diff --git a/lean/OAI/Geometry/NodalSets/Waves/GaussianFactorBound.lean b/lean/OAI/Geometry/NodalSets/Waves/GaussianFactorBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..e42f6ce52ba7159ab63737e90e26dadf2f1e213d --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/GaussianFactorBound.lean @@ -0,0 +1,64 @@ +import Mathlib.Analysis.Normed.Module.FiniteDimension +import OAI.Geometry.NodalSets.Waves.GaussianFactor + +namespace OAI + +namespace Yau.Probability +open MeasureTheory ProbabilityTheory +open scoped RealInnerProductSpace +noncomputable section +variable {ι : Type*} [Fintype ι] [DecidableEq ι] +variable {F : Type*} [NormedAddCommGroup F] [InnerProductSpace ℝ F] + [FiniteDimensional ℝ F] +local notation "E" => EuclideanSpace ℝ ι + +lemma covarianceFactor_norm_sq (T : F →L[ℝ] E) (v : E) : + ‖covarianceFactor T v‖^2 = ‖T.adjoint v‖^2 := by + simpa only [real_inner_self_eq_norm_sq] using covarianceFactor_inner T v v + +lemma covarianceFactor_lower (T : F →L[ℝ] E) (a : ℝ) (ha : 0 < a) + (h : ∀ v : E, a*‖v‖^2 ≤ ‖T.adjoint v‖^2) (v : E) : + Real.sqrt a * ‖v‖ ≤ ‖covarianceFactor T v‖ := by + have hs := Real.sq_sqrt ha.le + have hb := h v + rw [← covarianceFactor_norm_sq T v] at hb + nlinarith [sq_nonneg (Real.sqrt a*‖v‖-‖covarianceFactor T v‖), + norm_nonneg (covarianceFactor T v), norm_nonneg v, Real.sqrt_nonneg a] + +lemma covarianceFactor_bijective (T : F →L[ℝ] E) (a : ℝ) (ha : 0 < a) + (h : ∀ v : E, a*‖v‖^2 ≤ ‖T.adjoint v‖^2) : + Function.Bijective (covarianceFactor T) := by + have hi : Function.Injective (covarianceFactor T) := by + apply (covarianceFactor T).ker_eq_bot.mp + rw [LinearMap.ker_eq_bot'] + intro v hv + change covarianceFactor T v = 0 at hv + have hb := covarianceFactor_lower T a ha h v + rw [hv,norm_zero] at hb + have hz : ‖v‖ = 0 := by nlinarith [Real.sqrt_pos.mpr ha, norm_nonneg v] + exact norm_eq_zero.mp hz + exact ⟨hi, LinearMap.injective_iff_surjective.mp hi⟩ + +variable [MeasurableSpace F] [BorelSpace F] + +lemma exists_gaussian_factor_equiv (T : F →L[ℝ] E) (a : ℝ) (ha : 0 < a) + (h : ∀ v : E, a*‖v‖^2 ≤ ‖T.adjoint v‖^2) : + ∃ L : E ≃L[ℝ] E, + (stdGaussian F).map T = (stdGaussian E).map L ∧ + ‖L.symm.toContinuousLinearMap‖ ≤ (Real.sqrt a)⁻¹ := by + let L := (LinearEquiv.ofBijective (covarianceFactor T).toLinearMap + (covarianceFactor_bijective T a ha h)).toContinuousLinearEquiv + refine ⟨L, gaussian_covariance_factorization T, ?_⟩ + apply ContinuousLinearMap.opNorm_le_bound _ (by positivity) + intro v + have hb := covarianceFactor_lower T a ha h (L.symm v) + change Real.sqrt a*‖L.symm v‖ ≤ ‖L (L.symm v)‖ at hb + rw [L.apply_symm_apply] at hb + change ‖L.symm v‖ ≤ _ + rw [inv_mul_eq_div] + exact (le_div_iff₀ (Real.sqrt_pos.mpr ha)).mpr (by simpa [mul_comm] using hb) + +end +end Yau.Probability + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/GaussianFactorTwoSided.lean b/lean/OAI/Geometry/NodalSets/Waves/GaussianFactorTwoSided.lean new file mode 100644 index 0000000000000000000000000000000000000000..3f1098e3517edb4d97b3008c6e3f428f1210e718 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/GaussianFactorTwoSided.lean @@ -0,0 +1,40 @@ +import OAI.Geometry.NodalSets.Waves.GaussianFactorBound + +namespace OAI + +namespace Yau.Probability +open MeasureTheory ProbabilityTheory +noncomputable section +variable {ι : Type*} [Fintype ι] [DecidableEq ι] +variable {F : Type*} [NormedAddCommGroup F] [InnerProductSpace ℝ F] + [FiniteDimensional ℝ F] [MeasurableSpace F] [BorelSpace F] +local notation "E" => EuclideanSpace ℝ ι + +lemma exists_gaussian_factor_two_sided (T : F →L[ℝ] E) (a B : ℝ) + (ha : 0 < a) (hB : 0 ≤ B) + (hlo : ∀ v : E, a*‖v‖^2 ≤ ‖T.adjoint v‖^2) + (hhi : ∀ v : E, ‖T.adjoint v‖^2 ≤ B^2*‖v‖^2) : + ∃ L : E ≃L[ℝ] E, + (stdGaussian F).map T = (stdGaussian E).map L ∧ + ‖L.symm.toContinuousLinearMap‖ ≤ (Real.sqrt a)⁻¹ ∧ ‖L.toContinuousLinearMap‖ ≤ B := by + let L := (LinearEquiv.ofBijective (covarianceFactor T).toLinearMap + (covarianceFactor_bijective T a ha hlo)).toContinuousLinearEquiv + refine ⟨L,gaussian_covariance_factorization T,?_,?_⟩ + · apply ContinuousLinearMap.opNorm_le_bound _ (by positivity) + intro v + have hb := covarianceFactor_lower T a ha hlo (L.symm v) + change Real.sqrt a*‖L.symm v‖ ≤ ‖L (L.symm v)‖ at hb + rw [L.apply_symm_apply] at hb + rw [inv_mul_eq_div] + exact (le_div_iff₀ (Real.sqrt_pos.mpr ha)).mpr (by simpa [mul_comm] using hb) + · apply ContinuousLinearMap.opNorm_le_bound _ hB + intro v + change ‖covarianceFactor T v‖ ≤ B*‖v‖ + apply (sq_le_sq₀ (norm_nonneg _) (mul_nonneg hB (norm_nonneg _))).mp + rw [covarianceFactor_norm_sq,mul_pow] + exact hhi v + +end +end Yau.Probability + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/GaussianGradientSupremum.lean b/lean/OAI/Geometry/NodalSets/Waves/GaussianGradientSupremum.lean new file mode 100644 index 0000000000000000000000000000000000000000..1182c0ca12e5d0aa40a1ad6bd1a16d7ce015deeb --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/GaussianGradientSupremum.lean @@ -0,0 +1,99 @@ +import OAI.Geometry.NodalSets.Charts.MetricFrequencyBounds +import OAI.Geometry.NodalSets.Waves.GaussianCompactSections + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Yau.Probability MeasureTheory ProbabilityTheory +open scoped ContDiff +noncomputable section +variable {ι X : Type*} [Fintype ι] [TopologicalSpace X] + +def vectorMeanSection (M : Fin 4 → C(X,ℝ)) : C(X,EuclideanSpace ℝ (Fin 4)) := + ⟨fun x ↦ WithLp.toLp 2 (fun j ↦ M j x), + (PiLp.continuous_toLp 2 (fun _ : Fin 4 ↦ ℝ)).comp (continuous_pi (fun j ↦ (M j).continuous))⟩ + +def vectorCoeffSection (Z : Fin 4 → ι → C(X,ℂ)) (p : ι × Fin 2) : + C(X,EuclideanSpace ℝ (Fin 4)) := + vectorMeanSection (fun j ↦ if p.2 = 0 then + ⟨fun x ↦ (Z j p.1 x).re, Complex.continuous_re.comp (Z j p.1).continuous⟩ else + ⟨fun x ↦ -(Z j p.1 x).im, (Complex.continuous_im.comp (Z j p.1).continuous).neg⟩) + +def pairVectorSection (M : Fin 4 → C(X,ℝ)) (Z : Fin 4 → ι → C(X,ℂ)) + (a : ι × Fin 2 → ℝ) : C(X,EuclideanSpace ℝ (Fin 4)) := + vectorMeanSection M + ∑ p : ι × Fin 2, a p • vectorCoeffSection Z p + +lemma pairVectorSection_apply (M : Fin 4 → C(X,ℝ)) (Z : Fin 4 → ι → C(X,ℂ)) + (a : ι × Fin 2 → ℝ) (x : X) (j : Fin 4) : + pairVectorSection M Z a x j = M j x+pairLinearSum (fun i ↦ Z j i x) a := by + classical + simp only [pairVectorSection,ContinuousMap.add_apply,ContinuousMap.sum_apply, + ContinuousMap.smul_apply,PiLp.add_apply, + vectorMeanSection,ContinuousMap.coe_mk,pairLinearSum,vectorCoeffSection] + congr 1 + simp only [WithLp.ofLp_sum,WithLp.ofLp_smul,Finset.sum_apply,Pi.smul_apply] + apply Finset.sum_congr rfl + intro p _ + split_ifs <;> simp [smul_eq_mul,mul_comm] + +lemma pairVectorSection_continuous (M : Fin 4 → C(X,ℝ)) (Z : Fin 4 → ι → C(X,ℂ)) : + Continuous (pairVectorSection M Z) := by + unfold pairVectorSection + exact continuous_const.add (continuous_finsetSum _ (fun p _ ↦ + (continuous_apply p).smul continuous_const)) + +variable [CompactSpace X] + +lemma pairVectorSection_integrable (M : Fin 4 → C(X,ℝ)) (Z : Fin 4 → ι → C(X,ℂ)) : + Integrable (pairVectorSection M Z) gaussianPairs := by + let : IsProbabilityMeasure (gaussianPairs (ι := ι)) := by unfold gaussianPairs; infer_instance + unfold pairVectorSection + apply (integrable_const (μ := gaussianPairs (ι := ι)) (vectorMeanSection M)).add + apply integrable_finsetSum + intro p _ + exact (integrable_eval (μ := fun _ : ι × Fin 2 ↦ gaussianReal 0 1) + (i := p) IsGaussian.integrable_id).smul_const _ + +variable (V : ι → Coord → ℂ) (seed : Coord → ℝ) + (hV : ∀ i, ContDiff ℝ ∞ (V i)) (hs : ContDiff ℝ ∞ seed) + (K : Set Coord) [CompactSpace K] + +def gaussianGradientSection (a : ι × Fin 2 → ℝ) : C(K,EuclideanSpace ℝ (Fin 4)) := + pairVectorSection (fun j ↦ derivativeSection seed hs K 1 (fun _ ↦ Pi.single j 1)) + (fun j i ↦ derivativeSection (V i) (hV i) K 1 (fun _ ↦ Pi.single j 1)) a + +omit [CompactSpace K] in +lemma gaussianGradientSection_apply (a : ι × Fin 2 → ℝ) (x : K) (j : Fin 4) : + gaussianGradientSection V seed hV hs K a x j = + fderiv ℝ (fun z ↦ seed z+gaussianWaveField V a z) x (Pi.single j 1) := by + rw [gaussianGradientSection,pairVectorSection_apply] + have hh := seeded_gaussian_iterated_apply V seed hV hs a 1 x (fun _ ↦ Pi.single j 1) + simpa only [derivativeSection,ContinuousMap.coe_mk,iteratedFDeriv_one_apply] using hh.symm + +def gaussianGradientSup (a : ι × Fin 2 → ℝ) : ℝ := + ‖gaussianGradientSection V seed hV hs K a‖ + +lemma gaussianGradientSup_continuous : Continuous (gaussianGradientSup V seed hV hs K) := + (pairVectorSection_continuous _ _).norm + +lemma gaussianGradientSup_integrable : Integrable (gaussianGradientSup V seed hV hs K) gaussianPairs := + (pairVectorSection_integrable _ _).norm + +lemma gaussianGradientSup_le_iff (a : ι × Fin 2 → ℝ) {C : ℝ} (hC : 0 ≤ C) : + gaussianGradientSup V seed hV hs K a ≤ C ↔ + ∀ x ∈ K, sourceEuclideanNorm (fun j ↦ + fderiv ℝ (fun z ↦ seed z+gaussianWaveField V a z) x (Pi.single j 1)) ≤ C := by + unfold gaussianGradientSup + rw [ContinuousMap.norm_le _ hC] + have he (x : K) : ‖gaussianGradientSection V seed hV hs K a x‖ = + sourceEuclideanNorm (fun j ↦ + fderiv ℝ (fun z ↦ seed z+gaussianWaveField V a z) x (Pi.single j 1)) := by + rw [EuclideanSpace.norm_eq] + simp only [gaussianGradientSection_apply,Real.norm_eq_abs,sq_abs,sourceEuclideanNorm] + simp_rw [he] + exact Subtype.forall + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/GaussianIntervalBound.lean b/lean/OAI/Geometry/NodalSets/Waves/GaussianIntervalBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..f679ee78d7650af742d849a7416a372b500a691c --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/GaussianIntervalBound.lean @@ -0,0 +1,38 @@ +import Mathlib.MeasureTheory.Measure.Lebesgue.Basic +import Mathlib.Probability.Distributions.Gaussian.Real + +namespace OAI + +namespace Yau.Probability +open MeasureTheory ProbabilityTheory Set +open scoped ENNReal NNReal +noncomputable section + +lemma gaussian_pdf_upper_bound (mean x : ℝ) (v : ℝ≥0) : + gaussianPDFReal mean v x ≤ (Real.sqrt (2*Real.pi*v))⁻¹ := by + unfold gaussianPDFReal + apply mul_le_of_le_one_right (by positivity) + apply Real.exp_le_one_iff.mpr + exact div_nonpos_of_nonpos_of_nonneg (neg_nonpos.mpr (sq_nonneg _)) (by positivity) + +lemma gaussian_interval_bound (mean center radius : ℝ) (hr : 0 ≤ radius) + (v : ℝ≥0) (hv : v ≠ 0) : + gaussianReal mean v (Icc (center-radius) (center+radius)) ≤ + ENNReal.ofReal (2*radius/(Real.sqrt (2*Real.pi*v))) := by + rw [gaussianReal_apply mean hv] + calc + _ ≤ ∫⁻ _ in Icc (center-radius) (center+radius), + ENNReal.ofReal ((Real.sqrt (2*Real.pi*v))⁻¹) := by + apply lintegral_mono + intro x + exact ENNReal.ofReal_le_ofReal (gaussian_pdf_upper_bound mean x v) + _ = _ := by + rw [lintegral_const,Measure.restrict_apply_univ,Real.volume_Icc] + rw [← ENNReal.ofReal_mul' (by linarith only [hr])] + congr 1 + ring + +end +end Yau.Probability + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/GaussianJet.lean b/lean/OAI/Geometry/NodalSets/Waves/GaussianJet.lean new file mode 100644 index 0000000000000000000000000000000000000000..9acce191173759ce68e669ab919d18eaab7e3d52 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/GaussianJet.lean @@ -0,0 +1,91 @@ +import OAI.Geometry.NodalSets.Waves.FiniteGaussianMap +import OAI.Geometry.NodalSets.Waves.SeededGaussianJet + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Yau.Probability MeasureTheory ProbabilityTheory +open scoped RealInnerProductSpace +noncomputable section +variable {ι : Type*} [Fintype ι] + +abbrev JetSpace := EuclideanSpace ℝ (Fin 5) + +def normalizedRealJet (f : Coord → ℝ) (N S : ℝ) (x : Coord) : JetSpace := + WithLp.toLp 2 (Fin.cons (Real.exp (-N*S)*f x) + (fun i : Fin 4 ↦ Real.exp (-N*S)*N⁻¹*fderiv ℝ f x (Pi.single i 1))) + +lemma normalizedRealJet_inner (f : Coord → ℝ) (N S : ℝ) (x : Coord) (v : JetSpace) : + ⟪v,normalizedRealJet f N S x⟫ = + Real.exp (-N*S)*(v 0*f x+N⁻¹*fderiv ℝ f x (Fin.tail (WithLp.ofLp v))) := by + have he : Fin.tail (WithLp.ofLp v) = ∑ i : Fin 4, (v i.succ) • Pi.single i (1:ℝ) := by + ext j + simp [Pi.single_apply,Fin.tail] + rw [he,map_sum] + simp only [map_smul,smul_eq_mul] + simp only [normalizedRealJet,PiLp.inner_apply,RCLike.inner_apply,conj_trivial, + Fin.sum_univ_succ,Fin.cons_zero,Fin.cons_succ] + ring + +def jetWaveCoefficients (V : ι → Coord → ℂ) (N S : ℝ) (x : Coord) : Fin 5 → ι → ℂ := + Fin.cons (fun i ↦ dualWaveCoefficient N (V i) S x 1 0) + (fun j i ↦ dualWaveCoefficient N (V i) S x 0 (Pi.single j 1)) + +lemma gaussianWaveField_normalizedJet (V : ι → Coord → ℂ) (N S : ℝ) (x : Coord) + (hV : ∀ i, DifferentiableAt ℝ (V i) x) (a : ι × Fin 2 → ℝ) : + normalizedRealJet (gaussianWaveField V a) N S x = + pairJetMap (jetWaveCoefficients V N S x) (WithLp.toLp 2 a) := by + ext k + rw [pairJetMap_apply] + refine Fin.cases ?_ (fun j ↦ ?_) k + · simpa [normalizedRealJet,jetWaveCoefficients] using + gaussianWaveField_dual V a x 0 hV N S 1 + · simpa [normalizedRealJet,jetWaveCoefficients,mul_assoc] using + gaussianWaveField_dual V a x (Pi.single j 1) hV N S 0 + +lemma normalizedRealJet_add (f g : Coord → ℝ) (N S : ℝ) (x : Coord) + (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : + normalizedRealJet (fun y ↦ f y+g y) N S x = + normalizedRealJet f N S x+normalizedRealJet g N S x := by + ext k + refine Fin.cases ?_ (fun j ↦ ?_) k + · simp [normalizedRealJet,mul_add] + · simp [normalizedRealJet,fderiv_fun_add hf hg,mul_add] + +lemma seeded_gaussian_jet_eq (V : ι → Coord → ℂ) (seed : Coord → ℝ) + (N S : ℝ) (x : Coord) (hV : ∀ i, DifferentiableAt ℝ (V i) x) + (hs : DifferentiableAt ℝ seed x) (a : ι × Fin 2 → ℝ) : + normalizedRealJet (fun y ↦ seed y+gaussianWaveField V a y) N S x = + normalizedRealJet seed N S x+ + pairJetMap (jetWaveCoefficients V N S x) (WithLp.toLp 2 a) := by + rw [normalizedRealJet_add _ _ _ _ _ hs (gaussianWaveField_differentiable V a x hV), + gaussianWaveField_normalizedJet V N S x hV] + +lemma seeded_gaussian_jet_law (V : ι → Coord → ℂ) (seed : Coord → ℝ) + (N S : ℝ) (x : Coord) (hV : ∀ i, DifferentiableAt ℝ (V i) x) + (hs : DifferentiableAt ℝ seed x) : + (gaussianPairs (ι := ι)).map (fun a ↦ + normalizedRealJet (fun y ↦ seed y+gaussianWaveField V a y) N S x) = + (stdGaussian (EuclideanSpace ℝ (ι × Fin 2))).map + (fun z ↦ normalizedRealJet seed N S x+pairJetMap (jetWaveCoefficients V N S x) z) := by + simp_rw [seeded_gaussian_jet_eq V seed N S x hV hs] + rw [← map_pi_eq_stdGaussian, Measure.map_map (by fun_prop) (by fun_prop)] + rfl + +lemma seeded_gaussian_jet_variance (V : ι → Coord → ℂ) (seed : Coord → ℝ) + (N S : ℝ) (x : Coord) (hV : ∀ i, DifferentiableAt ℝ (V i) x) + (hs : DifferentiableAt ℝ seed x) (v : JetSpace) : + Var[fun a : ι × Fin 2 → ℝ ↦ + ⟪v,normalizedRealJet (fun y ↦ seed y+gaussianWaveField V a y) N S x⟫; gaussianPairs] = + ‖(pairJetMap (jetWaveCoefficients V N S x)).adjoint v‖^2 := by + let : IsProbabilityMeasure (gaussianPairs (ι := ι)) := by + unfold gaussianPairs + infer_instance + simp_rw [seeded_gaussian_jet_eq V seed N S x hV hs,inner_add_right] + rw [variance_const_add (by fun_prop)] + exact variance_gaussianMap_inner _ v + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/GaussianPairCovariance.lean b/lean/OAI/Geometry/NodalSets/Waves/GaussianPairCovariance.lean new file mode 100644 index 0000000000000000000000000000000000000000..043f9c104f7002f52d1b5ae11d96f6aacf2284ec --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/GaussianPairCovariance.lean @@ -0,0 +1,51 @@ +import Mathlib.Probability.Moments.Covariance +import OAI.Geometry.NodalSets.Waves.GaussianPairMoments + +namespace OAI + +namespace Yau.Geometry +open Yau.Probability MeasureTheory ProbabilityTheory +noncomputable section +variable {ι : Type*} [Fintype ι] + +lemma pairLinearSum_add (z w : ι → ℂ) : + pairLinearSum (fun i ↦ z i+w i) = fun a ↦ pairLinearSum z a+pairLinearSum w a := by + classical + funext a + simp only [pairLinearSum,Complex.add_re,Complex.add_im] + rw [← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro p _ + split_ifs <;> ring + +lemma covariance_pairLinearSum (z w : ι → ℂ) : + cov[pairLinearSum z,pairLinearSum w;gaussianPairs] = + ∑ i, ((z i).re*(w i).re+(z i).im*(w i).im) := by + let : IsProbabilityMeasure (gaussianPairs (ι := ι)) := by unfold gaussianPairs; infer_instance + have hz := pairLinearSum_memLp_two z + have hw := pairLinearSum_memLp_two w + have hh := variance_add hz hw + change Var[fun a ↦ pairLinearSum z a+pairLinearSum w a;gaussianPairs] = _ at hh + rw [← pairLinearSum_add] at hh + simp only [variance_pairLinearSum] at hh + have hn : ∑ i, ‖z i+w i‖^2 = (∑ i, ‖z i‖^2) + (∑ i, ‖w i‖^2) + + 2 * ∑ i, ((z i).re*(w i).re+(z i).im*(w i).im) := by + simp only [← Finset.sum_add_distrib,Finset.mul_sum,Complex.sq_norm, + Complex.normSq_apply,Complex.add_re,Complex.add_im] + apply Finset.sum_congr rfl + intro i _ + ring + linarith + +lemma pairLinearSum_covariance_integral (z w : ι → ℂ) : + ∫ a, pairLinearSum z a*pairLinearSum w a ∂gaussianPairs = + ∑ i, ((z i).re*(w i).re+(z i).im*(w i).im) := by + let : IsProbabilityMeasure (gaussianPairs (ι := ι)) := by unfold gaussianPairs; infer_instance + have hh := covariance_eq_sub (pairLinearSum_memLp_two z) (pairLinearSum_memLp_two w) + rw [pairLinearSum_mean,pairLinearSum_mean,mul_zero,sub_zero,covariance_pairLinearSum] at hh + exact hh.symm + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/GaussianPairMoments.lean b/lean/OAI/Geometry/NodalSets/Waves/GaussianPairMoments.lean new file mode 100644 index 0000000000000000000000000000000000000000..0965c355e3d482a220dc93839d9538fc20ed89a5 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/GaussianPairMoments.lean @@ -0,0 +1,50 @@ +import OAI.Geometry.NodalSets.Coefficients.GaussianCoefficientMSE + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Yau.Probability MeasureTheory ProbabilityTheory +noncomputable section +variable {ι : Type*} [Fintype ι] + +lemma pairLinearSum_memLp_two (z : ι → ℂ) : MemLp (pairLinearSum z) 2 gaussianPairs := by + classical + unfold pairLinearSum gaussianPairs + apply memLp_finsetSum + intro p _ + have hh : MemLp (id : ℝ → ℝ) 2 (gaussianReal 0 1) := IsGaussian.memLp_two_id + exact (hh.comp_measurePreserving (measurePreserving_eval (μ := fun _ : ι × Fin 2 ↦ gaussianReal 0 1) p)).const_mul _ + +lemma pairLinearSum_mean_square (z : ι → ℂ) (m : ℝ) : + ∫ coeff, (m+pairLinearSum z coeff)^2 ∂gaussianPairs = m^2+∑ i, ‖z i‖^2 := by + let : IsProbabilityMeasure (gaussianPairs (ι := ι)) := by unfold gaussianPairs; infer_instance + have hp := pairLinearSum_memLp_two z + have hh := variance_eq_sub ((memLp_const m).add hp) + have hm : ∫ coeff, m+pairLinearSum z coeff ∂gaussianPairs = m := by + rw [integral_add (integrable_const _) (pairLinearSum_integrable z),pairLinearSum_mean,integral_const] + simp + change Var[fun coeff ↦ m+pairLinearSum z coeff;gaussianPairs] = + (∫ coeff, (m+pairLinearSum z coeff)^2 ∂gaussianPairs) - + (∫ coeff, m+pairLinearSum z coeff ∂gaussianPairs)^2 at hh + rw [hm,variance_const_add hp.aestronglyMeasurable,variance_pairLinearSum] at hh + linarith + +lemma rescaledGaussianField_mse (V W : ι → Coord → ℂ) (S0 T0 S : Coord → ℝ) + (N s sigma : ℝ) (x v : Coord) : + ∫ coeff, (rescaledGaussianField V S0 T0 S N s sigma x coeff v - + gaussianWaveField W coeff v)^2 ∂gaussianPairs = + (rescaledSeed S0 T0 S N s sigma x v)^2 + + ∑ i, ‖normalizedRescaling (V i) S N s sigma x v-W i v‖^2 := by + have heq (coeff : ι × Fin 2 → ℝ) : + rescaledGaussianField V S0 T0 S N s sigma x coeff v - gaussianWaveField W coeff v = + rescaledSeed S0 T0 S N s sigma x v + + pairLinearSum (fun i ↦ normalizedRescaling (V i) S N s sigma x v-W i v) coeff := by + rw [rescaledGaussianField_decomposition,← gaussianWaveField_sub_pair] + ring + simp_rw [heq] + exact pairLinearSum_mean_square _ _ + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/GaussianPartialMeasurability.lean b/lean/OAI/Geometry/NodalSets/Waves/GaussianPartialMeasurability.lean new file mode 100644 index 0000000000000000000000000000000000000000..a88d8becdd95254fc1e0bf14a571d8eb4a83d68c --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/GaussianPartialMeasurability.lean @@ -0,0 +1,39 @@ +import OAI.Geometry.NodalSets.Elliptic.CoordinatePartialJets +import OAI.Geometry.NodalSets.Waves.GaussianDerivativeMoments + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Yau.Analysis Yau.Probability MeasureTheory +open scoped ContDiff +noncomputable section +variable {ι : Type*} [Fintype ι] + +lemma seeded_partial_joint_continuous (V : ι → Coord → ℂ) (seed : Coord → ℝ) + (hV : ∀ i, ContDiff ℝ ∞ (V i)) (hs : ContDiff ℝ ∞ seed) + (ds : List (Fin 4)) : + Continuous (fun z : (ι × Fin 2 → ℝ) × Coord ↦ + partialJet (fun x ↦ seed x+gaussianWaveField V z.1 x) ds z.2) := by + have hF (a : ι × Fin 2 → ℝ) := hs.add (gaussianWaveField_contDiff V a hV) + simp_rw [partialJet_eq_iterated _ (hF _),seeded_gaussian_iterated_apply V seed hV hs] + have horder : (ds.length : WithTop ℕ∞) ≤ ∞ := by + exact_mod_cast (show (ds.length:ℕ∞) ≤ ⊤ from le_top) + have hc {F : Type} [NormedAddCommGroup F] [NormedSpace ℝ F] + (f : Coord → F) (hf : ContDiff ℝ ∞ f) : + Continuous (fun z : (ι × Fin 2 → ℝ) × Coord ↦ + iteratedFDeriv ℝ ds.length f z.2 (partialDirs ds)) := + ((hf.continuous_iteratedFDeriv horder).comp continuous_snd).eval continuous_const + apply (hc seed hs).add + unfold pairLinearSum + apply continuous_finsetSum + intro p _ + apply Continuous.mul + · split_ifs + · exact Complex.continuous_re.comp (hc (V p.1) (hV p.1)) + · exact (Complex.continuous_im.comp (hc (V p.1) (hV p.1))).neg + · exact (continuous_apply p).comp continuous_fst + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/GaussianTailBound.lean b/lean/OAI/Geometry/NodalSets/Waves/GaussianTailBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..16cf2f7156c1c891d6c27399a200c24cb2c7ee59 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/GaussianTailBound.lean @@ -0,0 +1,56 @@ +import Mathlib.Analysis.SpecialFunctions.Exp +import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics +import Mathlib.Tactic.GCongr +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Positivity +import Mathlib.Tactic.Ring + +namespace OAI + +namespace Yau.Probability +open Filter +open scoped BigOperators Topology +noncomputable section + +lemma finite_gaussian_tail {ι : Type*} [Fintype ι] (d f : ι → ℝ) + {a R B r : ℝ} (ha : 0 ≤ a) (hR : 0 ≤ R) (hr : 0 ≤ r) + (hd : ∀ i, 0 ≤ d i) (hf : ∀ i, f i ≤ R*Real.exp (-2*a*(d i)^2)) + (hs : ∑ i, Real.exp (-a*(d i)^2) ≤ B) : + ∑ i ∈ Finset.univ.filter (fun i ↦ r < d i), f i ≤ + R*B*Real.exp (-a*r^2) := by + classical + calc + _ ≤ ∑ i ∈ Finset.univ.filter (fun i ↦ r < d i), + (R*Real.exp (-a*r^2))*Real.exp (-a*(d i)^2) := by + apply Finset.sum_le_sum + intro i hi + have hri := (Finset.mem_filter.mp hi).2.le + apply (hf i).trans + simp only [mul_assoc,← Real.exp_add] + gcongr + have hh := mul_le_mul_of_nonneg_left ((sq_le_sq₀ hr (hd i)).2 hri) ha + nlinarith + _ ≤ ∑ i, (R*Real.exp (-a*r^2))*Real.exp (-a*(d i)^2) := + Finset.sum_le_sum_of_subset_of_nonneg (Finset.filter_subset _ _) (fun _ _ _ ↦ by positivity) + _ = (R*Real.exp (-a*r^2))*∑ i, Real.exp (-a*(d i)^2) := by rw [Finset.mul_sum] + _ ≤ (R*Real.exp (-a*r^2))*B := mul_le_mul_of_nonneg_left hs (by positivity) + _ = _ := by ring + +lemma main_center_scale (N : ℝ) (hN : 0 < N) : + N*(N^(-5/12:ℝ))^2 = N^(1/6:ℝ) := by + calc + _ = N^(1:ℝ)*N^(-5/6:ℝ) := by + rw [← Real.rpow_mul_natCast hN.le] + norm_num + _ = _ := by rw [← Real.rpow_add hN]; norm_num + +lemma tendsto_main_center_tail (a : ℝ) (ha : 0 < a) : + Tendsto (fun n : ℕ ↦ Real.exp (-a*(n:ℝ)^(1/6:ℝ))) atTop (𝓝 0) := by + have hpow : Tendsto (fun n : ℕ ↦ (n:ℝ)^(1/6:ℝ)) atTop atTop := + (tendsto_rpow_atTop (by norm_num : (0:ℝ) < 1/6)).comp tendsto_natCast_atTop_atTop + exact Real.tendsto_exp_atBot.comp ((tendsto_const_mul_atBot_of_neg (neg_neg_of_pos ha)).mpr hpow) + +end +end Yau.Probability + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/GaussianUniformBall.lean b/lean/OAI/Geometry/NodalSets/Waves/GaussianUniformBall.lean new file mode 100644 index 0000000000000000000000000000000000000000..e2b8516fcc4f18fcb0a70acc01005b217711b379 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/GaussianUniformBall.lean @@ -0,0 +1,84 @@ +import Mathlib.MeasureTheory.Measure.OpenPos +import OAI.Geometry.NodalSets.Waves.EuclideanGaussianSmallBall + +namespace OAI + +namespace Yau.Probability +open MeasureTheory ProbabilityTheory Set Metric +open scoped ENNReal +noncomputable section +variable {ι : Type*} [Fintype ι] +local notation "E" => EuclideanSpace ℝ ι + +lemma stdGaussian_open_positive : (stdGaussian E).IsOpenPosMeasure := by + let : (gaussianReal 0 1).IsOpenPosMeasure := + (gaussianReal_absolutelyContinuous' 0 (by norm_num : (1:NNReal) ≠ 0)).isOpenPosMeasure + rw [← map_pi_eq_stdGaussian] + apply Continuous.isOpenPosMeasure_map (by fun_prop) + exact (WithLp.equiv 2 (ι → ℝ)).symm.surjective + +lemma uniform_gaussian_ball (R r : ℝ) (hr : 0 < r) : + ∃ p : ℝ≥0∞, 0 < p ∧ ∀ z : E, ‖z‖ ≤ R → p ≤ stdGaussian E (ball z r) := by + classical + let : (stdGaussian E).IsOpenPosMeasure := stdGaussian_open_positive + obtain ⟨s,hs⟩ := (isCompact_closedBall (0:E) R).elim_finite_subcover + (fun z : E ↦ ball z (r/2)) (fun _ ↦ isOpen_ball) (by + intro z hz + exact mem_iUnion.mpr ⟨z,mem_ball_self (by positivity)⟩) + let p : ℝ≥0∞ := s.inf (fun z ↦ stdGaussian E (ball z (r/2))) + have hp : 0 < p := by + dsimp only [p] + clear hs p + induction s using Finset.induction_on with + | empty => simp + | @insert z s hz ih => + rw [Finset.inf_insert] + exact lt_min (measure_ball_pos _ _ (by positivity)) ih + refine ⟨p,hp,?_⟩ + intro z hz + have hz' : z ∈ closedBall (0:E) R := by simpa only [mem_closedBall,dist_zero_right] using hz + obtain ⟨y,hy,hyz⟩ := mem_iUnion₂.mp (hs hz') + apply (Finset.inf_le hy).trans + apply measure_mono + intro x hx + have hx' : dist x y < r/2 := hx + have hz'' : dist z y < r/2 := hyz + have hh := dist_triangle x y z + rw [dist_comm y z] at hh + change dist x z < r + linarith + +lemma uniform_affine_gaussian_ball (A B M r : ℝ) (hA : 0 ≤ A) + (hB : 0 < B) (hM : 0 ≤ M) (hr : 0 < r) (target : E) : + ∃ p : ℝ≥0∞, 0 < p ∧ ∀ (L : E ≃L[ℝ] E) (mean : E), + ‖L.symm.toContinuousLinearMap‖ ≤ A → ‖L.toContinuousLinearMap‖ ≤ B → ‖mean‖ ≤ M → + p ≤ ((stdGaussian E).map (fun z ↦ mean+L z)) (ball target r) := by + let radius : NNReal := ⟨A*(‖target‖+M), mul_nonneg hA (add_nonneg (norm_nonneg _) hM)⟩ + obtain ⟨p,hp,huniform⟩ := uniform_gaussian_ball (ι := ι) radius (r/B) (div_pos hr hB) + refine ⟨p,hp,?_⟩ + intro L mean hLi hL hm + let center := L.symm (target-mean) + have hc : ‖center‖ ≤ A*(‖target‖+M) := by + exact (L.symm.toContinuousLinearMap.le_opNorm _).trans + (mul_le_mul hLi ((norm_sub_le _ _).trans (add_le_add le_rfl hm)) (norm_nonneg _) hA) + apply (huniform center hc).trans + rw [Measure.map_apply (by fun_prop) isOpen_ball.measurableSet] + apply measure_mono + intro z hz + change dist (mean+L z) target < r + rw [dist_eq_norm] + have he : mean+L z-target = L (z-center) := by + simp only [map_sub,center,L.apply_symm_apply] + abel + rw [he] + have hb := L.toContinuousLinearMap.le_opNorm (z-center) + have hh : ‖z-center‖ < r/B := by simpa only [mem_ball,dist_eq_norm] using hz + have hmul := (lt_div_iff₀ hB).mp hh + calc + _ ≤ B*‖z-center‖ := hb.trans (mul_le_mul_of_nonneg_right hL (norm_nonneg _)) + _ < r := by nlinarith + +end +end Yau.Probability + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/GaussianWaveJet.lean b/lean/OAI/Geometry/NodalSets/Waves/GaussianWaveJet.lean new file mode 100644 index 0000000000000000000000000000000000000000..e2f4b1d4ba125a2f21a24376682aea27c2146db2 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/GaussianWaveJet.lean @@ -0,0 +1,58 @@ +import OAI.Geometry.NodalSets.Coefficients.DualWaveCoefficient +import OAI.Geometry.NodalSets.Coefficients.GaussianCoefficientVariance +import OAI.Geometry.NodalSets.Elliptic.RealPhaseJet + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Yau.Probability Set Filter MeasureTheory ProbabilityTheory +open scoped ContDiff +noncomputable section +variable {ι : Type*} [Fintype ι] + +def gaussianCoefficient (a : ι × Fin 2 → ℝ) (i : ι) : ℂ := + (a (i,0):ℂ)+Complex.I*(a (i,1):ℂ) + +lemma pairLinearSum_eq_complex (z : ι → ℂ) (a : ι × Fin 2 → ℝ) : + pairLinearSum z a = ∑ i, (gaussianCoefficient a i*z i).re := by + classical + simp only [pairLinearSum,Fintype.sum_prod_type,Fin.sum_univ_succ,Fin.succ_ne_zero,Fin.succ_zero_eq_one,ite_true,ite_false,Fin.sum_univ_zero,add_zero, + gaussianCoefficient,Complex.mul_re,Complex.mul_im,Complex.add_re,Complex.add_im,Complex.ofReal_re, + Complex.ofReal_im,Complex.I_re,Complex.I_im,zero_mul,one_mul,mul_zero,zero_add] + apply Finset.sum_congr rfl + intro i _ + ring + +def gaussianWaveField (V : ι → Coord → ℂ) (a : ι × Fin 2 → ℝ) (x : Coord) : ℝ := + (∑ i, gaussianCoefficient a i*V i x).re + +lemma gaussianWaveField_dual (V : ι → Coord → ℂ) (a : ι × Fin 2 → ℝ) + (x v : Coord) (hV : ∀ i, DifferentiableAt ℝ (V i) x) (N S b : ℝ) : + Real.exp (-N*S)*(b*gaussianWaveField V a x+N⁻¹*fderiv ℝ (gaussianWaveField V a) x v) = + pairLinearSum (fun i ↦ dualWaveCoefficient N (V i) S x b v) a := by + classical + let W : Coord → ℂ := fun z ↦ ∑ i, gaussianCoefficient a i*V i z + have hW : DifferentiableAt ℝ W x := DifferentiableAt.fun_sum (fun i _ ↦ (hV i).const_mul _) + have hd : fderiv ℝ W x v = ∑ i, gaussianCoefficient a i*fderiv ℝ (V i) x v := by + dsimp only [W] + rw [fderiv_fun_sum (fun i _ ↦ (hV i).const_mul _)] + simp only [sum_apply] + apply Finset.sum_congr rfl + intro i _ + rw [((hV i).hasFDerivAt.const_mul (gaussianCoefficient a i)).fderiv] + rfl + have hr := realPart_fderiv W x hW v + change fderiv ℝ (gaussianWaveField V a) x v = _ at hr + rw [hr,hd,pairLinearSum_eq_complex] + simp only [gaussianWaveField,Complex.re_sum,Finset.mul_sum,← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro i _ + simp only [dualWaveCoefficient,Complex.mul_re,Complex.mul_im,Complex.add_re,Complex.add_im, + Complex.mul_im,Complex.ofReal_re,Complex.ofReal_im,← Complex.ofReal_inv, + zero_mul,sub_zero,add_zero] + ring + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticeActualDerivativeEnergy.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticeActualDerivativeEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..a02f9762bb2798a1cc418d6eacc5c1fa073f3f8c --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticeActualDerivativeEnergy.lean @@ -0,0 +1,74 @@ +import OAI.Geometry.NodalSets.Elliptic.RescaledDerivativeMoments +import OAI.Geometry.NodalSets.Waves.LatticePlaneWaveEnergy + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Set Filter +open scoped ContDiff Topology +noncomputable section + +lemma norm_square_le_two_sub_add {E : Type*} [SeminormedAddCommGroup E] (a b : E) : + ‖a‖^2 ≤ 2*‖a-b‖^2+2*‖b‖^2 := by + have h := norm_add_le (a-b) b + rw [sub_add_cancel] at h + have hsq := pow_le_pow_left₀ (norm_nonneg a) h 2 + nlinarith [sq_nonneg (‖a-b‖-‖b‖)] + +theorem lattice_actual_derivative_energy + (g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ) {H : Set Coord} + (hH : IsCompact H) (hg : ContinuousOn g H) + (hp : ∀ y ∈ H, ∀ v, v ≠ 0 → 0 < g y v v) (d : ℕ) : + ∃ C > 0, ∀ (w S : Coord → ℝ) (D U Q : Set Coord) (m J K k0 : ℕ) + (a : LocalCompactWaveData g w S D m J K k0) (_ : H ⊆ D) (hUD : U ⊆ D), + U ⊆ H → IsOpen U → Bornology.IsBounded U → IsCompact Q → Q ⊆ U → + ContDiff ℝ ∞ S → d ≤ k0 → + ∀ᶠ n : ℕ in atTop, ∃ hfin : Fintype (SourceGrid U n), letI := hfin + ∀ x ∈ Q, ∀ v : Coord, ‖v‖ ≤ 2 → ∀ k : ℕ, k ≤ d → + ∑ i : SourceGrid U n × Fin 3, + ‖iteratedFDeriv ℝ k (normalizedRescaling + (latticeWave a.cover a.beams hUD n i.1 i.2) S n (sourceSignScale g S x) + (a.latticeSigma hUD n x) x) v‖^2 ≤ C := by + obtain ⟨C,hC,hplane⟩ := lattice_planeWave_derivative_energy g hH hg hp d + refine ⟨2+2*C,by positivity,?_⟩ + intro w S D U Q m J K k0 a hHD hUD hUH hU hUb hQ hQU hS hd + filter_upwards [hplane w S D U Q m J K k0 a hHD hUD hUH hU hUb hQ hQU, + a.lattice_full_jet_approximation hUD hU hUb hQ hQU hS 2 (by norm_num) 1 (by norm_num), + a.estimates] with n hW he hest + obtain ⟨hfin,hW⟩ := hW + obtain ⟨hfin',he⟩ := he + have heq : hfin' = hfin := Subsingleton.elim _ _ + subst hfin' + let := hfin + refine ⟨hfin,?_⟩ + intro x hx v hv k hk + let W := a.latticePlaneWaveCoefficient hUD n x (sourceSignScale g S x) + let A := fun i : SourceGrid U n × Fin 3 ↦ normalizedRescaling + (latticeWave a.cover a.beams hUD n i.1 i.2) S n (sourceSignScale g S x) + (a.latticeSigma hUD n x) x + have hAs (i : SourceGrid U n × Fin 3) : ContDiff ℝ ∞ (A i) := + normalizedRescaling_smooth _ (hest (latticeFrame a.cover hUD n i.1,i.2)).1 _ _ _ _ _ + have hWs (i : SourceGrid U n × Fin 3) : ContDiff ℝ ∞ (W i) := + a.latticePlaneWaveCoefficient_smooth _ _ _ _ _ + have hk' : (k : WithTop ℕ∞) ≤ ∞ := by exact_mod_cast (show (k:ℕ∞) ≤ ⊤ from le_top) + have hid (i : SourceGrid U n × Fin 3) : + iteratedFDeriv ℝ k (fun z ↦ A i z-W i z) v = + iteratedFDeriv ℝ k (A i) v-iteratedFDeriv ℝ k (W i) v := by + change iteratedFDeriv ℝ k (A i-W i) v = _ + exact iteratedFDeriv_sub_apply ((hAs i).of_le hk').contDiffAt ((hWs i).of_le hk').contDiffAt + have herr := he x hx _ (show 1 ≤ sourceSignScale g S x by + linarith [a.source_sign_scale_lower x (hUD (hQU hx))]) v hv (⟨k,by omega⟩ : Fin (k0+1)) + change (∑ i, ‖iteratedFDeriv ℝ k (fun z ↦ A i z-W i z) v‖^2) ≤ 1 at herr + simp_rw [hid] at herr + have hw := hW x hx v k hk + have hb := Finset.sum_le_sum (fun i (_ : i ∈ (Finset.univ : Finset (SourceGrid U n × Fin 3))) ↦ + norm_square_le_two_sub_add (iteratedFDeriv ℝ k (A i) v) (iteratedFDeriv ℝ k (W i) v)) + simp only [Finset.sum_add_distrib,← Finset.mul_sum] at hb + change (∑ i, ‖iteratedFDeriv ℝ k (A i) v‖^2) ≤ _ + change (∑ i, ‖iteratedFDeriv ℝ k (W i) v‖^2) ≤ C at hw + linarith + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticeActualTwoPoint.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticeActualTwoPoint.lean new file mode 100644 index 0000000000000000000000000000000000000000..2fd10cc55eb5a767870101a901d05f34741b24b4 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticeActualTwoPoint.lean @@ -0,0 +1,73 @@ +import OAI.Geometry.NodalSets.Coefficients.TwoPointCoefficientEnergy +import OAI.Geometry.NodalSets.Waves.LatticeTwoPointGap + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Yau.Probability MeasureTheory ProbabilityTheory Set Filter +open scoped ContDiff Topology +noncomputable section + +theorem lattice_actual_two_point_energy + (g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ) {H : Set Coord} + (hH : IsCompact H) (hg : ContinuousOn g H) + (hp : ∀ y ∈ H, ∀ v, v ≠ 0 → 0 < g y v v) : + ∃ tau : ℝ, 0 < tau ∧ tau < 1/4 ∧ ∃ delta > 0, + ∀ (w S : Coord → ℝ) (D U Q : Set Coord) (m J K k0 : ℕ) + (a : LocalCompactWaveData g w S D m J K k0) (_ : H ⊆ D) (hUD : U ⊆ D), + U ⊆ H → IsOpen U → Bornology.IsBounded U → IsCompact Q → Q ⊆ U → ContDiff ℝ ∞ S → + ∀ᶠ n : ℕ in atTop, ∃ hfin : Fintype (SourceGrid U n), letI := hfin + ∀ x ∈ Q, ∃ j : Fin 4, ∀ u v : ℝ, + let coeff := fun i : SourceGrid U n × Fin 3 ↦ normalizedRescaling + (latticeWave a.cover a.beams hUD n i.1 i.2) S n + (sourceSignScale g S x) (a.latticeSigma hUD n x) x + delta*(u^2+v^2) ≤ ∑ i, + ‖(u:ℂ)*coeff i 0+(v:ℂ)*coeff i (tau • Pi.single j 1)‖^2 := by + obtain ⟨tau,ht,ht4,d,hd,hgaps⟩ := lattice_plane_wave_two_point_gap g hH hg hp + refine ⟨tau,ht,ht4,d/4,by positivity,?_⟩ + intro w S D U Q m J K k0 a hHD hUD hUH hU hUb hQ hQU hS + filter_upwards [hgaps w S D U Q m J K k0 a hHD hUD hUH hU hUb hQ hQU, + a.lattice_full_jet_approximation hUD hU hUb hQ hQU hS 2 (by norm_num) (d/8) (by positivity)] + with n hgap herr + obtain ⟨hfin,hgap⟩ := hgap + obtain ⟨hfin',herr⟩ := herr + have heq : hfin' = hfin := Subsingleton.elim _ _ + subst hfin' + let := hfin + refine ⟨hfin,?_⟩ + intro x hx + obtain ⟨j,hM,hM1,hW,hC0,hC⟩ := hgap x hx + dsimp only at hM hM1 hW hC0 hC + let W := a.latticePlaneWaveCoefficient hUD n x (sourceSignScale g S x) + let A := fun i : SourceGrid U n × Fin 3 ↦ normalizedRescaling + (latticeWave a.cover a.beams hUD n i.1 i.2) S n + (sourceSignScale g S x) (a.latticeSigma hUD n x) x + have hgap' : ∀ u v : ℝ, d*(u^2+v^2) ≤ + ∑ i, ‖(u:ℂ)*W i 0+(v:ℂ)*W i (tau • Pi.single j 1)‖^2 := by + intro u v + apply two_point_energy_of_gap _ _ _ _ d rfl _ rfl _ _ u v + · simpa only [gaussianWaveField_eq_pair] using hW + · have hm0 := variance_nonneg (fun coeff ↦ gaussianWaveField W coeff 0) gaussianPairs + rw [gaussianWaveField_eq_pair] at hm0 + simp only [gaussianWaveField_eq_pair] at hC0 + linarith + · simpa only [gaussianWaveField_eq_pair] using hC + have hs : 1 ≤ sourceSignScale g S x := by + linarith [a.source_sign_scale_lower x (hUD (hQU hx))] + have hnorm : ‖(tau • Pi.single j (1:ℝ) : Coord)‖ ≤ 2 := by + rw [norm_smul,Real.norm_eq_abs,abs_of_pos ht,Pi.norm_single,norm_one,mul_one] + linarith + have he0 := herr x hx _ hs 0 (by simp) (0 : Fin (k0+1)) + have he1 := herr x hx _ hs _ hnorm (0 : Fin (k0+1)) + simp +instances only [Fin.val_zero,norm_iteratedFDeriv_zero] at he0 he1 + refine ⟨j,?_⟩ + intro u v + have hh := two_point_energy_perturbation (fun i ↦ W i 0) (fun i ↦ W i (tau • Pi.single j 1)) + (fun i ↦ A i 0) (fun i ↦ A i (tau • Pi.single j 1)) d (d/8) he0 he1 hgap' u v + convert hh using 1 + ring + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticeCount.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticeCount.lean new file mode 100644 index 0000000000000000000000000000000000000000..de04820db1bbe10e0cd6d6483196c9643a642921 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticeCount.lean @@ -0,0 +1,75 @@ +import Mathlib.SetTheory.Cardinal.Finite +import OAI.Geometry.NodalSets.Waves.LatticeGeometry + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Set +noncomputable section + +lemma lattice_scale_eq_inv_sqrt (n : ℕ) : (n:ℝ)^(-1/2:ℝ) = (Real.sqrt n)⁻¹ := by + rw [show (-1/2:ℝ) = -(1/2) by ring,Real.rpow_neg,Real.sqrt_eq_rpow] + positivity + +theorem source_grid_card_bound {U : Set Coord} (hU : Bornology.IsBounded U) : + ∃ C > 0, ∀ n : ℕ, 0 < n → (Nat.card (SourceGrid U n) : ℝ) ≤ C*(n:ℝ)^2 := by + obtain ⟨B,hB,hbound⟩ := hU.exists_pos_norm_le + refine ⟨(2*B+3)^4,by positivity,?_⟩ + intro n hn + have hnR : (1:ℝ) ≤ n := by exact_mod_cast hn + have hs : 0 < Real.sqrt n := Real.sqrt_pos.mpr (by exact_mod_cast hn) + have hs1 : 1 ≤ Real.sqrt n := Real.one_le_sqrt.mpr hnR + have hs2 : (Real.sqrt n)^2 = (n:ℝ) := Real.sq_sqrt (by positivity) + let M : ℤ := ⌈B*Real.sqrt n⌉ + have hM0 : 0 ≤ M := Int.ceil_nonneg (by positivity) + have hMc : (M:ℝ) < B*Real.sqrt n+1 := Int.ceil_lt_add_one _ + have hcoords (z : SourceGrid U n) (i : Fin 4) : z.val i ∈ Icc (-M) M := by + have hi := (norm_le_pi_norm (scaledLatticePoint n z) i).trans (hbound _ z.property) + change |(n:ℝ)^(-1/2:ℝ)*(z.val i:ℝ)| ≤ B at hi + rw [lattice_scale_eq_inv_sqrt,abs_mul,abs_of_pos (inv_pos.mpr hs)] at hi + have hmul := mul_le_mul_of_nonneg_left hi hs.le + have hcancel : Real.sqrt n * ((Real.sqrt n)⁻¹ * |(z.val i:ℝ)|) = |(z.val i:ℝ)| := by + field_simp + rw [hcancel] at hmul + have ha : |(z.val i:ℝ)| ≤ (M:ℝ) := hmul.trans (by simpa [mul_comm] using Int.le_ceil (B*Real.sqrt n)) + have hp := abs_le.mp ha + exact ⟨by exact_mod_cast hp.1,by exact_mod_cast hp.2⟩ + let f : SourceGrid U n → (Fin 4 → Icc (-M) M) := fun z i ↦ ⟨z.val i,hcoords z i⟩ + have hfi : Function.Injective f := by + intro z w h + apply Subtype.ext + funext i + exact congrArg Subtype.val (congrFun h i) + have hc := Nat.card_le_card_of_injective f hfi + have hbox : Nat.card (Fin 4 → Icc (-M) M) = ((2*M+1).toNat)^4 := by + rw [Nat.card_fun] + simp [Nat.card_eq_fintype_card,Int.card_Icc,show M+1- -M = 2*M+1 by ring] + rw [hbox] at hc + have hcR : (Nat.card (SourceGrid U n):ℝ) ≤ ((2*M+1).toNat:ℝ)^4 := by exact_mod_cast hc + have hcast : ((2*M+1).toNat:ℝ) = 2*(M:ℝ)+1 := by + have hi : ((2*M+1).toNat:ℤ) = 2*M+1 := Int.toNat_of_nonneg (by omega) + exact_mod_cast hi + rw [hcast] at hcR + have hmnon : (0:ℝ) ≤ 2*(M:ℝ)+1 := by exact_mod_cast (show (0:ℤ) ≤ 2*M+1 by omega) + have hmle : 2*(M:ℝ)+1 ≤ (2*B+3)*Real.sqrt n := by nlinarith + have hpow := pow_le_pow_left₀ hmnon hmle 4 + calc + _ ≤ (2*(M:ℝ)+1)^4 := hcR + _ ≤ ((2*B+3)*Real.sqrt n)^4 := hpow + _ = (2*B+3)^4*(n:ℝ)^2 := by + rw [mul_pow,show (Real.sqrt n)^4 = ((Real.sqrt n)^2)^2 by ring,hs2] + +theorem source_coefficient_card_bound {U : Set Coord} (hU : Bornology.IsBounded U) : + ∃ C > 0, ∀ n : ℕ, 0 < n → (Nat.card (SourceGrid U n × Fin 3):ℝ) ≤ C*(n:ℝ)^2 := by + obtain ⟨C,hC,hb⟩ := source_grid_card_bound hU + refine ⟨3*C,by positivity,?_⟩ + intro n hn + have h := hb n hn + rw [Nat.card_prod] + norm_num + nlinarith + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticeCovariance.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticeCovariance.lean new file mode 100644 index 0000000000000000000000000000000000000000..559d451c1952648e30f2d0f05c597395bb7e5343 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticeCovariance.lean @@ -0,0 +1,60 @@ +import OAI.Geometry.NodalSets.Waves.LatticeCovariance2 +import OAI.Geometry.NodalSets.Waves.SeededGaussianJet + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Yau.Probability Set Filter MeasureTheory ProbabilityTheory +open scoped ContDiff Topology +noncomputable section +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} +variable {D U : Set Coord} {m J K k0 : ℕ} +namespace LocalCompactWaveData +variable (a : LocalCompactWaveData g w S D m J K k0) + +def latticeSeededRandomDual (hUD : U ⊆ D) (n : ℕ) (hfin : Fintype (SourceGrid U n)) + (seed : Coord → ℝ) (x : Coord) (b : ℝ) (v : Coord) + (coeff : ((SourceGrid U n × Fin 3) × Fin 2) → ℝ) : ℝ := + letI := hfin + let V := fun i : SourceGrid U n × Fin 3 ↦ latticeWave a.cover a.beams hUD n i.1 i.2 + Real.exp (-(n:ℝ)*S x)*(b*(seed x+gaussianWaveField V coeff x)+ + (n:ℝ)⁻¹*fderiv ℝ (fun z ↦ seed z+gaussianWaveField V coeff z) x v) + +lemma variance_latticeSeededRandomDual (hUD : U ⊆ D) (n : ℕ) (hfin : Fintype (SourceGrid U n)) + (seed : Coord → ℝ) (x : Coord) (hseed : DifferentiableAt ℝ seed x) + (hV : ∀ z j, DifferentiableAt ℝ (latticeWave a.cover a.beams hUD n z j) x) + (b : ℝ) (v : Coord) : + letI := hfin + Var[a.latticeSeededRandomDual hUD n hfin seed x b v; gaussianPairs] = + a.latticeEnergy hUD n hfin x b v := by + let := hfin + exact seeded_gaussian_dual_variance + (fun i : SourceGrid U n × Fin 3 ↦ latticeWave a.cover a.beams hUD n i.1 i.2) + seed x v (fun i ↦ hV i.1 i.2) hseed (n:ℝ) (S x) b + +theorem actual_lattice_covariance_lower_bound (hUD : U ⊆ D) (hU : IsOpen U) + (hUb : Bornology.IsBounded U) {Q : Set Coord} (hQ : IsCompact Q) (hQU : Q ⊆ U) : + ∃ c > 0, ∀ᶠ n : ℕ in atTop, ∃ hfin : Fintype (SourceGrid U n), + letI := hfin + ∀ (seed : Coord → ℝ) (x : Coord), x ∈ Q → DifferentiableAt ℝ seed x → ∀ (b : ℝ) (v : Coord), + c/(n:ℝ)*(b^2+∑ i : Fin 4, (v i)^2) ≤ + Var[a.latticeSeededRandomDual hUD n hfin seed x b v; gaussianPairs] := by + obtain ⟨c,hc,hb⟩ := a.euclidean_lattice_covariance_lower_bound hUD hU hUb hQ hQU + refine ⟨c,hc,?_⟩ + filter_upwards [hb,lattice_wave_estimates a.cover a.beams hUD] with n hn hs + obtain ⟨hfin,hbound⟩ := hn + let := hfin + refine ⟨hfin,?_⟩ + intro seed x hx hseed b v + have hV : ∀ z j, DifferentiableAt ℝ (latticeWave a.cover a.beams hUD n z j) x := + fun z j ↦ ((hs z j).1.differentiable (by simp)).differentiableAt + rw [a.variance_latticeSeededRandomDual hUD n hfin seed x hseed hV] + have hb := hbound x hx b v + rw [a.variance_latticeRandomDual] at hb + exact hb + +end LocalCompactWaveData +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticeCovariance2.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticeCovariance2.lean new file mode 100644 index 0000000000000000000000000000000000000000..ec59619c75bb6af24c9c66163356d8b93e7fe11a --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticeCovariance2.lean @@ -0,0 +1,70 @@ +import OAI.Geometry.NodalSets.Coefficients.GaussianCoefficientVariance +import OAI.Geometry.NodalSets.Waves.LatticeEnergyLowerBound + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Yau.Probability Set Filter MeasureTheory ProbabilityTheory +open scoped ContDiff Topology +noncomputable section +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} +variable {D U : Set Coord} {m J K k0 : ℕ} +namespace LocalCompactWaveData +variable (a : LocalCompactWaveData g w S D m J K k0) + +def latticeRandomDual (hUD : U ⊆ D) (n : ℕ) (hfin : Fintype (SourceGrid U n)) + (x : Coord) (b : ℝ) (v : Coord) : (((SourceGrid U n × Fin 3) × Fin 2) → ℝ) → ℝ := + letI := hfin + pairLinearSum (fun i : SourceGrid U n × Fin 3 ↦ + dualWaveCoefficient n (latticeWave a.cover a.beams hUD n i.1 i.2) (S x) x b v) + +lemma variance_latticeRandomDual (hUD : U ⊆ D) (n : ℕ) (hfin : Fintype (SourceGrid U n)) + (x : Coord) (b : ℝ) (v : Coord) : + letI := hfin + Var[a.latticeRandomDual hUD n hfin x b v; gaussianPairs] = a.latticeEnergy hUD n hfin x b v := by + let := hfin + exact variance_pairLinearSum _ + +theorem lattice_covariance_lower_bound (hUD : U ⊆ D) (hU : IsOpen U) (hUb : Bornology.IsBounded U) + {Q : Set Coord} (hQ : IsCompact Q) (hQU : Q ⊆ U) : + ∃ c > 0, ∀ᶠ n : ℕ in atTop, ∃ hfin : Fintype (SourceGrid U n), ∀ x ∈ Q, ∀ b v, + letI := hfin + c/(n:ℝ)*(b^2+‖v‖^2) ≤ Var[a.latticeRandomDual hUD n hfin x b v; gaussianPairs] := by + obtain ⟨c,hc,hb⟩ := a.lattice_energy_lower_bound hUD hU hUb hQ hQU + refine ⟨c,hc,?_⟩ + filter_upwards [hb] with n hn + obtain ⟨hfin,hbound⟩ := hn + let := hfin + refine ⟨hfin,?_⟩ + intro x hx b v + rw [a.variance_latticeRandomDual] + exact hbound x hx b v + +theorem euclidean_lattice_covariance_lower_bound (hUD : U ⊆ D) (hU : IsOpen U) (hUb : Bornology.IsBounded U) + {Q : Set Coord} (hQ : IsCompact Q) (hQU : Q ⊆ U) : + ∃ c > 0, ∀ᶠ n : ℕ in atTop, ∃ hfin : Fintype (SourceGrid U n), ∀ x ∈ Q, ∀ b v, + letI := hfin + c/(n:ℝ)*(b^2+∑ i : Fin 4, (v i)^2) ≤ Var[a.latticeRandomDual hUD n hfin x b v; gaussianPairs] := by + obtain ⟨c,hc,hb⟩ := a.lattice_covariance_lower_bound hUD hU hUb hQ hQU + refine ⟨c/4,by positivity,?_⟩ + filter_upwards [hb,eventually_ge_atTop (1:ℕ)] with n hn hn1 + obtain ⟨hfin,hbound⟩ := hn + let := hfin + refine ⟨hfin,?_⟩ + intro x hx b v + apply le_trans _ (hbound x hx b v) + have hcoord (i : Fin 4) : (v i)^2 ≤ ‖v‖^2 := by + have hh := norm_le_pi_norm v i + change |v i| ≤ ‖v‖ at hh + nlinarith [sq_abs (v i),norm_nonneg v,abs_nonneg (v i)] + have hsum := Finset.sum_le_sum (fun i (_ : i ∈ (Finset.univ : Finset (Fin 4))) ↦ hcoord i) + norm_num at hsum + have hh : b^2+∑ i : Fin 4, (v i)^2 ≤ 4*(b^2+‖v‖^2) := by nlinarith [sq_nonneg b] + have hh' := mul_le_mul_of_nonneg_left hh (by positivity : 0 ≤ c/(4*(n:ℝ))) + convert hh' using 1 <;> ring + +end LocalCompactWaveData +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticeDerivativeMoments.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticeDerivativeMoments.lean new file mode 100644 index 0000000000000000000000000000000000000000..238c3b621e7afa72648ef4ba570cbcc8863fe472 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticeDerivativeMoments.lean @@ -0,0 +1,63 @@ +import OAI.Geometry.NodalSets.Elliptic.SignScaleSeed +import OAI.Geometry.NodalSets.Waves.LatticeActualDerivativeEnergy + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Yau.Probability Set Filter MeasureTheory ProbabilityTheory +open scoped ContDiff Topology +noncomputable section + +theorem lattice_derivative_second_moments + (g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ) {H : Set Coord} + (hH : IsCompact H) (hg : ContinuousOn g H) + (hp : ∀ y ∈ H, ∀ v, v ≠ 0 → 0 < g y v v) (d : ℕ) : + ∃ C > 0, ∀ (w S S0 T0 : Coord → ℝ) (D U Q : Set Coord) (m J K k0 : ℕ) + (a : LocalCompactWaveData g w S D m J K k0) (_ : H ⊆ D) (hUD : U ⊆ D), + U ⊆ H → IsOpen U → Bornology.IsBounded U → IsCompact Q → Q ⊆ U → + ContDiff ℝ ∞ S → ContDiff ℝ ∞ S0 → ContDiff ℝ ∞ T0 → d ≤ k0 → + ∀ gamma > 0, (∀ x ∈ Q, S0 x+gamma ≤ S x) → + ∀ᶠ n : ℕ in atTop, ∃ hfin : Fintype (SourceGrid U n), letI := hfin + ∀ x ∈ Q, ∀ v : Coord, sourceEuclideanNorm v ≤ 2 → ∀ k : ℕ, k ≤ d → + ∀ dirs : Fin k → Coord, ‖dirs‖ ≤ 1 → + let F := rescaledGaussianField + (fun i : SourceGrid U n × Fin 3 ↦ latticeWave a.cover a.beams hUD n i.1 i.2) + S0 T0 S n (sourceSignScale g S x) (a.latticeSigma hUD n x) x + MemLp (fun coeff ↦ iteratedFDeriv ℝ k (F coeff) v dirs) 2 gaussianPairs ∧ + (∫ coeff, (iteratedFDeriv ℝ k (F coeff) v dirs)^2 ∂gaussianPairs) ≤ C := by + obtain ⟨C,hC,henergy⟩ := lattice_actual_derivative_energy g hH hg hp d + refine ⟨1+C,by positivity,?_⟩ + intro w S S0 T0 D U Q m J K k0 a hHD hUD hUH hU hUb hQ hQU hS hS0 hT0 hd gamma hgamma hgap + filter_upwards [henergy w S D U Q m J K k0 a hHD hUD hUH hU hUb hQ hQU hS hd, + a.sign_scale_seed_decay hUD hU hUb hQ hQU hS S0 T0 hS0 hT0 gamma hgamma hgap d 1 (by norm_num), + a.estimates] with n he hs hest + obtain ⟨hfin,he⟩ := he + obtain ⟨hfin',hs⟩ := hs + have heq : hfin' = hfin := Subsingleton.elim _ _ + subst hfin' + let := hfin + refine ⟨hfin,?_⟩ + intro x hx v hv k hk dirs hdirs + let V := fun i : SourceGrid U n × Fin 3 ↦ latticeWave a.cover a.beams hUD n i.1 i.2 + have hV (i : SourceGrid U n × Fin 3) : ContDiff ℝ ∞ (V i) := + (hest (latticeFrame a.cover hUD n i.1,i.2)).1 + refine ⟨rescaledGaussianField_derivative_memLp V hV _ _ _ hS0 hT0 _ _ _ _ _ _ _,?_⟩ + rw [rescaledGaussianField_derivative_moment V hV _ _ _ hS0 hT0] + have hseed := hs x hx v hv (⟨k,by omega⟩ : Fin (d+1)) + have hseed' := (iteratedFDeriv ℝ k + (rescaledSeed S0 T0 S n (sourceSignScale g S x) (a.latticeSigma hUD n x) x) v).unit_le_opNorm hdirs + have hmean := pow_le_pow_left₀ (norm_nonneg _) (hseed'.trans hseed) 2 + simp only [Real.norm_eq_abs,sq_abs,one_pow] at hmean + have hsum := Finset.sum_le_sum (fun i (_ : i ∈ (Finset.univ : Finset (SourceGrid U n × Fin 3))) ↦ + pow_le_pow_left₀ (norm_nonneg _) + ((iteratedFDeriv ℝ k (normalizedRescaling (V i) S n (sourceSignScale g S x) + (a.latticeSigma hUD n x) x) v).unit_le_opNorm hdirs) 2) + have hbound := he x hx v ((norm_le_sourceEuclideanNorm v).trans hv) k hk + change (∑ i, ‖iteratedFDeriv ℝ k (normalizedRescaling (V i) S n (sourceSignScale g S x) + (a.latticeSigma hUD n x) x) v‖^2) ≤ C at hbound + linarith + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticeDerivativeTail.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticeDerivativeTail.lean new file mode 100644 index 0000000000000000000000000000000000000000..e915f89b95002c1f7e39c1bb58dfdf301f1dd4f8 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticeDerivativeTail.lean @@ -0,0 +1,75 @@ +import OAI.Geometry.NodalSets.Waves.GaussianTailBound +import OAI.Geometry.NodalSets.Waves.LatticeVarianceUpper + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Yau.Probability Set Filter +open scoped ContDiff Topology +noncomputable section +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} +variable {D U : Set Coord} {m J K k0 : ℕ} +namespace LocalCompactWaveData +variable (a : LocalCompactWaveData g w S D m J K k0) + +theorem lattice_derivative_tail_bound (hUD : U ⊆ D) : + ∃ C > 0, ∀ᶠ n : ℕ in atTop, ∀ [Fintype (SourceGrid U n)], ∀ x : Coord, + ∀ k : Fin (k0+1), ∀ r : ℝ, 0 ≤ r → + ∑ i ∈ Finset.univ.filter (fun i : SourceGrid U n × Fin 3 ↦ + r < sourceEuclideanNorm (x-scaledLatticePoint n i.1)), + ‖iteratedFDeriv ℝ k.val (latticeWave a.cover a.beams hUD n i.1 i.2) x‖^2 ≤ + C*(n:ℝ)^(2*k.val)*Real.exp (2*(n:ℝ)*S x)*Real.exp (-a.beams.c*(n:ℝ)*r^2) := by + classical + obtain ⟨B,hB,hgauss⟩ := source_lattice_gaussian_sum a.beams.c_pos + refine ⟨3*a.beams.Cw^2*B,by have := a.beams.Cw_pos; positivity,?_⟩ + filter_upwards [a.estimates,eventually_gt_atTop (0:ℕ)] with n hn hnpos + intro hfin x k r hr + let d : SourceGrid U n × Fin 3 → ℝ := fun i ↦ sourceEuclideanNorm (x-scaledLatticePoint n i.1) + let R := a.beams.Cw^2*(n:ℝ)^(2*k.val)*Real.exp (2*(n:ℝ)*S x) + have hb (i : SourceGrid U n × Fin 3) : + ‖iteratedFDeriv ℝ k.val (latticeWave a.cover a.beams hUD n i.1 i.2) x‖^2 ≤ + R*Real.exp (-2*(a.beams.c*(n:ℝ))*(d i)^2) := by + have h := ((hn (latticeFrame a.cover hUD n i.1,i.2)).2.2.2.2 x).1 k + simp only [latticeFrame_center] at h + change ‖iteratedFDeriv ℝ k.val (latticeWave a.cover a.beams hUD n i.1 i.2) x‖ ≤ _ at h + refine (pow_le_pow_left₀ (norm_nonneg _) h 2).trans_eq ?_ + dsimp [R,d] + rw [mul_pow,mul_pow,← Real.exp_nat_mul,← pow_mul] + simp only [mul_assoc,← Real.exp_add] + congr 2 <;> ring_nf + have hg : ∑ i : SourceGrid U n × Fin 3, Real.exp (-(a.beams.c*(n:ℝ))*(d i)^2) ≤ 3*B := by + dsimp [d] + rw [Fintype.sum_prod_type] + simp only [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul] + rw [← Finset.mul_sum] + norm_num only [Nat.cast_ofNat] + apply mul_le_mul_of_nonneg_left _ (by norm_num) + simpa only [neg_mul] using hgauss U n hnpos x + have hh := finite_gaussian_tail d + (fun i ↦ ‖iteratedFDeriv ℝ k.val (latticeWave a.cover a.beams hUD n i.1 i.2) x‖^2) + (by have := a.beams.c_pos; positivity : 0 ≤ a.beams.c*(n:ℝ)) + (by dsimp [R]; positivity : 0 ≤ R) hr (fun i ↦ sourceEuclideanNorm_nonneg _) hb hg + convert hh using 1 + dsimp [R] + simp only [neg_mul] + ring + +theorem lattice_nonmain_derivative_bound (hUD : U ⊆ D) : + ∃ C > 0, ∀ᶠ n : ℕ in atTop, ∀ [Fintype (SourceGrid U n)], ∀ x : Coord, + ∀ k : Fin (k0+1), + ∑ i ∈ Finset.univ.filter (fun i : SourceGrid U n × Fin 3 ↦ + (n:ℝ)^(-5/12:ℝ) < sourceEuclideanNorm (x-scaledLatticePoint n i.1)), + ‖iteratedFDeriv ℝ k.val (latticeWave a.cover a.beams hUD n i.1 i.2) x‖^2 ≤ + C*(n:ℝ)^(2*k.val)*Real.exp (2*(n:ℝ)*S x)*Real.exp (-a.beams.c*(n:ℝ)^(1/6:ℝ)) := by + obtain ⟨C,hC,hb⟩ := a.lattice_derivative_tail_bound hUD + refine ⟨C,hC,?_⟩ + filter_upwards [hb,eventually_gt_atTop (0:ℕ)] with n hn hnpos + intro hfin x k + have h := hn x k ((n:ℝ)^(-5/12:ℝ)) (by positivity) + rwa [mul_assoc (-a.beams.c),main_center_scale _ (by exact_mod_cast hnpos)] at h + +end LocalCompactWaveData +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticeDirectionalCenters.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticeDirectionalCenters.lean new file mode 100644 index 0000000000000000000000000000000000000000..fbe451589ca752930a67066d721152c1929c52a5 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticeDirectionalCenters.lean @@ -0,0 +1,49 @@ +import OAI.Geometry.NodalSets.Elliptic.HalfScaleLemmas +import OAI.Geometry.NodalSets.Waves.LatticeGeometry + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Set Metric Filter +noncomputable section + +def unitDirection (v : Coord) : Coord := (‖v‖⁻¹:ℝ) • v + +lemma norm_unitDirection_le (v : Coord) : ‖unitDirection v‖ ≤ 1 := by + by_cases hv : v = 0 + · simp [unitDirection,hv] + have hn : 0 < ‖v‖ := norm_pos_iff.mpr hv + simp only [unitDirection,norm_smul,Real.norm_eq_abs,abs_of_pos (inv_pos.mpr hn),inv_mul_cancel₀ hn.ne'] + exact le_rfl + +def directionalLatticeIndex (n : ℕ) (x : Coord) (K : ℝ) (v : Coord) : Fin 4 → ℤ := + roundedLatticeIndex n (x+(K*(n:ℝ)^(-1/2:ℝ)) • unitDirection v) + +lemma directional_rounding_error {n : ℕ} (hn : 0 < n) (x : Coord) (K : ℝ) (v : Coord) : + ‖scaledLatticePoint n (directionalLatticeIndex n x K v)- + (x+(K*(n:ℝ)^(-1/2:ℝ)) • unitDirection v)‖ ≤ 2*(n:ℝ)^(-1/2:ℝ) := + (norm_le_sourceEuclideanNorm _).trans (rounded_lattice_distance hn _) + +lemma directional_center_distance {n : ℕ} (hn : 0 < n) (x : Coord) (K : ℝ) (hK : 0 ≤ K) (v : Coord) : + ‖scaledLatticePoint n (directionalLatticeIndex n x K v)-x‖ ≤ (K+2)*(n:ℝ)^(-1/2:ℝ) := by + let z := x+(K*(n:ℝ)^(-1/2:ℝ)) • unitDirection v + have h := norm_sub_le_norm_sub_add_norm_sub (scaledLatticePoint n (directionalLatticeIndex n x K v)) z x + have hz : ‖z-x‖ ≤ K*(n:ℝ)^(-1/2:ℝ) := by + simp only [z,add_sub_cancel_left,norm_smul,Real.norm_eq_abs, + abs_of_nonneg (mul_nonneg hK (lattice_scale_pos hn).le)] + exact (mul_le_mul_of_nonneg_left (norm_unitDirection_le v) + (mul_nonneg hK (lattice_scale_pos hn).le)).trans_eq (mul_one _) + have hr := directional_rounding_error hn x K v + dsimp [z] at h hz + nlinarith + +lemma directional_center_mem {U : Set Coord} {n : ℕ} (hn : 0 < n) + (x : Coord) (K : ℝ) (hK : 0 ≤ K) (v : Coord) + (hball : closedBall x ((K+2)*(n:ℝ)^(-1/2:ℝ)) ⊆ U) : + scaledLatticePoint n (directionalLatticeIndex n x K v) ∈ U := + hball (by simpa only [mem_closedBall,dist_eq_norm] using directional_center_distance hn x K hK v) + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticeEnergyLowerBound.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticeEnergyLowerBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..3eafedeef13ced785dac8882106eeeccff05a5d4 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticeEnergyLowerBound.lean @@ -0,0 +1,152 @@ +import OAI.Geometry.NodalSets.Elliptic.FiniteJetEnergy +import OAI.Geometry.NodalSets.Waves.LatticeDirectionalCenters +import OAI.Geometry.NodalSets.Waves.LocalCovarianceGeometry + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Set Metric Filter +open scoped ContDiff Topology +noncomputable section + +lemma compact_inner_ball {Q U : Set Coord} (hQ : IsCompact Q) (hU : IsOpen U) (hQU : Q ⊆ U) : + ∃ r > 0, ∀ x ∈ Q, closedBall x r ⊆ U := by + let : CompactSpace Q := isCompact_iff_compactSpace.mp hQ + obtain ⟨r,hr,hri⟩ := compact_family_common_radius isCompact_univ + (fun z : Q × Coord ↦ (z.1:Coord)+z.2) + ((continuous_subtype_val.comp continuous_fst).add continuous_snd) + hU (fun t _ ↦ by simpa only [add_zero] using hQU t.property) + refine ⟨r/2,by positivity,?_⟩ + intro x hx z hz + have hn : ‖z-x‖ ≤ r/2 := by simpa only [mem_closedBall,dist_eq_norm] using hz + have h := hri ⟨x,hx⟩ (mem_univ _) (z-x) (by linarith) + simpa using h + +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} +variable {D U : Set Coord} {m J K k0 : ℕ} +namespace LocalCompactWaveData +variable (a : LocalCompactWaveData g w S D m J K k0) + +def latticeEnergy (hUD : U ⊆ D) (n : ℕ) (hfin : Fintype (SourceGrid U n)) + (x : Coord) (b : ℝ) (v : Coord) : ℝ := + letI := hfin + ∑ i : SourceGrid U n × Fin 3, + ‖dualWaveCoefficient n (latticeWave a.cover a.beams hUD n i.1 i.2) (S x) x b v‖^2 + +theorem lattice_energy_lower_bound (hUD : U ⊆ D) (hU : IsOpen U) (hUb : Bornology.IsBounded U) + {Q : Set Coord} (hQ : IsCompact Q) (hQU : Q ⊆ U) : + ∃ c > 0, ∀ᶠ n : ℕ in atTop, ∃ hfin : Fintype (SourceGrid U n), ∀ x ∈ Q, ∀ b v, + c/(n:ℝ)*(b^2+‖v‖^2) ≤ a.latticeEnergy hUD n hfin x b v := by + obtain ⟨mu,hmu,B,hB,hgeom⟩ := a.original_covariance_geometry + obtain ⟨e,he,E,hE,heta⟩ := a.lattice_eta_bounds hUD + let R : ℝ := (2*B+2)/mu + have hR : 0 < R := by dsimp [R]; positivity + let L := R+2 + have hL : 0 < L := by dsimp [L]; linarith + have hlarge : 2*B+1 ≤ R*mu := by dsimp [R]; rw [div_mul_cancel₀ _ hmu.ne']; linarith + obtain ⟨Ca,hCa,Cr,hCr,Ci,hCi,s,hs,C,hC,hjets⟩ := a.lattice_logarithmic_jet_estimates hUD L hL + let F := B+E*B*L+Cr + have hF : 0 ≤ F := by dsimp [F]; positivity + let kappa := e^2/(2*(e+F+1)^2) + have hkappa : 0 < kappa := by dsimp [kappa]; positivity + obtain ⟨r,hr,hinner⟩ := compact_inner_ball hQ hU hQU + refine ⟨s^2*kappa/2,by positivity,?_⟩ + filter_upwards [hjets,eventually_nat_frequency (half_scale_eventually L 1 r hr), + eventually_nat_frequency (half_scale_eventually (2*Cr) 1 e he)] with n hj hn hsmall + have hn1 : 1 ≤ n := by exact_mod_cast hn.1 + have hnpos : 0 < n := by omega + have hN : 0 < (n:ℝ) := by exact_mod_cast hnpos + let h := (n:ℝ)^(-1/2:ℝ) + have hh : 0 < h := lattice_scale_pos hnpos + have hh1 : h ≤ 1 := Real.rpow_le_one_of_one_le_of_nonpos hn.1 (by norm_num) + let : Finite (SourceGrid U n) := finite_source_grid hUb hnpos + let hfin : Fintype (SourceGrid U n) := Fintype.ofFinite _ + refine ⟨hfin,?_⟩ + intro x hx b v + have hxD := hUD (hQU hx) + have hball : closedBall x (L*h) ⊆ U := (closedBall_subset_closedBall hn.2.1).trans (hinner x hx) + let z (v : Coord) : SourceGrid U n := ⟨directionalLatticeIndex n x R v, + directional_center_mem hnpos x R hR.le v hball⟩ + let V (v : Coord) := latticeWave a.cover a.beams hUD n (z v) 0 + let yy (v : Coord) := scaledLatticePoint n (z v) + have hdist (v : Coord) : ‖x-yy v‖ ≤ L*h := by + rw [norm_sub_rev] + exact directional_center_distance hnpos x R hR.le v + have hjet (v : Coord) := hj (z v) 0 x (hdist v) + let Rp := b+(normalizedLogJet n (V v) x v).re + let Rm := b+(normalizedLogJet n (V (-v)) x v).re + let pp := g (yy v) (x-yy v) v + let pm := g (yy (-v)) (x-yy (-v)) v + let ep := a.latticeEta hUD n (z v) 0 + let em := a.latticeEta hUD n (z (-v)) 0 + have hgp := hgeom (yy v) (hUD (z v).property) + have hgm := hgeom (yy (-v)) (hUD (z (-v)).property) + have hpp : pp ≤ -h*‖v‖ := rounded_positive_pairing (g (yy v)) mu B R h hmu hB.le hR.le hh.le + hgp.1 hgp.2.2 hlarge x (yy v) v (directional_rounding_error hnpos x R v) + have hpm : h*‖v‖ ≤ pm := by + have hh' := rounded_positive_pairing (g (yy (-v))) mu B R h hmu hB.le hR.le hh.le + hgm.1 hgm.2.2 hlarge x (yy (-v)) (-v) (directional_rounding_error hnpos x R (-v)) + simp only [map_neg,norm_neg] at hh' + dsimp [pm] + linarith + have herr (u : Coord) : |(b+(normalizedLogJet n (V u) x v).re)- + ((b+fderiv ℝ S x v)-a.latticeEta hUD n (z u) 0*g (yy u) (x-yy u) v)| ≤ Cr*h^2*‖v‖ := by + have hh' := ((hjet u).2.2.2.2.2 v).1 + have heq : Cr/(n:ℝ)*‖v‖ = Cr*h^2*‖v‖ := by dsimp [h]; rw [half_scale_square hN]; ring + rw [heq] at hh' + convert hh' using 1 + congr 1 + ring + have hdiff : e*h*‖v‖ ≤ Rp-Rm := opposite_real_products (b+fderiv ℝ S x v) + Rp Rm ep em pp pm h ‖v‖ e Cr hh.le (norm_nonneg _) he.le + (heta n (z v) 0).1 (heta n (z (-v)) 0).1 hpp hpm (herr v) (herr (-v)) hsmall.2.1 + have hprod : |ep*pp| ≤ E*B*L*‖v‖ := by + have hpabs := (bilinear_pairing_bound (g (yy v)) (x-yy v) v).trans + (show ‖g (yy v)‖*‖x-yy v‖*‖v‖ ≤ B*(L*h)*‖v‖ by + gcongr + · exact hgp.1 + · exact hdist v) + have hepos : 0 ≤ ep := he.le.trans (heta n (z v) 0).1 + rw [abs_mul,abs_of_nonneg hepos] + calc + ep*|pp| ≤ E*(B*(L*h)*‖v‖) := mul_le_mul (heta n (z v) 0).2 hpabs (abs_nonneg _) hE.le + _ ≤ E*(B*L*‖v‖) := by + gcongr + simpa using mul_le_mul_of_nonneg_left hh1 hL.le + _ = _ := by ring + have hSv : |fderiv ℝ S x v| ≤ B*‖v‖ := + ((fderiv ℝ S x).le_opNorm v).trans (mul_le_mul_of_nonneg_right (hgeom x hxD).2.1 (norm_nonneg v)) + have hErr : Cr*h^2*‖v‖ ≤ Cr*‖v‖ := by + have hh2 := pow_le_pow_left₀ hh.le hh1 2 + nlinarith [mul_nonneg hCr.le (norm_nonneg v)] + have hlog : |(normalizedLogJet n (V v) x v).re| ≤ F*‖v‖ := by + have hpR := abs_le.mp ((herr v).trans hErr) + have hpP := abs_le.mp hprod + have hpS := abs_le.mp hSv + dsimp [F,Rp,ep,pp] at * + apply abs_le.mpr + constructor <;> nlinarith + have hb : |b| ≤ |Rp|+F*‖v‖ := by + have ht := norm_sub_le (b+(normalizedLogJet n (V v) x v).re) (normalizedLogJet n (V v) x v).re + have ht' : |b| ≤ |Rp|+|(normalizedLogJet n (V v) x v).re| := by simpa only [add_sub_cancel_right,Real.norm_eq_abs] using ht + exact ht'.trans (add_le_add le_rfl hlog) + have hpair := paired_products_control b ‖v‖ Rp Rm h e F (norm_nonneg _) hh hh1 he hF hdiff hb + let f (i : SourceGrid U n × Fin 3) := dualWaveCoefficient n + (latticeWave a.cover a.beams hUD n i.1 i.2) (S x) x b v + have hcoef (u : Coord) : s*|b+(normalizedLogJet n (V u) x v).re| ≤ ‖f (z u,0)‖ := + (mul_le_mul_of_nonneg_right (hjet u).2.2.2.2.1.1 (abs_nonneg _)).trans + (real_log_product_le_coefficient n (V u) (S x) x b v (hjet u).2.2.2.1) + have henergy := two_coefficient_energy f (z v,0) (z (-v),0) s Rp Rm hs.le (hcoef v) (hcoef (-v)) + have hpair' := mul_le_mul_of_nonneg_left hpair (sq_nonneg s) + have hhbound := hpair'.trans henergy + change s^2*(kappa*h^2*(b^2+‖v‖^2)) ≤ 2*a.latticeEnergy hUD n hfin x b v at hhbound + calc + _ = (s^2*(kappa*h^2*(b^2+‖v‖^2)))/2 := by dsimp [h]; rw [half_scale_square hN]; ring + _ ≤ _ := (div_le_iff₀ (by norm_num : (0:ℝ)<2)).mpr (by linarith) + +end LocalCompactWaveData + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticeFieldBounds.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticeFieldBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..4090b4d8159a54bb64c294f45868b339f36a477c --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticeFieldBounds.lean @@ -0,0 +1,64 @@ +import OAI.Geometry.NodalSets.Waves.FiniteWaveDerivativeBounds +import OAI.Geometry.NodalSets.Waves.LatticeCount +import OAI.Geometry.NodalSets.Waves.LocalCompactWaves + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Yau.Probability Set Filter +open scoped ContDiff Topology +noncomputable section +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} +variable {D U : Set Coord} {m J K k0 : ℕ} +namespace LocalCompactWaveData +variable (a : LocalCompactWaveData g w S D m J K k0) + +theorem lattice_field_derivative_bound (hUD : U ⊆ D) (hUb : Bornology.IsBounded U) : + ∃ C > 0, ∀ᶠ n : ℕ in atTop, ∃ hfin : Fintype (SourceGrid U n), + letI := hfin + ∀ coeff : ((SourceGrid U n × Fin 3) × Fin 2) → ℝ, + coeff ∈ coefficientEvent (n:ℝ) → + ContDiff ℝ ∞ (gaussianWaveField + (fun i : SourceGrid U n × Fin 3 ↦ latticeWave a.cover a.beams hUD n i.1 i.2) coeff) ∧ + ∀ x : Coord, ∀ k : Fin (k0+1), + ‖iteratedFDeriv ℝ k.val (gaussianWaveField + (fun i : SourceGrid U n × Fin 3 ↦ latticeWave a.cover a.beams hUD n i.1 i.2) coeff) x‖ ≤ + C*(n:ℝ)^(k.val+3)*Real.exp ((n:ℝ)*S x) := by + obtain ⟨C,hC,hcard⟩ := source_coefficient_card_bound hUb + have hcw := a.beams.Cw_pos + have hbc := a.beams.c_pos + refine ⟨C*a.beams.Cw,mul_pos hC a.beams.Cw_pos,?_⟩ + filter_upwards [a.estimates,eventually_gt_atTop (0:ℕ)] with n hn hnpos + have := finite_source_grid hUb hnpos + let hfin := Fintype.ofFinite (SourceGrid U n) + let := hfin + refine ⟨hfin,?_⟩ + let V := fun i : SourceGrid U n × Fin 3 ↦ latticeWave a.cover a.beams hUD n i.1 i.2 + have hV (i : SourceGrid U n × Fin 3) : ContDiff ℝ ∞ (V i) := + (hn (latticeFrame a.cover hUD n i.1,i.2)).1 + intro coeff hc + refine ⟨gaussianWaveField_contDiff V coeff hV,?_⟩ + intro x k + have hb (i : SourceGrid U n × Fin 3) : ‖iteratedFDeriv ℝ k.val (V i) x‖ ≤ + a.beams.Cw*(n:ℝ)^k.val*Real.exp ((n:ℝ)*S x) := by + have h := ((hn (latticeFrame a.cover hUD n i.1,i.2)).2.2.2.2 x).1 k + refine h.trans ?_ + gcongr + exact sub_le_self _ (by positivity : 0 ≤ a.beams.c*(n:ℝ)* + (sourceEuclideanNorm (x-coverSourceCenter a.cover (latticeFrame a.cover hUD n i.1)))^2) + have h := gaussianWaveField_iterated_bound V coeff hV k.val x (by positivity) hc hb + have hcardR : (Fintype.card (SourceGrid U n × Fin 3):ℝ) ≤ C*(n:ℝ)^2 := by + simpa only [Nat.card_eq_fintype_card] using hcard n hnpos + refine h.trans ?_ + calc + _ ≤ (C*(n:ℝ)^2)*(n:ℝ)*(a.beams.Cw*(n:ℝ)^k.val*Real.exp ((n:ℝ)*S x)) := by + gcongr + _ = (C*a.beams.Cw)*(n:ℝ)^(k.val+3)*Real.exp ((n:ℝ)*S x) := by + rw [pow_add] + ring + +end LocalCompactWaveData +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticeFrequencyAnnulus.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticeFrequencyAnnulus.lean new file mode 100644 index 0000000000000000000000000000000000000000..2ff2badd87521c487ea626c37c1c45e0d401ad6e --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticeFrequencyAnnulus.lean @@ -0,0 +1,39 @@ +import OAI.Geometry.NodalSets.Charts.MetricFrequencyBounds +import OAI.Geometry.NodalSets.Elliptic.SignScaleContinuity + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Set Filter +open scoped ContDiff Topology +noncomputable section + +theorem lattice_main_frequency_annulus + (g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ) {H : Set Coord} + (hH : IsCompact H) (hg : ContinuousOn g H) + (hp : ∀ y ∈ H, ∀ v, v ≠ 0 → 0 < g y v v) : + ∃ κ > 0, ∃ B > 0, ∀ (w S : Coord → ℝ) (D U : Set Coord) (m J K k0 : ℕ) + (a : LocalCompactWaveData g w S D m J K k0) (_ : H ⊆ D) (hUD : U ⊆ D), + U ⊆ H → ∀ᶠ n : ℕ in atTop, ∀ x ∈ H, ∀ i : SourceGrid U n × Fin 3, + sourceEuclideanNorm (x-scaledLatticePoint n i.1) ≤ (n:ℝ)^(-5/12:ℝ) → + κ ≤ sourceEuclideanNorm (sourceFrequency (g (scaledLatticePoint n i.1)) + (a.cover.triple.q (latticeFrame a.cover hUD n i.1) i.2) (sourceSignScale g S x)) ∧ + sourceEuclideanNorm (sourceFrequency (g (scaledLatticePoint n i.1)) + (a.cover.triple.q (latticeFrame a.cover hUD n i.1) i.2) (sourceSignScale g S x)) ≤ B := by + obtain ⟨κ,hκ,B,hB,hmetric⟩ := compact_metric_frequency_bounds g hH hg hp + refine ⟨κ,hκ,B,hB,?_⟩ + intro w S D U m J K k0 a hHD hUD hUH + filter_upwards [a.source_main_scale_comparison hH hHD] with n hn + intro x hx i hi + have hy : scaledLatticePoint n i.1 ∈ H := hUH i.1.property + have hr := hn x hx _ hy hi + have hx0 : 0 < sourceSignScale g S x := by linarith [a.source_sign_scale_lower x (hHD hx)] + have hy0 : 0 < sourceSignScale g S (scaledLatticePoint n i.1) := by + linarith [a.source_sign_scale_lower _ (hUD i.1.property)] + apply hmetric _ hy _ _ _ hx0 hy0 _ hr.1 hr.2 + simpa only [latticeFrame_center] using a.original_direction_length (latticeFrame a.cover hUD n i.1) i.2 + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticeFullPlaneWaveApprox.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticeFullPlaneWaveApprox.lean new file mode 100644 index 0000000000000000000000000000000000000000..0214645698e2bf3de1ba88a6b18fb4645205db9c --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticeFullPlaneWaveApprox.lean @@ -0,0 +1,72 @@ +import OAI.Geometry.NodalSets.Waves.LatticePlaneWaveJets +import OAI.Geometry.NodalSets.Waves.RescaledLatticeTail + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Set Filter +open scoped ContDiff Topology +noncomputable section +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} +variable {D U : Set Coord} {m J K k0 : ℕ} +namespace LocalCompactWaveData +variable (a : LocalCompactWaveData g w S D m J K k0) + +def latticePlaneWaveCoefficient (hUD : U ⊆ D) (n : ℕ) [Fintype (SourceGrid U n)] + (x : Coord) (s : ℝ) (i : SourceGrid U n × Fin 3) (v : Coord) : ℂ := + if sourceEuclideanNorm (x-scaledLatticePoint n i.1) ≤ (n:ℝ)^(-5/12:ℝ) then + a.latticeAlpha hUD n x i * + planeWave (g (scaledLatticePoint n i.1) (a.cover.triple.q (latticeFrame a.cover hUD n i.1) i.2)) s v + else 0 + +theorem lattice_full_jet_approximation (hUD : U ⊆ D) (hU : IsOpen U) + (hUb : Bornology.IsBounded U) {Q : Set Coord} (hQ : IsCompact Q) (hQU : Q ⊆ U) + (hS : ContDiff ℝ ∞ S) (R : ℝ) (hR : 0 ≤ R) (e : ℝ) (he : 0 < e) : + ∀ᶠ n : ℕ in atTop, ∃ hfin : Fintype (SourceGrid U n), letI := hfin + ∀ x ∈ Q, ∀ s : ℝ, 1 ≤ s → ∀ v : Coord, ‖v‖ ≤ R → ∀ k : Fin (k0+1), + ∑ i : SourceGrid U n × Fin 3, + ‖iteratedFDeriv ℝ k.val (fun z ↦ + normalizedRescaling (latticeWave a.cover a.beams hUD n i.1 i.2) S n s + (a.latticeSigma hUD n x) x z - a.latticePlaneWaveCoefficient hUD n x s i z) v‖^2 ≤ e := by + classical + filter_upwards [a.lattice_main_jet_approximation hUD hU hUb hQ hQU R hR k0 (e/2) (by positivity), + a.rescaled_lattice_nonmain_negligible hUD hU hUb hQ hQU hS R hR (e/2) (by positivity)] + with n hmain htail + obtain ⟨hfin,hm⟩ := hmain + obtain ⟨hfin',ht⟩ := htail + have heq : hfin' = hfin := Subsingleton.elim _ _ + subst hfin' + let := hfin + refine ⟨hfin,?_⟩ + intro x hx s hs v hv k + let P := fun i : SourceGrid U n × Fin 3 ↦ + sourceEuclideanNorm (x-scaledLatticePoint n i.1) ≤ (n:ℝ)^(-5/12:ℝ) + let err := fun i : SourceGrid U n × Fin 3 ↦ + ‖iteratedFDeriv ℝ k.val (fun z ↦ + normalizedRescaling (latticeWave a.cover a.beams hUD n i.1 i.2) S n s + (a.latticeSigma hUD n x) x z-a.latticePlaneWaveCoefficient hUD n x s i z) v‖^2 + have hm' : ∑ i ∈ Finset.univ.filter P, err i ≤ e/2 := by + have hh := hm x hx s hs v hv k.val (by omega) + convert hh using 1 + apply Finset.sum_congr rfl + intro i hi + have hp := (Finset.mem_filter.mp hi).2 + dsimp only [P] at hp + simp only [err,latticePlaneWaveCoefficient,ite_eq_left hp] + have ht' : ∑ i ∈ Finset.univ.filter (fun i ↦ ¬P i), err i ≤ e/2 := by + have hh := ht x hx s hs v hv k + convert hh using 1 + · apply Finset.sum_congr + · ext i; simp only [P,Finset.mem_filter,not_le] + · intro i hi + have hp := (Finset.mem_filter.mp hi).2 + simp only [err,latticePlaneWaveCoefficient,ite_eq_right (not_le.mpr hp),sub_zero] + have hsplit := Finset.sum_filter_add_sum_filter_not (s := Finset.univ) P err + change ∑ i, err i ≤ e + linarith + +end LocalCompactWaveData +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticeGaussianSmallBall.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticeGaussianSmallBall.lean new file mode 100644 index 0000000000000000000000000000000000000000..040036f57ec36511519729b4c0b99a54bf741893 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticeGaussianSmallBall.lean @@ -0,0 +1,81 @@ +import OAI.Geometry.NodalSets.Waves.EuclideanGaussianSmallBall +import OAI.Geometry.NodalSets.Waves.GaussianJet +import OAI.Geometry.NodalSets.Waves.LatticeCovariance + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Yau.Probability Set Filter MeasureTheory ProbabilityTheory +open scoped ContDiff Topology ENNReal RealInnerProductSpace +noncomputable section +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} +variable {D U : Set Coord} {m J K k0 : ℕ} +namespace LocalCompactWaveData +variable (a : LocalCompactWaveData g w S D m J K k0) + +def latticeSeededJet (hUD : U ⊆ D) (n : ℕ) (hfin : Fintype (SourceGrid U n)) + (seed : Coord → ℝ) (x : Coord) + (coeff : ((SourceGrid U n × Fin 3) × Fin 2) → ℝ) : JetSpace := + letI := hfin + let V := fun i : SourceGrid U n × Fin 3 ↦ latticeWave a.cover a.beams hUD n i.1 i.2 + normalizedRealJet (fun z ↦ seed z+gaussianWaveField V coeff z) (n:ℝ) (S x) x + +lemma latticeSeededJet_inner (hUD : U ⊆ D) (n : ℕ) (hfin : Fintype (SourceGrid U n)) + (seed : Coord → ℝ) (x : Coord) (v : JetSpace) + (coeff : ((SourceGrid U n × Fin 3) × Fin 2) → ℝ) : + ⟪v,a.latticeSeededJet hUD n hfin seed x coeff⟫ = + a.latticeSeededRandomDual hUD n hfin seed x (v 0) (Fin.tail (WithLp.ofLp v)) coeff := by + let := hfin + unfold latticeSeededJet latticeSeededRandomDual + exact normalizedRealJet_inner + (fun z ↦ seed z + gaussianWaveField + (fun i : SourceGrid U n × Fin 3 ↦ latticeWave a.cover a.beams hUD n i.1 i.2) + coeff z) (n : ℝ) (S x) x v + +theorem actual_lattice_gaussian_small_ball (hUD : U ⊆ D) (hU : IsOpen U) + (hUb : Bornology.IsBounded U) {Q : Set Coord} (hQ : IsCompact Q) (hQU : Q ⊆ U) : + ∃ c > 0, ∀ᶠ n : ℕ in atTop, ∃ hfin : Fintype (SourceGrid U n), + letI := hfin + ∀ (seed : Coord → ℝ) (x : Coord), x ∈ Q → DifferentiableAt ℝ seed x → + ∀ r : ℝ, 0 ≤ r → + (gaussianPairs.map (a.latticeSeededJet hUD n hfin seed x)) {y | ‖y‖ ≤ r} ≤ + ENNReal.ofReal ((12*(Real.sqrt (c/(n:ℝ)))⁻¹*r/Real.sqrt (2*Real.pi))^5) := by + obtain ⟨c,hc,hcov⟩ := a.actual_lattice_covariance_lower_bound hUD hU hUb hQ hQU + refine ⟨c,hc,?_⟩ + filter_upwards [hcov,lattice_wave_estimates a.cover a.beams hUD, + eventually_gt_atTop (0:ℕ)] with n hn hw hnpos + obtain ⟨hfin,hbound⟩ := hn + let := hfin + refine ⟨hfin,?_⟩ + intro seed x hx hs r hr + let V := fun i : SourceGrid U n × Fin 3 ↦ latticeWave a.cover a.beams hUD n i.1 i.2 + have hV : ∀ i, DifferentiableAt ℝ (V i) x := fun i ↦ + ((hw i.1 i.2).1.differentiable (by simp)).differentiableAt + have hb (v : JetSpace) : c/(n:ℝ)*‖v‖^2 ≤ + ‖(pairJetMap (jetWaveCoefficients V n (S x) x)).adjoint v‖^2 := by + have h := hbound seed x hx hs (v 0) (Fin.tail (WithLp.ofLp v)) + have he : (fun coeff ↦ ⟪v,a.latticeSeededJet hUD n hfin seed x coeff⟫) = + a.latticeSeededRandomDual hUD n hfin seed x (v 0) (Fin.tail (WithLp.ofLp v)) := by + funext coeff + exact a.latticeSeededJet_inner hUD n hfin seed x v coeff + rw [← he] at h + change c/(n:ℝ)*((v 0)^2+∑ i : Fin 4, (v i.succ)^2) ≤ + Var[fun coeff ↦ ⟪v,normalizedRealJet (fun y ↦ seed y+gaussianWaveField V coeff y) + (n:ℝ) (S x) x⟫; gaussianPairs] at h + rw [seeded_gaussian_jet_variance V seed n (S x) x hV hs v] at h + simpa only [EuclideanSpace.real_norm_sq_eq,Fin.sum_univ_succ] using h + have hl := seeded_gaussian_jet_law V seed n (S x) x hV hs + change gaussianPairs.map (a.latticeSeededJet hUD n hfin seed x) = _ at hl + rw [hl] + have h := gaussian_map_small_ball (pairJetMap (jetWaveCoefficients V n (S x) x)) + (normalizedRealJet seed n (S x) x) (c/(n:ℝ)) r (by positivity) hr hb + convert h using 1 + norm_num + congr 2 + ring + +end LocalCompactWaveData +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticeGeometry.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticeGeometry.lean new file mode 100644 index 0000000000000000000000000000000000000000..cbdc75d515cbf2a6f16694ae98706cfaa9c38f46 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticeGeometry.lean @@ -0,0 +1,74 @@ +import Mathlib.Algebra.Order.Floor.Ring +import Mathlib.Data.Int.Interval +import OAI.Geometry.NodalSets.Waves.LatticeSourceWaves + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Set +noncomputable section + +lemma lattice_scale_pos {n : ℕ} (hn : 0 < n) : 0 < (n:ℝ)^(-1/2:ℝ) := + Real.rpow_pos_of_pos (by exact_mod_cast hn) _ + +lemma scaledLatticePoint_injective {n : ℕ} (hn : 0 < n) : Function.Injective (scaledLatticePoint n) := by + intro z w h + funext i + have hh := congrFun h i + change (n:ℝ)^(-1/2:ℝ)*(z i:ℝ) = (n:ℝ)^(-1/2:ℝ)*(w i:ℝ) at hh + exact_mod_cast mul_left_cancel₀ (ne_of_gt (lattice_scale_pos hn)) hh + +theorem finite_source_grid {U : Set Coord} (hU : Bornology.IsBounded U) + {n : ℕ} (hn : 0 < n) : Finite (SourceGrid U n) := by + obtain ⟨B,hB,hbound⟩ := hU.exists_pos_norm_le + let r : ℝ := (n:ℝ)^(-1/2:ℝ) + have hr : 0 < r := lattice_scale_pos hn + let M : ℤ := ⌈B/r⌉ + have hcoords (z : SourceGrid U n) (i : Fin 4) : z.val i ∈ Icc (-M) M := by + have hi := (norm_le_pi_norm (scaledLatticePoint n z) i).trans (hbound _ z.property) + change |r*(z.val i:ℝ)| ≤ B at hi + rw [abs_mul,abs_of_pos hr] at hi + have ha : |(z.val i:ℝ)| ≤ B/r := (le_div_iff₀ hr).mpr (by nlinarith) + have hM : B/r ≤ (M:ℝ) := Int.le_ceil _ + have hpair := abs_le.mp (ha.trans hM) + constructor + · exact_mod_cast hpair.1 + · exact_mod_cast hpair.2 + let f : SourceGrid U n → (Fin 4 → Icc (-M) M) := fun z i ↦ ⟨z.val i,hcoords z i⟩ + apply Finite.of_injective f + intro z w h + apply Subtype.ext + funext i + exact congrArg Subtype.val (congrFun h i) + +def roundedLatticeIndex (n : ℕ) (x : Coord) : Fin 4 → ℤ := + fun i ↦ ⌊x i / (n:ℝ)^(-1/2:ℝ)⌋ + +theorem rounded_lattice_distance {n : ℕ} (hn : 0 < n) (x : Coord) : + sourceEuclideanNorm (scaledLatticePoint n (roundedLatticeIndex n x)-x) ≤ + 2*(n:ℝ)^(-1/2:ℝ) := by + let r : ℝ := (n:ℝ)^(-1/2:ℝ) + have hr : 0 < r := lattice_scale_pos hn + have hb : ‖scaledLatticePoint n (roundedLatticeIndex n x)-x‖ ≤ r := by + apply (pi_norm_le_iff_of_nonneg hr.le).mpr + intro i + have h1 := Int.floor_le (x i/r) + have h2 := Int.lt_floor_add_one (x i/r) + have h1' := mul_le_mul_of_nonneg_left h1 hr.le + have h2' := mul_lt_mul_of_pos_left h2 hr + have he : r*(x i/r) = x i := by field_simp + rw [he] at h1' h2' + change |r*(⌊x i/r⌋:ℝ)-x i| ≤ r + apply abs_le.mpr + constructor <;> nlinarith + exact (sourceEuclideanNorm_le _).trans (by dsimp [r] at hb ⊢; linarith) + +theorem rounded_lattice_mem {U : Set Coord} {n : ℕ} (hn : 0 < n) (x : Coord) + (hball : {y | sourceEuclideanNorm (y-x) ≤ 2*(n:ℝ)^(-1/2:ℝ)} ⊆ U) : + scaledLatticePoint n (roundedLatticeIndex n x) ∈ U := + hball (rounded_lattice_distance hn x) + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticeGoodEvent.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticeGoodEvent.lean new file mode 100644 index 0000000000000000000000000000000000000000..634609b56c31985c2b664447cf1a3422f392bcc9 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticeGoodEvent.lean @@ -0,0 +1,58 @@ +import OAI.Geometry.NodalSets.Elliptic.FirstJetGoodEvent +import OAI.Geometry.NodalSets.Elliptic.FirstJetNonvanishing + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Yau.Probability Set Filter MeasureTheory +open scoped ContDiff Topology +noncomputable section +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} + {D U : Set Coord} {m J K k0 : ℕ} +namespace LocalCompactWaveData +variable (a : LocalCompactWaveData g w S D m J K k0) + +def latticeGoodEvent (hUD : U ⊆ D) (n : ℕ) (hfin : Fintype (SourceGrid U n)) + (S0 T0 : Coord → ℝ) (Ω : Set Coord) : Set (((SourceGrid U n × Fin 3) × Fin 2) → ℝ) := + letI := hfin + coefficientJetGoodEvent + (fun i : SourceGrid U n × Fin 3 ↦ latticeWave a.cover a.beams hUD n i.1 i.2) + (oscillatorySeed S0 T0 n) n Ω + (fun x ↦ ((n:ℝ)^65)⁻¹*max (Real.exp ((n:ℝ)*S x)) (Real.exp ((n:ℝ)*S0 x))) + +theorem lattice_good_event_probability (hUD : U ⊆ D) (hU : IsOpen U) + (hUb : Bornology.IsBounded U) (hS : ContDiff ℝ ∞ S) + (S0 T0 : Coord → ℝ) (hS0 : ContDiff ℝ ∞ S0) (hT0 : ContDiff ℝ ∞ T0) + {Ω : Set Coord} (hΩ : IsCompact Ω) (hk0 : 2 ≤ k0) + (hq : ∀ x ∈ Ω, fderiv ℝ T0 x ≠ 0) + {d : ℝ} (hd : 0 < d) (hgap : ∀ x ∈ Ω, x ∉ U → S x-S0 x ≤ -d) : + ∀ ε : ℝ, 0 < ε → ∀ᶠ n : ℕ in atTop, ∃ hfin : Fintype (SourceGrid U n), + letI := hfin + MeasurableSet (a.latticeGoodEvent hUD n hfin S0 T0 Ω) ∧ + gaussianPairs (a.latticeGoodEvent hUD n hfin S0 T0 Ω)ᶜ ≤ ENNReal.ofReal ε := by + intro ε hε + obtain ⟨C,hC,hcoeff⟩ := lattice_coefficient_event_failure hUb + have htail := (tendsto_coefficient_tail_rate C).eventually (gt_mem_nhds (by linarith : 0 < ε/2)) + filter_upwards [a.source_first_jet_failure_tends_zero hUD hU hUb hS S0 T0 hS0 hT0 + hΩ hk0 hq hd hgap (ε/2) (by linarith),htail,a.estimates,eventually_gt_atTop (0:ℕ)] with n hn ht he hn0 + obtain ⟨hfin,hjet⟩ := hn + let := hfin + let V := fun i : SourceGrid U n × Fin 3 ↦ latticeWave a.cover a.beams hUD n i.1 i.2 + have hV (i : SourceGrid U n × Fin 3) : ContDiff ℝ ∞ (V i) := + (he (latticeFrame a.cover hUD n i.1,i.2)).1 + refine ⟨hfin,coefficientJetGoodEvent_measurable V (oscillatorySeed S0 T0 n) + hV (oscillatorySeed_contDiff S0 T0 hS0 hT0 n) n Ω _,?_⟩ + apply (coefficientJetGoodEvent_failure_le V (oscillatorySeed S0 T0 n) n Ω _).trans + calc + _ ≤ ENNReal.ofReal (ε/2)+ENNReal.ofReal (ε/2) := + add_le_add ((hcoeff n hn0 hfin).trans (ENNReal.ofReal_le_ofReal ht.le)) hjet + _ = ENNReal.ofReal ε := by + rw [← ENNReal.ofReal_add (by linarith : 0 ≤ ε/2) (by linarith : 0 ≤ ε/2)] + congr 1 + ring + +end LocalCompactWaveData +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticeGradientExpectation.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticeGradientExpectation.lean new file mode 100644 index 0000000000000000000000000000000000000000..302edea2d194a8ba28fda65997e1ad0cd8f8fb39 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticeGradientExpectation.lean @@ -0,0 +1,48 @@ +import OAI.Geometry.NodalSets.Elliptic.RescaledGradientExpectation + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Yau.Probability Set Filter MeasureTheory ProbabilityTheory +open scoped ContDiff Topology +noncomputable section + +theorem lattice_gradient_expectation + (g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ) {H : Set Coord} + (hH : IsCompact H) (hg : ContinuousOn g H) + (hp : ∀ y ∈ H, ∀ v, v ≠ 0 → 0 < g y v v) : + ∃ C > 0, ∀ (w S S0 T0 : Coord → ℝ) (D U Q : Set Coord) (m J K k0 : ℕ) + (a : LocalCompactWaveData g w S D m J K k0) (_ : H ⊆ D) (hUD : U ⊆ D), + U ⊆ H → IsOpen U → Bornology.IsBounded U → IsCompact Q → Q ⊆ U → + ContDiff ℝ ∞ S → ContDiff ℝ ∞ S0 → ContDiff ℝ ∞ T0 → 5 ≤ k0 → + ∀ gamma > 0, (∀ x ∈ Q, S0 x+gamma ≤ S x) → + ∀ᶠ n : ℕ in atTop, ∃ hfin : Fintype (SourceGrid U n), letI := hfin + ∀ x ∈ Q, ∃ G : ((SourceGrid U n × Fin 3) × Fin 2 → ℝ) → ℝ, + Continuous G ∧ Integrable G gaussianPairs ∧ (∀ coeff, 0 ≤ G coeff) ∧ + (∫ coeff, G coeff ∂gaussianPairs) ≤ C ∧ + ∀ coeff L, 0 ≤ L → + (G coeff ≤ L ↔ ∀ v : Coord, sourceEuclideanNorm v ≤ 1 → + sourceEuclideanNorm (fun j ↦ fderiv ℝ (rescaledGaussianField + (fun i : SourceGrid U n × Fin 3 ↦ latticeWave a.cover a.beams hUD n i.1 i.2) + S0 T0 S n (sourceSignScale g S x) (a.latticeSigma hUD n x) x coeff) + v (Pi.single j 1)) ≤ L) := by + obtain ⟨B,hB,hmom⟩ := lattice_derivative_second_moments g hH hg hp 5 + refine ⟨648*(B+1),by positivity,?_⟩ + intro w S S0 T0 D U Q m J K k0 a hHD hUD hUH hU hUb hQ hQU hS hS0 hT0 hd gamma hgamma hgap + filter_upwards [hmom w S S0 T0 D U Q m J K k0 a hHD hUD hUH hU hUb hQ hQU + hS hS0 hT0 hd gamma hgamma hgap,a.estimates] with n hn hest + obtain ⟨hfin,hn⟩ := hn + let := hfin + refine ⟨hfin,?_⟩ + intro x hx + let V := fun i : SourceGrid U n × Fin 3 ↦ latticeWave a.cover a.beams hUD n i.1 i.2 + have hV (i : SourceGrid U n × Fin 3) : ContDiff ℝ ∞ (V i) := + (hest (latticeFrame a.cover hUD n i.1,i.2)).1 + exact rescaled_gradient_supremum_expectation V hV S0 T0 S hS0 hT0 + n (sourceSignScale g S x) (a.latticeSigma hUD n x) x hB.le + (fun v hv k hk dirs hd ↦ (hn x hx v hv k hk dirs hd).2) + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticeLogJets.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticeLogJets.lean new file mode 100644 index 0000000000000000000000000000000000000000..0ab4f8f4777657116a0e36e0953433bccfc435b8 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticeLogJets.lean @@ -0,0 +1,44 @@ +import OAI.Geometry.NodalSets.Elliptic.LocalLogJetBounds + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Set Filter +open scoped ContDiff Topology +noncomputable section +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} +variable {D U : Set Coord} {m J K k0 : ℕ} +namespace LocalCompactWaveData +variable (a : LocalCompactWaveData g w S D m J K k0) + +def latticeEta (hUD : U ⊆ D) (n : ℕ) (z : SourceGrid U n) (j : Fin 3) : ℝ := + a.originalEta (latticeFrame a.cover hUD n z,j) + +theorem lattice_logarithmic_jet_estimates (hUD : U ⊆ D) (L : ℝ) (hL : 0 < L) : + ∃ Ca > 0, ∃ Cr > 0, ∃ Ci > 0, ∃ c > 0, ∃ C > 0, + ∀ᶠ n : ℕ in atTop, ∀ (z : SourceGrid U n) (j : Fin 3) (x : Coord), + ‖x-scaledLatticePoint n z‖ ≤ L*(n:ℝ)^(-1/2:ℝ) → + let t := (latticeFrame a.cover hUD n z,j) + let V := latticeWave a.cover a.beams hUD n z j + ‖a.beams.amplitude n t x-1‖ ≤ Ca*(n:ℝ)^(-1/2:ℝ) ∧ + (1/2:ℝ) ≤ ‖a.beams.amplitude n t x‖ ∧ ‖a.beams.amplitude n t x‖ ≤ 3/2 ∧ V x ≠ 0 ∧ + (c ≤ ‖V x‖*Real.exp (-(n:ℝ)*S x) ∧ ‖V x‖*Real.exp (-(n:ℝ)*S x) ≤ C) ∧ + ∀ v, + |(normalizedLogJet n V x v).re - + (fderiv ℝ S x v-a.latticeEta hUD n z j*g (scaledLatticePoint n z) (x-scaledLatticePoint n z) v)| ≤ Cr/n*‖v‖ ∧ + |(normalizedLogJet n V x v).im - g (scaledLatticePoint n z) (a.cover.triple.q t.1 t.2) v| ≤ + Ci*(n:ℝ)^(-1/2:ℝ)*‖v‖ := by + obtain ⟨Ca,hCa,Cr,hCr,Ci,hCi,c,hc,C,hC,hb⟩ := a.original_logarithmic_jet_estimates L hL + refine ⟨Ca,hCa,Cr,hCr,Ci,hCi,c,hc,C,hC,?_⟩ + filter_upwards [hb] with n hn + intro z j x hx + have hx' : ‖x-coverSourceCenter a.cover (latticeFrame a.cover hUD n z)‖ ≤ L*(n:ℝ)^(-1/2:ℝ) := by + simpa only [latticeFrame_center] using hx + simpa only [latticeWave,TripleSourceWaveData.wave,latticeEta,latticeFrame_center] using + hn (latticeFrame a.cover hUD n z,j) x hx' + +end LocalCompactWaveData +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticeMainLogJets.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticeMainLogJets.lean new file mode 100644 index 0000000000000000000000000000000000000000..5005ae5b14a4220e3949422903440a5c667bd739 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticeMainLogJets.lean @@ -0,0 +1,66 @@ +import OAI.Geometry.NodalSets.Elliptic.LocalMainLogJets +import OAI.Geometry.NodalSets.Elliptic.ShiftedCenterDistance + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Set Filter +open scoped ContDiff Topology +noncomputable section + +lemma eventually_shifted_main_distance (R : ℝ) : + ∀ᶠ n : ℕ in atTop, ∀ (s : ℝ), 1 ≤ s → ∀ (x y v : Coord), ‖v‖ ≤ R → + sourceEuclideanNorm (x-y) ≤ (n:ℝ)^(-5/12:ℝ) → + ‖x+((n:ℝ)*s)⁻¹ • v-y‖ ≤ 2*(n:ℝ)^(-5/12:ℝ) := by + have ht : Tendsto (fun n : ℕ ↦ (n:ℝ)^(7/12:ℝ)) atTop atTop := + (tendsto_rpow_atTop (by norm_num : (0:ℝ) < 7/12)).comp tendsto_natCast_atTop_atTop + filter_upwards [ht.eventually (eventually_ge_atTop R),eventually_gt_atTop (0:ℕ)] + with n hn hnpos + intro s hs x y v hv hnear + have hn0 : (0:ℝ) < n := by exact_mod_cast hnpos + have hn1 : (1:ℝ) ≤ n := by exact_mod_cast hnpos + have hd := rescaling_displacement_bound (x := x) hn1 hs hv + rw [← main_radius_times_frequency hn0] at hn + have hshift : ‖(x+((n:ℝ)*s)⁻¹ • v)-x‖ ≤ (n:ℝ)^(-5/12:ℝ) := by nlinarith + have hxy := (norm_le_sourceEuclideanNorm _).trans hnear + have he : x+((n:ℝ)*s)⁻¹ • v-y = + (x+((n:ℝ)*s)⁻¹ • v-x)+(x-y) := by abel + rw [he] + exact (norm_add_le _ _).trans (by linarith) + +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} +variable {D U : Set Coord} {m J K k0 : ℕ} +namespace LocalCompactWaveData +variable (a : LocalCompactWaveData g w S D m J K k0) + +theorem lattice_shifted_main_log_jets (hUD : U ⊆ D) (R : ℝ) : + ∃ Ca > 0, ∃ Cr > 0, ∃ Ci > 0, + ∀ᶠ n : ℕ in atTop, ∀ (x : Coord) (s : ℝ), 1 ≤ s → + ∀ (v : Coord), ‖v‖ ≤ R → ∀ (i : SourceGrid U n × Fin 3), + sourceEuclideanNorm (x-scaledLatticePoint n i.1) ≤ (n:ℝ)^(-5/12:ℝ) → + let t := (latticeFrame a.cover hUD n i.1,i.2) + let z := x+((n:ℝ)*s)⁻¹ • v + ‖(a.beams.F t).symm z‖ < (n:ℝ)^(-1/3:ℝ) ∧ + ‖a.beams.amplitude n t z-1‖ ≤ Ca*(n:ℝ)^(-5/12:ℝ) ∧ + (1/2:ℝ) ≤ ‖a.beams.amplitude n t z‖ ∧ ‖a.beams.amplitude n t z‖ ≤ 3/2 ∧ + latticeWave a.cover a.beams hUD n i.1 i.2 z ≠ 0 ∧ ∀ u, + |(normalizedLogJet n (latticeWave a.cover a.beams hUD n i.1 i.2) z u).re - + (fderiv ℝ S z u-a.originalEta t*g (scaledLatticePoint n i.1) + (z-scaledLatticePoint n i.1) u)| ≤ Cr*(n:ℝ)^(-5/6:ℝ)*‖u‖ ∧ + |(normalizedLogJet n (latticeWave a.cover a.beams hUD n i.1 i.2) z u).im - + g (scaledLatticePoint n i.1) (a.cover.triple.q t.1 t.2) u| ≤ + Ci*(n:ℝ)^(-5/12:ℝ)*‖u‖ := by + obtain ⟨Ca,hCa,Cr,hCr,Ci,hCi,hjets⟩ := a.original_main_logarithmic_jet_estimates 2 (by norm_num) + refine ⟨Ca,hCa,Cr,hCr,Ci,hCi,?_⟩ + filter_upwards [hjets,eventually_shifted_main_distance R] with n hj hd + intro x s hs v hv i hi + have hz := hd s hs x (scaledLatticePoint n i.1) v hv hi + have hh := hj (latticeFrame a.cover hUD n i.1,i.2) (x+((n:ℝ)*s)⁻¹ • v) + (by simpa only [latticeFrame_center] using hz) + simpa only [latticeFrame_center,latticeWave,TripleSourceWaveData.wave] using hh + +end LocalCompactWaveData +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticeNeighborhoodJets.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticeNeighborhoodJets.lean new file mode 100644 index 0000000000000000000000000000000000000000..2eb051633c0e5f272e7240d0736472569c39a476 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticeNeighborhoodJets.lean @@ -0,0 +1,76 @@ +import Mathlib.Analysis.Calculus.MeanValue +import OAI.Geometry.NodalSets.Elliptic.NeighborhoodJetBound +import OAI.Geometry.NodalSets.Waves.LatticeGaussianSmallBall +import OAI.Geometry.NodalSets.Waves.SeededLatticeFieldBounds + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Yau.Probability Set Filter +open scoped ContDiff Topology +noncomputable section +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} +variable {D U : Set Coord} {m J K k0 : ℕ} +namespace LocalCompactWaveData +variable (a : LocalCompactWaveData g w S D m J K k0) + +theorem lattice_neighborhood_jet_bound (hUD : U ⊆ D) (hUb : Bornology.IsBounded U) + (hS : ContDiff ℝ ∞ S) (S0 T0 : Coord → ℝ) + (hS0 : ContDiff ℝ ∞ S0) (hT0 : ContDiff ℝ ∞ T0) + {Ω : Set Coord} (hΩ : IsCompact Ω) (hk0 : 2 ≤ k0) : + ∀ᶠ n : ℕ in atTop, ∃ hfin : Fintype (SourceGrid U n), + letI := hfin + ∀ coeff : ((SourceGrid U n × Fin 3) × Fin 2) → ℝ, + coeff ∈ coefficientEvent (n:ℝ) → + ∀ x ∈ highEnvelopeRegion Ω S S0 n, + ∀ z ∈ Metric.closedBall x ((n:ℝ)^2)⁻¹, + ‖fderiv ℝ (fun y ↦ a.latticeSeededJet hUD n hfin + (oscillatorySeed S0 T0 n) y coeff) z‖ ≤ (n:ℝ)^13 := by + obtain ⟨R,hR,hΩR⟩ := hΩ.isBounded.exists_pos_norm_le + let Q := Metric.closedBall (0:Coord) (R+1) + have hQ : IsCompact Q := isCompact_closedBall _ _ + obtain ⟨A,hA,hAb⟩ := (hQ.image (hS.continuous_fderiv (by simp))).isBounded.exists_pos_norm_le + have hdS : ContDiff ℝ ∞ (fun z ↦ S0 z-S z) := hS0.sub hS + obtain ⟨L,hL,hLb⟩ := (hQ.image (hdS.continuous_fderiv (by simp))).isBounded.exists_pos_norm_le + obtain ⟨B,hB,hfield⟩ := a.seeded_lattice_field_derivative_bound hUD hUb S0 T0 hS0 hT0 hQ + have hfreq : ∀ᶠ n : ℕ in atTop, max L (6*(A+1)*B*Real.exp 1) ≤ (n:ℝ) := + tendsto_natCast_atTop_atTop.eventually (eventually_ge_atTop _) + filter_upwards [hfield,hfreq,eventually_gt_atTop (0:ℕ)] with n hn hsize hnpos + obtain ⟨hfin,hb⟩ := hn + let := hfin + refine ⟨hfin,?_⟩ + intro coeff hc x hx z hz + obtain ⟨hu,hbnd⟩ := hb coeff hc + have hn1 : (1:ℝ) ≤ n := by exact_mod_cast hnpos + have hnR : (0:ℝ) < n := by exact_mod_cast hnpos + have hdist : ‖z-x‖ ≤ ((n:ℝ)^2)⁻¹ := by simpa only [Metric.mem_closedBall,dist_eq_norm] using hz + have hrad : ((n:ℝ)^2)⁻¹ ≤ 1 := + (inv_le_one₀ (by positivity)).mpr (one_le_pow₀ hn1) + have hxQ : x ∈ Q := by + change dist x 0 ≤ R+1 + rw [dist_zero_right] + linarith [hΩR x hx.1] + have hzQ : z ∈ Q := by + change dist z 0 ≤ R+1 + rw [dist_zero_right] + have ht := norm_le_norm_sub_add z x + linarith [hΩR x hx.1,hdist.trans hrad] + have hgap : (S0 z-S z)-(S0 x-S x) ≤ L*‖z-x‖ := by + have h := (convex_closedBall (0:Coord) (R+1)).norm_image_sub_le_of_norm_fderiv_le + (fun _ _ ↦ (hdS.differentiable (by simp)).differentiableAt) + (fun y hy ↦ hLb _ ⟨y,hy,rfl⟩) hxQ hzQ + exact (le_abs_self _).trans h + have h := normalized_jet_neighborhood_derivative_bound + (fun y ↦ oscillatorySeed S0 T0 n y+gaussianWaveField + (fun i : SourceGrid U n × Fin 3 ↦ latticeWave a.cover a.beams hUD n i.1 i.2) coeff y) + S S0 hu hS hnpos hx hA.le hB.le hL.le + ((le_max_left _ _).trans hsize) ((le_max_right _ _).trans hsize) + hdist hgap (hAb _ ⟨z,hzQ,rfl⟩) + (fun k ↦ hbnd z hzQ ⟨k.val,by omega⟩) + exact h + +end LocalCompactWaveData +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticeNetSmallBall.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticeNetSmallBall.lean new file mode 100644 index 0000000000000000000000000000000000000000..441ed7246dc4e5be0f01c8301caa20f0921f3413 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticeNetSmallBall.lean @@ -0,0 +1,79 @@ +import OAI.Geometry.NodalSets.Elliptic.SpatialNet +import OAI.Geometry.NodalSets.Waves.LatticeGaussianSmallBall +import OAI.Geometry.NodalSets.Waves.NetProbability + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Yau.Probability Set Filter MeasureTheory ProbabilityTheory +open scoped ContDiff Topology ENNReal +noncomputable section +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} +variable {D U : Set Coord} {m J K k0 : ℕ} +namespace LocalCompactWaveData +variable (a : LocalCompactWaveData g w S D m J K k0) + +lemma measurable_latticeSeededJet (hUD : U ⊆ D) (n : ℕ) + (hfin : Fintype (SourceGrid U n)) (seed : Coord → ℝ) (x : Coord) + (hs : DifferentiableAt ℝ seed x) + (hV : ∀ z j, DifferentiableAt ℝ (latticeWave a.cover a.beams hUD n z j) x) : + Measurable (a.latticeSeededJet hUD n hfin seed x) := by + let := hfin + let V := fun i : SourceGrid U n × Fin 3 ↦ latticeWave a.cover a.beams hUD n i.1 i.2 + have he : a.latticeSeededJet hUD n hfin seed x = fun coeff ↦ + normalizedRealJet seed n (S x) x + + pairJetMap (jetWaveCoefficients V n (S x) x) (WithLp.toLp 2 coeff) := by + funext coeff + exact seeded_gaussian_jet_eq V seed n (S x) x (fun i ↦ hV i.1 i.2) hs coeff + rw [he] + fun_prop + +theorem actual_lattice_net_small_ball (hUD : U ⊆ D) (hU : IsOpen U) + (hUb : Bornology.IsBounded U) {Q : Set Coord} (hQ : IsCompact Q) (hQU : Q ⊆ U) : + ∃ c > 0, ∃ C > 0, ∀ᶠ n : ℕ in atTop, ∃ hfin : Fintype (SourceGrid U n), + letI := hfin + ∀ E : Set Coord, E ⊆ Q → ∃ t : Finset Coord, + (↑t : Set Coord) ⊆ E ∧ (t.card : ℝ) ≤ C*(n:ℝ)^276 ∧ + (∀ x ∈ E, ∃ y ∈ t, ‖x-y‖ ≤ (4*(n:ℝ)^69)⁻¹ ∧ + sourceEuclideanNorm (x-y) ≤ (2*(n:ℝ)^69)⁻¹) ∧ + ∀ seed : Coord → ℝ, (∀ x ∈ Q, DifferentiableAt ℝ seed x) → + gaussianPairs {coeff | ∃ x ∈ t, + ‖a.latticeSeededJet hUD n hfin seed x coeff‖ ≤ 2/(n:ℝ)^56} ≤ + ENNReal.ofReal (C*(n:ℝ)^276* + (12*(Real.sqrt (c/(n:ℝ)))⁻¹*(2/(n:ℝ)^56)/Real.sqrt (2*Real.pi))^5) := by + obtain ⟨c,hc,hsmall⟩ := a.actual_lattice_gaussian_small_ball hUD hU hUb hQ hQU + obtain ⟨C,hC,hnet⟩ := jet_scale_internal_net hQ.isBounded + refine ⟨c,hc,C,hC,?_⟩ + filter_upwards [hsmall,lattice_wave_estimates a.cover a.beams hUD, + eventually_gt_atTop (0:ℕ)] with n hn hw hnpos + obtain ⟨hfin,hp⟩ := hn + let := hfin + refine ⟨hfin,?_⟩ + intro E hEQ + obtain ⟨t,ht,hcard,hcover⟩ := hnet n hnpos E hEQ + refine ⟨t,ht,hcard,hcover,?_⟩ + intro seed hs + let b := (12*(Real.sqrt (c/(n:ℝ)))⁻¹*(2/(n:ℝ)^56)/Real.sqrt (2*Real.pi))^5 + have hb : 0 ≤ b := by dsimp [b]; positivity + have hp' (x : Coord) (hx : x ∈ t) : + gaussianPairs {coeff | ‖a.latticeSeededJet hUD n hfin seed x coeff‖ ≤ 2/(n:ℝ)^56} ≤ + ENNReal.ofReal b := by + have hxQ := hEQ (ht hx) + have h := hp seed x hxQ (hs x hxQ) (2/(n:ℝ)^56) (by positivity) + rw [Measure.map_apply (a.measurable_latticeSeededJet hUD n hfin seed x (hs x hxQ) + (fun z j ↦ ((hw z j).1.differentiable (by simp)).differentiableAt)) + (measurableSet_le (by fun_prop) measurable_const)] at h + exact h + have hu := finite_small_ball_union gaussianPairs t + (fun coeff x ↦ a.latticeSeededJet hUD n hfin seed x coeff) + (2/(n:ℝ)^56) (ENNReal.ofReal b) hp' + refine hu.trans ?_ + rw [ENNReal.ofReal_mul (by positivity)] + gcongr + exact_mod_cast (ENNReal.ofReal_le_ofReal hcard) + +end LocalCompactWaveData +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticeNonmainDecay.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticeNonmainDecay.lean new file mode 100644 index 0000000000000000000000000000000000000000..37d3dde6dc533bbb69b0569a0fedd831bae42bff --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticeNonmainDecay.lean @@ -0,0 +1,72 @@ +import OAI.Geometry.NodalSets.Waves.LatticeNormalizedWeights + +namespace OAI + +namespace Yau.Probability +open Filter +open scoped Topology + +lemma tendsto_polynomial_main_center_tail (k : ℕ) (a : ℝ) (ha : 0 < a) : + Tendsto (fun n : ℕ ↦ (n:ℝ)^k*Real.exp (-a*(n:ℝ)^(1/6:ℝ))) atTop (𝓝 0) := by + have hpow : Tendsto (fun n : ℕ ↦ (n:ℝ)^(1/6:ℝ)) atTop atTop := + (tendsto_rpow_atTop (by norm_num : (0:ℝ) < 1/6)).comp tendsto_natCast_atTop_atTop + have ht := (tendsto_rpow_mul_exp_neg_mul_atTop_nhds_zero (6*(k:ℝ)) a ha).comp hpow + convert ht using 1 + funext n + simp only [Function.comp_def] + rw [← Real.rpow_mul (by positivity : (0:ℝ) ≤ n)] + rw [show (1/6:ℝ)*(6*(k:ℝ)) = (k:ℝ) by ring,Real.rpow_natCast] + +end Yau.Probability + +namespace Yau.Geometry +open Yau.Jets Yau.Probability Set Filter +open scoped ContDiff Topology +noncomputable section +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} +variable {D U : Set Coord} {m J K k0 : ℕ} +namespace LocalCompactWaveData +variable (a : LocalCompactWaveData g w S D m J K k0) + +theorem lattice_nonmain_derivatives_negligible (hUD : U ⊆ D) (hU : IsOpen U) + (hUb : Bornology.IsBounded U) {Q : Set Coord} (hQ : IsCompact Q) (hQU : Q ⊆ U) + (ε : ℝ) (hε : 0 < ε) : + ∀ᶠ n : ℕ in atTop, ∃ hfin : Fintype (SourceGrid U n), letI := hfin + ∀ x ∈ Q, ∀ k : Fin (k0+1), + (∑ i ∈ Finset.univ.filter (fun i : SourceGrid U n × Fin 3 ↦ + (n:ℝ)^(-5/12:ℝ) < sourceEuclideanNorm (x-scaledLatticePoint n i.1)), + ‖iteratedFDeriv ℝ k.val (latticeWave a.cover a.beams hUD n i.1 i.2) x‖^2) / + (a.latticeSigma hUD n x)^2 ≤ ε := by + classical + obtain ⟨c,hc,hlo⟩ := a.lattice_variance_lower_bound hUD hU hQ hQU + obtain ⟨C,hC,htail⟩ := a.lattice_nonmain_derivative_bound hUD + have hlim := (tendsto_polynomial_main_center_tail (2*k0) a.beams.c a.beams.c_pos).const_mul (C/c) + simp only [mul_zero] at hlim + filter_upwards [hlo,htail,hlim.eventually (gt_mem_nhds hε),eventually_gt_atTop (0:ℕ)] + with n hl ht hsmall hnpos + have := finite_source_grid hUb hnpos + let hfin := Fintype.ofFinite (SourceGrid U n) + refine ⟨hfin,?_⟩ + intro x hx k + have hv : 0 < a.latticeVariance hUD n x := + lt_of_lt_of_le (mul_pos hc (Real.exp_pos _)) (hl x hx) + have hn1 : (1:ℝ) ≤ n := by exact_mod_cast hnpos + have hp : (n:ℝ)^(2*k.val) ≤ (n:ℝ)^(2*k0) := + pow_le_pow_right₀ hn1 (by have := k.isLt; omega) + rw [a.latticeSigma_sq] + apply le_trans _ hsmall.le + apply (div_le_iff₀ hv).mpr + have hh := mul_le_mul_of_nonneg_left (hl x hx) + (by positivity : 0 ≤ (C/c)*((n:ℝ)^(2*k0)*Real.exp (-a.beams.c*(n:ℝ)^(1/6:ℝ)))) + calc + _ ≤ C*(n:ℝ)^(2*k.val)*Real.exp (2*(n:ℝ)*S x)*Real.exp (-a.beams.c*(n:ℝ)^(1/6:ℝ)) := ht x k + _ ≤ C*(n:ℝ)^(2*k0)*Real.exp (2*(n:ℝ)*S x)*Real.exp (-a.beams.c*(n:ℝ)^(1/6:ℝ)) := by gcongr + _ = ((C/c)*((n:ℝ)^(2*k0)*Real.exp (-a.beams.c*(n:ℝ)^(1/6:ℝ))))* + (c*Real.exp (2*(n:ℝ)*S x)) := by field_simp + _ ≤ _ := hh + +end LocalCompactWaveData +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticeNormalizedWeights.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticeNormalizedWeights.lean new file mode 100644 index 0000000000000000000000000000000000000000..db919b3fc9a050ab40cfca7403d3bc959500e9b6 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticeNormalizedWeights.lean @@ -0,0 +1,94 @@ +import OAI.Geometry.NodalSets.Waves.LatticeDerivativeTail +import OAI.Geometry.NodalSets.Waves.LatticeVarianceComparison + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Yau.Probability Set Filter +open scoped ContDiff Topology +noncomputable section +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} +variable {D U : Set Coord} {m J K k0 : ℕ} +namespace LocalCompactWaveData +variable (a : LocalCompactWaveData g w S D m J K k0) + +def latticeAlpha (hUD : U ⊆ D) (n : ℕ) [Fintype (SourceGrid U n)] + (x : Coord) (i : SourceGrid U n × Fin 3) : ℂ := + latticeWave a.cover a.beams hUD n i.1 i.2 x / (a.latticeSigma hUD n x:ℂ) + +lemma latticeAlpha_sum_sq (hUD : U ⊆ D) (n : ℕ) [Fintype (SourceGrid U n)] + (x : Coord) (s : Finset (SourceGrid U n × Fin 3)) : + ∑ i ∈ s, ‖a.latticeAlpha hUD n x i‖^2 = + (∑ i ∈ s, ‖latticeWave a.cover a.beams hUD n i.1 i.2 x‖^2) / a.latticeVariance hUD n x := by + simp only [latticeAlpha,norm_div,Complex.norm_real,Real.norm_eq_abs, + abs_of_nonneg (show 0 ≤ a.latticeSigma hUD n x from Real.sqrt_nonneg _), + div_pow,a.latticeSigma_sq,Finset.sum_div] + +lemma latticeAlpha_total (hUD : U ⊆ D) (n : ℕ) [Fintype (SourceGrid U n)] + (x : Coord) (hv : 0 < a.latticeVariance hUD n x) : + ∑ i, ‖a.latticeAlpha hUD n x i‖^2 = 1 := by + rw [a.latticeAlpha_sum_sq] + exact div_self hv.ne' + +theorem latticeAlpha_nonmain_bound (hUD : U ⊆ D) (hU : IsOpen U) + {Q : Set Coord} (hQ : IsCompact Q) (hQU : Q ⊆ U) : + ∃ C > 0, ∀ᶠ n : ℕ in atTop, ∀ [Fintype (SourceGrid U n)], ∀ x ∈ Q, + 0 < a.latticeVariance hUD n x ∧ + ∑ i ∈ Finset.univ.filter (fun i : SourceGrid U n × Fin 3 ↦ + (n:ℝ)^(-5/12:ℝ) < sourceEuclideanNorm (x-scaledLatticePoint n i.1)), + ‖a.latticeAlpha hUD n x i‖^2 ≤ C*Real.exp (-a.beams.c*(n:ℝ)^(1/6:ℝ)) := by + classical + obtain ⟨c,hc,hlo⟩ := a.lattice_variance_lower_bound hUD hU hQ hQU + obtain ⟨C,hC,htail⟩ := a.lattice_nonmain_derivative_bound hUD + refine ⟨C/c,div_pos hC hc,?_⟩ + filter_upwards [hlo,htail] with n hl ht + intro hfin x hx + have hv : 0 < a.latticeVariance hUD n x := + lt_of_lt_of_le (mul_pos hc (Real.exp_pos _)) (hl x hx) + refine ⟨hv,?_⟩ + rw [a.latticeAlpha_sum_sq] + apply (div_le_iff₀ hv).mpr + have h := ht x (0 : Fin (k0+1)) + simp only [Fin.val_zero,mul_zero,pow_zero,mul_one] at h + change (∑ i ∈ Finset.univ.filter (fun i : SourceGrid U n × Fin 3 ↦ + (n:ℝ)^(-5/12:ℝ) < sourceEuclideanNorm (x-scaledLatticePoint n i.1)), + ‖iteratedFDeriv ℝ 0 (latticeWave a.cover a.beams hUD n i.1 i.2) x‖^2) ≤ _ at h + simp only [norm_iteratedFDeriv_zero] at h + refine h.trans ?_ + have hh := mul_le_mul_of_nonneg_left (hl x hx) + (by positivity : 0 ≤ (C/c)*Real.exp (-a.beams.c*(n:ℝ)^(1/6:ℝ))) + calc + _ = ((C/c)*Real.exp (-a.beams.c*(n:ℝ)^(1/6:ℝ)))*(c*Real.exp (2*(n:ℝ)*S x)) := by field_simp + _ ≤ _ := hh + +theorem latticeAlpha_main_mass (hUD : U ⊆ D) (hU : IsOpen U) + (hUb : Bornology.IsBounded U) {Q : Set Coord} (hQ : IsCompact Q) (hQU : Q ⊆ U) + (ε : ℝ) (hε : 0 < ε) : + ∀ᶠ n : ℕ in atTop, ∃ hfin : Fintype (SourceGrid U n), letI := hfin + ∀ x ∈ Q, (∑ i, ‖a.latticeAlpha hUD n x i‖^2 = 1) ∧ + 1-ε ≤ ∑ i ∈ Finset.univ.filter (fun i : SourceGrid U n × Fin 3 ↦ + sourceEuclideanNorm (x-scaledLatticePoint n i.1) ≤ (n:ℝ)^(-5/12:ℝ)), + ‖a.latticeAlpha hUD n x i‖^2 := by + classical + obtain ⟨C,hC,hb⟩ := a.latticeAlpha_nonmain_bound hUD hU hQ hQU + have hlim := (tendsto_main_center_tail a.beams.c a.beams.c_pos).const_mul C + simp only [mul_zero] at hlim + filter_upwards [hb,hlim.eventually (gt_mem_nhds hε),eventually_gt_atTop (0:ℕ)] with n hn hsmall hnpos + have := finite_source_grid hUb hnpos + let hfin := Fintype.ofFinite (SourceGrid U n) + refine ⟨hfin,?_⟩ + intro x hx + obtain ⟨hv,ht⟩ := hn x hx + have hall := a.latticeAlpha_total hUD n x hv + refine ⟨hall,?_⟩ + have he := Finset.sum_filter_add_sum_filter_not (s := (Finset.univ : Finset (SourceGrid U n × Fin 3))) + (fun i ↦ sourceEuclideanNorm (x-scaledLatticePoint n i.1) ≤ (n:ℝ)^(-5/12:ℝ)) + (fun i ↦ ‖a.latticeAlpha hUD n x i‖^2) + simp only [not_le,hall] at he + linarith + +end LocalCompactWaveData +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticePhysicalSignSubballs.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticePhysicalSignSubballs.lean new file mode 100644 index 0000000000000000000000000000000000000000..060ea3fad5e8405463d592ab54250f766ddbfc84 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticePhysicalSignSubballs.lean @@ -0,0 +1,71 @@ +import OAI.Geometry.NodalSets.Elliptic.CompactSignEvents +import OAI.Geometry.NodalSets.Elliptic.RescaledSignTransfer +import OAI.Geometry.NodalSets.Waves.LatticeSignSubballs + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Yau.Probability Set Filter MeasureTheory ProbabilityTheory +open scoped ContDiff Topology +noncomputable section + +theorem lattice_physical_sign_subballs + (g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ) {H : Set Coord} + (hH : IsCompact H) (hg : ContinuousOn g H) + (hp : ∀ y ∈ H, ∀ v, v ≠ 0 → 0 < g y v v) : + ∃ tau : ℝ, 0 < tau ∧ tau < 1/4 ∧ ∃ r : ℝ, 0 < r ∧ + r < tau/4 ∧ r < (1-tau)/2 ∧ ∃ p : ℝ, 0 < p ∧ + ∀ (w S S0 T0 : Coord → ℝ) (D U Q : Set Coord) (m J K k0 : ℕ) + (a : LocalCompactWaveData g w S D m J K k0) (_ : H ⊆ D) (hUD : U ⊆ D), + U ⊆ H → IsOpen U → Bornology.IsBounded U → IsCompact Q → Q ⊆ U → + ContDiff ℝ ∞ S → ContDiff ℝ ∞ S0 → ContDiff ℝ ∞ T0 → 5 ≤ k0 → + ∀ gamma > 0, (∀ x ∈ Q, S0 x+gamma ≤ S x) → + ∀ᶠ n : ℕ in atTop, ∃ hfin : Fintype (SourceGrid U n), letI := hfin + ∀ x ∈ Q, ∃ j : Fin 4, + let scale := (n:ℝ)*sourceSignScale g S x + let f := fun coeff y ↦ oscillatorySeed S0 T0 n y + gaussianWaveField + (fun i : SourceGrid U n × Fin 3 ↦ latticeWave a.cover a.beams hUD n i.1 i.2) coeff y + let A : Set (((SourceGrid U n × Fin 3) × Fin 2) → ℝ) := {coeff | + (∀ y : Coord, sourceEuclideanNorm (y-x) ≤ r/scale → 0 < f coeff y) ∧ + (∀ y : Coord, sourceEuclideanNorm (y-(x+scale⁻¹ • (tau • Pi.single j 1))) ≤ r/scale → + f coeff y < 0)} + 0 < scale ∧ MeasurableSet A ∧ p ≤ gaussianPairs.real A := by + obtain ⟨tau,ht,ht4,r,hr,hrt,hr1,p,hp0,hprob⟩ := lattice_sign_subballs_probability g hH hg hp + refine ⟨tau,ht,ht4,r,hr,hrt,hr1,p,hp0,?_⟩ + intro w S S0 T0 D U Q m J K k0 a hHD hUD hUH hU hUb hQ hQU hS hS0 hT0 hd gamma hgamma hgap + obtain ⟨c,hc,C,hC,hsigma⟩ := a.lattice_sigma_comparison hUD hU hUb hQ hQU + filter_upwards [hprob w S S0 T0 D U Q m J K k0 a hHD hUD hUH hU hUb hQ hQU + hS hS0 hT0 hd gamma hgamma hgap,hsigma,eventually_gt_atTop (0:ℕ),a.estimates] with n hn hs hn0 hest + obtain ⟨hfin,hn⟩ := hn + obtain ⟨hfin',hs⟩ := hs + have heq : hfin' = hfin := Subsingleton.elim _ _ + subst hfin' + let := hfin + let : IsProbabilityMeasure (gaussianPairs (ι := SourceGrid U n × Fin 3)) := by + unfold gaussianPairs; infer_instance + refine ⟨hfin,?_⟩ + intro x hx + obtain ⟨j,hj⟩ := hn x hx + have hsc : 0 < (n:ℝ)*sourceSignScale g S x := mul_pos (by exact_mod_cast hn0) + (lt_of_lt_of_le (by norm_num : (0:ℝ) < 2) (a.source_sign_scale_lower x (hUD (hQU hx)))) + have hsig : 0 < a.latticeSigma hUD n x := + (mul_pos hc (Real.exp_pos _)).trans_le (hs x hx).1 + let V := fun i : SourceGrid U n × Fin 3 ↦ latticeWave a.cover a.beams hUD n i.1 i.2 + have hV (i : SourceGrid U n × Fin 3) : ContDiff ℝ ∞ (V i) := + (hest (latticeFrame a.cover hUD n i.1,i.2)).1 + have hmeas := seeded_gaussian_sign_balls_measurable V (oscillatorySeed S0 T0 n) + hV (oscillatorySeed_contDiff S0 T0 hS0 hT0 n) + x (x+((n:ℝ)*sourceSignScale g S x)⁻¹ • (tau • Pi.single j 1)) + (r/((n:ℝ)*sourceSignScale g S x)) (r/((n:ℝ)*sourceSignScale g S x)) + refine ⟨j,hsc,hmeas,hj.trans ?_⟩ + apply measureReal_mono + · intro coeff hcoeff + exact rescaled_sign_subballs_transfer _ S0 T0 S n (sourceSignScale g S x) + (a.latticeSigma hUD n x) x coeff hsc hsig tau r j + (fun v hv ↦ (hcoeff.1 v hv).2) (fun v hv ↦ (hcoeff.2 v hv).2) + · exact measure_ne_top _ _ + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticePlaneWaveEnergy.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticePlaneWaveEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..39dd3f0683d4d79beb9415ae84ab935a7b28b186 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticePlaneWaveEnergy.lean @@ -0,0 +1,90 @@ +import OAI.Geometry.NodalSets.Elliptic.FrequencyDerivativeEnergy +import OAI.Geometry.NodalSets.Waves.LatticeFrequencyAnnulus +import OAI.Geometry.NodalSets.Waves.LatticeFullPlaneWaveApprox +import OAI.Geometry.NodalSets.Waves.LatticeNormalizedWeights + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Set Filter +open scoped ContDiff Topology +noncomputable section +namespace LocalCompactWaveData +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} +variable {D U : Set Coord} {m J K k0 : ℕ} +variable (a : LocalCompactWaveData g w S D m J K k0) + +lemma latticePlaneWaveCoefficient_smooth (hUD : U ⊆ D) (n : ℕ) + [Fintype (SourceGrid U n)] (x : Coord) (s : ℝ) (i : SourceGrid U n × Fin 3) : + ContDiff ℝ ∞ (a.latticePlaneWaveCoefficient hUD n x s i) := by + classical + unfold latticePlaneWaveCoefficient + split_ifs + · exact contDiff_const.mul (planeWave_smooth _ _) + · exact contDiff_const + +lemma latticePlaneWaveCoefficient_energy (hUD : U ⊆ D) (n : ℕ) + [Fintype (SourceGrid U n)] (x : Coord) (s : ℝ) {B : ℝ} (hB : 1 ≤ B) + (hm : ∑ i : SourceGrid U n × Fin 3, ‖a.latticeAlpha hUD n x i‖^2 ≤ 1) + (hb : ∀ i : SourceGrid U n × Fin 3, + sourceEuclideanNorm (x-scaledLatticePoint n i.1) ≤ (n:ℝ)^(-5/12:ℝ) → + sourceEuclideanNorm (sourceFrequency (g (scaledLatticePoint n i.1)) + (a.cover.triple.q (latticeFrame a.cover hUD n i.1) i.2) s) ≤ B) + (k : ℕ) (v : Coord) : + ∑ i : SourceGrid U n × Fin 3, + ‖iteratedFDeriv ℝ k (a.latticePlaneWaveCoefficient hUD n x s i) v‖^2 ≤ + (k.factorial*(4*B)^k)^2 := by + classical + have hbound (i : SourceGrid U n × Fin 3) : + ‖iteratedFDeriv ℝ k (a.latticePlaneWaveCoefficient hUD n x s i) v‖ ≤ + ‖a.latticeAlpha hUD n x i‖*(k.factorial*(4*B)^k) := by + unfold latticePlaneWaveCoefficient + split_ifs with hi + · exact weighted_planeWave_derivative_bound _ _ s hB (hb i hi) k v + · simp only [iteratedFDeriv_fun_zero, Pi.zero_apply, norm_zero] + positivity + calc + _ ≤ ∑ i : SourceGrid U n × Fin 3, + (‖a.latticeAlpha hUD n x i‖*(k.factorial*(4*B)^k))^2 := + Finset.sum_le_sum (fun i _ ↦ pow_le_pow_left₀ (norm_nonneg _) (hbound i) 2) + _ = (∑ i : SourceGrid U n × Fin 3, ‖a.latticeAlpha hUD n x i‖^2)* + (k.factorial*(4*B)^k)^2 := by simp only [mul_pow,Finset.sum_mul] + _ ≤ _ := by nlinarith [sq_nonneg ((k.factorial:ℝ)*(4*B)^k)] +end LocalCompactWaveData + +theorem lattice_planeWave_derivative_energy + (g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ) {H : Set Coord} + (hH : IsCompact H) (hg : ContinuousOn g H) + (hp : ∀ y ∈ H, ∀ v, v ≠ 0 → 0 < g y v v) (d : ℕ) : + ∃ C > 0, ∀ (w S : Coord → ℝ) (D U Q : Set Coord) (m J K k0 : ℕ) + (a : LocalCompactWaveData g w S D m J K k0) (_ : H ⊆ D) (hUD : U ⊆ D), + U ⊆ H → IsOpen U → Bornology.IsBounded U → IsCompact Q → Q ⊆ U → + ∀ᶠ n : ℕ in atTop, ∃ hfin : Fintype (SourceGrid U n), letI := hfin + ∀ x ∈ Q, ∀ v : Coord, ∀ k : ℕ, k ≤ d → + ∑ i : SourceGrid U n × Fin 3, + ‖iteratedFDeriv ℝ k + (a.latticePlaneWaveCoefficient hUD n x (sourceSignScale g S x) i) v‖^2 ≤ C := by + obtain ⟨κ,hκ,B,hB,hann⟩ := lattice_main_frequency_annulus g hH hg hp + let B' := max 1 B + let C := ((d.factorial:ℝ)*(4*B')^d)^2 + have hB' : 1 ≤ B' := le_max_left _ _ + have h4 : 1 ≤ 4*B' := by linarith + refine ⟨C,by dsimp [C]; positivity,?_⟩ + intro w S D U Q m J K k0 a hHD hUD hUH hU hUb hQ hQU + filter_upwards [hann w S D U m J K k0 a hHD hUD hUH, + a.latticeAlpha_main_mass hUD hU hUb hQ hQU (1/2) (by norm_num)] with n hn hm + obtain ⟨hfin,hm⟩ := hm + let := hfin + refine ⟨hfin,?_⟩ + intro x hx v k hk + apply (a.latticePlaneWaveCoefficient_energy hUD n x _ hB' (by rw [(hm x hx).1]) + (fun i hi ↦ ((hn x (hUH (hQU hx)) i hi).2).trans (le_max_right _ _)) k v).trans + have hf : (k.factorial:ℝ) ≤ d.factorial := by exact_mod_cast Nat.factorial_le hk + have hpow := pow_le_pow_right₀ h4 hk + dsimp [C] + gcongr + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticePlaneWaveJets.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticePlaneWaveJets.lean new file mode 100644 index 0000000000000000000000000000000000000000..b1496c6aa4a9aa383b96ca2d0bb9e852edeeab1b --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticePlaneWaveJets.lean @@ -0,0 +1,73 @@ +import OAI.Geometry.NodalSets.Waves.LatticeNormalizedWeights +import OAI.Geometry.NodalSets.Waves.PlaneWaveJets2 + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Set Filter +open scoped ContDiff Topology +noncomputable section +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} +variable {D U : Set Coord} {m J K k0 : ℕ} +namespace LocalCompactWaveData +variable (a : LocalCompactWaveData g w S D m J K k0) + +theorem lattice_main_coefficient_jets (hUD : U ⊆ D) (R : ℝ) (hR : 0 ≤ R) + (d0 : ℕ) (e : ℝ) (he : 0 < e) : + ∀ᶠ n : ℕ in atTop, ∀ x ∈ D, ∀ s : ℝ, 1 ≤ s → + ∀ (sigma : ℝ) (v : Coord), ‖v‖ ≤ R → ∀ i : SourceGrid U n × Fin 3, + sourceEuclideanNorm (x-scaledLatticePoint n i.1) ≤ (n:ℝ)^(-5/12:ℝ) → ∀ k, k ≤ d0 → + ‖iteratedFDeriv ℝ k (fun z ↦ normalizedRescaling (latticeWave a.cover a.beams hUD n i.1 i.2) S n s sigma x z - + (latticeWave a.cover a.beams hUD n i.1 i.2 x/(sigma:ℂ))* + planeWave (g (scaledLatticePoint n i.1) (a.cover.triple.q (latticeFrame a.cover hUD n i.1) i.2)) s z) v‖ ≤ + e*‖latticeWave a.cover a.beams hUD n i.1 i.2 x/(sigma:ℂ)‖ := by + have hy := continuous_coverSourceCenter a.cover + have hp0 t := a.nonzero_gradient _ (a.cover.center t).property + filter_upwards [a.beams.uniform_main_coefficient_jets a.smooth_G a.positive_G + a.smooth_A hy hp0 R hR d0 e he] with n hn + intro x hx s hs sigma v hv i hi k hk + have hh := hn (latticeFrame a.cover hUD n i.1,i.2) x s hs + (by simpa only [latticeFrame_center] using hi) sigma v hv k hk + have hxA := (a.germ x (a.centers_E hx)).2.2 + have hyG := (a.germ (scaledLatticePoint n i.1) (a.centers_E (hUD i.1.property))).1 + simpa only [latticeFrame_center,hyG.self_of_nhds,latticeWave,TripleSourceWaveData.wave, + normalizedRescaling,rescaledSeedNormalizer,hxA.fderiv_eq] using hh + +theorem lattice_main_jet_approximation (hUD : U ⊆ D) (hU : IsOpen U) + (hUb : Bornology.IsBounded U) {Q : Set Coord} (hQ : IsCompact Q) (hQU : Q ⊆ U) + (R : ℝ) (hR : 0 ≤ R) (d0 : ℕ) (e : ℝ) (he : 0 < e) : + ∀ᶠ n : ℕ in atTop, ∃ hfin : Fintype (SourceGrid U n), letI := hfin + ∀ x ∈ Q, ∀ s : ℝ, 1 ≤ s → ∀ v : Coord, ‖v‖ ≤ R → ∀ k, k ≤ d0 → + ∑ i ∈ Finset.univ.filter (fun i : SourceGrid U n × Fin 3 ↦ + sourceEuclideanNorm (x-scaledLatticePoint n i.1) ≤ (n:ℝ)^(-5/12:ℝ)), + ‖iteratedFDeriv ℝ k (fun z ↦ normalizedRescaling (latticeWave a.cover a.beams hUD n i.1 i.2) S n s + (a.latticeSigma hUD n x) x z - a.latticeAlpha hUD n x i * + planeWave (g (scaledLatticePoint n i.1) (a.cover.triple.q (latticeFrame a.cover hUD n i.1) i.2)) s z) v‖^2 ≤ e := by + classical + filter_upwards [a.lattice_main_coefficient_jets hUD R hR d0 (Real.sqrt e) (Real.sqrt_pos.mpr he), + a.latticeAlpha_main_mass hUD hU hUb hQ hQU 1 zero_lt_one] with n hn hmass + obtain ⟨hfin,hmass⟩ := hmass + let := hfin + refine ⟨hfin,?_⟩ + intro x hx s hs v hv k hk + let I := Finset.univ.filter (fun i : SourceGrid U n × Fin 3 ↦ + sourceEuclideanNorm (x-scaledLatticePoint n i.1) ≤ (n:ℝ)^(-5/12:ℝ)) + have hsum : ∑ i ∈ I, ‖a.latticeAlpha hUD n x i‖^2 ≤ 1 := by + rw [← (hmass x hx).1] + exact Finset.sum_le_sum_of_subset_of_nonneg (Finset.filter_subset _ _) (fun _ _ _ ↦ sq_nonneg _) + calc + _ ≤ ∑ i ∈ I, e*‖a.latticeAlpha hUD n x i‖^2 := by + apply Finset.sum_le_sum + intro i hi + have hb := hn x (hUD (hQU hx)) s hs (a.latticeSigma hUD n x) v hv i (Finset.mem_filter.mp hi).2 k hk + have hh := pow_le_pow_left₀ (norm_nonneg _) hb 2 + rw [mul_pow,Real.sq_sqrt he.le] at hh + exact hh + _ = e*(∑ i ∈ I, ‖a.latticeAlpha hUD n x i‖^2) := by rw [Finset.mul_sum] + _ ≤ e := by nlinarith + +end LocalCompactWaveData +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticeProbabilityRates.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticeProbabilityRates.lean new file mode 100644 index 0000000000000000000000000000000000000000..162186ee4deda30b8a5e8c241d7a193496409af6 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticeProbabilityRates.lean @@ -0,0 +1,65 @@ +import OAI.Geometry.NodalSets.Coefficients.GaussianCoefficientTail +import OAI.Geometry.NodalSets.Elliptic.NetDecay +import OAI.Geometry.NodalSets.Waves.LatticeCount +import OAI.Geometry.NodalSets.Waves.LatticeNetSmallBall + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Yau.Probability Set Filter MeasureTheory ProbabilityTheory +open scoped Topology ENNReal +noncomputable section + +lemma lattice_coefficient_event_failure {U : Set Coord} (hU : Bornology.IsBounded U) : + ∃ C > 0, ∀ n : ℕ, 0 < n → ∀ hfin : Fintype (SourceGrid U n), + letI := hfin + (gaussianPairs (ι := SourceGrid U n × Fin 3)) (coefficientEvent (n:ℝ))ᶜ ≤ + ENNReal.ofReal (C*(n:ℝ)^2*Real.exp (-(n:ℝ)^2/8)) := by + obtain ⟨C,hC,hcard⟩ := source_coefficient_card_bound hU + refine ⟨4*C,by positivity,?_⟩ + intro n hn hfin + let := hfin + have h := coefficient_event_failure (ι := SourceGrid U n × Fin 3) + (r := (n:ℝ)) (by positivity) + refine h.trans (ENNReal.ofReal_le_ofReal ?_) + have hc : (Fintype.card (SourceGrid U n × Fin 3):ℝ) ≤ C*(n:ℝ)^2 := by + simpa only [Nat.card_eq_fintype_card] using hcard n hn + nlinarith [mul_le_mul_of_nonneg_right hc (Real.exp_nonneg (-(n:ℝ)^2/8))] + +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} +variable {D U : Set Coord} {m J K k0 : ℕ} +namespace LocalCompactWaveData +variable (a : LocalCompactWaveData g w S D m J K k0) + +theorem actual_lattice_net_failure_rate (hUD : U ⊆ D) (hU : IsOpen U) + (hUb : Bornology.IsBounded U) {Q : Set Coord} (hQ : IsCompact Q) (hQU : Q ⊆ U) : + ∃ B > 0, ∀ᶠ n : ℕ in atTop, ∃ hfin : Fintype (SourceGrid U n), + letI := hfin + ∀ E : Set Coord, E ⊆ Q → ∃ t : Finset Coord, + (↑t : Set Coord) ⊆ E ∧ + (∀ x ∈ E, ∃ y ∈ t, ‖x-y‖ ≤ (4*(n:ℝ)^69)⁻¹ ∧ + sourceEuclideanNorm (x-y) ≤ (2*(n:ℝ)^69)⁻¹) ∧ + ∀ seed : Coord → ℝ, (∀ x ∈ Q, DifferentiableAt ℝ seed x) → + gaussianPairs {coeff | ∃ x ∈ t, + ‖a.latticeSeededJet hUD n hfin seed x coeff‖ ≤ 2/(n:ℝ)^56} ≤ + ENNReal.ofReal (B/((n:ℝ)*Real.sqrt n)) := by + obtain ⟨c,hc,C,hC,hnet⟩ := a.actual_lattice_net_small_ball hUD hU hUb hQ hQU + refine ⟨C*(24/(Real.sqrt c*Real.sqrt (2*Real.pi)))^5,by positivity,?_⟩ + filter_upwards [hnet,eventually_gt_atTop (0:ℕ)] with n hn hnpos + obtain ⟨hfin,hb⟩ := hn + let := hfin + refine ⟨hfin,?_⟩ + intro E hEQ + obtain ⟨t,ht,_,hcover,hprob⟩ := hb E hEQ + refine ⟨t,ht,hcover,?_⟩ + intro seed hs + have h := hprob seed hs + rw [net_small_ball_rate C c n hc (by positivity)] at h + exact h + +end LocalCompactWaveData + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticeSignMargin.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticeSignMargin.lean new file mode 100644 index 0000000000000000000000000000000000000000..ead70b40728139118c0be6267e4e642c8dbbe7b9 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticeSignMargin.lean @@ -0,0 +1,82 @@ +import OAI.Geometry.NodalSets.Elliptic.SignScaleSeed +import OAI.Geometry.NodalSets.Waves.LatticeActualTwoPoint +import OAI.Geometry.NodalSets.Waves.LatticeSignValueBounds +import OAI.Geometry.NodalSets.Waves.TwoValueSignProbability + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Yau.Probability MeasureTheory ProbabilityTheory Set Filter +open scoped ContDiff Topology ENNReal +noncomputable section + +theorem lattice_sign_margin_probability + (g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ) {H : Set Coord} + (hH : IsCompact H) (hg : ContinuousOn g H) + (hp : ∀ y ∈ H, ∀ v, v ≠ 0 → 0 < g y v v) : + ∃ tau : ℝ, 0 < tau ∧ tau < 1/4 ∧ ∃ p : ℝ≥0∞, 0 < p ∧ + ∀ (w S S0 T0 : Coord → ℝ) (D U Q : Set Coord) (m J K k0 : ℕ) + (a : LocalCompactWaveData g w S D m J K k0) (_ : H ⊆ D) (hUD : U ⊆ D), + U ⊆ H → IsOpen U → Bornology.IsBounded U → IsCompact Q → Q ⊆ U → + ContDiff ℝ ∞ S → ContDiff ℝ ∞ S0 → ContDiff ℝ ∞ T0 → + ∀ gamma > 0, (∀ x ∈ Q, S0 x+gamma ≤ S x) → + ∀ᶠ n : ℕ in atTop, ∃ hfin : Fintype (SourceGrid U n), letI := hfin + ∀ x ∈ Q, ∃ j : Fin 4, + let F := rescaledGaussianField + (fun i : SourceGrid U n × Fin 3 ↦ latticeWave a.cover a.beams hUD n i.1 i.2) + S0 T0 S n (sourceSignScale g S x) (a.latticeSigma hUD n x) x + p ≤ gaussianPairs {coeff | 1 ≤ F coeff 0 ∧ F coeff (tau • Pi.single j 1) ≤ -1} := by + obtain ⟨tau,ht,ht4,d,hd,henergy⟩ := lattice_actual_two_point_energy g hH hg hp + obtain ⟨p,hp,hprob⟩ := two_value_sign_probability d 2 hd (by norm_num) + refine ⟨tau,ht,ht4,p,hp,?_⟩ + intro w S S0 T0 D U Q m J K k0 a hHD hUD hUH hU hUb hQ hQU hS hS0 hT0 gamma hgamma hgap + filter_upwards [henergy w S D U Q m J K k0 a hHD hUD hUH hU hUb hQ hQU hS, + a.lattice_sign_coefficient_upper hUD hU hUb hQ hQU hS, + a.sign_scale_seed_decay hUD hU hUb hQ hQU hS S0 T0 hS0 hT0 gamma hgamma hgap 0 1 (by norm_num)] + with n he hu hs + obtain ⟨hfin,he⟩ := he + obtain ⟨hfin',hu⟩ := hu + obtain ⟨hfin'',hs⟩ := hs + have heq : hfin' = hfin := Subsingleton.elim _ _ + have heq' : hfin'' = hfin := Subsingleton.elim _ _ + subst hfin' + subst hfin'' + let := hfin + refine ⟨hfin,?_⟩ + intro x hx + obtain ⟨j,hj⟩ := he x hx + let v : Coord := tau • Pi.single j 1 + let seed := rescaledSeed S0 T0 S n (sourceSignScale g S x) (a.latticeSigma hUD n x) x + let A := fun i : SourceGrid U n × Fin 3 ↦ normalizedRescaling + (latticeWave a.cover a.beams hUD n i.1 i.2) S n (sourceSignScale g S x) + (a.latticeSigma hUD n x) x + let mean : EuclideanSpace ℝ (Fin 2) := WithLp.toLp 2 ![seed 0,seed v] + have hvnorm : ‖v‖ = tau := by + simp [v,norm_smul,Real.norm_eq_abs,abs_of_pos ht,Pi.norm_single] + have hv : sourceEuclideanNorm v ≤ 2 := (sourceEuclideanNorm_le v).trans (by rw [hvnorm]; linarith) + have hv0 : sourceEuclideanNorm (0:Coord) ≤ 2 := by simp [sourceEuclideanNorm] + have hs0 := hs x hx 0 hv0 (0 : Fin 1) + have hs1 := hs x hx v hv (0 : Fin 1) + simp only [Fin.val_zero,norm_iteratedFDeriv_zero] at hs0 hs1 + change ‖seed 0‖ ≤ 1 at hs0 + change ‖seed v‖ ≤ 1 at hs1 + have hmean : ‖mean‖ ≤ 2 := by + have hsq : ‖mean‖^2 = (seed 0)^2+(seed v)^2 := by + simp [mean,EuclideanSpace.real_norm_sq_eq,Fin.sum_univ_two] + have h0 := pow_le_pow_left₀ (norm_nonneg _) hs0 2 + have h1 := pow_le_pow_left₀ (norm_nonneg _) hs1 2 + simp only [Real.norm_eq_abs,sq_abs,one_pow] at h0 h1 + nlinarith [norm_nonneg mean] + have hb := hprob (fun i ↦ A i 0) (fun i ↦ A i v) mean hmean + (hu x hx 0 (by simp)) (hu x hx v (by rw [hvnorm]; linarith)) hj + refine ⟨j,?_⟩ + convert hb using 1 + congr 1 + ext coeff + simp [rescaledGaussianField_decomposition,mean,seed,A,v, + pairLinearSum_eq_complex,gaussianWaveField,Complex.re_sum] + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticeSignSubballs.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticeSignSubballs.lean new file mode 100644 index 0000000000000000000000000000000000000000..3174b7413ef178765f867f86e7a9aaa5a17a6ba2 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticeSignSubballs.lean @@ -0,0 +1,78 @@ +import OAI.Geometry.NodalSets.Waves.LatticeGradientExpectation +import OAI.Geometry.NodalSets.Waves.LatticeSignMargin +import OAI.Geometry.NodalSets.Waves.SignSubballProbability + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Yau.Probability Set Filter MeasureTheory ProbabilityTheory +open scoped ContDiff Topology +noncomputable section + +theorem lattice_sign_subballs_probability + (g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ) {H : Set Coord} + (hH : IsCompact H) (hg : ContinuousOn g H) + (hp : ∀ y ∈ H, ∀ v, v ≠ 0 → 0 < g y v v) : + ∃ tau : ℝ, 0 < tau ∧ tau < 1/4 ∧ ∃ r : ℝ, 0 < r ∧ + r < tau/4 ∧ r < (1-tau)/2 ∧ ∃ p : ℝ, 0 < p ∧ + ∀ (w S S0 T0 : Coord → ℝ) (D U Q : Set Coord) (m J K k0 : ℕ) + (a : LocalCompactWaveData g w S D m J K k0) (_ : H ⊆ D) (hUD : U ⊆ D), + U ⊆ H → IsOpen U → Bornology.IsBounded U → IsCompact Q → Q ⊆ U → + ContDiff ℝ ∞ S → ContDiff ℝ ∞ S0 → ContDiff ℝ ∞ T0 → 5 ≤ k0 → + ∀ gamma > 0, (∀ x ∈ Q, S0 x+gamma ≤ S x) → + ∀ᶠ n : ℕ in atTop, ∃ hfin : Fintype (SourceGrid U n), letI := hfin + ∀ x ∈ Q, ∃ j : Fin 4, + let F := rescaledGaussianField + (fun i : SourceGrid U n × Fin 3 ↦ latticeWave a.cover a.beams hUD n i.1 i.2) + S0 T0 S n (sourceSignScale g S x) (a.latticeSigma hUD n x) x + p ≤ gaussianPairs.real {coeff | + (∀ v : Coord, sourceEuclideanNorm v ≤ r → + sourceEuclideanNorm v ≤ 1 ∧ 0 < F coeff v) ∧ + (∀ v : Coord, sourceEuclideanNorm (v-tau • Pi.single j 1) ≤ r → + sourceEuclideanNorm v ≤ 1 ∧ F coeff v < 0)} := by + obtain ⟨tau,ht,ht4,p,hp0,hmargin⟩ := lattice_sign_margin_probability g hH hg hp + obtain ⟨q,hq,hq1,hqp⟩ := positive_real_probability_floor hp0 + obtain ⟨C,hC,hmean⟩ := lattice_gradient_expectation g hH hg hp + obtain ⟨L,hL,r,hr,hrt,hr1,hrL,hCL⟩ := sign_subball_constants ht (by linarith) hq hC.le + refine ⟨tau,ht,ht4,r,hr,hrt,hr1,q/2,by positivity,?_⟩ + intro w S S0 T0 D U Q m J K k0 a hHD hUD hUH hU hUb hQ hQU hS hS0 hT0 hd gamma hgamma hgap + filter_upwards [hmargin w S S0 T0 D U Q m J K k0 a hHD hUD hUH hU hUb hQ hQU + hS hS0 hT0 gamma hgamma hgap, + hmean w S S0 T0 D U Q m J K k0 a hHD hUD hUH hU hUb hQ hQU + hS hS0 hT0 hd gamma hgamma hgap,a.estimates] with n hn hm hest + obtain ⟨hfin,hn⟩ := hn + obtain ⟨hfin',hm⟩ := hm + have heq : hfin' = hfin := Subsingleton.elim _ _ + subst hfin' + let := hfin + let : IsProbabilityMeasure (gaussianPairs (ι := SourceGrid U n × Fin 3)) := by + unfold gaussianPairs; infer_instance + refine ⟨hfin,?_⟩ + intro x hx + obtain ⟨j,hj⟩ := hn x hx + obtain ⟨G,hGc,hGi,hG0,hGC,hGe⟩ := hm x hx + let V := fun i : SourceGrid U n × Fin 3 ↦ latticeWave a.cover a.beams hUD n i.1 i.2 + let F := rescaledGaussianField V S0 T0 S n (sourceSignScale g S x) (a.latticeSigma hUD n x) x + have hV (i : SourceGrid U n × Fin 3) : ContDiff ℝ ∞ (V i) := + (hest (latticeFrame a.cover hUD n i.1,i.2)).1 + have hF (coeff) : ContDiff ℝ ∞ (F coeff) := by + have he : F coeff = fun z ↦ rescaledSeed S0 T0 S n (sourceSignScale g S x) + (a.latticeSigma hUD n x) x z + gaussianWaveField + (fun i ↦ normalizedRescaling (V i) S n (sourceSignScale g S x) + (a.latticeSigma hUD n x) x) coeff z := by + ext z + exact rescaledGaussianField_decomposition _ _ _ _ _ _ _ _ _ _ + rw [he] + exact (rescaledSeed_smooth _ _ _ hS0 hT0 _ _ _ _).add + (gaussianWaveField_contDiff _ _ (fun i ↦ normalizedRescaling_smooth _ (hV i) _ _ _ _ _)) + have hqA : q ≤ gaussianPairs.real {coeff | 1 ≤ F coeff 0 ∧ F coeff (tau • Pi.single j 1) ≤ -1} := by + have hh := ENNReal.toReal_mono (measure_ne_top _ _) (hqp.trans hj) + simpa only [ENNReal.toReal_ofReal hq.le,Measure.real] using hh + refine ⟨j,?_⟩ + exact sign_subballs_probability gaussianPairs F hF G hGi hG0 ht.le hr.le hL + (by linarith) hrL hGC hCL (fun coeff hcoeff ↦ (hGe coeff L hL.le).mp hcoeff) j hqA + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticeSignValueBounds.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticeSignValueBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..f9942ef0839c78674404ac22a1cdd5ab5329b562 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticeSignValueBounds.lean @@ -0,0 +1,57 @@ +import OAI.Geometry.NodalSets.Coefficients.TwoPointCoefficientEnergy +import OAI.Geometry.NodalSets.Elliptic.SignScaleSeed +import OAI.Geometry.NodalSets.Waves.LatticeTwoPointCovariance + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Yau.Probability MeasureTheory ProbabilityTheory Set Filter +open scoped ContDiff Topology +noncomputable section +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} +variable {D U : Set Coord} {m J K k0 : ℕ} +namespace LocalCompactWaveData +variable (a : LocalCompactWaveData g w S D m J K k0) + +theorem lattice_sign_coefficient_upper (hUD : U ⊆ D) (hU : IsOpen U) + (hUb : Bornology.IsBounded U) {Q : Set Coord} (hQ : IsCompact Q) (hQU : Q ⊆ U) + (hS : ContDiff ℝ ∞ S) : + ∀ᶠ n : ℕ in atTop, ∃ hfin : Fintype (SourceGrid U n), letI := hfin + ∀ x ∈ Q, ∀ v : Coord, ‖v‖ ≤ 2 → + ∑ i : SourceGrid U n × Fin 3, + ‖normalizedRescaling (latticeWave a.cover a.beams hUD n i.1 i.2) + S n (sourceSignScale g S x) (a.latticeSigma hUD n x) x v‖^2 ≤ 4 := by + classical + filter_upwards [a.lattice_full_jet_approximation hUD hU hUb hQ hQU hS 2 (by norm_num) 1 (by norm_num), + a.latticeAlpha_main_mass hUD hU hUb hQ hQU (1/2) (by norm_num)] with n herr hm + obtain ⟨hfin,herr⟩ := herr + obtain ⟨hfin',hm⟩ := hm + have heq : hfin' = hfin := Subsingleton.elim _ _ + subst hfin' + let := hfin + refine ⟨hfin,?_⟩ + intro x hx v hv + let W := a.latticePlaneWaveCoefficient hUD n x (sourceSignScale g S x) + let A := fun i : SourceGrid U n × Fin 3 ↦ normalizedRescaling + (latticeWave a.cover a.beams hUD n i.1 i.2) S n (sourceSignScale g S x) + (a.latticeSigma hUD n x) x + have hs : 1 ≤ sourceSignScale g S x := by + linarith [a.source_sign_scale_lower x (hUD (hQU hx))] + have herr' := herr x hx _ hs v hv (0 : Fin (k0+1)) + simp +instances only [Fin.val_zero,norm_iteratedFDeriv_zero] at herr' + have hW : ∑ i, ‖W i v‖^2 ≤ 1 := by + rw [← variance_pairLinearSum,← gaussianWaveField_eq_pair,a.lattice_plane_wave_variance,← (hm x hx).1] + exact Finset.sum_le_sum_of_subset_of_nonneg (Finset.filter_subset _ _) (fun i _ _ ↦ sq_nonneg _) + have hh (i : SourceGrid U n × Fin 3) : ‖A i v‖^2 ≤ 2*‖A i v-W i v‖^2+2*‖W i v‖^2 := by + simpa only [sub_add_cancel] using complex_norm_add_sq_bound (A i v-W i v) (W i v) + have hsum := Finset.sum_le_sum (fun i (_ : i ∈ (Finset.univ : Finset (SourceGrid U n × Fin 3))) ↦ hh i) + simp only [Finset.sum_add_distrib,← Finset.mul_sum] at hsum + change (∑ i, ‖A i v‖^2) ≤ 4 + change (∑ i, ‖A i v-W i v‖^2) ≤ 1 at herr' + linarith + +end LocalCompactWaveData +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticeSourceWaves.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticeSourceWaves.lean new file mode 100644 index 0000000000000000000000000000000000000000..0bca450103c1284cf064b7c3e4a58a27b79997d9 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticeSourceWaves.lean @@ -0,0 +1,82 @@ +import OAI.Geometry.NodalSets.Waves.CompactSourceWaves + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Set Filter +open scoped ContDiff Topology +noncomputable section + +def scaledLatticePoint (n : ℕ) (z : Fin 4 → ℤ) : Coord := + (n:ℝ)^(-1/2:ℝ) • (fun i ↦ (z i:ℝ)) + +abbrev SourceGrid (U : Set Coord) (n : ℕ) := {z : Fin 4 → ℤ // scaledLatticePoint n z ∈ U} + +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} +variable {D U : Set Coord} {m J K k0 : ℕ} + +def selectFrame (d : SourceCompactFrameCover g S D) (x : D) : d.Parameter := + Classical.choose (d.surjective_center x) + +lemma selectFrame_center (d : SourceCompactFrameCover g S D) (x : D) : + coverSourceCenter d (selectFrame d x) = x := + congrArg Subtype.val (Classical.choose_spec (d.surjective_center x)) + +def latticeFrame (d : SourceCompactFrameCover g S D) (hUD : U ⊆ D) + (n : ℕ) (z : SourceGrid U n) : d.Parameter := + selectFrame d ⟨scaledLatticePoint n z,hUD z.property⟩ + +lemma latticeFrame_center (d : SourceCompactFrameCover g S D) (hUD : U ⊆ D) + (n : ℕ) (z : SourceGrid U n) : + coverSourceCenter d (latticeFrame d hUD n z) = scaledLatticePoint n z := + selectFrame_center d _ + +def latticeWave (d : SourceCompactFrameCover g S D) + (b : TripleSourceWaveData g w S (coverSourceCenter d) d.triple m J K k0) + (hUD : U ⊆ D) (n : ℕ) (z : SourceGrid U n) (j : Fin 3) : Coord → ℂ := + chartPushforward (b.F (latticeFrame d hUD n z,j)) + (coordinateWave b.phi b.A J (n:ℝ) (latticeFrame d hUD n z,j)) + +theorem lattice_wave_estimates (d : SourceCompactFrameCover g S D) + (b : TripleSourceWaveData g w S (coverSourceCenter d) d.triple m J K k0) + (hUD : U ⊆ D) : + ∀ᶠ n : ℕ in atTop, ∀ (z : SourceGrid U n) (j : Fin 3), + ContDiff ℝ ∞ (latticeWave d b hUD n z j) ∧ HasCompactSupport (latticeWave d b hUD n z j) ∧ + tsupport (latticeWave d b hUD n z j) ⊆ + {x | sourceEuclideanNorm (x-scaledLatticePoint n z) ≤ b.R*(n:ℝ)^(-1/3:ℝ)} ∧ + ∀ x : Coord, + (∀ k : Fin (k0+1), ‖iteratedFDeriv ℝ k.val (latticeWave d b hUD n z j) x‖ ≤ + b.Cw*(n:ℝ)^k.val*Real.exp ((n:ℝ)*S x-b.c*(n:ℝ)*(sourceEuclideanNorm (x-scaledLatticePoint n z))^2)) ∧ + DerivativeBound k0 (fun x ↦ sourceWeightedOperator g w (latticeWave d b hUD n z j) x + + ((4:ℂ)*(n:ℂ)^2+6*(n:ℂ))*latticeWave d b hUD n z j x) x + (b.Cr*(n:ℝ)^(-(K:ℝ))*Real.exp ((n:ℝ)*S x)) := by + filter_upwards [b.estimates] with n hn + intro z j + simpa only [latticeWave,latticeFrame_center] using hn (latticeFrame d hUD n z,j) + +theorem lattice_direction_properties (d : SourceCompactFrameCover g S D) + (hUD : U ⊆ D) (n : ℕ) (z : SourceGrid U n) : + let x := scaledLatticePoint n z + let q := d.triple.q (latticeFrame d hUD n z) + LinearIndependent ℝ q ∧ ∀ j, + g x (metricGradient g S x) (q j) = 0 ∧ + g x (q j) (q j) = g x (metricGradient g S x) (metricGradient g S x)+4 ∧ + 0 < sourceHessian g S x (metricGradient g S x) (metricGradient g S x)+sourceHessian g S x (q j) (q j) := by + have he := latticeFrame_center d hUD n z + refine ⟨d.triple.independent _,?_⟩ + intro j + have hp := d.triple.perpendicular (latticeFrame d hUD n z) j + have hl := d.triple.length (latticeFrame d hUD n z) j + have hs := d.triple.strict (latticeFrame d hUD n z) j + change g (coverSourceCenter d _) (metricGradient g S (coverSourceCenter d _)) _ = 0 at hp + change g (coverSourceCenter d _) _ _ = g (coverSourceCenter d _) (metricGradient g S (coverSourceCenter d _)) + (metricGradient g S (coverSourceCenter d _))+4 at hl + change 0 < sourceHessian g S (coverSourceCenter d _) (metricGradient g S (coverSourceCenter d _)) + (metricGradient g S (coverSourceCenter d _))+sourceHessian g S (coverSourceCenter d _) _ _ at hs + rw [he] at hp hl hs + exact ⟨hp,hl,hs⟩ + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticeSphereExtension.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticeSphereExtension.lean new file mode 100644 index 0000000000000000000000000000000000000000..08c79cf94493964bd6302ae4f9cf704b27870461 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticeSphereExtension.lean @@ -0,0 +1,46 @@ +import OAI.Geometry.NodalSets.Charts.SeedChartScalarExtension +import OAI.Geometry.NodalSets.Coefficients.LatticeResidualSupport + +namespace OAI + +namespace Yau.Target +open Manifold Yau.Geometry Yau.Jets Yau.Probability Set Filter +open scoped ContDiff Topology +noncomputable section +variable {g : Yau.Jets.Coord → Yau.Jets.Coord →L[ℝ] Yau.Jets.Coord →L[ℝ] ℝ} +variable {w S : Yau.Jets.Coord → ℝ} {D U : Set Yau.Jets.Coord} {m J K k0 : ℕ} +variable (b : LocalCompactWaveData g w S D m J K k0) + +theorem literal_lattice_sphere_extension (hD : IsCompact D) (hUD : U ⊆ D) + (hUb : Bornology.IsBounded U) {Ω : Set Yau.Jets.Coord} (hΩ : IsOpen Ω) (hDΩ : D ⊆ Ω) : + ∃ Q : Set Yau.Jets.Coord, IsCompact Q ∧ Q ⊆ Ω ∧ + ∀ᶠ n : ℕ in atTop, ∃ hfin : Fintype (SourceGrid U n), + letI := hfin + ∀ coeff : ((SourceGrid U n × Fin 3) × Fin 2) → ℝ, + let v := gaussianWaveField + (fun i : SourceGrid U n × Fin 3 ↦ latticeWave b.cover b.beams hUD n i.1 i.2) coeff + ContDiff ℝ ∞ (fun x ↦ seedCoordinateField n x+v x) → + ∃ u : Base → ℝ, ContMDiff (𝓡 4) 𝓘(ℝ,ℝ) ∞ u ∧ + tsupport (u-sphericalSeed n) ⊆ seedSphereFromCoord '' Q ∧ + ∀ x, u (seedSphereFromCoord x) = seedCoordinateField n x+v x := by + obtain ⟨Q,hQ,hQΩ,hDQ,hbound⟩ := b.lattice_residual_support hD hUD hUb hΩ hDΩ + refine ⟨Q,hQ,hQΩ,?_⟩ + filter_upwards [hbound] with n hn + obtain ⟨hfin,hb⟩ := hn + let := hfin + refine ⟨hfin,?_⟩ + intro coeff v hu + have hv : ContDiff ℝ ∞ v := by + have he : v = fun x ↦ (seedCoordinateField n x+v x)-seedCoordinateField n x := by + funext x; ring + rw [he] + exact hu.sub (seedCoordinateField_smooth n) + have hs := (hb coeff).1 + obtain ⟨u,hus,hup,hval⟩ := seed_plus_compact_sphere_field v hv + (hQ.of_isClosed_subset isClosed_closure hs) n + exact ⟨u,hus,hup.trans (image_mono hs),hval⟩ + +end +end Yau.Target + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticeSuccessfulPacking.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticeSuccessfulPacking.lean new file mode 100644 index 0000000000000000000000000000000000000000..984dd0059b47ebea0fad59666aabbd00b2180fee --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticeSuccessfulPacking.lean @@ -0,0 +1,95 @@ +import OAI.Geometry.NodalSets.Elliptic.SignScalePacking +import OAI.Geometry.NodalSets.Elliptic.SuccessfulTestSelection +import OAI.Geometry.NodalSets.Waves.LatticeGoodEvent +import OAI.Geometry.NodalSets.Waves.LatticePhysicalSignSubballs + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Yau.Probability Set Filter MeasureTheory +open scoped ContDiff Topology +noncomputable section + +theorem lattice_successful_packing + (g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ) {H : Set Coord} + (hH : IsCompact H) (hg : ContinuousOn g H) + (hp : ∀ y ∈ H, ∀ v, v ≠ 0 → 0 < g y v v) : + ∃ tau : ℝ, 0 < tau ∧ tau < 1/4 ∧ ∃ r : ℝ, 0 < r ∧ + r < tau/4 ∧ r < (1-tau)/2 ∧ ∃ c : ℝ, 0 < c ∧ + ∀ (w S S0 T0 : Coord → ℝ) (D U Q Ω : Set Coord) (m J K k0 : ℕ) + (a : LocalCompactWaveData g w S D m J K k0) (_ : H ⊆ D) (hUD : U ⊆ D), + U ⊆ H → IsOpen U → Bornology.IsBounded U → IsCompact Q → Q ⊆ U → + ContDiff ℝ ∞ S → ContDiff ℝ ∞ S0 → ContDiff ℝ ∞ T0 → 5 ≤ k0 → + ∀ gamma > 0, (∀ x ∈ Q, S0 x+gamma ≤ S x) → + IsCompact Ω → (∀ x ∈ Ω, fderiv ℝ T0 x ≠ 0) → + ∀ d > 0, (∀ x ∈ Ω, x ∉ U → S x-S0 x ≤ -d) → + 0 < (∫ x in Q, sourceSignScale g S x) → + ∀ᶠ n : ℕ in atTop, ∃ hfin : Fintype (SourceGrid U n), letI := hfin + ∃ t : Finset Coord, ∃ j : t → Fin 4, + ∃ coeff ∈ a.latticeGoodEvent hUD n hfin S0 T0 Ω, ∃ u : Finset t, + let R := fun x ↦ ((n:ℝ)*sourceSignScale g S x)⁻¹ + let f := fun y ↦ oscillatorySeed S0 T0 n y + gaussianWaveField + (fun i : SourceGrid U n × Fin 3 ↦ latticeWave a.cover a.beams hUD n i.1 i.2) coeff y + (↑t : Set Coord) ⊆ Q ∧ + (↑t : Set Coord).PairwiseDisjoint (fun x ↦ sourceClosedBall x (R x)) ∧ + (∀ x ∈ t, 0 < R x ∧ sourceClosedBall x (5*R x) ⊆ U) ∧ + (∀ x ∈ u, + (∀ y ∈ sourceClosedBall x (r*R x), 0 < f y) ∧ + (∀ y ∈ sourceClosedBall ((x : Coord)+R x • (tau • Pi.single (j x) 1)) (r*R x), f y < 0)) ∧ + c*((n:ℝ)*(∫ x in Q, sourceSignScale g S x)) ≤ ∑ x ∈ u, (R x)^3 := by + classical + obtain ⟨tau,ht,ht4,r,hr,hrt,hr1,p,hp0,hprob⟩ := lattice_physical_sign_subballs g hH hg hp + let C : ℝ := 2*(Real.pi^2/2)*5^4 + have hC : 0 < C := by dsimp [C]; positivity + refine ⟨tau,ht,ht4,r,hr,hrt,hr1,p/(2*C),by positivity,?_⟩ + intro w S S0 T0 D U Q Ω m J K k0 a hHD hUD hUH hU hUb hQ hQU hS hS0 hT0 hk0 + gamma hgamma hgap hΩ hq d hd hout hmass + filter_upwards [hprob w S S0 T0 D U Q m J K k0 a hHD hUD hUH hU hUb hQ hQU + hS hS0 hT0 hk0 gamma hgamma hgap, + a.source_sign_scale_packing hQ hU hQU hUD, + a.lattice_good_event_probability hUD hU hUb hS S0 T0 hS0 hT0 hΩ (by omega) hq hd hout + (p/4) (by positivity)] with n hsign hpack hgood + obtain ⟨hfin,hsign⟩ := hsign + obtain ⟨hfin',hgood⟩ := hgood + have heq : hfin' = hfin := Subsingleton.elim _ _ + subst hfin' + let := hfin + let : IsProbabilityMeasure (gaussianPairs (ι := SourceGrid U n × Fin 3)) := by + unfold gaussianPairs; infer_instance + obtain ⟨hn,t,htQ,htdis,htcov,htU,hvol⟩ := hpack + let R := fun x ↦ ((n:ℝ)*sourceSignScale g S x)⁻¹ + let f := fun coeff y ↦ oscillatorySeed S0 T0 n y + gaussianWaveField + (fun i : SourceGrid U n × Fin 3 ↦ latticeWave a.cover a.beams hUD n i.1 i.2) coeff y + choose j hj using (fun x : t ↦ hsign x (htQ x.property)) + let A := fun x : t ↦ {coeff | + (∀ y ∈ sourceClosedBall x (r*R x), 0 < f coeff y) ∧ + (∀ y ∈ sourceClosedBall ((x : Coord)+R x • (tau • Pi.single (j x) 1)) (r*R x), f coeff y < 0)} + have hA (x : t) : MeasurableSet (A x) ∧ p ≤ gaussianPairs.real (A x) := by + simpa only [A,f,R,sourceClosedBall,mem_ofPred_eq,div_eq_mul_inv] using (hj x).2 + have hsum : (∑ x : t, (R x)^3) = ∑ x ∈ t, (R x)^3 := by + exact Finset.sum_coe_sort t (fun x ↦ (R x)^3) + have hvol' : (n:ℝ)*(∫ x in Q, sourceSignScale g S x) ≤ C * ∑ x : t, (R x)^3 := by + rw [hsum] + exact hvol + have hT : 0 < ∑ x : t, (R x)^3 := by + have hh : 0 < (n:ℝ)*(∫ x in Q, sourceSignScale g S x) := mul_pos (by exact_mod_cast hn) hmass + nlinarith + have hfail : (gaussianPairs (a.latticeGoodEvent hUD n hfin S0 T0 Ω)ᶜ).toReal < p/2 := by + have hh := ENNReal.toReal_mono ENNReal.ofReal_ne_top hgood.2 + rw [ENNReal.toReal_ofReal (by positivity : 0 ≤ p/4)] at hh + linarith + obtain ⟨coeff,hcoeff,u,hu,hw⟩ := exists_good_successful_tests + (fun x : t ↦ (R x)^3) (fun x ↦ (pow_pos (htU x x.property).1 3).le) hT + A (fun x ↦ (hA x).1) hp0 (fun x ↦ (hA x).2) + (a.latticeGoodEvent hUD n hfin S0 T0 Ω) hgood.1 hfail + refine ⟨hfin,t,j,coeff,hcoeff,u,htQ,htdis,htU,hu,?_⟩ + calc + p/(2*C)*((n:ℝ)*(∫ x in Q, sourceSignScale g S x)) ≤ + p/(2*C)*(C*∑ x : t, (R x)^3) := mul_le_mul_of_nonneg_left hvol' (by positivity) + _ = p*(∑ x : t, (R x)^3)/2 := by field_simp + _ ≤ _ := hw + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticeTwoPointCovariance.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticeTwoPointCovariance.lean new file mode 100644 index 0000000000000000000000000000000000000000..95bf6faf995d77af3bfb7e8e4f22c3b474e7c88b --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticeTwoPointCovariance.lean @@ -0,0 +1,57 @@ +import OAI.Geometry.NodalSets.Charts.MetricFrequencyBounds +import OAI.Geometry.NodalSets.Waves.LatticeFullPlaneWaveApprox +import OAI.Geometry.NodalSets.Waves.PlaneWaveCovariance + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Yau.Probability MeasureTheory ProbabilityTheory Set Filter +noncomputable section +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} +variable {D U : Set Coord} {m J K k0 : ℕ} +namespace LocalCompactWaveData +variable (a : LocalCompactWaveData g w S D m J K k0) + +lemma lattice_plane_wave_variance (hUD : U ⊆ D) (n : ℕ) [Fintype (SourceGrid U n)] + (x v : Coord) (s : ℝ) : + Var[fun coeff ↦ gaussianWaveField (a.latticePlaneWaveCoefficient hUD n x s) coeff v;gaussianPairs] = + ∑ i ∈ Finset.univ.filter (fun i : SourceGrid U n × Fin 3 ↦ + sourceEuclideanNorm (x-scaledLatticePoint n i.1) ≤ (n:ℝ)^(-5/12:ℝ)), + ‖a.latticeAlpha hUD n x i‖^2 := by + classical + rw [gaussianWaveField_eq_pair,variance_pairLinearSum,Finset.sum_filter] + apply Finset.sum_congr rfl + intro i _ + dsimp only [latticePlaneWaveCoefficient] + split_ifs <;> simp [planeWave_norm] + +lemma lattice_plane_wave_covariance (hUD : U ⊆ D) (n : ℕ) [Fintype (SourceGrid U n)] + (x : Coord) (s tau : ℝ) (j : Fin 4) : + cov[(fun coeff ↦ gaussianWaveField (a.latticePlaneWaveCoefficient hUD n x s) coeff 0), + (fun coeff ↦ gaussianWaveField (a.latticePlaneWaveCoefficient hUD n x s) + coeff (tau • Pi.single j 1));gaussianPairs] = + ∑ i ∈ Finset.univ.filter (fun i : SourceGrid U n × Fin 3 ↦ + sourceEuclideanNorm (x-scaledLatticePoint n i.1) ≤ (n:ℝ)^(-5/12:ℝ)), + ‖a.latticeAlpha hUD n x i‖^2 * Real.cos (tau * + sourceFrequency (g (scaledLatticePoint n i.1)) + (a.cover.triple.q (latticeFrame a.cover hUD n i.1) i.2) s j) := by + classical + rw [gaussianWaveField_eq_pair,gaussianWaveField_eq_pair,covariance_pairLinearSum,Finset.sum_filter] + apply Finset.sum_congr rfl + intro i _ + dsimp only [latticePlaneWaveCoefficient] + split_ifs + · simp only [planeWave_zero,mul_one] + rw [show planeWave (g (scaledLatticePoint n i.1) + (a.cover.triple.q (latticeFrame a.cover hUD n i.1) i.2)) s (tau • Pi.single j 1) = + Complex.exp (Complex.I * (tau * sourceFrequency (g (scaledLatticePoint n i.1)) + (a.cover.triple.q (latticeFrame a.cover hUD n i.1) i.2) s j : ℝ)) by + simp [planeWave,sourceFrequency,map_smul,smul_eq_mul,mul_div_assoc]] + exact complex_rotated_pairing _ _ + · simp + +end LocalCompactWaveData +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticeTwoPointGap.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticeTwoPointGap.lean new file mode 100644 index 0000000000000000000000000000000000000000..89a9398643a7d98d82288607ab658d832c6ec37f --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticeTwoPointGap.lean @@ -0,0 +1,80 @@ +import OAI.Geometry.NodalSets.Waves.CosineCovarianceBounds +import OAI.Geometry.NodalSets.Waves.LatticeTwoPointCovariance +import OAI.Geometry.NodalSets.Waves.PlaneWaveSecondMoment + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Yau.Probability MeasureTheory ProbabilityTheory Set Filter +open scoped Topology +noncomputable section + +theorem lattice_plane_wave_two_point_gap + (g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ) {H : Set Coord} + (hH : IsCompact H) (hg : ContinuousOn g H) + (hp : ∀ y ∈ H, ∀ v, v ≠ 0 → 0 < g y v v) : + ∃ tau : ℝ, 0 < tau ∧ tau < 1/4 ∧ ∃ delta > 0, + ∀ (w S : Coord → ℝ) (D U Q : Set Coord) (m J K k0 : ℕ) + (a : LocalCompactWaveData g w S D m J K k0) (_ : H ⊆ D) (hUD : U ⊆ D), + U ⊆ H → IsOpen U → Bornology.IsBounded U → IsCompact Q → Q ⊆ U → + ∀ᶠ n : ℕ in atTop, ∃ hfin : Fintype (SourceGrid U n), letI := hfin + ∀ x ∈ Q, ∃ j : Fin 4, + let G := fun v coeff ↦ gaussianWaveField + (a.latticePlaneWaveCoefficient hUD n x (sourceSignScale g S x)) coeff v + let M := Var[G 0;gaussianPairs] + let C := cov[G 0,G (tau • Pi.single j 1);gaussianPairs] + (1/2:ℝ) ≤ M ∧ M ≤ 1 ∧ + Var[G (tau • Pi.single j 1);gaussianPairs] = M ∧ + M/2 ≤ C ∧ C ≤ M-delta := by + classical + obtain ⟨κ,hκ,B,hB,hann⟩ := lattice_main_frequency_annulus g hH hg hp + let tau : ℝ := 1/(8*(B+1)) + have ht : 0 < tau := by dsimp [tau]; positivity + have ht4 : tau < 1/4 := by + dsimp [tau] + apply (div_lt_iff₀ (by positivity : 0 < 8*(B+1))).mpr + linarith + have hsmall : tau*B ≤ 1 := by + dsimp [tau] + rw [one_div,mul_comm,← div_eq_mul_inv] + apply (div_le_iff₀ (by positivity : 0 < 8*(B+1))).mpr + linarith + let delta : ℝ := (2/Real.pi^2)*tau^2*(κ^2/8) + have hd : 0 < delta := by dsimp [delta]; positivity + refine ⟨tau,ht,ht4,delta,hd,?_⟩ + intro w S D U Q m J K k0 a hHD hUD hUH hU hUb hQ hQU + filter_upwards [hann w S D U m J K k0 a hHD hUD hUH, + a.latticeAlpha_main_mass hUD hU hUb hQ hQU (1/2) (by norm_num)] with n hn hm + obtain ⟨hfin,hm⟩ := hm + let := hfin + refine ⟨hfin,?_⟩ + intro x hx + let F := Finset.univ.filter (fun i : SourceGrid U n × Fin 3 ↦ + sourceEuclideanNorm (x-scaledLatticePoint n i.1) ≤ (n:ℝ)^(-5/12:ℝ)) + let alpha := a.latticeAlpha hUD n x + let k := fun i : SourceGrid U n × Fin 3 ↦ sourceFrequency (g (scaledLatticePoint n i.1)) + (a.cover.triple.q (latticeFrame a.cover hUD n i.1) i.2) (sourceSignScale g S x) + have hmass : (1/2:ℝ) ≤ ∑ i ∈ F, ‖alpha i‖^2 := by + have := (hm x hx).2 + dsimp only [F,alpha] + linarith + have hmass1 : ∑ i ∈ F, ‖alpha i‖^2 ≤ 1 := by + rw [← (hm x hx).1] + exact Finset.sum_le_sum_of_subset_of_nonneg (Finset.filter_subset _ _) (fun i _ _ ↦ sq_nonneg _) + have hb (i : SourceGrid U n × Fin 3) (hi : i ∈ F) : + κ ≤ sourceEuclideanNorm (k i) ∧ sourceEuclideanNorm (k i) ≤ B := + hn x (hUH (hQU hx)) i (Finset.mem_filter.mp hi).2 + obtain ⟨j,hj⟩ := coordinate_second_moment F alpha k κ hκ.le hmass (fun i hi ↦ (hb i hi).1) + have hcoord (i : SourceGrid U n × Fin 3) (hi : i ∈ F) : |k i j| ≤ B := + (norm_le_pi_norm (k i) j).trans ((norm_le_sourceEuclideanNorm _).trans (hb i hi).2) + have hbounds := cosine_covariance_bounds F (fun i ↦ ‖alpha i‖^2) (fun i ↦ k i j) + tau B (κ^2/8) (fun i hi ↦ sq_nonneg _) ht.le hsmall hcoord hj + refine ⟨j,?_⟩ + dsimp only + rw [a.lattice_plane_wave_variance,a.lattice_plane_wave_variance,a.lattice_plane_wave_covariance] + exact ⟨hmass,hmass1,rfl,hbounds.1,hbounds.2⟩ + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticeValueVariance.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticeValueVariance.lean new file mode 100644 index 0000000000000000000000000000000000000000..ce3ad6a6e0d495b69e1eab99d3242ce7bde04722 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticeValueVariance.lean @@ -0,0 +1,45 @@ +import OAI.Geometry.NodalSets.Waves.GaussianWaveJet +import OAI.Geometry.NodalSets.Waves.LatticeNormalizedWeights + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Yau.Probability Set Filter MeasureTheory ProbabilityTheory +noncomputable section + +lemma gaussianWaveField_value_variance {ι : Type*} [Fintype ι] + (V : ι → Coord → ℂ) (seed : Coord → ℝ) (x : Coord) : + Var[fun coeff ↦ seed x+gaussianWaveField V coeff x; gaussianPairs] = + ∑ i, ‖V i x‖^2 := by + have he : (fun coeff ↦ gaussianWaveField V coeff x) = pairLinearSum (fun i ↦ V i x) := by + funext coeff + rw [pairLinearSum_eq_complex] + simp only [gaussianWaveField,Complex.re_sum] + let : IsProbabilityMeasure (gaussianPairs (ι := ι)) := by + change IsProbabilityMeasure (Measure.pi (fun _ : ι × Fin 2 ↦ gaussianReal 0 1)) + infer_instance + have hc : Continuous (pairLinearSum (fun i ↦ V i x)) := by + unfold pairLinearSum + fun_prop + change Var[(fun coeff ↦ seed x+(fun coeff ↦ gaussianWaveField V coeff x) coeff); gaussianPairs] = _ + rw [he,variance_const_add hc.aestronglyMeasurable,variance_pairLinearSum] + +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} +variable {D U : Set Coord} {m J K k0 : ℕ} +namespace LocalCompactWaveData +variable (a : LocalCompactWaveData g w S D m J K k0) + +lemma lattice_value_variance (hUD : U ⊆ D) (n : ℕ) [Fintype (SourceGrid U n)] + (seed : Coord → ℝ) (x : Coord) : + Var[fun coeff ↦ seed x+gaussianWaveField + (fun i : SourceGrid U n × Fin 3 ↦ latticeWave a.cover a.beams hUD n i.1 i.2) coeff x; + gaussianPairs] = (a.latticeSigma hUD n x)^2 := by + rw [a.latticeSigma_sq] + exact gaussianWaveField_value_variance _ seed x + +end LocalCompactWaveData + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticeVarianceComparison.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticeVarianceComparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..6e38329a5d2c048f4f73c2bc8f9c2e7befc9f472 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticeVarianceComparison.lean @@ -0,0 +1,84 @@ +import OAI.Geometry.NodalSets.Waves.LatticeEnergyLowerBound +import OAI.Geometry.NodalSets.Waves.LatticeLogJets +import OAI.Geometry.NodalSets.Waves.LatticeVarianceUpper + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Set Metric Filter +open scoped ContDiff Topology +noncomputable section +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} +variable {D U : Set Coord} {m J K k0 : ℕ} +namespace LocalCompactWaveData +variable (a : LocalCompactWaveData g w S D m J K k0) + +theorem lattice_variance_lower_bound (hUD : U ⊆ D) (hU : IsOpen U) + {Q : Set Coord} (hQ : IsCompact Q) (hQU : Q ⊆ U) : + ∃ c > 0, ∀ᶠ n : ℕ in atTop, ∀ [Fintype (SourceGrid U n)], ∀ x ∈ Q, + c*Real.exp (2*(n:ℝ)*S x) ≤ a.latticeVariance hUD n x := by + obtain ⟨Ca,hCa,Cr,hCr,Ci,hCi,c,hc,C,hC,hb⟩ := + a.lattice_logarithmic_jet_estimates hUD 2 (by norm_num) + obtain ⟨r,hr,hinner⟩ := compact_inner_ball hQ hU hQU + refine ⟨c^2,pow_pos hc 2,?_⟩ + filter_upwards [hb,eventually_gt_atTop (0:ℕ), + eventually_nat_frequency (half_scale_eventually 2 1 r hr)] with n hn hnpos hsmall + intro hfin x hx + have hd := (norm_le_sourceEuclideanNorm _).trans (rounded_lattice_distance hnpos x) + have hmem : scaledLatticePoint n (roundedLatticeIndex n x) ∈ U := + hinner x hx (by simpa only [mem_closedBall,dist_eq_norm] using hd.trans hsmall.2.1) + let z : SourceGrid U n := ⟨roundedLatticeIndex n x,hmem⟩ + have hd' : ‖x-scaledLatticePoint n z‖ ≤ 2*(n:ℝ)^(-1/2:ℝ) := by + rw [norm_sub_rev]; exact hd + have hl := (hn z 0 x hd').2.2.2.2.1 + have hle : c*Real.exp ((n:ℝ)*S x) ≤ ‖latticeWave a.cover a.beams hUD n z 0 x‖ := by + have hh := mul_le_mul_of_nonneg_right hl.1 (Real.exp_nonneg ((n:ℝ)*S x)) + simpa only [mul_assoc,← Real.exp_add,neg_mul,neg_add_cancel,Real.exp_zero,mul_one] using hh + have hs := pow_le_pow_left₀ (by positivity : 0 ≤ c*Real.exp ((n:ℝ)*S x)) hle 2 + have he : (c*Real.exp ((n:ℝ)*S x))^2 = c^2*Real.exp (2*(n:ℝ)*S x) := by + rw [mul_pow,← Real.exp_nat_mul] + congr 2 + ring + rw [he] at hs + apply hs.trans + unfold latticeVariance + exact Finset.single_le_sum (fun i _ ↦ sq_nonneg ‖latticeWave a.cover a.beams hUD n i.1 i.2 x‖) + (Finset.mem_univ (z,(0:Fin 3))) + +theorem lattice_sigma_comparison (hUD : U ⊆ D) (hU : IsOpen U) + (hUb : Bornology.IsBounded U) {Q : Set Coord} (hQ : IsCompact Q) (hQU : Q ⊆ U) : + ∃ c > 0, ∃ C > 0, ∀ᶠ n : ℕ in atTop, ∃ hfin : Fintype (SourceGrid U n), + letI := hfin + ∀ x ∈ Q, c*Real.exp ((n:ℝ)*S x) ≤ a.latticeSigma hUD n x ∧ + a.latticeSigma hUD n x ≤ C*Real.exp ((n:ℝ)*S x) := by + obtain ⟨c,hc,hlo⟩ := a.lattice_variance_lower_bound hUD hU hQ hQU + obtain ⟨C,hC,hup⟩ := a.lattice_variance_upper_bound hUD + refine ⟨Real.sqrt c,Real.sqrt_pos.mpr hc,Real.sqrt C,Real.sqrt_pos.mpr hC,?_⟩ + filter_upwards [hlo,hup,eventually_gt_atTop (0:ℕ)] with n hl hu hn + have := finite_source_grid hUb hn + let hfin := Fintype.ofFinite (SourceGrid U n) + refine ⟨hfin,?_⟩ + intro x hx + have hl' := hl x hx + have hu' := hu x + have hs := a.latticeSigma_sq hUD n x + have hnon : 0 ≤ a.latticeSigma hUD n x := Real.sqrt_nonneg _ + have he : (Real.exp ((n:ℝ)*S x))^2 = Real.exp (2*(n:ℝ)*S x) := by + rw [← Real.exp_nat_mul] + congr 1 + ring + have hc2 := Real.sq_sqrt hc.le + have hC2 := Real.sq_sqrt hC.le + constructor + · apply (sq_le_sq₀ (by positivity) hnon).mp + rw [mul_pow,hc2,he,hs] + exact hl' + · apply (sq_le_sq₀ hnon (by positivity)).mp + rw [mul_pow,hC2,he,hs] + exact hu' + +end LocalCompactWaveData +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LatticeVarianceUpper.lean b/lean/OAI/Geometry/NodalSets/Waves/LatticeVarianceUpper.lean new file mode 100644 index 0000000000000000000000000000000000000000..e3bba1812883416ee6fa601b20dee5f832d96a74 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LatticeVarianceUpper.lean @@ -0,0 +1,87 @@ +import OAI.Geometry.NodalSets.Waves.LocalCompactWaves +import OAI.Geometry.NodalSets.Waves.ScaledLatticeGaussianSum + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Set Filter +open scoped ContDiff Topology +noncomputable section +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} +variable {D U : Set Coord} {m J K k0 : ℕ} +namespace LocalCompactWaveData +variable (a : LocalCompactWaveData g w S D m J K k0) + +def latticeVariance (hUD : U ⊆ D) (n : ℕ) [Fintype (SourceGrid U n)] (x : Coord) : ℝ := + ∑ i : SourceGrid U n × Fin 3, ‖latticeWave a.cover a.beams hUD n i.1 i.2 x‖^2 + +def latticeSigma (hUD : U ⊆ D) (n : ℕ) [Fintype (SourceGrid U n)] (x : Coord) : ℝ := + Real.sqrt (a.latticeVariance hUD n x) + +lemma latticeVariance_nonneg (hUD : U ⊆ D) (n : ℕ) [Fintype (SourceGrid U n)] (x : Coord) : + 0 ≤ a.latticeVariance hUD n x := Finset.sum_nonneg (fun _ _ ↦ sq_nonneg _) + +lemma latticeSigma_sq (hUD : U ⊆ D) (n : ℕ) [Fintype (SourceGrid U n)] (x : Coord) : + (a.latticeSigma hUD n x)^2 = a.latticeVariance hUD n x := + Real.sq_sqrt (a.latticeVariance_nonneg hUD n x) + +theorem lattice_derivative_square_sum_bound (hUD : U ⊆ D) : + ∃ C > 0, ∀ᶠ n : ℕ in atTop, ∀ [Fintype (SourceGrid U n)], ∀ x : Coord, + ∀ k : Fin (k0+1), + ∑ i : SourceGrid U n × Fin 3, + ‖iteratedFDeriv ℝ k.val (latticeWave a.cover a.beams hUD n i.1 i.2) x‖^2 ≤ + C*(n:ℝ)^(2*k.val)*Real.exp (2*(n:ℝ)*S x) := by + obtain ⟨B,hB,hgauss⟩ := source_lattice_gaussian_sum (show 0 < 2*a.beams.c by have := a.beams.c_pos; positivity) + refine ⟨3*a.beams.Cw^2*B,by have := a.beams.Cw_pos; positivity,?_⟩ + filter_upwards [a.estimates,eventually_gt_atTop (0:ℕ)] with n hn hnpos + intro hfin x k + let R := a.beams.Cw^2*(n:ℝ)^(2*k.val)*Real.exp (2*(n:ℝ)*S x) + have hR : 0 ≤ R := by dsimp [R]; positivity + have hb (i : SourceGrid U n × Fin 3) : + ‖iteratedFDeriv ℝ k.val (latticeWave a.cover a.beams hUD n i.1 i.2) x‖^2 ≤ + R*Real.exp (-(2*a.beams.c)*(n:ℝ)*(sourceEuclideanNorm (x-scaledLatticePoint n i.1))^2) := by + have h := ((hn (latticeFrame a.cover hUD n i.1,i.2)).2.2.2.2 x).1 k + simp only [latticeFrame_center] at h + change ‖iteratedFDeriv ℝ k.val (latticeWave a.cover a.beams hUD n i.1 i.2) x‖ ≤ _ at h + have hh := pow_le_pow_left₀ (norm_nonneg _) h 2 + refine hh.trans_eq ?_ + dsimp [R] + rw [mul_pow,mul_pow,← Real.exp_nat_mul,← pow_mul] + simp only [mul_assoc,← Real.exp_add] + congr 2 <;> ring_nf + calc + _ ≤ ∑ i : SourceGrid U n × Fin 3, R*Real.exp (-(2*a.beams.c)*(n:ℝ)* + (sourceEuclideanNorm (x-scaledLatticePoint n i.1))^2) := Finset.sum_le_sum (fun i _ ↦ hb i) + _ = 3*R*∑ z : SourceGrid U n, Real.exp (-(2*a.beams.c)*(n:ℝ)* + (sourceEuclideanNorm (x-scaledLatticePoint n z))^2) := by + rw [Fintype.sum_prod_type] + simp only [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul] + rw [← Finset.mul_sum,← Finset.mul_sum,mul_assoc] + dsimp [R] + ring + _ ≤ 3*R*B := mul_le_mul_of_nonneg_left (hgauss U n hnpos x) (by positivity) + _ = _ := by dsimp [R]; ring + +theorem lattice_variance_upper_bound (hUD : U ⊆ D) : + ∃ C > 0, ∀ᶠ n : ℕ in atTop, ∀ [Fintype (SourceGrid U n)], ∀ x : Coord, + a.latticeVariance hUD n x ≤ C*Real.exp (2*(n:ℝ)*S x) := by + obtain ⟨C,hC,hb⟩ := a.lattice_derivative_square_sum_bound hUD + refine ⟨C,hC,?_⟩ + filter_upwards [hb] with n hn + intro hfin x + calc + a.latticeVariance hUD n x = + ∑ i : SourceGrid U n × Fin 3, + ‖iteratedFDeriv ℝ 0 (latticeWave a.cover a.beams hUD n i.1 i.2) x‖^2 := by + apply Finset.sum_congr rfl + intro i hi + exact congrArg (fun z : ℝ ↦ z^2) + (norm_iteratedFDeriv_zero (𝕜 := ℝ) + (f := latticeWave a.cover a.beams hUD n i.1 i.2) (x := x)).symm + _ ≤ _ := by simpa only [Fin.val_zero,mul_zero,pow_zero,mul_one] using! hn x 0 + +end LocalCompactWaveData +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LocalCompactWaves.lean b/lean/OAI/Geometry/NodalSets/Waves/LocalCompactWaves.lean new file mode 100644 index 0000000000000000000000000000000000000000..ef4f23fee32192943907f8843b73531c961f6726 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LocalCompactWaves.lean @@ -0,0 +1,82 @@ +import OAI.Geometry.NodalSets.Elliptic.CompactSourceRepresentatives +import OAI.Geometry.NodalSets.Waves.CompactSourceWaves +import OAI.Geometry.NodalSets.Waves.LocalSourceWaveTransfer +import OAI.Geometry.NodalSets.Waves.WaveSecondJet + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Set Filter +open scoped ContDiff Topology +noncomputable section +attribute [local instance] clmTopology clmAdd clmModule + +structure LocalCompactWaveData + (g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ) (w S : Coord → ℝ) + (D : Set Coord) (m J K k0 : ℕ) where + G : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ + W : Coord → ℝ + A : Coord → ℝ + E : Set Coord + smooth_G : ContDiff ℝ ∞ G + smooth_W : ContDiff ℝ ∞ W + smooth_A : ContDiff ℝ ∞ A + symmetric_G : ∀ x u v, G x u v = G x v u + positive_G : ∀ x v, v ≠ 0 → 0 < G x v v + open_E : IsOpen E + centers_E : D ⊆ E + germ : ∀ x ∈ E, (G =ᶠ[𝓝 x] g) ∧ (W =ᶠ[𝓝 x] w) ∧ (A =ᶠ[𝓝 x] S) + nonzero_gradient : ∀ x ∈ D, metricGradient G A x ≠ 0 + cover : SourceCompactFrameCover G A D + beams : TripleSourceWaveData G W A (coverSourceCenter cover) cover.triple m J K k0 + estimates : ∀ᶠ n : ℕ in atTop, ∀ t : cover.Parameter × Fin 3, + ContDiff ℝ ∞ (beams.wave (n:ℝ) t) ∧ HasCompactSupport (beams.wave (n:ℝ) t) ∧ + tsupport (beams.wave (n:ℝ) t) ⊆ E ∧ + tsupport (beams.wave (n:ℝ) t) ⊆ + {z | sourceEuclideanNorm (z-coverSourceCenter cover t.1) ≤ beams.R*(n:ℝ)^(-1/3:ℝ)} ∧ + ∀ z : Coord, + (∀ k : Fin (k0+1), ‖iteratedFDeriv ℝ k.val (beams.wave (n:ℝ) t) z‖ ≤ + beams.Cw*(n:ℝ)^k.val*Real.exp ((n:ℝ)*S z-beams.c*(n:ℝ)*(sourceEuclideanNorm (z-coverSourceCenter cover t.1))^2)) ∧ + DerivativeBound k0 (fun z ↦ sourceWeightedOperator g w (beams.wave (n:ℝ) t) z + + ((4:ℂ)*(n:ℂ)^2+6*(n:ℂ))*beams.wave (n:ℝ) t z) z + (beams.Cr*(n:ℝ)^(-(K:ℝ))*Real.exp ((n:ℝ)*S z)) + +theorem construct_local_compact_waves {D U : Set Coord} (hD : IsCompact D) + (hU : IsOpen U) (hDU : D ⊆ U) (hUn : U.Nonempty) + (g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ) (hg : ContDiffOn ℝ ∞ g U) + (hs : ∀ x ∈ U, ∀ u v, g x u v = g x v u) + (hp : ∀ x ∈ U, ∀ v, v ≠ 0 → 0 < g x v v) + (w S : Coord → ℝ) (hw : ContDiffOn ℝ ∞ w U) (hS : ContDiffOn ℝ ∞ S U) + (hwp : ∀ x ∈ U, 0 < w x) (hp0 : ∀ x ∈ D, metricGradient g S x ≠ 0) + (hdir : ∀ x ∈ D, ∃ v : Coord, g x (metricGradient g S x) v = 0 ∧ g x v v = 1 ∧ + 0 < sourceHessian g S x (metricGradient g S x) (metricGradient g S x)+ + (g x (metricGradient g S x) (metricGradient g S x)+4)*sourceHessian g S x v v) + (m J K k0 : ℕ) (hm : 3*K+4*k0+6 < m+1) (hJ : K+k0+1 ≤ J) : + Nonempty (LocalCompactWaveData g w S D m J K k0) := by + obtain ⟨G,W,A,E,hG,hW,hA,hGs,hGp,hE,hDE,hEU,hWp,he⟩ := + compact_source_representatives hD hU hDU hUn g hg hs hp w S hw hS hwp + have hn (x : Coord) (hx : x ∈ D) : metricGradient G A x ≠ 0 := by + rw [(he x (hDE hx)).2.2.2.1] + exact hp0 x hx + have hd (x : Coord) (hx : x ∈ D) : ∃ v : Coord, + G x (metricGradient G A x) v = 0 ∧ G x v v = 1 ∧ + 0 < sourceHessian G A x (metricGradient G A x) (metricGradient G A x)+ + (G x (metricGradient G A x) (metricGradient G A x)+4)*sourceHessian G A x v v := by + obtain ⟨hge,_,_,hpEq,hHEq⟩ := he x (hDE hx) + rw [hge.self_of_nhds,hpEq,hHEq] + exact hdir x hx + obtain ⟨d,⟨b⟩,_⟩ := construct_compact_source_waves G hG hGs hGp W hW A hA + hD hE hDE hWp hn hd m J K k0 hm hJ + have hest := local_source_wave_transfer g G w W S A + (fun t : d.Parameter × Fin 3 ↦ coverSourceCenter d t.1) + ((continuous_coverSourceCenter d).comp continuous_fst) hE + (fun t ↦ hDE (d.center t.1).property) + (fun x hx ↦ ⟨(he x hx).1,(he x hx).2.1,(he x hx).2.2.1.self_of_nhds⟩) + (fun n t ↦ b.wave (n:ℝ) t) k0 K b.c b.Cw b.Cr b.R b.Cw_pos b.Cr_pos b.estimates + exact ⟨⟨G,W,A,E,hG,hW,hA,hGs,hGp,hE,hDE, + (fun x hx ↦ ⟨(he x hx).1,(he x hx).2.1,(he x hx).2.2.1⟩),hn,d,b,hest⟩⟩ + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LocalCovarianceGeometry.lean b/lean/OAI/Geometry/NodalSets/Waves/LocalCovarianceGeometry.lean new file mode 100644 index 0000000000000000000000000000000000000000..682432405d65d8171b248a5ba6f7cebe5be31e4f --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LocalCovarianceGeometry.lean @@ -0,0 +1,53 @@ +import OAI.Geometry.NodalSets.Charts.MetricCoercivity +import OAI.Geometry.NodalSets.Elliptic.LocalDirectionBounds +import OAI.Geometry.NodalSets.Waves.LatticeLogJets + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Set Filter +open scoped ContDiff Topology +noncomputable section +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} +variable {D : Set Coord} {m J K k0 : ℕ} +namespace LocalCompactWaveData +variable (a : LocalCompactWaveData g w S D m J K k0) + +include a in +theorem original_covariance_geometry : ∃ mu > 0, ∃ B > 0, ∀ x ∈ D, + ‖g x‖ ≤ B ∧ ‖fderiv ℝ S x‖ ≤ B ∧ ∀ v, mu*‖v‖^2 ≤ g x v v := by + let y := coverSourceCenter a.cover + have hy := continuous_coverSourceCenter a.cover + obtain ⟨mu,hmu,B,hB,hg⟩ := uniform_metric_coercivity (a.G ∘ y) + (a.smooth_G.continuous.comp hy) (fun t ↦ a.positive_G (y t)) + have hc : Continuous (fun t ↦ fderiv ℝ a.A (y t)) := + (a.smooth_A.continuous_fderiv (by simp)).comp hy + obtain ⟨M,hM,hm⟩ := (isCompact_univ.image hc).isBounded.exists_pos_norm_le + refine ⟨mu,hmu,B+M,by positivity,?_⟩ + intro x hx + let t := selectFrame a.cover ⟨x,hx⟩ + have he : y t = x := selectFrame_center a.cover ⟨x,hx⟩ + have hG := hg t + change ‖a.G (y t)‖ ≤ B ∧ ∀ v, mu*‖v‖^2 ≤ a.G (y t) v v at hG + rw [he] at hG + have hA := hm _ ⟨t,mem_univ _,rfl⟩ + change ‖fderiv ℝ a.A (y t)‖ ≤ M at hA + rw [he] at hA + obtain ⟨hge,_,hae⟩ := a.germ x (a.centers_E hx) + rw [hge.self_of_nhds] at hG + rw [hae.fderiv_eq] at hA + exact ⟨hG.1.trans (by linarith),hA.trans (by linarith),hG.2⟩ + +theorem lattice_eta_bounds {U : Set Coord} (hUD : U ⊆ D) : + ∃ e > 0, ∃ E > 0, ∀ n (z : SourceGrid U n) j, + e ≤ a.latticeEta hUD n z j ∧ a.latticeEta hUD n z j ≤ E := by + obtain ⟨_,_,e,he,E,hE,hb⟩ := a.original_direction_bounds + refine ⟨e,he,E,hE,?_⟩ + intro n z j + exact (hb (latticeFrame a.cover hUD n z)).2 j + +end LocalCompactWaveData +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LocalSourceWaveTransfer.lean b/lean/OAI/Geometry/NodalSets/Waves/LocalSourceWaveTransfer.lean new file mode 100644 index 0000000000000000000000000000000000000000..aafcaa3f8dbb9de8792963d0872db1dd44ba4a94 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LocalSourceWaveTransfer.lean @@ -0,0 +1,76 @@ +import OAI.Geometry.NodalSets.Coefficients.CoefficientLocality +import OAI.Geometry.NodalSets.Waves.EuclideanSourceWaves + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Set Filter +open scoped ContDiff Topology +noncomputable section +variable {T : Type*} [TopologicalSpace T] [CompactSpace T] + +theorem local_source_wave_transfer + (g G : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ) (w W S A : Coord → ℝ) + (y : T → Coord) (hy : Continuous y) {E : Set Coord} (hE : IsOpen E) (hyE : ∀ t, y t ∈ E) + (he : ∀ x ∈ E, (G =ᶠ[𝓝 x] g) ∧ (W =ᶠ[𝓝 x] w) ∧ A x = S x) + (u : ℕ → T → Coord → ℂ) (k0 K : ℕ) (c Cw Cr R : ℝ) + (hCw : 0 < Cw) (hCr : 0 < Cr) + (hest : ∀ᶠ n : ℕ in atTop, ∀ t, + ContDiff ℝ ∞ (u n t) ∧ HasCompactSupport (u n t) ∧ + tsupport (u n t) ⊆ {z | sourceEuclideanNorm (z-y t) ≤ R*(n:ℝ)^(-1/3:ℝ)} ∧ + ∀ z : Coord, + (∀ k : Fin (k0+1), ‖iteratedFDeriv ℝ k.val (u n t) z‖ ≤ + Cw*(n:ℝ)^k.val*Real.exp ((n:ℝ)*A z-c*(n:ℝ)*(sourceEuclideanNorm (z-y t))^2)) ∧ + DerivativeBound k0 (fun z ↦ sourceWeightedOperator G W (u n t) z + + ((4:ℂ)*(n:ℂ)^2+6*(n:ℂ))*u n t z) z + (Cr*(n:ℝ)^(-(K:ℝ))*Real.exp ((n:ℝ)*A z))) : + ∀ᶠ n : ℕ in atTop, ∀ t, + ContDiff ℝ ∞ (u n t) ∧ HasCompactSupport (u n t) ∧ tsupport (u n t) ⊆ E ∧ + tsupport (u n t) ⊆ {z | sourceEuclideanNorm (z-y t) ≤ R*(n:ℝ)^(-1/3:ℝ)} ∧ + ∀ z : Coord, + (∀ k : Fin (k0+1), ‖iteratedFDeriv ℝ k.val (u n t) z‖ ≤ + Cw*(n:ℝ)^k.val*Real.exp ((n:ℝ)*S z-c*(n:ℝ)*(sourceEuclideanNorm (z-y t))^2)) ∧ + DerivativeBound k0 (fun z ↦ sourceWeightedOperator g w (u n t) z + + ((4:ℂ)*(n:ℂ)^2+6*(n:ℂ))*u n t z) z + (Cr*(n:ℝ)^(-(K:ℝ))*Real.exp ((n:ℝ)*S z)) := by + obtain ⟨r,hr,hball⟩ := compact_family_common_radius isCompact_univ + (fun z : T × Coord ↦ y z.1+z.2) ((hy.comp continuous_fst).add continuous_snd) + hE (fun t _ ↦ by simpa using hyE t) + have hsmall : ∀ᶠ n : ℕ in atTop, R*(n:ℝ)^(-1/3:ℝ) < r := by + apply eventually_nat_frequency (P := fun N : ℝ ↦ R*N^(-1/3:ℝ) < r) + have ht : Tendsto (fun N : ℝ ↦ R*N^(-1/3:ℝ)) atTop (𝓝 0) := by + simpa only [neg_div,mul_zero] using + (tendsto_rpow_neg_atTop (by norm_num : (0:ℝ) < 1/3)).const_mul R + exact ht.eventually (gt_mem_nhds hr) + filter_upwards [hest,hsmall] with n hn hnr + intro t + obtain ⟨hsm,hcomp,hsup,hb⟩ := hn t + have hsE : tsupport (u n t) ⊆ E := by + intro z hz + have hd := (norm_le_sourceEuclideanNorm (z-y t)).trans (hsup hz) + have hh := hball t (mem_univ t) (z-y t) (hd.trans_lt hnr) + simpa only [add_sub_cancel] using hh + refine ⟨hsm,hcomp,hsE,hsup,?_⟩ + intro z + by_cases hz : z ∈ E + · have hsame := he z hz + refine ⟨?_,?_⟩ + · simpa only [hsame.2.2] using (hb z).1 + · intro k hk + rw [← sourceResidual_coefficients_derivative_eq hsame.1 hsame.2.1] + simpa only [hsame.2.2] using (hb z).2 k hk + · have hnot : z ∉ tsupport (u n t) := fun hh ↦ hz (hsE hh) + have hzero := notMem_tsupport_iff_eventuallyEq.mp hnot + constructor + · intro k + rw [(hzero.iteratedFDeriv ℝ k.val).self_of_nhds] + simp only [iteratedFDeriv_zero,Pi.zero_apply,norm_zero] + positivity + · intro k hk + rw [source_residual_derivative_zero g w (u n t) _ z hnot k,norm_zero] + positivity + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LocalWaveEnvelopeTransfer.lean b/lean/OAI/Geometry/NodalSets/Waves/LocalWaveEnvelopeTransfer.lean new file mode 100644 index 0000000000000000000000000000000000000000..494bad308cb55ea885f41266e6978e88906cd68e --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LocalWaveEnvelopeTransfer.lean @@ -0,0 +1,59 @@ +import OAI.Geometry.NodalSets.Waves.LatticeSourceWaves +import OAI.Geometry.NodalSets.Waves.LocalCompactWaves + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Set Filter +open scoped ContDiff Topology +noncomputable section +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} +variable {D : Set Coord} {m J K k0 : ℕ} + +def LocalCompactWaveData.withEnvelope (b : LocalCompactWaveData g w S D m J K k0) + (S' : Coord → ℝ) {O : Set Coord} (hO : IsOpen O) (hDO : D ⊆ O) + (he : ∀ x ∈ O, S' =ᶠ[𝓝 x] S) : LocalCompactWaveData g w S' D m J K k0 where + G := b.G + W := b.W + A := b.A + E := b.E ∩ O + smooth_G := b.smooth_G + smooth_W := b.smooth_W + smooth_A := b.smooth_A + symmetric_G := b.symmetric_G + positive_G := b.positive_G + open_E := b.open_E.inter hO + centers_E := fun _ hx ↦ ⟨b.centers_E hx,hDO hx⟩ + germ := fun x hx ↦ ⟨(b.germ x hx.1).1,(b.germ x hx.1).2.1, + (b.germ x hx.1).2.2.trans (he x hx.2).symm⟩ + nonzero_gradient := b.nonzero_gradient + cover := b.cover + beams := b.beams + estimates := local_source_wave_transfer g b.G w b.W S' b.A + (fun t : b.cover.Parameter × Fin 3 ↦ coverSourceCenter b.cover t.1) + ((continuous_coverSourceCenter b.cover).comp continuous_fst) + (b.open_E.inter hO) + (fun t ↦ ⟨b.centers_E (b.cover.center t.1).property,hDO (b.cover.center t.1).property⟩) + (fun x hx ↦ ⟨(b.germ x hx.1).1,(b.germ x hx.1).2.1, + (b.germ x hx.1).2.2.eq_of_nhds.trans (he x hx.2).eq_of_nhds.symm⟩) + (fun n t ↦ b.beams.wave (n:ℝ) t) k0 K b.beams.c b.beams.Cw b.beams.Cr b.beams.R + b.beams.Cw_pos b.beams.Cr_pos b.beams.estimates + +lemma LocalCompactWaveData.withEnvelope_wave (b : LocalCompactWaveData g w S D m J K k0) + (S' : Coord → ℝ) {O : Set Coord} (hO : IsOpen O) (hDO : D ⊆ O) + (he : ∀ x ∈ O, S' =ᶠ[𝓝 x] S) {U : Set Coord} (hUD : U ⊆ D) + (n : ℕ) (z : SourceGrid U n) (j : Fin 3) : + latticeWave (b.withEnvelope S' hO hDO he).cover + (b.withEnvelope S' hO hDO he).beams hUD n z j = + latticeWave b.cover b.beams hUD n z j := rfl + +lemma envelope_germ_open (S S' : Coord → ℝ) : + IsOpen {x | S' =ᶠ[𝓝 x] S} := by + change IsOpen {x | {z | S' z = S z} ∈ 𝓝 x} + simpa only [← mem_interior_iff_mem_nhds, ofPred_mem_eq] using + (isOpen_interior : IsOpen (interior {z | S' z = S z})) + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LocalWaveHessian.lean b/lean/OAI/Geometry/NodalSets/Waves/LocalWaveHessian.lean new file mode 100644 index 0000000000000000000000000000000000000000..18203156b4c7a5553ab75cae77b703b952af99da --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LocalWaveHessian.lean @@ -0,0 +1,36 @@ +import OAI.Geometry.NodalSets.Waves.LocalWaveJets +import OAI.Geometry.NodalSets.Waves.WaveHessian + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Filter +open scoped Topology +noncomputable section +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} +variable {D : Set Coord} {m J K k0 : ℕ} +namespace LocalCompactWaveData +variable (a : LocalCompactWaveData g w S D m J K k0) + +theorem source_phase_hessian (t : a.cover.Parameter × Fin 3) (u v : Coord) : + sourceHessian g (fun z ↦ (a.beams.phase t z).re) (coverSourceCenter a.cover t.1) u v = + sourceHessian g S (coverSourceCenter a.cover t.1) u v - + sourceDirectionEta (g (coverSourceCenter a.cover t.1)) (sourceHessian g S (coverSourceCenter a.cover t.1)) + (metricGradient g S (coverSourceCenter a.cover t.1)) (a.cover.triple.q t.1 t.2) * + g (coverSourceCenter a.cover t.1) u v := by + have h := a.beams.phase_hessian a.smooth_G a.symmetric_G a.positive_G a.smooth_A + (fun t ↦ a.nonzero_gradient _ (a.cover.center t).property) t u v + obtain ⟨hG,_,_⟩ := a.germ _ (a.centers_E (a.cover.center t.1).property) + have he := (sourceHessian_eventuallyEq hG + (Filter.EventuallyEq.refl (𝓝 (coverSourceCenter a.cover t.1)) (fun z ↦ (a.beams.phase t z).re))).self_of_nhds + change sourceHessian a.G (fun z ↦ (a.beams.phase t z).re) (coverSourceCenter a.cover t.1) = + sourceHessian g (fun z ↦ (a.beams.phase t z).re) (coverSourceCenter a.cover t.1) at he + rw [he,(a.center_identifications t.1).1,(a.center_identifications t.1).2.2.1, + (a.center_identifications t.1).2.2.2] at h + exact h + +end LocalCompactWaveData +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LocalWaveJets.lean b/lean/OAI/Geometry/NodalSets/Waves/LocalWaveJets.lean new file mode 100644 index 0000000000000000000000000000000000000000..2a66da82c35916bb998daed3de8c507e97b243db --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LocalWaveJets.lean @@ -0,0 +1,82 @@ +import OAI.Geometry.NodalSets.Waves.LatticeSourceWaves +import OAI.Geometry.NodalSets.Waves.LocalCompactWaves +import OAI.Geometry.NodalSets.Waves.WaveGerm + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Set Filter +open scoped ContDiff Topology +noncomputable section +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} +variable {D : Set Coord} {m J K k0 : ℕ} +namespace LocalCompactWaveData +variable (a : LocalCompactWaveData g w S D m J K k0) + +lemma center_identifications (t : a.cover.Parameter) : + a.G (coverSourceCenter a.cover t) = g (coverSourceCenter a.cover t) ∧ + a.A (coverSourceCenter a.cover t) = S (coverSourceCenter a.cover t) ∧ + metricGradient a.G a.A (coverSourceCenter a.cover t) = metricGradient g S (coverSourceCenter a.cover t) ∧ + sourceHessian a.G a.A (coverSourceCenter a.cover t) = sourceHessian g S (coverSourceCenter a.cover t) := by + obtain ⟨hG,hW,hA⟩ := a.germ _ (a.centers_E (a.cover.center t).property) + exact ⟨hG.self_of_nhds,hA.self_of_nhds,(metricGradient_eventuallyEq hG hA).self_of_nhds, + (sourceHessian_eventuallyEq hG hA).self_of_nhds⟩ + +lemma source_phase_center (t : a.cover.Parameter × Fin 3) : + a.beams.phase t (coverSourceCenter a.cover t.1) = (S (coverSourceCenter a.cover t.1):ℂ) := by + rw [a.beams.phase_center,(a.center_identifications t.1).2.1] + +lemma source_wave_center (N : ℝ) (hN : 0 < N) (t : a.cover.Parameter × Fin 3) : + a.beams.wave N t (coverSourceCenter a.cover t.1) = + Complex.exp ((N:ℂ)*(S (coverSourceCenter a.cover t.1):ℂ)) := by + rw [a.beams.wave_center N hN,(a.center_identifications t.1).2.1] + +lemma source_phase_first (t : a.cover.Parameter × Fin 3) (v : Coord) : + fderiv ℝ (a.beams.phase t) (coverSourceCenter a.cover t.1) v = + (g (coverSourceCenter a.cover t.1) (metricGradient g S (coverSourceCenter a.cover t.1)) v:ℂ)+ + Complex.I*(g (coverSourceCenter a.cover t.1) (a.cover.triple.q t.1 t.2) v:ℂ) := by + have h := a.beams.phase_first a.positive_G + (fun t ↦ a.nonzero_gradient _ (a.cover.center t).property) t v + rw [(a.center_identifications t.1).1,(a.center_identifications t.1).2.2.1] at h + exact h + +lemma source_phase_second (t : a.cover.Parameter × Fin 3) (v : Coord) : + sourceHessian g (fun z ↦ (a.beams.phase t z).re) (coverSourceCenter a.cover t.1) v v = + sourceHessian g S (coverSourceCenter a.cover t.1) v v - + sourceDirectionEta (g (coverSourceCenter a.cover t.1)) (sourceHessian g S (coverSourceCenter a.cover t.1)) + (metricGradient g S (coverSourceCenter a.cover t.1)) (a.cover.triple.q t.1 t.2) * + g (coverSourceCenter a.cover t.1) v v := by + have h := a.beams.phase_second a.smooth_G a.symmetric_G a.positive_G a.smooth_A + (fun t ↦ a.nonzero_gradient _ (a.cover.center t).property) t v + obtain ⟨hG,_,_⟩ := a.germ _ (a.centers_E (a.cover.center t.1).property) + have he := (sourceHessian_eventuallyEq hG + (Filter.EventuallyEq.refl (𝓝 (coverSourceCenter a.cover t.1)) (fun z ↦ (a.beams.phase t z).re))).self_of_nhds + change sourceHessian a.G (fun z ↦ (a.beams.phase t z).re) (coverSourceCenter a.cover t.1) = + sourceHessian g (fun z ↦ (a.beams.phase t z).re) (coverSourceCenter a.cover t.1) at he + rw [he,(a.center_identifications t.1).1,(a.center_identifications t.1).2.2.1, + (a.center_identifications t.1).2.2.2] at h + exact h + +theorem local_lattice_estimates {U : Set Coord} (hUD : U ⊆ D) : + ∀ᶠ n : ℕ in atTop, ∀ (z : SourceGrid U n) (j : Fin 3), + let V := latticeWave a.cover a.beams hUD n z j + ContDiff ℝ ∞ V ∧ HasCompactSupport V ∧ tsupport V ⊆ a.E ∧ + tsupport V ⊆ {x | sourceEuclideanNorm (x-scaledLatticePoint n z) ≤ a.beams.R*(n:ℝ)^(-1/3:ℝ)} ∧ + ∀ x : Coord, + (∀ k : Fin (k0+1), ‖iteratedFDeriv ℝ k.val V x‖ ≤ + a.beams.Cw*(n:ℝ)^k.val*Real.exp ((n:ℝ)*S x-a.beams.c*(n:ℝ)*(sourceEuclideanNorm (x-scaledLatticePoint n z))^2)) ∧ + DerivativeBound k0 (fun x ↦ sourceWeightedOperator g w V x+((4:ℂ)*(n:ℂ)^2+6*(n:ℂ))*V x) x + (a.beams.Cr*(n:ℝ)^(-(K:ℝ))*Real.exp ((n:ℝ)*S x)) := by + filter_upwards [a.estimates] with n hn + intro z j + simpa only [latticeWave,TripleSourceWaveData.wave,latticeFrame_center] using hn (latticeFrame a.cover hUD n z,j) + +lemma local_lattice_nonzero {U : Set Coord} (hUD : U ⊆ D) (n : ℕ) (hn : 0 < n) + (z : SourceGrid U n) (j : Fin 3) : latticeWave a.cover a.beams hUD n z j ≠ 0 := + a.beams.wave_ne_zero n (by exact_mod_cast hn) (latticeFrame a.cover hUD n z,j) + +end LocalCompactWaveData +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LocalWaveSupportCore.lean b/lean/OAI/Geometry/NodalSets/Waves/LocalWaveSupportCore.lean new file mode 100644 index 0000000000000000000000000000000000000000..af7becec9075caef92cef0630c3c2a64c8e69e76 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LocalWaveSupportCore.lean @@ -0,0 +1,48 @@ +import Mathlib.Topology.MetricSpace.Thickening +import OAI.Geometry.NodalSets.Waves.LocalCompactWaves + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Set Filter Metric +open scoped Topology +noncomputable section + +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} + {D : Set Coord} {m J K k0 : ℕ} + +theorem LocalCompactWaveData.uniform_support_core (a : LocalCompactWaveData g w S D m J K k0) + (hD : IsCompact D) {Ω : Set Coord} (hΩ : IsOpen Ω) (hDΩ : D ⊆ Ω) : + ∃ C : Set Coord, IsCompact C ∧ C ⊆ Ω ∧ D ⊆ interior C ∧ + ∀ᶠ n : ℕ in atTop, ∀ t : a.cover.Parameter × Fin 3, + tsupport (a.beams.wave (n:ℝ) t) ⊆ C ∧ + ∀ x ∉ C, ∀ k : ℕ, + iteratedFDeriv ℝ k (fun z ↦ sourceWeightedOperator g w (a.beams.wave (n:ℝ) t) z + + ((4:ℂ)*(n:ℂ)^2+6*(n:ℂ))*a.beams.wave (n:ℝ) t z) x = 0 := by + obtain ⟨C,hC,hDC,hCΩ⟩ := exists_compact_between hD hΩ hDΩ + obtain ⟨ε,hε,hth⟩ := hD.exists_cthickening_subset_open isOpen_interior hDC + have hsmall : ∀ᶠ n : ℕ in atTop, a.beams.R*(n:ℝ)^(-1/3:ℝ) < ε := by + apply eventually_nat_frequency (P := fun N : ℝ ↦ a.beams.R*N^(-1/3:ℝ) < ε) + have ht : Tendsto (fun N : ℝ ↦ a.beams.R*N^(-1/3:ℝ)) atTop (𝓝 0) := by + simpa only [neg_div,mul_zero] using + (tendsto_rpow_neg_atTop (by norm_num : (0:ℝ) < 1/3)).const_mul a.beams.R + exact ht.eventually (gt_mem_nhds hε) + refine ⟨C,hC,hCΩ,hDC,?_⟩ + filter_upwards [a.estimates,hsmall] with n hn hnε + intro t + have hsup : tsupport (a.beams.wave (n:ℝ) t) ⊆ C := by + intro x hx + have hb := (norm_le_sourceEuclideanNorm (x-coverSourceCenter a.cover t.1)).trans + ((hn t).2.2.2.1 hx) + have hc : coverSourceCenter a.cover t.1 ∈ D := (a.cover.center t.1).property + apply interior_subset (hth (mem_cthickening_of_dist_le x (coverSourceCenter a.cover t.1) ε D hc ?_)) + rw [dist_eq_norm] + exact (hb.trans_lt hnε).le + refine ⟨hsup,?_⟩ + intro x hx k + exact source_residual_derivative_zero g w _ _ x (fun hz ↦ hx (hsup hz)) k + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/LocalWavesInDomain.lean b/lean/OAI/Geometry/NodalSets/Waves/LocalWavesInDomain.lean new file mode 100644 index 0000000000000000000000000000000000000000..445a86f93a8dd50338fe7c2d2b75c7c381bb1728 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/LocalWavesInDomain.lean @@ -0,0 +1,49 @@ +import OAI.Geometry.NodalSets.Waves.LocalCompactWaves + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Set Filter +open scoped ContDiff Topology +noncomputable section +attribute [local instance] clmTopology clmAdd clmModule + +theorem construct_local_compact_waves_in_domain {D U : Set Coord} (hD : IsCompact D) + (hU : IsOpen U) (hDU : D ⊆ U) (hUn : U.Nonempty) + (g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ) (hg : ContDiffOn ℝ ∞ g U) + (hs : ∀ x ∈ U, ∀ u v, g x u v = g x v u) + (hp : ∀ x ∈ U, ∀ v, v ≠ 0 → 0 < g x v v) + (w S : Coord → ℝ) (hw : ContDiffOn ℝ ∞ w U) (hS : ContDiffOn ℝ ∞ S U) + (hwp : ∀ x ∈ U, 0 < w x) (hp0 : ∀ x ∈ D, metricGradient g S x ≠ 0) + (hdir : ∀ x ∈ D, ∃ v : Coord, g x (metricGradient g S x) v = 0 ∧ g x v v = 1 ∧ + 0 < sourceHessian g S x (metricGradient g S x) (metricGradient g S x)+ + (g x (metricGradient g S x) (metricGradient g S x)+4)*sourceHessian g S x v v) + (m J K k0 : ℕ) (hm : 3*K+4*k0+6 < m+1) (hJ : K+k0+1 ≤ J) : + ∃ a : LocalCompactWaveData g w S D m J K k0, a.E ⊆ U := by + obtain ⟨G,W,A,E,hG,hW,hA,hGs,hGp,hE,hDE,hEU,hWp,he⟩ := + compact_source_representatives hD hU hDU hUn g hg hs hp w S hw hS hwp + have hn (x : Coord) (hx : x ∈ D) : metricGradient G A x ≠ 0 := by + rw [(he x (hDE hx)).2.2.2.1] + exact hp0 x hx + have hd (x : Coord) (hx : x ∈ D) : ∃ v : Coord, + G x (metricGradient G A x) v = 0 ∧ G x v v = 1 ∧ + 0 < sourceHessian G A x (metricGradient G A x) (metricGradient G A x)+ + (G x (metricGradient G A x) (metricGradient G A x)+4)*sourceHessian G A x v v := by + obtain ⟨hge,_,_,hpEq,hHEq⟩ := he x (hDE hx) + rw [hge.self_of_nhds,hpEq,hHEq] + exact hdir x hx + obtain ⟨d,⟨b⟩,_⟩ := construct_compact_source_waves G hG hGs hGp W hW A hA + hD hE hDE hWp hn hd m J K k0 hm hJ + have hest := local_source_wave_transfer g G w W S A + (fun t : d.Parameter × Fin 3 ↦ coverSourceCenter d t.1) + ((continuous_coverSourceCenter d).comp continuous_fst) hE + (fun t ↦ hDE (d.center t.1).property) + (fun x hx ↦ ⟨(he x hx).1,(he x hx).2.1,(he x hx).2.2.1.self_of_nhds⟩) + (fun n t ↦ b.wave (n:ℝ) t) k0 K b.c b.Cw b.Cr b.R b.Cw_pos b.Cr_pos b.estimates + refine ⟨⟨G,W,A,E,hG,hW,hA,hGs,hGp,hE,hDE, + (fun x hx ↦ ⟨(he x hx).1,(he x hx).2.1,(he x hx).2.2.1⟩),hn,d,b,hest⟩,hEU⟩ + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/NetProbability.lean b/lean/OAI/Geometry/NodalSets/Waves/NetProbability.lean new file mode 100644 index 0000000000000000000000000000000000000000..ec8a9dd415253b91f792164810edc3611b6cead3 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/NetProbability.lean @@ -0,0 +1,63 @@ +import Mathlib.Analysis.Calculus.MeanValue +import Mathlib.MeasureTheory.Measure.Basic + +namespace OAI + +namespace Yau.Probability +open Set MeasureTheory +open scoped ENNReal +noncomputable section +variable {Ω X F : Type*} [MeasurableSpace Ω] [NormedAddCommGroup F] + +lemma finite_small_ball_union (μ : Measure Ω) (t : Finset X) (Z : Ω → X → F) + (r : ℝ) (p : ℝ≥0∞) (hp : ∀ x ∈ t, μ {ω | ‖Z ω x‖ ≤ r} ≤ p) : + μ {ω | ∃ x ∈ t, ‖Z ω x‖ ≤ r} ≤ t.card*p := by + have he : {ω | ∃ x ∈ t, ‖Z ω x‖ ≤ r} = ⋃ x ∈ t, {ω | ‖Z ω x‖ ≤ r} := by + ext ω + simp + rw [he] + exact (measure_biUnion_finset_le t _).trans (by + simpa using Finset.sum_le_sum hp) + +lemma net_failure_le (μ : Measure Ω) (t : Finset X) (E : Set X) + (Z : Ω → X → F) (good : Set Ω) (r : ℝ) (p : ℝ≥0∞) + (hp : ∀ x ∈ t, μ {ω | ‖Z ω x‖ ≤ 2*r} ≤ p) + (happrox : ∀ ω ∈ good, ∀ x ∈ E, ∃ y ∈ t, ‖Z ω y-Z ω x‖ ≤ r) : + μ {ω | ∃ x ∈ E, ‖Z ω x‖ < r} ≤ μ goodᶜ+t.card*p := by + have hsub : {ω | ∃ x ∈ E, ‖Z ω x‖ < r} ⊆ + goodᶜ ∪ {ω | ∃ y ∈ t, ‖Z ω y‖ ≤ 2*r} := by + intro ω hω + by_cases hg : ω ∈ good + · obtain ⟨x,hx,hsmall⟩ := hω + obtain ⟨y,hy,hd⟩ := happrox ω hg x hx + right + refine ⟨y,hy,?_⟩ + have htri : ‖Z ω y‖ ≤ ‖Z ω y-Z ω x‖+‖Z ω x‖ := norm_le_norm_sub_add _ _ + linarith + · exact Or.inl hg + exact (measure_mono hsub).trans ((measure_union_le _ _).trans + (add_le_add le_rfl (finite_small_ball_union μ t Z (2*r) p hp))) + +variable [NormedAddCommGroup X] [NormedSpace ℝ X] [NormedSpace ℝ F] + +lemma neighborhood_net_approximation (t : Finset X) (E : Set X) (Z : X → F) + {δ R L r : ℝ} (hδ : 0 ≤ δ) (hδR : δ ≤ R) (hL : 0 ≤ L) (hLδ : L*δ ≤ r) + (hnet : ∀ x ∈ E, ∃ y ∈ t, ‖x-y‖ ≤ δ) + (hdiff : ∀ x ∈ E, ∀ z ∈ Metric.closedBall x R, DifferentiableAt ℝ Z z) + (hderiv : ∀ x ∈ E, ∀ z ∈ Metric.closedBall x R, ‖fderiv ℝ Z z‖ ≤ L) : + ∀ x ∈ E, ∃ y ∈ t, ‖Z y-Z x‖ ≤ r := by + intro x hx + obtain ⟨y,hy,hd⟩ := hnet x hx + have hxball : x ∈ Metric.closedBall x R := Metric.mem_closedBall_self (hδ.trans hδR) + have hyball : y ∈ Metric.closedBall x R := by + rw [Metric.mem_closedBall,dist_eq_norm,norm_sub_rev] + exact hd.trans hδR + have h := (convex_closedBall x R).norm_image_sub_le_of_norm_fderiv_le + (hdiff x hx) (hderiv x hx) hxball hyball + rw [norm_sub_rev y x] at h + exact ⟨y,hy,h.trans ((mul_le_mul_of_nonneg_left hd hL).trans hLδ)⟩ + +end +end Yau.Probability + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/NormalFrameWaveJet.lean b/lean/OAI/Geometry/NodalSets/Waves/NormalFrameWaveJet.lean new file mode 100644 index 0000000000000000000000000000000000000000..6af03fdc5399eed6cf6e6e84a02c1e4a60f85ac2 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/NormalFrameWaveJet.lean @@ -0,0 +1,60 @@ +import OAI.Geometry.NodalSets.Charts.NormalFrameContinuous +import OAI.Geometry.NodalSets.Waves.UniformWaveJet + +namespace OAI + +namespace Yau.Jets +open MvPolynomial +open scoped ContDiff +noncomputable section +variable {T : Type*} [TopologicalSpace T] + +theorem normal_frame_smooth_wave_jets_continuous + (a bb S : T → ℝ) (H : T → Fin 4 → Fin 4 → ℝ) + (ha : Continuous a) (hbb : Continuous bb) (hS : Continuous S) + (hHc : ∀ i j, Continuous (fun t ↦ H t i j)) + (ha0 : ∀ t, a t ≠ 0) (hbb0 : ∀ t, bb t ≠ 0) + (hlen : ∀ t, bb t ^ 2 = a t ^ 2 + 4) (hH : ∀ t i j, H t i j = H t j i) + (g : T → Fin 4 → Fin 4 → Coord → ℂ) (b : T → Fin 4 → Coord → ℂ) + (G : T → Fin 4 → Fin 4 → CPoly) (B : T → Fin 4 → CPoly) + (hG : ∀ i j, ContinuousPolyFamily (fun t ↦ G t i j)) + (hB : ∀ i, ContinuousPolyFamily (fun t ↦ B t i)) + (hg : ∀ t i j, ContDiff ℝ ∞ (g t i j)) (hb : ∀ t i, ContDiff ℝ ∞ (b t i)) + (hmetric : ∀ t i j, homogeneousComponent 0 (G t i j) = if i = j then 1 else 0) + (hmetricFirst : ∀ t i j, homogeneousComponent 1 (G t i j) = 0) (m J : ℕ) + (hgj : ∀ t i j, FlatAt m (fun x ↦ g t i j x - reval (G t i j) x) 0) + (hbj : ∀ t i, FlatAt m (fun x ↦ b t i x - reval (B t i) x) 0) : + ∃ (phi : T → CPoly) (A : ℕ → T → CPoly), + ContinuousPolyFamily phi ∧ (∀ j, ContinuousPolyFamily (A j)) ∧ + (∀ t k, k ≤ 2 → homogeneousComponent k (phi t) = initialPhaseJet (S t) (normalFrameVector (a t) (bb t)) + (normalComplexHessian (a t) (bb t) (H t)) k) ∧ + (∀ t d, m + 2 * J + 3 < d → homogeneousComponent d (phi t) = 0) ∧ + (∀ j t, homogeneousComponent 0 (A j t) = if j = 0 then 1 else 0) ∧ + (∀ j t k, m + 1 + 2 * (J - j) < k → homogeneousComponent k (A j t) = 0) ∧ + (∀ t, FlatAt m (smoothEikonal (g t) (reval (phi t))) 0) ∧ + (∀ t, FlatAt m (smoothTransport (smoothBeamVector (g t) (reval (phi t))) + (smoothBeamScalar (g t) (b t) (reval (phi t))) (fun _ ↦ 0) (reval (A 0 t))) 0) ∧ + ∀ j, j < J → ∀ t, FlatAt m + (smoothTransport (smoothBeamVector (g t) (reval (phi t))) + (smoothBeamScalar (g t) (b t) (reval (phi t))) + (fun x ↦ -smoothSecondOrder (g t) (b t) (reval (A j t)) x) + (reval (A (j + 1) t))) 0 := by + apply smooth_wave_jets_continuous (fun t ↦ normalFrameVector (a t) (bb t)) + (normalFrameVector_continuous a bb ha hbb) 0 + (fun t ↦ by simpa [normalFrameVector] using (Complex.ofReal_ne_zero.mpr (ha0 t))) + g b G B hG hB hg hb hmetric + (fun t ↦ initialPhaseJet (S t) (normalFrameVector (a t) (bb t)) + (normalComplexHessian (a t) (bb t) (H t))) + (fun t k ↦ initialPhaseJet_homogeneous _ _ _ k) + (normal_frame_initial_jets_continuous a bb S H ha hbb hS hHc ha0 hbb0) + (fun t i ↦ initialPhaseJet_first _ _ _ i) + (fun t ↦ normalFrameVector_null (hlen t)) + (fun t ↦ initialPhaseJet_second _ _ _ + (normalComplexHessian_symmetric (ha0 t) (hbb0 t) (H t) (hH t)) + (normalComplexHessian_contract (ha0 t) (hbb0 t) (H t)) + (fun r i j ↦ homogeneousComponent r (G t i j)) (hmetricFirst t)) m J hgj hbj + +end +end Yau.Jets + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/NormalizedWaveRatio.lean b/lean/OAI/Geometry/NodalSets/Waves/NormalizedWaveRatio.lean new file mode 100644 index 0000000000000000000000000000000000000000..d1a296aa1304117247847c422200f4ccd598b281 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/NormalizedWaveRatio.lean @@ -0,0 +1,63 @@ +import OAI.Geometry.NodalSets.Elliptic.NormalizedRescaling +import OAI.Geometry.NodalSets.Elliptic.RescaledPhaseDefect + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Set +open scoped ContDiff +noncomputable section + +def planeWave (k : Coord →L[ℝ] ℝ) (s : ℝ) (v : Coord) : ℂ := + Complex.exp (Complex.I*(k v/s:ℝ)) + +lemma planeWave_norm (k : Coord →L[ℝ] ℝ) (s : ℝ) (v : Coord) : + ‖planeWave k s v‖ = 1 := by + simp [planeWave,Complex.norm_exp] + +lemma normalizedWave_factorization (V amp phi : Coord → ℂ) (S : Coord → ℝ) + (k : Coord →L[ℝ] ℝ) (N s sigma : ℝ) (x v : Coord) + (hax : amp x ≠ 0) + (hx : V x = amp x*Complex.exp ((N:ℂ)*phi x)) + (hz : V (x+(N*s)⁻¹ • v) = amp (x+(N*s)⁻¹ • v)*Complex.exp ((N:ℂ)*phi (x+(N*s)⁻¹ • v))) : + normalizedRescaling V S N s sigma x v = + (V x/(sigma:ℂ))*planeWave k s v * + ((amp (x+(N*s)⁻¹ • v)/amp x)* + Complex.exp (rescaledPhaseDefect phi (frozenPhaseCovector (fderiv ℝ S x) k) N s x v)) := by + have hexp : Complex.exp ((N:ℂ)*phi (x+(N*s)⁻¹ • v)) = + Complex.exp ((N:ℂ)*phi x) * Complex.exp (fderiv ℝ S x v/s:ℝ) * planeWave k s v * + Complex.exp (rescaledPhaseDefect phi (frozenPhaseCovector (fderiv ℝ S x) k) N s x v) := by + simp only [planeWave,← Complex.exp_add,rescaledPhaseDefect,frozenPhaseCovector_apply, + Complex.real_smul,Complex.ofReal_div,Complex.ofReal_inv] + congr 1 + ring + rw [normalizedRescaling_eq_div,hz,hx,hexp] + rw [Complex.ofReal_mul,Complex.ofReal_exp] + field_simp + +lemma ratio_exp_error {a z : ℂ} {e : ℝ} (he : 0 ≤ e) (he1 : e ≤ 1) + (ha : ‖a-1‖ ≤ e) (hz : ‖z‖ ≤ e) : ‖a*Complex.exp z-1‖ ≤ 5*e := by + have hzexp := Complex.norm_exp_sub_one_le (hz.trans he1) + have hnexp : ‖Complex.exp z‖ ≤ 3 := by + have h := norm_add_le (Complex.exp z-1) (1:ℂ) + simp only [sub_add_cancel,norm_one] at h + linarith + have heq : a*Complex.exp z-1 = (a-1)*Complex.exp z+(Complex.exp z-1) := by ring + rw [heq] + apply (norm_add_le _ _).trans + rw [norm_mul] + have hprod := mul_le_mul ha hnexp (norm_nonneg _) (by linarith : 0 ≤ e) + linarith + +lemma amplitude_ratio_near_one {a b : ℂ} {e : ℝ} (ha : (1/2:ℝ) ≤ ‖a‖) + (hb : ‖b-a‖ ≤ e) : ‖b/a-1‖ ≤ 2*e := by + have hane : a ≠ 0 := by intro h; simp [h] at ha; norm_num at ha + rw [show b/a-1 = (b-a)/a by field_simp,norm_div] + apply (div_le_iff₀ (by linarith : 0 < ‖a‖)).mpr + have he : 0 ≤ e := (norm_nonneg _).trans hb + nlinarith + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/PlacedEnvelopeWaves.lean b/lean/OAI/Geometry/NodalSets/Waves/PlacedEnvelopeWaves.lean new file mode 100644 index 0000000000000000000000000000000000000000..3db5885af235f6598ede5a92e8382ab9cf94d094 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/PlacedEnvelopeWaves.lean @@ -0,0 +1,50 @@ +import OAI.Geometry.NodalSets.Elliptic.PlacedEnvelopeDomains +import OAI.Geometry.NodalSets.Waves.LocalCompactWaves + +namespace OAI + +namespace Yau.Target +open Yau.Geometry Yau.Jets Set Metric +open scoped ContDiff +noncomputable section + +lemma PlacedEnvelopeData.closure_U_branch {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} + {r a : ℝ} {K : Set Coord} {T : ℝ} (d : PlacedEnvelopeData g r a K T) : + closure d.U ⊆ seedCoordBranch := + d.closure_U_Ω.trans (subset_closure.trans (d.closure_Ω_patch.trans + (subset_closure.trans (d.patch_V.trans d.V_branch)))) + +lemma PlacedEnvelopeData.closure_U_V {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} + {r a : ℝ} {K : Set Coord} {T : ℝ} (d : PlacedEnvelopeData g r a K T) : + closure d.U ⊆ d.V := + d.closure_U_Ω.trans (subset_closure.trans (d.closure_Ω_patch.trans + (subset_closure.trans d.patch_V))) + +theorem PlacedEnvelopeData.waves {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} + {r a : ℝ} {K : Set Coord} {T : ℝ} (d : PlacedEnvelopeData g r a K T) (ha : 0 ≤ a) + (hg : ContDiffOn ℝ ∞ g seedCoordBranch) + (hs : ∀ x ∈ seedCoordBranch, ∀ u v, g x u v = g x v u) + (hp : ∀ x ∈ seedCoordBranch, ∀ v, v ≠ 0 → 0 < g x v v) + (w : Coord → ℝ) (hw : ContDiffOn ℝ ∞ w seedCoordBranch) + (hwp : ∀ x ∈ seedCoordBranch, 0 < w x) (k0 K' : ℕ) : + Nonempty (LocalCompactWaveData g w d.S (closure d.U) + (3*K'+4*k0+6) (K'+k0+1) K' k0) := by + have h0 : (0 : Coord) ∈ seedCoordCube a := by + constructor <;> intro i <;> simp only [Pi.zero_apply] <;> linarith + have h0U : (0 : Coord) ∈ d.U := d.C_U (d.inner_C (Or.inl h0)) + have h0V : (0 : Coord) ∈ d.V := d.closure_U_V (subset_closure h0U) + apply construct_local_compact_waves d.compact_closure_U d.open_V d.closure_U_V ⟨0,h0V⟩ + g (hg.mono d.V_branch) (fun x hx ↦ hs x (d.V_branch hx)) + (fun x hx ↦ hp x (d.V_branch hx)) w d.S (hw.mono d.V_branch) + (d.smooth.mono d.V_branch) (fun x hx ↦ hwp x (d.V_branch hx)) + (fun x hx ↦ (d.admissible x (d.closure_U_V hx)).1) + · intro x hx + obtain ⟨hn,v,hv,hpv,hstr⟩ := d.admissible x (d.closure_U_V hx) + exact ⟨v,hpv,hv,hstr⟩ + · omega + · omega + +end +end Yau.Target + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/PlacedFirstJetProbability.lean b/lean/OAI/Geometry/NodalSets/Waves/PlacedFirstJetProbability.lean new file mode 100644 index 0000000000000000000000000000000000000000..26d64852b09d6598e99fb7e64371c09ee64c4b10 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/PlacedFirstJetProbability.lean @@ -0,0 +1,86 @@ +import OAI.Geometry.NodalSets.Elliptic.PlacedSmoothRepresentatives +import OAI.Geometry.NodalSets.Waves.LatticeGoodEvent + +namespace OAI + +namespace Yau.Target +open Yau.Geometry Yau.Jets Yau.Probability Set Filter MeasureTheory +open scoped ContDiff Topology +noncomputable section +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w : Coord → ℝ} +variable {r a : ℝ} {Kset : Set Coord} {T : ℝ} {m J K k0 : ℕ} + +def PlacedEnvelopeData.representativeWaves (d : PlacedEnvelopeData g r a Kset T) + (b : LocalCompactWaveData g w d.S (closure d.U) m J K k0) + (S : Coord → ℝ) (he : ∀ x ∈ closure d.Ω, S =ᶠ[𝓝 x] d.S) : + LocalCompactWaveData g w S (closure d.U) m J K k0 := + b.withEnvelope S (envelope_germ_open d.S S) + (fun x hx ↦ he x (subset_closure (d.closure_U_Ω hx))) (fun _ hx ↦ hx) + +lemma PlacedEnvelopeData.literal_good_event_eq (d : PlacedEnvelopeData g r a Kset T) + (b : LocalCompactWaveData g w d.S (closure d.U) m J K k0) + (S S0 T0 : Coord → ℝ) + (he : ∀ x ∈ closure d.Ω, S =ᶠ[𝓝 x] d.S ∧ S0 =ᶠ[𝓝 x] seedCoordReal ∧ + T0 =ᶠ[𝓝 x] seedCoordImag) + (n : ℕ) (hfin : Fintype (SourceGrid d.U n)) : + (d.representativeWaves b S (fun x hx ↦ (he x hx).1)).latticeGoodEvent + subset_closure n hfin S0 T0 (closure d.Ω) = + letI := hfin + coefficientJetGoodEvent + (fun i : SourceGrid d.U n × Fin 3 ↦ latticeWave b.cover b.beams subset_closure n i.1 i.2) + (seedCoordinateField n) n (closure d.Ω) + (fun x ↦ ((n:ℝ)^65)⁻¹*max (Real.exp ((n:ℝ)*d.S x)) + (Real.exp ((n:ℝ)*seedCoordReal x))) := by + let := hfin + ext coeff + simp only [LocalCompactWaveData.latticeGoodEvent,coefficientJetGoodEvent, + mem_inter_iff,firstJetGoodEvent,mem_ofPred_eq] + apply and_congr_right + intro _ + apply forall_congr' + intro x + apply forall_congr' + intro hx + have hg := seedCoordinateField_log_germ n (d.closure_Ω_branch hx) S0 T0 + (he x hx).2.1 (he x hx).2.2 + have hj := seeded_sourceFirstJetSize_germ (v := gaussianWaveField + (fun i : SourceGrid d.U n × Fin 3 ↦ latticeWave b.cover b.beams subset_closure n i.1 i.2) coeff) hg (n:ℝ) + change (_ ≤ sourceFirstJetSize _ _ _) ↔ (_ ≤ sourceFirstJetSize _ _ _) + rw [hj,(he x hx).1.eq_of_nhds,(he x hx).2.1.eq_of_nhds] + rfl + +theorem PlacedEnvelopeData.literal_good_event_probability + (d : PlacedEnvelopeData g r a Kset T) + (b : LocalCompactWaveData g w d.S (closure d.U) m J K k0) (hk0 : 2 ≤ k0) + (hq : ∀ x ∈ closure d.Ω, fderiv ℝ seedCoordImag x ≠ 0) : + ∀ ε : ℝ, 0 < ε → ∀ᶠ n : ℕ in atTop, ∃ hfin : Fintype (SourceGrid d.U n), + letI := hfin + let event := coefficientJetGoodEvent + (fun i : SourceGrid d.U n × Fin 3 ↦ latticeWave b.cover b.beams subset_closure n i.1 i.2) + (seedCoordinateField n) n (closure d.Ω) + (fun x ↦ ((n:ℝ)^65)⁻¹*max (Real.exp ((n:ℝ)*d.S x)) + (Real.exp ((n:ℝ)*seedCoordReal x))) + MeasurableSet event ∧ gaussianPairs eventᶜ ≤ ENNReal.ofReal ε := by + obtain ⟨S,S0,T0,hS,hS0,hT0,he⟩ := d.smooth_representatives + let b' := d.representativeWaves b S (fun x hx ↦ (he x hx).1) + have hq' : ∀ x ∈ closure d.Ω, fderiv ℝ T0 x ≠ 0 := by + intro x hx + rw [(he x hx).2.2.fderiv_eq] + exact hq x hx + have hgap : ∀ x ∈ closure d.Ω, x ∉ d.U → S x-S0 x ≤ -d.gap := by + intro x hx hxu + rw [(he x hx).1.eq_of_nhds,(he x hx).2.1.eq_of_nhds] + exact d.outside_gap x hxu + intro ε hε + filter_upwards [b'.lattice_good_event_probability subset_closure d.open_U + (d.compact_closure_U.isBounded.subset subset_closure) hS S0 T0 hS0 hT0 + d.compact_closure_Ω hk0 hq' d.gap_pos hgap ε hε] with n hn + obtain ⟨hfin,hn⟩ := hn + refine ⟨hfin,?_⟩ + rw [d.literal_good_event_eq b S S0 T0 he n hfin] at hn + exact hn + +end +end Yau.Target + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/PlaneWaveCovariance.lean b/lean/OAI/Geometry/NodalSets/Waves/PlaneWaveCovariance.lean new file mode 100644 index 0000000000000000000000000000000000000000..c2425599b9d40e1fd27e05812c33f2a0103aae78 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/PlaneWaveCovariance.lean @@ -0,0 +1,47 @@ +import OAI.Geometry.NodalSets.Waves.GaussianPairCovariance +import OAI.Geometry.NodalSets.Waves.NormalizedWaveRatio + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Yau.Probability MeasureTheory ProbabilityTheory +noncomputable section +variable {ι : Type*} [Fintype ι] + +lemma complex_rotated_pairing (z : ℂ) (t : ℝ) : + z.re*(z*Complex.exp (Complex.I*(t:ℂ))).re + + z.im*(z*Complex.exp (Complex.I*(t:ℂ))).im = ‖z‖^2*Real.cos t := by + simp [Complex.exp_re,Complex.exp_im,Complex.mul_re,Complex.mul_im, + Complex.sq_norm,Complex.normSq_apply] + ring + +lemma gaussianWaveField_eq_pair (V : ι → Coord → ℂ) (v : Coord) : + (fun a ↦ gaussianWaveField V a v) = pairLinearSum (fun i ↦ V i v) := by + funext a + rw [pairLinearSum_eq_complex] + simp only [gaussianWaveField,Complex.re_sum] + +lemma planeWave_zero (k : Coord →L[ℝ] ℝ) (s : ℝ) : planeWave k s 0 = 1 := by + simp [planeWave] + +lemma planeWave_two_point_covariance (alpha : ι → ℂ) (k : ι → Coord →L[ℝ] ℝ) + (s : ℝ) (v : Coord) : + cov[(fun a ↦ gaussianWaveField (fun i z ↦ alpha i*planeWave (k i) s z) a 0), + (fun a ↦ gaussianWaveField (fun i z ↦ alpha i*planeWave (k i) s z) a v);gaussianPairs] = + ∑ i, ‖alpha i‖^2*Real.cos (k i v/s) := by + rw [gaussianWaveField_eq_pair,gaussianWaveField_eq_pair,covariance_pairLinearSum] + apply Finset.sum_congr rfl + intro i _ + simpa [planeWave] using complex_rotated_pairing (alpha i) (k i v/s) + +lemma planeWave_value_variance (alpha : ι → ℂ) (k : ι → Coord →L[ℝ] ℝ) + (s : ℝ) (v : Coord) : + Var[fun a ↦ gaussianWaveField (fun i z ↦ alpha i*planeWave (k i) s z) a v;gaussianPairs] = + ∑ i, ‖alpha i‖^2 := by + rw [gaussianWaveField_eq_pair,variance_pairLinearSum] + simp only [norm_mul,planeWave_norm,mul_one] + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/PlaneWaveJets.lean b/lean/OAI/Geometry/NodalSets/Waves/PlaneWaveJets.lean new file mode 100644 index 0000000000000000000000000000000000000000..61edc796db50b184e6700285a2eb69bb6555e3e5 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/PlaneWaveJets.lean @@ -0,0 +1,65 @@ +import OAI.Geometry.NodalSets.Elliptic.RescaledHigherJets +import OAI.Geometry.NodalSets.Waves.ExponentialWaveBounds +import OAI.Geometry.NodalSets.Waves.NormalizedWaveRatio + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Set +open scoped ContDiff +noncomputable section + +lemma planeWave_smooth (k : Coord →L[ℝ] ℝ) (s : ℝ) : ContDiff ℝ ∞ (planeWave k s) := by + unfold planeWave + have hh : ContDiff ℝ ∞ (fun v ↦ ((k v/s:ℝ):ℂ)) := + Complex.ofRealCLM.contDiff.comp (k.contDiff.div_const s) + exact Complex.contDiff_exp.comp (contDiff_const.mul hh) + +lemma planeWave_derivative_bound (k : Coord →L[ℝ] ℝ) {s B : ℝ} + (hs : 1 ≤ s) (hB : 1 ≤ B) (hk : ‖k‖ ≤ B) (d : ℕ) (v : Coord) : + ‖iteratedFDeriv ℝ d (planeWave k s) v‖ ≤ d.factorial*B^d := by + let L : Coord →L[ℝ] ℂ := s⁻¹ • (Complex.I • Complex.ofRealCLM.comp k) + have he : planeWave k s = Complex.exp ∘ L := by + funext z + simp [planeWave,L,Complex.real_smul,div_eq_mul_inv,mul_comm,mul_left_comm] + have hL : ‖L‖ ≤ B := by + apply ContinuousLinearMap.opNorm_le_bound _ (by linarith) + intro z + have hs0 : 0 < s := lt_of_lt_of_le zero_lt_one hs + have hi : s⁻¹ ≤ 1 := (inv_le_one₀ hs0).mpr hs + calc + ‖L z‖ = s⁻¹*‖k z‖ := by simp [L,abs_of_pos hs0] + _ ≤ 1*(B*‖z‖) := mul_le_mul hi ((k.le_opNorm z).trans (by gcongr)) (norm_nonneg _) zero_le_one + _ = _ := by ring + rw [he] + have h := norm_iteratedFDeriv_comp_le (Complex.contDiff_exp (𝕜 := ℝ) (n := ∞)) + (L.contDiff (n := ∞)) (n := d) (by exact_mod_cast (show (d:ℕ∞) ≤ ⊤ from le_top)) v + (C := 1) (D := B) + (fun j hj ↦ by + rw [norm_iteratedFDeriv_complex_exp] + simp [L,Complex.real_smul]) + (fun j hj hjd ↦ by + by_cases hj1 : j = 1 + · subst j; simpa only [norm_iteratedFDeriv_one,L.fderiv,pow_one] using hL + · rw [iteratedFDeriv_linear_high L v (by omega),norm_zero] + positivity) + simpa only [mul_one] using h + +lemma uniform_planeWave_jets {T : Type*} [TopologicalSpace T] [CompactSpace T] + (K : T → Coord →L[ℝ] ℝ) (hK : Continuous K) (d : ℕ) : + ∃ B > 0, ∀ t s, 1 ≤ s → ∀ v, ∀ j, j ≤ d → + ‖iteratedFDeriv ℝ j (planeWave (K t) s) v‖ ≤ B := by + obtain ⟨C,hC,hb⟩ := (isCompact_univ.image hK).isBounded.exists_pos_norm_le + let D := max 1 C + refine ⟨(d.factorial:ℝ)*D^d,by dsimp [D]; positivity,?_⟩ + intro t s hs v j hj + have hnorm : ‖K t‖ ≤ D := (hb _ ⟨t,mem_univ _,rfl⟩).trans (le_max_right _ _) + apply (planeWave_derivative_bound (K t) hs (le_max_left _ _) hnorm j v).trans + have hfac : (j.factorial:ℝ) ≤ d.factorial := by exact_mod_cast Nat.factorial_le hj + have hpow := pow_le_pow_right₀ (show 1 ≤ D from le_max_left _ _) hj + gcongr + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/PlaneWaveJets2.lean b/lean/OAI/Geometry/NodalSets/Waves/PlaneWaveJets2.lean new file mode 100644 index 0000000000000000000000000000000000000000..4b81d8d4514f2e8ca96446ee4da36ee9e082bcd3 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/PlaneWaveJets2.lean @@ -0,0 +1,95 @@ +import OAI.Geometry.NodalSets.Elliptic.ProductErrorJets +import OAI.Geometry.NodalSets.Elliptic.RescaledJetDecay +import OAI.Geometry.NodalSets.Waves.PlaneWaveJets + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Set Filter Metric +open scoped ContDiff Topology +noncomputable section +variable {T : Type*} [TopologicalSpace T] [CompactSpace T] +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} +variable {y : T → Coord} {d : SourceFrameTriple g S y} {m J K k0 : ℕ} +namespace TripleSourceWaveData +variable (b : TripleSourceWaveData g w S y d m J K k0) + +theorem uniform_main_coefficient_jets (hg : ContDiff ℝ ∞ g) + (hp : ∀ x v, v ≠ 0 → 0 < g x v v) (hS : ContDiff ℝ ∞ S) + (hy : Continuous y) (hp0 : ∀ t, metricGradient g S (y t) ≠ 0) + (R : ℝ) (hR : 0 ≤ R) (d0 : ℕ) (e : ℝ) (he : 0 < e) : + ∀ᶠ n : ℕ in atTop, ∀ t x s, 1 ≤ s → + sourceEuclideanNorm (x-y t.1) ≤ (n:ℝ)^(-5/12:ℝ) → + ∀ (sigma : ℝ) (v : Coord), ‖v‖ ≤ R → ∀ k, k ≤ d0 → + ‖iteratedFDeriv ℝ k (fun z ↦ normalizedRescaling (b.wave n t) S n s sigma x z - + (b.wave n t x/(sigma:ℂ))*planeWave (g (y t.1) (d.q t.1 t.2)) s z) v‖ ≤ + e*‖b.wave n t x/(sigma:ℂ)‖ := by + have hq : Continuous (fun t : T × Fin 3 ↦ d.q t.1 t.2) := + continuous_prod_of_discrete_right.mpr (fun j ↦ (continuous_apply j).comp d.continuous_q) + have hK : Continuous (fun t : T × Fin 3 ↦ g (y t.1) (d.q t.1 t.2)) := + (hg.continuous.comp (hy.comp continuous_fst)).clm_apply hq + obtain ⟨B,hB,hplane⟩ := uniform_planeWave_jets _ hK d0 + let cost : ℝ := 2^d0*B*(2^d0+2) + have hcost : 0 < cost := by dsimp [cost]; positivity + let q := min 1 (e/cost) + have hqpos : 0 < q := lt_min zero_lt_one (div_pos he hcost) + have hq1 : q ≤ 1 := min_le_left _ _ + have hqcost : cost*q ≤ e := by + have := (le_div_iff₀ hcost).mp (min_le_right 1 (e/cost)) + nlinarith + obtain ⟨delta,hdelta,hexp⟩ := small_exp_jet_threshold d0 q hqpos + have hmin : 0 < min delta q := lt_min hdelta hqpos + filter_upwards [b.uniform_rescaled_factor_jets hg hp hS hy hp0 (R+1) (by linarith) d0 + (min delta q) hmin,b.uniform_main_amplitude_ratio hg hp hy (R+1) 1 zero_lt_one] + with n hfactors hgerms + intro t x s hs hnear sigma v hv k hk + let U := ball (0:Coord) (R+1) + have hU : IsOpen U := isOpen_ball + have hvU : v ∈ U := by simpa only [U,mem_ball,dist_zero_right] using (show ‖v‖ < R+1 by linarith) + have hnorm (z : Coord) (hz : z ∈ U) : ‖z‖ ≤ R+1 := (by simpa only [U,mem_ball,dist_zero_right] using hz : ‖z‖ < R+1).le + let L := frozenPhaseCovector (fderiv ℝ S x) (g (y t.1) (d.q t.1 t.2)) + let E := rescaledPhaseDefect (b.phase t) L n s x + let A := rescaledAmplitudeRatio (b.amplitude n t) n s x + let P := planeWave (g (y t.1) (d.q t.1 t.2)) s + let alpha := b.wave n t x/(sigma:ℂ) + have hEs : ContDiffOn ℝ ∞ E U := fun z hz ↦ (hfactors t x s hs hnear z (hnorm z hz)).1.contDiffWithinAt + have hAs : ContDiffOn ℝ ∞ A U := fun z hz ↦ (hfactors t x s hs hnear z (hnorm z hz)).2.1.contDiffWithinAt + have hPs : ContDiff ℝ ∞ P := planeWave_smooth _ _ + have hBs : ContDiffOn ℝ ∞ (fun z ↦ Complex.exp (E z)) U := Complex.contDiff_exp.comp_contDiffOn hEs + have hEa (j : ℕ) (hj : j ≤ d0) : ‖iteratedFDeriv ℝ j E v‖ ≤ delta := + ((hfactors t x s hs hnear v (hv.trans (by linarith))).2.2 j hj).1.trans (min_le_left _ _) + have hAa (j : ℕ) (hj : j ≤ d0) : ‖iteratedFDeriv ℝ j (fun z ↦ A z-1) v‖ ≤ q := + ((hfactors t x s hs hnear v (hv.trans (by linarith))).2.2 j hj).2.trans (min_le_right _ _) + have hExp (j : ℕ) (hj : j ≤ d0) : ‖iteratedFDeriv ℝ j (fun z ↦ Complex.exp (E z)-1) v‖ ≤ q := + hexp U hU E hEs v hvU hEa j hj + have hprod (j : ℕ) (hj : j ≤ d0) : + ‖iteratedFDeriv ℝ j (fun z ↦ A z*Complex.exp (E z)-1) v‖ ≤ (2^d0+2)*q := + near_one_product_jet_bound hU A (fun z ↦ Complex.exp (E z)) hAs hBs hvU d0 hqpos.le hq1 hAa hExp j hj + have hrel := local_mul_jet_bound hU P (fun z ↦ A z*Complex.exp (E z)-1) + hPs.contDiffOn ((hAs.mul hBs).sub contDiffOn_const) hvU k hB.le + (fun j hj ↦ hplane t s hs v j (hj.trans hk)) (fun j hj ↦ hprod j (hj.trans hk)) + have hsmall : ‖iteratedFDeriv ℝ k (fun z ↦ P z*(A z*Complex.exp (E z)-1)) v‖ ≤ e := by + apply hrel.trans + have hpow : (2:ℝ)^k ≤ 2^d0 := pow_le_pow_right₀ (by norm_num) hk + calc + _ ≤ 2^d0*B*((2^d0+2)*q) := by gcongr + _ = cost*q := by dsimp [cost]; ring + _ ≤ e := hqcost + have heq : (fun z ↦ normalizedRescaling (b.wave n t) S n s sigma x z-alpha*P z) =ᶠ[𝓝 v] + (fun z ↦ alpha • (P z*(A z*Complex.exp (E z)-1))) := by + filter_upwards [hU.mem_nhds hvU] with z hz + obtain ⟨hax,_,hbase,hshift⟩ := hgerms t x s hs hnear z (hnorm z hz) + rw [normalizedWave_factorization _ _ _ S (g (y t.1) (d.q t.1 t.2)) n s sigma x z + hax hbase.self_of_nhds hshift.self_of_nhds] + dsimp [alpha,P,A,E,L,rescaledAmplitudeRatio] + ring + rw [(heq.iteratedFDeriv (𝕜 := ℝ) k).self_of_nhds, + iteratedFDeriv_const_smul_apply' (((hPs.contDiffOn.mul ((hAs.mul hBs).sub contDiffOn_const)).contDiffAt + (hU.mem_nhds hvU)).of_le (by exact_mod_cast (show (k:ℕ∞) ≤ ⊤ from le_top))),norm_smul] + exact (mul_le_mul_of_nonneg_left hsmall (norm_nonneg alpha)).trans_eq (mul_comm _ _) + +end TripleSourceWaveData +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/PlaneWaveSecondMoment.lean b/lean/OAI/Geometry/NodalSets/Waves/PlaneWaveSecondMoment.lean new file mode 100644 index 0000000000000000000000000000000000000000..76bc277b3140ebf93ca689e35199c9fa91577e65 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/PlaneWaveSecondMoment.lean @@ -0,0 +1,70 @@ +import OAI.Geometry.NodalSets.Waves.LatticeFrequencyAnnulus +import OAI.Geometry.NodalSets.Waves.LatticeNormalizedWeights + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Set Filter +open scoped Topology +noncomputable section + +lemma coordinate_second_moment {ι : Type*} (F : Finset ι) (α : ι → ℂ) + (k : ι → Coord) (κ : ℝ) (hκ : 0 ≤ κ) + (hmass : (1/2:ℝ) ≤ ∑ i ∈ F, ‖α i‖^2) + (hk : ∀ i ∈ F, κ ≤ sourceEuclideanNorm (k i)) : + ∃ j : Fin 4, κ^2/8 ≤ ∑ i ∈ F, ‖α i‖^2*(k i j)^2 := by + classical + have hsq (i : ι) (hi : i ∈ F) : κ^2 ≤ ∑ j : Fin 4, (k i j)^2 := by + have hh := pow_le_pow_left₀ hκ (hk i hi) 2 + have he : (sourceEuclideanNorm (k i))^2 = ∑ j : Fin 4, (k i j)^2 := + Real.sq_sqrt (Finset.sum_nonneg (fun _ _ ↦ sq_nonneg _)) + rwa [he] at hh + have htotal : κ^2/2 ≤ ∑ j : Fin 4, ∑ i ∈ F, ‖α i‖^2*(k i j)^2 := by + calc + _ ≤ κ^2*(∑ i ∈ F, ‖α i‖^2) := by nlinarith [sq_nonneg κ] + _ = ∑ i ∈ F, ‖α i‖^2*κ^2 := by rw [Finset.mul_sum]; congr 1; funext i; ring + _ ≤ ∑ i ∈ F, ‖α i‖^2*(∑ j : Fin 4, (k i j)^2) := + Finset.sum_le_sum (fun i hi ↦ mul_le_mul_of_nonneg_left (hsq i hi) (sq_nonneg _)) + _ = _ := by simp only [Finset.mul_sum]; rw [Finset.sum_comm] + by_contra h + push Not at h + have hh := Finset.sum_lt_sum + (fun j (_ : j ∈ (Finset.univ : Finset (Fin 4))) ↦ (h j).le) + ⟨0,Finset.mem_univ _,h 0⟩ + norm_num only [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul] at hh + linarith + +theorem lattice_main_coordinate_moment + (g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ) {H : Set Coord} + (hH : IsCompact H) (hg : ContinuousOn g H) + (hp : ∀ y ∈ H, ∀ v, v ≠ 0 → 0 < g y v v) : + ∃ c > 0, ∀ (w S : Coord → ℝ) (D U Q : Set Coord) (m J K k0 : ℕ) + (a : LocalCompactWaveData g w S D m J K k0), H ⊆ D → ∀ (hUD : U ⊆ D), + U ⊆ H → IsOpen U → Bornology.IsBounded U → IsCompact Q → Q ⊆ U → + ∀ᶠ n : ℕ in atTop, ∃ hfin : Fintype (SourceGrid U n), letI := hfin + ∀ x ∈ Q, ∃ j : Fin 4, + c ≤ ∑ i ∈ Finset.univ.filter (fun i : SourceGrid U n × Fin 3 ↦ + sourceEuclideanNorm (x-scaledLatticePoint n i.1) ≤ (n:ℝ)^(-5/12:ℝ)), + ‖a.latticeAlpha hUD n x i‖^2 * + (sourceFrequency (g (scaledLatticePoint n i.1)) + (a.cover.triple.q (latticeFrame a.cover hUD n i.1) i.2) + (sourceSignScale g S x) j)^2 := by + classical + obtain ⟨κ,hκ,B,hB,hann⟩ := lattice_main_frequency_annulus g hH hg hp + refine ⟨κ^2/8,by positivity,?_⟩ + intro w S D U Q m J K k0 a hHD hUD hUH hU hUb hQ hQU + have hm := a.latticeAlpha_main_mass hUD hU hUb hQ hQU (1/2) (by norm_num) + filter_upwards [hann w S D U m J K k0 a hHD hUD hUH,hm] with n hn hmass + obtain ⟨hfin,hmass⟩ := hmass + let := hfin + refine ⟨hfin,?_⟩ + intro x hx + apply coordinate_second_moment _ _ _ κ hκ.le + · linarith [(hmass x hx).2] + · intro i hi + exact (hn x (hUH (hQU hx)) i (Finset.mem_filter.mp hi).2).1 + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/RescaledGaussianField.lean b/lean/OAI/Geometry/NodalSets/Waves/RescaledGaussianField.lean new file mode 100644 index 0000000000000000000000000000000000000000..f94ee5f8e9e0b3f35e137f9c0c122ca0a71fc981 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/RescaledGaussianField.lean @@ -0,0 +1,71 @@ +import OAI.Geometry.NodalSets.Elliptic.NormalizedRescaling +import OAI.Geometry.NodalSets.Waves.LatticeValueVariance + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Yau.Probability MeasureTheory ProbabilityTheory +noncomputable section +variable {ι : Type*} [Fintype ι] + +def rescaledGaussianField (V : ι → Coord → ℂ) (S0 T0 S : Coord → ℝ) + (N s σ : ℝ) (x : Coord) (coeff : ι × Fin 2 → ℝ) (v : Coord) : ℝ := + (oscillatorySeed S0 T0 N (x+(N*s)⁻¹ • v)+ + gaussianWaveField V coeff (x+(N*s)⁻¹ • v)) / + (σ*Real.exp (fderiv ℝ S x v/s)) + +lemma rescaledGaussianField_decomposition (V : ι → Coord → ℂ) (S0 T0 S : Coord → ℝ) + (N s σ : ℝ) (x : Coord) (coeff : ι × Fin 2 → ℝ) (v : Coord) : + rescaledGaussianField V S0 T0 S N s σ x coeff v = rescaledSeed S0 T0 S N s σ x v + + gaussianWaveField (fun i ↦ normalizedRescaling (V i) S N s σ x) coeff v := by + classical + simp only [rescaledGaussianField,rescaledSeed,add_div,gaussianWaveField, + normalizedRescaling_eq_div,← mul_div_assoc,Complex.re_sum,Complex.div_ofReal_re, + Finset.sum_div] + +lemma pairLinearSum_integrable (z : ι → ℂ) : Integrable (pairLinearSum z) gaussianPairs := by + classical + unfold pairLinearSum gaussianPairs + apply integrable_finsetSum + intro p _ + exact (integrable_eval (μ := fun _ : ι × Fin 2 ↦ gaussianReal 0 1) + (i := p) IsGaussian.integrable_id).const_mul _ + +lemma pairLinearSum_mean (z : ι → ℂ) : ∫ coeff, pairLinearSum z coeff ∂gaussianPairs = 0 := by + classical + unfold pairLinearSum gaussianPairs + rw [integral_finsetSum] + · apply Finset.sum_eq_zero + intro p _ + rw [integral_const_mul,integral_eval] + simp + · intro p _ + exact (integrable_eval (μ := fun _ : ι × Fin 2 ↦ gaussianReal 0 1) + (i := p) IsGaussian.integrable_id).const_mul _ + +lemma rescaledGaussianField_mean (V : ι → Coord → ℂ) (S0 T0 S : Coord → ℝ) + (N s σ : ℝ) (x v : Coord) : + ∫ coeff, rescaledGaussianField V S0 T0 S N s σ x coeff v ∂gaussianPairs = + rescaledSeed S0 T0 S N s σ x v := by + classical + let Z := fun i ↦ normalizedRescaling (V i) S N s σ x v + have he : (fun coeff ↦ gaussianWaveField + (fun i ↦ normalizedRescaling (V i) S N s σ x) coeff v) = pairLinearSum Z := by + funext coeff + rw [pairLinearSum_eq_complex] + simp only [gaussianWaveField,Complex.re_sum,Z] + let : IsProbabilityMeasure (gaussianPairs (ι := ι)) := by + unfold gaussianPairs + infer_instance + simp_rw [rescaledGaussianField_decomposition] + change ∫ coeff, rescaledSeed S0 T0 S N s σ x v+ + (fun coeff ↦ gaussianWaveField (fun i ↦ normalizedRescaling (V i) S N s σ x) coeff v) coeff + ∂gaussianPairs = _ + rw [he,integral_add (integrable_const _) (pairLinearSum_integrable Z), + pairLinearSum_mean,add_zero,integral_const] + simp + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/RescaledLatticeTail.lean b/lean/OAI/Geometry/NodalSets/Waves/RescaledLatticeTail.lean new file mode 100644 index 0000000000000000000000000000000000000000..753dc526b63ad0a2821f8821d4f33d744b62c228 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/RescaledLatticeTail.lean @@ -0,0 +1,73 @@ +import OAI.Geometry.NodalSets.Elliptic.NormalizedRescaling +import OAI.Geometry.NodalSets.Waves.ShiftedLatticeTail + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Set Filter +open scoped ContDiff Topology +noncomputable section +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} +variable {D U : Set Coord} {m J K k0 : ℕ} +namespace LocalCompactWaveData +variable (a : LocalCompactWaveData g w S D m J K k0) + +theorem rescaled_lattice_nonmain_negligible (hUD : U ⊆ D) (hU : IsOpen U) + (hUb : Bornology.IsBounded U) {Q : Set Coord} (hQ : IsCompact Q) (hQU : Q ⊆ U) + (hS : ContDiff ℝ ∞ S) (R : ℝ) (hR : 0 ≤ R) (ε : ℝ) (hε : 0 < ε) : + ∀ᶠ n : ℕ in atTop, ∃ hfin : Fintype (SourceGrid U n), letI := hfin + ∀ x ∈ Q, ∀ s : ℝ, 1 ≤ s → ∀ v : Coord, ‖v‖ ≤ R → ∀ k : Fin (k0+1), + ∑ i ∈ Finset.univ.filter (fun i : SourceGrid U n × Fin 3 ↦ + (n:ℝ)^(-5/12:ℝ) < sourceEuclideanNorm (x-scaledLatticePoint n i.1)), + ‖iteratedFDeriv ℝ k.val + (normalizedRescaling (latticeWave a.cover a.beams hUD n i.1 i.2) + S n s (a.latticeSigma hUD n x) x) v‖^2 ≤ ε := by + classical + obtain ⟨A,hA,hamp⟩ := compact_smooth_derivative_bound (rescaledSeedNormalizer S) k0 + (fun j _ ↦ (smooth_spatial_iteratedFDeriv _ (rescaledSeedNormalizer_smooth S hS) j).continuous) + (Q ×ˢ Icc (0:ℝ) 1) (hQ.prod isCompact_Icc) R + let C : ℝ := (2^k0*A)^2 + have hC : 0 < C := by dsimp [C]; positivity + have hkpos : (0:ℝ) < k0+1 := by positivity + obtain ⟨c,hc,B,hB,hsigma⟩ := a.lattice_sigma_comparison hUD hU hUb hQ hQU + have htail := a.lattice_shifted_nonmain_negligible hUD hU hUb hQ hQU hS R hR + (ε/(C*((k0:ℝ)+1))) (by positivity) + filter_upwards [htail,hsigma,a.estimates,eventually_gt_atTop (0:ℕ)] + with n hn hσ hest hnpos + obtain ⟨hfin,ht⟩ := hn + obtain ⟨hfin',hσ⟩ := hσ + have he : hfin' = hfin := Subsingleton.elim _ _ + subst hfin' + let := hfin + refine ⟨hfin,?_⟩ + intro x hx s hs v hv k + have hn1 : (1:ℝ) ≤ n := by exact_mod_cast hnpos + have hs0 : 0 < s := lt_of_lt_of_le zero_lt_one hs + have hσ0 : 0 < a.latticeSigma hUD n x := + lt_of_lt_of_le (mul_pos hc (Real.exp_pos _)) (hσ x hx).1 + have ha := hamp (x,s⁻¹) ⟨hx,by positivity,(inv_le_one₀ hs0).mpr hs⟩ v hv + let F := Finset.univ.filter (fun i : SourceGrid U n × Fin 3 ↦ + (n:ℝ)^(-5/12:ℝ) < sourceEuclideanNorm (x-scaledLatticePoint n i.1)) + have hb (i : SourceGrid U n × Fin 3) := normalizedRescaling_square_bound + (latticeWave a.cover a.beams hUD n i.1 i.2) + (hest (latticeFrame a.cover hUD n i.1,i.2)).1 + S hS n s _ hn1 hs hσ0 x v k0 A hA.le ha k.val (by omega) + apply (Finset.sum_le_sum (fun i (_ : i ∈ F) ↦ hb i)).trans + calc + _ = C*∑ j : Fin (k0+1), ((∑ i ∈ F, + ‖iteratedFDeriv ℝ j.val (latticeWave a.cover a.beams hUD n i.1 i.2) + (x+((n:ℝ)*s)⁻¹ • v)‖^2)/(a.latticeSigma hUD n x)^2) := by + dsimp only [C] + simp only [Finset.mul_sum,Finset.sum_div,mul_div_assoc] + rw [Finset.sum_comm] + _ ≤ C*∑ _j : Fin (k0+1), ε/(C*((k0:ℝ)+1)) := + mul_le_mul_of_nonneg_left (Finset.sum_le_sum (fun j _ ↦ ht x hx s hs v hv j)) hC.le + _ = ε := by + simp only [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul,Nat.cast_add,Nat.cast_one] + field_simp + +end LocalCompactWaveData +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/ScaledLatticeGaussianSum.lean b/lean/OAI/Geometry/NodalSets/Waves/ScaledLatticeGaussianSum.lean new file mode 100644 index 0000000000000000000000000000000000000000..935a8fa4579cd39aaca85794a8842f33870383cf --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/ScaledLatticeGaussianSum.lean @@ -0,0 +1,45 @@ +import OAI.Geometry.NodalSets.Elliptic.HalfScaleLemmas +import OAI.Geometry.NodalSets.Waves.LatticeCount +import OAI.Geometry.NodalSets.Waves.ShiftedGaussianSum + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Yau.Probability +noncomputable section + +lemma scaled_lattice_squared_distance {n : ℕ} (hn : 0 < n) (x : Coord) + (z : Fin 4 → ℤ) : + (n:ℝ)*(sourceEuclideanNorm (x-scaledLatticePoint n z))^2 = + ∑ i, (Real.sqrt n*x i-(z i:ℝ))^2 := by + have hs : 0 < Real.sqrt n := Real.sqrt_pos.mpr (by exact_mod_cast hn) + have hs2 := Real.sq_sqrt (show (0:ℝ) ≤ n by positivity) + rw [sourceEuclideanNorm,Real.sq_sqrt (by positivity),Finset.mul_sum] + apply Finset.sum_congr rfl + intro i _ + change (n:ℝ)*(x i-(n:ℝ)^(-1/2:ℝ)*(z i:ℝ))^2 = _ + rw [lattice_scale_eq_inv_sqrt] + field_simp + nlinarith [hs2] + +theorem source_lattice_gaussian_sum {a : ℝ} (ha : 0 < a) : + ∃ C > 0, ∀ (U : Set Coord) (n : ℕ), 0 < n → ∀ [Fintype (SourceGrid U n)], + ∀ x : Coord, ∑ z : SourceGrid U n, + Real.exp (-a*(n:ℝ)*(sourceEuclideanNorm (x-scaledLatticePoint n z))^2) ≤ C := by + classical + obtain ⟨C,hC,hb⟩ := finite_shifted_gaussian_sum_pi (d := 4) ha + refine ⟨C,hC,?_⟩ + intro U n hn hfin x + let s : Finset (Fin 4 → ℤ) := Finset.univ.image (fun z : SourceGrid U n ↦ z.val) + have h := hb (fun i ↦ Real.sqrt n*x i) s + rw [Finset.sum_image (by intro u _ v _ huv; exact Subtype.ext huv)] at h + convert h using 1 + apply Finset.sum_congr rfl + intro z _ + congr 1 + rw [mul_assoc,scaled_lattice_squared_distance hn] + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/SeededGaussianJet.lean b/lean/OAI/Geometry/NodalSets/Waves/SeededGaussianJet.lean new file mode 100644 index 0000000000000000000000000000000000000000..41ceb142727f7370fffa0a6f2381267a1b01e6e4 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/SeededGaussianJet.lean @@ -0,0 +1,48 @@ +import OAI.Geometry.NodalSets.Waves.GaussianWaveJet + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Yau.Probability MeasureTheory ProbabilityTheory +noncomputable section +variable {ι : Type*} [Fintype ι] + +lemma gaussianWaveField_differentiable (V : ι → Coord → ℂ) (a : ι × Fin 2 → ℝ) + (x : Coord) (hV : ∀ i, DifferentiableAt ℝ (V i) x) : + DifferentiableAt ℝ (gaussianWaveField V a) x := by + classical + change DifferentiableAt ℝ (Complex.reCLM ∘ (fun z ↦ ∑ i, gaussianCoefficient a i*V i z)) x + exact Complex.reCLM.differentiableAt.comp x (DifferentiableAt.fun_sum (fun i _ ↦ (hV i).const_mul _)) + +lemma seeded_gaussian_dual_variance (V : ι → Coord → ℂ) (seed : Coord → ℝ) + (x v : Coord) (hV : ∀ i, DifferentiableAt ℝ (V i) x) (hseed : DifferentiableAt ℝ seed x) + (N S b : ℝ) : + Var[(fun a : ι × Fin 2 → ℝ ↦ Real.exp (-N*S)*(b*(seed x+gaussianWaveField V a x)+ + N⁻¹*fderiv ℝ (fun z ↦ seed z+gaussianWaveField V a z) x v)); gaussianPairs] = + ∑ i, ‖dualWaveCoefficient N (V i) S x b v‖^2 := by + let z := fun i ↦ dualWaveCoefficient N (V i) S x b v + let mean := Real.exp (-N*S)*(b*seed x+N⁻¹*fderiv ℝ seed x v) + have he : (fun a : ι × Fin 2 → ℝ ↦ Real.exp (-N*S)*(b*(seed x+gaussianWaveField V a x)+ + N⁻¹*fderiv ℝ (fun z ↦ seed z+gaussianWaveField V a z) x v)) = + fun a ↦ mean+pairLinearSum z a := by + funext a + rw [fderiv_fun_add hseed (gaussianWaveField_differentiable V a x hV),add_apply] + have h := gaussianWaveField_dual V a x v hV N S b + change _ = mean+pairLinearSum z a + rw [← h] + dsimp [mean] + ring + rw [he] + let : IsProbabilityMeasure (gaussianPairs (ι := ι)) := by + change IsProbabilityMeasure (Measure.pi (fun _ : ι × Fin 2 ↦ gaussianReal 0 1)) + infer_instance + have hc : Continuous (pairLinearSum z) := by + unfold pairLinearSum + fun_prop + rw [variance_const_add hc.aestronglyMeasurable] + exact variance_pairLinearSum _ + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/SeededLatticeFieldBounds.lean b/lean/OAI/Geometry/NodalSets/Waves/SeededLatticeFieldBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..7ed7bc385da034c48483fc8e7dcf22e13d4a9f64 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/SeededLatticeFieldBounds.lean @@ -0,0 +1,71 @@ +import OAI.Geometry.NodalSets.Elliptic.SeedDerivativeBounds +import OAI.Geometry.NodalSets.Waves.LatticeFieldBounds + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Yau.Probability Set Filter +open scoped ContDiff Topology +noncomputable section +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} +variable {D U : Set Coord} {m J K k0 : ℕ} +namespace LocalCompactWaveData +variable (a : LocalCompactWaveData g w S D m J K k0) + +theorem seeded_lattice_field_derivative_bound (hUD : U ⊆ D) (hUb : Bornology.IsBounded U) + (S0 T0 : Coord → ℝ) (hS0 : ContDiff ℝ ∞ S0) (hT0 : ContDiff ℝ ∞ T0) + {Q : Set Coord} (hQ : IsCompact Q) : + ∃ C > 0, ∀ᶠ n : ℕ in atTop, ∃ hfin : Fintype (SourceGrid U n), + letI := hfin + ∀ coeff : ((SourceGrid U n × Fin 3) × Fin 2) → ℝ, + coeff ∈ coefficientEvent (n:ℝ) → + let u := fun z ↦ oscillatorySeed S0 T0 n z + gaussianWaveField + (fun i : SourceGrid U n × Fin 3 ↦ latticeWave a.cover a.beams hUD n i.1 i.2) coeff z + ContDiff ℝ ∞ u ∧ ∀ x ∈ Q, ∀ k : Fin (k0+1), + ‖iteratedFDeriv ℝ k.val u x‖ ≤ C*(n:ℝ)^(k.val+3)* + max (Real.exp ((n:ℝ)*S x)) (Real.exp ((n:ℝ)*S0 x)) := by + have hs (j : Fin (k0+1)) := oscillatorySeed_derivative_bound S0 T0 hS0 hT0 hQ j.val + choose b hb hseed using hs + let B : ℝ := ∑ j, b j + have hB : 0 < B := (hb ⟨0,by omega⟩).trans_le + (Finset.single_le_sum (fun j _ ↦ (hb j).le) (Finset.mem_univ _)) + obtain ⟨C,hC,hfield⟩ := a.lattice_field_derivative_bound hUD hUb + refine ⟨B+C,by positivity,?_⟩ + filter_upwards [hfield,eventually_gt_atTop (0:ℕ)] with n hn hnpos + obtain ⟨hfin,hbnd⟩ := hn + let := hfin + refine ⟨hfin,?_⟩ + intro coeff hc + obtain ⟨hV,hVb⟩ := hbnd coeff hc + have hseedSmooth := oscillatorySeed_contDiff S0 T0 hS0 hT0 (n:ℝ) + refine ⟨hseedSmooth.add hV,?_⟩ + intro x hx k + have hn1 : (1:ℝ) ≤ n := by exact_mod_cast hnpos + have hseed' : ‖iteratedFDeriv ℝ k.val (oscillatorySeed S0 T0 n) x‖ ≤ + B*(n:ℝ)^(k.val+3)*max (Real.exp ((n:ℝ)*S x)) (Real.exp ((n:ℝ)*S0 x)) := by + have h := hseed k n hn1 x hx + refine h.trans ?_ + have hbB : b k ≤ B := Finset.single_le_sum (fun j _ ↦ (hb j).le) (Finset.mem_univ _) + gcongr + · omega + · exact le_max_right _ _ + have hrand : ‖iteratedFDeriv ℝ k.val (gaussianWaveField + (fun i : SourceGrid U n × Fin 3 ↦ latticeWave a.cover a.beams hUD n i.1 i.2) coeff) x‖ ≤ + C*(n:ℝ)^(k.val+3)*max (Real.exp ((n:ℝ)*S x)) (Real.exp ((n:ℝ)*S0 x)) := by + refine (hVb x k).trans ?_ + gcongr + exact le_max_left _ _ + change ‖iteratedFDeriv ℝ k.val (oscillatorySeed S0 T0 n + gaussianWaveField + (fun i : SourceGrid U n × Fin 3 ↦ latticeWave a.cover a.beams hUD n i.1 i.2) coeff) x‖ ≤ _ + rw [iteratedFDeriv_add_apply (hseedSmooth.of_le + (by exact_mod_cast (show (k.val:ℕ∞) ≤ ⊤ from le_top))).contDiffAt + (hV.of_le (by exact_mod_cast (show (k.val:ℕ∞) ≤ ⊤ from le_top))).contDiffAt] + have h := (norm_add_le _ _).trans (add_le_add hseed' hrand) + convert h using 1 + first | rfl | ring + +end LocalCompactWaveData +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/ShiftedGaussianSum.lean b/lean/OAI/Geometry/NodalSets/Waves/ShiftedGaussianSum.lean new file mode 100644 index 0000000000000000000000000000000000000000..7bbcf94a5ed62e80677d54a8fbae40abe95a0482 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/ShiftedGaussianSum.lean @@ -0,0 +1,84 @@ +import Mathlib.Algebra.BigOperators.Ring.Finset +import Mathlib.Algebra.Order.Floor.Ring +import Mathlib.Analysis.SpecialFunctions.Exp +import Mathlib.Tactic.GCongr +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Positivity +import Mathlib.Topology.Algebra.InfiniteSum.NatInt + +namespace OAI + +namespace Yau.Probability +open scoped BigOperators +noncomputable section + +lemma summable_integer_exponential {a : ℝ} (ha : 0 < a) : + Summable (fun z : ℤ ↦ Real.exp (-a * |(z:ℝ)|)) := by + apply summable_int_iff_summable_nat_and_neg.mpr + constructor <;> simpa [mul_comm] using + (Real.summable_exp_nat_mul_iff.mpr (neg_neg_of_pos ha)) + +lemma shifted_square_lower (x : ℝ) (z : ℤ) : + |((z-⌊x⌋ : ℤ):ℝ)| ≤ (x-(z:ℝ))^2+2 := by + have h0 := Int.floor_le x + have h1 := Int.lt_floor_add_one x + have ht : |((z-⌊x⌋ : ℤ):ℝ)| ≤ |(z:ℝ)-x|+|x-(⌊x⌋:ℝ)| := by + simpa only [Int.cast_sub,sub_add_sub_cancel] using abs_add_le ((z:ℝ)-x) (x-(⌊x⌋:ℝ)) + rw [abs_of_nonneg (by linarith : 0 ≤ x-(⌊x⌋:ℝ))] at ht + nlinarith [sq_nonneg (|(z:ℝ)-x|-1),sq_abs ((z:ℝ)-x)] + +theorem finite_shifted_gaussian_sum {a : ℝ} (ha : 0 < a) : + ∃ C > 0, ∀ (x : ℝ) (s : Finset ℤ), + ∑ z ∈ s, Real.exp (-a*(x-(z:ℝ))^2) ≤ C := by + let f : ℤ → ℝ := fun z ↦ Real.exp (-a*|(z:ℝ)|) + have hf : Summable f := summable_integer_exponential ha + have hsum : 0 < ∑' z, f z := (lt_of_lt_of_le (Real.exp_pos _) (hf.le_tsum 0 (fun _ _ ↦ Real.exp_nonneg _))) + refine ⟨Real.exp (2*a)*(∑' z, f z),mul_pos (Real.exp_pos _) hsum,?_⟩ + intro x s + calc + _ ≤ ∑ z ∈ s, Real.exp (2*a)*f (z-⌊x⌋) := by + apply Finset.sum_le_sum + intro z _ + dsimp [f] + rw [← Real.exp_add] + apply Real.exp_le_exp.mpr + have h := mul_le_mul_of_nonneg_left (shifted_square_lower x z) ha.le + nlinarith + _ = Real.exp (2*a)*∑ z ∈ s.image (fun z ↦ z-⌊x⌋), f z := by + rw [Finset.mul_sum,Finset.sum_image] + intro u _ v _ huv + exact sub_left_injective huv + _ ≤ Real.exp (2*a)*(∑' z, f z) := by + gcongr + exact hf.sum_le_tsum _ (fun _ _ ↦ Real.exp_nonneg _) + +theorem finite_shifted_gaussian_sum_pi {d : ℕ} {a : ℝ} (ha : 0 < a) : + ∃ C > 0, ∀ (x : Fin d → ℝ) (s : Finset (Fin d → ℤ)), + ∑ z ∈ s, Real.exp (-a*∑ i, (x i-(z i:ℝ))^2) ≤ C := by + classical + obtain ⟨C,hC,hb⟩ := finite_shifted_gaussian_sum ha + refine ⟨C^d,pow_pos hC d,?_⟩ + intro x s + let t : Fin d → Finset ℤ := fun i ↦ s.image (fun z ↦ z i) + have hsub : s ⊆ Fintype.piFinset t := by + intro z hz + exact Fintype.mem_piFinset.mpr (fun i ↦ Finset.mem_image.mpr ⟨z,hz,rfl⟩) + calc + _ = ∑ z ∈ s, ∏ i, Real.exp (-a*(x i-(z i:ℝ))^2) := by + apply Finset.sum_congr rfl + intro z _ + rw [Finset.mul_sum,Real.exp_sum] + _ ≤ ∑ z ∈ Fintype.piFinset t, ∏ i, Real.exp (-a*(x i-(z i:ℝ))^2) := + Finset.sum_le_sum_of_subset_of_nonneg hsub (fun _ _ _ ↦ by positivity) + _ = ∏ i, ∑ z ∈ t i, Real.exp (-a*(x i-(z:ℝ))^2) := + (Finset.prod_univ_sum t (fun i z ↦ Real.exp (-a*(x i-(z:ℝ))^2))).symm + _ ≤ ∏ _i : Fin d, C := by + apply Finset.prod_le_prod₀ (fun _ _ ↦ by positivity) + intro i _ + exact hb (x i) (t i) + _ = C^d := by simp + +end +end Yau.Probability + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/ShiftedLatticeTail.lean b/lean/OAI/Geometry/NodalSets/Waves/ShiftedLatticeTail.lean new file mode 100644 index 0000000000000000000000000000000000000000..d24f57603a2c4ab877f930132ed3db663e622669 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/ShiftedLatticeTail.lean @@ -0,0 +1,109 @@ +import OAI.Geometry.NodalSets.Elliptic.ShiftedCenterDistance +import OAI.Geometry.NodalSets.Waves.LatticeDerivativeTail +import OAI.Geometry.NodalSets.Waves.LatticeNonmainDecay +import OAI.Geometry.NodalSets.Waves.LatticeVarianceComparison + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Yau.Probability Set Filter +open scoped ContDiff Topology +noncomputable section +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} +variable {D U : Set Coord} {m J K k0 : ℕ} +namespace LocalCompactWaveData +variable (a : LocalCompactWaveData g w S D m J K k0) + +theorem lattice_shifted_nonmain_bound (hUD : U ⊆ D) (hS : ContDiff ℝ ∞ S) + {Q : Set Coord} (hQ : IsCompact Q) (R : ℝ) (hR : 0 ≤ R) : + ∃ C > 0, ∀ᶠ n : ℕ in atTop, ∀ [Fintype (SourceGrid U n)], + ∀ x ∈ Q, ∀ s : ℝ, 1 ≤ s → ∀ v : Coord, ‖v‖ ≤ R → ∀ k : Fin (k0+1), + ∑ i ∈ Finset.univ.filter (fun i : SourceGrid U n × Fin 3 ↦ + (n:ℝ)^(-5/12:ℝ) < sourceEuclideanNorm (x-scaledLatticePoint n i.1)), + ‖iteratedFDeriv ℝ k.val (latticeWave a.cover a.beams hUD n i.1 i.2) + (x+((n:ℝ)*s)⁻¹ • v)‖^2 ≤ + C*(n:ℝ)^(2*k.val)*Real.exp (2*(n:ℝ)*S x)* + Real.exp (-(a.beams.c/16)*(n:ℝ)^(1/6:ℝ)) := by + classical + obtain ⟨B,hB,htail⟩ := a.lattice_derivative_tail_bound hUD + obtain ⟨L,hL,hshift⟩ := compact_rescaled_envelope_bound S hS hQ R hR + refine ⟨B*Real.exp (2*L),by positivity,?_⟩ + filter_upwards [htail,eventually_shifted_center_distance R,eventually_gt_atTop (0:ℕ)] + with n hn hdist hnpos + intro hfin x hx s hs v hv k + have hn0 : (0:ℝ) < n := by exact_mod_cast hnpos + have hn1 : (1:ℝ) ≤ n := by exact_mod_cast hnpos + let z := x+((n:ℝ)*s)⁻¹ • v + let r : ℝ := (n:ℝ)^(-5/12:ℝ) + have hsub : Finset.univ.filter (fun i : SourceGrid U n × Fin 3 ↦ + r < sourceEuclideanNorm (x-scaledLatticePoint n i.1)) ⊆ + Finset.univ.filter (fun i : SourceGrid U n × Fin 3 ↦ + r/4 < sourceEuclideanNorm (z-scaledLatticePoint n i.1)) := by + intro i hi + exact Finset.mem_filter.mpr ⟨Finset.mem_univ _,hdist s hs x _ v hv (Finset.mem_filter.mp hi).2⟩ + have hsum := Finset.sum_le_sum_of_subset_of_nonneg hsub (fun i _ _ ↦ + sq_nonneg ‖iteratedFDeriv ℝ k.val (latticeWave a.cover a.beams hUD n i.1 i.2) z‖) + have he : -a.beams.c*(n:ℝ)*(r/4)^2 = -(a.beams.c/16)*(n:ℝ)^(1/6:ℝ) := by + calc + _ = -(a.beams.c/16)*((n:ℝ)*r^2) := by ring + _ = _ := by rw [main_center_scale _ hn0] + have hb := hn z k (r/4) (by dsimp [r]; positivity) + rw [he] at hb + have hexp : Real.exp (2*(n:ℝ)*S z) ≤ Real.exp (2*(n:ℝ)*S x)*Real.exp (2*L) := by + rw [← Real.exp_add] + apply Real.exp_le_exp.mpr + have hh := (le_abs_self _).trans (hshift n s hn1 hs x hx v hv) + dsimp [z] + nlinarith + apply (hsum.trans hb).trans + calc + _ ≤ B*(n:ℝ)^(2*k.val)*(Real.exp (2*(n:ℝ)*S x)*Real.exp (2*L))* + Real.exp (-(a.beams.c/16)*(n:ℝ)^(1/6:ℝ)) := by gcongr + _ = _ := by ring + +theorem lattice_shifted_nonmain_negligible (hUD : U ⊆ D) (hU : IsOpen U) + (hUb : Bornology.IsBounded U) {Q : Set Coord} (hQ : IsCompact Q) (hQU : Q ⊆ U) + (hS : ContDiff ℝ ∞ S) (R : ℝ) (hR : 0 ≤ R) (ε : ℝ) (hε : 0 < ε) : + ∀ᶠ n : ℕ in atTop, ∃ hfin : Fintype (SourceGrid U n), letI := hfin + ∀ x ∈ Q, ∀ s : ℝ, 1 ≤ s → ∀ v : Coord, ‖v‖ ≤ R → ∀ k : Fin (k0+1), + (∑ i ∈ Finset.univ.filter (fun i : SourceGrid U n × Fin 3 ↦ + (n:ℝ)^(-5/12:ℝ) < sourceEuclideanNorm (x-scaledLatticePoint n i.1)), + ‖iteratedFDeriv ℝ k.val (latticeWave a.cover a.beams hUD n i.1 i.2) + (x+((n:ℝ)*s)⁻¹ • v)‖^2) / (a.latticeSigma hUD n x)^2 ≤ ε := by + classical + obtain ⟨c,hc,hlo⟩ := a.lattice_variance_lower_bound hUD hU hQ hQU + obtain ⟨C,hC,htail⟩ := a.lattice_shifted_nonmain_bound hUD hS hQ R hR + have hlim := (tendsto_polynomial_main_center_tail (2*k0) (a.beams.c/16) + (by have := a.beams.c_pos; positivity)).const_mul (C/c) + simp only [mul_zero] at hlim + filter_upwards [hlo,htail,hlim.eventually (gt_mem_nhds hε),eventually_gt_atTop (0:ℕ)] + with n hl ht hsmall hnpos + have := finite_source_grid hUb hnpos + let hfin := Fintype.ofFinite (SourceGrid U n) + let := hfin + refine ⟨hfin,?_⟩ + intro x hx s hs v hv k + have hv0 : 0 < a.latticeVariance hUD n x := + lt_of_lt_of_le (mul_pos hc (Real.exp_pos _)) (hl x hx) + have hn1 : (1:ℝ) ≤ n := by exact_mod_cast hnpos + have hp : (n:ℝ)^(2*k.val) ≤ (n:ℝ)^(2*k0) := + pow_le_pow_right₀ hn1 (by have := k.isLt; omega) + rw [a.latticeSigma_sq] + apply le_trans _ hsmall.le + apply (div_le_iff₀ hv0).mpr + have hh := mul_le_mul_of_nonneg_left (hl x hx) + (by positivity : 0 ≤ (C/c)*((n:ℝ)^(2*k0)*Real.exp (-(a.beams.c/16)*(n:ℝ)^(1/6:ℝ)))) + calc + _ ≤ C*(n:ℝ)^(2*k.val)*Real.exp (2*(n:ℝ)*S x)* + Real.exp (-(a.beams.c/16)*(n:ℝ)^(1/6:ℝ)) := ht x hx s hs v hv k + _ ≤ C*(n:ℝ)^(2*k0)*Real.exp (2*(n:ℝ)*S x)* + Real.exp (-(a.beams.c/16)*(n:ℝ)^(1/6:ℝ)) := by gcongr + _ = ((C/c)*((n:ℝ)^(2*k0)*Real.exp (-(a.beams.c/16)*(n:ℝ)^(1/6:ℝ))))* + (c*Real.exp (2*(n:ℝ)*S x)) := by field_simp + _ ≤ _ := hh + +end LocalCompactWaveData +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/SignSubballProbability.lean b/lean/OAI/Geometry/NodalSets/Waves/SignSubballProbability.lean new file mode 100644 index 0000000000000000000000000000000000000000..dcccd8fb5f5e5fb978d8e5dc4b5fdb91de8c3164 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/SignSubballProbability.lean @@ -0,0 +1,59 @@ +import OAI.Geometry.NodalSets.Elliptic.SignEventMarkov +import OAI.Geometry.NodalSets.Elliptic.StrictSignSubballs + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets MeasureTheory Set +open scoped ContDiff ENNReal +noncomputable section + +lemma positive_real_probability_floor {p : ℝ≥0∞} (hp : 0 < p) : + ∃ q : ℝ, 0 < q ∧ q ≤ 1 ∧ ENNReal.ofReal q ≤ p := by + let b := min p 1 + have hb : 0 < b := lt_min hp (by norm_num) + have ht : b ≠ ⊤ := ne_of_lt ((min_le_right p 1).trans_lt (by norm_num)) + refine ⟨b.toReal,ENNReal.toReal_pos hb.ne' ht,?_,?_⟩ + · have hh := ENNReal.toReal_mono (by norm_num : (1:ℝ≥0∞) ≠ ⊤) (min_le_right p 1) + simpa using hh + · rw [ENNReal.ofReal_toReal ht] + exact min_le_left p 1 + +lemma sign_subball_constants {tau p C : ℝ} (ht : 0 < tau) (ht1 : tau < 1) + (hp : 0 < p) (hC : 0 ≤ C) : + ∃ L > 0, ∃ r > 0, r < tau/4 ∧ r < (1-tau)/2 ∧ 4*L*r < 1 ∧ 2*C ≤ p*L := by + let L := 2*C/p+1 + have hL : 0 < L := by dsimp [L]; positivity + obtain ⟨r,hr,hrt,hr1,hrL⟩ := choose_sign_subball_radius ht ht1 hL.le + refine ⟨L,hL,r,hr,hrt,hr1,hrL,?_⟩ + dsimp [L] + have he : p*(2*C/p+1) = 2*C+p := by field_simp + rw [he] + linarith + +lemma sign_subballs_probability {Ω : Type*} [MeasurableSpace Ω] + (μ : Measure Ω) [IsFiniteMeasure μ] (F : Ω → Coord → ℝ) + (hF : ∀ a, ContDiff ℝ ∞ (F a)) (G : Ω → ℝ) + (hG : Integrable G μ) (hG0 : ∀ a, 0 ≤ G a) + {tau r p C L : ℝ} (ht : 0 ≤ tau) (hr : 0 ≤ r) (hL : 0 < L) + (htr : tau+r ≤ 1) (hsmall : 4*L*r < 1) (hmean : (∫ a, G a ∂μ) ≤ C) + (hCL : 2*C ≤ p*L) + (hgrad : ∀ a, G a ≤ L → ∀ x : Coord, sourceEuclideanNorm x ≤ 1 → + sourceEuclideanNorm (fun i ↦ fderiv ℝ (F a) x (Pi.single i 1)) ≤ L) + (j : Fin 4) (hsign : p ≤ μ.real {a | 1 ≤ F a 0 ∧ F a (tau • Pi.single j 1) ≤ -1}) : + p/2 ≤ μ.real {a | + (∀ v : Coord, sourceEuclideanNorm v ≤ r → sourceEuclideanNorm v ≤ 1 ∧ 0 < F a v) ∧ + (∀ v : Coord, sourceEuclideanNorm (v-tau • Pi.single j 1) ≤ r → + sourceEuclideanNorm v ≤ 1 ∧ F a v < 0)} := by + have hh := event_inter_gradient_half hG hG0 hL hsign (by linarith : 2*(∫ a, G a ∂μ) ≤ p*L) + apply hh.trans + apply measureReal_mono + · intro a ha + exact strict_sign_subballs (F a) (hF a) ht hr hL.le htr hsmall j ha.1.1 ha.1.2 + (hgrad a ha.2) + · exact measure_ne_top _ _ + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/SmoothWaveOperator.lean b/lean/OAI/Geometry/NodalSets/Waves/SmoothWaveOperator.lean new file mode 100644 index 0000000000000000000000000000000000000000..b41da71e2b4c096b6f76cee17d96ea544d93c78b --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/SmoothWaveOperator.lean @@ -0,0 +1,155 @@ +import Mathlib.Analysis.SpecialFunctions.ExpDeriv +import OAI.Geometry.NodalSets.Elliptic.SmoothBeamJet + +namespace OAI + +namespace Yau.Jets +open scoped ContDiff +noncomputable section + +lemma coordPartial_add {f u : Coord → ℂ} (hf : ContDiff ℝ ∞ f) (hu : ContDiff ℝ ∞ u) + (i : Fin 4) : coordPartial i (fun x ↦ f x + u x) = + fun x ↦ coordPartial i f x + coordPartial i u x := by + funext x + unfold coordPartial + rw [fderiv_fun_add (hf.differentiable (by simp) x) (hu.differentiable (by simp) x)] + rfl + +lemma coordPartial_mul {f u : Coord → ℂ} (hf : ContDiff ℝ ∞ f) (hu : ContDiff ℝ ∞ u) + (i : Fin 4) : coordPartial i (fun x ↦ f x * u x) = + fun x ↦ coordPartial i f x * u x + f x * coordPartial i u x := by + funext x + unfold coordPartial + rw [fderiv_fun_mul (hf.differentiable (by simp) x) (hu.differentiable (by simp) x)] + simp [smul_eq_mul] + ring + +lemma coordPartial_const_mul {f : Coord → ℂ} (hf : ContDiff ℝ ∞ f) (a : ℂ) (i : Fin 4) : + coordPartial i (fun x ↦ a * f x) = fun x ↦ a * coordPartial i f x := by + rw [coordPartial_mul contDiff_const hf] + ext x + simp [coordPartial] + +lemma coordPartial_exp {f : Coord → ℂ} (hf : ContDiff ℝ ∞ f) (i : Fin 4) : + coordPartial i (fun x ↦ Complex.exp (f x)) = + fun x ↦ coordPartial i f x * Complex.exp (f x) := by + funext x + unfold coordPartial + rw [((hf.differentiable (by simp) x).hasFDerivAt.cexp).fderiv] + simp [smul_eq_mul, mul_comm] + +lemma coordPartial_twice_mul {f u : Coord → ℂ} (hf : ContDiff ℝ ∞ f) (hu : ContDiff ℝ ∞ u) + (i j : Fin 4) : coordPartial i (coordPartial j (fun x ↦ f x * u x)) = fun x ↦ + coordPartial i (coordPartial j f) x * u x + + coordPartial j f x * coordPartial i u x + + coordPartial i f x * coordPartial j u x + + f x * coordPartial i (coordPartial j u) x := by + rw [coordPartial_mul hf hu j, + coordPartial_add ((coordPartial_contDiff hf j).mul hu) (hf.mul (coordPartial_contDiff hu j)), + coordPartial_mul (coordPartial_contDiff hf j) hu i, + coordPartial_mul hf (coordPartial_contDiff hu j) i] + ext x + ring + +theorem smoothSecondOrder_mul (g : Fin 4 → Fin 4 → Coord → ℂ) (b : Fin 4 → Coord → ℂ) + {f u : Coord → ℂ} (hf : ContDiff ℝ ∞ f) (hu : ContDiff ℝ ∞ u) (x : Coord) : + smoothSecondOrder g b (fun z ↦ f z * u z) x = + f x * smoothSecondOrder g b u x + u x * smoothSecondOrder g b f x + + ∑ i, ∑ j, g i j x * + (coordPartial i f x * coordPartial j u x + coordPartial j f x * coordPartial i u x) := by + simp only [smoothSecondOrder] + simp_rw [coordPartial_twice_mul hf hu] + simp only [coordPartial_mul hf hu, + mul_add, Finset.sum_add_distrib, Finset.mul_sum] + simp only [mul_left_comm, mul_comm] + ring + +def waveExp (phi : Coord → ℂ) (N : ℝ) : Coord → ℂ := + fun x ↦ Complex.exp ((N : ℂ) * phi x) + +lemma waveExp_contDiff {phi : Coord → ℂ} (hp : ContDiff ℝ ∞ phi) (N : ℝ) : + ContDiff ℝ ∞ (waveExp phi N) := (contDiff_const.mul hp).cexp + +lemma coordPartial_waveExp {phi : Coord → ℂ} (hp : ContDiff ℝ ∞ phi) (N : ℝ) (i : Fin 4) : + coordPartial i (waveExp phi N) = + fun x ↦ (N : ℂ) * coordPartial i phi x * waveExp phi N x := by + unfold waveExp + rw [coordPartial_exp (contDiff_const.mul hp), coordPartial_const_mul hp] + +lemma coordPartial_twice_waveExp {phi : Coord → ℂ} (hp : ContDiff ℝ ∞ phi) + (N : ℝ) (i j : Fin 4) : coordPartial i (coordPartial j (waveExp phi N)) = + fun x ↦ ((N : ℂ) * coordPartial i (coordPartial j phi) x + + (N : ℂ) ^ 2 * coordPartial i phi x * coordPartial j phi x) * waveExp phi N x := by + rw [coordPartial_waveExp hp N j, + coordPartial_mul (contDiff_const.mul (coordPartial_contDiff hp j)) (waveExp_contDiff hp N) i, + coordPartial_const_mul (coordPartial_contDiff hp j), coordPartial_waveExp hp N i] + ext x + ring + +theorem smoothSecondOrder_waveExp (g : Fin 4 → Fin 4 → Coord → ℂ) + (b : Fin 4 → Coord → ℂ) {phi : Coord → ℂ} (hp : ContDiff ℝ ∞ phi) + (N : ℝ) (x : Coord) : + smoothSecondOrder g b (waveExp phi N) x = + ((N : ℂ) * smoothSecondOrder g b phi x + + (N : ℂ) ^ 2 * (smoothEikonal g phi x - 4)) * waveExp phi N x := by + simp only [smoothSecondOrder] + simp_rw [coordPartial_twice_waveExp hp N] + simp only [coordPartial_waveExp hp N, smoothEikonal, add_sub_cancel_right, + mul_add, add_mul, Finset.mul_sum, Finset.sum_mul, Finset.sum_add_distrib] + simp only [mul_assoc, mul_left_comm] + ring + +lemma symmetric_cross_sum (G : Fin 4 → Fin 4 → ℂ) (hG : ∀ i j, G i j = G j i) + (a q : Fin 4 → ℂ) : + (∑ i, ∑ j, G i j * (a i * q j + a j * q i)) = + ∑ i, (2 * ∑ j, G i j * q j) * a i := by + have hs : (∑ i, ∑ j, G i j * a j * q i) = ∑ i, ∑ j, G i j * a i * q j := by + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + rw [hG j i] + calc + _ = (∑ i, ∑ j, G i j * a i * q j) + (∑ i, ∑ j, G i j * a j * q i) := by + simp only [mul_add, ← mul_assoc, Finset.sum_add_distrib] + _ = 2 * (∑ i, ∑ j, G i j * a i * q j) := by rw [hs]; ring + _ = _ := by + simp only [Finset.mul_sum, Finset.sum_mul] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + ring + +theorem smooth_wave_residual_identity (g : Fin 4 → Fin 4 → Coord → ℂ) + (b : Fin 4 → Coord → ℂ) (hg : ∀ i j x, g i j x = g j i x) + {phi a : Coord → ℂ} (hp : ContDiff ℝ ∞ phi) (ha : ContDiff ℝ ∞ a) + (N : ℝ) (x : Coord) : + smoothSecondOrder g b (fun z ↦ a z * waveExp phi N z) x + + ((4 : ℂ) * (N : ℂ) ^ 2 + 6 * (N : ℂ)) * (a x * waveExp phi N x) = + waveExp phi N x * + ((N : ℂ) ^ 2 * smoothEikonal g phi x * a x + + (N : ℂ) * smoothTransport (smoothBeamVector g phi) (smoothBeamScalar g b phi) + (fun _ ↦ 0) a x + smoothSecondOrder g b a x) := by + rw [smoothSecondOrder_mul g b ha (waveExp_contDiff hp N), smoothSecondOrder_waveExp g b hp, + symmetric_cross_sum (fun i j ↦ g i j x) (fun i j ↦ hg i j x)] + simp only [coordPartial_waveExp hp N, smoothTransport, smoothBeamVector, smoothBeamScalar, + sub_zero] + have he : (∑ i, (2 * ∑ j, g i j x * ((N : ℂ) * coordPartial j phi x * waveExp phi N x)) * + coordPartial i a x) = + (N : ℂ) * waveExp phi N x * + (∑ i, (2 * ∑ j, g i j x * coordPartial j phi x) * coordPartial i a x) := by + simp only [Finset.mul_sum, Finset.sum_mul] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + ring + rw [he] + ring + +end +end Yau.Jets + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/TripleSourceWaves.lean b/lean/OAI/Geometry/NodalSets/Waves/TripleSourceWaves.lean new file mode 100644 index 0000000000000000000000000000000000000000..ef8f31c83335f0cd6f1be0072292a247ca730e23 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/TripleSourceWaves.lean @@ -0,0 +1,99 @@ +import OAI.Geometry.NodalSets.Waves.TripleWaveParameters +import OAI.Geometry.NodalSets.Waves.WitnessedEuclideanWaves + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Filter Set +open scoped ContDiff Topology +noncomputable section +attribute [local instance] clmTopology clmAdd clmModule +variable {T : Type*} [TopologicalSpace T] [CompactSpace T] + +abbrev SourceFrameTriple (g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ) (S : Coord → ℝ) + (y : T → Coord) := AdmissibleFrameTriple (g ∘ y) (sourceHessian g S ∘ y) (metricGradient g S ∘ y) + +def sourceTripleAlpha (g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ) (S : Coord → ℝ) + (y : T → Coord) (z : T × Fin 3) : ℝ := + Real.sqrt (g (y z.1) (metricGradient g S (y z.1)) (metricGradient g S (y z.1))) + +def sourceTripleBeta (g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ) (S : Coord → ℝ) + (y : T → Coord) (z : T × Fin 3) : ℝ := + Real.sqrt (g (y z.1) (metricGradient g S (y z.1)) (metricGradient g S (y z.1))+4) + +structure TripleSourceWaveData + (g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ) (w S : Coord → ℝ) + (y : T → Coord) (d : SourceFrameTriple g S y) (m J K k0 : ℕ) where + beta : ContDiffBump (0:Coord) + phi : T × Fin 3 → CPoly + A : ℕ → T × Fin 3 → CPoly + F : T × Fin 3 → OpenPartialHomeomorph Coord Coord + c : ℝ + Cw : ℝ + Cr : ℝ + R : ℝ + c_pos : 0 < c + Cw_pos : 0 < Cw + Cr_pos : 0 < Cr + R_pos : 0 < R + sourceRadius : ℝ + targetRadius : ℝ + sourceRadius_pos : 0 < sourceRadius + targetRadius_pos : 0 < targetRadius + jets : MetricWaveJetFamily (extendedPrincipal g (fun z ↦ y z.1) d.frame beta) + (extendedDrift g w (fun z ↦ y z.1) d.frame beta) + (fun z ↦ S (y z.1)) (sourceTripleAlpha g S y) (sourceTripleBeta g S y) + (fun z ↦ envelopeHessian (S ∘ actualMetricChart g (y z.1) (d.frame z))) m J phi A + chart_eq : ∀ z, (F z : Coord → Coord) = actualMetricChart g (y z.1) (d.frame z) + chart_domain : ∀ z, (F z).source = Metric.ball 0 sourceRadius ∧ + Metric.closedBall (y z.1) targetRadius ⊆ (F z).target ∧ + ContDiffOn ℝ ∞ (F z).symm (F z).target + estimates : ∀ᶠ n : ℕ in atTop, ∀ t, + let V := chartPushforward (F t) (coordinateWave phi A J (n:ℝ) t) + ContDiff ℝ ∞ V ∧ HasCompactSupport V ∧ + tsupport V ⊆ {z | sourceEuclideanNorm (z-y t.1) ≤ R*(n:ℝ)^(-1/3:ℝ)} ∧ + ∀ z : Coord, + (∀ k : Fin (k0+1), ‖iteratedFDeriv ℝ k.val V z‖ ≤ + Cw*(n:ℝ)^k.val*Real.exp ((n:ℝ)*S z-c*(n:ℝ)*(sourceEuclideanNorm (z-y t.1))^2)) ∧ + DerivativeBound k0 (fun z ↦ sourceWeightedOperator g w V z + + ((4:ℂ)*(n:ℂ)^2+6*(n:ℂ))*V z) z + (Cr*(n:ℝ)^(-(K:ℝ))*Real.exp ((n:ℝ)*S z)) + +theorem construct_triple_source_waves + (g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ) (hg : ContDiff ℝ ∞ g) + (hs : ∀ x u v, g x u v = g x v u) (hpos : ∀ x v, v ≠ 0 → 0 < g x v v) + (w : Coord → ℝ) (hw : ContDiff ℝ ∞ w) (S : Coord → ℝ) (hS : ContDiff ℝ ∞ S) + (y : T → Coord) (hy : Continuous y) (hp0 : ∀ t, metricGradient g S (y t) ≠ 0) + (d : SourceFrameTriple g S y) {U : Set Coord} (hU : IsOpen U) + (hyU : ∀ t, y t ∈ U) (hwpos : ∀ x ∈ U, 0 < w x) + (m J K k0 : ℕ) (hm : 3*K+4*k0+6 < m+1) (hJ : K+k0+1 ≤ J) : + Nonempty (TripleSourceWaveData g w S y d m J K k0) := by + have hp : Continuous (fun z : T × Fin 3 ↦ metricGradient g S (y z.1)) := (metricGradient_continuous g hg hpos S hS).comp (hy.comp continuous_fst) + have hlen : Continuous (fun z : T × Fin 3 ↦ + g (y z.1) (metricGradient g S (y z.1)) (metricGradient g S (y z.1))) := + (((hg.continuous.comp (hy.comp continuous_fst)).clm_apply hp).clm_apply hp) + have hapos (z : T × Fin 3) : 0 < sourceTripleAlpha g S y z := + Real.sqrt_pos.mpr (hpos (y z.1) _ (hp0 z.1)) + have hbpos (z : T × Fin 3) : 0 < sourceTripleBeta g S y z := by + apply Real.sqrt_pos.mpr + have h := hpos (y z.1) _ (hp0 z.1) + linarith + have hab (z : T × Fin 3) : (sourceTripleBeta g S y z)^2 = (sourceTripleAlpha g S y z)^2+4 := by + dsimp [sourceTripleAlpha,sourceTripleBeta] + rw [Real.sq_sqrt (hpos (y z.1) _ (hp0 z.1)).le,Real.sq_sqrt] + have h := hpos (y z.1) _ (hp0 z.1) + linarith + obtain ⟨beta,phi,A,F,c,Cw,Cr,R,r,delta,hc,hCw,hCr,hR,hr,hdelta,hjets,hF,hdom,hest⟩ := + witnessed_source_wave_estimates_euclidean g hg hs hpos w hw S hS + (fun z : T × Fin 3 ↦ y z.1) (hy.comp continuous_fst) d.frame d.continuous_frame + d.frame_orthonormal hU (fun z ↦ hyU z.1) hwpos (fun z ↦ d.q z.1 z.2) + (sourceTripleAlpha g S y) (sourceTripleBeta g S y) hlen.sqrt (hlen.add continuous_const).sqrt + (fun z ↦ ne_of_gt (hapos z)) (fun z ↦ ne_of_gt (hbpos z)) hab + (d.frame_first (fun t ↦ hpos (y t)) hp0) (d.frame_second (fun t ↦ hpos (y t)) hp0) + (fun z ↦ d.strict z.1 z.2) m J K k0 hm hJ + exact ⟨⟨beta,phi,A,F,c,Cw,Cr,R,hc,hCw,hCr,hR,r,delta,hr,hdelta,hjets,hF,hdom,hest⟩⟩ + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/TripleWaveParameters.lean b/lean/OAI/Geometry/NodalSets/Waves/TripleWaveParameters.lean new file mode 100644 index 0000000000000000000000000000000000000000..3f04eddcfbef2197a5a41190d0ae5183c937fa06 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/TripleWaveParameters.lean @@ -0,0 +1,46 @@ +import OAI.Geometry.NodalSets.Charts.LocalFrameTriple + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets +noncomputable section +attribute [local instance] clmTopology clmAdd clmModule +variable {T : Type*} [TopologicalSpace T] +variable {g H : T → Coord →L[ℝ] Coord →L[ℝ] ℝ} {p : T → Coord} +namespace AdmissibleFrameTriple +variable (d : AdmissibleFrameTriple g H p) +def frame (z : T × Fin 3) : Coord ≃L[ℝ] Coord := + frameEquiv (g z.1) (d.e z.1 z.2) (d.orthonormal z.1 z.2) +def alpha (t : T) : ℝ := Real.sqrt (g t (p t) (p t)) +def beta (t : T) : ℝ := Real.sqrt (g t (p t) (p t)+4) + +lemma continuous_frame : Continuous (fun z ↦ (d.frame z).toContinuousLinearMap) := by + apply continuous_prod_of_discrete_right.mpr + intro j + exact frameEquiv_continuous g (fun t ↦ d.e t j) (d.continuous_e j) (fun t ↦ d.orthonormal t j) + +lemma frame_orthonormal (z : T × Fin 3) (i j : Fin 4) : + g z.1 (d.frame z (Pi.single i 1)) (d.frame z (Pi.single j 1)) = if i=j then 1 else 0 := by + change g z.1 (frameMap (d.e z.1 z.2) (Pi.single i 1)) + (frameMap (d.e z.1 z.2) (Pi.single j 1)) = _ + simp only [frameMap_axis,d.orthonormal] + +lemma frame_first (hpos : ∀ t v, v ≠ 0 → 0 < g t v v) (hp0 : ∀ t, p t ≠ 0) + (z : T × Fin 3) : alpha (g := g) (p := p) z.1 • d.frame z (Pi.single 0 1) = p z.1 := by + change alpha z.1 • frameMap (d.e z.1 z.2) (Pi.single 0 1) = _ + rw [frameMap_axis,d.first] + simp [alpha,metricNormalize,smul_smul,ne_of_gt (Real.sqrt_pos.mpr (hpos z.1 _ (hp0 z.1)))] + +lemma frame_second (hpos : ∀ t v, v ≠ 0 → 0 < g t v v) (hp0 : ∀ t, p t ≠ 0) + (z : T × Fin 3) : beta (g := g) (p := p) z.1 • d.frame z (Pi.single 1 1) = d.q z.1 z.2 := by + have hb : 0 < g z.1 (p z.1) (p z.1)+4 := by have h := hpos z.1 _ (hp0 z.1); linarith + change beta z.1 • frameMap (d.e z.1 z.2) (Pi.single 1 1) = _ + rw [frameMap_axis,d.second] + simp [beta,metricNormalize,d.length,smul_smul,ne_of_gt (Real.sqrt_pos.mpr hb)] +end AdmissibleFrameTriple + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/TwoValueGaussianMap.lean b/lean/OAI/Geometry/NodalSets/Waves/TwoValueGaussianMap.lean new file mode 100644 index 0000000000000000000000000000000000000000..8350b6413bd8c889683245230506f946ff06b967 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/TwoValueGaussianMap.lean @@ -0,0 +1,42 @@ +import OAI.Geometry.NodalSets.Coefficients.TwoPointCoefficientEnergy +import OAI.Geometry.NodalSets.Waves.FiniteGaussianMap + +namespace OAI + +namespace Yau.Geometry +open Yau.Probability MeasureTheory ProbabilityTheory +open scoped RealInnerProductSpace +noncomputable section +variable {ι : Type*} [Fintype ι] + +lemma pairJetMap_two_inner (z w : ι → ℂ) (v : EuclideanSpace ℝ (Fin 2)) + (a : ι × Fin 2 → ℝ) : + ⟪v,pairJetMap ![z,w] (WithLp.toLp 2 a)⟫ = + pairLinearSum (fun i ↦ (v 0:ℂ)*z i+(v 1:ℂ)*w i) a := by + rw [EuclideanSpace.inner_eq_star_dotProduct] + simp only [dotProduct,star_trivial,Fin.sum_univ_two,pairJetMap_apply, + Matrix.cons_val_zero,Matrix.cons_val_one,pairLinearSum_real_combination] + ring + +lemma pairJetMap_two_energy (z w : ι → ℂ) (v : EuclideanSpace ℝ (Fin 2)) : + ‖(pairJetMap ![z,w]).adjoint v‖^2 = + ∑ i, ‖(v 0:ℂ)*z i+(v 1:ℂ)*w i‖^2 := by + rw [← variance_gaussianMap_inner] + simp_rw [pairJetMap_two_inner] + exact variance_pairLinearSum _ + +lemma two_point_energy_upper (z w : ι → ℂ) (M : ℝ) + (hz : ∑ i, ‖z i‖^2 ≤ M) (hw : ∑ i, ‖w i‖^2 ≤ M) (u v : ℝ) : + (∑ i, ‖(u:ℂ)*z i+(v:ℂ)*w i‖^2) ≤ 2*M*(u^2+v^2) := by + have hh := Finset.sum_le_sum (fun i (_ : i ∈ (Finset.univ : Finset ι)) ↦ + complex_norm_add_sq_bound ((u:ℂ)*z i) ((v:ℂ)*w i)) + simp only [norm_mul,mul_pow,Complex.norm_real,Real.norm_eq_abs,sq_abs, + Finset.sum_add_distrib,← Finset.mul_sum] at hh + have hz' := mul_le_mul_of_nonneg_left hz (sq_nonneg u) + have hw' := mul_le_mul_of_nonneg_left hw (sq_nonneg v) + nlinarith + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/TwoValueSignProbability.lean b/lean/OAI/Geometry/NodalSets/Waves/TwoValueSignProbability.lean new file mode 100644 index 0000000000000000000000000000000000000000..6fcd0532846d66d5d076ca8fdb85e7c20c852716 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/TwoValueSignProbability.lean @@ -0,0 +1,60 @@ +import OAI.Geometry.NodalSets.Waves.GaussianFactorTwoSided +import OAI.Geometry.NodalSets.Waves.GaussianUniformBall +import OAI.Geometry.NodalSets.Waves.TwoValueGaussianMap + +namespace OAI + +namespace Yau.Geometry +open Yau.Probability MeasureTheory ProbabilityTheory Set Metric +open scoped ENNReal RealInnerProductSpace +noncomputable section +local notation "E" => EuclideanSpace ℝ (Fin 2) + +lemma two_value_sign_probability (d M : ℝ) (hd : 0 < d) (hM : 0 ≤ M) : + ∃ p : ℝ≥0∞, 0 < p ∧ ∀ {ι : Type} [Fintype ι] (z w : ι → ℂ) (mean : E), + ‖mean‖ ≤ M → (∑ i, ‖z i‖^2) ≤ 4 → (∑ i, ‖w i‖^2) ≤ 4 → + (∀ u v : ℝ, d*(u^2+v^2) ≤ ∑ i, ‖(u:ℂ)*z i+(v:ℂ)*w i‖^2) → + p ≤ gaussianPairs {a | 1 ≤ mean 0+pairLinearSum z a ∧ mean 1+pairLinearSum w a ≤ -1} := by + let target : E := WithLp.toLp 2 ![2,-2] + obtain ⟨p,hp,hball⟩ := uniform_affine_gaussian_ball (ι := Fin 2) (Real.sqrt d)⁻¹ 4 M 1 + (by positivity) (by norm_num) hM (by norm_num) target + refine ⟨p,hp,?_⟩ + intro ι hfin z w mean hm hz hw hgap + let T := pairJetMap ![z,w] + have hlo (v : E) : d*‖v‖^2 ≤ ‖T.adjoint v‖^2 := by + rw [pairJetMap_two_energy] + simpa only [EuclideanSpace.real_norm_sq_eq,Fin.sum_univ_two] using hgap (v 0) (v 1) + have hhi (v : E) : ‖T.adjoint v‖^2 ≤ (4:ℝ)^2*‖v‖^2 := by + rw [pairJetMap_two_energy] + have hh := two_point_energy_upper z w 4 hz hw (v 0) (v 1) + have hn : ‖v‖^2 = (v 0)^2+(v 1)^2 := by rw [EuclideanSpace.real_norm_sq_eq,Fin.sum_univ_two] + rw [hn] + nlinarith [sq_nonneg (v 0),sq_nonneg (v 1)] + obtain ⟨L,hLaw,hLi,hL⟩ := exists_gaussian_factor_two_sided T d 4 hd (by norm_num) hlo hhi + have hmap : gaussianPairs.map (fun a ↦ mean+T (WithLp.toLp 2 a)) = + (stdGaussian E).map (fun v ↦ mean+L v) := by + have hh := congrArg (fun μ : Measure E ↦ μ.map (fun v ↦ mean+v)) (pairJetMap_law ![z,w]) + rw [hLaw] at hh + rw [Measure.map_map (by fun_prop) (by fun_prop), + Measure.map_map (by fun_prop) (by fun_prop)] at hh + exact hh + have hb := hball L mean hLi hL hm + rw [← hmap,Measure.map_apply (by fun_prop) isOpen_ball.measurableSet] at hb + apply hb.trans (measure_mono ?_) + intro a ha + let y := mean+T (WithLp.toLp 2 a) + have hn : ‖y-target‖ < 1 := by simpa only [mem_preimage,mem_ball,dist_eq_norm] using ha + have h0 := (PiLp.norm_apply_le (y-target) 0).trans_lt hn + have h1 := (PiLp.norm_apply_le (y-target) 1).trans_lt hn + change |y 0-2| < 1 at h0 + change |y 1-(-2)| < 1 at h1 + have hy0 : y 0 = mean 0+pairLinearSum z a := by simp [y,T,pairJetMap_apply] + have hy1 : y 1 = mean 1+pairLinearSum w a := by simp [y,T,pairJetMap_apply] + change 1 ≤ mean 0+pairLinearSum z a ∧ mean 1+pairLinearSum w a ≤ -1 + rw [← hy0,← hy1] + exact ⟨by linarith [(abs_lt.mp h0).1],by linarith [(abs_lt.mp h1).2]⟩ + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/UniformActualWaveSize.lean b/lean/OAI/Geometry/NodalSets/Waves/UniformActualWaveSize.lean new file mode 100644 index 0000000000000000000000000000000000000000..239494ac367f2d7035a2bf75a2a94ca3f9a67216 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/UniformActualWaveSize.lean @@ -0,0 +1,64 @@ +import OAI.Geometry.NodalSets.Coefficients.MetricWaveJets + +namespace OAI + +namespace Yau.Jets +open Filter Set +open scoped ContDiff Topology +noncomputable section +variable {T : Type*} [TopologicalSpace T] + +lemma cutoff_wave_derivative_zero_outside (u : Coord → ℂ) {N : ℝ} (hN : 0 < N) + (x : Coord) (k : ℕ) (hx : 2*N^(-1/3:ℝ) < ‖x‖) : + iteratedFDeriv ℝ k (fun z ↦ Yau.Waves.scaledCutoff N (0:Coord) z • u z) x = 0 := by + have hnear : ∀ᶠ z in 𝓝 x, 2*N^(-1/3:ℝ) < ‖z‖ := + (isOpen_lt continuous_const continuous_norm).mem_nhds hx + have he : (fun z ↦ Yau.Waves.scaledCutoff N (0:Coord) z • u z) =ᶠ[𝓝 x] fun _ ↦ (0:ℂ) := by + filter_upwards [hnear] with z hz + have hb : Yau.Waves.scaledCutoff N (0:Coord) z = 0 := by + by_contra hn + have hm : z ∈ Function.support (Yau.Waves.scaledCutoff N (0:Coord)) := hn + rw [Yau.Waves.scaledCutoff_support hN] at hm + have hlt : ‖z‖ < 2*N^(-1/3:ℝ) := by simpa [Metric.mem_ball,dist_eq_norm] using hm + linarith + simp [hb] + simpa using (he.iteratedFDeriv ℝ k).self_of_nhds + +theorem uniform_cutoff_wave_size {s : Set T} (hs : IsCompact s) + (phi : T → CPoly) (A : ℕ → T → CPoly) + (hp : ContinuousPolyFamily phi) (hA : ∀ j, ContinuousPolyFamily (A j)) + (J k : ℕ) (S : T → Coord → ℝ) (c : ℝ) (hc : 0 < c) + (hgap : ∀ᶠ N : ℝ in atTop, ∀ t ∈ s, ∀ x : Coord, ‖x‖ ≤ 2*N^(-1/3:ℝ) → + (reval (phi t) x).re-S t x ≤ -c*‖x‖^2) : + ∃ C > 0, ∀ᶠ N : ℝ in atTop, ∀ t ∈ s, ∀ x : Coord, + ‖iteratedFDeriv ℝ k (fun z ↦ Yau.Waves.scaledCutoff N (0:Coord) z • + (finiteAmplitude (fun j ↦ A j t) J N z * waveExp (reval (phi t)) N z)) x‖ ≤ + C*N^k*Real.exp (N*S t x-c*N*‖x‖^2) := by + obtain ⟨Ca,hCa,hamp⟩ := finiteAmplitude_all_parameter_derivatives A hA J k s hs 2 + obtain ⟨Cp,hCp,hphase⟩ := (hp.uniformSmoothBounded s hs 2).2 k + obtain ⟨B,hB,hsize⟩ := cutoff_wave_size k + let D := max Cp (1+c) + have hD : 1 ≤ D := (le_add_of_nonneg_right hc.le).trans (le_max_right _ _) + refine ⟨B*Ca*(k.factorial:ℝ)*D^k,by positivity,?_⟩ + filter_upwards [hgap,eventually_ge_atTop (1:ℝ)] with N hgN hN + intro t ht x + by_cases hx : ‖x‖ ≤ 2*N^(-1/3:ℝ) + · have hx2 : ‖x‖ ≤ 2 := hx.trans (by + have hh := Real.rpow_le_one_of_one_le_of_nonpos hN (show (-1/3:ℝ) ≤ 0 by norm_num) + linarith) + simpa only [sub_zero,mul_assoc] using hsize (reval (phi t)) + (finiteAmplitude (fun j ↦ A j t) J N) (reval_contDiff _) (finiteAmplitude_contDiff _ _ _) + 0 x N Ca D (S t x) c hN hCa.le hD (hamp t ht N hN x hx2) + (fun j _ hj ↦ (hphase t ht x hx2 j hj).trans (le_max_left _ _)) + (by simpa only [sub_zero] using hgN t ht x hx) + · rw [cutoff_wave_derivative_zero_outside _ (by linarith) x k (lt_of_not_ge hx),norm_zero] + positivity + +theorem eventually_nat_frequency {P : ℝ → Prop} (h : ∀ᶠ N : ℝ in atTop, P N) : + ∀ᶠ n : ℕ in atTop, P (n:ℝ) := + tendsto_natCast_atTop_atTop.eventually h + +end +end Yau.Jets + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/UniformChartWaveTransfer.lean b/lean/OAI/Geometry/NodalSets/Waves/UniformChartWaveTransfer.lean new file mode 100644 index 0000000000000000000000000000000000000000..2e0ef5c3318fbedf0b2c72bc270a02374f365b58 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/UniformChartWaveTransfer.lean @@ -0,0 +1,159 @@ +import OAI.Geometry.NodalSets.Charts.ChartDerivativeTransfer +import OAI.Geometry.NodalSets.Charts.ChartNormComparison +import OAI.Geometry.NodalSets.Charts.UniformInverseChartBounds +import OAI.Geometry.NodalSets.Coefficients.LocalCoordinateResidual +import OAI.Geometry.NodalSets.Elliptic.OperatorLocality +import OAI.Geometry.NodalSets.Waves.ConstructedCoordinateWaves + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Filter Set Metric +open scoped ContDiff Topology +noncomputable section +variable {T : Type*} [TopologicalSpace T] [CompactSpace T] + +theorem uniform_chart_wave_transfer + (g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ) (hg : ContDiff ℝ ∞ g) + (hp : ∀ x v, v ≠ 0 → 0 < g x v v) (w : Coord → ℝ) (hw : ContDiff ℝ ∞ w) + (p : T → QuadParam Coord) (hpc : Continuous p) + (F : T → OpenPartialHomeomorph Coord Coord) + (hF : ∀ t, (F t : Coord → Coord) = rawQuadratic (p t)) + (r : ℝ) (hr : 0 < r) (hsource : ∀ t, (F t).source = ball 0 r) + (hInv : ∀ t, ContDiffOn ℝ ∞ (F t).symm (F t).target) + (hJ : ∀ t, ∀ x ∈ (F t).source, ∃ J : Coord ≃L[ℝ] Coord, + fderiv ℝ (rawQuadratic (p t)) x = J.toContinuousLinearMap) + (hwp : ∀ t, ∀ z ∈ (F t).target, 0 < w z) + (S : Coord → ℝ) (u : ℕ → T → Coord → ℂ) + (hu : ∀ n t, ContDiff ℝ ∞ (u n t)) + (hsupport : ∀ n, 0 < n → ∀ t, tsupport (u n t) ⊆ closedBall 0 (2*(n:ℝ)^(-1/3:ℝ))) + (k0 K : ℕ) (c Cr : ℝ) (Cs : Fin (k0+1) → ℝ) + (hc : 0 < c) (hCr : 0 < Cr) (hCs : ∀ k, 0 < Cs k) + (hest : ∀ᶠ n : ℕ in atTop, ∀ t x, + (∀ k : Fin (k0+1), ‖iteratedFDeriv ℝ k.val (u n t) x‖ ≤ + Cs k*(n:ℝ)^k.val*Real.exp ((n:ℝ)*S (rawQuadratic (p t) x)-c*(n:ℝ)*‖x‖^2)) ∧ + DerivativeBound k0 (fun z ↦ smoothSecondOrder (fun i j ↦ complexPrincipal g i j (p t)) + (fun j ↦ complexDrift g w j (p t)) (u n t) z + + ((4:ℂ)*(n:ℂ)^2+6*(n:ℂ))*u n t z) x + (Cr*(n:ℝ)^(-(K:ℝ))*Real.exp ((n:ℝ)*S (rawQuadratic (p t) x)))) : + ∃ c' Cw Cr' R : ℝ, 0 < c' ∧ 0 < Cw ∧ 0 < Cr' ∧ 0 < R ∧ + ∀ᶠ n : ℕ in atTop, ∀ t, + ContDiff ℝ ∞ (chartPushforward (F t) (u n t)) ∧ + HasCompactSupport (chartPushforward (F t) (u n t)) ∧ + tsupport (chartPushforward (F t) (u n t)) ⊆ closedBall (p t).1 (R*(n:ℝ)^(-1/3:ℝ)) ∧ + ∀ z : Coord, + (∀ k : Fin (k0+1), ‖iteratedFDeriv ℝ k.val (chartPushforward (F t) (u n t)) z‖ ≤ + Cw*(n:ℝ)^k.val*Real.exp ((n:ℝ)*S z-c'*(n:ℝ)*‖z-(p t).1‖^2)) ∧ + DerivativeBound k0 (fun z ↦ sourceWeightedOperator g w (chartPushforward (F t) (u n t)) z + + ((4:ℂ)*(n:ℂ)^2+6*(n:ℂ))*chartPushforward (F t) (u n t) z) z + (Cr'*(n:ℝ)^(-(K:ℝ))*Real.exp ((n:ℝ)*S z)) := by + have hR (t : T) : closedBall (0:Coord) (r/2) ⊆ (F t).source := by + rw [hsource t] + exact closedBall_subset_ball (by linarith) + obtain ⟨D,hD,hDb⟩ := compact_inverse_derivative_bounds isCompact_univ p hpc F + (fun t _ ↦ hF t) (fun t _ ↦ hInv t) (fun t _ ↦ hJ t) (r/2) (fun t _ ↦ hR t) k0 + obtain ⟨L,hL,hLb⟩ := compact_chart_norm_bound isCompact_univ p hpc (r/2) (by positivity) + let Ct : ℝ := ∑ k, Cs k + have hCt : 0 < Ct := Finset.sum_pos (fun k _ ↦ hCs k) Finset.univ_nonempty + have hCi (k : Fin (k0+1)) : Cs k ≤ Ct := + Finset.single_le_sum (fun j _ ↦ (hCs j).le) (Finset.mem_univ k) + let Q : ℝ := (k0.factorial : ℝ)*D^k0 + have hQ : 0 < Q := by dsimp [Q]; positivity + have hQk (k : ℕ) (hk : k ≤ k0) : (k.factorial:ℝ)*D^k ≤ Q := by + have hf : (k.factorial:ℝ) ≤ k0.factorial := by exact_mod_cast Nat.factorial_le hk + have hd := pow_le_pow_right₀ hD hk + dsimp [Q] + gcongr + refine ⟨c/L^2,Q*Ct,Q*Cr,2*L,by positivity,mul_pos hQ hCt,mul_pos hQ hCr,by positivity,?_⟩ + have hsmall : ∀ᶠ n : ℕ in atTop, 2*(n:ℝ)^(-1/3:ℝ) < r/2 := by + apply eventually_nat_frequency (P := fun N : ℝ ↦ 2*N^(-1/3:ℝ) < r/2) + have ht : Tendsto (fun N : ℝ ↦ 2*N^(-1/3:ℝ)) atTop (𝓝 0) := by + simpa only [neg_div,mul_zero] using + (tendsto_rpow_neg_atTop (by norm_num : (0:ℝ) < 1/3)).const_mul 2 + exact ht.eventually (gt_mem_nhds (by positivity)) + filter_upwards [hest,hsmall,eventually_ge_atTop (1:ℕ)] with n hn hsmall hn1 + have hnpos : 0 < n := by omega + have hN : (1:ℝ) ≤ n := by exact_mod_cast hn1 + intro t + have hus := hsupport n hnpos t + have huR : tsupport (u n t) ⊆ closedBall (0:Coord) (r/2) := + hus.trans (closedBall_subset_closedBall hsmall.le) + have huSource := huR.trans (hR t) + have huComp : HasCompactSupport (u n t) := + (isCompact_closedBall (0:Coord) (r/2)).of_isClosed_subset isClosed_closure huR + obtain ⟨hVs,hVc,hVsup⟩ := chartPushforward_smooth (F t) (hInv t) (u n t) (hu n t) huComp huSource + refine ⟨hVs,hVc,?_,?_⟩ + · intro z hz + obtain ⟨x,hx,rfl⟩ := hVsup hz + have hnorm := hLb t (mem_univ t) x (huR hx) + have hxN : ‖x‖ ≤ 2*(n:ℝ)^(-1/3:ℝ) := by simpa using hus hx + rw [mem_closedBall,dist_eq_norm,hF t] + calc + _ ≤ L*‖x‖ := hnorm + _ ≤ L*(2*(n:ℝ)^(-1/3:ℝ)) := mul_le_mul_of_nonneg_left hxN (by positivity) + _ = _ := by ring + · intro z + by_cases hz : z ∈ tsupport (chartPushforward (F t) (u n t)) + · obtain ⟨x,hx,rfl⟩ := hVsup hz + have hxS := huSource hx + have hxt := (F t).map_source hxS + have hinv : (F t).symm (F t x) = x := (F t).left_inv hxS + have hFx : rawQuadratic (p t) x = F t x := congrFun (hF t).symm x + have hdi (i : ℕ) (hi : 1 ≤ i) (hik : i ≤ k0) := hDb t (mem_univ t) x (huR hx) i hi hik + have hnorm : ‖F t x-(p t).1‖ ≤ L*‖x‖ := by rw [hF t]; exact hLb t (mem_univ t) x (huR hx) + have hgauss : Real.exp ((n:ℝ)*S (rawQuadratic (p t) x)-c*(n:ℝ)*‖x‖^2) ≤ + Real.exp ((n:ℝ)*S (F t x)-(c/L^2)*(n:ℝ)*‖F t x-(p t).1‖^2) := by + apply Real.exp_le_exp.mpr + rw [hFx] + have hh := gaussian_chart_norm_bound c (n:ℝ) L ‖x‖ ‖F t x-(p t).1‖ hc.le + (by positivity) (by positivity) (norm_nonneg _) (norm_nonneg _) hnorm + linarith + refine ⟨?_,?_⟩ + · intro k + have hk : k.val ≤ k0 := by omega + have hb := chart_wave_size_transfer (F t) (hInv t) (u n t) (hu n t) (F t x) hxt k.val + Ct D (Real.exp ((n:ℝ)*S (rawQuadratic (p t) x)-c*(n:ℝ)*‖x‖^2)) (n:ℝ) + hCt.le (by positivity) hN (fun i hi ↦ by + rw [hinv] + have hh := (hn t x).1 ⟨i,by omega⟩ + exact hh.trans (by gcongr; exact hCi ⟨i,by omega⟩)) + (fun i hi hik ↦ hdi i hi (hik.trans hk)) + apply hb.trans + have hq := hQk k.val hk + calc + _ = ((k.val.factorial:ℝ)*D^k.val)*Ct*(n:ℝ)^k.val* + Real.exp ((n:ℝ)*S (rawQuadratic (p t) x)-c*(n:ℝ)*‖x‖^2) := by ring + _ ≤ _ := by gcongr + · intro k hk + rw [transported_residual_derivative g hg hp w hw (p t) (F t) (hF t) (hInv t) (hJ t) + (hwp t) (u n t) (hu n t) huComp huSource _ (F t x) hxt k] + have hrs := actual_coordinate_residual_smoothOn g hg hp w hw (p t) (F t).source (hJ t) + (fun x hx ↦ by rw [← hF t]; exact hwp t (F t x) ((F t).map_source hx)) (u n t) (hu n t) + ((4:ℂ)*(n:ℂ)^2+6*(n:ℂ)) + have hb := chart_residual_bound_transfer (F t) (hInv t) _ hrs (F t x) hxt k + Cr D (Real.exp ((n:ℝ)*S (rawQuadratic (p t) x))) (n:ℝ) (K:ℝ) + (fun i hi ↦ by rw [hinv]; exact (hn t x).2 i (hi.trans hk)) + (fun i hi hik ↦ hdi i hi (hik.trans hk)) + apply hb.trans + rw [hFx] + have hq := hQk k hk + calc + _ = ((k.factorial:ℝ)*D^k)*Cr*(n:ℝ)^(-(K:ℝ))*Real.exp ((n:ℝ)*S (F t x)) := by ring + _ ≤ _ := by gcongr + · have he : chartPushforward (F t) (u n t) =ᶠ[𝓝 z] (fun _ ↦ 0) := + notMem_tsupport_iff_eventuallyEq.mp hz + refine ⟨?_,?_⟩ + · intro k + rw [(he.iteratedFDeriv ℝ k.val).self_of_nhds] + have hzder : iteratedFDeriv ℝ k.val (fun _ : Coord ↦ (0:ℂ)) z = 0 := by simp + rw [hzder,norm_zero] + positivity + · intro k _ + rw [source_residual_derivative_zero g w _ _ z hz k] + simp only [norm_zero] + positivity + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/UniformWaveJet.lean b/lean/OAI/Geometry/NodalSets/Waves/UniformWaveJet.lean new file mode 100644 index 0000000000000000000000000000000000000000..4f25b8770948d9a4297c635e9ffeed569b37f9fd --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/UniformWaveJet.lean @@ -0,0 +1,179 @@ +import OAI.Geometry.NodalSets.Elliptic.SmoothBeamJet +import OAI.Geometry.NodalSets.Elliptic.UniformEikonal +import OAI.Geometry.NodalSets.Elliptic.UniformTransportPolynomial + +namespace OAI + +namespace Yau.Jets +open MvPolynomial +open scoped ContDiff +noncomputable section +variable {T : Type*} [TopologicalSpace T] + +lemma beamVector_family (g : T → Fin 4 → Fin 4 → CPoly) (phi : T → CPoly) + (hg : ∀ i j, ContinuousPolyFamily (fun t ↦ g t i j)) + (hp : ContinuousPolyFamily phi) (i : Fin 4) : + ContinuousPolyFamily (fun t ↦ beamVector (g t) (phi t) i) := by + apply ContinuousPolyFamily.mul (.const _) + exact ContinuousPolyFamily.sum _ (fun j _ ↦ (hg i j).mul (hp.pderiv j)) + +lemma secondOrder_family (g : T → Fin 4 → Fin 4 → CPoly) + (b : T → Fin 4 → CPoly) (phi : T → CPoly) + (hg : ∀ i j, ContinuousPolyFamily (fun t ↦ g t i j)) + (hb : ∀ i, ContinuousPolyFamily (fun t ↦ b t i)) + (hp : ContinuousPolyFamily phi) : + ContinuousPolyFamily (fun t ↦ polynomialSecondOrder (g t) (b t) (phi t)) := by + apply ContinuousPolyFamily.add + · apply ContinuousPolyFamily.sum + intro i _ + exact ContinuousPolyFamily.sum _ (fun j _ ↦ (hg i j).mul ((hp.pderiv j).pderiv i)) + · exact ContinuousPolyFamily.sum _ (fun i _ ↦ (hb i).mul (hp.pderiv i)) + +lemma beamScalar_family (g : T → Fin 4 → Fin 4 → CPoly) + (b : T → Fin 4 → CPoly) (phi : T → CPoly) + (hg : ∀ i j, ContinuousPolyFamily (fun t ↦ g t i j)) + (hb : ∀ i, ContinuousPolyFamily (fun t ↦ b t i)) + (hp : ContinuousPolyFamily phi) : + ContinuousPolyFamily (fun t ↦ beamScalar (g t) (b t) (phi t)) := + (secondOrder_family g b phi hg hb hp).add (.const _) + +theorem polynomial_wave_jets_continuous + (v : T → Fin 4 → ℂ) (hv : ∀ j, Continuous (fun t ↦ v t j)) + (i : Fin 4) (hvi : ∀ t, v t i ≠ 0) + (g : T → Fin 4 → Fin 4 → CPoly) (b : T → Fin 4 → CPoly) + (hg : ∀ i j, ContinuousPolyFamily (fun t ↦ g t i j)) + (hb : ∀ i, ContinuousPolyFamily (fun t ↦ b t i)) + (hmetric : ∀ t i j, homogeneousComponent 0 (g t i j) = if i = j then 1 else 0) + (initial : T → Jet) (hi : ∀ t k, (initial t k).IsHomogeneous k) + (hic : ∀ k, ContinuousPolyFamily (fun t ↦ initial t k)) + (hfirst : ∀ t i, pderiv i (initial t 1) = C (v t i)) + (hcenter : ∀ t, (∑ i, v t i * v t i) + 4 = 0) + (hsecond : ∀ t, eikonalCoefficient (v t) + (fun r i j ↦ homogeneousComponent r (g t i j)) 0 (initial t) = 0) (m J : ℕ) : + ∃ (phi : T → CPoly) (A : ℕ → T → CPoly), + ContinuousPolyFamily phi ∧ (∀ j, ContinuousPolyFamily (A j)) ∧ + (∀ t k, k ≤ 2 → homogeneousComponent k (phi t) = initial t k) ∧ + (∀ t d, m + 2 * J + 3 < d → homogeneousComponent d (phi t) = 0) ∧ + (∀ t d, d ≤ m + 2 * J + 2 → + homogeneousComponent d (polynomialEikonal (g t) (phi t)) = 0) ∧ + (∀ j t, homogeneousComponent 0 (A j t) = if j = 0 then 1 else 0) ∧ + (∀ j t k, m + 1 + 2 * (J - j) < k → homogeneousComponent k (A j t) = 0) ∧ + (∀ t n, n < m + 1 + 2 * J → homogeneousComponent n + (polynomialTransport (beamVector (g t) (phi t)) (beamScalar (g t) (b t) (phi t)) + 0 (A 0 t)) = 0) ∧ + ∀ j, j < J → ∀ t n, n < m + 1 + 2 * (J - (j + 1)) → homogeneousComponent n + (polynomialTransport (beamVector (g t) (phi t)) (beamScalar (g t) (b t) (phi t)) + (-polynomialSecondOrder (g t) (b t) (A j t)) (A (j + 1) t)) = 0 := by + obtain ⟨phi, hpc, hkeep, hdegree, hsolve, _⟩ := finite_eikonal_polynomial_continuous + v hv i hvi (fun t r i j ↦ homogeneousComponent r (g t i j)) + (fun r i j ↦ (hg i j).homogeneousComponent r) initial hi hic hsecond (m + 2 * J + 1) + have hf : ∀ t i, pderiv i (homogeneousComponent 1 (phi t)) = C (v t i) := by + intro t i + rw [show homogeneousComponent 1 (phi t) = initial t 1 from hkeep t 1 (by omega), hfirst] + have he : ∀ t d, d ≤ m + 2 * J + 2 → + homogeneousComponent d (polynomialEikonal (g t) (phi t)) = 0 := by + intro t d hd + cases d with + | zero => + unfold polynomialEikonal + have hc0 (a b : CPoly) : homogeneousComponent 0 (a * b) = + homogeneousComponent 0 a * homogeneousComponent 0 b := by + simpa using homogeneousComponent_mul a b 0 + simp only [map_add, map_sum, hc0, homogeneousComponent_pderiv, Nat.zero_add, hf, hmetric] + simp only [ite_mul, one_mul, zero_mul, Finset.sum_ite_eq, Finset.mem_univ, ite_true] + rw [homogeneousComponent_eq_self (isHomogeneous_C (Fin 4) (4 : ℂ))] + simpa only [map_add, map_sum, map_mul, map_zero] using congrArg C (hcenter t) + | succ n => + rw [← eikonalCoefficient_eq (v t) (g t) (hmetric t) (phi t) (hf t) n] + exact hsolve t n (by omega) + have hW := beamVector_family g phi hg hpc + have hc := beamScalar_family g b phi hg hb hpc + obtain ⟨A, hAc, hA0, hAd, hAfirst, hAnext⟩ := finite_transport_polynomials_continuous + (fun t j ↦ 2 * v t j) (fun j ↦ continuous_const.mul (hv j)) + i (fun t ↦ mul_ne_zero (by norm_num) (hvi t)) + (fun t r j ↦ homogeneousComponent r (beamVector (g t) (phi t) j)) + (fun t ↦ polynomialJet (beamScalar (g t) (b t) (phi t))) + (fun t r i j ↦ homogeneousComponent r (g t i j)) + (fun t r i ↦ homogeneousComponent r (b t i)) + (fun r j ↦ (hW j).homogeneousComponent r) (fun r ↦ hc.homogeneousComponent r) + (fun r i j ↦ (hg i j).homogeneousComponent r) + (fun r i ↦ (hb i).homogeneousComponent r) m J + refine ⟨phi, A, hpc, hAc, hkeep, ?_, he, hA0, hAd, ?_, ?_⟩ + · simpa [Nat.add_assoc, polynomialJet] using hdegree + · intro t n hn + rw [← transportCoefficient_eq (fun j ↦ 2 * v t j) _ + (beamVector_center (v t) (g t) (hmetric t) (phi t) (hf t)) _ 0 (A 0 t) n] + have hz : polynomialJet (0 : CPoly) = (0 : Jet) := funext (fun k ↦ map_zero _) + rw [hz] + exact hAfirst t n hn + · intro j hj t n hn + rw [← transportCoefficient_eq (fun j ↦ 2 * v t j) _ + (beamVector_center (v t) (g t) (hmetric t) (phi t) (hf t)) _ + (-polynomialSecondOrder (g t) (b t) (A j t)) (A (j + 1) t) n] + have hforce : polynomialJet (-polynomialSecondOrder (g t) (b t) (A j t)) = + fun k ↦ -secondOrderCoefficient (fun r i j ↦ homogeneousComponent r (g t i j)) + (fun r i ↦ homogeneousComponent r (b t i)) (polynomialJet (A j t)) k := by + funext k + rw [secondOrderCoefficient_eq] + exact map_neg (homogeneousComponent k) _ + rw [hforce] + exact hAnext j hj t n hn + +theorem smooth_wave_jets_continuous + (v : T → Fin 4 → ℂ) (hv : ∀ j, Continuous (fun t ↦ v t j)) + (i : Fin 4) (hvi : ∀ t, v t i ≠ 0) + (g : T → Fin 4 → Fin 4 → Coord → ℂ) (b : T → Fin 4 → Coord → ℂ) + (G : T → Fin 4 → Fin 4 → CPoly) (B : T → Fin 4 → CPoly) + (hG : ∀ i j, ContinuousPolyFamily (fun t ↦ G t i j)) + (hB : ∀ i, ContinuousPolyFamily (fun t ↦ B t i)) + (hg : ∀ t i j, ContDiff ℝ ∞ (g t i j)) (hb : ∀ t i, ContDiff ℝ ∞ (b t i)) + (hmetric : ∀ t i j, homogeneousComponent 0 (G t i j) = if i = j then 1 else 0) + (initial : T → Jet) (hi : ∀ t k, (initial t k).IsHomogeneous k) + (hic : ∀ k, ContinuousPolyFamily (fun t ↦ initial t k)) + (hfirst : ∀ t i, pderiv i (initial t 1) = C (v t i)) + (hcenter : ∀ t, (∑ i, v t i * v t i) + 4 = 0) + (hsecond : ∀ t, eikonalCoefficient (v t) + (fun r i j ↦ homogeneousComponent r (G t i j)) 0 (initial t) = 0) (m J : ℕ) + (hgj : ∀ t i j, FlatAt m (fun x ↦ g t i j x - reval (G t i j) x) 0) + (hbj : ∀ t i, FlatAt m (fun x ↦ b t i x - reval (B t i) x) 0) : + ∃ (phi : T → CPoly) (A : ℕ → T → CPoly), + ContinuousPolyFamily phi ∧ (∀ j, ContinuousPolyFamily (A j)) ∧ + (∀ t k, k ≤ 2 → homogeneousComponent k (phi t) = initial t k) ∧ + (∀ t d, m + 2 * J + 3 < d → homogeneousComponent d (phi t) = 0) ∧ + (∀ j t, homogeneousComponent 0 (A j t) = if j = 0 then 1 else 0) ∧ + (∀ j t k, m + 1 + 2 * (J - j) < k → homogeneousComponent k (A j t) = 0) ∧ + (∀ t, FlatAt m (smoothEikonal (g t) (reval (phi t))) 0) ∧ + (∀ t, FlatAt m (smoothTransport (smoothBeamVector (g t) (reval (phi t))) + (smoothBeamScalar (g t) (b t) (reval (phi t))) (fun _ ↦ 0) (reval (A 0 t))) 0) ∧ + ∀ j, j < J → ∀ t, FlatAt m + (smoothTransport (smoothBeamVector (g t) (reval (phi t))) + (smoothBeamScalar (g t) (b t) (reval (phi t))) + (fun x ↦ -smoothSecondOrder (g t) (b t) (reval (A j t)) x) + (reval (A (j + 1) t))) 0 := by + obtain ⟨phi, A, hpc, hAc, hkeep, hdeg, he, hA0, hAd, ht0, htj⟩ := + polynomial_wave_jets_continuous v hv i hvi G B hG hB hmetric initial hi hic + hfirst hcenter hsecond m J + refine ⟨phi, A, hpc, hAc, hkeep, hdeg, hA0, hAd, ?_, ?_, ?_⟩ + · intro t + exact smooth_eikonal_flat (G t) (phi t) (hg t) (hgj t) (fun k hk ↦ he t k (by omega)) + · intro t + have hp : ∀ k, k ≤ m → homogeneousComponent k + (polynomialTransport (beamVector (G t) (phi t)) (beamScalar (G t) (B t) (phi t)) + (-polynomialSecondOrder (G t) (B t) 0) (A 0 t)) = 0 := by + intro k hk + simpa [polynomialSecondOrder] using ht0 t k (by omega) + have h := smooth_beam_transport_flat (G t) (B t) (phi t) 0 (A 0 t) + (hg t) (hb t) (hgj t) (hbj t) hp + have hz : (fun x ↦ -smoothSecondOrder (g t) (b t) (reval 0) x) = fun _ ↦ 0 := by + ext x + simp [smoothSecondOrder, coordPartial_reval, reval] + rw [hz] at h + exact h + · intro j hj t + exact smooth_beam_transport_flat (G t) (B t) (phi t) (A j t) (A (j + 1) t) + (hg t) (hb t) (hgj t) (hbj t) (fun k hk ↦ htj j hj t k (by omega)) + +end +end Yau.Jets + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/WaveCenterJets.lean b/lean/OAI/Geometry/NodalSets/Waves/WaveCenterJets.lean new file mode 100644 index 0000000000000000000000000000000000000000..8543a0d524cb6c17bb11fed45945d9952f35a010 --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/WaveCenterJets.lean @@ -0,0 +1,114 @@ +import OAI.Geometry.NodalSets.Elliptic.PhaseActualJet +import OAI.Geometry.NodalSets.Waves.TripleSourceWaves + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Set Filter +open scoped ContDiff Topology +noncomputable section +attribute [local instance] clmTopology clmAdd clmModule +variable {T : Type*} [TopologicalSpace T] +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} +variable {y : T → Coord} {d : SourceFrameTriple g S y} {m J K k0 : ℕ} +namespace TripleSourceWaveData +variable (b : TripleSourceWaveData g w S y d m J K k0) + +def phase (t : T × Fin 3) : Coord → ℂ := reval (b.phi t) ∘ (b.F t).symm + +def amplitude (N : ℝ) (t : T × Fin 3) : Coord → ℂ := + finiteAmplitude (fun j ↦ b.A j t) J N ∘ (b.F t).symm + +def wave (N : ℝ) (t : T × Fin 3) : Coord → ℂ := + chartPushforward (b.F t) (coordinateWave b.phi b.A J N t) + +lemma zero_mem_source (t : T × Fin 3) : (0:Coord) ∈ (b.F t).source := by + rw [(b.chart_domain t).1] + simpa using b.sourceRadius_pos + +lemma chart_zero (t : T × Fin 3) : b.F t 0 = y t.1 := by + rw [b.chart_eq] + exact quadraticChartMap_zero _ _ _ + +lemma center_mem_target (t : T × Fin 3) : y t.1 ∈ (b.F t).target := by + rw [← b.chart_zero t] + exact (b.F t).map_source (b.zero_mem_source t) + +lemma inverse_center (t : T × Fin 3) : (b.F t).symm (y t.1) = 0 := by + rw [← b.chart_zero t] + exact (b.F t).left_inv (b.zero_mem_source t) + +lemma inverse_derivative (t : T × Fin 3) : + HasFDerivAt ((b.F t).symm : Coord → Coord) (d.frame t).symm.toContinuousLinearMap (y t.1) := by + apply (b.F t).hasFDerivAt_symm (b.center_mem_target t) + rw [b.inverse_center,b.chart_eq] + exact quadraticChartMap_deriv_zero _ _ _ + +lemma phase_smooth_at_center (t : T × Fin 3) : ContDiffAt ℝ ∞ (b.phase t) (y t.1) := + (reval_contDiff _).contDiffAt.comp _ ((b.chart_domain t).2.2.contDiffAt + ((b.F t).open_target.mem_nhds (b.center_mem_target t))) + +lemma phase_center (t : T × Fin 3) : b.phase t (y t.1) = (S (y t.1):ℂ) := by + unfold phase + simp only [Function.comp_apply,b.inverse_center] + exact retained_phase_value _ _ _ _ (b.jets.phase_retained t 0 (by omega)) + +lemma amplitude_center (N : ℝ) (t : T × Fin 3) : b.amplitude N t (y t.1) = 1 := by + unfold amplitude + simp only [Function.comp_apply,b.inverse_center] + exact finiteAmplitude_center _ _ _ (fun j ↦ b.jets.amplitude_value j t) + +lemma wave_center (N : ℝ) (hN : 0 < N) (t : T × Fin 3) : + b.wave N t (y t.1) = Complex.exp ((N:ℂ)*(S (y t.1):ℂ)) := by + rw [wave,← b.chart_zero t,chartPushforward_pullback _ _ _ (b.zero_mem_source t)] + have hc : Yau.Waves.scaledCutoff N (0:Coord) 0 = 1 := + Yau.Waves.scaledCutoff_eq_one hN 0 0 (by simp; positivity) + have hphi := retained_phase_value _ _ _ _ (b.jets.phase_retained t 0 (by omega)) + simp only [coordinateWave,hc,one_smul,waveExp,hphi, + finiteAmplitude_center _ J N (fun j ↦ b.jets.amplitude_value j t),one_mul] + rw [b.chart_zero] + +lemma wave_ne_zero (N : ℝ) (hN : 0 < N) (t : T × Fin 3) : b.wave N t ≠ 0 := by + intro h + have hh := congrFun h (y t.1) + rw [b.wave_center N hN t] at hh + exact Complex.exp_ne_zero _ hh + +lemma phase_first (hpos : ∀ x v, v ≠ 0 → 0 < g x v v) + (hp0 : ∀ t, metricGradient g S (y t) ≠ 0) (t : T × Fin 3) (v : Coord) : + fderiv ℝ (b.phase t) (y t.1) v = + (g (y t.1) (metricGradient g S (y t.1)) v:ℂ) + + Complex.I * (g (y t.1) (d.q t.1 t.2) v:ℂ) := by + have hder := ((reval_contDiff (b.phi t)).differentiable (by simp) 0).hasFDerivAt + have he := (b.inverse_derivative t) + have hf : fderiv ℝ (b.phase t) (y t.1) v = + fderiv ℝ (reval (b.phi t)) 0 ((d.frame t).symm v) := by + unfold phase + rw [fderiv_comp _ (by rw [b.inverse_center]; exact hder.differentiableAt) he.differentiableAt, + he.fderiv,b.inverse_center] + rfl + rw [hf,fderiv_reval] + simp_rw [retained_phase_first _ _ _ _ (b.jets.phase_retained t 1 (by omega))] + have hpair0 : g (y t.1) (metricGradient g S (y t.1)) v = + sourceTripleAlpha g S y t * (d.frame t).symm v 0 := by + have hframe : sourceTripleAlpha g S y t • d.frame t (Pi.single 0 1) = metricGradient g S (y t.1) := + d.frame_first (fun t ↦ hpos (y t)) hp0 t + rw [← hframe] + simp only [map_smul,smul_apply,smul_eq_mul] + rw [frame_pair_coordinate (g (y t.1)) (d.frame t) (d.frame_orthonormal t)] + have hpair1 : g (y t.1) (d.q t.1 t.2) v = + sourceTripleBeta g S y t * (d.frame t).symm v 1 := by + have hframe : sourceTripleBeta g S y t • d.frame t (Pi.single 1 1) = d.q t.1 t.2 := + d.frame_second (fun t ↦ hpos (y t)) hp0 t + rw [← hframe] + simp only [map_smul,smul_apply,smul_eq_mul] + rw [frame_pair_coordinate (g (y t.1)) (d.frame t) (d.frame_orthonormal t)] + rw [hpair0,hpair1] + simp [normalFrameVector,Fin.sum_univ_succ] + ring + +end TripleSourceWaveData +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/WaveEstimates.lean b/lean/OAI/Geometry/NodalSets/Waves/WaveEstimates.lean new file mode 100644 index 0000000000000000000000000000000000000000..daa753576e4b25553c9d94afebf4993b342c7dbf --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/WaveEstimates.lean @@ -0,0 +1,202 @@ +import Mathlib.Analysis.Calculus.ContDiff.Operations +import Mathlib.Analysis.Calculus.Taylor +import Mathlib.Analysis.Complex.Trigonometric +import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Ring + +namespace OAI + +namespace Yau.Waves +open Set Filter +open scoped Topology ContDiff +noncomputable section +universe u +variable {E F : Type u} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] + +lemma iteratedDeriv_line {f : E → F} {n k : ℕ} (hf : ContDiff ℝ n f) + (hk : k ≤ n) (y z : E) (t : ℝ) : + iteratedDeriv k (fun s : ℝ ↦ f (y + s • z)) t = + iteratedFDeriv ℝ k f (y + t • z) (fun _ ↦ z) := by + let L : ℝ →L[ℝ] E := (ContinuousLinearMap.id ℝ ℝ).smulRight z + have hshift : ContDiff ℝ n (fun x ↦ f (y + x)) := + hf.comp (contDiff_const.add contDiff_id) + rw [iteratedDeriv_eq_iteratedFDeriv] + change iteratedFDeriv ℝ k ((fun x ↦ f (y + x)) ∘ L) t (fun _ ↦ 1) = _ + rw [L.iteratedFDeriv_comp_right hshift t (by exact_mod_cast hk)] + simp only [ContinuousMultilinearMap.compContinuousLinearMap_apply] + rw [iteratedFDeriv_comp_add_left] + simp [L] + +theorem vanishing_jet_taylor_bound {f : E → F} {n : ℕ} (hf : ContDiff ℝ (n + 1) f) + (y z : E) (C : ℝ) + (hzero : ∀ k, k ≤ n → iteratedFDeriv ℝ k f y = 0) + (hbound : ∀ t ∈ Icc (0 : ℝ) 1, ‖iteratedFDeriv ℝ (n + 1) f (y + t • z)‖ ≤ C) : + ‖f (y + z)‖ ≤ C * ‖z‖ ^ (n + 1) / (n.factorial : ℝ) := by + let g : ℝ → F := fun t ↦ f (y + t • z) + have hg : ContDiff ℝ (n + 1) g := + hf.comp (contDiff_const.add (contDiff_id.smul contDiff_const)) + have hi (k : ℕ) (hk : k ≤ n + 1) (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) : + iteratedDerivWithin k g (Icc (0 : ℝ) 1) t = + iteratedFDeriv ℝ k f (y + t • z) (fun _ ↦ z) := by + rw [iteratedDerivWithin_eq_iteratedDeriv (uniqueDiffOn_Icc (by norm_num : (0 : ℝ) < 1)) + (hg.of_le (by exact_mod_cast hk)).contDiffAt ht] + exact iteratedDeriv_line hf hk y z t + have htaylor : taylorWithinEval g n (Icc (0 : ℝ) 1) 0 1 = 0 := by + rw [taylor_within_apply] + apply Finset.sum_eq_zero + intro k hk + rw [hi k (by have := Finset.mem_range.mp hk; omega) 0 (by constructor <;> norm_num)] + simp [hzero k (by have := Finset.mem_range.mp hk; omega)] + have hderiv : ∀ t ∈ Icc (0 : ℝ) 1, + ‖iteratedDerivWithin (n + 1) g (Icc (0 : ℝ) 1) t‖ ≤ C * ‖z‖ ^ (n + 1) := by + intro t ht + rw [hi (n + 1) le_rfl t ht] + calc + _ ≤ ‖iteratedFDeriv ℝ (n + 1) f (y + t • z)‖ * ∏ _ : Fin (n + 1), ‖z‖ := + ContinuousMultilinearMap.le_opNorm _ _ + _ ≤ C * ‖z‖ ^ (n + 1) := by + simp only [Finset.prod_const, Finset.card_univ, Fintype.card_fin] + exact mul_le_mul_of_nonneg_right (hbound t ht) (pow_nonneg (norm_nonneg _) _) + have h := taylor_mean_remainder_bound (by norm_num : (0 : ℝ) ≤ 1) + hg.contDiffOn (by constructor <;> norm_num : (1 : ℝ) ∈ Icc (0 : ℝ) 1) hderiv + simpa [htaylor, g] using h + +theorem vanishing_jet_derivative_bound {f : E → F} {m l : ℕ} + (hf : ContDiff ℝ ∞ f) (hl : l ≤ m) (y z : E) (C : ℝ) + (hzero : ∀ k, k ≤ m → iteratedFDeriv ℝ k f y = 0) + (hbound : ∀ t ∈ Icc (0 : ℝ) 1, + ‖iteratedFDeriv ℝ (m + 1) f (y + t • z)‖ ≤ C) : + ‖iteratedFDeriv ℝ l f (y + z)‖ ≤ + C * ‖z‖ ^ (m + 1 - l) / ((m - l).factorial : ℝ) := by + induction l generalizing F m with + | zero => + have hf0 : ContDiff ℝ (m + 1 : ℕ) f := hf.of_le (by + exact_mod_cast (show (m + 1 : ℕ∞) ≤ ⊤ from le_top)) + simpa [norm_iteratedFDeriv_zero] using + vanishing_jet_taylor_bound (n := m) hf0 y z C hzero hbound + | succ l ih => + cases m with + | zero => omega + | succ m => + have hf' : ContDiff ℝ ∞ (fderiv ℝ f) := hf.fderiv_right (by simp) + have hz' : ∀ k, k ≤ m → iteratedFDeriv ℝ k (fderiv ℝ f) y = 0 := by + intro k hk + apply norm_eq_zero.mp + rw [norm_iteratedFDeriv_fderiv, hzero (k + 1) (by omega), norm_zero] + have hb' : ∀ t ∈ Icc (0 : ℝ) 1, + ‖iteratedFDeriv ℝ (m + 1) (fderiv ℝ f) (y + t • z)‖ ≤ C := by + intro t ht + rw [norm_iteratedFDeriv_fderiv] + exact hbound t ht + have h := ih hf' (by omega : l ≤ m) hz' hb' + simpa [norm_iteratedFDeriv_fderiv] using h + +theorem quadratic_gap_of_cubic_remainder {eta C r gap : ℝ} + (hr : 0 ≤ r) (hsmall : C * r ≤ eta / 4) + (hgap : gap ≤ -(eta / 2) * r ^ 2 + C * r ^ 3) : + gap ≤ -(eta / 4) * r ^ 2 := by + have := mul_le_mul_of_nonneg_right hsmall (mul_nonneg hr hr) + nlinarith + +theorem complex_exponential_gaussian_bound {phi : ℂ} {S c N r : ℝ} + (hN : 0 ≤ N) (hgap : phi.re - S ≤ -c * r ^ 2) : + ‖Complex.exp ((N : ℂ) * phi)‖ ≤ Real.exp (N * S - c * N * r ^ 2) := by + rw [Complex.norm_exp] + simp only [Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, zero_mul, sub_zero] + apply Real.exp_le_exp.mpr + have := mul_le_mul_of_nonneg_left hgap hN + nlinarith + +theorem gaussian_absorbs_power (c : ℝ) (hc : 0 < c) (p K : ℝ) : + ∀ᶠ N : ℝ in atTop, + N ^ p * Real.exp (-c * N ^ (1 / 3 : ℝ)) ≤ N ^ (-K) := by + have ht := (tendsto_rpow_mul_exp_neg_mul_atTop_nhds_zero + (3 * (p + K)) c hc).comp (tendsto_rpow_atTop (by norm_num : (0 : ℝ) < 1 / 3)) + have he : ∀ᶠ N : ℝ in atTop, + (N ^ (1 / 3 : ℝ)) ^ (3 * (p + K)) * Real.exp (-c * N ^ (1 / 3 : ℝ)) ≤ 1 := + ht.eventually (eventually_le_nhds (by norm_num : (0 : ℝ) < 1)) + filter_upwards [he, eventually_gt_atTop (0 : ℝ)] with N hN hpos + have heq : (N ^ (1 / 3 : ℝ)) ^ (3 * (p + K)) = N ^ (p + K) := by + rw [← Real.rpow_mul hpos.le] + congr 1 + ring + rw [heq] at hN + rw [Real.rpow_neg hpos.le, ← one_div, le_div_iff₀ (Real.rpow_pos_of_pos hpos K)] + simpa [Real.rpow_add hpos, mul_assoc, mul_left_comm, mul_comm] using hN + +theorem gaussian_cutoff_bound (c b : ℝ) (hc : 0 < c) (hb : 0 < b) (p K : ℝ) : + ∀ᶠ N : ℝ in atTop, ∀ S r A : ℝ, 0 ≤ A → + b * N ^ (1 / 3 : ℝ) ≤ N * r ^ 2 → + A * N ^ p * Real.exp (N * S - c * N * r ^ 2) ≤ + A * N ^ (-K) * Real.exp (N * S) := by + filter_upwards [gaussian_absorbs_power (c * b) (mul_pos hc hb) p K, + eventually_gt_atTop (0 : ℝ)] with N hN hpos + intro S r A hA hann + have hexp : Real.exp (-c * N * r ^ 2) ≤ Real.exp (-(c * b) * N ^ (1 / 3 : ℝ)) := by + apply Real.exp_le_exp.mpr + have := mul_le_mul_of_nonneg_left hann hc.le + nlinarith + have hcost : N ^ p * Real.exp (-c * N * r ^ 2) ≤ N ^ (-K) := + (mul_le_mul_of_nonneg_left hexp (Real.rpow_nonneg hpos.le _)).trans hN + have h := mul_le_mul_of_nonneg_left hcost hA + have h' := mul_le_mul_of_nonneg_right h (Real.exp_pos (N * S)).le + rw [show N * S - c * N * r ^ 2 = N * S + (-c * N * r ^ 2) by ring, + Real.exp_add] + nlinarith [h'] + +theorem residual_exponent_budgets {m J K k k0 : ℕ} + (hm : 3 * K + 4 * k0 + 6 < m + 1) (hJ : K + k0 + 1 ≤ J) (hk : k ≤ k0) : + (k : ℝ) + 2 - ((m : ℝ) + 1 - k) / 3 < -(K : ℝ) ∧ + (k : ℤ) - J ≤ -(K : ℤ) - 1 := by + constructor + · have hm' : (3 : ℝ) * K + 4 * k0 + 6 < m + 1 := by exact_mod_cast hm + have hk' : (k : ℝ) ≤ k0 := by exact_mod_cast hk + linarith + · omega + +theorem scaled_taylor_defect_bound {f : E → F} {m K k k0 : ℕ} + (hf : ContDiff ℝ ∞ f) (hm : 3 * K + 4 * k0 + 6 < m + 1) (hk : k ≤ k0) + (y z : E) {C R N : ℝ} (hC : 0 ≤ C) (hR : 0 ≤ R) (hN : 1 ≤ N) + (hzero : ∀ j, j ≤ m → iteratedFDeriv ℝ j f y = 0) + (hbound : ∀ t ∈ Icc (0 : ℝ) 1, + ‖iteratedFDeriv ℝ (m + 1) f (y + t • z)‖ ≤ C) + (hradius : ‖z‖ ≤ R * N ^ (-1 / 3 : ℝ)) : + N ^ ((k : ℝ) + 2) * ‖iteratedFDeriv ℝ k f (y + z)‖ ≤ + C * R ^ (m + 1 - k) * N ^ (-(K : ℝ)) := by + have hkm : k ≤ m := by omega + have hpos : 0 < N := lt_of_lt_of_le zero_lt_one hN + let q : ℕ := m + 1 - k + have ht := vanishing_jet_derivative_bound hf hkm y z C hzero hbound + have hfact : (1 : ℝ) ≤ ((m - k).factorial : ℝ) := by + exact_mod_cast Nat.succ_le_of_lt (Nat.factorial_pos (m - k)) + have hsmall : ‖iteratedFDeriv ℝ k f (y + z)‖ ≤ C * (R * N ^ (-1 / 3 : ℝ)) ^ q := by + calc + _ ≤ C * ‖z‖ ^ q := ht.trans (div_le_self (mul_nonneg hC (pow_nonneg (norm_nonneg _) _)) hfact) + _ ≤ _ := mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (norm_nonneg _) hradius q) hC + have hp : (N ^ (-1 / 3 : ℝ)) ^ q = N ^ (-(q : ℝ) / 3) := by + rw [← Real.rpow_natCast, ← Real.rpow_mul hpos.le] + congr 1 + ring + have he : (k : ℝ) + 2 + (-(q : ℝ) / 3) ≤ -(K : ℝ) := by + have hq : (q : ℝ) = (m : ℝ) + 1 - k := by + dsimp [q] + rw [Nat.cast_sub (by omega), Nat.cast_add, Nat.cast_one] + rw [hq] + have hm' : (3 : ℝ) * K + 4 * k0 + 6 < m + 1 := by exact_mod_cast hm + have hk' : (k : ℝ) ≤ k0 := by exact_mod_cast hk + linarith + calc + _ ≤ N ^ ((k : ℝ) + 2) * (C * (R * N ^ (-1 / 3 : ℝ)) ^ q) := + mul_le_mul_of_nonneg_left hsmall (Real.rpow_nonneg hpos.le _) + _ = C * R ^ q * N ^ ((k : ℝ) + 2 + (-(q : ℝ) / 3)) := by + rw [mul_pow, hp, Real.rpow_add hpos ((k : ℝ) + 2) (-(q : ℝ) / 3)] + ring + _ ≤ _ := mul_le_mul_of_nonneg_left (Real.rpow_le_rpow_of_exponent_le hN he) + (mul_nonneg hC (pow_nonneg hR _)) + +end +end Yau.Waves + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/WaveGerm.lean b/lean/OAI/Geometry/NodalSets/Waves/WaveGerm.lean new file mode 100644 index 0000000000000000000000000000000000000000..bc1ad7a0fd307018ed19819c1b0e75feb4233dda --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/WaveGerm.lean @@ -0,0 +1,37 @@ +import OAI.Geometry.NodalSets.Waves.WaveCenterJets + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Set Filter +open scoped ContDiff Topology +noncomputable section +variable {T : Type*} [TopologicalSpace T] +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} +variable {y : T → Coord} {d : SourceFrameTriple g S y} {m J K k0 : ℕ} +namespace TripleSourceWaveData +variable (b : TripleSourceWaveData g w S y d m J K k0) + +lemma wave_germ (N : ℝ) (hN : 0 < N) (t : T × Fin 3) : + b.wave N t =ᶠ[𝓝 (y t.1)] + (fun x ↦ b.amplitude N t x * Complex.exp ((N:ℂ)*b.phase t x)) := by + have hcut : Yau.Waves.scaledCutoff N (0:Coord) =ᶠ[𝓝 (0:Coord)] (fun _ ↦ 1) := by + filter_upwards [Metric.ball_mem_nhds (0:Coord) (Real.rpow_pos_of_pos hN (-1/3:ℝ))] with z hz + exact Yau.Waves.scaledCutoff_eq_one hN 0 z (by simpa only [Metric.mem_ball,dist_eq_norm] using hz.le) + have hInv : Tendsto ((b.F t).symm : Coord → Coord) (𝓝 (y t.1)) (𝓝 0) := by + have hh := (b.inverse_derivative t).continuousAt + simpa only [ContinuousAt,b.inverse_center] using hh + filter_upwards [chartPushforward_eventually (b.F t) (coordinateWave b.phi b.A J N t) + (y t.1) (b.center_mem_target t),hcut.comp_tendsto hInv] with z hz hc + change chartPushforward (b.F t) (coordinateWave b.phi b.A J N t) z = _ + rw [hz] + change Yau.Waves.scaledCutoff N 0 ((b.F t).symm z) • _ = _ + change Yau.Waves.scaledCutoff N 0 ((b.F t).symm z) = 1 at hc + rw [hc,one_smul] + rfl + +end TripleSourceWaveData +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/WaveHessian.lean b/lean/OAI/Geometry/NodalSets/Waves/WaveHessian.lean new file mode 100644 index 0000000000000000000000000000000000000000..8dbec7db3d3eadb3e88e54ef2e489babf1494b4b --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/WaveHessian.lean @@ -0,0 +1,50 @@ +import OAI.Geometry.NodalSets.Waves.WaveSecondJet + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets +open scoped ContDiff +noncomputable section +attribute [local instance] clmTopology clmAdd clmModule + +lemma sourceHessian_symmetric_at + (g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ) (hg : ContDiff ℝ ∞ g) + (hs : ∀ x u v, g x u v = g x v u) (hp : ∀ x v, v ≠ 0 → 0 < g x v v) + (f : Coord → ℝ) (x : Coord) (hf : ContDiffAt ℝ ∞ f x) (u v : Coord) : + sourceHessian g f x u v = sourceHessian g f x v u := by + simp only [sourceHessian_apply] + rw [hf.isSymmSndFDerivAt + (by simp) u v, + actual_connection_symmetric g hg hs hp x u v] + +variable {T : Type*} [TopologicalSpace T] [CompactSpace T] +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} +variable {y : T → Coord} {d : SourceFrameTriple g S y} {m J K k0 : ℕ} +namespace TripleSourceWaveData +variable (b : TripleSourceWaveData g w S y d m J K k0) + +omit [CompactSpace T] in +theorem phase_hessian + (hg : ContDiff ℝ ∞ g) (hs : ∀ x u v, g x u v = g x v u) + (hp : ∀ x v, v ≠ 0 → 0 < g x v v) (hS : ContDiff ℝ ∞ S) + (hp0 : ∀ t, metricGradient g S (y t) ≠ 0) (t : T × Fin 3) (u v : Coord) : + sourceHessian g (fun z ↦ (b.phase t z).re) (y t.1) u v = + sourceHessian g S (y t.1) u v - + sourceDirectionEta (g (y t.1)) (sourceHessian g S (y t.1)) + (metricGradient g S (y t.1)) (d.q t.1 t.2) * g (y t.1) u v := by + have hu := b.phase_second hg hs hp hS hp0 t u + have hv := b.phase_second hg hs hp hS hp0 t v + have huv := b.phase_second hg hs hp hS hp0 t (u+v) + have hsym := sourceHessian_symmetric_at g hg hs hp (fun z ↦ (b.phase t z).re) (y t.1) + (Complex.reCLM.contDiff.contDiffAt.comp _ (b.phase_smooth_at_center t)) v u + have hSsym := sourceHessian_symmetric_at g hg hs hp S (y t.1) hS.contDiffAt v u + simp only [map_add,add_apply] at huv + rw [hsym,hSsym,hs (y t.1) v u] at huv + nlinarith + +end TripleSourceWaveData +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/WaveJetAssembly.lean b/lean/OAI/Geometry/NodalSets/Waves/WaveJetAssembly.lean new file mode 100644 index 0000000000000000000000000000000000000000..5c4068e0b2c91b87e27ad7c158af5e5ce068a4be --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/WaveJetAssembly.lean @@ -0,0 +1,96 @@ +import OAI.Geometry.NodalSets.Elliptic.EikonalPolynomial + +namespace OAI + +namespace Yau.Jets +open MvPolynomial +noncomputable section + +def beamVector (g : Fin 4 → Fin 4 → CPoly) (phi : CPoly) (i : Fin 4) : CPoly := + C 2 * ∑ j, g i j * pderiv j phi + +def beamScalar (g : Fin 4 → Fin 4 → CPoly) (b : Fin 4 → CPoly) (phi : CPoly) : CPoly := + polynomialSecondOrder g b phi + C 6 + +lemma beamVector_center (v : Fin 4 → ℂ) (g : Fin 4 → Fin 4 → CPoly) + (hmetric : ∀ i j, homogeneousComponent 0 (g i j) = if i = j then 1 else 0) + (phi : CPoly) (hfirst : ∀ i, pderiv i (homogeneousComponent 1 phi) = C (v i)) : + ∀ i, homogeneousComponent 0 (beamVector g phi i) = C (2 * v i) := by + intro i + have hc0 (a b : CPoly) : homogeneousComponent 0 (a * b) = + homogeneousComponent 0 a * homogeneousComponent 0 b := by + simpa using homogeneousComponent_mul a b 0 + unfold beamVector + rw [homogeneousComponent_C_mul, map_sum] + simp only [hc0, homogeneousComponent_pderiv, Nat.zero_add, hfirst, hmetric, + ite_mul, one_mul, zero_mul, Finset.sum_ite_eq, Finset.mem_univ, ite_true, map_mul] + +theorem polynomial_transport_hierarchy (w : Fin 4 → ℂ) (hw : w ≠ 0) + (W : Fin 4 → CPoly) (hW : ∀ i, homogeneousComponent 0 (W i) = C (w i)) + (c : CPoly) (g : Fin 4 → Fin 4 → CPoly) (b : Fin 4 → CPoly) (m J : ℕ) : + ∃ P : ℕ → CPoly, + (∀ j, homogeneousComponent 0 (P j) = if j = 0 then 1 else 0) ∧ + (∀ j k, m + 1 + 2 * (J - j) < k → homogeneousComponent k (P j) = 0) ∧ + (∀ n, n < m + 1 + 2 * J → homogeneousComponent n (polynomialTransport W c 0 (P 0)) = 0) ∧ + ∀ j, j < J → ∀ n, n < m + 1 + 2 * (J - (j + 1)) → + homogeneousComponent n (polynomialTransport W c (-polynomialSecondOrder g b (P j)) + (P (j + 1))) = 0 := by + obtain ⟨P, hzero, hdeg, hfirst, hnext⟩ := finite_transport_polynomials w hw + (fun r i ↦ homogeneousComponent r (W i)) (polynomialJet c) + (fun r i j ↦ homogeneousComponent r (g i j)) (fun r i ↦ homogeneousComponent r (b i)) m J + refine ⟨P, hzero, hdeg, ?_, ?_⟩ + · intro n hn + rw [← transportCoefficient_eq w W hW c 0 (P 0) n] + have hz : polynomialJet (0 : CPoly) = (0 : Jet) := funext (fun k ↦ map_zero _) + rw [hz] + exact hfirst n hn + · intro j hj n hn + rw [← transportCoefficient_eq w W hW c (-polynomialSecondOrder g b (P j)) (P (j + 1)) n] + have hforce : polynomialJet (-polynomialSecondOrder g b (P j)) = + fun k ↦ -secondOrderCoefficient (fun r i j ↦ homogeneousComponent r (g i j)) + (fun r i ↦ homogeneousComponent r (b i)) (polynomialJet (P j)) k := by + funext k + rw [secondOrderCoefficient_eq] + exact map_neg (homogeneousComponent k) _ + rw [hforce] + exact hnext j hj n hn + +theorem polynomial_wave_jets (v : Fin 4 → ℂ) (hv : v ≠ 0) + (g : Fin 4 → Fin 4 → CPoly) (b : Fin 4 → CPoly) + (hmetric : ∀ i j, homogeneousComponent 0 (g i j) = if i = j then 1 else 0) + (initial : Jet) (hi : ∀ k, (initial k).IsHomogeneous k) + (hfirst : ∀ i, pderiv i (initial 1) = C (v i)) + (hcenter : (∑ i, v i * v i) + 4 = 0) + (hsecond : eikonalCoefficient v (fun r i j ↦ homogeneousComponent r (g i j)) 0 initial = 0) + (m J : ℕ) : + ∃ (phi : CPoly) (A : ℕ → CPoly), + (∀ k, k ≤ 2 → homogeneousComponent k phi = initial k) ∧ + (∀ d, m + 2 * J + 3 < d → homogeneousComponent d phi = 0) ∧ + (∀ d, d ≤ m + 2 * J + 2 → homogeneousComponent d (polynomialEikonal g phi) = 0) ∧ + (∀ j, homogeneousComponent 0 (A j) = if j = 0 then 1 else 0) ∧ + (∀ j k, m + 1 + 2 * (J - j) < k → homogeneousComponent k (A j) = 0) ∧ + (∀ n, n < m + 1 + 2 * J → + homogeneousComponent n (polynomialTransport (beamVector g phi) (beamScalar g b phi) 0 (A 0)) = 0) ∧ + ∀ j, j < J → ∀ n, n < m + 1 + 2 * (J - (j + 1)) → + homogeneousComponent n (polynomialTransport (beamVector g phi) (beamScalar g b phi) + (-polynomialSecondOrder g b (A j)) (A (j + 1))) = 0 := by + obtain ⟨phi, hkeep, hdegree, heik⟩ := polynomial_eikonal_jets v hv g hmetric initial hi hfirst + hcenter hsecond (m + 2 * J + 1) + have hf : ∀ i, pderiv i (homogeneousComponent 1 phi) = C (v i) := by + intro i + rw [show homogeneousComponent 1 phi = initial 1 from hkeep 1 (by omega), hfirst] + have hv2 : (fun i ↦ 2 * v i) ≠ (0 : Fin 4 → ℂ) := by + intro h + apply hv + funext i + have := congrFun h i + simpa using this + obtain ⟨A, hA0, hAd, hAfirst, hAnext⟩ := polynomial_transport_hierarchy (fun i ↦ 2 * v i) hv2 + (beamVector g phi) (beamVector_center v g hmetric phi hf) (beamScalar g b phi) g b m J + exact ⟨phi, A, hkeep, by simpa [Nat.add_assoc] using hdegree, + by simpa [Nat.add_assoc] using heik, hA0, hAd, hAfirst, hAnext⟩ + +end +end Yau.Jets + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/WaveSecondJet.lean b/lean/OAI/Geometry/NodalSets/Waves/WaveSecondJet.lean new file mode 100644 index 0000000000000000000000000000000000000000..61dfd1eee7411f3be931080c0d8885912a5c18cc --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/WaveSecondJet.lean @@ -0,0 +1,95 @@ +import OAI.Geometry.NodalSets.Charts.ContactGeometry +import OAI.Geometry.NodalSets.Coefficients.CoefficientLocality +import OAI.Geometry.NodalSets.Elliptic.CommonLocalExtension +import OAI.Geometry.NodalSets.Waves.WaveCenterJets + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Set Filter +open scoped ContDiff Topology +noncomputable section +attribute [local instance] clmTopology clmAdd clmModule +variable {T : Type*} [TopologicalSpace T] [CompactSpace T] +variable {g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ} {w S : Coord → ℝ} +variable {y : T → Coord} {d : SourceFrameTriple g S y} {m J K k0 : ℕ} +namespace TripleSourceWaveData +variable (b : TripleSourceWaveData g w S y d m J K k0) + +omit [CompactSpace T] in +theorem phase_second + (hg : ContDiff ℝ ∞ g) (hs : ∀ x u v, g x u v = g x v u) + (hp : ∀ x v, v ≠ 0 → 0 < g x v v) (hS : ContDiff ℝ ∞ S) + (hp0 : ∀ t, metricGradient g S (y t) ≠ 0) (t : T × Fin 3) (v : Coord) : + sourceHessian g (fun z ↦ (b.phase t z).re) (y t.1) v v = + sourceHessian g S (y t.1) v v - + sourceDirectionEta (g (y t.1)) (sourceHessian g S (y t.1)) + (metricGradient g S (y t.1)) (d.q t.1 t.2) * g (y t.1) v v := by + let f : Coord → ℝ := fun z ↦ (b.phase t z).re + have hf : ContDiffOn ℝ ∞ f (b.F t).target := by + intro z hz + exact (Complex.reCLM.contDiff.contDiffAt.comp z + ((reval_contDiff _).contDiffAt.comp z + ((b.chart_domain t).2.2.contDiffAt ((b.F t).open_target.mem_nhds hz)))).contDiffWithinAt + obtain ⟨r,A,hr,hA,_,_,_,_,hAe⟩ := common_local_smooth_extension + (b.F t).open_target f hf (b.center_mem_target t) + have hAf : A =ᶠ[𝓝 (y t.1)] f := hAe _ (Metric.mem_ball_self hr) + let Q : Coord → Coord := actualMetricChart g (y t.1) (d.frame t) + have hQ : ContDiff ℝ ∞ Q := quadraticChartMap_smooth _ _ _ + have hQ0 : Q 0 = y t.1 := quadraticChartMap_zero _ _ _ + have heF : (b.F t : Coord → Coord) = Q := b.chart_eq t + have hAQ : (A ∘ Q) =ᶠ[𝓝 (0:Coord)] (fun z ↦ (reval (b.phi t) z).re) := by + have hmap : Tendsto Q (𝓝 0) (𝓝 (y t.1)) := by simpa only [ContinuousAt,hQ0] using (hQ.continuous.continuousAt (x := 0)) + filter_upwards [hAf.comp_tendsto hmap,(b.F t).open_source.mem_nhds (b.zero_mem_source t)] with z hz hzs + change A (Q z) = _ + change A (Q z) = f (Q z) at hz + rw [hz] + change (reval (b.phi t) ((b.F t).symm (Q z))).re = _ + rw [← heF,(b.F t).left_inv hzs] + have hHess : sourceHessian g A (y t.1) = sourceHessian g f (y t.1) := + (sourceHessian_eventuallyEq (Filter.EventuallyEq.refl (𝓝 (y t.1)) g) hAf).self_of_nhds + let a := sourceTripleAlpha g S y t + let bb := sourceTripleBeta g S y t + let H := envelopeHessian (S ∘ Q) + have ha : a ≠ 0 := ne_of_gt (Real.sqrt_pos.mpr (hp (y t.1) (metricGradient g S (y t.1)) (hp0 t.1))) + have hb : bb ≠ 0 := by + apply ne_of_gt + apply Real.sqrt_pos.mpr + have hh := hp (y t.1) (metricGradient g S (y t.1)) (hp0 t.1) + linarith + have hSQ : ContDiff ℝ ∞ (S ∘ Q) := hS.comp hQ + have hj := retained_normal_phase_derivatives (b.phi t) (S (y t.1)) a bb H ha hb + (envelopeHessian_symmetric _ hSQ) (b.jets.phase_retained t) + have heta : Yau.contactEta a bb (H 0 0) (H 1 1) = + sourceDirectionEta (g (y t.1)) (sourceHessian g S (y t.1)) + (metricGradient g S (y t.1)) (d.q t.1 t.2) := by + dsimp [H,Q] + rw [charted_envelope_hessian g hg hs hp S hS,charted_envelope_hessian g hg hs hp S hS] + exact source_eta_of_adapted_frame _ _ _ (d.frame_orthonormal t) _ _ a bb + (d.frame_first (fun t ↦ hp (y t)) hp0 t) (d.frame_second (fun t ↦ hp (y t)) hp0 t) + let u := (d.frame t).symm v + have hsum : (∑ i, ∑ j, H i j*u i*u j) = sourceHessian g S (y t.1) v v := by + rw [← envelopeHessian_diagonal] + simpa only [u,Q,ContinuousLinearEquiv.apply_symm_apply] using + scalar_chart_covariant_diagonal g hg hs hp S hS (y t.1) (d.frame t) u + have hnorm : (∑ i, (u i)^2) = g (y t.1) v v := by + simpa only [u,Q,ContinuousLinearEquiv.apply_symm_apply] using + (orthonormal_frame_norm_sq (g (y t.1)) (d.frame t) (d.frame_orthonormal t) u).symm + calc + _ = sourceHessian g A (y t.1) v v := by rw [hHess] + _ = iteratedFDeriv ℝ 2 (A ∘ Q) 0 (fun _ ↦ u) := by + simpa only [u,Q,ContinuousLinearEquiv.apply_symm_apply] using + (scalar_chart_covariant_diagonal g hg hs hp A hA (y t.1) (d.frame t) u).symm + _ = iteratedFDeriv ℝ 2 (fun z ↦ (reval (b.phi t) z).re) 0 (fun _ ↦ u) := by + rw [(hAQ.iteratedFDeriv ℝ 2).self_of_nhds] + _ = (iteratedFDeriv ℝ 2 (reval (b.phi t)) 0 (fun _ ↦ u)).re := by + exact congrArg (fun L : Coord [×2]→L[ℝ] ℝ ↦ L (fun _ ↦ u)) + (Complex.reCLM.iteratedFDeriv_comp_left (reval_contDiff _).contDiffAt + (by change (↑(2:ℕ∞):ℕ∞ω) ≤ ↑(⊤:ℕ∞); exact WithTop.coe_le_coe.mpr le_top)) + _ = _ := by rw [hj.2.2 u,hsum,hnorm,heta] + +end TripleSourceWaveData +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/WaveSize.lean b/lean/OAI/Geometry/NodalSets/Waves/WaveSize.lean new file mode 100644 index 0000000000000000000000000000000000000000..c8a77db4a0bb69a7e6a2b71a06b29760c4bdd63f --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/WaveSize.lean @@ -0,0 +1,80 @@ +import OAI.Geometry.NodalSets.Elliptic.CutoffProduct +import OAI.Geometry.NodalSets.Waves.ExponentialWaveBounds + +namespace OAI + +namespace Yau.Jets +open scoped ContDiff +noncomputable section + +lemma mul_derivative_power_bound {f u : Coord → ℂ} + (hf : ContDiff ℝ ∞ f) (hu : ContDiff ℝ ∞ u) (k : ℕ) (x : Coord) + {A B N w : ℝ} (hA : 0 ≤ A) (hN : 0 ≤ N) + (hfa : ∀ j, j ≤ k → ‖iteratedFDeriv ℝ j f x‖ ≤ A * N ^ j) + (hub : ∀ j, j ≤ k → ‖iteratedFDeriv ℝ j u x‖ ≤ B * N ^ j * w) : + ‖iteratedFDeriv ℝ k (fun z ↦ f z * u z) x‖ ≤ (2 : ℝ) ^ k * A * B * N ^ k * w := by + have h := norm_iteratedFDeriv_mul_le hf hu x (n := k) + (by exact_mod_cast (show (k : ℕ∞) ≤ ⊤ from le_top)) + calc + _ ≤ _ := h + _ ≤ ∑ j ∈ Finset.range (k + 1), (k.choose j : ℝ) * (A * B * N ^ k * w) := by + apply Finset.sum_le_sum + intro j hj + have hjk : j ≤ k := by have := Finset.mem_range.mp hj; omega + have hm := mul_le_mul (hfa j hjk) (hub (k - j) (Nat.sub_le _ _)) + (norm_nonneg _) (mul_nonneg hA (pow_nonneg hN _)) + have he : (A * N ^ j) * (B * N ^ (k - j) * w) = A * B * N ^ k * w := by + rw [show (A * N ^ j) * (B * N ^ (k - j) * w) = + A * B * (N ^ j * N ^ (k - j)) * w by ring, ← pow_add, Nat.add_sub_of_le hjk] + rw [he] at hm + simpa only [mul_assoc] using mul_le_mul_of_nonneg_left hm (Nat.cast_nonneg (k.choose j)) + _ = _ := by + rw [← Finset.sum_mul] + have he : (∑ j ∈ Finset.range (k + 1), (k.choose j : ℝ)) = (2 : ℝ) ^ k := by + exact_mod_cast Nat.sum_range_choose k + rw [he] + ring + +theorem cutoff_wave_size (k : ℕ) : ∃ B > 0, ∀ (phi a : Coord → ℂ), + ContDiff ℝ ∞ phi → ContDiff ℝ ∞ a → ∀ (y x : Coord) (N A D S c : ℝ), + 1 ≤ N → 0 ≤ A → 1 ≤ D → + (∀ j, j ≤ k → ‖iteratedFDeriv ℝ j a x‖ ≤ A) → + (∀ j, 1 ≤ j → j ≤ k → ‖iteratedFDeriv ℝ j phi x‖ ≤ D) → + (phi x).re - S ≤ -c * ‖x - y‖ ^ 2 → + ‖iteratedFDeriv ℝ k (fun z ↦ Yau.Waves.scaledCutoff N y z • + (a z * waveExp phi N z)) x‖ ≤ + B * A * (k.factorial : ℝ) * D ^ k * N ^ k * + Real.exp (N * S - c * N * ‖x - y‖ ^ 2) := by + obtain ⟨B, hB, hcut⟩ := Yau.Waves.cutoff_preserves_derivative_exponent (E := Coord) (F := ℂ) k + refine ⟨(2 : ℝ) ^ k * B * (2 : ℝ) ^ k, by positivity, ?_⟩ + intro phi a hp ha y x N A D S c hN hA hD hamp hphase hgap + let w := Real.exp (N * S - c * N * ‖x - y‖ ^ 2) + let Q := (k.factorial : ℝ) * D ^ k + have hQ : 0 ≤ Q := by dsimp [Q]; positivity + have hw : 0 ≤ w := (Real.exp_pos _).le + have he (j : ℕ) (hj : j ≤ k) : ‖iteratedFDeriv ℝ j (waveExp phi N) x‖ ≤ Q * N ^ j * w := by + apply (waveExp_gaussian_derivative_bound hp j x hD hN + (fun i hi hij ↦ hphase i hi (hij.trans hj)) hgap).trans + have hfact : (j.factorial : ℝ) ≤ k.factorial := by exact_mod_cast Nat.factorial_le hj + have hpow : D ^ j ≤ D ^ k := pow_le_pow_right₀ hD hj + dsimp [Q, w] + gcongr + have hau (j : ℕ) (hj : j ≤ k) : + ‖iteratedFDeriv ℝ j (fun z ↦ a z * waveExp phi N z) x‖ ≤ + ((2 : ℝ) ^ k * A * Q) * N ^ j * w := by + apply (mul_derivative_power_bound ha (waveExp_contDiff hp N) j x hA + (le_trans zero_le_one hN) _ (fun i hi ↦ he i (hi.trans hj))).trans + · have hp2 : (2 : ℝ) ^ j ≤ 2 ^ k := pow_le_pow_right₀ (by norm_num) hj + gcongr + · intro i hi + exact (hamp i (hi.trans hj)).trans (le_mul_of_one_le_right hA (one_le_pow₀ hN)) + have h := hcut N hN y x (fun z ↦ a z * waveExp phi N z) (ha.mul (waveExp_contDiff hp N)) + ((2 : ℝ) ^ k * A * Q) w (by positivity) hw hau + convert h using 1 + dsimp [Q, w] + ring + +end +end Yau.Jets + +end OAI diff --git a/lean/OAI/Geometry/NodalSets/Waves/WitnessedEuclideanWaves.lean b/lean/OAI/Geometry/NodalSets/Waves/WitnessedEuclideanWaves.lean new file mode 100644 index 0000000000000000000000000000000000000000..7cb89c745405a65341a59eb34fb6b1cbf292d9af --- /dev/null +++ b/lean/OAI/Geometry/NodalSets/Waves/WitnessedEuclideanWaves.lean @@ -0,0 +1,69 @@ +import OAI.Geometry.NodalSets.Elliptic.CoordinateNorm +import OAI.Geometry.NodalSets.Waves.ConstructedSourceWavesLemmas + +namespace OAI + +namespace Yau.Geometry +open Yau.Jets Filter Set +open scoped ContDiff Topology +noncomputable section +variable {T : Type*} [TopologicalSpace T] [CompactSpace T] + +theorem witnessed_source_wave_estimates_euclidean + (g : Coord → Coord →L[ℝ] Coord →L[ℝ] ℝ) (hg : ContDiff ℝ ∞ g) + (hs : ∀ x u v, g x u v = g x v u) (hpos : ∀ x v, v ≠ 0 → 0 < g x v v) + (w : Coord → ℝ) (hw : ContDiff ℝ ∞ w) (S : Coord → ℝ) (hS : ContDiff ℝ ∞ S) + (y : T → Coord) (hy : Continuous y) (e : T → Coord ≃L[ℝ] Coord) + (he : Continuous (fun t ↦ (e t).toContinuousLinearMap)) + (ho : ∀ t i j, g (y t) (e t (Pi.single i 1)) (e t (Pi.single j 1)) = if i=j then 1 else 0) + {U : Set Coord} (hU : IsOpen U) (hyU : ∀ t, y t ∈ U) (hwpos : ∀ x ∈ U, 0 < w x) + (q : T → Coord) (a bb : T → ℝ) (ha : Continuous a) (hbb : Continuous bb) + (ha0 : ∀ t, a t ≠ 0) (hb0 : ∀ t, bb t ≠ 0) (hlen : ∀ t, bb t^2 = a t^2+4) + (hap : ∀ t, a t • e t (Pi.single 0 1) = metricGradient g S (y t)) + (hbq : ∀ t, bb t • e t (Pi.single 1 1) = q t) + (hstrict : ∀ t, 0 < sourceHessian g S (y t) (metricGradient g S (y t)) (metricGradient g S (y t)) + + sourceHessian g S (y t) (q t) (q t)) (m J : ℕ) (K k0 : ℕ) (hm : 3*K+4*k0+6 < m+1) (hJ : K+k0+1 ≤ J) : + ∃ (beta : ContDiffBump (0:Coord)) (phi : T → CPoly) (A : ℕ → T → CPoly) + (F : T → OpenPartialHomeomorph Coord Coord) (c Cw Cr R r d : ℝ), + 0 < c ∧ 0 < Cw ∧ 0 < Cr ∧ 0 < R ∧ 0 < r ∧ 0 < d ∧ + MetricWaveJetFamily (extendedPrincipal g y e beta) (extendedDrift g w y e beta) + (fun t ↦ S (y t)) a bb + (fun t ↦ envelopeHessian (S ∘ actualMetricChart g (y t) (e t))) m J phi A ∧ + (∀ t, (F t : Coord → Coord) = actualMetricChart g (y t) (e t)) ∧ + (∀ t, (F t).source = Metric.ball 0 r ∧ Metric.closedBall (y t) d ⊆ (F t).target ∧ + ContDiffOn ℝ ∞ (F t).symm (F t).target) ∧ + ∀ᶠ n : ℕ in atTop, ∀ t, + let V := chartPushforward (F t) (coordinateWave phi A J (n:ℝ) t) + ContDiff ℝ ∞ V ∧ HasCompactSupport V ∧ + tsupport V ⊆ {z | sourceEuclideanNorm (z-y t) ≤ R*(n:ℝ)^(-1/3:ℝ)} ∧ + ∀ z : Coord, + (∀ k : Fin (k0+1), ‖iteratedFDeriv ℝ k.val V z‖ ≤ + Cw*(n:ℝ)^k.val*Real.exp ((n:ℝ)*S z-c*(n:ℝ)*(sourceEuclideanNorm (z-y t))^2)) ∧ + DerivativeBound k0 (fun z ↦ sourceWeightedOperator g w V z + + ((4:ℂ)*(n:ℂ)^2+6*(n:ℂ))*V z) z + (Cr*(n:ℝ)^(-(K:ℝ))*Real.exp ((n:ℝ)*S z)) := by + obtain ⟨beta,phi,A,F,c,Cw,Cr,R,r,d,hc,hCw,hCr,hR,hr,hd,hjets,hFe,hdom,hest⟩ := witnessed_source_wave_estimates + g hg hs hpos w hw S hS y hy e he ho hU hyU hwpos q a bb ha hbb ha0 hb0 hlen hap hbq hstrict + m J K k0 hm hJ + refine ⟨beta,phi,A,F,c/4,Cw,Cr,2*R,r,d,by positivity,hCw,hCr,by positivity,hr,hd,hjets,hFe,hdom,?_⟩ + filter_upwards [hest] with n hn + intro t + obtain ⟨hsm,hcomp,hsup,hbounds⟩ := hn t + refine ⟨hsm,hcomp,?_,?_⟩ + · intro z hz + have hzsup : ‖z-y t‖ ≤ R*(n:ℝ)^(-1/3:ℝ) := by simpa only [Metric.mem_closedBall,dist_eq_norm] using hsup hz + calc + _ ≤ 2*‖z-y t‖ := sourceEuclideanNorm_le _ + _ ≤ 2*(R*(n:ℝ)^(-1/3:ℝ)) := mul_le_mul_of_nonneg_left hzsup (by norm_num) + _ = _ := by ring + · intro z + refine ⟨?_,(hbounds z).2⟩ + intro k + apply ((hbounds z).1 k).trans + have he := gaussian_source_euclidean (z-y t) c (n:ℝ) (S z) hc.le (by positivity) + exact mul_le_mul_of_nonneg_left he (by positivity) + +end +end Yau.Geometry + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/ActualFiberFirstMoment.lean b/lean/OAI/Geometry/Perimeter/Regularity/ActualFiberFirstMoment.lean new file mode 100644 index 0000000000000000000000000000000000000000..49f6a019771e190d29e5831cc3d8f7d2f12ff160 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/ActualFiberFirstMoment.lean @@ -0,0 +1,135 @@ +import OAI.Geometry.Perimeter.Regularity.PhaseMomentLimit +import OAI.Geometry.Perimeter.Regularity.ActualFluxWindowLimit + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff Convolution InnerProductSpace +namespace RPISingularHarnack +open RPI.Boundary ContinuousLinearMap +variable {n : ℕ} + +theorem fiber_flux_first_moment {q : ℝ → ℝ} (hq : ContDiff ℝ 1 q) + {l u : ℝ} (hl : q l=1) (hu : q u=0) : + (∫ s in l..u, s*(-deriv q s)) = l+∫ s in l..u, q s := by + have h := intervalIntegral.integral_deriv_mul_eq_sub (a := l) (b := u) + (fun s _ ↦ hasDerivAt_id s) (fun s _ ↦ (hq.differentiable (by simp) s).hasDerivAt) + (continuous_const.intervalIntegrable _ _) (hq.continuous_deriv le_rfl |>.intervalIntegrable _ _) + simp only [one_mul,hu,hl,mul_zero,mul_one,zero_sub,id_eq] at h + have hi : IntervalIntegrable (fun s ↦ s*deriv q s) volume l u := + (continuous_id.mul (hq.continuous_deriv le_rfl)).intervalIntegrable _ _ + rw [intervalIntegral.integral_add (hq.continuous.intervalIntegrable _ _) hi] at h + simp_rw [mul_neg,intervalIntegral.integral_neg] + linarith + +theorem mollifiedNormalProfile_cap_values {E : Set (Euc n)} + {v : Euc n} (hv : ‖v‖ = 1) {k : Euc n → ℝ} (hu : ∫ x, k x=1) + {a b ε R : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) (hab : a+ε < b) + (hs : Function.support k ⊆ Metric.ball 0 ε) + (hphase : ∀ᵐ x ∂volume, x ∈ Metric.ball 0 R → a < |inner ℝ v x| → + (x ∈ E ↔ inner ℝ v x < 0)) + (y : normalPlane v) (hy : ‖y‖+b+ε ≤ R) : + mollifiedNormalProfile E k v y (-b)=1 ∧ mollifiedNormalProfile E k v y b=0 := by + constructor + · apply phaseMollification_lower_cap hv hu ha hs hphase + · have h := norm_add_le (y:Euc n) ((-b)•v) + rw [norm_smul,hv,mul_one,Real.norm_eq_abs,abs_neg,abs_of_nonneg hb] at h + change ‖(y:Euc n)‖+b+ε ≤ R at hy + linarith + · rw [normal_fiber_inner hv]; linarith + · apply phaseMollification_upper_cap hv ha hs hphase + · have h := norm_add_le (y:Euc n) (b•v) + rw [norm_smul,hv,mul_one,Real.norm_eq_abs,abs_of_nonneg hb] at h + change ‖(y:Euc n)‖+b+ε ≤ R at hy + linarith + · rw [normal_fiber_inner hv]; exact hab + +theorem mollified_fiber_weighted_first_moment {E : Set (Euc n)} (hE : MeasurableSet E) + {v : Euc n} (hv : ‖v‖ = 1) {φ : normalPlane v → ℝ} + (hφ : Continuous φ) (hcφ : HasCompactSupport φ) + {k : Euc n → ℝ} (hk : ContDiff ℝ ∞ k) (hc : HasCompactSupport k) + (hu : ∫ x, k x = 1) {a b ε R : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) (hab : a+ε < b) + (hs : Function.support k ⊆ Metric.ball 0 ε) + (hphase : ∀ᵐ x ∂volume, x ∈ Metric.ball 0 R → a < |inner ℝ v x| → + (x ∈ E ↔ inner ℝ v x < 0)) + (hKR : ∀ y ∈ tsupport φ, ‖y‖+b+ε ≤ R) : + (∫ x, normalWindowTest v φ b 1 x * (-fderiv ℝ (phaseMollification E k) x v)) = + ∫ y in tsupport φ, φ y*(-b+∫ s in (-b)..b, phaseMollification E k ((y:Euc n)+s•v)) := by + have hd := ((phaseMollification_contDiff hE hk hc).continuous_fderiv (by simp)).clm_apply + (g := fun _ ↦ v) continuous_const + have hi := normalWindowTest_integral hv hφ hcφ hb 1 hd.neg + dsimp only [Pi.neg_apply] at hi + rw [hi] + apply setIntegral_congr_fun hcφ.measurableSet + intro y hy + simp only [pow_one] + simp_rw [← mollifiedNormalProfile_deriv hE hk hc v] + have hcap := mollifiedNormalProfile_cap_values hv hu ha hb hab hs hphase y (hKR y hy) + rw [fiber_flux_first_moment ((mollifiedNormalProfile_contDiff hE hk hc v y).of_le (by simp)) + hcap.1 hcap.2] + rfl + +theorem mollified_fiber_weighted_height_tendsto {E : Set (Euc n)} (hE : MeasurableSet E) + {v : Euc n} (hv : ‖v‖ = 1) {φ : normalPlane v → ℝ} + (hφ : Continuous φ) (hcφ : HasCompactSupport φ) {b : ℝ} (hb : 0 ≤ b) : + Tendsto (fun j ↦ ∫ y in tsupport φ, φ y* + (-b+∫ s in (-b)..b, phaseMollification E ((c1Mollifier j).normed volume) + ((y:Euc n)+s•v))) atTop + (𝓝 (∫ y in tsupport φ, φ y*exactFiberHeight E v b y)) := by + apply tendsto_integral_of_dominated_convergence (fun y ↦ ‖φ y‖*b) + · intro j + exact (hφ.mul (continuous_const.add (continuous_profile_integral (v := v) _ + (phaseMollification_contDiff hE (c1Mollifier j).contDiff_normed + (c1Mollifier j).hasCompactSupport_normed).continuous (-b) b))).aestronglyMeasurable + · exact (hφ.continuousOn.integrableOn_compact hcφ).norm.mul_const _ + · intro j + apply ae_of_all + intro y + rw [norm_mul] + apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) + have h := interval_height_abs_le + (((phaseMollification_contDiff hE (c1Mollifier j).contDiff_normed + (c1Mollifier j).hasCompactSupport_normed).continuous.comp + (continuous_const.add (continuous_id.smul continuous_const))).measurable) + hb (fun s ↦ phaseMollification_c1_mem_Icc hE j ((y:Euc n)+s•v)) + exact h + · filter_upwards [ae_restrict_of_ae (mollified_fiber_height_ae_tendsto hE hv hb)] with y hy + exact tendsto_const_nhds.mul hy + +theorem actual_fiber_signed_first_moment (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + {v : Euc n} (hv : ‖v‖ = 1) {φ : normalPlane v → ℝ} + (hφ : Continuous φ) (hcφ : HasCompactSupport φ) + {a b δ R : ℝ} (ha : 0 ≤ a) (hδ : 0 < δ) (hab : a+δ < b) (hR : 0 < R) + (hKR : ∀ y ∈ tsupport φ, ‖y‖+b+δ ≤ R) + (hh : ∀ x ∈ perimeterSupport E ∩ Metric.ball 0 R, |inner ℝ v x| ≤ a) + (hphase : ∀ᵐ x ∂volume, x ∈ Metric.ball 0 R → a < |inner ℝ v x| → + (x ∈ E ↔ inner ℝ v x < 0)) : + (∫ x in Metric.ball 0 R, normalWindowTest v φ b 1 x * + inner ℝ (approximateNormal E x) v ∂perimeterMeasure E) = + ∫ y in tsupport φ, φ y*exactFiberHeight E v b y := by + have hb : 0 ≤ b := by linarith + have hh' : ∀ x ∈ perimeterSupport E ∩ Metric.ball 0 R, |inner ℝ v x| < b := + fun x hx ↦ (hh x hx).trans_lt (by linarith) + have hA := actual_normal_flux_window_tendsto hn hmin hv hφ hcφ hb hδ hR 1 hKR hh' + have hB := mollified_fiber_weighted_height_tendsto hmin.1 hv hφ hcφ hb + apply tendsto_nhds_unique hA + apply hB.congr' + have he : ∀ᶠ j in atTop, (c1Mollifier (n := n) j).rOut < δ := + c1Mollifier_radius_tendsto.eventually (gt_mem_nhds hδ) + filter_upwards [he] with j hj + have hs : Function.support ((c1Mollifier (n := n) j).normed volume) ⊆ Metric.ball 0 δ := by + intro x hx + have hx' := subset_tsupport _ hx + rw [(c1Mollifier j).tsupport_normed_eq] at hx' + exact Metric.closedBall_subset_ball hj hx' + exact (mollified_fiber_weighted_first_moment hmin.1 hv hφ hcφ + (c1Mollifier j).contDiff_normed (c1Mollifier j).hasCompactSupport_normed + (c1Mollifier j).integral_normed ha hb hab hs hphase hKR).symm + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/ActualFiberMoments.lean b/lean/OAI/Geometry/Perimeter/Regularity/ActualFiberMoments.lean new file mode 100644 index 0000000000000000000000000000000000000000..5c88007b90d6a8aa7f9f016238e8a4f4ac5295ce --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/ActualFiberMoments.lean @@ -0,0 +1,86 @@ +import OAI.Geometry.Perimeter.Regularity.ActualFiberSecondMoment +import OAI.Geometry.Perimeter.Regularity.NormalFluxError +import OAI.Geometry.Perimeter.Regularity.ActualFiberFirstMoment + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff Convolution InnerProductSpace +namespace RPISingularHarnack +open RPI.Boundary ContinuousLinearMap +variable {n : ℕ} + +theorem actual_fiber_first_moment_error (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + {v : Euc n} (hv : ‖v‖ = 1) {φ : normalPlane v → ℝ} + (hφ : Continuous φ) (hcφ : HasCompactSupport φ) + {M a b δ R : ℝ} (hM : ∀ y, ‖φ y‖ ≤ M) + (ha : 0 ≤ a) (hδ : 0 < δ) (hab : a+δ < b) (hR : 0 < R) + (hKR : ∀ y ∈ tsupport φ, ‖y‖+b+δ ≤ R) + (hh : ∀ x ∈ perimeterSupport E ∩ Metric.ball 0 R, |inner ℝ v x| ≤ a) + (hphase : ∀ᵐ x ∂volume, x ∈ Metric.ball 0 R → a < |inner ℝ v x| → + (x ∈ E ↔ inner ℝ v x < 0)) : + |(∫ x in Metric.ball 0 R, normalWindowTest v φ b 1 x ∂perimeterMeasure E) - + (∫ y in tsupport φ, φ y*exactFiberHeight E v b y)| ≤ + (M*b/2)*orientedTilt E v (Metric.ball 0 R) := by + rw [← actual_fiber_signed_first_moment hn hmin hv hφ hcφ ha hδ hab hR hKR hh hphase] + have h := normal_flux_error_le_tilt hn hmin hv hR + (normalWindowTest_measurable hφ b 1) + (normalWindowTest_bound hM (by linarith : 0 ≤ b) 1) + simpa only [pow_one,div_mul_eq_mul_div] using h + +theorem actual_fiber_second_moment_error (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + {v : Euc n} (hv : ‖v‖ = 1) {φ : normalPlane v → ℝ} + (hφ : Continuous φ) (hcφ : HasCompactSupport φ) (hpφ : ∀ y, 0 ≤ φ y) + {M a b δ R : ℝ} (hM : ∀ y, ‖φ y‖ ≤ M) + (ha : 0 ≤ a) (hδ : 0 < δ) (hab : a+δ < b) (hR : 0 < R) + (hKR : ∀ y ∈ tsupport φ, ‖y‖+b+δ ≤ R) + (hh : ∀ x ∈ perimeterSupport E ∩ Metric.ball 0 R, |inner ℝ v x| ≤ a) + (hphase : ∀ᵐ x ∂volume, x ∈ Metric.ball 0 R → a < |inner ℝ v x| → + (x ∈ E ↔ inner ℝ v x < 0)) : + |(∫ x in Metric.ball 0 R, normalWindowTest v φ b 2 x ∂perimeterMeasure E) - + (∫ y in tsupport φ, φ y*(exactFiberHeight E v b y)^2)| ≤ + (9/2*b^2*M)*orientedTilt E v (Metric.ball 0 R) := by + have hf := normal_flux_error_le_tilt hn hmin hv hR + (normalWindowTest_measurable hφ b 2) + (normalWindowTest_bound hM (by linarith : 0 ≤ b) 2) + have hs := actual_fiber_signed_second_moment hn hmin hv hφ hcφ hpφ hM + ha hδ hab hR hKR hh hphase + dsimp only at hs + have habs : |(∫ x in Metric.ball 0 R, normalWindowTest v φ b 2 x * + inner ℝ (approximateNormal E x) v ∂perimeterMeasure E) - + (∫ y in tsupport φ, φ y*(exactFiberHeight E v b y)^2)| ≤ + 4*b^2*M*orientedTilt E v (Metric.ball 0 R) := by + rw [abs_of_nonneg hs.1]; exact hs.2 + calc + _ ≤ |(∫ x in Metric.ball 0 R, normalWindowTest v φ b 2 x ∂perimeterMeasure E) - + (∫ x in Metric.ball 0 R, normalWindowTest v φ b 2 x * + inner ℝ (approximateNormal E x) v ∂perimeterMeasure E)| + + |(∫ x in Metric.ball 0 R, normalWindowTest v φ b 2 x * + inner ℝ (approximateNormal E x) v ∂perimeterMeasure E) - + (∫ y in tsupport φ, φ y*(exactFiberHeight E v b y)^2)| := abs_sub_le _ _ _ + _ ≤ (M*b^2/2)*orientedTilt E v (Metric.ball 0 R) + + 4*b^2*M*orientedTilt E v (Metric.ball 0 R) := add_le_add (by simpa only [div_mul_eq_mul_div] using hf) habs + _ = _ := by ring + +theorem normalized_second_moment_defect_tendsto_zero + (A B a e : ℕ → ℝ) {C : ℝ} (hC : 0 ≤ C) + (ha : ∀ i, 0 < a i) (he : Tendsto e atTop (𝓝 0)) + (hbound : ∀ i, |A i-B i| ≤ C*(a i)^2*e i) : + Tendsto (fun i ↦ (A i-B i)/(a i)^2) atTop (𝓝 0) := by + apply squeeze_zero_norm (fun i ↦ ?_) (by simpa using he.norm.const_mul C) + rw [Real.norm_eq_abs,abs_div,abs_of_pos (sq_pos_of_pos (ha i))] + apply (div_le_iff₀ (sq_pos_of_pos (ha i))).mpr + calc + |A i-B i| ≤ C*(a i)^2*e i := hbound i + _ ≤ C*(a i)^2*‖e i‖ := + mul_le_mul_of_nonneg_left (le_abs_self _) (mul_nonneg hC (sq_nonneg _)) + _ = C*‖e i‖*(a i)^2 := by ring + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/ActualFiberSecondMoment.lean b/lean/OAI/Geometry/Perimeter/Regularity/ActualFiberSecondMoment.lean new file mode 100644 index 0000000000000000000000000000000000000000..bc96a524ba625c8fa022272e2d58db40486d7bfc --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/ActualFiberSecondMoment.lean @@ -0,0 +1,67 @@ +import OAI.Geometry.Perimeter.Regularity.WeightedFiberMoment +import OAI.Geometry.Perimeter.Regularity.WeightedWrongWayFlux + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff Convolution InnerProductSpace +namespace RPISingularHarnack +open RPI.Boundary ContinuousLinearMap +variable {n : ℕ} + +theorem actual_fiber_signed_second_moment (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + {v : Euc n} (hv : ‖v‖ = 1) {φ : normalPlane v → ℝ} + (hφ : Continuous φ) (hcφ : HasCompactSupport φ) (hpφ : ∀ y, 0 ≤ φ y) + {M a b δ R : ℝ} (hM : ∀ y, ‖φ y‖ ≤ M) + (ha : 0 ≤ a) (hδ : 0 < δ) (hab : a+δ < b) (hR : 0 < R) + (hKR : ∀ y ∈ tsupport φ, ‖y‖+b+δ ≤ R) + (hh : ∀ x ∈ perimeterSupport E ∩ Metric.ball 0 R, |inner ℝ v x| ≤ a) + (hphase : ∀ᵐ x ∂volume, x ∈ Metric.ball 0 R → a < |inner ℝ v x| → + (x ∈ E ↔ inner ℝ v x < 0)) : + let A := ∫ x in Metric.ball 0 R, normalWindowTest v φ b 2 x * + inner ℝ (approximateNormal E x) v ∂perimeterMeasure E + let B := ∫ y in tsupport φ, φ y*(exactFiberHeight E v b y)^2 + 0 ≤ A-B ∧ A-B ≤ 4*b^2*M*orientedTilt E v (Metric.ball 0 R) := by + dsimp only + have hb : 0 ≤ b := by linarith + have hh' : ∀ x ∈ perimeterSupport E ∩ Metric.ball 0 R, |inner ℝ v x| < b := + fun x hx ↦ (hh x hx).trans_lt (by linarith) + have hA := actual_normal_flux_window_tendsto hn hmin hv hφ hcφ hb hδ hR 2 hKR hh' + have hB := mollified_fiber_weighted_height_square_tendsto hmin.1 hv hφ hcφ hb + have hD := normalWindowTest_diffuse_tendsto_zero hmin.1 hv hφ hcφ b + have he : ∀ᶠ j in atTop, (c1Mollifier (n := n) j).rOut < δ := + c1Mollifier_radius_tendsto.eventually (gt_mem_nhds hδ) + have hdef : ∀ᶠ j in atTop, + let q := phaseMollification E ((c1Mollifier j).normed volume) + let A := ∫ x, normalWindowTest v φ b 2 x * (-fderiv ℝ q x v) + let B := ∫ y in tsupport φ, φ y*(-b+∫ s in (-b)..b, q ((y:Euc n)+s•v))^2 + 0 ≤ A-B ∧ A-B ≤ + 4*b*(∫ x, normalWindowTest v φ b 0 x * (q x*(1-q x))) + + 4*b^2*M*orientedTilt E v (Metric.ball 0 R) := by + filter_upwards [he] with j hj + have hs : Function.support ((c1Mollifier (n := n) j).normed volume) ⊆ Metric.ball 0 δ := by + intro x hx + have hx' := subset_tsupport _ hx + rw [(c1Mollifier j).tsupport_normed_eq] at hx' + exact Metric.closedBall_subset_ball hj hx' + have ht := mollified_fiber_weighted_defect hmin.1 hv hφ hcφ hpφ + (c1Mollifier j).contDiff_normed (c1Mollifier j).hasCompactSupport_normed + (c1Mollifier j).nonneg_normed (c1Mollifier j).integral_normed ha hb hab hs hphase hKR + have hp := weighted_positive_derivative_le_tilt hn hmin hv hφ hcφ hpφ hM hb hR hKR hj + dsimp only at ht ⊢ + refine ⟨ht.1,ht.2.trans ?_⟩ + have hm := mul_le_mul_of_nonneg_left hp (by positivity : 0 ≤ 8*b^2) + nlinarith + refine ⟨ge_of_tendsto (hA.sub hB) (hdef.mono fun j hj ↦ hj.1),?_⟩ + have ht := le_of_tendsto_of_tendsto (hA.sub hB) + ((hD.const_mul (4*b)).add_const (4*b^2*M*orientedTilt E v (Metric.ball 0 R))) + (hdef.mono fun j hj ↦ hj.2) + simpa only [mul_zero,zero_add] using ht + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/ActualFiberZerothMoment.lean b/lean/OAI/Geometry/Perimeter/Regularity/ActualFiberZerothMoment.lean new file mode 100644 index 0000000000000000000000000000000000000000..70c5ad50ea3c49c9e9791184bd42ac30e9e0306c --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/ActualFiberZerothMoment.lean @@ -0,0 +1,90 @@ +import OAI.Geometry.Perimeter.Regularity.NormalFluxError +import OAI.Geometry.Perimeter.Regularity.ActualFiberFirstMoment + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +open RPI.Boundary ContinuousLinearMap +variable {n : ℕ} + +theorem mollified_fiber_weighted_zeroth_moment {E : Set (Euc n)} (hE : MeasurableSet E) + {v : Euc n} (hv : ‖v‖=1) {φ : normalPlane v → ℝ} + (hφ : Continuous φ) (hcφ : HasCompactSupport φ) + {k : Euc n → ℝ} (hk : ContDiff ℝ ∞ k) (hc : HasCompactSupport k) + (hu : ∫ x, k x=1) {a b ε R : ℝ} (ha : 0≤a) (hb : 0≤b) (hab : a+ε] (0 : ℝ)) (𝓝 ((Metric.closedBall c r)ᶜ.indicator (fun _ ↦ (1 : ℝ)) x)) := by + by_cases hx : x ∈ Metric.closedBall c r + · rw [indicator_of_notMem (by simpa using hx)] + apply tendsto_const_nhds.congr' + filter_upwards [self_mem_nhdsWithin] with δ hδ + change 0 < δ at hδ + symm + exact annularCutoff_zero (by simpa using add_pos hr hδ) (by linarith [show 0 < δ from hδ]) + (hx.trans (by linarith : r ≤ r + δ)) + · rw [indicator_of_mem (show x ∈ (Metric.closedBall c r)ᶜ from hx)] + have hd : 0 < (dist x c - r) / 2 := by + have hh : r < dist x c := lt_of_not_ge hx + linarith + apply tendsto_const_nhds.congr' + filter_upwards [self_mem_nhdsWithin, + (nhdsWithin_le_nhds (gt_mem_nhds hd))] with δ hδ hsmall + change 0 < δ at hδ + symm + exact annularCutoff_one (by simpa using add_pos hr hδ) (by linarith [show 0 < δ from hδ]) + (by change δ < (dist x c - r) / 2 at hsmall; linarith) + +theorem integral_divergence_outside_le {n : ℕ} {E U : Set (Euc n)} + {V : Euc n → Euc n} (hV : PerimeterAdmissible U V) {c : Euc n} {r L : ℝ} + (hr : 0 < r) (hL : 0 < L) (hbound : ∀ s, |deriv Real.smoothTransition s| ≤ L) + (hfin : perimeter E (U \ Metric.closedBall c r) ≠ ⊤) : + (∫ x in E \ Metric.closedBall c r, divergence V x) ≤ + (perimeter E (U \ Metric.closedBall c r)).toReal + + 2 * L * n * r ^ (n - 1) * volume.real (Metric.ball (0 : Euc n) 1) := by + have hd := integrable_divergence hV.1 hV.2.1 + have hlim : Tendsto (fun δ : ℝ ↦ ∫ x in E, + annularCutoff c (r + δ) (r + 2 * δ) x * divergence V x) + (𝓝[>] (0 : ℝ)) (𝓝 (∫ x in E \ Metric.closedBall c r, divergence V x)) := by + have ht := tendsto_integral_filter_of_dominated_convergence + (μ := volume.restrict E) (l := 𝓝[>] (0 : ℝ)) + (F := fun δ x ↦ annularCutoff c (r + δ) (r + 2 * δ) x * divergence V x) + (f := (Metric.closedBall c r)ᶜ.indicator (divergence V)) (fun x ↦ ‖divergence V x‖) + (Eventually.of_forall fun δ ↦ + ((annularCutoff_contDiff c (r + δ) (r + 2 * δ)).continuous.mul + (continuous_divergence hV.1)).aestronglyMeasurable) + (Eventually.of_forall fun δ ↦ Eventually.of_forall fun x ↦ by + rw [norm_mul, Real.norm_eq_abs, abs_of_nonneg (annularCutoff_mem_Icc c _ _ x).1] + exact mul_le_of_le_one_left (norm_nonneg _) (annularCutoff_mem_Icc c _ _ x).2) + hd.norm.integrableOn (Eventually.of_forall fun x ↦ ?_) + · simpa only [integral_indicator measurableSet_closedBall.compl, + Measure.restrict_restrict measurableSet_closedBall.compl, inter_comm, ← Set.sdiff_eq] using ht + · convert (annularCutoff_tendsto c x hr).mul + (tendsto_const_nhds (x := divergence V x)) using 1 + by_cases hx : x ∈ (Metric.closedBall c r)ᶜ <;> simp [hx] + have hpow : Tendsto (fun δ : ℝ ↦ + (perimeter E (U \ Metric.closedBall c r)).toReal + + 2 * L * n * (r + 2 * δ) ^ (n - 1) * volume.real (Metric.ball (0 : Euc n) 1)) + (𝓝[>] (0 : ℝ)) (𝓝 ((perimeter E (U \ Metric.closedBall c r)).toReal + + 2 * L * n * r ^ (n - 1) * volume.real (Metric.ball (0 : Euc n) 1))) := by + have hp : ContinuousAt (fun δ : ℝ ↦ + (perimeter E (U \ Metric.closedBall c r)).toReal + + 2 * L * n * (r + 2 * δ) ^ (n - 1) * volume.real (Metric.ball (0 : Euc n) 1)) 0 := by + fun_prop + simpa using hp.tendsto.mono_left nhdsWithin_le_nhds + apply le_of_tendsto_of_tendsto hlim hpow + filter_upwards [self_mem_nhdsWithin] with δ hδ + change 0 < δ at hδ + exact integral_annularCutoff_divergence_le hV (by simpa using add_pos hr hδ) + (by linarith [show 0 < δ from hδ]) (by linarith [show 0 < δ from hδ]) hL hbound hfin + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem perimeter_remove_closedBall_le {n : ℕ} {E U : Set (Euc n)} + {c : Euc n} {r L : ℝ} (hr : 0 < r) (hL : 0 < L) + (hbound : ∀ s, |deriv Real.smoothTransition s| ≤ L) + (hfin : perimeter E (U \ Metric.closedBall c r) ≠ ⊤) : + perimeter (E \ Metric.closedBall c r) U ≤ + perimeter E (U \ Metric.closedBall c r) + + ENNReal.ofReal (2 * L * n * r ^ (n - 1) * volume.real (Metric.ball (0 : Euc n) 1)) := by + rw [perimeter_eq_iSup_tests] + apply iSup_le + intro V + apply iSup_le + intro hV + have h := ENNReal.ofReal_le_ofReal (integral_divergence_outside_le hV hr hL hbound hfin) + rwa [ENNReal.ofReal_add ENNReal.toReal_nonneg (by positivity), ENNReal.ofReal_toReal hfin] at h + +theorem locallyMinimizing_perimeter_growth {n : ℕ} {E : Set (Euc n)} + (hmin : IsLocallyPerimeterMinimizing E) {L : ℝ} (hL : 0 < L) + (hbound : ∀ s, |deriv Real.smoothTransition s| ≤ L) (c : Euc n) {r : ℝ} (hr : 0 < r) : + perimeter E (Metric.ball c r) ≤ + ENNReal.ofReal (2 * L * n * r ^ (n - 1) * volume.real (Metric.ball (0 : Euc n) 1)) := by + let U := Metric.ball c (r + 1) + let F := E \ Metric.closedBall c r + have hout : perimeter E (U \ Metric.closedBall c r) ≠ ⊤ := + ne_top_of_le_ne_top (hmin.2.1 c (r + 1) (by linarith)).ne + (raw_perimeter_mono_region E sdiff_subset) + have hcl : closure (symmDiff E F) ⊆ Metric.closedBall c r := by + apply closure_minimal _ Metric.isClosed_closedBall + intro x hx + by_contra hc + rcases hx with hx | hx + · exact hx.2 ⟨hx.1, hc⟩ + · exact hx.2 hx.1.1 + have hcp : IsCompact (closure (symmDiff E F)) := + (isCompact_closedBall c r).of_isClosed_subset isClosed_closure hcl + have hcmp : perimeter E U ≤ perimeter F U := + hmin.2.2 c (r + 1) (by linarith) F + (hmin.1.diff measurableSet_closedBall) hcp + (hcl.trans (Metric.closedBall_subset_ball (by linarith))) + have hdisj : Disjoint (Metric.ball c r) (U \ Metric.closedBall c r) := by + apply Set.disjoint_left.mpr + intro x hx hy + exact hy.2 (Metric.ball_subset_closedBall hx) + have hsuper := perimeter_disjoint_superadditive E + (show Metric.ball c r ⊆ U from Metric.ball_subset_ball (by linarith)) sdiff_subset hdisj + have hremove := perimeter_remove_closedBall_le (E := E) (U := U) (c := c) hr hL hbound hout + have htotal := hsuper.trans (hcmp.trans hremove) + rw [add_comm (perimeter E (Metric.ball c r))] at htotal + exact (ENNReal.add_le_add_iff_left hout).mp htotal + +theorem exists_locallyMinimizing_perimeter_growth_constant (n : ℕ) (hn : 0 < n) : + ∃ C : ℝ, 0 < C ∧ ∀ E : Set (Euc n), IsLocallyPerimeterMinimizing E → + ∀ (c : Euc n) (r : ℝ), 0 < r → + perimeter E (Metric.ball c r) ≤ ENNReal.ofReal (C * r ^ (n - 1)) := by + obtain ⟨L, hL, hbound⟩ := exists_smoothTransition_deriv_bound + let C := 2 * L * n * volume.real (Metric.ball (0 : Euc n) 1) + refine ⟨C, ?_, ?_⟩ + · unfold C + have hv : 0 < volume.real (Metric.ball (0 : Euc n) 1) := by + rw [measureReal_def, ENNReal.toReal_pos_iff] + exact ⟨Metric.measure_ball_pos volume _ (by norm_num), + (measure_mono Metric.ball_subset_closedBall).trans_lt + (isCompact_closedBall (0 : Euc n) 1).measure_lt_top⟩ + positivity + · intro E hmin c r hr + convert locallyMinimizing_perimeter_growth hmin hL hbound c hr using 1 + unfold C + congr 1 + ring + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +def radialNormalTest {n : ℕ} (v x : Euc n) : Euc n := + (1 - Real.smoothTransition (4 * ‖x‖ ^ 2)) • v + +def radialFlux {n : ℕ} (v x : Euc n) : ℝ := + (8 * deriv Real.smoothTransition (4 * ‖x‖ ^ 2)) * max (-inner ℝ x v) 0 + +theorem radialNormalTest_contDiff {n : ℕ} (v : Euc n) : + ContDiff ℝ ∞ (radialNormalTest v) := by + have hq : ContDiff ℝ ∞ (fun x : Euc n ↦ 4 * ‖x‖ ^ 2) := + contDiff_const.mul (contDiff_id.norm_sq ℝ) + exact (contDiff_const.sub (Real.smoothTransition.contDiff.comp hq)).smul contDiff_const + +theorem radialNormalTest_support {n : ℕ} (v : Euc n) : + tsupport (radialNormalTest v) ⊆ Metric.closedBall 0 (1 / 2) := by + apply closure_minimal + · intro x hx + by_contra h + have hn : 1 / 2 < ‖x‖ := by simpa [Metric.mem_closedBall, dist_zero_right] using h + have hT := Real.smoothTransition.one_of_one_le (show 1 ≤ 4 * ‖x‖ ^ 2 by nlinarith) + exact hx (by simp [radialNormalTest, hT]) + · exact Metric.isClosed_closedBall + +theorem radialNormalTest_admissible {n : ℕ} {v : Euc n} (hv : ‖v‖ = 1) : + PerimeterAdmissible (Metric.ball (0 : Euc n) 1) (radialNormalTest v) := by + refine ⟨radialNormalTest_contDiff v, + (isCompact_closedBall (0 : Euc n) (1 / 2)).of_isClosed_subset (isClosed_tsupport _) + (radialNormalTest_support v), + (radialNormalTest_support v).trans (Metric.closedBall_subset_ball (by norm_num)), ?_⟩ + intro x + rw [radialNormalTest, norm_smul, hv, mul_one, Real.norm_eq_abs, + abs_of_nonneg (sub_nonneg.mpr (Real.smoothTransition.le_one _))] + linarith [Real.smoothTransition.nonneg (4 * ‖x‖ ^ 2)] + +theorem divergence_radialNormalTest {n : ℕ} (v x : Euc n) : + divergence (radialNormalTest v) x = + -(8 * deriv Real.smoothTransition (4 * ‖x‖ ^ 2)) * inner ℝ x v := by + have hq : HasFDerivAt (fun x : Euc n ↦ 4 * ‖x‖ ^ 2) ((8 : ℝ) • innerSL ℝ x) x := by + have h0 : HasFDerivAt (fun x : Euc n ↦ ‖x‖ ^ 2) (2 • innerSL ℝ x) x := by + simpa using (hasFDerivAt_id (𝕜 := ℝ) x).norm_sq + simpa only [two_smul, smul_add, ← add_smul, show (4 : ℝ) + 4 = 8 by norm_num] using h0.const_mul 4 + have hd := ((Real.smoothTransition.contDiff : ContDiff ℝ ∞ _).differentiable + (by norm_num) _).hasDerivAt.comp_hasFDerivAt x hq + have hV := ((hasFDerivAt_const (1 : ℝ) x).sub hd).smul_const v + change HasFDerivAt (radialNormalTest v) _ x at hV + simp only [divergence, hV.fderiv, + ContinuousLinearMap.smulRight_apply, smul_apply, + zero_sub, inner_smul_right, innerSL_apply_apply, + neg_apply, smul_eq_mul] + calc + _ = -(8 * deriv Real.smoothTransition (4 * ‖x‖ ^ 2)) * + ∑ i : Fin n, inner ℝ x ((EuclideanSpace.basisFun (Fin n) ℝ) i) * + inner ℝ ((EuclideanSpace.basisFun (Fin n) ℝ) i) v := by + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro i hi + ring + _ = _ := by rw [(EuclideanSpace.basisFun (Fin n) ℝ).sum_inner_mul_inner] + +theorem radialFlux_eq_indicator {n : ℕ} (v x : Euc n) : + radialFlux v x = {y | inner ℝ y v < 0}.indicator + (divergence (radialNormalTest v)) x := by + by_cases hx : inner ℝ x v < 0 + · rw [Set.indicator_of_mem (show x ∈ {y | inner ℝ y v < 0} from hx), divergence_radialNormalTest] + simp only [radialFlux, max_eq_left (by linarith : 0 ≤ -inner ℝ x v)] + ring + · rw [Set.indicator_of_notMem (show x ∉ {y | inner ℝ y v < 0} from hx)] + simp [radialFlux, max_eq_right (by linarith : -inner ℝ x v ≤ 0)] + +theorem radialFlux_nonneg {n : ℕ} (v x : Euc n) : 0 ≤ radialFlux v x := by + exact mul_nonneg (mul_nonneg (by norm_num) Real.smoothTransition.monotone.deriv_nonneg) + (le_max_right _ _) + +theorem radialFlux_continuous {n : ℕ} : + Continuous (fun p : Euc n × Euc n ↦ radialFlux p.1 p.2) := by + have hT : Continuous (deriv Real.smoothTransition) := + (Real.smoothTransition.contDiff : ContDiff ℝ ∞ _).continuous_deriv (by norm_num) + exact (hT.comp ((continuous_snd.norm.pow 2).const_mul 4)).const_mul 8 |>.mul + (((continuous_snd.inner continuous_fst).neg).max continuous_const) + +theorem radialFlux_support {n : ℕ} (v : Euc n) : + tsupport (radialFlux v) ⊆ Metric.closedBall 0 (1 / 2) := by + apply closure_minimal + · intro x hx + by_contra h + have hn : 1 / 2 < ‖x‖ := by simpa [Metric.mem_closedBall, dist_zero_right] using h + have hT := smoothTransition_deriv_zero_of_one_le (show 1 ≤ 4 * ‖x‖ ^ 2 by nlinarith) + exact hx (by simp [radialFlux, hT]) + · exact Metric.isClosed_closedBall + +theorem radialFlux_integrable {n : ℕ} (v : Euc n) : Integrable (radialFlux v) := by + apply (radialFlux_continuous.comp (continuous_const.prodMk continuous_id)).integrable_of_hasCompactSupport + exact (isCompact_closedBall (0 : Euc n) (1 / 2)).of_isClosed_subset (isClosed_tsupport _) + (radialFlux_support v) + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem integral_radialFlux_pos {n : ℕ} {v : Euc n} (hv : ‖v‖ = 1) : + 0 < ∫ x, radialFlux v x := by + obtain ⟨t, ht, hd⟩ := exists_deriv_eq_slope Real.smoothTransition (by norm_num : (0 : ℝ) < 1) + Real.smoothTransition.continuous.continuousOn + ((Real.smoothTransition.contDiff : ContDiff ℝ ∞ _).differentiable (by norm_num)).differentiableOn + have hd1 : deriv Real.smoothTransition t = 1 := by simpa using hd + let x : Euc n := (-(Real.sqrt t / 2)) • v + have hr : 0 < Real.sqrt t := Real.sqrt_pos.mpr ht.1 + have hnorm : ‖x‖ = Real.sqrt t / 2 := by + simp [x, norm_smul, hv, Real.norm_eq_abs, abs_of_nonneg (le_of_lt hr)] + have hq : 4 * ‖x‖ ^ 2 = t := by + rw [hnorm]; nlinarith [Real.sq_sqrt ht.1.le] + have hi : inner ℝ x v = -(Real.sqrt t / 2) := by + simp [x, inner_smul_left, hv] + apply (radialFlux_continuous.comp (continuous_const.prodMk continuous_id)).integral_pos_of_hasCompactSupport_nonneg_nonzero + ((isCompact_closedBall (0 : Euc n) (1 / 2)).of_isClosed_subset (isClosed_tsupport _) + (radialFlux_support v)) (radialFlux_nonneg v) + change radialFlux v x ≠ 0 + rw [radialFlux, hq, hd1, hi] + have hm : max (- -(Real.sqrt t / 2)) 0 = Real.sqrt t / 2 := by + simp [max_eq_left (show 0 ≤ Real.sqrt t / 2 by positivity)] + rw [hm] + positivity + +theorem continuous_integral_radialFlux {n : ℕ} : + Continuous (fun v : Euc n ↦ ∫ x, radialFlux v x) := by + have heq : (fun v : Euc n ↦ ∫ x, radialFlux v x) = + (fun v ↦ ∫ x in Metric.closedBall 0 (1 / 2), radialFlux v x) := by + funext v + exact (setIntegral_eq_integral_of_forall_compl_eq_zero (fun x hx ↦ + image_eq_zero_of_notMem_tsupport (fun h ↦ hx (radialFlux_support v h)))).symm + rw [heq] + exact continuous_parametric_integral_of_continuous radialFlux_continuous + (isCompact_closedBall (0 : Euc n) (1 / 2)) + +theorem exists_uniform_radialFlux_lower (n : ℕ) (hn : 0 < n) : + ∃ c : ℝ, 0 < c ∧ ∀ v : Euc n, ‖v‖ = 1 → c ≤ ∫ x, radialFlux v x := by + have hne : (Metric.sphere (0 : Euc n) 1).Nonempty := by + refine ⟨(EuclideanSpace.basisFun (Fin n) ℝ) ⟨0, hn⟩, ?_⟩ + simp + obtain ⟨v, hv, hmin⟩ := (isCompact_sphere (0 : Euc n) 1).exists_isMinOn hne + (continuous_integral_radialFlux (n := n)).continuousOn + have hv1 : ‖v‖ = 1 := by simpa [Metric.mem_sphere, dist_zero_right] using hv + refine ⟨∫ x, radialFlux v x, integral_radialFlux_pos hv1, fun w hw ↦ hmin ?_⟩ + simpa [Metric.mem_sphere, dist_zero_right] using hw + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +def ballNormalTest {n : ℕ} (c : Euc n) (r : ℝ) (v : Euc n) (y : Euc n) : Euc n := + radialNormalTest v (r⁻¹ • (y - c)) + +theorem ballNormalTest_contDiff {n : ℕ} (c : Euc n) (r : ℝ) (v : Euc n) : + ContDiff ℝ ∞ (ballNormalTest c r v) := + (radialNormalTest_contDiff v).comp ((contDiff_id.sub contDiff_const).const_smul r⁻¹) + +theorem ballNormalTest_support {n : ℕ} (c : Euc n) {r : ℝ} (hr : 0 < r) (v : Euc n) : + tsupport (ballNormalTest c r v) ⊆ Metric.closedBall c (r / 2) := by + have hs := tsupport_comp_subset_preimage (f := fun y : Euc n ↦ r⁻¹ • (y - c)) (radialNormalTest v) + ((continuous_id.sub continuous_const).const_smul r⁻¹) + intro y hy + have hmem := radialNormalTest_support v (hs hy) + simp only [Metric.mem_closedBall, dist_zero_right, norm_smul, Real.norm_eq_abs, + abs_of_pos (inv_pos.mpr hr)] at hmem + change dist y c ≤ r / 2 + rw [dist_eq_norm] + have hm := mul_le_mul_of_nonneg_left hmem hr.le + simpa [← mul_assoc, hr.ne', div_eq_mul_inv] using hm + +theorem ballNormalTest_admissible {n : ℕ} (c : Euc n) {r : ℝ} (hr : 0 < r) + {v : Euc n} (hv : ‖v‖ = 1) : + PerimeterAdmissible (Metric.ball c r) (ballNormalTest c r v) := by + refine ⟨ballNormalTest_contDiff c r v, + (isCompact_closedBall c (r / 2)).of_isClosed_subset (isClosed_tsupport _) + (ballNormalTest_support c hr v), + (ballNormalTest_support c hr v).trans (Metric.closedBall_subset_ball (by linarith)), ?_⟩ + intro y + exact (radialNormalTest_admissible hv).2.2.2 _ + +theorem divergence_ballNormalTest {n : ℕ} (c : Euc n) (r : ℝ) (v y : Euc n) : + divergence (ballNormalTest c r v) y = + r⁻¹ * divergence (radialNormalTest v) (r⁻¹ • (y - c)) := by + have hq : HasFDerivAt (fun y : Euc n ↦ r⁻¹ • (y - c)) + (r⁻¹ • ContinuousLinearMap.id ℝ (Euc n)) y := + ((hasFDerivAt_id (𝕜 := ℝ) y).sub_const c).const_smul r⁻¹ + have hV := ((radialNormalTest_contDiff v).differentiable (by norm_num) + (r⁻¹ • (y - c))).hasFDerivAt.comp y hq + change HasFDerivAt (ballNormalTest c r v) _ y at hV + simp only [divergence, hV.fderiv, ContinuousLinearMap.comp_apply, + smul_apply, ContinuousLinearMap.id_apply, map_smul, + inner_smul_right, ← Finset.mul_sum] + +theorem ballNormalTest_allIntegral {n : ℕ} (E : Set (Euc n)) (hE : MeasurableSet E) (c : Euc n) + {r : ℝ} (hr : 0 < r) (v : Euc n) : + (∫ y in E, divergence (ballNormalTest c r v) y) = + ∫ y in Metric.ball c r, E.indicator (divergence (ballNormalTest c r v)) y := by + rw [← integral_indicator (s := E)] + · apply (setIntegral_eq_integral_of_forall_compl_eq_zero (fun y hy ↦ ?_)).symm + have hns : y ∉ tsupport (divergence (ballNormalTest c r v)) := fun h ↦ hy + (((tsupport_divergence_subset _).trans (ballNormalTest_support c hr v)).trans + (Metric.closedBall_subset_ball (show r / 2 < r by linarith)) h) + by_cases he : y ∈ E + · rw [Set.indicator_of_mem he, image_eq_zero_of_notMem_tsupport hns] + · exact Set.indicator_of_notMem he _ + · exact hE + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem ballNormalTest_normalized_integral {n : ℕ} (E : Set (Euc n)) (hE : MeasurableSet E) + (c : Euc n) {r : ℝ} (hr : 0 < r) (v : Euc n) : + (r ^ n)⁻¹ * r * (∫ y in E, divergence (ballNormalTest c r v) y) = + ∫ z in Metric.ball (0 : Euc n) 1, + E.indicator (fun _ ↦ (1 : ℝ)) (c + r • z) * divergence (radialNormalTest v) z := by + rw [ballNormalTest_allIntegral E hE c hr v] + calc + _ = r * ((r ^ n)⁻¹ * ∫ y in Metric.ball c r, + E.indicator (divergence (ballNormalTest c r v)) y) := by ring + _ = r * ∫ z in Metric.ball (0 : Euc n) 1, + E.indicator (divergence (ballNormalTest c r v)) (c + r • z) := by + rw [normalized_ball_integral _ _ hr] + _ = _ := by + rw [← integral_const_mul] + apply setIntegral_congr_fun measurableSet_ball + intro z hz + by_cases he : c + r • z ∈ E + · simp only [Set.indicator_of_mem he, one_mul, divergence_ballNormalTest, + add_sub_cancel_left, inv_smul_smul₀ hr.ne', ← mul_assoc, mul_inv_cancel₀ hr.ne'] + · simp only [Set.indicator_of_notMem he, mul_zero, zero_mul] + +theorem ballNormalTest_integral {n : ℕ} (hn : 0 < n) (E : Set (Euc n)) + (hE : MeasurableSet E) (c : Euc n) {r : ℝ} (hr : 0 < r) (v : Euc n) : + (∫ y in E, divergence (ballNormalTest c r v) y) = r ^ (n - 1) * + ∫ z in Metric.ball (0 : Euc n) 1, + E.indicator (fun _ ↦ (1 : ℝ)) (c + r • z) * divergence (radialNormalTest v) z := by + have hc := ballNormalTest_normalized_integral E hE c hr v + have hp : r ^ n = r ^ (n - 1) * r := by + rw [← pow_succ, Nat.sub_add_cancel hn] + rw [hp] at hc + calc + _ = r ^ (n - 1) * ((r ^ (n - 1) * r)⁻¹ * r * + ∫ y in E, divergence (ballNormalTest c r v) y) := by field_simp + _ = _ := by rw [hc] + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/BlowupHolderGraph.lean b/lean/OAI/Geometry/Perimeter/Regularity/BlowupHolderGraph.lean new file mode 100644 index 0000000000000000000000000000000000000000..e489108a39cb13cb481e1bdfe9968fe6a18af9c7 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/BlowupHolderGraph.lean @@ -0,0 +1,79 @@ +import OAI.Geometry.Perimeter.Regularity.SlabContraction +import OAI.Geometry.Perimeter.Regularity.InitialSlab +import OAI.Geometry.Perimeter.Regularity.HolderGraph + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +variable {n : ℕ} + +theorem HasHalfspaceBlowup.exists_holder_graphs (hn : 1 simp [hxH] + simpa only [mem_ofPred_eq, mem_insert_iff, mem_singleton_iff] using + closure_minimal hs hclosed (hg m) + choose F hF hFK hFg using fun m ↦ exists_set_of_indicator_Lp (K m) (hK m) (g m) (hg01 m) + refine ⟨F, hF, hFK, σ, hσ, ?_⟩ + intro m + have htm := tendsto_pi_nhds.mp ht m + have he : Tendsto (fun i ↦ edist (f (σ i) m) (g m)) atTop (𝓝 0) := by + simpa only [Function.comp_def, edist_self] using + htm.edist (tendsto_const_nhds (x := g m)) + rw [← hFg m] at he + simp only [f, compactIndicatorLp_edist (K m) (hK m) _ _ _ _ (hAK m _) (hFK m)] at he + have hvol (i : ℕ) : (∫⁻ x, ‖(A m (σ i)).indicator (fun _ ↦ (1:ℝ)) x - + (F m).indicator (fun _ ↦ (1:ℝ)) x‖ₑ) = volume (symmDiff (A m (σ i)) (F m)) := by + simpa using lintegral_indicator_difference (U := univ) (hA m (σ i)) (hF m) + simpa only [hvol] using he + +theorem exists_global_set_of_local_L1_limits {n : ℕ} + (E F : ℕ → Set (Euc n)) (hF : ∀ m, MeasurableSet (F m)) + (hconv : ∀ m, Tendsto (fun i ↦ volume (symmDiff (E i) (F m) ∩ + Metric.closedBall 0 ((m:ℝ)+1))) atTop (𝓝 0)) : + ∃ G : Set (Euc n), MeasurableSet G ∧ ∀ (c : Euc n) (R : ℝ), 0 < R → + Tendsto (fun i ↦ volume.real (symmDiff (E i) G ∩ Metric.closedBall c R)) atTop (𝓝 0) := by + let B (m : ℕ) : Set (Euc n) := Metric.closedBall 0 ((m:ℝ)+1) + have hBmono : Monotone B := fun j m hjm ↦ + Metric.closedBall_subset_closedBall (by exact_mod_cast Nat.add_le_add_right hjm 1) + have hrestrict (j m : ℕ) (hjm : j ≤ m) : + Tendsto (fun i ↦ volume (symmDiff (E i) (F m) ∩ B j)) atTop (𝓝 0) := + tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds (hconv m) + (fun _ ↦ bot_le) (fun i ↦ measure_mono (inter_subset_inter_right _ (hBmono hjm))) + have hcompat (m l : ℕ) : (F m ∩ B (min m l) : Set (Euc n)) =ᵐ[volume] (F l ∩ B (min m l) : Set (Euc n)) := by + apply measure_symmDiff_eq_zero_iff.mp + apply le_antisymm _ bot_le + have ht := (hrestrict (min m l) m (min_le_left _ _)).add + (hrestrict (min m l) l (min_le_right _ _)) + simp only [zero_add] at ht + apply ge_of_tendsto ht + exact Eventually.of_forall fun i ↦ by + simpa only [← inter_symmDiff_distrib_right, symmDiff_comm (F m) (E i)] using + (measure_symmDiff_le (μ := (volume : Measure (Euc n))) + (F m ∩ B (min m l)) (E i ∩ B (min m l)) (F l ∩ B (min m l))) + let G : Set (Euc n) := ⋃ m, F m ∩ B m + have hG : MeasurableSet G := MeasurableSet.iUnion fun m ↦ + (hF m).inter measurableSet_closedBall + have hagree (m : ℕ) : (G ∩ B m : Set (Euc n)) =ᵐ[volume] (F m ∩ B m : Set (Euc n)) := by + filter_upwards [ae_all_iff.mpr (fun l ↦ hcompat m l)] with x hx + apply propext + constructor + · rintro ⟨hxG, hxm⟩ + obtain ⟨l, hxl, hxBl⟩ := mem_iUnion.mp hxG + have hxB : x ∈ B (min m l) := by + rcases le_total m l with h | h + · simpa only [min_eq_left h] using hxm + · simpa only [min_eq_right h] using hxBl + have hh : x ∈ F m ∩ B (min m l) := (eq_iff_iff.mp (hx l)).mpr ⟨hxl, hxB⟩ + exact ⟨hh.1, hxm⟩ + · rintro ⟨hxm, hxB⟩ + exact ⟨mem_iUnion.mpr ⟨m, hxm, hxB⟩, hxB⟩ + have hconvG (m : ℕ) : Tendsto (fun i ↦ volume (symmDiff (E i) G ∩ B m)) atTop (𝓝 0) := by + convert hconv m using 1 + funext i + apply measure_congr + filter_upwards [hagree m] with x hx + have hh : (x ∈ G ∧ x ∈ B m) ↔ (x ∈ F m ∧ x ∈ B m) := eq_iff_iff.mp hx + change (x ∈ symmDiff (E i) G ∩ B m) = + (x ∈ symmDiff (E i) (F m) ∩ B m) + apply propext + simp only [mem_inter_iff, mem_symmDiff] + tauto + refine ⟨G, hG, ?_⟩ + intro c R hR + obtain ⟨m, hm⟩ := exists_nat_gt (dist c 0 + R) + have hs : Metric.closedBall c R ⊆ B m := by + intro x hx + apply Metric.mem_closedBall.mpr + exact (dist_triangle x c 0).trans (by + have hh := Metric.mem_closedBall.mp hx + linarith) + have ht : Tendsto (fun i ↦ volume (symmDiff (E i) G ∩ Metric.closedBall c R)) atTop (𝓝 0) := + tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds (hconvG m) + (fun _ ↦ bot_le) (fun i ↦ measure_mono (inter_subset_inter_right _ hs)) + simpa only [measureReal_def, ENNReal.toReal_zero, Function.comp_def] using + (ENNReal.tendsto_toReal ENNReal.zero_ne_top).comp ht + +theorem minimizing_global_compactness {n : ℕ} (hn : 0 < n) + (E : ℕ → Set (Euc n)) (hE : ∀ i, IsLocallyPerimeterMinimizing (E i)) : + ∃ F : Set (Euc n), IsLocallyPerimeterMinimizing F ∧ + ∃ σ : ℕ → ℕ, StrictMono σ ∧ + (∀ (c : Euc n) (R : ℝ), 0 < R → + Tendsto (fun i ↦ volume.real (symmDiff (E (σ i)) F ∩ Metric.closedBall c R)) + atTop (𝓝 0)) ∧ + (∀ (c : Euc n) (r : ℝ), 0 < r → perimeterMeasure F (Metric.sphere c r) = 0 → + Tendsto (fun i ↦ perimeter (E (σ i)) (Metric.ball c r)) atTop + (𝓝 (perimeter F (Metric.ball c r)))) := by + choose C hC hcut using exists_uniform_minimizing_exhaustion_cut hn + choose A hA hAK hAE hP using fun m i ↦ hcut m (E i) (hE i) + obtain ⟨F, hF, hFK, σ, hσ, ht⟩ := exists_simultaneous_indicator_L1_subsequence + (fun m ↦ Metric.closedBall 0 ((m:ℝ)+2)) (fun m ↦ isCompact_closedBall _ _) + C hC A hA hAK hP + have hlocal (m : ℕ) : Tendsto (fun i ↦ volume (symmDiff (E (σ i)) (F m) ∩ + Metric.closedBall 0 ((m:ℝ)+1))) atTop (𝓝 0) := by + apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds (ht m) + (fun _ ↦ bot_le) (fun i ↦ ?_) + apply measure_mono + intro x hx + have hh : x ∈ E (σ i) ↔ x ∈ A m (σ i) := by + have he := Set.ext_iff.mp (hAE m (σ i)) x + simp only [mem_inter_iff] at he + exact ⟨fun h ↦ (he.mpr ⟨h, hx.2⟩).1, fun h ↦ (he.mp ⟨h, hx.2⟩).1⟩ + simpa only [mem_symmDiff, hh] using hx.1 + obtain ⟨G, hG, hconv⟩ := exists_global_set_of_local_L1_limits (fun i ↦ E (σ i)) F hF hlocal + refine ⟨G, locally_minimizing_of_local_L1_limit hn (fun i ↦ hE (σ i)) hG hconv, + σ, hσ, hconv, ?_⟩ + intro c r hr hnull + exact tendsto_minimizing_perimeter_ball_of_local_L1 hn (fun i ↦ hE (σ i)) hG hconv c hr hnull + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/C1Graph.lean b/lean/OAI/Geometry/Perimeter/Regularity/C1Graph.lean new file mode 100644 index 0000000000000000000000000000000000000000..afc33d64b0a948cb081b10d36ca2a93f0351d777 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/C1Graph.lean @@ -0,0 +1,70 @@ +import OAI.Geometry.Perimeter.Regularity.NeighborhoodPlanes +import OAI.Geometry.Perimeter.Regularity.GraphDerivative +import OAI.Geometry.Perimeter.Regularity.UniformDerivativeContinuity + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +variable {n : ℕ} + +theorem c1_graph_from_contraction (hn : 1 simp [χ, hx] + have hd := integrable_divergence hV.1 hV.2.1 + let F : Euc n × Euc n → ℝ := fun p ↦ k p.1 * χ (p.2 - p.1) * divergence V p.2 + have hFi : Integrable F (volume.prod volume) := by + apply (hk.norm.mul_prod hd.norm).mono' + · exact ((hkc.measurable.comp measurable_fst).mul + (hmχ.comp (measurable_snd.sub measurable_fst))).mul + ((continuous_divergence hV.1).measurable.comp measurable_snd) |>.aestronglyMeasurable + · apply ae_of_all + intro p + simp only [F, norm_mul] + exact mul_le_mul_of_nonneg_right + (by nlinarith [hbχ (p.2 - p.1), norm_nonneg (k p.1)]) (norm_nonneg _) + have hinner : ∀ t, (∫ x, F (t, x)) = k t * (∫ y in E, divergence V (y + t)) := by + intro t + simp only [F, mul_assoc, integral_const_mul] + congr 1 + calc + (∫ x, χ (x - t) * divergence V x) = + ∫ y, χ y * divergence V (y + t) := by + simpa only [add_sub_cancel_right] using + (integral_add_right_eq_self (fun x ↦ χ (x - t) * divergence V x) t).symm + _ = ∫ y in E, divergence V (y + t) := by + rw [← integral_indicator hE] + apply integral_congr_ae + apply ae_of_all + intro y + by_cases hy : y ∈ E <;> simp [χ, hy] + have hInt : Integrable (fun t ↦ k t * (∫ y in E, divergence V (y + t))) volume := by + simpa only [hinner] using hFi.integral_prod_left + have heq : (∫ x, (k ⋆[lsmul ℝ ℝ, volume] χ) x * divergence V x) = + ∫ t, k t * (∫ y in E, divergence V (y + t)) := by + calc + _ = ∫ x, ∫ t, F (t, x) := by + apply integral_congr_ae + apply ae_of_all + intro x + simp only [convolution_def, lsmul_apply, smul_eq_mul, F, integral_mul_const] + _ = ∫ t, ∫ x, F (t, x) := integral_integral_swap hFi.swap + _ = _ := by simp only [hinner] + have hbound : ∀ t, ∫ y in E, divergence V (y + t) ≤ (perimeter E univ).toReal := by + intro t + let Vt : Euc n → Euc n := fun y ↦ V (y + t) + have hVt : PerimeterAdmissible univ Vt := ⟨hV.1.comp (contDiff_id.add contDiff_const), + hV.2.1.comp_homeomorph (Homeomorph.addRight t), subset_univ _, fun y ↦ hV.2.2.2 _⟩ + simpa only [Vt, divergence_comp_add_right (hV.1.differentiable (by simp))] using + integral_divergence_le_perimeter_real E univ hP hVt + rw [heq] + calc + (∫ t, k t * (∫ y in E, divergence V (y + t))) ≤ + ∫ t, k t * (perimeter E univ).toReal := by + exact integral_mono hInt (hk.mul_const _) fun t ↦ + mul_le_mul_of_nonneg_left (hbound t) (hk0 t) + _ = (perimeter E univ).toReal := by rw [integral_mul_const, hk1, one_mul] + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/ClosedFilledLineInvariantOfFrontier.lean b/lean/OAI/Geometry/Perimeter/Regularity/ClosedFilledLineInvariantOfFrontier.lean new file mode 100644 index 0000000000000000000000000000000000000000..e7def427f64a6f7495da4cdb1021c1d7dc1d1fdf --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/ClosedFilledLineInvariantOfFrontier.lean @@ -0,0 +1,69 @@ +import OAI.Geometry.Perimeter.Regularity.ExistsMinimizingDensityLimit + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +open scoped ENNReal Topology ContDiff +open scoped Topology ENNReal +namespace RPISingularHarnack + +theorem closed_filled_line_invariant_of_frontier {n : ℕ} {F : Set (Euc n)} + (hF : IsClosed F) (c : Euc n) + (hline : ∀ (t : ℝ) (x : Euc n), x ∈ frontier F → x+t • c ∈ frontier F) : + ∀ (t : ℝ) (x : Euc n), x ∈ F → x+t • c ∈ F := by + intro t x hx + by_cases hxfr : x ∈ frontier F + · exact hF.closure_eq ▸ frontier_subset_closure (hline t x hxfr) + have hxint : x ∈ interior F := by + by_contra hxi + apply hxfr + rw [frontier, hF.closure_eq] + exact ⟨hx, hxi⟩ + let L : Set (Euc n) := Set.range (fun s : ℝ ↦ x+s • c) + have hLfr : Disjoint L (frontier F) := by + apply Set.disjoint_left.mpr + rintro y ⟨s, rfl⟩ hy + apply hxfr + have hh := hline (-s) (x+s • c) hy + convert hh using 1 + module + have hLsub : L ⊆ interior F ∪ Fᶜ := by + intro y hy + by_cases hyF : y ∈ F + · apply Or.inl + by_contra hyi + exact (Set.disjoint_left.mp hLfr hy) (by rw [frontier, hF.closure_eq]; exact ⟨hyF, hyi⟩) + · exact Or.inr hyF + have hLc : IsPreconnected L := by + exact isPreconnected_range (by fun_prop : Continuous (fun s : ℝ ↦ x+s • c)) + have hLInt : L ⊆ interior F := hLc.subset_left_of_subset_union isOpen_interior hF.isOpen_compl + (Set.disjoint_left.mpr fun y hy hyc ↦ hyc (interior_subset hy)) hLsub + ⟨x, ⟨0, by simp⟩, hxint⟩ + exact interior_subset (hLInt ⟨t, rfl⟩) + +theorem minimizing_cone_tangent_filled_line_invariant {n : ℕ} (hn : 1 < n) + {E F : Set (Euc n)} (hE : IsLocallyPerimeterMinimizing E) (hcone : IsCone E) + (hF : IsLocallyPerimeterMinimizing F) (hFc : IsClosed F) + (hFfront : frontier F = perimeterSupport F) (c : Euc n) + (r : ℕ → ℝ) (hr : ∀ i, 0 < r i) (htr : Tendsto r atTop (𝓝 0)) + (hconv : ∀ (x : Euc n) (R : ℝ), 0 < R → + Tendsto (fun i ↦ volume.real (symmDiff (blownUpSet E c (r i)) F ∩ Metric.closedBall x R)) + atTop (𝓝 0)) : + ∀ (t : ℝ) (x : Euc n), x ∈ F → x + t • c ∈ F := by + apply closed_filled_line_invariant_of_frontier hFc c + intro t x hx + rw [hFfront] at hx ⊢ + exact minimizing_cone_tangent_support_line_invariant hn hE hcone hF c r hr htr hconv t x hx + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/CompactLpExtension.lean b/lean/OAI/Geometry/Perimeter/Regularity/CompactLpExtension.lean new file mode 100644 index 0000000000000000000000000000000000000000..f139493605be17bf39ad6cba06f8f1c67ffee38d --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/CompactLpExtension.lean @@ -0,0 +1,84 @@ +import OAI.Geometry.Perimeter.Regularity.HeightCompactness + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal +namespace RPISingularHarnack +open RPI.Boundary +variable {n : ℕ} + +def compactLpExtension (K : Set (Euc n)) + (g : Lp ℝ 1 (volume.comap (Subtype.val : K → Euc n))) : Euc n → ℝ := + Function.extend (Subtype.val : K → Euc n) g (fun _ ↦ 0) + +@[simp] theorem compactLpExtension_coe (K : Set (Euc n)) + (g : Lp ℝ 1 (volume.comap (Subtype.val : K → Euc n))) (x : K) : + compactLpExtension K g x = g x := + Subtype.val_injective.extend_apply _ _ x + +theorem compactLpExtension_zero (K : Set (Euc n)) + (g : Lp ℝ 1 (volume.comap (Subtype.val : K → Euc n))) {x : Euc n} (hx : x ∉ K) : + compactLpExtension K g x = 0 := by + apply Function.extend_apply' + rintro ⟨y,rfl⟩; exact hx y.property + +theorem compactLpExtension_integrable (K : Set (Euc n)) (hK : IsCompact K) + (g : Lp ℝ 1 (volume.comap (Subtype.val : K → Euc n))) : + Integrable (compactLpExtension K g) volume := by + have hi : IntegrableOn (compactLpExtension K g) K volume := by + rw [integrableOn_iff_comap_subtypeVal hK.measurableSet] + simpa only [Function.comp_def,compactLpExtension_coe] using + (memLp_one_iff_integrable.mp (Lp.memLp g)) + exact hi.integrable_of_forall_notMem_eq_zero (fun _ hx ↦ compactLpExtension_zero K g hx) + +theorem compactLpExtension_error (K : Set (Euc n)) (hK : IsCompact K) + (g : Lp ℝ 1 (volume.comap (Subtype.val : K → Euc n))) + (f : Euc n → ℝ) (hi : Integrable f volume) (hs : Function.support f ⊆ K) : + (∫⁻ x, ‖f x-compactLpExtension K g x‖ₑ) = edist (compactFunctionLp K hK f hi) g := by + rw [Lp.edist_def,eLpNorm_one_eq_lintegral_enorm + ((Lp.aestronglyMeasurable (compactFunctionLp K hK f hi)).sub (Lp.aestronglyMeasurable g))] + have hz : Function.support (fun x ↦ ‖f x-compactLpExtension K g x‖ₑ) ⊆ K := by + intro x hx + by_contra hnot + have hf : f x=0 := Function.notMem_support.mp (fun h ↦ hnot (hs h)) + simp [hf,compactLpExtension_zero K g hnot] at hx + rw [← setLIntegral_eq_of_support_subset hz,← lintegral_subtype_comap hK.measurableSet] + apply lintegral_congr_ae + filter_upwards [compactFunctionLp_ae K hK f hi] with x hx + simp only [compactLpExtension_coe,Pi.sub_apply,hx] + +theorem compactLpExtension_tendsto (K : Set (Euc n)) (hK : IsCompact K) + (f : ℕ → Euc n → ℝ) (hi : ∀ i, Integrable (f i) volume) + (hs : ∀ i, Function.support (f i) ⊆ K) + (g : Lp ℝ 1 (volume.comap (Subtype.val : K → Euc n))) + (hlim : Tendsto (fun i ↦ compactFunctionLp K hK (f i) (hi i)) atTop (𝓝 g)) : + Tendsto (fun i ↦ ∫⁻ x, ‖f i x-compactLpExtension K g x‖ₑ) atTop (𝓝 0) := by + have he (i : ℕ) := compactLpExtension_error K hK g (f i) (hi i) (hs i) + simp_rw [he] + simpa only [edist_self] using hlim.edist (tendsto_const_nhds : Tendsto (fun _ : ℕ ↦ g) atTop (𝓝 g)) + +theorem compact_support_L1_subsequence + (K : Set (Euc n)) (hK : IsCompact K) (f : ℕ → Euc n → ℝ) + (hm : ∀ i, Measurable (f i)) (hi : ∀ i, Integrable (f i) volume) + (hs : ∀ i, Function.support (f i) ⊆ K) + (A : ℝ) (hA : 0 ≤ A) (hb : ∀ i, (∫ x, ‖f i x‖) ≤ A) + (D : ℝ≥0∞) (hD : D ≠ ⊤) + (ht : ∀ i w, (∫⁻ x, ‖f i (x+w)-f i x‖ₑ) ≤ ‖w‖ₑ * D) : + ∃ g : Euc n → ℝ, Integrable g volume ∧ Function.support g ⊆ K ∧ + ∃ σ : ℕ → ℕ, StrictMono σ ∧ + Tendsto (fun i ↦ ∫⁻ x, ‖f (σ i) x-g x‖ₑ) atTop (𝓝 0) := by + obtain ⟨g,σ,hσ,hg⟩ := compactFunctionLp_subsequence_of_translation K hK f hm hi A hA hb D hD ht + refine ⟨compactLpExtension K g,compactLpExtension_integrable K hK g,?_,σ,hσ,?_⟩ + · intro x hx + by_contra hnot + exact hx (compactLpExtension_zero K g hnot) + · exact compactLpExtension_tendsto K hK (fun i ↦ f (σ i)) (fun i ↦ hi (σ i)) + (fun i ↦ hs (σ i)) g hg + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/ConeLinkIntersection.lean b/lean/OAI/Geometry/Perimeter/Regularity/ConeLinkIntersection.lean new file mode 100644 index 0000000000000000000000000000000000000000..ad199e9ad871eb56fde0c154faa0d419f59fc5ae --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/ConeLinkIntersection.lean @@ -0,0 +1,83 @@ +import OAI.Geometry.Perimeter.Regularity.CoupledConeLink +import OAI.Geometry.Perimeter.Regularity.ConeLinkSupport + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +namespace RPISingularHarnack +namespace SphericalFrankel + +def fullLink {n : ℕ} (E : Set (Euc n)) : Set (Euc n) := + perimeterSupport E ∩ Metric.sphere 0 1 + +lemma fullLink_compact {n : ℕ} (E : Set (Euc n)) : IsCompact (fullLink E) := + (isCompact_sphere (0 : Euc n) 1).inter_left (isClosed_perimeterSupport E) + +lemma fullLink_nonempty {n : ℕ} (hn : 1 < n) {E : Set (Euc n)} + (hE : IsLocallyPerimeterMinimizing E) (hc : IsCone E) + (hv : (0 : Euc n) ∈ perimeterSupport E) : (fullLink E).Nonempty := by + obtain ⟨x,hx,hx0⟩ := minimizing_support_nonzero_point hn hE hv + refine ⟨radialUnit x, (isCone_perimeterSupport hE.1 hc _ + (inv_pos.mpr (norm_pos_iff.mpr hx0)) x).mpr hx, ?_⟩ + simpa [Metric.mem_sphere] using radialUnit_norm hx0 + +lemma product_ne_zero_of_ne_zero {n : ℕ} {μ ν : Measure (Frame n)} + [IsFiniteMeasure μ] [IsFiniteMeasure ν] (hμ : μ ≠ 0) (hν : ν ≠ 0) : μ.prod ν ≠ 0 := by + intro hz + have hp : μ Set.univ * ν Set.univ = 0 := by + rw [← Measure.prod_prod, Set.univ_prod_univ, hz] + simp + rcases mul_eq_zero.mp hp with h | h + · exact hμ (Measure.measure_univ_eq_zero.mp h) + · exact hν (Measure.measure_univ_eq_zero.mp h) + +theorem minimizing_cone_links_intersect {n : ℕ} (hn : 2 < n) {E F : Set (Euc n)} + (hE : IsLocallyPerimeterMinimizing E) (hF : IsLocallyPerimeterMinimizing F) + (hcE : IsCone E) (hcF : IsCone F) + (hvE : (0 : Euc n) ∈ perimeterSupport E) + (hvF : (0 : Euc n) ∈ perimeterSupport F) : + (fullLink E ∩ fullLink F).Nonempty := by + have hn1 : 1 < n := by omega + let μ := annularLink E + let ν := annularLink F + let : IsFiniteMeasure μ := annularLink_finite hE + let : IsFiniteMeasure ν := annularLink_finite hF + have hμ0 : μ ≠ 0 := annularLink_ne_zero hn1 hE hcE hvE + have hν0 : ν ≠ 0 := annularLink_ne_zero hn1 hF hcF hvF + have hμ := annularLink_frames hn1 hE hcE + have hν := annularLink_frames hn1 hF hcF + have hS := minimizing_cones_coupledStationarity hn1 hE hF hcE hcF + have hC : Continuous (fun p : Euc n × Euc n ↦ inner ℝ p.1 p.2) := + continuous_fst.inner continuous_snd + obtain ⟨p, hp, hmax⟩ := ((fullLink_compact E).prod (fullLink_compact F)).exists_isMaxOn + ((fullLink_nonempty hn1 hE hcE hvE).prod (fullLink_nonempty hn1 hF hcF hvF)) + hC.continuousOn + have hpn : ‖p.1‖ = 1 := by simpa [Metric.mem_sphere] using hp.1.2 + have hqn : ‖p.2‖ = 1 := by simpa [Metric.mem_sphere] using hp.2.2 + have hle : inner ℝ p.1 p.2 ≤ 1 := by + exact le_trans (le_abs_self _) (by simpa [hpn,hqn] using abs_real_inner_le_norm p.1 p.2) + by_cases heq : p.1 = p.2 + · exact ⟨p.1,hp.1,heq ▸ hp.2⟩ + · have hlt : inner ℝ p.1 p.2 < 1 := lt_of_le_of_ne hle (by + intro he + exact heq ((inner_eq_one_iff_of_norm_eq_one hpn hqn).mp he)) + have hbound : ∀ᵐ q ∂μ.prod ν, angle q.1 q.2 ≤ max 0 (inner ℝ p.1 p.2) := by + apply (Measure.ae_prod_iff_ae_ae + (isClosed_le continuous_angle continuous_const).measurableSet).mpr + filter_upwards [annularLink_radial_support hn1 hE hcE] with e he + filter_upwards [annularLink_radial_support hn1 hF hcF] with f hf + apply le_trans _ (le_max_right _ _) + change inner ℝ e.1 f.1 ≤ inner ℝ p.1 p.2 + exact hmax (a := (e.1,f.1)) ⟨⟨he.1, by simpa [Metric.mem_sphere] using he.2⟩, + ⟨hf.1, by simpa [Metric.mem_sphere] using hf.2⟩⟩ + exact (no_positive_angle_gap hn (product_ne_zero_of_ne_zero hμ0 hν0) + (product_frames hμ hν) hS (le_max_left _ _) (max_lt (by norm_num) hlt) hbound).elim + +end SphericalFrankel +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/ConeLinkSupport.lean b/lean/OAI/Geometry/Perimeter/Regularity/ConeLinkSupport.lean new file mode 100644 index 0000000000000000000000000000000000000000..e139f3f4b974c7704f1d9e6715f5a8263d0fc257 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/ConeLinkSupport.lean @@ -0,0 +1,112 @@ +import OAI.Geometry.Perimeter.Regularity.RawConeLink + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +namespace RPISingularHarnack +namespace SphericalFrankel + +lemma minimizing_perimeter_singleton {n : ℕ} (hn : 1 < n) {E : Set (Euc n)} + (hE : IsLocallyPerimeterMinimizing E) (x : Euc n) : perimeterMeasure E {x} = 0 := by + obtain ⟨C, D, hC0, hCt, hD0, hDt, hCD⟩ := minimizing_perimeter_hausdorff_comparison hn + have hd : (0 : ℝ) < (n - 1 : ℕ) := by exact_mod_cast (by omega : 0 < n-1) + let := Measure.nullSingletonClass_hausdorff (Euc n) hd + apply le_antisymm _ zero_le + calc + perimeterMeasure E {x} ≤ (C • (Measure.hausdorffMeasure (n-1 : ℕ)).restrict + (perimeterSupport E)) {x} := (hCD E hE).1 {x} + _ = 0 := by simp + +lemma minimizing_support_nonzero_point {n : ℕ} (hn : 1 < n) {E : Set (Euc n)} + (hE : IsLocallyPerimeterMinimizing E) (hv : (0 : Euc n) ∈ perimeterSupport E) : + ∃ x ∈ perimeterSupport E, x ≠ 0 := by + have hv' : (0 : Euc n) ∈ (perimeterMeasure E).support := by + rwa [perimeterMeasure_support] + have hp := Metric.nhds_basis_ball.mem_measureSupport.mp hv' 1 (by norm_num : (0 : ℝ)<1) + have hdiff : 0 < perimeterMeasure E (Metric.ball 0 1 \ {(0 : Euc n)}) := by + rwa [measure_sdiff_null (minimizing_perimeter_singleton hn hE 0)] + obtain ⟨x, hx, hs⟩ := (perimeterMeasure E).nonempty_inter_support_of_pos hdiff + exact ⟨x, by rwa [perimeterMeasure_support] at hs, hx.2⟩ + +lemma annularWeight_pos {n : ℕ} {x : Euc n} (h1 : 1 < ‖x‖) (h2 : ‖x‖ < 2) : + 0 < annularWeight x := by + unfold annularWeight annularCut annularProfile + apply mul_pos + · apply mul_pos <;> apply expNegInvGlue.pos_of_pos + · nlinarith [norm_nonneg x] + · nlinarith [norm_nonneg x] + · exact inv_pos.mpr (lt_trans (by norm_num) h1) + +lemma cone_support_annular_point {n : ℕ} (hn : 1 < n) {E : Set (Euc n)} + (hE : IsLocallyPerimeterMinimizing E) (hc : IsCone E) + (hv : (0 : Euc n) ∈ perimeterSupport E) : + ∃ y ∈ perimeterSupport E, ‖y‖ = (3 : ℝ)/2 := by + obtain ⟨x, hx, hx0⟩ := minimizing_support_nonzero_point hn hE hv + have hn0 : 0 < ‖x‖ := norm_pos_iff.mpr hx0 + refine ⟨((3:ℝ)/2/‖x‖) • x, + (isCone_perimeterSupport hE.1 hc _ (div_pos (by norm_num) hn0) x).mpr hx, ?_⟩ + rw [norm_smul, Real.norm_of_nonneg (div_nonneg (by norm_num) hn0.le), div_mul_cancel₀ _ hn0.ne'] + +lemma annularFrameMeasure_ne_zero {n : ℕ} (hn : 1 < n) {E : Set (Euc n)} + (hE : IsLocallyPerimeterMinimizing E) (hc : IsCone E) + (hv : (0 : Euc n) ∈ perimeterSupport E) : annularFrameMeasure E ≠ 0 := by + obtain ⟨y, hy, hyn⟩ := cone_support_annular_point hn hE hc hv + have hyp : 0 < annularWeight y := annularWeight_pos (by rw [hyn]; norm_num) (by rw [hyn]; norm_num) + have hyb : y ∈ Metric.ball (0 : Euc n) 3 := by simp [Metric.mem_ball, hyn] + let U := {x : Euc n | 0 < annularWeight x} + have hU : IsOpen U := isOpen_lt continuous_const annularWeight_continuous + have hy' : y ∈ (perimeterMeasure E).support := by rwa [perimeterMeasure_support] + have hp : 0 < perimeterMeasure E (U ∩ Metric.ball 0 3) := + (Measure.mem_support_iff_forall y).mp hy' _ ((hU.inter Metric.isOpen_ball).mem_nhds ⟨hyp,hyb⟩) + intro hz + have hzae : (fun x : Euc n ↦ (annularWeightNN x : ℝ≥0∞)) =ᵐ[ + (perimeterMeasure E).restrict (Metric.ball 0 3)] 0 := + (withDensity_eq_zero_iff annularWeightNN_measurable.coe_nnreal_ennreal.aemeasurable).mp hz + have hU0 : (perimeterMeasure E).restrict (Metric.ball 0 3) U = 0 := by + apply measure_eq_zero_iff_ae_notMem.mpr + filter_upwards [hzae] with x hx + intro hxp + have hw0 : annularWeight x = 0 := by + have hh : annularWeightNN x = 0 := ENNReal.coe_eq_zero.mp hx + exact congrArg (fun z : ℝ≥0 ↦ (z : ℝ)) hh + exact (ne_of_gt hxp) hw0 + rw [Measure.restrict_apply hU.measurableSet] at hU0 + exact hp.ne' hU0 + +lemma annularLink_ne_zero {n : ℕ} (hn : 1 < n) {E : Set (Euc n)} + (hE : IsLocallyPerimeterMinimizing E) (hc : IsCone E) + (hv : (0 : Euc n) ∈ perimeterSupport E) : annularLink E ≠ 0 := by + intro hz + apply annularFrameMeasure_ne_zero hn hE hc hv + exact (Measure.map_eq_zero_iff (frameOf_measurable hE.1).aemeasurable).mp hz + +lemma annularLink_radial_support {n : ℕ} (hn : 1 < n) {E : Set (Euc n)} + (hE : IsLocallyPerimeterMinimizing E) (hc : IsCone E) : + ∀ᵐ e ∂annularLink E, e.1 ∈ perimeterSupport E ∧ ‖e.1‖ = 1 := by + have hs : ∀ᵐ x ∂perimeterMeasure E, x ∈ perimeterSupport E := by + rw [← perimeterMeasure_support] + exact (perimeterMeasure E).support_mem_ae + have hf := annularLink_frames hn hE hc + have hr : ∀ᵐ e ∂annularLink E, e.1 ∈ perimeterSupport E := by + rw [annularLink, ae_map_iff (frameOf_measurable hE.1).aemeasurable + ((isClosed_perimeterSupport E).preimage continuous_fst).measurableSet, + annularFrameMeasure, ae_withDensity_iff annularWeightNN_measurable.coe_nnreal_ennreal] + filter_upwards [ae_restrict_of_ae hs] with x hx hρ + have hx0 : x ≠ 0 := by + intro hh + apply hρ + apply ENNReal.coe_eq_zero.mpr + apply Subtype.ext + simp [hh, annularWeightNN, annularWeight] + exact (isCone_perimeterSupport hE.1 hc _ (inv_pos.mpr (norm_pos_iff.mpr hx0)) x).mpr hx + filter_upwards [hr,hf] with e he hframe + exact ⟨he,hframe.1⟩ + +end SphericalFrankel +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/ConeRadialCap.lean b/lean/OAI/Geometry/Perimeter/Regularity/ConeRadialCap.lean new file mode 100644 index 0000000000000000000000000000000000000000..f3a9668e6d2f9485b2b5e28c75fbff88bef607a3 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/ConeRadialCap.lean @@ -0,0 +1,449 @@ +import OAI.Geometry.Perimeter.Regularity.SmulMemPhaseSupport + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +open scoped ENNReal Topology ContDiff +open scoped Topology ENNReal +namespace RPISingularHarnack + +def coneRadialCap {n : ℕ} (R : ℝ) (x : Euc n) : ℝ := + expNegInvGlue (R ^ 2 - ‖x‖ ^ 2) + +theorem coneRadialCap_contDiff {n : ℕ} (R : ℝ) : + ContDiff ℝ ∞ (coneRadialCap (n := n) R) := + expNegInvGlue.contDiff.comp (contDiff_const.sub (contDiff_id.norm_sq ℝ)) + +theorem coneRadialCap_tsupport {n : ℕ} {R : ℝ} (hR : 0 < R) : + tsupport (coneRadialCap (n := n) R) ⊆ Metric.closedBall (0 : Euc n) R := by + apply closure_minimal _ Metric.isClosed_closedBall + intro x hx + have hh : 0 < R ^ 2 - ‖x‖ ^ 2 := by + by_contra hh + exact hx (expNegInvGlue.zero_of_nonpos (le_of_not_gt hh)) + rw [Metric.mem_closedBall, dist_zero_right] + nlinarith [norm_nonneg x] + +theorem gradient_coneRadialCap {n : ℕ} (R : ℝ) (x : Euc n) : + gradient (coneRadialCap R) x = + (-2 * ((R ^ 2 - ‖x‖ ^ 2)⁻¹ ^ 2 * expNegInvGlue (R ^ 2 - ‖x‖ ^ 2))) • x := by + have hg (s : ℝ) : HasDerivAt expNegInvGlue (s⁻¹ ^ 2 * expNegInvGlue s) s := by + simpa using expNegInvGlue.hasDerivAt_polynomial_eval_inv_mul 1 s + have hq := ((hasFDerivAt_id (𝕜 := ℝ) x).norm_sq).const_sub (R ^ 2) + have hh := (hg (R ^ 2 - ‖x‖ ^ 2)).comp_hasFDerivAt x hq + change HasFDerivAt (coneRadialCap R) _ x at hh + apply (InnerProductSpace.toDual ℝ (Euc n)).injective + rw [toDual_gradient, hh.fderiv] + ext y + simp only [smul_apply, neg_apply, + ContinuousLinearMap.comp_apply, ContinuousLinearMap.id_apply, id_eq, + innerSL_apply_apply, map_smul, InnerProductSpace.toDual_apply_apply, + smul_eq_mul] + ring + +theorem minimizing_cone_support_in_halfspace_plane {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) (hcone : IsCone E) + (v : Euc n) (hside : ∀ x ∈ perimeterSupport E, 0 ≤ inner ℝ x v) : + ∀ x ∈ perimeterSupport E, inner ℝ x v = 0 := by + have hs : ∀ᵐ x ∂perimeterMeasure E, x ∈ perimeterSupport E := by + rw [← perimeterMeasure_support] + exact (perimeterMeasure E).support_mem_ae + have h0 : ∀ᵐ x ∂perimeterMeasure E, 0 ≤ inner ℝ x v := hs.mono fun x hx ↦ hside x hx + have hball (R : ℝ) (hR : 0 < R) : + ∀ᵐ x ∂(perimeterMeasure E).restrict (Metric.ball 0 R), inner ℝ x v = 0 := by + let φ : Euc n → ℝ := coneRadialCap R + let b : Euc n → ℝ := fun x ↦ (R ^ 2 - ‖x‖ ^ 2)⁻¹ ^ 2 * expNegInvGlue (R ^ 2 - ‖x‖ ^ 2) + let V : Euc n → Euc n := fun x ↦ φ x • v + have hφ : ContDiff ℝ ∞ φ := coneRadialCap_contDiff R + have htφ : HasCompactSupport φ := (isCompact_closedBall (0 : Euc n) R).of_isClosed_subset + (isClosed_tsupport _) (coneRadialCap_tsupport hR) + have hV : ContDiff ℝ ∞ V := hφ.smul contDiff_const + have htV : HasCompactSupport V := htφ.smul_right + have hVs : tsupport V ⊆ Metric.ball (0 : Euc n) (R + 1) := + (tsupport_smul_subset_left _ _).trans + ((coneRadialCap_tsupport hR).trans (Metric.closedBall_subset_ball (by linarith))) + have hdiv : ∀ᵐ x ∂perimeterMeasure E, + tangentialDivergence E V x = -2 * (b x * inner ℝ x v) := by + filter_upwards [minimizing_cone_radial_tangent_ae hn hmin hcone] with x hx + rw [tangentialDivergence_smul E (hφ.differentiable (by simp)) (differentiable_const v)] + have hc : tangentialDivergence E (fun _ : Euc n ↦ v) x = 0 := by + simp [tangentialDivergence, divergence] + rw [hc, mul_zero, zero_add, tangentialGradient, gradient_coneRadialCap] + simp only [real_inner_smul_left, hx, mul_zero, zero_smul, sub_zero] + dsimp [b] + ring + have hdf : Integrable (fun x ↦ b x * inner ℝ x v) + ((perimeterMeasure E).restrict (Metric.ball 0 (R + 1))) := by + have hh := (tangentialDivergence_integrable_ball_perimeter hmin 0 (by linarith : 0 < R + 1) hV).const_mul (-1/2 : ℝ) + apply hh.congr + filter_upwards [ae_restrict_of_ae hdiv] with x hx + rw [hx] + ring + have hnn : ∀ᵐ x ∂(perimeterMeasure E).restrict (Metric.ball 0 (R + 1)), + 0 ≤ b x * inner ℝ x v := by + filter_upwards [ae_restrict_of_ae h0] with x hx + exact mul_nonneg (mul_nonneg (sq_nonneg _) (expNegInvGlue.nonneg _)) hx + have hint : (∫ x in Metric.ball (0 : Euc n) (R + 1), b x * inner ℝ x v ∂perimeterMeasure E) = 0 := by + have hh := minimizing_tangentialDivergence_integral_eq_zero hn hmin 0 + (by linarith : 0 < R + 1) hV htV hVs + rw [integral_congr_ae (ae_restrict_of_ae hdiv), integral_const_mul] at hh + linarith + have he := (integral_eq_zero_iff_of_nonneg_ae hnn hdf).mp hint + have her : ∀ᵐ x ∂(perimeterMeasure E).restrict (Metric.ball 0 R), b x * inner ℝ x v = 0 := + ae_mono (Measure.restrict_mono (Metric.ball_subset_ball (by linarith)) le_rfl) he + filter_upwards [her, ae_restrict_mem measurableSet_ball] with x hx hxr + have hp : 0 < R ^ 2 - ‖x‖ ^ 2 := by + have hh : ‖x‖ < R := by simpa using hxr + nlinarith [norm_nonneg x] + have hb : 0 < b x := mul_pos (sq_pos_of_pos (inv_pos.mpr hp)) (expNegInvGlue.pos_of_pos hp) + exact (mul_eq_zero.mp hx).resolve_left hb.ne' + have hae : ∀ᵐ x ∂perimeterMeasure E, inner ℝ x v = 0 := by + let B (j : ℕ) := Metric.ball (0 : Euc n) (j + 1 : ℝ) + have hcover : (⋃ j, B j) = univ := by + apply eq_univ_of_forall + intro x + obtain ⟨j, hj⟩ := exists_nat_gt ‖x‖ + exact mem_iUnion.mpr ⟨j, by simpa [B] using (show ‖x‖ < (j : ℝ) + 1 by linarith)⟩ + have hh := (ae_restrict_iUnion_iff B (fun x ↦ inner ℝ x v = 0)).mpr + (fun j ↦ hball (j + 1) (by positivity)) + simpa only [hcover, Measure.restrict_univ] using hh + have hsup := Measure.support_subset_of_isClosed + (isClosed_eq (continuous_id.inner continuous_const) continuous_const) hae + rw [perimeterMeasure_support] at hsup + exact hsup + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +open scoped ENNReal Topology ContDiff +open scoped Topology ENNReal +namespace RPISingularHarnack + +theorem minimizing_cone_containing_halfspace_ae_eq {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) (hcone : IsCone E) + (hvertex : (0 : Euc n) ∈ perimeterSupport E) + {v : Euc n} (hv : ‖v‖ = 1) (hinside : {x | inner ℝ x v < 0} ⊆ E) : + E =ᵐ[volume] {x | inner ℝ x v < 0} := by + let K := (volume.restrict E).support + have hK : IsClosed K := Measure.isClosed_support + have hP : IsOpen {x : Euc n | inner ℝ x v < 0} := + isOpen_lt (continuous_id.inner continuous_const) continuous_const + have hPK : {x : Euc n | inner ℝ x v < 0} ⊆ K := by + intro x hx + apply Measure.interior_inter_support + refine ⟨?_, ?_⟩ + · exact (interior_mono hinside) (hP.interior_eq.symm ▸ hx) + · rw [Measure.support_eq_univ]; trivial + have hPint : {x : Euc n | inner ℝ x v < 0} ⊆ interior K := by + exact hP.interior_eq ▸ interior_mono hPK + have hfK : frontier K = perimeterSupport E := + minimizing_frontier_phaseSupport + (Real.HolderConjugate.conjExponent (by exact_mod_cast hn : 1 < (n : ℝ))) hmin + have hside : ∀ x ∈ perimeterSupport E, 0 ≤ inner ℝ x v := by + intro x hx + by_contra hh + have hi := hPint (lt_of_not_ge hh) + rw [← hfK, frontier] at hx + exact hx.2 hi + have hplane := minimizing_cone_support_in_halfspace_plane hn hmin hcone v hside + have hcover : {x : Euc n | 0 < inner ℝ x v} ⊆ interior K ∪ Kᶜ := by + intro x hx + by_cases hk : x ∈ K + · left + by_contra hi + have hs : x ∈ perimeterSupport E := by + rw [← hfK, frontier, hK.closure_eq] + exact ⟨hk, hi⟩ + exact (ne_of_gt hx) (hplane x hs) + · exact Or.inr hk + have hc : IsPreconnected {x : Euc n | 0 < inner ℝ x v} := by + have hh := (convex_halfSpace_gt (innerSL ℝ v).toLinearMap.isLinear (0 : ℝ)).isPreconnected + change IsPreconnected {x : Euc n | 0 < inner ℝ v x} at hh + simpa only [real_inner_comm v] using hh + have hor := hc.subset_or_subset isOpen_interior hK.isOpen_compl + (disjoint_compl_right.mono_left interior_subset) hcover + have hEK : E =ᵐ[volume] K := minimizing_ae_eq_phaseSupport + (Real.HolderConjugate.conjExponent (by exact_mod_cast hn : 1 < (n : ℝ))) hmin + rcases hor with hall | hnone + · have hae : ∀ᵐ x ∂(volume : Measure (Euc n)), x ∈ K := by + filter_upwards [ae_inner_ne_value hv 0] with x hx + rcases lt_or_gt_of_ne hx with hn | hp + · exact hPK hn + · exact interior_subset (hall hp) + have hKU : K = univ := by + have hh := Measure.support_subset_of_isClosed hK hae + rw [Measure.support_eq_univ] at hh + exact eq_univ_iff_forall.mpr fun x ↦ hh trivial + rw [← hfK, hKU, frontier_univ] at hvertex + exact False.elim hvertex + · apply hEK.trans + apply Filter.eventuallyEqSet_iff.mpr + filter_upwards [ae_inner_ne_value hv 0] with x hx + rcases lt_or_gt_of_ne hx with hn | hp + · exact iff_of_true (hPK hn) hn + · exact iff_of_false (hnone hp) (not_lt.mpr hp.le) + +theorem minimizing_cone_containing_halfspace_support_eq {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) (hcone : IsCone E) + (hvertex : (0 : Euc n) ∈ perimeterSupport E) + {v : Euc n} (hv : ‖v‖ = 1) (hinside : {x | inner ℝ x v < 0} ⊆ E) : + perimeterSupport E = perimeterSupport {x | inner ℝ x v < 0} := + perimeterSupport_eq_of_ae + (minimizing_cone_containing_halfspace_ae_eq hn hmin hcone hvertex hv hinside) + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +open scoped ENNReal Topology ContDiff +open scoped Topology ENNReal +namespace RPISingularHarnack + +theorem measure_eq_of_Iio_finite {μ ν : Measure ℝ} + (hfin : ∀ a : ℝ, μ (Iio a) ≠ ⊤) (heq : ∀ a : ℝ, μ (Iio a) = ν (Iio a)) : + μ = ν := by + apply Measure.ext_of_Ico' μ ν + · intro a b _ + exact ne_top_of_le_ne_top (hfin b) (measure_mono Ico_subset_Iio_self) + · intro a b hab + rw [← Iio_sdiff_Iio, measure_sdiff (Iio_subset_Iio hab.le) + measurableSet_Iio.nullMeasurableSet (hfin a), + measure_sdiff (Iio_subset_Iio hab.le) measurableSet_Iio.nullMeasurableSet + (by rw [← heq a]; exact hfin a), heq a, heq b] + +noncomputable def radialScaledMeasure {n : ℕ} (μ : Measure (Euc n)) (k : ℕ) (t : ℝ) : Measure ℝ := + ENNReal.ofReal (t^k) • μ.map (fun x ↦ t * ‖x‖) + +theorem radialScaledMeasure_Iio {n k : ℕ} (μ : Measure (Euc n)) + {a t : ℝ} (ht : 0 < t) : + radialScaledMeasure μ k t (Iio a) = + ENNReal.ofReal (t^k) * μ (Metric.ball 0 (a/t)) := by + have hm : Measurable (fun x : Euc n ↦ t * ‖x‖) := by fun_prop + rw [radialScaledMeasure, Measure.smul_apply, smul_eq_mul, + Measure.map_apply hm measurableSet_Iio] + congr 2 + ext x + simp only [mem_preimage, mem_Iio, Metric.mem_ball, dist_zero_right] + rw [lt_div_iff₀ ht, mul_comm] + +theorem radialScaledMeasure_eq_of_constant_density {n k : ℕ} + (μ : Measure (Euc n)) (hfin : ∀ r : ℝ, 0 < r → μ (Metric.ball 0 r) ≠ ⊤) + {a : ℝ} (ha : 0 ≤ a) (hdensity : ∀ r : ℝ, 0 < r → μ.real (Metric.ball 0 r) = a * r^k) + {s t : ℝ} (hs : 0 < s) (ht : 0 < t) : + radialScaledMeasure μ k s = radialScaledMeasure μ k t := by + have hval (t : ℝ) (ht : 0 < t) (r : ℝ) : + radialScaledMeasure μ k t (Iio r) = ENNReal.ofReal (a * (max r 0)^k) * + (if 0 < r then 1 else 0) := by + rw [radialScaledMeasure_Iio μ ht] + by_cases hr : 0 < r + · rw [ite_eq_left hr, mul_one, max_eq_left hr.le] + have hrt : 0 < r/t := div_pos hr ht + have hp := hdensity (r/t) hrt + have he : μ (Metric.ball 0 (r/t)) = ENNReal.ofReal (a * (r/t)^k) := by + rw [← hp, Measure.real, ENNReal.ofReal_toReal (hfin _ hrt)] + rw [he, ← ENNReal.ofReal_mul' (mul_nonneg ha (pow_nonneg hrt.le _))] + congr 1 + rw [div_pow] + field_simp + · rw [ite_eq_right hr, mul_zero, Metric.ball_eq_empty.mpr (div_nonpos_of_nonpos_of_nonneg + (le_of_not_gt hr) ht.le), measure_empty, mul_zero] + apply measure_eq_of_Iio_finite + · intro r + rw [hval s hs r] + split_ifs <;> finiteness + · intro r + rw [hval s hs r, hval t ht r] + +theorem radialDensity_integral_eq_pushforward {n k : ℕ} (μ : Measure (Euc n)) + {ψ : ℝ → ℝ} (hψ : Continuous ψ) {t : ℝ} (ht : 0 < t) : + (∫ x, radialDensityIntegrand 0 k ψ t x ∂μ) = + ∫ s, ψ (s^2) ∂radialScaledMeasure μ k t := by + have hm : Measurable (fun x : Euc n ↦ t * ‖x‖) := by fun_prop + have hc : Continuous (fun s : ℝ ↦ ψ (s^2)) := by fun_prop + rw [radialScaledMeasure, integral_smul_measure, + integral_map_of_stronglyMeasurable hm hc.stronglyMeasurable, + ENNReal.toReal_ofReal (pow_nonneg ht.le _)] + simp only [radialDensityIntegrand, sub_zero, smul_eq_mul, mul_pow, integral_const_mul] + +theorem radialDensity_integral_ball_eq {n k : ℕ} (μ : Measure (Euc n)) + {ψ : ℝ → ℝ} (hψz : ∀ s, 1 ≤ s → ψ s = 0) + {M t : ℝ} (hM : 0 < M) (ht : 1/M < t) : + (∫ x in Metric.ball (0 : Euc n) M, radialDensityIntegrand 0 k ψ t x ∂μ) = + ∫ x, radialDensityIntegrand 0 k ψ t x ∂μ := by + apply setIntegral_eq_integral_of_forall_compl_eq_zero + intro x hx + have ht0 : 0 < t := (one_div_pos.mpr hM).trans ht + have htM : 1 < t*M := (div_lt_iff₀ hM).mp ht + have hxM : M ≤ ‖x‖ := by simpa only [Metric.mem_ball, dist_zero_right, not_lt] using hx + have h1 : 1 ≤ t*‖x‖ := by nlinarith + have h2 := pow_le_pow_left₀ (by norm_num : (0:ℝ) ≤ 1) h1 2 + simp only [one_pow, mul_pow] at h2 + simp only [radialDensityIntegrand, sub_zero, hψz _ h2, mul_zero] + +theorem minimizing_radialDensityDerivative_eq_zero_of_constant_density + {n : ℕ} {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + {a : ℝ} (ha : 0 ≤ a) + (hdensity : ∀ r : ℝ, 0 < r → (perimeterMeasure E).real (Metric.ball 0 r) = a*r^(n-1)) + {M : ℝ} (hM : 0 < M) {ψ : ℝ → ℝ} (hψ : ContDiff ℝ ∞ ψ) + (hψz : ∀ s, 1 ≤ s → ψ s = 0) {t : ℝ} (ht : 1/M < t) : + (∫ x in Metric.ball 0 M, radialDensityDerivative 0 (n-1) ψ t x ∂perimeterMeasure E) = 0 := by + let μ := (perimeterMeasure E).restrict (Metric.ball 0 M) + have : IsFiniteMeasure μ := ⟨by + rw [Measure.restrict_apply_univ, perimeterMeasure_open E Metric.isOpen_ball] + exact hmin.2.1 0 M hM⟩ + have hμ : ∀ᵐ x ∂μ, x ∈ Metric.closedBall 0 M := + (ae_restrict_mem measurableSet_ball).mono fun _ hx ↦ Metric.ball_subset_closedBall hx + have hd := (radialDensity_integral_hasDerivAt 0 M (n-1) hψ μ hμ t).2 + have ht0 : 0 < t := (one_div_pos.mpr hM).trans ht + have hfin (r : ℝ) (hr : 0 < r) : perimeterMeasure E (Metric.ball 0 r) ≠ ⊤ := by + rw [perimeterMeasure_open E Metric.isOpen_ball] + exact (hmin.2.1 0 r hr).ne + have he (s : ℝ) (hs : 1/M < s) : + (∫ x, radialDensityIntegrand 0 (n-1) ψ s x ∂μ) = + ∫ x, radialDensityIntegrand 0 (n-1) ψ t x ∂μ := by + have hs0 := (one_div_pos.mpr hM).trans hs + change (∫ x in Metric.ball 0 M, _ ∂perimeterMeasure E) = + ∫ x in Metric.ball 0 M, _ ∂perimeterMeasure E + rw [radialDensity_integral_ball_eq _ hψz hM hs, + radialDensity_integral_ball_eq _ hψz hM ht, + radialDensity_integral_eq_pushforward _ hψ.continuous hs0, + radialDensity_integral_eq_pushforward _ hψ.continuous ht0, + radialScaledMeasure_eq_of_constant_density _ hfin ha hdensity hs0 ht0] + have hdz : HasDerivAt (fun s ↦ ∫ x, radialDensityIntegrand 0 (n-1) ψ s x ∂μ) 0 t := by + apply (hasDerivAt_const t (∫ x, radialDensityIntegrand 0 (n-1) ψ t x ∂μ)).congr_of_eventuallyEq + filter_upwards [lt_mem_nhds ht] with s hs + exact he s hs + exact hd.unique hdz + +theorem minimizing_radial_tangent_of_constant_density {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + {a : ℝ} (ha : 0 ≤ a) + (hdensity : ∀ r : ℝ, 0 < r → (perimeterMeasure E).real (Metric.ball 0 r) = a*r^(n-1)) : + ∀ᵐ x ∂perimeterMeasure E, inner ℝ (approximateNormal E x) x = 0 := by + let ψ : ℝ → ℝ := fun s ↦ expNegInvGlue (1-s) + have hψ : ContDiff ℝ ∞ ψ := expNegInvGlue.contDiff.comp (contDiff_const.sub contDiff_id) + have hψz (s : ℝ) (hs : 1 ≤ s) : ψ s = 0 := + expNegInvGlue.zero_of_nonpos (by linarith) + have hψd (s : ℝ) : deriv ψ s = -((1-s)⁻¹^2 * expNegInvGlue (1-s)) := by + have hg : HasDerivAt expNegInvGlue ((1-s)⁻¹^2 * expNegInvGlue (1-s)) (1-s) := by + simpa using expNegInvGlue.hasDerivAt_polynomial_eval_inv_mul 1 (1-s) + simpa [ψ, Function.comp_def] using (hg.comp s ((hasDerivAt_id s).const_sub 1)).deriv + have hlocal (R : ℝ) (hR : 0 < R) : + ∀ᵐ x ∂(perimeterMeasure E).restrict (Metric.ball 0 R), + inner ℝ (approximateNormal E x) x = 0 := by + let M := 2*R + let t := 1/R + have hM : 0 < M := by dsimp [M]; positivity + have ht0 : 0 < t := one_div_pos.mpr hR + have ht : 1/M < t := one_div_lt_one_div_of_lt hR (by dsimp [M]; linarith) + have htM : 1/t < M := by dsimp [t, M]; rw [one_div_one_div]; linarith + let μ := (perimeterMeasure E).restrict (Metric.ball 0 M) + have : IsFiniteMeasure μ := ⟨by + rw [Measure.restrict_apply_univ, perimeterMeasure_open E Metric.isOpen_ball] + exact hmin.2.1 0 M hM⟩ + have hμ : ∀ᵐ x ∂μ, x ∈ Metric.closedBall 0 M := + (ae_restrict_mem measurableSet_ball).mono fun _ hx ↦ Metric.ball_subset_closedBall hx + let V : Euc n → Euc n := fun x ↦ ψ (t^2*‖x‖^2) • x + have hV : ContDiff ℝ ∞ V := + (hψ.comp (contDiff_const.mul (contDiff_id.norm_sq (𝕜 := ℝ)))).smul contDiff_id + have hp : tsupport (fun x : Euc n ↦ ψ (t^2*‖x‖^2)) ⊆ Metric.closedBall 0 (1/t) := by + simpa only [sub_zero] using (radialProfile_tsupport (n := n) 0 hψz ht0) + have hs : tsupport V ⊆ Metric.closedBall 0 (1/t) := + (tsupport_smul_subset_left (fun x : Euc n ↦ ψ (t^2*‖x‖^2)) + (id : Euc n → Euc n)).trans hp + have hc : HasCompactSupport V := + (isCompact_closedBall (0 : Euc n) (1/t)).of_isClosed_subset (isClosed_tsupport _) hs + have hdiv := minimizing_tangentialDivergence_integral_eq_zero hn hmin 0 hM hV hc + (hs.trans (Metric.closedBall_subset_ball htM)) + have hD0 := minimizing_radialDensityDerivative_eq_zero_of_constant_density + hmin ha hdensity hM hψ hψz ht + have hDi := (radialDensity_integral_hasDerivAt 0 M (n-1) hψ μ hμ t).1 + have hVi := (tangentialDivergence_integrable_ball_perimeter hmin 0 hM hV).const_mul + (t^((n-1)-1)) + let q : Euc n → ℝ := fun x ↦ t^((n-1)-1)*tangentialDivergence E V x - + radialDensityDerivative 0 (n-1) ψ t x + have hqi : Integrable q μ := hVi.sub hDi + have hqformula : ∀ᵐ x ∂μ, q x = + (2*t^((n-1)-1)*t^2*(inner ℝ (approximateNormal E x) x)^2) * + ((1-t^2*‖x‖^2)⁻¹^2 * expNegInvGlue (1-t^2*‖x‖^2)) := by + filter_upwards [ae_restrict_of_ae (minimizing_halfspaceBlowup_ae hn hmin)] with x hx + have hpow : t^(n-1) = t^((n-1)-1)*t := by + rw [← pow_succ, Nat.sub_add_cancel (by omega : 1 ≤ n-1)] + have hvf := tangentialDivergence_radialProfile (by omega : 0 + (r ^ n)⁻¹ * ∫ y in Metric.ball x r, + |E.indicator (fun _ => (1 : ℝ)) y - + {z | inner ℝ (z - x) v < 0}.indicator (fun _ => (1 : ℝ)) y|) + (𝓝[>] (0 : ℝ)) (𝓝 0) + +def approximateNormal {n : ℕ} (E : Set (Euc n)) (x : Euc n) : Euc n := by + classical + exact if h : ∃ v, HasHalfspaceBlowup E x v then Classical.choose h else 0 + +def tangentialGradient {n : ℕ} (E : Set (Euc n)) (φ : Euc n → ℝ) + (x : Euc n) : Euc n := + gradient φ x - (inner ℝ (gradient φ x) (approximateNormal E x)) • + approximateNormal E x + +theorem eventually_sublevel_membership {n : ℕ} {E : Set (Euc n)} + {f : Euc n → ℝ} {x z : Euc n} {L : Euc n →L[ℝ] ℝ} + (hd : HasFDerivAt f L x) (hx : f x = 0) + (hlocal : ∀ᶠ y in 𝓝 x, y ∈ E ↔ f y < 0) (hz : L z ≠ 0) : + ∀ᶠ r : ℝ in 𝓝[>] 0, x + r • z ∈ E ↔ L z < 0 := by + have hp : HasDerivAt (fun r : ℝ ↦ x + r • z) z 0 := by + simpa using ((hasDerivAt_id (0 : ℝ)).smul_const z).const_add x + have hc : HasDerivAt (fun r : ℝ ↦ f (x + r • z)) (L z) 0 := by + exact (show HasFDerivAt f L (x + (0 : ℝ) • z) from by simpa using hd).comp_hasDerivAt 0 hp + have ht : Tendsto (fun r : ℝ ↦ r⁻¹ * f (x + r • z)) (𝓝[>] 0) (𝓝 (L z)) := by + simpa [hx] using hc.tendsto_slope_zero_right + have hm : ∀ᶠ r : ℝ in 𝓝[>] 0, x + r • z ∈ E ↔ f (x + r • z) < 0 := + (show Tendsto (fun r : ℝ ↦ x + r • z) (𝓝[>] 0) (𝓝 x) from + (show Tendsto (fun r : ℝ ↦ x + r • z) (𝓝 0) (𝓝 x) from by + simpa [ContinuousAt] using hp.continuousAt).mono_left nhdsWithin_le_nhds).eventually hlocal + rcases lt_or_gt_of_ne hz with hneg | hpos + · filter_upwards [hm, ht.eventually (gt_mem_nhds hneg), self_mem_nhdsWithin] with r hm hr hpr + have hfr : f (x + r • z) < 0 := by + have hi : 0 < r⁻¹ := inv_pos.mpr hpr + nlinarith + simp only [hm, hfr, hneg] + · filter_upwards [hm, ht.eventually (lt_mem_nhds hpos), self_mem_nhdsWithin] with r hm hr hpr + have hfr : 0 < f (x + r • z) := by + have hi : 0 < r⁻¹ := inv_pos.mpr hpr + nlinarith + simp only [hm, not_lt.mpr hfr.le, not_lt.mpr hpos.le] + +theorem normalized_ball_integral {n : ℕ} (g : Euc n → ℝ) (x : Euc n) + {r : ℝ} (hr : 0 < r) : + (r ^ n)⁻¹ * ∫ y in Metric.ball x r, g y = + ∫ z in Metric.ball (0 : Euc n) 1, g (x + r • z) := by + have hc := Measure.integral_comp_smul_of_nonneg (volume : Measure (Euc n)) + (fun y ↦ (Metric.ball x r).indicator g (x + y)) r (hR := hr.le) + simp only [finrank_euclideanSpace, Fintype.card_fin, smul_eq_mul, + integral_add_left_eq_self, integral_indicator measurableSet_ball] at hc + rw [← hc, ← integral_indicator measurableSet_ball] + apply integral_congr_ae + filter_upwards [] with z + have hm : x + r • z ∈ Metric.ball x r ↔ z ∈ Metric.ball (0 : Euc n) 1 := by + simp only [Metric.mem_ball, dist_eq_norm, add_sub_cancel_left, + sub_zero, norm_smul, Real.norm_eq_abs, abs_of_pos hr] + constructor <;> intro h <;> nlinarith + by_cases hz : z ∈ Metric.ball (0 : Euc n) 1 + · simp [hz, hm.mpr hz] + · have hn : x + r • z ∉ Metric.ball x r := fun h ↦ hz (hm.mp h) + rw [Set.indicator_of_notMem hn, Set.indicator_of_notMem hz] + +theorem ae_linear_ne_zero {n : ℕ} {L : Euc n →L[ℝ] ℝ} (hL : L ≠ 0) : + ∀ᵐ z ∂(volume : Measure (Euc n)), L z ≠ 0 := by + have hk : L.ker ≠ ⊤ := by + intro hk + apply hL + ext z + have hz : z ∈ L.ker := hk ▸ Submodule.mem_top + exact hz + have hn : (volume : Measure (Euc n)) {z | L z = 0} = 0 := + Measure.addHaar_submodule (volume : Measure (Euc n)) L.ker hk + simpa only [ae_iff, not_not] using hn + +theorem halfspace_indicator_rescale {n : ℕ} (x v z : Euc n) {r : ℝ} (hr : 0 < r) : + {y | inner ℝ (y - x) v < 0}.indicator (fun _ ↦ (1 : ℝ)) (x + r • z) = + {y | inner ℝ y v < 0}.indicator (fun _ ↦ (1 : ℝ)) z := by + have hm : inner ℝ ((x + r • z) - x) v < 0 ↔ inner ℝ z v < 0 := by + simp only [add_sub_cancel_left, real_inner_smul_left] + constructor <;> intro h <;> nlinarith + simp only [Set.indicator, Set.mem_ofPred_eq, hm] + +theorem hasHalfspaceBlowup_of_regular_sublevel {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) {f : Euc n → ℝ} {x v : Euc n} {L : Euc n →L[ℝ] ℝ} + (hd : HasFDerivAt f L x) (hx : f x = 0) + (hlocal : ∀ᶠ y in 𝓝 x, y ∈ E ↔ f y < 0) + (hv : ‖v‖ = 1) {a : ℝ} (ha : 0 < a) + (hL : ∀ z, L z = a * inner ℝ z v) : HasHalfspaceBlowup E x v := by + have hLn : L ≠ 0 := by + intro he + have hval := hL v + simp only [he, zero_apply, real_inner_self_eq_norm_sq, hv, + one_pow, mul_one] at hval + linarith + let H : Set (Euc n) := {z | inner ℝ z v < 0} + have hH : MeasurableSet H := + (isOpen_lt (continuous_id.inner continuous_const) continuous_const).measurableSet + let F : ℝ → Euc n → ℝ := fun r z ↦ + |E.indicator (fun _ ↦ (1 : ℝ)) (x + r • z) - H.indicator (fun _ ↦ (1 : ℝ)) z| + have hsign : ∀ z, L z < 0 ↔ inner ℝ z v < 0 := by + intro z + rw [hL] + constructor <;> intro h <;> nlinarith + have hmeas : ∀ r, AEStronglyMeasurable (F r) + (volume.restrict (Metric.ball (0 : Euc n) 1)) := by + intro r + have he : Measurable (E.indicator (fun _ : Euc n ↦ (1 : ℝ))) := + measurable_const.indicator hE + have hh : Measurable (H.indicator (fun _ : Euc n ↦ (1 : ℝ))) := + measurable_const.indicator hH + have hm : Measurable (fun z : Euc n ↦ x + r • z) := + measurable_const.add (measurable_id.const_smul r) + exact ((he.comp hm).sub hh).abs.aestronglyMeasurable + have hb : ∀ r, ∀ᵐ z ∂volume.restrict (Metric.ball (0 : Euc n) 1), ‖F r z‖ ≤ 1 := by + intro r + filter_upwards [] with z + by_cases he : x + r • z ∈ E <;> by_cases hh : z ∈ H <;> simp [F, he, hh] + have ht : ∀ᵐ z ∂volume.restrict (Metric.ball (0 : Euc n) 1), + Tendsto (fun r ↦ F r z) (𝓝[>] (0 : ℝ)) (𝓝 0) := by + filter_upwards [ae_restrict_of_ae (ae_linear_ne_zero hLn)] with z hz + apply tendsto_const_nhds.congr' + filter_upwards [eventually_sublevel_membership hd hx hlocal hz] with r hr + have hmem : x + r • z ∈ E ↔ z ∈ H := hr.trans (hsign z) + by_cases he : x + r • z ∈ E + · simp [F, he, hmem.mp he] + · have hhn : z ∉ H := fun hh ↦ he (hmem.mpr hh) + simp only [F, Set.indicator_of_notMem he, Set.indicator_of_notMem hhn, + sub_self, abs_zero] + have hi : Integrable (fun _ : Euc n ↦ (1 : ℝ)) + (volume.restrict (Metric.ball 0 1)) := integrableOn_const measure_ball_lt_top.ne + have hconv := tendsto_integral_filter_of_dominated_convergence + (fun _ : Euc n ↦ (1 : ℝ)) (Eventually.of_forall hmeas) (Eventually.of_forall hb) hi ht + refine ⟨hv, ?_⟩ + have heq : ∀ᶠ r : ℝ in 𝓝[>] 0, + (r ^ n)⁻¹ * (∫ y in Metric.ball x r, + |E.indicator (fun _ ↦ (1 : ℝ)) y - + {z | inner ℝ (z - x) v < 0}.indicator (fun _ ↦ (1 : ℝ)) y|) = + ∫ z in Metric.ball (0 : Euc n) 1, F r z := by + filter_upwards [self_mem_nhdsWithin] with r hr + rw [normalized_ball_integral _ x hr] + apply integral_congr_ae + filter_upwards [] with z + simp only [halfspace_indicator_rescale x v z hr, F, H] + exact (show Tendsto (fun r ↦ ∫ z in Metric.ball (0 : Euc n) 1, F r z) + (𝓝[>] (0 : ℝ)) (𝓝 0) from by simpa only [integral_zero] using hconv).congr' (Filter.EventuallyEq.symm heq) + +theorem hasHalfspaceBlowup_gradient {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) {f : Euc n → ℝ} {x : Euc n} + (hd : DifferentiableAt ℝ f x) (hx : f x = 0) (hdf : fderiv ℝ f x ≠ 0) + (hlocal : ∀ᶠ y in 𝓝 x, y ∈ E ↔ f y < 0) : + HasHalfspaceBlowup E x (‖gradient f x‖⁻¹ • gradient f x) := by + have hg : gradient f x ≠ 0 := by + intro he + apply hdf + ext z + rw [← inner_gradient_left, he, inner_zero_left] + rfl + have hng : 0 < ‖gradient f x‖ := norm_pos_iff.mpr hg + apply hasHalfspaceBlowup_of_regular_sublevel hE hd.hasFDerivAt hx hlocal + (a := ‖gradient f x‖) + · rw [norm_smul, Real.norm_of_nonneg (inv_nonneg.mpr hng.le), inv_mul_cancel₀ hng.ne'] + · exact hng + · intro z + rw [real_inner_smul_right, ← inner_gradient_left, real_inner_comm] + field_simp + +theorem halfspace_wedge_nonempty {n : ℕ} {v w : Euc n} + (hv : ‖v‖ = 1) (hw : ‖w‖ = 1) (hne : v ≠ w) : + (Metric.ball (0 : Euc n) 1 ∩ + {z | inner ℝ z v < 0} ∩ {z | 0 < inner ℝ z w}).Nonempty := by + have hdiff : 0 < ‖w - v‖ := norm_pos_iff.mpr (sub_ne_zero.mpr hne.symm) + have hinner : inner ℝ w v < 1 := by + have hs := norm_sub_sq_real w v + rw [hv, hw] at hs + nlinarith [sq_pos_of_pos hdiff] + refine ⟨(1 / 4 : ℝ) • (w - v), ⟨?_, ?_⟩, ?_⟩ + · rw [Metric.mem_ball, dist_zero_right, norm_smul] + have hn : ‖w - v‖ ≤ 2 := (norm_sub_le w v).trans (by rw [hw, hv]; norm_num) + norm_num + linarith + · simp only [Set.mem_ofPred_eq, real_inner_smul_left, inner_sub_left, + real_inner_self_eq_norm_sq, hv] + nlinarith + · simp only [Set.mem_ofPred_eq, real_inner_smul_left, inner_sub_left, + real_inner_self_eq_norm_sq, hw, real_inner_comm w v] + nlinarith + +theorem eq_of_halfspace_indicator_ae {n : ℕ} {v w : Euc n} + (hv : ‖v‖ = 1) (hw : ‖w‖ = 1) + (he : {z | inner ℝ z v < 0}.indicator (fun _ ↦ (1 : ℝ)) =ᵐ[ + volume.restrict (Metric.ball (0 : Euc n) 1)] + {z | inner ℝ z w < 0}.indicator (fun _ ↦ (1 : ℝ))) : v = w := by + by_contra hne + let U : Set (Euc n) := Metric.ball 0 1 ∩ {z | inner ℝ z v < 0} ∩ {z | 0 < inner ℝ z w} + have hUo : IsOpen U := (Metric.isOpen_ball.inter + (isOpen_lt (continuous_id.inner continuous_const) continuous_const)).inter + (isOpen_lt continuous_const (continuous_id.inner continuous_const)) + have hUp : 0 < (volume : Measure (Euc n)) U := + hUo.measure_pos _ (halfspace_wedge_nonempty hv hw hne) + have hUs : U ⊆ Metric.ball 0 1 := fun _ hz ↦ hz.1.1 + have hUr : 0 < volume.restrict (Metric.ball (0 : Euc n) 1) U := by + rwa [Measure.restrict_apply hUo.measurableSet, inter_eq_left.mpr hUs] + obtain ⟨z, hz, hze⟩ := Measure.exists_mem_of_measure_ne_zero_of_ae hUr.ne' (ae_restrict_of_ae he) + have hzv : z ∈ {y | inner ℝ y v < 0} := hz.1.2 + have hzwp : 0 < inner ℝ z w := hz.2 + have hzw : z ∉ {y | inner ℝ y w < 0} := not_lt.mpr hzwp.le + simp only [Set.indicator_of_mem hzv, Set.indicator_of_notMem hzw, one_ne_zero] at hze + +theorem integrable_rescaled_indicator {n : ℕ} {E : Set (Euc n)} (hE : MeasurableSet E) + (x : Euc n) (r : ℝ) : + Integrable (fun z ↦ E.indicator (fun _ ↦ (1 : ℝ)) (x + r • z)) + (volume.restrict (Metric.ball (0 : Euc n) 1)) := by + have hAff : Measurable (fun z : Euc n ↦ x + r • z) := + measurable_const.add (measurable_id.const_smul r) + have he : Measurable (E.indicator (fun _ : Euc n ↦ (1 : ℝ))) := + measurable_const.indicator hE + apply (integrableOn_const measure_ball_lt_top.ne (C := (1 : ℝ))).mono' + (he.comp hAff).aestronglyMeasurable + filter_upwards [] with z + by_cases hz : x + r • z ∈ E <;> simp [hz] + +theorem HasHalfspaceBlowup.tendstoInMeasure {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) {x v : Euc n} (hv : HasHalfspaceBlowup E x v) : + TendstoInMeasure (volume.restrict (Metric.ball (0 : Euc n) 1)) + (fun r z ↦ E.indicator (fun _ ↦ (1 : ℝ)) (x + r • z)) (𝓝[>] (0 : ℝ)) + ({z | inner ℝ z v < 0}.indicator (fun _ ↦ (1 : ℝ))) := by + let μ := (volume : Measure (Euc n)).restrict (Metric.ball 0 1) + let χ : ℝ → Euc n → ℝ := fun r z ↦ E.indicator (fun _ ↦ (1 : ℝ)) (x + r • z) + let H : Set (Euc n) := {z | inner ℝ z v < 0} + let ψ : Euc n → ℝ := H.indicator (fun _ ↦ (1 : ℝ)) + have hH : MeasurableSet H := + (isOpen_lt (continuous_id.inner continuous_const) continuous_const).measurableSet + have hχ : ∀ r, Integrable (χ r) μ := integrable_rescaled_indicator hE x + have hψ : Integrable ψ μ := + (integrableOn_const measure_ball_lt_top.ne (C := (1 : ℝ))).indicator hH + have hconv : Tendsto (fun r ↦ ∫ z, |χ r z - ψ z| ∂μ) (𝓝[>] (0 : ℝ)) (𝓝 0) := by + apply hv.2.congr' + filter_upwards [self_mem_nhdsWithin] with r hr + rw [normalized_ball_integral _ x hr] + apply integral_congr_ae + filter_upwards [] with z + simp only [χ, ψ, H, halfspace_indicator_rescale x v z hr] + apply tendstoInMeasure_of_tendsto_eLpNorm (p := 1) one_ne_zero + have heq : (fun r ↦ eLpNorm (χ r - ψ) 1 μ) = + (fun r ↦ ENNReal.ofReal (∫ z, |χ r z - ψ z| ∂μ)) := by + funext r + rw [eLpNorm_one_eq_lintegral_enorm ((hχ r).sub hψ).aestronglyMeasurable, + ← ofReal_integral_norm_eq_lintegral_enorm ((hχ r).sub hψ)] + rfl + change Tendsto (fun r ↦ eLpNorm (χ r - ψ) 1 μ) _ _ + rw [heq] + simpa only [Function.comp_def, ENNReal.ofReal_zero] using + ENNReal.continuous_ofReal.continuousAt.tendsto.comp hconv + +theorem HasHalfspaceBlowup.unique {n : ℕ} {E : Set (Euc n)} (hE : MeasurableSet E) + {x v w : Euc n} (hv : HasHalfspaceBlowup E x v) (hw : HasHalfspaceBlowup E x w) : + v = w := by + apply eq_of_halfspace_indicator_ae hv.1 hw.1 + exact tendstoInMeasure_ae_unique (hv.tendstoInMeasure hE) (hw.tendstoInMeasure hE) + +theorem approximateNormal_eq_of_blowup {n : ℕ} {E : Set (Euc n)} (hE : MeasurableSet E) + {x v : Euc n} (hv : HasHalfspaceBlowup E x v) : approximateNormal E x = v := by + have hex : ∃ w, HasHalfspaceBlowup E x w := ⟨v, hv⟩ + rw [approximateNormal, dite_eq_left hex] + exact (Classical.choose_spec hex).unique hE hv + +theorem approximateNormal_eq_gradient {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) {f : Euc n → ℝ} {x : Euc n} + (hd : DifferentiableAt ℝ f x) (hx : f x = 0) (hdf : fderiv ℝ f x ≠ 0) + (hlocal : ∀ᶠ y in 𝓝 x, y ∈ E ↔ f y < 0) : + approximateNormal E x = ‖gradient f x‖⁻¹ • gradient f x := + approximateNormal_eq_of_blowup hE (hasHalfspaceBlowup_gradient hE hd hx hdf hlocal) + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +namespace RPI.Boundary + +theorem surfaceGradient_eq_tangentialGradient {n : ℕ} {E S : Set (Space n)} + (hE : MeasurableSet E) {f g : Space n → ℝ} {x : Space n} + (hf : ContDiffAt ℝ 1 f x) (hfx : f x = 0) (hdf : fderiv ℝ f x ≠ 0) + (hlevel : ∀ᶠ y in 𝓝 x, y ∈ S ↔ f y = 0) + (hfilled : ∀ᶠ y in 𝓝 x, y ∈ E ↔ f y < 0) : + surfaceGradient S g x = RPISingularHarnack.tangentialGradient E g x := by + have hgrad : gradient f x ≠ 0 := by + intro he + apply hdf + rw [← toDual_gradient, he, map_zero] + have hn : ‖gradient f x‖ ≠ 0 := norm_ne_zero_iff.mpr hgrad + rw [surfaceGradient_eq_level_formula hf hdf (by simpa only [hfx] using hlevel), + RPISingularHarnack.tangentialGradient, + RPISingularHarnack.approximateNormal_eq_gradient hE + (hf.differentiableAt (by norm_num)) hfx hdf hfilled, + real_inner_smul_right, smul_smul, real_inner_comm (gradient f x) (gradient g x)] + congr 2 + field_simp + +end RPI.Boundary + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +namespace RPISingularHarnack + +def divergence {n : ℕ} (V : Euc n → Euc n) (x : Euc n) : ℝ := + ∑ i : Fin n, inner ℝ ((EuclideanSpace.basisFun (Fin n) ℝ) i) + (fderiv ℝ V x ((EuclideanSpace.basisFun (Fin n) ℝ) i)) + +def perimeter {n : ℕ} (E U : Set (Euc n)) : ℝ≥0∞ := + ⨆ (V : Euc n → Euc n) (_ : ContDiff ℝ ∞ V) (_ : HasCompactSupport V) + (_ : tsupport V ⊆ U) (_ : ∀ x, ‖V x‖ ≤ 1), + ENNReal.ofReal (∫ x in E, divergence V x) + +def perimeterSupport {n : ℕ} (E : Set (Euc n)) : Set (Euc n) := + {x | ∀ r : ℝ, 0 < r → 0 < perimeter E (Metric.ball x r)} + +def IsLocallyPerimeterMinimizing {n : ℕ} (E : Set (Euc n)) : Prop := + MeasurableSet E ∧ + (∀ x (r : ℝ), 0 < r → perimeter E (Metric.ball x r) < ⊤) ∧ + ∀ x (r : ℝ), 0 < r → ∀ F : Set (Euc n), MeasurableSet F → + IsCompact (closure (symmDiff E F)) → + closure (symmDiff E F) ⊆ Metric.ball x r → + perimeter E (Metric.ball x r) ≤ perimeter F (Metric.ball x r) + +def IsCone {n : ℕ} (E : Set (Euc n)) : Prop := + ∀ r : ℝ, 0 < r → ∀ x : Euc n, r • x ∈ E ↔ x ∈ E + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/CoupledConeLink.lean b/lean/OAI/Geometry/Perimeter/Regularity/CoupledConeLink.lean new file mode 100644 index 0000000000000000000000000000000000000000..c202ea92be70b032c37e4005965be514f0305231 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/CoupledConeLink.lean @@ -0,0 +1,168 @@ +import OAI.Geometry.Perimeter.Regularity.RawConeLink + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +namespace RPISingularHarnack +namespace SphericalFrankel + +lemma angle_swap {n : ℕ} (e f : Frame n) : angle f e = angle e f := real_inner_comm _ _ + +lemma cross_swap {n : ℕ} (e f : Frame n) : cross f e = cross e f := real_inner_comm _ _ + +lemma traceProduct_swap {n : ℕ} (e f : Frame n) : traceProduct f e = traceProduct e f := by + simp only [traceProduct, angle_swap, real_inner_comm f.1 e.2, + real_inner_comm f.2 e.1, real_inner_comm f.2 e.2] + ring + +lemma continuous_defect_reverse {n : ℕ} : + Continuous (fun p : Frame n × Frame n ↦ defect p.2 p.1) := by + unfold defect proj + fun_prop + +lemma product_frames {n : ℕ} {μ ν : Measure (Frame n)} [IsFiniteMeasure μ] [IsFiniteMeasure ν] + (hμ : ∀ᵐ e ∂μ, IsFrame e) (hν : ∀ᵐ e ∂ν, IsFrame e) : + ∀ᵐ p ∂μ.prod ν, IsFrame p.1 ∧ IsFrame p.2 := by + apply (Measure.ae_prod_iff_ae_ae + ((isClosed_frames n).prod (isClosed_frames n)).measurableSet).mpr + filter_upwards [hμ] with e he + filter_upwards [hν] with f hf + exact ⟨he, hf⟩ + +lemma stationary_product_integral {n : ℕ} {μ ν : Measure (Frame n)} + [IsFiniteMeasure μ] [IsFiniteMeasure ν] + (hμ : ∀ᵐ e ∂μ, IsFrame e) (hν : ∀ᵐ e ∂ν, IsFrame e) + (hS : LinkStationary μ) (W : Frame n → Euc n → Euc n) + (hW : ∀ f, ContDiff ℝ ∞ (W f)) + (G : Frame n × Frame n → ℝ) (hG : Continuous G) + (heq : ∀ e f, IsFrame e → IsFrame f → G (e,f) = linkDiv e (W f)) : + (∫ p, G p ∂μ.prod ν) = 0 := by + rw [integral_prod_symm G (integrable_pairFrameFunction (product_frames hμ hν) hG)] + calc + (∫ f, ∫ e, G (e, f) ∂μ ∂ν) = ∫ f, (0 : ℝ) ∂ν := by + apply integral_congr_ae + filter_upwards [hν] with f hf + calc + (∫ e, G (e,f) ∂μ) = ∫ e, linkDiv e (W f) ∂μ := by + apply integral_congr_ae + filter_upwards [hμ] with e he + exact heq e f he hf + _ = 0 := hS.firstVariation (W f) (hW f) + _ = 0 := by simp + +lemma stationary_gradient_one {n : ℕ} {μ ν : Measure (Frame n)} + [IsFiniteMeasure μ] [IsFiniteMeasure ν] + (hμ : ∀ᵐ e ∂μ, IsFrame e) (hν : ∀ᵐ e ∂ν, IsFrame e) + (hS : LinkStationary μ) {φ : ℝ → ℝ} (hφ : ContDiff ℝ ∞ φ) : + (∫ p, deriv φ (angle p.1 p.2) * defect p.1 p.2 ∂μ.prod ν) = + ((n : ℝ)-2) * ∫ p, φ (angle p.1 p.2) * angle p.1 p.2 ∂μ.prod ν := by + have hd := hφ.continuous_deriv (by simp) + have h0 := stationary_product_integral hμ hν hS + (fun f z ↦ φ (inner ℝ z f.1) • f.1) + (fun f ↦ (hφ.comp (contDiff_id.inner ℝ contDiff_const)).smul contDiff_const) + (fun p ↦ deriv φ (angle p.1 p.2) * defect p.1 p.2 - + ((n : ℝ)-2) * (φ (angle p.1 p.2) * angle p.1 p.2)) + (((hd.comp continuous_angle).mul continuous_defect).sub + (continuous_const.mul ((hφ.continuous.comp continuous_angle).mul continuous_angle))) + (fun e f he hf ↦ by + rw [linkDiv_scalar_constant he (hφ.differentiable (by simp))] + ring) + have hi1 : Integrable (fun p : Frame n × Frame n ↦ deriv φ (angle p.1 p.2) * defect p.1 p.2) (μ.prod ν) := + integrable_pairFrameFunction (product_frames hμ hν) + ((hd.comp continuous_angle).mul continuous_defect) + have hi2 : Integrable (fun p : Frame n × Frame n ↦ φ (angle p.1 p.2) * angle p.1 p.2) (μ.prod ν) := + integrable_pairFrameFunction (product_frames hμ hν) + ((hφ.continuous.comp continuous_angle).mul continuous_angle) + rw [integral_sub hi1 (hi2.const_mul ((n : ℝ)-2)), integral_const_mul] at h0 + exact sub_eq_zero.mp h0 + +lemma stationary_mixed_one {n : ℕ} {μ ν : Measure (Frame n)} + [IsFiniteMeasure μ] [IsFiniteMeasure ν] + (hμ : ∀ᵐ e ∂μ, IsFrame e) (hν : ∀ᵐ e ∂ν, IsFrame e) + (hS : LinkStationary μ) {φ : ℝ → ℝ} (hφ : ContDiff ℝ ∞ φ) : + (∫ p, deriv φ (angle p.1 p.2) * cross p.1 p.2 ∂μ.prod ν) + + (∫ p, φ (angle p.1 p.2) * traceProduct p.1 p.2 ∂μ.prod ν) - + ((n : ℝ)-2) * ∫ p, φ (angle p.1 p.2) * defect p.2 p.1 ∂μ.prod ν = 0 := by + have hd := hφ.continuous_deriv (by simp) + have hswap : Continuous (fun p : Frame n × Frame n ↦ defect p.2 p.1) := + continuous_defect_reverse + have hC : Continuous (fun p : Frame n × Frame n ↦ deriv φ (angle p.1 p.2) * cross p.1 p.2) := + (hd.comp continuous_angle).mul continuous_cross + have hT : Continuous (fun p : Frame n × Frame n ↦ φ (angle p.1 p.2) * traceProduct p.1 p.2) := + (hφ.continuous.comp continuous_angle).mul continuous_traceProduct + have hD : Continuous (fun p : Frame n × Frame n ↦ φ (angle p.1 p.2) * defect p.2 p.1) := + (hφ.continuous.comp continuous_angle).mul hswap + have h0 := stationary_product_integral hμ hν hS + (fun f z ↦ φ (inner ℝ z f.1) • projMap f z) + (fun f ↦ (hφ.comp (contDiff_id.inner ℝ contDiff_const)).smul (projMap f).contDiff) + (fun p ↦ deriv φ (angle p.1 p.2) * cross p.1 p.2 + + φ (angle p.1 p.2) * traceProduct p.1 p.2 - + ((n : ℝ)-2) * (φ (angle p.1 p.2) * defect p.2 p.1)) + ((hC.add hT).sub (continuous_const.mul hD)) + (fun e f he hf ↦ by + rw [linkDiv_scalar_proj he hf (hφ.differentiable (by simp))] + ring) + have hiC := integrable_pairFrameFunction (product_frames hμ hν) hC + have hiT := integrable_pairFrameFunction (product_frames hμ hν) hT + have hiD := integrable_pairFrameFunction (product_frames hμ hν) hD + have hiCT : Integrable (fun p : Frame n × Frame n ↦ + deriv φ (angle p.1 p.2) * cross p.1 p.2 + + φ (angle p.1 p.2) * traceProduct p.1 p.2) (μ.prod ν) := hiC.add hiT + rwa [integral_sub hiCT (hiD.const_mul ((n : ℝ)-2)), integral_add hiC hiT, + integral_const_mul] at h0 + +lemma coupledStationarity_product {n : ℕ} {μ ν : Measure (Frame n)} + [IsFiniteMeasure μ] [IsFiniteMeasure ν] + (hμ : ∀ᵐ e ∂μ, IsFrame e) (hν : ∀ᵐ e ∂ν, IsFrame e) + (hSμ : LinkStationary μ) (hSν : LinkStationary ν) : CoupledStationarity (μ.prod ν) := by + constructor + · intro φ hφ + have hd := hφ.continuous_deriv (by simp) + have hi1 : Integrable (fun p : Frame n × Frame n ↦ deriv φ (angle p.1 p.2) * defect p.1 p.2) (μ.prod ν) := + integrable_pairFrameFunction (product_frames hμ hν) + ((hd.comp continuous_angle).mul continuous_defect) + have hi2 : Integrable (fun p : Frame n × Frame n ↦ deriv φ (angle p.1 p.2) * defect p.2 p.1) (μ.prod ν) := + integrable_pairFrameFunction (product_frames hμ hν) + ((hd.comp continuous_angle).mul (continuous_defect_reverse)) + have h1 := stationary_gradient_one hμ hν hSμ hφ + have h2 := stationary_gradient_one hν hμ hSν hφ + rw [← integral_prod_swap (fun p : Frame n × Frame n ↦ deriv φ (angle p.1 p.2) * defect p.1 p.2), + ← integral_prod_swap (fun p : Frame n × Frame n ↦ φ (angle p.1 p.2) * angle p.1 p.2)] at h2 + simp only [Prod.fst_swap, Prod.snd_swap, angle_swap] at h2 + simp_rw [mul_add] + rw [integral_add hi1 hi2, h1, h2] + ring + · intro φ hφ + have h1 := stationary_mixed_one hμ hν hSμ hφ + have h2 := stationary_mixed_one hν hμ hSν hφ + rw [← integral_prod_swap (fun p : Frame n × Frame n ↦ deriv φ (angle p.1 p.2) * cross p.1 p.2), + ← integral_prod_swap (fun p : Frame n × Frame n ↦ φ (angle p.1 p.2) * traceProduct p.1 p.2), + ← integral_prod_swap (fun p : Frame n × Frame n ↦ φ (angle p.1 p.2) * defect p.2 p.1)] at h2 + simp only [Prod.fst_swap, Prod.snd_swap, angle_swap, cross_swap, traceProduct_swap] at h2 + have hi1 : Integrable (fun p : Frame n × Frame n ↦ φ (angle p.1 p.2) * defect p.1 p.2) (μ.prod ν) := + integrable_pairFrameFunction (product_frames hμ hν) + ((hφ.continuous.comp continuous_angle).mul continuous_defect) + have hi2 : Integrable (fun p : Frame n × Frame n ↦ φ (angle p.1 p.2) * defect p.2 p.1) (μ.prod ν) := + integrable_pairFrameFunction (product_frames hμ hν) + ((hφ.continuous.comp continuous_angle).mul (continuous_defect_reverse)) + simp_rw [mul_add] + rw [integral_add hi1 hi2] + linarith + +lemma minimizing_cones_coupledStationarity {n : ℕ} (hn : 1 < n) {E F : Set (Euc n)} + (hE : IsLocallyPerimeterMinimizing E) (hF : IsLocallyPerimeterMinimizing F) + (hcE : IsCone E) (hcF : IsCone F) : + CoupledStationarity ((annularLink E).prod (annularLink F)) := by + let := annularLink_finite hE + let := annularLink_finite hF + exact coupledStationarity_product (annularLink_frames hn hE hcE) (annularLink_frames hn hF hcF) + (annularLink_stationary hn hE hcE) (annularLink_stationary hn hF hcF) + +end SphericalFrankel +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/DilatedVolumeTest.lean b/lean/OAI/Geometry/Perimeter/Regularity/DilatedVolumeTest.lean new file mode 100644 index 0000000000000000000000000000000000000000..bb808f135abf1f0e8a97dcc48826b6347aa85249 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/DilatedVolumeTest.lean @@ -0,0 +1,321 @@ +import OAI.Geometry.Perimeter.Regularity.ConeRadialCap + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +open scoped ENNReal Topology ContDiff +open scoped Topology ENNReal +namespace RPISingularHarnack + +def dilatedVolumeTest {n : ℕ} (φ : Euc n → ℝ) (t : ℝ) (x : Euc n) : ℝ := + t^n * φ (t • x) + +def dilatedVolumeTestDerivative {n : ℕ} (φ : Euc n → ℝ) (t : ℝ) (x : Euc n) : ℝ := + (n : ℝ)*t^(n-1)*φ (t • x) + t^n * fderiv ℝ φ (t • x) x + +theorem dilatedVolumeTest_hasDerivAt {n : ℕ} {φ : Euc n → ℝ} + (hφ : ContDiff ℝ ∞ φ) (t : ℝ) (x : Euc n) : + HasDerivAt (fun s ↦ dilatedVolumeTest φ s x) (dilatedVolumeTestDerivative φ t x) t := by + have hp : HasDerivAt (fun s : ℝ ↦ s • x) x t := by + simpa using (hasDerivAt_id t).smul_const x + have hc := ((hφ.differentiable (by simp)) (t • x)).hasFDerivAt.comp_hasDerivAt t hp + convert (hasDerivAt_pow n t).mul hc using 1 <;> rfl + +theorem dilatedVolumeTest_continuous {n : ℕ} {φ : Euc n → ℝ} + (hφ : ContDiff ℝ ∞ φ) : + Continuous (fun p : ℝ × Euc n ↦ dilatedVolumeTest φ p.1 p.2) := by + unfold dilatedVolumeTest + fun_prop + +theorem dilatedVolumeTestDerivative_continuous {n : ℕ} {φ : Euc n → ℝ} + (hφ : ContDiff ℝ ∞ φ) : + Continuous (fun p : ℝ × Euc n ↦ dilatedVolumeTestDerivative φ p.1 p.2) := by + have hd := hφ.continuous_fderiv (by simp) + unfold dilatedVolumeTestDerivative + fun_prop + +theorem dilatedVolumeTest_integral_hasDerivAt {n : ℕ} {φ : Euc n → ℝ} + (hφ : ContDiff ℝ ∞ φ) (M : ℝ) (μ : Measure (Euc n)) [IsFiniteMeasure μ] + (hμ : ∀ᵐ x ∂μ, x ∈ Metric.closedBall 0 M) (t : ℝ) : + Integrable (dilatedVolumeTestDerivative φ t) μ ∧ + HasDerivAt (fun s ↦ ∫ x, dilatedVolumeTest φ s x ∂μ) + (∫ x, dilatedVolumeTestDerivative φ t x ∂μ) t := by + have hcF (s : ℝ) : Continuous (dilatedVolumeTest φ s) := + (dilatedVolumeTest_continuous hφ).comp (continuous_const.prodMk continuous_id) + have hcD (s : ℝ) : Continuous (dilatedVolumeTestDerivative φ s) := + (dilatedVolumeTestDerivative_continuous hφ).comp (continuous_const.prodMk continuous_id) + obtain ⟨C, hC⟩ := (isCompact_closedBall (0:Euc n) M).exists_bound_of_continuousOn (hcF t).continuousOn + have hFi : Integrable (dilatedVolumeTest φ t) μ := + Integrable.of_bound (hcF t).aestronglyMeasurable C (hμ.mono (fun x hx ↦ hC x hx)) + have hcB : ContinuousOn (fun p : ℝ × Euc n ↦ dilatedVolumeTestDerivative φ p.1 p.2) + (Icc (t-1) (t+1) ×ˢ Metric.closedBall 0 M) := + (dilatedVolumeTestDerivative_continuous hφ).continuousOn + obtain ⟨B, hB⟩ := ((isCompact_Icc : IsCompact (Icc (t-1) (t+1))).prod + (isCompact_closedBall (0:Euc n) M)).exists_bound_of_continuousOn hcB + apply hasDerivAt_integral_of_dominated_loc_of_deriv_le + (s := Ioo (t-1) (t+1)) (bound := fun _ ↦ B) (Ioo_mem_nhds (by linarith) (by linarith)) + (Eventually.of_forall fun s ↦ (hcF s).aestronglyMeasurable) hFi + (hcD t).aestronglyMeasurable ?_ (integrable_const B) (Eventually.of_forall ?_) + · filter_upwards [hμ] with x hx + intro s hs + exact hB (s,x) ⟨⟨hs.1.le,hs.2.le⟩,hx⟩ + · intro x s _ + exact dilatedVolumeTest_hasDerivAt hφ s x + +theorem dilatedVolumeTestDerivative_eq_divergence {n : ℕ} (hn : 0 < n) + {φ : Euc n → ℝ} (hφ : ContDiff ℝ ∞ φ) (t : ℝ) (x : Euc n) : + dilatedVolumeTestDerivative φ t x = + t^(n-1) * divergence (fun y ↦ φ (t • y) • y) x := by + have hη : Differentiable ℝ (fun y : Euc n ↦ φ (t • y)) := + (hφ.differentiable (by simp)).comp (differentiable_id.const_smul t) + have hp := divergence_smul hη (differentiable_id (𝕜 := ℝ) (E := Euc n)) x + change divergence (fun y ↦ φ (t • y) • y) x = _ at hp + rw [hp, inner_gradient_left] + have hid : divergence (id : Euc n → Euc n) x = n := by + simp [divergence, fderiv_id] + have hc := (((hφ.differentiable (by simp)) (t • x)).hasFDerivAt.comp x + ((hasFDerivAt_id x).const_smul t)).fderiv + simp only [Function.comp_def] at hc + rw [hid] + simp only [id_eq] + have hDx : fderiv ℝ (fun y ↦ φ (t • y)) x x = t * fderiv ℝ φ (t • x) x := by + rw [hc] + simp only [ContinuousLinearMap.comp_apply, smul_apply, + ContinuousLinearMap.id_apply, map_smul, smul_eq_mul] + rw [hDx] + unfold dilatedVolumeTestDerivative + have hpow : t^n = t^(n-1)*t := by rw [← pow_succ, Nat.sub_add_cancel hn] + rw [hpow] + ring + +theorem minimizing_radial_divergence_eq_zero {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (hrad : ∀ᵐ x ∂perimeterMeasure E, inner ℝ (approximateNormal E x) x = 0) + {φ : Euc n → ℝ} (hφ : ContDiff ℝ ∞ φ) (hcφ : HasCompactSupport φ) : + (∫ x in E, divergence (fun y ↦ φ y • y) x) = 0 := by + obtain ⟨r, hr⟩ := (Metric.isBounded_iff_subset_ball (0 : Euc n)).mp hcφ.isBounded + let R := max r 1 + have hR : 0 < R := lt_of_lt_of_le zero_lt_one (le_max_right _ _) + have hsφ : tsupport φ ⊆ Metric.ball (0:Euc n) R := + hr.trans (Metric.ball_subset_ball (le_max_left _ _)) + let V : Euc n → Euc n := fun y ↦ φ y • y + have hV : ContDiff ℝ ∞ V := hφ.smul contDiff_id + have hs : tsupport V ⊆ tsupport φ := tsupport_smul_subset_left _ _ + have hc : HasCompactSupport V := hcφ.of_isClosed_subset (isClosed_tsupport _) hs + rw [minimizing_gaussGreen_local hn hmin (Metric.ball 0 R) Metric.isOpen_ball + (hmin.2.1 0 R hR).ne V hV hc (hs.trans hsφ)] + apply integral_eq_zero_of_ae + filter_upwards [ae_restrict_of_ae hrad] with x hx + simp only [V, real_inner_smul_right, hx, mul_zero, Pi.zero_apply] + +theorem tsupport_dilation_subset_ball {n : ℕ} {φ : Euc n → ℝ} {R : ℝ} + (hs : tsupport φ ⊆ Metric.ball (0:Euc n) R) {t : ℝ} (ht : 0 < t) : + tsupport (fun x ↦ φ (t • x)) ⊆ Metric.ball (0:Euc n) (R/t) := by + intro x hx + have hh := hs (tsupport_comp_subset_preimage φ (continuous_id.const_smul t) hx) + change t • x ∈ Metric.ball 0 R at hh + simp only [Metric.mem_ball, dist_zero_right, norm_smul, Real.norm_of_nonneg ht.le] at hh ⊢ + exact (lt_div_iff₀ ht).mpr (by simpa only [mul_comm] using hh) + +theorem dilatedVolumeTest_zero_outside {n : ℕ} {φ : Euc n → ℝ} {R M t : ℝ} + (hs : tsupport φ ⊆ Metric.ball (0:Euc n) R) (ht : 0 < t) (hM : R/t ≤ M) + {x : Euc n} (hx : x ∉ Metric.ball 0 M) : + dilatedVolumeTest φ t x = 0 ∧ dilatedVolumeTestDerivative φ t x = 0 := by + have htx : t • x ∉ tsupport φ := by + intro h + apply hx + have hn := hs h + have hn' : x ∈ Metric.ball (0:Euc n) (R/t) := by + simp only [Metric.mem_ball, dist_zero_right, norm_smul, Real.norm_of_nonneg ht.le] at hn ⊢ + exact (lt_div_iff₀ ht).mpr (by simpa only [mul_comm] using hn) + exact Metric.ball_subset_ball hM hn' + have hz := image_eq_zero_of_notMem_tsupport htx + have hd := fderiv_of_notMem_tsupport ℝ htx + simp only [dilatedVolumeTest, dilatedVolumeTestDerivative, hz, hd, + zero_apply, mul_zero, add_zero, and_self] + +theorem minimizing_dilatedVolumeTestDerivative_integral_eq_zero {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (hrad : ∀ᵐ x ∂perimeterMeasure E, inner ℝ (approximateNormal E x) x = 0) + {φ : Euc n → ℝ} (hφ : ContDiff ℝ ∞ φ) (hcφ : HasCompactSupport φ) + {t : ℝ} (ht : 0 < t) : + (∫ x in E, dilatedVolumeTestDerivative φ t x) = 0 := by + have hφt : ContDiff ℝ ∞ (fun x ↦ φ (t • x)) := hφ.comp (contDiff_id.const_smul t) + obtain ⟨r, hr⟩ := (Metric.isBounded_iff_subset_ball (0:Euc n)).mp hcφ.isBounded + have hs := tsupport_dilation_subset_ball hr ht + have hct : HasCompactSupport (fun x ↦ φ (t • x)) := + (isCompact_closedBall (0:Euc n) (r/t)).of_isClosed_subset (isClosed_tsupport _) + (hs.trans Metric.ball_subset_closedBall) + simp_rw [dilatedVolumeTestDerivative_eq_divergence (by omega : 0 simp [hx] + simp_rw [hprod, integral_indicator hF, integral_indicator hmin.1] + exact hfint + apply Filter.eventuallyEqSet_iff.mpr + filter_upwards [he] with x hx + change x ∈ F ↔ x ∈ E + by_cases hxF : x ∈ F <;> by_cases hxE : x ∈ E <;> simp_all + +theorem minimizing_isCone_phaseSupport_of_radial_tangent {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (hrad : ∀ᵐ x ∂perimeterMeasure E, inner ℝ (approximateNormal E x) x = 0) : + IsCone (volume.restrict E).support := by + have hforward {x : Euc n} (hx : x ∈ (volume.restrict E).support) + {r : ℝ} (hr : 0 < r) : r • x ∈ (volume.restrict E).support := by + let F : Set (Euc n) := {y | r⁻¹ • y ∈ E} + have hFE : F =ᵐ[volume] E := minimizing_dilation_ae_eq hn hmin hrad hr + apply Metric.nhds_basis_ball.mem_measureSupport.mpr + intro R hR + rw [Measure.restrict_apply measurableSet_ball] + have hp := Metric.nhds_basis_ball.mem_measureSupport.mp hx (R/r) (div_pos hR hr) + rw [Measure.restrict_apply measurableSet_ball] at hp + have hs : r • (Metric.ball x (R/r) ∩ E) ⊆ Metric.ball (r • x) R ∩ F := by + rintro y ⟨z, hz, rfl⟩ + refine ⟨?_, ?_⟩ + · change dist (r • z) (r • x) < R + rw [dist_smul₀, Real.norm_of_nonneg hr.le] + simpa only [mul_comm] using (lt_div_iff₀ hr).mp hz.1 + · simpa only [F, mem_ofPred_eq, inv_smul_smul₀ hr.ne'] using hz.2 + have hnull : volume (Metric.ball (r • x) R ∩ F) = + volume (Metric.ball (r • x) R ∩ E) := by + apply measure_congr + apply Filter.eventuallyEqSet_iff.mpr + filter_upwards [hFE.mem_iff] with y hy + exact and_congr_right (fun _ ↦ hy) + rw [← hnull] + apply lt_of_lt_of_le _ (measure_mono (μ := volume) hs) + rw [Measure.addHaar_smul_of_nonneg volume hr.le] + exact ENNReal.mul_pos (ENNReal.ofReal_pos.mpr (pow_pos hr _)).ne' hp.ne' + intro r hr x + constructor + · intro hx + have hh := hforward hx (inv_pos.mpr hr) + simpa only [inv_smul_smul₀ hr.ne'] using hh + · exact fun hx ↦ hforward hx hr + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +open scoped ENNReal Topology ContDiff +open scoped Topology ENNReal +namespace RPISingularHarnack + +theorem minimizing_constant_density_conical_representative {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + {a : ℝ} (ha : 0 ≤ a) + (hdensity : ∀ r : ℝ, 0 < r → (perimeterMeasure E).real (Metric.ball 0 r) = a*r^(n-1)) : + let K := (volume.restrict E).support + IsClosed K ∧ E =ᵐ[volume] K ∧ IsLocallyPerimeterMinimizing K ∧ IsCone K ∧ + frontier K = perimeterSupport E := by + let K := (volume.restrict E).support + have hK : IsClosed K := Measure.isClosed_support + have hp := Real.HolderConjugate.conjExponent (by exact_mod_cast hn : 1 < (n : ℝ)) + have hEK : E =ᵐ[volume] K := minimizing_ae_eq_phaseSupport hp hmin + have hrad := minimizing_radial_tangent_of_constant_density hn hmin ha hdensity + exact ⟨hK, hEK, hmin.of_ae hEK hK.measurableSet, + minimizing_isCone_phaseSupport_of_radial_tangent hn hmin hrad, + minimizing_frontier_phaseSupport hp hmin⟩ + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/EllipticC1Limit.lean b/lean/OAI/Geometry/Perimeter/Regularity/EllipticC1Limit.lean new file mode 100644 index 0000000000000000000000000000000000000000..ec151b1007a7705fdcbea0864c7ab97e32a9e1e5 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/EllipticC1Limit.lean @@ -0,0 +1,68 @@ +import OAI.Geometry.Perimeter.Regularity.EllipticContraction +import OAI.Geometry.Perimeter.Regularity.EllipticCompactGradient + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +variable {n : ℕ} + + theorem C1_limit_of_uniform_gradients {f : ℕ → Euc n → ℝ} {g : Euc n → ℝ} + (hf : ∀ i, ContDiff ℝ 1 (f i)) {p : Euc n} {r : ℝ} + {W : Euc n → Euc n} (hW : ContinuousOn W (Metric.closedBall p r)) + (hgrad : TendstoUniformlyOn (fun i ↦ gradient (f i)) W atTop (Metric.closedBall p r)) + (hlim : ∀ x∈Metric.ball p r, Tendsto (fun i ↦ f i x) atTop (𝓝 (g x))) : + ContDiffOn ℝ 1 g (Metric.ball p r) ∧ ∀ x∈Metric.ball p r, gradient g x=W x := by + let D : Euc n → Euc n →L[ℝ] ℝ := fun x ↦ InnerProductSpace.toDual ℝ (Euc n) (W x) + have hDlim : TendstoUniformlyOn (fun i ↦ fderiv ℝ (f i)) D atTop (Metric.ball p r) := by + rw [Metric.tendstoUniformlyOn_iff] + intro ε hε + filter_upwards [(Metric.tendstoUniformlyOn_iff.mp hgrad) ε hε] with i hi x hx + have hh := hi x (Metric.ball_subset_closedBall hx) + change dist (InnerProductSpace.toDual ℝ (Euc n) (W x)) (fderiv ℝ (f i) x)<ε + rw [show fderiv ℝ (f i) x=InnerProductSpace.toDual ℝ (Euc n) (gradient (f i) x) from + (LinearIsometryEquiv.apply_symm_apply _ _).symm, + (InnerProductSpace.toDual ℝ (Euc n)).isometry.dist_eq] + exact hh + have hD (x : Euc n) (hx : x∈Metric.ball p r) : HasFDerivAt g (D x) x := + hasFDerivAt_of_tendstoUniformlyOn Metric.isOpen_ball hDlim + (fun i x _ ↦ (hf i).differentiable (by simp) x |>.hasFDerivAt) hlim hx + constructor + · change ContDiffOn ℝ (0+1) g (Metric.ball p r) + rw [contDiffOn_succ_iff_hasFDerivWithinAt_of_uniqueDiffOn Metric.isOpen_ball.uniqueDiffOn] + refine ⟨by simp,D,?_,fun x hx ↦ (hD x hx).hasFDerivWithinAt⟩ + apply contDiffOn_zero.mpr + exact (InnerProductSpace.toDual ℝ (Euc n)).continuous.comp_continuousOn + (hW.mono Metric.ball_subset_closedBall) + · intro x hx + rw [gradient,(hD x hx).fderiv] + exact LinearIsometryEquiv.symm_apply_apply _ _ + + theorem C1_limit_of_geometric_gradient_estimates {f : ℕ → Euc n → ℝ} {g : Euc n → ℝ} + (hf : ∀ i, ContDiff ℝ 1 (f i)) {p : Euc n} {r θ R C B : ℝ} + (hθ : 0<θ) (hR : 0.comp + (RPI.Boundary.c1Mollify_fderiv_tendsto hφ hcφ x) + exact (tendsto_const_nhds : Tendsto (fun _ : ℕ ↦ G x) atTop (𝓝 (G x))).inner hg + + theorem continuous_div_free_C1_test {G : Euc n → Euc n} (hG : Continuous G) + (p : Euc n) (r : ℝ) + (h : ∀ φ : SmoothLocalTest (Metric.ball p r), (∫ x, inner ℝ (G x) (gradient φ.val x))=0) + {φ : Euc n → ℝ} (hφ : ContDiff ℝ 1 φ) (hcφ : HasCompactSupport φ) + (hsφ : tsupport φ ⊆ Metric.ball p r) : + (∫ x, inner ℝ (G x) (gradient φ x))=0 := by + let φj := RPI.Boundary.c1Mollify φ + have hs := RPI.Boundary.c1Mollify_eventually_tsupport_subset hcφ Metric.isOpen_ball hsφ + have hlim := mollified_gradient_pairing_tendsto hG p r hφ hcφ + have hz : ∀ᶠ j in atTop, (∫ x in Metric.ball p r, inner ℝ (G x) (gradient (φj j) x))=0 := by + filter_upwards [hs] with j hj + rw [←integral_inner_gradient_eq_setIntegral measurableSet_ball hj] + exact h ⟨φj j,RPI.Boundary.c1Mollify_contDiff hφ.continuous j, + RPI.Boundary.c1Mollify_hasCompactSupport hcφ j,hj⟩ + rw [integral_inner_gradient_eq_setIntegral measurableSet_ball hsφ] + exact tendsto_nhds_unique hlim (tendsto_const_nhds.congr' (hz.mono (fun _ hj ↦ hj.symm))) + + theorem WeakLinearEquation.test_C1 {A : Euc n → Euc n →L[ℝ] Euc n} + {f : Euc n → ℝ} {F : Euc n → Euc n} (hA : Continuous A) (hf : ContDiff ℝ 1 f) + (hF : Continuous F) {p : Euc n} {r : ℝ} (h : WeakLinearEquation A f F (Metric.ball p r)) + {φ : Euc n → ℝ} (hφ : ContDiff ℝ 1 φ) (hcφ : HasCompactSupport φ) + (hsφ : tsupport φ ⊆ Metric.ball p r) : + (∫ x, inner ℝ (A x (gradient f x)-F x) (gradient φ x))=0 := by + apply continuous_div_free_C1_test ((hA.clm_apply (gradient_continuous_C1 hf)).sub hF) p r _ hφ hcφ hsφ + intro ψ + change (∫ x, inner ℝ (A x (gradient f x)-F x) (gradient ψ.val x))=0 + simp_rw [inner_sub_left] + erw [integral_sub (inner_gradient_pairing_integrable (hA.clm_apply (gradient_continuous_C1 hf)) ψ) + (inner_gradient_pairing_integrable hF ψ),h ψ,sub_self] + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/EllipticCaccioppoli.lean b/lean/OAI/Geometry/Perimeter/Regularity/EllipticCaccioppoli.lean new file mode 100644 index 0000000000000000000000000000000000000000..b154c015df702e43be4865c06b5f4eb05a07899f --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/EllipticCaccioppoli.lean @@ -0,0 +1,88 @@ +import OAI.Geometry.Perimeter.Regularity.EllipticC1Test +import OAI.Geometry.Perimeter.Regularity.EllipticCaccioppoliAlgebra + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +variable {n : ℕ} + + theorem continuous_inner_gradient_integrable {G : Euc n → Euc n} {f : Euc n → ℝ} + (hG : Continuous G) (hf : ContDiff ℝ 1 f) (hcf : HasCompactSupport f) : + Integrable (fun x ↦ inner ℝ (G x) (gradient f x)) volume := by + apply (hG.inner (gradient_continuous_C1 hf)).integrable_of_hasCompactSupport + apply (gradient_hasCompactSupport hcf).of_isClosed_subset (isClosed_tsupport _) + apply closure_mono + intro x hx + exact fun hz ↦ hx (by simp [hz]) + + theorem square_weight_integrable {u : Euc n → ℝ} {G : Euc n → Euc n} + (hu : Continuous u) (hcu : HasCompactSupport u) (hG : Continuous G) : + Integrable (fun x ↦ (u x)^2*‖G x‖^2) volume := by + apply ((hu.pow 2).mul (hG.norm.pow 2)).integrable_of_hasCompactSupport + apply hcu.of_isClosed_subset (isClosed_tsupport _) + apply closure_mono + intro x hx + exact fun hz ↦ hx (by simp [hz]) + + theorem square_compact_field_integrable {u : Euc n → ℝ} {G : Euc n → Euc n} + (hu : Continuous u) (hG : Continuous G) (hcG : HasCompactSupport G) : + Integrable (fun x ↦ (u x)^2*‖G x‖^2) volume := by + apply ((hu.pow 2).mul (hG.norm.pow 2)).integrable_of_hasCompactSupport + apply hcG.of_isClosed_subset (isClosed_tsupport _) + apply closure_mono + intro x hx + exact fun hz ↦ hx (by simp [hz]) + + theorem caccioppoli_test_bound {A : Euc n → Euc n →L[ℝ] Euc n} + {f : Euc n → ℝ} {F : Euc n → Euc n} (hf : ContDiff ℝ 1 f) + {p : Euc n} {r : ℝ} + (hnear : ∀ x∈Metric.ball p r, ‖ContinuousLinearMap.id ℝ (Euc n)-A x‖≤1/2) + {χ : Euc n → ℝ} (hχ : ContDiff ℝ 1 χ) + (hsχ : tsupport χ ⊆ Metric.ball p r) (x : Euc n) : (χ x)^2*‖gradient f x‖^2 ≤ + 4*inner ℝ (A x (gradient f x)-F x) (gradient (fun y ↦ χ y*χ y*f y) x)+256*((f x)^2*‖gradient χ x‖^2+(χ x)^2*‖F x‖^2) := by + by_cases hx : x∈tsupport χ + · rw [gradient_square_test (hf.differentiable (by simp)) (hχ.differentiable (by simp))] + exact caccioppoli_pointwise (A x) (hnear x (hsχ hx)) (gradient f x) (gradient χ x) (F x) (χ x) (f x) + · have hχ0 := image_eq_zero_of_notMem_tsupport hx + have hD0 : gradient χ x=0 := image_eq_zero_of_notMem_tsupport (fun hh ↦ hx (gradient_tsupport_subset χ hh)) + rw [gradient_square_test (hf.differentiable (by simp)) (hχ.differentiable (by simp)),hχ0,hD0] + simp + + theorem WeakLinearEquation.caccioppoli {A : Euc n → Euc n →L[ℝ] Euc n} + {f : Euc n → ℝ} {F : Euc n → Euc n} (hA : Continuous A) (hf : ContDiff ℝ 1 f) + (hF : Continuous F) {p : Euc n} {r : ℝ} (h : WeakLinearEquation A f F (Metric.ball p r)) + (hnear : ∀ x∈Metric.ball p r, ‖ContinuousLinearMap.id ℝ (Euc n)-A x‖≤1/2) + {χ : Euc n → ℝ} (hχ : ContDiff ℝ 1 χ) (hcχ : HasCompactSupport χ) + (hsχ : tsupport χ ⊆ Metric.ball p r) : + (∫ x, (χ x)^2*‖gradient f x‖^2) ≤ + 256*((∫ x, (f x)^2*‖gradient χ x‖^2)+(∫ x, (χ x)^2*‖F x‖^2)) := by + let φ := fun x ↦ χ x*χ x*f x + have hφ : ContDiff ℝ 1 φ := hχ.mul hχ |>.mul hf + have hcφ : HasCompactSupport φ := hcχ.mul_right.mul_right + have hsφ : tsupport φ ⊆ Metric.ball p r := + tsupport_mul_subset_left.trans (tsupport_mul_subset_left.trans hsχ) + have hz := h.test_C1 hA hf hF hφ hcφ hsφ + let J := fun x ↦ inner ℝ (A x (gradient f x)-F x) (gradient φ x) + have hJ : Integrable J volume := continuous_inner_gradient_integrable + ((hA.clm_apply (gradient_continuous_C1 hf)).sub hF) hφ hcφ + have hI := square_weight_integrable hχ.continuous hcχ (gradient_continuous_C1 hf) + have hI₁ := square_compact_field_integrable hf.continuous (gradient_continuous_C1 hχ) + (gradient_hasCompactSupport hcχ) + have hI₂ := square_weight_integrable hχ.continuous hcχ hF + have hpt := caccioppoli_test_bound (F := F) hf hnear hχ hsχ + have hh := integral_mono hI ((hJ.const_mul 4).add ((hI₁.add hI₂).const_mul 256)) hpt + simp only [Pi.add_apply] at hh + erw [integral_add (hJ.const_mul 4) ((hI₁.add hI₂).const_mul 256),integral_const_mul, + integral_const_mul,integral_add hI₁ hI₂] at hh + change (∫ x,J x)=0 at hz + rw [hz,mul_zero,zero_add] at hh + exact hh + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/EllipticCaccioppoliAlgebra.lean b/lean/OAI/Geometry/Perimeter/Regularity/EllipticCaccioppoliAlgebra.lean new file mode 100644 index 0000000000000000000000000000000000000000..71936033e18e42e952abe52ebe4a93272b924b57 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/EllipticCaccioppoliAlgebra.lean @@ -0,0 +1,83 @@ +import OAI.Geometry.Perimeter.Regularity.ContinuousWithinAtSurfaceGradientOfLocalLevel + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +variable {n : ℕ} + + theorem near_identity_bounds (A : Euc n →L[ℝ] Euc n) + (hA : ‖ContinuousLinearMap.id ℝ (Euc n)-A‖≤1/2) (ξ : Euc n) : + ‖A ξ‖≤2*‖ξ‖ ∧ ‖ξ‖^2/2≤ inner ℝ (A ξ) ξ := by + have he := (ContinuousLinearMap.id ℝ (Euc n)-A).le_opNorm ξ + simp only [sub_apply,ContinuousLinearMap.id_apply] at he + have he' : ‖ξ-A ξ‖≤(1/2)*‖ξ‖ := he.trans (mul_le_mul_of_nonneg_right hA (norm_nonneg ξ)) + have hn := norm_sub_le ξ (ξ-A ξ) + simp only [sub_sub_cancel] at hn + have hi := abs_real_inner_le_norm (ξ-A ξ) ξ + rw [inner_sub_left,real_inner_self_eq_norm_sq] at hi + have hi' := (le_abs_self (‖ξ‖^2-inner ℝ (A ξ) ξ)).trans hi + have he'' := mul_le_mul_of_nonneg_right he' (norm_nonneg ξ) + constructor <;> nlinarith [norm_nonneg ξ] + + theorem caccioppoli_scalar {X Y Z J : ℝ} + (hJ : X^2/2-4*X*Y-X*Z-2*Y*Z≤J) : + X^2≤4*J+256*(Y^2+Z^2) := by + nlinarith [sq_nonneg (X-16*Y),sq_nonneg (X-4*Z),sq_nonneg (Y-Z),sq_nonneg Y,sq_nonneg Z] + + theorem caccioppoli_pointwise (A : Euc n →L[ℝ] Euc n) + (hA : ‖ContinuousLinearMap.id ℝ (Euc n)-A‖≤1/2) (ξ η ζ : Euc n) (c u : ℝ) : + c^2*‖ξ‖^2 ≤ 4*inner ℝ (A ξ-ζ) ((c^2)•ξ+(2*c*u)•η)+ + 256*(u^2*‖η‖^2+c^2*‖ζ‖^2) := by + obtain ⟨hAn,hAi⟩ := near_identity_bounds A hA ξ + have h1 : |(2*c*u)*inner ℝ (A ξ) η|≤4*(|c| * ‖ξ‖)*(|u| * ‖η‖) := by + rw [abs_mul] + have hh := mul_le_mul_of_nonneg_left (abs_real_inner_le_norm (A ξ) η) (abs_nonneg (2*c*u)) + have hh' := mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_right hAn (norm_nonneg η)) (abs_nonneg (2*c*u)) + simp only [abs_mul,abs_of_nonneg (by norm_num : (0:ℝ)≤2)] at hh hh' ⊢ + convert hh.trans hh' using 1 + ring + have h2 : |c^2*inner ℝ ζ ξ|≤(|c| * ‖ξ‖)*(|c| * ‖ζ‖) := by + rw [abs_mul,abs_of_nonneg (sq_nonneg c)] + have hh := mul_le_mul_of_nonneg_left (abs_real_inner_le_norm ζ ξ) (sq_nonneg c) + convert hh using 1 + rw [←sq_abs c] + ring + have h3 : |(2*c*u)*inner ℝ ζ η|≤2*(|u| * ‖η‖)*(|c| * ‖ζ‖) := by + rw [abs_mul] + have hh := mul_le_mul_of_nonneg_left (abs_real_inner_le_norm ζ η) (abs_nonneg (2*c*u)) + simp only [abs_mul,abs_of_nonneg (by norm_num : (0:ℝ)≤2)] at hh ⊢ + convert hh using 1 + ring + have hbase := mul_le_mul_of_nonneg_left hAi (sq_nonneg c) + have hlo : (|c| * ‖ξ‖)^2/2-4*(|c| * ‖ξ‖)*(|u| * ‖η‖)- + (|c| * ‖ξ‖)*(|c| * ‖ζ‖)-2*(|u| * ‖η‖)*(|c| * ‖ζ‖) ≤ + inner ℝ (A ξ-ζ) ((c^2)•ξ+(2*c*u)•η) := by + simp only [inner_add_right,inner_sub_left,real_inner_smul_right] + have hh1 := neg_abs_le ((2*c*u)*inner ℝ (A ξ) η) + have hh2 := le_abs_self (c^2*inner ℝ ζ ξ) + have hh3 := le_abs_self ((2*c*u)*inner ℝ ζ η) + simp only [mul_pow,sq_abs] + nlinarith + have hh := caccioppoli_scalar hlo + simpa only [mul_pow,sq_abs] using hh + + theorem gradient_mul_C1 {f g : Euc n → ℝ} (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) (x : Euc n) : + gradient (fun y ↦ f y*g y) x=f x•gradient g x+g x•gradient f x := by + apply (InnerProductSpace.toDual ℝ (Euc n)).injective + simp only [gradient,map_add,map_smul,LinearIsometryEquiv.apply_symm_apply] + exact fderiv_mul (hf x) (hg x) + + theorem gradient_square_test {f χ : Euc n → ℝ} (hf : Differentiable ℝ f) (hχ : Differentiable ℝ χ) + (x : Euc n) : gradient (fun y ↦ χ y*χ y*f y) x=(χ x)^2•gradient f x+(2*χ x*f x)•gradient χ x := by + rw [gradient_mul_C1 (f := fun y ↦ χ y*χ y) (g := f) (hχ.mul hχ) hf,gradient_mul_C1 hχ hχ] + simp only [smul_add,smul_smul,pow_two] + module + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/EllipticCompactGradient.lean b/lean/OAI/Geometry/Perimeter/Regularity/EllipticCompactGradient.lean new file mode 100644 index 0000000000000000000000000000000000000000..3668cd346836db8583ccf0a5a0fabe519514779b --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/EllipticCompactGradient.lean @@ -0,0 +1,70 @@ +import OAI.Geometry.Perimeter.Regularity.ContinuousWithinAtSurfaceGradientOfLocalLevel + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace BoundedContinuousFunction +namespace RPISingularHarnack +variable {n : ℕ} + + theorem geometric_equicontinuous {X V : Type*} [PseudoMetricSpace X] [PseudoMetricSpace V] + {G : ℕ → X → V} {θ R C : ℝ} (hθ : 0<θ) (hR : 0 simp [hb] + _ = _ := integral_indicator measurableSet_ball + +theorem cutFieldLp_pairing (W : Euc n → Euc n) (hW : Continuous W) (p : Euc n) (r : ℝ) + {g : Euc n → Euc n} (hg : tsupport g ⊆ Metric.ball p r) : + (∫ x, inner ℝ (cutFieldLp W hW p r x) (g x)) = ∫ x, inner ℝ (W x) (g x) := by + apply integral_congr_ae + filter_upwards [cutFieldLp_ae W hW p r] with x hx + rw [hx] + by_cases hb : x∈Metric.ball p r + · simp [hb] + · have hz : g x=0 := image_eq_zero_of_notMem_tsupport (fun h ↦ hb (hg h)) + simp [hz] + +theorem cutGradient_curlFree {f : Euc n → ℝ} (hf : ContDiff ℝ 1 f) (p : Euc n) (r : ℝ) : + CurlFreeLpOn (cutFieldLp (gradient f) (gradient_continuous_C1 hf) p r) (Metric.ball p r) := by + intro φ a b + rw [MeasureTheory.L2.inner_def] + calc + (∫ x, inner ℝ (cutFieldLp (gradient f) (gradient_continuous_C1 hf) p r x) (curlTestLp φ a b x)) = + ∫ x, inner ℝ (cutFieldLp (gradient f) (gradient_continuous_C1 hf) p r x) (curlTest φ.val a b x) := by + apply integral_congr_ae + filter_upwards [curlTestLp_ae φ a b] with x hx + rw [hx] + _ = _ := cutFieldLp_pairing _ _ _ _ ((curlTest_tsupport _ _ _).trans φ.property.2.2) + _ = 0 := C1_gradient_curl_pairing_zero hf φ a b + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/EllipticCutoffEnergy.lean b/lean/OAI/Geometry/Perimeter/Regularity/EllipticCutoffEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..5c39da3a263ed88a7112585f958dbcd762067d74 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/EllipticCutoffEnergy.lean @@ -0,0 +1,64 @@ +import OAI.Geometry.Perimeter.Regularity.EllipticCaccioppoli +import OAI.Geometry.Perimeter.Regularity.EllipticScaleStep + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +variable {n : ℕ} + + theorem cutoff_energy_bound {A : Euc n → Euc n →L[ℝ] Euc n} + {f : Euc n → ℝ} {F : Euc n → Euc n} (hA : Continuous A) (hf : ContDiff ℝ 1 f) + (hF : Continuous F) {p : Euc n} {r : ℝ} (h : WeakLinearEquation A f F (Metric.ball p r)) + (hnear : ∀ x∈Metric.ball p r, ‖ContinuousLinearMap.id ℝ (Euc n)-A x‖≤1/2) + {χ : Euc n → ℝ} (hχ : ContDiff ℝ 1 χ) (hcχ : HasCompactSupport χ) + (hsχ : tsupport χ ⊆ Metric.ball p r) {B N : ℝ} + (hb : ∀ x, |f x|≤B) (hN : ∀ x, ‖F x‖≤N) : + (∫ x, (χ x)^2*‖gradient f x‖^2) ≤ + 256*(B^2*(∫ x, ‖gradient χ x‖^2)+N^2*(∫ x, (χ x)^2)) := by + have hi₁ : Integrable (fun x ↦ ‖gradient χ x‖^2) volume := by + simpa only [one_pow,one_mul] using square_compact_field_integrable + (continuous_const : Continuous (fun _ : Euc n ↦ (1:ℝ))) (gradient_continuous_C1 hχ) + (gradient_hasCompactSupport hcχ) + have hi₂ : Integrable (fun x ↦ (χ x)^2) volume := by + apply (hχ.continuous.pow 2).integrable_of_hasCompactSupport + apply hcχ.of_isClosed_subset (isClosed_tsupport _) + apply closure_mono + intro x hx + exact fun hz ↦ hx (by simp [hz]) + have h1 : (∫ x, (f x)^2*‖gradient χ x‖^2)≤B^2*(∫ x, ‖gradient χ x‖^2) := by + rw [←integral_const_mul] + apply integral_mono (square_compact_field_integrable hf.continuous (gradient_continuous_C1 hχ) + (gradient_hasCompactSupport hcχ)) (hi₁.const_mul _) + intro x + exact mul_le_mul_of_nonneg_right (by nlinarith [hb x,sq_abs (f x),abs_nonneg (f x)]) (sq_nonneg _) + have h2 : (∫ x, (χ x)^2*‖F x‖^2)≤N^2*(∫ x, (χ x)^2) := by + rw [←integral_const_mul] + apply integral_mono (square_weight_integrable hχ.continuous hcχ hF) (hi₂.const_mul _) + intro x + have ht := mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (norm_nonneg (F x)) (hN x) 2) (sq_nonneg (χ x)) + simpa only [mul_comm] using ht + exact (h.caccioppoli hA hf hF hnear hχ hcχ hsχ).trans (by linarith) + + theorem scaled_energy_le_cutoff {f χ : Euc n → ℝ} (hf : ContDiff ℝ 1 f) + (hχ : ContDiff ℝ 1 χ) (hcχ : HasCompactSupport χ) {p : Euc n} {r : ℝ} (hr : 0.const_add x) + have hd : HasDerivAt (fun h : ℝ ↦ f (x+h•e)) (fderiv ℝ f x e) 0 := by + have hf' : HasFDerivAt f (fderiv ℝ f x) (x+(0:ℝ)•e) := by simpa using (hf x).hasFDerivAt + have hh := hf'.comp_hasDerivAt (0:ℝ) ht + simpa only [zero_smul,add_zero,Function.comp_def] using hh + have he : (fun h : ℝ ↦ differenceQuotient f e h x) = _root_.slope (fun h : ℝ ↦ f (x+h•e)) 0 := by + funext h + simp only [_root_.slope,differenceQuotient,vsub_eq_sub,sub_zero,zero_smul,add_zero,smul_eq_mul] + rw [he] + exact hd.tendsto_slope + + theorem weak_nonlinear_difference {G : Euc n → Euc n} (hG : ContDiff ℝ 1 G) + {f : Euc n → ℝ} (hf : ContDiff ℝ 1 f) {U W : Set (Euc n)} + (h : WeakFluxEquation (fun x ↦ G (gradient f x)) U) (hWU : W⊆U) + (e : Euc n) (s : ℝ) (hs : ∀ x∈W, x+s•e∈U) : + WeakLinearEquation (fun x ↦ derivativeSecant G (gradient f x) (gradient f (x+s•e))) + (differenceQuotient f e s) (fun _ ↦ 0) W := by + have hbase : WeakFluxEquation (fun x ↦ G (gradient f x)) W := by + intro φ + exact h ⟨φ.val,φ.property.1,φ.property.2.1,φ.property.2.2.trans hWU⟩ + have hcont := hG.continuous.comp (gradient_continuous_C1 hf) + have hd := ((h.translate (s•e) hs).sub + (hcont.comp (continuous_id.add continuous_const)) hcont hbase).const_smul s⁻¹ + intro φ + have he (x : Euc n) : derivativeSecant G (gradient f x) (gradient f (x+s•e)) + (gradient (differenceQuotient f e s) x)=s⁻¹•(G (gradient f (x+s•e))-G (gradient f x)) := by + rw [differenceQuotient_gradient (hf.differentiable (by simp)),map_smul,derivativeSecant_apply hG] + simp only [he,inner_zero_left,integral_zero] + exact hd φ + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/EllipticExcessStep.lean b/lean/OAI/Geometry/Perimeter/Regularity/EllipticExcessStep.lean new file mode 100644 index 0000000000000000000000000000000000000000..eb74e6e57bb14510ee72e365387462541eaf1ae0 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/EllipticExcessStep.lean @@ -0,0 +1,50 @@ +import OAI.Geometry.Perimeter.Regularity.EllipticLinearStep + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +variable {n : ℕ} + +theorem linear_gradient_excess_step (hn : 0.mpr (le_max_right _ _) + rwa [Real.sq_sqrt (mul_nonneg (by positivity) hS)] at ht + have hball (x : Euc n) (hx : x∈Metric.closedBall p r) : Metric.ball x r⊆Metric.ball p (2*r) := by + intro y hy + have hh := dist_triangle y x p + rw [Metric.mem_closedBall] at hx + rw [Metric.mem_ball] at hy ⊢ + linarith + have huniform (i : ℕ) := linear_uniform_gradient_explicit hθ hθ1 hK hc ha hB hH hr hsmall + (le_max_left _ _) (hA i) (hf i) (hF i) + (fun x hx ↦ (h i).mono ((hball x hx).trans (Metric.ball_subset_ball (by linarith)))) + (fun x hx y hy ↦ (hnear i y ((hball x hx).trans (Metric.ball_subset_ball (by linarith)) hy)).trans (min_le_left _ _)) + (hosc i) (fun x hx ↦ (scaled_energy_le_cutoff (hf i) χ.contDiff χ.hasCompactSupport hr + (fun y hy ↦ χ.one_of_mem_closedBall (Metric.ball_subset_closedBall (hball x hx hy)))).trans + ((mul_le_mul_of_nonneg_left (henergy i) (by positivity)).trans hHe)) + obtain ⟨hg,hmod⟩ := C1_limit_of_geometric_gradient_estimates hf hθ (by positivity : 0 + have hinit' : scaledGradientEnergy f p (θ^0*R) (q 0) ≤ H^2*((1/2)^0)^2 := by + simpa only [hq0,pow_zero,one_pow,one_mul,mul_one] using hinit + obtain ⟨hd,_⟩ := linear_iteration_scalar hK hH ha hB (by positivity : 0 ≤ (1/2:ℝ)^0) + hsmall hforce (norm_nonneg (q 0)) (by simp only [hq0,norm_zero]; positivity) hinit' + (norm_nonneg (next 0 (q 0)-q 0)) (hnext 0 (q 0)).1 (hnext 0 (q 0)).2 + exact ⟨by simp only [hq0,norm_zero,pow_zero,sub_self,mul_zero,le_refl],hinit',by simpa only [hqnext] using hd⟩ + | succ j ih => + have hqnorm : ‖q j‖ ≤ 2*K*H := ih.1.trans (by + have hh : 0 ≤ 2*K*H*(1/2)^j := by positivity + nlinarith) + obtain ⟨_,hE⟩ := linear_iteration_scalar hK hH ha hB (by positivity : 0 ≤ (1/2:ℝ)^j) + hsmall hforce (norm_nonneg (q j)) hqnorm ih.2.1 + (norm_nonneg (next j (q j)-q j)) (hnext j (q j)).1 (hnext j (q j)).2 + have hE' : scaledGradientEnergy f p (θ^(j+1)*R) (q (j+1)) ≤ H^2*((1/2)^(j+1))^2 := by + simpa only [hqnext,pow_succ,div_eq_mul_inv,one_div,one_mul] using hE + have hn : ‖q (j+1)‖ ≤ 2*K*H*(1-(1/2)^(j+1)) := by + have htri := norm_add_le (q j) (q (j+1)-q j) + have he : q j + (q (j+1)-q j) = q (j+1) := by abel + rw [he] at htri + rw [pow_succ] + nlinarith [ih.1,ih.2.2] + have hn' : ‖q (j+1)‖ ≤ 2*K*H := hn.trans (by + have hh : 0 ≤ 2*K*H*(1/2)^(j+1) := by positivity + nlinarith) + obtain ⟨hd,_⟩ := linear_iteration_scalar hK hH ha hB (by positivity : 0 ≤ (1/2:ℝ)^(j+1)) + hsmall hforce (norm_nonneg (q (j+1))) hn' hE' + (norm_nonneg (next (j+1) (q (j+1))-q (j+1))) (hnext (j+1) (q (j+1))).1 (hnext (j+1) (q (j+1))).2 + exact ⟨hn,hE',by simpa only [hqnext] using hd⟩ + exact ⟨q,hq0,fun j ↦ (hbounds j).1,fun j ↦ (hbounds j).2.1,fun j ↦ (hbounds j).2.2⟩ + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/EllipticLinearStep.lean b/lean/OAI/Geometry/Perimeter/Regularity/EllipticLinearStep.lean new file mode 100644 index 0000000000000000000000000000000000000000..8540db75b2415562c9f88b84de3f16790aac5d1c --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/EllipticLinearStep.lean @@ -0,0 +1,91 @@ +import OAI.Geometry.Perimeter.Regularity.EllipticContinuousComparison + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +variable {n : ℕ} + +def WeakLinearEquation (A : Euc n → Euc n →L[ℝ] Euc n) (f : Euc n → ℝ) + (F : Euc n → Euc n) (U : Set (Euc n)) : Prop := + ∀ φ : SmoothLocalTest U, + (∫ x, inner ℝ (A x (gradient f x)) (gradient φ.val x)) = + ∫ x, inner ℝ (F x) (gradient φ.val x) + +def linearResidual (A : Euc n → Euc n →L[ℝ] Euc n) (f : Euc n → ℝ) + (F : Euc n → Euc n) (A₀ : Euc n →L[ℝ] Euc n) (F₀ q : Euc n) (x : Euc n) := + (gradient f x-q) - A x (gradient f x) + F x + (A₀ q-F₀) + +theorem linearResidual_continuous {A : Euc n → Euc n →L[ℝ] Euc n} + {f : Euc n → ℝ} {F : Euc n → Euc n} (hA : Continuous A) (hf : ContDiff ℝ 1 f) + (hF : Continuous F) (A₀ : Euc n →L[ℝ] Euc n) (F₀ q : Euc n) : + Continuous (linearResidual A f F A₀ F₀ q) := + ((((gradient_continuous_C1 hf).sub continuous_const).sub + (hA.clm_apply (gradient_continuous_C1 hf))).add hF).add continuous_const + +theorem linearResidual_pairing {A : Euc n → Euc n →L[ℝ] Euc n} + {f : Euc n → ℝ} {F : Euc n → Euc n} {U : Set (Euc n)} + (hA : Continuous A) (hf : ContDiff ℝ 1 f) (hF : Continuous F) + (h : WeakLinearEquation A f F U) (A₀ : Euc n →L[ℝ] Euc n) (F₀ q : Euc n) + (φ : SmoothLocalTest U) : + (∫ x, inner ℝ (gradient (fun y ↦ f y-inner ℝ q y) x) (gradient φ.val x)) = + ∫ x, inner ℝ (linearResidual A f F A₀ F₀ q x) (gradient φ.val x) := by + have hg := inner_gradient_pairing_integrable (gradient_continuous_C1 hf) φ + have hq := inner_gradient_pairing_integrable (continuous_const : Continuous (fun _ : Euc n ↦ q)) φ + have hAf := inner_gradient_pairing_integrable (hA.clm_apply (gradient_continuous_C1 hf)) φ + have hFi := inner_gradient_pairing_integrable hF φ + have hc := inner_gradient_pairing_integrable + (continuous_const : Continuous (fun _ : Euc n ↦ A₀ q-F₀)) φ + simp_rw [gradient_sub_linear (hf.differentiable (by simp)),linearResidual,inner_add_left,inner_sub_left] + simp_rw [← inner_sub_left (A₀ q) F₀] + erw [integral_add ((hg.sub hq).sub hAf |>.add hFi) hc, + integral_add ((hg.sub hq).sub hAf) hFi,integral_sub (hg.sub hq) hAf, + constant_gradient_pairing_zero φ (A₀ q-F₀),h φ] + ring_nf + rfl + +theorem linearResidual_bound {A : Euc n → Euc n →L[ℝ] Euc n} + {f : Euc n → ℝ} {F : Euc n → Euc n} (A₀ : Euc n →L[ℝ] Euc n) (F₀ q x : Euc n) + {δ α β : ℝ} (hδ : ‖ContinuousLinearMap.id ℝ (Euc n)-A x‖≤δ) + (hα : ‖A₀-A x‖≤α) (hβ : ‖F x-F₀‖≤β) : + ‖linearResidual A f F A₀ F₀ q x‖≤δ*‖gradient f x-q‖+α*‖q‖+β := by + have he : linearResidual A f F A₀ F₀ q x = + (ContinuousLinearMap.id ℝ (Euc n)-A x) (gradient f x-q)+(A₀-A x) q+(F x-F₀) := by + simp only [linearResidual,sub_apply,ContinuousLinearMap.id_apply,map_sub] + abel + rw [he] + have h1 := (ContinuousLinearMap.id ℝ (Euc n)-A x).le_opNorm (gradient f x-q) + have h2 := (A₀-A x).le_opNorm q + have hh := norm_add_le ((ContinuousLinearMap.id ℝ (Euc n)-A x) (gradient f x-q)+(A₀-A x) q) (F x-F₀) + have hh' := norm_add_le ((ContinuousLinearMap.id ℝ (Euc n)-A x) (gradient f x-q)) ((A₀-A x) q) + have h1' := mul_le_mul_of_nonneg_right hδ (norm_nonneg (gradient f x-q)) + have h2' := mul_le_mul_of_nonneg_right hα (norm_nonneg q) + linarith + +theorem continuous_residual_energy_bound {e W : Euc n → Euc n} (he : Continuous e) + (hW : Continuous W) {δ b : ℝ} (hδ : 0≤δ) (hb : 0≤b) + (h : ∀ x∈Metric.ball (0:Euc n) 1, ‖e x‖≤δ*‖W x‖+b) : + (∫ x in Metric.ball (0:Euc n) 1, ‖e x‖^2) ≤ + 2*δ^2*(∫ x in Metric.ball (0:Euc n) 1, ‖W x‖^2)+2*b^2*volume.real (Metric.ball (0:Euc n) 1) := by + have hI (G : Euc n → Euc n) (hG : Continuous G) : + IntegrableOn (fun x ↦ ‖G x‖^2) (Metric.ball (0:Euc n) 1) volume := + ((hG.norm.pow 2).continuousOn.integrableOn_compact (isCompact_closedBall 0 1)).mono_set Metric.ball_subset_closedBall + have : IsFiniteMeasure (volume.restrict (Metric.ball (0:Euc n) 1)) := ⟨by + rw [Measure.restrict_apply_univ]; exact measure_ball_lt_top⟩ + calc + _ ≤ ∫ x in Metric.ball (0:Euc n) 1, 2*δ^2*‖W x‖^2+2*b^2 := by + apply integral_mono_ae (hI e he) (((hI W hW).const_mul _).add (integrable_const _)) + filter_upwards [ae_restrict_mem measurableSet_ball] with x hx + have hsq := (sq_le_sq₀ (norm_nonneg (e x)) + (add_nonneg (mul_nonneg hδ (norm_nonneg (W x))) hb)).2 (h x hx) + change ‖e x‖^2≤2*δ^2*‖W x‖^2+2*b^2 + nlinarith [sq_nonneg (δ*‖W x‖-b)] + _ = _ := by rw [integral_add ((hI W hW).const_mul _) (integrable_const _),integral_const_mul,integral_const]; simp [smul_eq_mul,mul_comm] + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/EllipticLocalExtension.lean b/lean/OAI/Geometry/Perimeter/Regularity/EllipticLocalExtension.lean new file mode 100644 index 0000000000000000000000000000000000000000..852a718faa501dd7bc40991c79413c7391bfde96 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/EllipticLocalExtension.lean @@ -0,0 +1,80 @@ +import OAI.Geometry.Perimeter.Regularity.EllipticDifference + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +variable {n : ℕ} + + theorem contDiff_cutoff {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] + {f : Euc n → V} {U : Set (Euc n)} (hU : IsOpen U) {k : ℕ∞} + (hf : ContDiffOn ℝ k f U) {χ : Euc n → ℝ} (hχ : ContDiff ℝ k χ) + (hsχ : tsupport χ⊆U) : ContDiff ℝ k (fun x ↦ χ x•f x) := by + rw [contDiff_iff_contDiffAt] + intro x + by_cases hx : x∈tsupport χ + · exact hχ.contDiffAt.smul (hf.contDiffAt (hU.mem_nhds (hsχ hx))) + · apply (contDiffAt_const (c := (0:V))).congr_of_eventuallyEq + filter_upwards [(isClosed_tsupport χ).isOpen_compl.mem_nhds hx] with y hy + simp only [image_eq_zero_of_notMem_tsupport hy,zero_smul] + + theorem local_compact_extension {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] + {f : Euc n → V} {U : Set (Euc n)} (hU : IsOpen U) {p : Euc n} (hp : p∈U) + {k : ℕ∞} (hf : ContDiffOn ℝ k f U) : + ∃ r : ℝ, 0 simp [hx] + rw [he,integral_indicator measurableSet_ball] + have hI : IntegrableOn (fun x ↦ u x) (Metric.ball (0:Euc n) 1) volume := + integrableOn_Lp_of_measure_ne_top u (by norm_num) measure_ball_lt_top.ne + calc + _ ≤ ∫ x in Metric.ball (0:Euc n) 1, ‖a‖*‖u x‖ := integral_mono_ae + (((((innerSL ℝ a).comp_memLp u).locallyIntegrable (by norm_num)).integrableOn_isCompact + (isCompact_closedBall (0:Euc n) 1)).mono_set Metric.ball_subset_closedBall).norm + (hI.norm.const_mul _) (ae_of_all _ fun x ↦ norm_inner_le_norm a (u x)) + _ = ‖a‖*(∫ x in Metric.ball (0:Euc n) 1, ‖u x‖) := integral_const_mul _ _ + _ ≤ _ := by rw [mul_assoc]; exact mul_le_mul_of_nonneg_left (localL1_le_L2 u 1) (norm_nonneg a) + +theorem localScalarComponent_weakHarmonic {u : VectorL2 n} + (hd : DivFreeLpOn u (Metric.ball 0 1)) (hc : CurlFreeLpOn u (Metric.ball 0 1)) + (a : Euc n) : WeakHarmonicOn (localScalarComponent u a) (Metric.ball 0 1) := by + apply (div_curl_weak_harmonic hd hc a).congr_on + intro x hx + change inner ℝ a (u x)=(Metric.ball (0:Euc n) 1).indicator (fun z ↦ inner ℝ a (u z)) x + rw [Set.indicator_of_mem hx] + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/EllipticLocality.lean b/lean/OAI/Geometry/Perimeter/Regularity/EllipticLocality.lean new file mode 100644 index 0000000000000000000000000000000000000000..404ee4805a9793c49b81e47ba704b3896d790f1d --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/EllipticLocality.lean @@ -0,0 +1,86 @@ +import OAI.Geometry.Perimeter.Regularity.GeoComposition + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +variable {n : ℕ} + + theorem gradient_eqOn {f g : Euc n → ℝ} {U : Set (Euc n)} (hU : IsOpen U) + (h : EqOn f g U) : EqOn (gradient f) (gradient g) U := by + intro x hx + unfold gradient + congr 1 + exact Filter.EventuallyEq.fderiv_eq (Filter.eventually_of_mem (hU.mem_nhds hx) (fun y hy ↦ h hy)) + + theorem fderiv_eqOn {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] + {f g : Euc n → V} {U : Set (Euc n)} (hU : IsOpen U) + (h : EqOn f g U) : EqOn (fderiv ℝ f) (fderiv ℝ g) U := by + intro x hx + exact Filter.EventuallyEq.fderiv_eq (Filter.eventually_of_mem (hU.mem_nhds hx) (fun y hy ↦ h hy)) + + theorem flux_pairing_eq {V W : Euc n → Euc n} {U : Set (Euc n)} + (h : EqOn V W U) (φ : SmoothLocalTest U) : + (fun x ↦ inner ℝ (V x) (gradient φ.val x)) = fun x ↦ inner ℝ (W x) (gradient φ.val x) := by + funext x + by_cases hx : x∈U + · rw [h hx] + · have hx' : x∉tsupport φ.val := fun hh ↦ hx (φ.property.2.2 hh) + simp only [gradient,fderiv_of_notMem_tsupport ℝ hx',map_zero,inner_zero_right] + + theorem WeakFluxEquation.congr {V W : Euc n → Euc n} {U : Set (Euc n)} + (h : WeakFluxEquation V U) (he : EqOn V W U) : WeakFluxEquation W U := by + intro φ + rw [←flux_pairing_eq he φ] + exact h φ + + theorem WeakLinearEquation.congr {A B : Euc n → Euc n →L[ℝ] Euc n} + {f g : Euc n → ℝ} {F G : Euc n → Euc n} {U : Set (Euc n)} (hU : IsOpen U) + (h : WeakLinearEquation A f F U) (hA : EqOn A B U) (hf : EqOn f g U) + (hF : EqOn F G U) : WeakLinearEquation B g G U := by + have hAf : EqOn (fun x ↦ A x (gradient f x)) (fun x ↦ B x (gradient g x)) U := + fun x hx ↦ by dsimp only; rw [hA hx,gradient_eqOn hU hf hx] + intro φ + change (∫ x, inner ℝ (B x (gradient g x)) (gradient φ.val x)) = _ + rw [←flux_pairing_eq hAf φ,←flux_pairing_eq hF φ] + exact h φ + + theorem compact_continuous_bound {V : Type*} [NormedAddCommGroup V] + {f : Euc n → V} (hf : Continuous f) (hc : HasCompactSupport f) : + ∃ B : ℝ, 0 ≤ B ∧ ∀ x, ‖f x‖ ≤ B := by + obtain ⟨B,hB⟩ := hc.exists_bound_of_continuousOn hf.continuousOn + refine ⟨max 0 B,le_max_left _ _,fun x ↦ ?_⟩ + by_cases hx : x∈tsupport f + · exact (hB x hx).trans (le_max_right _ _) + · rw [image_eq_zero_of_notMem_tsupport hx,norm_zero] + exact le_max_left _ _ + + theorem local_compact_triple {A : Euc n → Euc n →L[ℝ] Euc n} + {f : Euc n → ℝ} {F : Euc n → Euc n} {U : Set (Euc n)} {k l : ℕ∞} + (hU : IsOpen U) {p : Euc n} (hp : p∈U) + (hA : ContDiffOn ℝ k A U) (hf : ContDiffOn ℝ l f U) (hF : ContDiffOn ℝ k F U) : + ∃ W : Set (Euc n), IsOpen W ∧ p∈W ∧ W⊆U ∧ + ∃ B g G, ContDiff ℝ k B ∧ HasCompactSupport B ∧ ContDiff ℝ l g ∧ HasCompactSupport g ∧ + ContDiff ℝ k G ∧ HasCompactSupport G ∧ EqOn B A W ∧ EqOn g f W ∧ EqOn G F W := by + obtain ⟨a,ha,haU,B,hB,hBc,heB⟩ := local_compact_extension hU hp hA + obtain ⟨b,hb,hbU,g,hg,hgc,heg⟩ := local_compact_extension hU hp hf + obtain ⟨c,hc,hcU,G,hG,hGc,heG⟩ := local_compact_extension hU hp hF + let r := min a (min b c) + have hr : 0.mp hGe), + ae_restrict_mem measurableSet_ball] with x hx hxB + have hxH : x∈Metric.ball (0:Euc n) (1/2) := Metric.ball_subset_ball hθ hxB + have hnorm : ‖g x-G 0‖≤C*‖u‖*θ := by + rw [hx hxH] + have hb' := hGL x 0 + rw [sub_zero] at hb' + exact hb'.trans (mul_le_mul (mul_le_mul_of_nonneg_left hgn hC) + (by exact (show ‖x‖<θ by simpa only [Metric.mem_ball,dist_zero_right] using hxB).le) + (norm_nonneg _) (mul_nonneg hC (norm_nonneg _))) + exact (norm_sub_sq_le_two (u x) (g x) (G 0)).trans (by + have hh := pow_le_pow_left₀ (norm_nonneg _) hnorm 2 + linarith) + calc + _ ≤ ∫ x in Metric.ball 0 θ, 2*‖u x-g x‖^2+2*(C*‖u‖*θ)^2 := integral_mono_ae hiu hib hb + _ = 2*(∫ x in Metric.ball 0 θ, ‖u x-g x‖^2)+ + 2*(C*‖u‖*θ)^2*volume.real (Metric.ball (0:Euc n) θ) := by + rw [integral_add (hiug.integrableOn.const_mul 2) (integrable_const _),integral_const_mul,integral_const] + simp only [smul_eq_mul,measureReal_def,Measure.restrict_apply_univ]; ring + _ ≤ _ := by + have hsq : (∫ x in Metric.ball 0 θ, ‖u x-g x‖^2)≤‖u-g‖^2 := by + have heq : (∫ x in Metric.ball 0 θ, ‖u x-g x‖^2)=∫ x in Metric.ball 0 θ, ‖(u-g) x‖^2 := + integral_congr_ae (ae_restrict_of_ae (by filter_upwards [Lp.coeFn_sub u g] with x hx; rw [hx]; rfl)) + rw [heq] + exact vectorLp_setIntegral_sq_le _ _ + have hsq' := pow_le_pow_left₀ (norm_nonneg _) he 2 + linarith + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/EllipticPointwise.lean b/lean/OAI/Geometry/Perimeter/Regularity/EllipticPointwise.lean new file mode 100644 index 0000000000000000000000000000000000000000..f7c80e932ec5bf5107a43c202a42aeef3cb7c489 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/EllipticPointwise.lean @@ -0,0 +1,52 @@ +import OAI.Geometry.Perimeter.Regularity.EllipticIteration +import OAI.Geometry.Perimeter.Regularity.EllipticGradientLimit + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +variable {n : ℕ} + + theorem linear_pointwise_iteration {θ δ K a B H R : ℝ} + (hθ : 0<θ) (hθ1 : θ<1) (hK : 1≤K) + (hc : LinearContractionProperty n θ δ K) + (ha : 0≤a) (hB : 0≤B) (hH : 0≤H) (hR : 0.const_add p))).const_mul r⁻¹).fderiv + have he := congrArg (fun L : Euc n →L[ℝ] ℝ ↦ L y) h + change fderiv ℝ (fun y ↦ r⁻¹*f (p+r•y)) x y = _ + simpa [ContinuousLinearMap.comp_apply,hr,mul_assoc] using he + +theorem integral_affine (g : Euc n → ℝ) (p : Euc n) {r : ℝ} (hr : 0.const_add a) + simpa only [zero_smul,add_zero,one_smul,add_sub_cancel] using + intervalIntegral.integral_eq_sub_of_hasDerivAt (fun t _ ↦ hd t) + ((hc.clm_apply continuous_const).intervalIntegrable 0 1) + + theorem derivativeSecant_near {G : Euc n → Euc n} (hG : ContDiff ℝ 1 G) + (a b : Euc n) (A : Euc n →L[ℝ] Euc n) (δ : ℝ) + (hb : ∀ t∈Icc (0:ℝ) 1, ‖A-fderiv ℝ G (a+t•(b-a))‖≤δ) : + ‖A-derivativeSecant G a b‖≤δ := by + have hc : Continuous (fun t : ℝ ↦ fderiv ℝ G (a+t•(b-a))) := + (hG.continuous_fderiv (by simp)).comp (continuous_const.add (continuous_id.smul continuous_const)) + have he : A-derivativeSecant G a b=∫ t in (0:ℝ)..1, A-fderiv ℝ G (a+t•(b-a)) := by + let : CompleteSpace (Euc n →L[ℝ] Euc n) := ContinuousLinearMap.instCompleteSpace + rw [intervalIntegral.integral_sub intervalIntegrable_const (hc.intervalIntegrable 0 1)] + simp only [derivativeSecant, intervalIntegral.integral_const, sub_zero, one_smul] + rw [he] + have hh := intervalIntegral.norm_integral_le_of_norm_le_const (fun t ht ↦ + hb t (by + rw [Set.uIoc_of_le (by norm_num : (0:ℝ)≤1)] at ht + exact Set.Ioc_subset_Icc_self ht)) + simpa using hh + + theorem derivativeSecant_difference {G : Euc n → Euc n} (hG : ContDiff ℝ 1 G) + (a b a' b' : Euc n) (C : ℝ) + (hb : ∀ t∈Icc (0:ℝ) 1, + ‖fderiv ℝ G (a+t•(b-a))-fderiv ℝ G (a'+t•(b'-a'))‖≤C) : + ‖derivativeSecant G a b-derivativeSecant G a' b'‖≤C := by + have hc (a b : Euc n) : Continuous (fun t : ℝ ↦ fderiv ℝ G (a+t•(b-a))) := + (hG.continuous_fderiv (by simp)).comp (continuous_const.add (continuous_id.smul continuous_const)) + rw [derivativeSecant,derivativeSecant,←intervalIntegral.integral_sub + ((hc a b).intervalIntegrable 0 1) ((hc a' b').intervalIntegrable 0 1)] + have hh := intervalIntegral.norm_integral_le_of_norm_le_const (fun t ht ↦ + hb t (by + rw [Set.uIoc_of_le (by norm_num : (0:ℝ)≤1)] at ht + exact Set.Ioc_subset_Icc_self ht)) + simpa using hh + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/EllipticSecantBounds.lean b/lean/OAI/Geometry/Perimeter/Regularity/EllipticSecantBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..b3f593db88df73ecb522548a4055b832c97c7b8c --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/EllipticSecantBounds.lean @@ -0,0 +1,56 @@ +import OAI.Geometry.Perimeter.Regularity.EllipticSecant + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +variable {n : ℕ} + + theorem segment_in_ball {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] + {p a b : V} {r t : ℝ} (ha : a∈Metric.ball p r) (hb : b∈Metric.ball p r) + (ht : t∈Icc (0:ℝ) 1) : a+t•(b-a)∈Metric.ball p r := by + have hh := (convex_ball p r) ha hb (sub_nonneg.mpr ht.2) ht.1 (by ring : 1-t+t=1) + convert hh using 1 + module + + theorem segment_difference_bound {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] + (a b a' b' : V) {t : ℝ} (ht : t∈Icc (0:ℝ) 1) : + ‖(a+t•(b-a))-(a'+t•(b'-a'))‖ ≤ ‖a-a'‖+‖b-b'‖ := by + have he : (a+t•(b-a))-(a'+t•(b'-a'))=(1-t)•(a-a')+t•(b-b') := by module + rw [he] + have hh := norm_add_le ((1-t)•(a-a')) (t•(b-b')) + rw [norm_smul,norm_smul,Real.norm_of_nonneg (sub_nonneg.mpr ht.2),Real.norm_of_nonneg ht.1] at hh + nlinarith [norm_nonneg (a-a'),norm_nonneg (b-b'),mul_nonneg ht.1 (norm_nonneg (a-a')), + mul_nonneg (sub_nonneg.mpr ht.2) (norm_nonneg (b-b'))] + + theorem derivativeSecant_lipschitz_ball {G : Euc n → Euc n} (hG : ContDiff ℝ 1 G) + {p a b a' b' : Euc n} {r L : ℝ} (hL : 0 ≤ L) + (ha : a∈Metric.ball p r) (hb : b∈Metric.ball p r) + (ha' : a'∈Metric.ball p r) (hb' : b'∈Metric.ball p r) + (hLip : ∀ x∈Metric.ball p r, ∀ y∈Metric.ball p r, + ‖fderiv ℝ G x-fderiv ℝ G y‖ ≤ L*‖x-y‖) : + ‖derivativeSecant G a b-derivativeSecant G a' b'‖ ≤ L*(‖a-a'‖+‖b-b'‖) := by + apply derivativeSecant_difference hG + intro t ht + exact (hLip _ (segment_in_ball ha hb ht) _ (segment_in_ball ha' hb' ht)).trans + (mul_le_mul_of_nonneg_left (segment_difference_bound a b a' b' ht) hL) + + theorem contDiff_local_lipschitz {V W : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] + [NormedAddCommGroup W] [NormedSpace ℝ W] {f : V → W} (hf : ContDiff ℝ 1 f) (p : V) : + ∃ r L : ℝ, 0 first | rfl | (simp only [scaledGradientEnergy,div_pow,pow_succ,inv_div]; field_simp [hr.ne']) + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/EllipticTestSpace.lean b/lean/OAI/Geometry/Perimeter/Regularity/EllipticTestSpace.lean new file mode 100644 index 0000000000000000000000000000000000000000..29c47838d4c15ddbe3409c5fbf92dcaec732f17d --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/EllipticTestSpace.lean @@ -0,0 +1,86 @@ +import OAI.Geometry.Perimeter.Regularity.EllipticHilbert +import OAI.Geometry.Perimeter.Regularity.GradientContDiff + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +variable {n : ℕ} + +abbrev VectorL2 (n : ℕ) := Lp (Euc n) 2 (volume : Measure (Euc n)) + +def SmoothLocalTest (U : Set (Euc n)) := + {φ : Euc n → ℝ // ContDiff ℝ ∞ φ ∧ HasCompactSupport φ ∧ tsupport φ ⊆ U} + +def testGradientLp {U : Set (Euc n)} (φ : SmoothLocalTest U) : VectorL2 n := + ((gradient_contDiff φ.property.1).continuous.memLp_of_hasCompactSupport + (gradient_hasCompactSupport φ.property.2.1)).toLp (gradient φ.val) + +theorem testGradientLp_ae {U : Set (Euc n)} (φ : SmoothLocalTest U) : + (testGradientLp φ : Euc n → Euc n)=ᵐ[volume] gradient φ.val := + MemLp.coeFn_toLp _ + +def testGradientSpace (U : Set (Euc n)) : Submodule ℝ (VectorL2 n) := + (Submodule.span ℝ (Set.range (testGradientLp (U := U)))).topologicalClosure + +instance testGradientSpace_complete (U : Set (Euc n)) : CompleteSpace (testGradientSpace U) := + (Submodule.isClosed_topologicalClosure _).completeSpace_coe + +theorem testGradient_mem {U : Set (Euc n)} (φ : SmoothLocalTest U) : + testGradientLp φ∈testGradientSpace U := + Submodule.le_topologicalClosure _ (Submodule.subset_span ⟨φ,rfl⟩) + +theorem inner_zero_on_closed_span {H : Type*} [NormedAddCommGroup H] + [InnerProductSpace ℝ H] (s : Set H) {u : H} (h : ∀ w∈s, inner ℝ u w=0) : + ∀ w∈(Submodule.span ℝ s).topologicalClosure, inner ℝ u w=0 := by + have hs : Submodule.span ℝ s ≤ (innerSL ℝ u).ker := by + apply Submodule.span_le.mpr + exact h + exact (Submodule.span ℝ s).topologicalClosure_minimal hs (innerSL ℝ u).isClosed_ker + +theorem testGradient_pairing_ext {U : Set (Euc n)} {u e : VectorL2 n} + (h : ∀ φ : SmoothLocalTest U, inner ℝ u (testGradientLp φ)=inner ℝ e (testGradientLp φ)) : + ∀ w∈testGradientSpace U, inner ℝ u w=inner ℝ e w := by + have hh := inner_zero_on_closed_span (Set.range (testGradientLp (U := U))) (u := u-e) + (by rintro _ ⟨φ,rfl⟩; rw [inner_sub_left,h φ,sub_self]) + intro w hw + have hz := hh w hw + simpa only [inner_sub_left,sub_eq_zero] using hz + +theorem testGradient_inner {U : Set (Euc n)} (u : VectorL2 n) (φ : SmoothLocalTest U) : + inner ℝ u (testGradientLp φ)=∫ x, inner ℝ (u x) (gradient φ.val x) := by + rw [MeasureTheory.L2.inner_def] + apply integral_congr_ae + filter_upwards [testGradientLp_ae φ] with x hx + rw [hx] + +theorem testGradient_integrable_pairing (u : VectorL2 n) {U : Set (Euc n)} + (φ : SmoothLocalTest U) : Integrable (fun x ↦ inner ℝ (u x) (gradient φ.val x)) volume := by + apply (MeasureTheory.L2.integrable_inner (𝕜 := ℝ) u (testGradientLp φ)).congr + filter_upwards [testGradientLp_ae φ] with x hx + rw [hx] + +def DivFreeLpOn (u : VectorL2 n) (U : Set (Euc n)) : Prop := + ∀ φ : SmoothLocalTest U, (∫ x, inner ℝ (u x) (gradient φ.val x))=0 + +theorem orthogonal_testGradient_divFree {U : Set (Euc n)} {u : VectorL2 n} + (hu : u∈(testGradientSpace U)ᗮ) : DivFreeLpOn u U := by + intro φ + rw [←testGradient_inner u φ] + exact Submodule.inner_left_of_mem_orthogonal (testGradient_mem φ) hu + +theorem weak_harmonic_gradient_comparison {U : Set (Euc n)} {u e : VectorL2 n} + (h : ∀ φ : SmoothLocalTest U, (∫ x, inner ℝ (u x) (gradient φ.val x))= + ∫ x, inner ℝ (e x) (gradient φ.val x)) : + ∃ g : VectorL2 n, DivFreeLpOn g U ∧ u-g∈testGradientSpace U ∧ ‖u-g‖≤‖e‖ := by + obtain ⟨g,hg,hug,he⟩ := harmonic_projection_exists (testGradientSpace U) + (testGradient_pairing_ext (fun φ ↦ by simpa only [testGradient_inner] using h φ)) + exact ⟨g,orthogonal_testGradient_divFree hg,hug,he⟩ + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/EllipticUniformGradient.lean b/lean/OAI/Geometry/Perimeter/Regularity/EllipticUniformGradient.lean new file mode 100644 index 0000000000000000000000000000000000000000..5d9abbacfbd02e7b26b8a77b6dc0c7adfdbaafd5 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/EllipticUniformGradient.lean @@ -0,0 +1,87 @@ +import OAI.Geometry.Perimeter.Regularity.EllipticPointwise +import OAI.Geometry.Perimeter.Regularity.EllipticSlopeComparison + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +variable {n : ℕ} + + theorem gradient_modulus_from_slopes {θ R K H L : ℝ} + (hθ : 0<θ) (hR : 0.mp hV + let b : ContDiffBump (0 : Space n) := + ⟨|r| + 1, |r| + 2, by positivity, by linarith⟩ + have hb : V ⊆ Metric.ball (0 : Space n) b.rIn := by + intro x hx + have hx' := Metric.mem_ball.mp (hr hx) + change dist x 0 < |r| + 1 + linarith [le_abs_self r] + refine ⟨fun x ↦ b x * f x, b.contDiff.mul hf, b.hasCompactSupport.mul_right, ?_, ?_⟩ + · intro x hx + change b x * f x = f x + rw [b.one_of_mem_closedBall (Metric.ball_subset_closedBall (hb hx)), one_mul] + · intro x hx + apply surfaceGradient_congr_trace + ((b.contDiff.mul hf).differentiable (by norm_num) x) + (hf.differentiable (by norm_num) x) + filter_upwards [b.eventuallyEq_one_of_mem_ball (hb hx)] with y hy + intro _ + simp only [hy, Pi.one_apply, one_mul] + +theorem exists_compact_approximants_of_mem_sobolevGraph {n : ℕ} (S V : Set (Space n)) + (hV : Bornology.IsBounded V) (hVm : MeasurableSet V) + {h : Space n → ℝ} {G : Space n → Space n} + (hh : MemLp h 2 ((surfaceMeasure S).restrict V)) + (hG : MemLp G 2 ((surfaceMeasure S).restrict V)) + (hp : (hh.toLp h, hG.toLp G) ∈ closure (smoothGradientGraph S V)) : + ∃ φ : ℕ → Space n → ℝ, (∀ j, ContDiff ℝ ∞ (φ j) ∧ HasCompactSupport (φ j)) ∧ + ∃ (hφ : ∀ j, MemLp (φ j) 2 ((surfaceMeasure S).restrict V)) + (hDφ : ∀ j, MemLp (surfaceGradient S (φ j)) 2 ((surfaceMeasure S).restrict V)), + Tendsto (fun j ↦ ((hφ j).toLp (φ j), + (hDφ j).toLp (surfaceGradient S (φ j)))) atTop (𝓝 (hh.toLp h, hG.toLp G)) := by + classical + obtain ⟨z, hz, hzt⟩ := mem_closure_iff_seq_limit.mp hp + have hw : ∀ j, ∃ φ : Space n → ℝ, ContDiff ℝ ∞ φ ∧ HasCompactSupport φ ∧ + ∃ (hφ : MemLp φ 2 ((surfaceMeasure S).restrict V)) + (hDφ : MemLp (surfaceGradient S φ) 2 ((surfaceMeasure S).restrict V)), + z j = (hφ.toLp φ, hDφ.toLp (surfaceGradient S φ)) := by + intro j + obtain ⟨f, hf, hfmem, hDfmem, hzj⟩ := hz j + obtain ⟨F, hF, hFc, hFe, hFDe⟩ := exists_compact_trace_on_bounded S V hV f hf + have he : F =ᵐ[(surfaceMeasure S).restrict V] f := + (ae_restrict_mem hVm).mono (fun x hx ↦ hFe hx) + have hDe : surfaceGradient S F =ᵐ[(surfaceMeasure S).restrict V] surfaceGradient S f := + (ae_restrict_mem hVm).mono (fun x hx ↦ hFDe hx) + let hFm := MemLp.ae_eq he.symm hfmem + let hDFm := MemLp.ae_eq hDe.symm hDfmem + refine ⟨F, hF, hFc, hFm, hDFm, hzj.trans ?_⟩ + exact Prod.ext (hfmem.toLp_congr hFm he.symm) (hDfmem.toLp_congr hDFm hDe.symm) + choose φ hφsmooth hφcompact hφ hDφ hzφ using hw + refine ⟨φ, fun j ↦ ⟨hφsmooth j, hφcompact j⟩, hφ, hDφ, ?_⟩ + have hzfun : z = (fun j ↦ ((hφ j).toLp (φ j), + (hDφ j).toLp (surfaceGradient S (φ j)))) := funext hzφ + rw [← hzfun] + exact hzt + +end RPI.Boundary + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +namespace RPI + +section BallCutoffs +variable (V : Type*) [NormedAddCommGroup V] [InnerProductSpace ℝ V] + [FiniteDimensional ℝ V] + +noncomputable def modelCapacityBump : ContDiffBump (0 : V) := + ⟨1, 2, zero_lt_one, one_lt_two⟩ + +noncomputable def ballCapacityCutoff (c : V) (r : ℝ) (x : V) : ℝ := + 1 - modelCapacityBump V (r⁻¹ • (x - c)) + +theorem ballCapacityCutoff_contDiff (c : V) (r : ℝ) : + ContDiff ℝ ∞ (ballCapacityCutoff V c r) := by + apply contDiff_const.sub + apply (modelCapacityBump V).contDiff.comp + fun_prop + +theorem ballCapacityCutoff_mem_Icc (c : V) (r : ℝ) (x : V) : + ballCapacityCutoff V c r x ∈ Icc (0 : ℝ) 1 := by + constructor + · exact sub_nonneg.mpr (modelCapacityBump V).le_one + · exact sub_le_self _ (modelCapacityBump V).nonneg + +theorem ballCapacityCutoff_zero {c x : V} {r : ℝ} (hr : 0 < r) + (hx : dist x c ≤ r) : ballCapacityCutoff V c r x = 0 := by + unfold ballCapacityCutoff + rw [(modelCapacityBump V).one_of_mem_closedBall, sub_self] + change dist (r⁻¹ • (x - c)) 0 ≤ 1 + rw [dist_zero_right, norm_smul, Real.norm_eq_abs, abs_inv, abs_of_pos hr, + ← div_eq_inv_mul, ← dist_eq_norm] + exact (div_le_one hr).mpr hx + +theorem ballCapacityCutoff_one {c x : V} {r : ℝ} (hr : 0 < r) + (hx : 2 * r ≤ dist x c) : ballCapacityCutoff V c r x = 1 := by + unfold ballCapacityCutoff + rw [(modelCapacityBump V).zero_of_le_dist, sub_zero] + change 2 ≤ dist (r⁻¹ • (x - c)) 0 + rw [dist_zero_right, norm_smul, Real.norm_eq_abs, abs_inv, abs_of_pos hr, + ← div_eq_inv_mul, ← dist_eq_norm] + exact (le_div_iff₀ hr).mpr hx + +theorem exists_ballCapacityCutoff_gradient_bound : + ∃ C : ℝ, 0 < C ∧ ∀ (c : V) (r : ℝ), 0 < r → + ∀ x : V, ‖gradient (ballCapacityCutoff V c r) x‖ ≤ C / r := by + obtain ⟨L, hL⟩ := ContDiff.lipschitzWith_of_hasCompactSupport + (modelCapacityBump V).hasCompactSupport + (show ContDiff ℝ 1 (modelCapacityBump V) from (modelCapacityBump V).contDiff) one_ne_zero + let C : ℝ := (L : ℝ) + 1 + have hC : 0 < C := by dsimp [C]; positivity + refine ⟨C, hC, ?_⟩ + intro c r hr x + have hlip : LipschitzWith ⟨C / r, div_nonneg hC.le hr.le⟩ (ballCapacityCutoff V c r) := by + apply LipschitzWith.of_dist_le_mul + intro y z + have hd : dist (r⁻¹ • (y - c)) (r⁻¹ • (z - c)) = r⁻¹ * dist y z := by + simp only [dist_eq_norm, ← smul_sub, sub_sub_sub_cancel_right, norm_smul, + Real.norm_eq_abs, abs_inv, abs_of_pos hr] + have hbound := hL.dist_le_mul (r⁻¹ • (y - c)) (r⁻¹ • (z - c)) + rw [hd] at hbound + have heq : dist (ballCapacityCutoff V c r y) (ballCapacityCutoff V c r z) = + dist (modelCapacityBump V (r⁻¹ • (y - c))) + (modelCapacityBump V (r⁻¹ • (z - c))) := by + simp only [ballCapacityCutoff, dist_eq_norm, sub_sub_sub_cancel_left, norm_sub_rev] + rw [heq] + change _ ≤ (C / r) * dist y z + calc + _ ≤ (L : ℝ) * (r⁻¹ * dist y z) := hbound + _ = ((L : ℝ) / r) * dist y z := by ring + _ ≤ (C / r) * dist y z := by + gcongr + dsimp [C] + linarith + have hb : ‖fderiv ℝ (ballCapacityCutoff V c r) x‖ ≤ C / r := + norm_fderiv_le_of_lipschitz ℝ (x₀ := x) hlip + simpa only [gradient, LinearIsometryEquiv.norm_map] using hb + +theorem ballCapacityCutoff_gradient_zero {c x : V} {r : ℝ} (hr : 0 < r) + (hx : 2 * r ≤ dist x c) : gradient (ballCapacityCutoff V c r) x = 0 := by + have hmax : IsLocalMax (ballCapacityCutoff V c r) x := by + apply Filter.Eventually.of_forall + intro y + rw [ballCapacityCutoff_one V hr hx] + exact (ballCapacityCutoff_mem_Icc V c r y).2 + simp only [gradient, hmax.fderiv_eq_zero, map_zero] + +end BallCutoffs + +section SmoothAggregate +variable {ι V : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] + [FiniteDimensional ℝ V] + +noncomputable def capacityGate : ContDiffBump (0 : ℝ) := + ⟨1 / 2, 1, by norm_num, by norm_num⟩ + +noncomputable def bumpScore (s : Finset ι) (b : ι → V → ℝ) (x : V) : ℝ := + ∑ j ∈ s, (b j x) ^ 2 + +noncomputable def smoothCutoffAggregate (s : Finset ι) (b : ι → V → ℝ) (x : V) : ℝ := + capacityGate (bumpScore s b x) + +omit [NormedAddCommGroup V] [InnerProductSpace ℝ V] [FiniteDimensional ℝ V] in +theorem bumpScore_nonneg [NormedAddCommGroup V] [InnerProductSpace ℝ V] + [FiniteDimensional ℝ V] (s : Finset ι) (b : ι → V → ℝ) (x : V) : + 0 ≤ bumpScore s b x := Finset.sum_nonneg (fun _ _ ↦ sq_nonneg _) + +omit [FiniteDimensional ℝ V] in +theorem smoothCutoffAggregate_contDiff [FiniteDimensional ℝ V] + (s : Finset ι) (b : ι → V → ℝ) + (hb : ∀ j ∈ s, ContDiff ℝ ∞ (b j)) : + ContDiff ℝ ∞ (smoothCutoffAggregate s b) := by + apply capacityGate.contDiff.comp + exact ContDiff.sum (fun j hj ↦ (hb j hj).pow 2) + +omit [NormedAddCommGroup V] [InnerProductSpace ℝ V] [FiniteDimensional ℝ V] in +theorem smoothCutoffAggregate_mem_Icc [NormedAddCommGroup V] [InnerProductSpace ℝ V] + [FiniteDimensional ℝ V] (s : Finset ι) (b : ι → V → ℝ) (x : V) : + smoothCutoffAggregate s b x ∈ Icc (0 : ℝ) 1 := + ⟨capacityGate.nonneg, capacityGate.le_one⟩ + +theorem smoothCutoffAggregate_zero {s : Finset ι} {b : ι → V → ℝ} {x : V} + (hx : 1 ≤ bumpScore s b x) : smoothCutoffAggregate s b x = 0 := by + apply capacityGate.zero_of_le_dist + change 1 ≤ dist (bumpScore s b x) 0 + simpa only [Real.dist_eq, sub_zero, abs_of_nonneg (bumpScore_nonneg s b x)] using hx + +theorem smoothCutoffAggregate_zero_of_one {s : Finset ι} {b : ι → V → ℝ} {x : V} + {j : ι} (hj : j ∈ s) (hbx : b j x = 1) : smoothCutoffAggregate s b x = 0 := by + apply smoothCutoffAggregate_zero + have ht := Finset.single_le_sum (s := s) (f := fun j ↦ b j x ^ 2) + (fun i hi ↦ sq_nonneg _) hj + change 1 ≤ ∑ j ∈ s, b j x ^ 2 + simpa only [hbx, one_pow] using ht + +omit [NormedAddCommGroup V] [InnerProductSpace ℝ V] [FiniteDimensional ℝ V] in +theorem smoothCutoffAggregate_one [NormedAddCommGroup V] [InnerProductSpace ℝ V] + [FiniteDimensional ℝ V] {s : Finset ι} {b : ι → V → ℝ} {x : V} + (hx : ∀ j ∈ s, b j x = 0) : smoothCutoffAggregate s b x = 1 := by + have hscore : bumpScore s b x = 0 := by + apply Finset.sum_eq_zero + intro j hj + simp [hx j hj] + unfold smoothCutoffAggregate + rw [hscore] + exact capacityGate.one_of_mem_closedBall (by norm_num [capacityGate]) + +theorem norm_sum_smul_sq_le {W : Type*} [NormedAddCommGroup W] [NormedSpace ℝ W] + (s : Finset ι) (a : ι → ℝ) (v : ι → W) : + ‖∑ j ∈ s, a j • v j‖ ^ 2 ≤ + (∑ j ∈ s, (a j) ^ 2) * (∑ j ∈ s, ‖v j‖ ^ 2) := by + have ht : ‖∑ j ∈ s, a j • v j‖ ≤ ∑ j ∈ s, |a j| * ‖v j‖ := by + simpa only [norm_smul, Real.norm_eq_abs] using norm_sum_le s (fun j ↦ a j • v j) + calc + _ ≤ (∑ j ∈ s, |a j| * ‖v j‖) ^ 2 := by + exact (sq_le_sq₀ (norm_nonneg _) (Finset.sum_nonneg + (fun _ _ ↦ mul_nonneg (abs_nonneg _) (norm_nonneg _)))).mpr ht + _ ≤ (∑ j ∈ s, |a j| ^ 2) * (∑ j ∈ s, ‖v j‖ ^ 2) := + Finset.sum_mul_sq_le_sq_mul_sq s (fun j ↦ |a j|) (fun j ↦ ‖v j‖) + _ = _ := by simp only [sq_abs] + +omit [FiniteDimensional ℝ V] in +theorem bumpScore_fderiv [FiniteDimensional ℝ V] (s : Finset ι) (b : ι → V → ℝ) {x : V} + (hb : ∀ j ∈ s, DifferentiableAt ℝ (b j) x) : + fderiv ℝ (bumpScore s b) x = ∑ j ∈ s, (2 * b j x) • fderiv ℝ (b j) x := by + have hd : HasFDerivAt (bumpScore s b) + (∑ j ∈ s, (2 * b j x) • fderiv ℝ (b j) x) x := by + have h := HasFDerivAt.sum (fun j hj ↦ (hb j hj).hasFDerivAt.pow 2) + convert! h using 1 + · ext y; simp only [bumpScore, Finset.sum_apply] + · simp only [Nat.reduceSub, pow_one, nsmul_eq_mul, Nat.cast_ofNat] + exact hd.fderiv + +theorem bumpScore_norm_fderiv_sq_le (s : Finset ι) (b : ι → V → ℝ) {x : V} + (hb : ∀ j ∈ s, DifferentiableAt ℝ (b j) x) : + ‖fderiv ℝ (bumpScore s b) x‖ ^ 2 ≤ + 4 * bumpScore s b x * ∑ j ∈ s, ‖fderiv ℝ (b j) x‖ ^ 2 := by + rw [bumpScore_fderiv s b hb] + have h := norm_sum_smul_sq_le s (fun j ↦ 2 * b j x) (fun j ↦ fderiv ℝ (b j) x) + convert! h using 1 + congr 1 + simp only [bumpScore, mul_pow, ← Finset.mul_sum] + norm_num + +theorem exists_smoothCutoffAggregate_gradient_bound : + ∃ B : ℝ, 0 < B ∧ ∀ (s : Finset ι) (b : ι → V → ℝ), + (∀ j ∈ s, ContDiff ℝ 1 (b j)) → ∀ x : V, + ‖gradient (smoothCutoffAggregate s b) x‖ ^ 2 ≤ + B * ∑ j ∈ s, ‖gradient (b j) x‖ ^ 2 := by + obtain ⟨L, hL⟩ := ContDiff.lipschitzWith_of_hasCompactSupport + capacityGate.hasCompactSupport (show ContDiff ℝ 1 capacityGate from capacityGate.contDiff) + one_ne_zero + let B : ℝ := 4 * ((L : ℝ) + 1) ^ 2 + have hB : 0 < B := by dsimp [B]; positivity + refine ⟨B, hB, ?_⟩ + intro s b hb x + have hgrad : ∀ (f : V → ℝ), ‖gradient f x‖ = ‖fderiv ℝ f x‖ := fun _ ↦ by + simp only [gradient, LinearIsometryEquiv.norm_map] + simp only [hgrad] + by_cases hs : 1 ≤ bumpScore s b x + · have hmin : IsLocalMin (smoothCutoffAggregate s b) x := by + apply Filter.Eventually.of_forall + intro y + rw [smoothCutoffAggregate_zero hs] + exact (smoothCutoffAggregate_mem_Icc s b y).1 + rw [hmin.fderiv_eq_zero, norm_zero, zero_pow (by decide)] + exact mul_nonneg hB.le (Finset.sum_nonneg (fun _ _ ↦ sq_nonneg _)) + · have hdiff : ∀ j ∈ s, DifferentiableAt ℝ (b j) x := fun j hj ↦ + (hb j hj).differentiable one_ne_zero |>.differentiableAt + have hsdiff : DifferentiableAt ℝ (bumpScore s b) x := by + convert! DifferentiableAt.sum (fun j hj ↦ (hdiff j hj).pow 2) using 1 + ext y; simp only [bumpScore, Finset.sum_apply, Pi.pow_apply] + have hcomp : fderiv ℝ (smoothCutoffAggregate s b) x = + (fderiv ℝ capacityGate (bumpScore s b x)).comp (fderiv ℝ (bumpScore s b) x) := + fderiv_comp x ((show ContDiff ℝ 1 capacityGate from capacityGate.contDiff).differentiable + one_ne_zero).differentiableAt hsdiff + have hdL : ‖fderiv ℝ capacityGate (bumpScore s b x)‖ ≤ (L : ℝ) := + norm_fderiv_le_of_lipschitz ℝ hL + have hd : ‖fderiv ℝ (smoothCutoffAggregate s b) x‖ ≤ + (L : ℝ) * ‖fderiv ℝ (bumpScore s b) x‖ := by + rw [hcomp] + exact (ContinuousLinearMap.opNorm_comp_le _ _).trans + (mul_le_mul_of_nonneg_right hdL (norm_nonneg _)) + have hdsq := bumpScore_norm_fderiv_sq_le s b hdiff + have hnnsum : 0 ≤ ∑ j ∈ s, ‖fderiv ℝ (b j) x‖ ^ 2 := + Finset.sum_nonneg (fun _ _ ↦ sq_nonneg _) + calc + _ ≤ ((L : ℝ) * ‖fderiv ℝ (bumpScore s b) x‖) ^ 2 := by + exact (sq_le_sq₀ (norm_nonneg _) (mul_nonneg L.coe_nonneg (norm_nonneg _))).mpr hd + _ = (L : ℝ) ^ 2 * ‖fderiv ℝ (bumpScore s b) x‖ ^ 2 := mul_pow _ _ _ + _ ≤ (L : ℝ) ^ 2 * (4 * bumpScore s b x * ∑ j ∈ s, ‖fderiv ℝ (b j) x‖ ^ 2) := by + gcongr + _ ≤ B * ∑ j ∈ s, ‖fderiv ℝ (b j) x‖ ^ 2 := by + dsimp [B] + have hscore : bumpScore s b x ≤ 1 := le_of_not_ge hs + have hLpos := L.coe_nonneg + nlinarith [mul_nonneg (sq_nonneg (L : ℝ)) hnnsum, + mul_le_mul_of_nonneg_left hscore (sq_nonneg (L : ℝ))] + +end SmoothAggregate + +section Energy +variable {V : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] + [FiniteDimensional ℝ V] [MeasurableSpace V] [BorelSpace V] + +noncomputable def smoothDirichletEnergy (μ : Measure V) (f : V → ℝ) : ℝ≥0∞ := + ∫⁻ x, ENNReal.ofReal (‖gradient f x‖ ^ 2) ∂μ + +theorem smoothDirichletEnergy_le_ball (μ : Measure V) (f : V → ℝ) + (c : V) (r L : ℝ) (hL : 0 ≤ L) + (hbound : ∀ x, ‖gradient f x‖ ≤ L) + (hzero : ∀ x, r ≤ dist x c → gradient f x = 0) : + smoothDirichletEnergy μ f ≤ ENNReal.ofReal (L ^ 2) * μ (Metric.ball c r) := by + calc + _ ≤ ∫⁻ x, (Metric.ball c r).indicator (fun _ ↦ ENNReal.ofReal (L ^ 2)) x ∂μ := by + apply lintegral_mono + intro x + by_cases hx : x ∈ Metric.ball c r + · rw [Set.indicator_of_mem hx] + exact ENNReal.ofReal_le_ofReal ((sq_le_sq₀ (norm_nonneg _) hL).mpr (hbound x)) + · rw [Set.indicator_of_notMem hx] + simp only [Metric.mem_ball, not_lt] at hx + simp [hzero x hx] + _ = _ := by + rw [lintegral_indicator Metric.isOpen_ball.measurableSet, lintegral_const, + Measure.restrict_apply_univ] + +noncomputable def innerCapacityBump (c : V) (r : ℝ) (x : V) : ℝ := + 1 - ballCapacityCutoff V c r x + +omit [MeasurableSpace V] [BorelSpace V] in +theorem innerCapacityBump_contDiff [MeasurableSpace V] [BorelSpace V] (c : V) (r : ℝ) : + ContDiff ℝ ∞ (innerCapacityBump c r) := + contDiff_const.sub (ballCapacityCutoff_contDiff V c r) + +omit [MeasurableSpace V] [BorelSpace V] in +theorem innerCapacityBump_gradient [MeasurableSpace V] [BorelSpace V] (c : V) (r : ℝ) (x : V) : + gradient (innerCapacityBump c r) x = -gradient (ballCapacityCutoff V c r) x := by + change gradient (fun y ↦ 1 - ballCapacityCutoff V c r y) x = + -gradient (ballCapacityCutoff V c r) x + simp only [gradient, fderiv_const_sub, map_neg] + +omit [MeasurableSpace V] [BorelSpace V] in +theorem innerCapacityBump_one [MeasurableSpace V] [BorelSpace V] {c x : V} {r : ℝ} (hr : 0 < r) + (hx : dist x c ≤ r) : innerCapacityBump c r x = 1 := by + simp only [innerCapacityBump, ballCapacityCutoff_zero V hr hx, sub_zero] + +omit [MeasurableSpace V] [BorelSpace V] in +theorem innerCapacityBump_zero [MeasurableSpace V] [BorelSpace V] {c x : V} {r : ℝ} (hr : 0 < r) + (hx : 2 * r ≤ dist x c) : innerCapacityBump c r x = 0 := by + simp only [innerCapacityBump, ballCapacityCutoff_one V hr hx, sub_self] + +theorem innerCapacityBump_energy_le (μ : Measure V) {C : ℝ} (hC : 0 < C) + (hbound : ∀ (c : V) (r : ℝ), 0 < r → ∀ x : V, + ‖gradient (ballCapacityCutoff V c r) x‖ ≤ C / r) + (c : V) (r : ℝ) (hr : 0 < r) : + smoothDirichletEnergy μ (innerCapacityBump c r) ≤ + ENNReal.ofReal ((C / r) ^ 2) * μ (Metric.ball c (2 * r)) := by + apply smoothDirichletEnergy_le_ball μ _ c (2 * r) (C / r) (by positivity) + · intro x + simpa only [innerCapacityBump_gradient, norm_neg] using hbound c r hr x + · intro x hx + simp only [innerCapacityBump_gradient, ballCapacityCutoff_gradient_zero V hr hx, neg_zero] + +theorem smoothCutoffAggregate_energy_le {ι : Type*} (μ : Measure V) + {B : ℝ} (hB : 0 ≤ B) (s : Finset ι) (b : ι → V → ℝ) + (hb : ∀ j ∈ s, ContDiff ℝ 1 (b j)) + (hbound : ∀ x : V, ‖gradient (smoothCutoffAggregate s b) x‖ ^ 2 ≤ + B * ∑ j ∈ s, ‖gradient (b j) x‖ ^ 2) : + smoothDirichletEnergy μ (smoothCutoffAggregate s b) ≤ + ENNReal.ofReal B * ∑ j ∈ s, smoothDirichletEnergy μ (b j) := by + have hmeas : ∀ j ∈ s, Measurable (fun x ↦ ENNReal.ofReal (‖gradient (b j) x‖ ^ 2)) := by + intro j hj + have hg : Continuous (gradient (b j)) := + (InnerProductSpace.toDual ℝ V).symm.continuous.comp + ((hb j hj).continuous_fderiv one_ne_zero) + exact (hg.norm.pow 2).measurable.ennreal_ofReal + calc + _ ≤ ∫⁻ x, ENNReal.ofReal B * ∑ j ∈ s, ENNReal.ofReal (‖gradient (b j) x‖ ^ 2) ∂μ := by + apply lintegral_mono + intro x + change ENNReal.ofReal (‖gradient (smoothCutoffAggregate s b) x‖ ^ 2) ≤ + ENNReal.ofReal B * ∑ j ∈ s, ENNReal.ofReal (‖gradient (b j) x‖ ^ 2) + rw [← ENNReal.ofReal_sum_of_nonneg (s := s) (f := fun j ↦ ‖gradient (b j) x‖ ^ 2) + (fun j hj ↦ sq_nonneg _), + ← ENNReal.ofReal_mul hB] + exact ENNReal.ofReal_le_ofReal (hbound x) + _ = _ := by + rw [lintegral_const_mul (ENNReal.ofReal B) (Finset.measurable_sum s hmeas), + lintegral_finsetSum s hmeas] + rfl + +end Energy +end RPI + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/ExistsDiameterCoverOfHausdorffZero.lean b/lean/OAI/Geometry/Perimeter/Regularity/ExistsDiameterCoverOfHausdorffZero.lean new file mode 100644 index 0000000000000000000000000000000000000000..f6d969e889a1ec6318f5d810a7e1863a479e190d --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/ExistsDiameterCoverOfHausdorffZero.lean @@ -0,0 +1,496 @@ +import OAI.Geometry.Perimeter.Regularity.VectorEnergy +import OAI.Geometry.Perimeter.Regularity.ExistsCompactTraceOnBounded + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +namespace RPI + +section Covers +variable {X : Type*} [MetricSpace X] [MeasurableSpace X] [BorelSpace X] + +theorem exists_diameter_cover_of_hausdorff_zero (S : Set X) (m : ℕ) (hm : 0 < m) + (hS : Measure.hausdorffMeasure (m : ℝ) S = 0) + {δ ε : ℝ≥0∞} (hδ : 0 < δ) (hε : 0 < ε) : + ∃ t : ℕ → Set X, S ⊆ ⋃ j, t j ∧ (∀ j, Metric.ediam (t j) ≤ δ) ∧ + (∑' j, Metric.ediam (t j) ^ m) < ε := by + have hi : (⨅ (t : ℕ → Set X) (_ : S ⊆ ⋃ j, t j) + (_ : ∀ j, Metric.ediam (t j) ≤ δ), + ∑' j, ⨆ _ : (t j).Nonempty, Metric.ediam (t j) ^ (m : ℝ)) < ε := by + apply lt_of_le_of_lt _ (show Measure.hausdorffMeasure (m : ℝ) S < ε by simpa [hS]) + rw [Measure.hausdorffMeasure_apply] + exact le_iSup_of_le δ (le_iSup_of_le hδ le_rfl) + obtain ⟨t, ht⟩ := iInf_lt_iff.mp hi + obtain ⟨hcover, ht⟩ := iInf_lt_iff.mp ht + obtain ⟨hdiam, ht⟩ := iInf_lt_iff.mp ht + refine ⟨t, hcover, hdiam, ?_⟩ + convert ht using 1 + congr 1 + funext j + by_cases hj : (t j).Nonempty + · simp only [ENNReal.rpow_natCast, iSup_pos hj] + · have he : t j = ∅ := Set.not_nonempty_iff_eq_empty.mp hj + simp [he, hm.ne', ENNReal.zero_rpow_of_pos (show 0 < (m : ℝ) by exact_mod_cast hm)] + +theorem exists_finite_ball_cover_of_hausdorff_zero [Nonempty X] (S : Set X) (hcompact : IsCompact S) + (m : ℕ) (hm : 0 < m) (hS : Measure.hausdorffMeasure (m : ℝ) S = 0) + {δ ε : ℝ} (hδ : 0 < δ) (hε : 0 < ε) : + ∃ (s : Finset ℕ) (c : ℕ → X) (r : ℕ → ℝ), + (∀ j ∈ s, c j ∈ S ∧ 0 < r j ∧ r j < δ) ∧ + S ⊆ ⋃ j ∈ s, Metric.ball (c j) (r j) ∧ + ∑ j ∈ s, (r j) ^ m < ε := by + classical + by_cases hSne : S.Nonempty + · let K : ℝ := 2 ^ (m - 1) + have hK : 0 < K := by dsimp [K]; positivity + let ε' : ℝ := ε / (4 * K) + have hε' : 0 < ε' := by dsimp [ε']; positivity + let a : ℝ := min (δ / 4) (min 1 (ε / (8 * K))) + have ha : 0 < a := by dsimp [a]; positivity + have haδ : a ≤ δ / 4 := min_le_left _ _ + have ha1 : a ≤ 1 := (min_le_right _ _).trans (min_le_left _ _) + have haε : a ≤ ε / (8 * K) := (min_le_right _ _).trans (min_le_right _ _) + obtain ⟨t, hcover, hdiam, hcost⟩ := exists_diameter_cover_of_hausdorff_zero S m hm hS + (δ := ENNReal.ofReal (δ / 4)) (ε := ENNReal.ofReal ε') + (ENNReal.ofReal_pos.mpr (by positivity)) (ENNReal.ofReal_pos.mpr hε') + have htfin : ∀ j, Metric.ediam (t j) ≠ ⊤ := fun j ↦ + ne_top_of_le_ne_top ENNReal.ofReal_ne_top (hdiam j) + let d : ℕ → ℝ := fun j ↦ (Metric.ediam (t j)).toReal + have hd0 : ∀ j, 0 ≤ d j := fun _ ↦ ENNReal.toReal_nonneg + have hdδ : ∀ j, d j ≤ δ / 4 := fun j ↦ by + exact (ENNReal.toReal_mono ENNReal.ofReal_ne_top (hdiam j)).trans_eq + (ENNReal.toReal_ofReal (by positivity)) + let b : ℕ → ℝ := fun j ↦ a * (1 / 2 : ℝ) ^ j + have hbpos : ∀ j, 0 < b j := fun j ↦ by dsimp [b]; positivity + have hble : ∀ j, b j ≤ a := fun j ↦ by + dsimp [b] + have hp : (1 / 2 : ℝ) ^ j ≤ 1 := pow_le_one₀ (by norm_num) (by norm_num) + nlinarith + have hbs : Summable b := (summable_geometric_of_abs_lt_one (by norm_num : |(1 / 2 : ℝ)| < 1)).mul_left a + have hbtsum : ∑' j, b j = 2 * a := by + dsimp [b] + rw [tsum_mul_left, tsum_geometric_of_lt_one (by norm_num) (by norm_num)] + ring + have hc : ∀ j, ∃ x ∈ S, (S ∩ t j).Nonempty → x ∈ t j := by + intro j + by_cases hj : (S ∩ t j).Nonempty + · obtain ⟨x, hx⟩ := hj + exact ⟨x, hx.1, fun _ ↦ hx.2⟩ + · obtain ⟨x, hx⟩ := hSne + exact ⟨x, hx, fun hn ↦ (hj hn).elim⟩ + choose c hcS hct using hc + let r : ℕ → ℝ := fun j ↦ d j + b j + have hrpos : ∀ j, 0 < r j := fun j ↦ by dsimp [r]; linarith [hd0 j, hbpos j] + have hrδ : ∀ j, r j < δ := fun j ↦ by + dsimp [r] + linarith [hdδ j, (hble j).trans haδ] + have hballcover : S ⊆ ⋃ j, Metric.ball (c j) (r j) := by + intro x hx + obtain ⟨j, hj⟩ := Set.mem_iUnion.mp (hcover hx) + apply Set.mem_iUnion.mpr + refine ⟨j, ?_⟩ + have hdxc : dist x (c j) ≤ d j := + Metric.dist_le_diam_of_mem' (htfin j) hj (hct j ⟨x, hx, hj⟩) + change dist x (c j) < d j + b j + linarith [hbpos j] + obtain ⟨s, hscover⟩ := hcompact.elim_finite_subcover + (fun j ↦ Metric.ball (c j) (r j)) (fun _ ↦ Metric.isOpen_ball) hballcover + refine ⟨s, c, r, fun j _ ↦ ⟨hcS j, hrpos j, hrδ j⟩, hscover, ?_⟩ + have hdscost : ∑ j ∈ s, d j ^ m < ε' := by + have hst := (ENNReal.sum_le_tsum s).trans_lt hcost + have heq : (∑ j ∈ s, Metric.ediam (t j) ^ m).toReal = ∑ j ∈ s, d j ^ m := by + rw [ENNReal.toReal_sum (fun j hj ↦ ENNReal.pow_ne_top (htfin j))] + simp only [ENNReal.toReal_pow, d] + have hh := ENNReal.toReal_lt_toReal + (ne_top_of_lt hst) ENNReal.ofReal_ne_top |>.mpr hst + simpa only [heq, ENNReal.toReal_ofReal hε'.le] using hh + have hbspow : ∑ j ∈ s, b j ^ m ≤ 2 * a := by + calc + _ ≤ ∑ j ∈ s, b j := by + apply Finset.sum_le_sum + intro j hj + exact pow_le_of_le_one (hbpos j).le ((hble j).trans ha1) hm.ne' + _ ≤ ∑' j, b j := hbs.sum_le_tsum s (fun _ _ ↦ (hbpos _).le) + _ = _ := hbtsum + calc + _ ≤ ∑ j ∈ s, K * (d j ^ m + b j ^ m) := by + apply Finset.sum_le_sum + intro j hj + exact add_pow_le (hd0 j) (hbpos j).le m + _ = K * ((∑ j ∈ s, d j ^ m) + ∑ j ∈ s, b j ^ m) := by + rw [← Finset.mul_sum, Finset.sum_add_distrib] + _ < K * (ε' + 2 * a) := + mul_lt_mul_of_pos_left (add_lt_add_of_lt_of_le hdscost hbspow) hK + _ < ε := by + dsimp [ε'] + have haux : a * (8 * K) ≤ ε := (le_div_iff₀ (by positivity)).mp haε + field_simp + nlinarith + · have hSe : S = ∅ := Set.not_nonempty_iff_eq_empty.mp hSne + exact ⟨∅, fun _ ↦ Classical.choice (inferInstance : Nonempty X), fun _ ↦ 0, + by simp, by simp [hSe], by simpa using hε⟩ + +end Covers +end RPI + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +namespace RPI +section CapacityConstruction +variable {V : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] + [FiniteDimensional ℝ V] [MeasurableSpace V] [BorelSpace V] + +theorem innerCapacityBump_energy_le_radius_power (μ : Measure V) + {C A : ℝ} (hC : 0 < C) (hA : 0 < A) + (hbound : ∀ (c : V) (r : ℝ), 0 < r → ∀ x : V, + ‖gradient (ballCapacityCutoff V c r) x‖ ≤ C / r) + (m : ℕ) (c : V) (r : ℝ) (hr : 0 < r) + (hgrowth : μ (Metric.ball c (2 * r)) ≤ ENNReal.ofReal (A * (2 * r) ^ (m + 2))) : + smoothDirichletEnergy μ (innerCapacityBump c r) ≤ + ENNReal.ofReal (C ^ 2 * A * 2 ^ (m + 2) * r ^ m) := by + calc + _ ≤ ENNReal.ofReal ((C / r) ^ 2) * μ (Metric.ball c (2 * r)) := + innerCapacityBump_energy_le μ hC hbound c r hr + _ ≤ ENNReal.ofReal ((C / r) ^ 2) * ENNReal.ofReal (A * (2 * r) ^ (m + 2)) := by + gcongr + _ = _ := by + rw [← ENNReal.ofReal_mul (sq_nonneg _)] + congr 1 + rw [mul_pow, pow_add r m 2] + field_simp + +theorem exists_smooth_capacity_cutoff (μ : Measure V) (S : Set V) + (hcompact : IsCompact S) (m : ℕ) (hm : 0 < m) + (hS : Measure.hausdorffMeasure (m : ℝ) S = 0) + {A r₀ : ℝ} (hA : 0 < A) (hr₀ : 0 < r₀) + (hgrowth : ∀ c ∈ S, ∀ r : ℝ, 0 < r → r < r₀ → + μ (Metric.ball c r) ≤ ENNReal.ofReal (A * r ^ (m + 2))) + {δ ε : ℝ} (hδ : 0 < δ) (hε : 0 < ε) : + ∃ χ : V → ℝ, ContDiff ℝ ∞ χ ∧ (∀ x, χ x ∈ Icc (0 : ℝ) 1) ∧ + (∃ U : Set V, IsOpen U ∧ S ⊆ U ∧ ∀ x ∈ U, χ x = 0) ∧ + (∀ x, (∀ c ∈ S, 2 * δ ≤ dist x c) → χ x = 1) ∧ + smoothDirichletEnergy μ χ < ENNReal.ofReal ε := by + classical + obtain ⟨C, hC, hCbound⟩ := exists_ballCapacityCutoff_gradient_bound V + obtain ⟨B, hB, hBbound⟩ := exists_smoothCutoffAggregate_gradient_bound (ι := ℕ) (V := V) + let D : ℝ := C ^ 2 * A * 2 ^ (m + 2) + have hD : 0 < D := by dsimp [D]; positivity + let E : ℝ := B * D + have hE : 0 < E := mul_pos hB hD + let δ' : ℝ := min δ (r₀ / 4) + have hδ' : 0 < δ' := lt_min hδ (by positivity) + obtain ⟨s, c, r, hcsr, hcover, hcost⟩ := + exists_finite_ball_cover_of_hausdorff_zero S hcompact m hm hS + (δ := δ') (ε := ε / E) hδ' (by positivity) + let b : ℕ → V → ℝ := fun j ↦ innerCapacityBump (c j) (r j) + have hb : ∀ j, ContDiff ℝ ∞ (b j) := fun j ↦ innerCapacityBump_contDiff (c j) (r j) + have hb₁ : ∀ j ∈ s, ContDiff ℝ 1 (b j) := fun j _ ↦ (hb j).of_le (by norm_num) + let χ : V → ℝ := smoothCutoffAggregate s b + refine ⟨χ, smoothCutoffAggregate_contDiff s b (fun j _ ↦ hb j), + smoothCutoffAggregate_mem_Icc s b, ?_, ?_, ?_⟩ + · refine ⟨⋃ j ∈ s, Metric.ball (c j) (r j), isOpen_iUnion (fun _ ↦ isOpen_iUnion + (fun _ ↦ Metric.isOpen_ball)), hcover, ?_⟩ + intro x hx + obtain ⟨j, hxj⟩ := Set.mem_iUnion.mp hx + obtain ⟨hj, hxj⟩ := Set.mem_iUnion.mp hxj + apply smoothCutoffAggregate_zero_of_one hj + exact innerCapacityBump_one (hcsr j hj).2.1 (Metric.mem_ball.mp hxj).le + · intro x hx + apply smoothCutoffAggregate_one + intro j hj + apply innerCapacityBump_zero (hcsr j hj).2.1 + have hrδ := (hcsr j hj).2.2.trans_le (min_le_left δ (r₀ / 4)) + linarith [hx (c j) (hcsr j hj).1] + · have hej : ∀ j ∈ s, smoothDirichletEnergy μ (b j) ≤ ENNReal.ofReal (D * (r j) ^ m) := by + intro j hj + apply innerCapacityBump_energy_le_radius_power μ hC hA hCbound m (c j) (r j) (hcsr j hj).2.1 + apply hgrowth (c j) (hcsr j hj).1 (2 * r j) + (mul_pos (by norm_num) (hcsr j hj).2.1) + have hrr := (hcsr j hj).2.2.trans_le (min_le_right δ (r₀ / 4)) + linarith + have hagg := smoothCutoffAggregate_energy_le μ hB.le s b hb₁ (hBbound s b hb₁) + have hsum0 : 0 ≤ ∑ j ∈ s, r j ^ m := + Finset.sum_nonneg (fun j hj ↦ pow_nonneg (hcsr j hj).2.1.le _) + calc + _ ≤ ENNReal.ofReal B * ∑ j ∈ s, smoothDirichletEnergy μ (b j) := hagg + _ ≤ ENNReal.ofReal B * ∑ j ∈ s, ENNReal.ofReal (D * (r j) ^ m) := by + gcongr with j hj + exact hej j hj + _ = ENNReal.ofReal (E * ∑ j ∈ s, r j ^ m) := by + rw [← ENNReal.ofReal_sum_of_nonneg (s := s) (f := fun j ↦ D * r j ^ m) + (fun j hj ↦ mul_nonneg hD.le (pow_nonneg (hcsr j hj).2.1.le _)), + ← ENNReal.ofReal_mul hB.le, ← Finset.mul_sum] + congr 1 + dsimp [E, D] + ring + _ < ENNReal.ofReal ε := by + apply ENNReal.ofReal_lt_ofReal_iff hε |>.mpr + have h := (lt_div_iff₀ hE).mp hcost + simpa only [mul_comm] using h + +theorem exists_smooth_capacity_sequence (μ : Measure V) (S : Set V) + (hcompact : IsCompact S) (m : ℕ) (hm : 0 < m) + (hS : Measure.hausdorffMeasure (m : ℝ) S = 0) + {A r₀ : ℝ} (hA : 0 < A) (hr₀ : 0 < r₀) + (hgrowth : ∀ c ∈ S, ∀ r : ℝ, 0 < r → r < r₀ → + μ (Metric.ball c r) ≤ ENNReal.ofReal (A * r ^ (m + 2))) : + ∃ χ : ℕ → V → ℝ, + (∀ i, ContDiff ℝ ∞ (χ i) ∧ (∀ x, χ i x ∈ Icc (0 : ℝ) 1) ∧ + ∃ U : Set V, IsOpen U ∧ S ⊆ U ∧ ∀ x ∈ U, χ i x = 0) ∧ + (∀ x ∉ S, ∀ᶠ i in atTop, χ i x = 1) ∧ + Tendsto (fun i ↦ smoothDirichletEnergy μ (χ i)) atTop (𝓝 0) := by + classical + let a : ℕ → ℝ := fun i ↦ 1 / ((i : ℝ) + 1) + have ha : ∀ i, 0 < a i := fun i ↦ by dsimp [a]; positivity + have ha0 : Tendsto a atTop (𝓝 0) := tendsto_one_div_add_atTop_nhds_zero_nat + have hχ : ∀ i : ℕ, ∃ χ : V → ℝ, ContDiff ℝ ∞ χ ∧ + (∀ x, χ x ∈ Icc (0 : ℝ) 1) ∧ + (∃ U : Set V, IsOpen U ∧ S ⊆ U ∧ ∀ x ∈ U, χ x = 0) ∧ + (∀ x, (∀ c ∈ S, 2 * a i ≤ dist x c) → χ x = 1) ∧ + smoothDirichletEnergy μ χ < ENNReal.ofReal (a i) := fun i ↦ + exists_smooth_capacity_cutoff μ S hcompact m hm hS hA hr₀ hgrowth (ha i) (ha i) + choose χ hχsmooth hχbound hχzero hχone hχenergy using hχ + refine ⟨χ, fun i ↦ ⟨hχsmooth i, hχbound i, hχzero i⟩, ?_, ?_⟩ + · intro x hx + obtain ⟨d, hd, hball⟩ := Metric.isOpen_iff.mp hcompact.isClosed.isOpen_compl x hx + have hfar : ∀ c ∈ S, d ≤ dist x c := by + intro c hc + by_contra hcclose + have hmem : c ∈ Metric.ball x d := by + simpa only [Metric.mem_ball, dist_comm] using lt_of_not_ge hcclose + exact hball hmem hc + have h2a : Tendsto (fun i ↦ 2 * a i) atTop (𝓝 0) := by + simpa only [mul_zero] using ha0.const_mul 2 + filter_upwards [h2a.eventually (gt_mem_nhds hd)] with i hi + exact hχone i x (fun c hc ↦ hi.le.trans (hfar c hc)) + · have hea : Tendsto (fun i ↦ ENNReal.ofReal (a i)) atTop (𝓝 0) := by + simpa only [ENNReal.ofReal_zero] using ENNReal.tendsto_ofReal ha0 + exact tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds hea + (fun _ ↦ zero_le) (fun i ↦ (hχenergy i).le) + +omit [BorelSpace V] in +theorem projected_smooth_energy_le (μ : Measure V) (P : V → Submodule ℝ V) (f : V → ℝ) : + (∫⁻ x, ENNReal.ofReal + (‖((P x).orthogonalProjectionOnto (gradient f x) : V)‖ ^ 2) ∂μ) ≤ + smoothDirichletEnergy μ f := by + apply lintegral_mono + intro x + apply ENNReal.ofReal_le_ofReal + have hp : ‖((P x).orthogonalProjectionOnto (gradient f x) : V)‖ ≤ ‖gradient f x‖ := by + calc + _ ≤ ‖(P x).orthogonalProjectionOnto‖ * ‖gradient f x‖ := + (P x).orthogonalProjectionOnto.le_opNorm _ + _ ≤ 1 * ‖gradient f x‖ := mul_le_mul_of_nonneg_right + (P x).orthogonalProjectionOnto_norm_le (norm_nonneg _) + _ = _ := one_mul _ + exact (sq_le_sq₀ (norm_nonneg _) (norm_nonneg _)).mpr hp + +omit [BorelSpace V] in +theorem projected_smooth_energy_tendsto_zero (μ : Measure V) (P : V → Submodule ℝ V) + (χ : ℕ → V → ℝ) + (hχ : Tendsto (fun i ↦ smoothDirichletEnergy μ (χ i)) atTop (𝓝 0)) : + Tendsto (fun i ↦ ∫⁻ x, ENNReal.ofReal + (‖((P x).orthogonalProjectionOnto (gradient (χ i) x) : V)‖ ^ 2) ∂μ) atTop (𝓝 0) := + tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds hχ + (fun _ ↦ zero_le) (fun i ↦ projected_smooth_energy_le μ P (χ i)) + +omit [InnerProductSpace ℝ V] [FiniteDimensional ℝ V] in +theorem hausdorff_capacity_dimension {n : ℕ} (hn : 8 ≤ n) (S : Set V) + (hdim : dimH S ≤ (n - 8 : ℕ)) : + 0 < n - 3 ∧ Measure.hausdorffMeasure ((n - 3 : ℕ) : ℝ) S = 0 := by + refine ⟨by omega, ?_⟩ + have hlt : dimH S < (n - 3 : ℕ) := hdim.trans_lt (by + exact_mod_cast (show n - 8 < n - 3 by omega)) + simpa only [NNReal.coe_natCast] using hausdorffMeasure_of_dimH_lt (d := (n - 3 : ℕ)) hlt + +end CapacityConstruction +end RPI + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +namespace RPI.Boundary + +theorem exists_memLp_capacity_sequence {n : ℕ} (hn : 8 ≤ n) + (S V Z : Set (Space n)) (hZc : IsCompact Z) (hZd : dimH Z ≤ (n - 8 : ℕ)) + (hgrad : ∀ f : Space n → ℝ, ContDiff ℝ ∞ f → + AEStronglyMeasurable (surfaceGradient S f) ((surfaceMeasure S).restrict V)) + {A r₀ : ℝ} (hA : 0 < A) (hr₀ : 0 < r₀) + (hgrowth : ∀ c ∈ Z, ∀ r : ℝ, 0 < r → r < r₀ → + (surfaceMeasure S).restrict V (Metric.ball c r) ≤ + ENNReal.ofReal (A * r ^ (n - 1))) : + ∃ χ : ℕ → Space n → ℝ, + (∀ i, ContDiff ℝ ∞ (χ i) ∧ (∀ x, χ i x ∈ Icc (0 : ℝ) 1) ∧ + (∃ U : Set (Space n), IsOpen U ∧ Z ⊆ U ∧ ∀ x ∈ U, χ i x = 0) ∧ + MemLp (surfaceGradient S (χ i)) 2 ((surfaceMeasure S).restrict V)) ∧ + (∀ᵐ x ∂(surfaceMeasure S).restrict V, + Tendsto (fun i ↦ χ i x) atTop (𝓝 1)) ∧ + Tendsto (fun i ↦ vectorEnergy ((surfaceMeasure S).restrict V) + (surfaceGradient S (χ i))) atTop (𝓝 0) := by + obtain ⟨hm, hZd'⟩ := hausdorff_capacity_dimension hn Z hZd + have hpow : n - 3 + 2 = n - 1 := by omega + obtain ⟨χ, hχ, hχone, hχenergy⟩ := exists_smooth_capacity_sequence + ((surfaceMeasure S).restrict V) Z hZc (n - 3) hm hZd' hA hr₀ + (by simpa only [hpow] using hgrowth) + have hE : Tendsto (fun i ↦ vectorEnergy ((surfaceMeasure S).restrict V) + (surfaceGradient S (χ i))) atTop (𝓝 0) := by + exact projected_smooth_energy_tendsto_zero ((surfaceMeasure S).restrict V) + (tangentPlane S) χ hχenergy + have hfinite : ∀ᶠ i in atTop, vectorEnergy ((surfaceMeasure S).restrict V) + (surfaceGradient S (χ i)) < 1 := + hE.eventually (gt_mem_nhds (by norm_num : (0 : ℝ≥0∞) < 1)) + obtain ⟨N, hN⟩ := eventually_atTop.mp hfinite + have hshift : Tendsto (fun i : ℕ ↦ i + N) atTop atTop := tendsto_add_atTop_nat N + refine ⟨fun i ↦ χ (i + N), ?_, ?_, hE.comp hshift⟩ + · intro i + refine ⟨(hχ (i + N)).1, (hχ (i + N)).2.1, (hχ (i + N)).2.2, ?_⟩ + apply (memLp_two_iff_vectorEnergy (hgrad _ (hχ (i + N)).1)).mpr + exact (hN (i + N) (Nat.le_add_left N i)).trans (by norm_num) + · have hnull : (surfaceMeasure S).restrict V Z = 0 := + le_antisymm ((Measure.restrict_apply_le V Z).trans_eq + (surfaceMeasure_zero_of_singular_dim hn S Z hZd)) zero_le + have hae : ∀ᵐ x ∂(surfaceMeasure S).restrict V, x ∉ Z := by + simpa only [ae_iff, not_not, Set.ofPred_mem_eq] using hnull + filter_upwards [hae] with x hx + exact ((tendsto_congr' (hχone x hx)).2 tendsto_const_nhds).comp hshift + +theorem hausdorff_trace_mem_sobolevGraph {n : ℕ} (hn : 8 ≤ n) + {S Z : Set (Space n)} (hS : IsClosed S) (V : Set (Space n)) + (hZc : IsCompact Z) (hZd : dimH Z ≤ (n - 8 : ℕ)) + {h : Space n → ℝ} {G : Space n → Space n} + (hreg : ∀ x ∈ S \ Z, HasSmoothTraceJetAt S h G x) + (hh : MemLp h 2 ((surfaceMeasure S).restrict V)) + (hG : MemLp G 2 ((surfaceMeasure S).restrict V)) + {M : ℝ} (hM : 0 ≤ M) + (hbound : ∀ᵐ x ∂(surfaceMeasure S).restrict V, ‖h x‖ ≤ M) + (hgrad : ∀ f : Space n → ℝ, ContDiff ℝ ∞ f → + AEStronglyMeasurable (surfaceGradient S f) ((surfaceMeasure S).restrict V)) + {A r₀ : ℝ} (hA : 0 < A) (hr₀ : 0 < r₀) + (hgrowth : ∀ c ∈ Z, ∀ r : ℝ, 0 < r → r < r₀ → + (surfaceMeasure S).restrict V (Metric.ball c r) ≤ + ENNReal.ofReal (A * r ^ (n - 1))) : + (hh.toLp h, hG.toLp G) ∈ closure (smoothGradientGraph S V) := by + obtain ⟨χ, hχ, hχlim, hχE⟩ := exists_memLp_capacity_sequence hn S V Z hZc hZd + hgrad hA hr₀ hgrowth + exact capacity_trace_mem_sobolevGraph hS V hreg hh hG hM hbound χ + (fun i ↦ (hχ i).1) (fun i ↦ (hχ i).2.2.1) + (fun i ↦ ae_of_all _ (hχ i).2.1) hχlim (fun i ↦ (hχ i).2.2.2) hχE + +end RPI.Boundary + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +namespace RPI.Boundary + +theorem tangentPlane_eq_ker_of_local_level {n : ℕ} {S : Set (Space n)} + {f : Space n → ℝ} {x : Space n} + (hf : ContDiffAt ℝ 1 f x) (hdf : fderiv ℝ f x ≠ 0) + (hlevel : ∀ᶠ y in 𝓝 x, y ∈ S ↔ f y = f x) : + tangentPlane S x = (fderiv ℝ f x).ker := by + have hder := hf.hasStrictFDerivAt (by norm_num) + have hrange : (fderiv ℝ f x).range = ⊤ := by + apply LinearMap.range_eq_top.mpr + have hv : ∃ v, fderiv ℝ f x v ≠ 0 := by + by_contra! hv + apply hdf + ext v + exact hv v + obtain ⟨v, hv⟩ := hv + intro a + refine ⟨(a / fderiv ℝ f x v) • v, ?_⟩ + simp only [map_smul, smul_eq_mul] + exact div_mul_cancel₀ a hv + apply le_antisymm + · apply Submodule.span_le.mpr + rintro v ⟨γ, hγx, hγd, hγS⟩ + have ht : Tendsto γ (𝓝 (0 : ℝ)) (𝓝 x) := hγx ▸ hγd.continuousAt + have heq : (f ∘ γ) =ᶠ[𝓝 (0 : ℝ)] fun _ ↦ f x := by + filter_upwards [ht.eventually hlevel, hγS] with t he ht + exact he.mp ht + have hd : HasDerivAt (f ∘ γ) (fderiv ℝ f x v) 0 := by + exact (show HasFDerivAt f (fderiv ℝ f x) (γ 0) by + simpa only [hγx] using hder.hasFDerivAt).comp_hasDerivAt 0 hγd + exact hd.unique ((hasDerivAt_const 0 (f x)).congr_of_eventuallyEq heq) + · intro v hv + let v' : (fderiv ℝ f x).ker := ⟨v, hv⟩ + let γ : ℝ → Space n := fun t ↦ hder.implicitFunction f (fderiv ℝ f x) + hrange (f x) (t • v') + have hγx : γ 0 = x := by simp [γ] + have hline : HasDerivAt (fun t : ℝ ↦ t • v') v' 0 := by + simpa using (hasDerivAt_id (0 : ℝ)).smul_const v' + have hγd : HasDerivAt γ v 0 := by + have hd' : HasFDerivAt (hder.implicitFunction f (fderiv ℝ f x) + hrange (f x)) (fderiv ℝ f x).ker.subtypeL ((0 : ℝ) • v') := by + simpa only [zero_smul] using (hder.to_implicitFunction hrange).hasFDerivAt + exact hd'.comp_hasDerivAt 0 hline + have ht : Tendsto γ (𝓝 (0 : ℝ)) (𝓝 x) := hγx ▸ hγd.continuousAt + have hparam : Tendsto (fun t : ℝ ↦ (f x, t • v')) (𝓝 0) + (𝓝 (f x, 0)) := by + apply tendsto_const_nhds.prodMk_nhds + simpa only [ContinuousAt, zero_smul] using hline.continuousAt + have hγS : ∀ᶠ t in 𝓝 (0 : ℝ), γ t ∈ S := by + filter_upwards [ht.eventually hlevel, + hparam.eventually (hder.map_implicitFunction_eq hrange)] with t he hval + exact he.mpr hval + exact Submodule.subset_span ⟨γ, hγx, hγd, hγS⟩ + +end RPI.Boundary + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +namespace RPI.Boundary + +theorem surfaceGradient_eq_level_formula {n : ℕ} {S : Set (Space n)} + {f g : Space n → ℝ} {x : Space n} + (hf : ContDiffAt ℝ 1 f x) (hdf : fderiv ℝ f x ≠ 0) + (hlevel : ∀ᶠ y in 𝓝 x, y ∈ S ↔ f y = f x) : + surfaceGradient S g x = gradient g x - + (inner ℝ (gradient f x) (gradient g x) / ‖gradient f x‖ ^ 2) • gradient f x := by + have hgn : gradient f x ≠ 0 := by + intro he + apply hdf + rw [← toDual_gradient, he, map_zero] + have hnorm : ‖gradient f x‖ ^ 2 ≠ 0 := pow_ne_zero _ (norm_ne_zero_iff.mpr hgn) + have htan := tangentPlane_eq_ker_of_local_level hf hdf hlevel + change (tangentPlane S x).starProjection (gradient g x) = _ + apply Submodule.eq_starProjection_of_mem_of_inner_eq_zero + · rw [htan] + change fderiv ℝ f x (_ - _) = 0 + rw [map_sub, map_smul] + rw [← inner_gradient_left, ← inner_gradient_left, real_inner_self_eq_norm_sq] + simp only [smul_eq_mul] + rw [div_mul_cancel₀ _ hnorm, sub_self] + · intro w hw + rw [htan] at hw + rw [sub_sub_cancel, real_inner_smul_left, inner_gradient_left] + change fderiv ℝ f x w = 0 at hw + simp only [inner_gradient_left, hw, mul_zero] + +theorem continuousAt_gradient_of_contDiffAt {n : ℕ} {f : Space n → ℝ} {x : Space n} + (hf : ContDiffAt ℝ 1 f x) : ContinuousAt (gradient f) x := by + exact (InnerProductSpace.toDual ℝ (Space n)).symm.continuous.continuousAt.comp + (hf.continuousAt_fderiv (by norm_num)) + +end RPI.Boundary + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/ExistsLocalPolarEqApproximateNormal.lean b/lean/OAI/Geometry/Perimeter/Regularity/ExistsLocalPolarEqApproximateNormal.lean new file mode 100644 index 0000000000000000000000000000000000000000..963b433899ee81242f2103df6818f28e619fb765 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/ExistsLocalPolarEqApproximateNormal.lean @@ -0,0 +1,402 @@ +import OAI.Geometry.Perimeter.Regularity.TsupportBlowdownSubsetBall + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +namespace RPISingularHarnack + +theorem exists_local_polar_eq_approximateNormal {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (U : Set (Euc n)) (hU : IsOpen U) (hP : perimeter E U ≠ ⊤) : + ∃ G : Euc n → Euc n, + StronglyMeasurable G ∧ MemLp G 2 ((perimeterMeasure E).restrict U) ∧ + (∀ᵐ x ∂(perimeterMeasure E).restrict U, HasHalfspaceBlowup E x (G x)) ∧ + (∀ᵐ x ∂(perimeterMeasure E).restrict U, approximateNormal E x = G x) ∧ + ∀ V : Euc n → Euc n, ContDiff ℝ ∞ V → HasCompactSupport V → tsupport V ⊆ U → + (∫ x in E, divergence V x) = ∫ x in U, inner ℝ (G x) (V x) ∂perimeterMeasure E := by + let μ := (perimeterMeasure E).restrict U + let : IsFiniteMeasure μ := ⟨by + rw [Measure.restrict_apply_univ, perimeterMeasure_open E hU]; exact hP.lt_top⟩ + obtain ⟨G, hG, hGp, hGn, hdiff, hrep⟩ := + exists_differentiating_unit_polar (lt_trans (by norm_num) hn) hmin U hU hP + have hsupp : ∀ᵐ x ∂μ, x ∈ perimeterSupport E := by + have hs : ∀ᵐ x ∂perimeterMeasure E, x ∈ perimeterSupport E := by + rw [← perimeterMeasure_support E] + exact (perimeterMeasure E).support_mem_ae + exact ae_restrict_of_ae hs + have hUae : ∀ᵐ x ∂μ, x ∈ U := ae_restrict_mem hU.measurableSet + have hblow : ∀ᵐ x ∂μ, HasHalfspaceBlowup E x (G x) := by + filter_upwards [hGn, hdiff, hsupp, hUae] with x hx hdx hsx hux + exact hasHalfspaceBlowup_of_differentiating_polar hn hmin hU μ + (MemLp.integrable (by norm_num) hGp) hrep x (G x) hux hsx hx hdx + exact ⟨G, hG, hGp, hblow, + hblow.mono (fun x hx ↦ approximateNormal_eq_of_blowup hmin.1 hx), hrep⟩ + +theorem minimizing_gaussGreen_local {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (U : Set (Euc n)) (hU : IsOpen U) (hP : perimeter E U ≠ ⊤) + (V : Euc n → Euc n) (hV : ContDiff ℝ ∞ V) (hVc : HasCompactSupport V) + (hVU : tsupport V ⊆ U) : + (∫ x in E, divergence V x) = + ∫ x in U, inner ℝ (approximateNormal E x) (V x) ∂perimeterMeasure E := by + obtain ⟨G, _, _, _, heq, hrep⟩ := exists_local_polar_eq_approximateNormal hn hmin U hU hP + rw [hrep V hV hVc hVU] + apply integral_congr_ae + exact heq.mono fun x hx ↦ by + change inner ℝ (G x) (V x) = inner ℝ (approximateNormal E x) (V x) + rw [hx] + +theorem minimizing_halfspaceBlowup_ae {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) : + ∀ᵐ x ∂perimeterMeasure E, HasHalfspaceBlowup E x (approximateNormal E x) := by + let U : ℕ → Set (Euc n) := fun j ↦ Metric.ball 0 (j + 1 : ℝ) + have hcover : (⋃ j, U j) = univ := by + apply eq_univ_of_forall + intro x + obtain ⟨j, hj⟩ := exists_nat_gt ‖x‖ + exact mem_iUnion.mpr ⟨j, by simpa [U, Metric.mem_ball, dist_zero_right] using + (show ‖x‖ < (j : ℝ) + 1 by linarith)⟩ + have hall : ∀ j, ∀ᵐ x ∂(perimeterMeasure E).restrict (U j), + HasHalfspaceBlowup E x (approximateNormal E x) := by + intro j + obtain ⟨G, _, _, hG, heq, _⟩ := exists_local_polar_eq_approximateNormal hn hmin + (U j) Metric.isOpen_ball (ne_of_lt (hmin.2.1 0 (j + 1) (by positivity))) + filter_upwards [hG, heq] with x hx he + rwa [he] + have hh := (ae_restrict_iUnion_iff U + (fun x ↦ HasHalfspaceBlowup E x (approximateNormal E x))).mpr hall + simpa only [hcover, Measure.restrict_univ] using hh + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +namespace RPI +section BoundedCoefficientLimits +variable {X V : Type*} [MeasurableSpace X] [NormedAddCommGroup V] + [NormedSpace ℝ V] {μ : Measure X} + +theorem vectorEnergy_bounded_coefficient_tendsto {G : X → V} (hG : MemLp G 2 μ) + (a : ℕ → X → ℝ) (hm : ∀ j, AEStronglyMeasurable (a j) μ) + {M : ℝ} (hM : 0 ≤ M) + (hb : ∀ j, ∀ᵐ x ∂μ, ‖a j x‖ ≤ M) + (ht : ∀ᵐ x ∂μ, Tendsto (fun j ↦ a j x) atTop (𝓝 0)) : + Tendsto (fun j ↦ vectorEnergy μ (fun x ↦ a j x • G x)) atTop (𝓝 0) := by + have hfin : (∫⁻ x, ENNReal.ofReal (M ^ 2) * ENNReal.ofReal (‖G x‖ ^ 2) ∂μ) ≠ ⊤ := by + rw [lintegral_const_mul' (ENNReal.ofReal (M ^ 2)) (fun x ↦ ENNReal.ofReal (‖G x‖ ^ 2)) ENNReal.ofReal_ne_top] + exact ENNReal.mul_ne_top ENNReal.ofReal_ne_top + ((memLp_two_iff_vectorEnergy hG.aestronglyMeasurable).mp hG).ne + have hlim := tendsto_lintegral_of_dominated_convergence' + (fun x ↦ ENNReal.ofReal (M ^ 2) * ENNReal.ofReal (‖G x‖ ^ 2)) + (f := fun _ ↦ (0 : ℝ≥0∞)) + (F := fun j x ↦ ENNReal.ofReal (‖a j x • G x‖ ^ 2)) + (fun j ↦ (((hm j).smul hG.aestronglyMeasurable).norm.pow 2).aemeasurable.ennreal_ofReal) ?_ hfin ?_ + · simpa only [vectorEnergy, lintegral_zero] using hlim + · intro j + filter_upwards [hb j] with x hx + rw [← ENNReal.ofReal_mul (sq_nonneg M)] + apply ENNReal.ofReal_le_ofReal + rw [norm_smul, mul_pow] + exact mul_le_mul_of_nonneg_right ((sq_le_sq₀ (norm_nonneg _) hM).mpr hx) (sq_nonneg _) + · filter_upwards [ht] with x hx + have hv : Tendsto (fun j ↦ a j x • G x) atTop (𝓝 (0 : V)) := by + simpa only [zero_smul] using hx.smul_const (G x) + simpa only [norm_zero, zero_pow (by norm_num : (2 : ℕ) ≠ 0), ENNReal.ofReal_zero] using + ENNReal.tendsto_ofReal (hv.norm.pow 2) + +theorem vectorEnergy_varying_bounded_smul_zero {F : ℕ → X → V} + (a : ℕ → X → ℝ) {M : ℝ} (hM : 0 ≤ M) + (ha : ∀ j, ∀ᵐ x ∂μ, ‖a j x‖ ≤ M) + (hF : Tendsto (fun j ↦ vectorEnergy μ (F j)) atTop (𝓝 0)) : + Tendsto (fun j ↦ vectorEnergy μ (fun x ↦ a j x • F j x)) atTop (𝓝 0) := by + have hh : Tendsto (fun j ↦ ENNReal.ofReal (M ^ 2) * vectorEnergy μ (F j)) + atTop (𝓝 0) := by + simpa only [mul_zero] using ENNReal.Tendsto.const_mul hF (Or.inr ENNReal.ofReal_ne_top) + exact tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds hh + (fun _ ↦ bot_le) (fun j ↦ vectorEnergy_bounded_smul hM (ha j)) + +theorem vectorEnergy_composed_gradient_tendsto + {u : ℕ → X → ℝ} {h : X → ℝ} {F : ℕ → X → V} {G : X → V} + (hu : ∀ j, AEStronglyMeasurable (u j) μ) (hh : AEStronglyMeasurable h μ) + (hF : ∀ j, MemLp (F j) 2 μ) (hG : MemLp G 2 μ) + (hFG : Tendsto (fun j ↦ vectorEnergy μ (fun x ↦ F j x - G x)) atTop (𝓝 0)) + (huh : ∀ᵐ x ∂μ, Tendsto (fun j ↦ u j x) atTop (𝓝 (h x))) + (b : ℝ → ℝ) (hb : Continuous b) {M : ℝ} (hM : 0 ≤ M) + (hbM : ∀ t, ‖b t‖ ≤ M) : + Tendsto (fun j ↦ vectorEnergy μ + (fun x ↦ b (u j x) • F j x - b (h x) • G x)) atTop (𝓝 0) := by + let A : ℕ → X → V := fun j x ↦ b (u j x) • (F j x - G x) + let B : ℕ → X → V := fun j x ↦ (b (u j x) - b (h x)) • G x + have hAm : ∀ j, AEStronglyMeasurable (A j) μ := fun j ↦ + (hb.comp_aestronglyMeasurable (hu j)).smul + ((hF j).aestronglyMeasurable.sub hG.aestronglyMeasurable) + have hBm : ∀ j, AEStronglyMeasurable (B j) μ := fun j ↦ + ((hb.comp_aestronglyMeasurable (hu j)).sub + (hb.comp_aestronglyMeasurable hh)).smul hG.aestronglyMeasurable + have hA0 : Tendsto (fun j ↦ vectorEnergy μ (A j)) atTop (𝓝 0) := + vectorEnergy_varying_bounded_smul_zero (fun j x ↦ b (u j x)) hM + (fun j ↦ ae_of_all _ fun x ↦ hbM _) hFG + have hB0 : Tendsto (fun j ↦ vectorEnergy μ (B j)) atTop (𝓝 0) := by + apply vectorEnergy_bounded_coefficient_tendsto hG + (fun j x ↦ b (u j x) - b (h x)) + (fun j ↦ (hb.comp_aestronglyMeasurable (hu j)).sub (hb.comp_aestronglyMeasurable hh)) + (M := 2 * M) (by positivity) + · intro j + exact ae_of_all _ fun x ↦ (norm_sub_le _ _).trans (by linarith [hbM (u j x), hbM (h x)]) + · filter_upwards [huh] with x hx + simpa only [sub_self, Function.comp_def] using (hb.continuousAt.tendsto.comp hx).sub_const (b (h x)) + have hbound : ∀ j, vectorEnergy μ (fun x ↦ b (u j x) • F j x - b (h x) • G x) ≤ + 2 * vectorEnergy μ (A j) + 2 * vectorEnergy μ (B j) := by + intro j + have heq : (fun x ↦ b (u j x) • F j x - b (h x) • G x) = + fun x ↦ A j x + B j x := by funext x; dsimp [A, B]; module + rw [heq] + exact vectorEnergy_add_le (hAm j) (hBm j) + have hlim : Tendsto (fun j ↦ 2 * vectorEnergy μ (A j) + 2 * vectorEnergy μ (B j)) + atTop (𝓝 0) := by + simpa only [mul_zero, add_zero] using + (ENNReal.Tendsto.const_mul hA0 (Or.inr (by norm_num : (2 : ℝ≥0∞) ≠ ⊤))).add + (ENNReal.Tendsto.const_mul hB0 (Or.inr (by norm_num : (2 : ℝ≥0∞) ≠ ⊤))) + exact tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds hlim + (fun _ ↦ bot_le) hbound + +end BoundedCoefficientLimits +end RPI + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +namespace RPI +section NonlinearTests +variable {X V : Type*} [MeasurableSpace X] [NormedAddCommGroup V] + [NormedSpace ℝ V] {μ : Measure X} + +theorem vectorEnergy_smul_bounded_field_le {a : X → ℝ} {D : X → V} {M : ℝ} + (hM : 0 ≤ M) (hD : ∀ᵐ x ∂μ, ‖D x‖ ≤ M) : + vectorEnergy μ (fun x ↦ a x • D x) ≤ ENNReal.ofReal (M ^ 2) * vectorEnergy μ a := by + unfold vectorEnergy + rw [← lintegral_const_mul' _ _ ENNReal.ofReal_ne_top] + · apply lintegral_mono_ae + filter_upwards [hD] with x hx + rw [← ENNReal.ofReal_mul (sq_nonneg M)] + apply ENNReal.ofReal_le_ofReal + rw [norm_smul, mul_pow] + nlinarith [mul_le_mul_of_nonneg_left ((sq_le_sq₀ (norm_nonneg _) hM).mpr hx) (sq_nonneg ‖a x‖)] + +theorem vectorEnergy_lipschitz_comp_zero {u : ℕ → X → ℝ} {h : X → ℝ} + {ψ : ℝ → ℝ} {K : ℝ≥0} (hψ : LipschitzWith K ψ) + (hu : Tendsto (fun j ↦ vectorEnergy μ (fun x ↦ u j x - h x)) atTop (𝓝 0)) : + Tendsto (fun j ↦ vectorEnergy μ (fun x ↦ ψ (u j x) - ψ (h x))) atTop (𝓝 0) := by + have hb : ∀ j, vectorEnergy μ (fun x ↦ ψ (u j x) - ψ (h x)) ≤ + ENNReal.ofReal ((K : ℝ) ^ 2) * vectorEnergy μ (fun x ↦ u j x - h x) := by + intro j + unfold vectorEnergy + rw [← lintegral_const_mul' _ _ ENNReal.ofReal_ne_top] + · apply lintegral_mono + intro x + dsimp only + rw [← ENNReal.ofReal_mul (sq_nonneg (K : ℝ))] + apply ENNReal.ofReal_le_ofReal + have hh := hψ.norm_sub_le (u j x) (h x) + simpa only [mul_pow] using (sq_le_sq₀ (norm_nonneg _) (by positivity)).mpr hh + have hlim : Tendsto (fun j ↦ ENNReal.ofReal ((K : ℝ) ^ 2) * + vectorEnergy μ (fun x ↦ u j x - h x)) atTop (𝓝 0) := by + simpa only [mul_zero] using ENNReal.Tendsto.const_mul hu (Or.inr ENNReal.ofReal_ne_top) + exact tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds hlim + (fun _ ↦ bot_le) hb + +theorem vectorEnergy_nonlinear_test_tendsto + {u : ℕ → X → ℝ} {h η : X → ℝ} {F : ℕ → X → V} {G D : X → V} + (hu : ∀ j, AEStronglyMeasurable (u j) μ) (hh : AEStronglyMeasurable h μ) + (hη : AEStronglyMeasurable η μ) (hD : AEStronglyMeasurable D μ) + (hF : ∀ j, MemLp (F j) 2 μ) (hG : MemLp G 2 μ) + {M N : ℝ} (hM : 0 ≤ M) (hN : 0 ≤ N) + (hηM : ∀ᵐ x ∂μ, ‖η x‖ ≤ M) (hDN : ∀ᵐ x ∂μ, ‖D x‖ ≤ N) + (huh : Tendsto (fun j ↦ vectorEnergy μ (fun x ↦ u j x - h x)) atTop (𝓝 0)) + (hFG : Tendsto (fun j ↦ vectorEnergy μ (fun x ↦ F j x - G x)) atTop (𝓝 0)) + (hpoint : ∀ᵐ x ∂μ, Tendsto (fun j ↦ u j x) atTop (𝓝 (h x))) + {ψ : ℝ → ℝ} {K : ℝ≥0} (hψ : LipschitzWith K ψ) + (b : ℝ → ℝ) (hb : Continuous b) {L : ℝ} (hL : 0 ≤ L) (hbL : ∀ t, ‖b t‖ ≤ L) : + Tendsto (fun j ↦ vectorEnergy μ (fun x ↦ + ((2 * η x * ψ (u j x)) • D x + (η x ^ 2 * b (u j x)) • F j x) - + ((2 * η x * ψ (h x)) • D x + (η x ^ 2 * b (h x)) • G x))) atTop (𝓝 0) := by + let A : ℕ → X → V := fun j x ↦ (2 * η x) • ((ψ (u j x) - ψ (h x)) • D x) + let B : ℕ → X → V := fun j x ↦ η x ^ 2 • (b (u j x) • F j x - b (h x) • G x) + have hψm := hψ.continuous + have hAm : ∀ j, AEStronglyMeasurable (A j) μ := fun j ↦ + (aestronglyMeasurable_const.mul hη).smul + (((hψm.comp_aestronglyMeasurable (hu j)).sub + (hψm.comp_aestronglyMeasurable hh)).smul hD) + have hBm : ∀ j, AEStronglyMeasurable (B j) μ := fun j ↦ + (hη.pow 2).smul + (((hb.comp_aestronglyMeasurable (hu j)).smul (hF j).aestronglyMeasurable).sub + ((hb.comp_aestronglyMeasurable hh).smul hG.aestronglyMeasurable)) + have hc : Tendsto (fun j ↦ vectorEnergy μ (fun x ↦ (ψ (u j x) - ψ (h x)) • D x)) + atTop (𝓝 0) := by + have hh0 := vectorEnergy_lipschitz_comp_zero hψ huh + have hlim : Tendsto (fun j ↦ ENNReal.ofReal (N ^ 2) * + vectorEnergy μ (fun x ↦ ψ (u j x) - ψ (h x))) atTop (𝓝 0) := by + simpa only [mul_zero] using ENNReal.Tendsto.const_mul hh0 (Or.inr ENNReal.ofReal_ne_top) + exact tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds hlim + (fun _ ↦ bot_le) (fun _ ↦ vectorEnergy_smul_bounded_field_le hN hDN) + have hA0 : Tendsto (fun j ↦ vectorEnergy μ (A j)) atTop (𝓝 0) := by + apply vectorEnergy_varying_bounded_smul_zero (fun _ x ↦ 2 * η x) (M := 2 * M) (by positivity) _ hc + intro j + filter_upwards [hηM] with x hx + simpa only [norm_mul, Real.norm_ofNat] using mul_le_mul_of_nonneg_left hx (by norm_num : (0 : ℝ) ≤ 2) + have hB0 : Tendsto (fun j ↦ vectorEnergy μ (B j)) atTop (𝓝 0) := by + apply vectorEnergy_varying_bounded_smul_zero (fun _ x ↦ η x ^ 2) (M := M ^ 2) (sq_nonneg M) _ + (vectorEnergy_composed_gradient_tendsto hu hh hF hG hFG hpoint b hb hL hbL) + intro j + filter_upwards [hηM] with x hx + simpa only [norm_pow] using (sq_le_sq₀ (norm_nonneg _) hM).mpr hx + have hlim : Tendsto (fun j ↦ 2 * vectorEnergy μ (A j) + 2 * vectorEnergy μ (B j)) + atTop (𝓝 0) := by + simpa only [mul_zero, add_zero] using + (ENNReal.Tendsto.const_mul hA0 (Or.inr (by norm_num : (2 : ℝ≥0∞) ≠ ⊤))).add + (ENNReal.Tendsto.const_mul hB0 (Or.inr (by norm_num : (2 : ℝ≥0∞) ≠ ⊤))) + apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds hlim (fun _ ↦ bot_le) + intro j + have heq : (fun x ↦ + ((2 * η x * ψ (u j x)) • D x + (η x ^ 2 * b (u j x)) • F j x) - + ((2 * η x * ψ (h x)) • D x + (η x ^ 2 * b (h x)) • G x)) = + fun x ↦ A j x + B j x := by funext x; dsimp [A, B]; module + dsimp only + rw [heq] + exact vectorEnergy_add_le (hAm j) (hBm j) + +end NonlinearTests +end RPI + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +namespace RPISingularHarnack + +def logTest (ε t : ℝ) : ℝ := (Real.sqrt (t ^ 2 + ε ^ 2) - t) / ε ^ 2 + +def logSlope (ε t : ℝ) : ℝ := (t / Real.sqrt (t ^ 2 + ε ^ 2) - 1) / ε ^ 2 + +lemma logTest_root_pos {ε : ℝ} (hε : 0 < ε) (t : ℝ) : + 0 < Real.sqrt (t ^ 2 + ε ^ 2) := Real.sqrt_pos.2 (by positivity) + +lemma logTest_root_sq {ε : ℝ} (hε : 0 < ε) (t : ℝ) : + Real.sqrt (t ^ 2 + ε ^ 2) ^ 2 = t ^ 2 + ε ^ 2 := + Real.sq_sqrt (by positivity) + +lemma logTest_abs_lt_root {ε : ℝ} (hε : 0 < ε) (t : ℝ) : + |t| < Real.sqrt (t ^ 2 + ε ^ 2) := by + have hs := logTest_root_sq hε t + have hr := logTest_root_pos hε t + nlinarith [sq_abs t, sq_pos_of_pos hε] + +theorem logTest_contDiff {ε : ℝ} (hε : 0 < ε) : ContDiff ℝ ∞ (logTest ε) := by + unfold logTest + exact ((((contDiff_id.pow 2).add contDiff_const).sqrt + (fun t ↦ ne_of_gt (by positivity : 0 < t ^ 2 + ε ^ 2))).sub contDiff_id).div_const _ + +theorem logTest_hasDerivAt {ε : ℝ} (hε : 0 < ε) (t : ℝ) : + HasDerivAt (logTest ε) (logSlope ε t) t := by + have hh := (((hasDerivAt_id t).pow 2).add_const (ε ^ 2)).sqrt + (ne_of_gt (by positivity : 0 < t ^ 2 + ε ^ 2)) + have h := (hh.sub (hasDerivAt_id t)).div_const (ε ^ 2) + apply h.congr_deriv + dsimp [logSlope] + ring + +theorem logSlope_continuous {ε : ℝ} (hε : 0 < ε) : Continuous (logSlope ε) := by + unfold logSlope + exact ((continuous_id.div (Real.continuous_sqrt.comp + ((continuous_id.pow 2).add continuous_const)) + (fun t ↦ (logTest_root_pos hε t).ne')).sub continuous_const).div_const _ + +theorem logTest_pos {ε : ℝ} (hε : 0 < ε) (t : ℝ) : 0 < logTest ε t := by + unfold logTest + exact div_pos (sub_pos.mpr ((le_abs_self t).trans_lt (logTest_abs_lt_root hε t))) + (sq_pos_of_pos hε) + +theorem logTest_reciprocal {ε : ℝ} (hε : 0 < ε) (t : ℝ) : + logTest ε t = 1 / (Real.sqrt (t ^ 2 + ε ^ 2) + t) := by + have hr : 0 < Real.sqrt (t ^ 2 + ε ^ 2) + t := by + have hh := (neg_le_abs t).trans_lt (logTest_abs_lt_root hε t) + linarith + unfold logTest + apply (div_eq_div_iff (pow_ne_zero _ hε.ne') hr.ne').2 + nlinarith [logTest_root_sq hε t] + +theorem logSlope_eq {ε : ℝ} (hε : 0 < ε) (t : ℝ) : + logSlope ε t = -logTest ε t / Real.sqrt (t ^ 2 + ε ^ 2) := by + unfold logSlope logTest + field_simp [(logTest_root_pos hε t).ne', hε.ne'] + ring + +theorem logSlope_neg {ε : ℝ} (hε : 0 < ε) (t : ℝ) : logSlope ε t < 0 := by + rw [logSlope_eq hε] + exact div_neg_of_neg_of_pos (neg_neg_of_pos (logTest_pos hε t)) (logTest_root_pos hε t) + +theorem logSlope_bound {ε : ℝ} (hε : 0 < ε) (t : ℝ) : + ‖logSlope ε t‖ ≤ 2 / ε ^ 2 := by + have hr := logTest_root_pos hε t + have ht : |t / Real.sqrt (t ^ 2 + ε ^ 2)| ≤ 1 := by + rw [abs_div, abs_of_pos hr] + exact (div_le_one hr).2 (logTest_abs_lt_root hε t).le + unfold logSlope + rw [norm_div, Real.norm_eq_abs, Real.norm_eq_abs, abs_of_pos (sq_pos_of_pos hε)] + apply div_le_div_of_nonneg_right _ (sq_nonneg ε) + exact (abs_sub (t / Real.sqrt (t ^ 2 + ε ^ 2)) 1).trans (by + simpa only [abs_one, add_comm, one_add_one_eq_two] using add_le_add_right ht 1) + +theorem logTest_sq_le_neg_slope {ε t : ℝ} (hε : 0 < ε) (ht : 0 ≤ t) : + logTest ε t ^ 2 ≤ -logSlope ε t := by + have hr := logTest_root_pos hε t + have hp := logTest_pos hε t + rw [logSlope_eq hε, neg_div, neg_neg] + have hmul : logTest ε t * Real.sqrt (t ^ 2 + ε ^ 2) ≤ 1 := by + rw [logTest_reciprocal hε, one_div, inv_mul_eq_div] + exact (div_le_one (by linarith : 0 < Real.sqrt (t ^ 2 + ε ^ 2) + t)).2 (by linarith) + apply (le_div_iff₀ hr).2 + nlinarith [mul_le_mul_of_nonneg_left hmul hp.le] + +theorem logSlope_controls_log_weight {ε t : ℝ} (hε : 0 < ε) (ht : 0 ≤ t) : + 1 / (t + ε) ^ 2 ≤ 2 * (-logSlope ε t) := by + have hr := logTest_root_pos hε t + have hte : 0 < t + ε := by positivity + have hroot : Real.sqrt (t ^ 2 + ε ^ 2) ≤ t + ε := by + nlinarith [logTest_root_sq hε t, mul_nonneg ht hε.le] + have hplus : 0 < Real.sqrt (t ^ 2 + ε ^ 2) + t := by positivity + rw [logSlope_eq hε, neg_div, neg_neg, logTest_reciprocal hε] + apply (div_le_iff₀ (sq_pos_of_pos hte)).2 + field_simp [hr.ne', hplus.ne'] + nlinarith [mul_le_mul hroot (show Real.sqrt (t ^ 2 + ε ^ 2) + t ≤ 2 * (t + ε) by linarith) + hplus.le hte.le] + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/ExistsLocalVariationExtension.lean b/lean/OAI/Geometry/Perimeter/Regularity/ExistsLocalVariationExtension.lean new file mode 100644 index 0000000000000000000000000000000000000000..ed6de1b71ad7d7ec43903303d3e46b530633f5e4 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/ExistsLocalVariationExtension.lean @@ -0,0 +1,544 @@ +import OAI.Geometry.Perimeter.Regularity.SmoothLayerSumBounds + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem exists_local_variation_extension {n : ℕ} (E U : Set (Euc n)) + (hU : IsOpen U) (hP : perimeter E U ≠ ⊤) : + ∃ F : Lp (Euc n) 2 ((perimeterMeasure E).restrict U) →ₗ[ℝ] ℝ, + (∀ u : smoothVariationDomain U ((perimeterMeasure E).restrict U), + F (u : Lp (Euc n) 2 ((perimeterMeasure E).restrict U)) = localVariationFunctional E U hU hP u) ∧ + ∀ u, |F u| ≤ ∫ x in U, ‖u x‖ ∂perimeterMeasure E := by + let μ := (perimeterMeasure E).restrict U + let : IsFiniteMeasure μ := ⟨by + rw [Measure.restrict_apply_univ, perimeterMeasure_open E hU]; exact hP.lt_top⟩ + let p : Lp (Euc n) 2 μ →ₗ.[ℝ] ℝ := + ⟨smoothVariationDomain U μ, localVariationFunctional E U hU hP⟩ + let N : Lp (Euc n) 2 μ → ℝ := fun u ↦ ∫ x, ‖u x‖ ∂μ + have hi : ∀ u : Lp (Euc n) 2 μ, Integrable (fun x ↦ ‖u x‖) μ := + fun u ↦ (memLp_one_iff_integrable.mp ((Lp.memLp u).mono_exponent (by norm_num))).norm + have hhom : ∀ c : ℝ, 0 < c → ∀ u, N (c • u) = c * N u := by + intro c hc u + dsimp [N] + calc + _ = ∫ x, c * ‖u x‖ ∂μ := by + apply integral_congr_ae + filter_upwards [Lp.coeFn_smul c u] with x hx + rw [hx, Pi.smul_apply, norm_smul, Real.norm_of_nonneg hc.le] + _ = _ := integral_const_mul _ _ + have hadd : ∀ u v, N (u + v) ≤ N u + N v := by + intro u v + dsimp [N] + rw [← integral_add (hi u) (hi v)] + apply integral_mono_ae (hi (u + v)) ((hi u).add (hi v)) + filter_upwards [Lp.coeFn_add u v] with x hx + rw [hx, Pi.add_apply] + exact norm_add_le _ _ + obtain ⟨F, hF, hFn⟩ := exists_extension_of_le_sublinear p N hhom hadd + (fun u ↦ (le_abs_self _).trans (localVariationFunctional_le E U hU hP u)) + refine ⟨F, hF, fun u ↦ abs_le.mpr ⟨?_, hFn u⟩⟩ + have hh := hFn (-u) + have he : N (-u) = N u := by + apply integral_congr_ae + filter_upwards [Lp.coeFn_neg u] with x hx + rw [hx, Pi.neg_apply, norm_neg] + rw [map_neg, he] at hh + linarith + +theorem local_l2_integral_norm_le {n : ℕ} (μ : Measure (Euc n)) [IsFiniteMeasure μ] + (u : Lp (Euc n) 2 μ) : + (∫ x, ‖u x‖ ∂μ) ≤ (μ univ ^ (1 / 2 : ℝ)).toReal * ‖u‖ := by + have hh := eLpNorm_le_eLpNorm_mul_rpow_measure_univ (f := (u : Euc n → Euc n)) + (p := 1) (q := 2) (by norm_num) (Lp.aestronglyMeasurable u) + norm_num only [ENNReal.toReal_one, ENNReal.toReal_ofNat, div_one, + show (1 : ℝ) - 1 / 2 = 1 / 2 by norm_num] at hh + have ht : eLpNorm (u : Euc n → Euc n) 2 μ * μ univ ^ (1 / 2 : ℝ) ≠ ⊤ := + ENNReal.mul_ne_top (Lp.eLpNorm_ne_top u) + (ENNReal.rpow_ne_top_of_nonneg (by norm_num) (measure_ne_top μ univ)) + have hr := ENNReal.toReal_mono ht hh + rw [eLpNorm_one_eq_lintegral_enorm (Lp.aestronglyMeasurable u), ENNReal.toReal_mul, + ← integral_norm_eq_lintegral_enorm (Lp.aestronglyMeasurable u), ← Lp.norm_def] at hr + simpa [mul_comm] using hr + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem l2_polar_norm_le_one {n : ℕ} (μ : Measure (Euc n)) [IsFiniteMeasure μ] + (G : Lp (Euc n) 2 μ) + (hG : ∀ u : Lp (Euc n) 2 μ, + inner ℝ G u ≤ ∫ x, ‖u x‖ ∂μ) : + ∀ᵐ x ∂μ, ‖G x‖ ≤ 1 := by + let s := {x | 1 < ‖G x‖} + have hs : MeasurableSet s := measurableSet_lt measurable_const (Lp.stronglyMeasurable G).measurable.norm + have hu : MemLp (s.indicator (G : Euc n → Euc n)) 2 μ := (Lp.memLp G).indicator hs + let u : Lp (Euc n) 2 μ := hu.toLp _ + have he : (u : Euc n → Euc n) =ᵐ[μ] s.indicator (G : Euc n → Euc n) := hu.coeFn_toLp + have hsq : Integrable (fun x ↦ ‖G x‖ ^ 2) μ := by + simpa only [real_inner_self_eq_norm_sq] using (L2.integrable_inner (𝕜 := ℝ) G G) + have hn : Integrable (fun x ↦ ‖G x‖) μ := + (memLp_one_iff_integrable.mp ((Lp.memLp G).mono_exponent (by norm_num))).norm + let a : Euc n → ℝ := s.indicator (fun x ↦ ‖G x‖ ^ 2) + let b : Euc n → ℝ := s.indicator (fun x ↦ ‖G x‖) + have hai : Integrable a μ := hsq.indicator hs + have hbi : Integrable b μ := hn.indicator hs + have hea : inner ℝ G u = ∫ x, a x ∂μ := by + rw [L2.inner_def] + apply integral_congr_ae + filter_upwards [he] with x hx + rw [hx] + by_cases hsx : x ∈ s + · simp [a, hsx] + · simp [a, hsx] + have heb : (∫ x, ‖u x‖ ∂μ) = ∫ x, b x ∂μ := by + apply integral_congr_ae + filter_upwards [he] with x hx + rw [hx] + by_cases hsx : x ∈ s <;> simp [b, hsx] + have hab := hG u + rw [hea, heb] at hab + have hnonneg : ∀ x, 0 ≤ a x - b x := by + intro x + by_cases hx : x ∈ s + · have hh : 1 < ‖G x‖ := hx + simp only [a, b, indicator_of_mem hx] + nlinarith + · simp [a, b, hx] + have hz : (∫ x, a x - b x ∂μ) = 0 := by + apply le_antisymm + · rw [integral_sub hai hbi]; linarith + · exact integral_nonneg hnonneg + have hae : ∀ᵐ x ∂μ, a x - b x = 0 := + (integral_eq_zero_iff_of_nonneg_ae (ae_of_all _ hnonneg) (hai.sub hbi)).mp hz + filter_upwards [hae] with x hx + by_contra h + have hlt : 1 < ‖G x‖ := lt_of_not_ge h + have hsx : x ∈ s := hlt + simp only [a, b, indicator_of_mem hsx] at hx + nlinarith + +theorem exists_local_variation_polar {n : ℕ} (E U : Set (Euc n)) + (hU : IsOpen U) (hP : perimeter E U ≠ ⊤) : + ∃ G : Euc n → Euc n, + StronglyMeasurable G ∧ + MemLp G 2 ((perimeterMeasure E).restrict U) ∧ + (∀ᵐ x ∂(perimeterMeasure E).restrict U, ‖G x‖ ≤ 1) ∧ + ∀ V : Euc n → Euc n, ContDiff ℝ ∞ V → HasCompactSupport V → tsupport V ⊆ U → + (∫ x in E, divergence V x) = ∫ x in U, inner ℝ (G x) (V x) ∂perimeterMeasure E := by + let μ := (perimeterMeasure E).restrict U + let : IsFiniteMeasure μ := ⟨by + rw [Measure.restrict_apply_univ, perimeterMeasure_open E hU]; exact hP.lt_top⟩ + obtain ⟨F, hF, hFb⟩ := exists_local_variation_extension E U hU hP + let C : ℝ := (μ univ ^ (1 / 2 : ℝ)).toReal + have hFc : ∀ u, ‖F u‖ ≤ C * ‖u‖ := fun u ↦ + (hFb u).trans (local_l2_integral_norm_le μ u) + let Fc : Lp (Euc n) 2 μ →L[ℝ] ℝ := F.mkContinuous C hFc + let G : Lp (Euc n) 2 μ := (InnerProductSpace.toDual ℝ (Lp (Euc n) 2 μ)).symm Fc + have hrep : ∀ u, inner ℝ G u = F u := fun u ↦ InnerProductSpace.toDual_symm_apply + have hnorm : ∀ᵐ x ∂μ, ‖G x‖ ≤ 1 := l2_polar_norm_le_one μ G + (fun u ↦ by rw [hrep]; exact (le_abs_self _).trans (hFb u)) + refine ⟨G, Lp.stronglyMeasurable G, Lp.memLp G, hnorm, ?_⟩ + intro V hV hc hs + obtain ⟨B, hB⟩ := (hc.isCompact_range hV.continuous).isBounded.exists_norm_le + have hVm : MemLp V 2 μ := MemLp.of_bound hV.continuous.aestronglyMeasurable B + (ae_of_all _ (fun x ↦ hB _ (mem_range_self x))) + let u : Lp (Euc n) 2 μ := hVm.toLp V + have heu : (u : Euc n → Euc n) =ᵐ[μ] V := hVm.coeFn_toLp + let v : smoothVariationDomain U μ := ⟨u, V, hV, hc, hs, heu⟩ + obtain ⟨hR, hcR, hsR, heR⟩ := smoothVariationRepresentative_spec v + have hval : localVariationFunctional E U hU hP v = ∫ x in E, divergence V x := + integral_divergence_eq_of_variation_ae E U hU hP hR hcR hsR hV hc hs (heR.symm.trans heu) + calc + (∫ x in E, divergence V x) = F u := hval.symm.trans (hF v).symm + _ = inner ℝ G u := (hrep u).symm + _ = ∫ x, inner ℝ (G x) (V x) ∂μ := by + rw [L2.inner_def] + apply integral_congr_ae + filter_upwards [heu] with x hx + rw [hx] + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem exists_local_unit_variation_polar {n : ℕ} (E U : Set (Euc n)) + (hU : IsOpen U) (hP : perimeter E U ≠ ⊤) : + ∃ G : Euc n → Euc n, + StronglyMeasurable G ∧ + MemLp G 2 ((perimeterMeasure E).restrict U) ∧ + (∀ᵐ x ∂(perimeterMeasure E).restrict U, ‖G x‖ = 1) ∧ + ∀ V : Euc n → Euc n, ContDiff ℝ ∞ V → HasCompactSupport V → tsupport V ⊆ U → + (∫ x in E, divergence V x) = ∫ x in U, inner ℝ (G x) (V x) ∂perimeterMeasure E := by + let μ := (perimeterMeasure E).restrict U + have hμu : μ univ = perimeter E U := by + rw [Measure.restrict_apply_univ, perimeterMeasure_open E hU] + let : IsFiniteMeasure μ := ⟨by rw [hμu]; exact hP.lt_top⟩ + obtain ⟨G, hG, hGp, hGn, hrep⟩ := exists_local_variation_polar E U hU hP + have hGi : Integrable (fun x ↦ ‖G x‖) μ := + (memLp_one_iff_integrable.mp (hGp.mono_exponent (by norm_num))).norm + have hvar : perimeter E U ≤ ENNReal.ofReal (∫ x, ‖G x‖ ∂μ) := by + rw [perimeter_eq_iSup_tests] + apply iSup_le + intro V + apply iSup_le + intro hV + apply ENNReal.ofReal_le_ofReal + rw [hrep V hV.1 hV.2.1 hV.2.2.1] + have hb : ∀ᵐ x ∂μ, ‖inner ℝ (G x) (V x)‖ ≤ 1 := by + filter_upwards [hGn] with x hx + exact (norm_inner_le_norm _ _).trans + ((mul_le_of_le_one_left (norm_nonneg _) hx).trans (hV.2.2.2 x)) + have hi : Integrable (fun x ↦ inner ℝ (G x) (V x)) μ := + Integrable.of_bound (hG.aestronglyMeasurable.inner hV.1.continuous.aestronglyMeasurable) 1 hb + apply integral_mono hi hGi + intro x + exact (real_inner_le_norm _ _).trans + ((mul_le_mul_of_nonneg_left (hV.2.2.2 x) (norm_nonneg _)).trans_eq (mul_one _)) + have hlow : μ.real univ ≤ ∫ x, ‖G x‖ ∂μ := by + have hh := ENNReal.toReal_mono ENNReal.ofReal_ne_top hvar + rw [ENNReal.toReal_ofReal (integral_nonneg (fun x ↦ norm_nonneg _))] at hh + simpa only [measureReal_def, hμu] using hh + have hnneg : ∀ᵐ x ∂μ, 0 ≤ (1 : ℝ) - ‖G x‖ := hGn.mono fun x hx ↦ sub_nonneg.mpr hx + have hz : (∫ x, (1 : ℝ) - ‖G x‖ ∂μ) = 0 := by + apply le_antisymm + · rw [integral_sub (integrable_const 1) hGi, integral_const] + simp only [smul_eq_mul, mul_one] + linarith + · exact integral_nonneg_of_ae hnneg + have he : ∀ᵐ x ∂μ, (1 : ℝ) - ‖G x‖ = 0 := + (integral_eq_zero_iff_of_nonneg_ae hnneg ((integrable_const 1).sub hGi)).mp hz + exact ⟨G, hG, hGp, he.mono (fun x hx ↦ by linarith), hrep⟩ + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem smooth_translation_lintegral_le {n : ℕ} {u : Euc n → ℝ} + (hu : ContDiff ℝ 1 u) (a : Euc n) : + (∫⁻ x, ‖u (x + a) - u x‖ₑ) ≤ ‖a‖ₑ * ∫⁻ x, ‖fderiv ℝ u x‖ₑ := by + have hfd := hu.continuous_fderiv one_ne_zero + have hpoint (x : Euc n) : + ‖u (x + a) - u x‖ₑ ≤ + ∫⁻ t in Ioc (0 : ℝ) 1, ‖a‖ₑ * ‖fderiv ℝ u (x + t • a)‖ₑ := by + have hd (t : ℝ) : HasDerivAt (fun s : ℝ ↦ u (x + s • a)) + (fderiv ℝ u (x + t • a) a) t := by + simpa only [Function.comp_def, id_eq, one_smul] using + (hu.differentiable one_ne_zero (x + t • a)).hasFDerivAt.comp_hasDerivAt t + (HasDerivAt.const_add x ((hasDerivAt_id t).smul_const a)) + have hi : IntervalIntegrable (fun t : ℝ ↦ fderiv ℝ u (x + t • a) a) volume 0 1 := + ((hfd.comp (continuous_const.add (continuous_id.smul continuous_const))).clm_apply + continuous_const).intervalIntegrable _ _ + have he := intervalIntegral.integral_eq_sub_of_hasDerivAt (fun t _ ↦ hd t) hi + simp only [one_smul, zero_smul, add_zero] at he + rw [← he, intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1)] + apply (enorm_integral_le_lintegral_enorm _).trans + apply lintegral_mono + intro t + simp only [← ofReal_norm] + rw [← ENNReal.ofReal_mul (norm_nonneg _)] + exact ENNReal.ofReal_le_ofReal ((ContinuousLinearMap.le_opNorm _ _).trans_eq (mul_comm _ _)) + have hm : Measurable (fun p : Euc n × ℝ ↦ ‖a‖ₑ * ‖fderiv ℝ u (p.1 + p.2 • a)‖ₑ) := + measurable_const.mul ((hfd.comp (continuous_fst.add + (continuous_snd.smul continuous_const))).enorm.measurable) + calc + (∫⁻ x, ‖u (x + a) - u x‖ₑ) ≤ + ∫⁻ x, ∫⁻ t in Ioc (0 : ℝ) 1, ‖a‖ₑ * ‖fderiv ℝ u (x + t • a)‖ₑ := + lintegral_mono hpoint + _ = ∫⁻ t in Ioc (0 : ℝ) 1, ∫⁻ x, ‖a‖ₑ * ‖fderiv ℝ u (x + t • a)‖ₑ := + lintegral_lintegral_swap hm.aemeasurable + _ = ∫⁻ t in Ioc (0 : ℝ) 1, ‖a‖ₑ * ∫⁻ x, ‖fderiv ℝ u x‖ₑ := by + apply lintegral_congr + intro t + have hmt : Measurable (fun x : Euc n ↦ ‖fderiv ℝ u (x + t • a)‖ₑ) := + (hfd.comp (continuous_id.add continuous_const)).enorm.measurable + rw [lintegral_const_mul _ hmt, + lintegral_add_right_eq_self (fun x : Euc n ↦ ‖fderiv ℝ u x‖ₑ) (t • a)] + _ = ‖a‖ₑ * ∫⁻ x, ‖fderiv ℝ u x‖ₑ := by simp + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack +open RPI.Boundary +open scoped Convolution + +theorem indicator_translation_lintegral_le {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) (hb : Bornology.IsBounded E) (hP : perimeter E univ ≠ ⊤) + (a : Euc n) : + (∫⁻ x, ‖E.indicator (fun _ ↦ (1 : ℝ)) (x + a) - + E.indicator (fun _ ↦ (1 : ℝ)) x‖ₑ) ≤ ‖a‖ₑ * perimeter E univ := by + let χ : Euc n → ℝ := E.indicator (fun _ ↦ 1) + let u : ℕ → Euc n → ℝ := c1Mollify χ + obtain ⟨hχ, hcχ⟩ := indicator_one_integrable_compact hE hb + have hu : ∀ j, ContDiff ℝ ∞ (u j) := fun j ↦ + (c1Mollifier j).hasCompactSupport_normed.contDiff_convolution_left _ + (c1Mollifier j).contDiff_normed hχ.locallyIntegrable + have hlim : ∀ᵐ x ∂volume, Tendsto (fun j ↦ u j x) atTop (𝓝 (χ x)) := by + apply ContDiffBump.ae_convolution_tendsto_right_of_locallyIntegrable + c1Mollifier_radius_tendsto (K := 2) _ hχ.locallyIntegrable + apply Eventually.of_forall + intro j + dsimp [c1Mollifier] + linarith + have hlimadd : ∀ᵐ x ∂volume, Tendsto (fun j ↦ u j (x + a)) atTop (𝓝 (χ (x + a))) := + (measurePreserving_add_right volume a).quasiMeasurePreserving.ae hlim + have hlimnorm : ∀ᵐ x ∂volume, + Tendsto (fun j ↦ ‖u j (x + a) - u j x‖ₑ) atTop (𝓝 (‖χ (x + a) - χ x‖ₑ)) := by + filter_upwards [hlimadd, hlim] with x hx hy + exact (hx.sub hy).enorm + calc + (∫⁻ x, ‖χ (x + a) - χ x‖ₑ) = + ∫⁻ x, liminf (fun j ↦ ‖u j (x + a) - u j x‖ₑ) atTop := by + apply lintegral_congr_ae + filter_upwards [hlimnorm] with x hx using hx.liminf_eq.symm + _ ≤ liminf (fun j ↦ ∫⁻ x, ‖u j (x + a) - u j x‖ₑ) atTop := + lintegral_liminf_le' (fun j ↦ (((hu j).continuous.comp + (continuous_id.add continuous_const)).sub (hu j).continuous).enorm.measurable.aemeasurable) + _ ≤ ‖a‖ₑ * perimeter E univ := by + have hb' : ∀ j, (∫⁻ x, ‖u j (x + a) - u j x‖ₑ) ≤ ‖a‖ₑ * perimeter E univ := by + intro j + apply (smooth_translation_lintegral_le ((hu j).of_le (by simp)) a).trans + gcongr + exact c1Mollify_indicator_gradient_le_perimeter hE hb hP j + exact liminf_le_of_frequently_le (Eventually.of_forall hb').frequently + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack +open RPI.Boundary ContinuousLinearMap +open scoped Convolution + +theorem c1Mollify_indicator_lintegral_error_le {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) (hb : Bornology.IsBounded E) (hP : perimeter E univ ≠ ⊤) + (j : ℕ) : + (∫⁻ x, ‖c1Mollify (E.indicator (fun _ ↦ (1 : ℝ))) j x - + E.indicator (fun _ ↦ (1 : ℝ)) x‖ₑ) ≤ + ENNReal.ofReal (c1Mollifier (n := n) j).rOut * perimeter E univ := by + let χ : Euc n → ℝ := E.indicator (fun _ ↦ 1) + let k : Euc n → ℝ := (c1Mollifier j).normed volume + have hmχ : Measurable χ := measurable_const.indicator hE + have hbχ : ∀ x, ‖χ x‖ ≤ 1 := by + intro x + by_cases hx : x ∈ E <;> simp [χ, hx] + have hkc : Continuous k := (c1Mollifier j).continuous_normed + have hk : Integrable k volume := hkc.integrable_of_hasCompactSupport + (c1Mollifier j).hasCompactSupport_normed + have hk1 : ∫ x, k x = 1 := (c1Mollifier j).integral_normed + have hp (x : Euc n) : ‖c1Mollify χ j x - χ x‖ₑ ≤ + ∫⁻ y, ‖k y‖ₑ * ‖χ (x - y) - χ x‖ₑ := by + have hi : Integrable (fun y ↦ k y * χ (x - y)) volume := by + apply hk.norm.mono' + · exact (hkc.measurable.mul (hmχ.comp (measurable_const.sub measurable_id))).aestronglyMeasurable + · apply ae_of_all + intro y + rw [norm_mul] + exact (mul_le_mul_of_nonneg_left (hbχ (x - y)) (norm_nonneg _)).trans_eq (mul_one _) + have he : c1Mollify χ j x - χ x = ∫ y, k y * (χ (x - y) - χ x) := by + simp only [c1Mollify, convolution_def, lsmul_apply, smul_eq_mul] + simp_rw [mul_sub] + rw [integral_sub hi (hk.mul_const _), integral_mul_const, hk1, one_mul] + rw [he] + apply (enorm_integral_le_lintegral_enorm _).trans_eq + apply lintegral_congr + intro y + exact enorm_mul _ _ + have hm : Measurable (fun p : Euc n × Euc n ↦ + ‖k p.2‖ₑ * ‖χ (p.1 - p.2) - χ p.1‖ₑ) := + (hkc.measurable.comp measurable_snd).enorm.mul + ((hmχ.comp (measurable_fst.sub measurable_snd)).sub + (hmχ.comp measurable_fst)).enorm + calc + (∫⁻ x, ‖c1Mollify χ j x - χ x‖ₑ) ≤ + ∫⁻ x, ∫⁻ y, ‖k y‖ₑ * ‖χ (x - y) - χ x‖ₑ := lintegral_mono hp + _ = ∫⁻ y, ∫⁻ x, ‖k y‖ₑ * ‖χ (x - y) - χ x‖ₑ := + lintegral_lintegral_swap hm.aemeasurable + _ = ∫⁻ y, ‖k y‖ₑ * ∫⁻ x, ‖χ (x - y) - χ x‖ₑ := by + apply lintegral_congr + intro y + apply lintegral_const_mul + exact ((hmχ.comp (measurable_id.sub measurable_const)).sub hmχ).enorm + _ ≤ ∫⁻ y, ‖k y‖ₑ * (‖y‖ₑ * perimeter E univ) := by + apply lintegral_mono + intro y + have hy : (∫⁻ x, ‖χ (x - y) - χ x‖ₑ) ≤ ‖y‖ₑ * perimeter E univ := by + simpa only [sub_eq_add_neg, enorm_neg] using indicator_translation_lintegral_le hE hb hP (-y) + exact mul_le_mul_right hy _ + _ ≤ ∫⁻ y, ‖k y‖ₑ * (ENNReal.ofReal (c1Mollifier (n := n) j).rOut * perimeter E univ) := by + apply lintegral_mono + intro y + by_cases hy : k y = 0 + · simp only [hy, enorm_zero, zero_mul, le_refl] + · have hys : y ∈ Function.support k := hy + rw [(c1Mollifier j).support_normed_eq] at hys + have hyb : ‖y‖ₑ ≤ ENNReal.ofReal (c1Mollifier (n := n) j).rOut := by + rw [← ofReal_norm] + exact ENNReal.ofReal_le_ofReal (by + have hylt : ‖y‖ < (c1Mollifier (n := n) j).rOut := by + simpa only [Metric.mem_ball, dist_zero_right] using hys + exact hylt.le) + exact mul_le_mul_right (mul_le_mul_left hyb _) _ + _ = ENNReal.ofReal (c1Mollifier (n := n) j).rOut * perimeter E univ := by + rw [lintegral_mul_const _ hkc.measurable.enorm] + have hki : (∫⁻ y, ‖k y‖ₑ) = 1 := by + have heq : ∀ y, ‖k y‖ₑ = ENNReal.ofReal (k y) := by + intro y + rw [← ofReal_norm, Real.norm_eq_abs, abs_of_nonneg ((c1Mollifier j).nonneg_normed y)] + simp_rw [heq] + rw [← ofReal_integral_eq_lintegral_ofReal hk (ae_of_all _ (c1Mollifier j).nonneg_normed), hk1] + norm_num + rw [hki, one_mul] + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack +open RPI.Boundary ContinuousLinearMap +open scoped Convolution NNReal + +theorem c1Mollify_indicator_mem_Icc {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) (j : ℕ) (x : Euc n) : + c1Mollify (E.indicator (fun _ ↦ (1 : ℝ))) j x ∈ Icc (0 : ℝ) 1 := by + let χ : Euc n → ℝ := E.indicator (fun _ ↦ 1) + let k : Euc n → ℝ := (c1Mollifier j).normed volume + have hk0 : ∀ y, 0 ≤ k y := (c1Mollifier j).nonneg_normed + have hk : Integrable k volume := (c1Mollifier j).continuous_normed.integrable_of_hasCompactSupport + (c1Mollifier j).hasCompactSupport_normed + have hχb : ∀ y, χ y ∈ Icc (0 : ℝ) 1 := by + intro y + by_cases hy : y ∈ E <;> simp [χ, hy] + change (∫ y, k y * χ (x - y)) ∈ Icc (0 : ℝ) 1 + refine ⟨integral_nonneg (fun y ↦ mul_nonneg (hk0 y) (hχb _).1), ?_⟩ + calc + (∫ y, k y * χ (x - y)) ≤ ∫ y, k y := by + have hnonneg : ∀ᵐ y ∂volume, 0 ≤ k y * χ (x - y) := + ae_of_all _ fun y ↦ mul_nonneg (hk0 y) (hχb _).1 + have hbound : ∀ᵐ y ∂volume, k y * χ (x - y) ≤ k y := by + apply ae_of_all + intro y + exact (mul_le_mul_of_nonneg_left (hχb _).2 (hk0 y)).trans_eq (mul_one _) + have hm : AEStronglyMeasurable (fun y ↦ k y * χ (x - y)) volume := + ((c1Mollifier j).continuous_normed.measurable.mul + ((measurable_const.indicator hE).comp + (measurable_const.sub measurable_id))).aestronglyMeasurable + exact integral_mono_ae (hk.mono_nonneg hm hnonneg hbound) hk hbound + _ = 1 := (c1Mollifier j).integral_normed + +theorem c1Mollify_indicator_uniform_lipschitz {n : ℕ} (K : Set (Euc n)) + (hK : Bornology.IsBounded K) (j : ℕ) : + ∃ L : ℝ≥0, ∀ E : Set (Euc n), MeasurableSet E → E ⊆ K → + LipschitzWith L (c1Mollify (E.indicator (fun _ ↦ (1 : ℝ))) j) := by + let k : Euc n → ℝ := (c1Mollifier j).normed volume + obtain ⟨C, hC⟩ := ContDiff.lipschitzWith_of_hasCompactSupport + (n := ∞) (f := k) (c1Mollifier j).hasCompactSupport_normed + (c1Mollifier j).contDiff_normed (by simp) + refine ⟨C * (volume K).toNNReal, ?_⟩ + intro E hE hEK + let χ : Euc n → ℝ := E.indicator (fun _ ↦ 1) + obtain ⟨hiχ, hcχ⟩ := indicator_one_integrable_compact hE (hK.subset hEK) + have hχ0 : ∀ z, 0 ≤ χ z := fun z ↦ indicator_nonneg (fun _ _ ↦ zero_le_one) z + have hχ1 : ∫ z, χ z ≤ volume.real K := by + rw [show χ = E.indicator (fun _ ↦ (1 : ℝ)) from rfl, integral_indicator hE] + simp only [setIntegral_const, smul_eq_mul, mul_one] + exact ENNReal.toReal_mono hK.measure_lt_top.ne (measure_mono hEK) + have hflip : (lsmul ℝ ℝ : ℝ →L[ℝ] ℝ →L[ℝ] ℝ).flip = lsmul ℝ ℝ := by + apply ContinuousLinearMap.ext + intro a + apply ContinuousLinearMap.ext + intro b + exact mul_comm b a + have hf : c1Mollify χ j = χ ⋆[lsmul ℝ ℝ, volume] k := by + change k ⋆[lsmul ℝ ℝ, volume] χ = _ + rw [← convolution_flip, hflip] + have hib (x : Euc n) : Integrable (fun z ↦ χ z * k (x - z)) volume := by + obtain ⟨B, hB⟩ := ((c1Mollifier (n := n) j).hasCompactSupport_normed (μ := volume)).exists_bound_of_continuous + (c1Mollifier j).continuous_normed + apply (hiχ.norm.mul_const B).mono' + · exact ((measurable_const.indicator hE).mul + ((c1Mollifier j).continuous_normed.measurable.comp + (measurable_const.sub measurable_id))).aestronglyMeasurable + · apply ae_of_all + intro z + rw [norm_mul] + exact mul_le_mul_of_nonneg_left (hB _) (norm_nonneg _) + apply LipschitzWith.of_dist_le_mul + intro x y + rw [dist_eq_norm, hf] + change ‖(∫ z, χ z * k (x - z)) - ∫ z, χ z * k (y - z)‖ ≤ _ + rw [← integral_sub (hib x) (hib y)] + calc + ‖∫ z, χ z * k (x - z) - χ z * k (y - z)‖ ≤ + ∫ z, ‖χ z * k (x - z) - χ z * k (y - z)‖ := norm_integral_le_integral_norm _ + _ ≤ ∫ z, χ z * ((C : ℝ) * dist x y) := by + apply integral_mono ((hib x).sub (hib y)).norm (hiχ.mul_const _) + intro z + change ‖χ z * k (x - z) - χ z * k (y - z)‖ ≤ + χ z * ((C : ℝ) * dist x y) + rw [← mul_sub, norm_mul, Real.norm_eq_abs, abs_of_nonneg (hχ0 z)] + apply mul_le_mul_of_nonneg_left _ (hχ0 z) + simpa only [← dist_eq_norm, dist_sub_right] using hC.dist_le_mul (x - z) (y - z) + _ = (∫ z, χ z) * ((C : ℝ) * dist x y) := integral_mul_const _ _ + _ ≤ volume.real K * ((C : ℝ) * dist x y) := + mul_le_mul_of_nonneg_right hχ1 (mul_nonneg C.coe_nonneg dist_nonneg) + _ = ((C * (volume K).toNNReal : ℝ≥0) : ℝ) * dist x y := by + change volume.real K * ((C : ℝ) * dist x y) = + ((C : ℝ) * volume.real K) * dist x y + ring + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/ExistsMinimizingBoundaryAreaGrowth.lean b/lean/OAI/Geometry/Perimeter/Regularity/ExistsMinimizingBoundaryAreaGrowth.lean new file mode 100644 index 0000000000000000000000000000000000000000..7ffe852491ea69058abef264e0db6863d24ac357 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/ExistsMinimizingBoundaryAreaGrowth.lean @@ -0,0 +1,453 @@ +import OAI.Geometry.Perimeter.Regularity.IndicatorConvolutionVariationLocalLe + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack +open RPI + +theorem exists_minimizing_boundaryArea_growth {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) : + ∃ A : ℝ, 0 < A ∧ ∀ (c : Euc n) (r : ℝ), 0 < r → + boundaryArea E (Metric.ball c r) ≤ ENNReal.ofReal (A * r ^ (n - 1)) := by + obtain ⟨A, hA, harea⟩ := exists_minimizing_surfaceMeasure_growth hn hmin + let b := hausdorffNormalizationRatio (n - 1) + let D := (b * ENNReal.ofReal A).toReal + 1 + have hD : 0 < D := by dsimp [D]; positivity + have hb : b ≠ ⊤ := hausdorffNormalizationRatio_ne_top _ + have hbA : b * ENNReal.ofReal A ≤ ENNReal.ofReal D := by + rw [← ENNReal.ofReal_toReal (ENNReal.mul_ne_top hb ENNReal.ofReal_ne_top)] + apply ENNReal.ofReal_le_ofReal + dsimp [D] + linarith + refine ⟨D, hD, ?_⟩ + intro c r hr + rw [boundaryArea_eq_smul_surfaceMeasure] + change b * _ ≤ _ + calc + _ ≤ b * ENNReal.ofReal (A * r ^ (n - 1)) := mul_le_mul le_rfl (harea c r hr) (by positivity) (by positivity) + _ = (b * ENNReal.ofReal A) * ENNReal.ofReal r ^ (n - 1) := by + rw [ENNReal.ofReal_mul hA.le, ENNReal.ofReal_pow hr.le, mul_assoc] + _ ≤ ENNReal.ofReal D * ENNReal.ofReal r ^ (n - 1) := mul_le_mul hbA le_rfl (by positivity) (by positivity) + _ = _ := by rw [ENNReal.ofReal_mul hD.le, ENNReal.ofReal_pow hr.le] + +theorem approximateNormal_norm_le_one {n : ℕ} (E : Set (Euc n)) (x : Euc n) : + ‖approximateNormal E x‖ ≤ 1 := by + classical + unfold approximateNormal + split_ifs with h + · exact (Classical.choose_spec h).1.le + · simp + +theorem tangentialGradient_norm_le_twice {n : ℕ} (E : Set (Euc n)) + (φ : Euc n → ℝ) (x : Euc n) : + ‖tangentialGradient E φ x‖ ≤ 2 * ‖gradient φ x‖ := by + have hv := approximateNormal_norm_le_one E x + have hinner : |inner ℝ (gradient φ x) (approximateNormal E x)| ≤ ‖gradient φ x‖ := by + exact (abs_real_inner_le_norm _ _).trans (by nlinarith [norm_nonneg (gradient φ x)]) + calc + _ ≤ ‖gradient φ x‖ + ‖(inner ℝ (gradient φ x) (approximateNormal E x)) • + approximateNormal E x‖ := norm_sub_le _ _ + _ ≤ ‖gradient φ x‖ + ‖gradient φ x‖ := by + rw [norm_smul, Real.norm_eq_abs] + gcongr + exact le_trans (mul_le_mul_of_nonneg_left hv (abs_nonneg _)) (by simpa using hinner) + _ = _ := by ring + +theorem exists_raw_minimizing_frontier_capacity_sequence {n : ℕ} (hn : 8 ≤ n) + {E Z : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (hZc : IsCompact Z) (hZd : dimH Z ≤ (n - 8 : ℕ)) : + ∃ χ : ℕ → Euc n → ℝ, + (∀ i, ContDiff ℝ ∞ (χ i) ∧ (∀ x, χ i x ∈ Icc (0 : ℝ) 1) ∧ + ∃ U : Set (Euc n), IsOpen U ∧ Z ⊆ U ∧ ∀ x ∈ U, χ i x = 0) ∧ + (∀ x ∉ Z, ∀ᶠ i in atTop, χ i x = 1) ∧ + Tendsto (fun i ↦ smoothDirichletEnergy (boundaryArea E) (χ i)) atTop (𝓝 0) ∧ + Tendsto (fun i ↦ vectorEnergy (boundaryArea E) (tangentialGradient E (χ i))) + atTop (𝓝 0) := by + obtain ⟨A, hA, harea⟩ := exists_minimizing_boundaryArea_growth (by omega : 1 < n) hmin + obtain ⟨hm, hnull⟩ := hausdorff_capacity_dimension hn Z hZd + have heq : n - 3 + 2 = n - 1 := by omega + obtain ⟨χ, hχ, hχone, hχenergy⟩ := exists_smooth_capacity_sequence (boundaryArea E) + Z hZc (n - 3) hm hnull hA (by norm_num : (0 : ℝ) < 1) + (fun c _ r hr _ ↦ by simpa only [heq] using harea c r hr) + refine ⟨χ, hχ, hχone, hχenergy, ?_⟩ + have hb : ∀ i, vectorEnergy (boundaryArea E) (tangentialGradient E (χ i)) ≤ + (4 : ℝ≥0∞) * smoothDirichletEnergy (boundaryArea E) (χ i) := by + intro i + rw [vectorEnergy, smoothDirichletEnergy, ← lintegral_const_mul' _ _ ENNReal.ofNat_ne_top] + apply lintegral_mono + intro x + have hnorm := tangentialGradient_norm_le_twice E (χ i) x + calc + _ ≤ ENNReal.ofReal (4 * ‖gradient (χ i) x‖ ^ 2) := by + apply ENNReal.ofReal_le_ofReal + nlinarith [norm_nonneg (tangentialGradient E (χ i) x), norm_nonneg (gradient (χ i) x)] + _ = _ := by rw [ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 4)]; norm_num + exact tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds + (by simpa only [mul_zero] using ENNReal.Tendsto.const_mul hχenergy (Or.inr (by norm_num : (4 : ℝ≥0∞) ≠ ⊤))) + (fun _ ↦ zero_le) hb + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem tendsto_normalized_monotone_of_dyadic {a : ℝ → ℝ} (n : ℕ) + (ha : ∀ r, 0 < r → 0 ≤ a r) + (ham : ∀ r s, 0 < r → r ≤ s → a r ≤ a s) + (ht : Tendsto (fun j : ℕ ↦ a ((1 / 2 : ℝ) ^ j) / ((1 / 2 : ℝ) ^ j) ^ n) + atTop (𝓝 0)) : + Tendsto (fun r : ℝ ↦ a r / r ^ n) (𝓝[>] 0) (𝓝 0) := by + apply Metric.tendsto_nhds.mpr + intro ε hε + have htwo : (0 : ℝ) < 2 ^ n := by positivity + have hev := (Metric.tendsto_nhds.mp ht) (ε / (2 : ℝ) ^ n) (div_pos hε htwo) + obtain ⟨N, hN⟩ := eventually_atTop.mp hev + have hpos : (0 : ℝ) < (1 / 2 : ℝ) ^ N := by positivity + have hsmall : ∀ᶠ r : ℝ in 𝓝[>] 0, r < (1 / 2 : ℝ) ^ N := + (gt_mem_nhds hpos).filter_mono nhdsWithin_le_nhds + filter_upwards [hsmall, self_mem_nhdsWithin] with r hr hrp + have hunit : r ≤ 1 := hr.le.trans (pow_le_one₀ (by norm_num) (by norm_num)) + obtain ⟨j, hjlo, hjhi⟩ := exists_nat_pow_near_of_lt_one hrp hunit + (by norm_num : (0 : ℝ) < 1 / 2) (by norm_num : (1 / 2 : ℝ) < 1) + have hjN : N ≤ j := by + by_contra h + have hNj : j + 1 ≤ N := by omega + have hpow : (1 / 2 : ℝ) ^ N ≤ (1 / 2 : ℝ) ^ (j + 1) := + pow_le_pow_of_le_one (by norm_num) (by norm_num) hNj + linarith + have hspos : (0 : ℝ) < (1 / 2 : ℝ) ^ j := by positivity + have hscale : (1 / 2 : ℝ) ^ j ≤ 2 * r := by + rw [pow_succ] at hjlo + linarith + have hpower : ((1 / 2 : ℝ) ^ j) ^ n ≤ (2 : ℝ) ^ n * r ^ n := by + simpa only [mul_pow] using pow_le_pow_left₀ hspos.le hscale n + have hab := ham r ((1 / 2 : ℝ) ^ j) hrp hjhi + have hbound : a r / r ^ n ≤ (2 : ℝ) ^ n * + (a ((1 / 2 : ℝ) ^ j) / ((1 / 2 : ℝ) ^ j) ^ n) := by + apply le_trans (div_le_div_of_nonneg_right hab (pow_nonneg hrp.le _)) + rw [← mul_div_assoc, div_le_div_iff₀ (pow_pos hrp _) (pow_pos hspos _)] + nlinarith [mul_le_mul_of_nonneg_left hpower (ha _ hspos)] + have hj := hN j hjN + rw [dist_zero_right, Real.norm_eq_abs, abs_of_nonneg (div_nonneg (ha _ hspos) + (pow_nonneg hspos.le _))] at hj + rw [dist_zero_right, Real.norm_eq_abs, abs_of_nonneg (div_nonneg (ha _ hrp) + (pow_nonneg hrp.le _))] + exact hbound.trans_lt ((mul_lt_mul_of_pos_left hj htwo).trans_eq (by field_simp)) + +def rescaledHalfspaceError {n : ℕ} (E : Set (Euc n)) (r : ℝ) + (p : Euc n × Euc n) : ℝ := + ∫ z in Metric.ball (0 : Euc n) 1, + |E.indicator (fun _ ↦ (1 : ℝ)) (p.1 + r • z) - + {y | inner ℝ y p.2 < 0}.indicator (fun _ ↦ (1 : ℝ)) z| + +theorem rescaledHalfspaceError_eq {n : ℕ} (E : Set (Euc n)) + (x v : Euc n) {r : ℝ} (hr : 0 < r) : + rescaledHalfspaceError E r (x, v) = + (r ^ n)⁻¹ * ∫ y in Metric.ball x r, + |E.indicator (fun _ ↦ (1 : ℝ)) y - + {z | inner ℝ (z - x) v < 0}.indicator (fun _ ↦ (1 : ℝ)) y| := by + rw [normalized_ball_integral _ x hr] + unfold rescaledHalfspaceError + apply integral_congr_ae + exact ae_of_all _ (fun z ↦ by dsimp only; rw [halfspace_indicator_rescale x v z hr]) + +theorem hasHalfspaceBlowup_iff_dyadic {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) (x v : Euc n) : + HasHalfspaceBlowup E x v ↔ ‖v‖ = 1 ∧ + Tendsto (fun j : ℕ ↦ rescaledHalfspaceError E ((1 / 2 : ℝ) ^ j) (x, v)) + atTop (𝓝 0) := by + have hpow := tendsto_pow_atTop_nhdsWithin_zero_of_lt_one + (by norm_num : (0 : ℝ) < 1 / 2) (by norm_num : (1 / 2 : ℝ) < 1) + constructor + · rintro ⟨hv, ht⟩ + refine ⟨hv, ?_⟩ + convert ht.comp hpow using 1 + ext j + exact rescaledHalfspaceError_eq E x v (by positivity) + · rintro ⟨hv, ht⟩ + refine ⟨hv, ?_⟩ + let f : Euc n → ℝ := fun y ↦ |E.indicator (fun _ ↦ (1 : ℝ)) y - + {z | inner ℝ (z - x) v < 0}.indicator (fun _ ↦ (1 : ℝ)) y| + have hf : Measurable f := by + apply Measurable.abs + exact (measurable_const.indicator hE).sub + (measurable_const.indicator (isOpen_lt + ((continuous_id.sub continuous_const).inner continuous_const) continuous_const).measurableSet) + have hfi : ∀ s : ℝ, IntegrableOn f (Metric.ball x s) volume := by + intro s + apply (integrableOn_const measure_ball_lt_top.ne (C := (1 : ℝ))).mono' hf.aestronglyMeasurable + apply ae_of_all + intro y + dsimp [f] + by_cases he : y ∈ E <;> by_cases hh : inner ℝ (y - x) v < 0 <;> simp [he, hh] + have hnon : ∀ s, 0 < s → 0 ≤ ∫ y in Metric.ball x s, f y := + fun s _ ↦ integral_nonneg (fun y ↦ abs_nonneg _) + have hmono : ∀ r s, 0 < r → r ≤ s → + (∫ y in Metric.ball x r, f y) ≤ ∫ y in Metric.ball x s, f y := by + intro r s _ hrs + exact setIntegral_mono_set (hfi s) (ae_of_all _ (fun y ↦ abs_nonneg _)) + (Eventually.of_forall (Metric.ball_subset_ball hrs)) + have hdy : Tendsto (fun j : ℕ ↦ + (∫ y in Metric.ball x ((1 / 2 : ℝ) ^ j), f y) / ((1 / 2 : ℝ) ^ j) ^ n) + atTop (𝓝 0) := by + convert ht using 1 + ext j + rw [rescaledHalfspaceError_eq E x v (by positivity)] + simp only [div_eq_mul_inv, mul_comm, f] + simpa only [div_eq_mul_inv, mul_comm, f] using + tendsto_normalized_monotone_of_dyadic n hnon hmono hdy + +theorem measurable_rescaledHalfspaceError {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) (r : ℝ) : Measurable (rescaledHalfspaceError E r) := by + have hχ : Measurable (E.indicator (fun _ ↦ (1 : ℝ))) := measurable_const.indicator hE + have hH : MeasurableSet {p : (Euc n × Euc n) × Euc n | inner ℝ p.2 p.1.2 < 0} := + (isOpen_lt (continuous_snd.inner (continuous_snd.comp continuous_fst)) continuous_const).measurableSet + have hf : Measurable (fun p : (Euc n × Euc n) × Euc n ↦ + |E.indicator (fun _ ↦ (1 : ℝ)) (p.1.1 + r • p.2) - + {y | inner ℝ y p.1.2 < 0}.indicator (fun _ ↦ (1 : ℝ)) p.2|) := by + have he : Measurable (fun p : (Euc n × Euc n) × Euc n ↦ + E.indicator (fun _ ↦ (1 : ℝ)) (p.1.1 + r • p.2)) := + hχ.comp ((measurable_fst.comp measurable_fst).add (measurable_snd.const_smul r)) + have hh : Measurable (fun p : (Euc n × Euc n) × Euc n ↦ + {y | inner ℝ y p.1.2 < 0}.indicator (fun _ ↦ (1 : ℝ)) p.2) := by + have heq : (fun p : (Euc n × Euc n) × Euc n ↦ + {y | inner ℝ y p.1.2 < 0}.indicator (fun _ ↦ (1 : ℝ)) p.2) = + {p : (Euc n × Euc n) × Euc n | inner ℝ p.2 p.1.2 < 0}.indicator + (fun _ ↦ (1 : ℝ)) := by funext p; rfl + rw [heq] + exact measurable_const.indicator hH + exact (he.sub hh).abs + exact (hf.stronglyMeasurable.integral_prod_right').measurable + +theorem measurableSet_halfspaceBlowup {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) : + MeasurableSet {p : Euc n × Euc n | HasHalfspaceBlowup E p.1 p.2} := by + have hnorm : MeasurableSet {p : Euc n × Euc n | ‖p.2‖ = 1} := + measurableSet_eq_fun measurable_snd.norm measurable_const + have ht := measurableSet_tendsto (l := (atTop : Filter ℕ)) (𝓝 (0 : ℝ)) + (fun j : ℕ ↦ measurable_rescaledHalfspaceError hE ((1 / 2 : ℝ) ^ j)) + simpa only [hasHalfspaceBlowup_iff_dyadic hE, Set.ofPred_and] using hnorm.inter ht + +theorem measurable_approximateNormal {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) : Measurable (approximateNormal E) := by + classical + let Γ : Set (Euc n × Euc n) := {p | HasHalfspaceBlowup E p.1 p.2} + have hΓ : MeasurableSet Γ := measurableSet_halfspaceBlowup hE + have hinj : Set.InjOn Prod.fst Γ := by + intro p hp q hq heq + apply Prod.ext heq + exact (show HasHalfspaceBlowup E p.1 p.2 from hp).unique hE + (by simpa only [Γ, Set.mem_ofPred_eq, heq] using hq) + let D : Set (Euc n) := Prod.fst '' Γ + have hD : MeasurableSet D := hΓ.image_of_measurable_injOn measurable_fst hinj + have hDm : ∀ x, x ∈ D ↔ ∃ v, HasHalfspaceBlowup E x v := by + intro x + constructor + · rintro ⟨⟨y, v⟩, hv, hxy⟩ + change y = x at hxy + subst y + exact ⟨v, hv⟩ + · rintro ⟨v, hv⟩ + exact ⟨(x, v), hv, rfl⟩ + intro s hs + let B : Set (Euc n) := Prod.fst '' (Γ ∩ Prod.snd ⁻¹' s) + have hB : MeasurableSet B := (hΓ.inter (hs.preimage measurable_snd)).image_of_measurable_injOn + measurable_fst (hinj.mono Set.inter_subset_left) + have hBm : ∀ x, x ∈ B ↔ ∃ v, HasHalfspaceBlowup E x v ∧ v ∈ s := by + intro x + constructor + · rintro ⟨⟨y, v⟩, ⟨hv, hvs⟩, hxy⟩ + change y = x at hxy + subst y + exact ⟨v, hv, hvs⟩ + · rintro ⟨v, hv, hvs⟩ + exact ⟨(x, v), ⟨hv, hvs⟩, rfl⟩ + have hm : ∀ x, x ∈ D → (approximateNormal E x ∈ s ↔ x ∈ B) := by + intro x hx + obtain ⟨v, hv⟩ := (hDm x).mp hx + rw [approximateNormal_eq_of_blowup hE hv, hBm] + constructor + · exact fun hvs ↦ ⟨v, hv, hvs⟩ + · rintro ⟨w, hw, hws⟩ + rwa [hv.unique hE hw] + have hz : ∀ x, x ∉ D → approximateNormal E x = 0 := by + intro x hx + have hno : ¬ ∃ v, HasHalfspaceBlowup E x v := by simpa only [hDm] using hx + simp only [approximateNormal, dite_eq_right hno] + have hBD : B ⊆ D := by + intro x hx + obtain ⟨v, hv, _⟩ := (hBm x).mp hx + exact (hDm x).mpr ⟨v, hv⟩ + by_cases hzero : (0 : Euc n) ∈ s + · have heq : approximateNormal E ⁻¹' s = B ∪ Dᶜ := by + ext x + by_cases hx : x ∈ D + · simp only [Set.mem_preimage, Set.mem_union, Set.mem_compl_iff, hx, not_true_eq_false, + or_false, hm x hx] + · simp only [Set.mem_preimage, Set.mem_union, Set.mem_compl_iff, hx, not_false_eq_true, + or_true, hz x hx, hzero] + rw [heq] + exact hB.union hD.compl + · have heq : approximateNormal E ⁻¹' s = B := by + ext x + by_cases hx : x ∈ D + · exact hm x hx + · have hb : x ∉ B := fun hb ↦ hx (hBD hb) + simp only [Set.mem_preimage, hz x hx, hzero, hb] + rw [heq] + exact hB + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack +open RPI RPI.Boundary + +theorem measurable_tangentialGradient {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) {φ : Euc n → ℝ} (hφ : ContDiff ℝ 1 φ) : + Measurable (tangentialGradient E φ) := by + have hg : Continuous (gradient φ) := continuous_iff_continuousAt.mpr (fun x ↦ + continuousAt_gradient_of_contDiffAt hφ.contDiffAt) + have hv := measurable_approximateNormal hE + exact hg.measurable.sub ((hg.measurable.inner (𝕜 := ℝ) hv).smul hv) + +theorem minimizing_boundaryArea_ball_lt_top {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (c : Euc n) {R : ℝ} (hR : 0 < R) : boundaryArea E (Metric.ball c R) < ⊤ := by + obtain ⟨A, _, hA⟩ := exists_minimizing_boundaryArea_growth hn hmin + exact (hA c R hR).trans_lt ENNReal.ofReal_lt_top + +theorem tangentialGradient_memLp_on_ball {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + {R : ℝ} (hR : 0 < R) {φ : Euc n → ℝ} (hφ : ContDiff ℝ 1 φ) : + MemLp (tangentialGradient E φ) 2 ((boundaryArea E).restrict (Metric.ball 0 R)) := by + let μ := (boundaryArea E).restrict (Metric.ball 0 R) + have : IsFiniteMeasure μ := ⟨by + simpa only [μ, Measure.restrict_apply_univ] using minimizing_boundaryArea_ball_lt_top hn hmin 0 hR⟩ + have hg : Continuous (gradient φ) := continuous_iff_continuousAt.mpr (fun x ↦ + continuousAt_gradient_of_contDiffAt hφ.contDiffAt) + obtain ⟨M, hM⟩ := (isCompact_closedBall (0 : Euc n) R).exists_bound_of_continuousOn hg.continuousOn + apply MemLp.of_bound (measurable_tangentialGradient hmin.1 hφ).aestronglyMeasurable (2 * M) + filter_upwards [ae_restrict_mem measurableSet_ball] with x hx + exact (tangentialGradient_norm_le_twice E φ x).trans (by + nlinarith [hM x (Metric.ball_subset_closedBall hx)]) + +theorem tangentialGradient_mul {n : ℕ} (E : Set (Euc n)) + {f g : Euc n → ℝ} {x : Euc n} + (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : + tangentialGradient E (fun y ↦ f y * g y) x = + f x • tangentialGradient E g x + g x • tangentialGradient E f x := by + have hgrad : gradient (fun y ↦ f y * g y) x = f x • gradient g x + g x • gradient f x := by + apply (InnerProductSpace.toDual ℝ (Euc n)).injective + simp only [map_add, map_smul, toDual_gradient] + exact fderiv_mul hf hg + simp only [tangentialGradient, hgrad, inner_add_left, real_inner_smul_left] + module + +theorem tangentialGradient_eq_zero_of_notMem_tsupport {n : ℕ} (E : Set (Euc n)) + {φ : Euc n → ℝ} {x : Euc n} (hx : x ∉ tsupport φ) : tangentialGradient E φ x = 0 := by + simp only [tangentialGradient, gradient, fderiv_of_notMem_tsupport ℝ hx, map_zero, + inner_zero_left, zero_smul, sub_self] + +theorem boundaryArea_zero_of_singular_dim {n : ℕ} (hn : 8 ≤ n) + (E Z : Set (Euc n)) (hZd : dimH Z ≤ (n - 8 : ℕ)) : boundaryArea E Z = 0 := by + rw [boundaryArea_eq_smul_surfaceMeasure, Measure.smul_apply, + surfaceMeasure_zero_of_singular_dim hn _ _ hZd] + exact mul_zero _ + +theorem wholeBoundarySupersolution_of_regular_tests {n : ℕ} (hn : 8 ≤ n) + {E Z : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (hZ : IsClosed Z) (hZd : dimH Z ≤ (n - 8 : ℕ)) {G : Euc n → Euc n} + (hloc : ∀ R : ℝ, 0 < R → MemLp G 2 ((boundaryArea E).restrict (Metric.ball 0 R))) + (hreg : ∀ ψ : Euc n → ℝ, ContDiff ℝ ∞ ψ → HasCompactSupport ψ → + Disjoint (tsupport ψ) Z → (∀ x, 0 ≤ ψ x) → + 0 ≤ ∫ x, inner ℝ (G x) (tangentialGradient E ψ x) ∂boundaryArea E) : + WholeBoundarySupersolution E G := by + intro φ hφ hcφ hpφ + obtain ⟨r, hr⟩ := Metric.isBounded_iff_subset_ball (0 : Euc n) |>.mp hcφ.isBounded + let R := max r 1 + have hR : 0 < R := lt_of_lt_of_le zero_lt_one (le_max_right _ _) + have hsupp : tsupport φ ⊆ Metric.ball (0 : Euc n) R := + hr.trans (Metric.ball_subset_ball (le_max_left _ _)) + let μ := (boundaryArea E).restrict (Metric.ball 0 R) + have hn1 : 1 < n := by omega + have : IsFiniteMeasure μ := ⟨by + simpa only [μ, Measure.restrict_apply_univ] using minimizing_boundaryArea_ball_lt_top hn1 hmin 0 hR⟩ + let K := Z ∩ tsupport φ + have hKc : IsCompact K := hcφ.of_isClosed_subset + (hZ.inter (isClosed_tsupport φ)) inter_subset_right + have hKd : dimH K ≤ (n - 8 : ℕ) := (dimH_mono inter_subset_left).trans hZd + obtain ⟨χ, hχ, hχlim, _, hχE⟩ := exists_raw_minimizing_frontier_capacity_sequence hn hmin hKc hKd + have hzero : ∀ᵐ x ∂μ, x ∉ K := by + have hKzero : μ K = 0 := le_antisymm + (Measure.restrict_apply_le _ _ |>.trans_eq (boundaryArea_zero_of_singular_dim hn E K hKd)) zero_le + simpa only [ae_iff, not_not, Set.ofPred_mem_eq] using hKzero + have hχlim' : ∀ᵐ x ∂μ, Tendsto (fun i ↦ χ i x) atTop (𝓝 1) := by + filter_upwards [hzero] with x hx + apply tendsto_const_nhds.congr' + filter_upwards [hχlim x hx] with i hi + exact hi.symm + have hχE' : Tendsto (fun i ↦ vectorEnergy μ (tangentialGradient E (χ i))) atTop (𝓝 0) := by + apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds hχE (fun _ ↦ zero_le) + intro i + exact lintegral_mono' Measure.restrict_le_self le_rfl + have hB : MemLp (tangentialGradient E φ) 2 μ := + tangentialGradient_memLp_on_ball hn1 hmin hR (hφ.of_le (by simp)) + have hC : ∀ i, MemLp (tangentialGradient E (χ i)) 2 μ := fun i ↦ + tangentialGradient_memLp_on_ball hn1 hmin hR ((hχ i).1.of_le (by simp)) + have hC0 : Tendsto (fun i ↦ (eLpNorm (tangentialGradient E (χ i)) 2 μ).toReal) + atTop (𝓝 0) := tendsto_eLpNorm_two_toReal_of_vectorEnergy_zero_of_aestronglyMeasurable + (fun i ↦ (hC i).aestronglyMeasurable) hχE' + have hχnorm : ∀ i, ∀ᵐ x ∂μ, ‖χ i x‖ ≤ 1 := fun i ↦ ae_of_all _ (fun x ↦ by + rw [Real.norm_eq_abs, abs_of_nonneg ((hχ i).2.1 x).1] + exact ((hχ i).2.1 x).2) + obtain ⟨M, hM⟩ := hcφ.exists_bound_of_continuous hφ.continuous + have hpair : 0 ≤ ∫ x, inner ℝ (G x) (tangentialGradient E φ x) ∂μ := by + apply energy_inequality_of_capacity_cutoffs (hloc R hR) hB χ + (fun i ↦ (hχ i).1.continuous.aestronglyMeasurable) hχnorm hχlim' + (fun i ↦ tangentialGradient E (χ i)) hC hC0 φ hφ.continuous.aestronglyMeasurable + (M := M) (ae_of_all _ hM) + intro i + have heq : (fun x ↦ χ i x • tangentialGradient E φ x + φ x • tangentialGradient E (χ i) x) = + tangentialGradient E (fun x ↦ φ x * χ i x) := by + funext x + rw [tangentialGradient_mul E (hφ.differentiable (by simp)).differentiableAt + ((hχ i).1.differentiable (by simp)).differentiableAt, add_comm] + simp_rw [congrFun heq] + rw [setIntegral_eq_integral_of_forall_compl_eq_zero] + · apply hreg _ (hφ.mul (hχ i).1) hcφ.mul_right + · exact tsupport_mul_disjoint_Singular (hχ i).2.2 + · exact fun x ↦ mul_nonneg (hpφ x) ((hχ i).2.1 x).1 + · intro x hx + rw [tangentialGradient_eq_zero_of_notMem_tsupport E + (fun hx' ↦ hx (hsupp (tsupport_mul_subset_left hx'))), inner_zero_right] + dsimp only [μ] at hpair + rwa [setIntegral_eq_integral_of_forall_compl_eq_zero (fun x hx ↦ by + rw [tangentialGradient_eq_zero_of_notMem_tsupport E (fun hx' ↦ hx (hsupp hx')), + inner_zero_right])] at hpair + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/ExistsMinimizingDensityLimit.lean b/lean/OAI/Geometry/Perimeter/Regularity/ExistsMinimizingDensityLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..a81b4f84c30be6f60d969092f9e11d88007bc8f9 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/ExistsMinimizingDensityLimit.lean @@ -0,0 +1,530 @@ +import OAI.Geometry.Perimeter.Regularity.DilatedVolumeTest +import OAI.Geometry.Perimeter.Regularity.BlowupHomeomorph + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +open scoped ENNReal Topology ContDiff +open scoped Topology ENNReal +namespace RPISingularHarnack + +theorem exists_minimizing_density_limit {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hE : IsLocallyPerimeterMinimizing E) (c : Euc n) : + ∃ a : ℝ, 0 ≤ a ∧ Tendsto + (fun r : ℝ ↦ (perimeterMeasure E).real (Metric.ball c r) / r^(n-1)) + (𝓝[>] 0) (𝓝 a) := by + let f (r : ℝ) := (perimeterMeasure E).real (Metric.ball c r) / r^(n-1) + let S : Set ℝ := f '' Ioi 0 + have hS : S.Nonempty := ⟨f 1, 1, (by norm_num : (1:ℝ) ∈ Ioi 0), rfl⟩ + have hnonneg : ∀ y ∈ S, 0 ≤ y := by + rintro y ⟨r, hr, rfl⟩ + exact div_nonneg ENNReal.toReal_nonneg (pow_nonneg hr.le _) + have hb : BddBelow S := ⟨0, hnonneg⟩ + have hmono := minimizing_perimeter_density_monotone hn hE c + refine ⟨sInf S, le_csInf hS hnonneg, tendsto_order.mpr ⟨?_, ?_⟩⟩ + · intro b hb' + filter_upwards [self_mem_nhdsWithin] with r hr + exact hb'.trans_le (csInf_le hb ⟨r, hr, rfl⟩) + · intro b hb' + obtain ⟨y, ⟨R, hR, rfl⟩, hy⟩ := exists_lt_of_csInf_lt hS hb' + filter_upwards [self_mem_nhdsWithin, + (gt_mem_nhds hR : ∀ᶠ r in 𝓝 (0:ℝ), r < R).filter_mono nhdsWithin_le_nhds] with r hr hrR + exact (hmono hr hR hrR.le).trans_lt hy + +theorem minimizing_blowup_ball_real {n : ℕ} (hn : 0 < n) + {E : Set (Euc n)} (hE : MeasurableSet E) (c : Euc n) + {r R : ℝ} (hr : 0 < r) (hR : 0 < R) : + (perimeterMeasure (blownUpSet E c r)).real (Metric.ball 0 R) = + ((perimeterMeasure E).real (Metric.ball c (r*R)) / (r*R)^(n-1)) * R^(n-1) := by + have hs := blownUpSet_ball c (0:Euc n) hr R + simp only [smul_zero, add_zero] at hs + rw [measureReal_def, perimeterMeasure_open _ Metric.isOpen_ball, + ← hs, perimeter_blownUpSet_eq hE c hr, ENNReal.toReal_mul, + ENNReal.toReal_ofReal (by positivity), measureReal_def, + perimeterMeasure_open _ Metric.isOpen_ball] + have hn' : n = (n-1)+1 := by omega + have hpow : r^n = r^(n-1)*r := by conv_lhs => rw [hn', pow_succ] + rw [hpow] + field_simp [hr.ne', hR.ne'] + rw [mul_pow] + ring + +theorem minimizing_dense_null_spheres {n : ℕ} {E : Set (Euc n)} + (hE : IsLocallyPerimeterMinimizing E) (c : Euc n) : + Dense {r : ℝ | perimeterMeasure E (Metric.sphere c r) = 0} := by + let := perimeterMeasure_locallyFinite E hE.2.1 + have hc := Measure.countable_meas_level_set_pos + (μ := perimeterMeasure E) (g := fun x : Euc n ↦ dist x c) + (continuous_id.dist continuous_const).measurable + have hd := hc.dense_compl ℝ + convert hd using 1 + ext r + simp only [mem_compl_iff, mem_ofPred_eq, not_lt, nonpos_iff_eq_zero, Metric.sphere] + +theorem minimizing_density_eq_of_null_spheres {n : ℕ} {E : Set (Euc n)} + (hE : IsLocallyPerimeterMinimizing E) {a : ℝ} (ha : 0 ≤ a) (k : ℕ) + (heq : ∀ r : ℝ, 0 < r → perimeterMeasure E (Metric.sphere 0 r) = 0 → + (perimeterMeasure E).real (Metric.ball 0 r) = a*r^k) : + ∀ r : ℝ, 0 < r → (perimeterMeasure E).real (Metric.ball 0 r) = a*r^k := by + let := perimeterMeasure_finiteOnCompacts E hE.2.1 + have hd := minimizing_dense_null_spheres hE (0:Euc n) + have hm : Monotone (fun r : ℝ ↦ (perimeterMeasure E).real (Metric.ball 0 r)) := by + intro r R hrR + exact measureReal_mono (Metric.ball_subset_ball hrR) + (measure_ne_top_of_subset Metric.ball_subset_closedBall (isCompact_closedBall (0:Euc n) R).measure_ne_top) + have ht (r : ℝ) : Tendsto (fun R : ℝ ↦ a*R^k) (𝓝 r) (𝓝 (a*r^k)) := (continuous_const.mul (continuous_id.pow k)).tendsto r + intro r hr + apply le_antisymm + · apply ge_of_tendsto ((ht r).mono_left nhdsWithin_le_nhds : + Tendsto (fun R : ℝ ↦ a*R^k) (𝓝[>] r) (𝓝 (a*r^k))) + filter_upwards [self_mem_nhdsWithin] with R hR + obtain ⟨s, hs, hrs, hsR⟩ := hd.exists_between hR + have hs0 := hr.trans hrs + calc + (perimeterMeasure E).real (Metric.ball 0 r) ≤ + (perimeterMeasure E).real (Metric.ball 0 s) := hm hrs.le + _ = a*s^k := heq s hs0 hs + _ ≤ a*R^k := mul_le_mul_of_nonneg_left (pow_le_pow_left₀ hs0.le hsR.le k) ha + · apply le_of_tendsto ((ht r).mono_left nhdsWithin_le_nhds : + Tendsto (fun R : ℝ ↦ a*R^k) (𝓝[<] r) (𝓝 (a*r^k))) + filter_upwards [self_mem_nhdsWithin, + (lt_mem_nhds hr : ∀ᶠ R in 𝓝 r, 0 < R).filter_mono nhdsWithin_le_nhds] with R hR hR0 + obtain ⟨s, hs, hRs, hsr⟩ := hd.exists_between hR + calc + a*R^k ≤ a*s^k := mul_le_mul_of_nonneg_left (pow_le_pow_left₀ hR0.le hRs.le k) ha + _ = (perimeterMeasure E).real (Metric.ball 0 s) := (heq s (hR0.trans hRs) hs).symm + _ ≤ (perimeterMeasure E).real (Metric.ball 0 r) := hm hsr.le + +theorem minimizing_density_limit_pos {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hE : IsLocallyPerimeterMinimizing E) + {c : Euc n} (hc : c ∈ perimeterSupport E) {a : ℝ} + (ht : Tendsto (fun r : ℝ ↦ (perimeterMeasure E).real (Metric.ball c r) / r^(n-1)) + (𝓝[>] 0) (𝓝 a)) : 0 < a := by + obtain ⟨b, hb, hbound⟩ := exists_minimizing_perimeter_lower_density n hn + apply hb.trans_le + apply ge_of_tendsto ht + filter_upwards [self_mem_nhdsWithin] with r hr + apply (le_div_iff₀ (pow_pos hr _)).mpr + rw [measureReal_def, perimeterMeasure_open E Metric.isOpen_ball] + exact (ENNReal.ofReal_le_iff_le_toReal (hE.2.1 c r hr).ne).mp (hbound E hE c hc r hr) + +theorem minimizing_blowup_limit_constant_density {n : ℕ} (hn : 1 < n) + {E F : Set (Euc n)} (hE : IsLocallyPerimeterMinimizing E) + (hF : IsLocallyPerimeterMinimizing F) (c : Euc n) + (r : ℕ → ℝ) (hr : ∀ i, 0 < r i) (htr : Tendsto r atTop (𝓝 0)) + (hconv : ∀ (x : Euc n) (R : ℝ), 0 < R → + Tendsto (fun i ↦ volume.real (symmDiff (blownUpSet E c (r i)) F ∩ Metric.closedBall x R)) + atTop (𝓝 0)) + {a : ℝ} (ha : 0 ≤ a) + (hden : Tendsto (fun R : ℝ ↦ (perimeterMeasure E).real (Metric.ball c R) / R^(n-1)) + (𝓝[>] 0) (𝓝 a)) : + ∀ R : ℝ, 0 < R → (perimeterMeasure F).real (Metric.ball 0 R) = a*R^(n-1) := by + apply minimizing_density_eq_of_null_spheres hF ha (n-1) + intro R hR hnull + have htR : Tendsto (fun i ↦ r i * R) atTop (𝓝[>] (0:ℝ)) := by + apply tendsto_nhdsWithin_iff.mpr + exact ⟨by simpa using htr.mul_const R, + Eventually.of_forall fun i ↦ mul_pos (hr i) hR⟩ + have htden : Tendsto (fun i ↦ (perimeterMeasure (blownUpSet E c (r i))).real (Metric.ball 0 R)) + atTop (𝓝 (a*R^(n-1))) := by + simpa only [minimizing_blowup_ball_real (by omega : 0 < n) hE.1 c (hr _) hR, Function.comp_def] using + (hden.comp htR).mul_const (R^(n-1)) + have htp := tendsto_minimizing_perimeter_ball_of_local_L1 (by omega : 0 < n) + (fun i ↦ locally_minimizing_blownUpSet hE c (hr i)) hF.1 hconv (0:Euc n) hR hnull + have htF := (ENNReal.tendsto_toReal (hF.2.1 0 R hR).ne).comp htp + have htF' : Tendsto (fun i ↦ (perimeterMeasure (blownUpSet E c (r i))).real (Metric.ball 0 R)) + atTop (𝓝 ((perimeterMeasure F).real (Metric.ball 0 R))) := by + simpa only [measureReal_def, perimeterMeasure_open _ Metric.isOpen_ball, Function.comp_def] using htF + exact tendsto_nhds_unique htF' htden + +theorem minimizing_tangent_cone_subsequence {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hE : IsLocallyPerimeterMinimizing E) + {c : Euc n} (hc : c ∈ perimeterSupport E) + (r : ℕ → ℝ) (hr : ∀ i, 0 < r i) (htr : Tendsto r atTop (𝓝 0)) : + ∃ K : Set (Euc n), IsClosed K ∧ IsLocallyPerimeterMinimizing K ∧ IsCone K ∧ + K = (volume.restrict K).support ∧ frontier K = perimeterSupport K ∧ (0:Euc n) ∈ perimeterSupport K ∧ + ∃ σ : ℕ → ℕ, StrictMono σ ∧ + (∀ (x : Euc n) (R : ℝ), 0 < R → + Tendsto (fun i ↦ volume.real (symmDiff (blownUpSet E c (r (σ i))) K ∩ Metric.closedBall x R)) + atTop (𝓝 0)) ∧ + (∀ R : ℝ, 0 < R → perimeterMeasure K (Metric.sphere 0 R) = 0 → + Tendsto (fun i ↦ perimeter (blownUpSet E c (r (σ i))) (Metric.ball 0 R)) atTop + (𝓝 (perimeter K (Metric.ball 0 R)))) := by + obtain ⟨F, hF, σ, hσ, hconv, hP⟩ := minimizing_global_compactness (by omega : 0 < n) + (fun i ↦ blownUpSet E c (r i)) (fun i ↦ locally_minimizing_blownUpSet hE c (hr i)) + obtain ⟨a, ha, hden⟩ := exists_minimizing_density_limit hn hE c + have ha0 := minimizing_density_limit_pos hn hE hc hden + have hdensity := minimizing_blowup_limit_constant_density hn hE hF c + (fun i ↦ r (σ i)) (fun i ↦ hr (σ i)) (htr.comp hσ.tendsto_atTop) hconv ha hden + let K := (volume.restrict F).support + obtain ⟨hK, hFK, hminK, hconeK, hfrontK⟩ := + minimizing_constant_density_conical_representative hn hF ha hdensity + have hlocal : ∀ (x : Euc n) (R : ℝ), 0 < R → + Tendsto (fun i ↦ volume.real (symmDiff (blownUpSet E c (r (σ i))) K ∩ Metric.closedBall x R)) + atTop (𝓝 0) := by + intro x R hR + convert hconv x R hR using 1 + funext i + rw [measureReal_def, measureReal_def] + congr 1 + apply measure_congr + filter_upwards [hFK] with y hy + simp only [mem_inter_iff, mem_symmDiff] + change (y ∈ F) = (y ∈ K) at hy + rw [hy] + have hcanonical : K = (volume.restrict K).support := by + change (volume.restrict F).support = (volume.restrict K).support + rw [Measure.restrict_congr_set hFK] + refine ⟨K, hK, hminK, hconeK, hcanonical, hfrontK.trans (perimeterSupport_eq_of_ae hFK), ?_, + σ, hσ, hlocal, ?_⟩ + · intro R hR + rw [← perimeter_eq_of_ae hFK] + have hh : 0 < (perimeter F (Metric.ball 0 R)).toReal := by + rw [← perimeterMeasure_open F Metric.isOpen_ball] + change 0 < (perimeterMeasure F).real (Metric.ball 0 R) + rw [hdensity R hR] + positivity + exact (ENNReal.toReal_pos_iff.mp hh).1 + · intro R hR hnull + exact tendsto_minimizing_perimeter_ball_of_local_L1 (by omega : 0 < n) + (fun i ↦ locally_minimizing_blownUpSet hE c (hr (σ i))) hminK.1 hlocal (0:Euc n) hR hnull + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +open scoped ENNReal Topology ContDiff +open scoped Topology ENNReal +namespace RPISingularHarnack + +theorem ae_subset_of_local_L1_limits {n : ℕ} + (E F : ℕ → Set (Euc n)) (K L : Set (Euc n)) (hsub : ∀ i, E i ⊆ F i) + (hE : ∀ (x : Euc n) (R : ℝ), 0 < R → + Tendsto (fun i ↦ volume.real (symmDiff (E i) K ∩ Metric.closedBall x R)) atTop (𝓝 0)) + (hF : ∀ (x : Euc n) (R : ℝ), 0 < R → + Tendsto (fun i ↦ volume.real (symmDiff (F i) L ∩ Metric.closedBall x R)) atTop (𝓝 0)) : + K ≤ᵐ[volume] L := by + have hENN (A : ℕ → Set (Euc n)) (B : Set (Euc n)) (x : Euc n) (R : ℝ) + (ht : Tendsto (fun i ↦ volume.real (symmDiff (A i) B ∩ Metric.closedBall x R)) atTop (𝓝 0)) : + Tendsto (fun i ↦ volume (symmDiff (A i) B ∩ Metric.closedBall x R)) atTop (𝓝 0) := by + have h := ENNReal.continuous_ofReal.tendsto (0:ℝ) |>.comp ht + simp only [Function.comp_def, measureReal_def, ENNReal.ofReal_zero, + ENNReal.ofReal_toReal (measure_ne_top_of_subset inter_subset_right + (isCompact_closedBall x R).measure_ne_top)] at h + exact h + have hz (x : Euc n) (R : ℝ) (hR : 0 < R) : volume ((K \ L) ∩ Metric.closedBall x R) = 0 := by + apply le_antisymm _ bot_le + have ht := (hENN E K x R (hE x R hR)).add (hENN F L x R (hF x R hR)) + simp only [zero_add] at ht + apply ge_of_tendsto ht + exact Eventually.of_forall fun i ↦ by + apply (measure_mono (show (K \ L) ∩ Metric.closedBall x R ⊆ + (symmDiff (E i) K ∩ Metric.closedBall x R) ∪ + (symmDiff (F i) L ∩ Metric.closedBall x R) from ?_)).trans + (measure_union_le _ _) + intro y hy + by_cases hyE : y ∈ E i + · exact Or.inr ⟨Or.inl ⟨hsub i hyE, hy.1.2⟩, hy.2⟩ + · exact Or.inl ⟨Or.inr ⟨hy.1.1, hyE⟩, hy.2⟩ + apply ae_le_set.mpr + have hs : K \ L ⊆ ⋃ m : ℕ, (K \ L) ∩ Metric.closedBall 0 ((m:ℝ)+1) := by + intro x hx + obtain ⟨m, hm⟩ := exists_nat_gt (dist x (0:Euc n)) + exact mem_iUnion.mpr ⟨m, hx, Metric.mem_closedBall.mpr (by linarith)⟩ + exact le_antisymm ((measure_mono hs).trans (le_of_eq (measure_iUnion_null fun m ↦ + hz 0 ((m:ℝ)+1) (by positivity)))) bot_le + +theorem canonical_subset_of_ae {n : ℕ} {K L : Set (Euc n)} + (hK : K = (volume.restrict K).support) (hL : L = (volume.restrict L).support) + (hKL : K ≤ᵐ[volume] L) : K ⊆ L := by + rw [hK, hL] + exact Measure.support_mono (Measure.restrict_mono_ae hKL) + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +open scoped ENNReal Topology ContDiff +open scoped Topology ENNReal +namespace RPISingularHarnack + +theorem nested_minimizing_tangent_cones {n : ℕ} (hn : 1 < n) + {E F : Set (Euc n)} (hE : IsLocallyPerimeterMinimizing E) + (hF : IsLocallyPerimeterMinimizing F) (hEF : E ⊆ F) + {c : Euc n} (hcE : c ∈ perimeterSupport E) (hcF : c ∈ perimeterSupport F) + (r : ℕ → ℝ) (hr : ∀ i, 0 < r i) (htr : Tendsto r atTop (𝓝 0)) : + ∃ K L : Set (Euc n), + IsClosed K ∧ IsClosed L ∧ IsLocallyPerimeterMinimizing K ∧ + IsLocallyPerimeterMinimizing L ∧ IsCone K ∧ IsCone L ∧ K ⊆ L ∧ + K = (volume.restrict K).support ∧ L = (volume.restrict L).support ∧ + frontier K = perimeterSupport K ∧ frontier L = perimeterSupport L ∧ + (0:Euc n) ∈ perimeterSupport K ∧ (0:Euc n) ∈ perimeterSupport L ∧ + ∃ σ : ℕ → ℕ, StrictMono σ ∧ + (∀ (x : Euc n) (R : ℝ), 0 < R → + Tendsto (fun i ↦ volume.real (symmDiff (blownUpSet E c (r (σ i))) K ∩ Metric.closedBall x R)) + atTop (𝓝 0)) ∧ + (∀ (x : Euc n) (R : ℝ), 0 < R → + Tendsto (fun i ↦ volume.real (symmDiff (blownUpSet F c (r (σ i))) L ∩ Metric.closedBall x R)) + atTop (𝓝 0)) ∧ + (∀ R : ℝ, 0 < R → perimeterMeasure K (Metric.sphere 0 R) = 0 → + Tendsto (fun i ↦ perimeter (blownUpSet E c (r (σ i))) (Metric.ball 0 R)) atTop + (𝓝 (perimeter K (Metric.ball 0 R)))) ∧ + (∀ R : ℝ, 0 < R → perimeterMeasure L (Metric.sphere 0 R) = 0 → + Tendsto (fun i ↦ perimeter (blownUpSet F c (r (σ i))) (Metric.ball 0 R)) atTop + (𝓝 (perimeter L (Metric.ball 0 R)))) := by + obtain ⟨K, hKc, hKm, hKcone, hKcan, hKf, hK0, σ, hσ, hEK, hPK⟩ := + minimizing_tangent_cone_subsequence hn hE hcE r hr htr + obtain ⟨L, hLc, hLm, hLcone, hLcan, hLf, hL0, τ, hτ, hFL, hPL⟩ := + minimizing_tangent_cone_subsequence hn hF hcF (fun i ↦ r (σ i)) + (fun i ↦ hr (σ i)) (htr.comp hσ.tendsto_atTop) + have hEK' : ∀ (x : Euc n) (R : ℝ), 0 < R → + Tendsto (fun i ↦ volume.real (symmDiff (blownUpSet E c (r (σ (τ i)))) K ∩ Metric.closedBall x R)) + atTop (𝓝 0) := by + intro x R hR + exact (hEK x R hR).comp hτ.tendsto_atTop + have hKL : K ⊆ L := canonical_subset_of_ae hKcan hLcan + (ae_subset_of_local_L1_limits + (fun i ↦ blownUpSet E c (r (σ (τ i)))) + (fun i ↦ blownUpSet F c (r (σ (τ i)))) K L + (fun i x hx ↦ hEF hx) hEK' hFL) + refine ⟨K, L, hKc, hLc, hKm, hLm, hKcone, hLcone, hKL, hKcan, hLcan, + hKf, hLf, hK0, hL0, σ ∘ τ, hσ.comp hτ, hEK', hFL, ?_, hPL⟩ + intro R hR hnull + exact (hPK R hR hnull).comp hτ.tendsto_atTop + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +open scoped ENNReal Topology ContDiff +open scoped Topology ENNReal +namespace RPISingularHarnack + +theorem minimizing_support_limit_of_local_L1 {n : ℕ} (hn : 1 < n) + (E : ℕ → Set (Euc n)) {F : Set (Euc n)} + (hE : ∀ i, IsLocallyPerimeterMinimizing (E i)) (hF : IsLocallyPerimeterMinimizing F) + (hconv : ∀ (x : Euc n) (R : ℝ), 0 < R → + Tendsto (fun i ↦ volume.real (symmDiff (E i) F ∩ Metric.closedBall x R)) atTop (𝓝 0)) + (x : ℕ → Euc n) {y : Euc n} (hx : ∀ i, x i ∈ perimeterSupport (E i)) + (htx : Tendsto x atTop (𝓝 y)) : y ∈ perimeterSupport F := by + by_contra hy + change ¬ ∀ R : ℝ, 0 < R → 0 < perimeter F (Metric.ball y R) at hy + push Not at hy + obtain ⟨R, hR, hzero⟩ := hy + have hzero' : perimeter F (Metric.ball y R) = 0 := bot_unique hzero + obtain ⟨s, hs, hs0, hsR⟩ := (minimizing_dense_null_spheres hF y).exists_between hR + have hsP : perimeter F (Metric.ball y s) = 0 := by + apply bot_unique + exact (perimeter_mono_region F (Metric.ball_subset_ball hsR.le)).trans hzero + have htP := tendsto_minimizing_perimeter_ball_of_local_L1 (by omega : 0 < n) + hE hF.1 hconv y hs0 hs + rw [hsP] at htP + obtain ⟨b, hb, hbound⟩ := exists_minimizing_perimeter_lower_density n hn + have hevent : ∀ᶠ i in atTop, ENNReal.ofReal (b * (s/2)^(n-1)) ≤ perimeter (E i) (Metric.ball y s) := by + filter_upwards [htx.eventually (Metric.ball_mem_nhds y (by positivity : 0 < s/2))] with i hi + apply (hbound (E i) (hE i) (x i) (hx i) (s/2) (by positivity)).trans + apply perimeter_mono_region + intro z hz + apply Metric.mem_ball.mpr + have htri := dist_triangle z (x i) y + have hz' := Metric.mem_ball.mp hz + have hi' := Metric.mem_ball.mp hi + linarith + have hle := ge_of_tendsto htP hevent + have hpos : 0 < ENNReal.ofReal (b * (s/2)^(n-1)) := ENNReal.ofReal_pos.mpr (by positivity) + exact (not_le_of_gt hpos) hle + +theorem minimizing_support_eventually_hits_of_local_L1 {n : ℕ} (hn : 0 < n) + (E : ℕ → Set (Euc n)) {F : Set (Euc n)} + (hE : ∀ i, IsLocallyPerimeterMinimizing (E i)) (hF : IsLocallyPerimeterMinimizing F) + (hconv : ∀ (x : Euc n) (R : ℝ), 0 < R → + Tendsto (fun i ↦ volume.real (symmDiff (E i) F ∩ Metric.closedBall x R)) atTop (𝓝 0)) + {x : Euc n} (hx : x ∈ perimeterSupport F) {ε : ℝ} (hε : 0 < ε) : + ∀ᶠ i in atTop, ∃ y ∈ perimeterSupport (E i), dist y x < ε := by + obtain ⟨s, hs, hs0, hsε⟩ := (minimizing_dense_null_spheres hF x).exists_between hε + have htP := tendsto_minimizing_perimeter_ball_of_local_L1 hn hE hF.1 hconv x hs0 hs + filter_upwards [htP.eventually (lt_mem_nhds (hx s hs0))] with i hi + have hi' : perimeterMeasure (E i) (Metric.ball x s) ≠ 0 := by + rw [perimeterMeasure_open _ Metric.isOpen_ball] + exact hi.ne' + have hsupport : ∀ᵐ y ∂perimeterMeasure (E i), y ∈ perimeterSupport (E i) := by + rw [← perimeterMeasure_support]; exact (perimeterMeasure (E i)).support_mem_ae + obtain ⟨y, hy, hyS⟩ := Measure.exists_mem_of_measure_ne_zero_of_ae hi' (ae_restrict_of_ae hsupport) + exact ⟨y, hyS, (Metric.mem_ball.mp hy).trans hsε⟩ + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +open scoped ENNReal Topology ContDiff +open scoped Topology ENNReal +namespace RPISingularHarnack + +theorem minimizing_supports_locally_converge {n : ℕ} (hn : 1 < n) + (E : ℕ → Set (Euc n)) {F : Set (Euc n)} + (hE : ∀ i, IsLocallyPerimeterMinimizing (E i)) (hF : IsLocallyPerimeterMinimizing F) + (hconv : ∀ (x : Euc n) (R : ℝ), 0 < R → + Tendsto (fun i ↦ volume.real (symmDiff (E i) F ∩ Metric.closedBall x R)) atTop (𝓝 0)) + {C : Set (Euc n)} (hC : IsCompact C) {ε : ℝ} (hε : 0 < ε) : + ∀ᶠ i in atTop, + (∀ x ∈ perimeterSupport (E i) ∩ C, ∃ y ∈ perimeterSupport F, dist x y < ε) ∧ + (∀ y ∈ perimeterSupport F ∩ C, ∃ x ∈ perimeterSupport (E i), dist x y < ε) := by + classical + have hupper : ∀ᶠ i in atTop, + ∀ x ∈ perimeterSupport (E i) ∩ C, ∃ y ∈ perimeterSupport F, dist x y < ε := by + by_contra h + have hf : ∃ᶠ i in atTop, ∃ x ∈ perimeterSupport (E i) ∩ C, + ∀ y ∈ perimeterSupport F, ε ≤ dist x y := by + simpa only [not_eventually, not_forall, not_exists, not_and, not_lt, exists_prop] using h + obtain ⟨σ, hσ, hσbad⟩ := extraction_of_frequently_atTop hf + choose x hx hbad using hσbad + obtain ⟨y, hyC, τ, hτ, hy⟩ := hC.tendsto_subseq (fun i ↦ (hx i).2) + have hyS : y ∈ perimeterSupport F := minimizing_support_limit_of_local_L1 hn + (fun i ↦ E (σ (τ i))) (fun i ↦ hE (σ (τ i))) hF + (fun z R hR ↦ (hconv z R hR).comp (hσ.comp hτ).tendsto_atTop) + (fun i ↦ x (τ i)) (fun i ↦ (hx (τ i)).1) hy + have ht : ∀ᶠ i in atTop, dist (x (τ i)) y < ε := + hy.eventually (Metric.ball_mem_nhds y hε) + obtain ⟨i, hi⟩ := ht.exists + exact (not_lt_of_ge (hbad (τ i) y hyS)) hi + have hlower : ∀ᶠ i in atTop, + ∀ y ∈ perimeterSupport F ∩ C, ∃ x ∈ perimeterSupport (E i), dist x y < ε := by + by_contra h + have hf : ∃ᶠ i in atTop, ∃ y ∈ perimeterSupport F ∩ C, + ∀ x ∈ perimeterSupport (E i), ε ≤ dist x y := by + simpa only [not_eventually, not_forall, not_exists, not_and, not_lt, exists_prop] using h + obtain ⟨σ, hσ, hσbad⟩ := extraction_of_frequently_atTop hf + choose y hy hbad using hσbad + obtain ⟨z, hzC, τ, hτ, hz⟩ := hC.tendsto_subseq (fun i ↦ (hy i).2) + have hzS : z ∈ perimeterSupport F := (isClosed_perimeterSupport F).mem_of_tendsto hz + (Eventually.of_forall fun i ↦ (hy (τ i)).1) + have hhits := minimizing_support_eventually_hits_of_local_L1 (by omega : 0 < n) + (fun i ↦ E (σ (τ i))) (fun i ↦ hE (σ (τ i))) hF + (fun x R hR ↦ (hconv x R hR).comp (hσ.comp hτ).tendsto_atTop) hzS (by positivity : 0 < ε/2) + have hnear : ∀ᶠ i in atTop, dist (y (τ i)) z < ε/2 := + hz.eventually (Metric.ball_mem_nhds z (by positivity)) + obtain ⟨i, hi, hni⟩ := (hhits.and hnear).exists + obtain ⟨x, hxS, hxz⟩ := hi + have htri := dist_triangle x z (y (τ i)) + rw [dist_comm z (y (τ i))] at htri + have hb := hbad (τ i) x hxS + linarith + exact hupper.and hlower + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +open scoped ENNReal Topology ContDiff +open scoped Topology ENNReal +namespace RPISingularHarnack + +theorem perimeterSupport_blownUpSet {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) (c : Euc n) {r : ℝ} (hr : 0 < r) (x : Euc n) : + x ∈ perimeterSupport (blownUpSet E c r) ↔ c + r • x ∈ perimeterSupport E := by + have hpos : 0 < ENNReal.ofReal (r * (r^n)⁻¹) := ENNReal.ofReal_pos.mpr (by positivity) + constructor + · intro hx R hR + have h := hx (R/r) (div_pos hR hr) + rw [← blownUpSet_ball c x hr, perimeter_blownUpSet_eq hE c hr] at h + simp only [mul_div_cancel₀ _ hr.ne'] at h + exact (ENNReal.mul_pos_iff.mp h).2 + · intro hx R hR + rw [← blownUpSet_ball c x hr, perimeter_blownUpSet_eq hE c hr] + exact ENNReal.mul_pos hpos.ne' (hx (r*R) (mul_pos hr hR)).ne' + +theorem cone_blowup_support_affine_mem {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) (hcone : IsCone E) (c : Euc n) {r t : ℝ} + (hr : 0 < r) (ht : 0 < 1+r*t) {x : Euc n} + (hx : x ∈ perimeterSupport (blownUpSet E c r)) : + (1+r*t) • x + t • c ∈ perimeterSupport (blownUpSet E c r) := by + rw [perimeterSupport_blownUpSet hE c hr] at hx ⊢ + have h := (isCone_perimeterSupport hE hcone (1+r*t) ht (c+r • x)).mpr hx + convert h using 1 + module + +theorem minimizing_cone_tangent_support_line_invariant {n : ℕ} (hn : 1 < n) + {E F : Set (Euc n)} (hE : IsLocallyPerimeterMinimizing E) + (hcone : IsCone E) (hF : IsLocallyPerimeterMinimizing F) (c : Euc n) + (r : ℕ → ℝ) (hr : ∀ i, 0 < r i) (htr : Tendsto r atTop (𝓝 0)) + (hconv : ∀ (x : Euc n) (R : ℝ), 0 < R → + Tendsto (fun i ↦ volume.real (symmDiff (blownUpSet E c (r i)) F ∩ Metric.closedBall x R)) + atTop (𝓝 0)) : + ∀ (t : ℝ) (x : Euc n), x ∈ perimeterSupport F → x + t • c ∈ perimeterSupport F := by + intro t x hx + have hmin (i : ℕ) := locally_minimizing_blownUpSet hE c (hr i) + have hpositive : ∀ᶠ i in atTop, 0 < 1+r i*t := by + have ht : Tendsto (fun i ↦ 1+r i*t) atTop (𝓝 (1:ℝ)) := by + simpa using tendsto_const_nhds.add (htr.mul_const t) + exact ht.eventually (lt_mem_nhds zero_lt_one) + have hhits (j : ℕ) : ∀ᶠ i in atTop, + (∃ y ∈ perimeterSupport (blownUpSet E c (r i)), dist y x < (1/2:ℝ)^j) ∧ 0 < 1+r i*t := + (minimizing_support_eventually_hits_of_local_L1 (by omega : 0 < n) + (fun i ↦ blownUpSet E c (r i)) hmin hF hconv hx (by positivity)).and hpositive + obtain ⟨σ, hσ, hσhit⟩ := extraction_forall_of_eventually hhits + choose y hyS hynear using fun i ↦ (hσhit i).1 + have hty : Tendsto y atTop (𝓝 x) := by + apply tendsto_iff_dist_tendsto_zero.mpr + apply squeeze_zero (fun _ ↦ dist_nonneg) (fun i ↦ (hynear i).le) + exact tendsto_pow_atTop_nhds_zero_of_lt_one (by norm_num) (by norm_num) + have htr' : Tendsto (fun i ↦ 1+r (σ i)*t) atTop (𝓝 (1:ℝ)) := by + simpa using tendsto_const_nhds.add ((htr.comp hσ.tendsto_atTop).mul_const t) + have hty' : Tendsto (fun i ↦ (1+r (σ i)*t) • y i + t • c) atTop (𝓝 (x+t • c)) := by + simpa using (htr'.smul hty).add_const (t • c) + exact minimizing_support_limit_of_local_L1 hn (fun i ↦ blownUpSet E c (r (σ i))) + (fun i ↦ hmin (σ i)) hF (fun z R hR ↦ (hconv z R hR).comp hσ.tendsto_atTop) + (fun i ↦ (1+r (σ i)*t) • y i + t • c) + (fun i ↦ cone_blowup_support_affine_mem hE.1 hcone c (hr (σ i)) (hσhit i).2 (hyS i)) hty' + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/ExistsTangentialGradientBallBound.lean b/lean/OAI/Geometry/Perimeter/Regularity/ExistsTangentialGradientBallBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..99175a1a9f53b34a67d9d894b0afeb9a3a3c212f --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/ExistsTangentialGradientBallBound.lean @@ -0,0 +1,511 @@ +import OAI.Geometry.Perimeter.Regularity.RankOneNormalError + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +namespace RPISingularHarnack +open RPI.Boundary + +theorem exists_tangentialGradient_ball_bound {n : ℕ} (E : Set (Euc n)) + (c : Euc n) (R : ℝ) {f : Euc n → ℝ} (hf : ContDiff ℝ 1 f) : + ∃ B : ℝ, ∀ x ∈ Metric.ball c R, ‖tangentialGradient E f x‖ ≤ B := by + have hg : Continuous (gradient f) := continuous_iff_continuousAt.mpr (fun x ↦ + continuousAt_gradient_of_contDiffAt hf.contDiffAt) + obtain ⟨M, hM⟩ := (isCompact_closedBall c R).exists_bound_of_continuousOn hg.continuousOn + exact ⟨2 * M, fun x hx ↦ (tangentialGradient_norm_le_twice E f x).trans + (by nlinarith [hM x (Metric.ball_subset_closedBall hx)])⟩ + +theorem tangentialDivergence_integrable_ball_perimeter {n : ℕ} + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (c : Euc n) {R : ℝ} (hR : 0 < R) {V : Euc n → Euc n} + (hV : ContDiff ℝ ∞ V) : + Integrable (tangentialDivergence E V) ((perimeterMeasure E).restrict (Metric.ball c R)) := by + change Integrable (fun x ↦ tangentialDivergence E V x) _ + simp_rw [tangentialDivergence_eq_sum E (hV.differentiable (by simp))] + apply integrable_finsetSum + intro i _ + exact (tangentialGradient_integrable_ball_perimeter hmin c hR + ((contDiff_const.inner ℝ hV).of_le (by simp))).inner_const _ + +theorem minimizing_radial_integral_bound {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (c a : Euc n) {R ε : ℝ} (hR : 0 < R) (hε : 0 < ε) + {f : Euc n → ℝ} (hf : ContDiff ℝ ∞ f) (hcf : HasCompactSupport f) + (hsf : tsupport f ⊆ Metric.ball c R) (hf0 : ∀ x, 0 ≤ f x) : + (∫ x in Metric.ball c R, f x * (n - 1 : ℕ) * + (‖x - a‖ ^ 2 + ε ^ 2) ^ (-((n - 1 : ℕ) : ℝ) / 2 - 1) * ε ^ 2 ∂perimeterMeasure E) ≤ + ∫ x in Metric.ball c R, ‖tangentialGradient E f x‖ * + (radialKernel a ε (n - 1 : ℕ) x * ‖x - a‖) ∂perimeterMeasure E := by + let μ := (perimeterMeasure E).restrict (Metric.ball c R) + let W : Euc n → Euc n := fun x ↦ radialKernel a ε (n - 1 : ℕ) x • (x - a) + have hW : ContDiff ℝ ∞ W := (radialKernel_contDiff a hε _).smul (contDiff_id.sub contDiff_const) + have hV : ContDiff ℝ ∞ (fun x ↦ f x • W x) := hf.smul hW + have hcV : HasCompactSupport (fun x ↦ f x • W x) := hcf.smul_right + have hsV : tsupport (fun x ↦ f x • W x) ⊆ Metric.ball c R := + (tsupport_smul_subset_left _ _).trans hsf + have hz := minimizing_tangentialDivergence_integral_eq_zero hn hmin c hR hV hcV hsV + have := perimeterMeasure_finiteOnCompacts E hmin.2.1 + have : IsFiniteMeasure μ := ⟨by + rw [Measure.restrict_apply_univ, perimeterMeasure_open E Metric.isOpen_ball] + exact hmin.2.1 c R hR⟩ + have hiW : Integrable W μ := hW.continuous.continuousOn.integrableOn_of_subset_isCompact + (isCompact_closedBall c R) measurableSet_ball Metric.ball_subset_closedBall + (by rw [perimeterMeasure_open E Metric.isOpen_ball]; exact (hmin.2.1 c R hR).ne) + have hmG := (measurable_tangentialGradient hmin.1 (hf.of_le (by simp))).aestronglyMeasurable (μ := μ) + obtain ⟨B, hB⟩ := exists_tangentialGradient_ball_bound E c R (hf.of_le (by simp)) + have hGi : Integrable (fun x ↦ inner ℝ (tangentialGradient E f x) (W x)) μ := by + apply Integrable.mono' (hiW.norm.const_mul B) (hmG.inner hW.continuous.aestronglyMeasurable) + filter_upwards [ae_restrict_mem measurableSet_ball] with x hx + exact (norm_inner_le_norm _ _).trans (mul_le_mul_of_nonneg_right (hB x hx) (norm_nonneg _)) + obtain ⟨D, hD⟩ := (isCompact_closedBall c R).exists_bound_of_continuousOn hf.continuous.continuousOn + have hDi := tangentialDivergence_integrable_ball_perimeter hmin c hR hW + have hfi : Integrable (fun x ↦ f x * tangentialDivergence E W x) μ := + hDi.bdd_mul hf.continuous.aestronglyMeasurable + ((ae_restrict_mem measurableSet_ball).mono fun x hx ↦ hD x (Metric.ball_subset_closedBall hx)) + have heq : (∫ x, f x * tangentialDivergence E W x ∂μ) + + (∫ x, inner ℝ (tangentialGradient E f x) (W x) ∂μ) = 0 := by + rw [← integral_add hfi hGi] + simpa only [μ, ← tangentialDivergence_smul E (hf.differentiable (by simp)) (hW.differentiable (by simp))] using hz + have hlci : Integrable (fun x ↦ f x * (n - 1 : ℕ) * + (‖x - a‖ ^ 2 + ε ^ 2) ^ (-((n - 1 : ℕ) : ℝ) / 2 - 1) * ε ^ 2) μ := by + apply ContinuousOn.integrableOn_of_subset_isCompact (s := Metric.ball c R) + (K := Metric.closedBall c R) _ (isCompact_closedBall c R) measurableSet_ball Metric.ball_subset_closedBall + (by rw [perimeterMeasure_open E Metric.isOpen_ball]; exact (hmin.2.1 c R hR).ne) + apply Continuous.continuousOn + apply Continuous.mul _ continuous_const + apply Continuous.mul (hf.continuous.mul continuous_const) + exact (((continuous_id.sub continuous_const).norm.pow 2).add continuous_const).rpow_const + (fun x ↦ Or.inl (by change ‖x - a‖ ^ 2 + ε ^ 2 ≠ 0; positivity)) + have hlow := integral_mono_ae hlci hfi + ((ae_restrict_of_ae (minimizing_halfspaceBlowup_ae hn hmin)).mono fun x hx ↦ by + dsimp [W] + rw [tangentialDivergence_radial E (by omega) a x hε hx.1] + have hpos : 0 ≤ (‖x - a‖ ^ 2 + ε ^ 2) ^ (-((n - 1 : ℕ) : ℝ) / 2 - 1) := by positivity + nlinarith [mul_nonneg (mul_nonneg (hf0 x) (Nat.cast_nonneg (n - 1))) hpos, + sq_nonneg (inner ℝ (x - a) (approximateNormal E x))]) + have hRhi : Integrable (fun x ↦ ‖tangentialGradient E f x‖ * ‖W x‖) μ := + hiW.norm.bdd_mul hmG.norm ((ae_restrict_mem measurableSet_ball).mono fun x hx ↦ by + simpa only [norm_norm] using hB x hx) + have hu := integral_mono hGi.neg hRhi (fun x ↦ (neg_le_abs _).trans (abs_real_inner_le_norm _ _)) + have hconcl : (∫ x, f x * (n - 1 : ℕ) * + (‖x - a‖ ^ 2 + ε ^ 2) ^ (-((n - 1 : ℕ) : ℝ) / 2 - 1) * ε ^ 2 ∂μ) ≤ + ∫ x, ‖tangentialGradient E f x‖ * ‖W x‖ ∂μ := by + simp only [Pi.neg_apply, integral_neg] at hu + linarith + simpa only [W, norm_smul, Real.norm_of_nonneg (radialKernel_pos a _ hε _).le] using hconcl + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +namespace RPISingularHarnack + +theorem radial_integral_lower_of_density {n : ℕ} (μ : Measure (Euc n)) [IsFiniteMeasure μ] + (a : Euc n) {ε k c : ℝ} (hε : 0 < ε) (hk : 0 ≤ k) (hc : 0 ≤ c) + (hdensity : c * ε ^ k ≤ μ.real (Metric.ball a ε)) + {f : Euc n → ℝ} (hf0 : ∀ x, 0 ≤ f x) + (hflower : ∀ x ∈ Metric.ball a ε, f a / 2 ≤ f x) + (hi : Integrable (fun x ↦ f x * k * (‖x - a‖ ^ 2 + ε ^ 2) ^ (-k / 2 - 1) * ε ^ 2) μ) : + (c * k * (2 : ℝ) ^ (-k / 2 - 1) / 2) * f a ≤ + ∫ x, f x * k * (‖x - a‖ ^ 2 + ε ^ 2) ^ (-k / 2 - 1) * ε ^ 2 ∂μ := by + let B : ℝ := f a / 2 * k * (2 * ε ^ 2) ^ (-k / 2 - 1) * ε ^ 2 + have hB : 0 ≤ B := by dsimp [B]; positivity [hf0 a] + have hdist (x : Euc n) (hx : x ∈ Metric.ball a ε) : ‖x - a‖ ^ 2 + ε ^ 2 ≤ 2 * ε ^ 2 := by + have hh : ‖x - a‖ < ε := by simpa only [Metric.mem_ball, dist_eq_norm] using hx + nlinarith [norm_nonneg (x - a)] + have hp (x : Euc n) (hx : x ∈ Metric.ball a ε) : + (2 * ε ^ 2) ^ (-k / 2 - 1) ≤ (‖x - a‖ ^ 2 + ε ^ 2) ^ (-k / 2 - 1) := + Real.rpow_le_rpow_of_nonpos (by positivity) (hdist x hx) (by linarith) + have hle (x : Euc n) : (Metric.ball a ε).indicator (fun _ ↦ B) x ≤ + f x * k * (‖x - a‖ ^ 2 + ε ^ 2) ^ (-k / 2 - 1) * ε ^ 2 := by + by_cases hx : x ∈ Metric.ball a ε + · rw [indicator_of_mem hx] + dsimp [B] + exact mul_le_mul_of_nonneg_right + (mul_le_mul (mul_le_mul_of_nonneg_right (hflower x hx) hk) (hp x hx) + (by positivity) (mul_nonneg (hf0 x) hk)) (sq_nonneg ε) + · rw [indicator_of_notMem hx] + positivity [hf0 x] + have hileft : Integrable ((Metric.ball a ε).indicator (fun _ ↦ B)) μ := + (integrable_const B).indicator measurableSet_ball + have hh := integral_mono hileft hi hle + rw [integral_indicator measurableSet_ball, integral_const, smul_eq_mul, + Measure.real, Measure.restrict_apply_univ] at hh + have hlow := mul_le_mul hdensity (le_refl B) hB + ((mul_nonneg hc (Real.rpow_nonneg hε.le k)).trans hdensity) + have he : (c * ε ^ k) * B = (c * k * (2 : ℝ) ^ (-k / 2 - 1) / 2) * f a := by + calc + _ = (c * k * f a / 2) * (ε ^ k * ε ^ 2 * (2 * ε ^ 2) ^ (-k / 2 - 1)) := by dsimp [B]; ring + _ = _ := by rw [radialKernel_mass_scaling hε]; ring + exact he ▸ hlow.trans hh + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +namespace RPISingularHarnack +open RPI.Boundary + +theorem exists_minimizing_riesz_potential_constant (n : ℕ) (hn : 2 < n) : + ∃ S : ℝ, 0 < S ∧ ∀ E : Set (Euc n), IsLocallyPerimeterMinimizing E → + ∀ (c : Euc n) (R : ℝ), 0 < R → ∀ f : Euc n → ℝ, + ContDiff ℝ ∞ f → HasCompactSupport f → tsupport f ⊆ Metric.ball c R → + (∀ x, 0 ≤ f x) → ∀ a ∈ perimeterSupport E, + S * f a ≤ ∫ x in Metric.ball c R, + ‖tangentialGradient E f x‖ * ‖x - a‖ ^ (-(((n - 1 : ℕ) : ℝ) - 1)) ∂perimeterMeasure E := by + have hn1 : 1 < n := by omega + have hk : (1 : ℝ) < (n - 1 : ℕ) := by exact_mod_cast (show 1 < n - 1 by omega) + obtain ⟨c₀, hc₀, hdensity⟩ := exists_minimizing_perimeter_lower_density n hn1 + obtain ⟨A, hA, hgrowth⟩ := exists_locallyMinimizing_perimeter_growth_constant n (by omega) + let S : ℝ := c₀ * (n - 1 : ℕ) * (2 : ℝ) ^ (-((n - 1 : ℕ) : ℝ) / 2 - 1) / 2 + have hS : 0 < S := by dsimp [S]; positivity + refine ⟨S, hS, ?_⟩ + intro E hmin c R hR f hf hcf hsf hf0 a ha + let μ := (perimeterMeasure E).restrict (Metric.ball c R) + have : IsFiniteMeasure μ := ⟨by + rw [Measure.restrict_apply_univ, perimeterMeasure_open E Metric.isOpen_ball] + exact hmin.2.1 c R hR⟩ + have hg (b : Euc n) (r : ℝ) (hr : 0 < r) : μ (Metric.ball b r) ≤ + ENNReal.ofReal (A * r ^ ((n - 1 : ℕ) : ℝ)) := by + calc + _ ≤ perimeterMeasure E (Metric.ball b r) := Measure.restrict_apply_le _ _ + _ = perimeter E (Metric.ball b r) := perimeterMeasure_open E Metric.isOpen_ball + _ ≤ _ := by simpa only [Real.rpow_natCast] using hgrowth E hmin b r hr + have hiK := RPIKernel.integrable_kernel_of_growth μ (by linarith : 0 < ((n - 1 : ℕ) : ℝ) - 1) + (by linarith : ((n - 1 : ℕ) : ℝ) - 1 < ((n - 1 : ℕ) : ℝ)) hA.le hg a + have hmG := (measurable_tangentialGradient hmin.1 (hf.of_le (by simp))).aestronglyMeasurable (μ := μ) + obtain ⟨B, hB⟩ := exists_tangentialGradient_ball_bound E c R (hf.of_le (by simp)) + have hiGK : Integrable (fun x ↦ ‖tangentialGradient E f x‖ * + ‖x - a‖ ^ (-(((n - 1 : ℕ) : ℝ) - 1))) μ := by + simpa only [dist_eq_norm] using hiK.bdd_mul hmG.norm + ((ae_restrict_mem measurableSet_ball).mono fun x hx ↦ by simpa only [norm_norm] using hB x hx) + by_cases hfa : f a = 0 + · rw [hfa, mul_zero] + exact integral_nonneg fun x ↦ by positivity + have hfa0 : 0 < f a := lt_of_le_of_ne (hf0 a) (Ne.symm hfa) + have haU : a ∈ Metric.ball c R := hsf (subset_tsupport f (by exact hfa)) + have hnhood : {x | f a / 2 < f x} ∈ 𝓝 a := + hf.continuous.continuousAt.preimage_mem_nhds (Ioi_mem_nhds (by linarith)) + obtain ⟨ε, hε, hεsub⟩ := Metric.mem_nhds_iff.mp + (inter_mem hnhood (Metric.isOpen_ball.mem_nhds haU)) + have hεU : Metric.ball a ε ⊆ Metric.ball c R := fun x hx ↦ (hεsub hx).2 + have hμball : μ (Metric.ball a ε) = perimeter E (Metric.ball a ε) := by + rw [Measure.restrict_apply measurableSet_ball, inter_eq_left.mpr hεU, + perimeterMeasure_open E Metric.isOpen_ball] + have hdens : c₀ * ε ^ ((n - 1 : ℕ) : ℝ) ≤ μ.real (Metric.ball a ε) := by + have ht := ENNReal.toReal_mono (hmin.2.1 a ε hε).ne (hdensity E hmin a ha ε hε) + rw [ENNReal.toReal_ofReal (by positivity)] at ht + simpa only [Measure.real, hμball, Real.rpow_natCast] using ht + have hlci : Integrable (fun x ↦ f x * (n - 1 : ℕ) * + (‖x - a‖ ^ 2 + ε ^ 2) ^ (-((n - 1 : ℕ) : ℝ) / 2 - 1) * ε ^ 2) μ := by + apply ContinuousOn.integrableOn_of_subset_isCompact (s := Metric.ball c R) + (K := Metric.closedBall c R) _ (isCompact_closedBall c R) measurableSet_ball Metric.ball_subset_closedBall + (by rw [perimeterMeasure_open E Metric.isOpen_ball]; exact (hmin.2.1 c R hR).ne) + apply Continuous.continuousOn + apply Continuous.mul _ continuous_const + apply Continuous.mul (hf.continuous.mul continuous_const) + exact (((continuous_id.sub continuous_const).norm.pow 2).add continuous_const).rpow_const + (fun x ↦ Or.inl (by change ‖x - a‖ ^ 2 + ε ^ 2 ≠ 0; positivity)) + have hlow := radial_integral_lower_of_density μ a hε (by linarith : 0 ≤ ((n - 1 : ℕ) : ℝ)) + hc₀.le hdens hf0 (fun x hx ↦ (hεsub hx).1.le) hlci + have hmid := minimizing_radial_integral_bound hn1 hmin c a hR hε hf hcf hsf hf0 + have hmRG : AEStronglyMeasurable (fun x ↦ ‖tangentialGradient E f x‖ * + (radialKernel a ε (n - 1 : ℕ) x * ‖x - a‖)) μ := + hmG.norm.mul (((radialKernel_contDiff a hε _).continuous.mul + (continuous_id.sub continuous_const).norm).aestronglyMeasurable) + have hpoint (x : Euc n) : ‖tangentialGradient E f x‖ * + (radialKernel a ε (n - 1 : ℕ) x * ‖x - a‖) ≤ + ‖tangentialGradient E f x‖ * ‖x - a‖ ^ (-(((n - 1 : ℕ) : ℝ) - 1)) := + mul_le_mul_of_nonneg_left (radialKernel_mul_dist_le a x hε hk) (norm_nonneg _) + have hiRG : Integrable (fun x ↦ ‖tangentialGradient E f x‖ * + (radialKernel a ε (n - 1 : ℕ) x * ‖x - a‖)) μ := + hiGK.mono' hmRG (ae_of_all μ fun x ↦ by + rw [Real.norm_of_nonneg (by positivity [(radialKernel_pos a x hε ((n - 1 : ℕ) : ℝ)).le])] + exact hpoint x) + exact hlow.trans (hmid.trans (integral_mono hiRG hiGK hpoint)) + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +namespace RPIKernel + +theorem lp_average_bound {X : Type*} [MeasurableSpace X] (μ : Measure X) + {p : ℝ} (hp : 1 < p) {f : X → ℝ≥0∞} (hf : AEMeasurable f μ) : + (∫⁻ x, f x ∂μ) ^ p ≤ (∫⁻ x, f x ^ p ∂μ) * (μ univ) ^ (p - 1) := by + have hc := Real.HolderConjugate.conjExponent hp + have hh := ENNReal.lintegral_mul_le_Lp_mul_Lq μ hc hf + (aemeasurable_const (b := (1 : ℝ≥0∞))) + simp only [Pi.mul_apply, mul_one, ENNReal.one_rpow, lintegral_const, one_mul] at hh + have h := ENNReal.rpow_le_rpow hh (by linarith : 0 ≤ p) + rw [ENNReal.mul_rpow_of_nonneg _ _ (by linarith : 0 ≤ p), ← ENNReal.rpow_mul, + ← ENNReal.rpow_mul, div_mul_cancel₀ _ (ne_of_gt (lt_trans zero_lt_one hp)), ENNReal.rpow_one] at h + have he : 1 / p.conjExponent * p = p - 1 := by + calc + _ = p / p.conjExponent := by ring + _ = p - 1 := (div_eq_iff (ne_of_gt hc.symm.pos)).mpr hc.sub_one_mul_conj.symm + rwa [he] at h + +theorem kernel_lp_bound {X Y : Type*} [MeasurableSpace X] [MeasurableSpace Y] + (μ : Measure X) (ν : Measure Y) [SFinite μ] [SFinite ν] + {p : ℝ} (hp : 1 < p) (K : Y → X → ℝ≥0∞) + (hK : Measurable (Function.uncurry K)) (g : X → ℝ≥0∞) (hg : Measurable g) + {C : ℝ≥0∞} (hcol : ∀ x, ∫⁻ y, K y x ^ p ∂ν ≤ C) : + ∫⁻ y, (∫⁻ x, K y x * g x ∂μ) ^ p ∂ν ≤ + C * (∫⁻ x, g x ∂μ) ^ p := by + have hrow (y : Y) : Measurable (K y) := hK.comp ((measurable_const (a := y)).prodMk measurable_id) + have hcolumn (x : X) : Measurable (fun y ↦ K y x) := hK.comp (measurable_id.prodMk (measurable_const (a := x))) + have hm : Measurable (Function.uncurry (fun y x ↦ K y x ^ p * g x)) := (hK.pow_const p).mul (hg.comp measurable_snd) + have hmain (y : Y) := lp_average_bound (μ.withDensity g) hp ((hrow y).aemeasurable) + have hw : (μ.withDensity g) univ = ∫⁻ x, g x ∂μ := by simp + have hpt (y : Y) : (∫⁻ x, K y x * g x ∂μ) ^ p ≤ + (∫⁻ x, K y x ^ p * g x ∂μ) * (∫⁻ x, g x ∂μ) ^ (p - 1) := by + have ht := hmain y + rw [hw, lintegral_withDensity_eq_lintegral_mul μ hg (hrow y), + lintegral_withDensity_eq_lintegral_mul μ hg ((hrow y).pow_const p)] at ht + simpa only [Pi.mul_apply, mul_comm (g _)] using ht + calc + _ ≤ ∫⁻ y, (∫⁻ x, K y x ^ p * g x ∂μ) * (∫⁻ x, g x ∂μ) ^ (p - 1) ∂ν := + lintegral_mono hpt + _ = (∫⁻ x, (∫⁻ y, K y x ^ p ∂ν) * g x ∂μ) * (∫⁻ x, g x ∂μ) ^ (p - 1) := by + rw [lintegral_mul_const _ hm.lintegral_prod_right] + congr 1 + rw [lintegral_lintegral_swap hm.aemeasurable] + apply lintegral_congr + intro x + rw [lintegral_mul_const _ ((hcolumn x).pow_const p)] + _ ≤ (∫⁻ x, C * g x ∂μ) * (∫⁻ x, g x ∂μ) ^ (p - 1) := by + gcongr with x + exact hcol x + _ = _ := by + rw [lintegral_const_mul _ hg] + rw [mul_assoc] + congr 1 + calc + _ = (∫⁻ x, g x ∂μ) ^ (1 : ℝ) * (∫⁻ x, g x ∂μ) ^ (p - 1) := by rw [ENNReal.rpow_one] + _ = (∫⁻ x, g x ∂μ) ^ (1 + (p - 1)) := (ENNReal.rpow_add_of_nonneg _ _ (by norm_num) (by linarith)).symm + _ = _ := by congr 1; ring + +end RPIKernel + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +namespace RPIKernel +open Set Filter MeasureTheory +open scoped ENNReal Topology +variable {X : Type*} + +lemma ofReal_integral_le_lintegral [MetricSpace X] [MeasurableSpace X] [BorelSpace X] + {f : X → ℝ} {μ : Measure X} + (hf : ∀ᵐ x ∂μ, 0 ≤ f x) : + ENNReal.ofReal (∫ x, f x ∂μ) ≤ ∫⁻ x, ENNReal.ofReal (f x) ∂μ := by + by_cases hi : Integrable f μ + · exact (ofReal_integral_eq_lintegral_ofReal hi hf).le + · simp [integral_undef hi] + +variable [MetricSpace X] [MeasurableSpace X] [BorelSpace X] + +theorem exists_potential_lp_bound [SecondCountableTopology X] (μ : Measure X) [IsFiniteMeasure μ] + {d s p A S : ℝ} (hs : 0 < s) (hp : 1 < p) (hsp : s * p < d) + (hA : 0 ≤ A) (hS : 0 < S) + (hgrowth : ∀ a r, 0 < r → μ (Metric.ball a r) ≤ ENNReal.ofReal (A * r ^ d)) : + ∃ C : ℝ≥0∞, C ≠ ⊤ ∧ ∀ f g : X → ℝ, + Measurable g → (∀ x, 0 ≤ g x) → + (∀ᵐ a ∂μ, S * f a ≤ ∫ x, g x * dist x a ^ (-s) ∂μ) → + (∫⁻ a, ENNReal.ofReal (f a) ^ p ∂μ) ≤ C * (∫⁻ x, ENNReal.ofReal (g x) ∂μ) ^ p := by + have hp0 : 0 < p := lt_trans zero_lt_one hp + obtain ⟨B, hB, hcol⟩ := exists_kernel_integral_bound μ (mul_pos hs hp0) hsp hA hgrowth + let K : X → X → ℝ≥0∞ := fun a x ↦ ENNReal.ofReal (dist x a ^ (-s)) + have hmK : Measurable (Function.uncurry K) := + ENNReal.measurable_ofReal.comp ((continuous_snd.dist continuous_fst).measurable.pow_const _) + have hcol' (x : X) : ∫⁻ a, K a x ^ p ∂μ ≤ B := by + calc + _ = ∫⁻ a, ENNReal.ofReal (dist a x ^ (-(s * p))) ∂μ := by + apply lintegral_congr + intro a + dsimp [K] + rw [ENNReal.ofReal_rpow_of_nonneg (Real.rpow_nonneg dist_nonneg _) hp0.le, + ← Real.rpow_mul dist_nonneg, dist_comm] + congr 2 + ring + _ ≤ B := hcol x + let T : ℝ≥0∞ := (ENNReal.ofReal S)⁻¹ ^ p + refine ⟨T * B, ENNReal.mul_ne_top + (ENNReal.rpow_ne_top_of_nonneg hp0.le (ENNReal.inv_ne_top.mpr (ENNReal.ofReal_ne_zero_iff.mpr hS))) hB, ?_⟩ + intro f g hg hg0 hpot + have hrow (a : X) : Measurable (K a) := hmK.comp (measurable_const.prodMk measurable_id) + have hpot' : ∀ᵐ a ∂μ, ENNReal.ofReal (f a) ≤ (ENNReal.ofReal S)⁻¹ * + ∫⁻ x, K a x * ENNReal.ofReal (g x) ∂μ := by + filter_upwards [hpot] with a ha + apply (ENNReal.mul_le_iff_le_inv (ENNReal.ofReal_ne_zero_iff.mpr hS) ENNReal.ofReal_ne_top).mp + calc + _ = ENNReal.ofReal (S * f a) := (ENNReal.ofReal_mul hS.le).symm + _ ≤ ENNReal.ofReal (∫ x, g x * dist x a ^ (-s) ∂μ) := ENNReal.ofReal_le_ofReal ha + _ ≤ ∫⁻ x, ENNReal.ofReal (g x * dist x a ^ (-s)) ∂μ := + ofReal_integral_le_lintegral (ae_of_all _ fun x ↦ mul_nonneg (hg0 x) (Real.rpow_nonneg dist_nonneg _)) + _ = _ := by + apply lintegral_congr + intro x + rw [ENNReal.ofReal_mul (hg0 x), mul_comm] + have hi := kernel_lp_bound μ μ hp K hmK (fun x ↦ ENNReal.ofReal (g x)) hg.ennreal_ofReal hcol' + calc + _ ≤ ∫⁻ a, T * (∫⁻ x, K a x * ENNReal.ofReal (g x) ∂μ) ^ p ∂μ := by + apply lintegral_mono_ae + filter_upwards [hpot'] with a ha + exact (ENNReal.rpow_le_rpow ha hp0.le).trans_eq + (ENNReal.mul_rpow_of_nonneg _ _ hp0.le) + _ = T * ∫⁻ a, (∫⁻ x, K a x * ENNReal.ofReal (g x) ∂μ) ^ p ∂μ := by + rw [lintegral_const_mul _ (((hmK.mul (hg.ennreal_ofReal.comp measurable_snd)).lintegral_prod_right).pow_const p)] + _ ≤ T * (B * (∫⁻ x, ENNReal.ofReal (g x) ∂μ) ^ p) := by gcongr + _ = _ := by rw [mul_assoc] + +end RPIKernel + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +namespace RPISingularHarnack + +theorem minimizing_perimeter_sobolev {n : ℕ} (hn : 2 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (c : Euc n) {R p : ℝ} (hR : 0 < R) (hp : 1 < p) + (hpk : (((n - 1 : ℕ) : ℝ) - 1) * p < (n - 1 : ℕ)) : + ∃ C : ℝ≥0∞, C ≠ ⊤ ∧ ∀ f : Euc n → ℝ, + ContDiff ℝ ∞ f → HasCompactSupport f → tsupport f ⊆ Metric.ball c R → + (∀ x, 0 ≤ f x) → + (∫⁻ x in Metric.ball c R, ENNReal.ofReal (f x) ^ p ∂perimeterMeasure E) ≤ + C * (∫⁻ x in Metric.ball c R, ENNReal.ofReal ‖tangentialGradient E f x‖ ∂perimeterMeasure E) ^ p := by + obtain ⟨S, hS, hpot⟩ := exists_minimizing_riesz_potential_constant n hn + obtain ⟨A, hA, hg⟩ := exists_locallyMinimizing_perimeter_growth_constant n (by omega) + let μ := (perimeterMeasure E).restrict (Metric.ball c R) + let : IsFiniteMeasure μ := ⟨by + rw [Measure.restrict_apply_univ, perimeterMeasure_open E Metric.isOpen_ball] + exact hmin.2.1 c R hR⟩ + have hgrowth (a : Euc n) (r : ℝ) (hr : 0 < r) : μ (Metric.ball a r) ≤ + ENNReal.ofReal (A * r ^ ((n - 1 : ℕ) : ℝ)) := by + calc + _ ≤ perimeterMeasure E (Metric.ball a r) := Measure.restrict_apply_le _ _ + _ = perimeter E (Metric.ball a r) := perimeterMeasure_open E Metric.isOpen_ball + _ ≤ _ := by simpa only [Real.rpow_natCast] using hg E hmin a r hr + have hk : (1 : ℝ) < (n - 1 : ℕ) := by exact_mod_cast (show 1 < n - 1 by omega) + obtain ⟨C, hC, hbound⟩ := RPIKernel.exists_potential_lp_bound μ + (by linarith : 0 < ((n - 1 : ℕ) : ℝ) - 1) hp hpk hA.le hS hgrowth + refine ⟨C, hC, ?_⟩ + intro f hf hcf hsf hf0 + apply hbound f (fun x ↦ ‖tangentialGradient E f x‖) + (measurable_tangentialGradient hmin.1 (hf.of_le (by simp))).norm (fun _ ↦ norm_nonneg _) + have hs : ∀ᵐ x ∂perimeterMeasure E, x ∈ perimeterSupport E := by + rw [← perimeterMeasure_support]; exact (perimeterMeasure E).support_mem_ae + filter_upwards [ae_restrict_of_ae hs] with a ha + simpa only [dist_eq_norm] using hpot E hmin c R hR f hf hcf hsf hf0 a ha + +theorem minimizing_perimeter_boundaryArea_comparison {n : ℕ} (hn : 1 < n) : + ∃ C D : ℝ≥0∞, C ≠ 0 ∧ C ≠ ⊤ ∧ D ≠ 0 ∧ D ≠ ⊤ ∧ + ∀ E : Set (Euc n), IsLocallyPerimeterMinimizing E → + perimeterMeasure E ≤ C • boundaryArea E ∧ boundaryArea E ≤ D • perimeterMeasure E := by + obtain ⟨C, D, hC0, hCt, hD0, hDt, hb⟩ := minimizing_perimeter_hausdorff_comparison hn + let b : ℝ≥0∞ := volume (Metric.ball (0 : Euc (n - 1)) 1) / 2 ^ (n - 1) + have hb0 : b ≠ 0 := ENNReal.div_ne_zero.mpr ⟨ + (Metric.measure_ball_pos volume 0 (by norm_num : (0 : ℝ) < 1)).ne', ENNReal.pow_ne_top (by norm_num)⟩ + have hbt : b ≠ ⊤ := ENNReal.div_ne_top measure_ball_ne_top (pow_ne_zero _ (by norm_num)) + refine ⟨C * b⁻¹, b * D, mul_ne_zero hC0 (ENNReal.inv_ne_zero.mpr hbt), + ENNReal.mul_ne_top hCt (ENNReal.inv_ne_top.mpr hb0), mul_ne_zero hb0 hD0, + ENNReal.mul_ne_top hbt hDt, ?_⟩ + intro E hmin + have he : boundaryArea E = b • ((Measure.hausdorffMeasure (n - 1 : ℕ)).restrict (perimeterSupport E)) := by + rw [boundaryArea, geometricHausdorff, Measure.restrict_smul] + constructor + · rw [he, smul_smul, mul_assoc, ENNReal.inv_mul_cancel hb0 hbt, mul_one] + exact (hb E hmin).1 + · rw [he] + apply Measure.le_iff.mpr + intro s hs + simp only [Measure.smul_apply, smul_eq_mul] + calc + _ ≤ b * (D * perimeterMeasure E s) := by + gcongr + exact Measure.le_iff.mp (hb E hmin).2 s hs + _ = _ := by rw [mul_assoc] + +theorem minimizing_boundaryArea_sobolev {n : ℕ} (hn : 2 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (c : Euc n) {R p : ℝ} (hR : 0 < R) (hp : 1 < p) + (hpk : (((n - 1 : ℕ) : ℝ) - 1) * p < (n - 1 : ℕ)) : + ∃ C : ℝ≥0∞, C ≠ ⊤ ∧ ∀ f : Euc n → ℝ, + ContDiff ℝ ∞ f → HasCompactSupport f → tsupport f ⊆ Metric.ball c R → + (∀ x, 0 ≤ f x) → + (∫⁻ x in Metric.ball c R, ENNReal.ofReal (f x) ^ p ∂boundaryArea E) ≤ + C * (∫⁻ x in Metric.ball c R, ENNReal.ofReal ‖tangentialGradient E f x‖ ∂boundaryArea E) ^ p := by + obtain ⟨B, hB, hb⟩ := minimizing_perimeter_sobolev hn hmin c hR hp hpk + obtain ⟨D₁, D₂, _, hD₁, _, hD₂, hd⟩ := minimizing_perimeter_boundaryArea_comparison (by omega : 1 < n) + have hμ₁ := Measure.restrict_mono_measure (hd E hmin).1 (Metric.ball c R) + have hμ₂ := Measure.restrict_mono_measure (hd E hmin).2 (Metric.ball c R) + rw [Measure.restrict_smul] at hμ₁ hμ₂ + have hp0 : 0 ≤ p := (lt_trans zero_lt_one hp).le + refine ⟨D₂ * B * D₁ ^ p, + ENNReal.mul_ne_top (ENNReal.mul_ne_top hD₂ hB) (ENNReal.rpow_ne_top_of_nonneg hp0 hD₁), ?_⟩ + intro f hf hcf hsf hf0 + have hgrad : (∫⁻ x in Metric.ball c R, ENNReal.ofReal ‖tangentialGradient E f x‖ ∂perimeterMeasure E) ≤ + D₁ * (∫⁻ x in Metric.ball c R, ENNReal.ofReal ‖tangentialGradient E f x‖ ∂boundaryArea E) := by + simpa only [lintegral_smul_measure, smul_eq_mul] using lintegral_mono' hμ₁ (le_refl (fun x ↦ ENNReal.ofReal ‖tangentialGradient E f x‖)) + calc + _ ≤ D₂ * (∫⁻ x in Metric.ball c R, ENNReal.ofReal (f x) ^ p ∂perimeterMeasure E) := by + simpa only [lintegral_smul_measure, smul_eq_mul] using lintegral_mono' hμ₂ (le_refl (fun x ↦ ENNReal.ofReal (f x) ^ p)) + _ ≤ D₂ * (B * (∫⁻ x in Metric.ball c R, ENNReal.ofReal ‖tangentialGradient E f x‖ ∂perimeterMeasure E) ^ p) := by + gcongr + exact hb f hf hcf hsf hf0 + _ ≤ D₂ * (B * (D₁ * (∫⁻ x in Metric.ball c R, ENNReal.ofReal ‖tangentialGradient E f x‖ ∂boundaryArea E)) ^ p) := by + gcongr + _ = _ := by rw [ENNReal.mul_rpow_of_nonneg _ _ hp0]; ac_rfl + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/FiberAveraging.lean b/lean/OAI/Geometry/Perimeter/Regularity/FiberAveraging.lean new file mode 100644 index 0000000000000000000000000000000000000000..570eb17f6ed4b53808eacd20c71fcc0871428435 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/FiberAveraging.lean @@ -0,0 +1,125 @@ +import OAI.Geometry.Perimeter.Regularity.EllipticLocality + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff Convolution +namespace RPISingularHarnack +open RPI.Boundary + +def normalFiberAverage {n : ℕ} (v : Euc n) (f : Euc n → ℝ) (x : Euc n) : ℝ := + ∫ s : ℝ, f (x+s•v) + +theorem normalFiberAverage_stronglyMeasurable {n : ℕ} {f : Euc n → ℝ} + (hf : Measurable f) (v : Euc n) : StronglyMeasurable (normalFiberAverage v f) := by + apply StronglyMeasurable.integral_prod_right + exact (hf.comp (continuous_fst.add (continuous_snd.smul continuous_const)).measurable).stronglyMeasurable + +theorem normalFiberAverage_add_smul {n : ℕ} (v : Euc n) (f : Euc n → ℝ) + (x : Euc n) (t : ℝ) : + normalFiberAverage v f (x+t•v) = normalFiberAverage v f x := by + unfold normalFiberAverage + have heq : (fun s : ℝ ↦ f (x+t•v+s•v)) = (fun s : ℝ ↦ f (x+(s+t)•v)) := by + funext s + congr 1 + rw [add_smul] + abel + rw [heq] + exact integral_add_right_eq_self (fun s : ℝ ↦ f (x+s•v)) t + +theorem fiber_support_subset_interval {n : ℕ} {f : Euc n → ℝ} + {v : Euc n} (hv : ‖v‖ = 1) {R : ℝ} + (hs : Function.support f ⊆ Metric.ball 0 R) (x : Euc n) : + Function.support (fun s : ℝ ↦ f (x+s•v)) ⊆ Icc (-(R+‖x‖)) (R+‖x‖) := by + intro s hs' + have hx := hs hs' + rw [Metric.mem_ball, dist_zero_right] at hx + have he : |s| = ‖s•v‖ := by rw [norm_smul, hv, mul_one, Real.norm_eq_abs] + have hl : |s| ≤ R+‖x‖ := by + rw [he] + calc + ‖s•v‖ = ‖(x+s•v)-x‖ := by congr 1; abel + _ ≤ ‖x+s•v‖+‖x‖ := norm_sub_le _ _ + _ ≤ R+‖x‖ := by linarith + exact abs_le.mp hl + +theorem integrable_fiber_of_bounded {n : ℕ} {f : Euc n → ℝ} + (hf : Measurable f) {v : Euc n} (hv : ‖v‖ = 1) {R : ℝ} + (hs : Function.support f ⊆ Metric.ball 0 R) {C : ℝ} + (hb : ∀ x, ‖f x‖ ≤ C) (x : Euc n) : + Integrable (fun s : ℝ ↦ f (x+s•v)) volume := by + let I := Icc (-(R+‖x‖)) (R+‖x‖) + have hI : Integrable (I.indicator (fun _ ↦ C)) volume := + continuous_const.integrableOn_Icc.integrable_indicator measurableSet_Icc + apply hI.mono' (hf.comp (continuous_const.add (continuous_id.smul continuous_const)).measurable).aestronglyMeasurable + apply ae_of_all + intro s + by_cases hsI : s ∈ I + · simpa [hsI] using hb (x+s•v) + · rw [indicator_of_notMem hsI] + have hz : f (x+s•v) = 0 := by + by_contra hz + exact hsI (fiber_support_subset_interval hv hs x hz) + simp [hz] + +theorem normalFiberAverage_translation_le {n : ℕ} {f : Euc n → ℝ} + (hf : Measurable f) {v : Euc n} (hv : ‖v‖ = 1) {R : ℝ} (hR : 0 < R) + (hs : Function.support f ⊆ Metric.ball 0 R) {C : ℝ} + (hb : ∀ x, ‖f x‖ ≤ C) {S : ℝ} (hS : 0 < S) (w : Euc n) : + (∫⁻ x in Metric.ball (0:Euc n) S, + ‖normalFiberAverage v f (x+w)-normalFiberAverage v f x‖ₑ) ≤ + ENNReal.ofReal (2*(R+S+‖w‖)) * ∫⁻ x, ‖f (x+w)-f x‖ₑ := by + let T := R+S+‖w‖ + have hT : 0 < T := add_pos_of_pos_of_nonneg (add_pos hR hS) (norm_nonneg w) + let I := Icc (-T) T + let B := Metric.ball (0:Euc n) S + have hxI (x : Euc n) (hx : x ∈ B) : + Function.support (fun s : ℝ ↦ ‖f (x+w+s•v)-f (x+s•v)‖ₑ) ⊆ I := by + intro s hs' + have hx' : ‖x‖ < S := by simpa only [B, Metric.mem_ball, dist_zero_right] using hx + have hzero (y : Euc n) (hy : ‖y‖ ≤ S+‖w‖) (hns : s ∉ I) : f (y+s•v) = 0 := by + by_contra hz + have ht := fiber_support_subset_interval hv hs y hz + exact hns (Icc_subset_Icc (by dsimp [T]; linarith) (by dsimp [T]; linarith) ht) + by_contra hns + have h₁ := hzero (x+w) ((norm_add_le x w).trans (by linarith)) hns + have h₂ := hzero x (hx'.le.trans (le_add_of_nonneg_right (norm_nonneg w))) hns + simp only [Function.mem_support, ne_eq, h₁, h₂, sub_self, enorm_zero, not_true_eq_false] at hs' + have hm : Measurable (fun p : Euc n × ℝ ↦ ‖f (p.1+w+p.2•v)-f (p.1+p.2•v)‖ₑ) := + ((hf.comp ((continuous_fst.add continuous_const).add + (continuous_snd.smul continuous_const)).measurable).sub + (hf.comp (continuous_fst.add (continuous_snd.smul continuous_const)).measurable)).enorm + calc + _ ≤ ∫⁻ x in B, ∫⁻ s in I, ‖f (x+w+s•v)-f (x+s•v)‖ₑ := by + apply lintegral_mono_ae + filter_upwards [ae_restrict_mem measurableSet_ball] with x hx + rw [normalFiberAverage, normalFiberAverage, + ← integral_sub (integrable_fiber_of_bounded hf hv hs hb (x+w)) + (integrable_fiber_of_bounded hf hv hs hb x)] + rw [setLIntegral_eq_of_support_subset (hxI x hx)] + exact enorm_integral_le_lintegral_enorm _ + _ ≤ ∫⁻ x, ∫⁻ s in I, ‖f (x+w+s•v)-f (x+s•v)‖ₑ := + setLIntegral_le_lintegral _ _ + _ = ∫⁻ s in I, ∫⁻ x, ‖f (x+w+s•v)-f (x+s•v)‖ₑ := + lintegral_lintegral_swap hm.aemeasurable + _ = ENNReal.ofReal (2*T) * ∫⁻ x, ‖f (x+w)-f x‖ₑ := by + have he (s : ℝ) : (∫⁻ x, ‖f (x+w+s•v)-f (x+s•v)‖ₑ) = + ∫⁻ x, ‖f (x+w)-f x‖ₑ := by + have heq : (fun x ↦ ‖f (x+w+s•v)-f (x+s•v)‖ₑ) = + (fun x ↦ ‖f ((x+s•v)+w)-f (x+s•v)‖ₑ) := by + funext x + congr 3 + abel + rw [heq] + exact lintegral_add_right_eq_self (fun x : Euc n ↦ ‖f (x+w)-f x‖ₑ) (s•v) + simp_rw [he] + simp only [lintegral_const, Measure.restrict_apply_univ, I] + rw [← uIcc_of_le (show -T ≤ T by linarith [hT]), Real.volume_interval, + sub_neg_eq_add, ← two_mul, abs_of_pos (mul_pos (by norm_num) hT), mul_comm] + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/FiberCompactness.lean b/lean/OAI/Geometry/Perimeter/Regularity/FiberCompactness.lean new file mode 100644 index 0000000000000000000000000000000000000000..f1bbc548a30a3532942a34f4094075a23396c96e --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/FiberCompactness.lean @@ -0,0 +1,411 @@ +import OAI.Geometry.Perimeter.Regularity.FlatExcess +import OAI.Geometry.Perimeter.Regularity.FiberHeight +import OAI.Geometry.Perimeter.Regularity.HalfspaceHorizontal + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff Convolution +namespace RPISingularHarnack +open RPI.Boundary ContinuousLinearMap + +theorem integral_phase_error_mul {n : ℕ} {E H : Set (Euc n)} + (hE : MeasurableSet E) (hH : MeasurableSet H) {g : Euc n → ℝ} + (hg : Integrable g volume) : + (∫ x, (E.indicator (fun _ ↦ (1:ℝ)) x - H.indicator (fun _ ↦ (1:ℝ)) x) * g x) = + (∫ x in E, g x) - ∫ x in H, g x := by + have heq : (fun x ↦ (E.indicator (fun _ ↦ (1:ℝ)) x - + H.indicator (fun _ ↦ (1:ℝ)) x) * g x) = E.indicator g - H.indicator g := by + funext x + by_cases hxE : x ∈ E <;> by_cases hxH : x ∈ H <;> simp [hxE,hxH] + rw [heq] + change (∫ x, E.indicator g x - H.indicator g x) = _ + rw [integral_sub (hg.indicator hE) (hg.indicator hH), + integral_indicator hE, integral_indicator hH] + +theorem integrable_phase_error_mul {n : ℕ} {E H : Set (Euc n)} + (hE : MeasurableSet E) (hH : MeasurableSet H) {g : Euc n → ℝ} + (hg : Integrable g volume) : + Integrable (fun x ↦ (E.indicator (fun _ ↦ (1:ℝ)) x - + H.indicator (fun _ ↦ (1:ℝ)) x) * g x) volume := by + convert (hg.indicator hE).sub (hg.indicator hH) using 1 + funext x + by_cases hxE : x ∈ E <;> by_cases hxH : x ∈ H <;> simp [hxE,hxH] + +theorem cutoffPhaseError_distribution {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + {v w : Euc n} (_hv : ‖v‖ = 1) (hw : inner ℝ v w = 0) + {η φ : Euc n → ℝ} (hη : ContDiff ℝ ∞ η) (hc : HasCompactSupport η) + (hφ : ContDiff ℝ ∞ φ) {R : ℝ} (hR : 0 < R) + (hs : tsupport η ⊆ Metric.ball 0 R) : + -(∫ x, cutoffPhaseError E v η x * fderiv ℝ φ x w) = + (∫ x, (E.indicator (fun _ ↦ (1:ℝ)) x - + {z | inner ℝ v z < 0}.indicator (fun _ ↦ (1:ℝ)) x) * + (φ x * fderiv ℝ η x w)) - + ∫ x in Metric.ball 0 R, φ x * (η x * inner ℝ (approximateNormal E x) w) + ∂perimeterMeasure E := by + let H : Set (Euc n) := {x | inner ℝ v x < 0} + have heH : H = {x | inner ℝ x v < 0} := by ext x; simp only [H, real_inner_comm] + have hHm : MeasurableSet H := (isOpen_lt (continuous_const.inner continuous_id) + continuous_const).measurableSet + have hηd := hη.differentiable (by simp) + have hφd := hφ.differentiable (by simp) + have hdi : Integrable (fun x ↦ η x * fderiv ℝ φ x w) volume := + (hη.continuous.mul ((hφ.continuous_fderiv (by simp)).clm_apply continuous_const)).integrable_of_hasCompactSupport + hc.mul_right + have hdi' : Integrable (fun x ↦ φ x * fderiv ℝ η x w) volume := + (hφ.continuous.mul ((hη.continuous_fderiv (by simp)).clm_apply continuous_const)).integrable_of_hasCompactSupport + (hc.fderiv_apply ℝ w).mul_left + have hprod (x : Euc n) : fderiv ℝ (fun y ↦ η y * φ y) x w = + η x * fderiv ℝ φ x w + φ x * fderiv ℝ η x w := by + rw [fderiv_fun_mul (hηd x) (hφd x)] + rfl + have hgg : (∫ x in E, fderiv ℝ (fun y ↦ η y * φ y) x w) = + ∫ x in Metric.ball 0 R, φ x * (η x * inner ℝ (approximateNormal E x) w) + ∂perimeterMeasure E := by + rw [← divergence_scalar_direction ((hη.mul hφ).differentiable (by simp)) w, + minimizing_gaussGreen_local hn hmin (Metric.ball 0 R) Metric.isOpen_ball + (hmin.2.1 0 R hR).ne (fun y ↦ (η y * φ y) • w) ((hη.mul hφ).smul contDiff_const) + hc.mul_right.smul_right + (tsupport_smul_subset_left _ _ |>.trans (tsupport_mul_subset_left.trans hs))] + apply integral_congr_ae + exact ae_of_all _ fun x ↦ by simp only [real_inner_smul_right]; ring + have hzero : (∫ x in H, fderiv ℝ (fun y ↦ η y * φ y) x w) = 0 := by + rw [heH] + exact halfspace_horizontal_integral hw (hη.mul hφ) hc.mul_right + simp_rw [hprod] at hgg hzero + rw [integral_add hdi.integrableOn hdi'.integrableOn] at hgg hzero + have hleft : (∫ x, cutoffPhaseError E v η x * fderiv ℝ φ x w) = + (∫ x in E, η x * fderiv ℝ φ x w) - ∫ x in H, η x * fderiv ℝ φ x w := by + rw [← integral_phase_error_mul hmin.1 hHm hdi] + apply integral_congr_ae + exact ae_of_all _ fun x ↦ by unfold cutoffPhaseError; dsimp [H]; ring + rw [hleft, integral_phase_error_mul hmin.1 hHm hdi'] + linarith + +theorem cutoffPhaseError_convolution_fderiv {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + {v w : Euc n} (hv : ‖v‖ = 1) (hw : inner ℝ v w = 0) + {η k : Euc n → ℝ} (hη : ContDiff ℝ ∞ η) (hc : HasCompactSupport η) + (hk : ContDiff ℝ ∞ k) (hck : HasCompactSupport k) {R : ℝ} (hR : 0 < R) + (hs : tsupport η ⊆ Metric.ball 0 R) (x : Euc n) : + fderiv ℝ (cutoffPhaseError E v η ⋆[lsmul ℝ ℝ, volume] k) x w = + ((fun y ↦ (E.indicator (fun _ ↦ (1:ℝ)) y - + {z | inner ℝ v z < 0}.indicator (fun _ ↦ (1:ℝ)) y) * fderiv ℝ η y w) + ⋆[lsmul ℝ ℝ, volume] k) x - + ((fun y ↦ η y * inner ℝ (approximateNormal E y) w) + ⋆[lsmul ℝ ℝ, (perimeterMeasure E).restrict (Metric.ball 0 R)] k) x := by + let f := cutoffPhaseError E v η + have hfi : Integrable f volume := by + have hi := integrable_phase_error_mul (H := {z | inner ℝ v z < 0}) hmin.1 + ((isOpen_lt (continuous_const.inner continuous_id) continuous_const).measurableSet) + (hη.continuous.integrable_of_hasCompactSupport hc) + change Integrable (fun y ↦ η y * (E.indicator (fun _ ↦ (1:ℝ)) y - + {z | inner ℝ v z < 0}.indicator (fun _ ↦ (1:ℝ)) y)) volume + simpa only [mul_comm] using hi + let φ : Euc n → ℝ := fun y ↦ k (x-y) + have hφ : ContDiff ℝ ∞ φ := hk.comp (contDiff_const.sub contDiff_id) + have hd (y : Euc n) : fderiv ℝ φ y w = -fderiv ℝ k (x-y) w := by + have h := ((hk.differentiable (by simp) (x-y)).hasFDerivAt.comp y + ((hasFDerivAt_const x y).sub (hasFDerivAt_id y))).fderiv + simpa only [φ, Function.comp_def, sub_apply, zero_apply, id_apply, + zero_sub, ContinuousLinearMap.comp_apply, neg_apply, map_neg] using + congrArg (fun L : Euc n →L[ℝ] ℝ ↦ L w) h + have hdconv : fderiv ℝ (f ⋆[lsmul ℝ ℝ, volume] k) x w = + -(∫ y, f y * fderiv ℝ φ y w) := by + rw [(hck.hasFDerivAt_convolution_right (lsmul ℝ ℝ) hfi.locallyIntegrable + (hk.of_le (by simp)) x).fderiv, + convolution_precompR_apply (lsmul ℝ ℝ) hfi.locallyIntegrable (hck.fderiv ℝ) + (hk.continuous_fderiv (by simp))] + simp_rw [hd, mul_neg] + rw [integral_neg, neg_neg] + rfl + rw [hdconv, cutoffPhaseError_distribution hn hmin hv hw hη hc hφ hR hs] + congr 1 <;> apply integral_congr_ae <;> exact ae_of_all _ fun y ↦ by + change _ = _ * k (x-y) + dsimp [φ] + ring + +theorem integral_abs_convolution_le {n : ℕ} (μ : Measure (Euc n)) [SFinite μ] + {f k : Euc n → ℝ} (hf : Integrable f μ) (hk : Integrable k volume) : + (∫ x, |(f ⋆[lsmul ℝ ℝ, μ] k) x|) ≤ + (∫ y, |f y| ∂μ) * ∫ x, |k x| := by + have hi := (hf.convolution_integrand (lsmul ℝ ℝ) hk).integral_prod_left + have hi' := (hf.abs.convolution_integrand (lsmul ℝ ℝ) hk.abs).integral_prod_left + calc + _ ≤ ∫ x, ((fun y ↦ |f y|) ⋆[lsmul ℝ ℝ, μ] (fun y ↦ |k y|)) x := by + apply integral_mono hi.abs hi' + intro x + change |∫ y, f y * k (x-y) ∂μ| ≤ ∫ y, |f y| * |k (x-y)| ∂μ + simpa only [abs_mul] using (abs_integral_le_integral_abs (f := fun y ↦ f y * k (x-y)) (μ := μ)) + _ = _ := integral_convolution (lsmul ℝ ℝ) hf.abs hk.abs + +theorem smooth_directional_translation_lintegral_le {n : ℕ} {u : Euc n → ℝ} + (hu : ContDiff ℝ 1 u) (a : Euc n) : + (∫⁻ x, ‖u (x+a)-u x‖ₑ) ≤ ∫⁻ x, ‖fderiv ℝ u x a‖ₑ := by + have hfd := hu.continuous_fderiv one_ne_zero + have hpoint (x : Euc n) : ‖u (x+a)-u x‖ₑ ≤ + ∫⁻ t in Ioc (0:ℝ) 1, ‖fderiv ℝ u (x+t•a) a‖ₑ := by + have hd (t : ℝ) : HasDerivAt (fun s : ℝ ↦ u (x+s•a)) + (fderiv ℝ u (x+t•a) a) t := by + simpa only [Function.comp_def, id_eq, one_smul] using + (hu.differentiable one_ne_zero (x+t•a)).hasFDerivAt.comp_hasDerivAt t + (HasDerivAt.const_add x ((hasDerivAt_id t).smul_const a)) + have hi : IntervalIntegrable (fun t : ℝ ↦ fderiv ℝ u (x+t•a) a) volume 0 1 := + ((hfd.comp (continuous_const.add (continuous_id.smul continuous_const))).clm_apply + continuous_const).intervalIntegrable _ _ + have he := intervalIntegral.integral_eq_sub_of_hasDerivAt (fun t _ ↦ hd t) hi + simp only [one_smul, zero_smul, add_zero] at he + rw [← he, intervalIntegral.integral_of_le (by norm_num : (0:ℝ) ≤ 1)] + exact enorm_integral_le_lintegral_enorm _ + have hm : Measurable (fun p : Euc n × ℝ ↦ ‖fderiv ℝ u (p.1+p.2•a) a‖ₑ) := + ((hfd.comp (continuous_fst.add (continuous_snd.smul continuous_const))).clm_apply + continuous_const).enorm.measurable + calc + _ ≤ ∫⁻ x, ∫⁻ t in Ioc (0:ℝ) 1, ‖fderiv ℝ u (x+t•a) a‖ₑ := lintegral_mono hpoint + _ = ∫⁻ t in Ioc (0:ℝ) 1, ∫⁻ x, ‖fderiv ℝ u (x+t•a) a‖ₑ := + lintegral_lintegral_swap hm.aemeasurable + _ = ∫⁻ t in Ioc (0:ℝ) 1, ∫⁻ x, ‖fderiv ℝ u x a‖ₑ := by + apply lintegral_congr + intro t + exact lintegral_add_right_eq_self (fun x : Euc n ↦ ‖fderiv ℝ u x a‖ₑ) (t•a) + _ = _ := by simp + +theorem minimizing_normal_scalar_integrable {n : ℕ} {E : Set (Euc n)} + (hmin : IsLocallyPerimeterMinimizing E) {η : Euc n → ℝ} + (hη : Continuous η) (hc : HasCompactSupport η) (w : Euc n) + {c : Euc n} {R : ℝ} (hR : 0 < R) : + Integrable (fun x ↦ η x * inner ℝ (approximateNormal E x) w) + ((perimeterMeasure E).restrict (Metric.ball c R)) := by + let μ := (perimeterMeasure E).restrict (Metric.ball c R) + have : IsFiniteMeasure μ := ⟨by + rw [Measure.restrict_apply_univ, perimeterMeasure_open E Metric.isOpen_ball] + exact hmin.2.1 c R hR⟩ + obtain ⟨M,hM⟩ := hc.exists_bound_of_continuous hη + have hM0 : 0 ≤ M := (norm_nonneg (η c)).trans (hM c) + apply Integrable.of_bound + (hη.aestronglyMeasurable.mul + ((measurable_approximateNormal hmin.1).inner measurable_const).aestronglyMeasurable) + (M*‖w‖) + apply ae_of_all μ + intro x + change ‖η x * inner ℝ (approximateNormal E x) w‖ ≤ _ + rw [norm_mul] + have hb : ‖inner ℝ (approximateNormal E x) w‖ ≤ ‖w‖ := + (norm_inner_le_norm (𝕜 := ℝ) _ _).trans (by + simpa only [one_mul] using mul_le_mul_of_nonneg_right + (approximateNormal_norm_le_one E x) (norm_nonneg w)) + exact mul_le_mul (hM x) hb (norm_nonneg _) hM0 + +theorem cutoffPhaseError_convolution_variation_le {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + {v w : Euc n} (hv : ‖v‖ = 1) (hw : inner ℝ v w = 0) + {η k : Euc n → ℝ} (hη : ContDiff ℝ ∞ η) (hc : HasCompactSupport η) + (hk : ContDiff ℝ ∞ k) (hck : HasCompactSupport k) {R : ℝ} (hR : 0 < R) + (hs : tsupport η ⊆ Metric.ball 0 R) : + (∫ x, |fderiv ℝ (cutoffPhaseError E v η ⋆[lsmul ℝ ℝ, volume] k) x w|) ≤ + ((∫ x, |(E.indicator (fun _ ↦ (1:ℝ)) x - + {z | inner ℝ v z < 0}.indicator (fun _ ↦ (1:ℝ)) x) * fderiv ℝ η x w|) + + ∫ x in Metric.ball 0 R, |η x * inner ℝ (approximateNormal E x) w| + ∂perimeterMeasure E) * ∫ x, |k x| := by + let μ := (perimeterMeasure E).restrict (Metric.ball 0 R) + have : IsFiniteMeasure μ := ⟨by + rw [Measure.restrict_apply_univ, perimeterMeasure_open E Metric.isOpen_ball] + exact hmin.2.1 0 R hR⟩ + let g : Euc n → ℝ := fun x ↦ (E.indicator (fun _ ↦ (1:ℝ)) x - + {z | inner ℝ v z < 0}.indicator (fun _ ↦ (1:ℝ)) x) * fderiv ℝ η x w + let q : Euc n → ℝ := fun x ↦ η x * inner ℝ (approximateNormal E x) w + have hg : Integrable g volume := integrable_phase_error_mul hmin.1 + (isOpen_lt (continuous_const.inner continuous_id) continuous_const).measurableSet + (((hη.continuous_fderiv (by simp)).clm_apply continuous_const).integrable_of_hasCompactSupport + (hc.fderiv_apply ℝ w)) + have hq : Integrable q μ := minimizing_normal_scalar_integrable hmin hη.continuous hc w hR + have hki : Integrable k volume := hk.continuous.integrable_of_hasCompactSupport hck + have hgk : Integrable (g ⋆[lsmul ℝ ℝ, volume] k) volume := + (hg.convolution_integrand (lsmul ℝ ℝ) hki).integral_prod_left + have hqk : Integrable (q ⋆[lsmul ℝ ℝ, μ] k) volume := + (hq.convolution_integrand (lsmul ℝ ℝ) hki).integral_prod_left + simp_rw [cutoffPhaseError_convolution_fderiv hn hmin hv hw hη hc hk hck hR hs] + calc + _ ≤ (∫ x, |(g ⋆[lsmul ℝ ℝ, volume] k) x|) + + ∫ x, |(q ⋆[lsmul ℝ ℝ, μ] k) x| := by + rw [← integral_add hgk.abs hqk.abs] + apply integral_mono (hgk.sub hqk).abs (hgk.abs.add hqk.abs) + intro x + exact abs_sub _ _ + _ ≤ (∫ x, |g x|) * (∫ x, |k x|) + (∫ x, |q x| ∂μ) * ∫ x, |k x| := + add_le_add (integral_abs_convolution_le volume hg hki) (integral_abs_convolution_le μ hq hki) + _ = _ := by rw [← add_mul] + +theorem localizedPhaseError_integrable {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) (v : Euc n) (R : ℝ) : + Integrable (localizedPhaseError E v R) volume := by + rw [localizedPhaseError, integrable_indicator_iff measurableSet_ball] + apply (integrableOn_const measure_ball_lt_top.ne (C := (1:ℝ))).mono' + (((measurable_const.indicator hE).sub + (measurable_const.indicator (isOpen_lt (continuous_const.inner continuous_id) + continuous_const).measurableSet)).aestronglyMeasurable.restrict) + exact ae_of_all _ fun x ↦ by + by_cases hxE : x ∈ E <;> by_cases hxH : inner ℝ v x < 0 <;> simp [hxE,hxH] + +theorem phase_error_cutoff_derivative_le {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) (v w : Euc n) + {η : Euc n → ℝ} (hη : ContDiff ℝ ∞ η) (hc : HasCompactSupport η) + {R L : ℝ} (hs : tsupport η ⊆ Metric.ball 0 R) (hL : 0 ≤ L) + (hgrad : ∀ x ∈ Metric.ball 0 R, ‖gradient η x‖ ≤ L) : + (∫ x, |(E.indicator (fun _ ↦ (1:ℝ)) x - + {z | inner ℝ v z < 0}.indicator (fun _ ↦ (1:ℝ)) x) * fderiv ℝ η x w|) ≤ + (L * ‖w‖) * ∫ x, |localizedPhaseError E v R x| := by + have hi := integrable_phase_error_mul (H := {z | inner ℝ v z < 0}) hE + (isOpen_lt (continuous_const.inner continuous_id) continuous_const).measurableSet + (((hη.continuous_fderiv (by simp)).clm_apply continuous_const).integrable_of_hasCompactSupport + (hc.fderiv_apply ℝ w)) + rw [← integral_const_mul] + apply integral_mono hi.abs ((localizedPhaseError_integrable hE v R).abs.const_mul _) + intro x + dsimp only + by_cases hx : x ∈ Metric.ball (0:Euc n) R + · have hd : |fderiv ℝ η x w| ≤ L * ‖w‖ := by + have he : ‖gradient η x‖ = ‖fderiv ℝ η x‖ := + (InnerProductSpace.toDual ℝ (Euc n)).symm.norm_map _ + exact (ContinuousLinearMap.le_opNorm _ _).trans + (mul_le_mul_of_nonneg_right (he ▸ hgrad x hx) (norm_nonneg _)) + rw [abs_mul] + simpa only [localizedPhaseError, indicator_of_mem hx, mul_comm] using + mul_le_mul_of_nonneg_left hd + (abs_nonneg (E.indicator (fun _ ↦ (1:ℝ)) x - + {z | inner ℝ v z < 0}.indicator (fun _ ↦ (1:ℝ)) x)) + · have hn : x ∉ tsupport η := fun h ↦ hx (hs h) + rw [fderiv_of_notMem_tsupport ℝ hn] + simp only [zero_apply, mul_zero, abs_zero] + positivity + +theorem cutoffPhaseError_convolution_height_variation {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + {v w : Euc n} (hv : ‖v‖ = 1) (hw : inner ℝ v w = 0) + {η k : Euc n → ℝ} (hη : ContDiff ℝ ∞ η) (hc : HasCompactSupport η) + (hk : ContDiff ℝ ∞ k) (hck : HasCompactSupport k) {R : ℝ} (hR : 0 < R) + (hs : tsupport η ⊆ Metric.ball 0 R) + {a L : ℝ} (ha : 0 ≤ a) (hL : 0 ≤ L) + (hheight : ∀ x ∈ perimeterSupport E ∩ Metric.ball 0 R, |inner ℝ v x| ≤ a) + (hgrad : ∀ x ∈ Metric.ball 0 R, ‖gradient η x‖ ≤ L) + (hphase : ∀ᵐ x ∂volume, x ∈ Metric.ball 0 R → a < |inner ℝ v x| → + (x ∈ E ↔ inner ℝ v x < 0)) : + (∫ x, |fderiv ℝ (cutoffPhaseError E v η ⋆[lsmul ℝ ℝ, volume] k) x w|) ≤ + (‖w‖ * a * L * (volume.real (Metric.ball (0:Euc n) (2*R)) / R + + 2 * (perimeter E (Metric.ball 0 R)).toReal)) * ∫ x, |k x| := by + have herr : (∫ x, |localizedPhaseError E v R x|) ≤ + a * (volume.real (Metric.ball (0:Euc n) (2*R)) / R) := by + have hi := slab_integral_bound (localizedPhaseError_measurable hmin.1 v R) hv ha hR + (show Function.support (localizedPhaseError E v R) ⊆ Metric.ball 0 R from + support_indicator_subset) + (localizedPhaseError_slab_bound E v R a hphase) + simp only [Real.norm_eq_abs] at hi + have ht : 0 < 2*R := by positivity + rw [← mul_div_assoc] + apply (le_div_iff₀ hR).mpr + nlinarith + have hn' := minimizing_horizontal_normal_integral_le hn hmin 0 hv hw 0 hR hη hc hs + ha hL (by simpa only [sub_zero] using hheight) hgrad + have hg := phase_error_cutoff_derivative_le hmin.1 v w hη hc hs hL hgrad + have hg' := hg.trans (mul_le_mul_of_nonneg_left herr (by positivity : 0 ≤ L*‖w‖)) + have hb := add_le_add hg' hn' + have hb' : ((∫ x, |(E.indicator (fun _ ↦ (1:ℝ)) x - + {z | inner ℝ v z < 0}.indicator (fun _ ↦ (1:ℝ)) x) * fderiv ℝ η x w|) + + ∫ x in Metric.ball 0 R, |η x * inner ℝ (approximateNormal E x) w| ∂perimeterMeasure E) ≤ + ‖w‖ * a * L * (volume.real (Metric.ball (0:Euc n) (2*R)) / R + + 2 * (perimeter E (Metric.ball 0 R)).toReal) := by + exact hb.trans_eq (by ring) + exact (cutoffPhaseError_convolution_variation_le hn hmin hv hw hη hc hk hck hR hs).trans + (mul_le_mul_of_nonneg_right hb' (integral_nonneg fun x ↦ abs_nonneg _)) + +theorem translation_lintegral_le_of_mollifier_direction_bound {n : ℕ} + {f : Euc n → ℝ} (hf : LocallyIntegrable f volume) (hc : HasCompactSupport f) + (a : Euc n) (B : ℝ) + (hb : ∀ j, (∫ x, |fderiv ℝ (c1Mollify f j) x a|) ≤ B) : + (∫⁻ x, ‖f (x+a)-f x‖ₑ) ≤ ENNReal.ofReal B := by + let u : ℕ → Euc n → ℝ := c1Mollify f + have hu : ∀ j, ContDiff ℝ ∞ (u j) := fun j ↦ + (c1Mollifier j).hasCompactSupport_normed.contDiff_convolution_left _ + (c1Mollifier j).contDiff_normed hf + have hcu : ∀ j, HasCompactSupport (u j) := fun j ↦ c1Mollify_hasCompactSupport hc j + have hlim : ∀ᵐ x ∂volume, Tendsto (fun j ↦ u j x) atTop (𝓝 (f x)) := by + apply ContDiffBump.ae_convolution_tendsto_right_of_locallyIntegrable + c1Mollifier_radius_tendsto (K := 2) _ hf + apply Eventually.of_forall + intro j + dsimp [c1Mollifier] + linarith + have hlimadd : ∀ᵐ x ∂volume, Tendsto (fun j ↦ u j (x+a)) atTop (𝓝 (f (x+a))) := + (measurePreserving_add_right volume a).quasiMeasurePreserving.ae hlim + have hlimnorm : ∀ᵐ x ∂volume, Tendsto (fun j ↦ ‖u j (x+a)-u j x‖ₑ) atTop + (𝓝 (‖f (x+a)-f x‖ₑ)) := by + filter_upwards [hlimadd,hlim] with x hx hy + exact (hx.sub hy).enorm + calc + _ = ∫⁻ x, liminf (fun j ↦ ‖u j (x+a)-u j x‖ₑ) atTop := by + apply lintegral_congr_ae + filter_upwards [hlimnorm] with x hx using hx.liminf_eq.symm + _ ≤ liminf (fun j ↦ ∫⁻ x, ‖u j (x+a)-u j x‖ₑ) atTop := + lintegral_liminf_le' (fun j ↦ (((hu j).continuous.comp + (continuous_id.add continuous_const)).sub (hu j).continuous).enorm.measurable.aemeasurable) + _ ≤ _ := by + have hj : ∀ j, (∫⁻ x, ‖u j (x+a)-u j x‖ₑ) ≤ ENNReal.ofReal B := by + intro j + apply (smooth_directional_translation_lintegral_le ((hu j).of_le (by simp)) a).trans + have hid : Integrable (fun x ↦ fderiv ℝ (u j) x a) volume := + (((hu j).continuous_fderiv (by simp)).clm_apply continuous_const).integrable_of_hasCompactSupport + ((hcu j).fderiv_apply ℝ a) + rw [← ofReal_integral_norm_eq_lintegral_enorm hid] + apply ENNReal.ofReal_le_ofReal + simpa only [Real.norm_eq_abs] using hb j + exact liminf_le_of_frequently_le (Eventually.of_forall hj).frequently + +theorem cutoffPhaseError_horizontal_translation_le {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + {v w : Euc n} (hv : ‖v‖ = 1) (hw : inner ℝ v w = 0) + {η : Euc n → ℝ} (hη : ContDiff ℝ ∞ η) (hc : HasCompactSupport η) + {R : ℝ} (hR : 0 < R) (hs : tsupport η ⊆ Metric.ball 0 R) + {a L : ℝ} (ha : 0 ≤ a) (hL : 0 ≤ L) + (hheight : ∀ x ∈ perimeterSupport E ∩ Metric.ball 0 R, |inner ℝ v x| ≤ a) + (hgrad : ∀ x ∈ Metric.ball 0 R, ‖gradient η x‖ ≤ L) + (hphase : ∀ᵐ x ∂volume, x ∈ Metric.ball 0 R → a < |inner ℝ v x| → + (x ∈ E ↔ inner ℝ v x < 0)) : + (∫⁻ x, ‖cutoffPhaseError E v η (x+w)-cutoffPhaseError E v η x‖ₑ) ≤ + ENNReal.ofReal (‖w‖ * a * L * (volume.real (Metric.ball (0:Euc n) (2*R)) / R + + 2 * (perimeter E (Metric.ball 0 R)).toReal)) := by + let f := cutoffPhaseError E v η + have hfi : Integrable f volume := by + have hi := integrable_phase_error_mul (H := {z | inner ℝ v z < 0}) hmin.1 + ((isOpen_lt (continuous_const.inner continuous_id) continuous_const).measurableSet) + (hη.continuous.integrable_of_hasCompactSupport hc) + change Integrable (fun y ↦ η y * (E.indicator (fun _ ↦ (1:ℝ)) y - + {z | inner ℝ v z < 0}.indicator (fun _ ↦ (1:ℝ)) y)) volume + simpa only [mul_comm] using hi + have hcf : HasCompactSupport f := hc.mul_right + apply translation_lintegral_le_of_mollifier_direction_bound hfi.locallyIntegrable hcf + intro j + have hflip : (lsmul ℝ ℝ : ℝ →L[ℝ] ℝ →L[ℝ] ℝ).flip = lsmul ℝ ℝ := by + apply ContinuousLinearMap.ext + intro a + apply ContinuousLinearMap.ext + intro b + exact mul_comm b a + have heq : c1Mollify f j = f ⋆[lsmul ℝ ℝ, volume] (c1Mollifier j).normed volume := by + change (c1Mollifier j).normed volume ⋆[lsmul ℝ ℝ, volume] f = _ + rw [← convolution_flip, hflip] + rw [heq] + have hk1 : (∫ x, |(c1Mollifier (n := n) j).normed volume x|) = 1 := by + simp_rw [abs_of_nonneg ((c1Mollifier j).nonneg_normed _)] + exact (c1Mollifier j).integral_normed + have hh := cutoffPhaseError_convolution_height_variation (k := (c1Mollifier j).normed volume) hn hmin hv hw hη hc + (c1Mollifier j).contDiff_normed (c1Mollifier j).hasCompactSupport_normed hR hs + ha hL hheight hgrad hphase + simpa only [hk1, mul_one] using hh + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/FiberCrossing.lean b/lean/OAI/Geometry/Perimeter/Regularity/FiberCrossing.lean new file mode 100644 index 0000000000000000000000000000000000000000..c0b9d589bd9766f25d4973936f6d2c7ecbcb12bc --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/FiberCrossing.lean @@ -0,0 +1,180 @@ +import OAI.Geometry.Perimeter.Regularity.GeoAlgebra + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal +namespace RPISingularHarnack + +def fiberPrimitive (q : ℝ → ℝ) (l s : ℝ) : ℝ := ∫ t in l..s, q t + +theorem fiberPrimitive_hasDerivAt {q : ℝ → ℝ} (hq : Continuous q) (l s : ℝ) : + HasDerivAt (fiberPrimitive q l) (q s) s := + intervalIntegral.integral_hasDerivAt_right (hq.intervalIntegrable _ _) + hq.stronglyMeasurable.stronglyMeasurableAtFilter hq.continuousAt + +theorem fiberPrimitive_continuous {q : ℝ → ℝ} (hq : Continuous q) (l : ℝ) : + Continuous (fiberPrimitive q l) := + continuous_iff_continuousAt.mpr (fun s ↦ (fiberPrimitive_hasDerivAt hq l s).continuousAt) + +theorem fiber_crossing_identity {q : ℝ → ℝ} (hq : Continuous q) (l u : ℝ) : + 2 * (∫ s in l..u, (s-l)*q s) - (∫ s in l..u, q s)^2 = + 2 * ∫ s in l..u, q s * ((s-l)-fiberPrimitive q l s) := by + have hF := fiberPrimitive_continuous hq l + have hprod : (∫ s in l..u, q s*fiberPrimitive q l s + fiberPrimitive q l s*q s) = + (fiberPrimitive q l u)^2 := by + have h := intervalIntegral.integral_deriv_mul_eq_sub (a := l) (b := u) + (fun s _ ↦ fiberPrimitive_hasDerivAt hq l s) + (fun s _ ↦ fiberPrimitive_hasDerivAt hq l s) + (hq.intervalIntegrable _ _) (hq.intervalIntegrable _ _) + simpa only [fiberPrimitive,intervalIntegral.integral_same,mul_zero,sub_zero,pow_two] using h + have hsq : 2*(∫ s in l..u, q s*fiberPrimitive q l s) = (∫ s in l..u, q s)^2 := by + have he : (fun s ↦ q s*fiberPrimitive q l s + fiberPrimitive q l s*q s) = + (fun s ↦ (2:ℝ)*(q s*fiberPrimitive q l s)) := by funext s; ring + rw [he,intervalIntegral.integral_const_mul] at hprod + exact hprod + have he : (fun s ↦ q s * ((s-l)-fiberPrimitive q l s)) = + (fun s ↦ (s-l)*q s-q s*fiberPrimitive q l s) := by funext s; ring + rw [he] + have hi₁ : IntervalIntegrable (fun s ↦ (s-l)*q s) volume l u := + ((continuous_id.sub continuous_const).mul hq).intervalIntegrable _ _ + have hi₂ : IntervalIntegrable (fun s ↦ q s*fiberPrimitive q l s) volume l u := + (hq.mul hF).intervalIntegrable _ _ + rw [intervalIntegral.integral_sub hi₁ hi₂] + linarith + +theorem fiber_crossing_bound_of_order_defect {q : ℝ → ℝ} (hq : Continuous q) + {l u D : ℝ} (hlu : l ≤ u) (hD : 0 ≤ D) + (hb : ∀ s ∈ Icc l u, 0 ≤ q s ∧ q s ≤ 1) + (horder : ∀ t ∈ Icc l u, ∀ s ∈ Icc t u, q s-q t ≤ D) : + 0 ≤ 2*(∫ s in l..u, (s-l)*q s)-(∫ s in l..u, q s)^2 ∧ + 2*(∫ s in l..u, (s-l)*q s)-(∫ s in l..u, q s)^2 ≤ + 2*(u-l)*(∫ s in l..u, q s*(1-q s))+2*(u-l)^2*D := by + rw [fiber_crossing_identity hq l u] + have hF := fiberPrimitive_continuous hq l + have hi : IntervalIntegrable (fun s ↦ q s*((s-l)-fiberPrimitive q l s)) volume l u := + (hq.mul ((continuous_id.sub continuous_const).sub hF)).intervalIntegrable _ _ + have hlen (s : ℝ) : (s-l)-fiberPrimitive q l s = ∫ t in l..s, 1-q t := by + rw [intervalIntegral.integral_sub (continuous_const.intervalIntegrable _ _) (hq.intervalIntegrable _ _)] + simp [fiberPrimitive] + have hpoint (s : ℝ) (hs : s ∈ Icc l u) : + 0 ≤ q s*((s-l)-fiberPrimitive q l s) ∧ + q s*((s-l)-fiberPrimitive q l s) ≤ + (u-l)*(q s*(1-q s))+(u-l)*D := by + have hqs := hb s hs + have hnon : 0 ≤ (s-l)-fiberPrimitive q l s := by + rw [hlen] + apply intervalIntegral.integral_nonneg hs.1 + intro t ht + exact sub_nonneg.mpr (hb t ⟨ht.1,ht.2.trans hs.2⟩).2 + refine ⟨mul_nonneg hqs.1 hnon, ?_⟩ + have hbound : (s-l)-fiberPrimitive q l s ≤ (s-l)*(1-q s+D) := by + rw [hlen] + calc + _ ≤ ∫ t in l..s, (1-q s+D) := by + apply intervalIntegral.integral_mono_on hs.1 + ((continuous_const.sub hq).intervalIntegrable _ _) (continuous_const.intervalIntegrable _ _) + intro t ht + change 1-q t ≤ 1-q s+D + have h := horder t ⟨ht.1,ht.2.trans hs.2⟩ s ⟨ht.2,hs.2⟩ + linarith + _ = _ := by simp; ring + have h₁ := mul_le_mul_of_nonneg_left hbound hqs.1 + have h₂ : (s-l)*(q s*(1-q s)) ≤ (u-l)*(q s*(1-q s)) := by + exact mul_le_mul_of_nonneg_right (by linarith [hs.2]) (mul_nonneg hqs.1 (sub_nonneg.mpr hqs.2)) + have h₃ : (s-l)*q s*D ≤ (u-l)*D := by + have hsq : (s-l)*q s ≤ u-l := by + calc + _ ≤ (s-l)*1 := mul_le_mul_of_nonneg_left hqs.2 (sub_nonneg.mpr hs.1) + _ ≤ _ := by linarith [hs.2] + exact mul_le_mul_of_nonneg_right hsq hD + nlinarith + constructor + · exact mul_nonneg (by norm_num) (intervalIntegral.integral_nonneg hlu (fun s hs ↦ (hpoint s hs).1)) + · have h := intervalIntegral.integral_mono_on hlu hi + ((continuous_const.mul (hq.mul (continuous_const.sub hq)) |>.add continuous_const).intervalIntegrable _ _) + (fun s hs ↦ (hpoint s hs).2) + change (∫ s in l..u, q s*((s-l)-fiberPrimitive q l s)) ≤ + ∫ s in l..u, (u-l)*(q s*(1-q s))+(u-l)*D at h + have hi₁ : IntervalIntegrable (fun s ↦ (u-l)*(q s*(1-q s))) volume l u := + (continuous_const.mul (hq.mul (continuous_const.sub hq))).intervalIntegrable _ _ + have hi₂ : IntervalIntegrable (fun _ : ℝ ↦ (u-l)*D) volume l u := + continuous_const.intervalIntegrable _ _ + rw [intervalIntegral.integral_add hi₁ hi₂,intervalIntegral.integral_const_mul] at h + simp only [intervalIntegral.integral_const,smul_eq_mul] at h + nlinarith + +theorem fiber_order_defect_of_positive_derivative {q : ℝ → ℝ} + (hq : ContDiff ℝ 1 q) {l u t s : ℝ} + (ht : t ∈ Icc l u) (hs : s ∈ Icc t u) : + q s-q t ≤ ∫ r in l..u, max (deriv q r) 0 := by + have hd : Continuous (deriv q) := hq.continuous_deriv (by simp) + rw [← intervalIntegral.integral_deriv_eq_sub + (fun x _ ↦ hq.differentiable (by simp) x) (hd.intervalIntegrable _ _)] + calc + _ ≤ ∫ r in t..s, max (deriv q r) 0 := + intervalIntegral.integral_mono hs.1 (hd.intervalIntegrable _ _) + ((hd.max continuous_const).intervalIntegrable _ _) (fun _ ↦ le_max_left _ _) + _ ≤ _ := intervalIntegral.integral_mono_interval ht.1 hs.1 hs.2 + (ae_of_all _ (fun _ ↦ le_max_right _ _)) ((hd.max continuous_const).intervalIntegrable _ _) + +theorem fiber_crossing_bound {q : ℝ → ℝ} (hq : ContDiff ℝ 1 q) + {l u : ℝ} (hlu : l ≤ u) (hb : ∀ s ∈ Icc l u, 0 ≤ q s ∧ q s ≤ 1) : + 0 ≤ 2*(∫ s in l..u, (s-l)*q s)-(∫ s in l..u, q s)^2 ∧ + 2*(∫ s in l..u, (s-l)*q s)-(∫ s in l..u, q s)^2 ≤ + 2*(u-l)*(∫ s in l..u, q s*(1-q s))+ + 2*(u-l)^2*(∫ s in l..u, max (deriv q s) 0) := by + apply fiber_crossing_bound_of_order_defect hq.continuous hlu + (intervalIntegral.integral_nonneg hlu (fun _ _ ↦ le_max_right _ _)) hb + exact fun _ ht _ hs ↦ fiber_order_defect_of_positive_derivative hq ht hs + +theorem fiber_flux_height_identity {q : ℝ → ℝ} (hq : ContDiff ℝ 1 q) + {l u : ℝ} (hl : q l = 1) (hu : q u = 0) : + (∫ s in l..u, s^2 * (-deriv q s)) - (l+∫ s in l..u, q s)^2 = + 2*(∫ s in l..u, (s-l)*q s)-(∫ s in l..u, q s)^2 := by + have hd : Continuous (deriv q) := hq.continuous_deriv (by simp) + have hpow (s : ℝ) : HasDerivAt (fun t : ℝ ↦ t^2) (2*s) s := by + simpa using (hasDerivAt_pow 2 s) + have hprod := intervalIntegral.integral_deriv_mul_eq_sub (a := l) (b := u) + (fun s _ ↦ hpow s) (fun s _ ↦ (hq.differentiable (by simp) s).hasDerivAt) + ((continuous_const.mul continuous_id).intervalIntegrable l u) + (hd.intervalIntegrable l u) + have hi₁ : IntervalIntegrable (fun s ↦ 2*s*q s) volume l u := + ((continuous_const.mul continuous_id).mul hq.continuous).intervalIntegrable _ _ + have hi₂ : IntervalIntegrable (fun s ↦ s^2*deriv q s) volume l u := + ((continuous_id.pow 2).mul hd).intervalIntegrable _ _ + rw [intervalIntegral.integral_add hi₁ hi₂,hl,hu,mul_zero,mul_one,zero_sub] at hprod + have he₁ : (∫ s in l..u, s^2*(-deriv q s)) = -(∫ s in l..u, s^2*deriv q s) := by + simp_rw [mul_neg] + exact intervalIntegral.integral_neg + have he₂ : (∫ s in l..u, (s-l)*q s) = + (∫ s in l..u, s*q s)-l*(∫ s in l..u, q s) := by + simp_rw [sub_mul] + have hi₁ : IntervalIntegrable (fun s ↦ s*q s) volume l u := + (continuous_id.mul hq.continuous).intervalIntegrable _ _ + have hi₂ : IntervalIntegrable (fun s ↦ l*q s) volume l u := + (continuous_const.mul hq.continuous).intervalIntegrable _ _ + rw [intervalIntegral.integral_sub hi₁ hi₂, intervalIntegral.integral_const_mul] + have he₃ : (∫ s in l..u, 2*s*q s) = 2*(∫ s in l..u, s*q s) := by + simp_rw [mul_assoc] + exact intervalIntegral.integral_const_mul _ _ + rw [he₃] at hprod + rw [he₁,he₂] + nlinarith + +theorem fiber_flux_height_defect {q : ℝ → ℝ} (hq : ContDiff ℝ 1 q) + {l u : ℝ} (hlu : l ≤ u) (hl : q l = 1) (hu : q u = 0) + (hb : ∀ s ∈ Icc l u, 0 ≤ q s ∧ q s ≤ 1) : + 0 ≤ (∫ s in l..u, s^2*(-deriv q s))-(l+∫ s in l..u, q s)^2 ∧ + (∫ s in l..u, s^2*(-deriv q s))-(l+∫ s in l..u, q s)^2 ≤ + 2*(u-l)*(∫ s in l..u, q s*(1-q s))+ + 2*(u-l)^2*(∫ s in l..u, max (deriv q s) 0) := by + rw [fiber_flux_height_identity hq hl hu] + exact fiber_crossing_bound hq hlu hb + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/FiberHeight.lean b/lean/OAI/Geometry/Perimeter/Regularity/FiberHeight.lean new file mode 100644 index 0000000000000000000000000000000000000000..0d1024eabe01b7d404025c1925463b2e285f794f --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/FiberHeight.lean @@ -0,0 +1,350 @@ +import OAI.Geometry.Perimeter.Regularity.EllipticLocality + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff Pointwise +namespace RPISingularHarnack +open RPI.Boundary + +theorem minimizing_phase_constant_off_support {n : ℕ} (hn : 1 < n) + {E U : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (hU : IsPreconnected U) (hdis : Disjoint U (perimeterSupport E)) : + (∀ᵐ x ∂volume, x ∈ U → x ∈ E) ∨ (∀ᵐ x ∂volume, x ∈ U → x ∉ E) := by + let K := (volume.restrict E).support + have hK : IsClosed K := Measure.isClosed_support + have hp : Real.HolderConjugate (n : ℝ) (Real.conjExponent (n : ℝ)) := + Real.HolderConjugate.conjExponent (by exact_mod_cast hn) + have heK : E =ᵐ[volume] K := minimizing_ae_eq_phaseSupport hp hmin + have hf : frontier K = perimeterSupport E := minimizing_frontier_phaseSupport hp hmin + have hcover : U ⊆ interior K ∪ Kᶜ := by + intro x hx + by_cases hxK : x ∈ K + · left + by_contra hxi + have hxf : x ∈ frontier K := by + rw [frontier, hK.closure_eq] + exact ⟨hxK,hxi⟩ + exact Set.disjoint_left.mp hdis hx (hf ▸ hxf) + · exact Or.inr hxK + rcases hU.subset_or_subset isOpen_interior hK.isOpen_compl + (Set.disjoint_left.mpr fun x hx hx' ↦ hx' (interior_subset hx)) hcover with h | h + · left + filter_upwards [heK.mem_iff] with x hx + intro hxU + exact hx.mpr (interior_subset (h hxU)) + · right + filter_upwards [heK.mem_iff] with x hx + intro hxU hxE + exact h hxU (hx.mp hxE) + +theorem minimizing_phase_absent_of_anchor {n : ℕ} (hn : 1 < n) + {E U A : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (hU : IsPreconnected U) (hdis : Disjoint U (perimeterSupport E)) + (hAU : A ⊆ U) (hanchor : 0 < volume (A \ E)) : + ∀ᵐ x ∂volume, x ∈ U → x ∉ E := by + rcases minimizing_phase_constant_off_support hn hmin hU hdis with h | h + · have hz : volume (A \ E) = 0 := by + apply measure_mono_null (fun x hx ↦ show x ∈ {x | ¬ (x ∈ U → x ∈ E)} from + fun hh ↦ hx.2 (hh (hAU hx.1))) + exact ae_iff.mp h + exact (hanchor.ne' hz).elim + · exact h + +theorem minimizing_phase_present_of_anchor {n : ℕ} (hn : 1 < n) + {E U A : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (hU : IsPreconnected U) (hdis : Disjoint U (perimeterSupport E)) + (hAU : A ⊆ U) (hanchor : 0 < volume (A ∩ E)) : + ∀ᵐ x ∂volume, x ∈ U → x ∈ E := by + rcases minimizing_phase_constant_off_support hn hmin hU hdis with h | h + · exact h + · have hz : volume (A ∩ E) = 0 := by + apply measure_mono_null (fun x hx ↦ show x ∈ {x | ¬ (x ∈ U → x ∉ E)} from + fun hh ↦ hh (hAU hx.1) hx.2) + exact ae_iff.mp h + exact (hanchor.ne' hz).elim + +theorem minimizing_slab_phase_agreement {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (v : Euc n) {R a : ℝ} (ha : 0 ≤ a) + (hheight : ∀ x ∈ perimeterSupport E ∩ Metric.ball 0 R, |inner ℝ v x| ≤ a) + {A B : Set (Euc n)} + (hA : A ⊆ Metric.ball 0 R ∩ {x | a < inner ℝ v x}) + (hB : B ⊆ Metric.ball 0 R ∩ {x | inner ℝ v x < -a}) + (hanchorA : 0 < volume (A \ E)) (hanchorB : 0 < volume (B ∩ E)) : + ∀ᵐ x ∂volume, x ∈ Metric.ball 0 R → a < |inner ℝ v x| → + (x ∈ E ↔ inner ℝ v x < 0) := by + have hu : IsPreconnected (Metric.ball (0 : Euc n) R ∩ {x | a < inner ℝ v x}) := + ((convex_ball _ _).inter ((convex_Ioi a).linear_preimage (innerSL ℝ v).toLinearMap)).isPreconnected + have hl : IsPreconnected (Metric.ball (0 : Euc n) R ∩ {x | inner ℝ v x < -a}) := + ((convex_ball _ _).inter ((convex_Iio (-a)).linear_preimage (innerSL ℝ v).toLinearMap)).isPreconnected + have hdu : Disjoint (Metric.ball (0 : Euc n) R ∩ {x | a < inner ℝ v x}) + (perimeterSupport E) := by + apply Set.disjoint_left.mpr + intro x hx hs + exact (hx.2.trans_le ((le_abs_self _).trans (hheight x ⟨hs,hx.1⟩))).false + have hdl : Disjoint (Metric.ball (0 : Euc n) R ∩ {x | inner ℝ v x < -a}) + (perimeterSupport E) := by + apply Set.disjoint_left.mpr + intro x hx hs + have hh := (abs_le.mp (hheight x ⟨hs,hx.1⟩)).1 + exact (hx.2.trans_le hh).false + have hupper := minimizing_phase_absent_of_anchor hn hmin hu hdu hA hanchorA + have hlower := minimizing_phase_present_of_anchor hn hmin hl hdl hB hanchorB + filter_upwards [hupper,hlower] with x hx hy + intro hxball hxa + rcases lt_abs.mp hxa with hpos | hneg + · have hnot := hx ⟨hxball,hpos⟩ + simp only [hnot, false_iff, not_lt] + exact ha.trans hpos.le + · have hyes := hy ⟨hxball,by change inner ℝ v x < -a; linarith⟩ + simp only [hyes, true_iff] + linarith + +def localizedPhaseError {n : ℕ} (E : Set (Euc n)) (v : Euc n) (R : ℝ) : Euc n → ℝ := + (Metric.ball 0 R).indicator (fun x ↦ E.indicator (fun _ ↦ (1:ℝ)) x - + {z | inner ℝ v z < 0}.indicator (fun _ ↦ (1:ℝ)) x) + +def fiberHeight {n : ℕ} (E : Set (Euc n)) (v : Euc n) (R : ℝ) (x : Euc n) : ℝ := + ∫ s : ℝ, localizedPhaseError E v R (x + s • v) + +theorem localizedPhaseError_measurable {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) (v : Euc n) (R : ℝ) : + Measurable (localizedPhaseError E v R) := by + exact ((measurable_const.indicator hE).sub (measurable_const.indicator + (isOpen_lt (continuous_const.inner continuous_id) continuous_const).measurableSet)).indicator + measurableSet_ball + +theorem localizedPhaseError_norm_le_one {n : ℕ} (E : Set (Euc n)) + (v : Euc n) (R : ℝ) (x : Euc n) : ‖localizedPhaseError E v R x‖ ≤ 1 := by + classical + by_cases hx : x ∈ Metric.ball (0 : Euc n) R + · by_cases hE : x ∈ E <;> by_cases hH : inner ℝ v x < 0 <;> + simp [localizedPhaseError,hx,hE,hH] + · simp [localizedPhaseError,hx] + +theorem fiberHeight_add_smul {n : ℕ} (E : Set (Euc n)) (v : Euc n) (R t : ℝ) + (x : Euc n) : fiberHeight E v R (x+t•v) = fiberHeight E v R x := by + unfold fiberHeight + have heq : (fun s : ℝ ↦ localizedPhaseError E v R (x+t•v+s•v)) = + (fun s : ℝ ↦ localizedPhaseError E v R (x+(s+t)•v)) := by + funext s + congr 1 + rw [add_smul] + abel + rw [heq] + exact integral_add_right_eq_self (fun s : ℝ ↦ localizedPhaseError E v R (x+s•v)) t + +theorem fiberHeight_stronglyMeasurable {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) (v : Euc n) (R : ℝ) : + StronglyMeasurable (fiberHeight E v R) := by + apply StronglyMeasurable.integral_prod_right + exact ((localizedPhaseError_measurable hE v R).comp + (continuous_fst.add (continuous_snd.smul continuous_const)).measurable).stronglyMeasurable + +theorem unit_inner_add_smul {n : ℕ} {v : Euc n} (hv : ‖v‖ = 1) + (x : Euc n) (s : ℝ) : inner ℝ v (x+s•v) = inner ℝ v x+s := by + simp only [inner_add_right, real_inner_smul_right, real_inner_self_eq_norm_sq, hv, + one_pow, mul_one] + +theorem ae_fiber_norm_bound {n : ℕ} {f : Euc n → ℝ} (hf : Measurable f) + {v : Euc n} (hv : ‖v‖ = 1) {a : ℝ} + (hbound : ∀ᵐ x ∂volume, ‖f x‖ ≤ (Icc (-a) a).indicator (fun _ ↦ (1:ℝ)) (inner ℝ v x)) : + ∀ᵐ x ∂volume, ∀ᵐ s : ℝ ∂volume, + ‖f (x+s•v)‖ ≤ (Icc (-a-inner ℝ v x) (a-inner ℝ v x)).indicator (fun _ ↦ (1:ℝ)) s := by + have hall : ∀ᵐ s : ℝ ∂volume, ∀ᵐ x ∂volume, + ‖f (x+s•v)‖ ≤ (Icc (-a) a).indicator (fun _ ↦ (1:ℝ)) (inner ℝ v (x+s•v)) := by + exact ae_of_all _ fun s ↦ (measurePreserving_add_right volume (s•v)).quasiMeasurePreserving.ae hbound + have hm : MeasurableSet {p : ℝ × Euc n | + ‖f (p.2+p.1•v)‖ ≤ (Icc (-a) a).indicator (fun _ ↦ (1:ℝ)) (inner ℝ v (p.2+p.1•v))} := by + apply measurableSet_le + · exact (hf.comp (continuous_snd.add (continuous_fst.smul continuous_const)).measurable).norm + · exact (measurable_const.indicator measurableSet_Icc).comp + ((continuous_const.inner (continuous_snd.add (continuous_fst.smul continuous_const))).measurable) + have hh := (Measure.ae_ae_comm hm).mp hall + filter_upwards [hh] with x hx + filter_upwards [hx] with s hs + have he : inner ℝ v (x+s•v) ∈ Icc (-a) a ↔ + s ∈ Icc (-a-inner ℝ v x) (a-inner ℝ v x) := by + rw [unit_inner_add_smul hv] + simp only [mem_Icc] + constructor <;> rintro ⟨h₁,h₂⟩ <;> constructor <;> linarith + simpa only [indicator_apply, he] using hs + +theorem norm_fiber_integral_le {n : ℕ} {f : Euc n → ℝ} (hf : Measurable f) + {v : Euc n} (hv : ‖v‖ = 1) {a : ℝ} (ha : 0 ≤ a) + (hbound : ∀ᵐ x ∂volume, ‖f x‖ ≤ (Icc (-a) a).indicator (fun _ ↦ (1:ℝ)) (inner ℝ v x)) : + ∀ᵐ x ∂volume, ‖∫ s : ℝ, f (x+s•v)‖ ≤ 2*a := by + filter_upwards [ae_fiber_norm_bound hf hv hbound] with x hx + let I := Icc (-a-inner ℝ v x) (a-inner ℝ v x) + have hI : Integrable (I.indicator (fun _ ↦ (1:ℝ))) volume := by + exact ((continuous_const.integrableOn_Icc).integrable_indicator measurableSet_Icc) + have hfx : Integrable (fun s : ℝ ↦ f (x+s•v)) volume := + hI.mono' (hf.comp (continuous_const.add (continuous_id.smul continuous_const)).measurable).aestronglyMeasurable hx + calc + ‖∫ s : ℝ, f (x+s•v)‖ ≤ ∫ s : ℝ, ‖f (x+s•v)‖ := norm_integral_le_integral_norm _ + _ ≤ ∫ s : ℝ, I.indicator (fun _ ↦ (1:ℝ)) s := integral_mono_ae hfx.norm hI hx + _ = 2*a := by + rw [integral_indicator measurableSet_Icc, integral_const] + simp only [smul_eq_mul, mul_one, Measure.real, Measure.restrict_apply_univ, Real.volume_Icc] + rw [show a-inner ℝ v x-(-a-inner ℝ v x) = 2*a by ring, ENNReal.toReal_ofReal (by positivity)] + +theorem localizedPhaseError_slab_bound {n : ℕ} (E : Set (Euc n)) (v : Euc n) + (R a : ℝ) + (hphase : ∀ᵐ x ∂volume, x ∈ Metric.ball 0 R → a < |inner ℝ v x| → + (x ∈ E ↔ inner ℝ v x < 0)) : + ∀ᵐ x ∂volume, ‖localizedPhaseError E v R x‖ ≤ + (Icc (-a) a).indicator (fun _ ↦ (1:ℝ)) (inner ℝ v x) := by + classical + filter_upwards [hphase] with x hx + by_cases hc : inner ℝ v x ∈ Icc (-a) a + · simpa only [indicator_of_mem hc] using localizedPhaseError_norm_le_one E v R x + · rw [indicator_of_notMem hc] + have hez : localizedPhaseError E v R x = 0 := by + by_cases hxball : x ∈ Metric.ball (0 : Euc n) R + · have hh : a < |inner ℝ v x| := lt_of_not_ge (fun h ↦ hc (abs_le.mp h)) + have he := hx hxball hh + by_cases hxE : x ∈ E + · simp [localizedPhaseError,hxball,hxE,he.mp hxE] + · have hxH : ¬inner ℝ v x < 0 := fun hh ↦ hxE (he.mpr hh) + simp [localizedPhaseError,hxball,hxE,hxH] + · simp [localizedPhaseError,hxball] + simp only [hez,norm_zero,le_refl] + +theorem fiberHeight_slab_bound {n : ℕ} {E : Set (Euc n)} (hE : MeasurableSet E) + {v : Euc n} (hv : ‖v‖ = 1) (R : ℝ) {a : ℝ} (ha : 0 ≤ a) + (hphase : ∀ᵐ x ∂volume, x ∈ Metric.ball 0 R → a < |inner ℝ v x| → + (x ∈ E ↔ inner ℝ v x < 0)) : + ∀ᵐ x ∂volume, ‖fiberHeight E v R x‖ ≤ 2*a := + norm_fiber_integral_le (localizedPhaseError_measurable hE v R) hv ha + (localizedPhaseError_slab_bound E v R a hphase) + +theorem lintegral_fiber_bound {n : ℕ} {f : Euc n → ℝ} (hf : Measurable f) + {v : Euc n} (hv : ‖v‖ = 1) {a : ℝ} (ha : 0 ≤ a) + (hbound : ∀ᵐ x ∂volume, ‖f x‖ ≤ (Icc (-a) a).indicator (fun _ ↦ (1:ℝ)) (inner ℝ v x)) : + ∀ᵐ x ∂volume, (∫⁻ s : ℝ, ‖f (x+s•v)‖ₑ) ≤ ENNReal.ofReal (2*a) := by + filter_upwards [ae_fiber_norm_bound hf hv hbound] with x hx + calc + _ ≤ ∫⁻ s : ℝ, ENNReal.ofReal + ((Icc (-a-inner ℝ v x) (a-inner ℝ v x)).indicator (fun _ ↦ (1:ℝ)) s) := by + apply lintegral_mono_ae + filter_upwards [hx] with s hs + rw [← ofReal_norm] + exact ENNReal.ofReal_le_ofReal hs + _ = ENNReal.ofReal (2*a) := by + have he : (fun s : ℝ ↦ ENNReal.ofReal + ((Icc (-a-inner ℝ v x) (a-inner ℝ v x)).indicator (fun _ ↦ (1:ℝ)) s)) = + (Icc (-a-inner ℝ v x) (a-inner ℝ v x)).indicator (fun _ ↦ (1:ℝ≥0∞)) := by + funext s + by_cases hs : s ∈ Icc (-a-inner ℝ v x) (a-inner ℝ v x) <;> simp [hs] + rw [he] + rw [lintegral_indicator measurableSet_Icc] + simp only [lintegral_const, Measure.restrict_apply_univ, one_mul] + rw [← uIcc_of_le (show -a-inner ℝ v x ≤ a-inner ℝ v x by linarith [ha]), + Real.volume_interval, abs_of_nonneg (by linarith [ha])] + congr 1 + ring + +theorem slab_lintegral_bound {n : ℕ} {f : Euc n → ℝ} (hf : Measurable f) + {v : Euc n} (hv : ‖v‖ = 1) {a : ℝ} (ha : 0 ≤ a) {R : ℝ} (hR : 0 < R) + (hs : Function.support f ⊆ Metric.ball 0 R) + (hbound : ∀ᵐ x ∂volume, ‖f x‖ ≤ (Icc (-a) a).indicator (fun _ ↦ (1:ℝ)) (inner ℝ v x)) : + ENNReal.ofReal (2*R) * (∫⁻ x, ‖f x‖ₑ) ≤ + ENNReal.ofReal (2*a) * volume (Metric.ball (0:Euc n) (2*R)) := by + let I := Icc (-R) R + let B := Metric.ball (0:Euc n) (2*R) + have hm : Measurable (fun p : Euc n × ℝ ↦ ‖f (p.1+p.2•v)‖ₑ) := + (hf.comp (continuous_fst.add (continuous_snd.smul continuous_const)).measurable).enorm + have hswap : ENNReal.ofReal (2*R) * (∫⁻ x, ‖f x‖ₑ) = + ∫⁻ x, ∫⁻ s in I, ‖f (x+s•v)‖ₑ := by + rw [lintegral_lintegral_swap hm.aemeasurable] + simp_rw [lintegral_add_right_eq_self (fun x : Euc n ↦ ‖f x‖ₑ)] + simp only [lintegral_const, Measure.restrict_apply_univ, I] + rw [← uIcc_of_le (show -R ≤ R by linarith [hR]), Real.volume_interval, + sub_neg_eq_add, ← two_mul, abs_of_pos (mul_pos (by norm_num) hR), mul_comm] + rw [hswap] + calc + _ ≤ ∫⁻ x, B.indicator (fun _ ↦ ENNReal.ofReal (2*a)) x := by + apply lintegral_mono_ae + filter_upwards [lintegral_fiber_bound hf hv ha hbound] with x hx + by_cases hxB : x ∈ B + · rw [indicator_of_mem hxB] + exact (lintegral_mono' Measure.restrict_le_self le_rfl).trans hx + · rw [indicator_of_notMem hxB] + apply le_of_eq + apply (lintegral_eq_zero_iff' (hf.comp (continuous_const.add (continuous_id.smul continuous_const)).measurable).enorm.aemeasurable).mpr + filter_upwards [ae_restrict_mem measurableSet_Icc] with s hsI + have hz : f (x+s•v) = 0 := by + by_contra hnz + have hy := hs hnz + have hsn : ‖s•v‖ ≤ R := by + rw [norm_smul, hv, mul_one, Real.norm_eq_abs] + exact abs_le.mpr hsI + have hxb : ‖x‖ < 2*R := by + have hxy : x = (x+s•v) - s•v := by abel + calc + ‖x‖ = ‖(x+s•v) - s•v‖ := congrArg norm hxy + _ ≤ ‖x+s•v‖ + ‖s•v‖ := norm_sub_le _ _ + _ < R+R := add_lt_add_of_lt_of_le (by simpa only [Metric.mem_ball, dist_zero_right] using hy) hsn + _ = 2*R := by ring + exact hxB (Metric.mem_ball.mpr (by simpa only [dist_zero_right] using hxb)) + change ‖f (x+s•v)‖ₑ = 0 + simp only [hz, enorm_zero] + _ = _ := by rw [lintegral_indicator measurableSet_ball]; simp [mul_comm] + +theorem slab_integral_bound {n : ℕ} {f : Euc n → ℝ} (hf : Measurable f) + {v : Euc n} (hv : ‖v‖ = 1) {a : ℝ} (ha : 0 ≤ a) {R : ℝ} (hR : 0 < R) + (hs : Function.support f ⊆ Metric.ball 0 R) + (hbound : ∀ᵐ x ∂volume, ‖f x‖ ≤ (Icc (-a) a).indicator (fun _ ↦ (1:ℝ)) (inner ℝ v x)) : + (2*R) * (∫ x, ‖f x‖) ≤ (2*a) * volume.real (Metric.ball (0:Euc n) (2*R)) := by + have hfinite : volume (Metric.ball (0:Euc n) (2*R)) ≠ ⊤ := + ne_top_of_le_ne_top (isCompact_closedBall (0:Euc n) (2*R)).measure_ne_top + (measure_mono Metric.ball_subset_closedBall) + have hi := ENNReal.toReal_mono (ENNReal.mul_ne_top ENNReal.ofReal_ne_top hfinite) + (slab_lintegral_bound hf hv ha hR hs hbound) + simpa only [ENNReal.toReal_mul, ENNReal.toReal_ofReal (by positivity : 0 ≤ 2*R), + ENNReal.toReal_ofReal (by positivity : 0 ≤ 2*a), Measure.real, + ← integral_norm_eq_lintegral_enorm hf.aestronglyMeasurable] using hi + +def cutoffPhaseError {n : ℕ} (E : Set (Euc n)) (v : Euc n) (η : Euc n → ℝ) + (x : Euc n) : ℝ := η x * (E.indicator (fun _ ↦ (1:ℝ)) x - + {z | inner ℝ v z < 0}.indicator (fun _ ↦ (1:ℝ)) x) + +theorem cutoffPhaseError_measurable {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) (v : Euc n) {η : Euc n → ℝ} (hη : Measurable η) : + Measurable (cutoffPhaseError E v η) := + hη.mul ((measurable_const.indicator hE).sub (measurable_const.indicator + (isOpen_lt (continuous_const.inner continuous_id) continuous_const).measurableSet)) + +theorem cutoffPhaseError_support {n : ℕ} (E : Set (Euc n)) (v : Euc n) + (η : Euc n → ℝ) : Function.support (cutoffPhaseError E v η) ⊆ Function.support η := by + intro x hx hz + exact hx (by simp [cutoffPhaseError, hz]) + +theorem cutoffPhaseError_eq_mul_localized {n : ℕ} (E : Set (Euc n)) (v : Euc n) + (η : Euc n → ℝ) {R : ℝ} (hs : Function.support η ⊆ Metric.ball 0 R) : + cutoffPhaseError E v η = fun x ↦ η x * localizedPhaseError E v R x := by + funext x + by_cases hx : x ∈ Metric.ball (0:Euc n) R + · simp [cutoffPhaseError, localizedPhaseError, hx] + · have hz : η x = 0 := Function.notMem_support.mp (fun hn ↦ hx (hs hn)) + simp [cutoffPhaseError, hz] + +theorem cutoffPhaseError_slab_bound {n : ℕ} (E : Set (Euc n)) (v : Euc n) + (η : Euc n → ℝ) {R a : ℝ} (hs : Function.support η ⊆ Metric.ball 0 R) + (hη : ∀ x, ‖η x‖ ≤ 1) + (hphase : ∀ᵐ x ∂volume, x ∈ Metric.ball 0 R → a < |inner ℝ v x| → + (x ∈ E ↔ inner ℝ v x < 0)) : + ∀ᵐ x ∂volume, ‖cutoffPhaseError E v η x‖ ≤ + (Icc (-a) a).indicator (fun _ ↦ (1:ℝ)) (inner ℝ v x) := by + rw [cutoffPhaseError_eq_mul_localized E v η hs] + filter_upwards [localizedPhaseError_slab_bound E v R a hphase] with x hx + rw [norm_mul] + exact ((mul_le_mul_of_nonneg_right (hη x) (norm_nonneg _)).trans_eq (one_mul _)).trans hx + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/FiberLocalization.lean b/lean/OAI/Geometry/Perimeter/Regularity/FiberLocalization.lean new file mode 100644 index 0000000000000000000000000000000000000000..36f8cee4eaa75d69f69d9f9a9d47c0f1b5c10ac6 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/FiberLocalization.lean @@ -0,0 +1,118 @@ +import OAI.Geometry.Perimeter.Regularity.FiberHeight +import OAI.Geometry.Perimeter.Regularity.PlaneFiberCompactness +import OAI.Geometry.Perimeter.Regularity.PhaseMomentLimit +import OAI.Geometry.Perimeter.Regularity.NormalWindowTest + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal InnerProductSpace ContDiff +namespace RPISingularHarnack +open RPI.Boundary +variable {n m : ℕ} + +theorem interval_negative_phase (b : ℝ) (hb : 0 ≤ b) : + (∫ s in (-b)..b, {t : ℝ | t<0}.indicator (fun _ ↦ (1:ℝ)) s)=b := by + have he : (fun s : ℝ ↦ {t : ℝ | t<0}.indicator (fun _ ↦ (1:ℝ)) s) =ᵐ[volume] + (fun s : ℝ ↦ {t : ℝ | t≤0}.indicator (fun _ ↦ (1:ℝ)) s) := by + filter_upwards [volume.ae_ne (0:ℝ)] with s hs + have hh : s<0 ↔ s≤0 := lt_iff_le_and_ne.trans (and_iff_left hs) + simp only [Set.indicator_apply,Set.mem_ofPred_eq,hh] + rw [intervalIntegral.integral_congr_ae (he.mono (fun _ h _ ↦ h)), + intervalIntegral.integral_indicator (show (0:ℝ) ∈ Icc (-b) b by constructor <;> linarith)] + simp + +theorem exactFiberHeight_eq_phase_integral {E : Set (Euc n)} (hE : MeasurableSet E) + {v : Euc n} (hv : ‖v‖=1) {b : ℝ} (hb : 0 ≤ b) (y : normalPlane v) : + exactFiberHeight E v b y = ∫ s in (-b)..b, + (E.indicator (fun _ ↦ (1:ℝ)) ((y:Euc n)+s•v)- + {z : Euc n | inner ℝ v z<0}.indicator (fun _ ↦ (1:ℝ)) ((y:Euc n)+s•v)) := by + have hi : IntervalIntegrable (fun s : ℝ ↦ E.indicator (fun _ ↦ (1:ℝ)) + ((y:Euc n)+s•v)) volume (-b) b := by + apply (intervalIntegrable_const (c := (1:ℝ))).mono_fun + (((measurable_const.indicator hE).comp + (continuous_const.add (continuous_id.smul continuous_const)).measurable).aestronglyMeasurable) + exact ae_of_all _ fun s ↦ by by_cases h : (y:Euc n)+s•v ∈ E <;> simp [h] + have hj : IntervalIntegrable (fun s : ℝ ↦ {t : ℝ | t<0}.indicator (fun _ ↦ (1:ℝ)) s) + volume (-b) b := by + apply (intervalIntegrable_const (c := (1:ℝ))).mono_fun + ((measurable_const.indicator measurableSet_Iio).aestronglyMeasurable) + exact ae_of_all _ fun s ↦ by by_cases h : s<0 <;> simp [h] + have he (s : ℝ) : {z : Euc n | inner ℝ v z<0}.indicator (fun _ ↦ (1:ℝ)) + ((y:Euc n)+s•v) = {t : ℝ | t<0}.indicator (fun _ ↦ (1:ℝ)) s := by + simp only [Set.indicator_apply,Set.mem_ofPred_eq,normal_fiber_inner hv] + simp_rw [he] + rw [intervalIntegral.integral_sub hi hj,interval_negative_phase b hb,exactFiberHeight] + ring + +theorem planeFiber_cutoff_eq_exact_ae {E : Set (Euc n)} (hE : MeasurableSet E) + {v : Euc n} (hv : ‖v‖=1) {η : Euc n → ℝ} {a b R : ℝ} + (ha : 0 ≤ a) (hab : a.mul hd.neg + have hiM := integral_normalCylinder hv hK hb hm + have hiD := integral_normalCylinder hv hK hb (hq.mul ((continuous_const (y := (1:ℝ))).sub hq)) + have hiP := integral_normalCylinder hv hK hb (hd.max (continuous_const (y := (0:ℝ)))) + have he (y : normalPlane v) (s : ℝ) : inner ℝ v ((y:Euc n)+s•v) = s := by + rw [inner_add_right, real_inner_smul_right, + Submodule.mem_orthogonal_singleton_iff_inner_right.mp y.property, + real_inner_self_eq_norm_sq,hv] + ring + dsimp only [q,Pi.mul_apply,Pi.sub_apply] at hiD + dsimp only [q] at hiM hiP + simp_rw [he, ← mollifiedNormalProfile_deriv hE hk hc v] at hiM + simp_rw [← mollifiedNormalProfile_deriv hE hk hc v] at hiP + rw [hiM,hiD,hiP] + let A := fun y : normalPlane v ↦ ∫ s in (-b)..b, + s^2*(-deriv (mollifiedNormalProfile E k v y) s) + let B := fun y : normalPlane v ↦ (-b+∫ s in (-b)..b, q ((y:Euc n)+s•v))^2 + let D := fun y : normalPlane v ↦ ∫ s in (-b)..b, q ((y:Euc n)+s•v)*(1-q ((y:Euc n)+s•v)) + let P := fun y : normalPlane v ↦ ∫ s in (-b)..b, max (deriv (mollifiedNormalProfile E k v y) s) 0 + have hA : Continuous A := by + have h := continuous_profile_integral (v := v) _ hm (-b) b + dsimp only [q] at h + simp_rw [he, ← mollifiedNormalProfile_deriv hE hk hc v] at h + exact h + have hB : Continuous B := + (continuous_const.add (continuous_profile_integral (v := v) q hq (-b) b)).pow 2 + have hD : Continuous D := continuous_profile_integral (v := v) _ + (hq.mul ((continuous_const (y := (1:ℝ))).sub hq)) (-b) b + have hP : Continuous P := by + have h := continuous_profile_integral (v := v) _ (hd.max (continuous_const (y := (0:ℝ)))) (-b) b + dsimp only [q] at h + simp_rw [← mollifiedNormalProfile_deriv hE hk hc v] at h + exact h + have hAi : IntegrableOn A K volume := hA.continuousOn.integrableOn_compact hK + have hBi : IntegrableOn B K volume := hB.continuousOn.integrableOn_compact hK + have hDi : IntegrableOn D K volume := hD.continuousOn.integrableOn_compact hK + have hPi : IntegrableOn P K volume := hP.continuousOn.integrableOn_compact hK + change 0 ≤ (∫ y in K, A y)-(∫ y in K, B y) ∧ + (∫ y in K, A y)-(∫ y in K, B y) ≤ 4*b*(∫ y in K, D y)+8*b^2*(∫ y in K, P y) + rw [← integral_sub hAi hBi, ← integral_const_mul, ← integral_const_mul, + ← integral_add (hDi.const_mul _) (hPi.const_mul _)] + have hpoint (y : normalPlane v) (hy : y ∈ K) := + mollifiedNormalProfile_flux_defect hE hv hk hc hp hu ha hb hab hs hphase y (hKR y hy) + constructor + · exact setIntegral_nonneg hK.measurableSet fun y hy ↦ (hpoint y hy).1 + · exact setIntegral_mono_on (hAi.sub hBi) ((hDi.const_mul _).add (hPi.const_mul _)) + hK.measurableSet fun y hy ↦ (hpoint y hy).2 + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/FiberQuadraticLimit.lean b/lean/OAI/Geometry/Perimeter/Regularity/FiberQuadraticLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..7e2c409ab0ef33326b5909ddb22ef6aa7bb494b8 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/FiberQuadraticLimit.lean @@ -0,0 +1,151 @@ +import OAI.Geometry.Perimeter.Regularity.FiberLocalization +import OAI.Geometry.Perimeter.Regularity.QuadraticError +import OAI.Geometry.Perimeter.Regularity.WeightedSquareLimit + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +open RPI.Boundary ContinuousLinearMap +variable {n m : ℕ} + +theorem chartFiber_cutoff_exact_ae {E : Set (Euc n)} (hE : MeasurableSet E) + {v : Euc n} (hv : ‖v‖=1) (e : Euc m ≃ₗᵢ[ℝ] normalPlane v) + {η : Euc n → ℝ} {a b R A : ℝ} (ha : 0≤a) (hab : a by_cases hh : inner ℝ v x<0 <;> simp [he,hh] + simpa using mul_le_mul_of_nonneg_left hb (norm_nonneg (η x)) + +theorem minimizing_quadratic_height_trace_tendsto_zero (hn : 1.2 + · exact mul_neg_of_pos_of_neg (hr i) + simp only [blownUpSet, mem_preimage, mem_symmDiff, hz] + have ht : Tendsto (fun t : ℝ ↦ (t^n)⁻¹ * + volume.real (symmDiff E Hp ∩ Metric.ball p t)) (𝓝[>] 0) (𝓝 0) := by + have hh := hv.2 + change Tendsto (fun t : ℝ ↦ (t^n)⁻¹ * + ∫ x in Metric.ball p t, |E.indicator (fun _ ↦ (1:ℝ)) x - + Hp.indicator (fun _ ↦ (1:ℝ)) x|) (𝓝[>] 0) (𝓝 0) at hh + simpa only [integral_abs_indicator_sub_eq_symmDiff hE hHp] using hh + have hcentral (S : ℝ) (hS : 0 < S) : + Tendsto (fun i ↦ volume.real (symmDiff (blownUpSet E p (r i)) H ∩ + Metric.closedBall (0 : Euc n) S)) atTop (𝓝 0) := by + have hscale : Tendsto (fun i ↦ r i * (S+1)) atTop (𝓝[>] (0 : ℝ)) := by + apply tendsto_nhdsWithin_iff.2 + refine ⟨?_, Eventually.of_forall fun i ↦ ?_⟩ + · simpa using htr.mul_const (S+1) + · exact mul_pos (hr i) (by linarith) + have ht' := (ht.comp hscale).const_mul ((S+1)^n) + simp only [mul_zero] at ht' + apply squeeze_zero (fun _ ↦ measureReal_nonneg) (fun i ↦ ?_) ht' + rw [← he i, volumeReal_blownUpSet_closedBall (hE.symmDiff hHp) p (hr i)] + calc + (r i ^ n)⁻¹ * volume.real (symmDiff E Hp ∩ Metric.closedBall p (r i*S)) ≤ + (r i ^ n)⁻¹ * volume.real (symmDiff E Hp ∩ Metric.ball p (r i*(S+1))) := by + apply mul_le_mul_of_nonneg_left _ (inv_nonneg.mpr (pow_nonneg (hr i).le _)) + apply measureReal_mono + (inter_subset_inter_right _ (Metric.closedBall_subset_ball (by nlinarith [hr i]))) + (measure_ne_top_of_subset inter_subset_right measure_ball_lt_top.ne) + _ = (S+1)^n * ((r i*(S+1))^n)⁻¹ * + volume.real (symmDiff E Hp ∩ Metric.ball p (r i*(S+1))) := by + have hs1 : S+1 ≠ 0 := ne_of_gt (by linarith) + rw [mul_pow, mul_inv] + field_simp [pow_ne_zero n (hr i).ne', pow_ne_zero n hs1] + _ = _ := by dsimp only [Function.comp_def]; ring + intro x R hR + have hS : 0 < ‖x‖ + R := by positivity + have hsub : Metric.closedBall x R ⊆ Metric.closedBall (0 : Euc n) (‖x‖+R) := by + intro z hz + have htri := dist_triangle z x (0 : Euc n) + have hz' := Metric.mem_closedBall.mp hz + simp only [dist_zero_right] at htri ⊢ + exact Metric.mem_closedBall.mpr (by simpa only [dist_zero_right] using + (htri.trans (by linarith : dist z x + ‖x‖ ≤ ‖x‖ + R))) + exact squeeze_zero (fun _ ↦ measureReal_nonneg) + (fun i ↦ measureReal_mono (inter_subset_inter_right _ hsub) + (measure_ne_top_of_subset inter_subset_right + (isCompact_closedBall (0 : Euc n) (‖x‖+R)).measure_ne_top)) + (hcentral (‖x‖+R) hS) + +theorem HasHalfspaceBlowup.support_height {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + {p v : Euc n} (hv : HasHalfspaceBlowup E p v) + (r : ℕ → ℝ) (hr : ∀ i, 0 < r i) (htr : Tendsto r atTop (𝓝 0)) + {C : Set (Euc n)} (hC : IsCompact C) {ε : ℝ} (hε : 0 < ε) : + ∀ᶠ i in atTop, ∀ z ∈ perimeterSupport (blownUpSet E p (r i)) ∩ C, + |inner ℝ z v| < ε := by + let H : Set (Euc n) := {z | inner ℝ z v < 0} + have hH : MeasurableSet H := + (isOpen_lt (continuous_id.inner continuous_const) continuous_const).measurableSet + have hconv := hv.local_L1 hmin.1 r hr htr + have hEm (i : ℕ) := locally_minimizing_blownUpSet hmin p (hr i) + have hHm := locally_minimizing_of_local_L1_limit (by omega : 0 < n) hEm hH hconv + filter_upwards [minimizing_supports_locally_converge hn _ hEm hHm hconv hC hε] with i hi + intro z hz + obtain ⟨y, hy, hzy⟩ := hi.1 z hz + have hy0 := halfspace_perimeterSupport_subset_plane v hy + have heq : inner ℝ z v = inner ℝ (z-y) v := by + rw [inner_sub_left, hy0, sub_zero] + rw [heq] + calc + |inner ℝ (z-y) v| ≤ ‖z-y‖ * ‖v‖ := abs_real_inner_le_norm _ _ + _ = dist z y := by rw [hv.1, mul_one, dist_eq_norm] + _ < ε := hzy + +def orientedTilt {n : ℕ} (E : Set (Euc n)) (v : Euc n) (U : Set (Euc n)) : ℝ := + ∫ x in U, ‖approximateNormal E x - v‖^2 ∂perimeterMeasure E + +theorem orientedTilt_le_calibration_gap {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + {v : Euc n} (hv : ‖v‖ = 1) {a b : ℝ} (ha : 0 < a) (hab : a < b) + {η : Euc n → ℝ} (hη : ContDiff ℝ ∞ η) (hc : HasCompactSupport η) + (hs : tsupport η ⊆ Metric.ball 0 b) (hb : ∀ x, η x ∈ Icc (0:ℝ) 1) + (hone : ∀ x ∈ Metric.ball 0 a, η x = 1) : + orientedTilt E v (Metric.ball 0 a) ≤ + 2 * ((perimeter E (Metric.ball 0 b)).toReal - + ∫ x in E, divergence (fun y ↦ η y • v) x) := by + let μ := (perimeterMeasure E).restrict (Metric.ball 0 b) + have hbf : 0 < b := ha.trans hab + have : IsFiniteMeasure μ := ⟨by + rw [Measure.restrict_apply_univ, perimeterMeasure_open E Metric.isOpen_ball] + exact hmin.2.1 0 b hbf⟩ + have hnb : ∀ x, |inner ℝ (approximateNormal E x) v| ≤ 1 := by + intro x + exact (abs_real_inner_le_norm _ _).trans (by + rw [hv, mul_one]; exact approximateNormal_norm_le_one E x) + have hp : ∀ x, |inner ℝ (approximateNormal E x) (η x • v)| ≤ 1 := by + intro x + rw [real_inner_smul_right, abs_mul, abs_of_nonneg (hb x).1] + exact (mul_le_mul_of_nonneg_left (hnb x) (hb x).1).trans (by simpa using (hb x).2) + have hnormal := measurable_approximateNormal hmin.1 + have hflux : Integrable (fun x ↦ inner ℝ (approximateNormal E x) (η x • v)) μ := + (integrable_const (1:ℝ)).mono' + (hnormal.inner (hη.continuous.measurable.smul measurable_const)).aestronglyMeasurable + (ae_of_all μ fun x ↦ by simpa only [Real.norm_eq_abs] using hp x) + have htilt : Integrable (fun x ↦ ‖approximateNormal E x - v‖^2) μ := by + apply (integrable_const (4:ℝ)).mono' + ((hnormal.sub measurable_const).norm.pow_const 2).aestronglyMeasurable + apply ae_of_all μ + intro x + rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] + have hbound : ‖approximateNormal E x-v‖ ≤ 2 := + (norm_sub_le _ _).trans (by rw [hv]; linarith [approximateNormal_norm_le_one E x]) + change ‖approximateNormal E x-v‖^2 ≤ 4 + nlinarith [norm_nonneg (approximateNormal E x-v)] + have hgg := minimizing_gaussGreen_local hn hmin (Metric.ball 0 b) Metric.isOpen_ball + (hmin.2.1 0 b hbf).ne (fun x ↦ η x • v) (hη.smul contDiff_const) + hc.smul_right (tsupport_smul_subset_left _ _ |>.trans hs) + have hle : ∀ x, (Metric.ball (0:Euc n) a).indicator + (fun x ↦ ‖approximateNormal E x-v‖^2) x ≤ + 2 * (1 - inner ℝ (approximateNormal E x) (η x • v)) := by + intro x + by_cases hx : x ∈ Metric.ball (0:Euc n) a + · rw [indicator_of_mem hx, hone x hx, one_smul, norm_sub_sq_real, hv] + have hh := approximateNormal_norm_le_one E x + have hpos := norm_nonneg (approximateNormal E x) + nlinarith + · rw [indicator_of_notMem hx] + have hh := (le_abs_self _).trans (hp x) + linarith + have hh := integral_mono (htilt.indicator measurableSet_ball) + (((integrable_const (1:ℝ)).sub hflux).const_mul 2) hle + rw [integral_indicator measurableSet_ball, Measure.restrict_restrict measurableSet_ball, + inter_eq_left.mpr (Metric.ball_subset_ball hab.le)] at hh + rw [integral_const_mul] at hh + simp only [Pi.sub_apply] at hh + rw [integral_sub (integrable_const _) hflux, integral_const] at hh + change orientedTilt E v (Metric.ball 0 a) ≤ 2 * (μ.real univ * 1 - _) at hh + have hmass : μ.real univ = (perimeter E (Metric.ball 0 b)).toReal := by + simp [μ, measureReal_def] + rw [hmass, mul_one] at hh + exact hgg ▸ hh + +theorem exists_halfspace_calibration {n : ℕ} (hn : 1 < n) {v : Euc n} + (hv : ‖v‖ = 1) + (hH : IsLocallyPerimeterMinimizing {x : Euc n | inner ℝ x v < 0}) + {a b : ℝ} (ha : 0 < a) (hab : a < b) {ε : ℝ} (hε : 0 < ε) : + ∃ η : Euc n → ℝ, ContDiff ℝ ∞ η ∧ HasCompactSupport η ∧ + tsupport η ⊆ Metric.ball 0 b ∧ (∀ x, η x ∈ Icc (0:ℝ) 1) ∧ + (∀ x ∈ Metric.ball 0 a, η x = 1) ∧ + (perimeter {x : Euc n | inner ℝ x v < 0} (Metric.ball 0 b)).toReal - ε < + ∫ x in {x : Euc n | inner ℝ x v < 0}, divergence (fun y ↦ η y • v) x := by + let H : Set (Euc n) := {x | inner ℝ x v < 0} + let μ := (perimeterMeasure H).restrict (Metric.ball 0 b) + have hb : 0 < b := ha.trans hab + have : IsFiniteMeasure μ := ⟨by + rw [Measure.restrict_apply_univ, perimeterMeasure_open H Metric.isOpen_ball] + exact hH.2.1 0 b hb⟩ + let s : ℕ → ℝ := fun j ↦ (1-(1/2:ℝ)^(j+1))*b + have hs0 (j : ℕ) : 0 < s j := by + have hh : (1/2:ℝ)^(j+1) < 1 := pow_lt_one₀ (by norm_num) (by norm_num) (by omega) + exact mul_pos (sub_pos.mpr hh) hb + have hsb (j : ℕ) : s j < b := by + have hh : 0 < (1/2:ℝ)^(j+1) := pow_pos (by norm_num) _ + dsimp [s] + nlinarith + have ht : Tendsto s atTop (𝓝 b) := by + have hpow := (tendsto_pow_atTop_nhds_zero_of_lt_one (by norm_num : (0:ℝ) ≤ 1/2) + (by norm_num : (1/2:ℝ) < 1)).mul_const (1/2:ℝ) + simpa only [s, pow_succ, zero_mul, sub_zero, one_mul] using + (tendsto_const_nhds (x := (1:ℝ))).sub hpow |>.mul_const b + obtain ⟨L, hL, hcut⟩ := exists_interior_cutoff_constant + choose η hη hc hsupport hbound hone hgrad using + (fun j ↦ hcut n H (s j) b (hs0 j) (hsb j)) + have hnH : ∀ᵐ x ∂μ, approximateNormal H x = v := by + have hsupp : ∀ᵐ x ∂perimeterMeasure H, x ∈ perimeterSupport H := by + rw [← perimeterMeasure_support H] + exact (perimeterMeasure H).support_mem_ae + filter_upwards [ae_restrict_of_ae hsupp] with x hx + exact approximateNormal_eq_of_blowup hH.1 + (halfspace_hasHalfspaceBlowup hv (halfspace_perimeterSupport_subset_plane v hx)) + have heq (j : ℕ) : (∫ x in H, divergence (fun y ↦ η j y • v) x) = ∫ x, η j x ∂μ := by + rw [minimizing_gaussGreen_local hn hH (Metric.ball 0 b) Metric.isOpen_ball + (hH.2.1 0 b hb).ne (fun x ↦ η j x • v) ((hη j).smul contDiff_const) + (hc j).smul_right (tsupport_smul_subset_left _ _ |>.trans (hsupport j))] + apply integral_congr_ae + filter_upwards [hnH] with x hx + rw [hx, real_inner_smul_right, real_inner_self_eq_norm_sq, hv] + ring + have hlim : Tendsto (fun j ↦ ∫ x, η j x ∂μ) atTop + (𝓝 ((perimeter H (Metric.ball 0 b)).toReal)) := by + have hpoint : ∀ᵐ x ∂μ, Tendsto (fun j ↦ η j x) atTop (𝓝 (1:ℝ)) := by + filter_upwards [ae_restrict_mem measurableSet_ball] with x hx + apply tendsto_const_nhds.congr' + filter_upwards [ht.eventually (lt_mem_nhds (Metric.mem_ball.mp hx))] with j hj + exact (hone j x (Metric.mem_ball.mpr hj)).symm + have hh := tendsto_integral_of_dominated_convergence (μ := μ) (fun _ ↦ (1:ℝ)) + (fun j ↦ (hη j).continuous.aestronglyMeasurable) (integrable_const _) + (fun j ↦ ae_of_all μ fun x ↦ by + rw [Real.norm_eq_abs, abs_of_nonneg (hbound j x).1] + exact (hbound j x).2) hpoint + simpa [μ, integral_const, measureReal_def] using hh + have hnear := hlim.eventually + (lt_mem_nhds (sub_lt_self _ hε)) + obtain ⟨j, hj, haj⟩ := (hnear.and (ht.eventually (lt_mem_nhds hab))).exists + refine ⟨η j, hη j, hc j, hsupport j, hbound j, ?_, ?_⟩ + · intro x hx + exact hone j x (Metric.ball_subset_ball haj.le hx) + · rwa [heq j] + +theorem HasHalfspaceBlowup.orientedTilt_tendsto {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + {p v : Euc n} (hv : HasHalfspaceBlowup E p v) + (r : ℕ → ℝ) (hr : ∀ i, 0 < r i) (htr : Tendsto r atTop (𝓝 0)) + {R : ℝ} (hR : 0 < R) : + Tendsto (fun i ↦ orientedTilt (blownUpSet E p (r i)) v (Metric.ball 0 R)) + atTop (𝓝 0) := by + let H : Set (Euc n) := {x | inner ℝ x v < 0} + have hH : MeasurableSet H := + (isOpen_lt (continuous_id.inner continuous_const) continuous_const).measurableSet + have hconv := hv.local_L1 hmin.1 r hr htr + have hEm (i : ℕ) := locally_minimizing_blownUpSet hmin p (hr i) + have hHm := locally_minimizing_of_local_L1_limit (by omega : 0 < n) hEm hH hconv + obtain ⟨b, hnull, hRb, hbR⟩ := (minimizing_dense_null_spheres hHm (0:Euc n)).exists_between + (show R < R+1 by linarith) + have hb : 0 < b := hR.trans hRb + have hmass := (ENNReal.tendsto_toReal (hHm.2.1 0 b hb).ne).comp + (tendsto_minimizing_perimeter_ball_of_local_L1 (by omega : 0 < n) hEm hH hconv 0 hb hnull) + apply tendsto_order.2 + constructor + · intro A hA + exact Eventually.of_forall fun i ↦ hA.trans_le (integral_nonneg fun _ ↦ sq_nonneg _) + · intro ε hε + obtain ⟨η, hη, hcη, hsη, hbη, honeη, hcal⟩ := + exists_halfspace_calibration hn hv.1 hHm hR hRb (by positivity : 0 < ε/4) + have htflux := tendsto_setIntegral_of_local_symmDiff (fun i ↦ (hEm i).1) hH hconv + (continuous_divergence (hη.smul contDiff_const)) + (hcη.smul_right.of_isClosed_subset (isClosed_tsupport _) + (tsupport_divergence_subset (fun y ↦ η y • v))) + have htgap := (hmass.sub htflux).const_mul 2 + have hgap : 2 *((perimeter H (Metric.ball 0 b)).toReal - + ∫ x in H, divergence (fun y ↦ η y • v) x) < ε := by linarith + filter_upwards [htgap.eventually (gt_mem_nhds hgap)] with i hi + exact (orientedTilt_le_calibration_gap hn (hEm i) hv.1 hR hRb + hη hcη hsη hbη honeη).trans_lt hi + +theorem HasHalfspaceBlowup.orientedTilt_tendsto_all_scales {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + {p v : Euc n} (hv : HasHalfspaceBlowup E p v) {R : ℝ} (hR : 0 < R) : + Tendsto (fun r : ℝ ↦ orientedTilt (blownUpSet E p r) v (Metric.ball 0 R)) + (𝓝[>] (0:ℝ)) (𝓝 0) := by + apply Filter.tendsto_of_seq_tendsto + intro r ht + let s : ℕ → ℝ := fun i ↦ if 0 < r i then r i else 1 + have hs : ∀ i, 0 < s i := by + intro i + dsimp [s] + split_ifs with h + · exact h + · norm_num + have heq : s =ᶠ[atTop] r := by + filter_upwards [ht.eventually self_mem_nhdsWithin] with i hi + simp [s, hi] + have hs0 : Tendsto s atTop (𝓝 (0:ℝ)) := + (tendsto_nhds_of_tendsto_nhdsWithin ht).congr' heq.symm + have hh := hv.orientedTilt_tendsto hn hmin s hs hs0 hR + apply hh.congr' + exact heq.fun_comp (fun a ↦ orientedTilt (blownUpSet E p a) v (Metric.ball 0 R)) + +theorem HasHalfspaceBlowup.support_height_all_scales {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + {p v : Euc n} (hv : HasHalfspaceBlowup E p v) + {C : Set (Euc n)} (hC : IsCompact C) {ε : ℝ} (hε : 0 < ε) : + ∀ᶠ r : ℝ in 𝓝[>] 0, ∀ z ∈ perimeterSupport (blownUpSet E p r) ∩ C, + |inner ℝ z v| < ε := by + apply Filter.eventually_iff_seq_eventually.2 + intro r ht + let s : ℕ → ℝ := fun i ↦ if 0 < r i then r i else 1 + have hs : ∀ i, 0 < s i := by + intro i + dsimp [s] + split_ifs with h + · exact h + · norm_num + have heq : s =ᶠ[atTop] r := by + filter_upwards [ht.eventually self_mem_nhdsWithin] with i hi + simp [s, hi] + have hs0 : Tendsto s atTop (𝓝 (0:ℝ)) := + (tendsto_nhds_of_tendsto_nhdsWithin ht).congr' heq.symm + filter_upwards [hv.support_height hn hmin s hs hs0 hC hε, heq] with i hi he + rwa [he] at hi + +theorem HasHalfspaceBlowup.small_height_and_orientedTilt {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + {p v : Euc n} (hv : HasHalfspaceBlowup E p v) + {R ε : ℝ} (hR : 0 < R) (hε : 0 < ε) : + ∀ᶠ r : ℝ in 𝓝[>] 0, + (∀ z ∈ perimeterSupport (blownUpSet E p r) ∩ Metric.closedBall 0 R, + |inner ℝ z v| < ε) ∧ + orientedTilt (blownUpSet E p r) v (Metric.ball 0 R) < ε := by + exact (hv.support_height_all_scales hn hmin (isCompact_closedBall 0 R) hε).and + ((hv.orientedTilt_tendsto_all_scales hn hmin hR).eventually (gt_mem_nhds hε)) + +theorem minimizing_height_caccioppoli {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (c v : Euc n) (a : ℝ) {R : ℝ} (hR : 0 < R) + {η : Euc n → ℝ} (hη : ContDiff ℝ ∞ η) (hc : HasCompactSupport η) + (hs : tsupport η ⊆ Metric.ball c R) : + (∫ x in Metric.ball c R, + η x ^ 2 * ‖tangentialGradient E (fun y ↦ inner ℝ v y - a) x‖ ^ 2 + ∂perimeterMeasure E) ≤ + 4 * ∫ x in Metric.ball c R, (inner ℝ v x - a)^2 * ‖gradient η x‖^2 + ∂perimeterMeasure E := by + let H : Euc n → ℝ := fun x ↦ inner ℝ v x - a + have hH : ContDiff ℝ ∞ H := (contDiff_const.inner ℝ contDiff_id).sub contDiff_const + have hgH (x : Euc n) : gradient H x = v := by + apply HasGradientAt.gradient + change HasFDerivAt H ((InnerProductSpace.toDual ℝ (Euc n)) v) x + exact (innerSL ℝ v).hasFDerivAt.sub_const a + let φ : Euc n → ℝ := fun x ↦ (η x * η x) * H x + have hφ : ContDiff ℝ ∞ φ := (hη.mul hη).mul hH + have hcφ : HasCompactSupport φ := (hc.mul_right).mul_right + have hsφ : tsupport φ ⊆ Metric.ball c R := + tsupport_mul_subset_left.trans (tsupport_mul_subset_left.trans hs) + let μ := (perimeterMeasure E).restrict (Metric.ball c R) + let := perimeterMeasure_locallyFinite E hmin.2.1 + have : IsFiniteMeasure μ := ⟨by + simp only [μ, Measure.restrict_apply_univ, perimeterMeasure_open E Metric.isOpen_ball] + exact hmin.2.1 c R hR⟩ + have hgd : Continuous (gradient η) := continuous_iff_continuousAt.mpr fun x ↦ + RPI.Boundary.continuousAt_gradient_of_contDiffAt (hη.contDiffAt.of_le (by simp)) + obtain ⟨M, hM⟩ := hc.exists_bound_of_continuous hη.continuous + have hM0 : 0 ≤ M := (norm_nonneg (η c)).trans (hM c) + have hA : MemLp (fun x ↦ η x • tangentialGradient E H x) (2:ℝ≥0∞) μ := by + apply MemLp.of_bound + (hη.continuous.aestronglyMeasurable.smul + (measurable_tangentialGradient hmin.1 (hH.of_le (by simp))).aestronglyMeasurable) + (M * (2 * ‖v‖)) + apply ae_of_all μ + intro x + change ‖η x • tangentialGradient E H x‖ ≤ _ + rw [norm_smul] + exact mul_le_mul (hM x) + ((tangentialGradient_norm_le_twice E H x).trans_eq (by rw [hgH])) + (norm_nonneg _) hM0 + have hIA : Integrable (fun x ↦ η x^2 * ‖tangentialGradient E H x‖^2) μ := by + simpa only [norm_smul, mul_pow, Real.norm_eq_abs, sq_abs] using + hA.integrable_norm_pow (by norm_num : (2:ℕ) ≠ 0) + have hIB : Integrable (fun x ↦ H x^2 * ‖gradient η x‖^2) μ := by + apply IntegrableOn.mono_set + (ContinuousOn.integrableOn_compact (isCompact_closedBall c R) + ((hH.continuous.pow 2).mul (hgd.norm.pow 2)).continuousOn) + Metric.ball_subset_closedBall + have hIJ : Integrable (fun x ↦ inner ℝ (tangentialGradient E φ x) v) μ := + (tangentialGradient_integrable_ball_perimeter hmin c hR + (hφ.of_le (by simp))).inner_const v + have hz := minimizing_tangentialGradient_integral_eq_zero_local hn hmin c hR hφ hcφ hsφ v + have hp : ∀ᵐ x ∂μ, + η x^2 * ‖tangentialGradient E H x‖^2 ≤ + 2 * inner ℝ (tangentialGradient E φ x) v + 4 * (H x^2 * ‖gradient η x‖^2) := by + filter_upwards [ae_restrict_of_ae (minimizing_halfspaceBlowup_ae hn hmin)] with x hx + have hW : inner ℝ (tangentialGradient E H x) v = + ‖tangentialGradient E H x‖^2 := by + simp only [tangentialGradient, hgH, inner_sub_left, real_inner_smul_left, + norm_sub_sq_real, norm_smul, Real.norm_eq_abs, sq_abs, + real_inner_smul_right, hx.1, mul_one, real_inner_self_eq_norm_sq] + rw [real_inner_comm (approximateNormal E x) v] + ring + have hG : inner ℝ (tangentialGradient E η x) v = + inner ℝ (gradient η x) (tangentialGradient E H x) := by + simp only [tangentialGradient, hgH, inner_sub_left, real_inner_smul_left, + inner_sub_right, real_inner_smul_right] + rw [real_inner_comm (approximateNormal E x) v] + ring + have hD : inner ℝ (tangentialGradient E φ x) v = + η x^2 * ‖tangentialGradient E H x‖^2 + + 2 * η x * H x * inner ℝ (gradient η x) (tangentialGradient E H x) := by + dsimp only [φ] + rw [tangentialGradient_mul E ((hη.differentiable (by simp) x).fun_mul + (hη.differentiable (by simp) x)) (hH.differentiable (by simp) x), + tangentialGradient_mul E (hη.differentiable (by simp) x) + (hη.differentiable (by simp) x)] + simp only [inner_add_left, real_inner_smul_left, hW, hG] + ring + have hnn := sq_nonneg ‖η x • tangentialGradient E H x + (2 * H x) • gradient η x‖ + rw [norm_add_sq_real] at hnn + simp only [norm_smul, Real.norm_eq_abs, mul_pow, sq_abs, + real_inner_smul_left, real_inner_smul_right] at hnn + have hiComm := real_inner_comm (tangentialGradient E H x) (gradient η x) + rw [← hiComm] at hnn + rw [hD] + nlinarith only [hnn] + have hi := integral_mono_ae hIA ((hIJ.const_mul 2).add (hIB.const_mul 4)) hp + simp only [Pi.add_apply] at hi + rw [integral_add (hIJ.const_mul 2) (hIB.const_mul 4), integral_const_mul, + integral_const_mul] at hi + change (∫ x, η x^2 * ‖tangentialGradient E H x‖^2 ∂μ) ≤ + 2 * (∫ x in Metric.ball c R, inner ℝ (tangentialGradient E φ x) v ∂perimeterMeasure E) + _ at hi + rw [hz, mul_zero, zero_add] at hi + exact hi + +theorem minimizing_height_distribution {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (c : Euc n) {R : ℝ} (hR : 0 < R) (v : Euc n) (a : ℝ) + {φ : Euc n → ℝ} (hφ : ContDiff ℝ ∞ φ) (hcφ : HasCompactSupport φ) + (hsφ : tsupport φ ⊆ Metric.ball c R) : + (∫ x in Metric.ball c R, (inner ℝ v x - a) * + tangentialDivergence E (gradient φ) x ∂perimeterMeasure E) = 0 := by + let H : Euc n → ℝ := fun x ↦ inner ℝ v x - a + have hH : ContDiff ℝ ∞ H := (contDiff_const.inner ℝ contDiff_id).sub contDiff_const + have hgH (x : Euc n) : gradient H x = v := by + apply HasGradientAt.gradient + change HasFDerivAt H ((InnerProductSpace.toDual ℝ (Euc n)) v) x + exact (innerSL ℝ v).hasFDerivAt.sub_const a + have hG := gradient_contDiff hφ + have hcG := gradient_hasCompactSupport hcφ + have hsG : tsupport (gradient φ) ⊆ Metric.ball c R := by + exact (tsupport_comp_subset (g := (InnerProductSpace.toDual ℝ (Euc n)).symm) + (map_zero _) (fderiv ℝ φ)).trans ((tsupport_fderiv_subset ℝ).trans hsφ) + let V : Euc n → Euc n := fun x ↦ H x • gradient φ x + have hV : ContDiff ℝ ∞ V := hH.smul (𝕜' := ℝ) hG + have hcV : HasCompactSupport V := hcG.smul_left (f := H) + have hsV : tsupport V ⊆ Metric.ball c R := + (tsupport_smul_subset_right H (gradient φ)).trans hsG + have heq (x : Euc n) : + H x * tangentialDivergence E (gradient φ) x = + tangentialDivergence E V x - inner ℝ (tangentialGradient E φ x) v := by + rw [show V = fun y ↦ H y • gradient φ y from rfl, + tangentialDivergence_smul E (hH.differentiable (by simp)) + (hG.differentiable (by simp))] + simp only [tangentialGradient, hgH, inner_sub_left, real_inner_smul_left] + rw [real_inner_comm v (gradient φ x), + real_inner_comm (approximateNormal E x) (gradient φ x), + real_inner_comm (approximateNormal E x) v] + ring + change (∫ x in Metric.ball c R, H x * tangentialDivergence E (gradient φ) x ∂perimeterMeasure E) = 0 + simp_rw [heq] + rw [integral_sub (tangentialDivergence_integrable_ball_perimeter hmin c hR hV) + ((tangentialGradient_integrable_ball_perimeter hmin c hR + (hφ.of_le (by simp))).inner_const v), + minimizing_tangentialDivergence_integral_eq_zero hn hmin c hR hV hcV hsV, + minimizing_tangentialGradient_integral_eq_zero_local hn hmin c hR hφ hcφ hsφ v, + sub_self] + +def planarDivergence {n : ℕ} (v : Euc n) (V : Euc n → Euc n) (x : Euc n) : ℝ := + divergence V x - inner ℝ v (fderiv ℝ V x v) + +theorem normal_quadratic_difference_le {n : ℕ} (L : Euc n →L[ℝ] Euc n) + {u v : Euc n} (hu : ‖u‖ ≤ 1) (hv : ‖v‖ ≤ 1) : + |inner ℝ u (L u) - inner ℝ v (L v)| ≤ 2 * ‖L‖ * ‖u-v‖ := by + have he : inner ℝ u (L u) - inner ℝ v (L v) = + inner ℝ (u-v) (L u) + inner ℝ v (L (u-v)) := by + rw [map_sub, inner_sub_left, inner_sub_right] + ring + rw [he] + calc + _ ≤ |inner ℝ (u-v) (L u)| + |inner ℝ v (L (u-v))| := abs_add_le _ _ + _ ≤ ‖u-v‖ * (‖L‖ * ‖u‖) + ‖v‖ * (‖L‖ * ‖u-v‖) := by + apply add_le_add + · simpa only [Real.norm_eq_abs] using + (norm_inner_le_norm (𝕜 := ℝ) (u-v) (L u)).trans + (mul_le_mul_of_nonneg_left (L.le_opNorm u) (norm_nonneg _)) + · simpa only [Real.norm_eq_abs] using + (norm_inner_le_norm (𝕜 := ℝ) v (L (u-v))).trans + (mul_le_mul_of_nonneg_left (L.le_opNorm (u-v)) (norm_nonneg _)) + _ ≤ ‖u-v‖ * (‖L‖ * 1) + 1 * (‖L‖ * ‖u-v‖) := by + apply add_le_add + · exact mul_le_mul_of_nonneg_left + (mul_le_mul_of_nonneg_left hu (norm_nonneg _)) (norm_nonneg _) + · exact mul_le_mul_of_nonneg_right hv (mul_nonneg (norm_nonneg _) (norm_nonneg _)) + _ = _ := by ring + +theorem normal_error_integral_le {n : ℕ} {E : Set (Euc n)} + (hmin : IsLocallyPerimeterMinimizing E) (c : Euc n) {R : ℝ} (hR : 0 < R) + (v : Euc n) : + (∫ x in Metric.ball c R, ‖approximateNormal E x - v‖ ∂perimeterMeasure E) ≤ + Real.sqrt (orientedTilt E v (Metric.ball c R)) * + Real.sqrt ((perimeter E (Metric.ball c R)).toReal) := by + let μ := (perimeterMeasure E).restrict (Metric.ball c R) + have : IsFiniteMeasure μ := ⟨by + rw [Measure.restrict_apply_univ, perimeterMeasure_open E Metric.isOpen_ball] + exact hmin.2.1 c R hR⟩ + have hmem : MemLp (fun x ↦ ‖approximateNormal E x - v‖) (ENNReal.ofReal (2:ℝ)) μ := by + apply MemLp.of_bound + (((measurable_approximateNormal hmin.1).sub measurable_const).norm.aestronglyMeasurable) + (1+‖v‖) + exact ae_of_all μ fun x ↦ by + rw [Real.norm_of_nonneg (norm_nonneg _)] + exact (norm_sub_le _ _).trans (add_le_add (approximateNormal_norm_le_one E x) le_rfl) + have hh := integral_mul_le_Lp_mul_Lq_of_nonneg + (show (2:ℝ).HolderConjugate 2 from Real.holderConjugate_iff.mpr ⟨by norm_num, by norm_num⟩) + (ae_of_all μ fun _ ↦ norm_nonneg _) (ae_of_all μ fun _ ↦ (zero_le_one : (0:ℝ) ≤ 1)) + hmem (memLp_const (1:ℝ)) + simpa only [mul_one, Real.rpow_two, one_pow, integral_const, smul_eq_mul, mul_one, + μ, Measure.real, Measure.restrict_apply_univ, perimeterMeasure_open E Metric.isOpen_ball, + ← Real.sqrt_eq_rpow, orientedTilt] using hh + +theorem minimizing_height_planar_residual {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (c : Euc n) {R : ℝ} (hR : 0 < R) {v : Euc n} (hv : ‖v‖ = 1) (a : ℝ) + {φ : Euc n → ℝ} (hφ : ContDiff ℝ ∞ φ) (hcφ : HasCompactSupport φ) + (hsφ : tsupport φ ⊆ Metric.ball c R) + {A K : ℝ} (hA : 0 ≤ A) (hK : 0 ≤ K) + (hheight : ∀ x ∈ perimeterSupport E ∩ Metric.ball c R, |inner ℝ v x - a| ≤ A) + (hderiv : ∀ x ∈ Metric.ball c R, ‖fderiv ℝ (gradient φ) x‖ ≤ K) : + |∫ x in Metric.ball c R, (inner ℝ v x - a) * + planarDivergence v (gradient φ) x ∂perimeterMeasure E| ≤ + 2 * A * K * (Real.sqrt (orientedTilt E v (Metric.ball c R)) * + Real.sqrt ((perimeter E (Metric.ball c R)).toReal)) := by + let μ := (perimeterMeasure E).restrict (Metric.ball c R) + let H : Euc n → ℝ := fun x ↦ inner ℝ v x - a + let G := gradient φ + have hg := gradient_contDiff hφ + have hH : Continuous H := (continuous_const.inner continuous_id).sub continuous_const + have := perimeterMeasure_locallyFinite E hmin.2.1 + have : IsFiniteMeasure μ := ⟨by + rw [Measure.restrict_apply_univ, perimeterMeasure_open E Metric.isOpen_ball] + exact hmin.2.1 c R hR⟩ + have hbH : ∀ᵐ x ∂μ, |H x| ≤ A := by + have hmm : ∀ᵐ x ∂perimeterMeasure E, x ∈ perimeterSupport E := by + rw [← perimeterMeasure_support]; exact (perimeterMeasure E).support_mem_ae + filter_upwards [ae_restrict_of_ae hmm, ae_restrict_mem measurableSet_ball] with x hx hx' + exact hheight x ⟨hx, hx'⟩ + have hpcont : Continuous (planarDivergence v G) := + (continuous_divergence hg).sub + (continuous_const.inner ((hg.continuous_fderiv (by simp)).clm_apply continuous_const)) + have hpint : Integrable (fun x ↦ H x * planarDivergence v G x) μ := + ((hH.mul hpcont).continuousOn.integrableOn_compact (isCompact_closedBall c R)).mono_set + Metric.ball_subset_closedBall + have htint : Integrable (fun x ↦ H x * tangentialDivergence E G x) μ := + (tangentialDivergence_integrable_ball_perimeter hmin c hR hg).bdd_mul + hH.aestronglyMeasurable (by simpa only [Real.norm_eq_abs] using hbH) + have hiN : Integrable (fun x ↦ ‖approximateNormal E x-v‖) μ := by + apply Integrable.of_bound + (((measurable_approximateNormal hmin.1).sub measurable_const).norm.aestronglyMeasurable) + 2 + apply ae_of_all μ + intro x + rw [Real.norm_of_nonneg (norm_nonneg _)] + exact (norm_sub_le _ _).trans (by + simp only [hv]; linarith [approximateNormal_norm_le_one E x]) + have heq : (∫ x, H x * planarDivergence v G x ∂μ) = + ∫ x, H x * planarDivergence v G x - H x * tangentialDivergence E G x ∂μ := by + rw [integral_sub hpint htint] + have hz := minimizing_height_distribution hn hmin c hR v a hφ hcφ hsφ + change (∫ x, H x * tangentialDivergence E G x ∂μ) = 0 at hz + rw [hz, sub_zero] + have hb : ∀ᵐ x ∂μ, + |H x * planarDivergence v G x - H x * tangentialDivergence E G x| ≤ + (2*A*K) * ‖approximateNormal E x-v‖ := by + filter_upwards [hbH, ae_restrict_mem measurableSet_ball] with x hx hxB + have hq := normal_quadratic_difference_le (fderiv ℝ G x) + (approximateNormal_norm_le_one E x) hv.le + have haeq : H x * planarDivergence v G x - H x * tangentialDivergence E G x = + H x * (inner ℝ (approximateNormal E x) (fderiv ℝ G x (approximateNormal E x)) - + inner ℝ v (fderiv ℝ G x v)) := by + dsimp [planarDivergence, tangentialDivergence] + ring + rw [haeq, abs_mul] + calc + _ ≤ A * (2 * ‖fderiv ℝ G x‖ * ‖approximateNormal E x-v‖) := + mul_le_mul hx hq (abs_nonneg _) hA + _ ≤ A * (2 * K * ‖approximateNormal E x-v‖) := by + apply mul_le_mul_of_nonneg_left _ hA + exact mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left + (hderiv x hxB) (by norm_num)) (norm_nonneg _) + _ = _ := by ring + change |∫ x, H x * planarDivergence v G x ∂μ| ≤ _ + rw [heq] + calc + _ ≤ ∫ x, |H x * planarDivergence v G x - H x * tangentialDivergence E G x| ∂μ := + abs_integral_le_integral_abs + _ ≤ ∫ x, (2*A*K) * ‖approximateNormal E x-v‖ ∂μ := + integral_mono_ae (hpint.sub htint).abs (hiN.const_mul _) hb + _ = (2*A*K) * ∫ x, ‖approximateNormal E x-v‖ ∂μ := integral_const_mul _ _ + _ ≤ _ := mul_le_mul_of_nonneg_left (normal_error_integral_le hmin c hR v) + (mul_nonneg (mul_nonneg (by norm_num) hA) hK) + +theorem horizontal_normal_le_height_projection {n : ℕ} {N v w : Euc n} + (hN : ‖N‖ = 1) (hv : ‖v‖ = 1) (hw : inner ℝ v w = 0) : + |inner ℝ N w| ≤ ‖v - (inner ℝ N v) • N‖ * ‖w‖ := by + have he : inner ℝ (N - (inner ℝ N v) • v) w = inner ℝ N w := by + simp [inner_sub_left, real_inner_smul_left, hw] + have hs : ‖N - (inner ℝ N v) • v‖ ^ 2 = + ‖v - (inner ℝ N v) • N‖ ^ 2 := by + simp only [norm_sub_sq_real, norm_smul, Real.norm_eq_abs, sq_abs, + real_inner_smul_right, hN, hv, one_pow, mul_one] + rw [real_inner_comm v N] + have hn : ‖N - (inner ℝ N v) • v‖ = ‖v - (inner ℝ N v) • N‖ := by + nlinarith [norm_nonneg (N - (inner ℝ N v) • v), + norm_nonneg (v - (inner ℝ N v) • N)] + rw [← he] + simpa only [Real.norm_eq_abs, hn] using + norm_inner_le_norm (𝕜 := ℝ) (N - (inner ℝ N v) • v) w + +theorem minimizing_horizontal_normal_square_le {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (c : Euc n) {v w : Euc n} (hv : ‖v‖ = 1) (hw : inner ℝ v w = 0) + (a : ℝ) {R : ℝ} (hR : 0 < R) + {η : Euc n → ℝ} (hη : ContDiff ℝ ∞ η) (hc : HasCompactSupport η) + (hs : tsupport η ⊆ Metric.ball c R) : + (∫ x in Metric.ball c R, (η x * inner ℝ (approximateNormal E x) w)^2 + ∂perimeterMeasure E) ≤ + 4 * ‖w‖^2 * ∫ x in Metric.ball c R, (inner ℝ v x - a)^2 * ‖gradient η x‖^2 + ∂perimeterMeasure E := by + let μ := (perimeterMeasure E).restrict (Metric.ball c R) + let H : Euc n → ℝ := fun x ↦ inner ℝ v x-a + have hH : ContDiff ℝ ∞ H := (contDiff_const.inner ℝ contDiff_id).sub contDiff_const + have hgH (x : Euc n) : gradient H x = v := by + apply HasGradientAt.gradient + change HasFDerivAt H ((InnerProductSpace.toDual ℝ (Euc n)) v) x + exact (innerSL ℝ v).hasFDerivAt.sub_const a + have : IsFiniteMeasure μ := ⟨by + rw [Measure.restrict_apply_univ, perimeterMeasure_open E Metric.isOpen_ball] + exact hmin.2.1 c R hR⟩ + obtain ⟨M, hM⟩ := hc.exists_bound_of_continuous hη.continuous + have hM0 : 0 ≤ M := (norm_nonneg (η c)).trans (hM c) + have hLI : Integrable (fun x ↦ (η x * inner ℝ (approximateNormal E x) w)^2) μ := by + have hh : MemLp (fun x ↦ η x * inner ℝ (approximateNormal E x) w) 2 μ := by + apply MemLp.of_bound + (hη.continuous.aestronglyMeasurable.mul + ((measurable_approximateNormal hmin.1).inner measurable_const).aestronglyMeasurable) + (M * ‖w‖) + apply ae_of_all μ + intro x + change ‖η x * inner ℝ (approximateNormal E x) w‖ ≤ _ + rw [norm_mul] + have hb : ‖inner ℝ (approximateNormal E x) w‖ ≤ ‖w‖ := + (norm_inner_le_norm (𝕜 := ℝ) _ _).trans (by + simpa only [one_mul] using mul_le_mul_of_nonneg_right + (approximateNormal_norm_le_one E x) (norm_nonneg w)) + exact mul_le_mul (hM x) hb (norm_nonneg _) hM0 + simpa only [Real.norm_eq_abs, sq_abs] using hh.integrable_norm_pow + (by norm_num : (2:ℕ) ≠ 0) + have hRI : Integrable (fun x ↦ η x^2 * ‖tangentialGradient E H x‖^2) μ := by + have hh : MemLp (fun x ↦ η x • tangentialGradient E H x) 2 μ := by + apply MemLp.of_bound + (hη.continuous.aestronglyMeasurable.smul + (measurable_tangentialGradient hmin.1 (hH.of_le (by simp))).aestronglyMeasurable) + (M * (2*‖v‖)) + apply ae_of_all μ + intro x + change ‖η x • tangentialGradient E H x‖ ≤ _ + rw [norm_smul] + exact mul_le_mul (hM x) ((tangentialGradient_norm_le_twice E H x).trans_eq + (by rw [hgH])) (norm_nonneg _) hM0 + simpa only [norm_smul, mul_pow, Real.norm_eq_abs, sq_abs] using + hh.integrable_norm_pow (by norm_num : (2:ℕ) ≠ 0) + have hp : ∀ᵐ x ∂μ, (η x * inner ℝ (approximateNormal E x) w)^2 ≤ + ‖w‖^2 * (η x^2 * ‖tangentialGradient E H x‖^2) := by + filter_upwards [ae_restrict_of_ae (minimizing_halfspaceBlowup_ae hn hmin)] with x hx + have hh := horizontal_normal_le_height_projection hx.1 hv hw + change |inner ℝ (approximateNormal E x) w| ≤ + ‖v - (inner ℝ (approximateNormal E x) v) • approximateNormal E x‖ * ‖w‖ at hh + have hsq := sq_le_sq₀ (abs_nonneg _) (mul_nonneg (norm_nonneg _) (norm_nonneg _)) |>.mpr hh + rw [sq_abs, mul_pow] at hsq + have hi := mul_le_mul_of_nonneg_left hsq (sq_nonneg (η x)) + rw [← real_inner_comm (approximateNormal E x) v] at hi + simpa only [mul_pow, tangentialGradient, hgH, mul_assoc, mul_left_comm, mul_comm] using hi + have hi := integral_mono_ae hLI (hRI.const_mul _) hp + rw [integral_const_mul] at hi + exact hi.trans (by + have hh := mul_le_mul_of_nonneg_left + (minimizing_height_caccioppoli hn hmin c v a hR hη hc hs) (sq_nonneg ‖w‖) + convert hh using 1 + ring) + +theorem integral_abs_le_of_quadratic_mean_bound {α : Type*} [MeasurableSpace α] + (μ : Measure α) [IsFiniteMeasure μ] {f : α → ℝ} + (hf : MemLp f 2 μ) {L : ℝ} (hL : 0 ≤ L) + (hq : (∫ x, f x^2 ∂μ) ≤ L^2 * (μ univ).toReal) : + (∫ x, |f x| ∂μ) ≤ L * (μ univ).toReal := by + have hpq : Real.HolderConjugate 2 2 := + Real.holderConjugate_iff.mpr ⟨by norm_num, by norm_num⟩ + have hm : MemLp (fun x ↦ |f x|) (ENNReal.ofReal (2:ℝ)) μ := by + simpa only [ENNReal.ofReal_ofNat, Real.norm_eq_abs] using hf.norm + have hh := integral_mul_le_Lp_mul_Lq_of_nonneg hpq + (ae_of_all μ fun x ↦ abs_nonneg (f x)) + (ae_of_all μ fun _ ↦ (zero_le_one : (0:ℝ) ≤ 1)) hm (memLp_const (1:ℝ)) + have hs : Real.sqrt (∫ x, f x^2 ∂μ) ≤ L * Real.sqrt (μ univ).toReal := by + calc + _ ≤ Real.sqrt (L^2 * (μ univ).toReal) := Real.sqrt_le_sqrt hq + _ = _ := by rw [Real.sqrt_mul (sq_nonneg L), Real.sqrt_sq hL] + have hh' : (∫ x, |f x| ∂μ) ≤ Real.sqrt (∫ x, f x^2 ∂μ) * Real.sqrt (μ univ).toReal := by + simpa only [mul_one, Real.rpow_two, sq_abs, one_pow, integral_const, smul_eq_mul, + mul_one, Measure.real, ← Real.sqrt_eq_rpow] using hh + calc + _ ≤ (L * Real.sqrt (μ univ).toReal) * Real.sqrt (μ univ).toReal := + hh'.trans (mul_le_mul_of_nonneg_right hs (Real.sqrt_nonneg _)) + _ = _ := by rw [mul_assoc, Real.mul_self_sqrt ENNReal.toReal_nonneg] + +theorem minimizing_horizontal_normal_integral_le {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (c : Euc n) {v w : Euc n} (hv : ‖v‖ = 1) (hw : inner ℝ v w = 0) + (a : ℝ) {R : ℝ} (hR : 0 < R) + {η : Euc n → ℝ} (hη : ContDiff ℝ ∞ η) (hc : HasCompactSupport η) + (hs : tsupport η ⊆ Metric.ball c R) + {A L : ℝ} (hA : 0 ≤ A) (hL : 0 ≤ L) + (hheight : ∀ x ∈ perimeterSupport E ∩ Metric.ball c R, |inner ℝ v x-a| ≤ A) + (hgrad : ∀ x ∈ Metric.ball c R, ‖gradient η x‖ ≤ L) : + (∫ x in Metric.ball c R, |η x * inner ℝ (approximateNormal E x) w| + ∂perimeterMeasure E) ≤ + (2 * ‖w‖ * A * L) * (perimeter E (Metric.ball c R)).toReal := by + let μ := (perimeterMeasure E).restrict (Metric.ball c R) + have := perimeterMeasure_locallyFinite E hmin.2.1 + have : IsFiniteMeasure μ := ⟨by + rw [Measure.restrict_apply_univ, perimeterMeasure_open E Metric.isOpen_ball] + exact hmin.2.1 c R hR⟩ + obtain ⟨M, hM⟩ := hc.exists_bound_of_continuous hη.continuous + have hM0 : 0 ≤ M := (norm_nonneg (η c)).trans (hM c) + have hf : MemLp (fun x ↦ η x * inner ℝ (approximateNormal E x) w) 2 μ := by + apply MemLp.of_bound + (hη.continuous.aestronglyMeasurable.mul + ((measurable_approximateNormal hmin.1).inner measurable_const).aestronglyMeasurable) + (M * ‖w‖) + apply ae_of_all μ + intro x + change ‖η x * inner ℝ (approximateNormal E x) w‖ ≤ _ + rw [norm_mul] + have hb : ‖inner ℝ (approximateNormal E x) w‖ ≤ ‖w‖ := + (norm_inner_le_norm (𝕜 := ℝ) _ _).trans (by + simpa only [one_mul] using mul_le_mul_of_nonneg_right + (approximateNormal_norm_le_one E x) (norm_nonneg w)) + exact mul_le_mul (hM x) hb (norm_nonneg _) hM0 + have hfi : Integrable (fun x ↦ (inner ℝ v x-a)^2 * ‖gradient η x‖^2) μ := + (((continuous_const.inner continuous_id).sub continuous_const).pow 2 |>.mul + ((gradient_contDiff hη).continuous.norm.pow 2)).continuousOn.integrableOn_compact + (isCompact_closedBall c R) |>.mono_set Metric.ball_subset_closedBall + have hG : (∫ x, (inner ℝ v x-a)^2 * ‖gradient η x‖^2 ∂μ) ≤ + A^2 * L^2 * (μ univ).toReal := by + have hsupp : ∀ᵐ x ∂μ, x ∈ perimeterSupport E := by + apply ae_restrict_of_ae + rw [← perimeterMeasure_support] + exact (perimeterMeasure E).support_mem_ae + have hb : ∀ᵐ x ∂μ, (inner ℝ v x-a)^2 * ‖gradient η x‖^2 ≤ A^2 * L^2 := by + filter_upwards [hsupp, ae_restrict_mem measurableSet_ball] with x hx hxB + have h₁ := (sq_le_sq₀ (abs_nonneg _) hA).mpr (hheight x ⟨hx,hxB⟩) + rw [sq_abs] at h₁ + have h₂ := (sq_le_sq₀ (norm_nonneg _) hL).mpr (hgrad x hxB) + exact mul_le_mul h₁ h₂ (sq_nonneg _) (sq_nonneg _) + have hi := integral_mono_ae hfi (integrable_const (A^2*L^2)) hb + simpa only [integral_const, smul_eq_mul, mul_comm, Measure.real] using hi + have hq : (∫ x, (η x * inner ℝ (approximateNormal E x) w)^2 ∂μ) ≤ + (2*‖w‖*A*L)^2 * (μ univ).toReal := by + have hh := minimizing_horizontal_normal_square_le hn hmin c hv hw a hR hη hc hs + change (∫ x, (η x * inner ℝ (approximateNormal E x) w)^2 ∂μ) ≤ + 4*‖w‖^2 * _ at hh + apply hh.trans + have hi := mul_le_mul_of_nonneg_left hG (by positivity : 0 ≤ 4*‖w‖^2) + convert hi using 1 + ring + have hh := integral_abs_le_of_quadratic_mean_bound μ hf + (show 0 ≤ 2*‖w‖*A*L by positivity) hq + simpa only [μ, Measure.restrict_apply_univ, perimeterMeasure_open E Metric.isOpen_ball] using hh + +theorem minimizing_horizontal_test_le {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (c : Euc n) {v w : Euc n} (hv : ‖v‖ = 1) (hw : inner ℝ v w = 0) + (a : ℝ) {R : ℝ} (hR : 0 < R) + {η φ : Euc n → ℝ} (hη : ContDiff ℝ ∞ η) (hc : HasCompactSupport η) + (hs : tsupport η ⊆ Metric.ball c R) (hφ : ContDiff ℝ ∞ φ) + (hbφ : ∀ x, |φ x| ≤ 1) + {A L : ℝ} (hA : 0 ≤ A) (hL : 0 ≤ L) + (hheight : ∀ x ∈ perimeterSupport E ∩ Metric.ball c R, |inner ℝ v x-a| ≤ A) + (hgrad : ∀ x ∈ Metric.ball c R, ‖gradient η x‖ ≤ L) : + |∫ x in E, fderiv ℝ (fun y ↦ η y * φ y) x w| ≤ + (2 * ‖w‖ * A * L) * (perimeter E (Metric.ball c R)).toReal := by + let μ := (perimeterMeasure E).restrict (Metric.ball c R) + have : IsFiniteMeasure μ := ⟨by + rw [Measure.restrict_apply_univ, perimeterMeasure_open E Metric.isOpen_ball] + exact hmin.2.1 c R hR⟩ + have htest : (∫ x in E, fderiv ℝ (fun y ↦ η y * φ y) x w) = + ∫ x, φ x * (η x * inner ℝ (approximateNormal E x) w) ∂μ := by + rw [← divergence_scalar_direction ((hη.mul hφ).differentiable (by simp)) w, + minimizing_gaussGreen_local hn hmin (Metric.ball c R) Metric.isOpen_ball + (hmin.2.1 c R hR).ne (fun y ↦ (η y * φ y) • w) ((hη.mul hφ).smul contDiff_const) + hc.mul_right.smul_right + (tsupport_smul_subset_left _ _ |>.trans (tsupport_mul_subset_left.trans hs))] + apply integral_congr_ae + apply ae_of_all μ + intro x + simp only [real_inner_smul_right] + ring + obtain ⟨M,hM⟩ := hc.exists_bound_of_continuous hη.continuous + have hM0 : 0 ≤ M := (norm_nonneg (η c)).trans (hM c) + have hg : Integrable (fun x ↦ η x * inner ℝ (approximateNormal E x) w) μ := by + apply Integrable.of_bound + (hη.continuous.aestronglyMeasurable.mul + ((measurable_approximateNormal hmin.1).inner measurable_const).aestronglyMeasurable) + (M*‖w‖) + apply ae_of_all μ + intro x + change ‖η x * inner ℝ (approximateNormal E x) w‖ ≤ _ + rw [norm_mul] + have hb : ‖inner ℝ (approximateNormal E x) w‖ ≤ ‖w‖ := + (norm_inner_le_norm (𝕜 := ℝ) _ _).trans (by + simpa only [one_mul] using mul_le_mul_of_nonneg_right + (approximateNormal_norm_le_one E x) (norm_nonneg w)) + exact mul_le_mul (hM x) hb (norm_nonneg _) hM0 + have hφg : Integrable (fun x ↦ φ x * (η x * inner ℝ (approximateNormal E x) w)) μ := + hg.bdd_mul hφ.continuous.aestronglyMeasurable (ae_of_all μ fun x ↦ by + simpa only [Real.norm_eq_abs] using hbφ x) + rw [htest] + calc + _ ≤ ∫ x, |φ x * (η x * inner ℝ (approximateNormal E x) w)| ∂μ := abs_integral_le_integral_abs + _ ≤ ∫ x, |η x * inner ℝ (approximateNormal E x) w| ∂μ := by + apply integral_mono_ae hφg.abs hg.abs + exact ae_of_all μ fun x ↦ by + change |φ x * (η x * inner ℝ (approximateNormal E x) w)| ≤ |η x * inner ℝ (approximateNormal E x) w| + rw [abs_mul] + simpa only [one_mul] using mul_le_mul_of_nonneg_right (hbφ x) (abs_nonneg _) + _ ≤ _ := minimizing_horizontal_normal_integral_le hn hmin c hv hw a hR hη hc hs + hA hL hheight hgrad + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/FlatnessImprovement.lean b/lean/OAI/Geometry/Perimeter/Regularity/FlatnessImprovement.lean new file mode 100644 index 0000000000000000000000000000000000000000..791ccb7fac3fb685e762a1455d25f51b82282a13 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/FlatnessImprovement.lean @@ -0,0 +1,64 @@ +import OAI.Geometry.Perimeter.Regularity.LocalFlatExcess +import OAI.Geometry.Perimeter.Regularity.SequentialFlatness +import OAI.Geometry.Perimeter.Regularity.NormalAdjustment + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +variable {n : ℕ} + +def FullSlab (E : Set (Euc n)) (v : Euc n) (R a : ℝ) : Prop := + (∀ x∈perimeterSupport E ∩ Metric.ball 0 R, |inner ℝ v x|≤a) ∧ + (∀ᵐ x ∂volume, x∈Metric.ball 0 R → a < |inner ℝ v x| → (x∈E ↔ inner ℝ v x<0)) + +theorem FullSlab.mono_radius {E : Set (Euc n)} {v : Euc n} {R S a : ℝ} + (h : FullSlab E v R a) (hSR : S≤R) : FullSlab E v S a := by + refine ⟨fun x hx ↦ h.1 x ⟨hx.1,Metric.ball_subset_ball hSR hx.2⟩,?_⟩ + filter_upwards [h.2] with x hx + exact fun hxS ↦ hx (Metric.ball_subset_ball hSR hxS) + +theorem exists_fixed_normal_improvement_constants (n : ℕ) (hn : 1 exact GeoBase.linear hθ hU hf L + | succ k ih => + refine ⟨L.contDiff.comp_contDiffOn hf.1,(GeoBase.linear hθ hU hf.2.1 L),fun e ↦ ?_⟩ + apply (ih (hf.2.2 e)).congr hθ hU + intro x hx + have hh := L.hasFDerivAt.comp x (((hf.1.contDiffAt (hU.mem_nhds hx)).differentiableAt + (by simp)).hasFDerivAt) + exact (congrArg (fun A : Euc n →L[ℝ] W ↦ A e) hh.fderiv).symm + + theorem GeoC.prodMk {θ : ℝ} (hθ : 0 ≤ θ) {k : ℕ} + {f : Euc n → V} {g : Euc n → W} {U : Set (Euc n)} + (hU : IsOpen U) (hf : GeoC θ k f U) (hg : GeoC θ k g U) : + GeoC θ k (fun x ↦ (f x,g x)) U := by + induction k generalizing f g with + | zero => exact GeoBase.prodMk hθ hf hg + | succ k ih => + refine ⟨hf.1.prodMk hg.1,GeoBase.prodMk hθ hf.2.1 hg.2.1,fun e ↦ ?_⟩ + apply (ih (hf.2.2 e) (hg.2.2 e)).congr hθ hU + intro x hx + have hdf := ((hf.1.contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp)).hasFDerivAt + have hdg := ((hg.1.contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp)).hasFDerivAt + exact (congrArg (fun A : Euc n →L[ℝ] (V×W) ↦ A e) (hdf.prodMk hdg).fderiv).symm + + theorem GeoC.add {θ : ℝ} (hθ : 0 ≤ θ) {k : ℕ} + {f g : Euc n → V} {U : Set (Euc n)} (hU : IsOpen U) + (hf : GeoC θ k f U) (hg : GeoC θ k g U) : GeoC θ k (fun x ↦ f x+g x) U := + (hf.prodMk hθ hU hg).linear hθ hU (ContinuousLinearMap.fst ℝ V V+ContinuousLinearMap.snd ℝ V V) + + theorem GeoC.neg {θ : ℝ} (hθ : 0 ≤ θ) {k : ℕ} + {f : Euc n → V} {U : Set (Euc n)} (hU : IsOpen U) + (hf : GeoC θ k f U) : GeoC θ k (fun x ↦ -f x) U := + hf.linear hθ hU (-ContinuousLinearMap.id ℝ V) + + theorem GeoC.sub {θ : ℝ} (hθ : 0 ≤ θ) {k : ℕ} + {f g : Euc n → V} {U : Set (Euc n)} (hU : IsOpen U) + (hf : GeoC θ k f U) (hg : GeoC θ k g U) : GeoC θ k (fun x ↦ f x-g x) U := by + simpa only [sub_eq_add_neg] using hf.add hθ hU (hg.neg hθ hU) + + theorem GeoC.bilinear {θ : ℝ} (hθ : 0 ≤ θ) {k : ℕ} + {f : Euc n → V} {g : Euc n → W} {U : Set (Euc n)} (hU : IsOpen U) + (hf : GeoC θ k f U) (hg : GeoC θ k g U) (B : V →L[ℝ] W →L[ℝ] Z) : + GeoC θ k (fun x ↦ B (f x) (g x)) U := by + have hb : ContDiff ℝ 1 (fun z : V×W ↦ B z.1 z.2) := + (B.contDiff.comp contDiff_fst).clm_apply contDiff_snd + have hbase {f : Euc n → V} {g : Euc n → W} (hf : GeoBase θ f U) (hg : GeoBase θ g U) : + GeoBase θ (fun x ↦ B (f x) (g x)) U := + ⟨(B.continuous.comp_continuousOn hf.1).clm_apply hg.1,fun p hp ↦ + ((hf.2 p hp).prodMk hθ (hg.2 p hp)).comp_C1 hθ + ((hf.1.continuousAt (hU.mem_nhds hp)).prodMk (hg.1.continuousAt (hU.mem_nhds hp))) hb⟩ + induction k generalizing f g with + | zero => exact hbase hf hg + | succ k ih => + refine ⟨(B.contDiff.comp_contDiffOn hf.1).clm_apply hg.1,hbase hf.2.1 hg.2.1,fun e ↦ ?_⟩ + have h₁ := ih hf.mono_order (hg.2.2 e) + have h₂ := ih (hf.2.2 e) hg.mono_order + apply (h₁.add hθ hU h₂).congr hθ hU + intro x hx + have hdf := ((hf.1.contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp)).hasFDerivAt + have hdg := ((hg.1.contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp)).hasFDerivAt + have hh := ((B.hasFDerivAt.comp x hdf).clm_apply hdg).fderiv + exact (congrArg (fun A : Euc n →L[ℝ] Z ↦ A e) hh).symm + + theorem GeoC.clm_apply {θ : ℝ} (hθ : 0 ≤ θ) {k : ℕ} + {f : Euc n → V →L[ℝ] W} {g : Euc n → V} {U : Set (Euc n)} (hU : IsOpen U) + (hf : GeoC θ k f U) (hg : GeoC θ k g U) : GeoC θ k (fun x ↦ f x (g x)) U := + hf.bilinear hθ hU hg (ContinuousLinearMap.apply ℝ W).flip + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/GeoComposition.lean b/lean/OAI/Geometry/Perimeter/Regularity/GeoComposition.lean new file mode 100644 index 0000000000000000000000000000000000000000..d1e2ee3936aa3cda3c2206c20b8257e4d2767da6 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/GeoComposition.lean @@ -0,0 +1,79 @@ +import OAI.Geometry.Perimeter.Regularity.GeoAlgebra + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +variable {n : ℕ} + + theorem GeoC.const {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] + (θ : ℝ) (k : ℕ) (c : V) (U : Set (Euc n)) : GeoC θ k (fun _ ↦ c) U := by + induction k generalizing c with + | zero => exact ⟨continuousOn_const,fun p _ ↦ GeometricHolderAt.const θ p c⟩ + | succ k ih => + refine ⟨contDiffOn_const,⟨continuousOn_const,fun p _ ↦ GeometricHolderAt.const θ p c⟩,fun e ↦ ?_⟩ + simpa only [fderiv_const_apply,zero_apply] using ih (0:V) + + theorem GeoC.clm_of_apply {V W : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] + [FiniteDimensional ℝ V] [NormedAddCommGroup W] [NormedSpace ℝ W] + {θ : ℝ} (hθ : 0 ≤ θ) {k : ℕ} {U : Set (Euc n)} (hU : IsOpen U) + {f : Euc n → V →L[ℝ] W} (hf : ∀ e, GeoC θ k (fun x ↦ f x e) U) : + GeoC θ k f U := by + have hbase {f : Euc n → V →L[ℝ] W} (hf : ∀ e, GeoC θ 0 (fun x ↦ f x e) U) : + GeoC θ 0 f U := by + have hc : ContinuousOn f U := continuousOn_clm_apply.mpr (fun e ↦ (hf e).1) + exact ⟨hc,fun p hp ↦ (GeometricHolderAt.clm_apply_iff hθ + (hc.continuousAt (hU.mem_nhds hp))).mpr (fun e ↦ (hf e).2 p hp)⟩ + induction k generalizing f with + | zero => exact hbase hf + | succ k ih => + have hc : ContDiffOn ℝ 1 f U := contDiffOn_clm_apply.mpr (fun e ↦ (hf e).1) + refine ⟨hc,hbase (fun e ↦ (hf e).2.1),fun e ↦ ih (fun v ↦ ?_)⟩ + apply ((hf v).2.2 e).congr hθ hU + intro x hx + have hd := ((hc.contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp)).hasFDerivAt + exact congrArg (fun L : Euc n →L[ℝ] W ↦ L e) + (((ContinuousLinearMap.apply ℝ W v).hasFDerivAt.comp x hd).fderiv) + + theorem GeoC.fderiv {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] + {θ : ℝ} (hθ : 0 ≤ θ) {k : ℕ} {U : Set (Euc n)} (hU : IsOpen U) + {f : Euc n → V} (hf : GeoC θ (k+1) f U) : GeoC θ k (fderiv ℝ f) U := + GeoC.clm_of_apply hθ hU hf.2.2 + + theorem GeoC.gradient {θ : ℝ} (hθ : 0 ≤ θ) {k : ℕ} {U : Set (Euc n)} (hU : IsOpen U) + {f : Euc n → ℝ} (hf : GeoC θ (k+1) f U) : GeoC θ k (gradient f) U := + (hf.fderiv hθ hU).linear hθ hU (InnerProductSpace.toDual ℝ (Euc n)).symm.toContinuousLinearMap + + theorem geoC_comp (k : ℕ) : ∀ {V W : Type} [NormedAddCommGroup V] [NormedSpace ℝ V] + [NormedAddCommGroup W] [NormedSpace ℝ W] {θ : ℝ}, 0 ≤ θ → + ∀ {U : Set (Euc n)}, IsOpen U → ∀ {f : Euc n → V}, GeoC θ k f U → + ∀ {G : V → W}, ContDiff ℝ ∞ G → GeoC θ k (fun x ↦ G (f x)) U := by + induction k with + | zero => + intro V W _ _ _ _ θ hθ U hU f hf G hG + exact ⟨hG.continuous.comp_continuousOn hf.1,fun p hp ↦ (hf.2 p hp).comp_C1 hθ + (hf.1.continuousAt (hU.mem_nhds hp)) (hG.of_le (by simp))⟩ + | succ k ih => + intro V W _ _ _ _ θ hθ U hU f hf G hG + have hcf : ContDiffOn ℝ 1 f U := hf.1 + have hcG : ContDiff ℝ 1 G := hG.of_le (by simp) + have hDG : ContDiff ℝ ∞ (fderiv ℝ G) := hG.fderiv_right (by simp) + have hb : GeoC θ 0 (fun x ↦ G (f x)) U := + ⟨hG.continuous.comp_continuousOn hf.2.1.1,fun p hp ↦ (hf.2.1.2 p hp).comp_C1 hθ + (hcf.continuousOn.continuousAt (hU.mem_nhds hp)) hcG⟩ + refine ⟨hcG.comp_contDiffOn hcf,hb,fun e ↦ ?_⟩ + have h₁ := ih hθ hU hf.mono_order hDG + have hh := h₁.clm_apply hθ hU (hf.2.2 e) + apply hh.congr hθ hU + intro x hx + have hd := ((hcf.contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp)).hasFDerivAt + exact (congrArg (fun L : Euc n →L[ℝ] W ↦ L e) + (((hcG.differentiable (by simp) (f x)).hasFDerivAt.comp x hd).fderiv)).symm + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/GeoRegularity.lean b/lean/OAI/Geometry/Perimeter/Regularity/GeoRegularity.lean new file mode 100644 index 0000000000000000000000000000000000000000..4aa01e7cd3b679662a091658ba2e826e36bfc812 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/GeoRegularity.lean @@ -0,0 +1,117 @@ +import OAI.Geometry.Perimeter.Regularity.EllipticLocalExtension +import OAI.Geometry.Perimeter.Regularity.GeometricHolder +import OAI.Geometry.Perimeter.Regularity.EllipticSecantBounds +import OAI.Geometry.Perimeter.Regularity.LinearDifference + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +variable {n : ℕ} + + abbrev GeoBase {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] + (θ : ℝ) (f : Euc n → V) (U : Set (Euc n)) : Prop := + ContinuousOn f U ∧ ∀ p∈U, GeometricHolderAt θ f p + + def GeoC {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] + (θ : ℝ) : ℕ → (Euc n → V) → Set (Euc n) → Prop + | 0,f,U => GeoBase θ f U + | k+1,f,U => ContDiffOn ℝ 1 f U ∧ GeoBase θ f U ∧ + ∀ e, GeoC θ k (fun x ↦ fderiv ℝ f x e) U + + theorem GeoC.contDiff {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] + {θ : ℝ} {k : ℕ} {f : Euc n → V} {U : Set (Euc n)} (hU : IsOpen U) + (h : GeoC θ k f U) : ContDiffOn ℝ k f U := by + induction k generalizing f with + | zero => exact contDiffOn_zero.mpr h.1 + | succ k ih => + rw [Nat.cast_add,Nat.cast_one,contDiffOn_succ_iff_fderiv_of_isOpen hU] + refine ⟨h.1.differentiableOn one_ne_zero,by simp,contDiffOn_clm_apply.mpr ?_⟩ + intro e + exact ih (h.2.2 e) + + theorem GeoC.base {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] + {θ : ℝ} {k : ℕ} {f : Euc n → V} {U : Set (Euc n)} + (h : GeoC θ k f U) : GeoC θ 0 f U := by cases k with | zero => exact h | succ k => exact h.2.1 + + theorem GeoC.mono_order {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] + {θ : ℝ} {k : ℕ} {f : Euc n → V} {U : Set (Euc n)} + (h : GeoC θ (k+1) f U) : GeoC θ k f U := by + induction k generalizing f with + | zero => exact h.2.1 + | succ k ih => exact ⟨h.1,h.2.1,fun e ↦ ih (h.2.2 e)⟩ + + theorem GeoC.mono {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] + {θ : ℝ} {k : ℕ} {f : Euc n → V} {U W : Set (Euc n)} + (h : GeoC θ k f U) (hWU : W⊆U) : GeoC θ k f W := by + induction k generalizing f with + | zero => exact ⟨h.1.mono hWU,fun p hp ↦ h.2 p (hWU hp)⟩ + | succ k ih => exact ⟨h.1.mono hWU,⟨h.2.1.1.mono hWU,fun p hp ↦ h.2.1.2 p (hWU hp)⟩, + fun e ↦ ih (h.2.2 e)⟩ + + theorem GeoC.congr {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] + {θ : ℝ} (hθ : 0 ≤ θ) {k : ℕ} {f g : Euc n → V} {U : Set (Euc n)} + (hU : IsOpen U) (h : GeoC θ k f U) (he : EqOn f g U) : GeoC θ k g U := by + induction k generalizing f g with + | zero => + refine ⟨h.1.congr he.symm,fun p hp ↦ (h.2 p hp).congr hθ ?_⟩ + exact Filter.eventually_of_mem (hU.mem_nhds hp) (fun x hx ↦ he hx) + | succ k ih => + refine ⟨h.1.congr he.symm,?_,fun e ↦ ih (h.2.2 e) ?_⟩ + · exact ⟨h.2.1.1.congr he.symm,fun p hp ↦ (h.2.1.2 p hp).congr hθ + (Filter.eventually_of_mem (hU.mem_nhds hp) (fun x hx ↦ he hx))⟩ + · intro x hx + exact congrArg (fun L : Euc n →L[ℝ] V ↦ L e) + ((Filter.EventuallyEq.fderiv_eq (Filter.eventually_of_mem (hU.mem_nhds hx) (fun y hy ↦ he hy)))) + + theorem GeoC.local {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] + {θ : ℝ} {k : ℕ} {f : Euc n → V} {U : Set (Euc n)} + (h : ∀ p∈U, ∃ W : Set (Euc n), IsOpen W ∧ p∈W ∧ GeoC θ k f W) : + GeoC θ k f U := by + induction k generalizing f with + | zero => + constructor + · intro p hp + obtain ⟨W,hW,hpW,hh⟩ := h p hp + exact (hh.1.continuousAt (hW.mem_nhds hpW)).continuousWithinAt + · intro p hp + obtain ⟨W,hW,hpW,hh⟩ := h p hp + exact hh.2 p hpW + | succ k ih => + refine ⟨?_,?_,fun e ↦ ih (fun p hp ↦ ?_)⟩ + · intro p hp + obtain ⟨W,hW,hpW,hh⟩ := h p hp + exact (hh.1.contDiffAt (hW.mem_nhds hpW)).contDiffWithinAt + · constructor + · intro p hp + obtain ⟨W,hW,hpW,hh⟩ := h p hp + exact (hh.1.continuousOn.continuousAt (hW.mem_nhds hpW)).continuousWithinAt + · intro p hp + obtain ⟨W,hW,hpW,hh⟩ := h p hp + exact hh.2.1.2 p hpW + · obtain ⟨W,hW,hpW,hh⟩ := h p hp + exact ⟨W,hW,hpW,hh.2.2 e⟩ + + theorem geometricHolderAt_of_C1_on {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] + {θ : ℝ} (hθ : 0 ≤ θ) (hθ' : θ ≤ 1/2) {f : Euc n → V} + {U : Set (Euc n)} (hU : IsOpen U) (hf : ContDiffOn ℝ 1 f U) {p : Euc n} (hp : p∈U) : + GeometricHolderAt θ f p := by + obtain ⟨r,hr,hrU,g,hg,hgc,he⟩ := local_compact_extension hU hp hf + obtain ⟨s,L,hs,hL,hLip⟩ := contDiff_local_lipschitz hg p + have hh : GeometricHolderAt θ g p := geometricHolderAt_of_local_lipschitz hθ hθ' hs hL + (fun x hx y hy ↦ by simpa only [dist_eq_norm] using hLip x hx y hy) + exact hh.congr hθ (Filter.eventually_of_mem (Metric.ball_mem_nhds p (by positivity : 0<2*r)) + (fun x hx ↦ he x hx)) + + theorem geoC_zero_of_C1 {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] + {θ : ℝ} (hθ : 0 ≤ θ) (hθ' : θ ≤ 1/2) {f : Euc n → V} + {U : Set (Euc n)} (hU : IsOpen U) (hf : ContDiffOn ℝ 1 f U) : GeoC θ 0 f U := + ⟨hf.continuousOn,fun _ hp ↦ geometricHolderAt_of_C1_on hθ hθ' hU hf hp⟩ + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/GeometricDerivativeModulus.lean b/lean/OAI/Geometry/Perimeter/Regularity/GeometricDerivativeModulus.lean new file mode 100644 index 0000000000000000000000000000000000000000..055832ccd542673933bb40cacba75c08d28dc496 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/GeometricDerivativeModulus.lean @@ -0,0 +1,73 @@ +import OAI.Geometry.Perimeter.Regularity.UniformDerivativeContinuity + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace +namespace RPISingularHarnack + + theorem geometricHolder_derivative_of_remainder {V : Type*} + [NormedAddCommGroup V] [NormedSpace ℝ V] + {f : V → ℝ} {D : V → V →L[ℝ] ℝ} {U : Set V} (hU : IsOpen U) + {q C : ℝ} (hq : 0 ∫⁻ x, ENNReal.ofReal (|φ j x - h x| ^ 2) ∂μ) + atTop (𝓝 0) ∧ + Tendsto (fun j => ∫⁻ x, + ENNReal.ofReal (‖tangentialGradient E (φ j) x - G x‖ ^ 2) ∂μ) + atTop (𝓝 0) + +def WholeBoundarySupersolution {n : ℕ} (E : Set (Euc n)) + (G : Euc n → Euc n) : Prop := + ∀ φ : Euc n → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → + (∀ x, 0 ≤ φ x) → + 0 ≤ ∫ x, inner ℝ (G x) (tangentialGradient E φ x) ∂boundaryArea E + +def ZeroEssentialInfAtVertex {n : ℕ} (E : Set (Euc n)) (h : Euc n → ℝ) : Prop := + ∀ R : ℝ, 0 < R → ∀ ε : ℝ, 0 < ε → + 0 < boundaryArea E (Metric.ball 0 R ∩ {x | h x < ε}) + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +namespace RPI.Boundary + +theorem surfaceGradient_ae_eq_tangentialGradient {n : ℕ} (hn : 8 ≤ n) + {E S Z : Set (Space n)} (hE : MeasurableSet E) (hS : MeasurableSet S) + (hZd : dimH Z ≤ (n - 8 : ℕ)) + (hreg : ∀ x ∈ S \ Z, ∃ f : Space n → ℝ, + ContDiffAt ℝ 1 f x ∧ f x = 0 ∧ fderiv ℝ f x ≠ 0 ∧ + (∀ᶠ y in 𝓝 x, y ∈ S ↔ f y = 0) ∧ + (∀ᶠ y in 𝓝 x, y ∈ E ↔ f y < 0)) (g : Space n → ℝ) : + surfaceGradient S g =ᵐ[surfaceMeasure S] + RPISingularHarnack.tangentialGradient E g := by + have hz : ∀ᵐ x ∂surfaceMeasure S, x ∉ Z := by + simpa only [ae_iff, not_not, Set.ofPred_mem_eq] using + surfaceMeasure_zero_of_singular_dim hn S Z hZd + filter_upwards [ae_restrict_mem hS, hz] with x hx hzx + obtain ⟨f, hf, hfx, hdf, hlevel, hfilled⟩ := hreg x ⟨hx, hzx⟩ + exact surfaceGradient_eq_tangentialGradient hE hf hfx hdf hlevel hfilled + +end RPI.Boundary + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +namespace RPISingularHarnack + +theorem boundaryArea_eq_smul_surfaceMeasure {n : ℕ} (E : Set (Euc n)) : + boundaryArea E = hausdorffNormalizationRatio (n - 1) • + RPI.Boundary.surfaceMeasure (perimeterSupport E) := by + rw [boundaryArea, geometricHausdorff_eq_smul_euclideanHausdorff, + Measure.restrict_smul] + rfl + +theorem wholeBoundarySobolev_of_local_sobolevGraph {n : ℕ} (hn : 8 ≤ n) + {E Z : Set (Euc n)} (hE : MeasurableSet E) + (hS : MeasurableSet (perimeterSupport E)) (hZd : dimH Z ≤ (n - 8 : ℕ)) + (hreg : ∀ x ∈ perimeterSupport E \ Z, ∃ f : Euc n → ℝ, + ContDiffAt ℝ 1 f x ∧ f x = 0 ∧ fderiv ℝ f x ≠ 0 ∧ + (∀ᶠ y in 𝓝 x, y ∈ perimeterSupport E ↔ f y = 0) ∧ + (∀ᶠ y in 𝓝 x, y ∈ E ↔ f y < 0)) + {h : Euc n → ℝ} {G : Euc n → Euc n} + (hgraph : ∀ R : ℝ, 0 < R → + ∃ (hh : MemLp h 2 ((RPI.Boundary.surfaceMeasure (perimeterSupport E)).restrict + (Metric.ball 0 R))) + (hG : MemLp G 2 ((RPI.Boundary.surfaceMeasure (perimeterSupport E)).restrict + (Metric.ball 0 R))), + (hh.toLp h, hG.toLp G) ∈ closure + (RPI.Boundary.smoothGradientGraph (perimeterSupport E) (Metric.ball 0 R))) : + WholeBoundarySobolev E h G := by + intro R hR + obtain ⟨hh, hG, hpair⟩ := hgraph R hR + obtain ⟨φ, hφ, hlim, hDlim⟩ := + RPI.Boundary.exists_compact_energy_approximants_of_mem_sobolevGraph + (perimeterSupport E) (Metric.ball 0 R) Metric.isBounded_ball + measurableSet_ball hh hG hpair + dsimp only + rw [boundaryArea_eq_smul_surfaceMeasure, Measure.restrict_smul] + refine ⟨hh.smul_measure (hausdorffNormalizationRatio_ne_top _), + hG.smul_measure (hausdorffNormalizationRatio_ne_top _), φ, hφ, ?_, ?_⟩ + · simp_rw [lintegral_smul_measure, smul_eq_mul] + simpa only [mul_zero] using ENNReal.Tendsto.const_mul hlim + (Or.inr (hausdorffNormalizationRatio_ne_top (n - 1))) + · have heq : ∀ j, RPI.Boundary.surfaceGradient (perimeterSupport E) (φ j) + =ᵐ[(RPI.Boundary.surfaceMeasure (perimeterSupport E)).restrict (Metric.ball 0 R)] + tangentialGradient E (φ j) := fun j ↦ + (RPI.Boundary.surfaceGradient_ae_eq_tangentialGradient hn hE hS hZd hreg (φ j)).filter_mono + (ae_mono Measure.restrict_le_self) + have hl : Tendsto (fun j ↦ ∫⁻ x, + ENNReal.ofReal (‖tangentialGradient E (φ j) x - G x‖ ^ 2) + ∂(RPI.Boundary.surfaceMeasure (perimeterSupport E)).restrict (Metric.ball 0 R)) + atTop (𝓝 0) := by + apply hDlim.congr + intro j + apply lintegral_congr_ae + filter_upwards [heq j] with x hx + rw [hx] + simp_rw [lintegral_smul_measure, smul_eq_mul] + simpa only [mul_zero] using ENNReal.Tendsto.const_mul hl + (Or.inr (hausdorffNormalizationRatio_ne_top (n - 1))) + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +namespace RPISingularHarnack + +theorem eventually_filled_membership {n : ℕ} {E : Set (Euc n)} + {f : Euc n → ℝ} {x z : Euc n} {L : Euc n →L[ℝ] ℝ} + (hd : HasFDerivAt f L x) (hx : f x = 0) + (hlocal : ∀ᶠ y in 𝓝 x, (f y < 0 → y ∈ E) ∧ (y ∈ E → f y ≤ 0)) (hz : L z ≠ 0) : + ∀ᶠ r : ℝ in 𝓝[>] 0, x + r • z ∈ E ↔ L z < 0 := by + have hp : HasDerivAt (fun r : ℝ ↦ x + r • z) z 0 := by + simpa using ((hasDerivAt_id (0 : ℝ)).smul_const z).const_add x + have hc : HasDerivAt (fun r : ℝ ↦ f (x + r • z)) (L z) 0 := by + exact (show HasFDerivAt f L (x + (0 : ℝ) • z) from by simpa using hd).comp_hasDerivAt 0 hp + have ht : Tendsto (fun r : ℝ ↦ r⁻¹ * f (x + r • z)) (𝓝[>] 0) (𝓝 (L z)) := by + simpa [hx] using hc.tendsto_slope_zero_right + have hm : ∀ᶠ r : ℝ in 𝓝[>] 0, + (f (x + r • z) < 0 → x + r • z ∈ E) ∧ + (x + r • z ∈ E → f (x + r • z) ≤ 0) := + (show Tendsto (fun r : ℝ ↦ x + r • z) (𝓝[>] 0) (𝓝 x) from + (show Tendsto (fun r : ℝ ↦ x + r • z) (𝓝 0) (𝓝 x) from by + simpa [ContinuousAt] using hp.continuousAt).mono_left nhdsWithin_le_nhds).eventually hlocal + rcases lt_or_gt_of_ne hz with hneg | hpos + · filter_upwards [hm, ht.eventually (gt_mem_nhds hneg), self_mem_nhdsWithin] with r hm hr hpr + have hfr : f (x + r • z) < 0 := by + have hi : 0 < r⁻¹ := inv_pos.mpr hpr + nlinarith + exact iff_of_true (hm.1 hfr) hneg + · filter_upwards [hm, ht.eventually (lt_mem_nhds hpos), self_mem_nhdsWithin] with r hm hr hpr + have hfr : 0 < f (x + r • z) := by + have hi : 0 < r⁻¹ := inv_pos.mpr hpr + nlinarith + exact iff_of_false (fun he ↦ (not_le.mpr hfr) (hm.2 he)) (not_lt.mpr hpos.le) + +theorem hasHalfspaceBlowup_of_regular_filled_chart {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) {f : Euc n → ℝ} {x v : Euc n} {L : Euc n →L[ℝ] ℝ} + (hd : HasFDerivAt f L x) (hx : f x = 0) + (hlocal : ∀ᶠ y in 𝓝 x, (f y < 0 → y ∈ E) ∧ (y ∈ E → f y ≤ 0)) + (hv : ‖v‖ = 1) {a : ℝ} (ha : 0 < a) + (hL : ∀ z, L z = a * inner ℝ z v) : HasHalfspaceBlowup E x v := by + have hLn : L ≠ 0 := by + intro he + have hval := hL v + simp only [he, zero_apply, real_inner_self_eq_norm_sq, hv, + one_pow, mul_one] at hval + linarith + let H : Set (Euc n) := {z | inner ℝ z v < 0} + have hH : MeasurableSet H := + (isOpen_lt (continuous_id.inner continuous_const) continuous_const).measurableSet + let F : ℝ → Euc n → ℝ := fun r z ↦ + |E.indicator (fun _ ↦ (1 : ℝ)) (x + r • z) - H.indicator (fun _ ↦ (1 : ℝ)) z| + have hsign : ∀ z, L z < 0 ↔ inner ℝ z v < 0 := by + intro z + rw [hL] + constructor <;> intro h <;> nlinarith + have hmeas : ∀ r, AEStronglyMeasurable (F r) + (volume.restrict (Metric.ball (0 : Euc n) 1)) := by + intro r + have he : Measurable (E.indicator (fun _ : Euc n ↦ (1 : ℝ))) := + measurable_const.indicator hE + have hh : Measurable (H.indicator (fun _ : Euc n ↦ (1 : ℝ))) := + measurable_const.indicator hH + have hm : Measurable (fun z : Euc n ↦ x + r • z) := + measurable_const.add (measurable_id.const_smul r) + exact ((he.comp hm).sub hh).abs.aestronglyMeasurable + have hb : ∀ r, ∀ᵐ z ∂volume.restrict (Metric.ball (0 : Euc n) 1), ‖F r z‖ ≤ 1 := by + intro r + filter_upwards [] with z + by_cases he : x + r • z ∈ E <;> by_cases hh : z ∈ H <;> simp [F, he, hh] + have ht : ∀ᵐ z ∂volume.restrict (Metric.ball (0 : Euc n) 1), + Tendsto (fun r ↦ F r z) (𝓝[>] (0 : ℝ)) (𝓝 0) := by + filter_upwards [ae_restrict_of_ae (ae_linear_ne_zero hLn)] with z hz + apply tendsto_const_nhds.congr' + filter_upwards [eventually_filled_membership hd hx hlocal hz] with r hr + have hmem : x + r • z ∈ E ↔ z ∈ H := hr.trans (hsign z) + by_cases he : x + r • z ∈ E + · simp [F, he, hmem.mp he] + · have hhn : z ∉ H := fun hh ↦ he (hmem.mpr hh) + simp only [F, Set.indicator_of_notMem he, Set.indicator_of_notMem hhn, + sub_self, abs_zero] + have hi : Integrable (fun _ : Euc n ↦ (1 : ℝ)) + (volume.restrict (Metric.ball 0 1)) := integrableOn_const measure_ball_lt_top.ne + have hconv := tendsto_integral_filter_of_dominated_convergence + (fun _ : Euc n ↦ (1 : ℝ)) (Eventually.of_forall hmeas) (Eventually.of_forall hb) hi ht + refine ⟨hv, ?_⟩ + have heq : ∀ᶠ r : ℝ in 𝓝[>] 0, + (r ^ n)⁻¹ * (∫ y in Metric.ball x r, + |E.indicator (fun _ ↦ (1 : ℝ)) y - + {z | inner ℝ (z - x) v < 0}.indicator (fun _ ↦ (1 : ℝ)) y|) = + ∫ z in Metric.ball (0 : Euc n) 1, F r z := by + filter_upwards [self_mem_nhdsWithin] with r hr + rw [normalized_ball_integral _ x hr] + apply integral_congr_ae + filter_upwards [] with z + simp only [halfspace_indicator_rescale x v z hr, F, H] + exact (show Tendsto (fun r ↦ ∫ z in Metric.ball (0 : Euc n) 1, F r z) + (𝓝[>] (0 : ℝ)) (𝓝 0) from by simpa only [integral_zero] using hconv).congr' (Filter.EventuallyEq.symm heq) + +theorem hasHalfspaceBlowup_gradient_filled {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) {f : Euc n → ℝ} {x : Euc n} + (hd : DifferentiableAt ℝ f x) (hx : f x = 0) (hdf : fderiv ℝ f x ≠ 0) + (hlocal : ∀ᶠ y in 𝓝 x, (f y < 0 → y ∈ E) ∧ (y ∈ E → f y ≤ 0)) : + HasHalfspaceBlowup E x (‖gradient f x‖⁻¹ • gradient f x) := by + have hg : gradient f x ≠ 0 := by + intro he + apply hdf + ext z + rw [← inner_gradient_left, he, inner_zero_left] + rfl + have hng : 0 < ‖gradient f x‖ := norm_pos_iff.mpr hg + apply hasHalfspaceBlowup_of_regular_filled_chart hE hd.hasFDerivAt hx hlocal + (a := ‖gradient f x‖) + · rw [norm_smul, Real.norm_of_nonneg (inv_nonneg.mpr hng.le), inv_mul_cancel₀ hng.ne'] + · exact hng + · intro z + rw [real_inner_smul_right, ← inner_gradient_left, real_inner_comm] + field_simp + +theorem approximateNormal_eq_gradient_filled {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) {f : Euc n → ℝ} {x : Euc n} + (hd : DifferentiableAt ℝ f x) (hx : f x = 0) (hdf : fderiv ℝ f x ≠ 0) + (hlocal : ∀ᶠ y in 𝓝 x, (f y < 0 → y ∈ E) ∧ (y ∈ E → f y ≤ 0)) : + approximateNormal E x = ‖gradient f x‖⁻¹ • gradient f x := + approximateNormal_eq_of_blowup hE + (hasHalfspaceBlowup_gradient_filled hE hd hx hdf hlocal) + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPI + +def truncationSlope (ε t : ℝ) : ℝ := Real.smoothTransition ((1 - t) / ε) + +def smoothTruncation (ε s : ℝ) : ℝ := ∫ t in (0 : ℝ)..s, truncationSlope ε t + +theorem truncationSlope_contDiff (ε : ℝ) : ContDiff ℝ ∞ (truncationSlope ε) := by + unfold truncationSlope + fun_prop + +theorem smoothTruncation_hasDerivAt (ε s : ℝ) : + HasDerivAt (smoothTruncation ε) (truncationSlope ε s) s := by + have hc := (truncationSlope_contDiff ε).continuous + exact intervalIntegral.integral_hasDerivAt_right (hc.intervalIntegrable 0 s) + hc.stronglyMeasurable.stronglyMeasurableAtFilter hc.continuousAt + +@[simp] theorem smoothTruncation_deriv (ε s : ℝ) : + deriv (smoothTruncation ε) s = truncationSlope ε s := + (smoothTruncation_hasDerivAt ε s).deriv + +theorem smoothTruncation_contDiff (ε : ℝ) : ContDiff ℝ ∞ (smoothTruncation ε) := by + rw [contDiff_infty_iff_deriv] + exact ⟨fun s ↦ (smoothTruncation_hasDerivAt ε s).differentiableAt, + by simpa only [funext (smoothTruncation_deriv ε)] using truncationSlope_contDiff ε⟩ + +theorem truncationSlope_mem_Icc (ε t : ℝ) : truncationSlope ε t ∈ Icc (0 : ℝ) 1 := + ⟨Real.smoothTransition.nonneg _, Real.smoothTransition.le_one _⟩ + +theorem truncationSlope_antitone {ε : ℝ} (hε : 0 < ε) : Antitone (truncationSlope ε) := by + intro s t hst + apply Real.smoothTransition.monotone + exact div_le_div_of_nonneg_right (sub_le_sub_left hst 1) hε.le + +theorem smoothTruncation_second_deriv_nonpos {ε : ℝ} (hε : 0 < ε) (s : ℝ) : + deriv (deriv (smoothTruncation ε)) s ≤ 0 := by + rw [show deriv (smoothTruncation ε) = truncationSlope ε from funext (smoothTruncation_deriv ε)] + exact (truncationSlope_antitone hε).deriv_nonpos + +@[simp] theorem smoothTruncation_zero (ε : ℝ) : smoothTruncation ε 0 = 0 := by + simp [smoothTruncation] + +theorem smoothTruncation_monotone (ε : ℝ) : Monotone (smoothTruncation ε) := by + apply monotone_of_deriv_nonneg + · exact fun s ↦ (smoothTruncation_hasDerivAt ε s).differentiableAt + · intro s + rw [smoothTruncation_deriv] + exact (truncationSlope_mem_Icc ε s).1 + +theorem smoothTruncation_nonneg (ε : ℝ) {s : ℝ} (hs : 0 ≤ s) : + 0 ≤ smoothTruncation ε s := by + simpa only [smoothTruncation_zero] using smoothTruncation_monotone ε hs + +theorem smoothTruncation_le_self (ε : ℝ) {s : ℝ} (hs : 0 ≤ s) : + smoothTruncation ε s ≤ s := by + have h := intervalIntegral.integral_mono hs + ((truncationSlope_contDiff ε).continuous.intervalIntegrable 0 s) + (intervalIntegrable_const : IntervalIntegrable (fun _ : ℝ ↦ (1 : ℝ)) volume 0 s) + (fun t ↦ (truncationSlope_mem_Icc ε t).2) + simpa only [smoothTruncation, intervalIntegral.integral_const, sub_zero, smul_eq_mul, mul_one] using h + +theorem truncationSlope_eq_zero {ε : ℝ} (hε : 0 < ε) {t : ℝ} (ht : 1 ≤ t) : + truncationSlope ε t = 0 := by + apply Real.smoothTransition.zero_of_nonpos + exact div_nonpos_of_nonpos_of_nonneg (sub_nonpos.mpr ht) hε.le + +theorem truncationSlope_eq_one {ε : ℝ} (hε : 0 < ε) {t : ℝ} (ht : t ≤ 1 - ε) : + truncationSlope ε t = 1 := by + apply Real.smoothTransition.one_of_one_le + apply (le_div_iff₀ hε).mpr + linarith + +theorem smoothTruncation_eq_self {ε s : ℝ} (hε : 0 < ε) (hs : 0 ≤ s) + (hsε : s ≤ 1 - ε) : smoothTruncation ε s = s := by + unfold smoothTruncation + calc + _ = ∫ _ in (0 : ℝ)..s, (1 : ℝ) := by + apply intervalIntegral.integral_congr + intro t ht + exact truncationSlope_eq_one hε ((uIcc_of_le hs ▸ ht).2.trans hsε) + _ = s := by simp + +theorem smoothTruncation_eq_at_one {ε s : ℝ} (hε : 0 < ε) (hs : 1 ≤ s) : + smoothTruncation ε s = smoothTruncation ε 1 := by + have hc := (truncationSlope_contDiff ε).continuous + have he := intervalIntegral.integral_add_adjacent_intervals (μ := volume) + (hc.intervalIntegrable 0 1) (hc.intervalIntegrable 1 s) + have hz : ∫ t in (1 : ℝ)..s, truncationSlope ε t = 0 := by + calc + _ = ∫ _ in (1 : ℝ)..s, (0 : ℝ) := by + apply intervalIntegral.integral_congr + intro t ht + exact truncationSlope_eq_zero hε ((uIcc_of_le hs ▸ ht).1) + _ = 0 := by simp + change _ = _ + change smoothTruncation ε 1 + (∫ t in (1 : ℝ)..s, truncationSlope ε t) = + smoothTruncation ε s at he + rw [hz, add_zero] at he + exact he.symm + +theorem smoothTruncation_le_min {ε s : ℝ} (hε : 0 < ε) (hs : 0 ≤ s) : + smoothTruncation ε s ≤ min s 1 := by + apply le_min (smoothTruncation_le_self ε hs) + by_cases h : s ≤ 1 + · exact (smoothTruncation_le_self ε hs).trans h + · rw [smoothTruncation_eq_at_one hε (le_of_not_ge h)] + exact smoothTruncation_le_self ε zero_le_one + +theorem min_sub_le_smoothTruncation {ε s : ℝ} (hε : 0 < ε) (hε1 : ε ≤ 1) + (hs : 0 ≤ s) : min s 1 - ε ≤ smoothTruncation ε s := by + by_cases h : s ≤ 1 - ε + · rw [smoothTruncation_eq_self hε hs h] + exact (sub_le_self _ hε.le).trans (min_le_left _ _) + · have h0 : 0 ≤ 1 - ε := sub_nonneg.mpr hε1 + have he : smoothTruncation ε (1 - ε) = 1 - ε := + smoothTruncation_eq_self hε h0 le_rfl + have hm := smoothTruncation_monotone ε (le_of_not_ge h) + rw [he] at hm + exact (sub_le_sub_right (min_le_right s 1) ε).trans hm + +def truncationParameter (j : ℕ) : ℝ := 1 / (j + 1 : ℝ) + +theorem truncationParameter_pos (j : ℕ) : 0 < truncationParameter j := by + unfold truncationParameter + positivity + +theorem truncationParameter_le_one (j : ℕ) : truncationParameter j ≤ 1 := by + unfold truncationParameter + apply (div_le_one (by positivity)).mpr + have hj : (0 : ℝ) ≤ j := Nat.cast_nonneg j + linarith + +theorem truncationParameter_tendsto : Tendsto truncationParameter atTop (𝓝 (0 : ℝ)) := + tendsto_one_div_add_atTop_nhds_zero_nat + +theorem smoothTruncation_tendsto {s : ℝ} (hs : 0 ≤ s) : + Tendsto (fun j ↦ smoothTruncation (truncationParameter j) s) atTop (𝓝 (min s 1)) := by + have hlow : Tendsto (fun j ↦ min s 1 - truncationParameter j) atTop (𝓝 (min s 1)) := by + simpa only [sub_zero] using tendsto_const_nhds.sub truncationParameter_tendsto + apply tendsto_of_tendsto_of_tendsto_of_le_of_le hlow tendsto_const_nhds + · intro j + exact min_sub_le_smoothTruncation (truncationParameter_pos j) + (truncationParameter_le_one j) hs + · intro j + exact smoothTruncation_le_min (truncationParameter_pos j) hs + +theorem truncationSlope_tendsto (s : ℝ) : + Tendsto (fun j ↦ truncationSlope (truncationParameter j) s) atTop + (𝓝 (if s < 1 then (1 : ℝ) else 0)) := by + split_ifs with hs + · apply tendsto_const_nhds.congr' + filter_upwards [truncationParameter_tendsto.eventually (gt_mem_nhds (sub_pos.mpr hs))] with j hj + symm + exact truncationSlope_eq_one (truncationParameter_pos j) (by linarith) + · apply tendsto_const_nhds.congr + intro j + symm + exact truncationSlope_eq_zero (truncationParameter_pos j) (le_of_not_gt hs) + +end RPI + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/GeometricHolder.lean b/lean/OAI/Geometry/Perimeter/Regularity/GeometricHolder.lean new file mode 100644 index 0000000000000000000000000000000000000000..d9973d1514cd57a57fbabf4724c8be8c6d217ca7 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/GeometricHolder.lean @@ -0,0 +1,96 @@ +import Mathlib + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace +namespace RPISingularHarnack + + def GeometricHolderAt {X Y : Type*} [PseudoMetricSpace X] [PseudoMetricSpace Y] + (θ : ℝ) (f : X → Y) (p : X) : Prop := + ∃ r C : ℝ, 0 exact ⟨1,0,by norm_num,le_rfl,by simp⟩ + | @insert i s hi ih => + obtain ⟨r,C,hr,hC,hs⟩ := ih + obtain ⟨b,D,hb,hD,hi⟩ := h i + refine ⟨min r b,max C D,lt_min hr hb,hC.trans (le_max_left _ _),?_⟩ + intro k hk j x hx y hy hxy + rcases Finset.mem_insert.mp hk with rfl | hk + · exact (hi j x (Metric.ball_subset_ball (min_le_right _ _) hx) y + (Metric.ball_subset_ball (min_le_right _ _) hy) + (hxy.trans (mul_le_mul_of_nonneg_left (min_le_right _ _) (pow_nonneg hθ j)))).trans + (mul_le_mul_of_nonneg_right (le_max_right _ _) (by positivity)) + · exact (hs k hk j x (Metric.ball_subset_ball (min_le_left _ _) hx) y + (Metric.ball_subset_ball (min_le_left _ _) hy) + (hxy.trans (mul_le_mul_of_nonneg_left (min_le_left _ _) (pow_nonneg hθ j)))).trans + (mul_le_mul_of_nonneg_right (le_max_left _ _) (by positivity)) + obtain ⟨r,C,hr,hC,hh⟩ := hall Finset.univ + refine ⟨r,C,hr,hC,fun j x hx y hy hxy ↦ ?_⟩ + exact (dist_pi_le_iff (by positivity)).mpr (fun i ↦ hh i (Finset.mem_univ _) j x hx y hy hxy) + + theorem GeometricHolderAt.clm_apply_iff {X V W : Type*} [PseudoMetricSpace X] + [NormedAddCommGroup V] [NormedSpace ℝ V] [FiniteDimensional ℝ V] + [NormedAddCommGroup W] [NormedSpace ℝ W] {θ : ℝ} (hθ : 0 ≤ θ) + {f : X → V →L[ℝ] W} {p : X} (hc : ContinuousAt f p) : + GeometricHolderAt θ f p ↔ ∀ e, GeometricHolderAt θ (fun x ↦ f x e) p := by + constructor + · intro h e + exact h.comp_C1 hθ hc (ContinuousLinearMap.apply ℝ W e).contDiff + · intro h + let d := Module.finrank ℝ V + have hd : d=Module.finrank ℝ (Fin d → ℝ) := (Module.finrank_fin_fun ℝ).symm + let e₁ := ContinuousLinearEquiv.ofFinrankEq hd + let e₂ := (e₁.arrowCongr (1 : W ≃L[ℝ] W)).trans (ContinuousLinearEquiv.piRing (Fin d)) + have hpi : GeometricHolderAt θ (fun x ↦ e₂ (f x)) p := GeometricHolderAt.pi hθ (fun i ↦ h _) + have hh := hpi.comp_C1 hθ (e₂.continuous.continuousAt.comp hc) e₂.symm.contDiff + simpa only [e₂.symm_apply_apply] using hh + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/GradientContDiff.lean b/lean/OAI/Geometry/Perimeter/Regularity/GradientContDiff.lean new file mode 100644 index 0000000000000000000000000000000000000000..084a42d33927cb01c3dccc7ebb380da6d0d7a081 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/GradientContDiff.lean @@ -0,0 +1,445 @@ +import OAI.Geometry.Perimeter.Regularity.C1MinRegularTest + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack +open RPI.Boundary +open ContinuousLinearMap + +theorem gradient_contDiff {n : ℕ} {u : Euc n → ℝ} (hu : ContDiff ℝ ∞ u) : + ContDiff ℝ ∞ (gradient u) := by + exact (InnerProductSpace.toDual ℝ (Euc n)).symm.contDiff.comp + (hu.fderiv_right (by simp)) + +theorem gradient_hasCompactSupport {n : ℕ} {u : Euc n → ℝ} + (hu : HasCompactSupport u) : HasCompactSupport (gradient u) := by + exact (hu.fderiv ℝ).comp_left (map_zero _) + +theorem integral_mul_divergence_eq_neg_inner_gradient {n : ℕ} {u : Euc n → ℝ} + {V : Euc n → Euc n} (hu : ContDiff ℝ ∞ u) (hcu : HasCompactSupport u) + (hV : ContDiff ℝ ∞ V) (hcV : HasCompactSupport V) : + (∫ x, u x * divergence V x) = - ∫ x, inner ℝ (gradient u x) (V x) := by + let b := EuclideanSpace.basisFun (Fin n) ℝ + let v : Fin n → Euc n → ℝ := fun i x ↦ inner ℝ (b i) (V x) + have hv : ∀ i, ContDiff ℝ ∞ (v i) := fun i ↦ (innerSL ℝ (b i)).contDiff.comp hV + have hcv : ∀ i, HasCompactSupport (v i) := fun i ↦ hcV.comp_left (by simp) + have hdv : ∀ i x, fderiv ℝ (v i) x (b i) = + inner ℝ (b i) (fderiv ℝ V x (b i)) := by + intro i x + have h := ((innerSL ℝ (b i)).hasFDerivAt.comp x + (hV.differentiable (by simp) x).hasFDerivAt).fderiv + exact congrArg (fun L : Euc n →L[ℝ] ℝ ↦ L (b i)) h + have hdi : ∀ i, Continuous (fun x ↦ fderiv ℝ u x (b i)) := fun i ↦ + (hu.continuous_fderiv (by simp)).clm_apply continuous_const + have hdvi : ∀ i, Continuous (fun x ↦ fderiv ℝ (v i) x (b i)) := fun i ↦ + ((hv i).continuous_fderiv (by simp)).clm_apply continuous_const + have hInt1 : ∀ i, Integrable (fun x ↦ fderiv ℝ u x (b i) * v i x) volume := fun i ↦ + ((hdi i).mul (hv i).continuous).integrable_of_hasCompactSupport (hcv i).mul_left + have hInt2 : ∀ i, Integrable (fun x ↦ u x * fderiv ℝ (v i) x (b i)) volume := fun i ↦ + (hu.continuous.mul (hdvi i)).integrable_of_hasCompactSupport hcu.mul_right + have hparts : ∀ i, (∫ x, u x * fderiv ℝ (v i) x (b i)) = + -∫ x, fderiv ℝ u x (b i) * v i x := by + intro i + exact integral_mul_fderiv_eq_neg_fderiv_mul_of_integrable (hInt1 i) (hInt2 i) + ((hu.continuous.mul (hv i).continuous).integrable_of_hasCompactSupport hcu.mul_right) + (fun x _ ↦ hu.differentiable (by simp) x) + (fun x _ ↦ (hv i).differentiable (by simp) x) + calc + (∫ x, u x * divergence V x) = ∫ x, ∑ i, u x * fderiv ℝ (v i) x (b i) := by + congr 1 + funext x + simp only [divergence, hdv, Finset.mul_sum, b] + _ = ∑ i, ∫ x, u x * fderiv ℝ (v i) x (b i) := integral_finsetSum _ (fun i _ ↦ hInt2 i) + _ = -(∑ i, ∫ x, fderiv ℝ u x (b i) * v i x) := by simp only [hparts, Finset.sum_neg_distrib] + _ = -(∫ x, ∑ i, fderiv ℝ u x (b i) * v i x) := by + rw [integral_finsetSum _ (fun i _ ↦ hInt1 i)] + _ = -(∫ x, inner ℝ (gradient u x) (V x)) := by + congr 1 + apply integral_congr_ae + apply ae_of_all + intro x + simp only [← inner_gradient_left, v] + exact b.sum_inner_mul_inner _ _ + +def gradientDualTest {n : ℕ} (u : Euc n → ℝ) (ε : ℝ) (x : Euc n) : Euc n := + -(Real.sqrt (ε ^ 2 + ‖gradient u x‖ ^ 2))⁻¹ • gradient u x + +theorem gradientDualTest_contDiff {n : ℕ} {u : Euc n → ℝ} + (hu : ContDiff ℝ ∞ u) {ε : ℝ} (hε : 0 < ε) : + ContDiff ℝ ∞ (gradientDualTest u ε) := by + have hg := gradient_contDiff hu + have hp : ∀ x, 0 < ε ^ 2 + ‖gradient u x‖ ^ 2 := fun x ↦ + add_pos_of_pos_of_nonneg (sq_pos_of_pos hε) (sq_nonneg _) + exact (((contDiff_const.add (hg.norm_sq ℝ)).sqrt (fun x ↦ (hp x).ne')).inv + (fun x ↦ (Real.sqrt_pos.2 (hp x)).ne')).neg.smul hg + +theorem gradientDualTest_hasCompactSupport {n : ℕ} {u : Euc n → ℝ} + (hcu : HasCompactSupport u) (ε : ℝ) : HasCompactSupport (gradientDualTest u ε) := by + change HasCompactSupport ((fun x ↦ -(Real.sqrt (ε ^ 2 + ‖gradient u x‖ ^ 2))⁻¹) • gradient u) + exact (gradient_hasCompactSupport hcu).smul_left + +theorem gradientDualTest_norm_le {n : ℕ} (u : Euc n → ℝ) {ε : ℝ} + (hε : 0 < ε) (x : Euc n) : ‖gradientDualTest u ε x‖ ≤ 1 := by + have hp : 0 < ε ^ 2 + ‖gradient u x‖ ^ 2 := + add_pos_of_pos_of_nonneg (sq_pos_of_pos hε) (sq_nonneg _) + have hs : ‖gradient u x‖ ≤ Real.sqrt (ε ^ 2 + ‖gradient u x‖ ^ 2) := by + rw [Real.le_sqrt (norm_nonneg _) hp.le] + nlinarith [sq_nonneg ε] + simp only [gradientDualTest, norm_smul, Real.norm_eq_abs, abs_neg, abs_inv, + abs_of_nonneg (Real.sqrt_nonneg _)] + rw [inv_mul_eq_div, div_le_one (Real.sqrt_pos.2 hp)] + exact hs + +theorem integral_norm_gradient_le_of_test_bound {n : ℕ} {u : Euc n → ℝ} + (hu : ContDiff ℝ ∞ u) (hcu : HasCompactSupport u) {P : ℝ} + (hbound : ∀ V : Euc n → Euc n, PerimeterAdmissible univ V → + (∫ x, u x * divergence V x) ≤ P) : + (∫ x, ‖gradient u x‖) ≤ P := by + let ε : ℕ → ℝ := fun j ↦ 1 / (j + 1 : ℝ) + have hε : ∀ j, 0 < ε j := by intro j; dsimp [ε]; positivity + let f : ℕ → Euc n → ℝ := fun j x ↦ + ‖gradient u x‖ ^ 2 / Real.sqrt (ε j ^ 2 + ‖gradient u x‖ ^ 2) + have hg := (gradient_contDiff hu).continuous + have hgi : Integrable (fun x ↦ ‖gradient u x‖) volume := + (hg.integrable_of_hasCompactSupport (gradient_hasCompactSupport hcu)).norm + have hf0 : ∀ j x, 0 ≤ f j x := by intro j x; exact div_nonneg (sq_nonneg _) (Real.sqrt_nonneg _) + have hfle : ∀ j x, f j x ≤ ‖gradient u x‖ := by + intro j x + have hp : 0 < ε j ^ 2 + ‖gradient u x‖ ^ 2 := + add_pos_of_pos_of_nonneg (sq_pos_of_pos (hε j)) (sq_nonneg _) + have hs : ‖gradient u x‖ ≤ Real.sqrt (ε j ^ 2 + ‖gradient u x‖ ^ 2) := by + rw [Real.le_sqrt (norm_nonneg _) hp.le] + nlinarith [sq_nonneg (ε j)] + exact (div_le_iff₀ (Real.sqrt_pos.2 hp)).2 (by nlinarith [norm_nonneg (gradient u x)]) + have hfcont : ∀ j, Continuous (f j) := by + intro j + exact (hg.norm.pow 2).div ((continuous_const.add (hg.norm.pow 2)).sqrt) + (fun x ↦ (Real.sqrt_pos.2 + (add_pos_of_pos_of_nonneg (sq_pos_of_pos (hε j)) (sq_nonneg _))).ne') + have hflim : ∀ x, Tendsto (fun j ↦ f j x) atTop (𝓝 ‖gradient u x‖) := by + intro x + have hlim : Tendsto ε atTop (𝓝 0) := by + simpa only [ε, Nat.cast_add, Nat.cast_one] using tendsto_one_div_add_atTop_nhds_zero_nat + by_cases hx : ‖gradient u x‖ = 0 + · simp [f, hx] + · have hden := ((hlim.pow 2).add_const (‖gradient u x‖ ^ 2)).sqrt + have hden' : Tendsto (fun j ↦ Real.sqrt (ε j ^ 2 + ‖gradient u x‖ ^ 2)) + atTop (𝓝 ‖gradient u x‖) := by + simpa [Real.sqrt_sq (norm_nonneg _)] using hden + have hh := (tendsto_const_nhds (x := ‖gradient u x‖ ^ 2)).div hden' hx + have heq : ‖gradient u x‖ ^ 2 / ‖gradient u x‖ = ‖gradient u x‖ := by + rw [pow_two, mul_div_cancel_right₀ _ hx] + change Tendsto (fun j ↦ ‖gradient u x‖ ^ 2 / Real.sqrt (ε j ^ 2 + ‖gradient u x‖ ^ 2)) + atTop (𝓝 (‖gradient u x‖ ^ 2 / ‖gradient u x‖)) at hh + rw [heq] at hh + exact hh + have hlim : Tendsto (fun j ↦ ∫ x, f j x) atTop (𝓝 (∫ x, ‖gradient u x‖)) := + tendsto_integral_of_dominated_convergence (fun x ↦ ‖gradient u x‖) + (fun j ↦ (hfcont j).aestronglyMeasurable) + hgi (fun j ↦ ae_of_all _ fun x ↦ by simpa only [Real.norm_eq_abs, abs_of_nonneg (hf0 j x)] using hfle j x) + (ae_of_all _ hflim) + apply le_of_tendsto hlim + apply Eventually.of_forall + intro j + let V := gradientDualTest u (ε j) + have hV : PerimeterAdmissible univ V := ⟨gradientDualTest_contDiff hu (hε j), + gradientDualTest_hasCompactSupport hcu _, subset_univ _, gradientDualTest_norm_le u (hε j)⟩ + have heq : (∫ x, u x * divergence V x) = ∫ x, f j x := by + rw [integral_mul_divergence_eq_neg_inner_gradient hu hcu hV.1 hV.2.1, ← integral_neg] + apply integral_congr_ae + apply ae_of_all + intro x + simp only [V, gradientDualTest, inner_smul_right, real_inner_self_eq_norm_sq, + f, mul_neg, neg_neg, div_eq_mul_inv, mul_comm] + rw [← heq] + exact hbound V hV + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack +open RPI.Boundary ContinuousLinearMap +open scoped Convolution + +theorem indicator_one_integrable_compact {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) (hb : Bornology.IsBounded E) : + Integrable (E.indicator (fun _ ↦ (1 : ℝ))) volume ∧ + HasCompactSupport (E.indicator (fun _ ↦ (1 : ℝ))) := by + have hfin : volume E ≠ ⊤ := ne_top_of_le_ne_top hb.isCompact_closure.measure_ne_top + (measure_mono subset_closure) + refine ⟨(integrable_indicator_iff hE).2 (integrableOn_const hfin), ?_⟩ + apply hb.isCompact_closure.of_isClosed_subset (isClosed_tsupport _) + apply closure_mono + intro x hx + by_contra hn + exact hx (indicator_of_notMem hn _) + +theorem c1Mollify_indicator_gradient_le_perimeter {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) (hb : Bornology.IsBounded E) (hP : perimeter E univ ≠ ⊤) + (j : ℕ) : + (∫⁻ x, ‖fderiv ℝ (c1Mollify (E.indicator (fun _ ↦ (1 : ℝ))) j) x‖ₑ) ≤ + perimeter E univ := by + let χ : Euc n → ℝ := E.indicator (fun _ ↦ 1) + let u := c1Mollify χ j + obtain ⟨hχ, hcχ⟩ := indicator_one_integrable_compact hE hb + have hu : ContDiff ℝ ∞ u := + (c1Mollifier j).hasCompactSupport_normed.contDiff_convolution_left _ + (c1Mollifier j).contDiff_normed hχ.locallyIntegrable + have hcu : HasCompactSupport u := c1Mollify_hasCompactSupport hcχ j + have hgrad : (∫ x, ‖gradient u x‖) ≤ (perimeter E univ).toReal := by + apply integral_norm_gradient_le_of_test_bound hu hcu + intro V hV + exact indicator_convolution_variation_le hE hP + (c1Mollifier j).continuous_normed + ((c1Mollifier j).continuous_normed.integrable_of_hasCompactSupport + (c1Mollifier j).hasCompactSupport_normed) + (c1Mollifier j).nonneg_normed (c1Mollifier j).integral_normed hV + have hnorm : ∀ x, ‖gradient u x‖ = ‖fderiv ℝ u x‖ := fun x ↦ + (InnerProductSpace.toDual ℝ (Euc n)).symm.norm_map _ + calc + (∫⁻ x, ‖fderiv ℝ u x‖ₑ) = ∫⁻ x, ENNReal.ofReal ‖gradient u x‖ := by + apply lintegral_congr + intro x + rw [hnorm, ofReal_norm] + _ = ENNReal.ofReal (∫ x, ‖gradient u x‖) := + (ofReal_integral_eq_lintegral_ofReal + ((gradient_contDiff hu).continuous.integrable_of_hasCompactSupport + (gradient_hasCompactSupport hcu)).norm (ae_of_all _ fun x ↦ norm_nonneg _)).symm + _ ≤ ENNReal.ofReal (perimeter E univ).toReal := ENNReal.ofReal_le_ofReal hgrad + _ = perimeter E univ := ENNReal.ofReal_toReal hP + +theorem raw_perimeter_isoperimetric {n : ℕ} {p : ℝ} + (hp : Real.HolderConjugate (n : ℝ) p) {E : Set (Euc n)} + (hE : MeasurableSet E) (hb : Bornology.IsBounded E) : + volume E ≤ (lintegralPowLePowLIntegralFDerivConst (volume : Measure (Euc n)) p : ℝ≥0∞) * + (perimeter E univ) ^ p := by + let χ : Euc n → ℝ := E.indicator (fun _ ↦ 1) + obtain ⟨hχ, hcχ⟩ := indicator_one_integrable_compact hE hb + let u : ℕ → Euc n → ℝ := c1Mollify χ + have hu : ∀ j, ContDiff ℝ ∞ (u j) := fun j ↦ + (c1Mollifier j).hasCompactSupport_normed.contDiff_convolution_left _ + (c1Mollifier j).contDiff_normed hχ.locallyIntegrable + have hcu : ∀ j, HasCompactSupport (u j) := c1Mollify_hasCompactSupport hcχ + have hlim : ∀ᵐ x ∂volume, Tendsto (fun j ↦ u j x) atTop (𝓝 (χ x)) := by + apply ContDiffBump.ae_convolution_tendsto_right_of_locallyIntegrable + c1Mollifier_radius_tendsto (K := 2) _ hχ.locallyIntegrable + apply Eventually.of_forall + intro j + dsimp [c1Mollifier] + linarith + have hSob : ∀ j, (∫⁻ x, ‖u j x‖ₑ ^ p) ≤ + (lintegralPowLePowLIntegralFDerivConst (volume : Measure (Euc n)) p : ℝ≥0∞) * + (perimeter E univ) ^ p := by + intro j + have hs := lintegral_pow_le_pow_lintegral_fderiv volume + ((hu j).of_le (by simp)) (hcu j) (by simpa using hp) + apply hs.trans + gcongr + · exact hp.symm.pos.le + by_cases hP : perimeter E univ = ⊤ + · rw [hP]; exact le_top + · exact c1Mollify_indicator_gradient_le_perimeter hE hb hP j + have hlp : ∀ᵐ x ∂volume, Tendsto (fun j ↦ ‖u j x‖ₑ ^ p) atTop (𝓝 (‖χ x‖ₑ ^ p)) := by + filter_upwards [hlim] with x hx + exact ENNReal.continuous_rpow_const.continuousAt.tendsto.comp hx.enorm + calc + volume E = ∫⁻ x, ‖χ x‖ₑ ^ p := by + have heq : (fun x ↦ ‖χ x‖ₑ ^ p) = E.indicator (fun _ ↦ (1 : ℝ≥0∞)) := by + funext x + by_cases hx : x ∈ E + · simp [χ, hx] + · simp [χ, hx, ENNReal.zero_rpow_of_pos hp.symm.pos] + rw [heq, lintegral_indicator hE] + simp + _ = ∫⁻ x, liminf (fun j ↦ ‖u j x‖ₑ ^ p) atTop := by + apply lintegral_congr_ae + filter_upwards [hlp] with x hx using hx.liminf_eq.symm + _ ≤ liminf (fun j ↦ ∫⁻ x, ‖u j x‖ₑ ^ p) atTop := + lintegral_liminf_le' (fun j ↦ ((hu j).continuous.measurable.enorm.pow_const p).aemeasurable) + _ ≤ (lintegralPowLePowLIntegralFDerivConst (volume : Measure (Euc n)) p : ℝ≥0∞) * + (perimeter E univ) ^ p := liminf_le_of_frequently_le (Eventually.of_forall hSob).frequently + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem radial_volume_increment_le {n : ℕ} (E : Set (Euc n)) (c : Euc n) + {a b : ℝ} (ha : 0 ≤ a) (hab : a ≤ b) : + volume.real (E ∩ Metric.closedBall c b) - volume.real (E ∩ Metric.closedBall c a) ≤ + (b ^ n - a ^ n) * volume.real (Metric.ball (0 : Euc n) 1) := by + have hf : volume (E ∩ Metric.closedBall c a) ≠ ⊤ := + measure_ne_top_of_subset inter_subset_right (isCompact_closedBall c a).measure_ne_top + calc + _ ≤ volume.real ((E ∩ Metric.closedBall c b) \ (E ∩ Metric.closedBall c a)) := + le_measureReal_sdiff hf + _ ≤ volume.real (Metric.closedBall c b \ Metric.closedBall c a) := by + apply measureReal_mono + · intro x hx + exact ⟨hx.1.2, fun h ↦ hx.2 ⟨hx.1.1, h⟩⟩ + · exact measure_ne_top_of_subset sdiff_subset (isCompact_closedBall c b).measure_ne_top + _ = _ := volume_real_annulus c ha hab + +theorem radial_volume_abs_sub_le {n : ℕ} (E : Set (Euc n)) (c : Euc n) + {a b : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) : + |volume.real (E ∩ Metric.closedBall c b) - volume.real (E ∩ Metric.closedBall c a)| ≤ + |b ^ n - a ^ n| * volume.real (Metric.ball (0 : Euc n) 1) := by + rcases le_total a b with hab | hba + · rw [abs_of_nonneg (sub_nonneg.mpr (measureReal_mono + (inter_subset_inter_right E (Metric.closedBall_subset_closedBall hab)) + (measure_ne_top_of_subset inter_subset_right (isCompact_closedBall c b).measure_ne_top))), + abs_of_nonneg (sub_nonneg.mpr (pow_le_pow_left₀ ha hab n))] + exact radial_volume_increment_le E c ha hab + · rw [abs_sub_comm (volume.real _), abs_sub_comm (b ^ n)] + rw [abs_of_nonneg (sub_nonneg.mpr (measureReal_mono + (inter_subset_inter_right E (Metric.closedBall_subset_closedBall hba)) + (measure_ne_top_of_subset inter_subset_right (isCompact_closedBall c a).measure_ne_top))), + abs_of_nonneg (sub_nonneg.mpr (pow_le_pow_left₀ hb hba n))] + exact radial_volume_increment_le E c hb hba + +theorem radial_volume_continuousAt {n : ℕ} (E : Set (Euc n)) (c : Euc n) + {r : ℝ} (hr : 0 < r) : + ContinuousAt (fun s : ℝ ↦ volume.real (E ∩ Metric.closedBall c s)) r := by + rw [ContinuousAt, ← tendsto_sub_nhds_zero_iff] + apply squeeze_zero_norm' (a := fun s : ℝ ↦ + |s ^ n - r ^ n| * volume.real (Metric.ball (0 : Euc n) 1)) + · filter_upwards [lt_mem_nhds hr] with s hs + simpa only [Real.norm_eq_abs] using radial_volume_abs_sub_le E c hr.le hs.le + · have ht : ContinuousAt (fun s : ℝ ↦ + |s ^ n - r ^ n| * volume.real (Metric.ball (0 : Euc n) 1)) r := by fun_prop + simpa using ht.tendsto + +theorem exists_controlled_cut_radius {n : ℕ} (E : Set (Euc n)) (c : Euc n) + {a b D : ℝ} (ha : 0 < a) (hab : a < b) + (hD : volume.real (E ∩ Metric.closedBall c b) < D * (b - a)) : + ∃ r ∈ Ico a b, ∀ t ∈ Icc r b, + volume.real (E ∩ Metric.closedBall c t) - volume.real (E ∩ Metric.closedBall c r) ≤ + D * (t - r) := by + let F : ℝ → ℝ := fun s ↦ volume.real (E ∩ Metric.closedBall c s) + have hcont : ContinuousOn (fun s ↦ F s - D * s) (Icc a b) := by + intro s hs + exact ((radial_volume_continuousAt E c (ha.trans_le hs.1)).sub + (continuousAt_const.mul continuousAt_id)).continuousWithinAt + obtain ⟨r, hr, hmax⟩ := isCompact_Icc.exists_isMaxOn (nonempty_Icc.mpr hab.le) hcont + have hrb : r < b := by + by_contra hh + have heq : r = b := le_antisymm hr.2 (not_lt.mp hh) + subst r + have hc := hmax (show a ∈ Icc a b from ⟨le_rfl, hab.le⟩) + have hn : 0 ≤ F a := ENNReal.toReal_nonneg + dsimp [F] at hc hn + nlinarith + refine ⟨r, ⟨hr.1, hrb⟩, ?_⟩ + intro t ht + have hc := hmax (show t ∈ Icc a b from ⟨hr.1.trans ht.1, ht.2⟩) + dsimp [F] at hc + nlinarith + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem integral_gradient_annularCutoff_in_set_le {n : ℕ} (E : Set (Euc n)) + (c : Euc n) {a b L : ℝ} (ha : 0 < a) (hab : a < b) (hL : 0 < L) + (hbound : ∀ s, |deriv Real.smoothTransition s| ≤ L) : + (∫ x in E, ‖gradient (annularCutoff c a b) x‖) ≤ + (2 * L * b / (b ^ 2 - a ^ 2)) * + volume.real (E ∩ (Metric.closedBall c b \ Metric.closedBall c a)) := by + let A := Metric.closedBall c b \ Metric.closedBall c a + have hid : (∫ x in A, ‖gradient (annularCutoff c a b) x‖ ∂volume.restrict E) = + ∫ x in E, ‖gradient (annularCutoff c a b) x‖ := by + apply setIntegral_eq_integral_of_forall_compl_eq_zero + intro x hx + rw [gradient_annularCutoff_zero ha hab, norm_zero] + by_cases hh : x ∈ Metric.closedBall c a + · exact Or.inl hh + · exact Or.inr (le_of_lt (lt_of_not_ge (fun h ↦ hx ⟨h, hh⟩))) + rw [← hid, Measure.restrict_restrict (measurableSet_closedBall.diff measurableSet_closedBall)] + calc + _ ≤ ‖∫ x in A ∩ E, ‖gradient (annularCutoff c a b) x‖‖ := le_abs_self _ + _ ≤ (2 * L * b / (b ^ 2 - a ^ 2)) * volume.real (A ∩ E) := by + apply norm_setIntegral_le_of_norm_le_const + ((measure_mono (inter_subset_left.trans sdiff_subset)).trans_lt + (isCompact_closedBall c b).measure_lt_top) + intro x hx + simpa only [norm_norm] using gradient_annularCutoff_bound ha hab hL hbound x + _ = _ := by rw [inter_comm] + +theorem controlled_radius_gradient_bound {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) (c : Euc n) {r B D L δ : ℝ} + (hr : 0 < r) (hδ : 0 < δ) (hδB : r + 2 * δ ≤ B) + (hcontrol : ∀ t ∈ Icc r B, + volume.real (E ∩ Metric.closedBall c t) - volume.real (E ∩ Metric.closedBall c r) ≤ + D * (t - r)) + (hD : 0 ≤ D) (hL : 0 < L) + (hbound : ∀ s, |deriv Real.smoothTransition s| ≤ L) : + (∫ x in E, ‖gradient (annularCutoff c (r + δ) (r + 2 * δ)) x‖) ≤ 4 * L * D := by + have ha : 0 < r + δ := by positivity + have hab : r + δ < r + 2 * δ := by linarith + have hden : 0 < (r + 2 * δ) ^ 2 - (r + δ) ^ 2 := by nlinarith + have hv : volume.real (E ∩ (Metric.closedBall c (r + 2 * δ) \ Metric.closedBall c (r + δ))) ≤ + 2 * D * δ := by + calc + _ ≤ volume.real ((E ∩ Metric.closedBall c (r + 2 * δ)) \ (E ∩ Metric.closedBall c r)) := by + apply measureReal_mono + · intro x hx + refine ⟨⟨hx.1, hx.2.1⟩, ?_⟩ + intro hh + exact hx.2.2 (Metric.closedBall_subset_closedBall (by linarith : r ≤ r + δ) hh.2) + · exact measure_ne_top_of_subset (sdiff_subset.trans inter_subset_right) + (isCompact_closedBall c (r + 2 * δ)).measure_ne_top + _ = volume.real (E ∩ Metric.closedBall c (r + 2 * δ)) - + volume.real (E ∩ Metric.closedBall c r) := by + exact measureReal_sdiff + (inter_subset_inter_right E (Metric.closedBall_subset_closedBall (by linarith))) + (hE.inter measurableSet_closedBall) + (measure_ne_top_of_subset inter_subset_right + (isCompact_closedBall c (r + 2 * δ)).measure_ne_top) + _ ≤ D * ((r + 2 * δ) - r) := hcontrol _ ⟨by linarith, hδB⟩ + _ = _ := by ring + have hcoef : 2 * L * (r + 2 * δ) / ((r + 2 * δ) ^ 2 - (r + δ) ^ 2) ≤ + 2 * L / δ := by + rw [div_le_div_iff₀ hden hδ] + nlinarith [mul_pos hL (mul_pos ha hδ)] + calc + _ ≤ (2 * L * (r + 2 * δ) / ((r + 2 * δ) ^ 2 - (r + δ) ^ 2)) * + volume.real (E ∩ (Metric.closedBall c (r + 2 * δ) \ Metric.closedBall c (r + δ))) := + integral_gradient_annularCutoff_in_set_le E c ha hab hL hbound + _ ≤ (2 * L / δ) * (2 * D * δ) := + (mul_le_mul_of_nonneg_left hv (by positivity)).trans + (mul_le_mul_of_nonneg_right hcoef (mul_nonneg (mul_nonneg (by norm_num) hD) hδ.le)) + _ = _ := by field_simp; ring + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/GraphChart.lean b/lean/OAI/Geometry/Perimeter/Regularity/GraphChart.lean new file mode 100644 index 0000000000000000000000000000000000000000..ed969215e5f3d5d933929628a9a4ffdb4845de4b --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/GraphChart.lean @@ -0,0 +1,128 @@ +import OAI.Geometry.Perimeter.Regularity.GraphPhase + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +variable {n : ℕ} + +def graphCylinder (v : Euc n) : Set (Euc n) := + {x | ‖normalProjection v x‖<1/4 ∧ |inner ℝ v x|<1/2} + +def graphDefining (v : Euc n) (f : normalPlane v → ℝ) (x : Euc n) : ℝ := + inner ℝ v x-f (normalProjection v x) + +theorem graphCylinder_open (v : Euc n) : IsOpen (graphCylinder v) := + (isOpen_lt (normalProjection v).continuous.norm continuous_const).inter + (isOpen_lt (show Continuous (fun x : Euc n ↦ |inner ℝ v x|) from + ((innerSL ℝ v).continuous).abs) continuous_const) + +@[simp] theorem graphDefining_fiber {v : Euc n} (hv : ‖v‖=1) + (f : normalPlane v → ℝ) (y : normalPlane v) (t : ℝ) : + graphDefining v f ((y:Euc n)+t•v)=t-f y := by + simp only [graphDefining,normalProjection_fiber,normal_fiber_inner hv] + +@[simp] theorem graphCylinder_fiber {v : Euc n} (hv : ‖v‖=1) + (y : normalPlane v) (t : ℝ) : + (y:Euc n)+t•v∈graphCylinder v ↔ ‖y‖<1/4 ∧ |t|<1/2 := by + simp only [graphCylinder,mem_ofPred_eq,normalProjection_fiber,normal_fiber_inner hv] + +theorem graphCylinder_norm_lt_one {v : Euc n} (hv : ‖v‖=1) + {x : Euc n} (hx : x∈graphCylinder v) : ‖x‖<1 := by + obtain ⟨⟨y,t⟩,rfl⟩ := (normalCoordinates v hv).surjective x + simp only [normalCoordinates_apply,graphCylinder_fiber hv] at hx ⊢ + have hh := norm_add_le (y:Euc n) (t•v) + rw [norm_smul,Real.norm_eq_abs,hv,mul_one] at hh + rw [Submodule.norm_coe] at hh + linarith [hx.1,hx.2] + +theorem graphDefining_contDiffOn {v : Euc n} {f : normalPlane v → ℝ} {k : ℕ∞ω} + (hf : ContDiffOn ℝ k f (Metric.ball 0 (1/4))) : + ContDiffOn ℝ k (graphDefining v f) (graphCylinder v) := by + apply (contDiff_const.inner ℝ contDiff_id).contDiffOn.sub + exact hf.comp (normalProjection v).contDiff.contDiffOn (fun x hx ↦ by + simpa only [Metric.mem_ball,dist_zero_right] using hx.1) + +theorem graphDefining_hasFDerivAt {v : Euc n} {f : normalPlane v → ℝ} + (hf : ContDiffOn ℝ 1 f (Metric.ball 0 (1/4))) {x : Euc n} + (hx : x∈graphCylinder v) : + HasFDerivAt (graphDefining v f) + ((innerSL ℝ v)-(fderiv ℝ f (normalProjection v x)).comp (normalProjection v)) x := by + have hy : normalProjection v x∈Metric.ball 0 (1/4) := by + simpa only [Metric.mem_ball,dist_zero_right] using hx.1 + have hfd : DifferentiableAt ℝ f (normalProjection v x) := + (hf.contDiffAt (Metric.isOpen_ball.mem_nhds hy)).differentiableAt (by norm_num) + exact (innerSL ℝ v).hasFDerivAt.sub (hfd.hasFDerivAt.comp x (normalProjection v).hasFDerivAt) + +theorem graphDefining_fderiv_normal {v : Euc n} (hv : ‖v‖=1) + {f : normalPlane v → ℝ} (hf : ContDiffOn ℝ 1 f (Metric.ball 0 (1/4))) + {x : Euc n} (hx : x∈graphCylinder v) : fderiv ℝ (graphDefining v f) x v=1 := by + rw [(graphDefining_hasFDerivAt hf hx).fderiv] + have hvp : normalProjection v v=0 := by + simpa only [Submodule.coe_zero,zero_add,one_smul] using normalProjection_fiber v 0 1 + simp only [sub_apply,ContinuousLinearMap.comp_apply,hvp,map_zero,sub_zero] + change inner ℝ v v=1 + rw [real_inner_self_eq_norm_sq,hv,one_pow] + +theorem graphDefining_fderiv_ne_zero {v : Euc n} (hv : ‖v‖=1) + {f : normalPlane v → ℝ} (hf : ContDiffOn ℝ 1 f (Metric.ball 0 (1/4))) + {x : Euc n} (hx : x∈graphCylinder v) : fderiv ℝ (graphDefining v f) x≠0 := by + intro h + have hh := graphDefining_fderiv_normal hv hf hx + rw [h,zero_apply] at hh + norm_num at hh + +theorem graphDefining_support_iff {v : Euc n} (hv : ‖v‖=1) {E : Set (Euc n)} + {f : normalPlane v → ℝ} + (hiff : ∀ (y : normalPlane v) (t : ℝ), ‖y‖<1/4 → ‖(y:Euc n)+t•v‖<1 → + ((y:Euc n)+t•v∈perimeterSupport E ↔ t=f y)) + {x : Euc n} (hx : x∈graphCylinder v) : x∈perimeterSupport E ↔ graphDefining v f x=0 := by + obtain ⟨⟨y,t⟩,rfl⟩ := (normalCoordinates v hv).surjective x + simp only [normalCoordinates_apply] at hx ⊢ + have hh := (graphCylinder_fiber hv y t).mp hx + rw [graphDefining_fiber hv,sub_eq_zero] + exact hiff y t hh.1 (graphCylinder_norm_lt_one hv hx) + +theorem graphDefining_phaseSupport_iff (hn : 1 rw [real_inner_comm] + ring + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/GraphGeoCoordinates.lean b/lean/OAI/Geometry/Perimeter/Regularity/GraphGeoCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..3654a487ab6d4105d6c79e1e086c0cd10f037f9c --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/GraphGeoCoordinates.lean @@ -0,0 +1,41 @@ +import OAI.Geometry.Perimeter.Regularity.GraphCoordinates + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +variable {m : ℕ} {W : Type*} [NormedAddCommGroup W] [InnerProductSpace ℝ W] + [FiniteDimensional ℝ W] + +theorem geoC_one_isometry {θ η : ℝ} (hθ : 0 ≤ θ) (hθh : θ ≤ 1/2) (hθη : θ ≤ η) + (e : Euc m ≃ₗᵢ[ℝ] W) {f : W → ℝ} {U : Set W} (hU : IsOpen U) + (hf : ContDiffOn ℝ 1 f U) + (hh : ∀ p∈U, GeometricHolderAt η (fderiv ℝ f) p) : + GeoC θ 1 (f ∘ e) (e ⁻¹' U) := by + have hV : IsOpen (e ⁻¹' U) := hU.preimage e.continuous + have hc : ContDiffOn ℝ 1 (f ∘ e) (e ⁻¹' U) := + hf.comp e.contDiff.contDiffOn (fun _ hx ↦ hx) + have hd : ContinuousOn (fderiv ℝ f) U := + (hf.fderiv_of_isOpen hU (m:=0) (by norm_num)).continuousOn + have hdc : ContinuousOn (fderiv ℝ (f ∘ e)) (e ⁻¹' U) := + (hc.fderiv_of_isOpen hV (m:=0) (by norm_num)).continuousOn + refine ⟨hc,geoC_zero_of_C1 hθ hθh hV hc,fun u ↦ ⟨hdc.clm_apply continuousOn_const,?_⟩⟩ + intro p hp + have hm := ((hh (e p) hp).mono_scale hθ hθη).precomp_isometry e + have hh' := hm.comp_C1 hθ + ((hd.continuousAt (hU.mem_nhds hp)).comp e.continuous.continuousAt) + (ContinuousLinearMap.apply ℝ ℝ (e u)).contDiff + have he : (fun x ↦ fderiv ℝ (f ∘ e) x u)=(fun x ↦ fderiv ℝ f (e x) (e u)) := by + funext x + exact congrArg (fun L : Euc m →L[ℝ] ℝ ↦ L u) + (e.toContinuousLinearEquiv.comp_right_fderiv (f:=f) (x:=x)) + rw [he] + exact hh' + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/GraphNormal.lean b/lean/OAI/Geometry/Perimeter/Regularity/GraphNormal.lean new file mode 100644 index 0000000000000000000000000000000000000000..c6036dc21e44af92faaac5c21acdd253b1e1e5f1 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/GraphNormal.lean @@ -0,0 +1,82 @@ +import OAI.Geometry.Perimeter.Regularity.GraphChart + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +variable {n : ℕ} + +def graphNormalVector (v : Euc n) (f : normalPlane v → ℝ) (y : normalPlane v) : Euc n := + v-((gradient f y : normalPlane v):Euc n) + +def graphAreaFactor (v : Euc n) (f : normalPlane v → ℝ) (y : normalPlane v) : ℝ := + ‖graphNormalVector v f y‖ + +theorem graphDefining_gradient {v : Euc n} {f : normalPlane v → ℝ} + (hf : ContDiffOn ℝ 1 f (Metric.ball 0 (1/4))) + {x : Euc n} (hx : x∈graphCylinder v) : + gradient (graphDefining v f) x=graphNormalVector v f (normalProjection v x) := by + apply ext_inner_right ℝ + intro z + rw [inner_gradient_left,(graphDefining_hasFDerivAt hf hx).fderiv] + simp only [sub_apply,ContinuousLinearMap.comp_apply] + change inner ℝ v z-fderiv ℝ f (normalProjection v x) (normalProjection v z)= + inner ℝ (v-((gradient f (normalProjection v x) : normalPlane v):Euc n)) z + rw [inner_sub_left,←(normalPlane v).inner_orthogonalProjectionOnto_eq_of_mem_left,inner_gradient_left] + +theorem graphNormalVector_inner_normal {v : Euc n} (hv : ‖v‖=1) + (f : normalPlane v → ℝ) (y : normalPlane v) : inner ℝ (graphNormalVector v f y) v=1 := by + rw [graphNormalVector,inner_sub_left,real_inner_self_eq_norm_sq,hv,one_pow, + Submodule.mem_orthogonal_singleton_iff_inner_left.mp (gradient f y).property,sub_zero] + +theorem graphAreaFactor_sq {v : Euc n} (hv : ‖v‖=1) + (f : normalPlane v → ℝ) (y : normalPlane v) : (graphAreaFactor v f y)^2=1+‖gradient f y‖^2 := by + rw [graphAreaFactor,graphNormalVector,norm_sub_sq_real,hv,one_pow, + Submodule.mem_orthogonal_singleton_iff_inner_right.mp (gradient f y).property, + mul_zero,sub_zero,Submodule.norm_coe] + +theorem graphAreaFactor_pos {v : Euc n} (hv : ‖v‖=1) + (f : normalPlane v → ℝ) (y : normalPlane v) : 0 arg 2; ext x; rw [he,map_smul] + simp only [smul_eq_mul] + rw [integral_const_mul,hh,mul_zero] + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/HarmonicApproxIdentity.lean b/lean/OAI/Geometry/Perimeter/Regularity/HarmonicApproxIdentity.lean new file mode 100644 index 0000000000000000000000000000000000000000..9810eff799e77eb5de03c31e0ce65837518c936d --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/HarmonicApproxIdentity.lean @@ -0,0 +1,54 @@ +import OAI.Geometry.Perimeter.Regularity.HarmonicKernel + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff Convolution InnerProductSpace +namespace RPISingularHarnack +open RPI.Boundary ContinuousLinearMap +variable {n : ℕ} + +theorem scaledHarmonicKernel_ball_bound {t : ℝ} (ht : 0 < t) (c x : Euc n) : + |scaledHarmonicKernel t (c-x)| ≤ + (volume.real (Metric.ball (0:Euc n) 1)/harmonicKernelMass n) / + volume.real (Metric.closedBall c (1/t)) := by + have hω : 0 < volume.real (Metric.ball (0:Euc n) 1) := + ENNReal.toReal_pos (Metric.measure_ball_pos volume (0:Euc n) zero_lt_one).ne' + measure_ball_lt_top.ne + rw [Measure.addHaar_real_closedBall volume c (one_div_pos.mpr ht).le] + simp only [finrank_euclideanSpace,Fintype.card_fin] + calc + _ ≤ t^n/harmonicKernelMass n := scaledHarmonicKernel_bound ht _ + _ = _ := by + simp only [one_div,inv_pow] + field_simp [ht.ne',hω.ne',(harmonicKernelMass_pos n).ne'] + +theorem scaledHarmonicKernel_ae_tendsto {u : Euc n → ℝ} (hu : LocallyIntegrable u volume) : + ∀ᵐ c ∂volume, Tendsto (fun i : ℕ ↦ + ∫ x, scaledHarmonicKernel ((i:ℝ)+1) (c-x)*u x) atTop (𝓝 (u c)) := by + have hd := IsUnifLocDoublingMeasure.ae_tendsto_average_norm_sub volume hu (1:ℝ) + filter_upwards [hd] with c hc + have hr : Tendsto (fun i : ℕ ↦ 1/((i:ℝ)+1)) atTop (𝓝[>] (0:ℝ)) := + tendsto_nhdsWithin_iff.mpr ⟨tendsto_one_div_add_atTop_nhds_zero_nat, + Eventually.of_forall fun i ↦ (show 0 < 1/((i:ℝ)+1) from one_div_pos.mpr (by positivity))⟩ + have hm := hc (fun _ : ℕ ↦ c) (fun i : ℕ ↦ 1/((i:ℝ)+1)) hr (by + apply Eventually.of_forall + intro i + exact Metric.mem_closedBall_self (by positivity)) + have h := tendsto_integral_smul_of_tendsto_average_norm_sub + (g := fun i : ℕ ↦ fun x ↦ scaledHarmonicKernel ((i:ℝ)+1) (c-x)) + (volume.real (Metric.ball (0:Euc n) 1)/harmonicKernelMass n) hm + (Eventually.of_forall fun i ↦ hu.integrableOn_isCompact (isCompact_closedBall _ _)) + (show Tendsto (fun i : ℕ ↦ ∫ x, scaledHarmonicKernel ((i:ℝ)+1) (c-x)) atTop (𝓝 1) by + exact tendsto_const_nhds.congr (fun i ↦ (shifted_scaledHarmonicKernel_integral + (by positivity : 0 < (i:ℝ)+1) c).symm)) + (Eventually.of_forall fun i ↦ shifted_scaledHarmonicKernel_support (by positivity) c) + (Eventually.of_forall fun i x ↦ scaledHarmonicKernel_ball_bound (by positivity) c x) + simpa only [smul_eq_mul] using h + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/HarmonicHeightLimit.lean b/lean/OAI/Geometry/Perimeter/Regularity/HarmonicHeightLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..a1775a320aca3359e7869e3bb89012c7199bcdc8 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/HarmonicHeightLimit.lean @@ -0,0 +1,141 @@ +import OAI.Geometry.Perimeter.Regularity.PlaneHeightResidual + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal InnerProductSpace ContDiff +namespace RPISingularHarnack +open RPI.Boundary ContinuousLinearMap +variable {n m : ℕ} + +theorem l1_test_pairing_tendsto {f : ℕ → Euc m → ℝ} {g φ : Euc m → ℝ} + (hf : ∀ i, Integrable (f i) volume) (hg : Integrable g volume) + (hφ : AEStronglyMeasurable φ volume) {M : ℝ} (hb : ∀ x, ‖φ x‖≤M) + (hL : Tendsto (fun i ↦ ∫⁻ x, ‖f i x-g x‖ₑ) atTop (𝓝 0)) : + Tendsto (fun i ↦ ∫ x, f i x*φ x) atTop (𝓝 (∫ x, g x*φ x)) := by + apply tendsto_integral_of_L1 _ (hg.aestronglyMeasurable.mul hφ) + (Eventually.of_forall (fun i ↦ (hf i).mul_bdd hφ (ae_of_all _ hb))) + have ht : Tendsto (fun i ↦ ENNReal.ofReal M * ∫⁻ x, ‖f i x-g x‖ₑ) atTop (𝓝 0) := by + simpa using ENNReal.Tendsto.const_mul hL (Or.inr ENNReal.ofReal_ne_top) + apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds ht + (fun _ ↦ zero_le) (fun i ↦ ?_) + rw [← lintegral_const_mul' _ _ ENNReal.ofReal_ne_top] + apply lintegral_mono + intro x + dsimp only [Pi.mul_apply] + rw [← sub_mul,enorm_mul,mul_comm] + exact mul_le_mul + (by simpa only [← ofReal_norm] using ENNReal.ofReal_le_ofReal (hb x)) le_rfl zero_le zero_le + +theorem chartLaplacianTest_tsupport {v : Euc n} (e : Euc m ≃ₗᵢ[ℝ] normalPlane v) + (ψ : Euc m → ℝ) : tsupport (chartLaplacianTest e ψ) ⊆ e '' tsupport ψ := by + intro y hy + refine ⟨e.symm y,?_,e.apply_symm_apply y⟩ + have hs : tsupport (divergence (gradient ψ)) ⊆ tsupport ψ := + (tsupport_divergence_subset _).trans (tsupport_gradient_subset ψ) + apply hs + change y ∈ tsupport ((divergence (gradient ψ)) ∘ (e.symm.toHomeomorph : _ → _)) at hy + rw [tsupport_comp_eq_preimage _ e.symm.toHomeomorph] at hy + exact hy + +theorem minimizing_plane_height_weakHarmonic (hn : 1.add (htilt.const_mul M) + have hz : Tendsto (fun i ↦ ∫ y, chartFiber v e (a i) (cutoffPhaseError (E i) v η) y * + divergence (gradient ψ) y) atTop (𝓝 0) := by + rw [tendsto_zero_iff_norm_tendsto_zero] + exact squeeze_zero' (Eventually.of_forall (fun _ ↦ norm_nonneg _)) hr ht + have hf (i) : Integrable (cutoffPhaseError (E i) v η) volume := by + apply (integrableOn_iff_integrable_of_support_subset + ((cutoffPhaseError_support (E i) v η).trans (subset_tsupport η))).mp + have : Fact (volume (tsupport η) < (∞ : ℝ≥0∞)) := ⟨hsη.measure_lt_top⟩ + refine ⟨(cutoffPhaseError_measurable (hmin i).1 v hη.measurable).aestronglyMeasurable.restrict, ?_⟩ + apply HasFiniteIntegral.of_bounded (C := 1) + apply ae_of_all + intro x + dsimp only [cutoffPhaseError] + rw [norm_mul] + have hb : ‖(E i).indicator (fun _ ↦ (1:ℝ)) x - {z | inner ℝ v z<0}.indicator (fun _ ↦ (1:ℝ)) x‖≤1 := by + by_cases he : x∈E i <;> by_cases hh : inner ℝ v x<0 <;> simp [he,hh] + exact (mul_le_mul (hbη x) hb (norm_nonneg _) zero_le_one).trans_eq (one_mul _) + have htpair := l1_test_pairing_tendsto (fun i ↦ chartFiber_integrable (hf i) hv e (a i)) hg + (continuous_divergence (gradient_contDiff hψ)).aestronglyMeasurable hM hL + exact tendsto_nhds_unique htpair hz + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/HarmonicKernel.lean b/lean/OAI/Geometry/Perimeter/Regularity/HarmonicKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..c836a439268cc827dac27432adec9cfd5022f954 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/HarmonicKernel.lean @@ -0,0 +1,106 @@ +import OAI.Geometry.Perimeter.Regularity.SmulMemPhaseSupport + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff Convolution InnerProductSpace +namespace RPISingularHarnack +open RPI.Boundary ContinuousLinearMap +variable {n : ℕ} + +def harmonicKernelRaw (x : Euc n) : ℝ := densityProfile 1 (‖x‖^2) +def harmonicKernelMass (n : ℕ) : ℝ := ∫ x : Euc n, harmonicKernelRaw x + +theorem harmonicKernelRaw_contDiff : ContDiff ℝ ∞ (harmonicKernelRaw (n := n)) := + (densityProfile_contDiff 1).comp (contDiff_id.norm_sq (𝕜 := ℝ)) + +theorem harmonicKernelRaw_tsupport : tsupport (harmonicKernelRaw (n := n)) ⊆ + Metric.closedBall 0 1 := by + have h := radialProfile_tsupport (0:Euc n) (fun s hs ↦ densityProfile_zero 1 hs) zero_lt_one + change tsupport (fun x : Euc n ↦ densityProfile 1 (‖x‖^2)) ⊆ _ + simpa only [one_pow,one_mul,sub_zero,div_one] using h + +theorem harmonicKernelRaw_compact : HasCompactSupport (harmonicKernelRaw (n := n)) := + (isCompact_closedBall 0 1).of_isClosed_subset (isClosed_tsupport _) harmonicKernelRaw_tsupport + +theorem harmonicKernelMass_pos (n : ℕ) : 0 < harmonicKernelMass n := by + apply harmonicKernelRaw_contDiff.continuous.integral_pos_of_hasCompactSupport_nonneg_nonzero + harmonicKernelRaw_compact (fun x ↦ (densityProfile_mem_Icc 1 _).1) (x := 0) + simp only [harmonicKernelRaw,norm_zero,zero_pow (by decide : 2 ≠ 0),densityProfile] + norm_num [Real.smoothTransition.one_of_one_le] + +def harmonicKernel (x : Euc n) : ℝ := harmonicKernelRaw x / harmonicKernelMass n + +theorem harmonicKernel_contDiff : ContDiff ℝ ∞ (harmonicKernel (n := n)) := + harmonicKernelRaw_contDiff.div_const _ + +theorem harmonicKernel_tsupport : tsupport (harmonicKernel (n := n)) ⊆ Metric.closedBall 0 1 := + by + change tsupport (fun x : Euc n ↦ harmonicKernelRaw x / harmonicKernelMass n) ⊆ _ + simp only [div_eq_mul_inv] + exact tsupport_mul_subset_left.trans harmonicKernelRaw_tsupport + +theorem harmonicKernel_compact : HasCompactSupport (harmonicKernel (n := n)) := + (isCompact_closedBall 0 1).of_isClosed_subset (isClosed_tsupport _) harmonicKernel_tsupport + +theorem harmonicKernel_integral : (∫ x : Euc n, harmonicKernel x) = 1 := by + simp only [harmonicKernel,integral_div] + exact div_self (harmonicKernelMass_pos n).ne' + +def scaledHarmonicKernel (t : ℝ) (x : Euc n) : ℝ := t^n*harmonicKernel (t•x) + +theorem scaledHarmonicKernel_contDiff (t : ℝ) : + ContDiff ℝ ∞ (scaledHarmonicKernel (n := n) t) := + contDiff_const.mul (harmonicKernel_contDiff.comp (contDiff_id.const_smul t)) + +theorem scaledHarmonicKernel_eq {t : ℝ} (ht : 0 < t) (x : Euc n) : + scaledHarmonicKernel t x = t^n*densityProfile 1 (t^2*‖x‖^2)/harmonicKernelMass n := by + simp only [scaledHarmonicKernel,harmonicKernel,harmonicKernelRaw,norm_smul, + Real.norm_eq_abs,abs_of_pos ht,mul_pow] + ring + +theorem scaledHarmonicKernel_integral {t : ℝ} (ht : 0 < t) : + (∫ x : Euc n, scaledHarmonicKernel t x) = 1 := by + change (∫ x : Euc n, t^n*harmonicKernel (t•x)) = 1 + rw [integral_const_mul] + have h := Measure.integral_comp_smul_of_nonneg (volume : Measure (Euc n)) + harmonicKernel t (hR := ht.le) + simp only [finrank_euclideanSpace,Fintype.card_fin,smul_eq_mul,harmonicKernel_integral] at h + rw [h] + simp [ht.ne'] + +theorem scaledHarmonicKernel_tsupport {t : ℝ} (ht : 0 < t) : + tsupport (scaledHarmonicKernel (n := n) t) ⊆ Metric.closedBall 0 (1/t) := by + have he : scaledHarmonicKernel (n := n) t = fun x ↦ + (t^n/harmonicKernelMass n)*densityProfile 1 (t^2*‖x-0‖^2) := by + funext x + rw [scaledHarmonicKernel_eq ht,sub_zero]; ring + rw [he] + exact tsupport_mul_subset_right.trans + (radialProfile_tsupport 0 (fun s hs ↦ densityProfile_zero 1 hs) ht) + +theorem scaledHarmonicKernel_bound {t : ℝ} (ht : 0 < t) (x : Euc n) : + |scaledHarmonicKernel t x| ≤ t^n/harmonicKernelMass n := by + rw [scaledHarmonicKernel_eq ht,abs_div,abs_of_pos (harmonicKernelMass_pos n), + abs_mul,abs_of_pos (pow_pos ht _),abs_of_nonneg (densityProfile_mem_Icc 1 _).1] + exact div_le_div_of_nonneg_right + (mul_le_of_le_one_right (pow_nonneg ht.le _) (densityProfile_mem_Icc 1 _).2) + (harmonicKernelMass_pos n).le + +theorem shifted_scaledHarmonicKernel_integral {t : ℝ} (ht : 0 < t) (c : Euc n) : + (∫ x, scaledHarmonicKernel t (c-x)) = 1 := by + rw [integral_sub_left_eq_self] + exact scaledHarmonicKernel_integral ht + +theorem shifted_scaledHarmonicKernel_support {t : ℝ} (ht : 0 < t) (c : Euc n) : + Function.support (fun x ↦ scaledHarmonicKernel t (c-x)) ⊆ Metric.closedBall c (1/t) := by + intro x hx + have h := scaledHarmonicKernel_tsupport ht (subset_tsupport _ hx) + simpa only [Metric.mem_closedBall,dist_zero_right,dist_eq_norm,sub_zero,norm_sub_rev] using h + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/HarmonicLimitBounds.lean b/lean/OAI/Geometry/Perimeter/Regularity/HarmonicLimitBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..4420722dec3d0e492db39be7a63bb0b0721be0b9 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/HarmonicLimitBounds.lean @@ -0,0 +1,72 @@ +import OAI.Geometry.Perimeter.Regularity.GeoComposition + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff Convolution InnerProductSpace +namespace RPISingularHarnack +open RPI.Boundary ContinuousLinearMap +variable {n : ℕ} + +theorem integral_norm_le_of_L1_limit {X : Type*} [MeasurableSpace X] + {μ : Measure X} (f : ℕ → X → ℝ) (hf : ∀ i, Integrable (f i) μ) + {g : X → ℝ} (hg : Integrable g μ) {V : ℝ} + (hb : ∀ i, ∫ x, ‖f i x‖ ∂μ ≤ V) + (hL : Tendsto (fun i ↦ ∫⁻ x, ‖f i x-g x‖ₑ ∂μ) atTop (𝓝 0)) : + ∫ x, ‖g x‖ ∂μ ≤ V := by + have hn : Tendsto (fun i ↦ ∫⁻ x, ‖‖f i x‖-‖g x‖‖ₑ ∂μ) atTop (𝓝 0) := by + apply tendsto_of_tendsto_of_tendsto_of_le_of_le' tendsto_const_nhds hL + (Eventually.of_forall fun _ ↦ zero_le) + exact Eventually.of_forall fun i ↦ lintegral_mono fun x ↦ by + rw [← ofReal_norm,← ofReal_norm] + exact ENNReal.ofReal_le_ofReal (by simpa only [Real.norm_eq_abs] using abs_norm_sub_norm_le (f i x) (g x)) + exact le_of_tendsto' (tendsto_integral_of_L1 (fun x ↦ ‖g x‖) + hg.norm.aestronglyMeasurable (Eventually.of_forall fun i ↦ (hf i).norm) hn) hb + +theorem kernelLinear_uniform_bound {k : Euc n → ℝ} + (hk : ContDiff ℝ ∞ k) (hc : HasCompactSupport k) : + ∃ M : ℝ, 0≤M ∧ ∀ u : Euc n → ℝ, Integrable u volume → + ‖kernelLinear u k‖≤M*(∫ x, ‖u x‖) := by + obtain ⟨M,hM⟩ := (hc.fderiv ℝ).exists_bound_of_continuous (hk.continuous_fderiv (by simp)) + refine ⟨M,(norm_nonneg _).trans (hM 0),fun u hu ↦ ?_⟩ + apply (norm_integral_le_integral_norm _).trans + have h := integral_mono_ae (kernelLinear_integrable hu hk hc).norm (hu.norm.const_mul M) + (ae_of_all _ fun x ↦ show ‖u x • fderiv ℝ k (-x)‖≤M*‖u x‖ from by + rw [norm_smul,mul_comm M] + exact mul_le_mul_of_nonneg_left (hM (-x)) (norm_nonneg _)) + simpa only [integral_const_mul] using h + +theorem harmonicRegularization_uniform_taylor (n : ℕ) : + ∃ C : ℝ, 0≤C ∧ ∀ u : Euc n → ℝ, Integrable u volume → ∀ y : Euc n, + ‖harmonicRegularization u 4 y-harmonicRegularization u 4 0- + kernelLinear u (scaledHarmonicKernel 4) y‖ ≤ C*(∫ x, ‖u x‖)*‖y‖^2 := by + exact convolution_uniform_taylor (scaledHarmonicKernel_contDiff 4) + ((isCompact_closedBall 0 (1/(4:ℝ))).of_isClosed_subset (isClosed_tsupport _) + (scaledHarmonicKernel_tsupport (by norm_num))) + +theorem harmonic_height_representative_bounds (hn : 0.aemeasurable.ennreal_ofReal) ?_ ?_ ?_ + · simpa only [vectorEnergy, Pi.sub_apply, lintegral_zero] using hlim + · intro j + filter_upwards [hbound j, hfbound] with x hx hy + apply ENNReal.ofReal_le_ofReal + apply (sq_le_sq₀ (norm_nonneg _) (by positivity)).mpr + exact (norm_sub_le _ _).trans (by linarith) + · simp only [lintegral_const] + exact ENNReal.mul_ne_top ENNReal.ofReal_ne_top (measure_ne_top _ _) + · filter_upwards [ht] with x hx + simpa only [sub_self, norm_zero, zero_pow (by norm_num : (2 : ℕ) ≠ 0), + ENNReal.ofReal_zero] using ENNReal.tendsto_ofReal ((hx.sub_const (f x)).norm.pow 2) + +end RPI + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPI.Boundary + +theorem c1_compact_mem_sobolevGraph {n : ℕ} (S V : Set (Space n)) + [IsFiniteMeasure ((surfaceMeasure S).restrict V)] + (hgrad : ∀ f : Space n → ℝ, ContDiff ℝ ∞ f → + AEStronglyMeasurable (surfaceGradient S f) ((surfaceMeasure S).restrict V)) + {f : Space n → ℝ} (hf : ContDiff ℝ 1 f) (hc : HasCompactSupport f) + (hm : MemLp f 2 ((surfaceMeasure S).restrict V)) + (hD : MemLp (surfaceGradient S f) 2 ((surfaceMeasure S).restrict V)) : + (hm.toLp f, hD.toLp (surfaceGradient S f)) ∈ closure (smoothGradientGraph S V) := by + obtain ⟨M, hM, hbound, hfb⟩ := c1Mollify_pair_bounded S hf hc + have hfm : ∀ j, MemLp (c1Mollify f j) 2 ((surfaceMeasure S).restrict V) := by + intro j + exact MemLp.of_bound (c1Mollify_contDiff hf.continuous j).continuous.aestronglyMeasurable M + (ae_of_all _ fun x ↦ (hbound j x).1) + have hDm : ∀ j, MemLp (surfaceGradient S (c1Mollify f j)) 2 + ((surfaceMeasure S).restrict V) := by + intro j + exact MemLp.of_bound (hgrad _ (c1Mollify_contDiff hf.continuous j)) M + (ae_of_all _ fun x ↦ (hbound j x).2) + have ht := bounded_tendsto_toLp_two hfm hm hM.le + (fun j ↦ ae_of_all _ fun x ↦ (hbound j x).1) + (ae_of_all _ fun x ↦ (hfb x).1) (ae_of_all _ fun x ↦ c1Mollify_tendsto hf.continuous x) + have hDt := bounded_tendsto_toLp_two hDm hD hM.le + (fun j ↦ ae_of_all _ fun x ↦ (hbound j x).2) + (ae_of_all _ fun x ↦ (hfb x).2) (ae_of_all _ fun x ↦ c1Mollify_surfaceGradient_tendsto S hf hc x) + apply mem_closure_of_tendsto (ht.prodMk_nhds hDt) + exact Eventually.of_forall fun j ↦ ⟨c1Mollify f j, c1Mollify_contDiff hf.continuous j, + hfm j, hDm j, rfl⟩ + +theorem exists_c1_compact_trace_on_bounded {n : ℕ} (S V : Set (Space n)) + (hV : Bornology.IsBounded V) (f : Space n → ℝ) (hf : ContDiff ℝ 1 f) : + ∃ F : Space n → ℝ, ContDiff ℝ 1 F ∧ HasCompactSupport F ∧ + EqOn F f V ∧ EqOn (surfaceGradient S F) (surfaceGradient S f) V := by + obtain ⟨r, hr⟩ := Metric.isBounded_iff_subset_ball (0 : Space n) |>.mp hV + let b : ContDiffBump (0 : Space n) := + ⟨|r| + 1, |r| + 2, by positivity, by linarith⟩ + have hb : V ⊆ Metric.ball (0 : Space n) b.rIn := by + intro x hx + have hx' := Metric.mem_ball.mp (hr hx) + change dist x 0 < |r| + 1 + linarith [le_abs_self r] + have hb1 : ContDiff ℝ 1 b := b.contDiff + refine ⟨fun x ↦ b x * f x, hb1.mul hf, b.hasCompactSupport.mul_right, ?_, ?_⟩ + · intro x hx + change b x * f x = f x + rw [b.one_of_mem_closedBall (Metric.ball_subset_closedBall (hb hx)), one_mul] + · intro x hx + apply surfaceGradient_congr_trace + ((hb1.mul hf).differentiable (by norm_num) x) + (hf.differentiable (by norm_num) x) + filter_upwards [b.eventuallyEq_one_of_mem_ball (hb hx)] with y hy + intro _ + simp only [hy, Pi.one_apply, one_mul] + +theorem c1_mem_sobolevGraph_bounded {n : ℕ} (S V : Set (Space n)) + (hV : Bornology.IsBounded V) (hVm : MeasurableSet V) + [IsFiniteMeasure ((surfaceMeasure S).restrict V)] + (hgrad : ∀ f : Space n → ℝ, ContDiff ℝ ∞ f → + AEStronglyMeasurable (surfaceGradient S f) ((surfaceMeasure S).restrict V)) + {f : Space n → ℝ} (hf : ContDiff ℝ 1 f) + (hm : MemLp f 2 ((surfaceMeasure S).restrict V)) + (hD : MemLp (surfaceGradient S f) 2 ((surfaceMeasure S).restrict V)) : + (hm.toLp f, hD.toLp (surfaceGradient S f)) ∈ closure (smoothGradientGraph S V) := by + obtain ⟨F, hF, hcF, he, hDe⟩ := exists_c1_compact_trace_on_bounded S V hV f hf + have he' : F =ᵐ[(surfaceMeasure S).restrict V] f := by + filter_upwards [ae_restrict_mem hVm] with x hx using he hx + have hDe' : surfaceGradient S F =ᵐ[(surfaceMeasure S).restrict V] surfaceGradient S f := by + filter_upwards [ae_restrict_mem hVm] with x hx using hDe hx + let hmF := hm.ae_eq he'.symm + let hDF := hD.ae_eq hDe'.symm + have hp := c1_compact_mem_sobolevGraph S V hgrad hF hcF hmF hDF + simpa only [hmF.toLp_congr hm he', hDF.toLp_congr hD hDe'] using hp + +end RPI.Boundary + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPI.Boundary + +theorem c1_capacity_trace_mem_sobolevGraph {n : ℕ} {S Z : Set (Space n)} + (hS : IsClosed S) (V : Set (Space n)) + (hV : Bornology.IsBounded V) (hVm : MeasurableSet V) + [IsFiniteMeasure ((surfaceMeasure S).restrict V)] + (hgrad : ∀ f : Space n → ℝ, ContDiff ℝ ∞ f → + AEStronglyMeasurable (surfaceGradient S f) ((surfaceMeasure S).restrict V)) + {h : Space n → ℝ} {G : Space n → Space n} + (hreg : ∀ x ∈ S \ Z, HasC1TraceJetAt S h G x) + (hh : MemLp h 2 ((surfaceMeasure S).restrict V)) + (hG : MemLp G 2 ((surfaceMeasure S).restrict V)) + {M : ℝ} (hM : 0 ≤ M) + (hbound : ∀ᵐ x ∂(surfaceMeasure S).restrict V, ‖h x‖ ≤ M) + (χ : ℕ → Space n → ℝ) + (hχ : ∀ i, ContDiff ℝ ∞ (χ i)) + (hχzero : ∀ i, ∃ U : Set (Space n), IsOpen U ∧ Z ⊆ U ∧ ∀ x ∈ U, χ i x = 0) + (hχb : ∀ i, ∀ᵐ x ∂(surfaceMeasure S).restrict V, χ i x ∈ Icc (0 : ℝ) 1) + (hχlim : ∀ᵐ x ∂(surfaceMeasure S).restrict V, + Tendsto (fun i ↦ χ i x) atTop (𝓝 1)) + (hC : ∀ i, MemLp (surfaceGradient S (χ i)) 2 ((surfaceMeasure S).restrict V)) + (hC0 : Tendsto (fun i ↦ vectorEnergy ((surfaceMeasure S).restrict V) + (surfaceGradient S (χ i))) atTop (𝓝 0)) : + (hh.toLp h, hG.toLp G) ∈ closure (smoothGradientGraph S V) := by + obtain ⟨hm, hg, ht⟩ := capacity_product_pair_tendsto hh hG χ + (fun i ↦ (hχ i).continuous.aestronglyMeasurable) hχb hχlim hM hbound + (fun i ↦ surfaceGradient S (χ i)) hC hC0 + apply isClosed_closure.mem_of_tendsto ht + apply Filter.Eventually.of_forall + intro i + obtain ⟨F, hF, hFe, hFG⟩ := exists_c1_cutoff_trace hS hreg (χ i) ((hχ i).of_le (by norm_num)) (hχzero i) + have hμS : ∀ᵐ x ∂(surfaceMeasure S).restrict V, x ∈ S := + ae_restrict_of_ae (ae_restrict_mem hS.measurableSet) + have he : F =ᵐ[(surfaceMeasure S).restrict V] (fun x ↦ χ i x * h x) := by + filter_upwards [hμS] with x hx using hFe hx + have hge : surfaceGradient S F =ᵐ[(surfaceMeasure S).restrict V] + (fun x ↦ χ i x • G x + h x • surfaceGradient S (χ i) x) := by + filter_upwards [hμS] with x hx using hFG hx + let hfmem := MemLp.ae_eq he.symm (hm i) + let hgfmem := MemLp.ae_eq hge.symm (hg i) + have hmem := c1_mem_sobolevGraph_bounded S V hV hVm hgrad hF hfmem hgfmem + have heLp := (hm i).toLp_congr hfmem he.symm + have hgeLp := (hg i).toLp_congr hgfmem hge.symm + simpa only [heLp, hgeLp] using hmem + +end RPI.Boundary + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPI.Boundary +theorem HasC1TraceJetAt.comp {n : ℕ} {S : Set (Space n)} + {h : Space n → ℝ} {G : Space n → Space n} {x : Space n} + (hxS : x ∈ S) (hx : HasC1TraceJetAt S h G x) + {T : ℝ → ℝ} (hT : ContDiff ℝ 1 T) : + HasC1TraceJetAt S (T ∘ h) (fun y ↦ deriv T (h y) • G y) x := by + obtain ⟨U, hU, hxU, f, hf, hfh, hfG⟩ := hx + refine ⟨U, hU, hxU, T ∘ f, hT.comp_contDiffOn hf, ?_, ?_⟩ + · intro y hy + exact congrArg T (hfh hy) + · rw [surfaceGradient_comp ((hf.contDiffAt (hU.mem_nhds hxU)).differentiableAt (by simp)) + (hT.differentiable (by simp)).differentiableAt, hfh ⟨hxS, hxU⟩, hfG] + +theorem HasC1TraceJetAt.smoothTruncation {n : ℕ} {S : Set (Space n)} + {W : Space n → ℝ} {D : Space n → Space n} {x : Space n} + (hxS : x ∈ S) (hx : HasC1TraceJetAt S W D x) + {ε : ℝ} (hε : 0 < ε) : + HasC1TraceJetAt S (fun y ↦ smoothTruncation ε (W y)) + (fun y ↦ truncationSlope ε (W y) • truncatedGradient W D y) x := by + simpa only [Function.comp_def, smoothTruncation_deriv, + truncationSlope_smul_truncatedGradient W D hε] using hx.comp hxS ((smoothTruncation_contDiff ε).of_le (by norm_num)) + +theorem c1_surfaceGradient_memLp_on_ball {n : ℕ} {S : Set (Space n)} + {R : ℝ} [IsFiniteMeasure ((surfaceMeasure S).restrict (Metric.ball 0 R))] + {φ : Space n → ℝ} (hφ : ContDiff ℝ 1 φ) + (hm : AEStronglyMeasurable (surfaceGradient S φ) + ((surfaceMeasure S).restrict (Metric.ball 0 R))) : + MemLp (surfaceGradient S φ) 2 ((surfaceMeasure S).restrict (Metric.ball 0 R)) := by + have hc : Continuous (gradient φ) := continuous_iff_continuousAt.mpr (fun x ↦ + continuousAt_gradient_of_contDiffAt (hφ.of_le (by norm_num)).contDiffAt) + obtain ⟨M, hM⟩ := (isCompact_closedBall (0 : Space n) R).exists_bound_of_continuousOn + hc.continuousOn + apply MemLp.of_bound hm M + filter_upwards [ae_restrict_mem measurableSet_ball] with x hx + calc + ‖surfaceGradient S φ x‖ ≤ ‖gradient φ x‖ := by + calc + _ ≤ ‖(tangentPlane S x).orthogonalProjectionOnto‖ * ‖gradient φ x‖ := + (tangentPlane S x).orthogonalProjectionOnto.le_opNorm _ + _ ≤ 1 * ‖gradient φ x‖ := mul_le_mul_of_nonneg_right + (tangentPlane S x).orthogonalProjectionOnto_norm_le (norm_nonneg _) + _ = _ := one_mul _ + _ ≤ M := hM x (Metric.ball_subset_closedBall hx) + +end RPI.Boundary + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPI.Boundary + +theorem c1_exists_smooth_representative_near_regular_test {n : ℕ} {S Z : Set (Space n)} + (hS : IsClosed S) (hZ : IsClosed Z) {W : Space n → ℝ} {D : Space n → Space n} + (htrace : ∀ x ∈ S \ Z, HasC1TraceJetAt S W D x) + {K : Set (Space n)} (hK : IsClosed K) (hKZ : Disjoint K Z) : + ∃ F : Space n → ℝ, ContDiff ℝ 1 F ∧ + (∀ x ∈ S ∩ K, F x = W x ∧ surfaceGradient S F x = D x) := by + obtain ⟨σ, hσ0, hσ1, _⟩ := exists_contMDiffMap_zero_one_nhds_of_isClosed + (modelWithCornersSelf ℝ (Space n)) hZ hK hKZ.symm (n := (⊤ : ℕ∞)) + have hσ : ContDiff ℝ 1 σ := σ.contMDiff.contDiff.of_le (by norm_num) + obtain ⟨U, hU, hUZ, hUσ⟩ := mem_nhdsSet_iff_exists.mp hσ0 + obtain ⟨F, hF, hFW, hFD⟩ := exists_c1_cutoff_trace hS htrace σ hσ + ⟨U, hU, hUZ, hUσ⟩ + refine ⟨F, hF, ?_⟩ + intro x hx + have hσx : σ x = 1 := hσ1.self_of_nhdsSet x hx.2 + have hσnear : (σ : Space n → ℝ) =ᶠ[𝓝 x] (fun _ ↦ (1 : ℝ)) := + hσ1.filter_mono (nhds_le_nhdsSet hx.2) + have hσg : surfaceGradient S σ x = 0 := by + have hg : gradient (σ : Space n → ℝ) x = 0 := by + simpa only [gradient_fun_const] using hσnear.gradient_eq + simp only [surfaceGradient, hg, map_zero, Submodule.coe_zero] + exact ⟨by simpa only [hσx, one_mul] using hFW hx.1, + by simpa only [hσx, one_smul, hσg, smul_zero, add_zero] using hFD hx.1⟩ + +end RPI.Boundary + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPI.Boundary +section RegularTests +variable {n : ℕ} {S Z : Set (Space n)} +variable (hS : IsClosed S) (hZ : IsClosed Z) +variable (hfinite : ∀ R : ℝ, 0 < R → (surfaceMeasure S) (Metric.ball 0 R) < ⊤) +variable (hgrad : ∀ f : Space n → ℝ, ContDiff ℝ 1 f → + AEStronglyMeasurable (surfaceGradient S f) (surfaceMeasure S)) + +include hfinite hgrad + +theorem c1_surfaceGradient_memLp_of_compact {φ : Space n → ℝ} + (hφ : ContDiff ℝ 1 φ) (hcφ : HasCompactSupport φ) : + MemLp (surfaceGradient S φ) 2 (surfaceMeasure S) := by + obtain ⟨r, hr⟩ := Metric.isBounded_iff_subset_ball (0 : Space n) |>.mp hcφ.isBounded + let R := max r 1 + have hR : 0 < R := lt_of_lt_of_le zero_lt_one (le_max_right _ _) + have hsupp : tsupport φ ⊆ Metric.ball (0 : Space n) R := + hr.trans (Metric.ball_subset_ball (le_max_left _ _)) + let : IsFiniteMeasure ((surfaceMeasure S).restrict (Metric.ball 0 R)) := + ⟨by simpa only [Measure.restrict_apply_univ] using hfinite R hR⟩ + have hloc := c1_surfaceGradient_memLp_on_ball (R := R) hφ + ((hgrad φ hφ).mono_measure Measure.restrict_le_self) + have hh := (memLp_indicator_iff_restrict measurableSet_ball).mpr hloc + apply hh.ae_eq + apply ae_of_all + intro x + by_cases hx : x ∈ Metric.ball (0 : Space n) R + · simp only [indicator_of_mem hx] + · simp only [indicator_of_notMem hx] + exact (surfaceGradient_eq_zero_of_notMem_tsupport S (fun h ↦ hx (hsupp h))).symm + +include hS hZ + +theorem c1_regular_gradient_memLp_indicator_test {W : Space n → ℝ} {D : Space n → Space n} + (htrace : ∀ x ∈ S \ Z, HasC1TraceJetAt S W D x) + {φ : Space n → ℝ} (hcφ : HasCompactSupport φ) (hφZ : Disjoint (tsupport φ) Z) : + MemLp ((tsupport φ).indicator D) 2 (surfaceMeasure S) := by + obtain ⟨F, hF, he⟩ := c1_exists_smooth_representative_near_regular_test hS hZ htrace + (isClosed_tsupport φ) hφZ + obtain ⟨r, hr⟩ := Metric.isBounded_iff_subset_ball (0 : Space n) |>.mp hcφ.isBounded + let R := max r 1 + have hR : 0 < R := lt_of_lt_of_le zero_lt_one (le_max_right _ _) + have hsupp : tsupport φ ⊆ Metric.ball (0 : Space n) R := + hr.trans (Metric.ball_subset_ball (le_max_left _ _)) + let : IsFiniteMeasure ((surfaceMeasure S).restrict (Metric.ball 0 R)) := + ⟨by simpa only [Measure.restrict_apply_univ] using hfinite R hR⟩ + have hloc : MemLp (surfaceGradient S F) 2 ((surfaceMeasure S).restrict (tsupport φ)) := + (c1_surfaceGradient_memLp_on_ball (R := R) hF ((hgrad F hF).mono_measure Measure.restrict_le_self)).mono_measure + (Measure.restrict_mono_set _ hsupp) + apply ((memLp_indicator_iff_restrict (isClosed_tsupport φ).measurableSet).mpr hloc).ae_eq + filter_upwards [ae_restrict_mem hS.measurableSet] with x hx + by_cases hxt : x ∈ tsupport φ + · simp only [indicator_of_mem hxt, (he x ⟨hx, hxt⟩).2] + · simp only [indicator_of_notMem hxt] + +theorem c1_integrable_regular_test_pair {W : Space n → ℝ} {D : Space n → Space n} + (htrace : ∀ x ∈ S \ Z, HasC1TraceJetAt S W D x) + {φ : Space n → ℝ} (hφ : ContDiff ℝ 1 φ) (hcφ : HasCompactSupport φ) + (hφZ : Disjoint (tsupport φ) Z) : + Integrable (fun x ↦ inner ℝ (D x) (surfaceGradient S φ x)) (surfaceMeasure S) := by + have hD := c1_regular_gradient_memLp_indicator_test hS hZ hfinite hgrad htrace hcφ hφZ + have hB := c1_surfaceGradient_memLp_of_compact hfinite hgrad hφ hcφ + apply (integrable_inner_of_memLp hD hB).congr + apply ae_of_all + intro x + by_cases hxt : x ∈ tsupport φ + · simp only [indicator_of_mem hxt] + · simp only [indicator_of_notMem hxt, surfaceGradient_eq_zero_of_notMem_tsupport S hxt, + inner_zero_right] + +end RegularTests +end RPI.Boundary + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/HeightCompactness.lean b/lean/OAI/Geometry/Perimeter/Regularity/HeightCompactness.lean new file mode 100644 index 0000000000000000000000000000000000000000..4ecd9d25f041622edbc0e231871da1c7c2879cc2 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/HeightCompactness.lean @@ -0,0 +1,236 @@ +import OAI.Geometry.Perimeter.Regularity.GeoAlgebra + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff Convolution BoundedContinuousFunction +namespace RPISingularHarnack +open RPI.Boundary ContinuousLinearMap + +theorem c1Mollify_lintegral_error_of_translation {n : ℕ} {f : Euc n → ℝ} + (hf : Measurable f) (hi : Integrable f volume) (D : ℝ≥0∞) + (ht : ∀ w : Euc n, (∫⁻ x, ‖f (x+w)-f x‖ₑ) ≤ ‖w‖ₑ * D) (j : ℕ) : + (∫⁻ x, ‖c1Mollify f j x-f x‖ₑ) ≤ + ENNReal.ofReal (c1Mollifier (n := n) j).rOut * D := by + let k : Euc n → ℝ := (c1Mollifier j).normed volume + have hkc : Continuous k := (c1Mollifier j).continuous_normed + have hk : Integrable k volume := hkc.integrable_of_hasCompactSupport + (c1Mollifier j).hasCompactSupport_normed + have hk1 : ∫ x, k x = 1 := (c1Mollifier j).integral_normed + obtain ⟨B,hB⟩ := ((c1Mollifier (n := n) j).hasCompactSupport_normed (μ := volume)).exists_bound_of_continuous hkc + have hp (x : Euc n) : ‖c1Mollify f j x-f x‖ₑ ≤ + ∫⁻ y, ‖k y‖ₑ * ‖f (x-y)-f x‖ₑ := by + have hif : Integrable (fun y ↦ f (x-y)) volume := + hi.comp_sub_left x + have hib : Integrable (fun y ↦ k y * f (x-y)) volume := by + apply (hif.norm.const_mul B).mono' + · exact (hkc.measurable.mul (hf.comp (measurable_const.sub measurable_id))).aestronglyMeasurable + · exact ae_of_all _ fun y ↦ by rw [norm_mul]; exact mul_le_mul_of_nonneg_right (hB y) (norm_nonneg _) + have he : c1Mollify f j x-f x = ∫ y, k y * (f (x-y)-f x) := by + simp only [c1Mollify, convolution_def, lsmul_apply, smul_eq_mul] + simp_rw [mul_sub] + rw [integral_sub hib (hk.mul_const _), integral_mul_const, hk1, one_mul] + rw [he] + apply (enorm_integral_le_lintegral_enorm _).trans_eq + exact lintegral_congr (fun _ ↦ enorm_mul _ _) + have hm : Measurable (fun p : Euc n × Euc n ↦ + ‖k p.2‖ₑ * ‖f (p.1-p.2)-f p.1‖ₑ) := + (hkc.measurable.comp measurable_snd).enorm.mul + ((hf.comp (measurable_fst.sub measurable_snd)).sub (hf.comp measurable_fst)).enorm + calc + _ ≤ ∫⁻ x, ∫⁻ y, ‖k y‖ₑ * ‖f (x-y)-f x‖ₑ := lintegral_mono hp + _ = ∫⁻ y, ∫⁻ x, ‖k y‖ₑ * ‖f (x-y)-f x‖ₑ := lintegral_lintegral_swap hm.aemeasurable + _ = ∫⁻ y, ‖k y‖ₑ * ∫⁻ x, ‖f (x-y)-f x‖ₑ := by + apply lintegral_congr + intro y + exact lintegral_const_mul _ ((hf.comp (measurable_id.sub measurable_const)).sub hf).enorm + _ ≤ ∫⁻ y, ‖k y‖ₑ * (‖y‖ₑ * D) := by + apply lintegral_mono + intro y + exact mul_le_mul_right (by simpa only [sub_eq_add_neg, enorm_neg] using ht (-y)) _ + _ ≤ ∫⁻ y, ‖k y‖ₑ * (ENNReal.ofReal (c1Mollifier (n := n) j).rOut * D) := by + apply lintegral_mono + intro y + by_cases hy : k y = 0 + · simp only [hy, enorm_zero, zero_mul, le_refl] + · have hys : y ∈ Function.support k := hy + rw [(c1Mollifier j).support_normed_eq] at hys + have hyb : ‖y‖ₑ ≤ ENNReal.ofReal (c1Mollifier (n := n) j).rOut := by + rw [← ofReal_norm] + exact ENNReal.ofReal_le_ofReal (by + have hylt : ‖y‖ < (c1Mollifier (n := n) j).rOut := by + simpa only [Metric.mem_ball, dist_zero_right] using hys + exact hylt.le) + exact mul_le_mul_right (mul_le_mul_left hyb _) _ + _ = _ := by + rw [lintegral_mul_const _ hkc.measurable.enorm] + have hki : (∫⁻ y, ‖k y‖ₑ) = 1 := by + have heq : ∀ y, ‖k y‖ₑ = ENNReal.ofReal (k y) := by + intro y + rw [← ofReal_norm, Real.norm_eq_abs, abs_of_nonneg ((c1Mollifier j).nonneg_normed y)] + simp_rw [heq] + rw [← ofReal_integral_eq_lintegral_ofReal hk (ae_of_all _ (c1Mollifier j).nonneg_normed), hk1, ENNReal.ofReal_one] + rw [hki, one_mul] + +theorem c1Mollify_uniform_bounds_of_integral_norm {n : ℕ} (A : ℝ) (hA : 0 ≤ A) + (j : ℕ) : ∃ L : ℝ≥0, ∃ B : ℝ, ∀ f : Euc n → ℝ, + Measurable f → Integrable f volume → (∫ x, ‖f x‖) ≤ A → + LipschitzWith L (c1Mollify f j) ∧ ∀ x, ‖c1Mollify f j x‖ ≤ B := by + let k : Euc n → ℝ := (c1Mollifier j).normed volume + have hc : HasCompactSupport k := (c1Mollifier j).hasCompactSupport_normed + have hk : ContDiff ℝ ∞ k := (c1Mollifier j).contDiff_normed + obtain ⟨C,hC⟩ := hk.lipschitzWith_of_hasCompactSupport hc (by simp) + obtain ⟨B,hB⟩ := hc.exists_bound_of_continuous hk.continuous + have hB0 : 0 ≤ B := (norm_nonneg (k 0)).trans (hB 0) + refine ⟨C * ⟨A,hA⟩, B*A, ?_⟩ + intro f hf hi hbound + have hflip : (lsmul ℝ ℝ : ℝ →L[ℝ] ℝ →L[ℝ] ℝ).flip = lsmul ℝ ℝ := by + apply ContinuousLinearMap.ext + intro a + apply ContinuousLinearMap.ext + intro b + exact mul_comm b a + have he : c1Mollify f j = f ⋆[lsmul ℝ ℝ,volume] k := by + change k ⋆[lsmul ℝ ℝ,volume] f = _ + rw [← convolution_flip,hflip] + have hib (x : Euc n) : Integrable (fun z ↦ f z*k (x-z)) volume := by + apply (hi.norm.mul_const B).mono' + · exact (hf.mul (hk.continuous.measurable.comp (measurable_const.sub measurable_id))).aestronglyMeasurable + · exact ae_of_all _ fun z ↦ by rw [norm_mul]; exact mul_le_mul_of_nonneg_left (hB _) (norm_nonneg _) + constructor + · apply LipschitzWith.of_dist_le_mul + intro x y + rw [dist_eq_norm,he] + change ‖(∫ z, f z*k (x-z))-(∫ z, f z*k (y-z))‖ ≤ _ + rw [← integral_sub (hib x) (hib y)] + calc + _ ≤ ∫ z, ‖f z*k (x-z)-f z*k (y-z)‖ := norm_integral_le_integral_norm _ + _ ≤ ∫ z, ‖f z‖*((C:ℝ)*dist x y) := by + apply integral_mono ((hib x).sub (hib y)).norm (hi.norm.mul_const _) + intro z + change ‖f z*k (x-z)-f z*k (y-z)‖ ≤ ‖f z‖*((C:ℝ)*dist x y) + rw [← mul_sub,norm_mul] + apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) + simpa only [← dist_eq_norm,dist_sub_right] using hC.dist_le_mul (x-z) (y-z) + _ = (∫ z, ‖f z‖)*((C:ℝ)*dist x y) := integral_mul_const _ _ + _ ≤ A*((C:ℝ)*dist x y) := mul_le_mul_of_nonneg_right hbound (by positivity) + _ = _ := by change A*((C:ℝ)*dist x y) = ((C:ℝ)*A)*dist x y; ring + · intro x + rw [he] + change ‖∫ z, f z*k (x-z)‖ ≤ _ + calc + _ ≤ ∫ z, ‖f z*k (x-z)‖ := norm_integral_le_integral_norm _ + _ ≤ ∫ z, ‖f z‖*B := by + apply integral_mono (hib x).norm (hi.norm.mul_const B) + intro z + change ‖f z*k (x-z)‖ ≤ ‖f z‖*B + rw [norm_mul] + exact mul_le_mul_of_nonneg_left (hB _) (norm_nonneg _) + _ = (∫ z, ‖f z‖)*B := integral_mul_const _ _ + _ ≤ A*B := mul_le_mul_of_nonneg_right hbound hB0 + _ = B*A := mul_comm _ _ + +theorem totallyBounded_toLp_of_lipschitz_norm + {α ι : Type*} [MetricSpace α] [CompactSpace α] + [MeasurableSpace α] [BorelSpace α] (μ : Measure α) [IsFiniteMeasure μ] + (f : ι → α →ᵇ ℝ) (L : NNReal) (B : ℝ) + (hf : ∀ i, LipschitzWith L (f i)) (hb : ∀ i x, ‖f i x‖ ≤ B) : + TotallyBounded (range (fun i ↦ BoundedContinuousFunction.toLp 1 μ ℝ (f i))) := by + have hc : IsCompact (closure (range f)) := by + apply BoundedContinuousFunction.arzela_ascoli (Metric.closedBall (0:ℝ) B) + (isCompact_closedBall _ _) + · rintro g x ⟨i,rfl⟩ + simpa only [Metric.mem_closedBall,dist_zero_right] using hb i x + · apply UniformEquicontinuous.equicontinuous + apply LipschitzWith.uniformEquicontinuous _ L + intro g + obtain ⟨i,hi⟩ := g.property + simpa only [← hi] using hf i + exact (hc.image (BoundedContinuousFunction.toLp 1 μ ℝ).continuous).totallyBounded.subset + (by rintro _ ⟨i,rfl⟩; exact ⟨f i,subset_closure (mem_range_self i),rfl⟩) + +noncomputable def compactFunctionLp {n : ℕ} (K : Set (Euc n)) (hK : IsCompact K) + (f : Euc n → ℝ) (hi : Integrable f volume) : + Lp ℝ 1 (volume.comap (Subtype.val : K → Euc n)) := + (memLp_one_iff_integrable.mpr ((integrableOn_iff_comap_subtypeVal hK.measurableSet).mp hi.integrableOn)).toLp _ + +theorem compactFunctionLp_ae {n : ℕ} (K : Set (Euc n)) (hK : IsCompact K) + (f : Euc n → ℝ) (hi : Integrable f volume) : + compactFunctionLp K hK f hi =ᵐ[volume.comap (Subtype.val : K → Euc n)] + fun x : K ↦ f x := + by unfold compactFunctionLp; exact MemLp.coeFn_toLp _ + +theorem compactFunctionLp_totallyBounded_of_translation {n : ℕ} {ι : Type*} + (K : Set (Euc n)) (hK : IsCompact K) (f : ι → Euc n → ℝ) + (hm : ∀ i, Measurable (f i)) (hi : ∀ i, Integrable (f i) volume) + (A : ℝ) (hA : 0 ≤ A) (hb : ∀ i, (∫ x, ‖f i x‖) ≤ A) + (D : ℝ≥0∞) (hD : D ≠ ⊤) + (ht : ∀ i w, (∫⁻ x, ‖f i (x+w)-f i x‖ₑ) ≤ ‖w‖ₑ * D) : + TotallyBounded (range (fun i ↦ compactFunctionLp K hK (f i) (hi i))) := by + let μ : Measure K := volume.comap (Subtype.val : K → Euc n) + let : IsFiniteMeasure μ := compact_subtype_volume_finite hK + let : CompactSpace K := isCompact_iff_compactSpace.mp hK + have hmc (i : ι) (j : ℕ) : Continuous (c1Mollify (f i) j) := + ((c1Mollifier j).hasCompactSupport_normed.contDiff_convolution_left (n := (⊤:ℕ∞)) _ + (c1Mollifier j).contDiff_normed (hi i).locallyIntegrable).continuous + let a : ℕ → ι → K →ᵇ ℝ := fun j i ↦ BoundedContinuousFunction.mkOfCompact + ⟨fun x ↦ c1Mollify (f i) j x, (hmc i j).comp continuous_subtype_val⟩ + apply totallyBounded_range_of_uniform_approximation + (fun i ↦ compactFunctionLp K hK (f i) (hi i)) + (fun j i ↦ BoundedContinuousFunction.toLp 1 μ ℝ (a j i)) + · intro j + obtain ⟨L,B,hLB⟩ := c1Mollify_uniform_bounds_of_integral_norm (n := n) A hA j + apply totallyBounded_toLp_of_lipschitz_norm μ (a j) L B + · intro i + apply LipschitzWith.of_dist_le_mul + intro x y + exact (hLB (f i) (hm i) (hi i) (hb i)).1.dist_le_mul x y + · intro i x + exact (hLB (f i) (hm i) (hi i) (hb i)).2 x + · intro ε hε + have htend : Tendsto (fun j ↦ ENNReal.ofReal (c1Mollifier (n := n) j).rOut * D) + atTop (𝓝 0) := by + simpa only [ENNReal.ofReal_zero,zero_mul] using + ENNReal.Tendsto.mul_const (ENNReal.tendsto_ofReal c1Mollifier_radius_tendsto) (Or.inr hD) + obtain ⟨j,hj⟩ := (htend.eventually (gt_mem_nhds (ENNReal.ofReal_pos.mpr hε))).exists + refine ⟨j,fun i ↦ edist_lt_ofReal.mp ?_⟩ + apply lt_of_le_of_lt _ hj + rw [Lp.edist_def, eLpNorm_one_eq_lintegral_enorm + ((Lp.aestronglyMeasurable _).sub (Lp.aestronglyMeasurable _))] + calc + _ = ∫⁻ x : K, ‖f i x-c1Mollify (f i) j x‖ₑ ∂μ := by + apply lintegral_congr_ae + filter_upwards [compactFunctionLp_ae K hK (f i) (hi i), + BoundedContinuousFunction.coeFn_toLp 1 μ ℝ (a j i)] with x hx hy + change ‖(compactFunctionLp K hK (f i) (hi i)) x- + (BoundedContinuousFunction.toLp 1 μ ℝ (a j i)) x‖ₑ = _ + rw [hx,hy] + rfl + _ = ∫⁻ x in K, ‖f i x-c1Mollify (f i) j x‖ₑ := + lintegral_subtype_comap (μ := volume) hK.measurableSet + (fun x : Euc n ↦ ‖f i x-c1Mollify (f i) j x‖ₑ) + _ ≤ ∫⁻ x, ‖f i x-c1Mollify (f i) j x‖ₑ := setLIntegral_le_lintegral _ _ + _ ≤ _ := by + simpa only [enorm_sub_rev] using + c1Mollify_lintegral_error_of_translation (hm i) (hi i) D (ht i) j + +theorem compactFunctionLp_subsequence_of_translation {n : ℕ} + (K : Set (Euc n)) (hK : IsCompact K) (f : ℕ → Euc n → ℝ) + (hm : ∀ i, Measurable (f i)) (hi : ∀ i, Integrable (f i) volume) + (A : ℝ) (hA : 0 ≤ A) (hb : ∀ i, (∫ x, ‖f i x‖) ≤ A) + (D : ℝ≥0∞) (hD : D ≠ ⊤) + (ht : ∀ i w, (∫⁻ x, ‖f i (x+w)-f i x‖ₑ) ≤ ‖w‖ₑ * D) : + ∃ g : Lp ℝ 1 (volume.comap (Subtype.val : K → Euc n)), + ∃ σ : ℕ → ℕ, StrictMono σ ∧ + Tendsto (fun i ↦ compactFunctionLp K hK (f (σ i)) (hi (σ i))) atTop (𝓝 g) := by + have hc := (compactFunctionLp_totallyBounded_of_translation K hK f hm hi A hA hb D hD ht).closure.isCompact_of_isClosed isClosed_closure + obtain ⟨g,-,σ,hσ,hg⟩ := hc.tendsto_subseq (fun i ↦ subset_closure + (mem_range_self (f := fun i ↦ compactFunctionLp K hK (f i) (hi i)) i)) + exact ⟨g,σ,hσ,hg⟩ + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/HeightMeanValue.lean b/lean/OAI/Geometry/Perimeter/Regularity/HeightMeanValue.lean new file mode 100644 index 0000000000000000000000000000000000000000..6e00647bb4021b3f14cf4c2ddf385ef434e78991 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/HeightMeanValue.lean @@ -0,0 +1,401 @@ +import OAI.Geometry.Perimeter.Regularity.SmulMemPhaseSupport + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff Pointwise +namespace RPISingularHarnack +open RPI.Boundary + +private theorem gradient_affine_height {n : ℕ} (v : Euc n) (a : ℝ) (x : Euc n) : + gradient (fun y ↦ inner ℝ v y - a) x = v := by + apply HasGradientAt.gradient + change HasFDerivAt (fun y ↦ inner ℝ v y - a) + ((InnerProductSpace.toDual ℝ (Euc n)) v) x + exact (innerSL ℝ v).hasFDerivAt.sub_const a + +private theorem gradient_radial_primitive {n : ℕ} (c : Euc n) (t : ℝ) + {Ψ ψ : ℝ → ℝ} (hΨ : ContDiff ℝ ∞ Ψ) (hdΨ : ∀ s, deriv Ψ s = ψ s) + (x : Euc n) : + gradient (fun y ↦ Ψ (t^2 * ‖y-c‖^2)) x = + (2*t^2*ψ (t^2*‖x-c‖^2)) • (x-c) := by + have hi := (((hasFDerivAt_id (𝕜 := ℝ) x).sub_const c).norm_sq).const_mul (t^2) + have hh := ((hΨ.differentiable (by simp)) _).hasDerivAt.comp_hasFDerivAt x hi + rw [hdΨ] at hh + change HasFDerivAt (fun y : Euc n ↦ Ψ (t^2 * ‖y-c‖^2)) _ x at hh + apply (InnerProductSpace.toDual ℝ (Euc n)).injective + rw [toDual_gradient, hh.fderiv] + ext z + simp only [smul_apply, ContinuousLinearMap.comp_apply, + ContinuousLinearMap.id_apply, id_eq, innerSL_apply_apply, map_smul, + InnerProductSpace.toDual_apply_apply, smul_eq_mul] + ring + +theorem minimizing_height_radialDerivative_nonpos {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (c v : Euc n) (a : ℝ) {M : ℝ} (hM : 0 < M) + {Ψ ψ : ℝ → ℝ} (hΨ : ContDiff ℝ ∞ Ψ) (hψ : ContDiff ℝ ∞ ψ) + (hdΨ : ∀ s, deriv Ψ s = ψ s) + (hΨz : ∀ s, 1 ≤ s → Ψ s = 0) (hψz : ∀ s, 1 ≤ s → ψ s = 0) + (hΨ0 : ∀ s, Ψ s ≤ 0) (hψd : ∀ s, deriv ψ s ≤ 0) + {t : ℝ} (ht : 1/M < t) : + (∫ x in Metric.ball c M, (inner ℝ v x-a)^2 * + radialDensityDerivative c (n-1) ψ t x ∂perimeterMeasure E) ≤ 0 := by + let μ := (perimeterMeasure E).restrict (Metric.ball c M) + have := perimeterMeasure_locallyFinite E hmin.2.1 + have : IsFiniteMeasure μ := ⟨by + rw [Measure.restrict_apply_univ, perimeterMeasure_open E Metric.isOpen_ball] + exact hmin.2.1 c M hM⟩ + have ht0 : 0 < t := (one_div_pos.mpr hM).trans ht + have htM : 1/t < M := (div_lt_iff₀ ht0).mpr (by + have := (div_lt_iff₀ hM).mp ht + nlinarith) + let H : Euc n → ℝ := fun x ↦ inner ℝ v x-a + let P : Euc n → ℝ := fun x ↦ Ψ (t^2*‖x-c‖^2) + let Q : Euc n → ℝ := fun x ↦ ψ (t^2*‖x-c‖^2) + let V : Euc n → Euc n := fun x ↦ Q x • (x-c) + let W : Euc n → Euc n := fun x ↦ H x^2 • V x + let φ : Euc n → ℝ := fun x ↦ H x * P x + have hH : ContDiff ℝ ∞ H := (contDiff_const.inner ℝ contDiff_id).sub contDiff_const + have hP : ContDiff ℝ ∞ P := + hΨ.comp (contDiff_const.mul ((contDiff_id.sub contDiff_const).norm_sq (𝕜 := ℝ))) + have hQ : ContDiff ℝ ∞ Q := + hψ.comp (contDiff_const.mul ((contDiff_id.sub contDiff_const).norm_sq (𝕜 := ℝ))) + have hV : ContDiff ℝ ∞ V := hQ.smul (𝕜' := ℝ) (contDiff_id.sub contDiff_const) + have hW : ContDiff ℝ ∞ W := (hH.pow 2).smul (𝕜' := ℝ) hV + have hφ : ContDiff ℝ ∞ φ := hH.mul hP + have hsV : tsupport V ⊆ Metric.closedBall c (1/t) := + (tsupport_smul_subset_left _ _).trans (radialProfile_tsupport c hψz ht0) + have hsW : tsupport W ⊆ Metric.closedBall c (1/t) := + (tsupport_smul_subset_right (fun x ↦ H x^2) V).trans hsV + have hsφ : tsupport φ ⊆ Metric.closedBall c (1/t) := + tsupport_mul_subset_right.trans (radialProfile_tsupport c hΨz ht0) + have hcW : HasCompactSupport W := + (isCompact_closedBall c (1/t)).of_isClosed_subset (isClosed_tsupport _) hsW + have hcφ : HasCompactSupport φ := + (isCompact_closedBall c (1/t)).of_isClosed_subset (isClosed_tsupport _) hsφ + have hzW := minimizing_tangentialDivergence_integral_eq_zero hn hmin c hM hW hcW + (hsW.trans (Metric.closedBall_subset_ball htM)) + have hzφ := minimizing_tangentialGradient_integral_eq_zero_local hn hmin c hM hφ hcφ + (hsφ.trans (Metric.closedBall_subset_ball htM)) v + have hiD : Integrable (fun x ↦ H x^2 * radialDensityDerivative c (n-1) ψ t x) μ := by + exact (((hH.continuous.pow 2).mul + ((radialDensityDerivative_continuous c (n-1) hψ).comp + (continuous_const.prodMk continuous_id))).continuousOn.integrableOn_compact + (isCompact_closedBall c M)).mono_set Metric.ball_subset_closedBall + have hiW := (tangentialDivergence_integrable_ball_perimeter hmin c hM hW).const_mul + (t^((n-1)-1)) + have hiφ := ((tangentialGradient_integrable_ball_perimeter hmin c hM + (hφ.of_le (by simp))).inner_const v).const_mul (t^((n-1)-1)/t^2) + have hcmp : ∀ᵐ x ∂μ, + H x^2 * radialDensityDerivative c (n-1) ψ t x ≤ + t^((n-1)-1) * tangentialDivergence E W x - + (t^((n-1)-1)/t^2) * inner ℝ (tangentialGradient E φ x) v := by + filter_upwards [ae_restrict_of_ae (minimizing_halfspaceBlowup_ae hn hmin)] with x hx + have hpow : t^(n-1) = t^((n-1)-1)*t := by + rw [← pow_succ, Nat.sub_add_cancel (by omega : 1 ≤ n-1)] + have hgH := gradient_affine_height v a x + change gradient H x = v at hgH + have hGnonneg : 0 ≤ ‖v‖^2 - (inner ℝ v (approximateNormal E x))^2 := by + have hh := norm_inner_le_norm (𝕜 := ℝ) v (approximateNormal E x) + rw [hx.1, mul_one, Real.norm_eq_abs] at hh + have hsq := mul_self_le_mul_self (abs_nonneg _) hh + nlinarith [sq_abs (inner ℝ v (approximateNormal E x))] + have hf : inner ℝ (tangentialGradient E φ x) v = + P x * (‖v‖^2 - (inner ℝ v (approximateNormal E x))^2) + + (2*t^2*H x*Q x) * (inner ℝ v (x-c) - + inner ℝ v (approximateNormal E x) * inner ℝ (approximateNormal E x) (x-c)) := by + dsimp only [φ] + rw [tangentialGradient_mul E (hH.differentiable (by simp) x) + (hP.differentiable (by simp) x)] + simp only [inner_add_left, real_inner_smul_left, tangentialGradient, hgH] + rw [show gradient P x = (2*t^2*Q x) • (x-c) from + gradient_radial_primitive c t hΨ hdΨ x] + simp only [inner_sub_left, real_inner_smul_left, + real_inner_self_eq_norm_sq] + simp only [inner_sub_right] + simp only [real_inner_comm] + ring + have hgh2 : tangentialGradient E (fun y ↦ H y^2) x = + (2*H x) • tangentialGradient E H x := by + have he : (fun y ↦ H y^2) = fun y ↦ H y*H y := by funext y; ring + rw [he, tangentialGradient_mul E (hH.differentiable (by simp) x) + (hH.differentiable (by simp) x)] + module + have hdiv : tangentialDivergence E W x = + H x^2 * ((n-1:ℕ)* Q x + 2*t^2*deriv ψ (t^2*‖x-c‖^2) * + (‖x-c‖^2 - (inner ℝ (approximateNormal E x) (x-c))^2)) + + (2*H x*Q x) * (inner ℝ v (x-c) - + inner ℝ v (approximateNormal E x) * inner ℝ (approximateNormal E x) (x-c)) := by + dsimp only [W] + rw [tangentialDivergence_smul E ((hH.pow 2).differentiable (by simp)) + (hV.differentiable (by simp)), hgh2] + rw [show tangentialDivergence E V x = _ from + tangentialDivergence_radialProfile (by omega) E c hψ t x hx.1] + simp only [V, tangentialGradient, hgH, inner_sub_left, real_inner_smul_left, + real_inner_smul_right] + ring + rw [hf, hdiv] + have hbad : (t^((n-1)-1)/t^2) * P x * + (‖v‖^2 - (inner ℝ v (approximateNormal E x))^2) ≤ 0 := + mul_nonpos_of_nonpos_of_nonneg + (mul_nonpos_of_nonneg_of_nonpos (by positivity) (hΨ0 _)) hGnonneg + have hrad : 2*t^((n-1)-1)*t^2 * H x^2 * + (inner ℝ (approximateNormal E x) (x-c))^2 * deriv ψ (t^2*‖x-c‖^2) ≤ 0 := + mul_nonpos_of_nonneg_of_nonpos (by positivity) (hψd _) + have halg : H x^2 * radialDensityDerivative c (n-1) ψ t x = + t^((n-1)-1) * + (H x^2 * ((n-1:ℕ)*Q x + 2*t^2*deriv ψ (t^2*‖x-c‖^2) * + (‖x-c‖^2-(inner ℝ (approximateNormal E x) (x-c))^2)) + + (2*H x*Q x)*(inner ℝ v (x-c)-inner ℝ v (approximateNormal E x)* + inner ℝ (approximateNormal E x) (x-c))) - + (t^((n-1)-1)/t^2) * (P x*(‖v‖^2-(inner ℝ v (approximateNormal E x))^2)+ + (2*t^2*H x*Q x)*(inner ℝ v (x-c)-inner ℝ v (approximateNormal E x)* + inner ℝ (approximateNormal E x) (x-c))) + + (t^((n-1)-1)/t^2) * P x*(‖v‖^2-(inner ℝ v (approximateNormal E x))^2) + + 2*t^((n-1)-1)*t^2*H x^2*(inner ℝ (approximateNormal E x) (x-c))^2* + deriv ψ (t^2*‖x-c‖^2) := by + dsimp only [radialDensityDerivative, Q] + rw [hpow] + field_simp + ring + linarith + have hh := integral_mono_ae hiD (hiW.sub hiφ) hcmp + simp only [Pi.sub_apply] at hh + dsimp only [μ] at hh + rw [integral_sub hiW hiφ, integral_const_mul, integral_const_mul] at hh + change _ ≤ _ * (∫ x in Metric.ball c M, tangentialDivergence E W x ∂perimeterMeasure E) - + _ * (∫ x in Metric.ball c M, inner ℝ (tangentialGradient E φ x) v ∂perimeterMeasure E) at hh + simpa only [hzW, hzφ, mul_zero, sub_self] using hh + +def densityPrimitive (j : ℕ) (s : ℝ) : ℝ := + ∫ z in (1:ℝ)..s, densityProfile j z + +theorem densityPrimitive_hasDerivAt (j : ℕ) (s : ℝ) : + HasDerivAt (densityPrimitive j) (densityProfile j s) s := by + exact intervalIntegral.integral_hasDerivAt_right + ((densityProfile_contDiff j).continuous.intervalIntegrable 1 s) + (densityProfile_contDiff j).continuous.stronglyMeasurable.stronglyMeasurableAtFilter + (densityProfile_contDiff j).continuous.continuousAt + +theorem densityPrimitive_deriv (j : ℕ) (s : ℝ) : + deriv (densityPrimitive j) s = densityProfile j s := (densityPrimitive_hasDerivAt j s).deriv + +theorem densityPrimitive_contDiff (j : ℕ) : ContDiff ℝ ∞ (densityPrimitive j) := by + apply contDiff_infty_iff_deriv.mpr + refine ⟨fun s ↦ (densityPrimitive_hasDerivAt j s).differentiableAt, ?_⟩ + simpa only [funext (densityPrimitive_deriv j)] using densityProfile_contDiff j + +theorem densityPrimitive_zero (j : ℕ) {s : ℝ} (hs : 1 ≤ s) : + densityPrimitive j s = 0 := by + unfold densityPrimitive + trans ∫ z in (1:ℝ)..s, (0:ℝ) + · apply intervalIntegral.integral_congr + intro z hz + rw [uIcc_of_le hs] at hz + exact densityProfile_zero j hz.1 + · simp + +theorem densityPrimitive_nonpos (j : ℕ) (s : ℝ) : densityPrimitive j s ≤ 0 := by + by_cases hs : 1 ≤ s + · rw [densityPrimitive_zero j hs] + · unfold densityPrimitive + rw [intervalIntegral.integral_symm] + exact neg_nonpos.mpr (intervalIntegral.integral_nonneg (le_of_not_ge hs) + fun z _ ↦ (densityProfile_mem_Icc j z).1) + +private theorem integral_hasDerivAt_compact_window {n : ℕ} + {F D : ℝ → Euc n → ℝ} (hF : Continuous (Function.uncurry F)) + (hD : Continuous (Function.uncurry D)) + (hd : ∀ s x, HasDerivAt (fun t ↦ F t x) (D s x) s) + (μ : Measure (Euc n)) [IsFiniteMeasure μ] + {K : Set (Euc n)} (hK : IsCompact K) (hμ : ∀ᵐ x ∂μ, x ∈ K) (t : ℝ) : + HasDerivAt (fun s ↦ ∫ x, F s x ∂μ) (∫ x, D t x ∂μ) t := by + have hFt : Continuous (F t) := hF.comp (continuous_const.prodMk continuous_id) + have hDt : Continuous (D t) := hD.comp (continuous_const.prodMk continuous_id) + obtain ⟨C, hC⟩ := hK.exists_bound_of_continuousOn hFt.continuousOn + have hFi : Integrable (F t) μ := + Integrable.of_bound hFt.aestronglyMeasurable C (hμ.mono fun x hx ↦ hC x hx) + obtain ⟨B, hB⟩ := (isCompact_Icc.prod hK).exists_bound_of_continuousOn + (hD.continuousOn : ContinuousOn _ (Icc (t-1) (t+1) ×ˢ K)) + have hbound : ∀ᵐ x ∂μ, ∀ s ∈ Ioo (t-1) (t+1), ‖D s x‖ ≤ B := by + filter_upwards [hμ] with x hx + intro s hs + exact hB (s,x) ⟨⟨hs.1.le, hs.2.le⟩,hx⟩ + have hderiv : ∀ᵐ x ∂μ, ∀ s ∈ Ioo (t-1) (t+1), + HasDerivAt (fun t ↦ F t x) (D s x) s := ae_of_all μ fun x s _ ↦ hd s x + exact (hasDerivAt_integral_of_dominated_loc_of_deriv_le + (F := F) (F' := D) (s := Ioo (t-1) (t+1)) (bound := fun _ ↦ B) + (Ioo_mem_nhds (by linarith) (by linarith)) + (Eventually.of_forall fun s ↦ (hF.comp ((continuous_const : Continuous (fun _ : Euc n ↦ s)).prodMk continuous_id)).aestronglyMeasurable) + hFi hDt.aestronglyMeasurable hbound (integrable_const B) hderiv).2 + +theorem height_radial_integral_hasDerivAt {n : ℕ} + (c v : Euc n) (a M : ℝ) (k : ℕ) + {ψ : ℝ → ℝ} (hψ : ContDiff ℝ ∞ ψ) (μ : Measure (Euc n)) [IsFiniteMeasure μ] + (hμ : ∀ᵐ x ∂μ, x ∈ Metric.closedBall c M) (t : ℝ) : + HasDerivAt (fun s ↦ ∫ x, (inner ℝ v x-a)^2 * radialDensityIntegrand c k ψ s x ∂μ) + (∫ x, (inner ℝ v x-a)^2 * radialDensityDerivative c k ψ t x ∂μ) t := by + let H : Euc n → ℝ := fun x ↦ (inner ℝ v x-a)^2 + have hH : Continuous H := ((continuous_const.inner continuous_id).sub continuous_const).pow 2 + have hcF : Continuous (fun p : ℝ × Euc n ↦ H p.2 * radialDensityIntegrand c k ψ p.1 p.2) := + (hH.comp continuous_snd).mul (radialDensityIntegrand_continuous c k hψ) + have hcD : Continuous (fun p : ℝ × Euc n ↦ H p.2 * radialDensityDerivative c k ψ p.1 p.2) := + (hH.comp continuous_snd).mul (radialDensityDerivative_continuous c k hψ) + exact integral_hasDerivAt_compact_window hcF hcD + (fun s x ↦ (radialDensityIntegrand_hasDerivAt c k hψ s x).const_mul (H x)) + μ (isCompact_closedBall c M) hμ t + +theorem minimizing_height_smoothedDensity_antitoneOn {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (c v : Euc n) (a : ℝ) {M : ℝ} (hM : 0 < M) (j : ℕ) : + AntitoneOn (fun t ↦ ∫ x in Metric.ball c M, (inner ℝ v x-a)^2 * + radialDensityIntegrand c (n-1) (densityProfile j) t x ∂perimeterMeasure E) (Ioi (1/M)) := by + let μ := (perimeterMeasure E).restrict (Metric.ball c M) + have : IsFiniteMeasure μ := ⟨by + rw [Measure.restrict_apply_univ, perimeterMeasure_open E Metric.isOpen_ball] + exact hmin.2.1 c M hM⟩ + have hμ : ∀ᵐ x ∂μ, x ∈ Metric.closedBall c M := + (ae_restrict_mem measurableSet_ball).mono fun _ hx ↦ Metric.ball_subset_closedBall hx + have hd := fun t ↦ height_radial_integral_hasDerivAt c v a M (n-1) + (densityProfile_contDiff j) μ hμ t + apply antitoneOn_of_hasDerivWithinAt_nonpos (convex_Ioi (1/M)) + (fun t _ ↦ (hd t).continuousAt.continuousWithinAt) + (fun t _ ↦ (hd t).hasDerivWithinAt) + intro t ht + exact minimizing_height_radialDerivative_nonpos hn hmin c v a hM + (densityPrimitive_contDiff j) (densityProfile_contDiff j) (densityPrimitive_deriv j) + (fun s hs ↦ densityPrimitive_zero j hs) (fun s hs ↦ densityProfile_zero j hs) + (densityPrimitive_nonpos j) (densityProfile_deriv_nonpos j) + (by simpa only [interior_Ioi, mem_Ioi] using ht) + +theorem height_radial_integral_tendsto {n : ℕ} + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (c v : Euc n) (a : ℝ) {M : ℝ} (hM : 0 < M) {t : ℝ} (ht : 1/M < t) : + Tendsto (fun j ↦ ∫ x in Metric.ball c M, (inner ℝ v x-a)^2 * + radialDensityIntegrand c (n-1) (densityProfile j) t x ∂perimeterMeasure E) atTop + (𝓝 (t^(n-1) * ∫ x in Metric.ball c (1/t), (inner ℝ v x-a)^2 ∂perimeterMeasure E)) := by + let μ := (perimeterMeasure E).restrict (Metric.ball c M) + let H : Euc n → ℝ := fun x ↦ (inner ℝ v x-a)^2 + have hH : Continuous H := ((continuous_const.inner continuous_id).sub continuous_const).pow 2 + have := perimeterMeasure_locallyFinite E hmin.2.1 + have : IsFiniteMeasure μ := ⟨by + rw [Measure.restrict_apply_univ, perimeterMeasure_open E Metric.isOpen_ball] + exact hmin.2.1 c M hM⟩ + have ht0 : 0 < t := (one_div_pos.mpr hM).trans ht + have htM : 1/t < M := (div_lt_iff₀ ht0).mpr (by + have := (div_lt_iff₀ hM).mp ht + nlinarith) + have hiH : Integrable H μ := (hH.continuousOn.integrableOn_compact + (isCompact_closedBall c M)).mono_set Metric.ball_subset_closedBall + have hh := tendsto_integral_of_dominated_convergence (μ := μ) (fun x ↦ H x*t^(n-1)) + (fun j ↦ (hH.mul (((radialDensityIntegrand_continuous c (n-1) (densityProfile_contDiff j)).comp + (continuous_const.prodMk continuous_id)))).aestronglyMeasurable) + (hiH.mul_const _) (fun j ↦ ae_of_all μ fun x ↦ ?_) + (ae_of_all μ fun x ↦ (tendsto_const_nhds (x := H x)).mul + (radialDensityIntegrand_tendsto c (n-1) ht0 x)) + · have heq : (∫ x, H x * (Metric.ball c (1/t)).indicator (fun _ ↦ t^(n-1)) x ∂μ) = + t^(n-1) * ∫ x in Metric.ball c (1/t), H x ∂perimeterMeasure E := by + have hpt : ∀ x, H x * (Metric.ball c (1/t)).indicator (fun _ ↦ t^(n-1)) x = + t^(n-1) * (Metric.ball c (1/t)).indicator H x := by + intro x + by_cases hx : x ∈ Metric.ball c (1/t) + · rw [indicator_of_mem hx, indicator_of_mem hx, mul_comm] + · rw [indicator_of_notMem hx, indicator_of_notMem hx, mul_zero, mul_zero] + simp_rw [hpt] + rw [integral_const_mul, integral_indicator measurableSet_ball] + dsimp only [μ] + rw [Measure.restrict_restrict measurableSet_ball, + inter_eq_left.mpr (Metric.ball_subset_ball htM.le)] + rwa [heq] at hh + · change |(inner ℝ v x-a)^2 * (t^(n-1)*densityProfile j (t^2*‖x-c‖^2))| ≤ + (inner ℝ v x-a)^2 * t^(n-1) + rw [abs_of_nonneg (mul_nonneg (sq_nonneg _) (mul_nonneg + (pow_nonneg ht0.le _) (densityProfile_mem_Icc j _).1))] + exact mul_le_mul_of_nonneg_left + (mul_le_of_le_one_right (pow_nonneg ht0.le _) (densityProfile_mem_Icc j _).2) (sq_nonneg _) + +theorem minimizing_height_density_monotone {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) (c v : Euc n) (a : ℝ) : + MonotoneOn (fun r : ℝ ↦ (∫ x in Metric.ball c r, + (inner ℝ v x-a)^2 ∂perimeterMeasure E) / r^(n-1)) (Ioi 0) := by + intro r hr R hR hrR + have hr0 : 0 < r := hr + have hR0 : 0 < R := hR + let M := 2*R + have hM : 0 < M := by dsimp [M]; positivity + have hRM : 1/M < 1/R := one_div_lt_one_div_of_lt hR0 (by dsimp [M]; linarith) + have htr : 1/R ≤ 1/r := one_div_le_one_div_of_le hr0 hrR + have hrM : 1/M < 1/r := hRM.trans_le htr + have hseq (j : ℕ) := minimizing_height_smoothedDensity_antitoneOn hn hmin c v a hM j hRM hrM htr + have hh := le_of_tendsto_of_tendsto + (height_radial_integral_tendsto hmin c v a hM hrM) + (height_radial_integral_tendsto hmin c v a hM hRM) (Eventually.of_forall hseq) + simpa [one_div, div_eq_mul_inv, mul_comm] using hh + +theorem exists_minimizing_height_mean_value_constant (n : ℕ) (hn : 1 < n) : + ∃ C : ℝ, 0 < C ∧ ∀ E : Set (Euc n), IsLocallyPerimeterMinimizing E → + ∀ p ∈ perimeterSupport E, ∀ R : ℝ, 0 < R → ∀ (v : Euc n) (a : ℝ), + (inner ℝ v p-a)^2 ≤ C/R^(n-1) * + ∫ x in Metric.ball p R, (inner ℝ v x-a)^2 ∂perimeterMeasure E := by + obtain ⟨c₀, hc₀, hdensity⟩ := exists_minimizing_perimeter_lower_density n hn + refine ⟨2/c₀, by positivity, ?_⟩ + intro E hmin p hp R hR v a + let H : Euc n → ℝ := fun x ↦ (inner ℝ v x-a)^2 + have hH : Continuous H := ((continuous_const.inner continuous_id).sub continuous_const).pow 2 + have hI0 : 0 ≤ ∫ x in Metric.ball p R, H x ∂perimeterMeasure E := + integral_nonneg fun x ↦ sq_nonneg _ + by_cases hz : H p = 0 + · change H p ≤ _ + rw [hz] + exact mul_nonneg (by positivity) hI0 + have hp0 : 0 < H p := lt_of_le_of_ne (sq_nonneg _) (Ne.symm hz) + have ht : {x | H p/2 < H x} ∈ 𝓝 p := + hH.continuousAt.preimage_mem_nhds (Ioi_mem_nhds (by linarith)) + obtain ⟨r, hr, hsub⟩ := Metric.mem_nhds_iff.mp ht + let ρ := min r R + have hρ : 0 < ρ := lt_min hr hR + have hρr : ρ ≤ r := min_le_left _ _ + have hρR : ρ ≤ R := min_le_right _ _ + have := perimeterMeasure_locallyFinite E hmin.2.1 + have : IsFiniteMeasure ((perimeterMeasure E).restrict (Metric.ball p ρ)) := ⟨by + rw [Measure.restrict_apply_univ, perimeterMeasure_open E Metric.isOpen_ball] + exact hmin.2.1 p ρ hρ⟩ + have hiH : IntegrableOn H (Metric.ball p ρ) (perimeterMeasure E) := + (hH.continuousOn.integrableOn_compact (isCompact_closedBall p ρ)).mono_set + Metric.ball_subset_closedBall + have hlow : (H p/2) * (perimeterMeasure E).real (Metric.ball p ρ) ≤ + ∫ x in Metric.ball p ρ, H x ∂perimeterMeasure E := by + have hh := integral_mono_ae (integrable_const (H p/2)) hiH + ((ae_restrict_mem measurableSet_ball).mono fun x hx ↦ + (hsub (Metric.ball_subset_ball hρr hx)).le) + simpa only [integral_const, smul_eq_mul, Measure.real, Measure.restrict_apply_univ, + mul_comm] using hh + have hd : c₀*ρ^(n-1) ≤ (perimeterMeasure E).real (Metric.ball p ρ) := by + have hd₀ := ENNReal.toReal_mono (hmin.2.1 p ρ hρ).ne (hdensity E hmin p hp ρ hρ) + rw [ENNReal.toReal_ofReal (by positivity)] at hd₀ + simpa only [Measure.real, perimeterMeasure_open E Metric.isOpen_ball] using hd₀ + have hmono := minimizing_height_density_monotone hn hmin p v a hρ hR hρR + have hbound : c₀*H p/2 ≤ (∫ x in Metric.ball p R, H x ∂perimeterMeasure E)/R^(n-1) := by + calc + _ = ((H p/2)*(c₀*ρ^(n-1)))/ρ^(n-1) := by + field_simp + _ ≤ ((H p/2)*(perimeterMeasure E).real (Metric.ball p ρ))/ρ^(n-1) := by + exact div_le_div_of_nonneg_right + (mul_le_mul_of_nonneg_left hd (by positivity)) (pow_nonneg hρ.le _) + _ ≤ (∫ x in Metric.ball p ρ, H x ∂perimeterMeasure E)/ρ^(n-1) := + div_le_div_of_nonneg_right hlow (pow_nonneg hρ.le _) + _ ≤ _ := hmono + change H p ≤ (2/c₀)/R^(n-1) * ∫ x in Metric.ball p R, H x ∂perimeterMeasure E + calc + H p = (2/c₀)*(c₀*H p/2) := by field_simp + _ ≤ (2/c₀)*((∫ x in Metric.ball p R, H x ∂perimeterMeasure E)/R^(n-1)) := + mul_le_mul_of_nonneg_left hbound (by positivity) + _ = _ := by ring + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/HolderGraph.lean b/lean/OAI/Geometry/Perimeter/Regularity/HolderGraph.lean new file mode 100644 index 0000000000000000000000000000000000000000..88f8888d6fea48e579b3bfbf5e69b7f0de1fb50a --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/HolderGraph.lean @@ -0,0 +1,88 @@ +import OAI.Geometry.Perimeter.Regularity.NeighborhoodPlanes +import OAI.Geometry.Perimeter.Regularity.GraphSlope +import OAI.Geometry.Perimeter.Regularity.GeometricDerivativeModulus + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +variable {n : ℕ} + +theorem holder_graph_from_contraction (hn : 1 simp [χ, hx] + have hd := integrable_divergence hV.1 hV.2.1 + let F : Euc n × Euc n → ℝ := fun p ↦ k p.1 * χ (p.2 - p.1) * divergence V p.2 + have hFi : Integrable F (volume.prod volume) := by + apply (hk.norm.mul_prod hd.norm).mono' + · exact ((hkc.measurable.comp measurable_fst).mul + (hmχ.comp (measurable_snd.sub measurable_fst))).mul + ((continuous_divergence hV.1).measurable.comp measurable_snd) |>.aestronglyMeasurable + · apply ae_of_all + intro p + simp only [F, norm_mul] + exact mul_le_mul_of_nonneg_right + (by nlinarith [hbχ (p.2 - p.1), norm_nonneg (k p.1)]) (norm_nonneg _) + have hinner : ∀ t, (∫ x, F (t, x)) = k t * (∫ y in E, divergence V (y + t)) := by + intro t + simp only [F, mul_assoc, integral_const_mul] + congr 1 + calc + (∫ x, χ (x - t) * divergence V x) = + ∫ y, χ y * divergence V (y + t) := by + simpa only [add_sub_cancel_right] using + (integral_add_right_eq_self (fun x ↦ χ (x - t) * divergence V x) t).symm + _ = ∫ y in E, divergence V (y + t) := by + rw [← integral_indicator hE] + apply integral_congr_ae + apply ae_of_all + intro y + by_cases hy : y ∈ E <;> simp [χ, hy] + have hInt : Integrable (fun t ↦ k t * (∫ y in E, divergence V (y + t))) volume := by + simpa only [hinner] using hFi.integral_prod_left + have heq : (∫ x, (k ⋆[lsmul ℝ ℝ, volume] χ) x * divergence V x) = + ∫ t, k t * (∫ y in E, divergence V (y + t)) := by + calc + _ = ∫ x, ∫ t, F (t, x) := by + apply integral_congr_ae + apply ae_of_all + intro x + simp only [convolution_def, lsmul_apply, smul_eq_mul, F, integral_mul_const] + _ = ∫ t, ∫ x, F (t, x) := integral_integral_swap hFi.swap + _ = _ := by simp only [hinner] + have hbound : ∀ t, k t * (∫ y in E, divergence V (y + t)) ≤ k t * (perimeter E W).toReal := by + intro t + by_cases ht : k t = 0 + · simp only [ht, zero_mul, le_refl] + have htk : t ∈ tsupport k := subset_closure ht + let Vt : Euc n → Euc n := fun y ↦ V (y + t) + have hVs : tsupport Vt ⊆ W := by + intro y hy + apply hshift t htk y + exact hV.2.2.1 ((tsupport_comp_subset_preimage V (continuous_id.add continuous_const)) hy) + have hVt : PerimeterAdmissible W Vt := ⟨hV.1.comp (contDiff_id.add contDiff_const), + hV.2.1.comp_homeomorph (Homeomorph.addRight t), hVs, fun y ↦ hV.2.2.2 _⟩ + have hh : (∫ y in E, divergence V (y + t)) ≤ (perimeter E W).toReal := by + simpa only [Vt, divergence_comp_add_right (hV.1.differentiable (by simp))] using + integral_divergence_le_perimeter_real E W hP hVt + exact mul_le_mul_of_nonneg_left hh (hk0 t) + rw [heq] + calc + (∫ t, k t * (∫ y in E, divergence V (y + t))) ≤ + ∫ t, k t * (perimeter E W).toReal := by + exact integral_mono hInt (hk.mul_const _) hbound + _ = (perimeter E W).toReal := by rw [integral_mul_const, hk1, one_mul] + +theorem scalar_compact_integration_parts {n : ℕ} {u v : Euc n → ℝ} + (hu : ContDiff ℝ ∞ u) (hv : ContDiff ℝ ∞ v) (hcv : HasCompactSupport v) + (a : Euc n) : + Integrable (fun x ↦ u x * fderiv ℝ v x a) volume ∧ + Integrable (fun x ↦ fderiv ℝ u x a * v x) volume ∧ + (∫ x, u x * fderiv ℝ v x a) = -(∫ x, fderiv ℝ u x a * v x) := by + have hdu : Continuous (fun x ↦ fderiv ℝ u x a) := + (hu.continuous_fderiv (by simp)).clm_apply continuous_const + have hdv : Continuous (fun x ↦ fderiv ℝ v x a) := + (hv.continuous_fderiv (by simp)).clm_apply continuous_const + have hcdv : HasCompactSupport (fun x ↦ fderiv ℝ v x a) := + hcv.fderiv_apply ℝ a + have h1 : Integrable (fun x ↦ u x * fderiv ℝ v x a) volume := + (hu.continuous.mul hdv).integrable_of_hasCompactSupport hcdv.mul_left + have h2 : Integrable (fun x ↦ fderiv ℝ u x a * v x) volume := + (hdu.mul hv.continuous).integrable_of_hasCompactSupport hcv.mul_left + refine ⟨h1, h2, ?_⟩ + exact integral_mul_fderiv_eq_neg_fderiv_mul_of_integrable h2 h1 + ((hu.continuous.mul hv.continuous).integrable_of_hasCompactSupport hcv.mul_left) + (fun x _ ↦ hu.differentiable (by simp) x) + (fun x _ ↦ hv.differentiable (by simp) x) + +theorem integral_mul_divergence_eq_neg_inner_gradient_local {n : ℕ} {u : Euc n → ℝ} + {V : Euc n → Euc n} (hu : ContDiff ℝ ∞ u) + (hV : ContDiff ℝ ∞ V) (hcV : HasCompactSupport V) : + (∫ x, u x * divergence V x) = - ∫ x, inner ℝ (gradient u x) (V x) := by + let b := EuclideanSpace.basisFun (Fin n) ℝ + let v : Fin n → Euc n → ℝ := fun i x ↦ inner ℝ (b i) (V x) + have hv : ∀ i, ContDiff ℝ ∞ (v i) := fun i ↦ (innerSL ℝ (b i)).contDiff.comp hV + have hcv : ∀ i, HasCompactSupport (v i) := fun i ↦ hcV.comp_left (by simp) + have hdv : ∀ i x, fderiv ℝ (v i) x (b i) = + inner ℝ (b i) (fderiv ℝ V x (b i)) := by + intro i x + have h := ((innerSL ℝ (b i)).hasFDerivAt.comp x + (hV.differentiable (by simp) x).hasFDerivAt).fderiv + exact congrArg (fun L : Euc n →L[ℝ] ℝ ↦ L (b i)) h + have hp := fun i ↦ scalar_compact_integration_parts hu (hv i) (hcv i) (b i) + have hInt1 := fun i ↦ (hp i).2.1 + have hInt2 := fun i ↦ (hp i).1 + have hparts := fun i ↦ (hp i).2.2 + calc + (∫ x, u x * divergence V x) = ∫ x, ∑ i, u x * fderiv ℝ (v i) x (b i) := by + congr 1 + funext x + simp only [divergence, hdv, Finset.mul_sum, b] + _ = ∑ i, ∫ x, u x * fderiv ℝ (v i) x (b i) := integral_finsetSum _ (fun i _ ↦ hInt2 i) + _ = -(∑ i, ∫ x, fderiv ℝ u x (b i) * v i x) := by simp only [hparts, Finset.sum_neg_distrib] + _ = -(∫ x, ∑ i, fderiv ℝ u x (b i) * v i x) := by + rw [integral_finsetSum _ (fun i _ ↦ hInt1 i)] + _ = -(∫ x, inner ℝ (gradient u x) (V x)) := by + congr 1 + apply integral_congr_ae + apply ae_of_all + intro x + simp only [← inner_gradient_left, v] + exact b.sum_inner_mul_inner _ _ + +theorem integral_weighted_norm_gradient_le_of_test_bound {n : ℕ} {u : Euc n → ℝ} + (hu : ContDiff ℝ ∞ u) {φ : Euc n → ℝ} (hφ : ContDiff ℝ ∞ φ) + (hcφ : HasCompactSupport φ) (hφ0 : ∀ x, 0 ≤ φ x) (hφ1 : ∀ x, φ x ≤ 1) + (U : Set (Euc n)) (hsφ : tsupport φ ⊆ U) {P : ℝ} + (hbound : ∀ V : Euc n → Euc n, PerimeterAdmissible U V → + (∫ x, u x * divergence V x) ≤ P) : + (∫ x, φ x * ‖gradient u x‖) ≤ P := by + let ε : ℕ → ℝ := fun j ↦ 1 / (j + 1 : ℝ) + have hε : ∀ j, 0 < ε j := by intro j; dsimp [ε]; positivity + let f : ℕ → Euc n → ℝ := fun j x ↦ + ‖gradient u x‖ ^ 2 / Real.sqrt (ε j ^ 2 + ‖gradient u x‖ ^ 2) + have hg := (gradient_contDiff hu).continuous + have hgi : Integrable (fun x ↦ φ x * ‖gradient u x‖) volume := + (hφ.continuous.mul hg.norm).integrable_of_hasCompactSupport hcφ.mul_right + have hf0 : ∀ j x, 0 ≤ f j x := by intro j x; exact div_nonneg (sq_nonneg _) (Real.sqrt_nonneg _) + have hfle : ∀ j x, f j x ≤ ‖gradient u x‖ := by + intro j x + have hp : 0 < ε j ^ 2 + ‖gradient u x‖ ^ 2 := + add_pos_of_pos_of_nonneg (sq_pos_of_pos (hε j)) (sq_nonneg _) + have hs : ‖gradient u x‖ ≤ Real.sqrt (ε j ^ 2 + ‖gradient u x‖ ^ 2) := by + rw [Real.le_sqrt (norm_nonneg _) hp.le] + nlinarith [sq_nonneg (ε j)] + exact (div_le_iff₀ (Real.sqrt_pos.2 hp)).2 (by nlinarith [norm_nonneg (gradient u x)]) + have hfcont : ∀ j, Continuous (f j) := by + intro j + exact (hg.norm.pow 2).div ((continuous_const.add (hg.norm.pow 2)).sqrt) + (fun x ↦ (Real.sqrt_pos.2 + (add_pos_of_pos_of_nonneg (sq_pos_of_pos (hε j)) (sq_nonneg _))).ne') + have hflim : ∀ x, Tendsto (fun j ↦ f j x) atTop (𝓝 ‖gradient u x‖) := by + intro x + have hlim : Tendsto ε atTop (𝓝 0) := by + simpa only [ε, Nat.cast_add, Nat.cast_one] using tendsto_one_div_add_atTop_nhds_zero_nat + by_cases hx : ‖gradient u x‖ = 0 + · simp [f, hx] + · have hden := ((hlim.pow 2).add_const (‖gradient u x‖ ^ 2)).sqrt + have hden' : Tendsto (fun j ↦ Real.sqrt (ε j ^ 2 + ‖gradient u x‖ ^ 2)) + atTop (𝓝 ‖gradient u x‖) := by + simpa [Real.sqrt_sq (norm_nonneg _)] using hden + have hh := (tendsto_const_nhds (x := ‖gradient u x‖ ^ 2)).div hden' hx + have heq : ‖gradient u x‖ ^ 2 / ‖gradient u x‖ = ‖gradient u x‖ := by + rw [pow_two, mul_div_cancel_right₀ _ hx] + change Tendsto (fun j ↦ ‖gradient u x‖ ^ 2 / Real.sqrt (ε j ^ 2 + ‖gradient u x‖ ^ 2)) + atTop (𝓝 (‖gradient u x‖ ^ 2 / ‖gradient u x‖)) at hh + rw [heq] at hh + exact hh + have hlim : Tendsto (fun j ↦ ∫ x, φ x * f j x) atTop + (𝓝 (∫ x, φ x * ‖gradient u x‖)) := + tendsto_integral_of_dominated_convergence (fun x ↦ φ x * ‖gradient u x‖) + (fun j ↦ (hφ.continuous.mul (hfcont j)).aestronglyMeasurable) + hgi (fun j ↦ ae_of_all _ fun x ↦ by + rw [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg (hφ0 x) (hf0 j x))] + exact mul_le_mul_of_nonneg_left (hfle j x) (hφ0 x)) + (ae_of_all _ fun x ↦ (hflim x).const_mul (φ x)) + apply le_of_tendsto hlim + apply Eventually.of_forall + intro j + let V : Euc n → Euc n := fun x ↦ φ x • gradientDualTest u (ε j) x + have hV : PerimeterAdmissible U V := by + refine ⟨hφ.smul (gradientDualTest_contDiff hu (hε j)), hcφ.smul_right, + (tsupport_smul_subset_left φ _).trans hsφ, ?_⟩ + intro x + simp only [V, norm_smul, Real.norm_eq_abs, abs_of_nonneg (hφ0 x)] + calc + φ x * ‖gradientDualTest u (ε j) x‖ ≤ φ x * 1 := + mul_le_mul_of_nonneg_left (gradientDualTest_norm_le u (hε j) x) (hφ0 x) + _ ≤ 1 := by simpa only [mul_one] using hφ1 x + have heq : (∫ x, u x * divergence V x) = ∫ x, φ x * f j x := by + rw [integral_mul_divergence_eq_neg_inner_gradient_local hu hV.1 hV.2.1, ← integral_neg] + apply integral_congr_ae + apply ae_of_all + intro x + simp only [V, gradientDualTest, inner_smul_right, real_inner_self_eq_norm_sq, + f, neg_mul, mul_neg, neg_neg, div_eq_mul_inv] + ring + rw [← heq] + exact hbound V hV + +theorem c1Mollify_indicator_local_gradient_le {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) (c : Euc n) {R : ℝ} (hR : 0 < R) + (hP : perimeter E (Metric.ball c (4 * R)) ≠ ⊤) (j : ℕ) + (hj : (c1Mollifier (n := n) j).rOut < R) : + (∫ x in Metric.closedBall c R, + ‖fderiv ℝ (c1Mollify (E.indicator (fun _ ↦ (1 : ℝ))) j) x‖) ≤ + (perimeter E (Metric.ball c (4 * R))).toReal := by + let χ : Euc n → ℝ := E.indicator (fun _ ↦ 1) + let u := c1Mollify χ j + let φ : ContDiffBump c := ⟨R, 2 * R, hR, by linarith⟩ + have hu : ContDiff ℝ ∞ u := + (c1Mollifier j).hasCompactSupport_normed.contDiff_convolution_left _ + (c1Mollifier j).contDiff_normed (indicator_one_locallyIntegrable hE) + have hsφ : tsupport φ ⊆ Metric.ball c (3 * R) := by + rw [φ.tsupport_eq] + exact Metric.closedBall_subset_ball (by dsimp [φ]; linarith) + have hgrad : (∫ x, φ x * ‖gradient u x‖) ≤ + (perimeter E (Metric.ball c (4 * R))).toReal := by + apply integral_weighted_norm_gradient_le_of_test_bound hu φ.contDiff + φ.hasCompactSupport (fun _ ↦ φ.nonneg) (fun _ ↦ φ.le_one) (Metric.ball c (3 * R)) hsφ + intro V hV + apply indicator_convolution_variation_local_le hE + (Metric.ball c (3 * R)) (Metric.ball c (4 * R)) hP + (c1Mollifier j).continuous_normed + ((c1Mollifier j).continuous_normed.integrable_of_hasCompactSupport + (c1Mollifier j).hasCompactSupport_normed) + (c1Mollifier j).nonneg_normed (c1Mollifier j).integral_normed _ hV + intro t ht y hy + rw [(c1Mollifier j).tsupport_normed_eq] at ht + have ht' : ‖t‖ ≤ (c1Mollifier (n := n) j).rOut := by + simpa only [Metric.mem_closedBall, dist_zero_right] using ht + have hdist : dist y (y + t) = ‖t‖ := by simp [dist_eq_norm] + exact (dist_triangle y (y + t) c).trans_lt (by + rw [hdist] + linarith [Metric.mem_ball.mp hy]) + have hnorm : ∀ x, ‖gradient u x‖ = ‖fderiv ℝ u x‖ := fun x ↦ + (InnerProductSpace.toDual ℝ (Euc n)).symm.norm_map _ + calc + _ = ∫ x in Metric.closedBall c R, φ x * ‖gradient u x‖ := by + apply setIntegral_congr_fun measurableSet_closedBall + intro x hx + change ‖fderiv ℝ u x‖ = φ x * ‖gradient u x‖ + rw [φ.one_of_mem_closedBall hx, one_mul, hnorm] + _ ≤ ∫ x, φ x * ‖gradient u x‖ := + setIntegral_le_integral ((φ.continuous.mul (gradient_contDiff hu).continuous.norm).integrable_of_hasCompactSupport φ.hasCompactSupport.mul_right) + (ae_of_all _ fun x ↦ mul_nonneg (φ.nonneg (x := x)) (norm_nonneg _)) + _ ≤ _ := hgrad + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack +open RPI.Boundary +open ContinuousLinearMap +open scoped Convolution + +theorem c1Mollify_indicator_norm_le_one {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) (j : ℕ) (x : Euc n) : + ‖c1Mollify (E.indicator (fun _ ↦ (1 : ℝ))) j x‖ ≤ 1 := by + have hh := dist_convolution_le (μ := (volume : Measure (Euc n))) + (g := E.indicator (fun _ ↦ (1 : ℝ))) (x₀ := x) (z₀ := 0) (by norm_num : (0 : ℝ) ≤ 1) + (c1Mollifier j).support_normed_eq.subset (c1Mollifier j).nonneg_normed + (c1Mollifier j).integral_normed (measurable_const.indicator hE).aestronglyMeasurable + (fun y _ ↦ by by_cases hy : y ∈ E <;> simp [hy]) + simpa only [c1Mollify, dist_zero_right] using hh + +theorem raw_ball_poincare {n : ℕ} {E : Set (Euc n)} (hE : MeasurableSet E) + (c : Euc n) {R : ℝ} (hR : 0 < R) + (hP : perimeter E (Metric.ball c (4 * R)) ≠ ⊤) : + volume.real (E ∩ Metric.closedBall c R) * + volume.real (Eᶜ ∩ Metric.closedBall c R) ≤ + 4 * R * volume.real (Metric.closedBall c R) * 2 ^ n * + (perimeter E (Metric.ball c (4 * R))).toReal := by + let B := Metric.closedBall c R + let μ : Measure (Euc n) := volume.restrict B + have : IsFiniteMeasure μ := ⟨by + simpa only [μ, Measure.restrict_apply_univ, B] using + (isCompact_closedBall c R).measure_lt_top (μ := volume)⟩ + let χ : Euc n → ℝ := E.indicator (fun _ ↦ 1) + let ψ : Euc n → ℝ := Eᶜ.indicator (fun _ ↦ 1) + let u : ℕ → Euc n → ℝ := c1Mollify χ + have hχ : LocallyIntegrable χ volume := indicator_one_locallyIntegrable hE + have hψ : LocallyIntegrable ψ volume := indicator_one_locallyIntegrable hE.compl + have hχi : Integrable χ μ := hχ.integrableOn_isCompact (isCompact_closedBall c R) + have hψi : Integrable ψ μ := hψ.integrableOn_isCompact (isCompact_closedBall c R) + have hu : ∀ j, ContDiff ℝ ∞ (u j) := fun j ↦ + (c1Mollifier j).hasCompactSupport_normed.contDiff_convolution_left _ + (c1Mollifier j).contDiff_normed hχ + have hub : ∀ j x, ‖u j x‖ ≤ 1 := c1Mollify_indicator_norm_le_one hE + have hlim : ∀ᵐ x ∂μ, Tendsto (fun j ↦ u j x) atTop (𝓝 (χ x)) := by + apply Filter.Eventually.filter_mono (ae_mono Measure.restrict_le_self) + apply ContDiffBump.ae_convolution_tendsto_right_of_locallyIntegrable + c1Mollifier_radius_tendsto (K := 2) _ hχ + apply Eventually.of_forall + intro j + dsimp [c1Mollifier] + linarith + have hlimp : ∀ᵐ p ∂μ.prod μ, + Tendsto (fun j ↦ ‖u j p.1 - u j p.2‖) atTop (𝓝 ‖χ p.1 - χ p.2‖) := by + filter_upwards [Measure.quasiMeasurePreserving_fst.ae hlim, + Measure.quasiMeasurePreserving_snd.ae hlim] with p hp hq + exact (hp.sub hq).norm + have hDlim : Tendsto (fun j ↦ ∫ p, ‖u j p.1 - u j p.2‖ ∂μ.prod μ) atTop + (𝓝 (∫ p, ‖χ p.1 - χ p.2‖ ∂μ.prod μ)) := by + apply tendsto_integral_of_dominated_convergence (fun _ ↦ (2 : ℝ)) + · intro j + exact (((hu j).continuous.comp continuous_fst).sub + ((hu j).continuous.comp continuous_snd)).norm.aestronglyMeasurable + · exact integrable_const _ + · intro j + apply ae_of_all + intro p + simp only [norm_norm] + exact (norm_sub_le _ _).trans (by linarith [hub j p.1, hub j p.2]) + · exact hlimp + have hD : (∫ p, ‖χ p.1 - χ p.2‖ ∂μ.prod μ) ≤ + 4 * R * volume.real B * 2 ^ n * (perimeter E (Metric.ball c (4 * R))).toReal := by + apply le_of_tendsto hDlim + have hsmall : ∀ᶠ j in atTop, (c1Mollifier (n := n) j).rOut < R := + c1Mollifier_radius_tendsto.eventually (gt_mem_nhds hR) + filter_upwards [hsmall] with j hj + have hh := smooth_ball_poincare ((hu j).of_le (by simp)) c hR + apply hh.trans + have hgrad := c1Mollify_indicator_local_gradient_le hE c hR hP j hj + have hconst : 0 ≤ 4 * R * volume.real B * (2 : ℝ) ^ n := by positivity + calc + _ = (4 * R * volume.real B * (2 : ℝ) ^ n) * + ∫ x in B, ‖fderiv ℝ (u j) x‖ := by ring + _ ≤ _ := mul_le_mul_of_nonneg_left hgrad hconst + have hDi : Integrable (fun p : Euc n × Euc n ↦ ‖χ p.1 - χ p.2‖) (μ.prod μ) := + ((hχi.comp_fst μ).sub (hχi.comp_snd μ)).norm + calc + _ = (∫ x, χ x ∂μ) * ∫ y, ψ y ∂μ := by + simp only [χ, ψ, μ, integral_indicator hE, integral_indicator hE.compl, + Measure.restrict_restrict hE, Measure.restrict_restrict hE.compl, + integral_const, measureReal_restrict_apply_univ, smul_eq_mul, mul_one, B] + _ = ∫ p, χ p.1 * ψ p.2 ∂μ.prod μ := (integral_prod_mul χ ψ).symm + _ ≤ ∫ p, ‖χ p.1 - χ p.2‖ ∂μ.prod μ := by + apply integral_mono (hχi.mul_prod hψi) hDi + intro p + by_cases hp : p.1 ∈ E <;> by_cases hq : p.2 ∈ E <;> simp [χ, ψ, hp, hq] + _ ≤ _ := hD + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem exists_minimizing_perimeter_lower_density (n : ℕ) (hn : 1 < n) : + ∃ c₀ : ℝ, 0 < c₀ ∧ ∀ E : Set (Euc n), IsLocallyPerimeterMinimizing E → + ∀ c ∈ perimeterSupport E, ∀ r : ℝ, 0 < r → + ENNReal.ofReal (c₀ * r ^ (n - 1)) ≤ perimeter E (Metric.ball c r) := by + have hnr : (1 : ℝ) < n := by exact_mod_cast hn + obtain ⟨ε, hε, hphase⟩ := minimizing_scaled_two_phase_volume_lower + (Real.HolderConjugate.conjExponent hnr) + let V := volume.real (Metric.ball (0 : Euc n) 1) + have hV : 0 < V := by + change 0 < volume.real (Metric.ball (0 : Euc n) 1) + rw [measureReal_def, ENNReal.toReal_pos_iff] + exact ⟨Metric.measure_ball_pos volume _ (by norm_num), + (measure_mono Metric.ball_subset_closedBall).trans_lt + (isCompact_closedBall (0 : Euc n) 1).measure_lt_top⟩ + let K : ℝ := 4 * V * 2 ^ n + have hK : 0 < K := by dsimp [K]; positivity + let c₀ : ℝ := ε ^ 2 / (K * 4 ^ (n - 1)) + have hc₀ : 0 < c₀ := by dsimp [c₀]; positivity + refine ⟨c₀, hc₀, ?_⟩ + intro E hmin c hc r hr + let R := r / 4 + have hR : 0 < R := by dsimp [R]; positivity + have h4R : 4 * R = r := by dsimp [R]; ring + have hP : perimeter E (Metric.ball c (4 * R)) ≠ ⊤ := + (hmin.2.1 c (4 * R) (by positivity)).ne + have hpoin := raw_ball_poincare hmin.1 c hR hP + have hvol : volume.real (Metric.closedBall c R) = R ^ n * V := by + simpa only [Euc, finrank_euclideanSpace, Fintype.card_fin, V] using + (Measure.addHaar_real_closedBall (volume : Measure (Euc n)) c hR.le) + rw [hvol] at hpoin + obtain ⟨hleft, hright⟩ := hphase E hmin c hc R hR + have hprod : (ε * R ^ n) * (ε * R ^ n) ≤ + volume.real (E ∩ Metric.closedBall c R) * + volume.real (Eᶜ ∩ Metric.closedBall c R) := + mul_le_mul hleft.le hright.le (by positivity) measureReal_nonneg + have hpow : R ^ n = R ^ (n - 1) * R := by + rw [← pow_succ] + congr 1 + omega + have hsimple : ε ^ 2 * R ^ (n - 1) ≤ K * + (perimeter E (Metric.ball c (4 * R))).toReal := by + apply (mul_le_mul_iff_right₀ (show 0 < R ^ n * R by positivity)).mp + calc + _ = (ε * R ^ n) * (ε * R ^ n) := by rw [hpow]; ring + _ ≤ _ := hprod.trans hpoin + _ = _ := by dsimp [K]; ring + have hfinal : c₀ * r ^ (n - 1) ≤ (perimeter E (Metric.ball c r)).toReal := by + apply (mul_le_mul_iff_right₀ hK).mp + calc + K * (c₀ * r ^ (n - 1)) = ε ^ 2 * R ^ (n - 1) := by + rw [← h4R, mul_pow] + dsimp [c₀] + field_simp + _ ≤ _ := by simpa only [h4R] using hsimple + exact (ENNReal.ofReal_le_ofReal hfinal).trans_eq (ENNReal.ofReal_toReal + (hmin.2.1 c r hr).ne) + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem exists_minimizing_surfaceMeasure_growth {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) : + ∃ A : ℝ, 0 < A ∧ ∀ (c : Euc n) (r : ℝ), 0 < r → + RPI.Boundary.surfaceMeasure (perimeterSupport E) (Metric.ball c r) ≤ + ENNReal.ofReal (A * r ^ (n - 1)) := by + obtain ⟨c₀, hc₀, hdensity₀⟩ := exists_minimizing_perimeter_lower_density n hn + obtain ⟨C, hC, hperim⟩ := exists_locallyMinimizing_perimeter_growth_constant n (by omega) + have hdensity : ∀ x ∈ perimeterSupport E, ∀ᶠ r : ℝ in 𝓝[>] (0 : ℝ), + ENNReal.ofReal (c₀ * r ^ (n - 1)) ≤ perimeter E (Metric.ball x r) := by + intro x hx + filter_upwards [self_mem_nhdsWithin] with r hr + exact hdensity₀ E hmin x hx r hr + let K : ℝ≥0∞ := (8 : ℝ≥0∞) ^ (n - 1) * (ENNReal.ofReal c₀)⁻¹ * + ENNReal.ofReal C * (2 : ℝ≥0∞) ^ (n - 1) + have hK : K ≠ ⊤ := by + unfold K + exact ENNReal.mul_ne_top (ENNReal.mul_ne_top + (ENNReal.mul_ne_top (by finiteness) + (ENNReal.inv_ne_top.mpr (ENNReal.ofReal_ne_zero_iff.mpr hc₀))) + ENNReal.ofReal_ne_top) (by finiteness) + have hraw : ∀ (c : Euc n) (r : ℝ), 0 < r → + Measure.hausdorffMeasure (n - 1 : ℕ) (Metric.ball c r ∩ perimeterSupport E) ≤ + K * ENNReal.ofReal r ^ (n - 1) := by + intro c r hr + rw [inter_comm] + calc + _ ≤ (8 : ℝ≥0∞) ^ (n - 1) * (ENNReal.ofReal c₀)⁻¹ * + perimeter E (Metric.ball c (2 * r)) := + hausdorffMeasure_le_perimeter_of_lower_density E (perimeterSupport E) hc₀ hdensity c hr + _ ≤ (8 : ℝ≥0∞) ^ (n - 1) * (ENNReal.ofReal c₀)⁻¹ * + ENNReal.ofReal (C * (2 * r) ^ (n - 1)) := by + exact mul_le_mul le_rfl (hperim E hmin c (2 * r) (by positivity)) (by positivity) (by positivity) + _ = _ := by + rw [ENNReal.ofReal_mul hC.le, ENNReal.ofReal_pow (by positivity), + ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 2)] + norm_num only [ENNReal.ofReal_ofNat] + simp only [K, mul_pow, mul_assoc] + let a : ℝ≥0∞ := (Measure.addHaarScalarFactor (volume : Measure (Euc (n - 1))) + (Measure.hausdorffMeasure ((n - 1 : ℕ) : ℝ)) : ℝ≥0∞) + let A : ℝ := (a * K).toReal + 1 + have hA : 0 < A := by dsimp [A]; positivity + refine ⟨A, hA, ?_⟩ + intro c r hr + have haK : a * K ≤ ENNReal.ofReal A := by + rw [← ENNReal.ofReal_toReal (ENNReal.mul_ne_top ENNReal.coe_ne_top hK)] + exact ENNReal.ofReal_le_ofReal (by dsimp [A]; linarith) + rw [RPI.Boundary.surfaceMeasure, Measure.restrict_apply measurableSet_ball, + Measure.euclideanHausdorffMeasure_def, Measure.smul_apply, ENNReal.smul_def] + change a * Measure.hausdorffMeasure (n - 1 : ℕ) (Metric.ball c r ∩ perimeterSupport E) ≤ _ + calc + _ ≤ a * (K * ENNReal.ofReal r ^ (n - 1)) := + mul_le_mul le_rfl (hraw c r hr) (by positivity) (by positivity) + _ ≤ ENNReal.ofReal A * ENNReal.ofReal r ^ (n - 1) := by + rw [← mul_assoc] + exact mul_le_mul haK le_rfl (by positivity) (by positivity) + _ = _ := by rw [ENNReal.ofReal_mul hA.le, ENNReal.ofReal_pow hr.le] + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/InitialSlab.lean b/lean/OAI/Geometry/Perimeter/Regularity/InitialSlab.lean new file mode 100644 index 0000000000000000000000000000000000000000..37c2694548240c9cee06fcfc90f48a4160bbef1b --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/InitialSlab.lean @@ -0,0 +1,107 @@ +import OAI.Geometry.Perimeter.Regularity.PhaseRestoration + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +variable {n : ℕ} + +theorem phase_anchors_of_small_symmDiff {E H A B U : Set (Euc n)} + (hE : MeasurableSet E) (hU : volume U ≠ (∞ : ℝ≥0∞)) + (hA : A ⊆ U ∩ Hᶜ) (hB : B ⊆ U ∩ H) + (hsmallA : volume.real (symmDiff E H ∩ U) < volume.real A) + (hsmallB : volume.real (symmDiff E H ∩ U) < volume.real B) : + 0 < volume (A\E) ∧ 0 < volume (B∩E) := by + have hfin : volume (symmDiff E H ∩ U) ≠ (∞ : ℝ≥0∞) := measure_ne_top_of_subset inter_subset_right hU + constructor + · by_contra! hz + have heq : volume A = volume (A∩E) := by + have hh := measure_sdiff_add_inter (μ := volume) A hE + rw [le_antisymm hz bot_le,zero_add] at hh + exact hh.symm + have hle : volume (A∩E) ≤ volume (symmDiff E H ∩ U) := by + apply measure_mono + intro x hx + exact ⟨Or.inl ⟨hx.2,(hA hx.1).2⟩,(hA hx.1).1⟩ + have hh := ENNReal.toReal_mono hfin (heq ▸ hle) + exact (not_lt_of_ge hh) hsmallA + · by_contra! hz + have heq : volume B = volume (B\E) := by + have hh := measure_sdiff_add_inter (μ := volume) B hE + rw [le_antisymm hz bot_le,add_zero] at hh + exact hh.symm + have hle : volume (B\E) ≤ volume (symmDiff E H ∩ U) := by + apply measure_mono + intro x hx + exact ⟨Or.inr ⟨(hB hx.1).2,hx.2⟩,(hB hx.1).1⟩ + have hh := ENNReal.toReal_mono hfin (heq ▸ hle) + exact (not_lt_of_ge hh) hsmallB + +theorem HasHalfspaceBlowup.eventually_fullSlab (hn : 1.resolve_right hQ.ne' + exact ((ENNReal.toReal_eq_zero_iff _).mp hvol).resolve_right + (measure_ne_top_of_subset inter_subset_right (isCompact_closedBall c (R / 2)).measure_ne_top) + +theorem minimizing_scaled_two_phase_volume_lower {n : ℕ} {p : ℝ} + (hp : Real.HolderConjugate (n : ℝ) p) : + ∃ ε : ℝ, 0 < ε ∧ ∀ E : Set (Euc n), IsLocallyPerimeterMinimizing E → + ∀ c ∈ perimeterSupport E, ∀ R : ℝ, 0 < R → + ε * R ^ n < volume.real (E ∩ Metric.closedBall c R) ∧ + ε * R ^ n < volume.real (Eᶜ ∩ Metric.closedBall c R) := by + obtain ⟨ε, hε, hclear⟩ := minimizing_scaled_clearing_out hp + have hphase : ∀ E : Set (Euc n), IsLocallyPerimeterMinimizing E → + ∀ c ∈ perimeterSupport E, ∀ R : ℝ, 0 < R → + ε * R ^ n < volume.real (E ∩ Metric.closedBall c R) := by + intro E hmin c hc R hR + by_contra h + have hz := hclear E hmin c R hR (le_of_not_gt h) + have hpz := raw_perimeter_eq_zero_of_volume_inter_eq_zero measurableSet_ball + (measure_mono_null (inter_subset_inter_right E Metric.ball_subset_closedBall) hz) + have hpos := hc (R / 2) (by positivity) + rw [hpz] at hpos + exact (lt_irrefl _ hpos) + refine ⟨ε, hε, ?_⟩ + intro E hmin c hc R hR + exact ⟨hphase E hmin c hc R hR, hphase Eᶜ (isLocallyPerimeterMinimizing_compl hmin) c + (by simpa only [perimeterSupport_compl hmin.1] using hc) R hR⟩ + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem indicator_one_locallyIntegrable {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) : LocallyIntegrable (E.indicator (fun _ ↦ (1 : ℝ))) volume := by + apply (locallyIntegrable_const (μ := (volume : Measure (Euc n))) (1 : ℝ)).mono + (measurable_const.indicator hE).aestronglyMeasurable + exact ae_of_all _ fun x ↦ by + by_cases hx : x ∈ E <;> simp [hx] + +theorem average_indicator_one_closedBall {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) (c : Euc n) (R : ℝ) : + (⨍ x in Metric.closedBall c R, E.indicator (fun _ ↦ (1 : ℝ)) x) = + volume.real (E ∩ Metric.closedBall c R) / volume.real (Metric.closedBall c R) := by + rw [setAverage_eq, integral_indicator hE, Measure.restrict_restrict hE, + integral_const, smul_eq_mul, smul_eq_mul] + simp only [measureReal_restrict_apply_univ, one_mul, div_eq_mul_inv, mul_comm] + +theorem minimizing_phaseSupport_volume_lower {n : ℕ} {p : ℝ} + (hp : Real.HolderConjugate (n : ℝ) p) : + ∃ ε : ℝ, 0 < ε ∧ ∀ E : Set (Euc n), IsLocallyPerimeterMinimizing E → + ∀ c ∈ (volume.restrict E).support, ∀ R : ℝ, 0 < R → + ε * R ^ n < volume.real (E ∩ Metric.closedBall c R) := by + obtain ⟨ε, hε, hclear⟩ := minimizing_scaled_clearing_out hp + refine ⟨ε, hε, ?_⟩ + intro E hmin c hc R hR + by_contra h + have hz := hclear E hmin c R hR (le_of_not_gt h) + have hpos := (Metric.nhds_basis_ball.mem_measureSupport (μ := volume.restrict E)).mp hc + (R / 2) (by positivity) + rw [Measure.restrict_apply measurableSet_ball, inter_comm] at hpos + have hnull := measure_mono_null (inter_subset_inter_right E Metric.ball_subset_closedBall) hz + exact hpos.ne' hnull + +theorem minimizing_ae_eq_phaseSupport {n : ℕ} {p : ℝ} + (hp : Real.HolderConjugate (n : ℝ) p) {E : Set (Euc n)} + (hmin : IsLocallyPerimeterMinimizing E) : E =ᵐ[volume] (volume.restrict E).support := by + obtain ⟨ε, hε, hlower⟩ := minimizing_phaseSupport_volume_lower hp + let omegaVol : ℝ := volume.real (Metric.ball (0 : Euc n) 1) + have homegaVol : 0 < omegaVol := by + exact ENNReal.toReal_pos (Metric.measure_ball_pos volume (0 : Euc n) (by norm_num)).ne' + measure_ball_lt_top.ne + have hmean : ∀ c ∈ (volume.restrict E).support, ∀ R : ℝ, 0 < R → + ε / omegaVol ≤ ⨍ x in Metric.closedBall c R, E.indicator (fun _ ↦ (1 : ℝ)) x := by + intro c hc R hR + rw [average_indicator_one_closedBall hmin.1, + Measure.addHaar_real_closedBall volume c hR.le] + simp only [finrank_euclideanSpace, Fintype.card_fin] + calc + ε / omegaVol = (ε * R ^ n) / (R ^ n * omegaVol) := by field_simp [hR.ne', homegaVol.ne'] + _ ≤ volume.real (E ∩ Metric.closedBall c R) / (R ^ n * omegaVol) := + div_le_div_of_nonneg_right (hlower E hmin c hc R hR).le (by positivity) + have hmem : ∀ᵐ x ∂volume, x ∈ E → x ∈ (volume.restrict E).support := + (ae_restrict_iff' hmin.1).mp (volume.restrict E).support_mem_ae + have hdiff := IsUnifLocDoublingMeasure.ae_tendsto_average volume + (indicator_one_locallyIntegrable hmin.1) (1 : ℝ) + filter_upwards [hmem, hdiff] with x hmem hdiff + apply propext + constructor + · exact hmem + · intro hx + by_contra hxE + have ht := hdiff (fun _ : ℝ ↦ x) (id : ℝ → ℝ) tendsto_id + (by filter_upwards [self_mem_nhdsWithin] with R hR + exact Metric.mem_closedBall_self (by simpa only [one_mul] using hR.le)) + simp only [indicator_of_notMem hxE] at ht + have hle : ε / omegaVol ≤ (0 : ℝ) := ge_of_tendsto ht (by + filter_upwards [self_mem_nhdsWithin] with R hR + exact hmean x hx R hR) + exact (div_pos hε homegaVol).not_ge hle + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/IntegralDivergenceEqZeroOfPerimeterEqZero.lean b/lean/OAI/Geometry/Perimeter/Regularity/IntegralDivergenceEqZeroOfPerimeterEqZero.lean new file mode 100644 index 0000000000000000000000000000000000000000..e43bcb706f310f4523f2bbff7bf509f65c9d949d --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/IntegralDivergenceEqZeroOfPerimeterEqZero.lean @@ -0,0 +1,380 @@ +import OAI.Geometry.Perimeter.Regularity.IntegralDivergenceEqZero + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack +open RPI.Boundary ContinuousLinearMap +open scoped Convolution + +theorem integral_divergence_eq_zero_of_perimeter_eq_zero {n : ℕ} + {E U : Set (Euc n)} (hP : perimeter E U = 0) + {V : Euc n → Euc n} (hV : ContDiff ℝ ∞ V) (hc : HasCompactSupport V) + (hs : tsupport V ⊆ U) : (∫ x in E, divergence V x) = 0 := by + obtain ⟨M, hM⟩ := hc.exists_bound_of_continuous hV.continuous + let a : ℝ := (|M| + 1)⁻¹ + have ha : 0 < a := by dsimp [a]; positivity + let W : Euc n → Euc n := fun x ↦ a • V x + have hW : PerimeterAdmissible U W := by + have hsmul : ContDiff ℝ ∞ (fun z : Euc n ↦ a • z) := + (contDiff_const (c := a)).smul contDiff_id + refine ⟨hsmul.comp hV, hc.comp_left (g := fun z : Euc n ↦ a • z) (smul_zero a), ?_, ?_⟩ + · exact (tsupport_smul_subset_right (fun _ ↦ a) V).trans hs + · intro x + simp only [W, norm_smul, Real.norm_of_nonneg ha.le] + calc + a * ‖V x‖ ≤ a * |M| := mul_le_mul_of_nonneg_left ((hM x).trans (le_abs_self M)) ha.le + _ ≤ a * (|M| + 1) := mul_le_mul_of_nonneg_left (by linarith) ha.le + _ = 1 := inv_mul_cancel₀ (by positivity) + have hupper := integral_divergence_le_perimeter_real E U (by rw [hP]; simp) hW + have hlower := integral_divergence_le_perimeter_real E U (by rw [hP]; simp) + (perimeterAdmissible_neg hW) + have hd : divergence W = fun x ↦ a * divergence V x := by + funext x + rw [divergence_smul (differentiable_const a) (hV.differentiable (by simp))] + simp + rw [hd, integral_const_mul, hP, ENNReal.toReal_zero] at hupper + rw [divergence_neg (hW.1.differentiable (by simp))] at hlower + simp only [Pi.neg_apply] at hlower + rw [integral_neg, hd, + integral_const_mul, hP, ENNReal.toReal_zero] at hlower + nlinarith + +theorem convolution_fderiv_eq_zero_of_perimeter_eq_zero {n : ℕ} + {E U : Set (Euc n)} (hE : MeasurableSet E) (hP : perimeter E U = 0) + {k : Euc n → ℝ} (hk : ContDiff ℝ ∞ k) (hck : HasCompactSupport k) + (x : Euc n) (hs : ∀ y, x - y ∈ tsupport k → y ∈ U) : + fderiv ℝ (E.indicator (fun _ ↦ (1 : ℝ)) ⋆[lsmul ℝ ℝ, volume] k) x = 0 := by + let χ : Euc n → ℝ := E.indicator (fun _ ↦ 1) + have hχ : LocallyIntegrable χ volume := indicator_one_locallyIntegrable hE + have hk1 : ContDiff ℝ 1 k := hk.of_le (by simp) + rw [(hck.hasFDerivAt_convolution_right (lsmul ℝ ℝ) hχ hk1 x).fderiv] + ext v + rw [convolution_precompR_apply (lsmul ℝ ℝ) hχ (hck.fderiv ℝ) + (hk.continuous_fderiv (by simp))] + let a : Euc n → ℝ := fun y ↦ k (x - y) + let V : Euc n → Euc n := fun y ↦ a y • v + have ha : ContDiff ℝ ∞ a := hk.comp (contDiff_const.sub contDiff_id) + have hca : HasCompactSupport a := hck.comp_homeomorph (Homeomorph.subLeft x) + have hsV : tsupport V ⊆ U := by + apply (tsupport_smul_subset_left a (fun _ ↦ v)).trans + intro y hy + apply hs y + exact (tsupport_comp_subset_preimage k (continuous_const.sub continuous_id)) hy + have hd : divergence V = fun y ↦ -fderiv ℝ k (x - y) v := by + funext y + rw [divergence_smul (ha.differentiable (by simp)) (differentiable_const v)] + simp only [divergence, fderiv_fun_const, Pi.zero_apply, zero_apply, inner_zero_right, Finset.sum_const_zero, + mul_zero, zero_add, inner_gradient_left] + have h := ((hk.differentiable (by simp) (x - y)).hasFDerivAt.comp y + ((hasFDerivAt_const x y).sub (hasFDerivAt_id y))).fderiv + simpa only [a, Function.comp_def, sub_apply, zero_apply, id_apply, zero_sub, + ContinuousLinearMap.comp_apply, neg_apply, map_neg] using congrArg (fun L : Euc n →L[ℝ] ℝ ↦ L v) h + have hz := integral_divergence_eq_zero_of_perimeter_eq_zero hP + (ha.smul (contDiff_const (c := v))) hca.smul_right hsV + change (∫ x in E, divergence V x) = 0 at hz + rw [hd, integral_neg, neg_eq_zero] at hz + change (∫ t, χ t * fderiv ℝ k (x - t) v) = 0 + have heq : (fun t ↦ χ t * fderiv ℝ k (x - t) v) = + E.indicator (fun t ↦ fderiv ℝ k (x - t) v) := by + funext t + by_cases ht : t ∈ E <;> simp [χ, ht] + rw [heq, integral_indicator hE] + exact hz + +theorem volume_inter_eq_zero_or_compl_of_perimeter_eq_zero {n : ℕ} + {E : Set (Euc n)} (hE : MeasurableSet E) (c : Euc n) {R : ℝ} (hR : 0 < R) + (hP : perimeter E (Metric.ball c R) = 0) : + volume (E ∩ Metric.ball c (R / 2)) = 0 ∨ + volume (Eᶜ ∩ Metric.ball c (R / 2)) = 0 := by + let χ : Euc n → ℝ := E.indicator (fun _ ↦ 1) + let u : ℕ → Euc n → ℝ := c1Mollify χ + have hχ : LocallyIntegrable χ volume := indicator_one_locallyIntegrable hE + have hflip : (lsmul ℝ ℝ : ℝ →L[ℝ] ℝ →L[ℝ] ℝ).flip = lsmul ℝ ℝ := by + apply ContinuousLinearMap.ext + intro a + apply ContinuousLinearMap.ext + intro b + exact mul_comm b a + have hu_eq : ∀ j, u j = χ ⋆[lsmul ℝ ℝ, volume] (c1Mollifier j).normed volume := by + intro j + change (c1Mollifier j).normed volume ⋆[lsmul ℝ ℝ, volume] χ = _ + rw [← convolution_flip, hflip] + have hu : ∀ j, ContDiff ℝ ∞ (u j) := fun j ↦ + (c1Mollifier j).hasCompactSupport_normed.contDiff_convolution_left _ + (c1Mollifier j).contDiff_normed hχ + have hconst : ∀ᶠ j in atTop, ∀ x ∈ Metric.ball c (R / 2), + ∀ y ∈ Metric.ball c (R / 2), u j x = u j y := by + have hsmall : ∀ᶠ j in atTop, (c1Mollifier (n := n) j).rOut < R / 2 := + c1Mollifier_radius_tendsto.eventually (gt_mem_nhds (by positivity)) + filter_upwards [hsmall] with j hj + have hzero : (Metric.ball c (R / 2)).EqOn (fderiv ℝ (u j)) 0 := by + intro x hx + rw [hu_eq j] + apply convolution_fderiv_eq_zero_of_perimeter_eq_zero hE hP + (c1Mollifier j).contDiff_normed (c1Mollifier j).hasCompactSupport_normed x + intro y hy + rw [(c1Mollifier j).tsupport_normed_eq] at hy + have hxy : dist y x ≤ (c1Mollifier (n := n) j).rOut := by + simpa only [Metric.mem_closedBall, dist_zero_right, dist_eq_norm, sub_zero, norm_sub_rev] using hy + exact (dist_triangle y x c).trans_lt (by linarith [Metric.mem_ball.mp hx]) + intro x hx y hy + exact Metric.isOpen_ball.is_const_of_fderiv_eq_zero (convex_ball c (R / 2)).isPreconnected + ((hu j).differentiable (by simp)).differentiableOn hzero hx hy + have hlim : ∀ᵐ x ∂volume, Tendsto (fun j ↦ u j x) atTop (𝓝 (χ x)) := by + apply ContDiffBump.ae_convolution_tendsto_right_of_locallyIntegrable + c1Mollifier_radius_tendsto (K := 2) _ hχ + apply Eventually.of_forall + intro j + dsimp [c1Mollifier] + linarith + by_contra hn + push Not at hn + obtain ⟨x, hx, hlimx⟩ := Measure.exists_mem_of_measure_ne_zero_of_ae hn.1 + (hlim.filter_mono (ae_mono Measure.restrict_le_self)) + obtain ⟨y, hy, hlimy⟩ := Measure.exists_mem_of_measure_ne_zero_of_ae hn.2 + (hlim.filter_mono (ae_mono Measure.restrict_le_self)) + have hxy : (fun j ↦ u j x) =ᶠ[atTop] (fun j ↦ u j y) := + hconst.mono fun j hj ↦ hj x hx.2 y hy.2 + have hlimxy := tendsto_nhds_unique hlimx (hlimy.congr' hxy.symm) + have : (1 : ℝ) = 0 := by + simpa only [χ, indicator_of_mem hx.1, indicator_of_notMem hy.1] using hlimxy + exact one_ne_zero this + +theorem perimeterSupport_eq_phaseSupport_inter {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) : + perimeterSupport E = (volume.restrict E).support ∩ (volume.restrict Eᶜ).support := by + ext x + constructor + · intro hx + have hphase : ∀ F : Set (Euc n), MeasurableSet F → x ∈ perimeterSupport F → + x ∈ (volume.restrict F).support := by + intro F hF hxF + apply (Metric.nhds_basis_ball.mem_measureSupport (μ := volume.restrict F)).mpr + intro r hr + apply pos_iff_ne_zero.mpr + intro hz + rw [Measure.restrict_apply measurableSet_ball, inter_comm] at hz + have hpz := raw_perimeter_eq_zero_of_volume_inter_eq_zero measurableSet_ball hz + exact (hxF r hr).ne' hpz + exact ⟨hphase E hE hx, hphase Eᶜ hE.compl + (by simpa only [perimeterSupport_compl hE] using hx)⟩ + · rintro ⟨hxE, hxEc⟩ r hr + apply pos_iff_ne_zero.mpr + intro hpz + rcases volume_inter_eq_zero_or_compl_of_perimeter_eq_zero hE x hr hpz with hz | hz + · have hpos := (Metric.nhds_basis_ball.mem_measureSupport (μ := volume.restrict E)).mp hxE + (r / 2) (by positivity) + rw [Measure.restrict_apply measurableSet_ball, inter_comm] at hpos + exact hpos.ne' hz + · have hpos := (Metric.nhds_basis_ball.mem_measureSupport (μ := volume.restrict Eᶜ)).mp hxEc + (r / 2) (by positivity) + rw [Measure.restrict_apply measurableSet_ball, inter_comm] at hpos + exact hpos.ne' hz + +theorem minimizing_frontier_phaseSupport {n : ℕ} {p : ℝ} + (hp : Real.HolderConjugate (n : ℝ) p) {E : Set (Euc n)} + (hmin : IsLocallyPerimeterMinimizing E) : + frontier (volume.restrict E).support = perimeterSupport E := by + let K : Set (Euc n) := (volume.restrict E).support + have hK : IsClosed K := Measure.isClosed_support + have hEK : E =ᵐ[volume] K := minimizing_ae_eq_phaseSupport hp hmin + have hEcKc : Eᶜ =ᵐ[volume] Kᶜ := by + apply Filter.eventuallyEqSet_iff.mpr + filter_upwards [hEK.mem_iff] with x hx + exact not_congr hx + have hKc : (volume.restrict Kᶜ).support = closure Kᶜ := by + apply le_antisymm (Measure.support_restrict_subset.trans inter_subset_left) + apply closure_minimal _ Measure.isClosed_support + intro x hx + apply Measure.interior_inter_support + exact ⟨(hK.isOpen_compl.interior_eq).symm ▸ hx, by rw [Measure.support_eq_univ]; trivial⟩ + have hμ : (volume : Measure (Euc n)).restrict Eᶜ = volume.restrict Kᶜ := + Measure.restrict_congr_set hEcKc + rw [perimeterSupport_eq_phaseSupport_inter hmin.1, hμ, hKc, + frontier_eq_closure_inter_closure, hK.closure_eq] + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack +open ContinuousLinearMap + +theorem chord_half_norm_sub_le {n : ℕ} {f : Euc n → ℝ} + (hf : ContDiff ℝ 1 f) (c x y : Euc n) {R : ℝ} + (hx : x ∈ Metric.closedBall c R) (hy : y ∈ Metric.closedBall c R) : + ‖f x - f ((1 / 2 : ℝ) • x + (1 / 2 : ℝ) • y)‖ ≤ + 2 * R * ∫ t in (1 / 2 : ℝ)..1, ‖fderiv ℝ f (t • x + (1 - t) • y)‖ := by + let z : ℝ → Euc n := fun t ↦ t • x + (1 - t) • y + have hz : ∀ t, HasDerivAt z (x - y) t := by + intro t + simpa [z, sub_eq_add_neg, Pi.add_def] using + ((hasDerivAt_id t).smul_const x).add + (((hasDerivAt_const t (1 : ℝ)).sub (hasDerivAt_id t)).smul_const y) + have hdf : ∀ t, HasDerivAt (fun t ↦ f (z t)) (fderiv ℝ f (z t) (x - y)) t := fun t ↦ + (hf.differentiable one_ne_zero (z t)).hasFDerivAt.comp_hasDerivAt t (hz t) + have hxy : ‖x - y‖ ≤ 2 * R := by + have hh := (dist_triangle x c y).trans (add_le_add (Metric.mem_closedBall.mp hx) + (by simpa only [dist_comm] using Metric.mem_closedBall.mp hy)) + simpa only [dist_eq_norm, two_mul] using hh + have hD : Continuous (fun t ↦ ‖fderiv ℝ f (z t)‖) := + ((hf.continuous_fderiv one_ne_zero).comp (by fun_prop)).norm + have hi := norm_sub_le_integral_of_norm_deriv_le_of_le (a := (1 / 2 : ℝ)) + (b := 1) (f := fun t ↦ f (z t)) (B := fun t ↦ 2 * R * ‖fderiv ℝ f (z t)‖) (by norm_num) + (hf.continuous.comp (by fun_prop)).continuousOn + (fun t _ ↦ (hdf t).differentiableAt.differentiableWithinAt) + (ae_of_all _ fun t _ ↦ by + rw [(hdf t).deriv] + exact ((fderiv ℝ f (z t)).le_opNorm (x - y)).trans + (by nlinarith [norm_nonneg (fderiv ℝ f (z t))])) + ((continuous_const.mul hD).intervalIntegrable _ _) + simpa only [z, Function.comp_def, one_smul, sub_self, zero_smul, add_zero, show (1 : ℝ) - 1 / 2 = 1 / 2 by norm_num, + intervalIntegral.integral_const_mul] using hi + +theorem chord_half_integral_le {n : ℕ} {G : Euc n → ℝ} + (hG : Continuous G) (hG0 : ∀ x, 0 ≤ G x) (c y : Euc n) {R t : ℝ} + (hy : y ∈ Metric.closedBall c R) (ht : t ∈ Icc (1 / 2 : ℝ) 1) : + (∫ x in Metric.closedBall c R, G (t • x + (1 - t) • y)) ≤ + 2 ^ n * ∫ x in Metric.closedBall c R, G x := by + let B := Metric.closedBall c R + let g : Euc n → ℝ := B.indicator G + have hg : Integrable g volume := + (integrable_indicator_iff measurableSet_closedBall).2 + (hG.continuousOn.integrableOn_compact (isCompact_closedBall c R)) + have hg0 : ∀ x, 0 ≤ g x := fun x ↦ indicator_nonneg (fun x _ ↦ hG0 x) x + have ht0 : 0 < t := lt_of_lt_of_le (by norm_num) ht.1 + have hga : Integrable (fun x ↦ g (t • x + (1 - t) • y)) volume := + (hg.comp_add_right ((1 - t) • y)).comp_smul ht0.ne' + have heq : ∀ x ∈ B, G (t • x + (1 - t) • y) = g (t • x + (1 - t) • y) := by + intro x hx + have hz : t • x + (1 - t) • y ∈ B := + (convex_closedBall c R) hx hy ht0.le (sub_nonneg.mpr ht.2) (by ring) + exact (indicator_of_mem hz G).symm + calc + (∫ x in B, G (t • x + (1 - t) • y)) = + ∫ x in B, g (t • x + (1 - t) • y) := + setIntegral_congr_fun measurableSet_closedBall heq + _ ≤ ∫ x, g (t • x + (1 - t) • y) := + setIntegral_le_integral hga (ae_of_all _ fun x ↦ hg0 _) + _ = (t ^ n)⁻¹ * ∫ x in B, G x := by + rw [Measure.integral_comp_smul_of_nonneg volume + (fun z ↦ g (z + (1 - t) • y)) t (hR := ht0.le)] + rw [integral_add_right_eq_self, integral_indicator measurableSet_closedBall] + simp only [Euc, finrank_euclideanSpace, Fintype.card_fin, smul_eq_mul, B] + _ ≤ 2 ^ n * ∫ x in B, G x := by + apply mul_le_mul_of_nonneg_right _ (integral_nonneg fun x ↦ hG0 x) + have hh : (t ^ n)⁻¹ ≤ ((1 / 2 : ℝ) ^ n)⁻¹ := + inv_anti₀ (pow_pos (by norm_num : (0 : ℝ) < 1 / 2) _) (pow_le_pow_left₀ (by norm_num) ht.1 _) + simpa only [inv_pow, one_div, inv_inv] using hh + +theorem integrated_chord_half_le {n : ℕ} {f : Euc n → ℝ} + (hf : ContDiff ℝ 1 f) (c y : Euc n) {R : ℝ} + (hy : y ∈ Metric.closedBall c R) : + (∫ x in Metric.closedBall c R, ‖f x - f ((1 / 2 : ℝ) • x + (1 / 2 : ℝ) • y)‖) ≤ + (2 * R) * (2 ^ n * ∫ x in Metric.closedBall c R, ‖fderiv ℝ f x‖) := by + let B := Metric.closedBall c R + let I := Icc (1 / 2 : ℝ) 1 + let G : Euc n → ℝ := fun x ↦ ‖fderiv ℝ f x‖ + let F : Euc n × ℝ → ℝ := fun p ↦ G (p.2 • p.1 + (1 - p.2) • y) + have hG : Continuous G := (hf.continuous_fderiv one_ne_zero).norm + have hF : Continuous F := hG.comp (by fun_prop) + have hiF : Integrable F ((volume.restrict B).prod (volume.restrict I)) := by + rw [Measure.prod_restrict] + exact hF.continuousOn.integrableOn_compact ((isCompact_closedBall c R).prod isCompact_Icc) + have hR : 0 ≤ 2 * R := by nlinarith [Metric.mem_closedBall.mp hy, dist_nonneg (x := y) (y := c)] + have hp : IntegrableOn + (fun x ↦ ‖f x - f ((1 / 2 : ℝ) • x + (1 / 2 : ℝ) • y)‖) B volume := + (hf.continuous.sub (hf.continuous.comp (by fun_prop))).norm.continuousOn.integrableOn_compact + (isCompact_closedBall c R) + calc + _ ≤ ∫ x in B, (2 * R) * ∫ t in I, F (x, t) := by + apply setIntegral_mono_on hp (hiF.integral_prod_left.const_mul _) measurableSet_closedBall + intro x hx + have hh := chord_half_norm_sub_le hf c x y hx hy + rw [intervalIntegral.integral_of_le (by norm_num : (1 / 2 : ℝ) ≤ 1), + ← integral_Icc_eq_integral_Ioc] at hh + exact hh + _ = (2 * R) * ∫ t in I, ∫ x in B, F (x, t) := by + rw [integral_const_mul, integral_integral_swap hiF] + _ ≤ (2 * R) * (2 ^ n * ∫ x in B, G x) := by + apply mul_le_mul_of_nonneg_left _ hR + have hh : (∫ t in I, ∫ x in B, F (x, t)) ≤ + ∫ _t in I, (2 : ℝ) ^ n * ∫ x in B, G x := by + apply setIntegral_mono_on hiF.integral_prod_right continuous_const.integrableOn_Icc measurableSet_Icc + intro t ht + exact chord_half_integral_le hG (fun x ↦ norm_nonneg _) c y hy ht + calc + _ ≤ _ := hh + _ ≤ (2 : ℝ) ^ n * ∫ x in B, G x := by + rw [integral_const, measureReal_restrict_apply_univ, smul_eq_mul] + have hvol : (volume I).toReal ≤ 1 := by + norm_num [I, Real.volume_Icc] + change (volume I).toReal * _ ≤ _ + nlinarith [mul_nonneg (pow_nonneg (by norm_num : (0 : ℝ) ≤ 2) n) + (integral_nonneg (μ := volume.restrict B) (fun x ↦ norm_nonneg (fderiv ℝ f x))), measureReal_nonneg (μ := volume) (s := I)] + +theorem smooth_ball_poincare {n : ℕ} {f : Euc n → ℝ} + (hf : ContDiff ℝ 1 f) (c : Euc n) {R : ℝ} (hR : 0 < R) : + (∫ p, ‖f p.1 - f p.2‖ ∂((volume.restrict (Metric.closedBall c R)).prod + (volume.restrict (Metric.closedBall c R)))) ≤ + 4 * R * volume.real (Metric.closedBall c R) * + (2 ^ n * ∫ x in Metric.closedBall c R, ‖fderiv ℝ f x‖) := by + let B := Metric.closedBall c R + let H : Euc n × Euc n → ℝ := fun p ↦ + ‖f p.1 - f ((1 / 2 : ℝ) • p.1 + (1 / 2 : ℝ) • p.2)‖ + have hHc : Continuous H := (hf.continuous.comp continuous_fst |>.sub + (hf.continuous.comp (by fun_prop))).norm + have hHi : Integrable H ((volume.restrict B).prod (volume.restrict B)) := by + rw [Measure.prod_restrict] + exact hHc.continuousOn.integrableOn_compact + ((isCompact_closedBall c R).prod (isCompact_closedBall c R)) + have hDi : Integrable (fun p : Euc n × Euc n ↦ ‖f p.1 - f p.2‖) + ((volume.restrict B).prod (volume.restrict B)) := by + rw [Measure.prod_restrict] + exact ((hf.continuous.comp continuous_fst).sub + (hf.continuous.comp continuous_snd)).norm.continuousOn.integrableOn_compact + ((isCompact_closedBall c R).prod (isCompact_closedBall c R)) + have hbound : (∫ p, H p ∂((volume.restrict B).prod (volume.restrict B))) ≤ + volume.real B * ((2 * R) * (2 ^ n * ∫ x in B, ‖fderiv ℝ f x‖)) := by + rw [integral_prod_symm H hHi] + calc + _ ≤ ∫ _y in B, (2 * R) * (2 ^ n * ∫ x in B, ‖fderiv ℝ f x‖) := by + apply setIntegral_mono_on hHi.integral_prod_right + (integrableOn_const (isCompact_closedBall c R).measure_ne_top) measurableSet_closedBall + exact fun y hy ↦ integrated_chord_half_le hf c y hy + _ = _ := by rw [integral_const, measureReal_restrict_apply_univ, smul_eq_mul] + have htri : ∀ p : Euc n × Euc n, ‖f p.1 - f p.2‖ ≤ H p + H p.swap := by + intro p + simpa only [H, Prod.fst_swap, Prod.snd_swap, add_comm ((1 / 2 : ℝ) • p.2), norm_sub_rev] using + (norm_sub_le_norm_sub_add_norm_sub (f p.1) (f ((1 / 2 : ℝ) • p.1 + (1 / 2 : ℝ) • p.2)) (f p.2)) + calc + _ ≤ ∫ p, H p + H p.swap ∂((volume.restrict B).prod (volume.restrict B)) := + integral_mono hDi (hHi.add hHi.swap) htri + _ = 2 * ∫ p, H p ∂((volume.restrict B).prod (volume.restrict B)) := by + calc + _ = (∫ p, H p ∂((volume.restrict B).prod (volume.restrict B))) + + ∫ p, (H ∘ Prod.swap) p ∂((volume.restrict B).prod (volume.restrict B)) := + integral_add hHi hHi.swap + _ = _ := by simp only [Function.comp_def, integral_prod_swap]; ring + _ ≤ 2 * (volume.real B * ((2 * R) * (2 ^ n * ∫ x in B, ‖fderiv ℝ f x‖))) := by + apply (mul_le_mul_iff_right₀ hR).mp + nlinarith [mul_le_mul_of_nonneg_right hbound hR.le] + _ = _ := by ring + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/IntegralInnerEqInnerToLp.lean b/lean/OAI/Geometry/Perimeter/Regularity/IntegralInnerEqInnerToLp.lean new file mode 100644 index 0000000000000000000000000000000000000000..99f9d816b27028e24f98968e519c9847abb4cdb0 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/IntegralInnerEqInnerToLp.lean @@ -0,0 +1,385 @@ +import OAI.Geometry.Perimeter.Regularity.SurfaceGradientComp + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPI + +section CutoffTests +variable {X V : Type*} [MeasurableSpace X] +variable [NormedAddCommGroup V] [InnerProductSpace ℝ V] +variable {μ : Measure X} + +theorem integral_inner_eq_inner_toLp {G B : X → V} + (hG : MemLp G 2 μ) (hB : MemLp B 2 μ) : + (∫ x, inner ℝ (G x) (B x) ∂μ) = inner ℝ (hG.toLp G) (hB.toLp B) := by + rw [L2.inner_def] + apply integral_congr_ae + filter_upwards [hG.coeFn_toLp, hB.coeFn_toLp] with x hx hy + rw [hx, hy] + +theorem integrable_inner_of_memLp {G B : X → V} + (hG : MemLp G 2 μ) (hB : MemLp B 2 μ) : + Integrable (fun x ↦ inner ℝ (G x) (B x)) μ := by + apply (L2.integrable_inner (𝕜 := ℝ) (hG.toLp G) (hB.toLp B)).congr + filter_upwards [hG.coeFn_toLp, hB.coeFn_toLp] with x hx hy + rw [hx, hy] + +theorem tendsto_integral_inner_of_L2_zero {G : X → V} (hG : MemLp G 2 μ) + (C : ℕ → X → V) (hC : ∀ i, MemLp (C i) 2 μ) + (hC0 : Tendsto (fun i ↦ (eLpNorm (C i) 2 μ).toReal) atTop (𝓝 0)) : + Tendsto (fun i ↦ ∫ x, inner ℝ (G x) (C i x) ∂μ) atTop (𝓝 0) := by + have hClim : Tendsto (fun i ↦ (hC i).toLp (C i)) atTop + (𝓝 (0 : Lp V 2 μ)) := by + apply tendsto_iff_norm_sub_tendsto_zero.mpr + simpa only [sub_zero, Lp.norm_toLp] using hC0 + have hlim := Filter.Tendsto.inner (𝕜 := ℝ) (tendsto_const_nhds (x := hG.toLp G)) hClim + simp only [inner_zero_right] at hlim + convert hlim using 1 + ext i + exact integral_inner_eq_inner_toLp hG (hC i) + +theorem energy_inequality_of_capacity_cutoffs + {G B : X → V} (hG : MemLp G 2 μ) (hB : MemLp B 2 μ) + (χ : ℕ → X → ℝ) (hχ : ∀ i, AEStronglyMeasurable (χ i) μ) + (hχbound : ∀ i, ∀ᵐ x ∂μ, ‖χ i x‖ ≤ 1) + (hχlim : ∀ᵐ x ∂μ, Tendsto (fun i ↦ χ i x) atTop (𝓝 1)) + (C : ℕ → X → V) (hC : ∀ i, MemLp (C i) 2 μ) + (hC0 : Tendsto (fun i ↦ (eLpNorm (C i) 2 μ).toReal) atTop (𝓝 0)) + (φ : X → ℝ) (hφ : AEStronglyMeasurable φ μ) + {M : ℝ} (hφbound : ∀ᵐ x ∂μ, ‖φ x‖ ≤ M) + (htest : ∀ i, 0 ≤ ∫ x, inner ℝ (G x) (χ i x • B x + φ x • C i x) ∂μ) : + 0 ≤ ∫ x, inner ℝ (G x) (B x) ∂μ := by + let b : X → ℝ := fun x ↦ inner ℝ (G x) (B x) + have hb : Integrable b μ := integrable_inner_of_memLp hG hB + have hmainlim : Tendsto (fun i ↦ ∫ x, χ i x * b x ∂μ) atTop (𝓝 (∫ x, b x ∂μ)) := by + apply tendsto_integral_of_dominated_convergence (fun x ↦ ‖b x‖) + · intro i + exact (hχ i).mul hb.aestronglyMeasurable + · exact hb.norm + · intro i + filter_upwards [hχbound i] with x hx + rw [norm_mul] + exact mul_le_of_le_one_left (norm_nonneg _) hx + · filter_upwards [hχlim] with x hx + simpa only [one_mul] using hx.mul_const (b x) + have hφG : MemLp (fun x ↦ φ x • G x) 2 μ := by + apply hG.of_le_mul (c := M) (hφ.smul hG.aestronglyMeasurable) + filter_upwards [hφbound] with x hx + change ‖φ x • G x‖ ≤ M * ‖G x‖ + rw [norm_smul] + exact mul_le_mul_of_nonneg_right hx (norm_nonneg _) + have herrlim : Tendsto (fun i ↦ ∫ x, φ x * inner ℝ (G x) (C i x) ∂μ) + atTop (𝓝 0) := by + simpa only [real_inner_smul_left] using tendsto_integral_inner_of_L2_zero hφG C hC hC0 + have hsumlim := hmainlim.add herrlim + rw [add_zero] at hsumlim + apply ge_of_tendsto hsumlim + apply Filter.Eventually.of_forall + intro i + have hm : Integrable (fun x ↦ χ i x * b x) μ := hb.bdd_mul (hχ i) (hχbound i) + have he : Integrable (fun x ↦ φ x * inner ℝ (G x) (C i x)) μ := + (integrable_inner_of_memLp hG (hC i)).bdd_mul hφ hφbound + rw [← integral_add hm he] + simpa only [inner_add_right, real_inner_smul_right, b] using htest i + +end CutoffTests +end RPI + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPI.Boundary + +theorem surfaceGradient_memLp_on_ball {n : ℕ} {S : Set (Space n)} + {R : ℝ} [IsFiniteMeasure ((surfaceMeasure S).restrict (Metric.ball 0 R))] + {φ : Space n → ℝ} (hφ : ContDiff ℝ ∞ φ) + (hm : AEStronglyMeasurable (surfaceGradient S φ) + ((surfaceMeasure S).restrict (Metric.ball 0 R))) : + MemLp (surfaceGradient S φ) 2 ((surfaceMeasure S).restrict (Metric.ball 0 R)) := by + have hc : Continuous (gradient φ) := continuous_iff_continuousAt.mpr (fun x ↦ + continuousAt_gradient_of_contDiffAt (hφ.of_le (by norm_num)).contDiffAt) + obtain ⟨M, hM⟩ := (isCompact_closedBall (0 : Space n) R).exists_bound_of_continuousOn + hc.continuousOn + apply MemLp.of_bound hm M + filter_upwards [ae_restrict_mem measurableSet_ball] with x hx + calc + ‖surfaceGradient S φ x‖ ≤ ‖gradient φ x‖ := by + calc + _ ≤ ‖(tangentPlane S x).orthogonalProjectionOnto‖ * ‖gradient φ x‖ := + (tangentPlane S x).orthogonalProjectionOnto.le_opNorm _ + _ ≤ 1 * ‖gradient φ x‖ := mul_le_mul_of_nonneg_right + (tangentPlane S x).orthogonalProjectionOnto_norm_le (norm_nonneg _) + _ = _ := one_mul _ + _ ≤ M := hM x (Metric.ball_subset_closedBall hx) + +theorem surfaceGradient_eq_zero_of_notMem_tsupport {n : ℕ} (S : Set (Space n)) + {φ : Space n → ℝ} {x : Space n} (hx : x ∉ tsupport φ) : + surfaceGradient S φ x = 0 := by + simp only [surfaceGradient, gradient, fderiv_of_notMem_tsupport ℝ hx, map_zero, + Submodule.coe_zero] + +theorem tsupport_mul_disjoint_Singular {n : ℕ} {Z : Set (Space n)} + {φ χ : Space n → ℝ} + (hzero : ∃ U : Set (Space n), IsOpen U ∧ Z ∩ tsupport φ ⊆ U ∧ ∀ x ∈ U, χ x = 0) : + Disjoint (tsupport (fun x ↦ φ x * χ x)) Z := by + obtain ⟨U, hU, hZU, he⟩ := hzero + apply Set.disjoint_left.mpr + intro x hx hxZ + have hxφ : x ∈ tsupport φ := tsupport_mul_subset_left hx + have heq : (fun x ↦ φ x * χ x) =ᶠ[𝓝 x] (0 : Space n → ℝ) := by + filter_upwards [hU.mem_nhds (hZU ⟨hxZ, hxφ⟩)] with y hy + simp only [he y hy, mul_zero, Pi.zero_apply] + exact (notMem_tsupport_iff_eventuallyEq.mpr heq) hx + +theorem full_test_of_regular_tests {n : ℕ} (hn : 8 ≤ n) + {S Z : Set (Space n)} (hZ : IsClosed Z) (hZd : dimH Z ≤ (n - 8 : ℕ)) + {G : Space n → Space n} + (hloc : ∀ R : ℝ, 0 < R → MemLp G 2 ((surfaceMeasure S).restrict (Metric.ball 0 R))) + (hfinite : ∀ R : ℝ, 0 < R → (surfaceMeasure S) (Metric.ball 0 R) < ⊤) + (hgrad : ∀ φ : Space n → ℝ, ContDiff ℝ ∞ φ → + AEStronglyMeasurable (surfaceGradient S φ) (surfaceMeasure S)) + (hgrowth : ∀ R : ℝ, 0 < R → ∃ A r₀ : ℝ, 0 < A ∧ 0 < r₀ ∧ + ∀ c ∈ Z ∩ Metric.closedBall 0 R, ∀ r : ℝ, 0 < r → r < r₀ → + (surfaceMeasure S).restrict (Metric.ball 0 R) (Metric.ball c r) ≤ + ENNReal.ofReal (A * r ^ (n - 1))) + (hreg : ∀ ψ : Space n → ℝ, ContDiff ℝ ∞ ψ → HasCompactSupport ψ → + Disjoint (tsupport ψ) Z → (∀ x, 0 ≤ ψ x) → + 0 ≤ ∫ x, inner ℝ (G x) (surfaceGradient S ψ x) ∂surfaceMeasure S) + {φ : Space n → ℝ} (hφ : ContDiff ℝ ∞ φ) (hcφ : HasCompactSupport φ) + (hpφ : ∀ x, 0 ≤ φ x) : + 0 ≤ ∫ x, inner ℝ (G x) (surfaceGradient S φ x) ∂surfaceMeasure S := by + obtain ⟨r, hr⟩ := Metric.isBounded_iff_subset_ball (0 : Space n) |>.mp hcφ.isBounded + let R := max r 1 + have hR : 0 < R := lt_of_lt_of_le zero_lt_one (le_max_right _ _) + have hsupp : tsupport φ ⊆ Metric.ball (0 : Space n) R := + hr.trans (Metric.ball_subset_ball (le_max_left _ _)) + let μ := (surfaceMeasure S).restrict (Metric.ball 0 R) + let : IsFiniteMeasure μ := ⟨by simpa only [μ, Measure.restrict_apply_univ] using hfinite R hR⟩ + let K := Z ∩ tsupport φ + have hKc : IsCompact K := hcφ.of_isClosed_subset + (hZ.inter (isClosed_tsupport φ)) inter_subset_right + have hKd : dimH K ≤ (n - 8 : ℕ) := (dimH_mono inter_subset_left).trans hZd + obtain ⟨A, r₀, hA, hr₀, hgr⟩ := hgrowth R hR + obtain ⟨χ, hχ, hχlim, hχE⟩ := exists_memLp_capacity_sequence hn S (Metric.ball 0 R) K + hKc hKd (fun f hf ↦ (hgrad f hf).mono_measure Measure.restrict_le_self) hA hr₀ + (fun c hc s hs hsr ↦ hgr c ⟨hc.1, Metric.ball_subset_closedBall (hsupp hc.2)⟩ s hs hsr) + have hB : MemLp (surfaceGradient S φ) 2 μ := surfaceGradient_memLp_on_ball hφ + ((hgrad φ hφ).mono_measure Measure.restrict_le_self) + have hC0 : Tendsto (fun i ↦ (eLpNorm (surfaceGradient S (χ i)) 2 μ).toReal) + atTop (𝓝 0) := tendsto_eLpNorm_two_toReal_of_vectorEnergy_zero_of_aestronglyMeasurable + (fun i ↦ (hχ i).2.2.2.aestronglyMeasurable) hχE + obtain ⟨M, hM⟩ := hcφ.exists_bound_of_continuous hφ.continuous + have htesteq : ∀ i, (fun x ↦ χ i x • surfaceGradient S φ x + φ x • surfaceGradient S (χ i) x) = + surfaceGradient S (fun x ↦ φ x * χ i x) := by + intro i + ext x + rw [surfaceGradient_mul (hφ.differentiable (by simp) x) + ((hχ i).1.differentiable (by simp) x), add_comm] + have hnonsupp : ∀ x, x ∉ Metric.ball (0 : Space n) R → surfaceGradient S φ x = 0 := + fun x hx ↦ surfaceGradient_eq_zero_of_notMem_tsupport S (fun h ↦ hx (hsupp h)) + have hχnorm : ∀ i, ∀ᵐ x ∂μ, ‖χ i x‖ ≤ 1 := by + intro i + apply ae_of_all + intro x + rw [Real.norm_eq_abs, abs_of_nonneg ((hχ i).2.1 x).1] + exact ((hχ i).2.1 x).2 + have hpair : 0 ≤ ∫ x, inner ℝ (G x) (surfaceGradient S φ x) ∂μ := by + apply energy_inequality_of_capacity_cutoffs (hloc R hR) hB χ + (fun i ↦ (hχ i).1.continuous.aestronglyMeasurable) hχnorm hχlim + (fun i ↦ surfaceGradient S (χ i)) (fun i ↦ (hχ i).2.2.2) hC0 + φ hφ.continuous.aestronglyMeasurable (M := M) (ae_of_all _ hM) + intro i + simp_rw [congrFun (htesteq i)] + rw [setIntegral_eq_integral_of_forall_compl_eq_zero] + · exact hreg _ (hφ.mul (hχ i).1) hcφ.mul_right + (tsupport_mul_disjoint_Singular (hχ i).2.2.1) + (fun x ↦ mul_nonneg (hpφ x) ((hχ i).2.1 x).1) + · intro x hx + rw [surfaceGradient_eq_zero_of_notMem_tsupport S + (fun hx' ↦ hx (hsupp (tsupport_mul_subset_left hx'))), inner_zero_right] + dsimp only [μ] at hpair + rwa [setIntegral_eq_integral_of_forall_compl_eq_zero + (fun x hx ↦ by rw [hnonsupp x hx, inner_zero_right])] at hpair + +end RPI.Boundary + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPI.Boundary + +theorem exists_smooth_representative_near_regular_test {n : ℕ} {S Z : Set (Space n)} + (hS : IsClosed S) (hZ : IsClosed Z) {W : Space n → ℝ} {D : Space n → Space n} + (htrace : ∀ x ∈ S \ Z, HasSmoothTraceJetAt S W D x) + {K : Set (Space n)} (hK : IsClosed K) (hKZ : Disjoint K Z) : + ∃ F : Space n → ℝ, ContDiff ℝ ∞ F ∧ + (∀ x ∈ S ∩ K, F x = W x ∧ surfaceGradient S F x = D x) := by + obtain ⟨σ, hσ0, hσ1, _⟩ := exists_contMDiffMap_zero_one_nhds_of_isClosed + (modelWithCornersSelf ℝ (Space n)) hZ hK hKZ.symm (n := (⊤ : ℕ∞)) + have hσ : ContDiff ℝ ∞ σ := σ.contMDiff.contDiff + obtain ⟨U, hU, hUZ, hUσ⟩ := mem_nhdsSet_iff_exists.mp hσ0 + obtain ⟨F, hF, hFW, hFD⟩ := exists_smooth_cutoff_trace hS htrace σ hσ + ⟨U, hU, hUZ, hUσ⟩ + refine ⟨F, hF, ?_⟩ + intro x hx + have hσx : σ x = 1 := hσ1.self_of_nhdsSet x hx.2 + have hσnear : (σ : Space n → ℝ) =ᶠ[𝓝 x] (fun _ ↦ (1 : ℝ)) := + hσ1.filter_mono (nhds_le_nhdsSet hx.2) + have hσg : surfaceGradient S σ x = 0 := by + have hg : gradient (σ : Space n → ℝ) x = 0 := by + simpa only [gradient_fun_const] using hσnear.gradient_eq + simp only [surfaceGradient, hg, map_zero, Submodule.coe_zero] + exact ⟨by simpa only [hσx, one_mul] using hFW hx.1, + by simpa only [hσx, one_smul, hσg, smul_zero, add_zero] using hFD hx.1⟩ + +end RPI.Boundary + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPI.Boundary +section RegularTests +variable {n : ℕ} {S Z : Set (Space n)} +variable (hS : IsClosed S) (hZ : IsClosed Z) +variable (hfinite : ∀ R : ℝ, 0 < R → (surfaceMeasure S) (Metric.ball 0 R) < ⊤) +variable (hgrad : ∀ f : Space n → ℝ, ContDiff ℝ ∞ f → + AEStronglyMeasurable (surfaceGradient S f) (surfaceMeasure S)) + +include hfinite hgrad + +theorem surfaceGradient_memLp_of_compact {φ : Space n → ℝ} + (hφ : ContDiff ℝ ∞ φ) (hcφ : HasCompactSupport φ) : + MemLp (surfaceGradient S φ) 2 (surfaceMeasure S) := by + obtain ⟨r, hr⟩ := Metric.isBounded_iff_subset_ball (0 : Space n) |>.mp hcφ.isBounded + let R := max r 1 + have hR : 0 < R := lt_of_lt_of_le zero_lt_one (le_max_right _ _) + have hsupp : tsupport φ ⊆ Metric.ball (0 : Space n) R := + hr.trans (Metric.ball_subset_ball (le_max_left _ _)) + let : IsFiniteMeasure ((surfaceMeasure S).restrict (Metric.ball 0 R)) := + ⟨by simpa only [Measure.restrict_apply_univ] using hfinite R hR⟩ + have hloc := surfaceGradient_memLp_on_ball (R := R) hφ + ((hgrad φ hφ).mono_measure Measure.restrict_le_self) + have hh := (memLp_indicator_iff_restrict measurableSet_ball).mpr hloc + apply hh.ae_eq + apply ae_of_all + intro x + by_cases hx : x ∈ Metric.ball (0 : Space n) R + · simp only [indicator_of_mem hx] + · simp only [indicator_of_notMem hx] + exact (surfaceGradient_eq_zero_of_notMem_tsupport S (fun h ↦ hx (hsupp h))).symm + +include hS hZ + +theorem regular_gradient_memLp_indicator_test {W : Space n → ℝ} {D : Space n → Space n} + (htrace : ∀ x ∈ S \ Z, HasSmoothTraceJetAt S W D x) + {φ : Space n → ℝ} (hcφ : HasCompactSupport φ) (hφZ : Disjoint (tsupport φ) Z) : + MemLp ((tsupport φ).indicator D) 2 (surfaceMeasure S) := by + obtain ⟨F, hF, he⟩ := exists_smooth_representative_near_regular_test hS hZ htrace + (isClosed_tsupport φ) hφZ + obtain ⟨r, hr⟩ := Metric.isBounded_iff_subset_ball (0 : Space n) |>.mp hcφ.isBounded + let R := max r 1 + have hR : 0 < R := lt_of_lt_of_le zero_lt_one (le_max_right _ _) + have hsupp : tsupport φ ⊆ Metric.ball (0 : Space n) R := + hr.trans (Metric.ball_subset_ball (le_max_left _ _)) + let : IsFiniteMeasure ((surfaceMeasure S).restrict (Metric.ball 0 R)) := + ⟨by simpa only [Measure.restrict_apply_univ] using hfinite R hR⟩ + have hloc : MemLp (surfaceGradient S F) 2 ((surfaceMeasure S).restrict (tsupport φ)) := + (surfaceGradient_memLp_on_ball (R := R) hF ((hgrad F hF).mono_measure Measure.restrict_le_self)).mono_measure + (Measure.restrict_mono_set _ hsupp) + apply ((memLp_indicator_iff_restrict (isClosed_tsupport φ).measurableSet).mpr hloc).ae_eq + filter_upwards [ae_restrict_mem hS.measurableSet] with x hx + by_cases hxt : x ∈ tsupport φ + · simp only [indicator_of_mem hxt, (he x ⟨hx, hxt⟩).2] + · simp only [indicator_of_notMem hxt] + +theorem integrable_regular_test_pair {W : Space n → ℝ} {D : Space n → Space n} + (htrace : ∀ x ∈ S \ Z, HasSmoothTraceJetAt S W D x) + {φ : Space n → ℝ} (hφ : ContDiff ℝ ∞ φ) (hcφ : HasCompactSupport φ) + (hφZ : Disjoint (tsupport φ) Z) : + Integrable (fun x ↦ inner ℝ (D x) (surfaceGradient S φ x)) (surfaceMeasure S) := by + have hD := regular_gradient_memLp_indicator_test hS hZ hfinite hgrad htrace hcφ hφZ + have hB := surfaceGradient_memLp_of_compact hfinite hgrad hφ hcφ + apply (integrable_inner_of_memLp hD hB).congr + apply ae_of_all + intro x + by_cases hxt : x ∈ tsupport φ + · simp only [indicator_of_mem hxt] + · simp only [indicator_of_notMem hxt, surfaceGradient_eq_zero_of_notMem_tsupport S hxt, + inner_zero_right] + +theorem smoothTruncation_regular_test {W : Space n → ℝ} {D : Space n → Space n} + (htrace : ∀ x ∈ S \ Z, HasSmoothTraceJetAt S W D x) + (hsup : ∀ φ : Space n → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → + Disjoint (tsupport φ) Z → (∀ x, 0 ≤ φ x) → + 0 ≤ ∫ x, inner ℝ (D x) (surfaceGradient S φ x) ∂surfaceMeasure S) + {ε : ℝ} (hε : 0 < ε) {φ : Space n → ℝ} + (hφ : ContDiff ℝ ∞ φ) (hcφ : HasCompactSupport φ) + (hφZ : Disjoint (tsupport φ) Z) (hpφ : ∀ x, 0 ≤ φ x) : + 0 ≤ ∫ x, inner ℝ (truncationSlope ε (W x) • D x) + (surfaceGradient S φ x) ∂surfaceMeasure S := by + obtain ⟨F, hF, he⟩ := exists_smooth_representative_near_regular_test hS hZ htrace + (isClosed_tsupport φ) hφZ + let ψ : Space n → ℝ := fun x ↦ φ x * truncationSlope ε (F x) + have hψ : ContDiff ℝ ∞ ψ := hφ.mul ((truncationSlope_contDiff ε).comp hF) + have hcψ : HasCompactSupport ψ := hcφ.mul_right + have hψZ : Disjoint (tsupport ψ) Z := hφZ.mono_left tsupport_mul_subset_left + have htt : ∀ x ∈ S \ Z, HasSmoothTraceJetAt S (smoothTruncation ε ∘ W) + (fun y ↦ truncationSlope ε (W y) • D y) x := by + intro x hx + simpa only [smoothTruncation_deriv] using + (htrace x hx).comp hx.1 (smoothTruncation_contDiff ε) + have hi := integrable_regular_test_pair hS hZ hfinite hgrad htrace hψ hcψ hψZ + have hj := integrable_regular_test_pair hS hZ hfinite hgrad htt hφ hcφ hφZ + apply (hsup ψ hψ hcψ hψZ (fun x ↦ mul_nonneg (hpφ x) + (truncationSlope_mem_Icc ε (F x)).1)).trans + apply integral_mono_ae hi hj + filter_upwards [ae_restrict_mem hS.measurableSet] with x hx + by_cases hxt : x ∈ tsupport φ + · have hFx := he x ⟨hx, hxt⟩ + have hDp : deriv (truncationSlope ε) (W x) ≤ 0 := + (truncationSlope_antitone hε).deriv_nonpos + have heq : surfaceGradient S ψ x = + φ x • (deriv (truncationSlope ε) (W x) • D x) + + truncationSlope ε (W x) • surfaceGradient S φ x := by + dsimp only [ψ] + rw [surfaceGradient_mul (S := S) (g := fun y ↦ truncationSlope ε (F y)) (hφ.differentiable (by simp) x) + (((truncationSlope_contDiff ε).comp hF).differentiable (by simp) x)] + rw [show (fun y ↦ truncationSlope ε (F y)) = truncationSlope ε ∘ F from rfl, + surfaceGradient_comp (hF.differentiable (by simp) x) + ((truncationSlope_contDiff ε).differentiable (by simp) (F x)), hFx.1, hFx.2] + rw [heq, inner_add_right, real_inner_smul_right, real_inner_smul_right, + real_inner_smul_right, real_inner_smul_left, real_inner_self_eq_norm_sq] + have hneg : φ x * (deriv (truncationSlope ε) (W x) * ‖D x‖ ^ 2) ≤ 0 := + mul_nonpos_of_nonneg_of_nonpos (hpφ x) (mul_nonpos_of_nonpos_of_nonneg hDp (sq_nonneg _)) + linarith + · have hxψ : x ∉ tsupport ψ := fun h ↦ hxt (tsupport_mul_subset_left h) + simp only [surfaceGradient_eq_zero_of_notMem_tsupport S hxt, + surfaceGradient_eq_zero_of_notMem_tsupport S hxψ, inner_zero_right, le_refl] + +end RegularTests +end RPI.Boundary + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/IsConeMemPosTangentCone.lean b/lean/OAI/Geometry/Perimeter/Regularity/IsConeMemPosTangentCone.lean new file mode 100644 index 0000000000000000000000000000000000000000..7020f89c60a3e04e711342d60fd12b2d0f24f0f5 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/IsConeMemPosTangentCone.lean @@ -0,0 +1,60 @@ +import OAI.Geometry.Perimeter.Regularity.ConeRadialCap +import OAI.Geometry.Perimeter.Regularity.GeoComposition + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +namespace RPISingularHarnack + +theorem isCone_mem_posTangentCone {n : ℕ} {S : Set (Euc n)} + (hcone : IsCone S) {x : Euc n} (hx : x ∈ S) : + x ∈ posTangentConeAt S (0 : Euc n) := by + apply mem_posTangentConeAt_of_frequently_mem + apply Filter.Eventually.frequently + filter_upwards [self_mem_nhdsWithin] with r hr + simpa only [zero_add] using (hcone r hr x).mpr hx + +theorem minimizing_cone_supporting_fderiv_eq_zero {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (hcone : IsCone E) {f : Euc n → ℝ} + (hf : DifferentiableAt ℝ f (0 : Euc n)) + (hmax : IsLocalMaxOn f (perimeterSupport E) (0 : Euc n)) : + ∀ x ∈ perimeterSupport E, fderiv ℝ f (0 : Euc n) x = 0 := by + have hc := isCone_perimeterSupport hmin.1 hcone + have hneg (x : Euc n) (hx : x ∈ perimeterSupport E) : + fderiv ℝ f (0 : Euc n) x ≤ 0 := + hmax.hasFDerivWithinAt_nonpos hf.hasFDerivAt.hasFDerivWithinAt + (isCone_mem_posTangentCone hc hx) + have hside : ∀ x ∈ perimeterSupport E, + 0 ≤ inner ℝ x (-gradient f (0 : Euc n)) := by + intro x hx + rw [inner_neg_right, real_inner_comm, inner_gradient_left] + linarith [hneg x hx] + have hzero := minimizing_cone_support_in_halfspace_plane hn hmin hcone + (-gradient f (0 : Euc n)) hside + intro x hx + have hh := hzero x hx + rw [inner_neg_right, real_inner_comm, inner_gradient_left] at hh + linarith + +theorem minimizing_cone_supporting_fderiv_zero_of_span {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (hcone : IsCone E) (hspan : Submodule.span ℝ (perimeterSupport E) = ⊤) + {f : Euc n → ℝ} (hf : DifferentiableAt ℝ f (0 : Euc n)) + (hmax : IsLocalMaxOn f (perimeterSupport E) (0 : Euc n)) : + fderiv ℝ f (0 : Euc n) = 0 := by + have hz := minimizing_cone_supporting_fderiv_eq_zero hn hmin hcone hf hmax + have hker : Submodule.span ℝ (perimeterSupport E) ≤ + LinearMap.ker (fderiv ℝ f (0 : Euc n)).toLinearMap := + Submodule.span_le.mpr hz + rw [hspan] at hker + ext x + exact hker (by trivial) + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/IsometricMinimizer.lean b/lean/OAI/Geometry/Perimeter/Regularity/IsometricMinimizer.lean new file mode 100644 index 0000000000000000000000000000000000000000..e57ee10f1d46e3ee94b452a13f5d0373cd67b2f7 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/IsometricMinimizer.lean @@ -0,0 +1,119 @@ +import OAI.Geometry.Perimeter.Regularity.PlaneLaplacian + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +open RPI.Boundary ContinuousLinearMap +variable {n : ℕ} + +def isometricPullbackField (e : Euc n ≃ₗᵢ[ℝ] Euc n) (V : Euc n → Euc n) : Euc n → Euc n := + fun x ↦ e.symm (V (e x)) + +theorem divergence_isometricPullback (e : Euc n ≃ₗᵢ[ℝ] Euc n) + {V : Euc n → Euc n} (hV : Differentiable ℝ V) (x : Euc n) : + divergence (isometricPullbackField e V) x = divergence V (e x) := by + have hd : fderiv ℝ (isometricPullbackField e V) x = + e.symm.toContinuousLinearEquiv.toContinuousLinearMap.comp + ((fderiv ℝ V (e x)).comp e.toContinuousLinearEquiv.toContinuousLinearMap) := + (e.symm.hasFDerivAt.comp x ((hV (e x)).hasFDerivAt.comp x e.hasFDerivAt)).fderiv + rw [divergence_eq_trace,hd,divergence_eq_trace] + change LinearMap.trace ℝ (Euc n) (e.symm.toLinearMap.comp + ((fderiv ℝ V (e x)).toLinearMap.comp e.toLinearMap)) = _ + rw [LinearMap.trace_comp_comm',LinearMap.comp_assoc] + have he : e.toLinearMap.comp e.symm.toLinearMap = LinearMap.id := by + apply LinearMap.ext + intro z + exact e.apply_symm_apply z + rw [he,LinearMap.comp_id] + +theorem admissible_isometricPullback (e : Euc n ≃ₗᵢ[ℝ] Euc n) + {V : Euc n → Euc n} {U : Set (Euc n)} (hV : PerimeterAdmissible U V) : + PerimeterAdmissible (e ⁻¹' U) (isometricPullbackField e V) := by + refine ⟨e.symm.contDiff.comp (hV.1.comp e.contDiff), + (hV.2.1.comp_homeomorph e.toHomeomorph).comp_left (map_zero e.symm), ?_, ?_⟩ + · have hs : tsupport (isometricPullbackField e V) ⊆ tsupport (V ∘ e) := by + apply closure_mono + intro x hx + contrapose! hx + simp only [Function.mem_support, not_not] at hx ⊢ + change e.symm (V (e x))=0 + rw [show V (e x)=0 from hx,map_zero] + exact hs.trans ((tsupport_comp_subset_preimage V e.continuous).trans + (preimage_mono hV.2.2.1)) + · intro x + change ‖e.symm (V (e x))‖≤1 + rw [e.symm.norm_map] + exact hV.2.2.2 _ + +theorem integral_divergence_isometricPullback (e : Euc n ≃ₗᵢ[ℝ] Euc n) + (E : Set (Euc n)) {V : Euc n → Euc n} (hV : Differentiable ℝ V) : + (∫ x in e ⁻¹' E, divergence (isometricPullbackField e V) x) = + ∫ x in E, divergence V x := by + simp_rw [divergence_isometricPullback e hV] + exact e.measurePreserving.setIntegral_preimage_emb e.toHomeomorph.measurableEmbedding _ _ + +theorem perimeter_isometric_preimage (e : Euc n ≃ₗᵢ[ℝ] Euc n) (E U : Set (Euc n)) : + perimeter (e ⁻¹' E) (e ⁻¹' U)=perimeter E U := by + have hle (d : Euc n ≃ₗᵢ[ℝ] Euc n) (A B : Set (Euc n)) : + perimeter A B ≤ perimeter (d ⁻¹' A) (d ⁻¹' B) := by + rw [perimeter_eq_iSup_tests] + apply iSup_le; intro V + apply iSup_le; intro hV + rw [← integral_divergence_isometricPullback d A (hV.1.differentiable (by simp))] + rw [perimeter_eq_iSup_tests] + exact le_iSup_of_le (isometricPullbackField d V) + (le_iSup_of_le (admissible_isometricPullback d hV) le_rfl) + apply le_antisymm + · simpa only [← preimage_comp,Function.comp_def,e.apply_symm_apply,preimage_id'] using + hle e.symm (e ⁻¹' E) (e ⁻¹' U) + · exact hle e E U + +theorem perimeterSupport_isometric_preimage (e : Euc n ≃ₗᵢ[ℝ] Euc n) (E : Set (Euc n)) : + perimeterSupport (e ⁻¹' E)=e ⁻¹' perimeterSupport E := by + ext x + change (∀ r, 0 intro h φ + · have hh := h φ + simp only [inner_sub_left] + rw [integral_sub (inner_gradient_pairing_integrable hc φ) (inner_gradient_pairing_integrable hF φ)] + exact sub_eq_zero.mpr hh + · have hh := h φ + simp only [inner_sub_left] at hh + rw [integral_sub (inner_gradient_pairing_integrable hc φ) (inner_gradient_pairing_integrable hF φ)] at hh + exact sub_eq_zero.mp hh + + theorem weak_linear_difference {A : Euc n → Euc n →L[ℝ] Euc n} + {f : Euc n → ℝ} {F : Euc n → Euc n} {U W : Set (Euc n)} + (hA : Continuous A) (hf : ContDiff ℝ 1 f) (hF : Continuous F) + (h : WeakLinearEquation A f F U) (hWU : W⊆U) + (e : Euc n) (s : ℝ) (hs : ∀ x∈W, x+s•e∈U) : + WeakLinearEquation A (differenceQuotient f e s) + (fun x ↦ vectorQuotient F e s x-vectorQuotient A e s x (gradient f (x+s•e))) W := by + let V := fun x ↦ A x (gradient f x)-F x + have hV : Continuous V := (hA.clm_apply (gradient_continuous_C1 hf)).sub hF + have hflux := (weakLinear_iff_flux hA hf hF).mp h + have hq := ((hflux.translate (s•e) hs).sub + (hV.comp (continuous_id.add continuous_const)) hV (hflux.mono hWU)).const_smul s⁻¹ + have hqA : Continuous (vectorQuotient A e s) := by + unfold vectorQuotient + exact ((hA.comp (continuous_id.add continuous_const)).sub hA).const_smul s⁻¹ + have hqF : Continuous (fun x ↦ vectorQuotient F e s x- + vectorQuotient A e s x (gradient f (x+s•e))) := + (vectorQuotient_continuous hF e s).sub (hqA.clm_apply + ((gradient_continuous_C1 hf).comp (continuous_id.add continuous_const))) + apply (weakLinear_iff_flux hA (differenceQuotient_contDiff hf e s) hqF).mpr + have he (x : Euc n) : A x (gradient (differenceQuotient f e s) x)- + (vectorQuotient F e s x-vectorQuotient A e s x (gradient f (x+s•e)))= + s⁻¹•(V (x+s•e)-V x) := by + rw [differenceQuotient_gradient (hf.differentiable (by simp))] + simp only [vectorQuotient,smul_apply,sub_apply,map_smul,map_sub,V] + module + simpa only [he,Function.comp_def,Pi.add_apply,id_eq] using hq + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/LinearLocalGain.lean b/lean/OAI/Geometry/Perimeter/Regularity/LinearLocalGain.lean new file mode 100644 index 0000000000000000000000000000000000000000..b344b477d429336c63407e8329784e5e4e1a8d7d --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/LinearLocalGain.lean @@ -0,0 +1,62 @@ +import OAI.Geometry.Perimeter.Regularity.EllipticLocality +import OAI.Geometry.Perimeter.Regularity.LinearDerivativeGain + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +variable {n : ℕ} + + theorem linear_directional_gain_local {θ δ K : ℝ} + (hθ : 0<θ) (hθ' : θ ≤ 1/2) (hK : 1 ≤ K) + (hc : LinearContractionProperty n θ δ K) + {A : Euc n → Euc n →L[ℝ] Euc n} {F : Euc n → Euc n} + {f : Euc n → ℝ} {U : Set (Euc n)} (hU : IsOpen U) {p : Euc n} (hp : p∈U) + (hA : GeoC θ 1 A U) (hF : GeoC θ 1 F U) (hf : GeoC θ 1 f U) + (heq : WeakLinearEquation A f F U) + (hnear : ‖ContinuousLinearMap.id ℝ (Euc n)-A p‖ < min δ (1/2)) (e : Euc n) : + ∃ r : ℝ, 0 exact h + | @step k hk ih => exact ih h.mono_order + + theorem linear_schauder (k : ℕ) {θ δ K : ℝ} + (hθ : 0<θ) (hθ' : θ ≤ 1/2) (hK : 1 ≤ K) + (hc : LinearContractionProperty n θ δ K) + {A : Euc n → Euc n →L[ℝ] Euc n} {F : Euc n → Euc n} + {f : Euc n → ℝ} {U : Set (Euc n)} (hU : IsOpen U) + (hA : GeoC θ k A U) (hF : GeoC θ k F U) (hf : ContDiffOn ℝ 1 f U) + (heq : WeakLinearEquation A f F U) + (hnear : ∀ p∈U, ‖ContinuousLinearMap.id ℝ (Euc n)-A p‖ < min δ (1/2)) : + GeoC θ (k+1) f U := by + induction k generalizing A F f U with + | zero => exact linear_geoC_one hθ hθ' hK hc hU hA hF hf heq hnear + | succ k ih => + have hff := ih hU hA.mono_order hF.mono_order hf heq hnear + have hA1 : GeoC θ 1 A U := hA.of_le (by omega) + have hF1 : GeoC θ 1 F U := hF.of_le (by omega) + have hf1 : GeoC θ 1 f U := hff.of_le (by omega) + have hf2 := linear_C2_gain hθ hθ' hK hc hU hA1 hF1 hf1 heq hnear + have hgrad := hff.gradient hθ.le hU + refine ⟨hf,geoC_zero_of_C1 hθ.le hθ' hU hf,fun e ↦ ?_⟩ + have hforce : GeoC θ k (fun x ↦ fderiv ℝ F x e-fderiv ℝ A x e (gradient f x)) U := + (hF.2.2 e).sub hθ.le hU ((hA.2.2 e).clm_apply hθ.le hU hgrad) + have hdir : ContDiffOn ℝ 1 (fun x ↦ fderiv ℝ f x e) U := + (hf2.fderiv_of_isOpen hU (by norm_num)).clm_apply contDiffOn_const + apply GeoC.local + intro p hp + obtain ⟨W,hW,hpW,hWU,hd⟩ := weak_linear_derivative_local hU hp hA1.1 hF1.1 hf2 heq e + exact ⟨W,hW,hpW,ih hW (hA.mono_order.mono hWU) (hforce.mono hWU) (hdir.mono hWU) + hd (fun x hx ↦ hnear x (hWU hx))⟩ + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/LinearWeakDerivative.lean b/lean/OAI/Geometry/Perimeter/Regularity/LinearWeakDerivative.lean new file mode 100644 index 0000000000000000000000000000000000000000..21305f015b297da6298d0cf174838b927704fbd5 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/LinearWeakDerivative.lean @@ -0,0 +1,64 @@ +import OAI.Geometry.Perimeter.Regularity.EllipticLocality +import OAI.Geometry.Perimeter.Regularity.WeakDerivative + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +variable {n : ℕ} + + theorem weak_linear_derivative {A : Euc n → Euc n →L[ℝ] Euc n} + {F : Euc n → Euc n} {f : Euc n → ℝ} {U : Set (Euc n)} + (hA : ContDiff ℝ 1 A) (hF : ContDiff ℝ 1 F) (hf : ContDiff ℝ 2 f) + (h : WeakLinearEquation A f F U) (e : Euc n) : + WeakLinearEquation A (fun x ↦ fderiv ℝ f x e) + (fun x ↦ fderiv ℝ F x e-fderiv ℝ A x e (gradient f x)) U := by + have hdf : ContDiff ℝ 1 (fderiv ℝ f) := hf.fderiv_right (by norm_num) + have hg : ContDiff ℝ 1 (gradient f) := + (InnerProductSpace.toDual ℝ (Euc n)).symm.toContinuousLinearMap.contDiff.comp hdf + have hV : ContDiff ℝ 1 (fun x ↦ A x (gradient f x)-F x) := (hA.clm_apply hg).sub hF + have hd := ((weakLinear_iff_flux hA.continuous (hf.of_le (by norm_num)) hF.continuous).mp h).derivative hV e + have hdir : ContDiff ℝ 1 (fun x ↦ fderiv ℝ f x e) := hdf.clm_apply contDiff_const + have hH : Continuous (fun x ↦ fderiv ℝ F x e-fderiv ℝ A x e (gradient f x)) := + ((hF.continuous_fderiv (by norm_num)).clm_apply continuous_const).sub + (((hA.continuous_fderiv (by norm_num)).clm_apply continuous_const).clm_apply hg.continuous) + apply (weakLinear_iff_flux hA.continuous hdir hH).mpr + apply hd.congr + intro x hx + have hr := (((hA.differentiable (by simp) x).hasFDerivAt.clm_apply + (hg.differentiable (by simp) x).hasFDerivAt).sub (hF.differentiable (by simp) x).hasFDerivAt).fderiv + have he := congrArg (fun L : Euc n →L[ℝ] Euc n ↦ L e) hr + dsimp only at * + change fderiv ℝ (fun y ↦ A y (gradient f y)-F y) x e = _ at he + rw [he,gradient_direction_swap hf] + simp only [sub_apply,add_apply,ContinuousLinearMap.comp_apply, + ContinuousLinearMap.flip_apply] + module + + theorem weak_linear_derivative_local {A : Euc n → Euc n →L[ℝ] Euc n} + {F : Euc n → Euc n} {f : Euc n → ℝ} {U : Set (Euc n)} + (hU : IsOpen U) {p : Euc n} (hp : p∈U) + (hA : ContDiffOn ℝ 1 A U) (hF : ContDiffOn ℝ 1 F U) (hf : ContDiffOn ℝ 2 f U) + (h : WeakLinearEquation A f F U) (e : Euc n) : + ∃ W : Set (Euc n), IsOpen W ∧ p∈W ∧ W⊆U ∧ + WeakLinearEquation A (fun x ↦ fderiv ℝ f x e) + (fun x ↦ fderiv ℝ F x e-fderiv ℝ A x e (gradient f x)) W := by + obtain ⟨W,hW,hpW,hWU,B,g,G,hB,hBc,hg,hgc,hG,hGc,heB,heg,heG⟩ := + local_compact_triple hU hp hA hf hF + have he := (h.mono hWU).congr hW heB.symm heg.symm heG.symm + have hd := weak_linear_derivative hB hG hg he e + refine ⟨W,hW,hpW,hWU,hd.congr hW heB ?_ ?_⟩ + · intro x hx + dsimp only + rw [fderiv_eqOn hW heg hx] + · intro x hx + dsimp only + rw [fderiv_eqOn hW heG hx,fderiv_eqOn hW heB hx,gradient_eqOn hW heg hx] + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/LocalFlatExcess.lean b/lean/OAI/Geometry/Perimeter/Regularity/LocalFlatExcess.lean new file mode 100644 index 0000000000000000000000000000000000000000..dcec2725c58e11e624bd655352508b0e1aa6c05e --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/LocalFlatExcess.lean @@ -0,0 +1,119 @@ +import OAI.Geometry.Perimeter.Regularity.FlatExcess + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +variable {n : ℕ} + +theorem tendsto_phase_slab_error {E : ℕ → Set (Euc n)} + (hE : ∀ i, MeasurableSet (E i)) {v : Euc n} (hv : ‖v‖=1) + (a : ℕ → ℝ) (hat : Tendsto a atTop (𝓝 0)) (R : ℝ) + (hphase : ∀ i, ∀ᵐ x ∂volume, x∈Metric.ball 0 R → a i < |inner ℝ v x| → + (x∈E i ↔ inner ℝ v x<0)) : + Tendsto (fun i ↦ volume.real (symmDiff (E i) {x | inner ℝ x v<0} ∩ Metric.ball 0 R)) + atTop (𝓝 0) := by + let H : Set (Euc n) := {x | inner ℝ x v<0} + have hH : MeasurableSet H := (isOpen_lt (continuous_id.inner continuous_const) continuous_const).measurableSet + let f := fun i x ↦ |(E i).indicator (fun _ ↦ (1:ℝ)) x-H.indicator (fun _ ↦ (1:ℝ)) x| + have hmeas (i) : AEStronglyMeasurable (f i) (volume.restrict (Metric.ball 0 R)) := + (((measurable_const.indicator (hE i)).sub (measurable_const.indicator hH)).abs).aestronglyMeasurable.restrict + have hb (i) : ∀ᵐ x ∂volume.restrict (Metric.ball (0:Euc n) R), ‖f i x‖≤1 := by + apply ae_of_all + intro x + by_cases hx : x∈E i <;> by_cases hy : x∈H <;> simp [f,hx,hy] + have hn : (innerSL ℝ v : Euc n →L[ℝ] ℝ) ≠ 0 := by + intro hz + have he := congrArg (fun L : Euc n →L[ℝ] ℝ ↦ L v) hz + change inner ℝ v v=0 at he + rw [real_inner_self_eq_norm_sq,hv] at he + norm_num at he + have hall := ae_all_iff.mpr hphase + have ht : ∀ᵐ x ∂volume.restrict (Metric.ball (0:Euc n) R), Tendsto (fun i ↦ f i x) atTop (𝓝 0) := by + filter_upwards [ae_restrict_of_ae hall,ae_restrict_of_ae (ae_linear_ne_zero hn), + ae_restrict_mem measurableSet_ball] with x hx hnz hxB + apply tendsto_const_nhds.congr' + have hpos : 0 < |inner ℝ v x| := abs_pos.mpr hnz + filter_upwards [hat.eventually (gt_mem_nhds hpos)] with i hi + have hm := hx i hxB hi + have hm' : x∈E i ↔ x∈H := by simpa only [H,mem_ofPred_eq,real_inner_comm x v] using hm + by_cases he : x∈E i + · simp [f,he,hm'.mp he] + · simp [f,he,mt hm'.mpr he] + have ht' := tendsto_integral_of_dominated_convergence (fun _ : Euc n ↦ (1:ℝ)) hmeas + (integrableOn_const measure_ball_lt_top.ne) hb ht + simp only [integral_zero] at ht' + convert ht' using 1 + ext i + exact (integral_abs_indicator_sub_eq_symmDiff (hE i) hH).symm + +theorem tendsto_setIntegral_of_ball_symmDiff {E : ℕ → Set (Euc n)} {F : Set (Euc n)} + (hE : ∀ i, MeasurableSet (E i)) (hF : MeasurableSet F) {R : ℝ} + (hconv : Tendsto (fun i ↦ volume.real (symmDiff (E i) F ∩ Metric.ball 0 R)) atTop (𝓝 0)) + {f : Euc n → ℝ} (hf : Continuous f) (hc : HasCompactSupport f) + (hs : tsupport f ⊆ Metric.ball 0 R) : + Tendsto (fun i ↦ ∫ x in E i, f x) atTop (𝓝 (∫ x in F, f x)) := by + obtain ⟨C,hC⟩ := hc.exists_bound_of_continuous hf + have hC0 : 0≤C := (norm_nonneg (f 0)).trans (hC 0) + have hb (i) := abs_setIntegral_sub_le_symmDiff_volume (hE i) hF measurableSet_ball + measure_ball_lt_top.ne (hf.integrable_of_hasCompactSupport hc) + (fun x hx ↦ image_eq_zero_of_notMem_tsupport (fun h ↦ hx (hs h))) hC0 + (fun x ↦ by simpa only [Real.norm_eq_abs] using hC x) + apply tendsto_iff_norm_sub_tendsto_zero.mpr + apply squeeze_zero (fun i ↦ norm_nonneg _) + (fun i ↦ by simpa only [Real.norm_eq_abs] using hb i) + simpa using hconv.const_mul C + +theorem orientedTilt_tendsto_of_local_halfspace_L1 (hn : 1 simp + +theorem minimalFlux_exists_small {δ : ℝ} (hδ : 0<δ) : ∃ ε : ℝ, 0<ε ∧ + ∀ z : Euc n, ‖z‖<ε → ‖ContinuousLinearMap.id ℝ (Euc n)-fderiv ℝ minimalFlux z‖< min δ (1/2) := by + have hD : ContDiff ℝ ∞ (fderiv ℝ (minimalFlux (n:=n))) := + minimalFlux_smooth.fderiv_right (by simp) + have hc : ContinuousAt (fderiv ℝ (minimalFlux (n:=n))) 0 := hD.continuous.continuousAt + obtain ⟨ε,hε,hh⟩ := Metric.continuousAt_iff.mp hc (min δ (1/2)) (lt_min hδ (by norm_num)) + refine ⟨ε,hε,fun z hz ↦ ?_⟩ + have hv := hh (by simpa only [dist_zero_right] using hz) + rwa [minimalFlux_fderiv_zero,dist_eq_norm,norm_sub_rev] at hv + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/MinimalGraphEquation.lean b/lean/OAI/Geometry/Perimeter/Regularity/MinimalGraphEquation.lean new file mode 100644 index 0000000000000000000000000000000000000000..17a80ffa5248074bce2a3fa0645a587c6bfbddab --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/MinimalGraphEquation.lean @@ -0,0 +1,71 @@ +import OAI.Geometry.Perimeter.Regularity.GraphFluxWeight + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +variable {n : ℕ} + +theorem full_graph_weak_minimal_equation (hn : 1 exact hf + | succ k ih => + have hgrad := ih.gradient hθ.le hU + have hA := geoC_comp k hθ.le hU hgrad hDG + refine ⟨hf.1,hf.2.1,fun e ↦ ?_⟩ + have hdir : ContDiffOn ℝ 1 (fun x ↦ fderiv ℝ f x e) U := + (hf2.fderiv_of_isOpen hU (by norm_num)).clm_apply contDiffOn_const + apply GeoC.local + intro p hp + obtain ⟨W,hW,hpW,hWU,hd⟩ := weak_nonlinear_derivative_local (hG.of_le (by simp)) hU hp hf2 heq e + exact ⟨W,hW,hpW,linear_schauder k hθ hθ' hK hc hW (hA.mono hWU) + (GeoC.const θ k 0 W) (hdir.mono hWU) hd (fun x hx ↦ hnear x (hWU hx))⟩ + + theorem nonlinear_smooth {θ δ K : ℝ} + (hθ : 0<θ) (hθ' : θ ≤ 1/2) (hK : 1 ≤ K) + (hc : LinearContractionProperty n θ δ K) + {G : Euc n → Euc n} (hG : ContDiff ℝ ∞ G) + {f : Euc n → ℝ} {U : Set (Euc n)} (hU : IsOpen U) + (hf : GeoC θ 1 f U) (heq : WeakFluxEquation (fun x ↦ G (gradient f x)) U) + (hnear : ∀ p∈U, ‖ContinuousLinearMap.id ℝ (Euc n)-fderiv ℝ G (gradient f p)‖ < min δ (1/2)) : + ContDiffOn ℝ ∞ f U := by + rw [contDiffOn_infty] + intro k + exact ((nonlinear_geoC_all hθ hθ' hK hc hG hU hf heq hnear k).mono_order).contDiff hU + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/NormalAdjustment.lean b/lean/OAI/Geometry/Perimeter/Regularity/NormalAdjustment.lean new file mode 100644 index 0000000000000000000000000000000000000000..6ac9cadde1437b8058d617500e813fd18c6b1c8a --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/NormalAdjustment.lean @@ -0,0 +1,81 @@ +import OAI.Geometry.Perimeter.Regularity.NormalCoordinates + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +open RPI.Boundary +variable {n : ℕ} + +theorem normalPlane_finrank {v : Euc n} (hv : ‖v‖=1) : + Module.finrank ℝ (normalPlane v)=n-1 := by + have hn : v≠0 := by intro hzero; simp [hzero] at hv + have h := (ℝ ∙ v).finrank_add_finrank_orthogonal + rw [finrank_span_singleton hn,finrank_euclideanSpace,Fintype.card_fin] at h + dsimp [normalPlane] + omega + +def normalPlaneEuclideanChart {v : Euc n} (hv : ‖v‖=1) : Euc (n-1) ≃ₗᵢ[ℝ] normalPlane v := + ((stdOrthonormalBasis ℝ (normalPlane v)).reindex (finCongr (normalPlane_finrank hv))).repr.symm + +theorem exists_normal_rotation {v w : Euc n} (h : ‖v‖=‖w‖) : + ∃ e : Euc n ≃ₗᵢ[ℝ] Euc n, e v=w := + ⟨(ℝ ∙ (v-w))ᗮ.reflection,Submodule.reflection_sub h⟩ + +theorem dual_of_normal_linear {v : Euc n} {L : Euc n →L[ℝ] ℝ} (hL : L v=0) : + let u := (InnerProductSpace.toDual ℝ (Euc n)).symm L + ‖u‖=‖L‖ ∧ inner ℝ v u=0 ∧ ∀ x, inner ℝ u x=L x := by + constructor + · exact (InnerProductSpace.toDual ℝ (Euc n)).symm.norm_map L + constructor + · rw [real_inner_comm,InnerProductSpace.toDual_symm_apply,hL] + · intro x; exact InnerProductSpace.toDual_symm_apply + +theorem exists_adjusted_unit_normal {v : Euc n} (hv : ‖v‖=1) + (L : Euc n →L[ℝ] ℝ) (hLv : L v=0) {a : ℝ} (ha : 0≤a) : + ∃ w : Euc n, ‖w‖=1 ∧ ‖w-v‖≤2*a*‖L‖ ∧ + ∀ x, |inner ℝ w x|≤|inner ℝ v x-a*L x| := by + let u := (InnerProductSpace.toDual ℝ (Euc n)).symm L + have hu := dual_of_normal_linear hLv + change ‖u‖=‖L‖ ∧ inner ℝ v u=0 ∧ ∀ x, inner ℝ u x=L x at hu + let z := v-a•u + have hzsq : ‖z‖^2=1+a^2*‖u‖^2 := by + dsimp [z] + rw [norm_sub_sq_real,hv,real_inner_smul_right,hu.2.1,mul_zero,mul_zero,sub_zero, + norm_smul,Real.norm_of_nonneg ha] + ring + have hzn : 1≤‖z‖ := by nlinarith [norm_nonneg z,sq_nonneg a,sq_nonneg ‖u‖] + have hz : 0<‖z‖ := lt_of_lt_of_le zero_lt_one hzn + let w := ‖z‖⁻¹•z + have hwn : ‖w‖=1 := by rw [norm_smul,Real.norm_of_nonneg (inv_nonneg.mpr hz.le),inv_mul_cancel₀ hz.ne'] + have hdist : ‖w-z‖=‖z‖-1 := by + have he : w-z=(‖z‖⁻¹-1)•z := by dsimp [w]; rw [sub_smul,one_smul] + rw [he,norm_smul,Real.norm_eq_abs,abs_of_nonpos (sub_nonpos.mpr ((inv_le_one₀ hz).mpr hzn))] + field_simp + ring + have hzv : ‖z-v‖=a*‖L‖ := by + have he : z-v=-(a•u) := by dsimp [z]; abel + rw [he,norm_neg,norm_smul,Real.norm_of_nonneg ha,hu.1] + refine ⟨w,hwn,?_,?_⟩ + · have hrev := norm_sub_norm_le z v + rw [hv,hzv] at hrev + have htri := norm_sub_le w z + have hh := norm_sub_le w v + calc + ‖w-v‖ ≤ ‖w-z‖+‖z-v‖ := norm_sub_le_norm_sub_add_norm_sub _ _ _ + _ = ‖z‖-1+a*‖L‖ := by rw [hdist,hzv] + _ ≤ 2*a*‖L‖ := by linarith + · intro x + have he : inner ℝ w x=‖z‖⁻¹*(inner ℝ v x-a*L x) := by + dsimp [w,z] + rw [real_inner_smul_left,inner_sub_left,real_inner_smul_left,hu.2.2] + rw [he,abs_mul,abs_of_nonneg (inv_nonneg.mpr hz.le)] + exact mul_le_of_le_one_left (abs_nonneg _) ((inv_le_one₀ hz).mpr hzn) + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/NormalCoordinates.lean b/lean/OAI/Geometry/Perimeter/Regularity/NormalCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..2c8f50da14bcc7febf8954f1052fcbf56da0b25f --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/NormalCoordinates.lean @@ -0,0 +1,85 @@ +import OAI.Geometry.Perimeter.Regularity.HasC1TraceAt + +namespace OAI + +noncomputable section +open Set MeasureTheory +open scoped InnerProductSpace ENNReal +namespace RPISingularHarnack +variable {V : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] + +abbrev normalPlane (v : V) := (ℝ ∙ v)ᗮ + +def normalCoordinateIsometry (v : V) (hv : ‖v‖ = 1) : + WithLp 2 (normalPlane v × ℝ) →ₗᵢ[ℝ] V where + toLinearMap := + { toFun := fun x ↦ (x.fst : V) + x.snd • v + map_add' := by intro x y; simp [add_smul]; abel + map_smul' := by intro t x; simp [smul_add,smul_smul] } + norm_map' := by + intro x + have ho : inner ℝ (x.fst : V) v = 0 := + Submodule.mem_orthogonal_singleton_iff_inner_left.mp x.fst.property + apply (sq_eq_sq₀ (norm_nonneg _) (norm_nonneg _)).mp + change ‖(x.fst : V)+x.snd•v‖^2 = ‖x‖^2 + rw [norm_add_sq_real, real_inner_smul_right, ho, mul_zero, mul_zero, add_zero, + norm_smul, hv, mul_one, WithLp.prod_norm_sq_eq_of_L2] + rfl + +theorem normalCoordinateIsometry_surjective (v : V) (hv : ‖v‖ = 1) : + Function.Surjective (normalCoordinateIsometry v hv) := by + have hself : inner ℝ v v = 1 := by rw [real_inner_self_eq_norm_sq,hv]; norm_num + intro x + let y : normalPlane v := ⟨x-inner ℝ v x•v, by + rw [Submodule.mem_orthogonal_singleton_iff_inner_right,inner_sub_right, + real_inner_smul_right,hself,mul_one,sub_self]⟩ + refine ⟨WithLp.toLp 2 (y,inner ℝ v x), ?_⟩ + change x-inner ℝ v x•v+inner ℝ v x•v=x + exact sub_add_cancel _ _ + +def normalCoordinateEquiv (v : V) (hv : ‖v‖ = 1) : + WithLp 2 (normalPlane v × ℝ) ≃ₗᵢ[ℝ] V := + LinearIsometryEquiv.ofSurjective (normalCoordinateIsometry v hv) + (normalCoordinateIsometry_surjective v hv) + +@[simp] theorem normalCoordinateEquiv_apply (v : V) (hv : ‖v‖ = 1) + (x : WithLp 2 (normalPlane v × ℝ)) : + normalCoordinateEquiv v hv x = (x.fst : V)+x.snd•v := rfl + +variable [MeasurableSpace V] [BorelSpace V] + +def normalCoordinates (v : V) (hv : ‖v‖ = 1) : (normalPlane v × ℝ) ≃ᵐ V := + (MeasurableEquiv.toLp 2 (normalPlane v × ℝ)).trans + (normalCoordinateEquiv v hv).toMeasurableEquiv + +@[simp] theorem normalCoordinates_apply (v : V) (hv : ‖v‖ = 1) + (x : normalPlane v × ℝ) : normalCoordinates v hv x = (x.1 : V)+x.2•v := rfl + +variable [FiniteDimensional ℝ V] + +theorem normalCoordinates_measurePreserving (v : V) (hv : ‖v‖ = 1) : + MeasurePreserving (normalCoordinates v hv) volume volume := + (normalCoordinateEquiv v hv).measurePreserving.comp + (WithLp.volume_preserving_toLp (normalPlane v) ℝ) + +theorem integral_normalCoordinates (v : V) (hv : ‖v‖ = 1) (f : V → ℝ) + (hf : Integrable f volume) : + (∫ x, f x) = ∫ y : normalPlane v, ∫ s : ℝ, f ((y:V)+s•v) := by + have hm := normalCoordinates_measurePreserving v hv + have he := hm.integral_comp (normalCoordinates v hv).measurableEmbedding f + rw [← he] + apply integral_prod + exact (hm.integrable_comp hf.aestronglyMeasurable).mpr hf + +theorem lintegral_normalCoordinates (v : V) (hv : ‖v‖ = 1) (f : V → ℝ≥0∞) + (hf : Measurable f) : + (∫⁻ x, f x) = ∫⁻ y : normalPlane v, ∫⁻ s : ℝ, f ((y:V)+s•v) := by + rw [← (normalCoordinates_measurePreserving v hv).lintegral_comp hf] + apply lintegral_prod + exact (hf.comp (normalCoordinates v hv).measurable).aemeasurable + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/NormalFluxError.lean b/lean/OAI/Geometry/Perimeter/Regularity/NormalFluxError.lean new file mode 100644 index 0000000000000000000000000000000000000000..b66135f59586c6f282323095f8eddf303776a053 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/NormalFluxError.lean @@ -0,0 +1,70 @@ +import OAI.Geometry.Perimeter.Regularity.FlatExcess + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff Convolution InnerProductSpace +namespace RPISingularHarnack +open RPI.Boundary ContinuousLinearMap +variable {n : ℕ} + +theorem normal_flux_error_le_tilt (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + {v : Euc n} (hv : ‖v‖ = 1) {R : ℝ} (hR : 0 < R) + {ψ : Euc n → ℝ} (hψ : Measurable ψ) {M : ℝ} (hM : ∀ x, ‖ψ x‖ ≤ M) : + |(∫ x in Metric.ball 0 R, ψ x ∂perimeterMeasure E) - + (∫ x in Metric.ball 0 R, ψ x*inner ℝ (approximateNormal E x) v ∂perimeterMeasure E)| ≤ + M * orientedTilt E v (Metric.ball 0 R) / 2 := by + let μ := (perimeterMeasure E).restrict (Metric.ball 0 R) + have : IsFiniteMeasure μ := ⟨by + rw [Measure.restrict_apply_univ,perimeterMeasure_open E Metric.isOpen_ball] + exact hmin.2.1 0 R hR⟩ + have hM0 : 0 ≤ M := (norm_nonneg (ψ 0)).trans (hM 0) + have hiψ : Integrable ψ μ := Integrable.of_bound hψ.aestronglyMeasurable M (ae_of_all _ hM) + have hN : ∀ x, |inner ℝ (approximateNormal E x) v| ≤ 1 := by + intro x + exact (abs_real_inner_le_norm _ _).trans (by rw [hv,mul_one]; exact approximateNormal_norm_le_one E x) + have hif : Integrable (fun x ↦ ψ x*inner ℝ (approximateNormal E x) v) μ := by + apply Integrable.of_bound (hψ.mul + ((measurable_approximateNormal hmin.1).inner measurable_const)).aestronglyMeasurable M + apply ae_of_all _ + intro x + change ‖ψ x*inner ℝ (approximateNormal E x) v‖ ≤ M + rw [norm_mul] + exact (mul_le_mul (hM x) (hN x) (abs_nonneg _) hM0).trans_eq (mul_one _) + have htilt : Integrable (fun x ↦ ‖approximateNormal E x-v‖^2) μ := by + apply Integrable.of_bound + (((measurable_approximateNormal hmin.1).sub measurable_const).norm.pow_const 2).aestronglyMeasurable + 4 + apply ae_of_all _ + intro x + rw [Real.norm_eq_abs,abs_of_nonneg (sq_nonneg _)] + have h := (norm_sub_le (approximateNormal E x) v).trans + (show ‖approximateNormal E x‖+‖v‖ ≤ 2 by rw [hv]; linarith [approximateNormal_norm_le_one E x]) + change ‖approximateNormal E x-v‖^2 ≤ 4 + nlinarith [norm_nonneg (approximateNormal E x-v)] + have hdiff : ∀ᵐ x ∂μ, |ψ x-ψ x*inner ℝ (approximateNormal E x) v| ≤ + (M/2)*‖approximateNormal E x-v‖^2 := by + filter_upwards [ae_restrict_of_ae (minimizing_halfspaceBlowup_ae hn hmin)] with x hx + have hid : 1-inner ℝ (approximateNormal E x) v = ‖approximateNormal E x-v‖^2/2 := by + rw [norm_sub_sq_real,hx.1,hv] + ring + rw [show ψ x-ψ x*inner ℝ (approximateNormal E x) v = + ψ x*(1-inner ℝ (approximateNormal E x) v) by ring, + abs_mul,hid,abs_of_nonneg (show 0 ≤ ‖approximateNormal E x-v‖^2/2 by positivity)] + have h := mul_le_mul_of_nonneg_right (hM x) (by positivity : 0 ≤ ‖approximateNormal E x-v‖^2/2) + simpa only [Real.norm_eq_abs,mul_div_assoc,div_mul_eq_mul_div] using h + change |(∫ x, ψ x ∂μ)-(∫ x, ψ x*inner ℝ (approximateNormal E x) v ∂μ)| ≤ _ + rw [← integral_sub hiψ hif] + calc + _ ≤ ∫ x, |ψ x-ψ x*inner ℝ (approximateNormal E x) v| ∂μ := abs_integral_le_integral_abs + _ ≤ ∫ x, (M/2)*‖approximateNormal E x-v‖^2 ∂μ := + integral_mono_ae (hiψ.sub hif).abs (htilt.const_mul _) hdiff + _ = _ := by rw [integral_const_mul]; dsimp only [orientedTilt,μ]; ring + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/NormalPhaseMollification.lean b/lean/OAI/Geometry/Perimeter/Regularity/NormalPhaseMollification.lean new file mode 100644 index 0000000000000000000000000000000000000000..be030f758fb8859e7fabc08ffe9bf894c9acc170 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/NormalPhaseMollification.lean @@ -0,0 +1,177 @@ +import OAI.Geometry.Perimeter.Regularity.FlatExcess + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff Convolution +namespace RPISingularHarnack +open RPI.Boundary ContinuousLinearMap + +def phaseMollification {n : ℕ} (E : Set (Euc n)) (k : Euc n → ℝ) : Euc n → ℝ := + E.indicator (fun _ ↦ (1:ℝ)) ⋆[lsmul ℝ ℝ, volume] k + +theorem phaseMollification_contDiff {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) {k : Euc n → ℝ} (hk : ContDiff ℝ ∞ k) + (hc : HasCompactSupport k) : ContDiff ℝ ∞ (phaseMollification E k) := + hc.contDiff_convolution_right _ ((locallyIntegrable_const (1:ℝ)).indicator hE) hk + +theorem phaseMollification_eq_setIntegral {n : ℕ} (E : Set (Euc n)) + (hE : MeasurableSet E) (k : Euc n → ℝ) (x : Euc n) : + phaseMollification E k x = ∫ y in E, k (x-y) := by + change (∫ y, E.indicator (fun _ ↦ (1:ℝ)) y*k (x-y)) = _ + have he : (fun y ↦ E.indicator (fun _ ↦ (1:ℝ)) y*k (x-y)) = + E.indicator (fun y ↦ k (x-y)) := by + funext y + by_cases hy : y ∈ E <;> simp [hy] + rw [he,integral_indicator hE] + +theorem phaseMollification_mem_Icc {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) {k : Euc n → ℝ} (hk : Integrable k volume) + (hpos : ∀ x, 0 ≤ k x) (hunit : ∫ x, k x = 1) (x : Euc n) : + phaseMollification E k x ∈ Icc (0:ℝ) 1 := by + rw [phaseMollification_eq_setIntegral E hE] + constructor + · exact integral_nonneg fun y ↦ hpos _ + · calc + _ ≤ ∫ y, k (x-y) := setIntegral_le_integral (hk.comp_sub_left x) + (ae_of_all _ (fun y ↦ hpos _)) + _ = 1 := by rw [integral_sub_left_eq_self,hunit] + +theorem negative_normal_flux_le_tilt {n : ℕ} (N : Euc n) {v : Euc n} + (hv : ‖v‖ = 1) : 2*max (-inner ℝ N v) 0 ≤ ‖N-v‖^2 := by + rw [norm_sub_sq_real,hv] + rcases le_total (-inner ℝ N v) 0 with h | h + · rw [max_eq_right h] + nlinarith [sq_nonneg ‖N-v‖,norm_sub_sq_real N v] + · rw [max_eq_left h] + nlinarith [sq_nonneg ‖N‖] + +theorem phaseMollification_fderiv {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + {k : Euc n → ℝ} (hk : ContDiff ℝ ∞ k) (hc : HasCompactSupport k) + (x v : Euc n) {R : ℝ} (hR : 0 < R) + (hs : tsupport (fun y ↦ k (x-y)) ⊆ Metric.ball 0 R) : + fderiv ℝ (phaseMollification E k) x v = + -(∫ y in Metric.ball 0 R, k (x-y)*inner ℝ (approximateNormal E y) v + ∂perimeterMeasure E) := by + let φ : Euc n → ℝ := fun y ↦ k (x-y) + have hφ : ContDiff ℝ ∞ φ := hk.comp (contDiff_const.sub contDiff_id) + have hcφ : HasCompactSupport φ := hc.comp_homeomorph (Homeomorph.subLeft x) + have hd (y : Euc n) : fderiv ℝ φ y v = -fderiv ℝ k (x-y) v := by + have h := ((hk.differentiable (by simp) (x-y)).hasFDerivAt.comp y + ((hasFDerivAt_const x y).sub (hasFDerivAt_id y))).fderiv + simpa only [φ,Function.comp_def,sub_apply,zero_apply,id_apply, + zero_sub,ContinuousLinearMap.comp_apply,neg_apply,map_neg] using + congrArg (fun L : Euc n →L[ℝ] ℝ ↦ L v) h + have hfi : LocallyIntegrable (E.indicator (fun _ ↦ (1:ℝ))) volume := + (locallyIntegrable_const (1:ℝ)).indicator hmin.1 + have hdiff : fderiv ℝ (phaseMollification E k) x v = -(∫ y in E, fderiv ℝ φ y v) := by + rw [phaseMollification,(hc.hasFDerivAt_convolution_right (lsmul ℝ ℝ) hfi + (hk.of_le (by simp)) x).fderiv, + convolution_precompR_apply (lsmul ℝ ℝ) hfi (hc.fderiv ℝ) + (hk.continuous_fderiv (by simp))] + change (∫ y, E.indicator (fun _ ↦ (1:ℝ)) y*fderiv ℝ k (x-y) v) = _ + simp_rw [hd,integral_neg,neg_neg] + have he : (fun y ↦ E.indicator (fun _ ↦ (1:ℝ)) y*fderiv ℝ k (x-y) v) = + E.indicator (fun y ↦ fderiv ℝ k (x-y) v) := by + funext y + by_cases hy : y ∈ E <;> simp [hy] + rw [he,integral_indicator hmin.1] + rw [hdiff,← divergence_scalar_direction (hφ.differentiable (by simp)) v, + minimizing_gaussGreen_local hn hmin (Metric.ball 0 R) Metric.isOpen_ball + (hmin.2.1 0 R hR).ne (fun y ↦ φ y • v) (hφ.smul contDiff_const) + hcφ.smul_right (tsupport_smul_subset_left _ _ |>.trans hs)] + congr 1 + apply integral_congr_ae + exact ae_of_all _ fun y ↦ by simp only [φ,real_inner_smul_right] + +theorem positive_neg_convolution_le {n : ℕ} (μ : Measure (Euc n)) + {f k : Euc n → ℝ} (hf : Integrable f μ) (hk : Continuous k) + (hc : HasCompactSupport k) (hp : ∀ x, 0 ≤ k x) (x : Euc n) : + max (-(f ⋆[lsmul ℝ ℝ, μ] k) x) 0 ≤ + ((fun y ↦ max (-f y) 0) ⋆[lsmul ℝ ℝ, μ] k) x := by + have hq : Integrable (fun y ↦ max (-f y) 0) μ := hf.neg_part + have hi := hc.convolutionExists_right (lsmul ℝ ℝ) hf.locallyIntegrable hk x + have hj := hc.convolutionExists_right (lsmul ℝ ℝ) hq.locallyIntegrable hk x + change max (-(∫ y, f y*k (x-y) ∂μ)) 0 ≤ ∫ y, max (-f y) 0*k (x-y) ∂μ + apply max_le + · rw [← integral_neg] + apply integral_mono hi.neg hj + intro y + change -(f y*k (x-y)) ≤ max (-f y) 0*k (x-y) + simpa only [neg_mul] using mul_le_mul_of_nonneg_right (le_max_left (-f y) 0) (hp _) + · exact integral_nonneg fun y ↦ mul_nonneg (le_max_right _ _) (hp _) + +theorem phaseMollification_positive_derivative_le_tilt {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) {v : Euc n} + (hv : ‖v‖ = 1) {k : Euc n → ℝ} (hk : ContDiff ℝ ∞ k) + (hc : HasCompactSupport k) (hp : ∀ x, 0 ≤ k x) (hu : ∫ x, k x = 1) + {R : ℝ} (hR : 0 < R) (c : Euc n) (r : ℝ) + (hs : ∀ x ∈ Metric.closedBall c r, tsupport (fun y ↦ k (x-y)) ⊆ Metric.ball 0 R) : + (∫ x in Metric.closedBall c r, + max (fderiv ℝ (phaseMollification E k) x v) 0) ≤ + orientedTilt E v (Metric.ball 0 R) / 2 := by + let μ := (perimeterMeasure E).restrict (Metric.ball 0 R) + have : IsFiniteMeasure μ := ⟨by + rw [Measure.restrict_apply_univ, perimeterMeasure_open E Metric.isOpen_ball] + exact hmin.2.1 0 R hR⟩ + let f : Euc n → ℝ := fun y ↦ inner ℝ (approximateNormal E y) v + let q : Euc n → ℝ := fun y ↦ max (-f y) 0 + have hm : Measurable f := (measurable_approximateNormal hmin.1).inner measurable_const + have hf : Integrable f μ := (integrable_const (1:ℝ)).mono' hm.aestronglyMeasurable + (ae_of_all _ fun y ↦ by + change ‖inner ℝ (approximateNormal E y) v‖ ≤ 1 + exact (norm_inner_le_norm (𝕜 := ℝ) _ _).trans (by + rw [hv,mul_one]; exact approximateNormal_norm_le_one E y)) + have hq : Integrable q μ := hf.neg_part + have hki : Integrable k volume := hk.continuous.integrable_of_hasCompactSupport hc + have hconv : Integrable (q ⋆[lsmul ℝ ℝ, μ] k) volume := + (hq.convolution_integrand (lsmul ℝ ℝ) hki).integral_prod_left + have hpos : ∀ x, 0 ≤ (q ⋆[lsmul ℝ ℝ, μ] k) x := by + intro x + exact integral_nonneg fun y ↦ mul_nonneg (le_max_right _ _) (hp _) + have hdiff := (phaseMollification_contDiff hmin.1 hk hc).continuous_fderiv (by simp) + have hleft : IntegrableOn (fun x ↦ max (fderiv ℝ (phaseMollification E k) x v) 0) + (Metric.closedBall c r) volume := + ((hdiff.clm_apply continuous_const).max continuous_const).continuousOn.integrableOn_compact + (isCompact_closedBall c r) + have hpoint : ∀ x ∈ Metric.closedBall c r, + max (fderiv ℝ (phaseMollification E k) x v) 0 ≤ + (q ⋆[lsmul ℝ ℝ, μ] k) x := by + intro x hx + rw [phaseMollification_fderiv hn hmin hk hc x v hR (hs x hx)] + have h := positive_neg_convolution_le μ hf hk.continuous hc hp x + convert h using 1 + congr 2 + apply integral_congr_ae + exact ae_of_all _ fun y ↦ mul_comm _ _ + have htilt : Integrable (fun y ↦ ‖approximateNormal E y-v‖^2) μ := by + apply (integrable_const (4:ℝ)).mono' + (((measurable_approximateNormal hmin.1).sub measurable_const).norm.pow_const 2).aestronglyMeasurable + apply ae_of_all μ + intro y + rw [Real.norm_eq_abs,abs_of_nonneg (sq_nonneg _)] + have hb : ‖approximateNormal E y-v‖ ≤ 2 := + (norm_sub_le _ _).trans (by rw [hv]; linarith [approximateNormal_norm_le_one E y]) + change ‖approximateNormal E y-v‖^2 ≤ 4 + nlinarith [norm_nonneg (approximateNormal E y-v)] + calc + _ ≤ ∫ x in Metric.closedBall c r, (q ⋆[lsmul ℝ ℝ, μ] k) x := + setIntegral_mono_on hleft hconv.integrableOn measurableSet_closedBall hpoint + _ ≤ ∫ x, (q ⋆[lsmul ℝ ℝ, μ] k) x := + setIntegral_le_integral hconv (ae_of_all _ hpos) + _ = ∫ y, q y ∂μ := by rw [integral_convolution (lsmul ℝ ℝ) hq hki,hu]; simp + _ ≤ _ := by + dsimp [orientedTilt] + rw [le_div_iff₀ (by norm_num : (0:ℝ) < 2)] + rw [← integral_mul_const] + apply integral_mono (hq.mul_const 2) htilt + intro y + simpa only [q,f,mul_comm] using negative_normal_flux_le_tilt (approximateNormal E y) hv + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/NormalWindowTest.lean b/lean/OAI/Geometry/Perimeter/Regularity/NormalWindowTest.lean new file mode 100644 index 0000000000000000000000000000000000000000..b2b25c573ca55c067cd1a0154cac249b6ae598c8 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/NormalWindowTest.lean @@ -0,0 +1,175 @@ +import OAI.Geometry.Perimeter.Regularity.FiberMomentIntegration + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff Convolution InnerProductSpace +namespace RPISingularHarnack +open RPI.Boundary ContinuousLinearMap +variable {n : ℕ} + +abbrev normalProjection (v : Euc n) : Euc n →L[ℝ] normalPlane v := + (normalPlane v).orthogonalProjectionOnto + +@[simp] theorem normalProjection_fiber (v : Euc n) (y : normalPlane v) (s : ℝ) : + normalProjection v ((y:Euc n)+s•v) = y := by + have hv : normalProjection v v = 0 := + Submodule.orthogonalProjectionOnto_eq_zero_iff.mpr + ((ℝ ∙ v).le_orthogonal_orthogonal (Submodule.mem_span_singleton_self v)) + rw [map_add,map_smul,hv,smul_zero,add_zero] + exact Submodule.orthogonalProjectionOnto_mem_subspace_eq_self y + +@[simp] theorem normal_fiber_inner {v : Euc n} (hv : ‖v‖ = 1) + (y : normalPlane v) (s : ℝ) : inner ℝ v ((y:Euc n)+s•v) = s := by + rw [inner_add_right,real_inner_smul_right, + Submodule.mem_orthogonal_singleton_iff_inner_right.mp y.property, + real_inner_self_eq_norm_sq,hv] + ring + +def normalWindowTest (v : Euc n) (φ : normalPlane v → ℝ) (b : ℝ) (m : ℕ) + (x : Euc n) : ℝ := + {z : Euc n | |inner ℝ v z| ≤ b}.indicator + (fun z ↦ φ (normalProjection v z)*(inner ℝ v z)^m) x + +theorem normalWindowTest_measurable {v : Euc n} {φ : normalPlane v → ℝ} + (hφ : Continuous φ) (b : ℝ) (m : ℕ) : Measurable (normalWindowTest v φ b m) := + ((hφ.comp (normalProjection v).continuous).measurable.mul + ((continuous_const.inner continuous_id).pow m).measurable).indicator + (isClosed_le (continuous_const.inner continuous_id).abs continuous_const).measurableSet + +theorem normalWindowTest_bound {v : Euc n} {φ : normalPlane v → ℝ} + {M b : ℝ} (hM : ∀ y, ‖φ y‖ ≤ M) (hb : 0 ≤ b) (m : ℕ) (x : Euc n) : + ‖normalWindowTest v φ b m x‖ ≤ M*b^m := by + have hM0 : 0 ≤ M := (norm_nonneg (φ 0)).trans (hM 0) + by_cases hx : |inner ℝ v x| ≤ b + · simp only [normalWindowTest,Set.indicator_apply,Set.mem_ofPred_eq,ite_eq_left hx,norm_mul,norm_pow, + Real.norm_eq_abs] + exact mul_le_mul (hM _) (pow_le_pow_left₀ (abs_nonneg _) hx m) (pow_nonneg (abs_nonneg _) _) hM0 + · simp only [normalWindowTest,Set.indicator_apply,Set.mem_ofPred_eq,ite_eq_right hx,norm_zero] + exact mul_nonneg hM0 (pow_nonneg hb _) + +theorem normalWindowTest_continuousAt {v : Euc n} {φ : normalPlane v → ℝ} + (hφ : Continuous φ) {b : ℝ} (m : ℕ) {x : Euc n} (hx : |inner ℝ v x| < b) : + ContinuousAt (normalWindowTest v φ b m) x := by + have he : ∀ᶠ z in 𝓝 x, |inner ℝ v z| < b := + (continuous_const.inner continuous_id).abs.continuousAt.eventually (gt_mem_nhds hx) + have hc : Continuous (fun z ↦ φ (normalProjection v z)*(inner ℝ v z)^m) := + (hφ.comp (normalProjection v).continuous).mul ((continuous_const.inner continuous_id).pow m) + apply hc.continuousAt.congr + filter_upwards [he] with z hz + simp only [normalWindowTest,Set.indicator_apply,Set.mem_ofPred_eq,ite_eq_left hz.le] + +@[simp] theorem normalCoordinates_mem_normalCylinder {v : Euc n} (hv : ‖v‖ = 1) + (K : Set (normalPlane v)) (b : ℝ) (y : normalPlane v) (s : ℝ) : + (y:Euc n)+s•v ∈ normalCylinder v hv K b ↔ y ∈ K ∧ s ∈ Icc (-b) b := by + change normalCoordinates v hv (y,s) ∈ normalCoordinates v hv '' (K ×ˢ Icc (-b) b) ↔ _ + constructor + · rintro ⟨z,hz,he⟩ + have he' : z = (y,s) := (normalCoordinates v hv).injective he + simpa only [he',Set.mem_prod] using hz + · intro h + exact ⟨(y,s),h,rfl⟩ + +theorem normalWindowTest_eq_indicator {v : Euc n} (hv : ‖v‖ = 1) + (φ : normalPlane v → ℝ) (b : ℝ) (m : ℕ) : + normalWindowTest v φ b m = (normalCylinder v hv (tsupport φ) b).indicator + (fun x ↦ φ (normalProjection v x)*(inner ℝ v x)^m) := by + funext x + obtain ⟨⟨y,s⟩,rfl⟩ := (normalCoordinates v hv).surjective x + simp only [normalCoordinates_apply] + by_cases hy : y ∈ tsupport φ + · by_cases hs : s ∈ Icc (-b) b + · have hs' : |s| ≤ b := abs_le.mpr hs + simp [normalWindowTest,normal_fiber_inner hv,hs',normalCoordinates_mem_normalCylinder,hy,hs] + · have hs' : ¬ |s| ≤ b := fun h ↦ hs (abs_le.mp h) + simp [normalWindowTest,normal_fiber_inner hv,hs',normalCoordinates_mem_normalCylinder,hy,hs] + · have hz : φ y=0 := image_eq_zero_of_notMem_tsupport hy + simp [normalWindowTest,normal_fiber_inner hv,normalCoordinates_mem_normalCylinder, + hy,hz,Set.indicator_apply] + +theorem normalWindowTest_integrable {v : Euc n} (hv : ‖v‖ = 1) + {φ : normalPlane v → ℝ} (hφ : Continuous φ) (hcφ : HasCompactSupport φ) + (b : ℝ) (m : ℕ) : Integrable (normalWindowTest v φ b m) volume := by + rw [normalWindowTest_eq_indicator hv] + have hf : Continuous (fun x ↦ φ (normalProjection v x)*(inner ℝ v x)^m) := + (hφ.comp (normalProjection v).continuous).mul ((continuous_const.inner continuous_id).pow m) + exact (hf.continuousOn.integrableOn_compact (isCompact_normalCylinder hv hcφ b)).integrable_indicator + (isCompact_normalCylinder hv hcφ b).measurableSet + +theorem normalWindowTest_support_subset {v : Euc n} (hv : ‖v‖ = 1) + (φ : normalPlane v → ℝ) (b : ℝ) (m : ℕ) : + Function.support (normalWindowTest v φ b m) ⊆ normalCylinder v hv (tsupport φ) b := by + rw [normalWindowTest_eq_indicator hv] + exact Set.support_indicator_subset + +theorem normalWindowTest_mul_integrable {v : Euc n} (hv : ‖v‖ = 1) + {φ : normalPlane v → ℝ} (hφ : Continuous φ) (hcφ : HasCompactSupport φ) + (b : ℝ) (m : ℕ) {g : Euc n → ℝ} (hg : Continuous g) : + Integrable (fun x ↦ normalWindowTest v φ b m x*g x) volume := by + rw [normalWindowTest_eq_indicator hv] + have he : (fun x ↦ (normalCylinder v hv (tsupport φ) b).indicator + (fun z ↦ φ (normalProjection v z)*(inner ℝ v z)^m) x*g x) = + (normalCylinder v hv (tsupport φ) b).indicator + (fun x ↦ φ (normalProjection v x)*(inner ℝ v x)^m*g x) := by + funext x + by_cases hx : x ∈ normalCylinder v hv (tsupport φ) b <;> simp [hx] + rw [he] + have hf : Continuous (fun x ↦ φ (normalProjection v x)*(inner ℝ v x)^m*g x) := + ((hφ.comp (normalProjection v).continuous).mul ((continuous_const.inner continuous_id).pow m)).mul hg + exact (hf.continuousOn.integrableOn_compact (isCompact_normalCylinder hv hcφ b)).integrable_indicator + (isCompact_normalCylinder hv hcφ b).measurableSet + +theorem normalWindowTest_support_norm {v : Euc n} (hv : ‖v‖ = 1) + (φ : normalPlane v → ℝ) (b δ R : ℝ) (m : ℕ) + (hKR : ∀ y ∈ tsupport φ, ‖y‖+b+δ ≤ R) {x : Euc n} + (hx : normalWindowTest v φ b m x ≠ 0) : ‖x‖+δ ≤ R := by + obtain ⟨⟨y,s⟩,⟨hy,hs⟩,rfl⟩ := normalWindowTest_support_subset hv φ b m hx + have h := norm_add_le (y:Euc n) (s•v) + rw [norm_smul,hv,mul_one,Real.norm_eq_abs] at h + have hs' : |s| ≤ b := abs_le.mpr hs + have hyR := hKR y hy + change ‖(y:Euc n)‖+b+δ ≤ R at hyR + change ‖(y:Euc n)+s•v‖+δ ≤ R + linarith + +theorem normalWindowTest_integral {v : Euc n} (hv : ‖v‖ = 1) + {φ : normalPlane v → ℝ} (hφ : Continuous φ) (hcφ : HasCompactSupport φ) + {b : ℝ} (hb : 0 ≤ b) (m : ℕ) {g : Euc n → ℝ} (hg : Continuous g) : + (∫ x, normalWindowTest v φ b m x*g x) = + ∫ y in tsupport φ, φ y*(∫ s in (-b)..b, s^m*g ((y:Euc n)+s•v)) := by + let f : Euc n → ℝ := fun x ↦ φ (normalProjection v x)*(inner ℝ v x)^m*g x + have hf : Continuous f := ((hφ.comp (normalProjection v).continuous).mul + ((continuous_const.inner continuous_id).pow m)).mul hg + have he : (fun x ↦ normalWindowTest v φ b m x*g x) = + (normalCylinder v hv (tsupport φ) b).indicator f := by + funext x + obtain ⟨⟨y,s⟩,rfl⟩ := (normalCoordinates v hv).surjective x + simp only [normalCoordinates_apply] + by_cases hy : y ∈ tsupport φ + · by_cases hs : s ∈ Icc (-b) b + · have hs' : |s| ≤ b := abs_le.mpr hs + simp [normalWindowTest,normal_fiber_inner hv,hs',normalCoordinates_mem_normalCylinder, + hy,hs,f] + · have hs' : ¬ |s| ≤ b := fun h ↦ hs (abs_le.mp h) + simp [normalWindowTest,normal_fiber_inner hv,hs',normalCoordinates_mem_normalCylinder, + hy,hs,f] + · have hz : φ y=0 := image_eq_zero_of_notMem_tsupport hy + simp [normalWindowTest,normal_fiber_inner hv,normalCoordinates_mem_normalCylinder, + hy,f,hz,Set.indicator_apply] + rw [he,integral_indicator (isCompact_normalCylinder hv hcφ b).measurableSet, + integral_normalCylinder hv hcφ hb hf] + apply setIntegral_congr_fun hcφ.measurableSet + intro y _ + dsimp only [f] + simp_rw [normalProjection_fiber,normal_fiber_inner hv] + rw [← intervalIntegral.integral_const_mul] + congr 1 + funext s + ring + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/NormalizedHeight.lean b/lean/OAI/Geometry/Perimeter/Regularity/NormalizedHeight.lean new file mode 100644 index 0000000000000000000000000000000000000000..a7d5aae9c0d0a882e8656a9194dab3122f26721b --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/NormalizedHeight.lean @@ -0,0 +1,205 @@ +import OAI.Geometry.Perimeter.Regularity.FiberCompactness +import OAI.Geometry.Perimeter.Regularity.FiberAveraging +import OAI.Geometry.Perimeter.Regularity.WindowAverage +import OAI.Geometry.Perimeter.Regularity.HeightCompactness + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff Convolution +namespace RPISingularHarnack +open RPI.Boundary + +def normalizedWindowHeight {n : ℕ} (v : Euc n) (T a : ℝ) + (f : Euc n → ℝ) (x : Euc n) : ℝ := a⁻¹ * normalWindowAverage v T f x + +theorem normalizedWindowHeight_measurable {n : ℕ} {f : Euc n → ℝ} + (hf : Measurable f) (v : Euc n) (T a : ℝ) : + Measurable (normalizedWindowHeight v T a f) := + (normalWindowAverage_stronglyMeasurable hf v T).measurable.const_mul _ + +theorem normalizedWindowHeight_lintegral_le {n : ℕ} {f : Euc n → ℝ} + (hf : Measurable f) (v : Euc n) {T a V : ℝ} (ha : 0 < a) + (hT : 0 ≤ T) (hV : 0 ≤ V) + (hm : (∫⁻ x, ‖f x‖ₑ) ≤ ENNReal.ofReal (a*V)) : + (∫⁻ x, ‖normalizedWindowHeight v T a f x‖ₑ) ≤ ENNReal.ofReal (2*T*V) := by + have he : (∫⁻ x, ‖normalizedWindowHeight v T a f x‖ₑ) = + ENNReal.ofReal a⁻¹ * ∫⁻ x, ‖normalWindowAverage v T f x‖ₑ := by + simp only [normalizedWindowHeight] + simp_rw [enorm_mul] + rw [show ‖a⁻¹‖ₑ = ENNReal.ofReal a⁻¹ by + rw [← ofReal_norm,Real.norm_eq_abs,abs_of_pos (inv_pos.mpr ha)]] + exact lintegral_const_mul _ (normalWindowAverage_stronglyMeasurable hf v T).measurable.enorm + rw [he] + calc + _ ≤ ENNReal.ofReal a⁻¹ * (ENNReal.ofReal (2*T) * ENNReal.ofReal (a*V)) := + mul_le_mul_right ((normalWindowAverage_lintegral_le hf v T).trans + (mul_le_mul_right hm _)) _ + _ = _ := by + rw [← ENNReal.ofReal_mul (by positivity), + ← ENNReal.ofReal_mul' (mul_nonneg (mul_nonneg (by norm_num) hT) (mul_nonneg ha.le hV))] + congr 1 + field_simp + +theorem normalizedWindowHeight_integrable {n : ℕ} {f : Euc n → ℝ} + (hf : Measurable f) (v : Euc n) {T a V : ℝ} (ha : 0 < a) + (hT : 0 ≤ T) (hV : 0 ≤ V) + (hm : (∫⁻ x, ‖f x‖ₑ) ≤ ENNReal.ofReal (a*V)) : + Integrable (normalizedWindowHeight v T a f) volume := by + refine ⟨(normalizedWindowHeight_measurable hf v T a).aestronglyMeasurable, ?_⟩ + exact (normalizedWindowHeight_lintegral_le hf v ha hT hV hm).trans_lt ENNReal.ofReal_lt_top + +theorem normalizedWindowHeight_translation_le {n : ℕ} {f : Euc n → ℝ} + (hf : Measurable f) {C : ℝ} (hb : ∀ x, ‖f x‖ ≤ C) + {v : Euc n} (hv : ‖v‖ = 1) {T a H V : ℝ} (ha : 0 < a) + (hT : 0 ≤ T) (hH : 0 ≤ H) (hV : 0 ≤ V) + (hm : (∫⁻ x, ‖f x‖ₑ) ≤ ENNReal.ofReal (a*V)) + (hh : ∀ z, inner ℝ v z = 0 → + (∫⁻ x, ‖f (x+z)-f x‖ₑ) ≤ ENNReal.ofReal (‖z‖*(a*H))) (w : Euc n) : + (∫⁻ x, ‖normalizedWindowHeight v T a f (x+w)-normalizedWindowHeight v T a f x‖ₑ) ≤ + ‖w‖ₑ * ENNReal.ofReal (4*T*H+4*V) := by + have he : (∫⁻ x, ‖normalizedWindowHeight v T a f (x+w)-normalizedWindowHeight v T a f x‖ₑ) = + ENNReal.ofReal a⁻¹ * ∫⁻ x, ‖normalWindowAverage v T f (x+w)-normalWindowAverage v T f x‖ₑ := by + simp only [normalizedWindowHeight,← mul_sub] + simp_rw [enorm_mul] + rw [show ‖a⁻¹‖ₑ = ENNReal.ofReal a⁻¹ by + rw [← ofReal_norm,Real.norm_eq_abs,abs_of_pos (inv_pos.mpr ha)]] + apply lintegral_const_mul + exact (((normalWindowAverage_stronglyMeasurable hf v T).measurable.comp + (measurable_id.add measurable_const)).sub + (normalWindowAverage_stronglyMeasurable hf v T).measurable).enorm + rw [he] + calc + _ ≤ ENNReal.ofReal a⁻¹ * ENNReal.ofReal (‖w‖*(4*T*(a*H)+4*(a*V))) := + mul_le_mul_right (normalWindowAverage_all_translation_le hf hb hv hT + (by positivity) (by positivity) hm hh w) _ + _ = _ := by + rw [← ofReal_norm,← ENNReal.ofReal_mul (by positivity), + ← ENNReal.ofReal_mul (norm_nonneg _)] + congr 1 + field_simp + +theorem normalizedWindowHeight_subsequence {n : ℕ} + (K : Set (Euc n)) (hK : IsCompact K) (f : ℕ → Euc n → ℝ) + (hm : ∀ i, Measurable (f i)) (C : ℝ) (hb : ∀ i x, ‖f i x‖ ≤ C) + {v : Euc n} (hv : ‖v‖ = 1) {T H V : ℝ} + (hT : 0 ≤ T) (hH : 0 ≤ H) (hV : 0 ≤ V) + (a : ℕ → ℝ) (ha : ∀ i, 0 < a i) + (hmass : ∀ i, (∫⁻ x, ‖f i x‖ₑ) ≤ ENNReal.ofReal (a i*V)) + (hhor : ∀ i z, inner ℝ v z = 0 → + (∫⁻ x, ‖f i (x+z)-f i x‖ₑ) ≤ ENNReal.ofReal (‖z‖*(a i*H))) : + ∃ hi : ∀ i, Integrable (normalizedWindowHeight v T (a i) (f i)) volume, + ∃ g : Lp ℝ 1 (volume.comap (Subtype.val : K → Euc n)), + ∃ σ : ℕ → ℕ, StrictMono σ ∧ + Tendsto (fun i ↦ compactFunctionLp K hK + (normalizedWindowHeight v T (a (σ i)) (f (σ i))) (hi (σ i))) atTop (𝓝 g) := by + have hi := fun i ↦ normalizedWindowHeight_integrable (hm i) v (ha i) hT hV (hmass i) + refine ⟨hi, ?_⟩ + refine compactFunctionLp_subsequence_of_translation K hK _ + (fun i ↦ normalizedWindowHeight_measurable (hm i) v T (a i)) hi + (2*T*V) (by positivity) ?_ (ENNReal.ofReal (4*T*H+4*V)) ENNReal.ofReal_ne_top ?_ + · intro i + have h := normalizedWindowHeight_lintegral_le (hm i) v (ha i) hT hV (hmass i) + rw [← ofReal_integral_norm_eq_lintegral_enorm (hi i)] at h + exact (ENNReal.ofReal_le_ofReal_iff (by positivity)).mp h + · intro i w + exact normalizedWindowHeight_translation_le (hm i) (hb i) hv (ha i) hT hH hV + (hmass i) (hhor i) w + +theorem normalWindowAverage_eq_normalFiberAverage {n : ℕ} + {f : Euc n → ℝ} {v : Euc n} (hv : ‖v‖ = 1) {R T : ℝ} + (hs : Function.support f ⊆ Metric.ball 0 R) (x : Euc n) + (hT : R+‖x‖ ≤ T) : + normalWindowAverage v T f x = normalFiberAverage v f x := by + unfold normalWindowAverage normalFiberAverage + apply integral_congr_ae + apply ae_of_all + intro s + by_cases ht : s ∈ Icc (-T) T + · simp [lineWindow,ht] + · have hz : f (x+s•v) = 0 := by + by_contra hz + have hi := fiber_support_subset_interval hv hs x hz + exact ht ((Icc_subset_Icc (by linarith) hT) hi) + simp [hz] + +theorem cutoffPhaseError_norm_le_one {n : ℕ} (E : Set (Euc n)) (v : Euc n) + {η : Euc n → ℝ} (hη : ∀ x, ‖η x‖ ≤ 1) (x : Euc n) : + ‖cutoffPhaseError E v η x‖ ≤ 1 := by + unfold cutoffPhaseError + rw [norm_mul] + have h : ‖E.indicator (fun _ ↦ (1:ℝ)) x - + {z | inner ℝ v z < 0}.indicator (fun _ ↦ (1:ℝ)) x‖ ≤ 1 := by + by_cases he : x ∈ E <;> by_cases hh : inner ℝ v x < 0 <;> simp [he,hh] + exact (mul_le_mul (hη x) h (norm_nonneg _) zero_le_one).trans_eq (one_mul _) + +theorem cutoffPhaseError_lintegral_height_le {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) {v : Euc n} (hv : ‖v‖ = 1) + {η : Euc n → ℝ} (hη : Measurable η) (hb : ∀ x, ‖η x‖ ≤ 1) + {R a : ℝ} (hR : 0 < R) (ha : 0 ≤ a) + (hs : Function.support η ⊆ Metric.ball 0 R) + (hphase : ∀ᵐ x ∂volume, x ∈ Metric.ball 0 R → a < |inner ℝ v x| → + (x ∈ E ↔ inner ℝ v x < 0)) : + (∫⁻ x, ‖cutoffPhaseError E v η x‖ₑ) ≤ + ENNReal.ofReal (a*(volume.real (Metric.ball (0:Euc n) (2*R))/R)) := by + have hmass := slab_lintegral_bound (cutoffPhaseError_measurable hE v hη) hv ha hR + ((cutoffPhaseError_support E v η).trans hs) + (cutoffPhaseError_slab_bound E v η hs hb hphase) + have hfinite : volume (Metric.ball (0:Euc n) (2*R)) ≠ ⊤ := measure_ball_lt_top.ne + have hnorm : ENNReal.ofReal (a*(volume.real (Metric.ball (0:Euc n) (2*R))/R)) = + (ENNReal.ofReal (2*a)*volume (Metric.ball (0:Euc n) (2*R))) / ENNReal.ofReal (2*R) := by + rw [← ENNReal.ofReal_toReal hfinite] + simp only [← ENNReal.ofReal_mul (by positivity : 0 ≤ 2*a), + ← ENNReal.ofReal_div_of_pos (by positivity : 0 < 2*R)] + congr 1 + change a*((volume (Metric.ball (0:Euc n) (2*R))).toReal/R) = + 2*a*(volume (Metric.ball (0:Euc n) (2*R))).toReal/(2*R) + field_simp + rw [hnorm] + exact (ENNReal.le_div_iff_mul_le (Or.inl (ENNReal.ofReal_pos.mpr (by positivity)).ne') + (Or.inl ENNReal.ofReal_ne_top)).mpr + (by simpa only [mul_comm] using hmass) + +theorem minimizing_normalized_height_subsequence {n : ℕ} (hn : 1 < n) + (K : Set (Euc n)) (hK : IsCompact K) (E : ℕ → Set (Euc n)) + (hmin : ∀ i, IsLocallyPerimeterMinimizing (E i)) + {v : Euc n} (hv : ‖v‖ = 1) + {η : Euc n → ℝ} (hη : ContDiff ℝ ∞ η) (hc : HasCompactSupport η) + (hb : ∀ x, ‖η x‖ ≤ 1) {R T L P : ℝ} (hR : 0 < R) (hT : 0 ≤ T) + (hL : 0 ≤ L) (hP : 0 ≤ P) (hs : tsupport η ⊆ Metric.ball 0 R) + (hgrad : ∀ x ∈ Metric.ball 0 R, ‖gradient η x‖ ≤ L) + (a : ℕ → ℝ) (ha : ∀ i, 0 < a i) + (hheight : ∀ i x, x ∈ perimeterSupport (E i) ∩ Metric.ball 0 R → |inner ℝ v x| ≤ a i) + (hper : ∀ i, (perimeter (E i) (Metric.ball 0 R)).toReal ≤ P) + (hphase : ∀ i, ∀ᵐ x ∂volume, x ∈ Metric.ball 0 R → a i < |inner ℝ v x| → + (x ∈ E i ↔ inner ℝ v x < 0)) : + ∃ hi : ∀ i, Integrable (normalizedWindowHeight v T (a i) (cutoffPhaseError (E i) v η)) volume, + ∃ g : Lp ℝ 1 (volume.comap (Subtype.val : K → Euc n)), + ∃ σ : ℕ → ℕ, StrictMono σ ∧ + Tendsto (fun i ↦ compactFunctionLp K hK + (normalizedWindowHeight v T (a (σ i)) (cutoffPhaseError (E (σ i)) v η)) + (hi (σ i))) atTop (𝓝 g) := by + let V := volume.real (Metric.ball (0:Euc n) (2*R))/R + have hV : 0 ≤ V := div_nonneg measureReal_nonneg hR.le + apply normalizedWindowHeight_subsequence K hK (fun i ↦ cutoffPhaseError (E i) v η) + (fun i ↦ cutoffPhaseError_measurable (hmin i).1 v hη.continuous.measurable) + 1 (fun i x ↦ cutoffPhaseError_norm_le_one (E i) v hb x) hv hT + (H := L*(V+2*P)) (by positivity) hV a ha + · intro i + exact cutoffPhaseError_lintegral_height_le (hmin i).1 hv hη.continuous.measurable hb + hR (ha i).le ((show Function.support η ⊆ tsupport η from subset_closure).trans hs) (hphase i) + · intro i z hz + apply (cutoffPhaseError_horizontal_translation_le hn (hmin i) hv hz hη hc hR hs + (ha i).le hL (hheight i) hgrad (hphase i)).trans + apply ENNReal.ofReal_le_ofReal + have hai := (ha i).le + have hp := mul_le_mul_of_nonneg_left (hper i) (by positivity : 0 ≤ ‖z‖*a i*L*2) + dsimp [V] + nlinarith + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/PairedCutTest.lean b/lean/OAI/Geometry/Perimeter/Regularity/PairedCutTest.lean new file mode 100644 index 0000000000000000000000000000000000000000..2cd39f0577bdb000c5ebf7c02926c34366d44af2 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/PairedCutTest.lean @@ -0,0 +1,524 @@ +import OAI.Geometry.Perimeter.Regularity.GradientContDiff + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +def pairedCutTest {n : ℕ} (c : Euc n) (a b : ℝ) + (V W : Euc n → Euc n) (x : Euc n) : Euc n := + V x + annularCutoff c a b x • (W x - V x) + +theorem pairedCutTest_eq {n : ℕ} (c : Euc n) (a b : ℝ) + (V W : Euc n → Euc n) (x : Euc n) : + pairedCutTest c a b V W x = + (1 - annularCutoff c a b x) • V x + annularCutoff c a b x • W x := by + unfold pairedCutTest + module + +theorem pairedCutTest_admissible {n : ℕ} {U : Set (Euc n)} + {V W : Euc n → Euc n} (hV : PerimeterAdmissible univ V) + (hW : PerimeterAdmissible U W) {c : Euc n} {a b : ℝ} + (ha : 0 < a) (hab : a < b) (hB : Metric.closedBall c b ⊆ U) : + PerimeterAdmissible U (pairedCutTest c a b V W) := by + have hs : tsupport (pairedCutTest c a b V W) ⊆ Metric.closedBall c b ∪ tsupport W := by + apply closure_minimal + · intro x hx + by_contra hh + have hxb : b ≤ dist x c := le_of_lt (lt_of_not_ge (fun hb ↦ hh (Or.inl hb))) + have hxW : x ∉ tsupport W := fun hw ↦ hh (Or.inr hw) + exact hx (by simp [pairedCutTest, annularCutoff_one ha hab hxb, + image_eq_zero_of_notMem_tsupport hxW]) + · exact Metric.isClosed_closedBall.union (isClosed_tsupport _) + refine ⟨hV.1.add ((annularCutoff_contDiff c a b).smul (hW.1.sub hV.1)), + ((isCompact_closedBall c b).union hW.2.1).of_isClosed_subset (isClosed_tsupport _) hs, + hs.trans (union_subset hB hW.2.2.1), ?_⟩ + intro x + rw [pairedCutTest_eq] + have hη := annularCutoff_mem_Icc c a b x + calc + _ ≤ ‖(1 - annularCutoff c a b x) • V x‖ + ‖annularCutoff c a b x • W x‖ := norm_add_le _ _ + _ = (1 - annularCutoff c a b x) * ‖V x‖ + annularCutoff c a b x * ‖W x‖ := by + simp [norm_smul, Real.norm_eq_abs, abs_of_nonneg hη.1, abs_of_nonneg (sub_nonneg.mpr hη.2)] + _ ≤ (1 - annularCutoff c a b x) * 1 + annularCutoff c a b x * 1 := + add_le_add (mul_le_mul_of_nonneg_left (hV.2.2.2 x) (sub_nonneg.mpr hη.2)) + (mul_le_mul_of_nonneg_left (hW.2.2.2 x) hη.1) + _ = 1 := by ring + +theorem divergence_sub {n : ℕ} {V W : Euc n → Euc n} + (hV : Differentiable ℝ V) (hW : Differentiable ℝ W) : + divergence (V - W) = divergence V - divergence W := by + funext x + simp only [divergence, fderiv_sub (hV x) (hW x), sub_apply, + inner_sub_right, Finset.sum_sub_distrib, Pi.sub_apply] + +theorem divergence_pairedCutTest {n : ℕ} {c : Euc n} {a b : ℝ} + {V W : Euc n → Euc n} (hV : ContDiff ℝ ∞ V) (hW : ContDiff ℝ ∞ W) (x : Euc n) : + divergence (pairedCutTest c a b V W) x = + divergence V x + annularCutoff c a b x * (divergence W x - divergence V x) + + inner ℝ (gradient (annularCutoff c a b) x) (W x - V x) := by + have hdV := hV.differentiable (by norm_num) + have hdW := hW.differentiable (by norm_num) + have hdη := (annularCutoff_contDiff c a b).differentiable (by norm_num) + change divergence (V + (fun y ↦ annularCutoff c a b y • (W - V) y)) x = _ + rw [divergence_add (W := fun y ↦ annularCutoff c a b y • (W - V) y) + hdV (hdη.smul (hdW.sub hdV))] + change divergence V x + divergence (fun y ↦ annularCutoff c a b y • (W y - V y)) x = _ + rw [divergence_smul (V := fun y ↦ W y - V y) hdη (hdW.sub hdV)] + rw [show divergence (fun y ↦ W y - V y) x = divergence W x - divergence V x from + congrFun (divergence_sub hdW hdV) x] + ring + +theorem integrable_annularCutoff_mul {n : ℕ} {f : Euc n → ℝ} + (hf : Integrable f volume) (c : Euc n) (a b : ℝ) : + Integrable (fun x ↦ annularCutoff c a b x * f x) volume := by + apply hf.norm.mono' (((annularCutoff_contDiff c a b).continuous.aestronglyMeasurable).mul + hf.aestronglyMeasurable) + filter_upwards [] with x + change ‖annularCutoff c a b x * f x‖ ≤ ‖f x‖ + rw [norm_mul, Real.norm_eq_abs, abs_of_nonneg (annularCutoff_mem_Icc c a b x).1] + exact mul_le_of_le_one_left (norm_nonneg _) (annularCutoff_mem_Icc c a b x).2 + +theorem integral_pairedCut_le {n : ℕ} {E U : Set (Euc n)} + {V W : Euc n → Euc n} (hV : PerimeterAdmissible univ V) + (hW : PerimeterAdmissible U W) {c : Euc n} {a b : ℝ} + (ha : 0 < a) (hab : a < b) (hB : Metric.closedBall c b ⊆ U) + (hfin : perimeter E U ≠ ⊤) : + (∫ x in E, divergence V x + annularCutoff c a b x * (divergence W x - divergence V x)) ≤ + (perimeter E U).toReal + 2 * ∫ x in E, ‖gradient (annularCutoff c a b) x‖ := by + have hZ := pairedCutTest_admissible hV hW ha hab hB + have hdV := integrable_divergence hV.1 hV.2.1 + have hdW := integrable_divergence hW.1 hW.2.1 + have hm : Integrable (fun x ↦ divergence V x + + annularCutoff c a b x * (divergence W x - divergence V x)) volume := + hdV.add (integrable_annularCutoff_mul (hdW.sub hdV) c a b) + have hg : Integrable (fun x ↦ ‖gradient (annularCutoff c a b) x‖) volume := + ((gradient_annularCutoff_continuous c a b).integrable_of_hasCompactSupport + (gradient_annularCutoff_compact c ha hab)).norm + have hinner : ∀ x, |inner ℝ (gradient (annularCutoff c a b) x) (W x - V x)| ≤ + 2 * ‖gradient (annularCutoff c a b) x‖ := by + intro x + calc + _ ≤ ‖gradient (annularCutoff c a b) x‖ * ‖W x - V x‖ := abs_real_inner_le_norm _ _ + _ ≤ ‖gradient (annularCutoff c a b) x‖ * 2 := by + gcongr + exact (norm_sub_le _ _).trans (by linarith [hV.2.2.2 x, hW.2.2.2 x]) + _ = _ := by ring + have hi : Integrable (fun x ↦ inner ℝ (gradient (annularCutoff c a b) x) (W x - V x)) volume := + (hg.const_mul 2).mono' + ((gradient_annularCutoff_continuous c a b).inner (hW.1.continuous.sub hV.1.continuous)).aestronglyMeasurable + (Eventually.of_forall hinner) + have hp : (∫ x in E, divergence (pairedCutTest c a b V W) x) ≤ (perimeter E U).toReal := by + apply (ENNReal.ofReal_le_iff_le_toReal hfin).mp + rw [perimeter_eq_iSup_tests] + exact le_iSup_of_le _ (le_iSup_of_le hZ le_rfl) + simp_rw [divergence_pairedCutTest hV.1 hW.1] at hp + rw [integral_add hm.integrableOn hi.integrableOn] at hp + have herr : -(∫ x in E, inner ℝ (gradient (annularCutoff c a b) x) (W x - V x)) ≤ + 2 * ∫ x in E, ‖gradient (annularCutoff c a b) x‖ := by + rw [← integral_neg, ← integral_const_mul] + exact integral_mono hi.integrableOn.neg (hg.const_mul 2).integrableOn + (fun x ↦ (neg_le_abs _).trans (hinner x)) + linarith + +theorem tendsto_integral_annularCutoff_mul {n : ℕ} {E : Set (Euc n)} + {f : Euc n → ℝ} (hf : Integrable f volume) (c : Euc n) {r : ℝ} (hr : 0 < r) : + Tendsto (fun δ : ℝ ↦ ∫ x in E, annularCutoff c (r + δ) (r + 2 * δ) x * f x) + (𝓝[>] (0 : ℝ)) (𝓝 (∫ x in E \ Metric.closedBall c r, f x)) := by + have ht := tendsto_integral_filter_of_dominated_convergence + (μ := volume.restrict E) (l := 𝓝[>] (0 : ℝ)) + (F := fun δ x ↦ annularCutoff c (r + δ) (r + 2 * δ) x * f x) + (f := (Metric.closedBall c r)ᶜ.indicator f) (fun x ↦ ‖f x‖) + (Eventually.of_forall fun δ ↦ (integrable_annularCutoff_mul hf c _ _).integrableOn.aestronglyMeasurable) + (Eventually.of_forall fun δ ↦ Eventually.of_forall fun x ↦ by + rw [norm_mul, Real.norm_eq_abs, abs_of_nonneg (annularCutoff_mem_Icc c _ _ x).1] + exact mul_le_of_le_one_left (norm_nonneg _) (annularCutoff_mem_Icc c _ _ x).2) + hf.norm.integrableOn (Eventually.of_forall fun x ↦ ?_) + · simpa only [integral_indicator measurableSet_closedBall.compl, + Measure.restrict_restrict measurableSet_closedBall.compl, inter_comm, ← sdiff_eq] using ht + · convert (annularCutoff_tendsto c x hr).mul (tendsto_const_nhds (x := f x)) using 1 + by_cases hx : x ∈ (Metric.closedBall c r)ᶜ <;> simp [hx] + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem nonnegative_perimeter_test_replacement {n : ℕ} (E U : Set (Euc n)) + {V : Euc n → Euc n} (hV : PerimeterAdmissible U V) : + ∃ W : Euc n → Euc n, PerimeterAdmissible U W ∧ + 0 ≤ ∫ x in E, divergence W x ∧ + ENNReal.ofReal (∫ x in E, divergence W x) = ENNReal.ofReal (∫ x in E, divergence V x) := by + by_cases h : 0 ≤ ∫ x in E, divergence V x + · exact ⟨V, hV, h, rfl⟩ + · refine ⟨fun _ ↦ 0, perimeterAdmissible_zero U, ?_, ?_⟩ + · simp [divergence] + · rw [ENNReal.ofReal_of_nonpos (le_of_not_ge h)] + simp [divergence] + +theorem perimeter_add_le_of_pair_integrals {n : ℕ} (E F U V : Set (Euc n)) (K : ℝ) + (h : ∀ X Y : Euc n → Euc n, PerimeterAdmissible U X → PerimeterAdmissible V Y → + (∫ x in E, divergence X x) + (∫ x in F, divergence Y x) ≤ K) : + perimeter E U + perimeter F V ≤ ENNReal.ofReal K := by + rw [perimeter_eq_iSup_tests, perimeter_eq_iSup_tests] + apply ENNReal.biSup_add_biSup_le' ⟨_, perimeterAdmissible_zero U⟩ ⟨_, perimeterAdmissible_zero V⟩ + intro X hX Y hY + obtain ⟨X', hX', hnX, hvalX⟩ := nonnegative_perimeter_test_replacement E U hX + obtain ⟨Y', hY', hnY, hvalY⟩ := nonnegative_perimeter_test_replacement F V hY + rw [← hvalX, ← hvalY, ← ENNReal.ofReal_add hnX hnY] + exact ENNReal.ofReal_le_ofReal (h X' Y' hX' hY') + +theorem controlled_radius_perimeter_cut {n : ℕ} {E U : Set (Euc n)} + (hE : MeasurableSet E) (c : Euc n) {r B D L : ℝ} + (hr : 0 < r) (hrB : r < B) (hBU : Metric.closedBall c B ⊆ U) + (hcontrol : ∀ t ∈ Icc r B, + volume.real (E ∩ Metric.closedBall c t) - volume.real (E ∩ Metric.closedBall c r) ≤ + D * (t - r)) + (hD : 0 ≤ D) (hL : 0 < L) + (hbound : ∀ s, |deriv Real.smoothTransition s| ≤ L) + (hfin : perimeter E U ≠ ⊤) : + perimeter (E ∩ Metric.closedBall c r) univ + perimeter (E \ Metric.closedBall c r) U ≤ + perimeter E U + ENNReal.ofReal (8 * L * D) := by + rw [← ENNReal.ofReal_toReal hfin, ← ENNReal.ofReal_add ENNReal.toReal_nonneg (by positivity)] + apply perimeter_add_le_of_pair_integrals + intro V W hV hW + have hdV := integrable_divergence hV.1 hV.2.1 + have hdW := integrable_divergence hW.1 hW.2.1 + have ht : Tendsto (fun δ : ℝ ↦ ∫ x in E, + divergence V x + annularCutoff c (r + δ) (r + 2 * δ) x * (divergence W x - divergence V x)) + (𝓝[>] (0 : ℝ)) (𝓝 ((∫ x in E ∩ Metric.closedBall c r, divergence V x) + + (∫ x in E \ Metric.closedBall c r, divergence W x))) := by + have hlim := (tendsto_const_nhds (x := ∫ x in E, divergence V x)).add + (tendsto_integral_annularCutoff_mul (E := E) (hdW.sub hdV) c hr) + have heq : (∫ x in E, divergence V x) + + (∫ x in E \ Metric.closedBall c r, (divergence W - divergence V) x) = + (∫ x in E ∩ Metric.closedBall c r, divergence V x) + + (∫ x in E \ Metric.closedBall c r, divergence W x) := by + simp only [Pi.sub_apply] + rw [integral_sub hdW.integrableOn hdV.integrableOn] + have hsplit := integral_inter_add_sdiff (s := E) (t := Metric.closedBall c r) measurableSet_closedBall hdV.integrableOn + linarith + rw [heq] at hlim + convert hlim using 1 + ext δ + exact integral_add hdV.integrableOn + (integrable_annularCutoff_mul (hdW.sub hdV) c _ _).integrableOn + apply le_of_tendsto ht + filter_upwards [self_mem_nhdsWithin, + nhdsWithin_le_nhds (gt_mem_nhds (show (0 : ℝ) < (B - r) / 2 by linarith))] with δ hδ hsmall + change 0 < δ at hδ + change δ < (B - r) / 2 at hsmall + have hδB : r + 2 * δ ≤ B := by linarith + have hp := integral_pairedCut_le hV hW (c := c) + (show 0 < r + δ by positivity) (show r + δ < r + 2 * δ by linarith) + ((Metric.closedBall_subset_closedBall hδB).trans hBU) hfin + have hg := controlled_radius_gradient_bound hE c hr hδ hδB hcontrol hD hL hbound + linarith + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem minimizing_controlled_radius_perimeter_le {n : ℕ} {E : Set (Euc n)} + (hmin : IsLocallyPerimeterMinimizing E) (c : Euc n) {r B D L : ℝ} + (hr : 0 < r) (hrB : r < B) + (hcontrol : ∀ t ∈ Icc r B, + volume.real (E ∩ Metric.closedBall c t) - volume.real (E ∩ Metric.closedBall c r) ≤ + D * (t - r)) + (hD : 0 ≤ D) (hL : 0 < L) + (hbound : ∀ s, |deriv Real.smoothTransition s| ≤ L) : + perimeter (E ∩ Metric.closedBall c r) univ ≤ ENNReal.ofReal (8 * L * D) := by + let U := Metric.ball c (B + 1) + let F := E \ Metric.closedBall c r + have hfin : perimeter E U ≠ ⊤ := (hmin.2.1 c (B + 1) (by linarith)).ne + have hcut := controlled_radius_perimeter_cut hmin.1 c hr hrB + (show Metric.closedBall c B ⊆ U from Metric.closedBall_subset_ball (by linarith)) + hcontrol hD hL hbound hfin + have hcl : closure (symmDiff E F) ⊆ Metric.closedBall c r := by + apply closure_minimal _ Metric.isClosed_closedBall + intro x hx + by_contra hc + rcases hx with hx | hx + · exact hx.2 ⟨hx.1, hc⟩ + · exact hx.2 hx.1.1 + have hcmp : perimeter E U ≤ perimeter F U := + hmin.2.2 c (B + 1) (by linarith) F (hmin.1.diff measurableSet_closedBall) + ((isCompact_closedBall c r).of_isClosed_subset isClosed_closure hcl) + (hcl.trans (Metric.closedBall_subset_ball (by linarith))) + have hout : perimeter F U ≠ ⊤ := ne_top_of_le_ne_top + (ENNReal.add_ne_top.mpr ⟨hfin, ENNReal.ofReal_ne_top⟩) + ((le_add_left le_rfl).trans hcut) + have hlast := hcut.trans (add_le_add hcmp le_rfl) + rw [add_comm (perimeter (E ∩ Metric.closedBall c r) univ)] at hlast + exact (ENNReal.add_le_add_iff_left hout).mp hlast + +theorem exists_minimizing_volume_cut {n : ℕ} {E : Set (Euc n)} + (hmin : IsLocallyPerimeterMinimizing E) (c : Euc n) {a b L : ℝ} + (ha : 0 < a) (hab : a < b) + (hv : 0 < volume.real (E ∩ Metric.closedBall c b)) + (hL : 0 < L) (hbound : ∀ s, |deriv Real.smoothTransition s| ≤ L) : + ∃ r ∈ Ico a b, perimeter (E ∩ Metric.closedBall c r) univ ≤ + ENNReal.ofReal (16 * L * volume.real (E ∩ Metric.closedBall c b) / (b - a)) := by + let D := 2 * volume.real (E ∩ Metric.closedBall c b) / (b - a) + have hD : 0 < D := by dsimp [D]; positivity + have hDwidth : D * (b - a) = 2 * volume.real (E ∩ Metric.closedBall c b) := by + dsimp [D] + exact div_mul_cancel₀ _ (sub_pos.mpr hab).ne' + obtain ⟨r, hr, hcontrol⟩ := exists_controlled_cut_radius E c ha hab + (show volume.real (E ∩ Metric.closedBall c b) < D * (b - a) by rw [hDwidth]; linarith) + refine ⟨r, hr, ?_⟩ + have h := minimizing_controlled_radius_perimeter_le hmin c (ha.trans_le hr.1) hr.2 + hcontrol hD.le hL hbound + convert h using 1 + dsimp [D] + congr 1 + ring + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem nonlinear_iteration_geometric_bound {u : ℕ → ℝ} {p C B A q : ℝ} + (hp : 0 ≤ p) (hC : 0 ≤ C) (hB : 0 ≤ B) (hA : 0 ≤ A) (hq : 0 ≤ q) + (hu : ∀ i, 0 ≤ u i) (hstart : u 0 ≤ A) + (hstep : ∀ i, u (i + 1) ≤ C * B ^ i * (u i) ^ p) + (hAstep : C * A ^ p ≤ A * q) (hqstep : B * q ^ p ≤ q) : + ∀ i, u i ≤ A * q ^ i := by + intro i + induction i with + | zero => simpa using hstart + | succ i ih => + have hpow : (q ^ i) ^ p = (q ^ p) ^ i := by + rw [← Real.rpow_natCast_mul hq, mul_comm (i : ℝ), Real.rpow_mul_natCast hq] + calc + u (i + 1) ≤ C * B ^ i * (u i) ^ p := hstep i + _ ≤ C * B ^ i * (A * q ^ i) ^ p := by gcongr; exact hu i + _ = (C * A ^ p) * (B * q ^ p) ^ i := by + rw [Real.mul_rpow hA (pow_nonneg hq _), hpow, mul_pow] + ring + _ ≤ (A * q) * q ^ i := by + exact mul_le_mul hAstep (pow_le_pow_left₀ (mul_nonneg hB (Real.rpow_nonneg hq _)) hqstep i) + (pow_nonneg (mul_nonneg hB (Real.rpow_nonneg hq _)) _) (mul_nonneg hA hq) + _ = A * q ^ (i + 1) := by rw [pow_succ]; ring + +theorem exists_nonlinear_iteration_threshold {p C B : ℝ} + (hp : 1 < p) (hC : 0 < C) (hB : 1 < B) : + ∃ A q : ℝ, 0 < A ∧ 0 < q ∧ q < 1 ∧ + C * A ^ p ≤ A * q ∧ B * q ^ p ≤ q := by + let q := (1 / (2 * B)) ^ (p - 1)⁻¹ + have he : 0 < p - 1 := by linarith + have hbase : 0 < 1 / (2 * B) := by positivity + have hq : 0 < q := Real.rpow_pos_of_pos hbase _ + have hq1 : q < 1 := by + apply Real.rpow_lt_one hbase.le _ (inv_pos.mpr he) + rw [div_lt_one (by linarith : 0 < 2 * B)] + linarith + have hqpow : q ^ (p - 1) = 1 / (2 * B) := by + dsimp [q] + rw [← Real.rpow_mul hbase.le, inv_mul_cancel₀ he.ne', Real.rpow_one] + let A := (q / (2 * C)) ^ (p - 1)⁻¹ + have hbaseA : 0 < q / (2 * C) := by positivity + have hA : 0 < A := Real.rpow_pos_of_pos hbaseA _ + have hApow : A ^ (p - 1) = q / (2 * C) := by + dsimp [A] + rw [← Real.rpow_mul hbaseA.le, inv_mul_cancel₀ he.ne', Real.rpow_one] + have hrewrite : p = (p - 1) + 1 := by ring + refine ⟨A, q, hA, hq, hq1, ?_, ?_⟩ + · rw [hrewrite, Real.rpow_add hA, hApow, Real.rpow_one] + have heq : C * (q / (2 * C) * A) = A * q / 2 := by field_simp + rw [heq] + nlinarith + · rw [hrewrite, Real.rpow_add hq, hqpow, Real.rpow_one] + have heq : B * (1 / (2 * B) * q) = q / 2 := by field_simp + rw [heq] + linarith + +theorem nonlinear_iteration_tendsto_zero {p C B : ℝ} + (hp : 1 < p) (hC : 0 < C) (hB : 1 < B) : + ∃ A : ℝ, 0 < A ∧ ∀ u : ℕ → ℝ, (∀ i, 0 ≤ u i) → u 0 ≤ A → + (∀ i, u (i + 1) ≤ C * B ^ i * (u i) ^ p) → Tendsto u atTop (𝓝 0) := by + obtain ⟨A, q, hA, hq, hq1, hAstep, hqstep⟩ := exists_nonlinear_iteration_threshold hp hC hB + refine ⟨A, hA, ?_⟩ + intro u hu hstart hstep + have hmajor := nonlinear_iteration_geometric_bound (by linarith : 0 ≤ p) hC.le + (by linarith : 0 ≤ B) hA.le hq.le hu hstart hstep hAstep hqstep + apply squeeze_zero hu hmajor + simpa using (tendsto_const_nhds (x := A)).mul (tendsto_pow_atTop_nhds_zero_of_lt_one hq.le hq1) + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem minimizing_volume_recursion {n : ℕ} {p : ℝ} + (hp : Real.HolderConjugate (n : ℝ) p) {E : Set (Euc n)} + (hmin : IsLocallyPerimeterMinimizing E) (c : Euc n) {a b L : ℝ} + (ha : 0 < a) (hab : a < b) (hL : 0 < L) + (hbound : ∀ s, |deriv Real.smoothTransition s| ≤ L) : + volume.real (E ∩ Metric.closedBall c a) ≤ + (lintegralPowLePowLIntegralFDerivConst (volume : Measure (Euc n)) p : ℝ) * + (16 * L * volume.real (E ∩ Metric.closedBall c b) / (b - a)) ^ p := by + have hv : 0 ≤ volume.real (E ∩ Metric.closedBall c b) := ENNReal.toReal_nonneg + by_cases hz : volume.real (E ∩ Metric.closedBall c b) = 0 + · have hm : volume.real (E ∩ Metric.closedBall c a) ≤ 0 := by + rw [← hz] + exact measureReal_mono + (inter_subset_inter_right E (Metric.closedBall_subset_closedBall hab.le)) + (measure_ne_top_of_subset inter_subset_right (isCompact_closedBall c b).measure_ne_top) + exact hm.trans (by positivity) + obtain ⟨r, hr, hcut⟩ := exists_minimizing_volume_cut hmin c ha hab + (lt_of_le_of_ne hv (Ne.symm hz)) hL hbound + have hiso := raw_perimeter_isoperimetric hp (hmin.1.inter measurableSet_closedBall) + (((isCompact_closedBall c r).isBounded).subset inter_subset_right) + have hvol : volume (E ∩ Metric.closedBall c a) ≤ + (lintegralPowLePowLIntegralFDerivConst (volume : Measure (Euc n)) p : ℝ≥0∞) * + (ENNReal.ofReal (16 * L * volume.real (E ∩ Metric.closedBall c b) / (b - a))) ^ p := by + calc + _ ≤ volume (E ∩ Metric.closedBall c r) := measure_mono + (inter_subset_inter_right E (Metric.closedBall_subset_closedBall hr.1)) + _ ≤ _ := hiso.trans (mul_le_mul_right (ENNReal.rpow_le_rpow hcut hp.symm.pos.le) _) + have hQ : 0 ≤ 16 * L * volume.real (E ∩ Metric.closedBall c b) / (b - a) := by positivity + have hne : (lintegralPowLePowLIntegralFDerivConst (volume : Measure (Euc n)) p : ℝ≥0∞) * + (ENNReal.ofReal (16 * L * volume.real (E ∩ Metric.closedBall c b) / (b - a))) ^ p ≠ ⊤ := by + apply ENNReal.mul_ne_top ENNReal.coe_ne_top + exact ENNReal.rpow_ne_top_of_nonneg hp.symm.pos.le ENNReal.ofReal_ne_top + have hreal := ENNReal.toReal_mono hne hvol + rw [ENNReal.toReal_mul, ← ENNReal.toReal_rpow, ENNReal.toReal_ofReal hQ] at hreal + simpa only [measureReal_def, ENNReal.coe_toReal] using hreal + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +def clearingRadius (R : ℝ) (i : ℕ) : ℝ := R / 2 + R / (2 * (2 : ℝ) ^ i) + +theorem clearingRadius_zero (R : ℝ) : clearingRadius R 0 = R := by + simp [clearingRadius] + +theorem clearingRadius_sub_succ (R : ℝ) (i : ℕ) : + clearingRadius R i - clearingRadius R (i + 1) = R / (4 * (2 : ℝ) ^ i) := by + unfold clearingRadius + rw [pow_succ] + field_simp + ring + +theorem clearingRadius_pos {R : ℝ} (hR : 0 < R) (i : ℕ) : 0 < clearingRadius R i := by + unfold clearingRadius + positivity + +theorem clearingRadius_half_le {R : ℝ} (hR : 0 ≤ R) (i : ℕ) : R / 2 ≤ clearingRadius R i := by + unfold clearingRadius + exact le_add_of_nonneg_right (div_nonneg hR (by positivity)) + +theorem clearingRadius_succ_lt {R : ℝ} (hR : 0 < R) (i : ℕ) : + clearingRadius R (i + 1) < clearingRadius R i := by + have hpos : 0 < clearingRadius R i - clearingRadius R (i + 1) := by + rw [clearingRadius_sub_succ] + positivity + linarith + +theorem minimizing_clearing_out {n : ℕ} {p : ℝ} + (hp : Real.HolderConjugate (n : ℝ) p) {R : ℝ} (hR : 0 < R) : + ∃ ε : ℝ, 0 < ε ∧ ∀ E : Set (Euc n), IsLocallyPerimeterMinimizing E → + ∀ c : Euc n, volume.real (E ∩ Metric.closedBall c R) ≤ ε → + volume (E ∩ Metric.closedBall c (R / 2)) = 0 := by + obtain ⟨L, hL, hbound⟩ := exists_smoothTransition_deriv_bound + let S : ℝ := lintegralPowLePowLIntegralFDerivConst (volume : Measure (Euc n)) p + let K : ℝ := 64 * L / R + let C : ℝ := (S + 1) * K ^ p + let B : ℝ := (2 : ℝ) ^ p + have hS : 0 ≤ S := NNReal.coe_nonneg _ + have hK : 0 < K := by dsimp [K]; positivity + have hC : 0 < C := by dsimp [C]; positivity + have hp1 : 1 < p := hp.symm.lt + have hB : 1 < B := Real.one_lt_rpow (by norm_num) (by linarith) + obtain ⟨ε, hε, hiteration⟩ := nonlinear_iteration_tendsto_zero hp1 hC hB + refine ⟨ε, hε, ?_⟩ + intro E hmin c hsmall + let u : ℕ → ℝ := fun i ↦ volume.real (E ∩ Metric.closedBall c (clearingRadius R i)) + have hu : ∀ i, 0 ≤ u i := fun _ ↦ ENNReal.toReal_nonneg + have hstart : u 0 ≤ ε := by simpa only [u, clearingRadius_zero] using hsmall + have hstep : ∀ i, u (i + 1) ≤ C * B ^ i * (u i) ^ p := by + intro i + have hm := minimizing_volume_recursion hp hmin c (clearingRadius_pos hR (i + 1)) + (clearingRadius_succ_lt hR i) hL hbound + have heq : 16 * L * u i / (clearingRadius R i - clearingRadius R (i + 1)) = K * (2 : ℝ) ^ i * u i := by + rw [clearingRadius_sub_succ] + dsimp [K] + field_simp + ring + change u (i + 1) ≤ S * (16 * L * u i / + (clearingRadius R i - clearingRadius R (i + 1))) ^ p at hm + rw [heq] at hm + have hpow : ((2 : ℝ) ^ i) ^ p = ((2 : ℝ) ^ p) ^ i := by + rw [← Real.rpow_natCast_mul (by norm_num : (0 : ℝ) ≤ 2), + mul_comm (i : ℝ), Real.rpow_mul_natCast (by norm_num : (0 : ℝ) ≤ 2)] + calc + u (i + 1) ≤ S * (K * (2 : ℝ) ^ i * u i) ^ p := hm + _ = (S * K ^ p) * B ^ i * (u i) ^ p := by + rw [Real.mul_rpow (by positivity) (hu i), + Real.mul_rpow hK.le (by positivity), hpow] + dsimp [B] + ring + _ ≤ C * B ^ i * (u i) ^ p := by + unfold C + gcongr + linarith + have ht := hiteration u hu hstart hstep + have hzero : volume.real (E ∩ Metric.closedBall c (R / 2)) = 0 := by + apply le_antisymm _ ENNReal.toReal_nonneg + apply ge_of_tendsto ht + exact Eventually.of_forall fun i ↦ measureReal_mono + (inter_subset_inter_right E (Metric.closedBall_subset_closedBall (clearingRadius_half_le hR.le i))) + (measure_ne_top_of_subset inter_subset_right (isCompact_closedBall c (clearingRadius R i)).measure_ne_top) + exact ((ENNReal.toReal_eq_zero_iff _).mp hzero).resolve_right + (measure_ne_top_of_subset inter_subset_right (isCompact_closedBall c (R / 2)).measure_ne_top) + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/PerimeterAdmissiblePartitionPiece.lean b/lean/OAI/Geometry/Perimeter/Regularity/PerimeterAdmissiblePartitionPiece.lean new file mode 100644 index 0000000000000000000000000000000000000000..1a752301b78c8f6826d58c8f8d8904e1ec8e8f09 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/PerimeterAdmissiblePartitionPiece.lean @@ -0,0 +1,535 @@ +import OAI.Geometry.Perimeter.Regularity.IndicatorConvolutionVariationLocalLe + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack +open scoped Manifold + +theorem perimeterAdmissible_partition_piece {n : ℕ} {ι : Type*} + {E U : Set (Euc n)} {V : Euc n → Euc n} + (hV : PerimeterAdmissible U V) + (ρ : SmoothPartitionOfUnity ι 𝓘(ℝ, Euc n) (Euc n) E) + (W : ι → Set (Euc n)) (hρ : ρ.IsSubordinate W) (i : ι) : + PerimeterAdmissible (W i) (fun x ↦ ρ i x • V x) := by + refine ⟨(ρ i).contMDiff.contDiff.smul hV.1, + (hV.2.1.smul_left (f := fun x ↦ ρ i x)), ?_, ?_⟩ + · exact (tsupport_smul_subset_left _ _).trans (hρ i) + · intro x + rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg (ρ.nonneg i x)] + calc + ρ i x * ‖V x‖ ≤ 1 * ‖V x‖ := + mul_le_mul_of_nonneg_right (ρ.le_one i x) (norm_nonneg _) + _ ≤ 1 := by simpa only [one_mul] using hV.2.2.2 x + +theorem divergence_finset_sum {n : ℕ} {ι : Type*} (s : Finset ι) + (V : ι → Euc n → Euc n) (hV : ∀ i ∈ s, Differentiable ℝ (V i)) : + divergence (∑ i ∈ s, V i) = ∑ i ∈ s, divergence (V i) := by + classical + induction s using Finset.induction_on with + | empty => + simp only [Finset.sum_empty] + funext x + simp [divergence] + | @insert i s hi ih => + rw [Finset.sum_insert hi, Finset.sum_insert hi, + divergence_add (hV i (by simp)) + (Differentiable.sum (fun j hj ↦ hV j (by simp [hj]))), + ih (fun j hj ↦ hV j (by simp [hj]))] + +theorem perimeter_iUnion_open_le {n : ℕ} (E : Set (Euc n)) + {ι : Type*} (U : ι → Set (Euc n)) (hU : ∀ i, IsOpen (U i)) : + perimeter E (⋃ i, U i) ≤ ∑' i, perimeter E (U i) := by + classical + rw [perimeter_eq_iSup_tests] + refine iSup_le fun V ↦ iSup_le fun hV ↦ ?_ + obtain ⟨s, hs⟩ := hV.2.1.elim_finite_subcover U hU hV.2.2.1 + have hs' : tsupport V ⊆ ⋃ i : s, U i := by + simpa only [iUnion_subtype, iUnion_coe_set] using hs + obtain ⟨ρ, hρ⟩ := SmoothPartitionOfUnity.exists_isSubordinate + 𝓘(ℝ, Euc n) (isClosed_tsupport V) (fun i : s ↦ U i) (fun i ↦ hU i) hs' + let W : s → Euc n → Euc n := fun i x ↦ ρ i x • V x + have hW : ∀ i : s, PerimeterAdmissible (U i) (W i) := + fun i ↦ perimeterAdmissible_partition_piece hV ρ _ hρ i + have hsum : V = ∑ i : s, W i := by + funext x + simp only [Finset.sum_apply, W, ← Finset.sum_smul] + by_cases hx : x ∈ tsupport V + · have ht := ρ.sum_eq_one hx + rw [finsum_eq_sum_of_fintype] at ht + rw [ht, one_smul] + · rw [image_eq_zero_of_notMem_tsupport hx, smul_zero] + calc + ENNReal.ofReal (∫ x in E, divergence V x) = + ENNReal.ofReal (∑ i : s, ∫ x in E, divergence (W i) x) := by + rw [hsum, divergence_finset_sum _ W (fun i _ ↦ (hW i).1.differentiable (by simp))] + simp only [Finset.sum_apply] + rw [integral_finsetSum _ (fun i _ ↦ + (integrable_divergence (hW i).1 (hW i).2.1).integrableOn)] + _ ≤ ∑ i : s, ENNReal.ofReal (∫ x in E, divergence (W i) x) := + by + have h (m : Finset s) : + ENNReal.ofReal (∑ i ∈ m, ∫ x in E, divergence (W i) x) ≤ + ∑ i ∈ m, ENNReal.ofReal (∫ x in E, divergence (W i) x) := by + induction m using Finset.induction_on with + | empty => simp + | @insert i m hi ih => + simp only [Finset.sum_insert hi] + exact ENNReal.ofReal_add_le.trans (add_le_add le_rfl ih) + exact h Finset.univ + _ ≤ ∑ i : s, perimeter E (U i) := by + apply Finset.sum_le_sum + intro i hi + rw [perimeter_eq_iSup_tests] + exact le_iSup_of_le (W i) (le_iSup_of_le (hW i) le_rfl) + _ ≤ ∑' i, perimeter E (U i) := by + exact (Finset.sum_coe_sort s (fun i ↦ perimeter E (U i))).le.trans + (ENNReal.sum_le_tsum s) + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +@[simp] theorem raw_perimeter_empty_region {n : ℕ} (E : Set (Euc n)) : + perimeter E ∅ = 0 := by + apply le_antisymm _ zero_le + rw [perimeter_eq_iSup_tests] + refine iSup_le fun V ↦ iSup_le fun hV ↦ ?_ + have hzero : V = 0 := by + funext x + exact image_eq_zero_of_notMem_tsupport (fun hx ↦ hV.2.2.1 hx) + simp [hzero, divergence] + +noncomputable def openPerimeterCost {n : ℕ} (E U : Set (Euc n)) : ℝ≥0∞ := + by classical exact if IsOpen U then perimeter E U else ⊤ + +@[simp] theorem openPerimeterCost_empty {n : ℕ} (E : Set (Euc n)) : + openPerimeterCost E ∅ = 0 := by + simp [openPerimeterCost] + +noncomputable def perimeterOuterMeasure {n : ℕ} (E : Set (Euc n)) : + OuterMeasure (Euc n) := + OuterMeasure.ofFunction (openPerimeterCost E) (openPerimeterCost_empty E) + +theorem perimeterOuterMeasure_le_open {n : ℕ} (E : Set (Euc n)) + {A U : Set (Euc n)} (hU : IsOpen U) (hAU : A ⊆ U) : + perimeterOuterMeasure E A ≤ perimeter E U := by + exact ((perimeterOuterMeasure E).mono hAU).trans + ((OuterMeasure.ofFunction_le _).trans_eq (by simp [openPerimeterCost, hU])) + +theorem perimeterOuterMeasure_eq_iInf_open {n : ℕ} (E A : Set (Euc n)) : + perimeterOuterMeasure E A = + ⨅ (U : Set (Euc n)) (_ : IsOpen U) (_ : A ⊆ U), perimeter E U := by + apply le_antisymm + · exact le_iInf fun U ↦ le_iInf fun hU ↦ le_iInf fun hAU ↦ + perimeterOuterMeasure_le_open E hU hAU + · unfold perimeterOuterMeasure + rw [OuterMeasure.ofFunction_eq_iInf_mem (openPerimeterCost E) + (openPerimeterCost_empty E) (P := IsOpen) + (fun U hU ↦ by simp [openPerimeterCost, hU])] + refine le_iInf fun U ↦ le_iInf fun hU ↦ le_iInf fun hAU ↦ ?_ + calc + _ ≤ perimeter E (⋃ i, U i) := + iInf_le_of_le (⋃ i, U i) (iInf_le_of_le (isOpen_iUnion hU) + (iInf_le_of_le hAU le_rfl)) + _ ≤ ∑' i, perimeter E (U i) := perimeter_iUnion_open_le E U hU + _ = ∑' i, openPerimeterCost E (U i) := by + congr 1 + funext i + simp [openPerimeterCost, hU i] + +theorem perimeterOuterMeasure_open {n : ℕ} (E : Set (Euc n)) + {U : Set (Euc n)} (hU : IsOpen U) : + perimeterOuterMeasure E U = perimeter E U := by + apply le_antisymm (perimeterOuterMeasure_le_open E hU Subset.rfl) + rw [perimeterOuterMeasure_eq_iInf_open] + exact le_iInf fun W ↦ le_iInf fun _ ↦ le_iInf fun hUW ↦ raw_perimeter_mono_region E hUW + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem separated_open_neighborhoods {n : ℕ} {A B : Set (Euc n)} + (hsep : Metric.AreSeparated A B) : + ∃ U V : Set (Euc n), IsOpen U ∧ IsOpen V ∧ A ⊆ U ∧ B ⊆ V ∧ Disjoint U V := by + obtain ⟨r, hr, hsep⟩ := hsep + have hc : IsClosed {p : Euc n × Euc n | r ≤ edist p.1 p.2} := + isClosed_le continuous_const continuous_edist + have hcl : closure (A ×ˢ B) ⊆ {p : Euc n × Euc n | r ≤ edist p.1 p.2} := + hc.closure_subset_iff.mpr (fun p hp ↦ hsep p.1 hp.1 p.2 hp.2) + rw [closure_prod_eq] at hcl + have hd : Disjoint (closure A) (closure B) := by + apply Set.disjoint_left.mpr + intro x hx hy + exact hr (le_antisymm (by simpa using hcl (show (x, x) ∈ closure A ×ˢ closure B from ⟨hx, hy⟩)) zero_le) + obtain ⟨U, V, hU, hV, hAU, hBV, hUV⟩ := + normal_separation isClosed_closure isClosed_closure hd + exact ⟨U, V, hU, hV, subset_closure.trans hAU, subset_closure.trans hBV, hUV⟩ + +theorem perimeterOuterMeasure_isMetric {n : ℕ} (E : Set (Euc n)) : + (perimeterOuterMeasure E).IsMetric := by + intro A B hsep + apply le_antisymm (measure_union_le (μ := perimeterOuterMeasure E) A B) + obtain ⟨U, V, hU, hV, hAU, hBV, hUV⟩ := separated_open_neighborhoods hsep + rw [perimeterOuterMeasure_eq_iInf_open E (A ∪ B)] + refine le_iInf fun O ↦ le_iInf fun hO ↦ le_iInf fun hABO ↦ ?_ + calc + _ ≤ perimeter E (O ∩ U) + perimeter E (O ∩ V) := by + apply add_le_add + · exact perimeterOuterMeasure_le_open E (hO.inter hU) + (fun x hx ↦ ⟨hABO (Or.inl hx), hAU hx⟩) + · exact perimeterOuterMeasure_le_open E (hO.inter hV) + (fun x hx ↦ ⟨hABO (Or.inr hx), hBV hx⟩) + _ ≤ perimeter E O := perimeter_disjoint_superadditive E + inter_subset_left inter_subset_left (hUV.mono inter_subset_right inter_subset_right) + +noncomputable def perimeterMeasure {n : ℕ} (E : Set (Euc n)) : Measure (Euc n) := + (perimeterOuterMeasure E).toMeasure (perimeterOuterMeasure_isMetric E).le_caratheodory + +@[simp] theorem perimeterMeasure_open {n : ℕ} (E : Set (Euc n)) + {U : Set (Euc n)} (hU : IsOpen U) : perimeterMeasure E U = perimeter E U := by + rw [perimeterMeasure, toMeasure_apply _ _ hU.measurableSet, + perimeterOuterMeasure_open E hU] + +theorem perimeterMeasure_support {n : ℕ} (E : Set (Euc n)) : + (perimeterMeasure E).support = perimeterSupport E := by + ext x + rw [Measure.mem_support_iff_forall] + constructor + · intro hx r hr + rw [← perimeterMeasure_open E Metric.isOpen_ball] + exact hx _ (Metric.ball_mem_nhds x hr) + · intro hx U hU + obtain ⟨r, hr, hrU⟩ := Metric.mem_nhds_iff.mp hU + have hm : 0 < perimeterMeasure E (Metric.ball x r) := by + rw [perimeterMeasure_open E Metric.isOpen_ball] + exact hx r hr + exact hm.trans_le ((perimeterMeasure E).mono hrU) + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem perimeterMeasure_locallyFinite {n : ℕ} (E : Set (Euc n)) + (hfin : ∀ x (r : ℝ), 0 < r → perimeter E (Metric.ball x r) < ⊤) : + IsLocallyFiniteMeasure (perimeterMeasure E) := by + constructor + intro x + refine ⟨Metric.ball x 1, Metric.ball_mem_nhds x zero_lt_one, ?_⟩ + rw [perimeterMeasure_open E Metric.isOpen_ball] + exact hfin x 1 zero_lt_one + +theorem perimeterMeasure_finiteOnCompacts {n : ℕ} (E : Set (Euc n)) + (hfin : ∀ x (r : ℝ), 0 < r → perimeter E (Metric.ball x r) < ⊤) : + IsFiniteMeasureOnCompacts (perimeterMeasure E) := by + let := perimeterMeasure_locallyFinite E hfin + infer_instance + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem measure_le_hausdorff_of_ball_growth {n k : ℕ} (μ : Measure (Euc n)) + {C : ℝ} (hC : 0 < C) + (hg : ∀ x (r : ℝ), 0 < r → μ (Metric.ball x r) ≤ ENNReal.ofReal (C * r ^ k)) : + μ ≤ ENNReal.ofReal C • Measure.hausdorffMeasure (k : ℝ) := by + have hbound : ∀ s : Set (Euc n), Metric.ediam s ≤ 1 → + μ s ≤ ENNReal.ofReal C * Metric.ediam s ^ k := by + intro s hs + rcases s.eq_empty_or_nonempty with rfl | ⟨x, hx⟩ + · simp + have hst : Metric.ediam s ≠ ⊤ := ne_top_of_le_ne_top (by simp) hs + have hlim : Tendsto (fun r : ℝ ↦ ENNReal.ofReal (C * (Metric.diam s + r) ^ k)) + (𝓝[>] (0 : ℝ)) (𝓝 (ENNReal.ofReal (C * Metric.diam s ^ k))) := by + have hc : Continuous (fun r : ℝ ↦ ENNReal.ofReal (C * (Metric.diam s + r) ^ k)) := + ENNReal.continuous_ofReal.comp (continuous_const.mul + ((continuous_const.add continuous_id).pow k)) + simpa only [add_zero] using (hc.tendsto 0).mono_left nhdsWithin_le_nhds + have hh : μ s ≤ ENNReal.ofReal (C * Metric.diam s ^ k) := by + apply ge_of_tendsto hlim + filter_upwards [self_mem_nhdsWithin] with r hr + have hsub : s ⊆ Metric.ball x (Metric.diam s + r) := by + intro y hy + exact (Metric.dist_le_diam_of_mem' hst hy hx).trans_lt (lt_add_of_pos_right _ hr) + exact (measure_mono hsub).trans (hg x _ (add_pos_of_nonneg_of_pos Metric.diam_nonneg hr)) + rw [ENNReal.ofReal_mul hC.le, ENNReal.ofReal_pow Metric.diam_nonneg] at hh + simpa only [Metric.diam, ENNReal.ofReal_toReal hst] using hh + have hm : (ENNReal.ofReal C)⁻¹ • μ ≤ Measure.hausdorffMeasure (k : ℝ) := by + apply Measure.le_hausdorffMeasure _ _ 1 zero_lt_one + intro s hs + rw [Measure.smul_apply, smul_eq_mul, ENNReal.rpow_natCast] + calc + _ ≤ (ENNReal.ofReal C)⁻¹ * (ENNReal.ofReal C * Metric.ediam s ^ k) := + mul_le_mul le_rfl (hbound s hs) zero_le zero_le + _ = _ := by rw [← mul_assoc, ENNReal.inv_mul_cancel + (ENNReal.ofReal_ne_zero_iff.mpr hC) ENNReal.ofReal_ne_top, one_mul] + calc + μ = ENNReal.ofReal C • ((ENNReal.ofReal C)⁻¹ • μ) := by + rw [smul_smul, ENNReal.mul_inv_cancel (ENNReal.ofReal_ne_zero_iff.mpr hC) + ENNReal.ofReal_ne_top, one_smul] + _ ≤ ENNReal.ofReal C • Measure.hausdorffMeasure (k : ℝ) := by + apply Measure.le_iff.mpr + intro s hs + simp only [Measure.smul_apply, smul_eq_mul] + exact mul_le_mul le_rfl (Measure.le_iff.mp hm s hs) zero_le zero_le + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem exists_perimeter_vitali_cover_open {n : ℕ} (E S U : Set (Euc n)) + (hU : IsOpen U) {c₀ : ℝ} (hc₀ : 0 < c₀) + (hdensity : ∀ x ∈ S, ∀ᶠ r : ℝ in 𝓝[>] (0 : ℝ), + ENNReal.ofReal (c₀ * r ^ (n - 1)) ≤ perimeter E (Metric.ball x r)) + {δ : ℝ} (hδ : 0 < δ) : + ∃ (u : Set (Euc n)) (r : Euc n → ℝ), u.Countable ∧ + (∀ x ∈ u, 0 < r x ∧ r x ≤ δ) ∧ + (S ∩ U ⊆ ⋃ x ∈ u, Metric.ball x (4 * r x)) ∧ + (∑' x : u, (ENNReal.ofReal (r x)) ^ (n - 1)) ≤ + (ENNReal.ofReal c₀)⁻¹ * perimeter E U := by + classical + let t := S ∩ U + have hchoose : ∀ x ∈ t, ∃ r : ℝ, 0 < r ∧ r ≤ δ ∧ + Metric.ball x r ⊆ U ∧ + ENNReal.ofReal (c₀ * r ^ (n - 1)) ≤ perimeter E (Metric.ball x r) := by + intro x hx + obtain ⟨ε, hε, hεU⟩ := Metric.mem_nhds_iff.mp (hU.mem_nhds hx.2) + have hev := hdensity x hx.1 + have hsmall : ∀ᶠ r : ℝ in 𝓝[>] (0 : ℝ), r < min δ ε := + (eventually_lt_nhds (lt_min hδ hε)).filter_mono nhdsWithin_le_nhds + obtain ⟨r, hr, hden, hsm⟩ := + ((show ∀ᶠ r : ℝ in 𝓝[>] (0 : ℝ), 0 < r from self_mem_nhdsWithin).and + (hev.and hsmall)).exists + exact ⟨r, hr, hsm.le.trans (min_le_left _ _), + (Metric.ball_subset_ball (hsm.le.trans (min_le_right _ _))).trans hεU, hden⟩ + have htotal : ∀ x : Euc n, ∃ r : ℝ, 0 < r ∧ r ≤ δ ∧ + (x ∈ t → Metric.ball x r ⊆ U ∧ + ENNReal.ofReal (c₀ * r ^ (n - 1)) ≤ perimeter E (Metric.ball x r)) := by + intro x + by_cases hx : x ∈ t + · obtain ⟨r, hr, hrδ, hrU, hden⟩ := hchoose x hx + exact ⟨r, hr, hrδ, fun _ ↦ ⟨hrU, hden⟩⟩ + · refine ⟨δ / 2, half_pos hδ, (half_lt_self hδ).le, fun h ↦ ?_⟩ + exact (hx h).elim + choose r hr using htotal + obtain ⟨u, hut, hud, hcover⟩ := + Vitali.exists_disjoint_subfamily_covering_enlargement_ball t id r δ + (fun x hx ↦ (hr x).2.1) 4 (by norm_num) + have huc : u.Countable := hud.countable_of_isOpen (fun _ _ ↦ Metric.isOpen_ball) + (fun x hx ↦ ⟨x, Metric.mem_ball_self (hr x).1⟩) + refine ⟨u, r, huc, fun x hx ↦ ⟨(hr x).1, (hr x).2.1⟩, ?_, ?_⟩ + · intro x hx + obtain ⟨y, hy, hxy⟩ := hcover x hx + exact mem_iUnion.mpr ⟨y, mem_iUnion.mpr ⟨hy, hxy (Metric.mem_ball_self (hr x).1)⟩⟩ + · have hsum := perimeter_tsum_disjoint_le E + (fun x : u ↦ Metric.ball (x : Euc n) (r x)) U + (fun x y h ↦ hud x.property y.property (fun hxy ↦ h (Subtype.ext hxy))) + (fun x ↦ ((hr x).2.2 (hut x.property)).1) + have hweigh : ENNReal.ofReal c₀ * ∑' x : u, ENNReal.ofReal (r x) ^ (n - 1) ≤ + perimeter E U := by + rw [← ENNReal.tsum_mul_left] + apply le_trans (ENNReal.tsum_le_tsum (fun x : u ↦ ?_)) hsum + rw [← ENNReal.ofReal_pow (hr x).1.le, ← ENNReal.ofReal_mul hc₀.le] + exact ((hr x).2.2 (hut x.property)).2 + calc + _ = (ENNReal.ofReal c₀)⁻¹ * + (ENNReal.ofReal c₀ * ∑' x : u, ENNReal.ofReal (r x) ^ (n - 1)) := by + rw [← mul_assoc, ENNReal.inv_mul_cancel (ENNReal.ofReal_ne_zero_iff.mpr hc₀) + ENNReal.ofReal_ne_top, one_mul] + _ ≤ _ := mul_le_mul le_rfl hweigh zero_le zero_le + +theorem hausdorffMeasure_inter_open_le_perimeter {n : ℕ} (E S U : Set (Euc n)) + (hU : IsOpen U) {c₀ : ℝ} (hc₀ : 0 < c₀) + (hdensity : ∀ x ∈ S, ∀ᶠ r : ℝ in 𝓝[>] (0 : ℝ), + ENNReal.ofReal (c₀ * r ^ (n - 1)) ≤ perimeter E (Metric.ball x r)) : + Measure.hausdorffMeasure (n - 1 : ℕ) (S ∩ U) ≤ + (8 : ℝ≥0∞) ^ (n - 1) * (ENNReal.ofReal c₀)⁻¹ * perimeter E U := by + classical + let δ : ℕ → ℝ := fun j ↦ 1 / (j + 1) + have hδ : ∀ j, 0 < δ j := fun j ↦ by dsimp [δ]; positivity + choose u r hcount hr hcover hsum using fun j ↦ + exists_perimeter_vitali_cover_open E S U hU hc₀ hdensity (hδ j) + let : ∀ j, Countable (u j) := fun j ↦ (hcount j).to_subtype + have hediam : ∀ j (x : u j), + Metric.ediam (Metric.ball (x : Euc n) (4 * r j x)) ≤ + ENNReal.ofReal (8 * r j x) := by + intro j x + apply Metric.ediam_le + intro y hy z hz + rw [edist_dist] + apply ENNReal.ofReal_le_ofReal + simp only [Metric.mem_ball] at hy hz + calc dist y z ≤ dist y x + dist z x := dist_triangle_right _ _ _ + _ ≤ 8 * r j x := by linarith + have hδlim : Tendsto (fun j ↦ ENNReal.ofReal (8 * δ j)) atTop (𝓝 0) := by + have hh : Tendsto δ atTop (𝓝 0) := tendsto_one_div_add_atTop_nhds_zero_nat + simpa only [Function.comp_def, mul_zero, ENNReal.ofReal_zero] using + ENNReal.continuous_ofReal.continuousAt.tendsto.comp (hh.const_mul 8) + have hh := Measure.hausdorffMeasure_le_liminf_tsum ((n - 1 : ℕ) : ℝ) + (S ∩ U) (fun j ↦ ENNReal.ofReal (8 * δ j)) hδlim + (fun j (x : u j) ↦ Metric.ball (x : Euc n) (4 * r j x)) + (Filter.Eventually.of_forall (fun j x ↦ + (hediam j x).trans (ENNReal.ofReal_le_ofReal (by + have h := (hr j x x.property).2; linarith)))) + (Filter.Eventually.of_forall (fun j ↦ by simpa only [iUnion_subtype] using hcover j)) + apply hh.trans + refine Filter.liminf_le_of_frequently_le ?_ (by isBoundedDefault) + apply Filter.Eventually.frequently + apply Filter.Eventually.of_forall + intro j + calc + _ ≤ ∑' x : u j, (8 : ℝ≥0∞) ^ (n - 1) * + ENNReal.ofReal (r j x) ^ (n - 1) := by + apply ENNReal.tsum_le_tsum + intro x + rw [ENNReal.rpow_natCast] + calc + _ ≤ (ENNReal.ofReal (8 * r j x)) ^ (n - 1) := pow_le_pow_left' (hediam j x) _ + _ = _ := by rw [ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 8), mul_pow]; norm_num + _ = (8 : ℝ≥0∞) ^ (n - 1) * ∑' x : u j, ENNReal.ofReal (r j x) ^ (n - 1) := + ENNReal.tsum_mul_left + _ ≤ _ := by simpa only [mul_assoc] using mul_le_mul le_rfl (hsum j) zero_le zero_le + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem hausdorff_restrict_le_perimeterMeasure {n : ℕ} (E S : Set (Euc n)) + {c₀ : ℝ} (hc₀ : 0 < c₀) + (hdensity : ∀ x ∈ S, ∀ᶠ r : ℝ in 𝓝[>] (0 : ℝ), + ENNReal.ofReal (c₀ * r ^ (n - 1)) ≤ perimeter E (Metric.ball x r)) : + (Measure.hausdorffMeasure (n - 1 : ℕ)).restrict S ≤ + ((8 : ℝ≥0∞) ^ (n - 1) * (ENNReal.ofReal c₀)⁻¹) • perimeterMeasure E := by + let K : ℝ≥0∞ := 8 ^ (n - 1) * (ENNReal.ofReal c₀)⁻¹ + have hc0 : ENNReal.ofReal c₀ ≠ 0 := ENNReal.ofReal_ne_zero_iff.mpr hc₀ + have hK0 : K ≠ 0 := by + exact mul_ne_zero (pow_ne_zero _ (by norm_num : (8 : ℝ≥0∞) ≠ 0)) + (ENNReal.inv_ne_zero.mpr ENNReal.ofReal_ne_top) + have hKt : K ≠ ⊤ := by + apply ENNReal.mul_ne_top + · exact ENNReal.pow_ne_top (by norm_num) + · exact ENNReal.inv_ne_top.mpr hc0 + apply Measure.le_iff.mpr + intro A hA + rw [Measure.restrict_apply hA, Measure.smul_apply, smul_eq_mul] + change Measure.hausdorffMeasure (n - 1 : ℕ) (A ∩ S) ≤ K * perimeterMeasure E A + rw [perimeterMeasure, toMeasure_apply _ _ hA, perimeterOuterMeasure_eq_iInf_open, + ENNReal.mul_iInf_of_ne hK0 hKt] + refine le_iInf fun U ↦ ?_ + rw [ENNReal.mul_iInf_of_ne hK0 hKt] + refine le_iInf fun hU ↦ ?_ + rw [ENNReal.mul_iInf_of_ne hK0 hKt] + refine le_iInf fun hAU ↦ ?_ + calc + _ ≤ Measure.hausdorffMeasure (n - 1 : ℕ) (S ∩ U) := + (Measure.hausdorffMeasure _).mono (fun x hx ↦ ⟨hx.2, hAU hx.1⟩) + _ ≤ _ := hausdorffMeasure_inter_open_le_perimeter E S U hU hc₀ hdensity + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem minimizing_perimeter_hausdorff_comparison {n : ℕ} (hn : 1 < n) : + ∃ C D : ℝ≥0∞, C ≠ 0 ∧ C ≠ ⊤ ∧ D ≠ 0 ∧ D ≠ ⊤ ∧ + ∀ E : Set (Euc n), IsLocallyPerimeterMinimizing E → + perimeterMeasure E ≤ C • ((Measure.hausdorffMeasure (n - 1 : ℕ)).restrict + (perimeterSupport E)) ∧ + (Measure.hausdorffMeasure (n - 1 : ℕ)).restrict (perimeterSupport E) ≤ + D • perimeterMeasure E := by + obtain ⟨C, hC, hg⟩ := exists_locallyMinimizing_perimeter_growth_constant n (by omega) + obtain ⟨c₀, hc₀, hd⟩ := exists_minimizing_perimeter_lower_density n hn + let D : ℝ≥0∞ := 8 ^ (n - 1) * (ENNReal.ofReal c₀)⁻¹ + have hD0 : D ≠ 0 := mul_ne_zero (pow_ne_zero _ (by norm_num)) + (ENNReal.inv_ne_zero.mpr ENNReal.ofReal_ne_top) + have hDt : D ≠ ⊤ := ENNReal.mul_ne_top (ENNReal.pow_ne_top (by norm_num)) + (ENNReal.inv_ne_top.mpr (ENNReal.ofReal_ne_zero_iff.mpr hc₀)) + refine ⟨ENNReal.ofReal C, D, ENNReal.ofReal_ne_zero_iff.mpr hC, + ENNReal.ofReal_ne_top, hD0, hDt, ?_⟩ + intro E hmin + constructor + · have hh := measure_le_hausdorff_of_ball_growth (perimeterMeasure E) (k := n - 1) hC + (fun x r hr ↦ by rw [perimeterMeasure_open E Metric.isOpen_ball]; exact hg E hmin x r hr) + have hs : ∀ᵐ x ∂perimeterMeasure E, x ∈ perimeterSupport E := by + rw [← perimeterMeasure_support] + exact (perimeterMeasure E).support_mem_ae + have hres := Measure.restrict_mono_measure hh (perimeterSupport E) + rwa [Measure.restrict_eq_self_of_ae_mem hs, Measure.restrict_smul] at hres + · apply hausdorff_restrict_le_perimeterMeasure E (perimeterSupport E) hc₀ + intro x hx + filter_upwards [self_mem_nhdsWithin] with r hr + exact hd E hmin x hx r hr + +theorem minimizing_perimeter_hausdorff_mutuallyAC {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) : + perimeterMeasure E ≪ (Measure.hausdorffMeasure (n - 1 : ℕ)).restrict (perimeterSupport E) ∧ + (Measure.hausdorffMeasure (n - 1 : ℕ)).restrict (perimeterSupport E) ≪ perimeterMeasure E := by + obtain ⟨C, D, _, _, _, _, hb⟩ := minimizing_perimeter_hausdorff_comparison hn + exact ⟨Measure.absolutelyContinuous_of_le_smul (hb E hmin).1, + Measure.absolutelyContinuous_of_le_smul (hb E hmin).2⟩ + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/PerimeterEqOfAe.lean b/lean/OAI/Geometry/Perimeter/Regularity/PerimeterEqOfAe.lean new file mode 100644 index 0000000000000000000000000000000000000000..5fd0df53d99b004e786bc24604266a178d1d206f --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/PerimeterEqOfAe.lean @@ -0,0 +1,469 @@ +import OAI.Geometry.Perimeter.Regularity.SurfaceGradientComp + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem perimeter_eq_of_ae {n : ℕ} {E F : Set (Euc n)} + (hEF : E =ᵐ[volume] F) (U : Set (Euc n)) : perimeter E U = perimeter F U := by + unfold perimeter + rw [Measure.restrict_congr_set hEF] + +theorem perimeterSupport_eq_of_ae {n : ℕ} {E F : Set (Euc n)} + (hEF : E =ᵐ[volume] F) : perimeterSupport E = perimeterSupport F := by + ext x + simp only [perimeterSupport, mem_ofPred_eq, perimeter_eq_of_ae hEF] + +theorem hasHalfspaceBlowup_iff_of_ae {n : ℕ} {E F : Set (Euc n)} + (hEF : E =ᵐ[volume] F) (x v : Euc n) : + HasHalfspaceBlowup E x v ↔ HasHalfspaceBlowup F x v := by + classical + have hi : E.indicator (fun _ ↦ (1 : ℝ)) =ᵐ[volume] F.indicator (fun _ ↦ (1 : ℝ)) := by + filter_upwards [hEF.mem_iff] with y hy + by_cases hx : y ∈ E + · simp only [indicator_of_mem hx, indicator_of_mem (hy.mp hx)] + · simp only [indicator_of_notMem hx, indicator_of_notMem (mt hy.mpr hx)] + have hint : ∀ r : ℝ, (∫ y in Metric.ball x r, + |E.indicator (fun _ ↦ (1 : ℝ)) y - + {z | inner ℝ (z - x) v < 0}.indicator (fun _ ↦ (1 : ℝ)) y|) = + ∫ y in Metric.ball x r, + |F.indicator (fun _ ↦ (1 : ℝ)) y - + {z | inner ℝ (z - x) v < 0}.indicator (fun _ ↦ (1 : ℝ)) y| := by + intro r + apply integral_congr_ae + filter_upwards [hi.filter_mono (ae_mono Measure.restrict_le_self)] with y hy + rw [hy] + unfold HasHalfspaceBlowup + simp only [hint] + +theorem approximateNormal_eq_of_ae {n : ℕ} {E F : Set (Euc n)} + (hEF : E =ᵐ[volume] F) (x : Euc n) : approximateNormal E x = approximateNormal F x := by + have hp : HasHalfspaceBlowup E x = HasHalfspaceBlowup F x := + funext fun v ↦ propext (hasHalfspaceBlowup_iff_of_ae hEF x v) + unfold approximateNormal + rw [hp] + +theorem tangentialGradient_eq_of_ae {n : ℕ} {E F : Set (Euc n)} + (hEF : E =ᵐ[volume] F) (φ : Euc n → ℝ) : + tangentialGradient E φ = tangentialGradient F φ := by + funext x + simp only [tangentialGradient, approximateNormal_eq_of_ae hEF] + +theorem boundaryArea_eq_of_ae {n : ℕ} {E F : Set (Euc n)} + (hEF : E =ᵐ[volume] F) : boundaryArea E = boundaryArea F := by + simp only [boundaryArea, perimeterSupport_eq_of_ae hEF] + +theorem wholeBoundarySobolev_iff_of_ae {n : ℕ} {E F : Set (Euc n)} + (hEF : E =ᵐ[volume] F) (h : Euc n → ℝ) (G : Euc n → Euc n) : + WholeBoundarySobolev E h G ↔ WholeBoundarySobolev F h G := by + simp only [WholeBoundarySobolev, boundaryArea_eq_of_ae hEF, tangentialGradient_eq_of_ae hEF] + +theorem wholeBoundarySupersolution_iff_of_ae {n : ℕ} {E F : Set (Euc n)} + (hEF : E =ᵐ[volume] F) (G : Euc n → Euc n) : + WholeBoundarySupersolution E G ↔ WholeBoundarySupersolution F G := by + simp only [WholeBoundarySupersolution, boundaryArea_eq_of_ae hEF, tangentialGradient_eq_of_ae hEF] + +theorem zeroEssentialInfAtVertex_iff_of_ae {n : ℕ} {E F : Set (Euc n)} + (hEF : E =ᵐ[volume] F) (h : Euc n → ℝ) : + ZeroEssentialInfAtVertex E h ↔ ZeroEssentialInfAtVertex F h := by + simp only [ZeroEssentialInfAtVertex, boundaryArea_eq_of_ae hEF] + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem IsLocallyPerimeterMinimizing.of_ae {n : ℕ} {E F : Set (Euc n)} + (hmin : IsLocallyPerimeterMinimizing E) (hEF : E =ᵐ[volume] F) + (hF : MeasurableSet F) : IsLocallyPerimeterMinimizing F := by + obtain ⟨hE, hfin, hcomp⟩ := hmin + refine ⟨hF, ?_, ?_⟩ + · intro x r hr + rw [← perimeter_eq_of_ae hEF] + exact hfin x r hr + · intro x r hr G hG hKc hKB + let K := closure (symmDiff F G) + let H := (G ∩ K) ∪ (E \ K) + have hK : IsClosed K := isClosed_closure + have hHm : MeasurableSet H := (hG.inter hK.measurableSet).union (hE.diff hK.measurableSet) + have hFGout : ∀ y ∉ K, y ∈ F ↔ y ∈ G := by + intro y hy + have hdiff : y ∉ symmDiff F G := fun h ↦ hy (subset_closure h) + simp only [mem_symmDiff] at hdiff + tauto + have hHG : H =ᵐ[volume] G := by + apply Filter.eventuallyEqSet_iff.mpr + filter_upwards [hEF.mem_iff] with y hy + by_cases hyK : y ∈ K + · simp only [H, mem_union, mem_inter_iff, Set.mem_sdiff, hyK, and_true, not_true_eq_false, + and_false, or_false] + · have ho := hFGout y hyK + simp only [H, mem_union, mem_inter_iff, Set.mem_sdiff, hyK, and_false, not_false_eq_true, + and_true, false_or] + exact hy.trans ho + have hEH : symmDiff E H ⊆ K := by + intro y hy + by_contra hn + have hne : y ∈ H ↔ y ∈ E := by + simp only [H, mem_union, mem_inter_iff, Set.mem_sdiff, hn, and_false, not_false_eq_true, + and_true, false_or] + simp only [mem_symmDiff] at hy + tauto + have hcl : closure (symmDiff E H) ⊆ K := closure_minimal hEH hK + calc + perimeter F (Metric.ball x r) = perimeter E (Metric.ball x r) := (perimeter_eq_of_ae hEF _).symm + _ ≤ perimeter H (Metric.ball x r) := hcomp x r hr H hHm + (hKc.of_isClosed_subset isClosed_closure hcl) (hcl.trans hKB) + _ = perimeter G (Metric.ball x r) := perimeter_eq_of_ae hHG _ + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem tsupport_divergence_subset {n : ℕ} (V : Euc n → Euc n) : + tsupport (divergence V) ⊆ tsupport V := by + apply closure_minimal + · intro x hx + by_contra h + have hd : fderiv ℝ V x = 0 := fderiv_of_notMem_tsupport ℝ h + exact hx (by simp only [divergence, hd, zero_apply, inner_zero_right, + Finset.sum_const_zero]) + · exact isClosed_tsupport V + +theorem continuous_divergence {n : ℕ} {V : Euc n → Euc n} + (hV : ContDiff ℝ ∞ V) : Continuous (divergence V) := by + unfold divergence + apply continuous_finsetSum + intro i hi + exact continuous_const.inner ((hV.continuous_fderiv (by norm_num)).clm_apply continuous_const) + +theorem integrable_divergence {n : ℕ} {V : Euc n → Euc n} + (hV : ContDiff ℝ ∞ V) (hc : HasCompactSupport V) : + Integrable (divergence V) volume := + (continuous_divergence hV).integrable_of_hasCompactSupport + (hc.of_isClosed_subset (isClosed_tsupport _) (tsupport_divergence_subset V)) + +theorem divergence_add {n : ℕ} {V W : Euc n → Euc n} + (hV : Differentiable ℝ V) (hW : Differentiable ℝ W) : + divergence (V + W) = divergence V + divergence W := by + funext x + simp only [divergence, fderiv_add (hV x) (hW x), add_apply, + inner_add_right, Finset.sum_add_distrib, Pi.add_apply] + +theorem raw_perimeter_mono_region {n : ℕ} (E : Set (Euc n)) {U V : Set (Euc n)} + (hUV : U ⊆ V) : perimeter E U ≤ perimeter E V := by + unfold perimeter + refine iSup_le fun f ↦ iSup_le fun hf ↦ iSup_le fun hc ↦ iSup_le fun hs ↦ iSup_le fun hb ↦ ?_ + exact le_iSup_of_le f (le_iSup_of_le hf (le_iSup_of_le hc + (le_iSup_of_le (hs.trans hUV) (le_iSup_of_le hb le_rfl)))) + +def PerimeterAdmissible {n : ℕ} (U : Set (Euc n)) (V : Euc n → Euc n) : Prop := + ContDiff ℝ ∞ V ∧ HasCompactSupport V ∧ tsupport V ⊆ U ∧ (∀ x, ‖V x‖ ≤ 1) + +theorem perimeterAdmissible_zero {n : ℕ} (U : Set (Euc n)) : + PerimeterAdmissible U (fun _ ↦ 0) := by + exact ⟨contDiff_const, (by simp [HasCompactSupport]), by simp, by simp⟩ + +theorem perimeter_eq_iSup_tests {n : ℕ} (E U : Set (Euc n)) : + perimeter E U = ⨆ V, ⨆ (_ : PerimeterAdmissible U V), + ENNReal.ofReal (∫ x in E, divergence V x) := by + simp only [perimeter, PerimeterAdmissible, iSup_and] + +theorem perimeter_disjoint_superadditive {n : ℕ} (E : Set (Euc n)) + {U V Z : Set (Euc n)} (hUZ : U ⊆ Z) (hVZ : V ⊆ Z) (hUV : Disjoint U V) : + perimeter E U + perimeter E V ≤ perimeter E Z := by + rw [perimeter_eq_iSup_tests E U, perimeter_eq_iSup_tests E V] + apply ENNReal.biSup_add_biSup_le' + ⟨_, perimeterAdmissible_zero U⟩ ⟨_, perimeterAdmissible_zero V⟩ + rintro F ⟨hF, hcF, hsF, hbF⟩ G ⟨hG, hcG, hsG, hbG⟩ + by_cases hf : 0 ≤ ∫ x in E, divergence F x + · by_cases hg : 0 ≤ ∫ x in E, divergence G x + · have hs : tsupport (F + G) ⊆ Z := (tsupport_add F G).trans (union_subset (hsF.trans hUZ) (hsG.trans hVZ)) + have hb : ∀ x, ‖(F + G) x‖ ≤ 1 := by + intro x + by_cases hx : x ∈ tsupport F + · have hn : x ∉ tsupport G := fun hg ↦ Set.disjoint_left.mp hUV (hsF hx) (hsG hg) + simp only [Pi.add_apply, image_eq_zero_of_notMem_tsupport hn, add_zero] + exact hbF x + · simp only [Pi.add_apply, image_eq_zero_of_notMem_tsupport hx, zero_add] + exact hbG x + rw [← ENNReal.ofReal_add hf hg] + have hi : (∫ x in E, divergence F x) + (∫ x in E, divergence G x) = + ∫ x in E, divergence (F + G) x := by + rw [divergence_add (hF.differentiable (by norm_num)) (hG.differentiable (by norm_num))] + exact (integral_add (integrable_divergence hF hcF).integrableOn + (integrable_divergence hG hcG).integrableOn).symm + rw [hi] + unfold perimeter + exact le_iSup_of_le (F + G) (le_iSup_of_le (hF.add hG) (le_iSup_of_le (hcF.add hcG) + (le_iSup_of_le hs (le_iSup_of_le hb le_rfl)))) + · rw [ENNReal.ofReal_of_nonpos (le_of_lt (lt_of_not_ge hg)), add_zero] + unfold perimeter + exact le_iSup_of_le F (le_iSup_of_le hF (le_iSup_of_le hcF + (le_iSup_of_le (hsF.trans hUZ) (le_iSup_of_le hbF le_rfl)))) + · rw [ENNReal.ofReal_of_nonpos (le_of_lt (lt_of_not_ge hf)), zero_add] + unfold perimeter + exact le_iSup_of_le G (le_iSup_of_le hG (le_iSup_of_le hcG + (le_iSup_of_le (hsG.trans hVZ) (le_iSup_of_le hbG le_rfl)))) + +theorem divergence_smul {n : ℕ} {η : Euc n → ℝ} {V : Euc n → Euc n} + (hη : Differentiable ℝ η) (hV : Differentiable ℝ V) (x : Euc n) : + divergence (fun y ↦ η y • V y) x = + η x * divergence V x + inner ℝ (gradient η x) (V x) := by + simp only [divergence, fderiv_fun_smul (hη x) (hV x), + add_apply, smul_apply, + ContinuousLinearMap.smulRight_apply, inner_add_right, inner_smul_right, + Finset.sum_add_distrib, ← Finset.mul_sum] + congr 1 + simp_rw [← inner_gradient_left] + exact (EuclideanSpace.basisFun (Fin n) ℝ).sum_inner_mul_inner _ _ + +theorem smoothTransition_deriv_zero_of_nonpos {s : ℝ} (hs : s ≤ 0) : + deriv Real.smoothTransition s = 0 := by + have hm : IsLocalMin Real.smoothTransition s := by + filter_upwards [] with x + rw [Real.smoothTransition.zero_of_nonpos hs] + exact Real.smoothTransition.nonneg x + exact hm.deriv_eq_zero + +theorem smoothTransition_deriv_zero_of_one_le {s : ℝ} (hs : 1 ≤ s) : + deriv Real.smoothTransition s = 0 := by + have hm : IsLocalMax Real.smoothTransition s := by + filter_upwards [] with x + rw [Real.smoothTransition.one_of_one_le hs] + exact Real.smoothTransition.le_one x + exact hm.deriv_eq_zero + +theorem exists_smoothTransition_deriv_bound : + ∃ L : ℝ, 0 < L ∧ ∀ s, |deriv Real.smoothTransition s| ≤ L := by + have hc : Continuous (deriv Real.smoothTransition) := + (Real.smoothTransition.contDiff : ContDiff ℝ ∞ _).continuous_deriv (by norm_num) + obtain ⟨L₀, hL₀⟩ := (isCompact_Icc : IsCompact (Icc (0 : ℝ) 1)).exists_bound_of_continuousOn hc.continuousOn + refine ⟨max L₀ 0 + 1, by positivity, ?_⟩ + intro s + by_cases hs : s ∈ Icc (0 : ℝ) 1 + · have h := hL₀ s hs + rw [Real.norm_eq_abs] at h + linarith [le_max_left L₀ (0 : ℝ)] + · have hh : s ≤ 0 ∨ 1 ≤ s := by simp only [mem_Icc] at hs; by_contra h; push Not at h; exact hs ⟨h.1.le, h.2.le⟩ + rcases hh with hh | hh + · rw [smoothTransition_deriv_zero_of_nonpos hh, abs_zero]; positivity + · rw [smoothTransition_deriv_zero_of_one_le hh, abs_zero]; positivity + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +def annularCutoff {n : ℕ} (c : Euc n) (a b : ℝ) (x : Euc n) : ℝ := + Real.smoothTransition ((‖x - c‖ ^ 2 - a ^ 2) / (b ^ 2 - a ^ 2)) + +theorem annularCutoff_contDiff {n : ℕ} (c : Euc n) (a b : ℝ) : + ContDiff ℝ ∞ (annularCutoff c a b) := by + apply Real.smoothTransition.contDiff.comp + exact (((contDiff_id.sub contDiff_const).norm_sq ℝ).sub contDiff_const).div_const _ + +theorem annularCutoff_mem_Icc {n : ℕ} (c : Euc n) (a b : ℝ) (x : Euc n) : + annularCutoff c a b x ∈ Icc (0 : ℝ) 1 := + ⟨Real.smoothTransition.nonneg _, Real.smoothTransition.le_one _⟩ + +theorem annularCutoff_zero {n : ℕ} {c x : Euc n} {a b : ℝ} + (ha : 0 < a) (hab : a < b) (hx : dist x c ≤ a) : + annularCutoff c a b x = 0 := by + apply Real.smoothTransition.zero_of_nonpos + apply div_nonpos_of_nonpos_of_nonneg + · rw [dist_eq_norm] at hx + nlinarith [norm_nonneg (x - c)] + · nlinarith + +theorem annularCutoff_one {n : ℕ} {c x : Euc n} {a b : ℝ} + (ha : 0 < a) (hab : a < b) (hx : b ≤ dist x c) : + annularCutoff c a b x = 1 := by + apply Real.smoothTransition.one_of_one_le + rw [le_div_iff₀ (by nlinarith : 0 < b ^ 2 - a ^ 2)] + rw [dist_eq_norm] at hx + nlinarith [norm_nonneg (x - c)] + +theorem tsupport_annularCutoff_subset {n : ℕ} {c : Euc n} {a b : ℝ} + (ha : 0 < a) (hab : a < b) : + tsupport (annularCutoff c a b) ⊆ {x | a ≤ dist x c} := by + apply closure_minimal + · intro x hx + exact (lt_of_not_ge (fun h ↦ hx (annularCutoff_zero ha hab h))).le + · exact isClosed_le continuous_const (continuous_id.dist continuous_const) + +theorem gradient_annularCutoff {n : ℕ} (c x : Euc n) (a b : ℝ) : + gradient (annularCutoff c a b) x = + (deriv Real.smoothTransition ((‖x - c‖ ^ 2 - a ^ 2) / (b ^ 2 - a ^ 2)) * + (2 / (b ^ 2 - a ^ 2))) • (x - c) := by + let q : Euc n → ℝ := fun y ↦ (‖y - c‖ ^ 2 - a ^ 2) / (b ^ 2 - a ^ 2) + have h0 : HasFDerivAt (fun y : Euc n ↦ ‖y - c‖ ^ 2 - a ^ 2) + (2 • innerSL ℝ (x - c)) x := by + simpa using (((hasFDerivAt_id (𝕜 := ℝ) x).sub_const c).norm_sq.sub_const (a ^ 2)) + have hq : HasFDerivAt q ((2 • innerSL ℝ (x - c)).smulRight + ((b ^ 2 - a ^ 2)⁻¹ : ℝ)) x := by + simpa only [q, div_eq_mul_inv, smul_eq_mul] using h0.smul_const + ((b ^ 2 - a ^ 2)⁻¹ : ℝ) + have hT : DifferentiableAt ℝ Real.smoothTransition (q x) := + (Real.smoothTransition.contDiff : ContDiff ℝ ∞ _).differentiable (by norm_num) _ + apply (InnerProductSpace.toDual ℝ (Euc n)).injective + rw [toDual_gradient] + have hchain := (hT.hasDerivAt.comp_hasFDerivAt x hq).fderiv + change fderiv ℝ (Real.smoothTransition ∘ q) x = _ + rw [hchain] + ext y + simp only [map_smul, smul_apply, ContinuousLinearMap.smulRight_apply, + InnerProductSpace.toDual_apply_apply, innerSL_apply_apply] + simp only [smul_eq_mul] + dsimp [q] + ring + +theorem gradient_annularCutoff_zero {n : ℕ} {c x : Euc n} {a b : ℝ} + (ha : 0 < a) (hab : a < b) (hx : dist x c ≤ a ∨ b ≤ dist x c) : + gradient (annularCutoff c a b) x = 0 := by + rcases hx with hx | hx + · have hm : IsLocalMin (annularCutoff c a b) x := by + filter_upwards [] with y + rw [annularCutoff_zero ha hab hx] + exact (annularCutoff_mem_Icc c a b y).1 + simp only [gradient, hm.fderiv_eq_zero, map_zero] + · have hm : IsLocalMax (annularCutoff c a b) x := by + filter_upwards [] with y + rw [annularCutoff_one ha hab hx] + exact (annularCutoff_mem_Icc c a b y).2 + simp only [gradient, hm.fderiv_eq_zero, map_zero] + +theorem gradient_annularCutoff_bound {n : ℕ} {c : Euc n} {a b L : ℝ} + (ha : 0 < a) (hab : a < b) (hL : 0 < L) + (hbound : ∀ s, |deriv Real.smoothTransition s| ≤ L) (x : Euc n) : + ‖gradient (annularCutoff c a b) x‖ ≤ 2 * L * b / (b ^ 2 - a ^ 2) := by + have hb : 0 < b := ha.trans hab + have hden : 0 < b ^ 2 - a ^ 2 := by nlinarith + by_cases hx : b ≤ dist x c + · rw [gradient_annularCutoff_zero ha hab (Or.inr hx), norm_zero] + exact div_nonneg (mul_nonneg (by positivity) (by linarith)) (by nlinarith) + · have hxb : ‖x - c‖ ≤ b := by simpa only [dist_eq_norm] using (lt_of_not_ge hx).le + rw [gradient_annularCutoff, norm_smul, Real.norm_eq_abs, abs_mul, + abs_div, abs_of_pos (by norm_num : (0 : ℝ) < 2), abs_of_pos (by nlinarith : 0 < b ^ 2 - a ^ 2)] + calc + _ ≤ (L * (2 / (b ^ 2 - a ^ 2))) * b := by + gcongr + exact hbound _ + _ = _ := by ring + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem volume_real_annulus {n : ℕ} (c : Euc n) {a b : ℝ} + (ha : 0 ≤ a) (hab : a ≤ b) : + volume.real (Metric.closedBall c b \ Metric.closedBall c a) = + (b ^ n - a ^ n) * volume.real (Metric.ball (0 : Euc n) 1) := by + rw [measureReal_sdiff (Metric.closedBall_subset_closedBall hab) measurableSet_closedBall + (isCompact_closedBall c b).measure_ne_top, + Measure.addHaar_real_closedBall volume c (ha.trans hab), + Measure.addHaar_real_closedBall volume c ha] + simp only [finrank_euclideanSpace, Fintype.card_fin] + ring + +theorem gradient_annularCutoff_continuous {n : ℕ} (c : Euc n) (a b : ℝ) : + Continuous (gradient (annularCutoff c a b)) := by + exact (InnerProductSpace.toDual ℝ (Euc n)).symm.continuous.comp + ((annularCutoff_contDiff c a b).continuous_fderiv (by norm_num)) + +theorem gradient_annularCutoff_compact {n : ℕ} (c : Euc n) {a b : ℝ} + (ha : 0 < a) (hab : a < b) : + HasCompactSupport (gradient (annularCutoff c a b)) := by + apply (isCompact_closedBall c b).of_isClosed_subset (isClosed_tsupport _) + apply closure_minimal + · intro x hx + by_contra hb + exact hx (gradient_annularCutoff_zero ha hab (Or.inr (le_of_lt (lt_of_not_ge hb)))) + · exact Metric.isClosed_closedBall + +theorem integral_gradient_annularCutoff_le {n : ℕ} (c : Euc n) {a b L : ℝ} + (ha : 0 < a) (hab : a < b) (hL : 0 < L) + (hbound : ∀ s, |deriv Real.smoothTransition s| ≤ L) : + (∫ x, ‖gradient (annularCutoff c a b) x‖) ≤ + 2 * L * n * b ^ (n - 1) * volume.real (Metric.ball (0 : Euc n) 1) := by + have hb : 0 < b := ha.trans hab + have hden : 0 < b ^ 2 - a ^ 2 := by nlinarith + have hpow : b ^ n - a ^ n ≤ (b - a) * n * b ^ (n - 1) := by + have hh := abs_pow_sub_pow_le (a := b) (b := a) (n := n) + rw [abs_of_pos hb, abs_of_pos ha, max_eq_left hab.le, abs_of_pos (sub_pos.mpr hab)] at hh + exact (le_abs_self _).trans hh + let A := Metric.closedBall c b \ Metric.closedBall c a + have hid : (∫ x in A, ‖gradient (annularCutoff c a b) x‖) = + ∫ x, ‖gradient (annularCutoff c a b) x‖ := by + apply setIntegral_eq_integral_of_forall_compl_eq_zero + intro x hx + rw [gradient_annularCutoff_zero ha hab, norm_zero] + by_cases hh : x ∈ Metric.closedBall c a + · exact Or.inl hh + · exact Or.inr (le_of_lt (lt_of_not_ge (fun h ↦ hx ⟨h, hh⟩))) + rw [← hid] + calc + _ ≤ ‖∫ x in A, ‖gradient (annularCutoff c a b) x‖‖ := le_abs_self _ + _ ≤ (2 * L * b / (b ^ 2 - a ^ 2)) * volume.real A := by + apply norm_setIntegral_le_of_norm_le_const + ((measure_mono sdiff_subset).trans_lt (isCompact_closedBall c b).measure_lt_top) + intro x hx + simpa only [norm_norm] using gradient_annularCutoff_bound ha hab hL hbound x + _ = (2 * L * b / (b ^ 2 - a ^ 2)) * + ((b ^ n - a ^ n) * volume.real (Metric.ball (0 : Euc n) 1)) := by + rw [volume_real_annulus c ha.le hab.le] + _ ≤ (2 * L * b / (b ^ 2 - a ^ 2)) * + (((b - a) * n * b ^ (n - 1)) * volume.real (Metric.ball (0 : Euc n) 1)) := by + gcongr + _ ≤ _ := by + have heq : (2 * L * b / (b ^ 2 - a ^ 2)) * + (((b - a) * n * b ^ (n - 1)) * volume.real (Metric.ball (0 : Euc n) 1)) = + (b / (b + a)) * (2 * L * n * b ^ (n - 1) * + volume.real (Metric.ball (0 : Euc n) 1)) := by + field_simp + ring + rw [heq] + exact mul_le_of_le_one_left (by positivity) + ((div_le_one (by linarith : 0 < b + a)).mpr (by linarith)) + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/PerimeterMomentLimit.lean b/lean/OAI/Geometry/Perimeter/Regularity/PerimeterMomentLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..844f7d0e002d7d2597687b9ae0021f3bd5f31c92 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/PerimeterMomentLimit.lean @@ -0,0 +1,168 @@ +import OAI.Geometry.Perimeter.Regularity.GeoAlgebra + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff Convolution InnerProductSpace +namespace RPISingularHarnack +open RPI.Boundary ContinuousLinearMap +variable {n : ℕ} + +theorem c1Mollify_norm_le_bound {ψ : Euc n → ℝ} (hψ : Continuous ψ) + {M : ℝ} (hM : ∀ x, ‖ψ x‖ ≤ M) (j : ℕ) (y : Euc n) : + ‖c1Mollify ψ j y‖ ≤ M := by + let k : Euc n → ℝ := (c1Mollifier j).normed volume + have hk : Integrable k volume := (c1Mollifier j).integrable_normed + have hp : ∀ x, 0 ≤ k x := (c1Mollifier j).nonneg_normed + have hi : Integrable (fun x ↦ k x*ψ (y-x)) volume := + hk.mul_bdd (hψ.comp (continuous_const.sub continuous_id)).aestronglyMeasurable + (ae_of_all _ fun x ↦ hM _) + change ‖∫ x, k x*ψ (y-x)‖ ≤ M + calc + _ ≤ ∫ x, ‖k x*ψ (y-x)‖ := norm_integral_le_integral_norm _ + _ ≤ ∫ x, k x*M := by + apply integral_mono hi.norm (hk.mul_const M) + intro x + change ‖k x*ψ (y-x)‖ ≤ k x*M + rw [norm_mul,Real.norm_eq_abs,abs_of_nonneg (hp x)] + exact mul_le_mul_of_nonneg_left (hM _) (hp x) + _ = M := by rw [integral_mul_const]; dsimp only [k]; rw [(c1Mollifier j).integral_normed,one_mul] + +theorem weak_c1_convolution_identity (μ : Measure (Euc n)) [SFinite μ] + {f : Euc n → ℝ} (hf : Integrable f μ) {ψ : Euc n → ℝ} + (hψ : Continuous ψ) (hcψ : HasCompactSupport ψ) (j : ℕ) : + (∫ x, ψ x*(f ⋆[lsmul ℝ ℝ, μ] (c1Mollifier j).normed volume) x) = + ∫ y, f y*c1Mollify ψ j y ∂μ := by + let k : Euc n → ℝ := (c1Mollifier j).normed volume + obtain ⟨M,hM⟩ := hcψ.exists_bound_of_continuous hψ + have hi : Integrable (fun z : Euc n × Euc n ↦ ψ z.1*(f z.2*k (z.1-z.2))) + (volume.prod μ) := + (hf.convolution_integrand (lsmul ℝ ℝ) (c1Mollifier j).integrable_normed).bdd_mul + (hψ.comp continuous_fst).aestronglyMeasurable (ae_of_all _ fun z ↦ hM _) + calc + _ = ∫ x, ∫ y, ψ x*(f y*k (x-y)) ∂μ := by + apply integral_congr_ae + exact ae_of_all _ fun x ↦ (integral_const_mul _ _).symm + _ = ∫ y, ∫ x, ψ x*(f y*k (x-y)) ∂volume ∂μ := integral_integral_swap hi + _ = ∫ y, f y*c1Mollify ψ j y ∂μ := by + apply integral_congr_ae + apply ae_of_all + intro y + dsimp only + rw [c1Mollify,convolution_eq_swap,← integral_const_mul] + apply integral_congr_ae + apply ae_of_all + intro x + change ψ x*(f y*k (x-y)) = f y*(k (y-x)*ψ x) + have he : k (y-x) = k (x-y) := by + rw [show y-x=-(x-y) by abel] + exact (c1Mollifier j).normed_neg _ + rw [he] + ring + +theorem weak_c1_convolution_tendsto (μ : Measure (Euc n)) [SFinite μ] + {f : Euc n → ℝ} (hf : Integrable f μ) {ψ : Euc n → ℝ} + (hψ : Continuous ψ) (hcψ : HasCompactSupport ψ) : + Tendsto (fun j ↦ ∫ x, ψ x*(f ⋆[lsmul ℝ ℝ, μ] (c1Mollifier j).normed volume) x) + atTop (𝓝 (∫ y, ψ y*f y ∂μ)) := by + simp_rw [weak_c1_convolution_identity μ hf hψ hcψ] + obtain ⟨M,hM⟩ := hcψ.exists_bound_of_continuous hψ + have h : Tendsto (fun j ↦ ∫ y, f y*c1Mollify ψ j y ∂μ) atTop + (𝓝 (∫ y, f y*ψ y ∂μ)) := by + apply tendsto_integral_of_dominated_convergence (fun y ↦ ‖f y‖*M) + · intro j + exact hf.aestronglyMeasurable.mul (c1Mollify_contDiff hψ j).continuous.aestronglyMeasurable + · exact hf.norm.mul_const M + · intro j + apply ae_of_all + intro y + rw [norm_mul] + exact mul_le_mul_of_nonneg_left (c1Mollify_norm_le_bound hψ hM j y) (norm_nonneg _) + · exact ae_of_all _ fun y ↦ tendsto_const_nhds.mul (c1Mollify_tendsto hψ y) + convert h using 2 + apply integral_congr_ae + exact ae_of_all _ fun y ↦ mul_comm _ _ + +theorem weak_c1_convolution_tendsto_of_ae_continuous + (μ : Measure (Euc n)) [SFinite μ] {f : Euc n → ℝ} (hf : Integrable f μ) + {ψ : Euc n → ℝ} (hψ : Measurable ψ) {M : ℝ} (hM : ∀ x, ‖ψ x‖ ≤ M) + (hcont : ∀ᵐ y ∂μ, ContinuousAt ψ y) : + Tendsto (fun j ↦ ∫ x, ψ x*(f ⋆[lsmul ℝ ℝ, μ] (c1Mollifier j).normed volume) x) + atTop (𝓝 (∫ y, ψ y*f y ∂μ)) := by + have hM0 : 0 ≤ M := (norm_nonneg (ψ 0)).trans (hM 0) + have hloc : LocallyIntegrable ψ volume := + (locallyIntegrable_const M).mono hψ.aestronglyMeasurable + (ae_of_all _ fun x ↦ by simpa only [Real.norm_eq_abs,abs_of_nonneg hM0] using hM x) + have hc (j : ℕ) : ContDiff ℝ ∞ (c1Mollify ψ j) := + (c1Mollifier j).hasCompactSupport_normed.contDiff_convolution_left _ + (c1Mollifier j).contDiff_normed hloc + have hbound (j : ℕ) (y : Euc n) : ‖c1Mollify ψ j y‖ ≤ M := by + let k : Euc n → ℝ := (c1Mollifier j).normed volume + have hk : Integrable k volume := (c1Mollifier j).integrable_normed + have hp : ∀ x, 0 ≤ k x := (c1Mollifier j).nonneg_normed + have hi : Integrable (fun x ↦ k x*ψ (y-x)) volume := + hk.mul_bdd (hψ.comp (measurable_const.sub measurable_id)).aestronglyMeasurable + (ae_of_all _ fun x ↦ hM _) + change ‖∫ x, k x*ψ (y-x)‖ ≤ M + calc + _ ≤ ∫ x, ‖k x*ψ (y-x)‖ := norm_integral_le_integral_norm _ + _ ≤ ∫ x, k x*M := by + apply integral_mono hi.norm (hk.mul_const M) + intro x + change ‖k x*ψ (y-x)‖ ≤ k x*M + rw [norm_mul,Real.norm_eq_abs,abs_of_nonneg (hp x)] + exact mul_le_mul_of_nonneg_left (hM _) (hp x) + _ = M := by rw [integral_mul_const]; dsimp only [k]; rw [(c1Mollifier j).integral_normed,one_mul] + have he (j : ℕ) : + (∫ x, ψ x*(f ⋆[lsmul ℝ ℝ, μ] (c1Mollifier j).normed volume) x) = + ∫ y, f y*c1Mollify ψ j y ∂μ := by + let k : Euc n → ℝ := (c1Mollifier j).normed volume + have hi : Integrable (fun z : Euc n × Euc n ↦ ψ z.1*(f z.2*k (z.1-z.2))) + (volume.prod μ) := + (hf.convolution_integrand (lsmul ℝ ℝ) (c1Mollifier j).integrable_normed).bdd_mul + (hψ.comp measurable_fst).aestronglyMeasurable (ae_of_all _ fun z ↦ hM _) + calc + _ = ∫ x, ∫ y, ψ x*(f y*k (x-y)) ∂μ := by + apply integral_congr_ae + exact ae_of_all _ fun x ↦ (integral_const_mul _ _).symm + _ = ∫ y, ∫ x, ψ x*(f y*k (x-y)) ∂volume ∂μ := integral_integral_swap hi + _ = ∫ y, f y*c1Mollify ψ j y ∂μ := by + apply integral_congr_ae + apply ae_of_all + intro y + dsimp only + rw [c1Mollify,convolution_eq_swap,← integral_const_mul] + apply integral_congr_ae + apply ae_of_all + intro x + change ψ x*(f y*k (x-y)) = f y*(k (y-x)*ψ x) + have hk : k (y-x) = k (x-y) := by + rw [show y-x=-(x-y) by abel] + exact (c1Mollifier j).normed_neg _ + rw [hk]; ring + simp_rw [he] + have ht : Tendsto (fun j ↦ ∫ y, f y*c1Mollify ψ j y ∂μ) atTop + (𝓝 (∫ y, f y*ψ y ∂μ)) := by + apply tendsto_integral_of_dominated_convergence (fun y ↦ ‖f y‖*M) + · exact fun j ↦ hf.aestronglyMeasurable.mul (hc j).continuous.aestronglyMeasurable + · exact hf.norm.mul_const M + · intro j + apply ae_of_all + intro y + rw [norm_mul] + exact mul_le_mul_of_nonneg_left (hbound j y) (norm_nonneg _) + · filter_upwards [hcont] with y hy + apply tendsto_const_nhds.mul + exact ContDiffBump.convolution_tendsto_right c1Mollifier_radius_tendsto + (Eventually.of_forall fun _ ↦ hψ.aestronglyMeasurable) + (hy.tendsto.comp tendsto_snd) tendsto_const_nhds + convert ht using 2 + apply integral_congr_ae + exact ae_of_all _ fun y ↦ mul_comm _ _ + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/PhaseMomentLimit.lean b/lean/OAI/Geometry/Perimeter/Regularity/PhaseMomentLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..641bf214f052040025348f8f7fad1be99ffbda59 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/PhaseMomentLimit.lean @@ -0,0 +1,153 @@ +import OAI.Geometry.Perimeter.Regularity.FiberMomentIntegration + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff Convolution InnerProductSpace +namespace RPISingularHarnack +open RPI.Boundary ContinuousLinearMap +variable {n : ℕ} + +theorem phaseMollification_c1_eq (E : Set (Euc n)) (j : ℕ) : + phaseMollification E ((c1Mollifier j).normed volume) = + c1Mollify (E.indicator (fun _ ↦ (1:ℝ))) j := by + funext x + rw [phaseMollification,convolution_eq_swap] + change (∫ y, E.indicator (fun _ ↦ (1:ℝ)) (x-y) * (c1Mollifier j).normed volume y) = _ + apply integral_congr_ae + exact ae_of_all _ fun y ↦ mul_comm _ _ + +theorem phaseMollification_ae_tendsto {E : Set (Euc n)} (hE : MeasurableSet E) : + ∀ᵐ x ∂volume, Tendsto (fun j ↦ phaseMollification E ((c1Mollifier j).normed volume) x) + atTop (𝓝 (E.indicator (fun _ ↦ (1:ℝ)) x)) := by + simp_rw [phaseMollification_c1_eq] + apply ContDiffBump.ae_convolution_tendsto_right_of_locallyIntegrable + c1Mollifier_radius_tendsto (K := 2) _ ((locallyIntegrable_const (1:ℝ)).indicator hE) + apply Eventually.of_forall + intro j + dsimp [c1Mollifier] + linarith + +theorem phaseMollification_c1_mem_Icc {E : Set (Euc n)} (hE : MeasurableSet E) + (j : ℕ) (x : Euc n) : + phaseMollification E ((c1Mollifier j).normed volume) x ∈ Icc (0:ℝ) 1 := + phaseMollification_mem_Icc hE (c1Mollifier j).integrable_normed + (c1Mollifier j).nonneg_normed (c1Mollifier j).integral_normed x + +theorem phaseMollification_diffuse_tendsto_zero {E : Set (Euc n)} (hE : MeasurableSet E) + (K : Set (Euc n)) (hK : IsCompact K) : + Tendsto (fun j ↦ ∫ x in K, + phaseMollification E ((c1Mollifier j).normed volume) x * + (1-phaseMollification E ((c1Mollifier j).normed volume) x)) atTop (𝓝 0) := by + have : IsFiniteMeasure (volume.restrict K) := ⟨by + rw [Measure.restrict_apply_univ]; exact hK.measure_lt_top⟩ + have hlim : ∀ᵐ x ∂volume.restrict K, Tendsto (fun j ↦ + phaseMollification E ((c1Mollifier j).normed volume) x * + (1-phaseMollification E ((c1Mollifier j).normed volume) x)) atTop (𝓝 (0:ℝ)) := by + filter_upwards [ae_restrict_of_ae (phaseMollification_ae_tendsto hE)] with x hx + convert hx.mul (tendsto_const_nhds.sub hx) using 1 + by_cases he : x ∈ E <;> simp [he] + have h := tendsto_integral_of_dominated_convergence (μ := volume.restrict K) (fun _ ↦ (1:ℝ)) + (fun j ↦ ((phaseMollification_contDiff hE (c1Mollifier j).contDiff_normed + (c1Mollifier j).hasCompactSupport_normed).continuous.mul + (continuous_const.sub (phaseMollification_contDiff hE (c1Mollifier j).contDiff_normed + (c1Mollifier j).hasCompactSupport_normed).continuous)).aestronglyMeasurable) + (integrable_const _) (fun j ↦ ae_of_all _ fun x ↦ ?_) hlim + · simpa only [integral_zero,Pi.mul_apply,Pi.sub_apply] using h + · obtain ⟨h0,h1⟩ := phaseMollification_c1_mem_Icc hE j x + dsimp only [Pi.mul_apply,Pi.sub_apply] + rw [Real.norm_eq_abs,abs_of_nonneg (mul_nonneg h0 (sub_nonneg.mpr h1))] + nlinarith + +def exactFiberHeight (E : Set (Euc n)) (v : Euc n) (b : ℝ) + (y : normalPlane v) : ℝ := + -b+∫ s in (-b)..b, E.indicator (fun _ ↦ (1:ℝ)) ((y:Euc n)+s•v) + +theorem phaseMollification_fiber_ae_tendsto {E : Set (Euc n)} (hE : MeasurableSet E) + {v : Euc n} (hv : ‖v‖ = 1) : + ∀ᵐ y : normalPlane v ∂volume, ∀ᵐ s : ℝ ∂volume, + Tendsto (fun j ↦ phaseMollification E ((c1Mollifier j).normed volume) + ((y:Euc n)+s•v)) atTop (𝓝 (E.indicator (fun _ ↦ (1:ℝ)) ((y:Euc n)+s•v))) := by + have ht := (normalCoordinates_measurePreserving v hv).quasiMeasurePreserving.ae + (phaseMollification_ae_tendsto hE) + change ∀ᵐ z : normalPlane v × ℝ ∂volume.prod volume, _ at ht + exact Measure.ae_ae_of_ae_prod ht + +theorem mollified_fiber_height_ae_tendsto {E : Set (Euc n)} (hE : MeasurableSet E) + {v : Euc n} (hv : ‖v‖ = 1) {b : ℝ} (hb : 0 ≤ b) : + ∀ᵐ y : normalPlane v ∂volume, Tendsto (fun j ↦ + -b+∫ s in (-b)..b, phaseMollification E ((c1Mollifier j).normed volume) + ((y:Euc n)+s•v)) atTop (𝓝 (exactFiberHeight E v b y)) := by + filter_upwards [phaseMollification_fiber_ae_tendsto hE hv] with y hy + let F : ℕ → ℝ → ℝ := fun j ↦ mollifiedNormalProfile E ((c1Mollifier j).normed volume) v y + let f : ℝ → ℝ := fun s ↦ E.indicator (fun _ ↦ (1:ℝ)) ((y:Euc n)+s•v) + have hm (j : ℕ) : AEStronglyMeasurable (F j) (volume.restrict (Ioc (-b) b)) := + (mollifiedNormalProfile_contDiff hE (c1Mollifier j).contDiff_normed + (c1Mollifier j).hasCompactSupport_normed v y).continuous.aestronglyMeasurable + have hbd (j : ℕ) : ∀ᵐ s ∂volume.restrict (Ioc (-b) b), ‖F j s‖ ≤ 1 := by + apply ae_of_all + intro s + obtain ⟨h0,h1⟩ := phaseMollification_c1_mem_Icc hE j ((y:Euc n)+s•v) + change ‖phaseMollification E ((c1Mollifier j).normed volume) ((y:Euc n)+s•v)‖ ≤ 1 + simpa only [Real.norm_eq_abs,abs_of_nonneg h0] using h1 + have hlim : ∀ᵐ s ∂volume.restrict (Ioc (-b) b), Tendsto (fun j ↦ F j s) atTop (𝓝 (f s)) := + ae_restrict_of_ae hy + have h : Tendsto (fun j ↦ ∫ s in Ioc (-b) b, F j s) atTop + (𝓝 (∫ s in Ioc (-b) b, f s)) := + tendsto_integral_of_dominated_convergence (fun _ ↦ (1:ℝ)) hm (integrable_const _) hbd hlim + have hadd := (tendsto_const_nhds (x := -b)).add h + simpa only [exactFiberHeight,intervalIntegral.integral_of_le (by linarith : -b ≤ b), + F,f,mollifiedNormalProfile] using hadd + +theorem interval_height_abs_le {q : ℝ → ℝ} (hq : Measurable q) {b : ℝ} + (hb : 0 ≤ b) (hbound : ∀ s, q s ∈ Icc (0:ℝ) 1) : + |-b+∫ s in (-b)..b, q s| ≤ b := by + have hi : IntervalIntegrable q volume (-b) b := by + apply (intervalIntegrable_const (c := (1:ℝ))).mono_fun hq.aestronglyMeasurable + apply ae_of_all + intro s + simpa only [Real.norm_eq_abs,abs_of_nonneg (hbound s).1,abs_one] using (hbound s).2 + have h0 : 0 ≤ ∫ s in (-b)..b, q s := + intervalIntegral.integral_nonneg (by linarith) fun s _ ↦ (hbound s).1 + have h1 : (∫ s in (-b)..b, q s) ≤ 2*b := by + calc + _ ≤ ∫ s in (-b)..b, (1:ℝ) := intervalIntegral.integral_mono_on + (by linarith) hi intervalIntegrable_const (fun s _ ↦ (hbound s).2) + _ = _ := by simp; ring + rw [abs_le] + constructor <;> linarith + +theorem mollified_fiber_height_square_tendsto {E : Set (Euc n)} (hE : MeasurableSet E) + {v : Euc n} (hv : ‖v‖ = 1) {b : ℝ} (hb : 0 ≤ b) + (K : Set (normalPlane v)) (hK : IsCompact K) : + Tendsto (fun j ↦ ∫ y in K, + (-b+∫ s in (-b)..b, phaseMollification E ((c1Mollifier j).normed volume) + ((y:Euc n)+s•v))^2) atTop (𝓝 (∫ y in K, (exactFiberHeight E v b y)^2)) := by + have : IsFiniteMeasure (volume.restrict K) := ⟨by + rw [Measure.restrict_apply_univ]; exact hK.measure_lt_top⟩ + apply tendsto_integral_of_dominated_convergence (fun _ ↦ b^2) + · intro j + exact ((continuous_const.add (continuous_profile_integral (v := v) _ + (phaseMollification_contDiff hE (c1Mollifier j).contDiff_normed + (c1Mollifier j).hasCompactSupport_normed).continuous (-b) b)).pow 2).aestronglyMeasurable + · exact integrable_const _ + · intro j + apply ae_of_all + intro y + have h := interval_height_abs_le + (((phaseMollification_contDiff hE (c1Mollifier j).contDiff_normed + (c1Mollifier j).hasCompactSupport_normed).continuous.comp + (continuous_const.add (continuous_id.smul continuous_const))).measurable) + hb (fun s ↦ phaseMollification_c1_mem_Icc hE j ((y:Euc n)+s•v)) + rw [Real.norm_eq_abs,abs_of_nonneg (sq_nonneg _)] + simpa only [sq_abs,Function.comp_def,Pi.add_apply,Pi.smul_apply,Pi.smul_apply',id_eq] using + (sq_le_sq₀ (abs_nonneg _) hb).mpr h + · filter_upwards [ae_restrict_of_ae (mollified_fiber_height_ae_tendsto hE hv hb)] with y hy + exact hy.pow 2 + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/PhaseRestoration.lean b/lean/OAI/Geometry/Perimeter/Regularity/PhaseRestoration.lean new file mode 100644 index 0000000000000000000000000000000000000000..85b29b0e6d13c0798ba748bde50bf145d0a54ba0 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/PhaseRestoration.lean @@ -0,0 +1,105 @@ +import OAI.Geometry.Perimeter.Regularity.FlatnessImprovement + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +variable {n : ℕ} + +theorem positive_cap_ball {v w : Euc n} (hv : ‖v‖=1) + {r : ℝ} (hr : 0 < r) (hvw : ‖w-v‖≤1/4) : + ∀ x∈Metric.ball ((r/2)•v) (r/8), + x∈Metric.ball 0 r ∧ r/8 < inner ℝ v x ∧ r/8 < inner ℝ w x := by + intro x hx + have hxc : ‖x-(r/2)•v‖ < r/8 := by simpa only [Metric.mem_ball,dist_eq_norm] using hx + have hc : ‖(r/2)•v‖=r/2 := by rw [norm_smul,Real.norm_of_nonneg (by positivity),hv,mul_one] + have hnx : ‖x‖.measurable + unfold exactFiberHeight + simp_rw [intervalIntegral.integral_of_le (by linarith : -b≤b)] + exact (measurable_const : Measurable (fun _ : normalPlane v ↦ -b)).add hi + +theorem exactFiberHeight_norm_le {E : Set (Euc n)} (hE : MeasurableSet E) + (v : Euc n) {b : ℝ} (hb : 0≤b) (y : normalPlane v) : ‖exactFiberHeight E v b y‖≤b := by + apply interval_height_abs_le + ((measurable_const.indicator hE).comp (continuous_const.add (continuous_id.smul continuous_const)).measurable) + hb + intro s + by_cases hs : (y:Euc n)+s•v∈E <;> simp [hs] + +theorem exactFiberMoment_integrable {E : Set (Euc n)} (hE : MeasurableSet E) + (v : Euc n) {φ : normalPlane v → ℝ} (hφ : Continuous φ) (hcφ : HasCompactSupport φ) + {b : ℝ} (hb : 0≤b) (k : ℕ) : Integrable (fun y ↦ φ y*(exactFiberHeight E v b y)^k) volume := by + apply Integrable.mono' ((hφ.integrable_of_hasCompactSupport hcφ).norm.mul_const (b^k)) + ((hφ.measurable.mul ((exactFiberHeight_measurable hE v hb).pow_const k)).aestronglyMeasurable) + exact ae_of_all _ fun y ↦ by + dsimp only [Pi.mul_apply] + rw [norm_mul,norm_pow] + exact mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (norm_nonneg _) (exactFiberHeight_norm_le hE v hb y) k) (norm_nonneg _) + +theorem normalWindowTest_integrableOn {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (v : Euc n) {φ : normalPlane v → ℝ} (hφ : Continuous φ) (hcφ : HasCompactSupport φ) + {b R : ℝ} (hb : 0≤b) (hR : 0 arg 2; ext i; rw [mul_comm] + exact ((EuclideanSpace.basisFun (Fin n) ℝ).sum_inner_mul_inner _ _).symm + +theorem tangentialDivergence_smul {n : ℕ} (E : Set (Euc n)) + {f : Euc n → ℝ} {V : Euc n → Euc n} + (hf : Differentiable ℝ f) (hV : Differentiable ℝ V) (x : Euc n) : + tangentialDivergence E (fun y ↦ f y • V y) x = + f x * tangentialDivergence E V x + + inner ℝ (tangentialGradient E f x) (V x) := by + rw [tangentialDivergence, divergence_smul hf hV, + fderiv_fun_smul (hf x) (hV x)] + simp only [add_apply, smul_apply, + ContinuousLinearMap.smulRight_apply, inner_add_right, real_inner_smul_right, + tangentialDivergence, tangentialGradient, inner_sub_left, real_inner_smul_left, + inner_gradient_left] + ring + +theorem tangentialDivergence_displacement {n : ℕ} (E : Set (Euc n)) + (a x : Euc n) (hN : ‖approximateNormal E x‖ = 1) (hn : 0 < n) : + tangentialDivergence E (fun y ↦ y - a) x = (n - 1 : ℕ) := by + have hd : fderiv ℝ (fun y : Euc n ↦ y - a) x = ContinuousLinearMap.id ℝ (Euc n) := by + simpa only [id_eq] using ((hasFDerivAt_id x).sub_const a).fderiv + simp only [tangentialDivergence, divergence, hd, ContinuousLinearMap.id_apply, + real_inner_self_eq_norm_sq, hN, one_pow] + simp only [(EuclideanSpace.basisFun (Fin n) ℝ).norm_eq_one, one_pow, + Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul, mul_one] + simpa only [Nat.cast_one] using (Nat.cast_sub (R := ℝ) (by omega : 1 ≤ n)).symm + +def radialKernel {n : ℕ} (a : Euc n) (ε p : ℝ) (x : Euc n) : ℝ := + (‖x - a‖ ^ 2 + ε ^ 2) ^ (-p / 2) + +theorem radialKernel_contDiff {n : ℕ} (a : Euc n) {ε : ℝ} (hε : 0 < ε) (p : ℝ) : + ContDiff ℝ ∞ (radialKernel a ε p) := by + apply (((show ContDiff ℝ ∞ (fun x : Euc n ↦ x - a) from contDiff_id.sub contDiff_const).norm_sq (𝕜 := ℝ)).add contDiff_const).rpow_const_of_ne + intro x + positivity + +theorem radialKernel_hasFDerivAt {n : ℕ} (a x : Euc n) {ε : ℝ} (hε : 0 < ε) (p : ℝ) : + HasFDerivAt (radialKernel a ε p) + ((-p * (‖x - a‖ ^ 2 + ε ^ 2) ^ (-p / 2 - 1)) • innerSL ℝ (x - a)) x := by + have hq := (((hasFDerivAt_id x).sub_const a).norm_sq).add_const (ε ^ 2) + have hh := hq.rpow_const (p := -p / 2) (Or.inl (by positivity : ‖id x - a‖ ^ 2 + ε ^ 2 ≠ 0)) + have he : (-p / 2 * (‖x - a‖ ^ 2 + ε ^ 2) ^ (-p / 2 - 1)) * 2 = + -p * (‖x - a‖ ^ 2 + ε ^ 2) ^ (-p / 2 - 1) := by ring + have hmap : (-p / 2 * (‖id x - a‖ ^ 2 + ε ^ 2) ^ (-p / 2 - 1)) • + (2 • (innerSL ℝ (id x - a)).comp (ContinuousLinearMap.id ℝ (Euc n))) = + (-p * (‖x - a‖ ^ 2 + ε ^ 2) ^ (-p / 2 - 1)) • innerSL ℝ (x - a) := by + ext v + simp only [smul_apply, ContinuousLinearMap.comp_apply, + ContinuousLinearMap.id_apply, innerSL_apply_apply, smul_eq_mul, id_eq] + ring + rw [hmap] at hh + exact hh + +theorem tangentialDivergence_radial {n : ℕ} (E : Set (Euc n)) (hn : 0 < n) + (a x : Euc n) {ε : ℝ} (hε : 0 < ε) (hN : ‖approximateNormal E x‖ = 1) : + tangentialDivergence E (fun y ↦ radialKernel a ε (n - 1 : ℕ) y • (y - a)) x = + (n - 1 : ℕ) * (‖x - a‖ ^ 2 + ε ^ 2) ^ (-((n - 1 : ℕ) : ℝ) / 2 - 1) * + (ε ^ 2 + (inner ℝ (x - a) (approximateNormal E x)) ^ 2) := by + rw [tangentialDivergence_smul E ((radialKernel_contDiff a hε _).differentiable (by simp)) + (show Differentiable ℝ (fun y : Euc n ↦ y - a) from differentiable_id.sub_const a), tangentialDivergence_displacement E a x hN hn] + have hgrad : gradient (radialKernel a ε (n - 1 : ℕ)) x = + (-((n - 1 : ℕ) : ℝ) * (‖x - a‖ ^ 2 + ε ^ 2) ^ (-((n - 1 : ℕ) : ℝ) / 2 - 1)) • (x - a) := by + apply (InnerProductSpace.toDual ℝ (Euc n)).injective + rw [toDual_gradient, (radialKernel_hasFDerivAt a x hε _).fderiv] + simp only [map_smul] + rfl + rw [tangentialGradient, hgrad, inner_sub_left] + simp only [real_inner_smul_left, real_inner_self_eq_norm_sq, radialKernel] + rw [real_inner_comm (approximateNormal E x) (x - a)] + have hp : 0 < ‖x - a‖ ^ 2 + ε ^ 2 := by positivity + have hr : (‖x - a‖ ^ 2 + ε ^ 2) ^ (-((n - 1 : ℕ) : ℝ) / 2) = + (‖x - a‖ ^ 2 + ε ^ 2) ^ (-((n - 1 : ℕ) : ℝ) / 2 - 1) * (‖x - a‖ ^ 2 + ε ^ 2) := by + calc + _ = (‖x - a‖ ^ 2 + ε ^ 2) ^ ((-((n - 1 : ℕ) : ℝ) / 2 - 1) + 1) := by congr 1; ring + _ = _ := by rw [Real.rpow_add hp, Real.rpow_one] + rw [hr] + ring + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +namespace RPISingularHarnack +open RPI.Boundary + +theorem tangentialGradient_integrable_ball_perimeter {n : ℕ} + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (c : Euc n) {R : ℝ} (hR : 0 < R) {φ : Euc n → ℝ} + (hφ : ContDiff ℝ 1 φ) : + Integrable (tangentialGradient E φ) ((perimeterMeasure E).restrict (Metric.ball c R)) := by + let μ := (perimeterMeasure E).restrict (Metric.ball c R) + have : IsFiniteMeasure μ := ⟨by + rw [Measure.restrict_apply_univ, perimeterMeasure_open E Metric.isOpen_ball] + exact hmin.2.1 c R hR⟩ + have hg : Continuous (gradient φ) := continuous_iff_continuousAt.mpr (fun x ↦ + continuousAt_gradient_of_contDiffAt hφ.contDiffAt) + obtain ⟨M, hM⟩ := (isCompact_closedBall c R).exists_bound_of_continuousOn hg.continuousOn + apply Integrable.of_bound (measurable_tangentialGradient hmin.1 hφ).aestronglyMeasurable (2 * M) + filter_upwards [ae_restrict_mem measurableSet_ball] with x hx + exact (tangentialGradient_norm_le_twice E φ x).trans (by + nlinarith [hM x (Metric.ball_subset_closedBall hx)]) + +theorem minimizing_tangentialDivergence_integral_eq_zero {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (c : Euc n) {R : ℝ} (hR : 0 < R) {V : Euc n → Euc n} + (hV : ContDiff ℝ ∞ V) (hcV : HasCompactSupport V) + (hsV : tsupport V ⊆ Metric.ball c R) : + (∫ x in Metric.ball c R, tangentialDivergence E V x ∂perimeterMeasure E) = 0 := by + let b := EuclideanSpace.basisFun (Fin n) ℝ + let f : Fin n → Euc n → ℝ := fun i x ↦ inner ℝ (b i) (V x) + have hf (i : Fin n) : ContDiff ℝ ∞ (f i) := contDiff_const.inner ℝ hV + have hcf (i : Fin n) : HasCompactSupport (f i) := + hcV.comp_left (show inner ℝ (b i) (0 : Euc n) = 0 from inner_zero_right _) + have hsf (i : Fin n) : tsupport (f i) ⊆ Metric.ball c R := + (tsupport_comp_subset (g := fun z : Euc n ↦ inner ℝ (b i) z) + (inner_zero_right _) V).trans hsV + have hz (i : Fin n) := minimizing_tangentialGradient_integral_eq_zero_local hn hmin c hR + (hf i) (hcf i) (hsf i) (b i) + have hi (i : Fin n) : Integrable (fun x ↦ inner ℝ (tangentialGradient E (f i) x) (b i)) + ((perimeterMeasure E).restrict (Metric.ball c R)) := + (tangentialGradient_integrable_ball_perimeter hmin c hR ((hf i).of_le (by simp))).inner_const (b i) + simp_rw [tangentialDivergence_eq_sum E (hV.differentiable (by simp))] + rw [integral_finsetSum _ (fun i _ ↦ hi i)] + exact Finset.sum_eq_zero fun i _ ↦ hz i + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +namespace RPIKernel + +variable {X : Type*} [MetricSpace X] + +theorem kernel_le_dyadic [MeasurableSpace X] [BorelSpace X] + (a x : X) {s : ℝ} (hs : 0 < s) : + ENNReal.ofReal (dist x a ^ (-s)) ≤ 1 + ∑' j : ℕ, + (Metric.ball a (2 * (1 / 2 : ℝ) ^ j)).indicator + (fun _ ↦ ENNReal.ofReal (((2 : ℝ) ^ s) ^ (j + 1))) x := by + by_cases h0 : dist x a = 0 + · simp [h0, Real.zero_rpow (ne_of_lt (neg_neg_of_pos hs))] + have hr : 0 < dist x a := lt_of_le_of_ne dist_nonneg (Ne.symm h0) + by_cases hr1 : 1 ≤ dist x a + · have hh : dist x a ^ (-s) ≤ 1 := by + simpa using Real.rpow_le_rpow_of_nonpos (by norm_num : (0 : ℝ) < 1) hr1 (by linarith : -s ≤ 0) + exact (ENNReal.ofReal_le_one.mpr hh).trans (le_add_of_nonneg_right (by positivity)) + obtain ⟨j, hj₁, hj₂⟩ := exists_nat_pow_near_of_lt_one hr (le_of_not_ge hr1) + (by norm_num : (0 : ℝ) < 1 / 2) (by norm_num : (1 / 2 : ℝ) < 1) + have hx : x ∈ Metric.ball a (2 * (1 / 2 : ℝ) ^ j) := by + rw [Metric.mem_ball] + nlinarith [pow_pos (by norm_num : (0 : ℝ) < 1 / 2) j] + have hb : dist x a ^ (-s) ≤ ((2 : ℝ) ^ s) ^ (j + 1) := by + refine (Real.rpow_le_rpow_of_nonpos (pow_pos (by norm_num : (0 : ℝ) < 1 / 2) _) hj₁.le (by linarith)).trans_eq ?_ + rw [← Real.rpow_natCast_mul (by norm_num : (0 : ℝ) ≤ 1 / 2), mul_comm, Real.rpow_mul_natCast (by norm_num : (0 : ℝ) ≤ 1 / 2)] + congr 1 + rw [Real.rpow_neg_eq_inv_rpow] + norm_num + calc + _ ≤ ENNReal.ofReal (((2 : ℝ) ^ s) ^ (j + 1)) := ENNReal.ofReal_le_ofReal hb + _ = (Metric.ball a (2 * (1 / 2 : ℝ) ^ j)).indicator + (fun _ ↦ ENNReal.ofReal (((2 : ℝ) ^ s) ^ (j + 1))) x := (indicator_of_mem hx (fun _ : X ↦ ENNReal.ofReal (((2 : ℝ) ^ s) ^ (j + 1)))).symm + _ ≤ ∑' j : ℕ, (Metric.ball a (2 * (1 / 2 : ℝ) ^ j)).indicator + (fun _ ↦ ENNReal.ofReal (((2 : ℝ) ^ s) ^ (j + 1))) x := + ENNReal.le_tsum (f := fun index : ℕ ↦ + (Metric.ball a (2 * (1 / 2 : ℝ) ^ index)).indicator + (fun _ ↦ ENNReal.ofReal (((2 : ℝ) ^ s) ^ (index + 1))) x) j + _ ≤ _ := le_add_of_nonneg_left (by positivity) + +variable [MeasurableSpace X] [BorelSpace X] + +theorem exists_kernel_integral_bound (μ : Measure X) [IsFiniteMeasure μ] + {d s A : ℝ} (hs : 0 < s) (hsd : s < d) (hA : 0 ≤ A) + (hg : ∀ (a : X) (r : ℝ), 0 < r → μ (Metric.ball a r) ≤ ENNReal.ofReal (A * r ^ d)) : + ∃ C : ℝ≥0∞, C ≠ ⊤ ∧ ∀ a : X, ∫⁻ x, ENNReal.ofReal (dist x a ^ (-s)) ∂μ ≤ C := by + let q : ℝ := (2 : ℝ) ^ s * (1 / 2 : ℝ) ^ d + have hq0 : 0 ≤ q := by dsimp [q]; positivity + have hq1 : q < 1 := by + have he : q = (2 : ℝ) ^ (s - d) := by + dsimp [q] + rw [show (1 / 2 : ℝ) = (2 : ℝ)⁻¹ by norm_num, Real.inv_rpow (by norm_num), + ← Real.rpow_neg (by norm_num), ← Real.rpow_add (by norm_num)] + congr 1 + rw [he] + exact Real.rpow_lt_one_of_one_lt_of_neg (by norm_num) (sub_neg.mpr hsd) + let B : ℝ := A * (2 : ℝ) ^ d * (2 : ℝ) ^ s + have hB : 0 ≤ B := by dsimp [B]; positivity + let C : ℝ≥0∞ := μ univ + ENNReal.ofReal B * ∑' j : ℕ, (ENNReal.ofReal q) ^ j + have hqt : ∑' j : ℕ, (ENNReal.ofReal q) ^ j ≠ ⊤ := by + rw [ENNReal.tsum_geometric] + exact ENNReal.inv_ne_top.mpr (tsub_pos_iff_lt.mpr (ENNReal.ofReal_lt_one.mpr hq1)).ne' + refine ⟨C, ENNReal.add_ne_top.mpr ⟨measure_ne_top _ _, ENNReal.mul_ne_top ENNReal.ofReal_ne_top hqt⟩, ?_⟩ + intro a + calc + _ ≤ ∫⁻ x, 1 + ∑' j : ℕ, (Metric.ball a (2 * (1 / 2 : ℝ) ^ j)).indicator + (fun _ ↦ ENNReal.ofReal (((2 : ℝ) ^ s) ^ (j + 1))) x ∂μ := + lintegral_mono fun x ↦ kernel_le_dyadic a x hs + _ = μ univ + ∑' j : ℕ, ENNReal.ofReal (((2 : ℝ) ^ s) ^ (j + 1)) * + μ (Metric.ball a (2 * (1 / 2 : ℝ) ^ j)) := by + rw [lintegral_add_left measurable_const] + rw [lintegral_tsum (fun j ↦ (measurable_const.indicator measurableSet_ball).aemeasurable)] + simp only [lintegral_const, one_mul, lintegral_indicator measurableSet_ball, + Measure.restrict_apply_univ] + _ ≤ μ univ + ∑' j : ℕ, ENNReal.ofReal B * (ENNReal.ofReal q) ^ j := by + apply add_le_add le_rfl + apply ENNReal.tsum_le_tsum + intro j + calc + _ ≤ ENNReal.ofReal (((2 : ℝ) ^ s) ^ (j + 1)) * + ENNReal.ofReal (A * (2 * (1 / 2 : ℝ) ^ j) ^ d) := + by gcongr; exact hg a _ (by positivity) + _ = ENNReal.ofReal B * (ENNReal.ofReal q) ^ j := by + rw [← ENNReal.ofReal_mul (by positivity), ← ENNReal.ofReal_pow hq0, + ← ENNReal.ofReal_mul hB] + congr 1 + rw [Real.mul_rpow (by norm_num) (by positivity), + ← Real.rpow_natCast_mul (by norm_num : (0 : ℝ) ≤ 1 / 2), + mul_comm (j : ℝ) d, Real.rpow_mul_natCast (by norm_num : (0 : ℝ) ≤ 1 / 2), + pow_succ, mul_pow] + dsimp [B, q] + ring + _ = C := by rw [ENNReal.tsum_mul_left] + +end RPIKernel + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +namespace RPIKernel +open MeasureTheory +variable {X : Type*} [MetricSpace X] [MeasurableSpace X] [BorelSpace X] + +theorem integrable_kernel_of_growth (μ : Measure X) [IsFiniteMeasure μ] + {d s A : ℝ} (hs : 0 < s) (hsd : s < d) (hA : 0 ≤ A) + (hg : ∀ (a : X) (r : ℝ), 0 < r → μ (Metric.ball a r) ≤ ENNReal.ofReal (A * r ^ d)) + (a : X) : Integrable (fun x ↦ dist x a ^ (-s)) μ := by + obtain ⟨C, hC, hbound⟩ := exists_kernel_integral_bound μ hs hsd hA hg + refine ⟨((continuous_id.dist (continuous_const (y := a))).measurable.pow_const _).aestronglyMeasurable, ?_⟩ + rw [hasFiniteIntegral_iff_ofReal (ae_of_all μ fun _ ↦ Real.rpow_nonneg dist_nonneg _)] + exact (hbound a).trans_lt hC.lt_top + +end RPIKernel + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +namespace RPISingularHarnack + +theorem radialKernel_pos {n : ℕ} (a x : Euc n) {ε : ℝ} (hε : 0 < ε) (p : ℝ) : + 0 < radialKernel a ε p x := by + apply Real.rpow_pos_of_pos + positivity + +theorem radialKernel_mul_dist_le {n : ℕ} (a x : Euc n) {ε p : ℝ} + (hε : 0 < ε) (hp : 1 < p) : + radialKernel a ε p x * ‖x - a‖ ≤ ‖x - a‖ ^ (-(p - 1)) := by + by_cases h0 : ‖x - a‖ = 0 + · rw [h0, mul_zero] + positivity + have hr : 0 < ‖x - a‖ := lt_of_le_of_ne (norm_nonneg _) (Ne.symm h0) + have hpow := Real.rpow_le_rpow_of_nonpos (sq_pos_of_pos hr) + (le_add_of_nonneg_right (sq_pos_of_pos hε).le) (by linarith : -p / 2 ≤ 0) + apply (mul_le_mul_of_nonneg_right hpow hr.le).trans_eq + calc + _ = ‖x - a‖ ^ ((2 : ℝ) * (-p / 2)) * ‖x - a‖ ^ (1 : ℝ) := by + rw [Real.rpow_one] + congr 1 + simpa only [Nat.cast_ofNat] using (Real.rpow_natCast_mul hr.le 2 (-p / 2)).symm + _ = ‖x - a‖ ^ ((2 : ℝ) * (-p / 2) + 1) := (Real.rpow_add hr _ _).symm + _ = _ := by congr 1; ring + +theorem radialKernel_mass_scaling {k ε : ℝ} (hε : 0 < ε) : + ε ^ k * ε ^ 2 * (2 * ε ^ 2) ^ (-k / 2 - 1) = (2 : ℝ) ^ (-k / 2 - 1) := by + rw [Real.mul_rpow (by norm_num) (sq_nonneg ε), ← Real.rpow_natCast_mul hε.le] + norm_num only [Nat.cast_ofNat] + rw [show ε ^ k * ε ^ 2 * ((2 : ℝ) ^ (-k / 2 - 1) * ε ^ ((2 : ℝ) * (-k / 2 - 1))) = + (2 : ℝ) ^ (-k / 2 - 1) * (ε ^ k * ε ^ (2 : ℝ) * ε ^ ((2 : ℝ) * (-k / 2 - 1))) by + rw [Real.rpow_two]; ring] + rw [← Real.rpow_add hε, ← Real.rpow_add hε] + ring_nf + simp + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/RawConeLink.lean b/lean/OAI/Geometry/Perimeter/Regularity/RawConeLink.lean new file mode 100644 index 0000000000000000000000000000000000000000..6140e2924d4102fadf911541742efb9398666ab3 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/RawConeLink.lean @@ -0,0 +1,513 @@ +import OAI.Geometry.Perimeter.Regularity.EllipticLocality +import OAI.Geometry.Perimeter.Regularity.SphericalFrankel + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +namespace RPISingularHarnack +namespace SphericalFrankel + +abbrev End (n : ℕ) := Euc n →L[ℝ] Euc n + +def linTrace {n : ℕ} (A : End n) : ℝ := + ∑ i : Fin n, inner ℝ ((EuclideanSpace.basisFun (Fin n) ℝ) i) + (A ((EuclideanSpace.basisFun (Fin n) ℝ) i)) + +def linkTrace {n : ℕ} (e : Frame n) (A : End n) : ℝ := + linTrace A - inner ℝ e.1 (A e.1) - inner ℝ e.2 (A e.2) + +def projMap {n : ℕ} (e : Frame n) : End n := + ContinuousLinearMap.id ℝ (Euc n) - (innerSL ℝ e.1).smulRight e.1 - + (innerSL ℝ e.2).smulRight e.2 + +lemma projMap_apply {n : ℕ} (e : Frame n) (v : Euc n) : + projMap e v = proj e v := rfl + +lemma linTrace_sub {n : ℕ} (A B : End n) : + linTrace (A - B) = linTrace A - linTrace B := by + simp only [linTrace, sub_apply, inner_sub_right, + Finset.sum_sub_distrib] + +lemma linTrace_add {n : ℕ} (A B : End n) : + linTrace (A + B) = linTrace A + linTrace B := by + simp only [linTrace, add_apply, inner_add_right, + Finset.sum_add_distrib] + +lemma linTrace_smul {n : ℕ} (t : ℝ) (A : End n) : + linTrace (t • A) = t * linTrace A := by + simp only [linTrace, smul_apply, real_inner_smul_right, + Finset.mul_sum] + +lemma linTrace_id {n : ℕ} : linTrace (ContinuousLinearMap.id ℝ (Euc n)) = n := by + simp [linTrace] + +lemma linTrace_rank {n : ℕ} (v w : Euc n) : + linTrace ((innerSL ℝ v).smulRight w) = inner ℝ v w := by + simpa only [linTrace, ContinuousLinearMap.smulRight_apply, innerSL_apply_apply, + real_inner_smul_right] using + (EuclideanSpace.basisFun (Fin n) ℝ).sum_inner_mul_inner v w + +lemma linkTrace_sub {n : ℕ} (e : Frame n) (A B : End n) : + linkTrace e (A-B) = linkTrace e A - linkTrace e B := by + simp only [linkTrace, linTrace_sub, sub_apply, inner_sub_right] + ring + +lemma linkTrace_add {n : ℕ} (e : Frame n) (A B : End n) : + linkTrace e (A+B) = linkTrace e A + linkTrace e B := by + simp only [linkTrace, linTrace_add, add_apply, inner_add_right] + ring + +lemma linkTrace_smul {n : ℕ} (e : Frame n) (t : ℝ) (A : End n) : + linkTrace e (t • A) = t * linkTrace e A := by + simp only [linkTrace, linTrace_smul, smul_apply, + real_inner_smul_right] + ring + +lemma linkTrace_rank {n : ℕ} (e : Frame n) (v w : Euc n) : + linkTrace e ((innerSL ℝ v).smulRight w) = inner ℝ (proj e v) w := by + simp only [linkTrace, linTrace_rank, ContinuousLinearMap.smulRight_apply, + innerSL_apply_apply, real_inner_smul_right, proj, inner_sub_left, + real_inner_smul_left] + rw [real_inner_comm v e.1, real_inner_comm v e.2] + +lemma proj_self_left {n : ℕ} {e : Frame n} (he : IsFrame e) : proj e e.1 = 0 := by + have h11 : inner ℝ e.1 e.1 = 1 := by simp [he.1] + have h21 : inner ℝ e.2 e.1 = 0 := by rw [real_inner_comm, he.2.2] + simp only [proj, h11, h21, one_smul, zero_smul, sub_self] + +lemma proj_self_right {n : ℕ} {e : Frame n} (he : IsFrame e) : proj e e.2 = 0 := by + have h22 : inner ℝ e.2 e.2 = 1 := by simp [he.2.1] + simp only [proj, h22, he.2.2, one_smul, zero_smul, sub_zero, sub_self] + +lemma inner_proj_swap {n : ℕ} (e : Frame n) (v w : Euc n) : + inner ℝ (proj e v) w = inner ℝ v (proj e w) := by + simp only [proj, inner_sub_left, inner_sub_right, real_inner_smul_left, + real_inner_smul_right] + rw [real_inner_comm v e.1, real_inner_comm v e.2] + ring + +lemma inner_proj_self {n : ℕ} {e : Frame n} (he : IsFrame e) (v : Euc n) : + inner ℝ (proj e v) v = ‖proj e v‖ ^ 2 := by + rw [← real_inner_self_eq_norm_sq, proj_inner_self he] + simp only [proj, inner_sub_left, real_inner_smul_left, real_inner_self_eq_norm_sq] + ring + +lemma linkTrace_id {n : ℕ} {e : Frame n} (he : IsFrame e) : + linkTrace e (ContinuousLinearMap.id ℝ (Euc n)) = (n : ℝ) - 2 := by + simp [linkTrace, linTrace_id, he.1, he.2.1] + ring + +lemma linkTrace_proj {n : ℕ} {e f : Frame n} (he : IsFrame e) (hf : IsFrame f) : + linkTrace e (projMap f) = traceProduct e f := by + rw [projMap, linkTrace_sub, linkTrace_sub, linkTrace_id he, + linkTrace_rank, linkTrace_rank] + simp only [proj, inner_sub_left, real_inner_smul_left, real_inner_self_eq_norm_sq, + hf.1, hf.2.1, traceProduct, angle] + ring + +def linkDiv {n : ℕ} (e : Frame n) (W : Euc n → Euc n) : ℝ := + linkTrace e (fderiv ℝ W e.1) - ((n : ℝ)-2) * inner ℝ e.1 (W e.1) + +lemma linkDiv_scalar_constant {n : ℕ} {e f : Frame n} + (he : IsFrame e) {φ : ℝ → ℝ} (hφ : Differentiable ℝ φ) : + linkDiv e (fun z ↦ φ (inner ℝ z f.1) • f.1) = + deriv φ (angle e f) * defect e f - ((n : ℝ)-2) * φ (angle e f) * angle e f := by + have hi : HasFDerivAt (fun z : Euc n ↦ inner ℝ z f.1) (innerSL ℝ f.1) e.1 := by + convert (innerSL ℝ f.1).hasFDerivAt (x := e.1) using 1 + funext z + exact real_inner_comm f.1 z + have hd := ((hφ _).hasDerivAt.comp_hasFDerivAt e.1 hi).smul_const f.1 + have hd' : fderiv ℝ (fun z ↦ φ (inner ℝ z f.1) • f.1) e.1 = + deriv φ (angle e f) • (innerSL ℝ f.1).smulRight f.1 := by + have hdf := hd.fderiv + simp only [Function.comp_def] at hdf + rw [hdf] + ext v + simp [angle, mul_assoc] + rw [linkDiv, hd', linkTrace_smul, linkTrace_rank, inner_proj_self he] + simp only [defect, real_inner_smul_right, angle] + ring + +lemma linkDiv_scalar_proj {n : ℕ} {e f : Frame n} + (he : IsFrame e) (hf : IsFrame f) + {φ : ℝ → ℝ} (hφ : Differentiable ℝ φ) : + linkDiv e (fun z ↦ φ (inner ℝ z f.1) • (projMap f z)) = + deriv φ (angle e f) * cross e f + φ (angle e f) * traceProduct e f - + ((n : ℝ)-2) * φ (angle e f) * defect f e := by + have hi : HasFDerivAt (fun z : Euc n ↦ inner ℝ z f.1) (innerSL ℝ f.1) e.1 := by + convert (innerSL ℝ f.1).hasFDerivAt (x := e.1) using 1 + funext z + exact real_inner_comm f.1 z + have hd := ((hφ _).hasDerivAt.comp_hasFDerivAt e.1 hi).smul (projMap f).hasFDerivAt + have hd' : fderiv ℝ (fun z ↦ φ (inner ℝ z f.1) • (projMap f z)) e.1 = + deriv φ (angle e f) • (innerSL ℝ f.1).smulRight (proj f e.1) + + φ (angle e f) • projMap f := by + have hdf := hd.fderiv + change fderiv ℝ (fun z ↦ φ (inner ℝ z f.1) • (projMap f z)) e.1 = _ at hdf + rw [hdf] + ext v + simp [angle, projMap_apply, add_comm, mul_assoc] + rw [linkDiv, hd', linkTrace_add, linkTrace_smul, linkTrace_smul, + linkTrace_rank, linkTrace_proj he hf] + simp only [projMap_apply, real_inner_smul_right] + have hip : inner ℝ e.1 (proj f e.1) = ‖proj f e.1‖ ^ 2 := + (real_inner_comm _ _).trans (inner_proj_self hf e.1) + rw [hip] + dsimp [angle, cross, defect] + ring + +lemma linTrace_rank_general {n : ℕ} (ℓ : Euc n →L[ℝ] ℝ) (w : Euc n) : + linTrace (ℓ.smulRight w) = ℓ w := by + let b := EuclideanSpace.basisFun (Fin n) ℝ + have hw : (∑ i : Fin n, inner ℝ (b i) w • b i) = w := by + simpa only [OrthonormalBasis.repr_apply_apply] using b.sum_repr w + calc + linTrace (ℓ.smulRight w) = ∑ i : Fin n, inner ℝ (b i) w * ℓ (b i) := by + simp only [linTrace, ContinuousLinearMap.smulRight_apply, real_inner_smul_right, b] + congr 1; ext i; ring + _ = ℓ (∑ i : Fin n, inner ℝ (b i) w • b i) := by simp + _ = ℓ w := by rw [hw] + +def sphereProj {n : ℕ} (z : Euc n) : End n := + ContinuousLinearMap.id ℝ (Euc n) - (innerSL ℝ z).smulRight z + +def planeTrace {n : ℕ} (ν : Euc n) (A : End n) : ℝ := + linTrace A - inner ℝ ν (A ν) + +lemma planeTrace_add {n : ℕ} (ν : Euc n) (A B : End n) : + planeTrace ν (A+B) = planeTrace ν A + planeTrace ν B := by + simp only [planeTrace, linTrace_add, add_apply, inner_add_right] + ring + +lemma planeTrace_sub {n : ℕ} (ν : Euc n) (A B : End n) : + planeTrace ν (A-B) = planeTrace ν A - planeTrace ν B := by + simp only [planeTrace, linTrace_sub, sub_apply, inner_sub_right] + ring + +lemma planeTrace_smul {n : ℕ} (ν : Euc n) (a : ℝ) (A : End n) : + planeTrace ν (a • A) = a * planeTrace ν A := by + simp only [planeTrace, linTrace_smul, smul_apply, real_inner_smul_right] + ring + +lemma planeTrace_rank {n : ℕ} (ν : Euc n) (ℓ : Euc n →L[ℝ] ℝ) (w : Euc n) : + planeTrace ν (ℓ.smulRight w) = ℓ w - ℓ ν * inner ℝ ν w := by + simp only [planeTrace, linTrace_rank_general, ContinuousLinearMap.smulRight_apply, + real_inner_smul_right] + +lemma planeTrace_comp_sphereProj {n : ℕ} {e : Frame n} (he : IsFrame e) (A : End n) : + planeTrace e.2 (A.comp (sphereProj e.1)) = linkTrace e A := by + have hid : A.comp (sphereProj e.1) = A - (innerSL ℝ e.1).smulRight (A e.1) := by + ext v + simp [sphereProj] + rw [hid, planeTrace_sub, planeTrace_rank] + simp only [innerSL_apply_apply, he.2.2, zero_mul, sub_zero, planeTrace, linkTrace] + ring + +lemma sphereProj_self {n : ℕ} {z : Euc n} (hz : ‖z‖ = 1) : sphereProj z z = 0 := by + simp [sphereProj, hz] + +lemma planeTrace_sphereProj {n : ℕ} {e : Frame n} (he : IsFrame e) : + planeTrace e.2 (sphereProj e.1) = (n : ℝ)-2 := by + have hh := planeTrace_comp_sphereProj he (ContinuousLinearMap.id ℝ (Euc n)) + simpa [linkTrace_id he] using hh + +def radialUnit {n : ℕ} (x : Euc n) : Euc n := ‖x‖⁻¹ • x + +lemma radialUnit_norm {n : ℕ} {x : Euc n} (hx : x ≠ 0) : ‖radialUnit x‖ = 1 := by + simp [radialUnit, norm_smul, norm_ne_zero_iff.mpr hx] + +lemma radialUnit_scale {n : ℕ} {x : Euc n} (hx : x ≠ 0) : ‖x‖ • radialUnit x = x := by + simp [radialUnit, smul_smul, norm_ne_zero_iff.mpr hx] + +lemma radialUnit_contDiffAt {n : ℕ} {x : Euc n} (hx : x ≠ 0) : + ContDiffAt ℝ ∞ radialUnit x := + ((contDiffAt_norm ℝ hx).inv (norm_ne_zero_iff.mpr hx)).smul contDiffAt_id + +lemma radialUnit_measurable {n : ℕ} : Measurable (radialUnit (n := n)) := + (measurable_norm.inv).smul measurable_id + +lemma radialUnit_hasFDerivAt {n : ℕ} {x : Euc n} (hx : x ≠ 0) : + HasFDerivAt radialUnit (‖x‖⁻¹ • sphereProj (radialUnit x)) x := by + have hr : ‖x‖ ≠ 0 := norm_ne_zero_iff.mpr hx + have hnorm : HasFDerivAt (fun y : Euc n ↦ ‖y‖) (‖x‖⁻¹ • innerSL ℝ x) x := by + have hh := ((hasFDerivAt_id (𝕜 := ℝ) x).norm_sq).sqrt (pow_ne_zero 2 hr) + simp only [Real.sqrt_sq (norm_nonneg _)] at hh + apply hh.congr_fderiv + ext v + simp + ring + have hinv := (hasDerivAt_inv hr).comp_hasFDerivAt x hnorm + have h := hinv.smul (hasFDerivAt_id x) + change HasFDerivAt radialUnit _ x at h + apply h.congr_fderiv + ext v : 1 + simp only [sphereProj, radialUnit, add_apply, + sub_apply, smul_apply, + ContinuousLinearMap.smulRight_apply, ContinuousLinearMap.id_apply, + innerSL_apply_apply, Function.comp_apply, real_inner_smul_left, + smul_eq_mul, smul_smul, id_eq] + module + +def sphereLift {n : ℕ} (W : Euc n → Euc n) (x : Euc n) : Euc n := + W (radialUnit x) - (inner ℝ (radialUnit x) (W (radialUnit x))) • radialUnit x + +lemma inner_radialUnit_sphereLift {n : ℕ} (W : Euc n → Euc n) + {x : Euc n} (hx : x ≠ 0) : inner ℝ (radialUnit x) (sphereLift W x) = 0 := by + simp [sphereLift, inner_sub_right, real_inner_smul_right, radialUnit_norm hx] + +lemma sphereLift_contDiffAt {n : ℕ} {W : Euc n → Euc n} + (hW : ContDiff ℝ ∞ W) {x : Euc n} (hx : x ≠ 0) : + ContDiffAt ℝ ∞ (sphereLift W) x := by + have hq := radialUnit_contDiffAt hx + have hWq := hW.contDiffAt.comp x hq + exact hWq.sub ((hq.inner ℝ hWq).smul hq) + +lemma planeTrace_sphereLift {n : ℕ} {W : Euc n → Euc n} + (hW : Differentiable ℝ W) {x ν : Euc n} (hx : x ≠ 0) + (he : IsFrame (radialUnit x, ν)) : + planeTrace ν (fderiv ℝ (sphereLift W) x) = + ‖x‖⁻¹ * linkDiv (radialUnit x, ν) W := by + let z := radialUnit x + let A := fderiv ℝ W z + let B := ‖x‖⁻¹ • sphereProj z + let D := A.comp B + let ℓ := (fderivInnerCLM ℝ (z, W z)).comp (B.prod D) + have hq : HasFDerivAt radialUnit B x := radialUnit_hasFDerivAt hx + have hWq : HasFDerivAt (W ∘ radialUnit) D x := (hW z).hasFDerivAt.comp x hq + have hd := hWq.sub ((hq.inner ℝ hWq).smul hq) + have hdf : fderiv ℝ (sphereLift W) x = D - (inner ℝ z (W z) • B + ℓ.smulRight z) := by + exact hd.fderiv + have hz : ‖z‖ = 1 := he.1 + have hBz : B z = 0 := by + change ‖x‖⁻¹ • sphereProj z z = 0 + rw [sphereProj_self hz, smul_zero] + have hlz : ℓ z = 0 := by simp [ℓ, D, hBz] + have hnz : inner ℝ ν z = 0 := by exact (real_inner_comm _ _).trans he.2.2 + have hD : planeTrace ν D = ‖x‖⁻¹ * linkTrace (z,ν) A := by + have hid : D = ‖x‖⁻¹ • (A.comp (sphereProj z)) := by ext v; simp [D, B] + rw [hid, planeTrace_smul, planeTrace_comp_sphereProj he] + have hB : planeTrace ν B = ‖x‖⁻¹ * ((n : ℝ)-2) := by + change planeTrace ν (‖x‖⁻¹ • sphereProj z) = _ + rw [planeTrace_smul, planeTrace_sphereProj he] + rw [hdf, planeTrace_sub, planeTrace_add, planeTrace_smul, planeTrace_rank, + hlz, hnz, mul_zero, sub_zero, hD, hB] + dsimp [linkDiv, z, A] + ring + +def annularProfile (s : ℝ) : ℝ := expNegInvGlue (s - 1) * expNegInvGlue (4 - s) + +def annularCut {n : ℕ} (x : Euc n) : ℝ := annularProfile (‖x‖ ^ 2) + +lemma annularProfile_contDiff : ContDiff ℝ ∞ annularProfile := + (expNegInvGlue.contDiff.comp (contDiff_id.sub contDiff_const)).mul + (expNegInvGlue.contDiff.comp (contDiff_const.sub contDiff_id)) + +lemma annularCut_contDiff {n : ℕ} : ContDiff ℝ ∞ (annularCut (n := n)) := + annularProfile_contDiff.comp (contDiff_id.norm_sq ℝ) + +lemma annularCut_nonneg {n : ℕ} (x : Euc n) : 0 ≤ annularCut x := + mul_nonneg (expNegInvGlue.nonneg _) (expNegInvGlue.nonneg _) + +lemma annularCut_eq_zero_inner {n : ℕ} {x : Euc n} (hx : ‖x‖ ≤ 1) : + annularCut x = 0 := by + have hh : ‖x‖ ^ 2 - 1 ≤ 0 := by nlinarith [norm_nonneg x] + simp [annularCut, annularProfile, expNegInvGlue.zero_of_nonpos hh] + +lemma annularCut_eq_zero_outer {n : ℕ} {x : Euc n} (hx : 2 ≤ ‖x‖) : + annularCut x = 0 := by + have hh : 4 - ‖x‖ ^ 2 ≤ 0 := by nlinarith + simp [annularCut, annularProfile, expNegInvGlue.zero_of_nonpos hh] + +lemma annularCut_pos {n : ℕ} {x : Euc n} (hxi : 1 < ‖x‖) (hxo : ‖x‖ < 2) : + 0 < annularCut x := by + apply mul_pos + · exact expNegInvGlue.pos_of_pos (by nlinarith) + · exact expNegInvGlue.pos_of_pos (by nlinarith [norm_nonneg x]) + +lemma annularCut_hasFDerivAt {n : ℕ} (x : Euc n) : + HasFDerivAt annularCut + ((2 * deriv annularProfile (‖x‖ ^ 2)) • innerSL ℝ x) x := by + have hh := ((annularProfile_contDiff.differentiable (by simp)) _).hasDerivAt.comp_hasFDerivAt x + ((hasFDerivAt_id x).norm_sq) + apply hh.congr_fderiv + ext v + simp + ring + +def annularLift {n : ℕ} (W : Euc n → Euc n) (x : Euc n) : Euc n := + annularCut x • sphereLift W x + +lemma annularLift_contDiff {n : ℕ} {W : Euc n → Euc n} (hW : ContDiff ℝ ∞ W) : + ContDiff ℝ ∞ (annularLift W) := by + apply contDiff_iff_contDiffAt.mpr + intro x + by_cases hx : x = 0 + · subst x + apply (contDiffAt_const (c := (0 : Euc n))).congr_of_eventuallyEq + filter_upwards [Metric.ball_mem_nhds (0 : Euc n) (by norm_num : (0 : ℝ)<1)] with y hy + have hy' : ‖y‖ ≤ 1 := (by simpa using hy : ‖y‖ < 1).le + simp [annularLift, annularCut_eq_zero_inner hy'] + · exact annularCut_contDiff.contDiffAt.smul (sphereLift_contDiffAt hW hx) + +lemma annularLift_tsupport {n : ℕ} (W : Euc n → Euc n) : + tsupport (annularLift W) ⊆ Metric.closedBall (0 : Euc n) 2 := by + apply closure_minimal _ Metric.isClosed_closedBall + intro x hx + rw [Metric.mem_closedBall, dist_zero_right] + by_contra hn + exact hx (by simp [annularLift, annularCut_eq_zero_outer (le_of_not_ge hn)]) + +lemma planeTrace_annularLift {n : ℕ} {W : Euc n → Euc n} + (hW : ContDiff ℝ ∞ W) {x ν : Euc n} (hx : x ≠ 0) + (he : IsFrame (radialUnit x,ν)) : + planeTrace ν (fderiv ℝ (annularLift W) x) = + (annularCut x * ‖x‖⁻¹) * linkDiv (radialUnit x,ν) W := by + have hS := (sphereLift_contDiffAt hW hx).differentiableAt (by simp) + have hd := (annularCut_hasFDerivAt x).smul hS.hasFDerivAt + have hdf : fderiv ℝ (annularLift W) x = annularCut x • fderiv ℝ (sphereLift W) x + + ((2 * deriv annularProfile (‖x‖^2)) • innerSL ℝ x).smulRight (sphereLift W x) := hd.fderiv + have hxn : inner ℝ x ν = 0 := by + rw [← radialUnit_scale hx, real_inner_smul_left, he.2.2, mul_zero] + have hxS : inner ℝ x (sphereLift W x) = 0 := by + calc + inner ℝ x (sphereLift W x) = ‖x‖ * inner ℝ (radialUnit x) (sphereLift W x) := by + rw [← real_inner_smul_left, radialUnit_scale hx] + _ = 0 := by rw [inner_radialUnit_sphereLift W hx, mul_zero] + rw [hdf, planeTrace_add, planeTrace_smul, planeTrace_rank, + planeTrace_sphereLift (hW.differentiable (by simp)) hx he] + simp only [smul_apply, innerSL_apply_apply, smul_eq_mul, hxn, hxS, mul_zero] + ring + +lemma annularLift_zero_nhds {n : ℕ} (W : Euc n → Euc n) : + annularLift W =ᶠ[𝓝 (0 : Euc n)] (fun _ ↦ 0) := by + filter_upwards [Metric.ball_mem_nhds (0 : Euc n) (by norm_num : (0 : ℝ)<1)] with y hy + have hy' : ‖y‖ ≤ 1 := (by simpa using hy : ‖y‖ < 1).le + simp [annularLift, annularCut_eq_zero_inner hy'] + +def annularWeight {n : ℕ} (x : Euc n) : ℝ := annularCut x * ‖x‖⁻¹ + +lemma annularWeight_nonneg {n : ℕ} (x : Euc n) : 0 ≤ annularWeight x := + mul_nonneg (annularCut_nonneg x) (inv_nonneg.mpr (norm_nonneg x)) + +lemma annularWeight_continuous {n : ℕ} : Continuous (annularWeight (n := n)) := by + apply continuous_iff_continuousAt.mpr + intro x + by_cases hx : x = 0 + · subst x + apply (continuousAt_const (y := (0 : ℝ))).congr_of_eventuallyEq + filter_upwards [Metric.ball_mem_nhds (0 : Euc n) (by norm_num : (0 : ℝ)<1)] with y hy + have hy' : ‖y‖ ≤ 1 := (by simpa using hy : ‖y‖ < 1).le + simp [annularWeight, annularCut_eq_zero_inner hy'] + · exact annularCut_contDiff.continuous.continuousAt.mul + (continuous_norm.continuousAt.inv₀ (norm_ne_zero_iff.mpr hx)) + +lemma annularWeight_tsupport {n : ℕ} : + tsupport (annularWeight (n := n)) ⊆ Metric.closedBall (0 : Euc n) 2 := by + apply closure_minimal _ Metric.isClosed_closedBall + intro x hx + rw [Metric.mem_closedBall, dist_zero_right] + by_contra hn + exact hx (by simp [annularWeight, annularCut_eq_zero_outer (le_of_not_ge hn)]) + +def annularWeightNN {n : ℕ} (x : Euc n) : ℝ≥0 := ⟨annularWeight x, annularWeight_nonneg x⟩ + +lemma annularWeightNN_measurable {n : ℕ} : Measurable (annularWeightNN (n := n)) := + annularWeight_continuous.measurable.nnreal_mk + +def annularFrameMeasure {n : ℕ} (E : Set (Euc n)) : Measure (Euc n) := + ((perimeterMeasure E).restrict (Metric.ball 0 3)).withDensity + (fun x ↦ (annularWeightNN x : ℝ≥0∞)) + +def frameOf {n : ℕ} (E : Set (Euc n)) (x : Euc n) : Frame n := + (radialUnit x, approximateNormal E x) + +lemma frameOf_measurable {n : ℕ} {E : Set (Euc n)} (hE : MeasurableSet E) : + Measurable (frameOf E) := radialUnit_measurable.prodMk (measurable_approximateNormal hE) + +def annularLink {n : ℕ} (E : Set (Euc n)) : Measure (Frame n) := + Measure.map (frameOf E) (annularFrameMeasure E) + +lemma annularFrameMeasure_finite {n : ℕ} {E : Set (Euc n)} + (hE : IsLocallyPerimeterMinimizing E) : IsFiniteMeasure (annularFrameMeasure E) := by + let := perimeterMeasure_locallyFinite E hE.2.1 + have hc : HasCompactSupport (annularWeight (n := n)) := + (isCompact_closedBall (0 : Euc n) 2).of_isClosed_subset isClosed_closure annularWeight_tsupport + have hi : Integrable (annularWeight (n := n)) + ((perimeterMeasure E).restrict (Metric.ball 0 3)) := + annularWeight_continuous.integrable_of_hasCompactSupport hc + apply isFiniteMeasure_withDensity + have hh := (hasFiniteIntegral_iff_ofReal + (Filter.Eventually.of_forall (annularWeight_nonneg (n := n)))).mp hi.2 + convert hh.ne using 1 + congr 1 + funext x + exact (ENNReal.ofReal_coe_nnreal (p := annularWeightNN x)).symm + +lemma annularLink_finite {n : ℕ} {E : Set (Euc n)} + (hE : IsLocallyPerimeterMinimizing E) : IsFiniteMeasure (annularLink E) := by + let := annularFrameMeasure_finite hE + exact Measure.isFiniteMeasure_map (annularFrameMeasure E) (frameOf E) + +lemma annularLink_frames {n : ℕ} (hn : 1 < n) {E : Set (Euc n)} + (hE : IsLocallyPerimeterMinimizing E) (hc : IsCone E) : + ∀ᵐ e ∂annularLink E, IsFrame e := by + rw [annularLink, ae_map_iff (frameOf_measurable hE.1).aemeasurable + (isClosed_frames n).measurableSet, annularFrameMeasure, + ae_withDensity_iff annularWeightNN_measurable.coe_nnreal_ennreal] + filter_upwards [ae_restrict_of_ae (minimizing_halfspaceBlowup_ae hn hE), + ae_restrict_of_ae (minimizing_cone_radial_tangent_ae hn hE hc)] with x hx ht hρ + have hx0 : x ≠ 0 := by + intro hh + apply hρ + apply ENNReal.coe_eq_zero.mpr + apply Subtype.ext + simp [hh, annularWeightNN, annularWeight] + refine ⟨radialUnit_norm hx0, hx.1, ?_⟩ + change inner ℝ (radialUnit x) (approximateNormal E x) = 0 + rw [radialUnit, real_inner_smul_left, ht, mul_zero] + +lemma linkDiv_continuous {n : ℕ} {W : Euc n → Euc n} (hW : ContDiff ℝ ∞ W) : + Continuous (fun e : Frame n ↦ linkDiv e W) := by + have hA := hW.continuous_fderiv (by simp) + unfold linkDiv linkTrace linTrace + fun_prop + +structure LinkStationary {n : ℕ} (μ : Measure (Frame n)) : Prop where + firstVariation : ∀ W : Euc n → Euc n, ContDiff ℝ ∞ W → (∫ e, linkDiv e W ∂μ) = 0 + +lemma annularLink_stationary {n : ℕ} (hn : 1 < n) {E : Set (Euc n)} + (hE : IsLocallyPerimeterMinimizing E) (hc : IsCone E) : + LinkStationary (annularLink E) := by + constructor + intro W hW + have hV := annularLift_contDiff hW + have hs : tsupport (annularLift W) ⊆ Metric.ball (0 : Euc n) 3 := + (annularLift_tsupport W).trans (Metric.closedBall_subset_ball (by norm_num)) + have hk : HasCompactSupport (annularLift W) := + (isCompact_closedBall (0 : Euc n) 2).of_isClosed_subset isClosed_closure (annularLift_tsupport W) + have hstat := minimizing_tangentialDivergence_integral_eq_zero hn hE 0 (by norm_num : (0 : ℝ)<3) + hV hk hs + rw [annularLink, integral_map (frameOf_measurable hE.1).aemeasurable + (linkDiv_continuous hW).measurable.aestronglyMeasurable, + annularFrameMeasure, integral_withDensity_eq_integral_smul annularWeightNN_measurable] + change (∫ x in Metric.ball 0 3, annularWeight x * linkDiv (frameOf E x) W ∂perimeterMeasure E) = 0 + apply (integral_congr_ae ?_).trans hstat + filter_upwards [ae_restrict_of_ae (minimizing_halfspaceBlowup_ae hn hE), + ae_restrict_of_ae (minimizing_cone_radial_tangent_ae hn hE hc)] with x hx ht + by_cases hx0 : x = 0 + · subst x + have hd : fderiv ℝ (annularLift W) 0 = 0 := + ((hasFDerivAt_const (0 : Euc n) (0 : Euc n)).congr_of_eventuallyEq (annularLift_zero_nhds W)).fderiv + simp [annularWeight, tangentialDivergence, divergence, hd] + · have hf : IsFrame (radialUnit x, approximateNormal E x) := + ⟨radialUnit_norm hx0, hx.1, by simp [radialUnit, real_inner_smul_left, ht]⟩ + exact (planeTrace_annularLift hW hx0 hf).symm + +end SphericalFrankel +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/RegularSupersolutionC1Test.lean b/lean/OAI/Geometry/Perimeter/Regularity/RegularSupersolutionC1Test.lean new file mode 100644 index 0000000000000000000000000000000000000000..3553a0b727f7315d6e6fa4580ce71194649b9a2c --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/RegularSupersolutionC1Test.lean @@ -0,0 +1,461 @@ +import OAI.Geometry.Perimeter.Regularity.HasC1TraceAt + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPI.Boundary + +theorem regular_supersolution_c1_test {n : ℕ} {S Z : Set (Space n)} + (hS : IsClosed S) (hZ : IsClosed Z) + (hfinite : ∀ R : ℝ, 0 < R → surfaceMeasure S (Metric.ball 0 R) < ⊤) + (hgrad : ∀ f : Space n → ℝ, ContDiff ℝ 1 f → + AEStronglyMeasurable (surfaceGradient S f) (surfaceMeasure S)) + {W : Space n → ℝ} {D : Space n → Space n} + (htrace : ∀ x ∈ S \ Z, HasC1TraceJetAt S W D x) + (hsup : ∀ φ : Space n → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → + Disjoint (tsupport φ) Z → (∀ x, 0 ≤ φ x) → + 0 ≤ ∫ x, inner ℝ (D x) (surfaceGradient S φ x) ∂surfaceMeasure S) + {φ : Space n → ℝ} (hφ : ContDiff ℝ 1 φ) (hc : HasCompactSupport φ) + (hφZ : Disjoint (tsupport φ) Z) (hpφ : ∀ x, 0 ≤ φ x) : + 0 ≤ ∫ x, inner ℝ (D x) (surfaceGradient S φ x) ∂surfaceMeasure S := by + obtain ⟨r, hr, hKZ⟩ := hc.exists_cthickening_subset_open hZ.isOpen_compl + (Set.disjoint_left.mp hφZ) + let K := Metric.cthickening r (tsupport φ) + have hKc : IsCompact K := hc.cthickening + have hφK : tsupport φ ⊆ K := Metric.self_subset_cthickening (tsupport φ) + have hKd : Disjoint K Z := Set.disjoint_left.mpr hKZ + obtain ⟨F, hF, he⟩ := c1_exists_smooth_representative_near_regular_test hS hZ htrace + hKc.isClosed hKd + have hFK : D =ᵐ[(surfaceMeasure S).restrict K] surfaceGradient S F := by + filter_upwards [ae_restrict_mem hKc.measurableSet, + ae_restrict_of_ae (ae_restrict_mem hS.measurableSet)] with x hx hxS + exact (he x ⟨hxS, hx⟩).2.symm + have hDm : AEStronglyMeasurable D ((surfaceMeasure S).restrict K) := + ((hgrad F hF).mono_measure Measure.restrict_le_self).congr hFK.symm + obtain ⟨R, hR⟩ := Metric.isBounded_iff_subset_ball (0 : Space n) |>.mp hKc.isBounded + have hKfin : surfaceMeasure S K < ⊤ := + (measure_mono (hR.trans (Metric.ball_subset_ball (le_max_left R 1)))).trans_lt + (hfinite (max R 1) (zero_lt_one.trans_le (le_max_right R 1))) + let : IsFiniteMeasure ((surfaceMeasure S).restrict K) := + ⟨by simpa only [Measure.restrict_apply_univ] using hKfin⟩ + obtain ⟨B, hB⟩ := hKc.exists_bound_of_continuousOn + (hF.continuous_fderiv (by norm_num)).continuousOn + have hDb : ∀ᵐ x ∂(surfaceMeasure S).restrict K, ‖D x‖ ≤ B := by + filter_upwards [ae_restrict_mem hKc.measurableSet, hFK] with x hx hFx + rw [hFx] + exact (surfaceGradient_norm_le_fderiv S F x).trans (hB x hx) + obtain ⟨M, hM, hb, _⟩ := c1Mollify_pair_bounded S hφ hc + have ht := tendsto_integral_of_dominated_convergence (μ := (surfaceMeasure S).restrict K) + (fun _ ↦ B * M) + (F := fun j x ↦ inner ℝ (D x) (surfaceGradient S (c1Mollify φ j) x)) + (f := fun x ↦ inner ℝ (D x) (surfaceGradient S φ x)) + (fun j ↦ hDm.inner ((hgrad _ ((c1Mollify_contDiff hφ.continuous j).of_le (by norm_num))).mono_measure + Measure.restrict_le_self)) (integrable_const _) ?_ ?_ + · have hsupp : ∀ᶠ j in atTop, tsupport (c1Mollify φ j) ⊆ K := by + filter_upwards [c1Mollifier_radius_tendsto.eventually (gt_mem_nhds hr)] with j hj + exact (c1Mollify_tsupport_subset φ j).trans (Metric.cthickening_mono hj.le _) + have hn : ∀ᶠ j in atTop, 0 ≤ ∫ x in K, + inner ℝ (D x) (surfaceGradient S (c1Mollify φ j) x) ∂surfaceMeasure S := by + filter_upwards [hsupp] with j hj + rw [setIntegral_eq_integral_of_forall_compl_eq_zero (fun x hx ↦ by + rw [surfaceGradient_eq_zero_of_notMem_tsupport S (fun h ↦ hx (hj h)), inner_zero_right])] + exact hsup _ (c1Mollify_contDiff hφ.continuous j) (c1Mollify_hasCompactSupport hc j) + (hKd.mono_left hj) (c1Mollify_nonneg hpφ j) + have hle := ge_of_tendsto ht hn + rwa [setIntegral_eq_integral_of_forall_compl_eq_zero (fun x hx ↦ by + rw [surfaceGradient_eq_zero_of_notMem_tsupport S (fun h ↦ hx (hφK h)), inner_zero_right])] at hle + · intro j + filter_upwards [hDb] with x hx + exact (norm_inner_le_norm _ _).trans (mul_le_mul hx (hb j x).2 + (norm_nonneg _) (by linarith [norm_nonneg (D x)])) + · exact ae_of_all _ fun x ↦ tendsto_const_nhds.inner + (c1Mollify_surfaceGradient_tendsto S hφ hc x) + +end RPI.Boundary + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPI.Boundary + +theorem c1_hausdorff_trace_mem_sobolevGraph {n : ℕ} (hn : 8 ≤ n) + {S Z : Set (Space n)} (hS : IsClosed S) (V : Set (Space n)) + (hV : Bornology.IsBounded V) (hVm : MeasurableSet V) + [IsFiniteMeasure ((surfaceMeasure S).restrict V)] + (hZc : IsCompact Z) (hZd : dimH Z ≤ (n - 8 : ℕ)) + {h : Space n → ℝ} {G : Space n → Space n} + (hreg : ∀ x ∈ S \ Z, HasC1TraceJetAt S h G x) + (hh : MemLp h 2 ((surfaceMeasure S).restrict V)) + (hG : MemLp G 2 ((surfaceMeasure S).restrict V)) + {M : ℝ} (hM : 0 ≤ M) + (hbound : ∀ᵐ x ∂(surfaceMeasure S).restrict V, ‖h x‖ ≤ M) + (hgrad : ∀ f : Space n → ℝ, ContDiff ℝ ∞ f → + AEStronglyMeasurable (surfaceGradient S f) ((surfaceMeasure S).restrict V)) + {A r₀ : ℝ} (hA : 0 < A) (hr₀ : 0 < r₀) + (hgrowth : ∀ c ∈ Z, ∀ r : ℝ, 0 < r → r < r₀ → + (surfaceMeasure S).restrict V (Metric.ball c r) ≤ + ENNReal.ofReal (A * r ^ (n - 1))) : + (hh.toLp h, hG.toLp G) ∈ closure (smoothGradientGraph S V) := by + obtain ⟨χ, hχ, hχlim, hχE⟩ := exists_memLp_capacity_sequence hn S V Z hZc hZd + hgrad hA hr₀ hgrowth + exact c1_capacity_trace_mem_sobolevGraph hS V hV hVm hgrad hreg hh hG hM hbound χ + (fun i ↦ (hχ i).1) (fun i ↦ (hχ i).2.2.1) + (fun i ↦ ae_of_all _ (hχ i).2.1) hχlim (fun i ↦ (hχ i).2.2.2) hχE + +theorem HasC1TraceJetAt.mul_smooth {n : ℕ} {S : Set (Space n)} + {h : Space n → ℝ} {G : Space n → Space n} {x : Space n} + (hxS : x ∈ S) (hx : HasC1TraceJetAt S h G x) + {ψ : Space n → ℝ} (hψ : ContDiff ℝ ∞ ψ) : + HasC1TraceJetAt S (fun y ↦ ψ y * h y) + (fun y ↦ ψ y • G y + h y • surfaceGradient S ψ y) x := by + obtain ⟨U, hU, hxU, f, hf, he, hG⟩ := hx + refine ⟨U, hU, hxU, fun y ↦ ψ y * f y, (hψ.of_le (by norm_num)).contDiffOn.mul hf, ?_, ?_⟩ + · intro y hy + exact congrArg (fun a ↦ ψ y * a) (he hy) + · rw [surfaceGradient_mul (hψ.differentiable (by simp) x) + ((hf.contDiffAt (hU.mem_nhds hxU)).differentiableAt (by simp)), + hG, he ⟨hxS, hxU⟩] + +theorem c1_regular_trace_jet_mul_spatial {n : ℕ} {S Z : Set (Space n)} + {h : Space n → ℝ} {G : Space n → Space n} + (hreg : ∀ x ∈ S \ Z, HasC1TraceJetAt S h G x) + {ψ : Space n → ℝ} (hψ : ContDiff ℝ ∞ ψ) : + ∀ x ∈ S \ (Z ∩ tsupport ψ), HasC1TraceJetAt S (fun y ↦ ψ y * h y) + (fun y ↦ ψ y • G y + h y • surfaceGradient S ψ y) x := by + intro x hx + by_cases hxZ : x ∈ Z + · have hxs : x ∉ tsupport ψ := fun hxψ ↦ hx.2 ⟨hxZ, hxψ⟩ + have hloc : ψ =ᶠ[𝓝 x] (0 : Space n → ℝ) := + notMem_tsupport_iff_eventuallyEq.mp hxs + obtain ⟨U, hUsub, hU, hxU⟩ := mem_nhds_iff.mp hloc + have hψgrad : gradient ψ x = 0 := by + simpa only [Pi.zero_def, gradient_fun_const] using hloc.gradient_eq + have hψx : ψ x = 0 := hloc.self_of_nhds + refine ⟨U, hU, hxU, fun _ ↦ 0, contDiffOn_const, ?_, ?_⟩ + · intro y hy + have hy0 : ψ y = 0 := hUsub hy.2 + simp only [hy0, zero_mul] + · simp only [hψx, surfaceGradient, hψgrad, gradient_fun_const, + map_zero, Submodule.coe_zero, zero_smul, smul_zero, add_zero] + · exact (hreg x ⟨hx.1, hxZ⟩).mul_smooth hx.1 hψ + +theorem c1_hausdorff_trace_mem_sobolevGraph_ball {n : ℕ} (hn : 8 ≤ n) + {S Z : Set (Space n)} (hS : IsClosed S) (hZ : IsClosed Z) + (hZd : dimH Z ≤ (n - 8 : ℕ)) {R : ℝ} (hR : 0 < R) + [IsFiniteMeasure ((surfaceMeasure S).restrict (Metric.ball 0 R))] + {h : Space n → ℝ} {G : Space n → Space n} + (hreg : ∀ x ∈ S \ Z, HasC1TraceJetAt S h G x) + (hh : MemLp h 2 ((surfaceMeasure S).restrict (Metric.ball 0 R))) + (hG : MemLp G 2 ((surfaceMeasure S).restrict (Metric.ball 0 R))) + {M : ℝ} (hM : 0 ≤ M) + (hbound : ∀ᵐ x ∂(surfaceMeasure S).restrict (Metric.ball 0 R), ‖h x‖ ≤ M) + (hgrad : ∀ f : Space n → ℝ, ContDiff ℝ ∞ f → + AEStronglyMeasurable (surfaceGradient S f) + ((surfaceMeasure S).restrict (Metric.ball 0 R))) + {A r₀ : ℝ} (hA : 0 < A) (hr₀ : 0 < r₀) + (hgrowth : ∀ c ∈ Z ∩ Metric.closedBall 0 (R + 2), ∀ r : ℝ, 0 < r → r < r₀ → + (surfaceMeasure S).restrict (Metric.ball 0 R) (Metric.ball c r) ≤ + ENNReal.ofReal (A * r ^ (n - 1))) : + (hh.toLp h, hG.toLp G) ∈ closure (smoothGradientGraph S (Metric.ball 0 R)) := by + let b : ContDiffBump (0 : Space n) := ⟨R + 1, R + 2, by linarith, by linarith⟩ + let K : Set (Space n) := Z ∩ tsupport b + have hKc : IsCompact K := b.hasCompactSupport.of_isClosed_subset + (hZ.inter (isClosed_tsupport b)) inter_subset_right + have hKd : dimH K ≤ (n - 8 : ℕ) := + (dimH_mono (show K ⊆ Z from inter_subset_left)).trans hZd + have hb : ∀ x ∈ Metric.ball (0 : Space n) R, b =ᶠ[𝓝 x] 1 := by + intro x hx + apply b.eventuallyEq_one_of_mem_ball + exact Metric.mem_ball.mpr ((Metric.mem_ball.mp hx).trans (by dsimp [b]; linarith)) + have hbG : ∀ x ∈ Metric.ball (0 : Space n) R, surfaceGradient S b x = 0 := by + intro x hx + have hgr : gradient b x = 0 := by + simpa only [Pi.one_def, gradient_fun_const] using (hb x hx).gradient_eq + simp only [surfaceGradient, hgr, map_zero, Submodule.coe_zero] + let h' := fun x ↦ b x * h x + let G' := fun x ↦ b x • G x + h x • surfaceGradient S b x + have he : h' =ᵐ[(surfaceMeasure S).restrict (Metric.ball 0 R)] h := by + filter_upwards [ae_restrict_mem measurableSet_ball] with x hx + dsimp [h'] + rw [(hb x hx).self_of_nhds] + simp + have hDe : G' =ᵐ[(surfaceMeasure S).restrict (Metric.ball 0 R)] G := by + filter_upwards [ae_restrict_mem measurableSet_ball] with x hx + dsimp [G'] + rw [(hb x hx).self_of_nhds, hbG x hx] + simp + let hh' := hh.ae_eq he.symm + let hG' := hG.ae_eq hDe.symm + have hbound' : ∀ᵐ x ∂(surfaceMeasure S).restrict (Metric.ball 0 R), ‖h' x‖ ≤ M := by + filter_upwards [he, hbound] with x hx hbx + simpa only [hx] using hbx + have hmem := c1_hausdorff_trace_mem_sobolevGraph hn hS (Metric.ball 0 R) + Metric.isBounded_ball measurableSet_ball hKc hKd + (c1_regular_trace_jet_mul_spatial hreg b.contDiff) hh' hG' hM + hbound' hgrad hA hr₀ (fun c hc r hr hrr ↦ hgrowth c + ⟨hc.1, by simpa only [b.tsupport_eq] using hc.2⟩ r hr hrr) + have heLp : hh'.toLp h' = hh.toLp h := hh'.toLp_congr hh he + have hDeLp : hG'.toLp G' = hG.toLp G := hG'.toLp_congr hG hDe + change (hh'.toLp h', hG'.toLp G') ∈ _ at hmem + simpa only [heLp, hDeLp] using hmem + +theorem c1_trace_aestronglyMeasurable_of_singular_dim {n : ℕ} (hn : 8 ≤ n) + {S Z : Set (Space n)} (hS : MeasurableSet S) (hZ : MeasurableSet Z) + (hdim : dimH Z ≤ (n - 8 : ℕ)) {h : Space n → ℝ} {G : Space n → Space n} + (hreg : ∀ x ∈ S \ Z, HasC1TraceJetAt S h G x) : + AEStronglyMeasurable h (surfaceMeasure S) := by + have hc : ContinuousOn h (S \ Z) := by + intro x hx + obtain ⟨U, hU, hxU, f, hf, he, _⟩ := hreg x hx + have hf' : ContinuousWithinAt f (S \ Z) x := + (hf.contDiffAt (hU.mem_nhds hxU)).continuousAt.continuousWithinAt + apply hf'.congr_of_eventuallyEq _ (he ⟨hx.1, hxU⟩).symm + filter_upwards [self_mem_nhdsWithin, + mem_nhdsWithin_of_mem_nhds (hU.mem_nhds hxU)] with y hy hyU + exact (he ⟨hy.1, hyU⟩).symm + have hs : ∀ᵐ x ∂surfaceMeasure S, x ∈ S := ae_restrict_mem hS + have hz : ∀ᵐ x ∂surfaceMeasure S, x ∉ Z := by + simpa only [ae_iff, not_not, Set.ofPred_mem_eq] using + surfaceMeasure_zero_of_singular_dim hn S Z hdim + have hregular : ∀ᵐ x ∂surfaceMeasure S, x ∈ S \ Z := by + filter_upwards [hs, hz] with x hx hzx + exact ⟨hx, hzx⟩ + have hmeas := hc.aestronglyMeasurable (μ := surfaceMeasure S) (hS.diff hZ) + rwa [Measure.restrict_eq_self_of_ae_mem hregular] at hmeas + +theorem c1_min_one_mem_sobolevGraph_ball {n : ℕ} (hn : 8 ≤ n) + {S Z : Set (Space n)} (hS : IsClosed S) (hZ : IsClosed Z) + (hZd : dimH Z ≤ (n - 8 : ℕ)) {R : ℝ} (hR : 0 < R) + [IsFiniteMeasure ((surfaceMeasure S).restrict (Metric.ball 0 R))] + {W : Space n → ℝ} {D : Space n → Space n} + (htrace : ∀ x ∈ S \ Z, HasC1TraceJetAt S W D x) + (hW0 : ∀ᵐ x ∂(surfaceMeasure S).restrict (Metric.ball 0 R), 0 ≤ W x) + (hG : MemLp (truncatedGradient W D) 2 + ((surfaceMeasure S).restrict (Metric.ball 0 R))) + (hgrad : ∀ f : Space n → ℝ, ContDiff ℝ ∞ f → + AEStronglyMeasurable (surfaceGradient S f) + ((surfaceMeasure S).restrict (Metric.ball 0 R))) + {A r₀ : ℝ} (hA : 0 < A) (hr₀ : 0 < r₀) + (hgrowth : ∀ c ∈ Z ∩ Metric.closedBall 0 (R + 2), ∀ r : ℝ, 0 < r → r < r₀ → + (surfaceMeasure S).restrict (Metric.ball 0 R) (Metric.ball c r) ≤ + ENNReal.ofReal (A * r ^ (n - 1))) : + ∃ hh : MemLp (fun x ↦ min (W x) 1) 2 + ((surfaceMeasure S).restrict (Metric.ball 0 R)), + (hh.toLp (fun x ↦ min (W x) 1), hG.toLp (truncatedGradient W D)) ∈ + closure (smoothGradientGraph S (Metric.ball 0 R)) := by + have hW : AEStronglyMeasurable W ((surfaceMeasure S).restrict (Metric.ball 0 R)) := + (c1_trace_aestronglyMeasurable_of_singular_dim hn hS.measurableSet + hZ.measurableSet hZd htrace).mono_measure (Measure.restrict_le_self) + obtain ⟨hh, hf, hF, hlim⟩ := smoothTruncation_pair_tendsto hW hW0 hG + refine ⟨hh, isClosed_closure.mem_of_tendsto hlim (Filter.Eventually.of_forall ?_)⟩ + intro j + apply c1_hausdorff_trace_mem_sobolevGraph_ball hn hS hZ hZd hR + (fun x hx ↦ (htrace x hx).smoothTruncation hx.1 (truncationParameter_pos j)) + (hf j) (hF j) (M := 1) zero_le_one _ hgrad hA hr₀ hgrowth + filter_upwards [hW0] with x hx + exact smoothTruncation_norm_le (truncationParameter_pos j) hx + +end RPI.Boundary + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPI.Boundary +section C1RegularTests +variable {n : ℕ} {S Z : Set (Space n)} +variable (hS : IsClosed S) (hZ : IsClosed Z) +variable (hfinite : ∀ R : ℝ, 0 < R → (surfaceMeasure S) (Metric.ball 0 R) < ⊤) +variable (hgrad : ∀ f : Space n → ℝ, ContDiff ℝ 1 f → + AEStronglyMeasurable (surfaceGradient S f) (surfaceMeasure S)) +include hS hZ hfinite hgrad + +theorem c1_smoothTruncation_regular_test {W : Space n → ℝ} {D : Space n → Space n} + (htrace : ∀ x ∈ S \ Z, HasC1TraceJetAt S W D x) + (hsup : ∀ φ : Space n → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → + Disjoint (tsupport φ) Z → (∀ x, 0 ≤ φ x) → + 0 ≤ ∫ x, inner ℝ (D x) (surfaceGradient S φ x) ∂surfaceMeasure S) + {ε : ℝ} (hε : 0 < ε) {φ : Space n → ℝ} + (hφ : ContDiff ℝ 1 φ) (hcφ : HasCompactSupport φ) + (hφZ : Disjoint (tsupport φ) Z) (hpφ : ∀ x, 0 ≤ φ x) : + 0 ≤ ∫ x, inner ℝ (truncationSlope ε (W x) • D x) + (surfaceGradient S φ x) ∂surfaceMeasure S := by + obtain ⟨F, hF, he⟩ := c1_exists_smooth_representative_near_regular_test hS hZ htrace + (isClosed_tsupport φ) hφZ + let ψ : Space n → ℝ := fun x ↦ φ x * truncationSlope ε (F x) + have hψ : ContDiff ℝ 1 ψ := hφ.mul (((truncationSlope_contDiff ε).of_le (by norm_num)).comp hF) + have hcψ : HasCompactSupport ψ := hcφ.mul_right + have hψZ : Disjoint (tsupport ψ) Z := hφZ.mono_left tsupport_mul_subset_left + have htt : ∀ x ∈ S \ Z, HasC1TraceJetAt S (smoothTruncation ε ∘ W) + (fun y ↦ truncationSlope ε (W y) • D y) x := by + intro x hx + simpa only [smoothTruncation_deriv] using + (htrace x hx).comp hx.1 ((smoothTruncation_contDiff ε).of_le (by norm_num)) + have hi := c1_integrable_regular_test_pair hS hZ hfinite hgrad htrace hψ hcψ hψZ + have hj := c1_integrable_regular_test_pair hS hZ hfinite hgrad htt hφ hcφ hφZ + apply (regular_supersolution_c1_test hS hZ hfinite hgrad htrace hsup hψ hcψ hψZ (fun x ↦ mul_nonneg (hpφ x) + (truncationSlope_mem_Icc ε (F x)).1)).trans + apply integral_mono_ae hi hj + filter_upwards [ae_restrict_mem hS.measurableSet] with x hx + by_cases hxt : x ∈ tsupport φ + · have hFx := he x ⟨hx, hxt⟩ + have hDp : deriv (truncationSlope ε) (W x) ≤ 0 := + (truncationSlope_antitone hε).deriv_nonpos + have heq : surfaceGradient S ψ x = + φ x • (deriv (truncationSlope ε) (W x) • D x) + + truncationSlope ε (W x) • surfaceGradient S φ x := by + dsimp only [ψ] + rw [surfaceGradient_mul (S := S) (g := fun y ↦ truncationSlope ε (F y)) (hφ.differentiable (by simp) x) + ((((truncationSlope_contDiff ε).of_le (by norm_num)).comp hF).differentiable (by simp) x)] + rw [show (fun y ↦ truncationSlope ε (F y)) = truncationSlope ε ∘ F from rfl, + surfaceGradient_comp (hF.differentiable (by simp) x) + ((truncationSlope_contDiff ε).differentiable (by simp) (F x)), hFx.1, hFx.2] + rw [heq, inner_add_right, real_inner_smul_right, real_inner_smul_right, + real_inner_smul_right, real_inner_smul_left, real_inner_self_eq_norm_sq] + have hneg : φ x * (deriv (truncationSlope ε) (W x) * ‖D x‖ ^ 2) ≤ 0 := + mul_nonpos_of_nonneg_of_nonpos (hpφ x) (mul_nonpos_of_nonpos_of_nonneg hDp (sq_nonneg _)) + linarith + · have hxψ : x ∉ tsupport ψ := fun h ↦ hxt (tsupport_mul_subset_left h) + simp only [surfaceGradient_eq_zero_of_notMem_tsupport S hxt, + surfaceGradient_eq_zero_of_notMem_tsupport S hxψ, inner_zero_right, le_refl] + +end C1RegularTests +end RPI.Boundary + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPI.Boundary +section RegularEnergy +variable {n : ℕ} {S Z : Set (Space n)} +variable (hS : IsClosed S) (hZ : IsClosed Z) +variable (hfinite : ∀ R : ℝ, 0 < R → (surfaceMeasure S) (Metric.ball 0 R) < ⊤) +variable (hgrad : ∀ f : Space n → ℝ, ContDiff ℝ 1 f → + AEStronglyMeasurable (surfaceGradient S f) (surfaceMeasure S)) +include hS hZ hfinite hgrad + +theorem c1_regular_gradient_memLp_test {W : Space n → ℝ} {D : Space n → Space n} + (htrace : ∀ x ∈ S \ Z, HasC1TraceJetAt S W D x) + {η : Space n → ℝ} (hη : ContDiff ℝ 1 η) (hcη : HasCompactSupport η) + (hηZ : Disjoint (tsupport η) Z) : + MemLp (fun x ↦ η x • D x) 2 (surfaceMeasure S) := by + have hi := c1_regular_gradient_memLp_indicator_test hS hZ hfinite hgrad htrace hcη hηZ + obtain ⟨M, hM⟩ := hcη.exists_bound_of_continuous hη.continuous + have hh : MemLp (fun x ↦ η x • (tsupport η).indicator D x) 2 (surfaceMeasure S) := by + apply hi.of_le_mul (c := M) + (hη.continuous.aestronglyMeasurable.smul hi.aestronglyMeasurable) + apply ae_of_all + intro x + change ‖η x • (tsupport η).indicator D x‖ ≤ M * ‖(tsupport η).indicator D x‖ + rw [norm_smul] + exact mul_le_mul_of_nonneg_right (hM x) (norm_nonneg _) + apply hh.ae_eq + apply ae_of_all + intro x + by_cases hx : x ∈ tsupport η + · simp only [indicator_of_mem hx] + · simp only [indicator_of_notMem hx, image_eq_zero_of_notMem_tsupport hx, zero_smul] + +theorem c1_smoothTruncation_regular_energy {W : Space n → ℝ} {D : Space n → Space n} + (htrace : ∀ x ∈ S \ Z, HasC1TraceJetAt S W D x) + (hW0 : ∀ x ∈ S \ Z, 0 ≤ W x) + (hsup : ∀ φ : Space n → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → + Disjoint (tsupport φ) Z → (∀ x, 0 ≤ φ x) → + 0 ≤ ∫ x, inner ℝ (D x) (surfaceGradient S φ x) ∂surfaceMeasure S) + {ε : ℝ} (hε : 0 < ε) {η : Space n → ℝ} + (hη : ContDiff ℝ 1 η) (hcη : HasCompactSupport η) + (hηZ : Disjoint (tsupport η) Z) : + (∫ x, ‖η x • (truncationSlope ε (W x) • D x)‖ ^ 2 ∂surfaceMeasure S) ≤ + 4 * ∫ x, ‖surfaceGradient S η x‖ ^ 2 ∂surfaceMeasure S := by + let T := smoothTruncation ε + let G : Space n → Space n := fun x ↦ truncationSlope ε (W x) • D x + have htt : ∀ x ∈ S \ Z, HasC1TraceJetAt S (T ∘ W) G x := by + intro x hx + simpa only [T, G, smoothTruncation_deriv] using + (htrace x hx).comp hx.1 ((smoothTruncation_contDiff ε).of_le (by norm_num)) + obtain ⟨F, hF, he⟩ := c1_exists_smooth_representative_near_regular_test hS hZ htrace + (isClosed_tsupport η) hηZ + let ψ : Space n → ℝ := fun x ↦ (η x * η x) * (1 - T (F x)) + have hTF : ContDiff ℝ 1 (T ∘ F) := ((smoothTruncation_contDiff ε).of_le (by norm_num)).comp hF + have hψ : ContDiff ℝ 1 ψ := (hη.mul hη).mul (contDiff_const.sub hTF) + have hcψ : HasCompactSupport ψ := hcη.mul_right.mul_right + have hsub : tsupport ψ ⊆ tsupport η := tsupport_mul_subset_left.trans tsupport_mul_subset_left + have hψZ : Disjoint (tsupport ψ) Z := hηZ.mono_left hsub + have hψ0 : ∀ x, 0 ≤ ψ x := fun x ↦ mul_nonneg (mul_self_nonneg (η x)) + (sub_nonneg.mpr (smoothTruncation_le_one_all hε (F x))) + have ht : 0 ≤ ∫ x, inner ℝ (G x) (surfaceGradient S ψ x) ∂surfaceMeasure S := + c1_smoothTruncation_regular_test hS hZ hfinite hgrad htrace hsup hε hψ hcψ hψZ hψ0 + let A : Space n → Space n := fun x ↦ η x • G x + let B : Space n → Space n := surfaceGradient S η + have hA : MemLp A 2 (surfaceMeasure S) := + c1_regular_gradient_memLp_test hS hZ hfinite hgrad htt hη hcη hηZ + have hB : MemLp B 2 (surfaceMeasure S) := + c1_surfaceGradient_memLp_of_compact hfinite hgrad hη hcη + have hi := c1_integrable_regular_test_pair hS hZ hfinite hgrad htt hψ hcψ hψZ + have hAs := (memLp_two_iff_integrable_sq_norm hA.aestronglyMeasurable).mp hA + have hBs := (memLp_two_iff_integrable_sq_norm hB.aestronglyMeasurable).mp hB + have hu : Integrable (fun x ↦ 2 * ‖B x‖ ^ 2 - (1 / 2 : ℝ) * ‖A x‖ ^ 2) (surfaceMeasure S) := + (hBs.const_mul 2).sub (hAs.const_mul (1 / 2)) + have hle : (∫ x, inner ℝ (G x) (surfaceGradient S ψ x) ∂surfaceMeasure S) ≤ + ∫ x, 2 * ‖B x‖ ^ 2 - (1 / 2 : ℝ) * ‖A x‖ ^ 2 ∂surfaceMeasure S := by + apply integral_mono_ae hi hu + filter_upwards [ae_restrict_mem hS.measurableSet] with x hx + by_cases hxt : x ∈ tsupport η + · have hxr : x ∈ S \ Z := ⟨hx, fun hz ↦ Set.disjoint_left.mp hηZ hxt hz⟩ + have hFx := he x ⟨hx, hxt⟩ + have hgT : surfaceGradient S (fun y ↦ T (F y)) x = G x := by + change surfaceGradient S (T ∘ F) x = G x + rw [surfaceGradient_comp (hF.differentiable (by simp) x) + ((smoothTruncation_contDiff ε).differentiable (by simp) (F x))] + simp only [smoothTruncation_deriv, hFx.1, hFx.2, G] + have hgψ : surfaceGradient S ψ x = + (η x * η x) • (-G x) + (1 - T (W x)) • (η x • B x + η x • B x) := by + dsimp only [ψ] + rw [surfaceGradient_mul (S := S) (g := fun y ↦ 1 - T (F y)) ((hη.mul hη).differentiable (by simp) x) + ((contDiff_const.sub hTF).differentiable (by simp) x)] + rw [surfaceGradient_const_sub S 1, hgT, + surfaceGradient_mul (hη.differentiable (by simp) x) (hη.differentiable (by simp) x), hFx.1] + have heq : inner ℝ (G x) (surfaceGradient S ψ x) = + inner ℝ (A x) ((2 * (1 - T (W x))) • B x - A x) := by + rw [hgψ] + simp only [A, inner_add_right, real_inner_smul_right, inner_neg_right, + real_inner_smul_left, inner_sub_right] + ring + rw [heq] + exact truncation_test_pointwise (A x) (B x) + (smoothTruncation_nonneg ε (hW0 x hxr)) (smoothTruncation_le_one_all hε (W x)) + · have hAx : A x = 0 := by simp only [A, image_eq_zero_of_notMem_tsupport hxt, zero_smul] + have hBx : B x = 0 := surfaceGradient_eq_zero_of_notMem_tsupport S hxt + rw [surfaceGradient_eq_zero_of_notMem_tsupport S (fun h ↦ hxt (hsub h)), + inner_zero_right, hAx, hBx] + norm_num + rw [integral_sub (hBs.const_mul 2) (hAs.const_mul (1 / 2)), + integral_const_mul, integral_const_mul] at hle + change (∫ x, ‖A x‖ ^ 2 ∂surfaceMeasure S) ≤ 4 * ∫ x, ‖B x‖ ^ 2 ∂surfaceMeasure S + linarith + +end RegularEnergy +end RPI.Boundary + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/SequentialFlatness.lean b/lean/OAI/Geometry/Perimeter/Regularity/SequentialFlatness.lean new file mode 100644 index 0000000000000000000000000000000000000000..d631e56c218e6493fa1a19f5040bed60af9b40ce --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/SequentialFlatness.lean @@ -0,0 +1,167 @@ +import OAI.Geometry.Perimeter.Regularity.PlaneHeightLimit +import OAI.Geometry.Perimeter.Regularity.HarmonicHeightLimit +import OAI.Geometry.Perimeter.Regularity.FiberQuadraticLimit +import OAI.Geometry.Perimeter.Regularity.SupportImprovement +import OAI.Geometry.Perimeter.Regularity.HarmonicLimitBounds + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +open RPI.Boundary ContinuousLinearMap +variable {n m : ℕ} + +theorem minimizing_plane_limit_integral_bound + (E : ℕ → Set (Euc n)) (hmin : ∀ i, IsLocallyPerimeterMinimizing (E i)) + {v : Euc n} (hv : ‖v‖=1) (e : Euc m ≃ₗᵢ[ℝ] normalPlane v) + {η : Euc n → ℝ} (hη : Continuous η) (hcη : HasCompactSupport η) + (hηs : Function.support η ⊆ Metric.ball 0 4) (hηb : ∀ x, ‖η x‖≤1) + (a : ℕ → ℝ) (ha : ∀ i, 0 by_cases hxF : x ∈ F + · simp [hxE, hxF, mem_symmDiff] + · simpa [hxE, hxF, mem_symmDiff] using (neg_le_abs (f x)).trans (hfg x) + · simpa [hxE, hxF, mem_symmDiff] using (le_abs_self (f x)).trans (hfg x) + · simp [hxE, hxF, mem_symmDiff] + +theorem integral_smooth_patch_le {n : ℕ} {E F U : Set (Euc n)} + (hE : MeasurableSet E) (hF : MeasurableSet F) + {V : Euc n → Euc n} (hV : PerimeterAdmissible U V) + {c : Euc n} {r a b B : ℝ} (ha : 0 < a) (hra : r < a) (hab : a < b) + (hbB : b < B) (hPE : perimeter E (U \ Metric.closedBall c r) ≠ ⊤) + (hPF : perimeter F (Metric.ball c B) ≠ ⊤) : + (∫ x in F, divergence V x) + + (∫ x in E, annularCutoff c a b x * divergence V x) - + (∫ x in F, annularCutoff c a b x * divergence V x) ≤ + (perimeter E (U \ Metric.closedBall c r)).toReal + + (perimeter F (Metric.ball c B)).toReal + + ∫ x in symmDiff E F, ‖gradient (annularCutoff c a b) x‖ := by + have hVE : PerimeterAdmissible (U \ Metric.closedBall c r) + (fun x ↦ annularCutoff c a b x • V x) := + annularCutoff_test_admissible hV ha hra hab + have hVu : PerimeterAdmissible univ V := + ⟨hV.1, hV.2.1, subset_univ _, hV.2.2.2⟩ + have hVF := pairedCutTest_admissible hVu (perimeterAdmissible_zero (Metric.ball c B)) + ha hab (Metric.closedBall_subset_ball hbB) + have hd := integrable_divergence hV.1 hV.2.1 + have hg : Integrable (fun x ↦ ‖gradient (annularCutoff c a b) x‖) volume := + ((gradient_annularCutoff_continuous c a b).integrable_of_hasCompactSupport + (gradient_annularCutoff_compact c ha hab)).norm + have hinner (x : Euc n) : |inner ℝ (gradient (annularCutoff c a b) x) (V x)| ≤ + ‖gradient (annularCutoff c a b) x‖ := + (abs_real_inner_le_norm _ _).trans + (mul_le_of_le_one_right (norm_nonneg _) (hV.2.2.2 x)) + have hi : Integrable (fun x ↦ inner ℝ (gradient (annularCutoff c a b) x) (V x)) volume := + hg.mono' ((gradient_annularCutoff_continuous c a b).inner hV.1.continuous).aestronglyMeasurable + (Eventually.of_forall hinner) + have hmul := integrable_annularCutoff_mul hd c a b + have hEi := integral_divergence_le_perimeter_real E _ hPE hVE + have hFi := integral_divergence_le_perimeter_real F _ hPF hVF + simp_rw [divergence_smul ((annularCutoff_contDiff c a b).differentiable (by simp)) + (hV.1.differentiable (by simp))] at hEi + rw [integral_add hmul.integrableOn hi.integrableOn] at hEi + have hformula (x : Euc n) : divergence (pairedCutTest c a b V (fun _ ↦ 0)) x = + divergence V x - annularCutoff c a b x * divergence V x - + inner ℝ (gradient (annularCutoff c a b) x) (V x) := by + rw [divergence_pairedCutTest hV.1 contDiff_const] + have hz : divergence (fun _ : Euc n ↦ (0:Euc n)) x = 0 := by simp [divergence] + simp only [hz, zero_sub, inner_neg_right] + ring + simp_rw [hformula] at hFi + have hleft : Integrable (fun x ↦ divergence V x - annularCutoff c a b x * divergence V x) volume := hd.sub hmul + rw [integral_sub hleft.integrableOn hi.integrableOn, + integral_sub hd.integrableOn hmul.integrableOn] at hFi + have herr := setIntegral_sub_le_symmDiff hE hF hi hg hinner + linarith + +def gluedFilledSet {n : ℕ} (E F : Set (Euc n)) (c : Euc n) (r : ℝ) : Set (Euc n) := + (F ∩ Metric.closedBall c r) ∪ (E \ Metric.closedBall c r) + +theorem controlled_radius_glued_perimeter_le {n : ℕ} {E F U : Set (Euc n)} + (hE : MeasurableSet E) (hF : MeasurableSet F) (c : Euc n) {r B D L : ℝ} + (hr : 0 < r) (hrB : r < B) + (hcontrol : ∀ t ∈ Icc r B, + volume.real (symmDiff E F ∩ Metric.closedBall c t) - + volume.real (symmDiff E F ∩ Metric.closedBall c r) ≤ D * (t - r)) + (hD : 0 ≤ D) (hL : 0 < L) + (hbound : ∀ s, |deriv Real.smoothTransition s| ≤ L) + (hPE : perimeter E (U \ Metric.closedBall c r) ≠ ⊤) + (hPF : perimeter F (Metric.ball c B) ≠ ⊤) : + perimeter (gluedFilledSet E F c r) U ≤ + perimeter E (U \ Metric.closedBall c r) + perimeter F (Metric.ball c B) + + ENNReal.ofReal (4*L*D) := by + rw [perimeter_eq_iSup_tests] + refine iSup_le fun V ↦ iSup_le fun hV ↦ ?_ + have hd := integrable_divergence hV.1 hV.2.1 + have hdis : Disjoint (F ∩ Metric.closedBall c r) (E \ Metric.closedBall c r) := by + apply disjoint_left.mpr + intro x hx hy + exact hy.2 hx.2 + have hsplit := integral_inter_add_sdiff (s := F) (t := Metric.closedBall c r) + measurableSet_closedBall hd.integrableOn + have hpatch : (∫ x in F, divergence V x) + + (∫ x in E \ Metric.closedBall c r, divergence V x) - + (∫ x in F \ Metric.closedBall c r, divergence V x) = + ∫ x in gluedFilledSet E F c r, divergence V x := by + rw [gluedFilledSet, setIntegral_union hdis (hE.diff measurableSet_closedBall) + hd.integrableOn hd.integrableOn] + linarith + have ht := ((tendsto_const_nhds (x := ∫ x in F, divergence V x)).add + (tendsto_integral_annularCutoff_mul (E := E) hd c hr)).sub + (tendsto_integral_annularCutoff_mul (E := F) hd c hr) + rw [hpatch] at ht + have hreal : (∫ x in gluedFilledSet E F c r, divergence V x) ≤ + (perimeter E (U \ Metric.closedBall c r)).toReal + + (perimeter F (Metric.ball c B)).toReal + 4*L*D := by + apply le_of_tendsto ht + filter_upwards [self_mem_nhdsWithin, + nhdsWithin_le_nhds (gt_mem_nhds (show (0:ℝ) < (B-r)/2 by linarith))] with δ hδ hsmall + change 0 < δ at hδ + change δ < (B-r)/2 at hsmall + have hh := integral_smooth_patch_le hE hF hV + (show 0 < r+δ by positivity) (show r < r+δ by linarith) + (show r+δ < r+2*δ by linarith) (show r+2*δ < B by linarith) hPE hPF + have hg := controlled_radius_gradient_bound (hE.symmDiff hF) c hr hδ + (show r+2*δ ≤ B by linarith) hcontrol hD hL hbound + linarith + calc + _ ≤ ENNReal.ofReal ((perimeter E (U \ Metric.closedBall c r)).toReal + + (perimeter F (Metric.ball c B)).toReal + 4*L*D) := ENNReal.ofReal_le_ofReal hreal + _ = _ := by + rw [ENNReal.ofReal_add (by positivity) (by positivity), + ENNReal.ofReal_add ENNReal.toReal_nonneg ENNReal.toReal_nonneg, + ENNReal.ofReal_toReal hPE, ENNReal.ofReal_toReal hPF] + +theorem minimizing_controlled_replacement_perimeter_le {n : ℕ} {E F : Set (Euc n)} + (hmin : IsLocallyPerimeterMinimizing E) (hF : MeasurableSet F) + (c : Euc n) {a r B D L : ℝ} (ha : 0 < a) (har : a ≤ r) (hrB : r < B) + (hcontrol : ∀ t ∈ Icc r B, + volume.real (symmDiff E F ∩ Metric.closedBall c t) - + volume.real (symmDiff E F ∩ Metric.closedBall c r) ≤ D*(t-r)) + (hD : 0 ≤ D) (hL : 0 < L) + (hbound : ∀ s, |deriv Real.smoothTransition s| ≤ L) + (hPF : perimeter F (Metric.ball c B) ≠ ⊤) : + perimeter E (Metric.ball c a) ≤ perimeter F (Metric.ball c B) + ENNReal.ofReal (4*L*D) := by + let U := Metric.ball c (B+1) + let G := gluedFilledSet E F c r + have hr : 0 < r := ha.trans_le har + have hUfin : perimeter E U ≠ ⊤ := (hmin.2.1 c (B+1) (by linarith)).ne + have hPE : perimeter E (U \ Metric.closedBall c r) ≠ ⊤ := + ne_top_of_le_ne_top hUfin (raw_perimeter_mono_region E sdiff_subset) + have hG : MeasurableSet G := + (hF.inter measurableSet_closedBall).union (hmin.1.diff measurableSet_closedBall) + have hcl : closure (symmDiff E G) ⊆ Metric.closedBall c r := by + apply closure_minimal _ Metric.isClosed_closedBall + intro x hx + by_contra hb + have hmem : x ∈ G ↔ x ∈ E := by simp [G, gluedFilledSet, hb] + rcases hx with hx | hx + · exact hx.2 (hmem.mpr hx.1) + · exact hx.2 (hmem.mp hx.1) + have hcmp := hmin.2.2 c (B+1) (by linarith) G hG + ((isCompact_closedBall c r).of_isClosed_subset isClosed_closure hcl) + (hcl.trans (Metric.closedBall_subset_ball (by linarith))) + have hcut := controlled_radius_glued_perimeter_le hmin.1 hF c hr hrB + hcontrol hD hL hbound hPE hPF + have hdis : Disjoint (Metric.ball c a) (U \ Metric.closedBall c r) := by + apply disjoint_left.mpr + intro x hx hy + exact hy.2 ((Metric.ball_subset_closedBall.trans (Metric.closedBall_subset_closedBall har)) hx) + have hadd := perimeter_disjoint_superadditive E + (Metric.ball_subset_ball (by linarith : a ≤ B+1)) sdiff_subset hdis + have hh : perimeter E (Metric.ball c a) + perimeter E (U \ Metric.closedBall c r) ≤ + (perimeter F (Metric.ball c B) + ENNReal.ofReal (4*L*D)) + + perimeter E (U \ Metric.closedBall c r) := by + calc + _ ≤ perimeter E U := hadd + _ ≤ perimeter G U := hcmp + _ ≤ _ := by simpa only [add_assoc, add_comm, add_left_comm] using hcut + exact (ENNReal.add_le_add_iff_right hPE).mp hh + +theorem exists_controlled_annular_cut_radius {n : ℕ} {T : Set (Euc n)} + (hT : MeasurableSet T) (c : Euc n) {a B D : ℝ} (ha : 0 < a) (haB : a < B) + (hv : volume.real (T ∩ (Metric.closedBall c B \ Metric.closedBall c a)) < D*(B-a)) : + ∃ r ∈ Ico a B, ∀ t ∈ Icc r B, + volume.real (T ∩ Metric.closedBall c t) - volume.real (T ∩ Metric.closedBall c r) ≤ D*(t-r) := by + let S := T \ Metric.closedBall c a + have hvol : volume.real (S ∩ Metric.closedBall c B) < D*(B-a) := by + convert hv using 2 + ext x + simp only [S, mem_inter_iff, Set.mem_sdiff] + tauto + obtain ⟨r, hr, hc⟩ := exists_controlled_cut_radius S c ha haB hvol + have he (t : ℝ) (hat : a ≤ t) : + volume.real (S ∩ Metric.closedBall c t) = + volume.real (T ∩ Metric.closedBall c t) - volume.real (T ∩ Metric.closedBall c a) := by + have hset : S ∩ Metric.closedBall c t = + (T ∩ Metric.closedBall c t) \ (T ∩ Metric.closedBall c a) := by + ext x + simp only [S, mem_inter_iff, Set.mem_sdiff] + tauto + rw [hset] + exact measureReal_sdiff (inter_subset_inter_right T (Metric.closedBall_subset_closedBall hat)) + (hT.inter measurableSet_closedBall) + (measure_ne_top_of_subset inter_subset_right (isCompact_closedBall c t).measure_ne_top) + refine ⟨r, hr, ?_⟩ + intro t ht + have hh := hc t ht + rw [he t (hr.1.trans ht.1), he r hr.1] at hh + linarith + +theorem minimizing_annular_replacement_perimeter_le {n : ℕ} {E F : Set (Euc n)} + (hmin : IsLocallyPerimeterMinimizing E) (hF : MeasurableSet F) + (c : Euc n) {a B D L : ℝ} (ha : 0 < a) (haB : a < B) + (hv : volume.real (symmDiff E F ∩ (Metric.closedBall c B \ Metric.closedBall c a)) < D*(B-a)) + (hD : 0 ≤ D) (hL : 0 < L) + (hbound : ∀ s, |deriv Real.smoothTransition s| ≤ L) : + perimeter E (Metric.ball c a) ≤ perimeter F (Metric.ball c B) + ENNReal.ofReal (4*L*D) := by + by_cases hPF : perimeter F (Metric.ball c B) = ⊤ + · simp [hPF] + obtain ⟨r, hr, hc⟩ := exists_controlled_annular_cut_radius (hmin.1.symmDiff hF) c ha haB hv + exact minimizing_controlled_replacement_perimeter_le hmin hF c ha hr.1 hr.2 + hc hD hL hbound hPF + +theorem eventually_minimizing_perimeter_le_of_annular_L1 {n : ℕ} + {E : ℕ → Set (Euc n)} {F : Set (Euc n)} + (hE : ∀ i, IsLocallyPerimeterMinimizing (E i)) (hF : MeasurableSet F) + (c : Euc n) {a B : ℝ} (ha : 0 < a) (haB : a < B) + (hconv : Tendsto (fun i ↦ volume.real (symmDiff (E i) F ∩ + (Metric.closedBall c B \ Metric.closedBall c a))) atTop (𝓝 0)) + {ε : ℝ} (hε : 0 < ε) : + ∀ᶠ i in atTop, perimeter (E i) (Metric.ball c a) ≤ + perimeter F (Metric.ball c B) + ENNReal.ofReal ε := by + obtain ⟨L, hL, hbound⟩ := exists_smoothTransition_deriv_bound + let D := ε/(4*L) + have hD : 0 < D := div_pos hε (by positivity) + have hd : 0 < D*(B-a) := mul_pos hD (sub_pos.mpr haB) + filter_upwards [hconv.eventually (gt_mem_nhds hd)] with i hi + have hh := minimizing_annular_replacement_perimeter_le (hE i) hF c ha haB hi + hD.le hL hbound + have he : 4*L*D = ε := by dsimp [D]; field_simp + simpa only [he] using hh + +theorem lintegral_indicator_difference {n : ℕ} {E F U : Set (Euc n)} + (hE : MeasurableSet E) (hF : MeasurableSet F) : + (∫⁻ x in U, ‖E.indicator (fun _ ↦ (1:ℝ)) x - F.indicator (fun _ ↦ (1:ℝ)) x‖ₑ) = + volume (symmDiff E F ∩ U) := by + have he (x : Euc n) : + ‖E.indicator (fun _ ↦ (1:ℝ)) x - F.indicator (fun _ ↦ (1:ℝ)) x‖ₑ = + (symmDiff E F).indicator (fun _ ↦ (1:ℝ≥0∞)) x := by + by_cases hxE : x ∈ E <;> by_cases hxF : x ∈ F <;> simp [hxE, hxF, mem_symmDiff] + simp_rw [he] + rw [lintegral_indicator (hE.symmDiff hF), lintegral_one, + Measure.restrict_apply_univ, Measure.restrict_apply (hE.symmDiff hF)] + +theorem abs_setIntegral_sub_le_symmDiff_volume {n : ℕ} {E F U : Set (Euc n)} + (hE : MeasurableSet E) (hF : MeasurableSet F) (hU : MeasurableSet U) + (hUfin : volume U ≠ ⊤) {f : Euc n → ℝ} (hf : Integrable f volume) + (hs : ∀ x ∉ U, f x = 0) {C : ℝ} (hC : 0 ≤ C) (hb : ∀ x, |f x| ≤ C) : + |(∫ x in E, f x) - (∫ x in F, f x)| ≤ + C * volume.real (symmDiff E F ∩ U) := by + let g := U.indicator (fun _ : Euc n ↦ C) + have hg : Integrable g volume := (integrable_indicator_iff hU).2 (integrableOn_const hUfin) + have hfg (x : Euc n) : |f x| ≤ g x := by + by_cases hx : x ∈ U + · simpa [g, hx] using hb x + · rw [hs x hx, abs_zero] + exact Set.indicator_nonneg (fun _ _ ↦ hC) x + have hi : (∫ x in symmDiff E F, g x) = C * volume.real (symmDiff E F ∩ U) := by + rw [show g = U.indicator (fun _ : Euc n ↦ C) from rfl, integral_indicator hU, + Measure.restrict_restrict hU, integral_const, smul_eq_mul] + rw [Set.inter_comm U (symmDiff E F)] + simp [Measure.real, mul_comm] + have h₁ := setIntegral_sub_le_symmDiff hE hF hf hg hfg + have h₂ := setIntegral_sub_le_symmDiff hF hE hf hg hfg + rw [symmDiff_comm F E, hi] at h₂ + rw [hi] at h₁ + exact abs_le.mpr ⟨by linarith, h₂⟩ + +theorem tendsto_setIntegral_of_local_symmDiff {n : ℕ} + {E : ℕ → Set (Euc n)} {F : Set (Euc n)} + (hE : ∀ i, MeasurableSet (E i)) (hF : MeasurableSet F) + (hconv : ∀ (c : Euc n) (R : ℝ), 0 < R → + Tendsto (fun i ↦ volume.real (symmDiff (E i) F ∩ Metric.closedBall c R)) atTop (𝓝 0)) + {f : Euc n → ℝ} (hf : Continuous f) (hc : HasCompactSupport f) : + Tendsto (fun i ↦ ∫ x in E i, f x) atTop (𝓝 (∫ x in F, f x)) := by + obtain ⟨r, hr⟩ := (Metric.isBounded_iff_subset_ball (0:Euc n)).mp hc.isBounded + let R := max r 0 + 1 + have hR : 0 < R := by dsimp [R]; positivity + have hs : tsupport f ⊆ Metric.closedBall (0:Euc n) R := + hr.trans (Metric.ball_subset_closedBall.trans + (Metric.closedBall_subset_closedBall (by dsimp [R]; linarith [le_max_left r 0]))) + obtain ⟨C, hC⟩ := hc.exists_bound_of_continuous hf + have hC0 : 0 ≤ C := (norm_nonneg (f 0)).trans (hC 0) + have hb (i : ℕ) := abs_setIntegral_sub_le_symmDiff_volume (hE i) hF + measurableSet_closedBall (isCompact_closedBall (0:Euc n) R).measure_ne_top + (hf.integrable_of_hasCompactSupport hc) + (fun x hx ↦ image_eq_zero_of_notMem_tsupport (fun h ↦ hx (hs h))) hC0 + (fun x ↦ by simpa only [Real.norm_eq_abs] using hC x) + apply tendsto_iff_norm_sub_tendsto_zero.mpr + apply squeeze_zero (fun i ↦ norm_nonneg _) (fun i ↦ by simpa only [Real.norm_eq_abs] using hb i) + simpa using (hconv 0 R hR).const_mul C + +theorem perimeter_le_of_eventually_le_of_local_L1 {n : ℕ} + {E : ℕ → Set (Euc n)} {F U : Set (Euc n)} + (hE : ∀ i, MeasurableSet (E i)) (hF : MeasurableSet F) + (hconv : ∀ (c : Euc n) (R : ℝ), 0 < R → + Tendsto (fun i ↦ volume.real (symmDiff (E i) F ∩ Metric.closedBall c R)) atTop (𝓝 0)) + {A : ℝ≥0∞} (hb : ∀ᶠ i in atTop, perimeter (E i) U ≤ A) : + perimeter F U ≤ A := by + by_cases hA : A = ⊤ + · simp [hA] + rw [perimeter_eq_iSup_tests] + refine iSup_le fun V ↦ iSup_le fun hV ↦ ?_ + have hc := hV.2.1.of_isClosed_subset (isClosed_tsupport _) (tsupport_divergence_subset V) + have ht := tendsto_setIntegral_of_local_symmDiff hE hF hconv (continuous_divergence hV.1) hc + apply (ENNReal.ofReal_le_iff_le_toReal hA).2 + apply le_of_tendsto ht + filter_upwards [hb] with i hi + exact (integral_divergence_le_perimeter_real (E i) U + (ne_top_of_le_ne_top hA hi) hV).trans (ENNReal.toReal_mono hA hi) + +theorem locally_minimizing_of_local_L1_limit {n : ℕ} (hn : 0 < n) + {E : ℕ → Set (Euc n)} {F : Set (Euc n)} + (hE : ∀ i, IsLocallyPerimeterMinimizing (E i)) (hF : MeasurableSet F) + (hconv : ∀ (c : Euc n) (R : ℝ), 0 < R → + Tendsto (fun i ↦ volume.real (symmDiff (E i) F ∩ Metric.closedBall c R)) atTop (𝓝 0)) : + IsLocallyPerimeterMinimizing F := by + obtain ⟨C, hC, hgrowth⟩ := exists_locallyMinimizing_perimeter_growth_constant n hn + refine ⟨hF, ?_, ?_⟩ + · intro c r hr + exact (perimeter_le_of_eventually_le_of_local_L1 (fun i ↦ (hE i).1) hF hconv + (Eventually.of_forall fun i ↦ hgrowth (E i) (hE i) c r hr)).trans_lt ENNReal.ofReal_lt_top + · intro c R hR G hG hcG hsG + rw [perimeter_eq_iSup_tests] + refine iSup_le fun V ↦ iSup_le fun hV ↦ ?_ + obtain ⟨a₀, ha₀, hsub⟩ := exists_lt_subset_ball + ((isClosed_tsupport V).union isClosed_closure) (union_subset hV.2.2.1 hsG) + let a := max a₀ (R/2) + have ha : 0 < a := (half_pos hR).trans_le (le_max_right _ _) + have haR : a < R := max_lt ha₀ (by linarith) + have hasub : tsupport V ∪ closure (symmDiff F G) ⊆ Metric.ball c a := + hsub.trans (Metric.ball_subset_ball (le_max_left _ _)) + let B := (a+R)/2 + have haB : a < B := by dsimp [B]; linarith + have hBR : B < R := by dsimp [B]; linarith + have hB : 0 < B := ha.trans haB + have hann : Tendsto (fun i ↦ volume.real (symmDiff (E i) G ∩ + (Metric.closedBall c B \ Metric.closedBall c a))) atTop (𝓝 0) := by + apply squeeze_zero (fun i ↦ ENNReal.toReal_nonneg) + (fun i ↦ measureReal_mono (s₂ := symmDiff (E i) F ∩ Metric.closedBall c B) ?_ + (measure_ne_top_of_subset inter_subset_right (isCompact_closedBall c B).measure_ne_top)) + (hconv c B hB) + intro x hx + have hxFG : x ∉ symmDiff F G := by + intro hx' + exact hx.2.2 (Metric.ball_subset_closedBall + (hasub (Or.inr (subset_closure hx')))) + refine ⟨?_, hx.2.1⟩ + simp only [mem_symmDiff] at hxFG ⊢ + have hh := hx.1 + simp only [mem_symmDiff] at hh + tauto + have hle : perimeter F (Metric.ball c a) ≤ perimeter G (Metric.ball c R) := by + apply ENNReal.le_of_forall_pos_le_add + intro ε hε hfin + apply perimeter_le_of_eventually_le_of_local_L1 (fun i ↦ (hE i).1) hF hconv + filter_upwards [eventually_minimizing_perimeter_le_of_annular_L1 hE hG c ha haB hann + (show 0 < (ε:ℝ) from hε)] with i hi + rw [ENNReal.ofReal_coe_nnreal] at hi + exact hi.trans (add_le_add (raw_perimeter_mono_region G + (Metric.ball_subset_ball hBR.le)) le_rfl) + have hvle : ENNReal.ofReal (∫ x in F, divergence V x) ≤ perimeter F (Metric.ball c a) := by + rw [perimeter_eq_iSup_tests] + exact le_iSup_of_le V (le_iSup_of_le + (show PerimeterAdmissible (Metric.ball c a) V from + ⟨hV.1, hV.2.1, subset_union_left.trans hasub, hV.2.2.2⟩) le_rfl) + exact hvle.trans hle + +theorem tendsto_perimeter_ball_right {n : ℕ} {F : Set (Euc n)} + (hF : IsLocallyPerimeterMinimizing F) (c : Euc n) {r : ℝ} (hr : 0 < r) : + Tendsto (fun R ↦ perimeter F (Metric.ball c R)) (𝓝[>] r) + (𝓝 (perimeterMeasure F (Metric.closedBall c r))) := by + have ht := tendsto_measure_biInter_gt + (μ := perimeterMeasure F) (s := fun R : ℝ ↦ Metric.ball c R) (a := r) + (fun R hR ↦ measurableSet_ball.nullMeasurableSet) + (fun R S hR hRS ↦ Metric.ball_subset_ball hRS) + ⟨r+1, by linarith, by + rw [perimeterMeasure_open F Metric.isOpen_ball] + exact (hF.2.1 c (r+1) (by linarith)).ne⟩ + simpa only [Metric.biInter_gt_ball, Function.comp_def, + perimeterMeasure_open F Metric.isOpen_ball] using ht + +theorem tendsto_minimizing_perimeter_ball_of_local_L1 {n : ℕ} (hn : 0 < n) + {E : ℕ → Set (Euc n)} {F : Set (Euc n)} + (hE : ∀ i, IsLocallyPerimeterMinimizing (E i)) (hF : MeasurableSet F) + (hconv : ∀ (c : Euc n) (R : ℝ), 0 < R → + Tendsto (fun i ↦ volume.real (symmDiff (E i) F ∩ Metric.closedBall c R)) atTop (𝓝 0)) + (c : Euc n) {r : ℝ} (hr : 0 < r) + (hnull : perimeterMeasure F (Metric.sphere c r) = 0) : + Tendsto (fun i ↦ perimeter (E i) (Metric.ball c r)) atTop + (𝓝 (perimeter F (Metric.ball c r))) := by + have hmin := locally_minimizing_of_local_L1_limit hn hE hF hconv + apply tendsto_order.2 + constructor + · intro A hA + rw [perimeter_eq_iSup_tests, lt_iSup_iff] at hA + obtain ⟨V, hV⟩ := hA + rw [lt_iSup_iff] at hV + obtain ⟨hV, hAV⟩ := hV + have hc := hV.2.1.of_isClosed_subset (isClosed_tsupport _) (tsupport_divergence_subset V) + have ht := ENNReal.continuous_ofReal.tendsto _ |>.comp + (tendsto_setIntegral_of_local_symmDiff (fun i ↦ (hE i).1) hF hconv + (continuous_divergence hV.1) hc) + filter_upwards [ht.eventually (lt_mem_nhds hAV)] with i hi + apply hi.trans_le + rw [perimeter_eq_iSup_tests] + exact le_iSup_of_le V (le_iSup_of_le hV le_rfl) + · intro A hA + have heq : perimeterMeasure F (Metric.closedBall c r) = perimeter F (Metric.ball c r) := by + rw [← perimeterMeasure_open F Metric.isOpen_ball] + apply le_antisymm + · rw [← Metric.ball_union_sphere] + exact (measure_union_le _ _).trans (by rw [hnull, add_zero]) + · exact measure_mono Metric.ball_subset_closedBall + have ht := tendsto_perimeter_ball_right hmin c hr + rw [heq] at ht + have hh : ∀ᶠ B in 𝓝[>] r, r < B ∧ perimeter F (Metric.ball c B) < A := by + filter_upwards [self_mem_nhdsWithin, ht.eventually (gt_mem_nhds hA)] with B hB hBA + exact ⟨hB, hBA⟩ + obtain ⟨B, hBr, hBA⟩ := hh.exists + obtain ⟨ε, hε, hεA⟩ := ENNReal.lt_iff_exists_add_pos_lt.mp hBA + have hann : Tendsto (fun i ↦ volume.real (symmDiff (E i) F ∩ + (Metric.closedBall c B \ Metric.closedBall c r))) atTop (𝓝 0) := by + exact squeeze_zero (fun _ ↦ ENNReal.toReal_nonneg) + (fun i ↦ measureReal_mono (inter_subset_inter_right _ sdiff_subset) + (measure_ne_top_of_subset inter_subset_right (isCompact_closedBall c B).measure_ne_top)) + (hconv c B (hr.trans hBr)) + filter_upwards [eventually_minimizing_perimeter_le_of_annular_L1 hE hF c hr hBr hann + (show 0 < (ε:ℝ) from hε)] with i hi + rw [ENNReal.ofReal_coe_nnreal] at hi + exact hi.trans_lt hεA + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/SingleGraph.lean b/lean/OAI/Geometry/Perimeter/Regularity/SingleGraph.lean new file mode 100644 index 0000000000000000000000000000000000000000..60730e2b0901fb7ae6d60e14d0ab9b01aec973b5 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/SingleGraph.lean @@ -0,0 +1,60 @@ +import OAI.Geometry.Perimeter.Regularity.GraphExistence + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +variable {n : ℕ} + +theorem fiber_chord_norm {v : Euc n} (hv : ‖v‖=1) + (y z : normalPlane v) (s t : ℝ) : + ‖((y:Euc n)+s•v)-((z:Euc n)+t•v)‖≤‖y-z‖+|s-t| := by + have he : ((y:Euc n)+s•v)-((z:Euc n)+t•v)=((y-z:normalPlane v):Euc n)+(s-t)•v := by + simp only [Submodule.coe_sub,sub_smul]; abel + rw [he] + simpa only [norm_smul,Real.norm_eq_abs,hv,mul_one,Submodule.norm_coe] using + norm_add_le ((y-z:normalPlane v):Euc n) ((s-t)•v) + +theorem single_graph_from_slab (hn : 1 linarith + · have hq : Measure.QuasiMeasurePreserving (fun x : Euc n ↦ p+(1/2:ℝ)•x) volume volume := + (measurePreserving_add_left volume p).quasiMeasurePreserving.comp + (Measure.quasiMeasurePreserving_smul volume (by norm_num : (1/2:ℝ)≠0)) + filter_upwards [hq.ae h.2] with x hx + intro hxb hxa + rcases abs_le.mp hhp with ⟨hpl,hpu⟩ + have hi : inner ℝ v (p+(1/2:ℝ)•x)=inner ℝ v p+1/2*inner ℝ v x := by + rw [inner_add_right,real_inner_smul_right] + have hbig : a < |inner ℝ v (p+(1/2:ℝ)•x)| := by + rw [hi] + rcases lt_abs.mp hxa with hh | hh + · exact (lt_of_lt_of_le (by linarith) (le_abs_self _)) + · exact (lt_of_lt_of_le (by linarith) (neg_le_abs _)) + have hsign : inner ℝ v (p+(1/2:ℝ)•x)<0 ↔ inner ℝ v x<0 := by + rw [hi] + rcases lt_abs.mp hxa with hh | hh + · have hpos : 0 < inner ℝ v x := by linarith + constructor <;> intro hneg <;> linarith + · have hneg : inner ℝ v x < 0 := by linarith + constructor <;> intro hneg' <;> linarith + exact (hx (hball x hxb) hbig).trans hsign + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/SmoothFlatOrder.lean b/lean/OAI/Geometry/Perimeter/Regularity/SmoothFlatOrder.lean new file mode 100644 index 0000000000000000000000000000000000000000..66cb84808af78dfffdd69ecc66fab7ebca53e018 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/SmoothFlatOrder.lean @@ -0,0 +1,540 @@ +import OAI.Geometry.Perimeter.Regularity.TotallyBoundedRangeOfUniformApproximation + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +namespace RPISingularHarnack + +theorem smooth_flat_order {n : ℕ} {u : Euc n → ℝ} + (hu : ContDiff ℝ 1 u) {v : Euc n} (hv : ‖v‖ = 1) + {R : ℝ} (hz : ∀ z ∈ Metric.ball (0 : Euc n) R, + ∀ w, inner ℝ w v = 0 → fderiv ℝ u z w = 0) + (hneg : ∀ z ∈ Metric.ball (0 : Euc n) R, fderiv ℝ u z v ≤ 0) + {x y : Euc n} (hx : x ∈ Metric.ball (0 : Euc n) R) + (hy : y ∈ Metric.ball (0 : Euc n) R) + (hxy : inner ℝ x v ≤ inner ℝ y v) : u y ≤ u x := by + let w := y - x + let a := inner ℝ w v + have ha : 0 ≤ a := by dsimp [a, w]; rw [inner_sub_left]; linarith + have horth : inner ℝ (w - a • v) v = 0 := by + simp [inner_sub_left, inner_smul_left, hv, a] + have hdir (z : Euc n) (hzball : z ∈ Metric.ball (0 : Euc n) R) : + fderiv ℝ u z w ≤ 0 := by + have heq : w = (w - a • v) + a • v := by abel + rw [heq, map_add, map_smul, hz z hzball (w - a • v) horth, zero_add, + smul_eq_mul] + exact mul_nonpos_of_nonneg_of_nonpos ha (hneg z hzball) + let f : ℝ → ℝ := fun t ↦ u (x + t • w) + have hd (t : ℝ) : HasDerivAt f (fderiv ℝ u (x + t • w) w) t := by + simpa only [f, Function.comp_def, id_eq, one_smul] using + (hu.differentiable one_ne_zero (x + t • w)).hasFDerivAt.comp_hasDerivAt t + (HasDerivAt.const_add x ((hasDerivAt_id t).smul_const w)) + have hm : AntitoneOn f (Icc (0 : ℝ) 1) := by + apply antitoneOn_of_hasDerivWithinAt_nonpos (convex_Icc _ _) + (hu.continuous.comp (continuous_const.add (continuous_id.smul continuous_const))).continuousOn + · intro t ht + exact (hd t).hasDerivWithinAt + · intro t ht + apply hdir + exact (convex_ball (0 : Euc n) R).add_smul_sub_mem hx hy (interior_subset ht) + have he := hm (show (0 : ℝ) ∈ Icc 0 1 by norm_num) + (show (1 : ℝ) ∈ Icc 0 1 by norm_num) (by norm_num) + simpa [f, w] using he + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +namespace RPISingularHarnack +open RPI.Boundary ContinuousLinearMap +open scoped Convolution + +theorem indicator_convolution_fderiv_eq {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) {k : Euc n → ℝ} (hk : ContDiff ℝ ∞ k) + (hck : HasCompactSupport k) (x v : Euc n) : + fderiv ℝ (E.indicator (fun _ ↦ (1 : ℝ)) ⋆[lsmul ℝ ℝ, volume] k) x v = + -(∫ y in E, fderiv ℝ (fun z ↦ k (x - z)) y v) := by + let χ : Euc n → ℝ := E.indicator (fun _ ↦ 1) + have hχ : LocallyIntegrable χ volume := indicator_one_locallyIntegrable hE + rw [(hck.hasFDerivAt_convolution_right (lsmul ℝ ℝ) hχ (hk.of_le (by simp)) x).fderiv] + rw [convolution_precompR_apply (lsmul ℝ ℝ) hχ (hck.fderiv ℝ) + (hk.continuous_fderiv (by simp))] + have hd (y : Euc n) : fderiv ℝ (fun z ↦ k (x - z)) y v = + -fderiv ℝ k (x - y) v := by + have h := ((hk.differentiable (by simp) (x - y)).hasFDerivAt.comp y + ((hasFDerivAt_const x y).sub (hasFDerivAt_id y))).fderiv + simpa only [Function.comp_def, sub_apply, zero_apply, id_apply, + zero_sub, ContinuousLinearMap.comp_apply, neg_apply, map_neg] using + congrArg (fun L : Euc n →L[ℝ] ℝ ↦ L v) h + simp_rw [hd] + rw [integral_neg, neg_neg] + change (∫ t, χ t * fderiv ℝ k (x - t) v) = _ + have heq : (fun t ↦ χ t * fderiv ℝ k (x - t) v) = + E.indicator (fun t ↦ fderiv ℝ k (x - t) v) := by + funext t + by_cases ht : t ∈ E <;> simp [χ, ht] + rw [heq, integral_indicator hE] + +theorem halfspace_of_flat_distribution {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) {R : ℝ} (hR : 0 < R) {v : Euc n} (hv : ‖v‖ = 1) + (hz : ∀ φ : Euc n → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → + tsupport φ ⊆ Metric.ball (0 : Euc n) R → + ∀ w, inner ℝ w v = 0 → (∫ x in E, fderiv ℝ φ x w) = 0) + (hp : ∀ φ : Euc n → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → + tsupport φ ⊆ Metric.ball (0 : Euc n) R → (∀ x, 0 ≤ φ x) → + 0 ≤ ∫ x in E, fderiv ℝ φ x v) : + ∃ t ∈ Icc (-R / 2) (R / 2), + ∀ᵐ x ∂volume.restrict (Metric.ball (0 : Euc n) (R / 2)), + x ∈ E ↔ inner ℝ x v < t := by + let χ : Euc n → ℝ := E.indicator (fun _ ↦ 1) + let u : ℕ → Euc n → ℝ := c1Mollify χ + have hχ : LocallyIntegrable χ volume := indicator_one_locallyIntegrable hE + have hflip : (lsmul ℝ ℝ : ℝ →L[ℝ] ℝ →L[ℝ] ℝ).flip = lsmul ℝ ℝ := by + apply ContinuousLinearMap.ext + intro a + apply ContinuousLinearMap.ext + intro b + exact mul_comm b a + have hu_eq : ∀ j, u j = χ ⋆[lsmul ℝ ℝ, volume] (c1Mollifier j).normed volume := by + intro j + change (c1Mollifier j).normed volume ⋆[lsmul ℝ ℝ, volume] χ = _ + rw [← convolution_flip, hflip] + have hu : ∀ j, ContDiff ℝ ∞ (u j) := fun j ↦ + (c1Mollifier j).hasCompactSupport_normed.contDiff_convolution_left _ + (c1Mollifier j).contDiff_normed hχ + have horder : ∀ᶠ j in atTop, ∀ x ∈ Metric.ball (0 : Euc n) (R / 2), + ∀ y ∈ Metric.ball (0 : Euc n) (R / 2), + inner ℝ x v ≤ inner ℝ y v → u j y ≤ u j x := by + have hsmall : ∀ᶠ j in atTop, (c1Mollifier (n := n) j).rOut < R / 2 := + c1Mollifier_radius_tendsto.eventually (gt_mem_nhds (by positivity)) + filter_upwards [hsmall] with j hj + have hs (x : Euc n) (hx : x ∈ Metric.ball (0 : Euc n) (R / 2)) : + tsupport (fun z ↦ (c1Mollifier (n := n) j).normed volume (x - z)) ⊆ + Metric.ball (0 : Euc n) R := by + intro y hy + have hk := (tsupport_comp_subset_preimage ((c1Mollifier j).normed volume) + (continuous_const.sub continuous_id)) hy + rw [(c1Mollifier j).tsupport_normed_eq] at hk + change x - y ∈ Metric.closedBall (0 : Euc n) (c1Mollifier j).rOut at hk + have hxy : dist y x ≤ (c1Mollifier (n := n) j).rOut := by + simpa only [Metric.mem_closedBall, dist_zero_right, dist_eq_norm, sub_zero, norm_sub_rev] using hk + exact (dist_triangle y x 0).trans_lt (by linarith [Metric.mem_ball.mp hx]) + have hzero : ∀ z ∈ Metric.ball (0 : Euc n) (R / 2), + ∀ w, inner ℝ w v = 0 → fderiv ℝ (u j) z w = 0 := by + intro z hzball w hw + rw [hu_eq j, indicator_convolution_fderiv_eq hE + (c1Mollifier j).contDiff_normed (c1Mollifier j).hasCompactSupport_normed] + apply neg_eq_zero.mpr + exact hz _ ((c1Mollifier j).contDiff_normed.comp (contDiff_const.sub contDiff_id)) + ((c1Mollifier j).hasCompactSupport_normed.comp_homeomorph (Homeomorph.subLeft z)) + (hs z hzball) w hw + have hnonpos : ∀ z ∈ Metric.ball (0 : Euc n) (R / 2), fderiv ℝ (u j) z v ≤ 0 := by + intro z hzball + rw [hu_eq j, indicator_convolution_fderiv_eq hE + (c1Mollifier j).contDiff_normed (c1Mollifier j).hasCompactSupport_normed] + apply neg_nonpos.mpr + exact hp _ ((c1Mollifier j).contDiff_normed.comp (contDiff_const.sub contDiff_id)) + ((c1Mollifier j).hasCompactSupport_normed.comp_homeomorph (Homeomorph.subLeft z)) + (hs z hzball) (fun y ↦ (c1Mollifier j).nonneg_normed (z - y)) + intro x hx y hy hxy + exact smooth_flat_order ((hu j).of_le (by simp)) hv hzero hnonpos hx hy hxy + have hlim : ∀ᵐ x ∂volume, Tendsto (fun j ↦ u j x) atTop (𝓝 (χ x)) := by + apply ContDiffBump.ae_convolution_tendsto_right_of_locallyIntegrable + c1Mollifier_radius_tendsto (K := 2) _ hχ + apply Eventually.of_forall + intro j + dsimp [c1Mollifier] + linarith + let S := {x | Tendsto (fun j ↦ u j x) atTop (𝓝 (χ x))} + have hS : ∀ᵐ x ∂volume, x ∈ S := hlim + have hd : ∀ x ∈ S ∩ Metric.ball (0 : Euc n) (R / 2), + ∀ y ∈ S ∩ Metric.ball (0 : Euc n) (R / 2), + inner ℝ x v < inner ℝ y v → y ∈ E → x ∈ E := by + intro x hx y hy hxy hyE + have hle : χ y ≤ χ x := le_of_tendsto_of_tendsto hy.1 hx.1 + (horder.mono fun j hj ↦ hj x hx.2 y hy.2 hxy.le) + by_contra hxE + norm_num [χ, hxE, hyE] at hle + simpa only [neg_div] using ordered_indicator_halfspace E S hS hv (by positivity : 0 < R / 2) hd + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +namespace RPISingularHarnack + +theorem halfspace_threshold_eq_zero {n : ℕ} {E : Set (Euc n)} + {R : ℝ} (hR : 0 < R) {v : Euc n} (hv : ‖v‖ = 1) {t : ℝ} + (hhalf : ∀ᵐ x ∂volume.restrict (Metric.ball (0 : Euc n) R), + x ∈ E ↔ inner ℝ x v < t) + (hphase : ∀ s : ℝ, 0 < s → s ≤ R → + 0 < volume (E ∩ Metric.ball (0 : Euc n) s) ∧ + 0 < volume (Eᶜ ∩ Metric.ball (0 : Euc n) s)) : t = 0 := by + have ha := (ae_restrict_iff' measurableSet_ball).mp hhalf + have hinner (x : Euc n) {s : ℝ} (hx : x ∈ Metric.ball (0 : Euc n) s) : + |inner ℝ x v| < s := by + apply (abs_real_inner_le_norm x v).trans_lt + simpa only [hv, mul_one, Metric.mem_ball, dist_zero_right] using hx + rcases lt_trichotomy t 0 with ht | ht | ht + · let s := min R (-t) / 2 + have hs : 0 < s := by + dsimp [s] + exact div_pos (lt_min hR (neg_pos.mpr ht)) (by norm_num) + have hsR : s ≤ R := by dsimp [s]; linarith [min_le_left R (-t)] + have hst : s < -t := by dsimp [s]; linarith [min_le_right R (-t), lt_min hR (neg_pos.mpr ht)] + have hno : ∀ᵐ x ∂volume, x ∉ E ∩ Metric.ball (0 : Euc n) s := by + filter_upwards [ha] with x hx + intro hxin + have hxR := Metric.ball_subset_ball hsR hxin.2 + have hxt := (hx hxR).mp hxin.1 + have hb := (abs_lt.mp (hinner x hxin.2)).1 + linarith + have hz : volume (E ∩ Metric.ball (0 : Euc n) s) = 0 := by + simpa only [not_not, Set.ofPred_mem_eq] using ae_iff.mp hno + exact False.elim (ne_of_gt (hphase s hs hsR).1 hz) + · exact ht + · let s := min R t / 2 + have hs : 0 < s := by dsimp [s]; positivity + have hsR : s ≤ R := by dsimp [s]; linarith [min_le_left R t] + have hst : s < t := by dsimp [s]; linarith [min_le_right R t, lt_min hR ht] + have hno : ∀ᵐ x ∂volume, x ∉ Eᶜ ∩ Metric.ball (0 : Euc n) s := by + filter_upwards [ha] with x hx + intro hxin + have hxR := Metric.ball_subset_ball hsR hxin.2 + have hxt : inner ℝ x v < t := (abs_lt.mp (hinner x hxin.2)).2.trans hst + exact hxin.1 ((hx hxR).mpr hxt) + have hz : volume (Eᶜ ∩ Metric.ball (0 : Euc n) s) = 0 := by + simpa only [not_not, Set.ofPred_mem_eq] using ae_iff.mp hno + exact False.elim (ne_of_gt (hphase s hs hsR).2 hz) + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +namespace RPISingularHarnack + +def blownUpSet {n : ℕ} (E : Set (Euc n)) (c : Euc n) (r : ℝ) : Set (Euc n) := + (fun z ↦ c + r • z) ⁻¹' E + +theorem measurableSet_blownUpSet {n : ℕ} {E : Set (Euc n)} (hE : MeasurableSet E) + (c : Euc n) (r : ℝ) : MeasurableSet (blownUpSet E c r) := + hE.preimage (by fun_prop) + +theorem integral_blownUpSet {n : ℕ} {E : Set (Euc n)} (hE : MeasurableSet E) + (g : Euc n → ℝ) (c : Euc n) {r : ℝ} (hr : 0 < r) : + (∫ z in blownUpSet E c r, g (c + r • z)) = (r ^ n)⁻¹ * ∫ y in E, g y := by + have hc := Measure.integral_comp_smul_of_nonneg (volume : Measure (Euc n)) + (fun y ↦ E.indicator g (c + y)) r (hR := hr.le) + simp only [finrank_euclideanSpace, Fintype.card_fin, smul_eq_mul, + integral_add_left_eq_self, integral_indicator hE] at hc + rw [← hc, ← integral_indicator (measurableSet_blownUpSet hE c r)] + apply integral_congr_ae + exact ae_of_all _ fun z ↦ by + by_cases hz : c + r • z ∈ E <;> simp [blownUpSet, hz] + +theorem divergence_comp_blowdown {n : ℕ} {V : Euc n → Euc n} + (hV : Differentiable ℝ V) (c : Euc n) (r : ℝ) (y : Euc n) : + divergence (fun z ↦ V (r⁻¹ • (z - c))) y = + r⁻¹ * divergence V (r⁻¹ • (y - c)) := by + have hd := ((hV _).hasFDerivAt.comp y + (((hasFDerivAt_id y).sub_const c).const_smul r⁻¹)).fderiv + simp only [Function.comp_def, id_eq, Pi.smul_apply] at hd + simp only [divergence, hd, ContinuousLinearMap.comp_apply, + smul_apply, ContinuousLinearMap.id_apply, map_smul, + inner_smul_right, ← Finset.mul_sum] + +theorem perimeter_blownUpSet_le {n : ℕ} {E : Set (Euc n)} (hE : MeasurableSet E) + (c : Euc n) {r R : ℝ} (hr : 0 < r) + (hP : perimeter E (Metric.ball c (r * R)) ≠ ⊤) : + perimeter (blownUpSet E c r) (Metric.ball (0 : Euc n) R) ≤ + ENNReal.ofReal (r * (r ^ n)⁻¹ * (perimeter E (Metric.ball c (r * R))).toReal) := by + rw [perimeter_eq_iSup_tests] + refine iSup_le fun V ↦ iSup_le fun hV ↦ ?_ + let W : Euc n → Euc n := fun y ↦ V (r⁻¹ • (y - c)) + have hW : PerimeterAdmissible (Metric.ball c (r * R)) W := by + refine ⟨hV.1.comp ((contDiff_id.sub contDiff_const).const_smul r⁻¹), ?_, ?_, ?_⟩ + · exact hV.2.1.comp_homeomorph + ((Homeomorph.subRight c).trans (Homeomorph.smulOfNeZero r⁻¹ (inv_ne_zero hr.ne'))) + · intro y hy + have hys := tsupport_comp_subset_preimage V + ((continuous_id.sub continuous_const).const_smul r⁻¹) hy + have hyb := hV.2.2.1 hys + change r⁻¹ • (y - c) ∈ Metric.ball (0 : Euc n) R at hyb + simp only [Metric.mem_ball, dist_zero_right, norm_smul, + Real.norm_of_nonneg (inv_nonneg.mpr hr.le)] at hyb + change dist y c < r * R + rw [dist_eq_norm] + have he : r * (r⁻¹ * ‖y - c‖) = ‖y - c‖ := by field_simp + linarith [mul_lt_mul_of_pos_left hyb hr] + · exact fun y ↦ hV.2.2.2 _ + have he (z : Euc n) : divergence W (c + r • z) = r⁻¹ * divergence V z := by + dsimp [W] + rw [divergence_comp_blowdown (hV.1.differentiable (by simp))] + simp [inv_smul_smul₀ hr.ne'] + have hint := integral_blownUpSet hE (divergence W) c hr + simp_rw [he] at hint + rw [integral_const_mul] at hint + have hint' : (∫ z in blownUpSet E c r, divergence V z) = + (r * (r ^ n)⁻¹) * ∫ y in E, divergence W y := by + have heq := congrArg (fun a : ℝ ↦ r * a) hint + have hrinv : r * r⁻¹ = 1 := mul_inv_cancel₀ hr.ne' + simpa only [← mul_assoc, hrinv, one_mul] using heq + rw [hint'] + apply ENNReal.ofReal_le_ofReal + exact mul_le_mul_of_nonneg_left (integral_divergence_le_perimeter_real E _ hP hW) + (by positivity) + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +namespace RPISingularHarnack + +theorem exists_fixed_annular_bv_cut {n : ℕ} : + ∃ D : ℝ≥0∞, D ≠ ⊤ ∧ ∀ E : Set (Euc n), MeasurableSet E → + perimeter E (Metric.ball (0 : Euc n) 4) ≠ ⊤ → + ∃ r ∈ Ico (2 : ℝ) 3, + perimeter (E ∩ Metric.closedBall (0 : Euc n) r) univ ≤ + perimeter E (Metric.ball (0 : Euc n) 4) + D := by + obtain ⟨L, hL, hbound⟩ := exists_smoothTransition_deriv_bound + let D : ℝ := volume.real (Metric.closedBall (0 : Euc n) 3) + 1 + have hD : 0 < D := by dsimp [D]; positivity + refine ⟨ENNReal.ofReal (8 * L * D), ENNReal.ofReal_ne_top, ?_⟩ + intro E hE hP + have hvol : volume.real (E ∩ Metric.closedBall (0 : Euc n) 3) < D * (3 - 2) := by + have hm := measureReal_mono (μ := (volume : Measure (Euc n))) + (s₁ := E ∩ Metric.closedBall (0 : Euc n) 3) inter_subset_right + (isCompact_closedBall (0 : Euc n) 3).measure_ne_top + dsimp [D] + linarith + obtain ⟨r, hr, hc⟩ := exists_controlled_cut_radius E (0 : Euc n) + (by norm_num : (0 : ℝ) < 2) (by norm_num : (2 : ℝ) < 3) hvol + refine ⟨r, hr, ?_⟩ + have hcut := controlled_radius_perimeter_cut hE (0 : Euc n) + (by linarith [hr.1] : 0 < r) hr.2 + (Metric.closedBall_subset_ball (by norm_num : (3 : ℝ) < 4)) + hc hD.le hL hbound hP + exact (le_add_right le_rfl).trans hcut + +theorem exists_local_indicator_L1_subsequence {n : ℕ} (C : ℝ≥0∞) (hC : C ≠ ⊤) + (E : ℕ → Set (Euc n)) (hE : ∀ i, MeasurableSet (E i)) + (hP : ∀ i, perimeter (E i) (Metric.ball (0 : Euc n) 4) ≤ C) : + ∃ F : Set (Euc n), MeasurableSet F ∧ F ⊆ Metric.closedBall (0 : Euc n) 3 ∧ + ∃ A : ℕ → Set (Euc n), (∀ i, MeasurableSet (A i)) ∧ + (∀ i, A i ∩ Metric.ball (0 : Euc n) 2 = E i ∩ Metric.ball (0 : Euc n) 2) ∧ + ∃ σ : ℕ → ℕ, StrictMono σ ∧ + Tendsto (fun i ↦ ∫⁻ x, ‖(A (σ i)).indicator (fun _ ↦ (1 : ℝ)) x - + F.indicator (fun _ ↦ (1 : ℝ)) x‖ₑ) atTop (𝓝 0) := by + obtain ⟨D, hD, hcut⟩ := exists_fixed_annular_bv_cut (n := n) + choose r hr hpr using fun i ↦ hcut (E i) (hE i) (ne_top_of_le_ne_top hC (hP i)) + let A : ℕ → Set (Euc n) := fun i ↦ E i ∩ Metric.closedBall 0 (r i) + have hA : ∀ i, MeasurableSet (A i) := fun i ↦ (hE i).inter measurableSet_closedBall + have hAK : ∀ i, A i ⊆ Metric.closedBall (0 : Euc n) 3 := fun i ↦ + inter_subset_right.trans (Metric.closedBall_subset_closedBall (hr i).2.le) + have hpA : ∀ i, perimeter (A i) univ ≤ C + D := fun i ↦ + (hpr i).trans (add_le_add (hP i) le_rfl) + obtain ⟨F, hF, hFK, σ, hσ, ht⟩ := exists_indicator_L1_subsequence + (Metric.closedBall (0 : Euc n) 3) (isCompact_closedBall _ _) (C + D) + (ENNReal.add_ne_top.mpr ⟨hC, hD⟩) A hA hAK hpA + refine ⟨F, hF, hFK, A, hA, ?_, σ, hσ, ht⟩ + intro i + ext x + constructor + · exact fun hx ↦ ⟨hx.1.1, hx.2⟩ + · intro hx + exact ⟨⟨hx.1, (Metric.ball_subset_closedBall.trans + (Metric.closedBall_subset_closedBall (hr i).1)) hx.2⟩, hx.2⟩ + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +namespace RPISingularHarnack + +theorem exists_blownUpSet_perimeter_bound {n : ℕ} (hn : 0 < n) : + ∃ C : ℝ≥0∞, C ≠ ⊤ ∧ ∀ E : Set (Euc n), IsLocallyPerimeterMinimizing E → + ∀ c (r : ℝ), 0 < r → + perimeter (blownUpSet E c r) (Metric.ball (0 : Euc n) 4) ≤ C := by + obtain ⟨C, hC, hgrowth⟩ := exists_locallyMinimizing_perimeter_growth_constant n hn + refine ⟨ENNReal.ofReal (C * 4 ^ (n - 1)), ENNReal.ofReal_ne_top, ?_⟩ + intro E hmin c r hr + have hb := hgrowth E hmin c (r * 4) (by positivity) + have hfin : perimeter E (Metric.ball c (r * 4)) ≠ ⊤ := ne_top_of_le_ne_top ENNReal.ofReal_ne_top hb + have hreal : (perimeter E (Metric.ball c (r * 4))).toReal ≤ C * (r * 4) ^ (n - 1) := by + simpa only [ENNReal.toReal_ofReal (by positivity : 0 ≤ C * (r * 4) ^ (n - 1))] using + ENNReal.toReal_mono ENNReal.ofReal_ne_top hb + apply (perimeter_blownUpSet_le hmin.1 c hr hfin).trans + apply ENNReal.ofReal_le_ofReal + calc + r * (r ^ n)⁻¹ * (perimeter E (Metric.ball c (r * 4))).toReal ≤ + r * (r ^ n)⁻¹ * (C * (r * 4) ^ (n - 1)) := + mul_le_mul_of_nonneg_left hreal (by positivity) + _ = C * 4 ^ (n - 1) := by + have hn' : n = (n - 1) + 1 := (Nat.sub_add_cancel hn).symm + have he : r ^ n = r * r ^ (n - 1) := by conv_lhs => rw [hn']; rw [pow_succ']; + rw [he, mul_pow] + field_simp + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +namespace RPISingularHarnack + +theorem divergence_scalar_direction {n : ℕ} {φ : Euc n → ℝ} + (hφ : Differentiable ℝ φ) (w : Euc n) : + divergence (fun y ↦ φ y • w) = fun y ↦ fderiv ℝ φ y w := by + funext y + rw [divergence_smul hφ (differentiable_const w)] + simp only [divergence, fderiv_fun_const, Pi.zero_apply, zero_apply, + inner_zero_right, Finset.sum_const_zero, mul_zero, zero_add, inner_gradient_left] + +theorem integral_fderiv_blownUpSet {n : ℕ} {E : Set (Euc n)} (hE : MeasurableSet E) + {φ : Euc n → ℝ} (hφ : Differentiable ℝ φ) (c w : Euc n) {r : ℝ} (hr : 0 < r) : + (∫ z in blownUpSet E c r, fderiv ℝ φ z w) = + (r * (r ^ n)⁻¹) * ∫ y in E, fderiv ℝ (fun z ↦ φ (r⁻¹ • (z - c))) y w := by + have hd (y : Euc n) : fderiv ℝ (fun z ↦ φ (r⁻¹ • (z - c))) y w = + r⁻¹ * fderiv ℝ φ (r⁻¹ • (y - c)) w := by + have h := ((hφ _).hasFDerivAt.comp y + (((hasFDerivAt_id y).sub_const c).const_smul r⁻¹)).fderiv + simp only [Function.comp_def, id_eq, Pi.smul_apply] at h + rw [h, ContinuousLinearMap.comp_apply, smul_apply, + ContinuousLinearMap.id_apply, map_smul, smul_eq_mul] + have he (z : Euc n) : fderiv ℝ (fun y ↦ φ (r⁻¹ • (y - c))) (c + r • z) w = + r⁻¹ * fderiv ℝ φ z w := by rw [hd]; simp [inv_smul_smul₀ hr.ne'] + have hint := integral_blownUpSet hE + (fun y ↦ fderiv ℝ (fun z ↦ φ (r⁻¹ • (z - c))) y w) c hr + simp_rw [he] at hint + rw [integral_const_mul] at hint + have heq := congrArg (fun a : ℝ ↦ r * a) hint + simpa only [← mul_assoc, mul_inv_cancel₀ hr.ne', one_mul] using heq + +theorem integral_fderiv_blownUpSet_polar {n : ℕ} {E U : Set (Euc n)} + (hE : MeasurableSet E) (μ : Measure (Euc n)) (G : Euc n → Euc n) + (hrep : ∀ V : Euc n → Euc n, ContDiff ℝ ∞ V → HasCompactSupport V → + tsupport V ⊆ U → (∫ y in E, divergence V y) = ∫ y, inner ℝ (G y) (V y) ∂μ) + {φ : Euc n → ℝ} (hφ : ContDiff ℝ ∞ φ) (hcφ : HasCompactSupport φ) + (c w : Euc n) {r : ℝ} (hr : 0 < r) + (hs : tsupport (fun y ↦ φ (r⁻¹ • (y - c))) ⊆ U) : + (∫ z in blownUpSet E c r, fderiv ℝ φ z w) = + (r * (r ^ n)⁻¹) * ∫ y, φ (r⁻¹ • (y - c)) * inner ℝ (G y) w ∂μ := by + let ψ : Euc n → ℝ := fun y ↦ φ (r⁻¹ • (y - c)) + have hψ : ContDiff ℝ ∞ ψ := hφ.comp ((contDiff_id.sub contDiff_const).const_smul r⁻¹) + have hcψ : HasCompactSupport ψ := hcφ.comp_homeomorph + ((Homeomorph.subRight c).trans (Homeomorph.smulOfNeZero r⁻¹ (inv_ne_zero hr.ne'))) + rw [integral_fderiv_blownUpSet hE (hφ.differentiable (by simp)) c w hr] + have he := hrep (fun y ↦ ψ y • w) (hψ.smul contDiff_const) hcψ.smul_right + ((tsupport_smul_subset_left ψ (fun _ ↦ w)).trans hs) + rw [divergence_scalar_direction (hψ.differentiable (by simp))] at he + simp only [inner_smul_right] at he + rw [he] + +theorem polar_test_oscillation_le {n : ℕ} (μ : Measure (Euc n)) [IsFiniteMeasure μ] + {G : Euc n → Euc n} (hG : Integrable G μ) (v w : Euc n) + {ψ : Euc n → ℝ} (hψ : Continuous ψ) {M : ℝ} (hM : 0 ≤ M) + (hb : ∀ y, ‖ψ y‖ ≤ M) (B : Set (Euc n)) (hB : MeasurableSet B) + (hs : ∀ y ∉ B, ψ y = 0) : + |(∫ y, ψ y * inner ℝ (G y) w ∂μ) - + (∫ y, ψ y * inner ℝ v w ∂μ)| ≤ + M * ‖w‖ * ∫ y in B, ‖G y - v‖ ∂μ := by + have hiψ : Integrable ψ μ := Integrable.of_bound hψ.aestronglyMeasurable M (ae_of_all _ hb) + have hib : Integrable (fun y ↦ ψ y * inner ℝ (G y - v) w) μ := by + apply (hG.sub (integrable_const v)).norm.mul_const (M * ‖w‖) |>.mono' + · exact hψ.aestronglyMeasurable.mul + ((hG.aestronglyMeasurable.sub stronglyMeasurable_const.aestronglyMeasurable).inner + stronglyMeasurable_const.aestronglyMeasurable) + · filter_upwards [] with y + rw [norm_mul, Real.norm_eq_abs] + have hin := abs_real_inner_le_norm (G y - v) w + calc + ‖ψ y‖ * |inner ℝ (G y - v) w| ≤ M * (‖G y - v‖ * ‖w‖) := + mul_le_mul (hb y) hin (abs_nonneg _) hM + _ = ‖G y - v‖ * (M * ‖w‖) := by ring + have hiG : Integrable (fun y ↦ ψ y * inner ℝ (G y) w) μ := by + have he : (fun y ↦ ψ y * inner ℝ (G y) w) = + (fun y ↦ ψ y * inner ℝ (G y - v) w) + (fun y ↦ ψ y * inner ℝ v w) := by + funext y + simp only [Pi.add_apply, inner_sub_left] + ring + rw [he] + exact hib.add (hiψ.mul_const _) + have heq : (∫ y, ψ y * inner ℝ (G y) w ∂μ) - (∫ y, ψ y * inner ℝ v w ∂μ) = + ∫ y in B, ψ y * inner ℝ (G y - v) w ∂μ := by + rw [← integral_sub hiG (hiψ.mul_const _)] + have he : (fun y ↦ ψ y * inner ℝ (G y) w - ψ y * inner ℝ v w) = + fun y ↦ ψ y * inner ℝ (G y - v) w := by funext y; rw [inner_sub_left, mul_sub] + rw [he] + rw [← integral_indicator hB] + apply integral_congr_ae + exact ae_of_all _ fun point ↦ by + by_cases hpoint : point ∈ B + · rw [indicator_of_mem hpoint] + · simp only [indicator_of_notMem hpoint, hs point hpoint, zero_mul] + rw [heq] + calc + _ ≤ ∫ y in B, |ψ y * inner ℝ (G y - v) w| ∂μ := abs_integral_le_integral_abs + _ ≤ ∫ y in B, M * ‖w‖ * ‖G y - v‖ ∂μ := by + apply integral_mono hib.integrableOn.norm + (((hG.sub (integrable_const v)).norm.const_mul (M * ‖w‖)).integrableOn) + intro y + change ‖ψ y * inner ℝ (G y - v) w‖ ≤ M * ‖w‖ * ‖G y - v‖ + rw [norm_mul, Real.norm_eq_abs (inner ℝ (G y - v) w)] + calc + _ ≤ M * (‖G y - v‖ * ‖w‖) := + mul_le_mul (hb y) (abs_real_inner_le_norm _ _) (abs_nonneg _) hM + _ = _ := by ring + _ = _ := integral_const_mul _ _ + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/SmoothLayerSumBounds.lean b/lean/OAI/Geometry/Perimeter/Regularity/SmoothLayerSumBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..a8e122ff3cf4978ca4f7c83a451bf92b10ffa8f0 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/SmoothLayerSumBounds.lean @@ -0,0 +1,490 @@ +import OAI.Geometry.Perimeter.Regularity.PerimeterAdmissiblePartitionPiece + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem smooth_layer_sum_bounds (N : ℕ) {a : ℝ} (ha : 0 ≤ a) (haN : a ≤ N) : + a - 1 ≤ ∑ j ∈ Finset.range N, Real.smoothTransition (a - j) ∧ + (∑ j ∈ Finset.range N, Real.smoothTransition (a - j)) ≤ a + 1 := by + induction N generalizing a with + | zero => simp only [Nat.cast_zero] at haN; have : a = 0 := le_antisymm haN ha; simp [this] + | succ N ih => + rw [Finset.sum_range_succ'] + by_cases ha1 : 1 ≤ a + · have hrec := ih (a := a - 1) (by linarith) (by push_cast at haN; linarith) + have he : (∑ j ∈ Finset.range N, Real.smoothTransition (a - (j + 1 : ℕ))) = + ∑ j ∈ Finset.range N, Real.smoothTransition ((a - 1) - j) := by + apply Finset.sum_congr rfl + intro j hj + congr 1 + push_cast + ring + rw [he, Nat.cast_zero, sub_zero, Real.smoothTransition.one_of_one_le ha1] + constructor <;> linarith [hrec.1, hrec.2] + · have ha1' : a ≤ 1 := le_of_not_ge ha1 + have hz : ∑ j ∈ Finset.range N, Real.smoothTransition (a - (j + 1 : ℕ)) = 0 := by + apply Finset.sum_eq_zero + intro j hj + apply Real.smoothTransition.zero_of_nonpos + have hj0 : (0 : ℝ) ≤ j := Nat.cast_nonneg j + push_cast + linarith + rw [hz, zero_add, Nat.cast_zero, sub_zero] + constructor + · linarith [Real.smoothTransition.nonneg a] + · linarith [Real.smoothTransition.le_one a] + +theorem finite_level_count_le (N : ℕ) {a : ℝ} (ha : 0 ≤ a) : + (∑ j ∈ Finset.range N, if (j : ℝ) < a then (1 : ℝ) else 0) ≤ a + 1 := by + classical + induction N with + | zero => simp; linarith + | succ N ih => + rw [Finset.sum_range_succ] + by_cases hN : (N : ℝ) < a + · rw [ite_eq_left hN] + have hsum : (∑ j ∈ Finset.range N, if (j : ℝ) < a then (1 : ℝ) else 0) ≤ N := by + calc + _ ≤ ∑ _j ∈ Finset.range N, (1 : ℝ) := by + apply Finset.sum_le_sum + intro j hj + split_ifs <;> norm_num + _ = _ := by simp + linarith + · simpa [hN] using ih + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem abs_integral_divergence_le_bound_perimeter {n : ℕ} (E U : Set (Euc n)) + (hP : perimeter E U ≠ ⊤) {V : Euc n → Euc n} + (hV : ContDiff ℝ ∞ V) (hc : HasCompactSupport V) (hs : tsupport V ⊆ U) + {B : ℝ} (hB : 0 < B) (hb : ∀ x, ‖V x‖ ≤ B) : + |∫ x in E, divergence V x| ≤ B * (perimeter E U).toReal := by + let W : Euc n → Euc n := fun x ↦ B⁻¹ • V x + have hW : PerimeterAdmissible U W := by + have hsm : ContDiff ℝ ∞ (fun z : Euc n ↦ B⁻¹ • z) := + (contDiff_const (c := B⁻¹)).smul contDiff_id + refine ⟨hsm.comp hV, hc.comp_left (g := fun z : Euc n ↦ B⁻¹ • z) + (smul_zero _), ?_, ?_⟩ + · exact (tsupport_smul_subset_right (fun _ ↦ B⁻¹) V).trans hs + · intro x + simp only [W, norm_smul, Real.norm_of_nonneg (inv_nonneg.mpr hB.le)] + exact (mul_le_mul_of_nonneg_left (hb x) (inv_nonneg.mpr hB.le)).trans_eq + (inv_mul_cancel₀ hB.ne') + have hp := integral_divergence_le_perimeter_real E U hP hW + have hn := integral_divergence_le_perimeter_real E U hP (perimeterAdmissible_neg hW) + have hd : divergence W = fun x ↦ B⁻¹ * divergence V x := by + funext x + rw [divergence_smul (differentiable_const _) (hV.differentiable (by simp))] + simp + rw [divergence_neg (hW.1.differentiable (by simp))] at hn + simp only [Pi.neg_apply] at hn + rw [integral_neg] at hn + rw [hd, integral_const_mul] at hp hn + have hab : |B⁻¹ * ∫ x in E, divergence V x| ≤ (perimeter E U).toReal := + abs_le.mpr ⟨by linarith, hp⟩ + calc + _ = B * |B⁻¹ * ∫ x in E, divergence V x| := by + rw [abs_mul, abs_inv, abs_of_pos hB, ← mul_assoc, mul_inv_cancel₀ hB.ne', one_mul] + _ ≤ _ := mul_le_mul_of_nonneg_left hab hB.le + +theorem scalar_layer_admissible {n : ℕ} {U : Set (Euc n)} + {Q : Euc n → Euc n} (hQ : PerimeterAdmissible U Q) + {f : Euc n → ℝ} (hf : ContDiff ℝ ∞ f) {δ : ℝ} (hδ : 0 < δ) (j : ℕ) : + PerimeterAdmissible (U ∩ {x | ((j : ℝ) - 1) * δ < f x}) + (fun x ↦ Real.smoothTransition (f x / δ - j) • Q x) := by + let a : Euc n → ℝ := fun x ↦ Real.smoothTransition (f x / δ - j) + have ha : ContDiff ℝ ∞ a := + Real.smoothTransition.contDiff.comp ((hf.div_const δ).sub contDiff_const) + have hsa : tsupport a ⊆ {x | (j : ℝ) * δ ≤ f x} := by + apply closure_minimal + · intro x hx + by_contra h + have hlt : f x < (j : ℝ) * δ := lt_of_not_ge h + have hd : f x / δ - j ≤ 0 := by + have := (div_lt_iff₀ hδ).mpr hlt + linarith + exact hx (Real.smoothTransition.zero_of_nonpos hd) + · exact isClosed_le continuous_const hf.continuous + refine ⟨ha.smul hQ.1, hQ.2.1.smul_left (f := a), ?_, ?_⟩ + · intro x hx + refine ⟨hQ.2.2.1 (tsupport_smul_subset_right _ _ hx), ?_⟩ + have h := hsa (tsupport_smul_subset_left _ _ hx) + change (j : ℝ) * δ ≤ f x at h + change ((j : ℝ) - 1) * δ < f x + nlinarith + · intro x + rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg (Real.smoothTransition.nonneg _)] + exact (mul_le_of_le_one_left (norm_nonneg _) (Real.smoothTransition.le_one _)).trans + (hQ.2.2.2 x) + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem finite_level_integral_le {n : ℕ} (μ : Measure (Euc n)) [IsFiniteMeasure μ] + {f : Euc n → ℝ} (hf : Measurable f) (hf0 : ∀ x, 0 ≤ f x) (hfi : Integrable f μ) + {δ : ℝ} (hδ : 0 < δ) (N : ℕ) : + δ * (∑ j ∈ Finset.range N, μ.real {x | ((j : ℝ) - 1) * δ < f x}) ≤ + (∫ x, f x ∂μ) + 2 * δ * μ.real univ := by + classical + let s : ℕ → Set (Euc n) := fun j ↦ {x | ((j : ℝ) - 1) * δ < f x} + have hs : ∀ j, MeasurableSet (s j) := fun j ↦ measurableSet_lt measurable_const hf + let g : ℕ → Euc n → ℝ := fun j ↦ (s j).indicator (fun _ ↦ 1) + have hg : ∀ j, Integrable (g j) μ := fun j ↦ (integrable_const 1).indicator (hs j) + have hpoint : ∀ x, δ * ∑ j ∈ Finset.range N, g j x ≤ f x + 2 * δ := by + intro x + have hcount := finite_level_count_le N (a := f x / δ + 1) (add_nonneg (div_nonneg (hf0 x) hδ.le) zero_le_one) + have he : (∑ j ∈ Finset.range N, g j x) = + ∑ j ∈ Finset.range N, if (j : ℝ) < f x / δ + 1 then (1 : ℝ) else 0 := by + apply Finset.sum_congr rfl + intro j hj + have hc : ((j : ℝ) - 1) * δ < f x ↔ (j : ℝ) < f x / δ + 1 := by + have heq : f x / δ * δ = f x := div_mul_cancel₀ _ hδ.ne' + constructor <;> intro h <;> nlinarith + simp only [g, Set.indicator_apply, s, Set.mem_ofPred_eq, hc] + rw [he] + have hh := mul_le_mul_of_nonneg_left hcount hδ.le + have heq : δ * (f x / δ) = f x := mul_div_cancel₀ _ hδ.ne' + nlinarith + calc + _ = ∫ x, δ * ∑ j ∈ Finset.range N, g j x ∂μ := by + rw [integral_const_mul, integral_finsetSum _ (fun j _ ↦ hg j)] + congr 1 + apply Finset.sum_congr rfl + intro j hj + simp only [g, integral_indicator (hs j), integral_const, smul_eq_mul, mul_one, + measureReal_restrict_apply_univ, s] + _ ≤ ∫ x, (f x + 2 * δ) ∂μ := by + exact integral_mono ((integrable_finsetSum _ (fun j _ ↦ hg j)).const_mul δ) + (hfi.add (integrable_const _)) hpoint + _ = _ := by rw [integral_add hfi (integrable_const _), integral_const]; simp [smul_eq_mul, mul_comm] + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem integral_divergence_scalar_le {n : ℕ} (E U : Set (Euc n)) + (hU : IsOpen U) (hP : perimeter E U ≠ ⊤) + {Q : Euc n → Euc n} (hQ : PerimeterAdmissible U Q) + {f : Euc n → ℝ} (hf : ContDiff ℝ ∞ f) (hf0 : ∀ x, 0 ≤ f x) + {M : ℝ} (hfM : ∀ x, f x ≤ M) : + (∫ x in E, divergence (fun y ↦ f y • Q y) x) ≤ + ∫ x in U, f x ∂perimeterMeasure E := by + classical + let μ := (perimeterMeasure E).restrict U + have hμuniv : μ univ = perimeter E U := by + rw [Measure.restrict_apply_univ, perimeterMeasure_open E hU] + let : IsFiniteMeasure μ := ⟨by rw [hμuniv]; exact hP.lt_top⟩ + have hμr : μ.real univ = (perimeter E U).toReal := by rw [measureReal_def, hμuniv] + have hfi : Integrable f μ := Integrable.of_bound hf.continuous.aestronglyMeasurable M + (ae_of_all _ (fun x ↦ by rw [Real.norm_eq_abs, abs_of_nonneg (hf0 x)]; exact hfM x)) + let V : Euc n → Euc n := fun x ↦ f x • Q x + have hVc : ContDiff ℝ ∞ V := hf.smul hQ.1 + have hVk : HasCompactSupport V := hQ.2.1.smul_left (f := f) + have hVs : tsupport V ⊆ U := (tsupport_smul_subset_right _ _).trans hQ.2.2.1 + have hδbound : ∀ δ : ℝ, 0 < δ → + (∫ x in E, divergence V x) ≤ (∫ x, f x ∂μ) + 3 * δ * μ.real univ := by + intro δ hδ + obtain ⟨N, hN⟩ := exists_nat_ge (M / δ) + let s : ℕ → Set (Euc n) := fun j ↦ U ∩ {x | ((j : ℝ) - 1) * δ < f x} + have hs : ∀ j, IsOpen (s j) := fun j ↦ hU.inter (isOpen_lt continuous_const hf.continuous) + let W : ℕ → Euc n → Euc n := fun j x ↦ Real.smoothTransition (f x / δ - j) • Q x + have hW : ∀ j, PerimeterAdmissible (s j) (W j) := scalar_layer_admissible hQ hf hδ + let a : Euc n → ℝ := fun x ↦ δ * ∑ j ∈ Finset.range N, Real.smoothTransition (f x / δ - j) + have hac : ContDiff ℝ ∞ a := contDiff_const.mul (ContDiff.sum (fun j _ ↦ + Real.smoothTransition.contDiff.comp ((hf.div_const δ).sub contDiff_const))) + let A : Euc n → Euc n := fun x ↦ a x • Q x + have hAc : ContDiff ℝ ∞ A := hac.smul hQ.1 + have hAk : HasCompactSupport A := hQ.2.1.smul_left (f := a) + have hAs : tsupport A ⊆ U := (tsupport_smul_subset_right _ _).trans hQ.2.2.1 + have har : ∀ x, |f x - a x| ≤ δ := by + intro x + have hh := smooth_layer_sum_bounds N (a := f x / δ) (div_nonneg (hf0 x) hδ.le) + ((div_le_div_of_nonneg_right (hfM x) hδ.le).trans hN) + have h1 := mul_le_mul_of_nonneg_left hh.1 hδ.le + have h2 := mul_le_mul_of_nonneg_left hh.2 hδ.le + have heq : δ * (f x / δ) = f x := by field_simp + dsimp [a] + exact abs_le.mpr ⟨by nlinarith, by nlinarith⟩ + have hb : ∀ x, ‖(V - A) x‖ ≤ δ := by + intro x + change ‖f x • Q x - a x • Q x‖ ≤ δ + rw [← sub_smul, norm_smul, Real.norm_eq_abs] + exact (mul_le_mul (har x) (hQ.2.2.2 x) (norm_nonneg _) hδ.le).trans_eq (mul_one δ) + have her := abs_integral_divergence_le_bound_perimeter E U hP + (hVc.sub hAc) (hVk.sub hAk) + ((tsupport_sub V A).trans (union_subset hVs hAs)) hδ hb + change |∫ x in E, divergence (V - A) x| ≤ δ * (perimeter E U).toReal at her + rw [divergence_sub (hVc.differentiable (by simp)) (hAc.differentiable (by simp))] at her + simp only [Pi.sub_apply] at her + rw [integral_sub (integrable_divergence hVc hVk).integrableOn + (integrable_divergence hAc hAk).integrableOn] at her + have hAid : A = fun x ↦ δ • (∑ j ∈ Finset.range N, W j) x := by + funext x + simp only [A, a, W, Finset.sum_apply, ← Finset.sum_smul, smul_smul] + have hAdiv : divergence A = fun x ↦ δ * ∑ j ∈ Finset.range N, divergence (W j) x := by + rw [hAid] + funext x + rw [divergence_smul (differentiable_const δ) + (Differentiable.sum (fun j _ ↦ (hW j).1.differentiable (by simp)))] + simp only [gradient_fun_const, inner_zero_left, add_zero] + rw [divergence_finset_sum _ W (fun j _ ↦ (hW j).1.differentiable (by simp))] + simp only [Finset.sum_apply] + have hAint : (∫ x in E, divergence A x) = + δ * ∑ j ∈ Finset.range N, ∫ x in E, divergence (W j) x := by + rw [hAdiv, integral_const_mul, integral_finsetSum _ + (fun j _ ↦ (integrable_divergence (hW j).1 (hW j).2.1).integrableOn)] + have hWbound : ∀ j, (∫ x in E, divergence (W j) x) ≤ + μ.real {x | ((j : ℝ) - 1) * δ < f x} := by + intro j + have hPs : perimeter E (s j) ≠ ⊤ := ne_top_of_le_ne_top hP + (raw_perimeter_mono_region E inter_subset_left) + have hd := integral_divergence_le_perimeter_real E (s j) hPs (hW j) + convert hd using 1 + rw [measureReal_def, Measure.restrict_apply + (measurableSet_lt measurable_const hf.continuous.measurable), inter_comm, + perimeterMeasure_open E (hs j)] + have hAupper : (∫ x in E, divergence A x) ≤ (∫ x, f x ∂μ) + 2 * δ * μ.real univ := by + rw [hAint] + exact (mul_le_mul_of_nonneg_left (Finset.sum_le_sum (fun j _ ↦ hWbound j)) hδ.le).trans + (finite_level_integral_le μ hf.continuous.measurable hf0 hfi hδ N) + rw [← hμr] at her + have hh := (le_abs_self _).trans her + linarith + apply le_of_forall_pos_le_add + intro ε hε + let δ := ε / (3 * μ.real univ + 1) + have hd : 0 < δ := by dsimp [δ]; positivity + have hh := hδbound δ hd + have hmul : δ * (3 * μ.real univ + 1) = ε := by + dsimp [δ] + exact div_mul_cancel₀ _ (by positivity) + change (∫ x in E, divergence V x) ≤ (∫ x, f x ∂μ) + ε + nlinarith + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem abs_integral_divergence_le_integral_norm {n : ℕ} (E U : Set (Euc n)) + (hU : IsOpen U) (hP : perimeter E U ≠ ⊤) {V : Euc n → Euc n} + (hV : ContDiff ℝ ∞ V) (hc : HasCompactSupport V) (hs : tsupport V ⊆ U) : + |∫ x in E, divergence V x| ≤ ∫ x in U, ‖V x‖ ∂perimeterMeasure E := by + classical + let μ := (perimeterMeasure E).restrict U + let : IsFiniteMeasure μ := ⟨by + rw [Measure.restrict_apply_univ, perimeterMeasure_open E hU]; exact hP.lt_top⟩ + obtain ⟨B, hB⟩ := (hc.isCompact_range hV.continuous).isBounded.exists_norm_le + have hb : ∀ x, ‖V x‖ ≤ B := fun x ↦ hB _ (mem_range_self x) + have hNi : Integrable (fun x ↦ ‖V x‖) μ := + Integrable.of_bound hV.continuous.norm.aestronglyMeasurable B + (ae_of_all _ (fun x ↦ by simpa using hb x)) + have hbound : ∀ ε : ℝ, 0 < ε → + |∫ x in E, divergence V x| ≤ (∫ x, ‖V x‖ ∂μ) + ε * μ.real univ := by + intro ε hε + let f : Euc n → ℝ := fun x ↦ Real.sqrt (‖V x‖ ^ 2 + ε ^ 2) + have hsquare : ContDiff ℝ ∞ (fun x ↦ ‖V x‖ ^ 2 + ε ^ 2) := by + simpa only [real_inner_self_eq_norm_sq] using (hV.inner ℝ hV).add (contDiff_const (c := ε^2)) + have hsq : ∀ x, 0 < ‖V x‖ ^ 2 + ε ^ 2 := fun x ↦ by positivity + have hf : ContDiff ℝ ∞ f := hsquare.sqrt (fun x ↦ (hsq x).ne') + have hfpos : ∀ x, 0 < f x := fun x ↦ Real.sqrt_pos.2 (hsq x) + have hflo : ∀ x, ‖V x‖ ≤ f x := by + intro x + exact (Real.le_sqrt (norm_nonneg _) (hsq x).le).2 (by nlinarith [sq_nonneg ε]) + have hfhi : ∀ x, f x ≤ ‖V x‖ + ε := by + intro x + apply (Real.sqrt_le_iff).2 + constructor + · positivity + · nlinarith [norm_nonneg (V x)] + let Q : Euc n → Euc n := fun x ↦ (f x)⁻¹ • V x + have hQ : PerimeterAdmissible U Q := by + refine ⟨(hf.inv (fun x ↦ (hfpos x).ne')).smul hV, + hc.smul_left (f := fun x ↦ (f x)⁻¹), + (tsupport_smul_subset_right _ _).trans hs, ?_⟩ + intro x + simp only [Q, norm_smul, Real.norm_of_nonneg (inv_nonneg.mpr (hfpos x).le)] + exact (mul_le_mul_of_nonneg_left (hflo x) (inv_nonneg.mpr (hfpos x).le)).trans_eq + (inv_mul_cancel₀ (hfpos x).ne') + have hfM : ∀ x, f x ≤ B + ε := fun x ↦ (hfhi x).trans (add_le_add (hb x) le_rfl) + have hfi : Integrable f μ := Integrable.of_bound hf.continuous.aestronglyMeasurable + (B + ε) (ae_of_all _ (fun x ↦ by rw [Real.norm_eq_abs, abs_of_pos (hfpos x)]; exact hfM x)) + have hi := integral_divergence_scalar_le E U hU hP hQ hf (fun x ↦ (hfpos x).le) hfM + have hn := integral_divergence_scalar_le E U hU hP (perimeterAdmissible_neg hQ) + hf (fun x ↦ (hfpos x).le) hfM + have heq : (fun x ↦ f x • Q x) = V := by + funext x + simp only [Q, smul_smul, mul_inv_cancel₀ (hfpos x).ne', one_smul] + have heqn : (fun x ↦ f x • (-Q) x) = -V := by + funext x + simp only [Pi.neg_apply, smul_neg] + rw [congrFun heq] + rw [heq] at hi + rw [heqn, divergence_neg (hV.differentiable (by simp))] at hn + simp only [Pi.neg_apply, integral_neg] at hn + have ha : |∫ x in E, divergence V x| ≤ ∫ x, f x ∂μ := abs_le.mpr ⟨by linarith, hi⟩ + refine ha.trans ?_ + calc + (∫ x, f x ∂μ) ≤ ∫ x, ‖V x‖ + ε ∂μ := integral_mono hfi (hNi.add (integrable_const ε)) hfhi + _ = (∫ x, ‖V x‖ ∂μ) + ε * μ.real univ := by + rw [integral_add hNi (integrable_const ε), integral_const]; simp [mul_comm] + apply le_of_forall_pos_le_add + intro η hη + let ε := η / (μ.real univ + 1) + have hε : 0 < ε := by dsimp [ε]; positivity + have hh := hbound ε hε + have hm : ε * (μ.real univ + 1) = η := by + dsimp [ε] + exact div_mul_cancel₀ _ (by positivity) + change |∫ x in E, divergence V x| ≤ (∫ x, ‖V x‖ ∂μ) + η + nlinarith + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +def smoothVariationDomain {n : ℕ} (U : Set (Euc n)) (μ : Measure (Euc n)) : + Submodule ℝ (Lp (Euc n) 2 μ) where + carrier := {u | ∃ V : Euc n → Euc n, ContDiff ℝ ∞ V ∧ HasCompactSupport V ∧ + tsupport V ⊆ U ∧ (u : Euc n → Euc n) =ᵐ[μ] V} + zero_mem' := by + refine ⟨0, contDiff_const, HasCompactSupport.zero, by simp, ?_⟩ + exact Lp.coeFn_zero _ _ _ + add_mem' := by + rintro u v ⟨V, hV, hcV, hsV, heV⟩ ⟨W, hW, hcW, hsW, heW⟩ + refine ⟨V + W, hV.add hW, hcV.add hcW, + (tsupport_add V W).trans (union_subset hsV hsW), ?_⟩ + exact (Lp.coeFn_add u v).trans (heV.add heW) + smul_mem' := by + rintro c u ⟨V, hV, hcV, hsV, heV⟩ + refine ⟨c • V, hV.const_smul c, hcV.comp_left (g := fun z : Euc n ↦ c • z) (smul_zero _), + (tsupport_smul_subset_right (fun _ : Euc n ↦ c) V).trans hsV, ?_⟩ + exact (Lp.coeFn_smul c u).trans (heV.const_smul c) + +noncomputable def smoothVariationRepresentative {n : ℕ} {U : Set (Euc n)} + {μ : Measure (Euc n)} (u : smoothVariationDomain U μ) : Euc n → Euc n := + u.property.choose + +theorem smoothVariationRepresentative_spec {n : ℕ} {U : Set (Euc n)} + {μ : Measure (Euc n)} (u : smoothVariationDomain U μ) : + ContDiff ℝ ∞ (smoothVariationRepresentative u) ∧ + HasCompactSupport (smoothVariationRepresentative u) ∧ + tsupport (smoothVariationRepresentative u) ⊆ U ∧ + ((u : Lp (Euc n) 2 μ) : Euc n → Euc n) =ᵐ[μ] smoothVariationRepresentative u := + u.property.choose_spec + +theorem integral_divergence_eq_of_variation_ae {n : ℕ} (E U : Set (Euc n)) + (hU : IsOpen U) (hP : perimeter E U ≠ ⊤) {V W : Euc n → Euc n} + (hV : ContDiff ℝ ∞ V) (hcV : HasCompactSupport V) (hsV : tsupport V ⊆ U) + (hW : ContDiff ℝ ∞ W) (hcW : HasCompactSupport W) (hsW : tsupport W ⊆ U) + (he : V =ᵐ[(perimeterMeasure E).restrict U] W) : + (∫ x in E, divergence V x) = ∫ x in E, divergence W x := by + have hh := abs_integral_divergence_le_integral_norm E U hU hP + (hV.sub hW) (hcV.sub hcW) ((tsupport_sub V W).trans (union_subset hsV hsW)) + have he0 : (∫ x in U, ‖V x - W x‖ ∂perimeterMeasure E) = 0 := by + apply integral_eq_zero_of_ae + filter_upwards [he] with x hx + simp [hx] + change |∫ x in E, divergence (V - W) x| ≤ ∫ x in U, ‖V x - W x‖ ∂perimeterMeasure E at hh + rw [he0, abs_nonpos_iff, divergence_sub (hV.differentiable (by simp)) + (hW.differentiable (by simp))] at hh + simp only [Pi.sub_apply] at hh + rw [integral_sub (integrable_divergence hV hcV).integrableOn + (integrable_divergence hW hcW).integrableOn] at hh + exact sub_eq_zero.mp hh + +noncomputable def localVariationFunctional {n : ℕ} (E U : Set (Euc n)) + (hU : IsOpen U) (hP : perimeter E U ≠ ⊤) : + smoothVariationDomain U ((perimeterMeasure E).restrict U) →ₗ[ℝ] ℝ where + toFun u := ∫ x in E, divergence (smoothVariationRepresentative u) x + map_add' u v := by + obtain ⟨hVu, hcVu, hsVu, heVu⟩ := smoothVariationRepresentative_spec u + obtain ⟨hVv, hcVv, hsVv, heVv⟩ := smoothVariationRepresentative_spec v + obtain ⟨hVw, hcVw, hsVw, heVw⟩ := smoothVariationRepresentative_spec (u + v) + have he := heVw.symm.trans ((Lp.coeFn_add (u : Lp (Euc n) 2 ((perimeterMeasure E).restrict U)) (v : Lp (Euc n) 2 ((perimeterMeasure E).restrict U))).trans + (heVu.add heVv)) + rw [integral_divergence_eq_of_variation_ae E U hU hP hVw hcVw hsVw + (hVu.add hVv) (hcVu.add hcVv) + ((tsupport_add (smoothVariationRepresentative u) (smoothVariationRepresentative v)).trans (union_subset hsVu hsVv)) he] + change (∫ x in E, divergence (smoothVariationRepresentative u + smoothVariationRepresentative v) x) = _ + rw [divergence_add (hVu.differentiable (by simp)) (hVv.differentiable (by simp))] + exact integral_add (integrable_divergence hVu hcVu).integrableOn + (integrable_divergence hVv hcVv).integrableOn + map_smul' c u := by + obtain ⟨hVu, hcVu, hsVu, heVu⟩ := smoothVariationRepresentative_spec u + obtain ⟨hVw, hcVw, hsVw, heVw⟩ := smoothVariationRepresentative_spec (c • u) + have he := heVw.symm.trans ((Lp.coeFn_smul c (u : Lp (Euc n) 2 ((perimeterMeasure E).restrict U))).trans (heVu.const_smul c)) + rw [integral_divergence_eq_of_variation_ae E U hU hP hVw hcVw hsVw + (hVu.const_smul c) (hcVu.comp_left (g := fun z : Euc n ↦ c • z) (smul_zero _)) + ((tsupport_smul_subset_right (fun _ : Euc n ↦ c) (smoothVariationRepresentative u)).trans hsVu) he] + change (∫ x in E, divergence (fun y ↦ c • smoothVariationRepresentative u y) x) = _ + simp_rw [divergence_smul (differentiable_const c) (hVu.differentiable (by simp)), + gradient_fun_const, inner_zero_left, add_zero] + exact integral_smul c _ + +theorem localVariationFunctional_le {n : ℕ} (E U : Set (Euc n)) + (hU : IsOpen U) (hP : perimeter E U ≠ ⊤) + (u : smoothVariationDomain U ((perimeterMeasure E).restrict U)) : + |localVariationFunctional E U hU hP u| ≤ + ∫ x in U, ‖(u : Lp (Euc n) 2 ((perimeterMeasure E).restrict U)) x‖ ∂perimeterMeasure E := by + obtain ⟨hV, hcV, hsV, heV⟩ := smoothVariationRepresentative_spec u + refine (abs_integral_divergence_le_integral_norm E U hU hP hV hcV hsV).trans_eq ?_ + apply integral_congr_ae + filter_upwards [heV] with x hx + rw [hx] + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/SmoothSheet.lean b/lean/OAI/Geometry/Perimeter/Regularity/SmoothSheet.lean new file mode 100644 index 0000000000000000000000000000000000000000..8090c34f818985839620e4a34f9dfc334db0a6ec --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/SmoothSheet.lean @@ -0,0 +1,88 @@ +import OAI.Geometry.Perimeter.Regularity.MinimalGraphEquation +import OAI.Geometry.Perimeter.Regularity.MinimalGraphSmooth +import OAI.Geometry.Perimeter.Regularity.BlowupHolderGraph + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff InnerProductSpace +namespace RPISingularHarnack + +def HasSmoothPerimeterSheetAt {n : ℕ} (E : Set (Euc n)) (p : Euc n) : Prop := + ∃ U : Set (Euc n), IsOpen U ∧ p ∈ U ∧ + ∃ f : Euc n → ℝ, ContDiffOn ℝ ∞ f U ∧ + (∀ x ∈ U, x ∈ perimeterSupport E ↔ f x = 0) ∧ + (∀ x ∈ U, f x = 0 → fderiv ℝ f x ≠ 0) + +def FlatBlowupRegularityObligation : Prop := + ∀ (n : ℕ), 1 < n → ∀ (E : Set (Euc n)), + IsLocallyPerimeterMinimizing E → + ∀ (p v : Euc n), p ∈ perimeterSupport E → HasHalfspaceBlowup E p v → + HasSmoothPerimeterSheetAt E p + +theorem HasSmoothPerimeterSheetAt.of_blownUpSet {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) {p : Euc n} {r : ℝ} (hr : 0 try rfl + · dsimp [radialDensityDerivative] + ring + +theorem radialDensityIntegrand_continuous {n : ℕ} (c : Euc n) (k : ℕ) + {ψ : ℝ → ℝ} (hψ : ContDiff ℝ ∞ ψ) : + Continuous (fun p : ℝ × Euc n ↦ radialDensityIntegrand c k ψ p.1 p.2) := by + unfold radialDensityIntegrand + fun_prop + +theorem radialDensityDerivative_continuous {n : ℕ} (c : Euc n) (k : ℕ) + {ψ : ℝ → ℝ} (hψ : ContDiff ℝ ∞ ψ) : + Continuous (fun p : ℝ × Euc n ↦ radialDensityDerivative c k ψ p.1 p.2) := by + have hd := hψ.continuous_deriv (by simp) + unfold radialDensityDerivative + fun_prop + +theorem radialDensity_integral_hasDerivAt {n : ℕ} (c : Euc n) (M : ℝ) (k : ℕ) + {ψ : ℝ → ℝ} (hψ : ContDiff ℝ ∞ ψ) (μ : Measure (Euc n)) [IsFiniteMeasure μ] + (hμ : ∀ᵐ x ∂μ, x ∈ Metric.closedBall c M) (t : ℝ) : + Integrable (radialDensityDerivative c k ψ t) μ ∧ + HasDerivAt (fun s ↦ ∫ x, radialDensityIntegrand c k ψ s x ∂μ) + (∫ x, radialDensityDerivative c k ψ t x ∂μ) t := by + have hcF (s : ℝ) : Continuous (radialDensityIntegrand c k ψ s) := + (radialDensityIntegrand_continuous c k hψ).comp (continuous_const.prodMk continuous_id) + have hcD (s : ℝ) : Continuous (radialDensityDerivative c k ψ s) := + (radialDensityDerivative_continuous c k hψ).comp (continuous_const.prodMk continuous_id) + obtain ⟨C, hC⟩ := (isCompact_closedBall c M).exists_bound_of_continuousOn (hcF t).continuousOn + have hFi : Integrable (radialDensityIntegrand c k ψ t) μ := + Integrable.of_bound (hcF t).aestronglyMeasurable C (hμ.mono (fun x hx ↦ hC x hx)) + obtain ⟨B, hB⟩ := (isCompact_Icc.prod (isCompact_closedBall c M)).exists_bound_of_continuousOn + ((radialDensityDerivative_continuous c k hψ).continuousOn : + ContinuousOn _ (Icc (t-1) (t+1) ×ˢ Metric.closedBall c M)) + apply hasDerivAt_integral_of_dominated_loc_of_deriv_le + (s := Ioo (t-1) (t+1)) (bound := fun _ ↦ B) (Ioo_mem_nhds (by linarith) (by linarith)) + (Eventually.of_forall fun s ↦ (hcF s).aestronglyMeasurable) hFi + (hcD t).aestronglyMeasurable ?_ (integrable_const B) (Eventually.of_forall ?_) + · filter_upwards [hμ] with x hx + intro s hs + exact hB (s,x) ⟨⟨hs.1.le,hs.2.le⟩,hx⟩ + · intro x s _ + exact radialDensityIntegrand_hasDerivAt c k hψ s x + +theorem tangentialDivergence_radialProfile {n : ℕ} (hn : 0 < n) + (E : Set (Euc n)) (c : Euc n) {ψ : ℝ → ℝ} (hψ : ContDiff ℝ ∞ ψ) + (t : ℝ) (x : Euc n) (hN : ‖approximateNormal E x‖ = 1) : + tangentialDivergence E (fun y ↦ ψ (t^2 * ‖y-c‖^2) • (y-c)) x = + (n-1 : ℕ) * ψ (t^2 * ‖x-c‖^2) + + 2*t^2*deriv ψ (t^2 * ‖x-c‖^2) * + (‖x-c‖^2 - (inner ℝ (approximateNormal E x) (x-c))^2) := by + have hf : ContDiff ℝ ∞ (fun y : Euc n ↦ ψ (t^2 * ‖y-c‖^2)) := + hψ.comp (contDiff_const.mul ((contDiff_id.sub contDiff_const).norm_sq (𝕜 := ℝ))) + have hV : Differentiable ℝ (fun y : Euc n ↦ y-c) := + differentiable_id.sub (differentiable_const c) + rw [tangentialDivergence_smul E (hf.differentiable (by simp)) hV, + tangentialDivergence_displacement E c x hN hn] + have hd : fderiv ℝ (fun y : Euc n ↦ ψ (t^2 * ‖y-c‖^2)) x = + (deriv ψ (t^2 * ‖x-c‖^2) * t^2 * 2) • innerSL ℝ (x-c) := by + have hi := (((hasFDerivAt_id x).sub_const c).norm_sq).const_mul (t^2) + have hh := ((hψ.differentiable (by simp)) _).hasDerivAt.comp_hasFDerivAt x hi + convert hh.fderiv using 1 <;> try rfl + ext v + simp + ring + rw [tangentialGradient, inner_sub_left, real_inner_smul_left] + simp only [inner_gradient_left, hd, smul_apply, + innerSL_apply_apply, smul_eq_mul, real_inner_self_eq_norm_sq] + rw [real_inner_comm (x-c) (approximateNormal E x)] + ring + +theorem radialProfile_tsupport {n : ℕ} (c : Euc n) {ψ : ℝ → ℝ} + (hψz : ∀ s, 1 ≤ s → ψ s = 0) {t : ℝ} (ht : 0 < t) : + tsupport (fun x : Euc n ↦ ψ (t^2 * ‖x-c‖^2)) ⊆ Metric.closedBall c (1/t) := by + apply closure_minimal + · intro x hx + by_contra hh + have hr : 1/t < ‖x-c‖ := by simpa [Metric.mem_closedBall, dist_eq_norm] using hh + have htr : 1 < t * ‖x-c‖ := by + have := (div_lt_iff₀ ht).mp hr + nlinarith + have hsq : 1 ≤ t^2 * ‖x-c‖^2 := by nlinarith [sq_nonneg (t * ‖x-c‖ - 1)] + exact hx (hψz _ hsq) + · exact Metric.isClosed_closedBall + +theorem minimizing_radialDensityDerivative_nonpos {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (c : Euc n) {M : ℝ} (hM : 0 < M) {ψ : ℝ → ℝ} (hψ : ContDiff ℝ ∞ ψ) + (hψz : ∀ s, 1 ≤ s → ψ s = 0) (hψd : ∀ s, deriv ψ s ≤ 0) + {t : ℝ} (ht : 1/M < t) : + (∫ x in Metric.ball c M, radialDensityDerivative c (n-1) ψ t x ∂perimeterMeasure E) ≤ 0 := by + let μ := (perimeterMeasure E).restrict (Metric.ball c M) + have : IsFiniteMeasure μ := ⟨by + rw [Measure.restrict_apply_univ, perimeterMeasure_open E Metric.isOpen_ball] + exact hmin.2.1 c M hM⟩ + have hμ : ∀ᵐ x ∂μ, x ∈ Metric.closedBall c M := + (ae_restrict_mem measurableSet_ball).mono fun _ hx ↦ Metric.ball_subset_closedBall hx + have hd := radialDensity_integral_hasDerivAt c M (n-1) hψ μ hμ t + have ht0 : 0 < t := (one_div_pos.mpr hM).trans ht + have htM : 1/t < M := (div_lt_iff₀ ht0).mpr (by + have := (div_lt_iff₀ hM).mp ht + nlinarith) + let V : Euc n → Euc n := fun x ↦ ψ (t^2 * ‖x-c‖^2) • (x-c) + have hf : ContDiff ℝ ∞ (fun x : Euc n ↦ ψ (t^2 * ‖x-c‖^2)) := + hψ.comp (contDiff_const.mul ((contDiff_id.sub contDiff_const).norm_sq (𝕜 := ℝ))) + have hV : ContDiff ℝ ∞ V := hf.smul (contDiff_id.sub contDiff_const) + have hs : tsupport V ⊆ Metric.closedBall c (1/t) := + (tsupport_smul_subset_left _ _).trans (radialProfile_tsupport c hψz ht0) + have hc : HasCompactSupport V := + (isCompact_closedBall c (1/t)).of_isClosed_subset (isClosed_tsupport _) hs + have hz := minimizing_tangentialDivergence_integral_eq_zero hn hmin c hM hV hc + (hs.trans (Metric.closedBall_subset_ball htM)) + have hi := (tangentialDivergence_integrable_ball_perimeter hmin c hM hV).const_mul (t^((n-1)-1)) + have hcmp : ∀ᵐ x ∂μ, + radialDensityDerivative c (n-1) ψ t x ≤ t^((n-1)-1) * tangentialDivergence E V x := by + filter_upwards [ae_restrict_of_ae (minimizing_halfspaceBlowup_ae hn hmin)] with x hx + have hpow : t^(n-1) = t^((n-1)-1)*t := by + rw [← pow_succ, Nat.sub_add_cancel (by omega : 1 ≤ n-1)] + have heq : radialDensityDerivative c (n-1) ψ t x = + t^((n-1)-1) * tangentialDivergence E V x + + (2*t^((n-1)-1)*t^2*(inner ℝ (approximateNormal E x) (x-c))^2) * + deriv ψ (t^2*‖x-c‖^2) := by + dsimp [V, radialDensityDerivative] + rw [tangentialDivergence_radialProfile (by omega) E c hψ t x hx.1, hpow] + ring + rw [heq] + exact add_le_of_nonpos_right (mul_nonpos_of_nonneg_of_nonpos (by positivity) (hψd _)) + have h := integral_mono_ae hd.1 hi hcmp + rw [integral_const_mul] at h + change _ ≤ _ * (∫ x in Metric.ball c M, tangentialDivergence E V x ∂perimeterMeasure E) at h + simpa only [hz, mul_zero] using h + +theorem minimizing_smoothedDensity_antitoneOn {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (c : Euc n) {M : ℝ} (hM : 0 < M) {ψ : ℝ → ℝ} (hψ : ContDiff ℝ ∞ ψ) + (hψz : ∀ s, 1 ≤ s → ψ s = 0) (hψd : ∀ s, deriv ψ s ≤ 0) : + AntitoneOn (fun t ↦ ∫ x in Metric.ball c M, + radialDensityIntegrand c (n-1) ψ t x ∂perimeterMeasure E) (Ioi (1/M)) := by + let μ := (perimeterMeasure E).restrict (Metric.ball c M) + have : IsFiniteMeasure μ := ⟨by + rw [Measure.restrict_apply_univ, perimeterMeasure_open E Metric.isOpen_ball] + exact hmin.2.1 c M hM⟩ + have hμ : ∀ᵐ x ∂μ, x ∈ Metric.closedBall c M := + (ae_restrict_mem measurableSet_ball).mono fun _ hx ↦ Metric.ball_subset_closedBall hx + have hd := fun t ↦ (radialDensity_integral_hasDerivAt c M (n-1) hψ μ hμ t).2 + apply antitoneOn_of_hasDerivWithinAt_nonpos (convex_Ioi (1/M)) + (fun t _ ↦ (hd t).continuousAt.continuousWithinAt) + (fun t _ ↦ (hd t).hasDerivWithinAt) + intro t ht + exact minimizing_radialDensityDerivative_nonpos hn hmin c hM hψ hψz hψd + (by simpa only [interior_Ioi, mem_Ioi] using ht) + +def densityProfile (j : ℕ) (s : ℝ) : ℝ := + Real.smoothTransition (((j : ℝ)+1)*(1-s)) + +theorem densityProfile_contDiff (j : ℕ) : ContDiff ℝ ∞ (densityProfile j) := + Real.smoothTransition.contDiff.comp (contDiff_const.mul (contDiff_const.sub contDiff_id)) + +theorem densityProfile_mem_Icc (j : ℕ) (s : ℝ) : densityProfile j s ∈ Icc (0:ℝ) 1 := + ⟨Real.smoothTransition.nonneg _, Real.smoothTransition.le_one _⟩ + +theorem densityProfile_zero (j : ℕ) {s : ℝ} (hs : 1 ≤ s) : densityProfile j s = 0 := by + apply Real.smoothTransition.zero_of_nonpos + exact mul_nonpos_of_nonneg_of_nonpos (by positivity) (by linarith) + +theorem densityProfile_deriv_nonpos (j : ℕ) (s : ℝ) : deriv (densityProfile j) s ≤ 0 := by + have hm : Antitone (densityProfile j) := by + intro a b hab + apply Real.smoothTransition.monotone + apply mul_le_mul_of_nonneg_left _ (by positivity) + linarith + exact hm.deriv_nonpos + +theorem densityProfile_eventually_one {s : ℝ} (hs : s < 1) : + ∀ᶠ j : ℕ in atTop, densityProfile j s = 1 := by + obtain ⟨N, hN⟩ := exists_nat_gt (1/(1-s)) + filter_upwards [eventually_ge_atTop N] with j hj + apply Real.smoothTransition.one_of_one_le + have hn : (N : ℝ) ≤ j := by exact_mod_cast hj + have hdiv : 1/(1-s) < (j:ℝ)+1 := by linarith + exact ((div_lt_iff₀ (by linarith : 0 < 1-s)).mp hdiv).le + +theorem radialDensityIntegrand_tendsto {n : ℕ} (c : Euc n) (k : ℕ) + {t : ℝ} (ht : 0 < t) (x : Euc n) : + Tendsto (fun j ↦ radialDensityIntegrand c k (densityProfile j) t x) atTop + (𝓝 ((Metric.ball c (1/t)).indicator (fun _ ↦ t^k) x)) := by + by_cases hx : x ∈ Metric.ball c (1/t) + · have hr : ‖x-c‖ < 1/t := by simpa [Metric.mem_ball, dist_eq_norm] using hx + have htr : t*‖x-c‖ < 1 := by + have := (lt_div_iff₀ ht).mp hr + nlinarith + have hq : t^2*‖x-c‖^2 < 1 := by + have := mul_self_lt_mul_self (mul_nonneg ht.le (norm_nonneg (x-c))) htr + nlinarith + rw [indicator_of_mem hx] + apply tendsto_const_nhds.congr' + filter_upwards [densityProfile_eventually_one hq] with j hj + simp [radialDensityIntegrand, hj] + · have hr : 1/t ≤ ‖x-c‖ := by simpa [Metric.mem_ball, dist_eq_norm] using hx + have htr : 1 ≤ t*‖x-c‖ := by + have := (div_le_iff₀ ht).mp hr + nlinarith + have hq : 1 ≤ t^2*‖x-c‖^2 := by nlinarith [sq_nonneg (t*‖x-c‖-1)] + rw [indicator_of_notMem hx] + have heq : (fun j ↦ radialDensityIntegrand c k (densityProfile j) t x) = fun _ ↦ (0:ℝ) := by + funext j + simp [radialDensityIntegrand, densityProfile_zero j hq] + rw [heq] + exact tendsto_const_nhds + +theorem radialDensity_integral_tendsto {n : ℕ} + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (c : Euc n) {M : ℝ} (hM : 0 < M) {t : ℝ} (ht : 1/M < t) : + Tendsto (fun j ↦ ∫ x in Metric.ball c M, + radialDensityIntegrand c (n-1) (densityProfile j) t x ∂perimeterMeasure E) atTop + (𝓝 (t^(n-1) * (perimeterMeasure E).real (Metric.ball c (1/t)))) := by + let μ := (perimeterMeasure E).restrict (Metric.ball c M) + have : IsFiniteMeasure μ := ⟨by + rw [Measure.restrict_apply_univ, perimeterMeasure_open E Metric.isOpen_ball] + exact hmin.2.1 c M hM⟩ + have ht0 : 0 < t := (one_div_pos.mpr hM).trans ht + have htM : 1/t < M := (div_lt_iff₀ ht0).mpr (by + have := (div_lt_iff₀ hM).mp ht + nlinarith) + have hh := tendsto_integral_of_dominated_convergence (μ := μ) (fun _ ↦ t^(n-1)) + (fun j ↦ ((radialDensityIntegrand_continuous c (n-1) (densityProfile_contDiff j)).comp + (continuous_const.prodMk continuous_id)).aestronglyMeasurable) + (integrable_const _) (fun j ↦ ae_of_all μ fun x ↦ ?_) + (ae_of_all μ (radialDensityIntegrand_tendsto c (n-1) ht0)) + · have heq : (∫ x, (Metric.ball c (1/t)).indicator (fun _ ↦ t^(n-1)) x ∂μ) = + t^(n-1) * (perimeterMeasure E).real (Metric.ball c (1/t)) := by + rw [integral_indicator_const (t^(n-1)) measurableSet_ball, smul_eq_mul, mul_comm] + congr 1 + change (μ (Metric.ball c (1/t))).toReal = _ + rw [Measure.restrict_apply measurableSet_ball, + inter_eq_left.mpr (Metric.ball_subset_ball htM.le)] + rfl + rwa [heq] at hh + · dsimp [radialDensityIntegrand] + rw [abs_of_nonneg (mul_nonneg (by positivity) (densityProfile_mem_Icc j _).1)] + exact mul_le_of_le_one_right (by positivity) (densityProfile_mem_Icc j _).2 + +theorem minimizing_perimeter_density_monotone {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) (c : Euc n) : + MonotoneOn (fun r : ℝ ↦ (perimeterMeasure E).real (Metric.ball c r) / r^(n-1)) (Ioi 0) := by + intro r hr R hR hrR + have hr0 : 0 < r := hr + have hR0 : 0 < R := hR + let M := 2*R + have hM : 0 < M := by dsimp [M]; positivity + have hRM : 1/M < 1/R := one_div_lt_one_div_of_lt hR0 (by dsimp [M]; linarith) + have htr : 1/R ≤ 1/r := one_div_le_one_div_of_le hr0 hrR + have hrM : 1/M < 1/r := hRM.trans_le htr + have hseq (j : ℕ) := minimizing_smoothedDensity_antitoneOn hn hmin c hM + (densityProfile_contDiff j) (fun s hs ↦ densityProfile_zero j hs) + (densityProfile_deriv_nonpos j) hRM hrM htr + have hh := le_of_tendsto_of_tendsto + (radialDensity_integral_tendsto hmin c hM hrM) + (radialDensity_integral_tendsto hmin c hM hRM) (Eventually.of_forall hseq) + simpa [one_div, div_eq_mul_inv, mul_comm] using hh + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +open scoped ENNReal Topology ContDiff +open scoped Topology ENNReal +namespace RPISingularHarnack + +theorem support_ray_inner_le_zero {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + {x v w : Euc n} (hv : HasHalfspaceBlowup E x v) + (hray : ∀ r : ℝ, 0 < r → r < 1 → x + r • w ∈ perimeterSupport E) : + inner ℝ w v ≤ 0 := by + by_contra hbad + have ha : 0 < inner ℝ w v := lt_of_not_ge hbad + let a := inner ℝ w v + let δ := a / 4 + let A := ‖w‖ + δ + 1 + have hδ : 0 < δ := by dsimp [δ, a]; positivity + have hA : 0 < A := by dsimp [A]; positivity + let f : Euc n → ℝ := fun y ↦ |E.indicator (fun _ ↦ (1 : ℝ)) y - + {z | inner ℝ (z - x) v < 0}.indicator (fun _ ↦ (1 : ℝ)) y| + have hfm : Measurable f := by + apply Measurable.abs + exact (measurable_const.indicator hmin.1).sub + (measurable_const.indicator (isOpen_lt + ((continuous_id.sub continuous_const).inner continuous_const) continuous_const).measurableSet) + have hfi (s : ℝ) : IntegrableOn f (Metric.ball x s) volume := by + apply (integrableOn_const measure_ball_lt_top.ne (C := (1 : ℝ))).mono' hfm.aestronglyMeasurable + apply ae_of_all + intro y + dsimp [f] + by_cases he : y ∈ E <;> by_cases hh : inner ℝ (y - x) v < 0 <;> simp [he, hh] + obtain ⟨ε, hε, hphase⟩ := minimizing_scaled_two_phase_volume_lower + (Real.HolderConjugate.conjExponent (by exact_mod_cast hn : 1 < (n : ℝ))) + have hlow (r : ℝ) (hr : 0 < r) (hr1 : r < 1) : + ε * (r * δ) ^ n ≤ ∫ y in Metric.ball x (r * A), f y := by + let B := Metric.closedBall (x + r • w) (r * δ) + have hsub : B ⊆ Metric.ball x (r * A) := by + intro y hy + have ht := dist_triangle y (x + r • w) x + have hd : dist (x + r • w) x = r * ‖w‖ := by + simp [dist_eq_norm, norm_smul, abs_of_pos hr] + rw [hd] at ht + have hb : dist y (x + r • w) ≤ r * δ := hy + change dist y x < r * A + dsimp [A] + nlinarith + have hpos (y : Euc n) (hy : y ∈ B) : 0 < inner ℝ (y - x) v := by + have hi := (abs_le.mp (abs_real_inner_le_norm (y - (x + r • w)) v)).1 + rw [hv.1, mul_one] at hi + have hb : ‖y - (x + r • w)‖ ≤ r * δ := by + simpa only [B, Metric.mem_closedBall, dist_eq_norm] using hy + have he : inner ℝ (y - x) v = inner ℝ (y - (x + r • w)) v + r * a := by + simp [a, inner_sub_left, inner_add_left, real_inner_smul_left] + ring + dsimp [δ] at hb + rw [he] + nlinarith + have heq : (∫ y in B, f y) = volume.real (E ∩ B) := by + calc + (∫ y in B, f y) = ∫ y in B, E.indicator (fun _ ↦ (1 : ℝ)) y := by + apply setIntegral_congr_fun measurableSet_closedBall + intro y hy + have hh : ¬ inner ℝ (y - x) v < 0 := not_lt.mpr (hpos y hy).le + dsimp [f] + by_cases he : y ∈ E <;> simp [he, hh] + _ = volume.real (E ∩ B) := by + simp only [integral_indicator_const _ hmin.1, + measureReal_restrict_apply hmin.1, smul_eq_mul, mul_one] + exact le_trans (hphase E hmin _ (hray r hr hr1) _ (mul_pos hr hδ)).1.le + (heq ▸ setIntegral_mono_set (hfi _) (ae_of_all _ (fun y ↦ abs_nonneg _)) + (Eventually.of_forall hsub)) + have ht : Tendsto (fun r : ℝ ↦ r * A) (𝓝[>] 0) (𝓝[>] 0) := by + apply tendsto_nhdsWithin_iff.mpr + refine ⟨?_, ?_⟩ + · simpa using ((tendsto_id : Tendsto (fun r : ℝ ↦ r) (𝓝 0) (𝓝 0)).mono_left nhdsWithin_le_nhds).mul_const A + · filter_upwards [self_mem_nhdsWithin] with r hr + exact mul_pos hr hA + have hlim := hv.2.comp ht + change Tendsto (fun r : ℝ ↦ ((r * A) ^ n)⁻¹ * ∫ y in Metric.ball x (r * A), f y) + (𝓝[>] 0) (𝓝 0) at hlim + have hb : ε * δ ^ n / A ^ n ≤ (0 : ℝ) := by + apply ge_of_tendsto hlim + filter_upwards [self_mem_nhdsWithin, (eventually_lt_nhds (show (0 : ℝ) < 1 by norm_num)).filter_mono nhdsWithin_le_nhds] with r hr hr1 + change 0 < r at hr + have hl := hlow r hr hr1 + rw [mul_pow] at hl + apply (div_le_iff₀ (pow_pos hA n)).mpr + have he : (((r * A) ^ n)⁻¹ * ∫ y in Metric.ball x (r * A), f y) * A ^ n = + (r ^ n)⁻¹ * ∫ y in Metric.ball x (r * A), f y := by + rw [mul_pow] + field_simp + rw [he] + have hh := mul_le_mul_of_nonneg_left hl (inv_nonneg.mpr (pow_pos hr n).le) + convert hh using 1 + field_simp [ne_of_gt hr] + have : 0 < ε * δ ^ n / A ^ n := div_pos (mul_pos hε (pow_pos hδ n)) (pow_pos hA n) + linarith + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +open scoped ENNReal Topology ContDiff +open scoped Topology ENNReal +namespace RPISingularHarnack + +theorem minimizing_cone_halfspace_radial_tangent {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) (hcone : IsCone E) + {x v : Euc n} (hx : x ∈ perimeterSupport E) (hv : HasHalfspaceBlowup E x v) : + inner ℝ x v = 0 := by + have hc := isCone_perimeterSupport hmin.1 hcone + have hplus : inner ℝ x v ≤ 0 := support_ray_inner_le_zero hn hmin hv (by + intro r hr _ + have hh := (hc (1 + r) (by linarith) x).mpr hx + simpa only [add_smul, one_smul] using hh) + have hminus : inner ℝ (-x) v ≤ 0 := support_ray_inner_le_zero hn hmin hv (by + intro r _ hr + have hh := (hc (1 - r) (by linarith) x).mpr hx + rw [sub_smul, one_smul] at hh + simpa only [smul_neg, sub_eq_add_neg] using hh) + rw [inner_neg_left] at hminus + linarith + +theorem minimizing_cone_radial_tangent_ae {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) (hcone : IsCone E) : + ∀ᵐ x ∂perimeterMeasure E, inner ℝ x (approximateNormal E x) = 0 := by + have hs : ∀ᵐ x ∂perimeterMeasure E, x ∈ perimeterSupport E := by + rw [← perimeterMeasure_support] + exact (perimeterMeasure E).support_mem_ae + filter_upwards [minimizing_halfspaceBlowup_ae hn hmin, hs] with x hx hsx + exact minimizing_cone_halfspace_radial_tangent hn hmin hcone hsx hx + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/Space.lean b/lean/OAI/Geometry/Perimeter/Regularity/Space.lean new file mode 100644 index 0000000000000000000000000000000000000000..63659c686f999729091e6baba71b70d627f047a4 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/Space.lean @@ -0,0 +1,299 @@ +import Mathlib + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +namespace RPI +namespace Boundary + +abbrev Space (n : ℕ) := EuclideanSpace ℝ (Fin n) + +noncomputable def divergence {n : ℕ} (X : Space n → Space n) (x : Space n) : ℝ := + ∑ i : Fin n, (fderiv ℝ X x (EuclideanSpace.single i 1)) i + +def PerimeterTest {n : ℕ} (U : Set (Space n)) (X : Space n → Space n) : Prop := + ContDiff ℝ 1 X ∧ HasCompactSupport X ∧ tsupport X ⊆ U ∧ ∀ x, ‖X x‖ ≤ 1 + +noncomputable def perimeter {n : ℕ} (K U : Set (Space n)) : ℝ≥0∞ := + ⨆ X : Space n → Space n, ⨆ (_ : PerimeterTest U X), + ENNReal.ofReal (∫ x in K, divergence X x) + +theorem perimeter_mono {n : ℕ} (K : Set (Space n)) {U V : Set (Space n)} + (hUV : U ⊆ V) : perimeter K U ≤ perimeter K V := by + unfold perimeter + refine iSup_le fun X ↦ iSup_le fun hX ↦ ?_ + apply le_iSup_of_le X + apply le_iSup_of_le (show PerimeterTest V X from + ⟨hX.1, hX.2.1, hX.2.2.1.trans hUV, hX.2.2.2⟩) + exact le_rfl + +theorem perimeter_congr_ae {n : ℕ} {K L : Set (Space n)} + (hKL : K =ᵐ[(volume : Measure (Space n))] L) (U : Set (Space n)) : + perimeter K U = perimeter L U := by + simp only [perimeter, Measure.restrict_congr_set hKL] + +def LocallyFinitePerimeter {n : ℕ} (K : Set (Space n)) : Prop := + MeasurableSet K ∧ ∀ R : ℝ, 0 < R → perimeter K (Metric.ball 0 R) < ⊤ + +def CompactVariationIn {n : ℕ} (K L U : Set (Space n)) : Prop := + ∃ F : Set (Space n), IsCompact F ∧ F ⊆ U ∧ + ∀ᵐ x ∂(volume : Measure (Space n)), x ∉ F → (x ∈ K ↔ x ∈ L) + +def LocallyPerimeterMinimizing {n : ℕ} (K : Set (Space n)) : Prop := + LocallyFinitePerimeter K ∧ + ∀ (L U : Set (Space n)), LocallyFinitePerimeter L → IsOpen U → Bornology.IsBounded U → + CompactVariationIn K L U → perimeter K U ≤ perimeter L U + +def perimeterSupport {n : ℕ} (K : Set (Space n)) : Set (Space n) := + {x | ∀ r : ℝ, 0 < r → 0 < perimeter K (Metric.ball x r)} + +theorem isClosed_perimeterSupport {n : ℕ} (K : Set (Space n)) : + IsClosed (perimeterSupport K) := by + rw [← isOpen_compl_iff, Metric.isOpen_iff] + intro x hx + change ¬ ∀ r : ℝ, 0 < r → 0 < perimeter K (Metric.ball x r) at hx + push Not at hx + obtain ⟨r, hr, hPr⟩ := hx + refine ⟨r / 2, half_pos hr, ?_⟩ + intro y hy + change ¬ ∀ s : ℝ, 0 < s → 0 < perimeter K (Metric.ball y s) + intro h + have hsub : Metric.ball y (r / 2) ⊆ Metric.ball x r := by + intro z hz + have hzy := Metric.mem_ball.mp hz + have hyx := Metric.mem_ball.mp hy + have ht := dist_triangle z y x + change dist z x < r + linarith + exact not_lt_of_ge ((perimeter_mono K hsub).trans hPr) (h (r / 2) (half_pos hr)) + +def IsCone {n : ℕ} (K : Set (Space n)) : Prop := + ∀ r : ℝ, 0 < r → ∀ᵐ x ∂(volume : Measure (Space n)), (r • x ∈ K ↔ x ∈ K) + +noncomputable def surfaceMeasure {n : ℕ} (S : Set (Space n)) : Measure (Space n) := + (Measure.euclideanHausdorffMeasure (n - 1)).restrict S + +theorem surfaceMeasure_zero_of_dimH_lt {n : ℕ} (S T : Set (Space n)) + (hT : dimH T < (n - 1 : ℕ)) : surfaceMeasure S T = 0 := by + have hraw : Measure.hausdorffMeasure ((n - 1 : ℕ) : ℝ) T = 0 := by + simpa only [NNReal.coe_natCast] using + hausdorffMeasure_of_dimH_lt (d := (n - 1 : ℕ)) hT + have hnorm : (Measure.euclideanHausdorffMeasure (n - 1) : Measure (Space n)) T = 0 := by + simp only [Measure.euclideanHausdorffMeasure, Measure.smul_apply, hraw, smul_zero] + exact le_antisymm ((Measure.restrict_apply_le S T).trans_eq hnorm) zero_le + +theorem surfaceMeasure_zero_of_singular_dim {n : ℕ} (hn : 8 ≤ n) + (S T : Set (Space n)) (hT : dimH T ≤ (n - 8 : ℕ)) : surfaceMeasure S T = 0 := by + apply surfaceMeasure_zero_of_dimH_lt S T + apply hT.trans_lt + exact_mod_cast (show n - 8 < n - 1 by omega) + +theorem contact_measure_zero {n : ℕ} (S S' Z : Set (Space n)) + (hS : MeasurableSet S') (hcontact : S ∩ S' ⊆ Z) + (hZ : dimH Z < (n - 1 : ℕ)) (U : Set (Space n)) : + (surfaceMeasure S).restrict U S' = 0 := by + have hbase : surfaceMeasure S S' = 0 := by + rw [surfaceMeasure, Measure.restrict_apply hS] + have hraw : Measure.hausdorffMeasure ((n - 1 : ℕ) : ℝ) Z = 0 := by + simpa only [NNReal.coe_natCast] using + hausdorffMeasure_of_dimH_lt (d := (n - 1 : ℕ)) hZ + have hnorm : (Measure.euclideanHausdorffMeasure (n - 1) : Measure (Space n)) Z = 0 := by + simp only [Measure.euclideanHausdorffMeasure, Measure.smul_apply, hraw, smul_zero] + apply le_antisymm _ zero_le + apply (measure_mono ?_).trans_eq hnorm + exact fun x hx ↦ hcontact ⟨hx.2, hx.1⟩ + exact le_antisymm ((Measure.restrict_apply_le U S').trans_eq hbase) zero_le + +noncomputable def tangentPlane {n : ℕ} (S : Set (Space n)) (x : Space n) : + Submodule ℝ (Space n) := + Submodule.span ℝ {v | ∃ γ : ℝ → Space n, + γ 0 = x ∧ HasDerivAt γ v 0 ∧ ∀ᶠ t in 𝓝 (0 : ℝ), γ t ∈ S} + +noncomputable def surfaceGradient {n : ℕ} (S : Set (Space n)) + (f : Space n → ℝ) (x : Space n) : Space n := + ((tangentPlane S x).orthogonalProjectionOnto (gradient f x) : Space n) + +def smoothGradientGraph {n : ℕ} (S U : Set (Space n)) : + Set (Lp ℝ 2 ((surfaceMeasure S).restrict U) × + Lp (Space n) 2 ((surfaceMeasure S).restrict U)) := + {z | ∃ f : Space n → ℝ, ContDiff ℝ ∞ f ∧ + ∃ hf : MemLp f 2 ((surfaceMeasure S).restrict U), + ∃ hDf : MemLp (surfaceGradient S f) 2 ((surfaceMeasure S).restrict U), + z = (hf.toLp f, hDf.toLp (surfaceGradient S f))} + +def IsLocalSobolevPair {n : ℕ} (S U : Set (Space n)) + (h : Space n → ℝ) (G : Space n → Space n) : Prop := + ∀ V : Set (Space n), IsOpen V → IsCompact (closure V) → closure V ⊆ U → + ∃ hh : MemLp h 2 ((surfaceMeasure S).restrict V), + ∃ hG : MemLp G 2 ((surfaceMeasure S).restrict V), + (hh.toLp h, hG.toLp G) ∈ closure (smoothGradientGraph S V) + +def IsWeakLaplaceSupersolution {n : ℕ} (S U : Set (Space n)) + (h : Space n → ℝ) (G : Space n → Space n) : Prop := + IsLocalSobolevPair S U h G ∧ + ∀ φ : Space n → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → tsupport φ ⊆ U → + (∀ x, 0 ≤ φ x) → + Integrable (fun x ↦ inner ℝ (G x) (surfaceGradient S φ x)) (surfaceMeasure S) ∧ + 0 ≤ ∫ x, inner ℝ (G x) (surfaceGradient S φ x) ∂surfaceMeasure S + +end Boundary +end RPI + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +namespace RPI.Boundary + +theorem surfaceGradient_congr_trace {n : ℕ} {S : Set (Space n)} + {f g : Space n → ℝ} {x : Space n} + (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) + (heq : ∀ᶠ y in 𝓝 x, y ∈ S → f y = g y) : + surfaceGradient S f x = surfaceGradient S g x := by + have hker : tangentPlane S x ≤ (fderiv ℝ f x - fderiv ℝ g x).ker := by + apply Submodule.span_le.mpr + intro v hv + obtain ⟨γ, hγx, hγd, hγS⟩ := hv + have hfe : HasDerivAt (f ∘ γ) (fderiv ℝ f x v) 0 := by + exact (show HasFDerivAt f (fderiv ℝ f x) (γ 0) by + simpa only [hγx] using hf.hasFDerivAt).comp_hasDerivAt 0 hγd + have hge : HasDerivAt (g ∘ γ) (fderiv ℝ g x v) 0 := by + exact (show HasFDerivAt g (fderiv ℝ g x) (γ 0) by + simpa only [hγx] using hg.hasFDerivAt).comp_hasDerivAt 0 hγd + have hcomp : (f ∘ γ) =ᶠ[𝓝 (0 : ℝ)] (g ∘ γ) := by + have ht : Tendsto γ (𝓝 (0 : ℝ)) (𝓝 x) := hγx ▸ hγd.continuousAt + filter_upwards [ht.eventually heq, hγS] with t ht hS + exact ht hS + have hd : fderiv ℝ f x v = fderiv ℝ g x v := + hfe.unique (hge.congr_of_eventuallyEq hcomp) + change fderiv ℝ f x v - fderiv ℝ g x v = 0 + exact sub_eq_zero.mpr hd + have ho : gradient f x - gradient g x ∈ (tangentPlane S x)ᗮ := by + rw [Submodule.mem_orthogonal] + intro v hv + have hk := hker hv + change fderiv ℝ f x v - fderiv ℝ g x v = 0 at hk + simpa only [inner_sub_right, inner_gradient_right, starRingEnd_apply, star_trivial] using hk + have hp := (Submodule.orthogonalProjectionOnto_eq_zero_iff).mpr ho + have hp' : (tangentPlane S x).orthogonalProjectionOnto (gradient f x) = + (tangentPlane S x).orthogonalProjectionOnto (gradient g x) := by + simpa only [map_sub, sub_eq_zero] using hp + exact congrArg Subtype.val hp' + +def HasSmoothTraceAt {n : ℕ} (S : Set (Space n)) (h : Space n → ℝ) + (x : Space n) : Prop := + ∃ U : Set (Space n), IsOpen U ∧ x ∈ U ∧ ∃ f : Space n → ℝ, + ContDiffOn ℝ ∞ f U ∧ EqOn f h (S ∩ U) + +theorem exists_contDiff_eqOn_of_local_trace {n : ℕ} {S : Set (Space n)} + (hS : IsClosed S) (h : Space n → ℝ) + (hloc : ∀ x ∈ S, HasSmoothTraceAt S h x) : + ∃ f : Space n → ℝ, ContDiff ℝ ∞ f ∧ EqOn f h S := by + classical + let t : Space n → Set ℝ := fun x ↦ if x ∈ S then {h x} else univ + have hc : ∀ x, Convex ℝ (t x) := by + intro x + dsimp [t] + split_ifs + · exact convex_singleton _ + · exact convex_univ + have hlocal : ∀ x : Space n, ∃ U ∈ 𝓝 x, ∃ g : Space n → ℝ, + ContMDiffOn (modelWithCornersSelf ℝ (Space n)) (modelWithCornersSelf ℝ ℝ) ∞ g U ∧ + ∀ y ∈ U, g y ∈ t y := by + intro x + by_cases hx : x ∈ S + · obtain ⟨U, hU, hxU, f, hf, he⟩ := hloc x hx + refine ⟨U, hU.mem_nhds hxU, f, hf.contMDiffOn, ?_⟩ + intro y hy + by_cases hys : y ∈ S + · simpa only [t, ite_eq_left hys, mem_singleton_iff] using he ⟨hys, hy⟩ + · simp only [t, ite_eq_right hys, mem_univ] + · refine ⟨Sᶜ, hS.isOpen_compl.mem_nhds hx, fun _ ↦ 0, contMDiffOn_const, ?_⟩ + intro y hy + simp only [t, ite_eq_right hy, mem_univ] + obtain ⟨f, hf⟩ := exists_contMDiffMap_forall_mem_convex_of_local + (modelWithCornersSelf ℝ (Space n)) (n := (⊤ : ℕ∞)) hc hlocal + refine ⟨f, f.contMDiff.contDiff, ?_⟩ + intro x hx + simpa only [t, ite_eq_left hx, mem_singleton_iff] using hf x + +def HasSmoothTraceJetAt {n : ℕ} (S : Set (Space n)) (h : Space n → ℝ) + (G : Space n → Space n) (x : Space n) : Prop := + ∃ U : Set (Space n), IsOpen U ∧ x ∈ U ∧ ∃ f : Space n → ℝ, + ContDiffOn ℝ ∞ f U ∧ EqOn f h (S ∩ U) ∧ surfaceGradient S f x = G x + +lemma HasSmoothTraceJetAt.trace {n : ℕ} {S : Set (Space n)} {h : Space n → ℝ} + {G : Space n → Space n} {x : Space n} (hx : HasSmoothTraceJetAt S h G x) : + HasSmoothTraceAt S h x := by + obtain ⟨U, hU, hxU, f, hf, he, _⟩ := hx + exact ⟨U, hU, hxU, f, hf, he⟩ + +theorem surfaceGradient_mul {n : ℕ} {S : Set (Space n)} + {f g : Space n → ℝ} {x : Space n} + (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : + surfaceGradient S (fun y ↦ f y * g y) x = + f x • surfaceGradient S g x + g x • surfaceGradient S f x := by + have hgrad : gradient (fun y ↦ f y * g y) x = + f x • gradient g x + g x • gradient f x := by + apply (InnerProductSpace.toDual ℝ (Space n)).injective + simp only [map_add, map_smul, toDual_gradient] + exact fderiv_mul hf hg + simp only [surfaceGradient, hgrad, map_add, map_smul, Submodule.coe_add, + Submodule.coe_smul] + +@[simp] theorem surfaceGradient_const {n : ℕ} (S : Set (Space n)) + (c : ℝ) (x : Space n) : surfaceGradient S (fun _ ↦ c) x = 0 := by + simp only [surfaceGradient, gradient_fun_const, map_zero, Submodule.coe_zero] + +theorem exists_smooth_cutoff_trace {n : ℕ} {S Z : Set (Space n)} + (hS : IsClosed S) {h : Space n → ℝ} {G : Space n → Space n} + (hreg : ∀ x ∈ S \ Z, HasSmoothTraceJetAt S h G x) + (χ : Space n → ℝ) (hχ : ContDiff ℝ ∞ χ) + (hzero : ∃ U : Set (Space n), IsOpen U ∧ Z ⊆ U ∧ ∀ x ∈ U, χ x = 0) : + ∃ F : Space n → ℝ, ContDiff ℝ ∞ F ∧ EqOn F (fun x ↦ χ x * h x) S ∧ + EqOn (surfaceGradient S F) + (fun x ↦ χ x • G x + h x • surfaceGradient S χ x) S := by + have hj : ∀ x ∈ S, HasSmoothTraceJetAt S (fun x ↦ χ x * h x) + (fun x ↦ χ x • G x + h x • surfaceGradient S χ x) x := by + intro x hx + by_cases hxZ : x ∈ Z + · obtain ⟨U, hU, hZU, he⟩ := hzero + have hxU := hZU hxZ + refine ⟨U, hU, hxU, fun _ ↦ 0, contDiffOn_const, ?_, ?_⟩ + · intro y hy + simp only [he y hy.2, zero_mul] + · have hχgrad : gradient χ x = 0 := by + have heq : χ =ᶠ[𝓝 x] (fun _ ↦ (0 : ℝ)) := by + filter_upwards [hU.mem_nhds hxU] with y hy using he y hy + simpa only [gradient_fun_const] using heq.gradient_eq + simp only [he x hxU, zero_smul, surfaceGradient, gradient_fun_const, + hχgrad, map_zero, Submodule.coe_zero, smul_zero, add_zero] + · obtain ⟨U, hU, hxU, f, hf, he, hG⟩ := hreg x ⟨hx, hxZ⟩ + refine ⟨U, hU, hxU, fun y ↦ χ y * f y, hχ.contDiffOn.mul hf, ?_, ?_⟩ + · intro y hy + exact congrArg (fun a ↦ χ y * a) (he hy) + · rw [surfaceGradient_mul (hχ.differentiable (by simp) x) + ((hf.contDiffAt (hU.mem_nhds hxU)).differentiableAt (by simp)), + hG, he ⟨hx, hxU⟩] + obtain ⟨F, hF, hFe⟩ := exists_contDiff_eqOn_of_local_trace hS + (fun x ↦ χ x * h x) (fun x hx ↦ (hj x hx).trace) + refine ⟨F, hF, hFe, ?_⟩ + intro x hx + obtain ⟨U, hU, hxU, f, hf, he, hG⟩ := hj x hx + calc + surfaceGradient S F x = surfaceGradient S f x := by + apply surfaceGradient_congr_trace (hF.differentiable (by simp) x) + ((hf.contDiffAt (hU.mem_nhds hxU)).differentiableAt (by simp)) + filter_upwards [hU.mem_nhds hxU] with y hy + intro hys + exact (hFe hys).trans (he ⟨hys, hy⟩).symm + _ = _ := hG + +end RPI.Boundary + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/SphericalFrankel.lean b/lean/OAI/Geometry/Perimeter/Regularity/SphericalFrankel.lean new file mode 100644 index 0000000000000000000000000000000000000000..10ce2b632a34dfd2eebb2c7ffdcdb70c21462ef0 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/SphericalFrankel.lean @@ -0,0 +1,449 @@ +import OAI.Geometry.Perimeter.Regularity.GeoComposition + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +namespace RPISingularHarnack +namespace SphericalFrankel + +abbrev Frame (n : ℕ) := Euc n × Euc n + +def IsFrame {n : ℕ} (e : Frame n) : Prop := + ‖e.1‖ = 1 ∧ ‖e.2‖ = 1 ∧ inner ℝ e.1 e.2 = 0 + +def proj {n : ℕ} (e : Frame n) (v : Euc n) : Euc n := + v - (inner ℝ e.1 v) • e.1 - (inner ℝ e.2 v) • e.2 + +def angle {n : ℕ} (e f : Frame n) : ℝ := inner ℝ e.1 f.1 + +def defect {n : ℕ} (e f : Frame n) : ℝ := ‖proj e f.1‖ ^ 2 + +def traceProduct {n : ℕ} (e f : Frame n) : ℝ := + (n : ℝ) - 4 + angle e f ^ 2 + (inner ℝ e.1 f.2) ^ 2 + + (inner ℝ e.2 f.1) ^ 2 + (inner ℝ e.2 f.2) ^ 2 + +def cross {n : ℕ} (e f : Frame n) : ℝ := inner ℝ (proj e f.1) (proj f e.1) + +lemma proj_inner_self {n : ℕ} {e : Frame n} (he : IsFrame e) (v : Euc n) : + inner ℝ (proj e v) (proj e v) = + ‖v‖ ^ 2 - (inner ℝ e.1 v) ^ 2 - (inner ℝ e.2 v) ^ 2 := by + have h11 : inner ℝ e.1 e.1 = 1 := by simp [he.1] + have h22 : inner ℝ e.2 e.2 = 1 := by simp [he.2.1] + have h21 : inner ℝ e.2 e.1 = 0 := by rw [real_inner_comm, he.2.2] + simp only [proj, inner_sub_left, inner_sub_right, inner_smul_left, inner_smul_right, + conj_trivial, h11, h22, he.2.2, h21, real_inner_self_eq_norm_sq] + rw [real_inner_comm v e.1, real_inner_comm v e.2] + ring + +lemma defect_eq {n : ℕ} {e f : Frame n} (he : IsFrame e) (hf : IsFrame f) : + defect e f = 1 - angle e f ^ 2 - (inner ℝ e.2 f.1) ^ 2 := by + rw [defect, ← real_inner_self_eq_norm_sq, proj_inner_self he, hf.1] + simp [angle] + +lemma cross_eq {n : ℕ} {e f : Frame n} (he : IsFrame e) (hf : IsFrame f) : + cross e f = angle e f * (-1 + angle e f ^ 2 + + (inner ℝ e.2 f.1) ^ 2 + (inner ℝ e.1 f.2) ^ 2) + + (inner ℝ e.2 f.1) * (inner ℝ e.1 f.2) * (inner ℝ e.2 f.2) := by + have hs : inner ℝ f.1 f.2 = 0 := hf.2.2 + have ht : inner ℝ e.2 e.1 = 0 := by rw [real_inner_comm, he.2.2] + simp only [cross, proj, inner_sub_left, inner_sub_right, inner_smul_left, + inner_smul_right, conj_trivial, hs, ht, real_inner_self_eq_norm_sq, he.1, hf.1] + dsimp [angle] + simp only [real_inner_comm f.1 e.1, real_inner_comm f.2 e.1] + ring + +lemma cross_abs_le {n : ℕ} (e f : Frame n) : + |cross e f| ≤ (defect e f + defect f e) / 2 := by + have h := abs_real_inner_le_norm (proj e f.1) (proj f e.1) + dsimp [cross, defect] + nlinarith [sq_nonneg (‖proj e f.1‖ - ‖proj f e.1‖)] + +lemma angle_abs_le_one {n : ℕ} {e f : Frame n} (he : IsFrame e) (hf : IsFrame f) : + |angle e f| ≤ 1 := by + simpa [angle, he.1, hf.1] using abs_real_inner_le_norm e.1 f.1 + +lemma traceProduct_eq {n : ℕ} {e f : Frame n} (he : IsFrame e) (hf : IsFrame f) : + traceProduct e f = (n : ℝ) - 2 - angle e f ^ 2 + + (inner ℝ e.2 f.2) ^ 2 - (defect e f + defect f e) := by + rw [traceProduct, defect_eq he hf, defect_eq hf he] + rw [real_inner_comm f.2 e.1] + have h : angle f e = angle e f := real_inner_comm _ _ + rw [h] + ring + +lemma scalar_gap_bound {c f a b d : ℝ} + (hc0 : 0 ≤ c) (hc1 : c < 1) (hf0 : 0 ≤ f) (hfc : f ≤ c) + (ha : |a| ≤ 1) (hb : |b| ≤ 1) (hd : |d| ≤ 1) + (hA : 0 ≤ 1 - f ^ 2 - a ^ 2) (hB : 0 ≤ 1 - f ^ 2 - b ^ 2) + (hcross : |f * (-1 + f ^ 2 + a ^ 2 + b ^ 2) + a * b * d| ≤ + ((1 - f ^ 2 - a ^ 2) + (1 - f ^ 2 - b ^ 2)) / 2) : + f ^ 2 - d ^ 2 ≤ 3 / (1 - c ^ 2) ^ 2 * + ((1 - f ^ 2 - a ^ 2) + (1 - f ^ 2 - b ^ 2)) := by + let s := 1 - f ^ 2 + let U := (1 - f ^ 2 - a ^ 2) + (1 - f ^ 2 - b ^ 2) + have hf1 : f < 1 := hfc.trans_lt hc1 + have hs : 0 < s := by dsimp [s]; nlinarith + have hs1 : s ≤ 1 := by dsimp [s]; nlinarith [sq_nonneg f] + have hU : 0 ≤ U := add_nonneg hA hB + have ha2 : a ^ 2 ≤ s := by dsimp [s]; linarith + have hb2 : b ^ 2 ≤ s := by dsimp [s]; linarith + have hab : a ^ 2 * b ^ 2 ≤ s ^ 2 := by + simpa [pow_two] using mul_le_mul ha2 hb2 (sq_nonneg b) hs.le + have habd : |a * b * d| ≤ 1 := by + rw [abs_mul, abs_mul] + calc + |a| * |b| * |d| ≤ 1 * 1 * 1 := + mul_le_mul (mul_le_mul ha hb (abs_nonneg b) (by norm_num)) hd + (abs_nonneg d) (by norm_num) + _ = 1 := by ring + have hfs : |f * s| ≤ 1 := by + rw [abs_of_nonneg (mul_nonneg hf0 hs.le)] + nlinarith + have hC : |f * s + a * b * d| ≤ (3 / 2 : ℝ) * U := by + have hid : f * s + a * b * d = + (f * (-1 + f ^ 2 + a ^ 2 + b ^ 2) + a * b * d) + f * U := by + dsimp [s, U]; ring + rw [hid] + calc + _ ≤ |f * (-1 + f ^ 2 + a ^ 2 + b ^ 2) + a * b * d| + |f * U| := abs_add_le _ _ + _ ≤ U / 2 + f * U := by + rw [abs_of_nonneg (mul_nonneg hf0 hU)] + change _ ≤ ((1 - f ^ 2 - a ^ 2) + (1 - f ^ 2 - b ^ 2)) / 2 + f * U + linarith + _ ≤ (3 / 2 : ℝ) * U := by nlinarith + have hD : |f * s - a * b * d| ≤ 2 := + (abs_sub _ _).trans (by linarith) + have hprod : |(f * s) ^ 2 - (a * b * d) ^ 2| ≤ 3 * U := by + have hid : (f * s) ^ 2 - (a * b * d) ^ 2 = + (f * s + a * b * d) * (f * s - a * b * d) := by ring + rw [hid, abs_mul] + calc + _ ≤ ((3 / 2 : ℝ) * U) * 2 := + mul_le_mul hC hD (abs_nonneg _) (by positivity) + _ = 3 * U := by ring + have hgap : (f ^ 2 - d ^ 2) * s ^ 2 ≤ 3 * U := by + have hmul := mul_le_mul_of_nonneg_right hab (sq_nonneg d) + have hsq := (le_abs_self ((f * s) ^ 2 - (a * b * d) ^ 2)).trans hprod + nlinarith only [hmul, hsq] + have hε : 0 < 1 - c ^ 2 := by nlinarith + have hεs : 1 - c ^ 2 ≤ s := by dsimp [s]; nlinarith + have hε2 : (1 - c ^ 2) ^ 2 ≤ s ^ 2 := by nlinarith + have hεp : 0 < (1 - c ^ 2) ^ 2 := sq_pos_of_pos hε + change f ^ 2 - d ^ 2 ≤ 3 / (1 - c ^ 2) ^ 2 * U + rw [div_mul_eq_mul_div, le_div_iff₀ hεp] + by_cases hsign : 0 ≤ f ^ 2 - d ^ 2 + · exact (mul_le_mul_of_nonneg_left hε2 hsign).trans hgap + · have hg : f ^ 2 - d ^ 2 ≤ 0 := le_of_lt (lt_of_not_ge hsign) + exact (mul_nonpos_of_nonpos_of_nonneg hg hεp.le).trans (by positivity) + +lemma traceProduct_lower_bound {n : ℕ} {e f : Frame n} + (he : IsFrame e) (hf : IsFrame f) {c : ℝ} (hc0 : 0 ≤ c) (hc1 : c < 1) + (hangle0 : 0 ≤ angle e f) (hanglec : angle e f ≤ c) : + (n : ℝ) - 2 - (1 + 3 / (1 - c ^ 2) ^ 2) * (defect e f + defect f e) ≤ + traceProduct e f := by + have ha : |inner ℝ e.2 f.1| ≤ 1 := by + simpa [he.2.1, hf.1] using abs_real_inner_le_norm e.2 f.1 + have hb : |inner ℝ e.1 f.2| ≤ 1 := by + simpa [he.1, hf.2.1] using abs_real_inner_le_norm e.1 f.2 + have hd : |inner ℝ e.2 f.2| ≤ 1 := by + simpa [he.2.1, hf.2.1] using abs_real_inner_le_norm e.2 f.2 + have hB : defect f e = 1 - angle e f ^ 2 - (inner ℝ e.1 f.2) ^ 2 := by + rw [defect_eq hf he, show angle f e = angle e f from real_inner_comm _ _, + real_inner_comm f.2 e.1] + have hg := scalar_gap_bound hc0 hc1 hangle0 hanglec ha hb hd + (show 0 ≤ 1 - angle e f ^ 2 - (inner ℝ e.2 f.1) ^ 2 by + rw [← defect_eq he hf]; exact sq_nonneg _) + (show 0 ≤ 1 - angle e f ^ 2 - (inner ℝ e.1 f.2) ^ 2 by + rw [← hB]; exact sq_nonneg _) + (show |angle e f * (-1 + angle e f ^ 2 + (inner ℝ e.2 f.1) ^ 2 + + (inner ℝ e.1 f.2) ^ 2) + (inner ℝ e.2 f.1) * (inner ℝ e.1 f.2) * + (inner ℝ e.2 f.2)| ≤ _ by + rw [← cross_eq he hf, ← defect_eq he hf, ← hB] + exact cross_abs_le e f) + rw [← defect_eq he hf, ← hB] at hg + rw [traceProduct_eq he hf] + nlinarith only [hg] + +lemma continuous_proj {n : ℕ} : Continuous (fun p : Frame n × Euc n ↦ proj p.1 p.2) := by + unfold proj + fun_prop + +lemma continuous_angle {n : ℕ} : Continuous (fun p : Frame n × Frame n ↦ angle p.1 p.2) := by + unfold angle + fun_prop + +lemma continuous_defect {n : ℕ} : Continuous (fun p : Frame n × Frame n ↦ defect p.1 p.2) := by + unfold defect proj + fun_prop + +lemma continuous_traceProduct {n : ℕ} : + Continuous (fun p : Frame n × Frame n ↦ traceProduct p.1 p.2) := by + unfold traceProduct angle + fun_prop + +lemma continuous_cross {n : ℕ} : Continuous (fun p : Frame n × Frame n ↦ cross p.1 p.2) := by + unfold cross proj + fun_prop + +lemma isClosed_frames (n : ℕ) : IsClosed {e : Frame n | IsFrame e} := by + have h1 : IsClosed {e : Frame n | ‖e.1‖ = 1} := isClosed_eq (by fun_prop) continuous_const + have h2 : IsClosed {e : Frame n | ‖e.2‖ = 1} := isClosed_eq (by fun_prop) continuous_const + have h3 : IsClosed {e : Frame n | inner ℝ e.1 e.2 = 0} := + isClosed_eq (by fun_prop) continuous_const + exact h1.inter (h2.inter h3) + +lemma isCompact_frames (n : ℕ) : IsCompact {e : Frame n | IsFrame e} := by + apply (isCompact_closedBall (0 : Frame n) 1).of_isClosed_subset (isClosed_frames n) + intro e he + simp [Metric.mem_closedBall, dist_zero_right, Prod.norm_def, he.1, he.2.1] + +lemma integrable_pairFrameFunction {n : ℕ} {μ : Measure (Frame n × Frame n)} + [IsFiniteMeasure μ] (hμ : ∀ᵐ p ∂μ, IsFrame p.1 ∧ IsFrame p.2) + {G : Frame n × Frame n → ℝ} (hG : Continuous G) : Integrable G μ := by + have hK := (isCompact_frames n).prod (isCompact_frames n) + obtain ⟨C, hC⟩ := hK.exists_bound_of_continuousOn hG.continuousOn + apply Integrable.of_bound hG.measurable.aestronglyMeasurable C + filter_upwards [hμ] with p hp + exact hC p hp + +def angularWeight (t s : ℝ) : ℝ := Real.exp (t * s) * expNegInvGlue s + +lemma angularWeight_contDiff (t : ℝ) : ContDiff ℝ ∞ (angularWeight t) := + ((contDiff_const.mul contDiff_id).exp).mul expNegInvGlue.contDiff + +lemma angularWeight_nonneg (t s : ℝ) : 0 ≤ angularWeight t s := + mul_nonneg (Real.exp_pos _).le (expNegInvGlue.nonneg _) + +lemma angularWeight_pos_iff (t s : ℝ) : 0 < angularWeight t s ↔ 0 < s := by + rw [angularWeight, mul_pos_iff_of_pos_left (Real.exp_pos _)] + constructor + · intro h + by_contra hh + rw [expNegInvGlue.zero_of_nonpos (le_of_not_gt hh)] at h + exact lt_irrefl 0 h + · exact expNegInvGlue.pos_of_pos + +lemma angularWeight_zero_of_nonpos (t : ℝ) {s : ℝ} (hs : s ≤ 0) : + angularWeight t s = 0 := by simp [angularWeight, expNegInvGlue.zero_of_nonpos hs] + +lemma angularWeight_hasDerivAt (t s : ℝ) : + HasDerivAt (angularWeight t) ((t + s⁻¹ ^ 2) * angularWeight t s) s := by + have hg : HasDerivAt expNegInvGlue (s⁻¹ ^ 2 * expNegInvGlue s) s := by + simpa using expNegInvGlue.hasDerivAt_polynomial_eval_inv_mul 1 s + have he := (((hasDerivAt_id s).const_mul t).exp).mul hg + have hid : (t + s⁻¹ ^ 2) * angularWeight t s = + Real.exp (t * id s) * (t * 1) * expNegInvGlue s + + Real.exp (t * id s) * (s⁻¹ ^ 2 * expNegInvGlue s) := by + dsimp [angularWeight] + ring + rw [hid] + exact he + +lemma angularWeight_deriv (t s : ℝ) : + deriv (angularWeight t) s = (t + s⁻¹ ^ 2) * angularWeight t s := + (angularWeight_hasDerivAt t s).deriv + +lemma angularWeight_deriv_lower (t s : ℝ) : + t * angularWeight t s ≤ deriv (angularWeight t) s := by + rw [angularWeight_deriv] + nlinarith [sq_nonneg s⁻¹, angularWeight_nonneg t s] + +lemma angularWeight_deriv_nonneg {t : ℝ} (ht : 0 ≤ t) (s : ℝ) : + 0 ≤ deriv (angularWeight t) s := + (mul_nonneg ht (angularWeight_nonneg t s)).trans (angularWeight_deriv_lower t s) + +structure CoupledStationarity {n : ℕ} (μ : Measure (Frame n × Frame n)) : Prop where + gradient : ∀ (φ : ℝ → ℝ), ContDiff ℝ ∞ φ → + (∫ p, deriv φ (angle p.1 p.2) * (defect p.1 p.2 + defect p.2 p.1) ∂μ) = + 2 * ((n : ℝ) - 2) * ∫ p, φ (angle p.1 p.2) * angle p.1 p.2 ∂μ + mixed : ∀ (φ : ℝ → ℝ), ContDiff ℝ ∞ φ → + 2 * (∫ p, φ (angle p.1 p.2) * traceProduct p.1 p.2 ∂μ) - + ((n : ℝ) - 2) * (∫ p, φ (angle p.1 p.2) * + (defect p.1 p.2 + defect p.2 p.1) ∂μ) + + 2 * (∫ p, deriv φ (angle p.1 p.2) * cross p.1 p.2 ∂μ) = 0 + +lemma continuous_defect_sum {n : ℕ} : + Continuous (fun p : Frame n × Frame n ↦ defect p.1 p.2 + defect p.2 p.1) := +by + unfold defect proj + fun_prop + +lemma angularWeight_integral_pos {n : ℕ} (hn : 2 < n) + {μ : Measure (Frame n × Frame n)} [IsFiniteMeasure μ] (hμ0 : μ ≠ 0) + (hμ : ∀ᵐ p ∂μ, IsFrame p.1 ∧ IsFrame p.2) + (hS : CoupledStationarity μ) (t : ℝ) : + 0 < ∫ p, angularWeight t (angle p.1 p.2) ∂μ := by + have hk : 0 < (n : ℝ) - 2 := by + have hh : (2 : ℝ) < n := by exact_mod_cast hn + linarith + have hiA := integrable_pairFrameFunction hμ (continuous_angle (n := n)) + have hiD := integrable_pairFrameFunction hμ (continuous_defect_sum (n := n)) + have hiT := integrable_pairFrameFunction hμ (continuous_traceProduct (n := n)) + have hiW := integrable_pairFrameFunction hμ + ((angularWeight_contDiff t).continuous.comp continuous_angle) + have hW : ∀ᵐ p ∂μ, 0 ≤ angularWeight t (angle p.1 p.2) := + Filter.Eventually.of_forall fun p ↦ angularWeight_nonneg t _ + by_contra hpos + have hz : (∫ p, angularWeight t (angle p.1 p.2) ∂μ) = 0 := + le_antisymm (le_of_not_gt hpos) (integral_nonneg_of_ae hW) + have heq := (integral_eq_zero_iff_of_nonneg_ae hW hiW).mp hz + have hAnonpos : ∀ᵐ p ∂μ, angle p.1 p.2 ≤ 0 := by + filter_upwards [heq] with p hp + by_contra hh + have h := (angularWeight_pos_iff t _).mpr (lt_of_not_ge hh) + simp [hp] at h + have hA : (∫ p, angle p.1 p.2 ∂μ) = 0 := by + have h := hS.gradient (fun _ ↦ 1) contDiff_const + simp only [deriv_const, zero_mul, integral_zero, one_mul] at h + nlinarith + have hAzero : ∀ᵐ p ∂μ, angle p.1 p.2 = 0 := by + have hh : (∫ p, -(angle p.1 p.2) ∂μ) = 0 := by rw [integral_neg, hA, neg_zero] + have he := (integral_eq_zero_iff_of_nonneg_ae + (hAnonpos.mono (fun p hp ↦ neg_nonneg.mpr hp)) hiA.neg).mp hh + filter_upwards [he] with p hp + exact neg_eq_zero.mp hp + have hD : (∫ p, defect p.1 p.2 + defect p.2 p.1 ∂μ) = 0 := by + have h := hS.gradient id contDiff_id + simp only [id_eq] at h + rw [show (∫ p, angle p.1 p.2 * angle p.1 p.2 ∂μ) = 0 by + calc + _ = ∫ _ : Frame n × Frame n, (0 : ℝ) ∂μ := + integral_congr_ae (hAzero.mono (fun p hp ↦ by simp [hp])) + _ = 0 := integral_zero _ _] at h + simpa using h + have hT : (∫ p, traceProduct p.1 p.2 ∂μ) = 0 := by + have h := hS.mixed (fun _ ↦ 1) contDiff_const + simp only [deriv_const, zero_mul, integral_zero, one_mul, hD] at h + linarith + have hlower : ∀ᵐ p ∂μ, (n : ℝ) - 2 ≤ + traceProduct p.1 p.2 + (defect p.1 p.2 + defect p.2 p.1) := by + filter_upwards [hμ, hAzero] with p hp ha + rw [traceProduct_eq hp.1 hp.2, ha] + nlinarith [sq_nonneg (inner ℝ p.1.2 p.2.2)] + have hle := integral_mono_ae (integrable_const ((n : ℝ) - 2)) (hiT.add hiD) hlower + change (∫ _ : Frame n × Frame n, (n : ℝ) - 2 ∂μ) ≤ + ∫ p, traceProduct p.1 p.2 + (defect p.1 p.2 + defect p.2 p.1) ∂μ at hle + rw [integral_add hiT hiD, hT, hD, add_zero, integral_const, smul_eq_mul] at hle + have hmass : 0 < μ.real univ := by + apply ENNReal.toReal_pos _ (measure_ne_top _ _) + intro hm + exact hμ0 (Measure.measure_univ_eq_zero.mp hm) + nlinarith + +lemma weighted_trace_lower_bound {n : ℕ} {e f : Frame n} + (he : IsFrame e) (hf : IsFrame f) {c : ℝ} (hc0 : 0 ≤ c) (hc1 : c < 1) + (hfc : angle e f ≤ c) (t : ℝ) : + ((n : ℝ) - 2) * angularWeight t (angle e f) - + (1 + 3 / (1 - c ^ 2) ^ 2) * + (angularWeight t (angle e f) * (defect e f + defect f e)) ≤ + angularWeight t (angle e f) * traceProduct e f := by + by_cases ha : 0 ≤ angle e f + · have h := mul_le_mul_of_nonneg_left + (traceProduct_lower_bound he hf hc0 hc1 ha hfc) + (angularWeight_nonneg t (angle e f)) + nlinarith + · rw [angularWeight_zero_of_nonpos t (le_of_lt (lt_of_not_ge ha))] + ring_nf + exact le_rfl + +theorem no_positive_angle_gap {n : ℕ} (hn : 2 < n) + {μ : Measure (Frame n × Frame n)} [IsFiniteMeasure μ] (hμ0 : μ ≠ 0) + (hμ : ∀ᵐ p ∂μ, IsFrame p.1 ∧ IsFrame p.2) + (hS : CoupledStationarity μ) {c : ℝ} (hc0 : 0 ≤ c) (hc1 : c < 1) + (hc : ∀ᵐ p ∂μ, angle p.1 p.2 ≤ c) : False := by + let k : ℝ := n - 2 + let C : ℝ := 1 + 3 / (1 - c ^ 2) ^ 2 + have hk : 0 < k := by + have hh : (2 : ℝ) < n := by exact_mod_cast hn + dsimp [k]; linarith + have hC : 0 < C := by dsimp [C]; positivity + let t : ℝ := 2 * c * (C + k / 2) / (1 - c) + 1 + have ht : 0 < t := by dsimp [t]; positivity + have hcoef : 2 * k * c * (C + k / 2) < t * k * (1 - c) := by + have hden : 1 - c ≠ 0 := ne_of_gt (sub_pos.mpr hc1) + dsimp [t] + field_simp + nlinarith + let W : Frame n × Frame n → ℝ := fun p ↦ angularWeight t (angle p.1 p.2) + let D : Frame n × Frame n → ℝ := fun p ↦ defect p.1 p.2 + defect p.2 p.1 + let dW : Frame n × Frame n → ℝ := fun p ↦ deriv (angularWeight t) (angle p.1 p.2) + have hW : Continuous W := (angularWeight_contDiff t).continuous.comp continuous_angle + have hdW : Continuous dW := + ((angularWeight_contDiff t).continuous_deriv (by simp)).comp continuous_angle + have hD : Continuous D := continuous_defect_sum + have hiW := integrable_pairFrameFunction hμ hW + have hiWD := integrable_pairFrameFunction hμ (hW.mul hD) + have hiWA := integrable_pairFrameFunction hμ (hW.mul continuous_angle) + have hiWT := integrable_pairFrameFunction hμ (hW.mul continuous_traceProduct) + have hidWD := integrable_pairFrameFunction hμ (hdW.mul hD) + have hidWC := integrable_pairFrameFunction hμ (hdW.mul continuous_cross) + have hWnn (p : Frame n × Frame n) : 0 ≤ W p := angularWeight_nonneg _ _ + have hDnn (p : Frame n × Frame n) : 0 ≤ D p := + add_nonneg (sq_nonneg _) (sq_nonneg _) + have hdWnn (p : Frame n × Frame n) : 0 ≤ dW p := angularWeight_deriv_nonneg ht.le _ + let J : ℝ := ∫ p, W p ∂μ + let B : ℝ := ∫ p, W p * D p ∂μ + let A : ℝ := ∫ p, W p * angle p.1 p.2 ∂μ + let T : ℝ := ∫ p, W p * traceProduct p.1 p.2 ∂μ + let Q : ℝ := ∫ p, dW p * cross p.1 p.2 ∂μ + have hJ : 0 < J := angularWeight_integral_pos hn hμ0 hμ hS t + have hgrad : (∫ p, dW p * D p ∂μ) = 2 * k * A := + hS.gradient _ (angularWeight_contDiff t) + have hmixed : 2 * T - k * B + 2 * Q = 0 := + hS.mixed _ (angularWeight_contDiff t) + have hA : A ≤ c * J := by + have hp : ∀ᵐ p ∂μ, W p * angle p.1 p.2 ≤ c * W p := by + filter_upwards [hc] with p hp + nlinarith [mul_le_mul_of_nonneg_left hp (hWnn p)] + have h := integral_mono_ae hiWA (hiW.const_mul c) hp + simpa only [Pi.mul_apply, integral_const_mul] using h + have hB : t * B ≤ 2 * k * A := by + have hp : ∀ᵐ p ∂μ, t * (W p * D p) ≤ dW p * D p := + Filter.Eventually.of_forall fun p ↦ by + have h := mul_le_mul_of_nonneg_right (angularWeight_deriv_lower t (angle p.1 p.2)) (hDnn p) + simpa only [mul_assoc] using h + have h := integral_mono_ae (hiWD.const_mul t) hidWD hp + simpa only [Pi.mul_apply, integral_const_mul, hgrad] using h + have hQ : -(k * A) ≤ Q := by + have hp : ∀ᵐ p ∂μ, (-1 / 2 : ℝ) * (dW p * D p) ≤ dW p * cross p.1 p.2 := + Filter.Eventually.of_forall fun p ↦ by + have h := (abs_le.mp (cross_abs_le p.1 p.2)).1 + have hm := mul_le_mul_of_nonneg_left h (hdWnn p) + dsimp [D] at * + nlinarith + have h := integral_mono_ae (hidWD.const_mul (-1 / 2)) hidWC hp + simp only [Pi.mul_apply] at h + rw [integral_const_mul, hgrad] at h + dsimp [Q] + linarith + have hT : k * J - C * B ≤ T := by + have hp : ∀ᵐ p ∂μ, k * W p - C * (W p * D p) ≤ W p * traceProduct p.1 p.2 := by + filter_upwards [hμ, hc] with p hp hpc + exact weighted_trace_lower_bound hp.1 hp.2 hc0 hc1 hpc t + have h := integral_mono_ae ((hiW.const_mul k).sub (hiWD.const_mul C)) hiWT hp + simp only [Pi.mul_apply, Pi.sub_apply] at h + have hiCB : Integrable (fun p ↦ C * (W p * D p)) μ := by + simpa only [Pi.mul_apply] using hiWD.const_mul C + rw [integral_sub (hiW.const_mul k) hiCB, integral_const_mul, + integral_const_mul] at h + exact h + have hmain : k * (1 - c) * J ≤ (C + k / 2) * B := by + have hu : T ≤ k / 2 * B + k * A := by linarith + have hf := mul_le_mul_of_nonneg_left hA hk.le + nlinarith + have hB' : t * B ≤ 2 * k * c * J := by + have h := mul_le_mul_of_nonneg_left hA (by positivity : 0 ≤ 2 * k) + nlinarith + have h1 := mul_le_mul_of_nonneg_left hmain ht.le + have h2 := mul_le_mul_of_nonneg_left hB' (by positivity : 0 ≤ C + k / 2) + have h3 := mul_lt_mul_of_pos_right hcoef hJ + nlinarith + +end SphericalFrankel +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/SupportAffineEstimate.lean b/lean/OAI/Geometry/Perimeter/Regularity/SupportAffineEstimate.lean new file mode 100644 index 0000000000000000000000000000000000000000..7193dfb63e5622cf08458cebe46c71fe88851c3e --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/SupportAffineEstimate.lean @@ -0,0 +1,141 @@ +import OAI.Geometry.Perimeter.Regularity.QuadraticMoment + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +open RPI.Boundary ContinuousLinearMap +variable {n : ℕ} + +theorem normalWindowQuadratic_integrableOn {E : Set (Euc n)} + (hmin : IsLocallyPerimeterMinimizing E) (v : Euc n) {φ w : normalPlane v → ℝ} + (hφ : Continuous φ) (hcφ : HasCompactSupport φ) (hw : Continuous w) + {a b R : ℝ} (hb : 0≤b) (hR : 0] 0) (𝓝 0) := by + simpa using (((tendsto_id : Tendsto (fun r : ℝ ↦ r) (𝓝 0) (𝓝 0)).pow 4).const_mul M).mono_left nhdsWithin_le_nhds + have hzero : b^2≤0 := le_of_tendsto_of_tendsto tendsto_const_nhds ht (by + filter_upwards [self_mem_nhdsWithin,nhdsWithin_le_nhds (gt_mem_nhds hδ)] with r hr hrδ + exact hb r hr hrδ) + nlinarith [sq_nonneg b] + +theorem exists_full_support_improvement_constant (n : ℕ) (hn : 1.add_const ((8*D*r^2)^2*(G*r^(n-1)))).const_mul (C/r^(n-1)) + have h := le_of_tendsto_of_tendsto' tendsto_const_nhds ht he + have heq : C/r^(n-1)*((8*D*r^2)^2*(G*r^(n-1)))=(64*C*D^2*G)*r^4 := by + field_simp [ne_of_gt hr] + ring + rw [heq] at h + exact h + refine ⟨hb,fun r hr hrb ↦ ?_⟩ + have hsmall : ∀ᶠ i in atTop, Q i.ne + have hmeas : ∀ j, AEMeasurable (fun x ↦ ENNReal.ofReal (‖F j x - G x‖ ^ 2)) μ := by + intro j + exact (((hF j).aestronglyMeasurable.sub hG.aestronglyMeasurable).norm.pow 2).aemeasurable.ennreal_ofReal + have hlim := tendsto_lintegral_of_dominated_convergence' (μ := μ) + (fun x ↦ ENNReal.ofReal (‖G x‖ ^ 2)) (f := fun _ ↦ (0 : ℝ≥0∞)) + (F := fun j x ↦ ENNReal.ofReal (‖F j x - G x‖ ^ 2)) hmeas ?_ hfin ?_ + · simpa only [vectorEnergy, Pi.sub_apply, lintegral_zero] using hlim + · intro j + apply ae_of_all + intro x + apply ENNReal.ofReal_le_ofReal + apply (sq_le_sq₀ (norm_nonneg _) (norm_nonneg _)).mpr + have he : F j x - G x = (truncationSlope (truncationParameter j) (W x) - 1) • G x := by + rw [sub_smul, one_smul] + rw [he, norm_smul, Real.norm_eq_abs, + abs_of_nonpos (sub_nonpos.mpr (truncationSlope_mem_Icc _ _).2)] + exact mul_le_of_le_one_left (norm_nonneg _) (by linarith [(truncationSlope_mem_Icc (truncationParameter j) (W x)).1]) + · apply ae_of_all + intro x + have ht : Tendsto (fun j ↦ F j x) atTop (𝓝 (G x)) := by + have ht := (truncationSlope_tendsto (W x)).smul_const (G x) + by_cases hx : W x < 1 + · simpa only [ite_eq_left hx, one_smul] using ht + · simpa only [F, G, truncatedGradient, ite_eq_right hx, smul_zero] using ht + have ht' : Tendsto (fun j ↦ F j x - G x) atTop (𝓝 (0 : Space n)) := by + simpa only [sub_self] using ht.sub_const (G x) + simpa only [norm_zero, zero_pow (by norm_num : (2 : ℕ) ≠ 0), ENNReal.ofReal_zero] using + ENNReal.tendsto_ofReal (ht'.norm.pow 2) + +theorem smoothTruncation_pair_tendsto {n : ℕ} {μ : Measure (Space n)} + [IsFiniteMeasure μ] {W : Space n → ℝ} {D : Space n → Space n} + (hW : AEStronglyMeasurable W μ) (hW0 : ∀ᵐ x ∂μ, 0 ≤ W x) + (hG : MemLp (truncatedGradient W D) 2 μ) : + ∃ (hh : MemLp (fun x ↦ min (W x) 1) 2 μ) + (hf : ∀ j, MemLp (fun x ↦ smoothTruncation (truncationParameter j) (W x)) 2 μ) + (hF : ∀ j, MemLp (fun x ↦ truncationSlope (truncationParameter j) (W x) • + truncatedGradient W D x) 2 μ), + Tendsto (fun j ↦ ((hf j).toLp (fun x ↦ smoothTruncation (truncationParameter j) (W x)), + (hF j).toLp (fun x ↦ truncationSlope (truncationParameter j) (W x) • + truncatedGradient W D x))) atTop + (𝓝 (hh.toLp (fun x ↦ min (W x) 1), hG.toLp (truncatedGradient W D))) := by + let hh := min_one_memLp hW hW0 + let hf := fun j ↦ smoothTruncation_memLp hW hW0 (truncationParameter_pos j) + let hF := fun j ↦ truncationGradient_memLp hW hG (truncationParameter j) + refine ⟨hh, hf, hF, ?_⟩ + apply Filter.Tendsto.prodMk_nhds + · apply (Lp.tendsto_Lp_iff_tendsto_eLpNorm'' _ hf _ hh).mpr + exact tendsto_eLpNorm_two_of_vectorEnergy_zero_of_aestronglyMeasurable + (fun index ↦ ((hf index).sub hh).aestronglyMeasurable) + (smoothTruncation_error_energy_tendsto hW hW0) + · apply (Lp.tendsto_Lp_iff_tendsto_eLpNorm'' _ hF _ hG).mpr + exact tendsto_eLpNorm_two_of_vectorEnergy_zero_of_aestronglyMeasurable + (fun index ↦ ((hF index).sub hG).aestronglyMeasurable) + (truncationGradient_error_energy_tendsto hW hG) + +end RPI.Boundary + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPI.Boundary + +theorem surfaceGradient_eq_tangentialGradient_filled {n : ℕ} {E S : Set (Space n)} + (hE : MeasurableSet E) {f g : Space n → ℝ} {x : Space n} + (hf : ContDiffAt ℝ 1 f x) (hfx : f x = 0) (hdf : fderiv ℝ f x ≠ 0) + (hlevel : ∀ᶠ y in 𝓝 x, y ∈ S ↔ f y = 0) + (hfilled : ∀ᶠ y in 𝓝 x, (f y < 0 → y ∈ E) ∧ (y ∈ E → f y ≤ 0)) : + surfaceGradient S g x = RPISingularHarnack.tangentialGradient E g x := by + have hgrad : gradient f x ≠ 0 := by + intro he + apply hdf + rw [← toDual_gradient, he, map_zero] + have hn : ‖gradient f x‖ ≠ 0 := norm_ne_zero_iff.mpr hgrad + rw [surfaceGradient_eq_level_formula hf hdf (by simpa only [hfx] using hlevel), + RPISingularHarnack.tangentialGradient, + RPISingularHarnack.approximateNormal_eq_gradient_filled hE + (hf.differentiableAt (by norm_num)) hfx hdf hfilled, + real_inner_smul_right, smul_smul, real_inner_comm (gradient f x) (gradient g x)] + congr 2 + field_simp + +end RPI.Boundary + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPI.Boundary + +theorem surfaceGradient_ae_eq_tangentialGradient_filled {n : ℕ} (hn : 8 ≤ n) + {E S Z : Set (Space n)} (hE : MeasurableSet E) (hS : MeasurableSet S) + (hZd : dimH Z ≤ (n - 8 : ℕ)) + (hreg : ∀ x ∈ S \ Z, ∃ f : Space n → ℝ, + ContDiffAt ℝ 1 f x ∧ f x = 0 ∧ fderiv ℝ f x ≠ 0 ∧ + (∀ᶠ y in 𝓝 x, y ∈ S ↔ f y = 0) ∧ + (∀ᶠ y in 𝓝 x, (f y < 0 → y ∈ E) ∧ (y ∈ E → f y ≤ 0))) (g : Space n → ℝ) : + surfaceGradient S g =ᵐ[surfaceMeasure S] + RPISingularHarnack.tangentialGradient E g := by + have hz : ∀ᵐ x ∂surfaceMeasure S, x ∉ Z := by + simpa only [ae_iff, not_not, Set.ofPred_mem_eq] using + surfaceMeasure_zero_of_singular_dim hn S Z hZd + filter_upwards [ae_restrict_mem hS, hz] with x hx hzx + obtain ⟨f, hf, hfx, hdf, hlevel, hfilled⟩ := hreg x ⟨hx, hzx⟩ + exact surfaceGradient_eq_tangentialGradient_filled hE hf hfx hdf hlevel hfilled + +end RPI.Boundary + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem wholeBoundarySobolev_of_local_sobolevGraph_filled {n : ℕ} (hn : 8 ≤ n) + {E Z : Set (Euc n)} (hE : MeasurableSet E) + (hS : MeasurableSet (perimeterSupport E)) (hZd : dimH Z ≤ (n - 8 : ℕ)) + (hreg : ∀ x ∈ perimeterSupport E \ Z, ∃ f : Euc n → ℝ, + ContDiffAt ℝ 1 f x ∧ f x = 0 ∧ fderiv ℝ f x ≠ 0 ∧ + (∀ᶠ y in 𝓝 x, y ∈ perimeterSupport E ↔ f y = 0) ∧ + (∀ᶠ y in 𝓝 x, (f y < 0 → y ∈ E) ∧ (y ∈ E → f y ≤ 0))) + {h : Euc n → ℝ} {G : Euc n → Euc n} + (hgraph : ∀ R : ℝ, 0 < R → + ∃ (hh : MemLp h 2 ((RPI.Boundary.surfaceMeasure (perimeterSupport E)).restrict + (Metric.ball 0 R))) + (hG : MemLp G 2 ((RPI.Boundary.surfaceMeasure (perimeterSupport E)).restrict + (Metric.ball 0 R))), + (hh.toLp h, hG.toLp G) ∈ closure + (RPI.Boundary.smoothGradientGraph (perimeterSupport E) (Metric.ball 0 R))) : + WholeBoundarySobolev E h G := by + intro R hR + obtain ⟨hh, hG, hpair⟩ := hgraph R hR + obtain ⟨φ, hφ, hlim, hDlim⟩ := + RPI.Boundary.exists_compact_energy_approximants_of_mem_sobolevGraph + (perimeterSupport E) (Metric.ball 0 R) Metric.isBounded_ball + measurableSet_ball hh hG hpair + dsimp only + rw [boundaryArea_eq_smul_surfaceMeasure, Measure.restrict_smul] + refine ⟨hh.smul_measure (hausdorffNormalizationRatio_ne_top _), + hG.smul_measure (hausdorffNormalizationRatio_ne_top _), φ, hφ, ?_, ?_⟩ + · simp_rw [lintegral_smul_measure, smul_eq_mul] + simpa only [mul_zero] using ENNReal.Tendsto.const_mul hlim + (Or.inr (hausdorffNormalizationRatio_ne_top (n - 1))) + · have heq : ∀ j, RPI.Boundary.surfaceGradient (perimeterSupport E) (φ j) + =ᵐ[(RPI.Boundary.surfaceMeasure (perimeterSupport E)).restrict (Metric.ball 0 R)] + tangentialGradient E (φ j) := fun j ↦ + (RPI.Boundary.surfaceGradient_ae_eq_tangentialGradient_filled hn hE hS hZd hreg (φ j)).filter_mono + (ae_mono Measure.restrict_le_self) + have hl : Tendsto (fun j ↦ ∫⁻ x, + ENNReal.ofReal (‖tangentialGradient E (φ j) x - G x‖ ^ 2) + ∂(RPI.Boundary.surfaceMeasure (perimeterSupport E)).restrict (Metric.ball 0 R)) + atTop (𝓝 0) := by + apply hDlim.congr + intro j + apply lintegral_congr_ae + filter_upwards [heq j] with x hx + rw [hx] + simp_rw [lintegral_smul_measure, smul_eq_mul] + simpa only [mul_zero] using ENNReal.Tendsto.const_mul hl + (Or.inr (hausdorffNormalizationRatio_ne_top (n - 1))) + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPI.Boundary + +theorem HasSmoothTraceJetAt.mul_smooth {n : ℕ} {S : Set (Space n)} + {h : Space n → ℝ} {G : Space n → Space n} {x : Space n} + (hxS : x ∈ S) (hx : HasSmoothTraceJetAt S h G x) + {ψ : Space n → ℝ} (hψ : ContDiff ℝ ∞ ψ) : + HasSmoothTraceJetAt S (fun y ↦ ψ y * h y) + (fun y ↦ ψ y • G y + h y • surfaceGradient S ψ y) x := by + obtain ⟨U, hU, hxU, f, hf, he, hG⟩ := hx + refine ⟨U, hU, hxU, fun y ↦ ψ y * f y, hψ.contDiffOn.mul hf, ?_, ?_⟩ + · intro y hy + exact congrArg (fun a ↦ ψ y * a) (he hy) + · rw [surfaceGradient_mul (hψ.differentiable (by simp) x) + ((hf.contDiffAt (hU.mem_nhds hxU)).differentiableAt (by simp)), + hG, he ⟨hxS, hxU⟩] + +theorem regular_trace_jet_mul_spatial {n : ℕ} {S Z : Set (Space n)} + {h : Space n → ℝ} {G : Space n → Space n} + (hreg : ∀ x ∈ S \ Z, HasSmoothTraceJetAt S h G x) + {ψ : Space n → ℝ} (hψ : ContDiff ℝ ∞ ψ) : + ∀ x ∈ S \ (Z ∩ tsupport ψ), HasSmoothTraceJetAt S (fun y ↦ ψ y * h y) + (fun y ↦ ψ y • G y + h y • surfaceGradient S ψ y) x := by + intro x hx + by_cases hxZ : x ∈ Z + · have hxs : x ∉ tsupport ψ := fun hxψ ↦ hx.2 ⟨hxZ, hxψ⟩ + have hloc : ψ =ᶠ[𝓝 x] (0 : Space n → ℝ) := + notMem_tsupport_iff_eventuallyEq.mp hxs + obtain ⟨U, hUsub, hU, hxU⟩ := mem_nhds_iff.mp hloc + have hψgrad : gradient ψ x = 0 := by + simpa only [Pi.zero_def, gradient_fun_const] using hloc.gradient_eq + have hψx : ψ x = 0 := hloc.self_of_nhds + refine ⟨U, hU, hxU, fun _ ↦ 0, contDiffOn_const, ?_, ?_⟩ + · intro y hy + have hy0 : ψ y = 0 := hUsub hy.2 + simp only [hy0, zero_mul] + · simp only [hψx, surfaceGradient, hψgrad, gradient_fun_const, + map_zero, Submodule.coe_zero, zero_smul, smul_zero, add_zero] + · exact (hreg x ⟨hx.1, hxZ⟩).mul_smooth hx.1 hψ + +theorem hausdorff_trace_mem_sobolevGraph_ball {n : ℕ} (hn : 8 ≤ n) + {S Z : Set (Space n)} (hS : IsClosed S) (hZ : IsClosed Z) + (hZd : dimH Z ≤ (n - 8 : ℕ)) {R : ℝ} (hR : 0 < R) + {h : Space n → ℝ} {G : Space n → Space n} + (hreg : ∀ x ∈ S \ Z, HasSmoothTraceJetAt S h G x) + (hh : MemLp h 2 ((surfaceMeasure S).restrict (Metric.ball 0 R))) + (hG : MemLp G 2 ((surfaceMeasure S).restrict (Metric.ball 0 R))) + {M : ℝ} (hM : 0 ≤ M) + (hbound : ∀ᵐ x ∂(surfaceMeasure S).restrict (Metric.ball 0 R), ‖h x‖ ≤ M) + (hgrad : ∀ f : Space n → ℝ, ContDiff ℝ ∞ f → + AEStronglyMeasurable (surfaceGradient S f) + ((surfaceMeasure S).restrict (Metric.ball 0 R))) + {A r₀ : ℝ} (hA : 0 < A) (hr₀ : 0 < r₀) + (hgrowth : ∀ c ∈ Z ∩ Metric.closedBall 0 (R + 2), ∀ r : ℝ, 0 < r → r < r₀ → + (surfaceMeasure S).restrict (Metric.ball 0 R) (Metric.ball c r) ≤ + ENNReal.ofReal (A * r ^ (n - 1))) : + (hh.toLp h, hG.toLp G) ∈ closure (smoothGradientGraph S (Metric.ball 0 R)) := by + let b : ContDiffBump (0 : Space n) := ⟨R + 1, R + 2, by linarith, by linarith⟩ + let K : Set (Space n) := Z ∩ tsupport b + have hKc : IsCompact K := b.hasCompactSupport.of_isClosed_subset + (hZ.inter (isClosed_tsupport b)) inter_subset_right + have hKd : dimH K ≤ (n - 8 : ℕ) := + (dimH_mono (show K ⊆ Z from inter_subset_left)).trans hZd + have hb : ∀ x ∈ Metric.ball (0 : Space n) R, b =ᶠ[𝓝 x] 1 := by + intro x hx + apply b.eventuallyEq_one_of_mem_ball + exact Metric.mem_ball.mpr ((Metric.mem_ball.mp hx).trans (by dsimp [b]; linarith)) + have hbG : ∀ x ∈ Metric.ball (0 : Space n) R, surfaceGradient S b x = 0 := by + intro x hx + have hgr : gradient b x = 0 := by + simpa only [Pi.one_def, gradient_fun_const] using (hb x hx).gradient_eq + simp only [surfaceGradient, hgr, map_zero, Submodule.coe_zero] + let h' := fun x ↦ b x * h x + let G' := fun x ↦ b x • G x + h x • surfaceGradient S b x + have he : h' =ᵐ[(surfaceMeasure S).restrict (Metric.ball 0 R)] h := by + filter_upwards [ae_restrict_mem measurableSet_ball] with x hx + dsimp [h'] + rw [(hb x hx).self_of_nhds] + simp + have hDe : G' =ᵐ[(surfaceMeasure S).restrict (Metric.ball 0 R)] G := by + filter_upwards [ae_restrict_mem measurableSet_ball] with x hx + dsimp [G'] + rw [(hb x hx).self_of_nhds, hbG x hx] + simp + let hh' := hh.ae_eq he.symm + let hG' := hG.ae_eq hDe.symm + have hbound' : ∀ᵐ x ∂(surfaceMeasure S).restrict (Metric.ball 0 R), ‖h' x‖ ≤ M := by + filter_upwards [he, hbound] with x hx hbx + simpa only [hx] using hbx + have hmem := hausdorff_trace_mem_sobolevGraph hn hS (Metric.ball 0 R) hKc hKd + (regular_trace_jet_mul_spatial hreg b.contDiff) hh' hG' hM + hbound' hgrad hA hr₀ (fun c hc r hr hrr ↦ hgrowth c + ⟨hc.1, by simpa only [b.tsupport_eq] using hc.2⟩ r hr hrr) + have heLp : hh'.toLp h' = hh.toLp h := hh'.toLp_congr hh he + have hDeLp : hG'.toLp G' = hG.toLp G := hG'.toLp_congr hG hDe + change (hh'.toLp h', hG'.toLp G') ∈ _ at hmem + simpa only [heLp, hDeLp] using hmem + +end RPI.Boundary + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPI.Boundary + +theorem trace_aestronglyMeasurable_of_singular_dim {n : ℕ} (hn : 8 ≤ n) + {S Z : Set (Space n)} (hS : MeasurableSet S) (hZ : MeasurableSet Z) + (hdim : dimH Z ≤ (n - 8 : ℕ)) {h : Space n → ℝ} {G : Space n → Space n} + (hreg : ∀ x ∈ S \ Z, HasSmoothTraceJetAt S h G x) : + AEStronglyMeasurable h (surfaceMeasure S) := by + have hc : ContinuousOn h (S \ Z) := by + intro x hx + obtain ⟨U, hU, hxU, f, hf, he, _⟩ := hreg x hx + have hf' : ContinuousWithinAt f (S \ Z) x := + (hf.contDiffAt (hU.mem_nhds hxU)).continuousAt.continuousWithinAt + apply hf'.congr_of_eventuallyEq _ (he ⟨hx.1, hxU⟩).symm + filter_upwards [self_mem_nhdsWithin, + mem_nhdsWithin_of_mem_nhds (hU.mem_nhds hxU)] with y hy hyU + exact (he ⟨hy.1, hyU⟩).symm + have hs : ∀ᵐ x ∂surfaceMeasure S, x ∈ S := ae_restrict_mem hS + have hz : ∀ᵐ x ∂surfaceMeasure S, x ∉ Z := by + simpa only [ae_iff, not_not, Set.ofPred_mem_eq] using + surfaceMeasure_zero_of_singular_dim hn S Z hdim + have hregular : ∀ᵐ x ∂surfaceMeasure S, x ∈ S \ Z := by + filter_upwards [hs, hz] with x hx hzx + exact ⟨hx, hzx⟩ + have hmeas := hc.aestronglyMeasurable (μ := surfaceMeasure S) (hS.diff hZ) + rwa [Measure.restrict_eq_self_of_ae_mem hregular] at hmeas + +theorem min_one_mem_sobolevGraph_ball {n : ℕ} (hn : 8 ≤ n) + {S Z : Set (Space n)} (hS : IsClosed S) (hZ : IsClosed Z) + (hZd : dimH Z ≤ (n - 8 : ℕ)) {R : ℝ} (hR : 0 < R) + [IsFiniteMeasure ((surfaceMeasure S).restrict (Metric.ball 0 R))] + {W : Space n → ℝ} {D : Space n → Space n} + (htrace : ∀ x ∈ S \ Z, HasSmoothTraceJetAt S W D x) + (hW0 : ∀ᵐ x ∂(surfaceMeasure S).restrict (Metric.ball 0 R), 0 ≤ W x) + (hG : MemLp (truncatedGradient W D) 2 + ((surfaceMeasure S).restrict (Metric.ball 0 R))) + (hgrad : ∀ f : Space n → ℝ, ContDiff ℝ ∞ f → + AEStronglyMeasurable (surfaceGradient S f) + ((surfaceMeasure S).restrict (Metric.ball 0 R))) + {A r₀ : ℝ} (hA : 0 < A) (hr₀ : 0 < r₀) + (hgrowth : ∀ c ∈ Z ∩ Metric.closedBall 0 (R + 2), ∀ r : ℝ, 0 < r → r < r₀ → + (surfaceMeasure S).restrict (Metric.ball 0 R) (Metric.ball c r) ≤ + ENNReal.ofReal (A * r ^ (n - 1))) : + ∃ hh : MemLp (fun x ↦ min (W x) 1) 2 + ((surfaceMeasure S).restrict (Metric.ball 0 R)), + (hh.toLp (fun x ↦ min (W x) 1), hG.toLp (truncatedGradient W D)) ∈ + closure (smoothGradientGraph S (Metric.ball 0 R)) := by + have hW : AEStronglyMeasurable W ((surfaceMeasure S).restrict (Metric.ball 0 R)) := + (trace_aestronglyMeasurable_of_singular_dim hn hS.measurableSet + hZ.measurableSet hZd htrace).mono_measure (Measure.restrict_le_self) + obtain ⟨hh, hf, hF, hlim⟩ := smoothTruncation_pair_tendsto hW hW0 hG + refine ⟨hh, isClosed_closure.mem_of_tendsto hlim (Filter.Eventually.of_forall ?_)⟩ + intro j + apply hausdorff_trace_mem_sobolevGraph_ball hn hS hZ hZd hR + (fun x hx ↦ (htrace x hx).smoothTruncation hx.1 (truncationParameter_pos j)) + (hf j) (hF j) (M := 1) zero_le_one _ hgrad hA hr₀ hgrowth + filter_upwards [hW0] with x hx + exact smoothTruncation_norm_le (truncationParameter_pos j) hx + +end RPI.Boundary + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/SurfaceGradientConstSub.lean b/lean/OAI/Geometry/Perimeter/Regularity/SurfaceGradientConstSub.lean new file mode 100644 index 0000000000000000000000000000000000000000..49199edf755b720a39e12ac800e938342cb6258b --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/SurfaceGradientConstSub.lean @@ -0,0 +1,510 @@ +import OAI.Geometry.Perimeter.Regularity.IntegralInnerEqInnerToLp + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPI.Boundary + +theorem surfaceGradient_const_sub {n : ℕ} (S : Set (Space n)) {f : Space n → ℝ} + {x : Space n} (c : ℝ) : + surfaceGradient S (fun y ↦ c - f y) x = -surfaceGradient S f x := by + have hg : gradient (fun y ↦ c - f y) x = -gradient f x := by + apply (InnerProductSpace.toDual ℝ (Space n)).injective + simp only [map_neg, toDual_gradient] + exact fderiv_const_sub c + simp only [surfaceGradient, hg, map_neg, Submodule.coe_neg] + +section RegularEnergy +variable {n : ℕ} {S Z : Set (Space n)} +variable (hS : IsClosed S) (hZ : IsClosed Z) +variable (hfinite : ∀ R : ℝ, 0 < R → (surfaceMeasure S) (Metric.ball 0 R) < ⊤) +variable (hgrad : ∀ f : Space n → ℝ, ContDiff ℝ ∞ f → + AEStronglyMeasurable (surfaceGradient S f) (surfaceMeasure S)) +include hS hZ hfinite hgrad + +theorem regular_gradient_memLp_test {W : Space n → ℝ} {D : Space n → Space n} + (htrace : ∀ x ∈ S \ Z, HasSmoothTraceJetAt S W D x) + {η : Space n → ℝ} (hη : ContDiff ℝ ∞ η) (hcη : HasCompactSupport η) + (hηZ : Disjoint (tsupport η) Z) : + MemLp (fun x ↦ η x • D x) 2 (surfaceMeasure S) := by + have hi := regular_gradient_memLp_indicator_test hS hZ hfinite hgrad htrace hcη hηZ + obtain ⟨M, hM⟩ := hcη.exists_bound_of_continuous hη.continuous + have hh : MemLp (fun x ↦ η x • (tsupport η).indicator D x) 2 (surfaceMeasure S) := by + apply hi.of_le_mul (c := M) (hη.continuous.aestronglyMeasurable.smul hi.aestronglyMeasurable) + apply ae_of_all + intro x + change ‖η x • (tsupport η).indicator D x‖ ≤ M * ‖(tsupport η).indicator D x‖ + rw [norm_smul] + exact mul_le_mul_of_nonneg_right (hM x) (norm_nonneg _) + apply hh.ae_eq + apply ae_of_all + intro x + by_cases hx : x ∈ tsupport η + · simp only [indicator_of_mem hx] + · simp only [indicator_of_notMem hx, image_eq_zero_of_notMem_tsupport hx, zero_smul] + +omit hS hZ hfinite hgrad in +theorem smoothTruncation_le_one_all {ε : ℝ} (hε : 0 < ε) (s : ℝ) : + smoothTruncation ε s ≤ 1 := by + by_cases hs : 0 ≤ s + · exact (smoothTruncation_le_min hε hs).trans (min_le_right _ _) + · have hh := smoothTruncation_monotone ε (le_of_not_ge hs) + have hz : smoothTruncation ε 0 = 0 := by simp [smoothTruncation] + exact (hh.trans_eq hz).trans zero_le_one + +theorem smoothTruncation_regular_energy {W : Space n → ℝ} {D : Space n → Space n} + (htrace : ∀ x ∈ S \ Z, HasSmoothTraceJetAt S W D x) + (hW0 : ∀ x ∈ S \ Z, 0 ≤ W x) + (hsup : ∀ φ : Space n → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → + Disjoint (tsupport φ) Z → (∀ x, 0 ≤ φ x) → + 0 ≤ ∫ x, inner ℝ (D x) (surfaceGradient S φ x) ∂surfaceMeasure S) + {ε : ℝ} (hε : 0 < ε) {η : Space n → ℝ} + (hη : ContDiff ℝ ∞ η) (hcη : HasCompactSupport η) + (hηZ : Disjoint (tsupport η) Z) : + (∫ x, ‖η x • (truncationSlope ε (W x) • D x)‖ ^ 2 ∂surfaceMeasure S) ≤ + 4 * ∫ x, ‖surfaceGradient S η x‖ ^ 2 ∂surfaceMeasure S := by + let T := smoothTruncation ε + let G : Space n → Space n := fun x ↦ truncationSlope ε (W x) • D x + have htt : ∀ x ∈ S \ Z, HasSmoothTraceJetAt S (T ∘ W) G x := by + intro x hx + simpa only [T, G, smoothTruncation_deriv] using + (htrace x hx).comp hx.1 (smoothTruncation_contDiff ε) + obtain ⟨F, hF, he⟩ := exists_smooth_representative_near_regular_test hS hZ htrace + (isClosed_tsupport η) hηZ + let ψ : Space n → ℝ := fun x ↦ (η x * η x) * (1 - T (F x)) + have hTF : ContDiff ℝ ∞ (T ∘ F) := (smoothTruncation_contDiff ε).comp hF + have hψ : ContDiff ℝ ∞ ψ := (hη.mul hη).mul (contDiff_const.sub hTF) + have hcψ : HasCompactSupport ψ := hcη.mul_right.mul_right + have hsub : tsupport ψ ⊆ tsupport η := tsupport_mul_subset_left.trans tsupport_mul_subset_left + have hψZ : Disjoint (tsupport ψ) Z := hηZ.mono_left hsub + have hψ0 : ∀ x, 0 ≤ ψ x := fun x ↦ mul_nonneg (mul_self_nonneg (η x)) + (sub_nonneg.mpr (smoothTruncation_le_one_all hε (F x))) + have ht : 0 ≤ ∫ x, inner ℝ (G x) (surfaceGradient S ψ x) ∂surfaceMeasure S := + smoothTruncation_regular_test hS hZ hfinite hgrad htrace hsup hε hψ hcψ hψZ hψ0 + let A : Space n → Space n := fun x ↦ η x • G x + let B : Space n → Space n := surfaceGradient S η + have hA : MemLp A 2 (surfaceMeasure S) := + regular_gradient_memLp_test hS hZ hfinite hgrad htt hη hcη hηZ + have hB : MemLp B 2 (surfaceMeasure S) := + surfaceGradient_memLp_of_compact hfinite hgrad hη hcη + have hi := integrable_regular_test_pair hS hZ hfinite hgrad htt hψ hcψ hψZ + have hAs := (memLp_two_iff_integrable_sq_norm hA.aestronglyMeasurable).mp hA + have hBs := (memLp_two_iff_integrable_sq_norm hB.aestronglyMeasurable).mp hB + have hu : Integrable (fun x ↦ 2 * ‖B x‖ ^ 2 - (1 / 2 : ℝ) * ‖A x‖ ^ 2) (surfaceMeasure S) := + (hBs.const_mul 2).sub (hAs.const_mul (1 / 2)) + have hle : (∫ x, inner ℝ (G x) (surfaceGradient S ψ x) ∂surfaceMeasure S) ≤ + ∫ x, 2 * ‖B x‖ ^ 2 - (1 / 2 : ℝ) * ‖A x‖ ^ 2 ∂surfaceMeasure S := by + apply integral_mono_ae hi hu + filter_upwards [ae_restrict_mem hS.measurableSet] with x hx + by_cases hxt : x ∈ tsupport η + · have hxr : x ∈ S \ Z := ⟨hx, fun hz ↦ Set.disjoint_left.mp hηZ hxt hz⟩ + have hFx := he x ⟨hx, hxt⟩ + have hgT : surfaceGradient S (fun y ↦ T (F y)) x = G x := by + change surfaceGradient S (T ∘ F) x = G x + rw [surfaceGradient_comp (hF.differentiable (by simp) x) + ((smoothTruncation_contDiff ε).differentiable (by simp) (F x))] + simp only [smoothTruncation_deriv, hFx.1, hFx.2, G] + have hgψ : surfaceGradient S ψ x = + (η x * η x) • (-G x) + (1 - T (W x)) • (η x • B x + η x • B x) := by + dsimp only [ψ] + rw [surfaceGradient_mul (S := S) (g := fun y ↦ 1 - T (F y)) ((hη.mul hη).differentiable (by simp) x) + ((contDiff_const.sub hTF).differentiable (by simp) x)] + rw [surfaceGradient_const_sub S 1, hgT, + surfaceGradient_mul (hη.differentiable (by simp) x) (hη.differentiable (by simp) x), hFx.1] + have heq : inner ℝ (G x) (surfaceGradient S ψ x) = + inner ℝ (A x) ((2 * (1 - T (W x))) • B x - A x) := by + rw [hgψ] + simp only [A, inner_add_right, real_inner_smul_right, inner_neg_right, + real_inner_smul_left, inner_sub_right] + ring + rw [heq] + exact truncation_test_pointwise (A x) (B x) + (smoothTruncation_nonneg ε (hW0 x hxr)) (smoothTruncation_le_one_all hε (W x)) + · have hAx : A x = 0 := by simp only [A, image_eq_zero_of_notMem_tsupport hxt, zero_smul] + have hBx : B x = 0 := surfaceGradient_eq_zero_of_notMem_tsupport S hxt + rw [surfaceGradient_eq_zero_of_notMem_tsupport S (fun h ↦ hxt (hsub h)), + inner_zero_right, hAx, hBx] + norm_num + rw [integral_sub (hBs.const_mul 2) (hAs.const_mul (1 / 2)), + integral_const_mul, integral_const_mul] at hle + change (∫ x, ‖A x‖ ^ 2 ∂surfaceMeasure S) ≤ 4 * ∫ x, ‖B x‖ ^ 2 ∂surfaceMeasure S + linarith + +end RegularEnergy +end RPI.Boundary + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPI.Boundary +section TruncationRegularLimit +variable {n : ℕ} {S Z : Set (Space n)} +variable (hS : IsClosed S) (hZ : IsClosed Z) +variable (hfinite : ∀ R : ℝ, 0 < R → (surfaceMeasure S) (Metric.ball 0 R) < ⊤) +variable (hgrad : ∀ f : Space n → ℝ, ContDiff ℝ ∞ f → + AEStronglyMeasurable (surfaceGradient S f) (surfaceMeasure S)) +variable {W : Space n → ℝ} {D : Space n → Space n} +variable (htrace : ∀ x ∈ S \ Z, HasSmoothTraceJetAt S W D x) +variable (hsup : ∀ φ : Space n → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → + Disjoint (tsupport φ) Z → (∀ x, 0 ≤ φ x) → + 0 ≤ ∫ x, inner ℝ (D x) (surfaceGradient S φ x) ∂surfaceMeasure S) +include hS hZ hfinite hgrad htrace hsup + +theorem min_regular_test {φ : Space n → ℝ} (hφ : ContDiff ℝ ∞ φ) + (hcφ : HasCompactSupport φ) (hφZ : Disjoint (tsupport φ) Z) (hpφ : ∀ x, 0 ≤ φ x) : + 0 ≤ ∫ x, inner ℝ (truncatedGradient W D x) (surfaceGradient S φ x) ∂surfaceMeasure S := by + let b : Space n → ℝ := fun x ↦ inner ℝ (D x) (surfaceGradient S φ x) + have hb : Integrable b (surfaceMeasure S) := + integrable_regular_test_pair hS hZ hfinite hgrad htrace hφ hcφ hφZ + let q : ℕ → Space n → ℝ := fun j x ↦ + inner ℝ (truncationSlope (truncationParameter j) (W x) • D x) (surfaceGradient S φ x) + have hq : ∀ j, AEStronglyMeasurable (q j) (surfaceMeasure S) := by + intro j + have htt : ∀ x ∈ S \ Z, HasSmoothTraceJetAt S (smoothTruncation (truncationParameter j) ∘ W) + (fun y ↦ truncationSlope (truncationParameter j) (W y) • D y) x := by + intro x hx + simpa only [smoothTruncation_deriv] using + (htrace x hx).comp hx.1 (smoothTruncation_contDiff (truncationParameter j)) + exact (integrable_regular_test_pair hS hZ hfinite hgrad htt hφ hcφ hφZ).aestronglyMeasurable + have hlim : Tendsto (fun j ↦ ∫ x, q j x ∂surfaceMeasure S) atTop + (𝓝 (∫ x, inner ℝ (truncatedGradient W D x) (surfaceGradient S φ x) ∂surfaceMeasure S)) := by + apply tendsto_integral_of_dominated_convergence (fun x ↦ ‖b x‖) hq hb.norm + · intro j + apply ae_of_all + intro x + simp only [q, real_inner_smul_left, norm_mul] + exact mul_le_of_le_one_left (norm_nonneg _) (truncationSlope_norm_le _ _) + · apply ae_of_all + intro x + have ht := (truncationSlope_tendsto (W x)).mul_const (b x) + by_cases hx : W x < 1 + · simpa only [q, b, truncatedGradient, ite_eq_left hx, one_mul, real_inner_smul_left] using ht + · simpa only [q, b, truncatedGradient, ite_eq_right hx, zero_mul, inner_zero_left, + real_inner_smul_left] using ht + apply ge_of_tendsto hlim + apply Eventually.of_forall + intro j + exact smoothTruncation_regular_test hS hZ hfinite hgrad htrace hsup + (truncationParameter_pos j) hφ hcφ hφZ hpφ + +theorem min_regular_energy (hW0 : ∀ x ∈ S \ Z, 0 ≤ W x) + {η : Space n → ℝ} (hη : ContDiff ℝ ∞ η) (hcη : HasCompactSupport η) + (hηZ : Disjoint (tsupport η) Z) : + MemLp (fun x ↦ η x • truncatedGradient W D x) 2 (surfaceMeasure S) ∧ + vectorEnergy (surfaceMeasure S) (fun x ↦ η x • truncatedGradient W D x) ≤ + 4 * vectorEnergy (surfaceMeasure S) (surfaceGradient S η) := by + let A : ℕ → Space n → Space n := fun j x ↦ η x • (truncationSlope (truncationParameter j) (W x) • D x) + let H : Space n → Space n := fun x ↦ η x • truncatedGradient W D x + have hA : ∀ j, MemLp (A j) 2 (surfaceMeasure S) := by + intro j + have htt : ∀ x ∈ S \ Z, HasSmoothTraceJetAt S (smoothTruncation (truncationParameter j) ∘ W) + (fun y ↦ truncationSlope (truncationParameter j) (W y) • D y) x := by + intro x hx + simpa only [smoothTruncation_deriv] using + (htrace x hx).comp hx.1 (smoothTruncation_contDiff (truncationParameter j)) + exact regular_gradient_memLp_test hS hZ hfinite hgrad htt hη hcη hηZ + have hB : MemLp (surfaceGradient S η) 2 (surfaceMeasure S) := + surfaceGradient_memLp_of_compact hfinite hgrad hη hcη + have he : ∀ j, vectorEnergy (surfaceMeasure S) (A j) ≤ + 4 * vectorEnergy (surfaceMeasure S) (surfaceGradient S η) := by + intro j + have h := ENNReal.ofReal_le_ofReal (smoothTruncation_regular_energy hS hZ hfinite hgrad + htrace hW0 hsup (truncationParameter_pos j) hη hcη hηZ) + rw [ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 4)] at h + simpa only [A, vectorEnergy, ofReal_integral_eq_lintegral_ofReal + ((memLp_two_iff_integrable_sq_norm (hA j).aestronglyMeasurable).mp (hA j)) + (ae_of_all _ (fun x ↦ sq_nonneg ‖A j x‖)), + ofReal_integral_eq_lintegral_ofReal + ((memLp_two_iff_integrable_sq_norm hB.aestronglyMeasurable).mp hB) + (ae_of_all _ (fun x ↦ sq_nonneg ‖surfaceGradient S η x‖)), ENNReal.ofReal_ofNat] using h + have hlim : ∀ᵐ x ∂surfaceMeasure S, Tendsto (fun j ↦ A j x) atTop (𝓝 (H x)) := by + apply ae_of_all + intro x + have ht := (tendsto_const_nhds (x := η x)).smul + ((truncationSlope_tendsto (W x)).smul_const (D x)) + by_cases hx : W x < 1 + · simpa only [A, H, truncatedGradient, ite_eq_left hx, one_smul] using ht + · simpa only [A, H, truncatedGradient, ite_eq_right hx, zero_smul] using ht + have hHm : AEStronglyMeasurable H (surfaceMeasure S) := + aestronglyMeasurable_of_tendsto_ae atTop (fun j ↦ (hA j).aestronglyMeasurable) hlim + have hHE := vectorEnergy_le_of_ae_tendsto (fun j ↦ (hA j).aestronglyMeasurable) hlim + (Eventually.of_forall he) tendsto_const_nhds + refine ⟨(memLp_two_iff_vectorEnergy hHm).mpr (hHE.trans_lt ?_), hHE⟩ + exact ENNReal.mul_lt_top (by norm_num) ((memLp_two_iff_vectorEnergy hB.aestronglyMeasurable).mp hB) + +end TruncationRegularLimit +end RPI.Boundary + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPI + +theorem vectorEnergy_restrict_of_vanish {X V : Type*} [MeasurableSpace X] + [NormedAddCommGroup V] {μ : Measure X} {U : Set X} (hU : MeasurableSet U) + {F : X → V} (hF : ∀ x ∉ U, F x = 0) : + vectorEnergy (μ.restrict U) F = vectorEnergy μ F := by + unfold vectorEnergy + rw [← lintegral_indicator hU] + apply lintegral_congr + intro x + by_cases hx : x ∈ U + · simp only [indicator_of_mem hx] + · simp only [indicator_of_notMem hx, hF x hx, norm_zero, ne_eq, + OfNat.ofNat_ne_zero, not_false_eq_true, zero_pow, ENNReal.ofReal_zero] + +end RPI + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPI.Boundary + +theorem min_local_energy {n : ℕ} (hn : 8 ≤ n) + {S Z : Set (Space n)} (hS : IsClosed S) (hZ : IsClosed Z) + (hZd : dimH Z ≤ (n - 8 : ℕ)) + (hfinite : ∀ R : ℝ, 0 < R → (surfaceMeasure S) (Metric.ball 0 R) < ⊤) + (hgrad : ∀ f : Space n → ℝ, ContDiff ℝ ∞ f → + AEStronglyMeasurable (surfaceGradient S f) (surfaceMeasure S)) + (hgrowth : ∀ R : ℝ, 0 < R → ∃ A r₀ : ℝ, 0 < A ∧ 0 < r₀ ∧ + ∀ c ∈ Z ∩ Metric.closedBall 0 R, ∀ r : ℝ, 0 < r → r < r₀ → + (surfaceMeasure S).restrict (Metric.ball 0 R) (Metric.ball c r) ≤ + ENNReal.ofReal (A * r ^ (n - 1))) + {W : Space n → ℝ} {D : Space n → Space n} + (htrace : ∀ x ∈ S \ Z, HasSmoothTraceJetAt S W D x) + (hW0 : ∀ x ∈ S \ Z, 0 ≤ W x) + (hsup : ∀ φ : Space n → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → + Disjoint (tsupport φ) Z → (∀ x, 0 ≤ φ x) → + 0 ≤ ∫ x, inner ℝ (D x) (surfaceGradient S φ x) ∂surfaceMeasure S) + {R : ℝ} (hR : 0 < R) : + MemLp (truncatedGradient W D) 2 ((surfaceMeasure S).restrict (Metric.ball 0 R)) := by + let b : ContDiffBump (0 : Space n) := ⟨R + 1, R + 2, by linarith, by linarith⟩ + let μ := (surfaceMeasure S).restrict (Metric.ball 0 (R + 3)) + have hR3 : 0 < R + 3 := by linarith + have : IsFiniteMeasure μ := ⟨by simpa only [μ, Measure.restrict_apply_univ] using hfinite _ hR3⟩ + let K := Z ∩ tsupport b + have hKc : IsCompact K := b.hasCompactSupport.of_isClosed_subset + (hZ.inter (isClosed_tsupport b)) inter_subset_right + have hKd : dimH K ≤ (n - 8 : ℕ) := (dimH_mono inter_subset_left).trans hZd + have hbs : tsupport b ⊆ Metric.ball (0 : Space n) (R + 3) := by + rw [b.tsupport_eq] + exact Metric.closedBall_subset_ball (by dsimp [b]; linarith) + obtain ⟨A, r₀, hA, hr₀, hgr⟩ := hgrowth _ hR3 + obtain ⟨χ, hχ, hχlim, hχE⟩ := exists_memLp_capacity_sequence hn S + (Metric.ball 0 (R + 3)) K hKc hKd + (fun f hf ↦ (hgrad f hf).mono_measure Measure.restrict_le_self) hA hr₀ + (fun c hc s hs hsr ↦ hgr c ⟨hc.1, Metric.ball_subset_closedBall (hbs hc.2)⟩ s hs hsr) + have hb : MemLp (fun x ↦ b x) 2 μ := MemLp.of_bound b.continuous.aestronglyMeasurable 1 + (ae_of_all _ (fun x ↦ by simpa only [Real.norm_eq_abs, abs_of_nonneg b.nonneg] using b.le_one)) + have hDb : MemLp (surfaceGradient S b) 2 μ := surfaceGradient_memLp_on_ball b.contDiff + ((hgrad b b.contDiff).mono_measure Measure.restrict_le_self) + obtain ⟨_, hB, hBt⟩ := capacity_product_pair_tendsto hb hDb χ + (fun i ↦ (hχ i).1.continuous.aestronglyMeasurable) + (fun i ↦ ae_of_all _ (hχ i).2.1) hχlim zero_le_one + (ae_of_all _ (fun x ↦ by simpa only [Real.norm_eq_abs, abs_of_nonneg b.nonneg] using b.le_one)) + (fun i ↦ surfaceGradient S (χ i)) (fun i ↦ (hχ i).2.2.2) hχE + let η : ℕ → Space n → ℝ := fun i x ↦ b x * χ i x + let F : ℕ → Space n → Space n := fun i x ↦ η i x • truncatedGradient W D x + let H : Space n → Space n := fun x ↦ b x • truncatedGradient W D x + have hη : ∀ i, ContDiff ℝ ∞ (η i) := fun i ↦ b.contDiff.mul (hχ i).1 + have hcη : ∀ i, HasCompactSupport (η i) := fun _ ↦ b.hasCompactSupport.mul_right + have hηZ : ∀ i, Disjoint (tsupport (η i)) Z := fun i ↦ + tsupport_mul_disjoint_Singular (hχ i).2.2.1 + have hFE : ∀ i, MemLp (F i) 2 (surfaceMeasure S) ∧ + vectorEnergy (surfaceMeasure S) (F i) ≤ + 4 * vectorEnergy (surfaceMeasure S) (surfaceGradient S (η i)) := by + intro i + exact min_regular_energy hS hZ hfinite hgrad htrace hsup hW0 (hη i) (hcη i) (hηZ i) + have hFm : ∀ i, MemLp (F i) 2 μ := fun i ↦ (hFE i).1.mono_measure Measure.restrict_le_self + have hB_eq : ∀ i, (fun x ↦ χ i x • surfaceGradient S b x + b x • surfaceGradient S (χ i) x) = + surfaceGradient S (η i) := by + intro i + funext x + change _ = surfaceGradient S (fun y ↦ b y * χ i y) x + have hbDiff : ContDiff ℝ ∞ (fun y ↦ b y) := b.contDiff + rw [surfaceGradient_mul (hbDiff.differentiable (by simp) x) + ((hχ i).1.differentiable (by simp) x), add_comm] + have hBE := vectorEnergy_tendsto_of_toLp_tendsto hB hDb hBt.snd_nhds + simp_rw [hB_eq] at hBE + have hbound : ∀ i, vectorEnergy μ (F i) ≤ 4 * vectorEnergy μ (surfaceGradient S (η i)) := by + intro i + rw [vectorEnergy_restrict_of_vanish measurableSet_ball, vectorEnergy_restrict_of_vanish measurableSet_ball] + · exact (hFE i).2 + · intro x hx + exact surfaceGradient_eq_zero_of_notMem_tsupport S + (fun h ↦ hx (hbs (tsupport_mul_subset_left h))) + · intro x hx + have hb0 : b x = 0 := image_eq_zero_of_notMem_tsupport (fun h ↦ hx (hbs h)) + simp only [F, η, hb0, zero_mul, zero_smul] + have hlim : ∀ᵐ x ∂μ, Tendsto (fun i ↦ F i x) atTop (𝓝 (H x)) := by + filter_upwards [hχlim] with x hx + simpa only [F, H, η, mul_one] using + (tendsto_const_nhds.mul hx).smul_const (truncatedGradient W D x) + have hHm : AEStronglyMeasurable H μ := + aestronglyMeasurable_of_tendsto_ae atTop (fun i ↦ (hFm i).aestronglyMeasurable) hlim + have hHE := vectorEnergy_le_of_ae_tendsto (fun i ↦ (hFm i).aestronglyMeasurable) hlim + (Eventually.of_forall hbound) (ENNReal.Tendsto.const_mul hBE (Or.inr (by norm_num))) + have hH : MemLp H 2 μ := (memLp_two_iff_vectorEnergy hHm).mpr (hHE.trans_lt + (ENNReal.mul_lt_top (by norm_num) ((memLp_two_iff_vectorEnergy hDb.aestronglyMeasurable).mp hDb))) + have hHR : MemLp H 2 ((surfaceMeasure S).restrict (Metric.ball 0 R)) := + hH.mono_measure (Measure.restrict_mono_set _ (Metric.ball_subset_ball (by linarith))) + apply hHR.ae_eq + filter_upwards [ae_restrict_mem measurableSet_ball] with x hx + have hbx : b x = 1 := b.one_of_mem_closedBall (Metric.mem_closedBall.mpr + ((Metric.mem_ball.mp hx).le.trans (by dsimp [b]; linarith))) + simp only [H, hbx, one_smul] + +end RPI.Boundary + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem perimeter_mono_region {n : ℕ} (E : Set (Euc n)) {U V : Set (Euc n)} + (hUV : U ⊆ V) : perimeter E U ≤ perimeter E V := by + unfold perimeter + refine iSup_le fun f ↦ iSup_le fun hf ↦ iSup_le fun hc ↦ iSup_le fun hs ↦ iSup_le fun hb ↦ ?_ + exact le_iSup_of_le f (le_iSup_of_le hf (le_iSup_of_le hc + (le_iSup_of_le (hs.trans hUV) (le_iSup_of_le hb le_rfl)))) + +theorem isClosed_perimeterSupport {n : ℕ} (E : Set (Euc n)) : + IsClosed (perimeterSupport E) := by + rw [← isOpen_compl_iff, Metric.isOpen_iff] + intro x hx + simp only [mem_compl_iff, perimeterSupport, mem_ofPred_eq] at hx + push Not at hx + obtain ⟨r, hr, hp⟩ := hx + refine ⟨r / 2, half_pos hr, ?_⟩ + intro y hy + change ¬ ∀ s : ℝ, 0 < s → 0 < perimeter E (Metric.ball y s) + intro hys + have hsub : Metric.ball y (r / 2) ⊆ Metric.ball x r := by + intro z hz + apply Metric.mem_ball.mpr + have h1 := Metric.mem_ball.mp hy + have h2 := Metric.mem_ball.mp hz + have h3 := dist_triangle z y x + linarith + exact (not_lt_of_ge ((perimeter_mono_region E hsub).trans hp)) (hys (r / 2) (half_pos hr)) + +open RPI RPI.Boundary + +theorem min_wholeBoundarySobolev_and_supersolution_of_regular_geometry + {n : ℕ} (hn : 8 ≤ n) {E Z : Set (Euc n)} (hE : MeasurableSet E) + (hZ : IsClosed Z) (hZd : dimH Z ≤ (n - 8 : ℕ)) + (hfinite : ∀ R : ℝ, 0 < R → surfaceMeasure (perimeterSupport E) (Metric.ball 0 R) < ⊤) + (hgrowth : ∀ R : ℝ, 0 < R → ∃ A r₀ : ℝ, 0 < A ∧ 0 < r₀ ∧ + ∀ c ∈ Z ∩ Metric.closedBall 0 R, ∀ r : ℝ, 0 < r → r < r₀ → + (surfaceMeasure (perimeterSupport E)).restrict (Metric.ball 0 R) (Metric.ball c r) ≤ + ENNReal.ofReal (A * r ^ (n - 1))) + (hreg : ∀ x ∈ perimeterSupport E \ Z, ∃ U : Set (Euc n), IsOpen U ∧ x ∈ U ∧ + ∃ f : Euc n → ℝ, ContDiffOn ℝ ∞ f U ∧ + (∀ y ∈ U, fderiv ℝ f y ≠ 0) ∧ + (∀ y ∈ U, y ∈ perimeterSupport E ↔ f y = 0) ∧ + (∀ y ∈ U, (f y < 0 → y ∈ E) ∧ (y ∈ E → f y ≤ 0))) + {W : Euc n → ℝ} {D : Euc n → Euc n} + (htrace : ∀ x ∈ perimeterSupport E \ Z, HasSmoothTraceJetAt (perimeterSupport E) W D x) + (hW0 : ∀ x ∈ perimeterSupport E \ Z, 0 ≤ W x) + (hsup : ∀ φ : Euc n → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → + Disjoint (tsupport φ) Z → (∀ x, 0 ≤ φ x) → + 0 ≤ ∫ x, inner ℝ (D x) (surfaceGradient (perimeterSupport E) φ x) + ∂surfaceMeasure (perimeterSupport E)) : + WholeBoundarySobolev E (fun x ↦ min (W x) 1) (truncatedGradient W D) ∧ + WholeBoundarySupersolution E (truncatedGradient W D) := by + have hS := isClosed_perimeterSupport E + have hlevel : ∀ x ∈ perimeterSupport E \ Z, ∃ U : Set (Euc n), IsOpen U ∧ x ∈ U ∧ + ∃ f : Euc n → ℝ, ContDiffOn ℝ 1 f U ∧ + (∀ y ∈ U, fderiv ℝ f y ≠ 0) ∧ + (∀ y ∈ U, y ∈ perimeterSupport E ↔ f y = 0) := by + intro x hx + obtain ⟨U, hU, hxU, f, hf, hdf, hs, _⟩ := hreg x hx + exact ⟨U, hU, hxU, f, hf.of_le (by norm_num), hdf, hs⟩ + have hfilled : ∀ x ∈ perimeterSupport E \ Z, ∃ f : Euc n → ℝ, + ContDiffAt ℝ 1 f x ∧ f x = 0 ∧ fderiv ℝ f x ≠ 0 ∧ + (∀ᶠ y in 𝓝 x, y ∈ perimeterSupport E ↔ f y = 0) ∧ + (∀ᶠ y in 𝓝 x, (f y < 0 → y ∈ E) ∧ (y ∈ E → f y ≤ 0)) := by + intro x hx + obtain ⟨U, hU, hxU, f, hf, hdf, hs, he⟩ := hreg x hx + refine ⟨f, (hf.of_le (by norm_num)).contDiffAt (hU.mem_nhds hxU), + (hs x hxU).mp hx.1, hdf x hxU, ?_, ?_⟩ + · filter_upwards [hU.mem_nhds hxU] with y hy using hs y hy + · filter_upwards [hU.mem_nhds hxU] with y hy using he y hy + have hgrad : ∀ f : Euc n → ℝ, ContDiff ℝ ∞ f → + AEStronglyMeasurable (surfaceGradient (perimeterSupport E) f) + (surfaceMeasure (perimeterSupport E)) := by + intro f hf + exact surfaceGradient_aestronglyMeasurable_of_regular_locus hn hS.measurableSet + hZ.measurableSet hZd hlevel (hf.of_le (by norm_num)) + have hloc : ∀ R : ℝ, 0 < R → MemLp (truncatedGradient W D) 2 + ((surfaceMeasure (perimeterSupport E)).restrict (Metric.ball 0 R)) := by + intro R hR + exact min_local_energy hn hS hZ hZd hfinite hgrad hgrowth htrace hW0 hsup hR + have haereg : ∀ᵐ x ∂surfaceMeasure (perimeterSupport E), x ∈ perimeterSupport E \ Z := by + have hz : ∀ᵐ x ∂surfaceMeasure (perimeterSupport E), x ∉ Z := by + simpa only [ae_iff, not_not, Set.ofPred_mem_eq] using + surfaceMeasure_zero_of_singular_dim hn (perimeterSupport E) Z hZd + filter_upwards [ae_restrict_mem hS.measurableSet, hz] with x hx hzx + exact ⟨hx, hzx⟩ + constructor + · apply wholeBoundarySobolev_of_local_sobolevGraph_filled hn hE hS.measurableSet hZd hfilled + intro R hR + have : IsFiniteMeasure ((surfaceMeasure (perimeterSupport E)).restrict (Metric.ball 0 R)) := + ⟨by simpa only [Measure.restrict_apply_univ] using hfinite R hR⟩ + have hw : ∀ᵐ x ∂(surfaceMeasure (perimeterSupport E)).restrict (Metric.ball 0 R), 0 ≤ W x := by + filter_upwards [haereg.filter_mono (ae_mono Measure.restrict_le_self)] with x hx + exact hW0 x hx + obtain ⟨A, r₀, hA, hr₀, hgr⟩ := hgrowth (R + 2) (by linarith) + obtain ⟨hh, hpair⟩ := min_one_mem_sobolevGraph_ball hn hS hZ hZd hR htrace hw (hloc R hR) + (fun f hf ↦ (hgrad f hf).mono_measure Measure.restrict_le_self) hA hr₀ (by + intro c hc r hr hrr + apply le_trans _ (hgr c hc r hr hrr) + exact Measure.le_iff'.mp (Measure.restrict_mono_set _ + (Metric.ball_subset_ball (by linarith : R ≤ R + 2))) _) + exact ⟨hh, hloc R hR, hpair⟩ + · intro φ hφ hcφ hpφ + have hh := full_test_of_regular_tests hn hZ hZd hloc hfinite hgrad hgrowth + (fun ψ hψ hcψ hψZ hpψ ↦ min_regular_test hS hZ hfinite hgrad htrace hsup hψ hcψ hψZ hpψ) + hφ hcφ hpφ + have heq := surfaceGradient_ae_eq_tangentialGradient_filled hn hE hS.measurableSet hZd hfilled φ + rw [boundaryArea_eq_smul_surfaceMeasure, integral_smul_measure] + have hi : (∫ x, inner ℝ (truncatedGradient W D x) (tangentialGradient E φ x) + ∂surfaceMeasure (perimeterSupport E)) = + ∫ x, inner ℝ (truncatedGradient W D x) (surfaceGradient (perimeterSupport E) φ x) + ∂surfaceMeasure (perimeterSupport E) := by + apply integral_congr_ae + filter_upwards [heq] with x hx + rw [hx] + rw [hi] + exact mul_nonneg ENNReal.toReal_nonneg hh + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/TangentPlanes.lean b/lean/OAI/Geometry/Perimeter/Regularity/TangentPlanes.lean new file mode 100644 index 0000000000000000000000000000000000000000..99915d19dce6f6c78f6332c37b595afd2df71aa6 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/TangentPlanes.lean @@ -0,0 +1,102 @@ +import OAI.Geometry.Perimeter.Regularity.SlabIteration + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +variable {n : ℕ} + +theorem FullSlab.undilate_height {E : Set (Euc n)} (hE : MeasurableSet E) + {v : Euc n} {R a t : ℝ} (ht : 0 < t) + (h : FullSlab (blownUpSet E 0 t) v R a) : + ∀ x∈perimeterSupport E ∩ Metric.ball 0 (t*R), |inner ℝ v x|≤t*a := by + intro x hx + let y := t⁻¹•x + have hxy : t•y=x := smul_inv_smul₀ ht.ne' x + have hyS : y∈perimeterSupport (blownUpSet E 0 t) := by + rw [perimeterSupport_blownUpSet hE 0 ht,zero_add,hxy] + exact hx.1 + have hyB : y∈Metric.ball 0 R := by + have hh : t*‖y‖ linarith [hb.1, hb.2]) htest + have hAs : Integrable (fun x ↦ ‖A x‖ ^ 2) μ := (memLp_two_iff_integrable_sq_norm hAm).mp hA + let W : Euc n → ℝ := fun x ↦ η x ^ 2 * ‖G x‖ ^ 2 / (h x + ε) ^ 2 + have hWm : AEStronglyMeasurable W μ := + (((hη.continuous.aemeasurable.pow_const 2).mul + (hG.aestronglyMeasurable.norm.pow 2).aemeasurable).div + ((hh.aestronglyMeasurable.add_const ε).pow 2).aemeasurable).aestronglyMeasurable + have hWle : ∀ᵐ x ∂μ, W x ≤ 2 * ‖A x‖ ^ 2 := by + filter_upwards [ae_restrict_of_ae hh01] with x hx + exact log_weight_le_energy hε hx.1 (η x) (G x) + have hW : Integrable W μ := (hAs.const_mul 2).mono' hWm (by + filter_upwards [hWle] with x hx + rw [Real.norm_of_nonneg (by dsimp [W]; positivity)] + exact hx) + have hi := integral_mono_ae hW (hAs.const_mul 2) hWle + rw [integral_const_mul] at hi + change (∫ x, W x ∂μ) ≤ 8 * ∫ x, ‖tangentialGradient E η x‖ ^ 2 ∂μ + linarith + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +namespace RPISingularHarnack + +def smoothPositive (ε s : ℝ) : ℝ := ∫ t in (0 : ℝ)..s, Real.smoothTransition (t / ε) + +theorem smoothPositive_hasDerivAt (ε s : ℝ) : + HasDerivAt (smoothPositive ε) (Real.smoothTransition (s / ε)) s := by + have hc : Continuous (fun t : ℝ ↦ Real.smoothTransition (t / ε)) := by fun_prop + exact intervalIntegral.integral_hasDerivAt_right (hc.intervalIntegrable 0 s) + hc.stronglyMeasurable.stronglyMeasurableAtFilter hc.continuousAt + +@[simp] theorem smoothPositive_deriv (ε s : ℝ) : + deriv (smoothPositive ε) s = Real.smoothTransition (s / ε) := + (smoothPositive_hasDerivAt ε s).deriv + +theorem smoothPositive_contDiff (ε : ℝ) : ContDiff ℝ ∞ (smoothPositive ε) := by + rw [contDiff_infty_iff_deriv] + refine ⟨fun s ↦ (smoothPositive_hasDerivAt ε s).differentiableAt, ?_⟩ + simp only [funext (smoothPositive_deriv ε)] + fun_prop + +theorem smoothPositive_of_nonpos {ε s : ℝ} (hε : 0 < ε) (hs : s ≤ 0) : + smoothPositive ε s = 0 := by + unfold smoothPositive + calc + _ = ∫ _t in (0 : ℝ)..s, (0 : ℝ) := by + apply intervalIntegral.integral_congr + intro t ht + rw [uIcc_of_ge hs] at ht + exact Real.smoothTransition.zero_of_nonpos (div_nonpos_of_nonpos_of_nonneg ht.2 hε.le) + _ = 0 := by simp + +theorem smoothPositive_nonneg {ε : ℝ} (hε : 0 < ε) (s : ℝ) : + 0 ≤ smoothPositive ε s := by + by_cases hs : 0 ≤ s + · exact intervalIntegral.integral_nonneg hs (fun t _ ↦ Real.smoothTransition.nonneg _) + · rw [smoothPositive_of_nonpos hε (le_of_not_ge hs)] + +theorem smoothPositive_le_mul {ε s : ℝ} (hε : 0 < ε) (hs : 0 ≤ s) : + smoothPositive ε s ≤ s * Real.smoothTransition (s / ε) := by + have hc : Continuous (fun t : ℝ ↦ Real.smoothTransition (t / ε)) := by fun_prop + have hh := intervalIntegral.integral_mono_on hs (hc.intervalIntegrable 0 s) + (intervalIntegrable_const : IntervalIntegrable (fun _ : ℝ ↦ Real.smoothTransition (s / ε)) volume 0 s) + (fun t ht ↦ Real.smoothTransition.monotone (div_le_div_of_nonneg_right ht.2 hε.le)) + simpa only [smoothPositive, intervalIntegral.integral_const, sub_zero, smul_eq_mul] using hh + +theorem smoothPositive_le_self {ε s : ℝ} (hε : 0 < ε) (hs : 0 ≤ s) : + smoothPositive ε s ≤ s := by + exact (smoothPositive_le_mul hε hs).trans (by nlinarith [Real.smoothTransition.le_one (s / ε)]) + +theorem sub_parameter_le_smoothPositive {ε s : ℝ} (hε : 0 < ε) : + s - ε ≤ smoothPositive ε s := by + by_cases hs : s ≤ ε + · exact (sub_nonpos.mpr hs).trans (smoothPositive_nonneg hε s) + · have hes : ε ≤ s := le_of_not_ge hs + have hc : Continuous (fun t : ℝ ↦ Real.smoothTransition (t / ε)) := by fun_prop + unfold smoothPositive + rw [← intervalIntegral.integral_add_adjacent_intervals (hc.intervalIntegrable 0 ε) + (hc.intervalIntegrable ε s)] + have heq : (∫ t in ε..s, Real.smoothTransition (t / ε)) = s - ε := by + calc + _ = ∫ _t in ε..s, (1 : ℝ) := by + apply intervalIntegral.integral_congr + intro t ht + rw [uIcc_of_le hes] at ht + exact Real.smoothTransition.one_of_one_le ((le_div_iff₀ hε).2 (by simpa using ht.1)) + _ = _ := by simp + rw [heq] + have hp := intervalIntegral.integral_nonneg (μ := volume) hε.le + (fun t (_ : t ∈ Icc (0 : ℝ) ε) ↦ Real.smoothTransition.nonneg (t / ε)) + linarith + +def sublevelTest (ε k t : ℝ) : ℝ := smoothPositive ε (k - t) +def sublevelSlope (ε k t : ℝ) : ℝ := Real.smoothTransition ((k - t) / ε) + +theorem sublevelTest_contDiff (ε k : ℝ) : ContDiff ℝ ∞ (sublevelTest ε k) := + (smoothPositive_contDiff ε).comp (contDiff_const.sub contDiff_id) + +theorem sublevelTest_hasDerivAt (ε k t : ℝ) : + HasDerivAt (sublevelTest ε k) (-sublevelSlope ε k t) t := by + convert (smoothPositive_hasDerivAt ε (k - t)).comp t ((hasDerivAt_id t).const_sub k) using 1 <;> + (first | rfl | simp [sublevelSlope]) + +theorem sublevelTest_nonneg {ε : ℝ} (hε : 0 < ε) (k t : ℝ) : + 0 ≤ sublevelTest ε k t := smoothPositive_nonneg hε _ + +theorem sublevelSlope_mem_Icc (ε k t : ℝ) : sublevelSlope ε k t ∈ Icc (0 : ℝ) 1 := + ⟨Real.smoothTransition.nonneg _, Real.smoothTransition.le_one _⟩ + +theorem sublevelTest_controls {ε k t : ℝ} (hε : 0 < ε) (hk : 0 ≤ k) (ht : 0 ≤ t) : + sublevelTest ε k t ≤ k * sublevelSlope ε k t := by + by_cases htk : t ≤ k + · exact (smoothPositive_le_mul hε (sub_nonneg.mpr htk)).trans + (mul_le_mul_of_nonneg_right (by linarith) (sublevelSlope_mem_Icc ε k t).1) + · rw [sublevelTest, smoothPositive_of_nonpos hε (by linarith)] + exact mul_nonneg hk (sublevelSlope_mem_Icc ε k t).1 + +theorem sublevelTest_eq_zero {ε k t : ℝ} (hε : 0 < ε) (ht : k ≤ t) : + sublevelTest ε k t = 0 := smoothPositive_of_nonpos hε (sub_nonpos.mpr ht) + +theorem sublevelSlope_eq_zero {ε k t : ℝ} (hε : 0 < ε) (ht : k ≤ t) : + sublevelSlope ε k t = 0 := + Real.smoothTransition.zero_of_nonpos (div_nonpos_of_nonpos_of_nonneg (sub_nonpos.mpr ht) hε.le) + +theorem sublevelTest_lipschitz (ε k : ℝ) : LipschitzWith 1 (sublevelTest ε k) := by + apply lipschitzWith_of_nnnorm_deriv_le ((sublevelTest_contDiff ε k).differentiable (by simp)) + intro t + change ‖deriv (sublevelTest ε k) t‖ ≤ 1 + rw [(sublevelTest_hasDerivAt ε k t).deriv, norm_neg, + Real.norm_of_nonneg (sublevelSlope_mem_Icc ε k t).1] + exact (sublevelSlope_mem_Icc ε k t).2 + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/TendstoLintegralNormOfL2.lean b/lean/OAI/Geometry/Perimeter/Regularity/TendstoLintegralNormOfL2.lean new file mode 100644 index 0000000000000000000000000000000000000000..3e46212c1763dd6486a249832257b7b5bd8493eb --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/TendstoLintegralNormOfL2.lean @@ -0,0 +1,527 @@ +import OAI.Geometry.Perimeter.Regularity.ExistsTangentialGradientBallBound + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +namespace RPIKernel +variable {X V : Type*} [MeasurableSpace X] [NormedAddCommGroup V] + +lemma tendsto_lintegral_norm_of_L2 [NormedSpace ℝ V] (μ : Measure X) [IsFiniteMeasure μ] + {F : ℕ → X → V} {G : X → V} (hF : ∀ j, MemLp (F j) 2 μ) (hG : MemLp G 2 μ) + (hlim : Tendsto (fun j ↦ eLpNorm (fun x ↦ F j x - G x) 2 μ) atTop (𝓝 0)) : + Tendsto (fun j ↦ ∫⁻ x, ENNReal.ofReal ‖F j x‖ ∂μ) atTop + (𝓝 (∫⁻ x, ENNReal.ofReal ‖G x‖ ∂μ)) := by + have hfinite : μ univ ^ (1 / 2 : ℝ) ≠ ⊤ := + ENNReal.rpow_ne_top_of_nonneg (by norm_num) (measure_ne_top μ univ) + have ht : Tendsto (fun j ↦ eLpNorm (fun x ↦ F j x - G x) 2 μ * μ univ ^ (1 / 2 : ℝ)) atTop (𝓝 0) := by + simpa only [zero_mul] using ENNReal.Tendsto.mul_const hlim (Or.inr hfinite) + have hnorm : Tendsto (fun j ↦ eLpNorm (fun x ↦ ‖F j x‖ - ‖G x‖) 1 μ) atTop (𝓝 0) := by + apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds ht (fun _ ↦ bot_le) + intro j + calc + _ ≤ eLpNorm (fun x ↦ F j x - G x) 1 μ := eLpNorm_mono_ae + ((hF j).aestronglyMeasurable.norm.sub hG.aestronglyMeasurable.norm) + (ae_of_all _ fun x ↦ by simpa only [Pi.sub_apply, Real.norm_eq_abs] using abs_norm_sub_norm_le (F j x) (G x)) + _ ≤ _ := by + simpa only [Pi.sub_apply, ENNReal.toReal_one, ENNReal.toReal_ofNat, div_one, + show (1 : ℝ) - 1 / 2 = 1 / 2 by norm_num] using + eLpNorm_le_eLpNorm_mul_rpow_measure_univ (f := fun x ↦ F j x - G x) (by norm_num : (1 : ℝ≥0∞) ≤ 2) ((hF j).aestronglyMeasurable.sub hG.aestronglyMeasurable) + have hiF (j : ℕ) : Integrable (F j) μ := memLp_one_iff_integrable.mp ((hF j).mono_exponent (by norm_num)) + have hiG : Integrable G μ := memLp_one_iff_integrable.mp (hG.mono_exponent (by norm_num)) + have hI := tendsto_integral_of_L1' (fun x ↦ ‖G x‖) + (Eventually.of_forall fun j ↦ (hiF j).norm) hnorm + have H := ENNReal.continuous_ofReal.tendsto (∫ x, ‖G x‖ ∂μ) |>.comp hI + change Tendsto (fun j ↦ ENNReal.ofReal (∫ x, ‖F j x‖ ∂μ)) atTop + (𝓝 (ENNReal.ofReal (∫ x, ‖G x‖ ∂μ))) at H + simp_rw [ofReal_integral_norm_eq_lintegral_enorm (hiF _), + ofReal_integral_norm_eq_lintegral_enorm hiG] at H + simpa only [ofReal_norm] using H + +variable [NormedSpace ℝ V] + +theorem sobolev_limit (μ : Measure X) [IsFiniteMeasure μ] + {f : ℕ → X → ℝ} {h : X → ℝ} {F : ℕ → X → V} {G : X → V} + (hf : ∀ j, AEMeasurable (f j) μ) + (hpoint : ∀ᵐ x ∂μ, Tendsto (fun j ↦ f j x) atTop (𝓝 (h x))) + (hF : ∀ j, MemLp (F j) 2 μ) (hG : MemLp G 2 μ) + (hlim : Tendsto (fun j ↦ eLpNorm (fun x ↦ F j x - G x) 2 μ) atTop (𝓝 0)) + {p : ℝ} {C : ℝ≥0∞} (hC : C ≠ ⊤) + (hbound : ∀ j, (∫⁻ x, ENNReal.ofReal (f j x) ^ p ∂μ) ≤ + C * (∫⁻ x, ENNReal.ofReal ‖F j x‖ ∂μ) ^ p) : + (∫⁻ x, ENNReal.ofReal (h x) ^ p ∂μ) ≤ C * (∫⁻ x, ENNReal.ofReal ‖G x‖ ∂μ) ^ p := by + have hI := tendsto_lintegral_norm_of_L2 μ hF hG hlim + have hpow := (ENNReal.continuous_rpow_const (y := p)).tendsto (∫⁻ x, ENNReal.ofReal ‖G x‖ ∂μ) |>.comp hI + have hR := ENNReal.Tendsto.const_mul hpow (Or.inr hC) + calc + _ = ∫⁻ x, liminf (fun j ↦ ENNReal.ofReal (f j x) ^ p) atTop ∂μ := by + apply lintegral_congr_ae + filter_upwards [hpoint] with x hx + exact (((ENNReal.continuous_rpow_const (y := p)).comp ENNReal.continuous_ofReal).tendsto (h x) |>.comp hx).liminf_eq.symm + _ ≤ liminf (fun j ↦ ∫⁻ x, ENNReal.ofReal (f j x) ^ p ∂μ) atTop := + lintegral_liminf_le' (fun j ↦ ((hf j).ennreal_ofReal).pow_const p) + _ ≤ liminf (fun j ↦ C * (∫⁻ x, ENNReal.ofReal ‖F j x‖ ∂μ) ^ p) atTop := + liminf_le_liminf (Eventually.of_forall hbound) + _ = _ := hR.liminf_eq + +end RPIKernel + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +namespace RPISingularHarnack +open RPI RPI.Boundary + +theorem wholeBoundary_nonlinear_approximation {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + {h : Euc n → ℝ} {G : Euc n → Euc n} + (hSob : WholeBoundarySobolev E h G) + (hh01 : ∀ᵐ x ∂boundaryArea E, 0 ≤ h x ∧ h x ≤ 1) + {R : ℝ} (hR : 0 < R) {η : Euc n → ℝ} + (hη : ContDiff ℝ ∞ η) (hcη : HasCompactSupport η) + (hsη : tsupport η ⊆ Metric.ball 0 R) + {ψ : ℝ → ℝ} (hψ : ContDiff ℝ ∞ ψ) (hψpos : ∀ t, 0 ≤ ψ t) + {K : ℝ≥0} (hψLip : LipschitzWith K ψ) + {L : ℝ} (hL : 0 ≤ L) (hdψ : ∀ t, ‖deriv ψ t‖ ≤ L) : + let μ := (boundaryArea E).restrict (Metric.ball 0 R) + let B := fun x ↦ (2 * η x * ψ (h x)) • tangentialGradient E η x + + (η x ^ 2 * deriv ψ (h x)) • G x + MemLp B 2 μ ∧ ∃ ξ : ℕ → Euc n → ℝ, + (∀ j, ContDiff ℝ ∞ (ξ j) ∧ HasCompactSupport (ξ j) ∧ + tsupport (ξ j) ⊆ Metric.ball 0 R ∧ ∀ x, 0 ≤ ξ j x) ∧ + (∀ᵐ x ∂μ, Tendsto (fun j ↦ ξ j x) atTop (𝓝 (η x ^ 2 * ψ (h x)))) ∧ + Tendsto (fun j ↦ vectorEnergy μ (fun x ↦ tangentialGradient E (ξ j) x - B x)) atTop (𝓝 0) := by + let μ := (boundaryArea E).restrict (Metric.ball 0 R) + have : IsFiniteMeasure μ := ⟨by + simpa only [μ, Measure.restrict_apply_univ] using minimizing_boundaryArea_ball_lt_top hn hmin 0 hR⟩ + obtain ⟨hh, hG, u, hu, huh, huG⟩ := hSob R hR + have hu0 : Tendsto (fun j ↦ vectorEnergy μ (fun x ↦ u j x - h x)) atTop (𝓝 0) := by + simpa only [vectorEnergy, Real.norm_eq_abs] using huh + have hum : ∀ j, AEStronglyMeasurable (u j) μ := + fun j ↦ (hu j).1.continuous.aestronglyMeasurable + obtain ⟨σ, hσ, hpoint⟩ := (tendstoInMeasure_of_tendsto_eLpNorm + (by norm_num : (2 : ℝ≥0∞) ≠ 0) + (tendsto_eLpNorm_two_of_vectorEnergy_zero_of_aestronglyMeasurable + (fun index ↦ (hum index).sub hh.aestronglyMeasurable) hu0)).exists_seq_tendsto_ae + let F : ℕ → Euc n → Euc n := fun j ↦ tangentialGradient E (u (σ j)) + let D := tangentialGradient E η + have hF : ∀ j, MemLp (F j) 2 μ := fun j ↦ + tangentialGradient_memLp_on_ball hn hmin hR ((hu (σ j)).1.of_le (by simp)) + have hD : MemLp D 2 μ := tangentialGradient_memLp_on_ball hn hmin hR (hη.of_le (by simp)) + have hdcont : Continuous (deriv ψ) := hψ.continuous_deriv (by simp) + obtain ⟨M₀, hM₀⟩ := hcη.exists_bound_of_continuous hη.continuous + let M := max M₀ 0 + have hM : 0 ≤ M := le_max_right _ _ + have hηM : ∀ᵐ x ∂μ, ‖η x‖ ≤ M := ae_of_all _ fun x ↦ (hM₀ x).trans (le_max_left _ _) + have hgradη : Continuous (gradient η) := continuous_iff_continuousAt.mpr (fun x ↦ + continuousAt_gradient_of_contDiffAt (hη.of_le (by simp)).contDiffAt) + obtain ⟨N₀, hN₀⟩ := (isCompact_closedBall (0 : Euc n) R).exists_bound_of_continuousOn hgradη.continuousOn + let N := 2 * max N₀ 0 + have hN : 0 ≤ N := by positivity + have hDN : ∀ᵐ x ∂μ, ‖D x‖ ≤ N := by + filter_upwards [ae_restrict_mem measurableSet_ball] with x hx + exact (tangentialGradient_norm_le_twice E η x).trans (by + dsimp [N]; nlinarith [hN₀ x (Metric.ball_subset_closedBall hx), le_max_left N₀ 0]) + let B : Euc n → Euc n := fun x ↦ + (2 * η x * ψ (h x)) • D x + (η x ^ 2 * deriv ψ (h x)) • G x + obtain ⟨C₀, hC₀⟩ := (isCompact_Icc : IsCompact (Icc (0 : ℝ) 1)).exists_bound_of_continuousOn + hψ.continuous.continuousOn + let C := max C₀ 0 + have hC : 0 ≤ C := le_max_right _ _ + have hψC : ∀ᵐ x ∂μ, ‖ψ (h x)‖ ≤ C := by + filter_upwards [ae_restrict_of_ae hh01] with x hx + exact (hC₀ (h x) hx).trans (le_max_left _ _) + have hca : MemLp (fun x ↦ 2 * η x * ψ (h x)) ∞ μ := by + apply MemLp.of_bound ((aestronglyMeasurable_const.mul hη.continuous.aestronglyMeasurable).mul + (hψ.continuous.comp_aestronglyMeasurable hh.aestronglyMeasurable)) (2 * M * C) + filter_upwards [hηM, hψC] with x hx hy + simpa only [Pi.mul_apply, norm_mul, Real.norm_ofNat] using mul_le_mul + (mul_le_mul_of_nonneg_left hx (by norm_num : (0 : ℝ) ≤ 2)) hy (norm_nonneg _) (by positivity) + have hcb : MemLp (fun x ↦ η x ^ 2 * deriv ψ (h x)) ∞ μ := by + apply MemLp.of_bound ((hη.continuous.aestronglyMeasurable.pow 2).mul + (hdcont.comp_aestronglyMeasurable hh.aestronglyMeasurable)) (M ^ 2 * L) + filter_upwards [hηM] with x hx + rw [Pi.mul_apply, Pi.pow_apply, norm_mul, norm_pow] + exact mul_le_mul ((sq_le_sq₀ (norm_nonneg _) hM).mpr hx) (hdψ _) (norm_nonneg _) (sq_nonneg _) + have hB : MemLp B 2 μ := (hca.smul hD).add (hcb.smul hG) + let ξ : ℕ → Euc n → ℝ := fun j x ↦ (η x * η x) * ψ (u (σ j) x) + have hξ : ∀ j, ContDiff ℝ ∞ (ξ j) := fun j ↦ (hη.mul hη).mul (hψ.comp (hu (σ j)).1) + have hξc : ∀ j, HasCompactSupport (ξ j) := fun _ ↦ hcη.mul_right.mul_right + have hξgrad : ∀ j x, tangentialGradient E (ξ j) x = + (2 * η x * ψ (u (σ j) x)) • D x + (η x ^ 2 * deriv ψ (u (σ j) x)) • F j x := by + intro j x + exact tangentialGradient_nonlinear_test E (hη.differentiable (by simp) x) + ((hu (σ j)).1.differentiable (by simp) x) (hψ.differentiable (by simp) _) + have henergy : Tendsto (fun j ↦ vectorEnergy μ + (fun x ↦ tangentialGradient E (ξ j) x - B x)) atTop (𝓝 0) := by + simp_rw [hξgrad] + exact vectorEnergy_nonlinear_test_tendsto (fun j ↦ hum (σ j)) hh.aestronglyMeasurable + hη.continuous.aestronglyMeasurable hD.aestronglyMeasurable hF hG hM hN hηM hDN + (hu0.comp hσ.tendsto_atTop) (huG.comp hσ.tendsto_atTop) hpoint hψLip + (deriv ψ) hdcont hL hdψ + refine ⟨hB, ξ, ?_, ?_, henergy⟩ + · intro j + refine ⟨hξ j, hξc j, ?_, fun x ↦ mul_nonneg (mul_self_nonneg _) (hψpos _)⟩ + exact (tsupport_mul_subset_left.trans tsupport_mul_subset_left).trans hsη + · filter_upwards [hpoint] with x hx + simpa only [ξ, ← sq] using + (tendsto_const_nhds.mul ((hψ.continuous.tendsto (h x)).comp hx) : + Tendsto (fun j ↦ (η x * η x) * ψ (u (σ j) x)) atTop (𝓝 ((η x * η x) * ψ (h x)))) + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +namespace RPISingularHarnack +open RPI + +theorem wholeBoundary_sublevel_sobolev {n : ℕ} (hn : 2 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + {h : Euc n → ℝ} {G : Euc n → Euc n} + (hSob : WholeBoundarySobolev E h G) + (hh01 : ∀ᵐ x ∂boundaryArea E, 0 ≤ h x ∧ h x ≤ 1) + {R p : ℝ} (hR : 0 < R) (hp : 1 < p) + (hpk : (((n - 1 : ℕ) : ℝ) - 1) * p < (n - 1 : ℕ)) : + ∃ C : ℝ≥0∞, C ≠ ⊤ ∧ ∀ η : Euc n → ℝ, + ContDiff ℝ ∞ η → HasCompactSupport η → tsupport η ⊆ Metric.ball 0 R → + ∀ ε k : ℝ, 0 < ε → 0 ≤ k → + (∫⁻ x in Metric.ball 0 R, ENNReal.ofReal (η x ^ 2 * sublevelTest ε k (h x)) ^ p ∂boundaryArea E) ≤ + C * (∫⁻ x in Metric.ball 0 R, ENNReal.ofReal + ‖(2 * η x * sublevelTest ε k (h x)) • tangentialGradient E η x - + (η x ^ 2 * sublevelSlope ε k (h x)) • G x‖ ∂boundaryArea E) ^ p := by + obtain ⟨C, hC, hb⟩ := minimizing_boundaryArea_sobolev hn hmin 0 hR hp hpk + refine ⟨C, hC, ?_⟩ + intro η hη hcη hsη ε k hε hk + let μ := (boundaryArea E).restrict (Metric.ball 0 R) + let : IsFiniteMeasure μ := ⟨by + simpa only [μ, Measure.restrict_apply_univ] using minimizing_boundaryArea_ball_lt_top (by omega : 1 < n) hmin 0 hR⟩ + obtain ⟨hB, ξ, hξ, hpoint, henergy⟩ := wholeBoundary_nonlinear_approximation (by omega : 1 < n) + hmin hSob hh01 hR hη hcη hsη (sublevelTest_contDiff ε k) (sublevelTest_nonneg hε k) + (sublevelTest_lipschitz ε k) (show (0 : ℝ) ≤ 1 by norm_num) (fun t ↦ by + rw [(sublevelTest_hasDerivAt ε k t).deriv, norm_neg, + Real.norm_of_nonneg (sublevelSlope_mem_Icc ε k t).1] + exact (sublevelSlope_mem_Icc ε k t).2) + have hF : ∀ j, MemLp (tangentialGradient E (ξ j)) 2 μ := fun j ↦ + tangentialGradient_memLp_on_ball (by omega : 1 < n) hmin hR ((hξ j).1.of_le (by simp)) + have H := RPIKernel.sobolev_limit μ (fun j ↦ (hξ j).1.continuous.measurable.aemeasurable) + hpoint hF hB (tendsto_eLpNorm_two_of_vectorEnergy_zero_of_aestronglyMeasurable + (fun index ↦ (hF index).aestronglyMeasurable.sub hB.aestronglyMeasurable) henergy) hC + (fun j ↦ hb (ξ j) (hξ j).1 (hξ j).2.1 (hξ j).2.2.1 (hξ j).2.2.2) + simpa only [(sublevelTest_hasDerivAt ε k _).deriv, mul_neg, neg_smul, sub_eq_add_neg] using H + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +open scoped ENNReal Topology ContDiff +namespace RPIKernel +open Classical + +lemma weighted_sublevel_gradient_bound {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] + (G D : V) {a ψ χ k N : ℝ} (ha : a ∈ Icc (0 : ℝ) 1) + (hχ : χ ∈ Icc (0 : ℝ) 1) (hψ : 0 ≤ ψ) (hψk : ψ ≤ k * χ) + (hk : 0 < k) (hN : 0 < N) (hD : ‖D‖ ≤ N) : + ‖(2 * a * ψ) • D - (a ^ 2 * χ) • G‖ ≤ + (5 / 2 : ℝ) * (k * N) + (a ^ 2 * χ * ‖G‖ ^ 2) / (2 * (k * N)) := by + have ha0 := ha.1 + have ha1 := ha.2 + have hχ0 := hχ.1 + have hχ1 := hχ.2 + have hχa : 0 ≤ a ^ 2 * χ := by positivity + have ha2 : a ^ 2 ≤ 1 := by nlinarith [ha.1, ha.2] + have hχa1 : a ^ 2 * χ ≤ 1 := by nlinarith [hχ.1, hχ.2, sq_nonneg a] + have hL : 0 < k * N := mul_pos hk hN + have hψbound : ψ ≤ k := by nlinarith [hχ.2] + have hfirst : ‖(2 * a * ψ) • D‖ ≤ 2 * (k * N) := by + rw [norm_smul, Real.norm_of_nonneg (by positivity)] + calc + _ ≤ (2 * 1 * k) * N := by gcongr + _ = _ := by ring + have hsecond : ‖(a ^ 2 * χ) • G‖ ≤ (1 / 2 : ℝ) * (k * N) + + (a ^ 2 * χ * ‖G‖ ^ 2) / (2 * (k * N)) := by + rw [norm_smul, Real.norm_of_nonneg hχa] + have hh : (a ^ 2 * χ * ‖G‖) ^ 2 ≤ a ^ 2 * χ * ‖G‖ ^ 2 := by + nlinarith [mul_nonneg (sub_nonneg.mpr hχa1) (mul_nonneg hχa (sq_nonneg ‖G‖))] + have H : a ^ 2 * χ * ‖G‖ * (2 * (k * N)) ≤ (k * N) ^ 2 + a ^ 2 * χ * ‖G‖ ^ 2 := by + nlinarith [sq_nonneg (a ^ 2 * χ * ‖G‖ - k * N)] + have HD := (le_div_iff₀ (by positivity : 0 < 2 * (k * N))).mpr H + calc + _ ≤ ((k * N) ^ 2 + a ^ 2 * χ * ‖G‖ ^ 2) / (2 * (k * N)) := HD + _ = _ := by field_simp + exact (norm_sub_le _ _).trans (by linarith) + +lemma integral_norm_sublevel_bound {X V : Type*} [MeasurableSpace X] + [NormedAddCommGroup V] [NormedSpace ℝ V] + (μ : Measure X) [IsFiniteMeasure μ] {A : Set X} (hA : NullMeasurableSet A μ) + {B : X → V} {J : X → ℝ} (hB : Integrable B μ) (hJ : Integrable J μ) + {L : ℝ} (hL : 0 < L) + (hpoint : ∀ᵐ x ∂μ, ‖B x‖ ≤ (if x ∈ A then (5 / 2 : ℝ) * L else 0) + J x / (2 * L)) + (henergy : (∫ x, J x ∂μ) ≤ 4 * L ^ 2 * μ.real A) : + (∫ x, ‖B x‖ ∂μ) ≤ 5 * L * μ.real A := by + classical + have hiA : Integrable (fun x ↦ if x ∈ A then (5 / 2 : ℝ) * L else 0) μ := + (integrable_const ((5 / 2 : ℝ) * L)).indicator₀ hA + have hmono := integral_mono_ae hB.norm (hiA.add (hJ.div_const _)) hpoint + have hIA : (∫ x, (if x ∈ A then (5 / 2 : ℝ) * L else 0) ∂μ) = (5 / 2 : ℝ) * L * μ.real A := by + change (∫ x, A.indicator (fun _ ↦ (5 / 2 : ℝ) * L) x ∂μ) = _ + rw [integral_indicator₀ hA] + simp only [setIntegral_const, smul_eq_mul] + ring + simp only [Pi.add_apply] at hmono + rw [integral_add hiA (hJ.div_const _), hIA, integral_div] at hmono + have he := div_le_div_of_nonneg_right henergy (by positivity : 0 ≤ 2 * L) + have hc : 4 * L ^ 2 * μ.real A / (2 * L) = 2 * L * μ.real A := by field_simp; ring + rw [hc] at he + nlinarith [(measureReal_nonneg : 0 ≤ μ.real A)] + +end RPIKernel + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +open scoped ENNReal Topology ContDiff +namespace RPISingularHarnack +open RPI RPI.Boundary Classical + +theorem wholeBoundary_sublevel_L1 {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + {h : Euc n → ℝ} {G : Euc n → Euc n} + (hSob : WholeBoundarySobolev E h G) (hSuper : WholeBoundarySupersolution E G) + (hh01 : ∀ᵐ x ∂boundaryArea E, 0 ≤ h x ∧ h x ≤ 1) + {R r ε k N : ℝ} (hR : 0 < R) (hrR : r ≤ R) (hε : 0 < ε) (hk : 0 < k) (hN : 0 < N) + {η : Euc n → ℝ} (hη : ContDiff ℝ ∞ η) (hcη : HasCompactSupport η) + (hsη : tsupport η ⊆ Metric.ball 0 r) (hη01 : ∀ x, η x ∈ Icc (0 : ℝ) 1) + (hD : ∀ x, ‖tangentialGradient E η x‖ ≤ N) : + (∫⁻ x in Metric.ball 0 R, ENNReal.ofReal + ‖(2 * η x * sublevelTest ε k (h x)) • tangentialGradient E η x - + (η x ^ 2 * sublevelSlope ε k (h x)) • G x‖ ∂boundaryArea E) ≤ + ENNReal.ofReal (5 * k * N) * boundaryArea E (Metric.ball 0 r ∩ {x | h x < k}) := by + classical + let μ := (boundaryArea E).restrict (Metric.ball 0 R) + let : IsFiniteMeasure μ := ⟨by + simpa only [μ, Measure.restrict_apply_univ] using minimizing_boundaryArea_ball_lt_top hn hmin 0 hR⟩ + have hsR := hsη.trans (Metric.ball_subset_ball hrR) + have hh := (hSob R hR).1 + have hG := (hSob R hR).2.1 + let A := Metric.ball (0 : Euc n) r ∩ {x | h x < k} + have hAm : NullMeasurableSet A μ := measurableSet_ball.nullMeasurableSet.inter + (nullMeasurableSet_lt hh.aestronglyMeasurable.aemeasurable aemeasurable_const) + let J := fun x ↦ η x ^ 2 * sublevelSlope ε k (h x) * ‖G x‖ ^ 2 + let B := fun x ↦ (2 * η x * sublevelTest ε k (h x)) • tangentialGradient E η x - + (η x ^ 2 * sublevelSlope ε k (h x)) • G x + have hχc : Continuous (sublevelSlope ε k) := by unfold sublevelSlope; fun_prop + have hJm : AEStronglyMeasurable J μ := + ((hη.continuous.aestronglyMeasurable.pow 2).mul (hχc.comp_aestronglyMeasurable hh.aestronglyMeasurable)).mul (hG.aestronglyMeasurable.norm.pow 2) + have hJ : Integrable J μ := ((memLp_two_iff_integrable_sq_norm hG.aestronglyMeasurable).mp hG).mono' hJm (by + filter_upwards [] with x + have ha0 := (hη01 x).1 + have ha1 := (hη01 x).2 + have hc0 := (sublevelSlope_mem_Icc ε k (h x)).1 + have hc1 := (sublevelSlope_mem_Icc ε k (h x)).2 + rw [Real.norm_of_nonneg (by dsimp [J]; positivity)] + have hb : η x ^ 2 * sublevelSlope ε k (h x) ≤ 1 := by nlinarith [sq_nonneg (η x)] + simpa only [one_mul] using mul_le_mul_of_nonneg_right hb (sq_nonneg ‖G x‖)) + have hBA : MemLp B 2 μ := by + have H := (wholeBoundary_nonlinear_approximation hn hmin hSob hh01 hR hη hcη hsR + (sublevelTest_contDiff ε k) (sublevelTest_nonneg hε k) (sublevelTest_lipschitz ε k) + (show (0 : ℝ) ≤ 1 by norm_num) (fun t ↦ by + rw [(sublevelTest_hasDerivAt ε k t).deriv, norm_neg, + Real.norm_of_nonneg (sublevelSlope_mem_Icc ε k t).1] + exact (sublevelSlope_mem_Icc ε k t).2)).1 + simpa only [B, μ, (sublevelTest_hasDerivAt ε k _).deriv, mul_neg, neg_smul, sub_eq_add_neg] using H + have hB : Integrable B μ := memLp_one_iff_integrable.mp (hBA.mono_exponent (by norm_num)) + have hz {x : Euc n} (hx : x ∉ Metric.ball 0 r) : η x = 0 ∧ tangentialGradient E η x = 0 := by + have ht : x ∉ tsupport η := fun ht ↦ hx (hsη ht) + exact ⟨image_eq_zero_of_notMem_tsupport ht, tangentialGradient_eq_zero_of_notMem_tsupport E ht⟩ + have hpoint : ∀ᵐ x ∂μ, ‖B x‖ ≤ (if x ∈ A then (5 / 2 : ℝ) * (k * N) else 0) + J x / (2 * (k * N)) := by + filter_upwards [ae_restrict_of_ae hh01] with x hx + by_cases hxr : x ∈ Metric.ball 0 r + · by_cases hxk : h x < k + · simp only [A, mem_inter_iff, mem_ofPred_eq, hxr, hxk, and_self, ite_true] + exact RPIKernel.weighted_sublevel_gradient_bound (G x) (tangentialGradient E η x) + (hη01 x) (sublevelSlope_mem_Icc ε k (h x)) (sublevelTest_nonneg hε k (h x)) + (sublevelTest_controls hε hk.le hx.1) hk hN (hD x) + · simp [B, J, A, hxk, sublevelTest_eq_zero hε (le_of_not_gt hxk), + sublevelSlope_eq_zero hε (le_of_not_gt hxk)] + · obtain ⟨hηx, hDx⟩ := hz hxr + simp [B, J, A, hxr, hηx, hDx] + have hi : Integrable (fun x ↦ if h x < k then k ^ 2 * ‖tangentialGradient E η x‖ ^ 2 else 0) μ := by + have hm : NullMeasurableSet {x | h x < k} μ := nullMeasurableSet_lt hh.aestronglyMeasurable.aemeasurable aemeasurable_const + exact ((memLp_two_iff_integrable_sq_norm + (tangentialGradient_memLp_on_ball hn hmin hR (hη.of_le (by simp))).aestronglyMeasurable).mp + (tangentialGradient_memLp_on_ball hn hmin hR (hη.of_le (by simp)))).const_mul (k ^ 2) |>.indicator₀ hm + have hconst : Integrable (A.indicator (fun _ ↦ (k * N) ^ 2)) μ := (integrable_const _).indicator₀ hAm + have hcost : (∫ x, (if h x < k then k ^ 2 * ‖tangentialGradient E η x‖ ^ 2 else 0) ∂μ) ≤ + (k * N) ^ 2 * μ.real A := by + calc + _ ≤ ∫ x, A.indicator (fun _ ↦ (k * N) ^ 2) x ∂μ := by + apply integral_mono_ae hi hconst + exact ae_of_all _ fun x ↦ by + by_cases hxr : x ∈ Metric.ball 0 r + · by_cases hxk : h x < k + · simp only [A, mem_inter_iff, mem_ofPred_eq, hxr, hxk, and_self, ite_true, indicator_of_mem] + nlinarith [sq_le_sq₀ (norm_nonneg (tangentialGradient E η x)) hN.le |>.mpr (hD x)] + · simp [A, hxk] + · simp [A, hxr, (hz hxr).2] + _ = _ := by rw [integral_indicator₀ hAm, setIntegral_const]; simp [Measure.real, smul_eq_mul, mul_comm] + have henergy := wholeBoundary_sublevel_energy hn hmin hSob hSuper hh01 hR hη hcη hsR hε hk.le + have hreal := RPIKernel.integral_norm_sublevel_bound μ hAm hB hJ (mul_pos hk hN) (by + filter_upwards [hpoint] with x hx + by_cases hxA : x ∈ A <;> simpa only [hxA, ↓reduceIte] using hx) + (by simpa only [μ, J, mul_assoc] using + henergy.trans (mul_le_mul_of_nonneg_left hcost (by norm_num : (0 : ℝ) ≤ 4))) + have hμA : μ A = boundaryArea E A := by + change (boundaryArea E).restrict (Metric.ball 0 R) A = _ + rw [Measure.restrict_apply₀ hAm] + congr 1 + exact inter_eq_left.mpr (fun x hx ↦ Metric.ball_subset_ball hrR hx.1) + calc + _ = ENNReal.ofReal (∫ x, ‖B x‖ ∂μ) := by + symm + simpa only [ofReal_norm] using ofReal_integral_norm_eq_lintegral_enorm hB + _ ≤ ENNReal.ofReal (5 * (k * N) * μ.real A) := ENNReal.ofReal_le_ofReal hreal + _ = _ := by + rw [ENNReal.ofReal_mul (by positivity : 0 ≤ 5 * (k * N)), Measure.real, + ENNReal.ofReal_toReal (measure_ne_top μ A), hμA, mul_assoc] + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +open scoped ENNReal Topology ContDiff +namespace RPISingularHarnack +open RPI RPI.Boundary + +theorem exists_interior_cutoff_constant : ∃ L : ℝ, 0 < L ∧ ∀ (n : ℕ) (E : Set (Euc n)) + (s r : ℝ), 0 < s → s < r → ∃ η : Euc n → ℝ, + ContDiff ℝ ∞ η ∧ HasCompactSupport η ∧ tsupport η ⊆ Metric.ball 0 r ∧ + (∀ x, η x ∈ Icc (0 : ℝ) 1) ∧ (∀ x ∈ Metric.ball 0 s, η x = 1) ∧ + (∀ x, ‖tangentialGradient E η x‖ ≤ L / (r - s)) := by + obtain ⟨M, hM, hb⟩ := exists_smoothTransition_deriv_bound + refine ⟨8 * M, by positivity, ?_⟩ + intro n E s r hs hsr + let b := (s + r) / 2 + have hsb : s < b := by dsimp [b]; linarith + have hbr : b < r := by dsimp [b]; linarith + have hb0 : 0 < b := hs.trans hsb + let η := fun x : Euc n ↦ 1 - annularCutoff 0 s b x + have hη : ContDiff ℝ ∞ η := contDiff_const.sub (annularCutoff_contDiff 0 s b) + have hts : tsupport η ⊆ Metric.closedBall 0 b := by + apply closure_minimal + · intro x hx + by_contra hxb + have hdist : b ≤ dist x 0 := le_of_lt (lt_of_not_ge hxb) + exact hx (by dsimp [η]; rw [annularCutoff_one hs hsb hdist, sub_self]) + · exact Metric.isClosed_closedBall + have hgrad (x : Euc n) : gradient η x = -gradient (annularCutoff 0 s b) x := by + simp only [η, gradient, fderiv_const_sub, map_neg] + refine ⟨η, hη, (isCompact_closedBall (0 : Euc n) b).of_isClosed_subset (isClosed_tsupport _) hts, + hts.trans (Metric.closedBall_subset_ball hbr), ?_, ?_, ?_⟩ + · intro x + have h := annularCutoff_mem_Icc (0 : Euc n) s b x + dsimp [η] + exact ⟨by linarith [h.2], by linarith [h.1]⟩ + · intro x hx + dsimp [η] + rw [annularCutoff_zero hs hsb (Metric.mem_ball.mp hx).le, sub_zero] + · intro x + have hden : 0 < b ^ 2 - s ^ 2 := by nlinarith + have hwidth : 0 < r - s := sub_pos.mpr hsr + calc + _ ≤ 2 * ‖gradient η x‖ := tangentialGradient_norm_le_twice E η x + _ = 2 * ‖gradient (annularCutoff 0 s b) x‖ := by rw [hgrad, norm_neg] + _ ≤ 2 * (2 * M * b / (b ^ 2 - s ^ 2)) := + mul_le_mul_of_nonneg_left (gradient_annularCutoff_bound hs hsb hM hb x) (by norm_num) + _ ≤ 8 * M / (r - s) := by + rw [← mul_div_assoc, div_le_div_iff₀ hden hwidth] + have hbs : b - s = (r - s) / 2 := by dsimp [b]; ring + have hp : 0 ≤ M * s * (r - s) := by positivity + have heq : 8 * M * (b ^ 2 - s ^ 2) - 2 * (2 * M * b) * (r-s) = 4 * M * s * (r-s) := by + dsimp [b] + ring + nlinarith + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +open scoped ENNReal Topology ContDiff +namespace RPIIteration + +lemma sublevel_step_division {a b C d p : ℝ} (hd : 0 < d) (hb : 0 ≤ b) + (h : d ^ p * a ≤ C * b ^ p) : a ≤ C * (b / d) ^ p := by + have hdp := Real.rpow_pos_of_pos hd p + rw [Real.div_rpow hb hd.le, ← mul_div_assoc, le_div_iff₀ hdp] + rwa [mul_comm] + +lemma sublevel_step_factor {C L k l s r a p : ℝ} (hC : 0 ≤ C) (hL : 0 < L) + (hk : 0 < k) (hkl : l < k) (hsr : s < r) (ha : 0 ≤ a) : + C * (5 * k * (L / (r-s)) * a / ((k-l) / 2)) ^ p ≤ + ((C + 1) * (10 * L) ^ p) * (k / ((r-s) * (k-l))) ^ p * a ^ p := by + have heq : 5 * k * (L / (r-s)) * a / ((k-l)/2) = + (10 * L) * (k / ((r-s) * (k-l))) * a := by field_simp; ring + rw [heq, Real.mul_rpow (by positivity) ha, + Real.mul_rpow (by positivity) (by positivity)] + have hc : C ≤ C + 1 := by linarith + calc + _ ≤ (C + 1) * ((10 * L) ^ p * (k / ((r-s) * (k-l))) ^ p * a ^ p) := by + exact mul_le_mul hc le_rfl (by positivity) (add_nonneg hC zero_le_one) + _ = _ := by ring + +end RPIIteration + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/TendstoWeightedHalfspaceBlowup.lean b/lean/OAI/Geometry/Perimeter/Regularity/TendstoWeightedHalfspaceBlowup.lean new file mode 100644 index 0000000000000000000000000000000000000000..a72cb060ccd6e789ddf10ab51e79de5f17912465 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/TendstoWeightedHalfspaceBlowup.lean @@ -0,0 +1,548 @@ +import OAI.Geometry.Perimeter.Regularity.SurfaceGradientConstSub +import OAI.Geometry.Perimeter.Regularity.AnnularCutoffTestAdmissible + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem tendsto_weighted_halfspaceBlowup {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) {c v : Euc n} (hv : HasHalfspaceBlowup E c v) : + Tendsto (fun r : ℝ ↦ ∫ z in Metric.ball (0 : Euc n) 1, + E.indicator (fun _ ↦ (1 : ℝ)) (c + r • z) * divergence (radialNormalTest v) z) + (𝓝[>] (0 : ℝ)) (𝓝 (∫ z, radialFlux v z)) := by + let μ := (volume : Measure (Euc n)).restrict (Metric.ball 0 1) + let χ : ℝ → Euc n → ℝ := fun r z ↦ E.indicator (fun _ ↦ (1 : ℝ)) (c + r • z) + let H : Set (Euc n) := {z | inner ℝ z v < 0} + let ψ : Euc n → ℝ := H.indicator (fun _ ↦ (1 : ℝ)) + let dV : Euc n → ℝ := divergence (radialNormalTest v) + have hH : MeasurableSet H := + (isOpen_lt (continuous_id.inner continuous_const) continuous_const).measurableSet + have hχ : ∀ r, Integrable (χ r) μ := integrable_rescaled_indicator hE c + have hψ : Integrable ψ μ := + (integrableOn_const measure_ball_lt_top.ne (C := (1 : ℝ))).indicator hH + have hdV : Continuous dV := continuous_divergence (radialNormalTest_contDiff v) + have hcV : HasCompactSupport dV := (radialNormalTest_admissible hv.1).2.1.of_isClosed_subset + (isClosed_tsupport _) (tsupport_divergence_subset _) + obtain ⟨D, hD⟩ := hcV.exists_bound_of_continuous hdV + have hχV : ∀ r, Integrable (fun z ↦ χ r z * dV z) μ := fun r ↦ + (hχ r).mul_bdd hdV.aestronglyMeasurable (Eventually.of_forall hD) + have hψV : Integrable (fun z ↦ ψ z * dV z) μ := + hψ.mul_bdd hdV.aestronglyMeasurable (Eventually.of_forall hD) + have hconv : Tendsto (fun r ↦ ∫ z, |χ r z - ψ z| ∂μ) (𝓝[>] (0 : ℝ)) (𝓝 0) := by + apply hv.2.congr' + filter_upwards [self_mem_nhdsWithin] with r hr + rw [normalized_ball_integral _ c hr] + apply integral_congr_ae + filter_upwards [] with z + simp only [χ, ψ, H, halfspace_indicator_rescale c v z hr] + have hbound : ∀ r, ‖(∫ z, χ r z * dV z ∂μ) - ∫ z, ψ z * dV z ∂μ‖ ≤ + D * ∫ z, |χ r z - ψ z| ∂μ := by + intro r + calc + _ = ‖∫ z, (χ r z - ψ z) * dV z ∂μ‖ := by + simp_rw [sub_mul] + rw [integral_sub (hχV r) hψV] + _ ≤ ∫ z, D * |χ r z - ψ z| ∂μ := by + apply norm_integral_le_of_norm_le ((hχ r |>.sub hψ).abs.const_mul D) + filter_upwards [] with z + rw [norm_mul, Real.norm_eq_abs] + exact (mul_le_mul_of_nonneg_left (hD z) (abs_nonneg _)).trans_eq (mul_comm _ _) + _ = _ := integral_const_mul _ _ + have hl : Tendsto (fun r ↦ ∫ z, χ r z * dV z ∂μ) (𝓝[>] (0 : ℝ)) + (𝓝 (∫ z, ψ z * dV z ∂μ)) := by + apply tendsto_iff_norm_sub_tendsto_zero.mpr + exact squeeze_zero (fun _ ↦ norm_nonneg _) hbound (by simpa using hconv.const_mul D) + have heq : (∫ z, ψ z * dV z ∂μ) = ∫ z, radialFlux v z := by + calc + _ = ∫ z in Metric.ball (0 : Euc n) 1, radialFlux v z := by + apply integral_congr_ae + filter_upwards [] with z + rw [radialFlux_eq_indicator] + by_cases hz : z ∈ H <;> simp [ψ, H, dV, hz] + _ = _ := setIntegral_eq_integral_of_forall_compl_eq_zero (fun z hz ↦ + image_eq_zero_of_notMem_tsupport (fun h ↦ hz + ((radialFlux_support v).trans (Metric.closedBall_subset_ball (by norm_num)) h))) + rw [heq] at hl + exact hl + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem exists_halfspace_perimeter_lower_density_constant (n : ℕ) (hn : 0 < n) : + ∃ c₀ : ℝ, 0 < c₀ ∧ ∀ E : Set (Euc n), MeasurableSet E → + ∀ x v, HasHalfspaceBlowup E x v → + ∀ᶠ r : ℝ in 𝓝[>] (0 : ℝ), + ENNReal.ofReal (c₀ * r ^ (n - 1)) ≤ perimeter E (Metric.ball x r) := by + obtain ⟨c₁, hc₁, hflux⟩ := exists_uniform_radialFlux_lower n hn + refine ⟨c₁ / 2, by positivity, ?_⟩ + intro E hE x v hv + have hconv := tendsto_weighted_halfspaceBlowup hE hv + have hlt : c₁ / 2 < ∫ z, radialFlux v z := by + have hh := hflux v hv.1 + linarith + have hevent := hconv.eventually (Ioi_mem_nhds hlt) + filter_upwards [hevent, self_mem_nhdsWithin] with r hr0 hr + change 0 < r at hr + change c₁ / 2 < _ at hr0 + calc + _ ≤ ENNReal.ofReal (∫ y in E, divergence (ballNormalTest x r v) y) := by + apply ENNReal.ofReal_le_ofReal + rw [ballNormalTest_integral hn E hE x hr v] + exact (mul_le_mul_of_nonneg_right hr0.le (pow_nonneg hr.le _)).trans_eq (mul_comm _ _) + _ ≤ perimeter E (Metric.ball x r) := by + rw [perimeter_eq_iSup_tests] + exact le_iSup_of_le (ballNormalTest x r v) + (le_iSup_of_le (ballNormalTest_admissible x hr hv.1) le_rfl) + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem perimeter_finset_disjoint_superadditive {n : ℕ} (E : Set (Euc n)) + {ι : Type*} (s : Finset ι) (U : ι → Set (Euc n)) + (hU : (s : Set ι).PairwiseDisjoint U) : + ∑ i ∈ s, perimeter E (U i) ≤ perimeter E (⋃ i ∈ s, U i) := by + classical + induction s using Finset.induction_on with + | empty => simp only [Finset.sum_empty]; exact bot_le + | @insert a s ha ih => + rw [Finset.sum_insert ha] + have hs : (s : Set ι).PairwiseDisjoint U := (fun i hi j hj h ↦ hU (by simp [hi]) (by simp [hj]) h) + have hd : Disjoint (U a) (⋃ i ∈ s, U i) := by + rw [Set.disjoint_iUnion_right] + intro i + rw [Set.disjoint_iUnion_right] + intro hi + exact hU (by simp) (by simp [hi]) (by intro h; subst i; exact ha hi) + calc + _ ≤ perimeter E (U a) + perimeter E (⋃ i ∈ s, U i) := add_le_add le_rfl (ih hs) + _ ≤ perimeter E (⋃ i ∈ insert a s, U i) := + perimeter_disjoint_superadditive E + (by intro x hx; exact mem_iUnion.mpr ⟨a, mem_iUnion.mpr ⟨by simp, hx⟩⟩) + (by intro x hx; simpa only [Finset.mem_insert, iUnion_iUnion_eq_or_left] using + (show x ∈ U a ∪ ⋃ i ∈ s, U i from Or.inr hx)) hd + +theorem perimeter_tsum_disjoint_le {n : ℕ} (E : Set (Euc n)) + {ι : Type*} (U : ι → Set (Euc n)) (Z : Set (Euc n)) + (hU : Pairwise (fun i j ↦ Disjoint (U i) (U j))) (hUZ : ∀ i, U i ⊆ Z) : + ∑' i, perimeter E (U i) ≤ perimeter E Z := by + apply ENNReal.summable.tsum_le_of_sum_le + intro s + exact (perimeter_finset_disjoint_superadditive E s U + (fun _ _ _ _ h ↦ hU h)).trans + (raw_perimeter_mono_region E (by simp only [iUnion_subset_iff]; intro i hi; exact hUZ i)) + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem exists_perimeter_vitali_cover {n : ℕ} (E S : Set (Euc n)) + {c₀ : ℝ} (hc₀ : 0 < c₀) + (hdensity : ∀ x ∈ S, ∀ᶠ r : ℝ in 𝓝[>] (0 : ℝ), + ENNReal.ofReal (c₀ * r ^ (n - 1)) ≤ perimeter E (Metric.ball x r)) + (c : Euc n) {R δ : ℝ} (hR : 0 < R) (hδ : 0 < δ) : + ∃ (u : Set (Euc n)) (r : Euc n → ℝ), u.Countable ∧ + (∀ x ∈ u, 0 < r x ∧ r x ≤ δ) ∧ + (S ∩ Metric.ball c R ⊆ ⋃ x ∈ u, Metric.ball x (4 * r x)) ∧ + (∑' x : u, (ENNReal.ofReal (r x)) ^ (n - 1)) ≤ + (ENNReal.ofReal c₀)⁻¹ * perimeter E (Metric.ball c (2 * R)) := by + classical + let t := S ∩ Metric.ball c R + have hchoose : ∀ x ∈ t, ∃ r : ℝ, 0 < r ∧ r ≤ min δ R ∧ + ENNReal.ofReal (c₀ * r ^ (n - 1)) ≤ perimeter E (Metric.ball x r) := by + intro x hx + have hev := hdensity x hx.1 + have hsmall : ∀ᶠ r : ℝ in 𝓝[>] (0 : ℝ), r < min δ R := + (eventually_lt_nhds (lt_min hδ hR)).filter_mono nhdsWithin_le_nhds + obtain ⟨r, hr, hden, hsm⟩ := + ((show ∀ᶠ r : ℝ in 𝓝[>] (0 : ℝ), 0 < r from self_mem_nhdsWithin).and (hev.and hsmall)).exists + exact ⟨r, hr, hsm.le, hden⟩ + have htotal : ∀ x : Euc n, ∃ r : ℝ, 0 < r ∧ r ≤ min δ R ∧ + (x ∈ t → ENNReal.ofReal (c₀ * r ^ (n - 1)) ≤ perimeter E (Metric.ball x r)) := by + intro x + by_cases hx : x ∈ t + · obtain ⟨r, hr, hrb, hd⟩ := hchoose x hx + exact ⟨r, hr, hrb, fun _ ↦ hd⟩ + · exact ⟨min δ R / 2, by positivity, by linarith [lt_min hδ hR], + (show x ∈ t → ENNReal.ofReal (c₀ * (min δ R / 2) ^ (n - 1)) ≤ + perimeter E (Metric.ball x (min δ R / 2)) from fun h ↦ False.elim (hx h))⟩ + choose r hr using htotal + obtain ⟨u, hut, hud, hcover⟩ := + Vitali.exists_disjoint_subfamily_covering_enlargement_ball t id r (min δ R) + (fun x hx ↦ (hr x).2.1) 4 (by norm_num) + have huc : u.Countable := hud.countable_of_isOpen (fun _ _ ↦ Metric.isOpen_ball) + (fun x hx ↦ ⟨x, Metric.mem_ball_self (hr x).1⟩) + refine ⟨u, r, huc, ?_, ?_, ?_⟩ + · intro x hx + exact ⟨(hr x).1, (hr x).2.1.trans (min_le_left _ _)⟩ + · intro x hx + obtain ⟨y, hy, hxy⟩ := hcover x hx + exact mem_iUnion.mpr ⟨y, mem_iUnion.mpr ⟨hy, hxy (Metric.mem_ball_self (hr x).1)⟩⟩ + · have hballs : ∀ x : u, Metric.ball (x : Euc n) (r x) ⊆ Metric.ball c (2 * R) := by + intro x y hy + have hx := (hut x.property).2 + simp only [Metric.mem_ball] at hx hy ⊢ + have hrR := (hr x).2.1.trans (min_le_right δ R) + calc dist y c ≤ dist y x + dist (x : Euc n) c := dist_triangle _ _ _ + _ < 2 * R := by linarith + have hsum := perimeter_tsum_disjoint_le E + (fun x : u ↦ Metric.ball (x : Euc n) (r x)) (Metric.ball c (2 * R)) + (fun x y h ↦ hud x.property y.property (fun hxy ↦ h (Subtype.ext hxy))) hballs + have hweigh : ENNReal.ofReal c₀ * ∑' x : u, ENNReal.ofReal (r x) ^ (n - 1) ≤ + perimeter E (Metric.ball c (2 * R)) := by + rw [← ENNReal.tsum_mul_left] + apply le_trans (ENNReal.tsum_le_tsum (fun x : u ↦ ?_)) hsum + rw [← ENNReal.ofReal_pow (hr x).1.le, ← ENNReal.ofReal_mul hc₀.le] + exact (hr x).2.2 (hut x.property) + calc + _ = (ENNReal.ofReal c₀)⁻¹ * + (ENNReal.ofReal c₀ * ∑' x : u, ENNReal.ofReal (r x) ^ (n - 1)) := by + rw [← mul_assoc, ENNReal.inv_mul_cancel (ENNReal.ofReal_ne_zero_iff.mpr hc₀) + ENNReal.ofReal_ne_top, one_mul] + _ ≤ _ := mul_le_mul le_rfl hweigh (by positivity) (by positivity) + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem hausdorffMeasure_le_perimeter_of_lower_density {n : ℕ} (E S : Set (Euc n)) + {c₀ : ℝ} (hc₀ : 0 < c₀) + (hdensity : ∀ x ∈ S, ∀ᶠ r : ℝ in 𝓝[>] (0 : ℝ), + ENNReal.ofReal (c₀ * r ^ (n - 1)) ≤ perimeter E (Metric.ball x r)) + (c : Euc n) {R : ℝ} (hR : 0 < R) : + Measure.hausdorffMeasure (n - 1 : ℕ) (S ∩ Metric.ball c R) ≤ + (8 : ℝ≥0∞) ^ (n - 1) * (ENNReal.ofReal c₀)⁻¹ * + perimeter E (Metric.ball c (2 * R)) := by + classical + let δ : ℕ → ℝ := fun j ↦ 1 / (j + 1) + have hδ : ∀ j, 0 < δ j := fun j ↦ by dsimp [δ]; positivity + choose u r hcount hr hcover hsum using fun j ↦ + exists_perimeter_vitali_cover E S hc₀ hdensity c hR (hδ j) + let : ∀ j, Countable (u j) := fun j ↦ (hcount j).to_subtype + have hediam : ∀ j (x : u j), + Metric.ediam (Metric.ball (x : Euc n) (4 * r j x)) ≤ + ENNReal.ofReal (8 * r j x) := by + intro j x + apply Metric.ediam_le + intro y hy z hz + rw [edist_dist] + apply ENNReal.ofReal_le_ofReal + simp only [Metric.mem_ball] at hy hz + calc dist y z ≤ dist y x + dist z x := dist_triangle_right _ _ _ + _ ≤ 8 * r j x := by linarith + have hδlim : Tendsto (fun j ↦ ENNReal.ofReal (8 * δ j)) atTop (𝓝 0) := by + have hh : Tendsto δ atTop (𝓝 0) := tendsto_one_div_add_atTop_nhds_zero_nat + simpa only [Function.comp_def, mul_zero, ENNReal.ofReal_zero] using ENNReal.continuous_ofReal.continuousAt.tendsto.comp (hh.const_mul 8) + have hh := Measure.hausdorffMeasure_le_liminf_tsum ((n - 1 : ℕ) : ℝ) + (S ∩ Metric.ball c R) (fun j ↦ ENNReal.ofReal (8 * δ j)) hδlim + (fun j (x : u j) ↦ Metric.ball (x : Euc n) (4 * r j x)) + (Filter.Eventually.of_forall (fun j x ↦ + (hediam j x).trans (ENNReal.ofReal_le_ofReal (by + have h := (hr j x x.property).2; linarith)))) + (Filter.Eventually.of_forall (fun j ↦ by simpa only [iUnion_subtype] using hcover j)) + apply hh.trans + refine Filter.liminf_le_of_frequently_le ?_ (by isBoundedDefault) + apply Filter.Eventually.frequently + apply Filter.Eventually.of_forall + intro j + calc + _ ≤ ∑' x : u j, (8 : ℝ≥0∞) ^ (n - 1) * + ENNReal.ofReal (r j x) ^ (n - 1) := by + apply ENNReal.tsum_le_tsum + intro x + rw [ENNReal.rpow_natCast] + calc + _ ≤ (ENNReal.ofReal (8 * r j x)) ^ (n - 1) := pow_le_pow_left' (hediam j x) _ + _ = _ := by rw [ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 8), mul_pow]; norm_num + _ = (8 : ℝ≥0∞) ^ (n - 1) * ∑' x : u j, ENNReal.ofReal (r j x) ^ (n - 1) := + ENNReal.tsum_mul_left + _ ≤ _ := by simpa only [mul_assoc] using mul_le_mul le_rfl (hsum j) (by positivity) (by positivity) + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack + +theorem exists_minimizing_surfaceMeasure_growth_of_halfspace {n : ℕ} (hn : 8 ≤ n) + {E Z : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (hZd : dimH Z ≤ (n - 8 : ℕ)) + (hhalf : ∀ x ∈ perimeterSupport E \ Z, ∃ v, HasHalfspaceBlowup E x v) : + ∃ A : ℝ, 0 < A ∧ ∀ (c : Euc n) (r : ℝ), 0 < r → + RPI.Boundary.surfaceMeasure (perimeterSupport E) (Metric.ball c r) ≤ + ENNReal.ofReal (A * r ^ (n - 1)) := by + obtain ⟨c₀, hc₀, hdensity₀⟩ := exists_halfspace_perimeter_lower_density_constant n (by omega) + obtain ⟨C, hC, hperim⟩ := exists_locallyMinimizing_perimeter_growth_constant n (by omega) + have hdensity : ∀ x ∈ perimeterSupport E \ Z, ∀ᶠ r : ℝ in 𝓝[>] (0 : ℝ), + ENNReal.ofReal (c₀ * r ^ (n - 1)) ≤ perimeter E (Metric.ball x r) := by + intro x hx + obtain ⟨v, hv⟩ := hhalf x hx + exact hdensity₀ E hmin.1 x v hv + have hZnull : Measure.hausdorffMeasure (n - 1 : ℕ) Z = 0 := by + apply hausdorffMeasure_of_dimH_lt (d := (n - 1 : ℕ)) + apply hZd.trans_lt + exact_mod_cast (show n - 8 < n - 1 by omega) + let K : ℝ≥0∞ := (8 : ℝ≥0∞) ^ (n - 1) * (ENNReal.ofReal c₀)⁻¹ * + ENNReal.ofReal C * (2 : ℝ≥0∞) ^ (n - 1) + have hK : K ≠ ⊤ := by + unfold K + exact ENNReal.mul_ne_top (ENNReal.mul_ne_top + (ENNReal.mul_ne_top (by finiteness) + (ENNReal.inv_ne_top.mpr (ENNReal.ofReal_ne_zero_iff.mpr hc₀))) + ENNReal.ofReal_ne_top) (by finiteness) + have hraw : ∀ (c : Euc n) (r : ℝ), 0 < r → + Measure.hausdorffMeasure (n - 1 : ℕ) (Metric.ball c r ∩ perimeterSupport E) ≤ + K * ENNReal.ofReal r ^ (n - 1) := by + intro c r hr + have heq : (Metric.ball c r ∩ perimeterSupport E) \ Z = + (perimeterSupport E \ Z) ∩ Metric.ball c r := by ext x; simp only [Set.mem_sdiff, mem_inter_iff]; tauto + rw [← measure_sdiff_null hZnull, heq] + calc + _ ≤ (8 : ℝ≥0∞) ^ (n - 1) * (ENNReal.ofReal c₀)⁻¹ * + perimeter E (Metric.ball c (2 * r)) := + hausdorffMeasure_le_perimeter_of_lower_density E (perimeterSupport E \ Z) hc₀ hdensity c hr + _ ≤ (8 : ℝ≥0∞) ^ (n - 1) * (ENNReal.ofReal c₀)⁻¹ * + ENNReal.ofReal (C * (2 * r) ^ (n - 1)) := by + exact mul_le_mul le_rfl (hperim E hmin c (2 * r) (by positivity)) (by positivity) (by positivity) + _ = _ := by + rw [ENNReal.ofReal_mul hC.le, ENNReal.ofReal_pow (by positivity), + ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 2)] + norm_num only [ENNReal.ofReal_ofNat] + simp only [K, mul_pow, mul_assoc] + let a : ℝ≥0∞ := (Measure.addHaarScalarFactor (volume : Measure (Euc (n - 1))) + (Measure.hausdorffMeasure ((n - 1 : ℕ) : ℝ)) : ℝ≥0∞) + let A : ℝ := (a * K).toReal + 1 + have hA : 0 < A := by dsimp [A]; positivity + refine ⟨A, hA, ?_⟩ + intro c r hr + have haK : a * K ≤ ENNReal.ofReal A := by + rw [← ENNReal.ofReal_toReal (ENNReal.mul_ne_top ENNReal.coe_ne_top hK)] + exact ENNReal.ofReal_le_ofReal (by dsimp [A]; linarith) + rw [RPI.Boundary.surfaceMeasure, Measure.restrict_apply measurableSet_ball, + Measure.euclideanHausdorffMeasure_def, Measure.smul_apply, ENNReal.smul_def] + change a * Measure.hausdorffMeasure (n - 1 : ℕ) (Metric.ball c r ∩ perimeterSupport E) ≤ _ + calc + _ ≤ a * (K * ENNReal.ofReal r ^ (n - 1)) := + mul_le_mul le_rfl (hraw c r hr) (by positivity) (by positivity) + _ ≤ ENNReal.ofReal A * ENNReal.ofReal r ^ (n - 1) := by + rw [← mul_assoc] + exact mul_le_mul haK le_rfl (by positivity) (by positivity) + _ = _ := by rw [ENNReal.ofReal_mul hA.le, ENNReal.ofReal_pow hr.le] + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPISingularHarnack +open RPI RPI.Boundary + +theorem min_wholeBoundarySobolev_and_supersolution_of_minimizing_regular_geometry + {n : ℕ} (hn : 8 ≤ n) {E Z : Set (Euc n)} + (hmin : IsLocallyPerimeterMinimizing E) + (hZ : IsClosed Z) (hZd : dimH Z ≤ (n - 8 : ℕ)) + (hreg : ∀ x ∈ perimeterSupport E \ Z, ∃ U : Set (Euc n), IsOpen U ∧ x ∈ U ∧ + ∃ f : Euc n → ℝ, ContDiffOn ℝ ∞ f U ∧ + (∀ y ∈ U, fderiv ℝ f y ≠ 0) ∧ + (∀ y ∈ U, y ∈ perimeterSupport E ↔ f y = 0) ∧ + (∀ y ∈ U, (f y < 0 → y ∈ E) ∧ (y ∈ E → f y ≤ 0))) + {W : Euc n → ℝ} {D : Euc n → Euc n} + (htrace : ∀ x ∈ perimeterSupport E \ Z, HasSmoothTraceJetAt (perimeterSupport E) W D x) + (hW0 : ∀ x ∈ perimeterSupport E \ Z, 0 ≤ W x) + (hsup : ∀ φ : Euc n → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → + Disjoint (tsupport φ) Z → (∀ x, 0 ≤ φ x) → + 0 ≤ ∫ x, inner ℝ (D x) (surfaceGradient (perimeterSupport E) φ x) + ∂surfaceMeasure (perimeterSupport E)) : + WholeBoundarySobolev E (fun x ↦ min (W x) 1) (truncatedGradient W D) ∧ + WholeBoundarySupersolution E (truncatedGradient W D) := by + have hhalf : ∀ x ∈ perimeterSupport E \ Z, ∃ v, HasHalfspaceBlowup E x v := by + intro x hx + obtain ⟨U, hU, hxU, f, hf, hdf, hs, he⟩ := hreg x hx + refine ⟨_, hasHalfspaceBlowup_gradient_filled hmin.1 + ((hf.contDiffAt (hU.mem_nhds hxU)).differentiableAt (by norm_num)) + ((hs x hxU).mp hx.1) (hdf x hxU) ?_⟩ + filter_upwards [hU.mem_nhds hxU] with y hy using he y hy + obtain ⟨A, hA, harea⟩ := exists_minimizing_surfaceMeasure_growth_of_halfspace hn hmin hZd hhalf + apply min_wholeBoundarySobolev_and_supersolution_of_regular_geometry hn hmin.1 hZ hZd + (fun R hR ↦ (harea 0 R hR).trans_lt ENNReal.ofReal_lt_top) _ hreg htrace hW0 hsup + intro R hR + refine ⟨A, 1, hA, by norm_num, ?_⟩ + intro c hc r hr hrr + exact (Measure.restrict_apply_le (Metric.ball 0 R) (Metric.ball c r)).trans (harea c r hr) + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +namespace RPI.Boundary +open scoped Convolution +open ContinuousLinearMap + +noncomputable def c1Mollifier {n : ℕ} (j : ℕ) : ContDiffBump (0 : Space n) := + ⟨((j : ℝ) + 1)⁻¹ / 2, ((j : ℝ) + 1)⁻¹, + half_pos (by positivity), half_lt_self (by positivity)⟩ + +noncomputable def c1Mollify {n : ℕ} (f : Space n → ℝ) (j : ℕ) : Space n → ℝ := + (c1Mollifier j).normed volume ⋆[lsmul ℝ ℝ, volume] f + +lemma c1Mollifier_radius_tendsto {n : ℕ} : + Tendsto (fun j ↦ (c1Mollifier (n := n) j).rOut) atTop (𝓝 0) := by + simpa only [c1Mollifier, one_div] using (tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)) + +lemma c1Mollify_contDiff {n : ℕ} {f : Space n → ℝ} (hf : Continuous f) (j : ℕ) : + ContDiff ℝ ∞ (c1Mollify f j) := + (c1Mollifier j).hasCompactSupport_normed.contDiff_convolution_left _ + (c1Mollifier j).contDiff_normed hf.locallyIntegrable + +lemma c1Mollify_hasCompactSupport {n : ℕ} {f : Space n → ℝ} + (hc : HasCompactSupport f) (j : ℕ) : HasCompactSupport (c1Mollify f j) := + (c1Mollifier j).hasCompactSupport_normed.convolution _ hc + +lemma c1Mollify_fderiv {n : ℕ} {f : Space n → ℝ} (hf : ContDiff ℝ 1 f) + (hc : HasCompactSupport f) (j : ℕ) (x : Space n) : + fderiv ℝ (c1Mollify f j) x = + ((c1Mollifier j).normed volume ⋆[lsmul ℝ ℝ, volume] fderiv ℝ f) x := by + have he : (lsmul ℝ ℝ : ℝ →L[ℝ] ℝ →L[ℝ] ℝ).precompR (Space n) = + (lsmul ℝ ℝ : ℝ →L[ℝ] (Space n →L[ℝ] ℝ) →L[ℝ] (Space n →L[ℝ] ℝ)) := by + ext scalar linearMap + rfl + simpa only [c1Mollify, he] using + (hc.hasFDerivAt_convolution_right (lsmul ℝ ℝ) + (c1Mollifier j).continuous_normed.locallyIntegrable hf x).fderiv + +lemma c1Mollify_tendsto {n : ℕ} {f : Space n → ℝ} (hf : Continuous f) (x : Space n) : + Tendsto (fun j ↦ c1Mollify f j x) atTop (𝓝 (f x)) := + ContDiffBump.convolution_tendsto_right_of_continuous c1Mollifier_radius_tendsto hf x + +lemma c1Mollify_fderiv_tendsto {n : ℕ} {f : Space n → ℝ} (hf : ContDiff ℝ 1 f) + (hc : HasCompactSupport f) (x : Space n) : + Tendsto (fun j ↦ fderiv ℝ (c1Mollify f j) x) atTop (𝓝 (fderiv ℝ f x)) := by + simp_rw [c1Mollify_fderiv hf hc] + exact ContDiffBump.convolution_tendsto_right_of_continuous + c1Mollifier_radius_tendsto (hf.continuous_fderiv one_ne_zero) x + +lemma c1Mollify_nonneg {n : ℕ} {f : Space n → ℝ} (hf : ∀ x, 0 ≤ f x) + (j : ℕ) (x : Space n) : 0 ≤ c1Mollify f j x := by + apply integral_nonneg + intro t + exact mul_nonneg ((c1Mollifier j).nonneg_normed t) (hf _) + +lemma c1Mollify_uniform_bound {n : ℕ} {f : Space n → ℝ} + (hf : ContDiff ℝ 1 f) (hc : HasCompactSupport f) : + ∃ M : ℝ, 0 < M ∧ ∀ j x, ‖c1Mollify f j x‖ ≤ M ∧ + ‖fderiv ℝ (c1Mollify f j) x‖ ≤ M := by + obtain ⟨A, hA⟩ := hf.continuous.bounded_above_of_compact_support hc + obtain ⟨B, hB⟩ := (hf.continuous_fderiv one_ne_zero).bounded_above_of_compact_support + (hc.fderiv ℝ) + let M := 3 * (|A| + |B| + 1) + refine ⟨M, by dsimp [M]; positivity, ?_⟩ + intro j x + have h1 : dist (c1Mollify f j x) (f x) ≤ 2 * |A| := by + apply (c1Mollifier j).dist_normed_convolution_le hf.continuous.aestronglyMeasurable + intro y hy + calc + dist (f y) (f x) ≤ ‖f y‖ + ‖f x‖ := dist_le_norm_add_norm _ _ + _ ≤ 2 * |A| := by have := hA y; have := hA x; have := le_abs_self A; linarith + have h2 : dist (fderiv ℝ (c1Mollify f j) x) (fderiv ℝ f x) ≤ 2 * |B| := by + rw [c1Mollify_fderiv hf hc] + apply (c1Mollifier j).dist_normed_convolution_le + (hf.continuous_fderiv one_ne_zero).aestronglyMeasurable + intro y hy + calc + dist (fderiv ℝ f y) (fderiv ℝ f x) ≤ ‖fderiv ℝ f y‖ + ‖fderiv ℝ f x‖ := + dist_le_norm_add_norm _ _ + _ ≤ 2 * |B| := by have := hB y; have := hB x; have := le_abs_self B; linarith + constructor + · have := dist_triangle (c1Mollify f j x) (f x) 0 + simp only [dist_zero_right] at this + have := hA x + dsimp [M] + have := le_abs_self A + have := abs_nonneg B + simp only [Real.norm_eq_abs] at * + linarith + · have := dist_triangle (fderiv ℝ (c1Mollify f j) x) (fderiv ℝ f x) 0 + simp only [dist_zero_right] at this + have := hB x + dsimp [M] + have := le_abs_self B + have := abs_nonneg A + linarith + +lemma c1Mollify_tsupport_subset {n : ℕ} (f : Space n → ℝ) (j : ℕ) : + tsupport (c1Mollify f j) ⊆ Metric.cthickening (c1Mollifier (n := n) j).rOut (tsupport f) := by + apply closure_minimal _ Metric.isClosed_cthickening + intro x hx + obtain ⟨y, hy, z, hz, rfl⟩ := support_convolution_subset_swap (lsmul ℝ ℝ) hx + rw [(c1Mollifier j).support_normed_eq] at hz + apply Metric.mem_cthickening_of_dist_le _ y _ _ (subset_closure hy) + simpa only [dist_eq_norm, add_sub_cancel_left, sub_zero] using (Metric.mem_ball.mp hz).le + +lemma c1Mollify_eventually_tsupport_subset {n : ℕ} {f : Space n → ℝ} + (hc : HasCompactSupport f) {U : Set (Space n)} (hU : IsOpen U) (hs : tsupport f ⊆ U) : + ∀ᶠ j in atTop, tsupport (c1Mollify f j) ⊆ U := by + obtain ⟨r, hr, hsub⟩ := hc.exists_cthickening_subset_open hU hs + filter_upwards [c1Mollifier_radius_tendsto.eventually (gt_mem_nhds hr)] with j hj + exact (c1Mollify_tsupport_subset f j).trans ((Metric.cthickening_mono hj.le _).trans hsub) + +end RPI.Boundary + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/TotallyBoundedRangeOfUniformApproximation.lean b/lean/OAI/Geometry/Perimeter/Regularity/TotallyBoundedRangeOfUniformApproximation.lean new file mode 100644 index 0000000000000000000000000000000000000000..8376683fa353a933bc72bfb7135bd13ea1d5a4b6 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/TotallyBoundedRangeOfUniformApproximation.lean @@ -0,0 +1,546 @@ +import OAI.Geometry.Perimeter.Regularity.ExistsLocalVariationExtension + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +namespace RPISingularHarnack + +theorem totallyBounded_range_of_uniform_approximation + {α X : Type*} [PseudoMetricSpace X] (f : α → X) (a : ℕ → α → X) + (ha : ∀ j, TotallyBounded (range (a j))) + (happrox : ∀ ε : ℝ, 0 < ε → ∃ j, ∀ x, dist (f x) (a j x) < ε) : + TotallyBounded (range f) := by + apply Metric.totallyBounded_iff.mpr + intro ε hε + obtain ⟨j, hj⟩ := happrox (ε / 2) (half_pos hε) + obtain ⟨t, ht, hcover⟩ := Metric.totallyBounded_iff.mp (ha j) (ε / 2) (half_pos hε) + refine ⟨t, ht, ?_⟩ + rintro _ ⟨x, rfl⟩ + obtain ⟨y, hy, hxy⟩ := mem_iUnion₂.mp (hcover (mem_range_self x)) + apply mem_iUnion₂.mpr + refine ⟨y, hy, ?_⟩ + change dist (f x) y < ε + calc + dist (f x) y ≤ dist (f x) (a j x) + dist (a j x) y := dist_triangle _ _ _ + _ < ε / 2 + ε / 2 := add_lt_add (hj x) hxy + _ = ε := by ring + +theorem totallyBounded_toLp_of_lipschitz + {α ι : Type*} [MetricSpace α] [CompactSpace α] + [MeasurableSpace α] [BorelSpace α] (μ : Measure α) [IsFiniteMeasure μ] + (f : ι → α →ᵇ ℝ) (L : NNReal) + (hf : ∀ i, LipschitzWith L (f i)) + (hrange : ∀ i x, f i x ∈ Icc (0 : ℝ) 1) : + TotallyBounded (range (fun i ↦ BoundedContinuousFunction.toLp 1 μ ℝ (f i))) := by + have hc : IsCompact (closure (range f)) := by + apply BoundedContinuousFunction.arzela_ascoli (Icc (0 : ℝ) 1) isCompact_Icc + · rintro g x ⟨i, rfl⟩ + exact hrange i x + · apply UniformEquicontinuous.equicontinuous + apply LipschitzWith.uniformEquicontinuous _ L + intro g + obtain ⟨i, hi⟩ := g.property + simpa only [← hi] using hf i + have hc' := hc.image (BoundedContinuousFunction.toLp 1 μ ℝ).continuous + apply hc'.totallyBounded.subset + rintro _ ⟨i, rfl⟩ + exact ⟨f i, subset_closure (mem_range_self i), rfl⟩ + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +namespace RPISingularHarnack + +theorem isClosed_lp_ae_mem {α : Type*} [MeasurableSpace α] (μ : Measure α) + (s : Set ℝ) (hs : IsClosed s) : + IsClosed {f : Lp ℝ 1 μ | ∀ᵐ x ∂μ, f x ∈ s} := by + apply IsSeqClosed.isClosed + intro f g hf hfg + obtain ⟨σ, hσ, hconv⟩ := (tendstoInMeasure_of_tendsto_Lp hfg).exists_seq_tendsto_ae + filter_upwards [ae_all_iff.mpr hf, hconv] with x hx hc + exact hs.mem_of_tendsto hc (Eventually.of_forall (fun j ↦ hx (σ j))) + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +namespace RPISingularHarnack +open RPI.Boundary +open scoped BoundedContinuousFunction + +theorem compact_subtype_volume_finite {n : ℕ} {K : Set (Euc n)} (hK : IsCompact K) : + IsFiniteMeasure (volume.comap (Subtype.val : K → Euc n)) := by + constructor + rw [(MeasurableEmbedding.subtype_coe hK.measurableSet).comap_apply] + simpa only [Set.image_univ, Subtype.range_coe] using hK.measure_lt_top + +noncomputable def compactIndicatorLp {n : ℕ} (K : Set (Euc n)) (hK : IsCompact K) + (E : Set (Euc n)) (hE : MeasurableSet E) : + Lp ℝ 1 (volume.comap (Subtype.val : K → Euc n)) := by + letI := compact_subtype_volume_finite hK + exact ((memLp_const (1 : ℝ)).indicator (hE.preimage measurable_subtype_coe)).toLp _ + +theorem compactIndicatorLp_ae {n : ℕ} (K : Set (Euc n)) (hK : IsCompact K) + (E : Set (Euc n)) (hE : MeasurableSet E) : + compactIndicatorLp K hK E hE =ᵐ[volume.comap (Subtype.val : K → Euc n)] + fun x : K ↦ E.indicator (fun _ ↦ (1 : ℝ)) x := by + let := compact_subtype_volume_finite hK + have hm : MemLp ((Subtype.val ⁻¹' E : Set K).indicator (fun _ ↦ (1 : ℝ))) 1 + (volume.comap (Subtype.val : K → Euc n)) := + (memLp_const (1 : ℝ)).indicator (hE.preimage measurable_subtype_coe) + unfold compactIndicatorLp + filter_upwards [hm.coeFn_toLp] with x hx + change (hm.toLp _) x = _ + exact hx.trans (by rfl) + +theorem compactIndicatorLp_edist_mollified_le {n : ℕ} + (K : Set (Euc n)) (hK : IsCompact K) (E : Set (Euc n)) + (hE : MeasurableSet E) (hEK : E ⊆ K) (hP : perimeter E univ ≠ ⊤) + (j : ℕ) (g : K →ᵇ ℝ) + (hg : ∀ x : K, g x = c1Mollify (E.indicator (fun _ ↦ (1 : ℝ))) j x) : + letI := compact_subtype_volume_finite hK + edist (compactIndicatorLp K hK E hE) + (BoundedContinuousFunction.toLp 1 + (volume.comap (Subtype.val : K → Euc n)) ℝ g) ≤ + ENNReal.ofReal (c1Mollifier (n := n) j).rOut * perimeter E univ := by + let μ : Measure K := volume.comap (Subtype.val : K → Euc n) + let : IsFiniteMeasure μ := compact_subtype_volume_finite hK + rw [Lp.edist_def, eLpNorm_one_eq_lintegral_enorm + ((Lp.aestronglyMeasurable _).sub (Lp.aestronglyMeasurable _))] + calc + _ = ∫⁻ x : K, ‖E.indicator (fun _ ↦ (1 : ℝ)) x - + c1Mollify (E.indicator (fun _ ↦ (1 : ℝ))) j x‖ₑ ∂μ := by + apply lintegral_congr_ae + filter_upwards [compactIndicatorLp_ae K hK E hE, + BoundedContinuousFunction.coeFn_toLp 1 μ ℝ g] with x hx hy + change ‖(compactIndicatorLp K hK E hE) x - + (BoundedContinuousFunction.toLp 1 μ ℝ g) x‖ₑ = _ + rw [hx, hy, hg x] + _ = ∫⁻ x in K, ‖E.indicator (fun _ ↦ (1 : ℝ)) x - + c1Mollify (E.indicator (fun _ ↦ (1 : ℝ))) j x‖ₑ := + lintegral_subtype_comap (μ := volume) hK.measurableSet + (fun x : Euc n ↦ ‖E.indicator (fun _ ↦ (1 : ℝ)) x - + c1Mollify (E.indicator (fun _ ↦ (1 : ℝ))) j x‖ₑ) + _ ≤ ∫⁻ x, ‖E.indicator (fun _ ↦ (1 : ℝ)) x - + c1Mollify (E.indicator (fun _ ↦ (1 : ℝ))) j x‖ₑ := + setLIntegral_le_lintegral _ _ + _ ≤ ENNReal.ofReal (c1Mollifier (n := n) j).rOut * perimeter E univ := by + simpa only [enorm_sub_rev] using c1Mollify_indicator_lintegral_error_le hE + (hK.isBounded.subset hEK) hP j + +theorem bounded_perimeter_indicator_totallyBounded {n : ℕ} + (K : Set (Euc n)) (hK : IsCompact K) (C : ℝ≥0∞) (hC : C ≠ ⊤) : + TotallyBounded (range (fun E : {E : Set (Euc n) // + MeasurableSet E ∧ E ⊆ K ∧ perimeter E univ ≤ C} ↦ + compactIndicatorLp K hK E E.property.1)) := by + let μ : Measure K := volume.comap (Subtype.val : K → Euc n) + let : IsFiniteMeasure μ := compact_subtype_volume_finite hK + let : CompactSpace K := isCompact_iff_compactSpace.mp hK + let ι := {E : Set (Euc n) // MeasurableSet E ∧ E ⊆ K ∧ perimeter E univ ≤ C} + let f : ι → Lp ℝ 1 μ := fun E ↦ compactIndicatorLp K hK E E.property.1 + have hm (E : ι) (j : ℕ) : Continuous + (c1Mollify ((E : Set (Euc n)).indicator (fun _ ↦ (1 : ℝ))) j) := by + obtain ⟨hi, -⟩ := indicator_one_integrable_compact E.property.1 + (hK.isBounded.subset E.property.2.1) + exact ((c1Mollifier j).hasCompactSupport_normed.contDiff_convolution_left (n := (⊤ : ℕ∞)) _ + (c1Mollifier j).contDiff_normed hi.locallyIntegrable).continuous + let a : ℕ → ι → K →ᵇ ℝ := fun j E ↦ BoundedContinuousFunction.mkOfCompact + ⟨fun x ↦ c1Mollify ((E : Set (Euc n)).indicator (fun _ ↦ (1 : ℝ))) j x, + (hm E j).comp continuous_subtype_val⟩ + apply totallyBounded_range_of_uniform_approximation f + (fun j E ↦ BoundedContinuousFunction.toLp 1 μ ℝ (a j E)) + · intro j + obtain ⟨L, hL⟩ := c1Mollify_indicator_uniform_lipschitz K hK.isBounded j + apply totallyBounded_toLp_of_lipschitz μ (a j) L + · intro E + apply LipschitzWith.of_dist_le_mul + intro x y + exact (hL E E.property.1 E.property.2.1).dist_le_mul x y + · intro E x + exact c1Mollify_indicator_mem_Icc E.property.1 j x + · intro ε hε + have ht : Tendsto (fun j ↦ ENNReal.ofReal (c1Mollifier (n := n) j).rOut * C) + atTop (𝓝 0) := by + simpa only [ENNReal.ofReal_zero, zero_mul] using + ENNReal.Tendsto.mul_const + (ENNReal.tendsto_ofReal c1Mollifier_radius_tendsto) (Or.inr hC) + obtain ⟨j, hj⟩ := (ht.eventually (gt_mem_nhds (ENNReal.ofReal_pos.mpr hε))).exists + refine ⟨j, fun E ↦ edist_lt_ofReal.mp ?_⟩ + refine (compactIndicatorLp_edist_mollified_le K hK E E.property.1 E.property.2.1 + (ne_top_of_le_ne_top hC E.property.2.2) j (a j E) (fun _ ↦ rfl)).trans_lt ?_ + exact (mul_le_mul' le_rfl E.property.2.2).trans_lt hj + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +namespace RPISingularHarnack +open RPI.Boundary +open scoped BoundedContinuousFunction + +theorem compactIndicatorLp_edist {n : ℕ} (K : Set (Euc n)) (hK : IsCompact K) + (E F : Set (Euc n)) (hE : MeasurableSet E) (hF : MeasurableSet F) + (hEK : E ⊆ K) (hFK : F ⊆ K) : + edist (compactIndicatorLp K hK E hE) (compactIndicatorLp K hK F hF) = + ∫⁻ x, ‖E.indicator (fun _ ↦ (1 : ℝ)) x - F.indicator (fun _ ↦ (1 : ℝ)) x‖ₑ := by + let μ : Measure K := volume.comap (Subtype.val : K → Euc n) + rw [Lp.edist_def, eLpNorm_one_eq_lintegral_enorm + ((Lp.aestronglyMeasurable _).sub (Lp.aestronglyMeasurable _))] + calc + _ = ∫⁻ x : K, ‖E.indicator (fun _ ↦ (1 : ℝ)) x - + F.indicator (fun _ ↦ (1 : ℝ)) x‖ₑ ∂μ := by + apply lintegral_congr_ae + filter_upwards [compactIndicatorLp_ae K hK E hE, + compactIndicatorLp_ae K hK F hF] with x hx hy + change ‖(compactIndicatorLp K hK E hE) x - (compactIndicatorLp K hK F hF) x‖ₑ = _ + rw [hx, hy] + _ = ∫⁻ x in K, ‖E.indicator (fun _ ↦ (1 : ℝ)) x - + F.indicator (fun _ ↦ (1 : ℝ)) x‖ₑ := + lintegral_subtype_comap (μ := volume) hK.measurableSet + (fun x : Euc n ↦ ‖E.indicator (fun _ ↦ (1 : ℝ)) x - + F.indicator (fun _ ↦ (1 : ℝ)) x‖ₑ) + _ = _ := by + rw [← lintegral_indicator hK.measurableSet] + apply lintegral_congr + intro x + by_cases hx : x ∈ K + · simp only [indicator_of_mem hx] + · have hxE : x ∉ E := fun h ↦ hx (hEK h) + have hxF : x ∉ F := fun h ↦ hx (hFK h) + simp only [indicator_of_notMem hx, indicator_of_notMem hxE, + indicator_of_notMem hxF, sub_self, enorm_zero] + +theorem exists_indicator_L1_subsequence {n : ℕ} (K : Set (Euc n)) (hK : IsCompact K) + (C : ℝ≥0∞) (hC : C ≠ ⊤) (E : ℕ → Set (Euc n)) + (hE : ∀ i, MeasurableSet (E i)) (hEK : ∀ i, E i ⊆ K) + (hP : ∀ i, perimeter (E i) univ ≤ C) : + ∃ F : Set (Euc n), MeasurableSet F ∧ F ⊆ K ∧ + ∃ σ : ℕ → ℕ, StrictMono σ ∧ + Tendsto (fun i ↦ ∫⁻ x, ‖(E (σ i)).indicator (fun _ ↦ (1 : ℝ)) x - + F.indicator (fun _ ↦ (1 : ℝ)) x‖ₑ) atTop (𝓝 0) := by + let μ : Measure K := volume.comap (Subtype.val : K → Euc n) + let f : ℕ → Lp ℝ 1 μ := fun i ↦ compactIndicatorLp K hK (E i) (hE i) + let S : Set (Lp ℝ 1 μ) := range (fun H : {H : Set (Euc n) // + MeasurableSet H ∧ H ⊆ K ∧ perimeter H univ ≤ C} ↦ + compactIndicatorLp K hK H H.property.1) + have hfS (i : ℕ) : f i ∈ S := ⟨⟨E i, hE i, hEK i, hP i⟩, rfl⟩ + have hc : IsCompact (closure S) := + (bounded_perimeter_indicator_totallyBounded K hK C hC).closure.isCompact_of_isClosed + isClosed_closure + obtain ⟨g, hg, σ, hσ, hconv⟩ := hc.isSeqCompact (fun i ↦ subset_closure (hfS i)) + have hclosed : IsClosed {g : Lp ℝ 1 μ | ∀ᵐ x ∂μ, g x ∈ ({0, 1} : Set ℝ)} := + isClosed_lp_ae_mem μ _ (isClosed_singleton.union isClosed_singleton) + have hS01 : S ⊆ {g : Lp ℝ 1 μ | ∀ᵐ x ∂μ, g x ∈ ({0, 1} : Set ℝ)} := by + rintro _ ⟨H, rfl⟩ + filter_upwards [compactIndicatorLp_ae K hK H H.property.1] with x hx + rw [hx] + by_cases hxH : (x : Euc n) ∈ (H : Set (Euc n)) <;> simp [hxH] + have hg01 : ∀ᵐ x ∂μ, g x = 0 ∨ g x = 1 := by + simpa only [mem_ofPred_eq, mem_insert_iff, mem_singleton_iff] using + (closure_minimal hS01 hclosed hg) + let A : Set K := {x | g x = 1} + have hA : MeasurableSet A := measurableSet_eq_fun (Lp.stronglyMeasurable g).measurable measurable_const + let F : Set (Euc n) := Subtype.val '' A + have hF : MeasurableSet F := + (MeasurableEmbedding.subtype_coe hK.measurableSet).measurableSet_image.mpr hA + have hFK : F ⊆ K := Subtype.coe_image_subset K A + have hFg : compactIndicatorLp K hK F hF = g := by + apply Lp.ext + filter_upwards [compactIndicatorLp_ae K hK F hF, hg01] with x hx hx01 + rw [hx] + by_cases hx1 : g x = 1 + · have hxF : (x : Euc n) ∈ F := ⟨x, hx1, rfl⟩ + simp only [indicator_of_mem hxF, hx1] + · have hxF : (x : Euc n) ∉ F := by + rintro ⟨y, hy, hyx⟩ + have : y = x := Subtype.ext hyx + subst y + exact hx1 hy + simp only [indicator_of_notMem hxF, hx01.resolve_right hx1] + refine ⟨F, hF, hFK, σ, hσ, ?_⟩ + have ht : Tendsto (fun i ↦ edist (f (σ i)) g) atTop (𝓝 0) := by + simpa only [Function.comp_def, edist_self] using + hconv.edist (tendsto_const_nhds (x := g)) + rw [← hFg] at ht + simpa only [f, compactIndicatorLp_edist K hK _ F _ hF (hEK _) hFK] using ht + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +namespace RPISingularHarnack + +theorem tendsto_setIntegral_of_indicator_L1 {n : ℕ} + (E : ℕ → Set (Euc n)) (F : Set (Euc n)) + (hE : ∀ i, MeasurableSet (E i)) (hF : MeasurableSet F) + (hconv : Tendsto (fun i ↦ ∫⁻ x, + ‖(E i).indicator (fun _ ↦ (1 : ℝ)) x - F.indicator (fun _ ↦ (1 : ℝ)) x‖ₑ) + atTop (𝓝 0)) + {f : Euc n → ℝ} (hf : Integrable f volume) + (hbound : ∃ M : ℝ, ∀ x, ‖f x‖ ≤ M) : + Tendsto (fun i ↦ ∫ x in E i, f x) atTop (𝓝 (∫ x in F, f x)) := by + obtain ⟨M, hM⟩ := hbound + have hM0 : 0 ≤ M := (norm_nonneg (f 0)).trans (hM 0) + have hib (i : ℕ) : + edist (∫ x in E i, f x) (∫ x in F, f x) ≤ + ENNReal.ofReal M * ∫⁻ x, + ‖(E i).indicator (fun _ ↦ (1 : ℝ)) x - F.indicator (fun _ ↦ (1 : ℝ)) x‖ₑ := by + rw [edist_eq_enorm_sub, ← integral_indicator (hE i), ← integral_indicator hF, + ← integral_sub (hf.indicator (hE i)) (hf.indicator hF)] + apply (enorm_integral_le_lintegral_enorm _).trans + rw [← lintegral_const_mul' _ _] + · apply lintegral_mono + intro x + have he : (E i).indicator f x - F.indicator f x = + ((E i).indicator (fun _ ↦ (1 : ℝ)) x - + F.indicator (fun _ ↦ (1 : ℝ)) x) * f x := by + by_cases hx : x ∈ E i <;> by_cases hy : x ∈ F <;> simp [hx,hy] + dsimp only + rw [he, enorm_mul, mul_comm] + exact mul_le_mul' (by simpa only [ofReal_norm] using + ENNReal.ofReal_le_ofReal (hM x)) le_rfl + · exact ENNReal.ofReal_ne_top + apply tendsto_iff_edist_tendsto_0.mpr + apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds + (by simpa only [mul_zero, bot_eq_zero] using + ENNReal.Tendsto.const_mul hconv (Or.inr ENNReal.ofReal_ne_top)) + (fun _ ↦ show (0 : ℝ≥0∞) ≤ _ from bot_le) hib + +theorem perimeter_le_of_indicator_L1 {n : ℕ} + (E : ℕ → Set (Euc n)) (F U : Set (Euc n)) (C : ℝ≥0∞) + (hE : ∀ i, MeasurableSet (E i)) (hF : MeasurableSet F) + (hconv : Tendsto (fun i ↦ ∫⁻ x, + ‖(E i).indicator (fun _ ↦ (1 : ℝ)) x - F.indicator (fun _ ↦ (1 : ℝ)) x‖ₑ) + atTop (𝓝 0)) + (hP : ∀ i, perimeter (E i) U ≤ C) : perimeter F U ≤ C := by + rw [perimeter_eq_iSup_tests] + apply iSup_le + intro V + apply iSup_le + intro hV + have hd := integrable_divergence hV.1 hV.2.1 + have hc : HasCompactSupport (divergence V) := + hV.2.1.of_isClosed_subset (isClosed_tsupport _) (tsupport_divergence_subset V) + have ht := tendsto_setIntegral_of_indicator_L1 E F hE hF hconv hd + (hc.exists_bound_of_continuous (continuous_divergence hV.1)) + apply le_of_tendsto (ENNReal.continuous_ofReal.tendsto _ |>.comp ht) + filter_upwards [] with i + have hb : ENNReal.ofReal (∫ x in E i, divergence V x) ≤ perimeter (E i) U := by + rw [perimeter_eq_iSup_tests] + exact le_iSup_of_le V (le_iSup_of_le hV le_rfl) + exact hb.trans (hP i) + +theorem exists_bounded_perimeter_L1_subsequence {n : ℕ} + (K : Set (Euc n)) (hK : IsCompact K) (C : ℝ≥0∞) (hC : C ≠ ⊤) + (E : ℕ → Set (Euc n)) (hE : ∀ i, MeasurableSet (E i)) + (hEK : ∀ i, E i ⊆ K) (hP : ∀ i, perimeter (E i) univ ≤ C) : + ∃ F : Set (Euc n), MeasurableSet F ∧ F ⊆ K ∧ perimeter F univ ≤ C ∧ + ∃ σ : ℕ → ℕ, StrictMono σ ∧ + Tendsto (fun i ↦ ∫⁻ x, ‖(E (σ i)).indicator (fun _ ↦ (1 : ℝ)) x - + F.indicator (fun _ ↦ (1 : ℝ)) x‖ₑ) atTop (𝓝 0) := by + obtain ⟨F, hF, hFK, σ, hσ, ht⟩ := exists_indicator_L1_subsequence K hK C hC E hE hEK hP + exact ⟨F, hF, hFK, perimeter_le_of_indicator_L1 (E ∘ σ) F univ C + (fun i ↦ hE (σ i)) hF ht (fun i ↦ hP (σ i)), σ, hσ, ht⟩ + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +namespace RPISingularHarnack + +theorem ae_tendsto_scaled_polar_oscillation {n k : ℕ} + (μ : Measure (Euc n)) [IsFiniteMeasure μ] (G : Euc n → Euc n) + (hG : Integrable G μ) {C : ℝ} (hC : 0 < C) + (hgrowth : ∀ x (r : ℝ), 0 < r → + μ (Metric.ball x r) ≤ ENNReal.ofReal (C * r ^ k)) : + ∀ᵐ x ∂μ, Tendsto (fun r : ℝ ↦ (r ^ k)⁻¹ * + ∫ y in Metric.closedBall x r, ‖G y - G x‖ ∂μ) + (𝓝[>] (0 : ℝ)) (𝓝 0) := by + filter_upwards [(Besicovitch.vitaliFamily μ).ae_tendsto_average_norm_sub hG.locallyIntegrable] + with x hx + have ht := hx.comp (Besicovitch.tendsto_filterAt μ x) + let A : ℝ → ℝ := fun r ↦ ⨍ y in Metric.closedBall x r, ‖G y - G x‖ ∂μ + have ha (r : ℝ) : 0 ≤ A r := integral_nonneg (fun _ ↦ norm_nonneg _) + have hb : ∀ᶠ r : ℝ in 𝓝[>] (0 : ℝ), + (r ^ k)⁻¹ * ∫ y in Metric.closedBall x r, ‖G y - G x‖ ∂μ ≤ + (C * 2 ^ k) * A r := by + filter_upwards [self_mem_nhdsWithin] with r hr + change 0 < r at hr + have hμb : μ (Metric.closedBall x r) ≤ ENNReal.ofReal (C * (2 * r) ^ k) := + (measure_mono (Metric.closedBall_subset_ball (by linarith))).trans + (hgrowth x (2 * r) (by positivity)) + have hreal : μ.real (Metric.closedBall x r) ≤ C * (2 * r) ^ k := by + simpa only [measureReal_def, ENNReal.toReal_ofReal (by positivity : 0 ≤ C * (2 * r) ^ k)] using + ENNReal.toReal_mono ENNReal.ofReal_ne_top hμb + have hi := measure_smul_setAverage (μ := μ) (fun y ↦ ‖G y - G x‖) + (measure_ne_top μ (Metric.closedBall x r)) + simp only [smul_eq_mul] at hi + rw [← hi] + calc + _ ≤ (r ^ k)⁻¹ * ((C * (2 * r) ^ k) * A r) := by + exact mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_right hreal (ha r)) + (by positivity) + _ = _ := by rw [mul_pow]; field_simp [hr.ne'] + have hnonneg : ∀ᶠ r : ℝ in 𝓝[>] (0 : ℝ), 0 ≤ (r ^ k)⁻¹ * + ∫ y in Metric.closedBall x r, ‖G y - G x‖ ∂μ := by + filter_upwards [self_mem_nhdsWithin] with r hr + exact mul_nonneg (inv_nonneg.mpr (pow_nonneg (le_of_lt hr) k)) + (integral_nonneg fun _ ↦ norm_nonneg _) + refine squeeze_zero' hnonneg hb ?_ + simpa only [mul_zero, Function.comp_def, A] using ht.const_mul (C * 2 ^ k) + +theorem exists_differentiating_unit_polar {n : ℕ} (hn : 0 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (U : Set (Euc n)) (hU : IsOpen U) (hP : perimeter E U ≠ ⊤) : + ∃ G : Euc n → Euc n, + StronglyMeasurable G ∧ MemLp G 2 ((perimeterMeasure E).restrict U) ∧ + (∀ᵐ x ∂(perimeterMeasure E).restrict U, ‖G x‖ = 1) ∧ + (∀ᵐ x ∂(perimeterMeasure E).restrict U, + Tendsto (fun r : ℝ ↦ (r ^ (n - 1))⁻¹ * ∫ y in Metric.closedBall x r, + ‖G y - G x‖ ∂(perimeterMeasure E).restrict U) (𝓝[>] (0 : ℝ)) (𝓝 0)) ∧ + ∀ V : Euc n → Euc n, ContDiff ℝ ∞ V → HasCompactSupport V → tsupport V ⊆ U → + (∫ x in E, divergence V x) = ∫ x in U, inner ℝ (G x) (V x) ∂perimeterMeasure E := by + let μ := (perimeterMeasure E).restrict U + let : IsFiniteMeasure μ := ⟨by + rw [Measure.restrict_apply_univ, perimeterMeasure_open E hU]; exact hP.lt_top⟩ + obtain ⟨G, hG, hGp, hGn, hrep⟩ := exists_local_unit_variation_polar E U hU hP + obtain ⟨C, hC, hgrowth⟩ := exists_locallyMinimizing_perimeter_growth_constant n hn + have hlocal : ∀ x (r : ℝ), 0 < r → μ (Metric.ball x r) ≤ + ENNReal.ofReal (C * r ^ (n - 1)) := by + intro x r hr + exact ((Measure.restrict_le_self (μ := perimeterMeasure E) (s := U)) _).trans + (by simpa only [perimeterMeasure_open E Metric.isOpen_ball] using hgrowth E hmin x r hr) + exact ⟨G, hG, hGp, hGn, + ae_tendsto_scaled_polar_oscillation μ G (MemLp.integrable (by norm_num) hGp) hC hlocal, + hrep⟩ + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +namespace RPISingularHarnack + +theorem ae_inner_ne_value {n : ℕ} {v : Euc n} (hv : ‖v‖ = 1) (t : ℝ) : + ∀ᵐ x ∂(volume : Measure (Euc n)), inner ℝ x v ≠ t := by + let L : Euc n →L[ℝ] ℝ := innerSL ℝ v + have hLv : L v = 1 := by simp [L, hv] + have hL : L ≠ 0 := by intro hz; simp [hz] at hLv + have hk : L.ker ≠ ⊤ := by + intro hk + apply hL + ext z + have hz : z ∈ L.ker := hk ▸ Submodule.mem_top + exact hz + have hn : (volume : Measure (Euc n)) {z | L z = 0} = 0 := + Measure.addHaar_submodule (volume : Measure (Euc n)) L.ker hk + have ha : ∀ᵐ z ∂(volume : Measure (Euc n)), L z ≠ 0 := by + simpa only [ae_iff, not_not] using hn + have ht := (measurePreserving_add_right (volume : Measure (Euc n)) (-t • v)).quasiMeasurePreserving.ae ha + filter_upwards [ht] with x hx + change L (x + -t • v) ≠ 0 at hx + simp only [map_add, map_smul, hLv, smul_eq_mul, mul_one] at hx + intro heq + apply hx + change inner ℝ v x + -t = 0 + rw [real_inner_comm, heq] + ring + +theorem ordered_indicator_halfspace {n : ℕ} (E S : Set (Euc n)) + (hS : ∀ᵐ x ∂(volume : Measure (Euc n)), x ∈ S) + {v : Euc n} (hv : ‖v‖ = 1) {R : ℝ} (hR : 0 < R) + (horder : ∀ x ∈ S ∩ Metric.ball (0 : Euc n) R, + ∀ y ∈ S ∩ Metric.ball (0 : Euc n) R, + inner ℝ x v < inner ℝ y v → y ∈ E → x ∈ E) : + ∃ t ∈ Icc (-R) R, ∀ᵐ x ∂volume.restrict (Metric.ball (0 : Euc n) R), + x ∈ E ↔ inner ℝ x v < t := by + let A : Set ℝ := (fun x : Euc n ↦ inner ℝ x v) '' (E ∩ S ∩ Metric.ball 0 R) + have hb (x : Euc n) (hx : x ∈ Metric.ball (0 : Euc n) R) : + -R < inner ℝ x v ∧ inner ℝ x v < R := by + apply abs_lt.mp + apply (abs_real_inner_le_norm x v).trans_lt + simpa only [hv, mul_one, Metric.mem_ball, dist_zero_right] using hx + have hbA : ∀ a ∈ A, -R < a ∧ a < R := by + rintro _ ⟨x, hx, rfl⟩ + exact hb x hx.2 + by_cases hA : A.Nonempty + · have hAb : BddAbove A := ⟨R, fun a ha ↦ (hbA a ha).2.le⟩ + let t := sSup A + have htl : -R ≤ t := by + obtain ⟨a, ha⟩ := hA + exact (hbA a ha).1.le.trans (le_csSup hAb ha) + have htu : t ≤ R := csSup_le hA (fun a ha ↦ (hbA a ha).2.le) + refine ⟨t, ⟨htl, htu⟩, ?_⟩ + filter_upwards [ae_restrict_mem measurableSet_ball, + hS.filter_mono (ae_mono Measure.restrict_le_self), + (ae_inner_ne_value hv t).filter_mono (ae_mono Measure.restrict_le_self)] with x hx hxS hxne + constructor + · intro hxE + have ha : inner ℝ x v ∈ A := ⟨x, ⟨⟨hxE, hxS⟩, hx⟩, rfl⟩ + exact (le_csSup hAb ha).lt_of_ne hxne + · intro hxt + obtain ⟨a, ha, hxa⟩ := exists_lt_of_lt_csSup hA hxt + obtain ⟨y, hy, rfl⟩ := ha + exact horder x ⟨hxS, hx⟩ y ⟨hy.1.2, hy.2⟩ hxa hy.1.1 + · refine ⟨-R, ⟨le_rfl, by linarith⟩, ?_⟩ + filter_upwards [ae_restrict_mem measurableSet_ball, + hS.filter_mono (ae_mono Measure.restrict_le_self)] with x hx hxS + have hxE : x ∉ E := by + intro hxE + exact hA ⟨inner ℝ x v, x, ⟨⟨hxE, hxS⟩, hx⟩, rfl⟩ + simp only [hxE, false_iff] + exact not_lt.mpr (hb x hx).1.le + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/TsupportBlowdownSubsetBall.lean b/lean/OAI/Geometry/Perimeter/Regularity/TsupportBlowdownSubsetBall.lean new file mode 100644 index 0000000000000000000000000000000000000000..2bdb4de7ae28334982a1df2bb5efd5d2bc122797 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/TsupportBlowdownSubsetBall.lean @@ -0,0 +1,498 @@ +import OAI.Geometry.Perimeter.Regularity.ExistsMinimizingBoundaryAreaGrowth +import OAI.Geometry.Perimeter.Regularity.SmoothFlatOrder + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +namespace RPISingularHarnack + +theorem tsupport_blowdown_subset_ball {n : ℕ} {φ : Euc n → ℝ} {R : ℝ} + (hs : tsupport φ ⊆ Metric.ball (0 : Euc n) R) (c : Euc n) {r : ℝ} (hr : 0 < r) : + tsupport (fun y ↦ φ (r⁻¹ • (y - c))) ⊆ Metric.ball c (r * R) := by + intro y hy + have hyb := hs (tsupport_comp_subset_preimage φ + ((continuous_id.sub continuous_const).const_smul r⁻¹) hy) + change r⁻¹ • (y - c) ∈ Metric.ball (0 : Euc n) R at hyb + simp only [Metric.mem_ball, dist_zero_right, norm_smul, + Real.norm_of_nonneg (inv_nonneg.mpr hr.le)] at hyb + change dist y c < r * R + rw [dist_eq_norm] + have he : r * (r⁻¹ * ‖y - c‖) = ‖y - c‖ := by field_simp + linarith [mul_lt_mul_of_pos_left hyb hr] + +theorem tsupport_directionalDeriv_subset {n : ℕ} (φ : Euc n → ℝ) (w : Euc n) : + tsupport (fun y ↦ fderiv ℝ φ y w) ⊆ tsupport φ := by + apply closure_minimal + · intro y hy + by_contra hn + exact hy (by dsimp only; rw [fderiv_of_notMem_tsupport ℝ hn]; rfl) + · exact isClosed_tsupport φ + +theorem setIntegral_eq_of_inter_eq {n : ℕ} {A B U : Set (Euc n)} + (hA : MeasurableSet A) (hB : MeasurableSet B) (hAB : A ∩ U = B ∩ U) + {f : Euc n → ℝ} (hs : tsupport f ⊆ U) : + (∫ x in A, f x) = ∫ x in B, f x := by + rw [← integral_indicator hA, ← integral_indicator hB] + congr 1 + funext x + by_cases hx : x ∈ U + · have hm : x ∈ A ↔ x ∈ B := by + have he := Set.ext_iff.mp hAB x + simpa only [mem_inter_iff, hx, and_true] using he + by_cases ha : x ∈ A + · simp [ha, hm.mp ha] + · simp [ha, mt hm.mpr ha] + · have hz : f x = 0 := image_eq_zero_of_notMem_tsupport (fun hh ↦ hx (hs hh)) + by_cases ha : x ∈ A <;> by_cases hb : x ∈ B <;> simp [ha, hb, hz] + +theorem polar_blowup_test_error_le {n : ℕ} (hn : 0 < n) {E U : Set (Euc n)} + (hE : MeasurableSet E) (μ : Measure (Euc n)) [IsFiniteMeasure μ] + {G : Euc n → Euc n} (hG : Integrable G μ) + (hrep : ∀ V : Euc n → Euc n, ContDiff ℝ ∞ V → HasCompactSupport V → + tsupport V ⊆ U → (∫ y in E, divergence V y) = ∫ y, inner ℝ (G y) (V y) ∂μ) + {φ : Euc n → ℝ} (hφ : ContDiff ℝ ∞ φ) (hcφ : HasCompactSupport φ) + (hsφ : tsupport φ ⊆ Metric.ball (0 : Euc n) 2) + (c v w : Euc n) {r : ℝ} (hr : 0 < r) (hrU : Metric.ball c (r * 2) ⊆ U) + {M : ℝ} (hM : 0 ≤ M) (hMφ : ∀ y, ‖φ y‖ ≤ M) : + |(∫ z in blownUpSet E c r, fderiv ℝ φ z w) - + ((r ^ (n - 1))⁻¹ * ∫ y, φ (r⁻¹ • (y - c)) * inner ℝ v w ∂μ)| ≤ + M * ‖w‖ * ((r ^ (n - 1))⁻¹ * ∫ y in Metric.closedBall c (2 * r), ‖G y - v‖ ∂μ) := by + have hs := tsupport_blowdown_subset_ball hsφ c hr + rw [integral_fderiv_blownUpSet_polar hE μ G hrep hφ hcφ c w hr (hs.trans hrU)] + have hn' : n = (n - 1) + 1 := (Nat.sub_add_cancel hn).symm + have he : r * (r ^ n)⁻¹ = (r ^ (n - 1))⁻¹ := by + have hp : r ^ n = r * r ^ (n - 1) := by conv_lhs => rw [hn']; rw [pow_succ'] + rw [hp]; field_simp + rw [he, ← mul_sub, abs_mul, abs_of_nonneg (inv_nonneg.mpr (pow_nonneg hr.le _))] + have hzero : ∀ y ∉ Metric.closedBall c (2 * r), φ (r⁻¹ • (y - c)) = 0 := by + intro y hy + have ht : y ∉ tsupport (fun z ↦ φ (r⁻¹ • (z - c))) := fun ht ↦ + hy (Metric.ball_subset_closedBall (by simpa only [mul_comm] using hs ht)) + exact image_eq_zero_of_notMem_tsupport (f := fun z ↦ φ (r⁻¹ • (z - c))) ht + have hb := polar_test_oscillation_le μ hG v w + (hφ.continuous.comp ((continuous_id.sub continuous_const).const_smul r⁻¹)) + hM (fun y ↦ hMφ _) (Metric.closedBall c (2 * r)) measurableSet_closedBall hzero + calc + _ ≤ (r ^ (n - 1))⁻¹ * (M * ‖w‖ * ∫ y in Metric.closedBall c (2 * r), ‖G y - v‖ ∂μ) := + mul_le_mul_of_nonneg_left hb (by positivity) + _ = _ := by ring + +theorem tendsto_doubled_polar_oscillation {n : ℕ} (μ : Measure (Euc n)) + (G : Euc n → Euc n) (c v : Euc n) + (hlim : Tendsto (fun s : ℝ ↦ (s ^ (n - 1))⁻¹ * ∫ y in Metric.closedBall c s, + ‖G y - v‖ ∂μ) (𝓝[>] (0 : ℝ)) (𝓝 0)) + {r : ℕ → ℝ} (hr : ∀ i, 0 < r i) (hr0 : Tendsto r atTop (𝓝 0)) : + Tendsto (fun i ↦ ((r i) ^ (n - 1))⁻¹ * ∫ y in Metric.closedBall c (2 * r i), + ‖G y - v‖ ∂μ) atTop (𝓝 0) := by + have ht : Tendsto (fun i ↦ 2 * r i) atTop (𝓝[>] (0 : ℝ)) := by + apply tendsto_nhdsWithin_iff.mpr + exact ⟨by simpa only [mul_zero] using hr0.const_mul 2, + Eventually.of_forall (fun i ↦ by change 0 < 2 * r i; exact mul_pos (by norm_num) (hr i))⟩ + have h := (hlim.comp ht).const_mul ((2 : ℝ) ^ (n - 1)) + simp only [mul_zero] at h + convert h using 1 + funext i + dsimp only [Function.comp_def] + rw [mul_pow] + field_simp [(hr i).ne'] + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +namespace RPISingularHarnack + +theorem flat_distribution_of_polar_blowup_limit {n : ℕ} (hn : 0 < n) + {E U : Set (Euc n)} (hE : MeasurableSet E) + (μ : Measure (Euc n)) [IsFiniteMeasure μ] + {G : Euc n → Euc n} (hG : Integrable G μ) + (hrep : ∀ V : Euc n → Euc n, ContDiff ℝ ∞ V → HasCompactSupport V → + tsupport V ⊆ U → (∫ y in E, divergence V y) = ∫ y, inner ℝ (G y) (V y) ∂μ) + (c v : Euc n) + (hosc : Tendsto (fun s : ℝ ↦ (s ^ (n - 1))⁻¹ * ∫ y in Metric.closedBall c s, + ‖G y - v‖ ∂μ) (𝓝[>] (0 : ℝ)) (𝓝 0)) + {r : ℕ → ℝ} (hr : ∀ i, 0 < r i) (hr0 : Tendsto r atTop (𝓝 0)) + (hrU : ∀ᶠ i in atTop, Metric.ball c (r i * 2) ⊆ U) + (A : ℕ → Set (Euc n)) (hA : ∀ i, MeasurableSet (A i)) + (hAE : ∀ i, A i ∩ Metric.ball (0 : Euc n) 2 = + blownUpSet E c (r i) ∩ Metric.ball (0 : Euc n) 2) + (F : Set (Euc n)) (hF : MeasurableSet F) + (hconv : Tendsto (fun i ↦ ∫⁻ x, + ‖(A i).indicator (fun _ ↦ (1 : ℝ)) x - F.indicator (fun _ ↦ (1 : ℝ)) x‖ₑ) + atTop (𝓝 0)) : + (∀ φ : Euc n → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → + tsupport φ ⊆ Metric.ball (0 : Euc n) 2 → + ∀ w, inner ℝ w v = 0 → (∫ x in F, fderiv ℝ φ x w) = 0) ∧ + (∀ φ : Euc n → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → + tsupport φ ⊆ Metric.ball (0 : Euc n) 2 → (∀ x, 0 ≤ φ x) → + 0 ≤ ∫ x in F, fderiv ℝ φ x v) := by + let e : ℕ → ℝ := fun i ↦ ((r i) ^ (n - 1))⁻¹ * + ∫ y in Metric.closedBall c (2 * r i), ‖G y - v‖ ∂μ + have he : Tendsto e atTop (𝓝 0) := + tendsto_doubled_polar_oscillation μ G c v hosc hr hr0 + have he0 : ∀ i, 0 ≤ e i := fun i ↦ mul_nonneg + (inv_nonneg.mpr (pow_nonneg (hr i).le _)) (integral_nonneg fun _ ↦ norm_nonneg _) + have htest (φ : Euc n → ℝ) (hφ : ContDiff ℝ ∞ φ) + (hcφ : HasCompactSupport φ) (hsφ : tsupport φ ⊆ Metric.ball (0 : Euc n) 2) + (w : Euc n) : + Tendsto (fun i ↦ ∫ x in blownUpSet E c (r i), fderiv ℝ φ x w) + atTop (𝓝 (∫ x in F, fderiv ℝ φ x w)) := by + have hcD : HasCompactSupport (fun x ↦ fderiv ℝ φ x w) := + hcφ.of_isClosed_subset (isClosed_tsupport _) (tsupport_directionalDeriv_subset φ w) + have hD : Continuous (fun x ↦ fderiv ℝ φ x w) := + (hφ.continuous_fderiv (by simp)).clm_apply continuous_const + have ht := tendsto_setIntegral_of_indicator_L1 A F hA hF hconv + (hD.integrable_of_hasCompactSupport hcD) (hcD.exists_bound_of_continuous hD) + convert ht using 1 + funext i + exact setIntegral_eq_of_inter_eq (measurableSet_blownUpSet hE c (r i)) (hA i) + (hAE i).symm ((tsupport_directionalDeriv_subset φ w).trans hsφ) + constructor + · intro φ hφ hcφ hsφ w hw + obtain ⟨M, hb⟩ := hcφ.exists_bound_of_continuous hφ.continuous + have hM : 0 ≤ M := (norm_nonneg (φ 0)).trans (hb 0) + have hbe : ∀ᶠ i in atTop, |∫ x in blownUpSet E c (r i), fderiv ℝ φ x w| ≤ M * ‖w‖ * e i := by + filter_upwards [hrU] with i hiU + have hh := polar_blowup_test_error_le hn hE μ hG hrep hφ hcφ hsφ c v w + (hr i) hiU hM hb + have hvw : inner ℝ v w = 0 := by rw [real_inner_comm]; exact hw + simpa only [hvw, mul_zero, integral_zero, sub_zero] using hh + have hz : Tendsto (fun i ↦ ∫ x in blownUpSet E c (r i), fderiv ℝ φ x w) + atTop (𝓝 0) := by + apply tendsto_zero_iff_norm_tendsto_zero.mpr + simpa only [Real.norm_eq_abs] using + (squeeze_zero' (Eventually.of_forall fun i ↦ abs_nonneg _) hbe + (by simpa only [mul_zero] using he.const_mul (M * ‖w‖))) + exact tendsto_nhds_unique (htest φ hφ hcφ hsφ w) hz + · intro φ hφ hcφ hsφ hφ0 + obtain ⟨M, hb⟩ := hcφ.exists_bound_of_continuous hφ.continuous + have hM : 0 ≤ M := (norm_nonneg (φ 0)).trans (hb 0) + have hbtest : ∀ᶠ i in atTop, -(M * ‖v‖ * e i) ≤ + ∫ x in blownUpSet E c (r i), fderiv ℝ φ x v := by + filter_upwards [hrU] with i hiU + have hh := polar_blowup_test_error_le hn hE μ hG hrep hφ hcφ hsφ c v v + (hr i) hiU hM hb + have hp : 0 ≤ ((r i) ^ (n - 1))⁻¹ * + ∫ y, φ ((r i)⁻¹ • (y - c)) * inner ℝ v v ∂μ := + mul_nonneg (inv_nonneg.mpr (pow_nonneg (hr i).le _)) (integral_nonneg fun y ↦ + mul_nonneg (hφ0 _) (real_inner_self_nonneg)) + have hlow := (abs_le.mp hh).1 + change -(M * ‖v‖ * e i) ≤ _ at hlow + linarith + exact le_of_tendsto_of_tendsto + (by simpa only [mul_zero, neg_zero] using (he.const_mul (M * ‖v‖)).neg) + (htest φ hφ hcφ hsφ v) hbtest + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +namespace RPISingularHarnack + +theorem volumeReal_blownUpSet_closedBall {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) (c : Euc n) {r : ℝ} (hr : 0 < r) (s : ℝ) : + volume.real (blownUpSet E c r ∩ Metric.closedBall (0 : Euc n) s) = + (r ^ n)⁻¹ * volume.real (E ∩ Metric.closedBall c (r * s)) := by + have hi := integral_blownUpSet hE + ((Metric.closedBall c (r * s)).indicator (fun _ ↦ (1 : ℝ))) c hr + have he : (fun z ↦ (Metric.closedBall c (r * s)).indicator (fun _ ↦ (1 : ℝ)) (c + r • z)) = + (Metric.closedBall (0 : Euc n) s).indicator (fun _ ↦ (1 : ℝ)) := by + funext z + have hm : c + r • z ∈ Metric.closedBall c (r * s) ↔ z ∈ Metric.closedBall (0 : Euc n) s := by + simp only [Metric.mem_closedBall, dist_eq_norm, add_sub_cancel_left, sub_zero, + norm_smul, Real.norm_of_nonneg hr.le] + exact mul_le_mul_iff_right₀ hr + by_cases hz : z ∈ Metric.closedBall (0 : Euc n) s + · simp [hz, hm.mpr hz] + · simp [hz, mt hm.mp hz] + rw [he] at hi + simpa only [integral_indicator_const _ measurableSet_closedBall, + measureReal_restrict_apply measurableSet_closedBall, smul_eq_mul, mul_one, inter_comm] using hi + +theorem indicator_L1_compl {n : ℕ} (A F : Set (Euc n)) : + (∫⁻ x, ‖Aᶜ.indicator (fun _ ↦ (1 : ℝ)) x - Fᶜ.indicator (fun _ ↦ (1 : ℝ)) x‖ₑ) = + ∫⁻ x, ‖A.indicator (fun _ ↦ (1 : ℝ)) x - F.indicator (fun _ ↦ (1 : ℝ)) x‖ₑ := by + apply lintegral_congr + intro x + by_cases hx : x ∈ A <;> by_cases hy : x ∈ F <;> simp [hx, hy] + +theorem tendsto_volumeReal_inter_closedBall_of_indicator_L1 {n : ℕ} + (A : ℕ → Set (Euc n)) (F : Set (Euc n)) + (hA : ∀ i, MeasurableSet (A i)) (hF : MeasurableSet F) + (hconv : Tendsto (fun i ↦ ∫⁻ x, + ‖(A i).indicator (fun _ ↦ (1 : ℝ)) x - F.indicator (fun _ ↦ (1 : ℝ)) x‖ₑ) + atTop (𝓝 0)) (c : Euc n) (s : ℝ) : + Tendsto (fun i ↦ volume.real (A i ∩ Metric.closedBall c s)) atTop + (𝓝 (volume.real (F ∩ Metric.closedBall c s))) := by + have hf : Integrable ((Metric.closedBall c s).indicator (fun _ ↦ (1 : ℝ))) volume := + ((continuous_const.locallyIntegrable (μ := (volume : Measure (Euc n)))).integrableOn_isCompact + (isCompact_closedBall c s)).integrable_indicator measurableSet_closedBall + have hb : ∃ M : ℝ, ∀ x : Euc n, ‖(Metric.closedBall c s).indicator (fun _ ↦ (1 : ℝ)) x‖ ≤ M := by + refine ⟨1, ?_⟩ + intro x + by_cases hx : x ∈ Metric.closedBall c s <;> simp [hx] + have ht := tendsto_setIntegral_of_indicator_L1 A F hA hF hconv hf hb + simpa only [integral_indicator_const _ measurableSet_closedBall, + measureReal_restrict_apply measurableSet_closedBall, smul_eq_mul, mul_one, inter_comm] using ht + +theorem two_phase_of_indicator_L1 {n : ℕ} + (A : ℕ → Set (Euc n)) (F : Set (Euc n)) + (hA : ∀ i, MeasurableSet (A i)) (hF : MeasurableSet F) + (hconv : Tendsto (fun i ↦ ∫⁻ x, + ‖(A i).indicator (fun _ ↦ (1 : ℝ)) x - F.indicator (fun _ ↦ (1 : ℝ)) x‖ₑ) + atTop (𝓝 0)) + {ε : ℝ} (hε : 0 < ε) + (hphase : ∀ i (s : ℝ), 0 < s → s ≤ 1 → + ε * s ^ n ≤ volume.real (A i ∩ Metric.closedBall (0 : Euc n) s) ∧ + ε * s ^ n ≤ volume.real ((A i)ᶜ ∩ Metric.closedBall (0 : Euc n) s)) : + ∀ s : ℝ, 0 < s → s ≤ 1 → + 0 < volume (F ∩ Metric.ball (0 : Euc n) s) ∧ + 0 < volume (Fᶜ ∩ Metric.ball (0 : Euc n) s) := by + intro s hs hs1 + have hh : 0 < s / 2 := by positivity + have hh1 : s / 2 ≤ 1 := by linarith + have hl : ε * (s / 2) ^ n ≤ volume.real (F ∩ Metric.closedBall (0 : Euc n) (s / 2)) := by + apply ge_of_tendsto (tendsto_volumeReal_inter_closedBall_of_indicator_L1 A F hA hF hconv 0 (s / 2)) + exact Eventually.of_forall fun i ↦ (hphase i _ hh hh1).1 + have hconvC : Tendsto (fun i ↦ ∫⁻ x, + ‖(A i)ᶜ.indicator (fun _ ↦ (1 : ℝ)) x - Fᶜ.indicator (fun _ ↦ (1 : ℝ)) x‖ₑ) + atTop (𝓝 0) := by simpa only [indicator_L1_compl] using hconv + have hlc : ε * (s / 2) ^ n ≤ volume.real (Fᶜ ∩ Metric.closedBall (0 : Euc n) (s / 2)) := by + apply ge_of_tendsto (tendsto_volumeReal_inter_closedBall_of_indicator_L1 + (fun i ↦ (A i)ᶜ) Fᶜ (fun i ↦ (hA i).compl) hF.compl hconvC 0 (s / 2)) + exact Eventually.of_forall fun i ↦ (hphase i _ hh hh1).2 + have hp : 0 < ε * (s / 2) ^ n := mul_pos hε (pow_pos hh n) + have hsub : Metric.closedBall (0 : Euc n) (s / 2) ⊆ Metric.ball (0 : Euc n) s := + Metric.closedBall_subset_ball (by linarith) + exact ⟨(ENNReal.toReal_pos_iff.mp (hp.trans_le hl)).1.trans_le + (measure_mono (inter_subset_inter_right F hsub)), + (ENNReal.toReal_pos_iff.mp (hp.trans_le hlc)).1.trans_le + (measure_mono (inter_subset_inter_right Fᶜ hsub))⟩ + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +namespace RPISingularHarnack + +theorem tendsto_rescaledHalfspaceError_of_indicator_L1 {n : ℕ} + (E : Set (Euc n)) (c v : Euc n) (r : ℕ → ℝ) + (A : ℕ → Set (Euc n)) (hA : ∀ i, MeasurableSet (A i)) + (hAE : ∀ i, A i ∩ Metric.ball (0 : Euc n) 2 = + blownUpSet E c (r i) ∩ Metric.ball (0 : Euc n) 2) + (F : Set (Euc n)) (hF : MeasurableSet F) + (hconv : Tendsto (fun i ↦ ∫⁻ x, + ‖(A i).indicator (fun _ ↦ (1 : ℝ)) x - F.indicator (fun _ ↦ (1 : ℝ)) x‖ₑ) + atTop (𝓝 0)) + (hhalf : ∀ᵐ x ∂volume.restrict (Metric.ball (0 : Euc n) 1), + x ∈ F ↔ inner ℝ x v < 0) : + Tendsto (fun i ↦ rescaledHalfspaceError E (r i) (c, v)) atTop (𝓝 0) := by + have ht : Tendsto (fun i ↦ ∫⁻ x in Metric.ball (0 : Euc n) 1, + ‖(A i).indicator (fun _ ↦ (1 : ℝ)) x - F.indicator (fun _ ↦ (1 : ℝ)) x‖ₑ) + atTop (𝓝 0) := by + exact tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds hconv + (fun _ ↦ bot_le) (fun i ↦ setLIntegral_le_lintegral _ _) + have htR := (ENNReal.tendsto_toReal (by norm_num : (0 : ℝ≥0∞) ≠ ⊤)).comp ht + simp only [ENNReal.toReal_zero] at htR + convert htR using 1 + funext i + dsimp only [Function.comp_def] + have hm : AEStronglyMeasurable (fun x ↦ + (A i).indicator (fun _ ↦ (1 : ℝ)) x - F.indicator (fun _ ↦ (1 : ℝ)) x) + (volume.restrict (Metric.ball (0 : Euc n) 1)) := + ((measurable_const.indicator (hA i)).sub + (measurable_const.indicator hF)).aestronglyMeasurable.restrict + rw [← integral_norm_eq_lintegral_enorm hm] + unfold rescaledHalfspaceError + apply integral_congr_ae + have hzball : ∀ᵐ z ∂volume.restrict (Metric.ball (0 : Euc n) 1), + z ∈ Metric.ball (0 : Euc n) 1 := ae_restrict_mem measurableSet_ball + filter_upwards [hhalf, hzball] with z hz hz1 + have hz2 := Metric.ball_subset_ball (by norm_num : (1 : ℝ) ≤ 2) hz1 + have hAz : z ∈ A i ↔ c + r i • z ∈ E := by + have hh := Set.ext_iff.mp (hAE i) z + simpa only [blownUpSet, mem_inter_iff, mem_preimage, hz2, and_true] using hh + have hχA : (A i).indicator (fun _ ↦ (1 : ℝ)) z = + E.indicator (fun _ ↦ (1 : ℝ)) (c + r i • z) := by + by_cases ha : z ∈ A i + · simp [ha, hAz.mp ha] + · simp [ha, mt hAz.mpr ha] + have hχF : F.indicator (fun _ ↦ (1 : ℝ)) z = + {y | inner ℝ y v < 0}.indicator (fun _ ↦ (1 : ℝ)) z := by + by_cases hf : z ∈ F + · simp [hf, hz.mp hf] + · simp [hf, mt hz.mpr hf] + rw [hχA, hχF, Real.norm_eq_abs] + +theorem tendsto_of_every_subseq_has_subseq {X : Type*} [TopologicalSpace X] + (f : ℕ → X) (x : X) + (h : ∀ σ : ℕ → ℕ, StrictMono σ → ∃ τ : ℕ → ℕ, StrictMono τ ∧ + Tendsto (fun i ↦ f (σ (τ i))) atTop (𝓝 x)) : Tendsto f atTop (𝓝 x) := by + by_contra ht + rw [tendsto_def] at ht + push Not at ht + obtain ⟨S, hS, hnot⟩ := ht + have hf : ∃ᶠ i in atTop, f i ∉ S := by + intro hevent + apply hnot + filter_upwards [hevent] with i hi + exact not_not.mp hi + obtain ⟨σ, hσ, hbad⟩ := extraction_of_frequently_atTop hf + obtain ⟨τ, hτ, hgood⟩ := h σ hσ + obtain ⟨i, hi⟩ := (hgood.eventually hS).exists + exact hbad (τ i) hi + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +namespace RPISingularHarnack + +theorem inter_eq_on_subdomain {X : Type*} {A B U V : Set X} + (hAB : A ∩ U = B ∩ U) (hVU : V ⊆ U) : A ∩ V = B ∩ V := by + have hu : U ∩ V = V := inter_eq_right.mpr hVU + calc + A ∩ V = (A ∩ U) ∩ V := by rw [inter_assoc, hu] + _ = (B ∩ U) ∩ V := by rw [hAB] + _ = B ∩ V := by rw [inter_assoc, hu] + +theorem compl_inter_eq_of_inter_eq {X : Type*} {A B U : Set X} + (hAB : A ∩ U = B ∩ U) : Aᶜ ∩ U = Bᶜ ∩ U := by + ext x + have hh := Set.ext_iff.mp hAB x + simp only [mem_inter_iff, mem_compl_iff] at hh ⊢ + tauto + +theorem scaled_two_phase_bound_for_blownUpSet {n : ℕ} {E : Set (Euc n)} + (hE : MeasurableSet E) (c : Euc n) {ε : ℝ} + (hden : ∀ R : ℝ, 0 < R → + ε * R ^ n < volume.real (E ∩ Metric.closedBall c R) ∧ + ε * R ^ n < volume.real (Eᶜ ∩ Metric.closedBall c R)) + {r s : ℝ} (hr : 0 < r) (hs : 0 < s) : + ε * s ^ n ≤ volume.real (blownUpSet E c r ∩ Metric.closedBall (0 : Euc n) s) ∧ + ε * s ^ n ≤ volume.real ((blownUpSet E c r)ᶜ ∩ Metric.closedBall (0 : Euc n) s) := by + have he : (r ^ n)⁻¹ * (ε * (r * s) ^ n) = ε * s ^ n := by + rw [mul_pow] + field_simp + have hd := hden (r * s) (mul_pos hr hs) + constructor + · rw [volumeReal_blownUpSet_closedBall hE c hr s, ← he] + exact mul_le_mul_of_nonneg_left hd.1.le (by positivity) + · change ε * s ^ n ≤ volume.real (blownUpSet Eᶜ c r ∩ Metric.closedBall (0 : Euc n) s) + rw [volumeReal_blownUpSet_closedBall hE.compl c hr s, ← he] + exact mul_le_mul_of_nonneg_left hd.2.le (by positivity) + +theorem exists_halfspace_blowup_subsequence {n : ℕ} (hn : 1 < n) + {E U : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) (hU : IsOpen U) + (μ : Measure (Euc n)) [IsFiniteMeasure μ] + {G : Euc n → Euc n} (hG : Integrable G μ) + (hrep : ∀ V : Euc n → Euc n, ContDiff ℝ ∞ V → HasCompactSupport V → + tsupport V ⊆ U → (∫ y in E, divergence V y) = ∫ y, inner ℝ (G y) (V y) ∂μ) + (c v : Euc n) (hcU : c ∈ U) (hc : c ∈ perimeterSupport E) (hv : ‖v‖ = 1) + (hosc : Tendsto (fun s : ℝ ↦ (s ^ (n - 1))⁻¹ * ∫ y in Metric.closedBall c s, + ‖G y - v‖ ∂μ) (𝓝[>] (0 : ℝ)) (𝓝 0)) + {r : ℕ → ℝ} (hr : ∀ i, 0 < r i) (hr0 : Tendsto r atTop (𝓝 0)) : + ∃ σ : ℕ → ℕ, StrictMono σ ∧ + Tendsto (fun i ↦ rescaledHalfspaceError E (r (σ i)) (c, v)) atTop (𝓝 0) := by + have hn0 : 0 < n := lt_trans (by norm_num) hn + obtain ⟨C, hC, hbound⟩ := exists_blownUpSet_perimeter_bound hn0 + obtain ⟨F, hF, hFK, A, hA, hAE, σ, hσ, hconv⟩ := + exists_local_indicator_L1_subsequence C hC (fun i ↦ blownUpSet E c (r i)) + (fun i ↦ measurableSet_blownUpSet hmin.1 c (r i)) + (fun i ↦ hbound E hmin c (r i) (hr i)) + have hnR : (1 : ℝ) < (n : ℝ) := by exact_mod_cast hn + obtain ⟨ε, hε, hdensity⟩ := minimizing_scaled_two_phase_volume_lower + (Real.HolderConjugate.conjExponent hnR) + have hphaseA : ∀ i (s : ℝ), 0 < s → s ≤ 1 → + ε * s ^ n ≤ volume.real (A i ∩ Metric.closedBall (0 : Euc n) s) ∧ + ε * s ^ n ≤ volume.real ((A i)ᶜ ∩ Metric.closedBall (0 : Euc n) s) := by + intro i s hs hs1 + have hsub : Metric.closedBall (0 : Euc n) s ⊆ Metric.ball (0 : Euc n) 2 := + Metric.closedBall_subset_ball (by linarith) + rw [inter_eq_on_subdomain (hAE i) hsub, + inter_eq_on_subdomain (compl_inter_eq_of_inter_eq (hAE i)) hsub] + exact scaled_two_phase_bound_for_blownUpSet hmin.1 c + (hdensity E hmin c hc) (hr i) hs + have hphase : ∀ s : ℝ, 0 < s → s ≤ 1 → + 0 < volume (F ∩ Metric.ball (0 : Euc n) s) ∧ + 0 < volume (Fᶜ ∩ Metric.ball (0 : Euc n) s) := + two_phase_of_indicator_L1 (fun i ↦ A (σ i)) F (fun i ↦ hA (σ i)) hF hconv hε + (fun i ↦ hphaseA (σ i)) + have hrU : ∀ᶠ i in atTop, Metric.ball c (r i * 2) ⊆ U := by + obtain ⟨δ, hδ, hδU⟩ := Metric.mem_nhds_iff.mp (hU.mem_nhds hcU) + have ht : Tendsto (fun i ↦ r i * 2) atTop (𝓝 0) := by + simpa only [zero_mul] using hr0.mul_const 2 + filter_upwards [ht.eventually (gt_mem_nhds hδ)] with i hi + exact (Metric.ball_subset_ball hi.le).trans hδU + obtain ⟨hflat, hmono⟩ := flat_distribution_of_polar_blowup_limit hn0 hmin.1 μ hG hrep + c v hosc (fun i ↦ hr (σ i)) (hr0.comp hσ.tendsto_atTop) + (hσ.tendsto_atTop.eventually hrU) (fun i ↦ A (σ i)) (fun i ↦ hA (σ i)) + (fun i ↦ hAE (σ i)) F hF hconv + obtain ⟨t, ht, hhalf⟩ := halfspace_of_flat_distribution hF (by norm_num : (0 : ℝ) < 2) + hv hflat hmono + have hhalf1 : ∀ᵐ x ∂volume.restrict (Metric.ball (0 : Euc n) 1), + x ∈ F ↔ inner ℝ x v < t := by simpa only [show (2 : ℝ) / 2 = 1 by norm_num] using hhalf + have ht0 := halfspace_threshold_eq_zero (by norm_num : (0 : ℝ) < 1) hv hhalf1 hphase + rw [ht0] at hhalf1 + exact ⟨σ, hσ, tendsto_rescaledHalfspaceError_of_indicator_L1 E c v (fun i ↦ r (σ i)) + (fun i ↦ A (σ i)) (fun i ↦ hA (σ i)) (fun i ↦ hAE (σ i)) F hF hconv hhalf1⟩ + +theorem hasHalfspaceBlowup_of_differentiating_polar {n : ℕ} (hn : 1 < n) + {E U : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) (hU : IsOpen U) + (μ : Measure (Euc n)) [IsFiniteMeasure μ] + {G : Euc n → Euc n} (hG : Integrable G μ) + (hrep : ∀ V : Euc n → Euc n, ContDiff ℝ ∞ V → HasCompactSupport V → + tsupport V ⊆ U → (∫ y in E, divergence V y) = ∫ y, inner ℝ (G y) (V y) ∂μ) + (c v : Euc n) (hcU : c ∈ U) (hc : c ∈ perimeterSupport E) (hv : ‖v‖ = 1) + (hosc : Tendsto (fun s : ℝ ↦ (s ^ (n - 1))⁻¹ * ∫ y in Metric.closedBall c s, + ‖G y - v‖ ∂μ) (𝓝[>] (0 : ℝ)) (𝓝 0)) : HasHalfspaceBlowup E c v := by + apply (hasHalfspaceBlowup_iff_dyadic hmin.1 c v).mpr + refine ⟨hv, tendsto_of_every_subseq_has_subseq + (fun i : ℕ ↦ rescaledHalfspaceError E ((1 / 2 : ℝ) ^ i) (c, v)) (0 : ℝ) ?_⟩ + intro σ hσ + have ht : Tendsto (fun i ↦ (1 / 2 : ℝ) ^ σ i) atTop (𝓝 0) := + (tendsto_pow_atTop_nhds_zero_of_lt_one + (by norm_num : (0 : ℝ) ≤ 1 / 2) (by norm_num : (1 / 2 : ℝ) < 1)).comp hσ.tendsto_atTop + exact exists_halfspace_blowup_subsequence hn hmin hU μ hG hrep c v hcU hc hv hosc + (r := fun i : ℕ ↦ (1 / 2 : ℝ) ^ σ i) + (fun i ↦ pow_pos (by norm_num : (0 : ℝ) < 1 / 2) (σ i)) ht + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/UniformDerivativeContinuity.lean b/lean/OAI/Geometry/Perimeter/Regularity/UniformDerivativeContinuity.lean new file mode 100644 index 0000000000000000000000000000000000000000..2aa09945900dbc5a373263a19aa3b5870098a578 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/UniformDerivativeContinuity.lean @@ -0,0 +1,96 @@ +import OAI.Geometry.Perimeter.Regularity.EllipticLocality + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace +namespace RPISingularHarnack + +theorem four_point_linear_bound {t e d A B X X' Y Y' : ℝ} (ht : 0.aemeasurable.ennreal_ofReal) + have hGm : AEMeasurable (fun x ↦ (2 : ℝ≥0∞) * ENNReal.ofReal (‖G x‖ ^ 2)) μ := + aemeasurable_const.mul (hG.norm.pow 2 |>.aemeasurable.ennreal_ofReal) + calc + _ ≤ ∫⁻ x, 2 * ENNReal.ofReal (‖F x‖ ^ 2) + 2 * ENNReal.ofReal (‖G x‖ ^ 2) ∂μ := by + apply lintegral_mono + intro x + have hb : ‖F x + G x‖ ^ 2 ≤ 2 * ‖F x‖ ^ 2 + 2 * ‖G x‖ ^ 2 := by + have hsq := (sq_le_sq₀ (norm_nonneg _) (add_nonneg (norm_nonneg _) (norm_nonneg _))).mpr + (norm_add_le (F x) (G x)) + nlinarith [sq_nonneg (‖F x‖ - ‖G x‖)] + calc + _ ≤ ENNReal.ofReal (2 * ‖F x‖ ^ 2 + 2 * ‖G x‖ ^ 2) := ENNReal.ofReal_le_ofReal hb + _ = _ := by + rw [ENNReal.ofReal_add (by positivity) (by positivity), + ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 2), + ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 2)] + norm_num + _ = _ := by + rw [lintegral_congr_ae (hFm.ae_eq_mk.fun_add hGm.ae_eq_mk), + lintegral_add_aux hFm.measurable_mk hGm.measurable_mk, + ← lintegral_congr_ae hFm.ae_eq_mk, ← lintegral_congr_ae hGm.ae_eq_mk, + lintegral_const_mul' _ _ (by norm_num : (2 : ℝ≥0∞) ≠ ⊤), + lintegral_const_mul' _ _ (by norm_num : (2 : ℝ≥0∞) ≠ ⊤)] + rfl + +theorem vectorEnergy_omitted_tendsto_zero {G : X → V} (hG : MemLp G 2 μ) + (χ : ℕ → X → ℝ) (hχ : ∀ i, AEStronglyMeasurable (χ i) μ) + (hχb : ∀ i, ∀ᵐ x ∂μ, χ i x ∈ Icc (0 : ℝ) 1) + (hχlim : ∀ᵐ x ∂μ, Tendsto (fun i ↦ χ i x) atTop (𝓝 1)) : + Tendsto (fun i ↦ vectorEnergy μ (fun x ↦ (χ i x - 1) • G x)) atTop (𝓝 0) := by + have hfin : vectorEnergy μ G ≠ ⊤ := + (memLp_two_iff_vectorEnergy hG.aestronglyMeasurable).mp hG |>.ne + have hlim := tendsto_lintegral_of_dominated_convergence' + (fun x ↦ ENNReal.ofReal (‖G x‖ ^ 2)) + (f := fun _ ↦ (0 : ℝ≥0∞)) + (F := fun i x ↦ ENNReal.ofReal (‖(χ i x - 1) • G x‖ ^ 2)) + (fun i ↦ (((hχ i).sub aestronglyMeasurable_const).smul hG.aestronglyMeasurable).norm.pow 2 + |>.aemeasurable.ennreal_ofReal) ?_ hfin ?_ + · simpa only [vectorEnergy, lintegral_zero] using hlim + · intro i + filter_upwards [hχb i] with x hx + apply ENNReal.ofReal_le_ofReal + apply (sq_le_sq₀ (norm_nonneg _) (norm_nonneg _)).mpr + rw [norm_smul, Real.norm_eq_abs, abs_of_nonpos (by linarith [hx.2])] + exact mul_le_of_le_one_left (norm_nonneg _) (by linarith [hx.1]) + · filter_upwards [hχlim] with x hx + have hv : Tendsto (fun i ↦ (χ i x - 1) • G x) atTop (𝓝 (0 : V)) := by + simpa only [sub_self, zero_smul] using (hx.sub_const 1).smul_const (G x) + simpa only [norm_zero, zero_pow (by norm_num : (2 : ℕ) ≠ 0), ENNReal.ofReal_zero] using + ENNReal.tendsto_ofReal (hv.norm.pow 2) + +theorem vectorEnergy_bounded_smul_tendsto_zero {h : X → ℝ} {M : ℝ} + (hM : 0 ≤ M) (hh : ∀ᵐ x ∂μ, ‖h x‖ ≤ M) + (C : ℕ → X → V) + (hC : Tendsto (fun i ↦ vectorEnergy μ (C i)) atTop (𝓝 0)) : + Tendsto (fun i ↦ vectorEnergy μ (fun x ↦ h x • C i x)) atTop (𝓝 0) := by + have ha : Tendsto (fun i ↦ ENNReal.ofReal (M ^ 2) * vectorEnergy μ (C i)) atTop (𝓝 0) := by + simpa only [mul_zero] using ENNReal.Tendsto.const_mul hC (Or.inr ENNReal.ofReal_ne_top) + exact tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds ha + (fun _ ↦ zero_le) (fun _ ↦ vectorEnergy_bounded_smul hM hh) + +theorem memLp_of_capacity_energy_bounds {G : X → V} + (χ : ℕ → X → ℝ) + (hF : ∀ i, MemLp (fun x ↦ χ i x • G x) 2 μ) + (hχlim : ∀ᵐ x ∂μ, Tendsto (fun i ↦ χ i x) atTop (𝓝 1)) + {a : ℕ → ℝ≥0∞} (ha : Tendsto a atTop (𝓝 0)) + {A B : ℝ≥0∞} (hA : A ≠ ⊤) (hB : B < ⊤) + (hbound : ∀ᶠ i in atTop, vectorEnergy μ (fun x ↦ χ i x • G x) ≤ B + A * a i) : + MemLp G 2 μ ∧ vectorEnergy μ G ≤ B := by + have hlim : ∀ᵐ x ∂μ, Tendsto (fun i ↦ χ i x • G x) atTop (𝓝 (G x)) := by + filter_upwards [hχlim] with x hx + simpa only [one_smul] using hx.smul_const (G x) + have hG : AEStronglyMeasurable G μ := + aestronglyMeasurable_of_tendsto_ae atTop (fun i ↦ (hF i).aestronglyMeasurable) hlim + have hbB : Tendsto (fun i ↦ B + A * a i) atTop (𝓝 B) := by + simpa only [mul_zero, add_zero] using + tendsto_const_nhds.add (ENNReal.Tendsto.const_mul ha (Or.inr hA)) + have hE := vectorEnergy_le_of_ae_tendsto (fun i ↦ (hF i).aestronglyMeasurable) hlim hbound hbB + exact ⟨(memLp_two_iff_vectorEnergy hG).mpr (hE.trans_lt hB), hE⟩ + +theorem capacity_productGradient_tendsto {G : X → V} (hG : MemLp G 2 μ) + (χ : ℕ → X → ℝ) (hχ : ∀ i, AEStronglyMeasurable (χ i) μ) + (hχb : ∀ i, ∀ᵐ x ∂μ, χ i x ∈ Icc (0 : ℝ) 1) + (hχlim : ∀ᵐ x ∂μ, Tendsto (fun i ↦ χ i x) atTop (𝓝 1)) + {h : X → ℝ} (hh : AEStronglyMeasurable h μ) {M : ℝ} (hM : 0 ≤ M) + (hhb : ∀ᵐ x ∂μ, ‖h x‖ ≤ M) + (C : ℕ → X → V) (hC : ∀ i, MemLp (C i) 2 μ) + (hC0 : Tendsto (fun i ↦ vectorEnergy μ (C i)) atTop (𝓝 0)) : + Tendsto (fun i ↦ vectorEnergy μ (fun x ↦ χ i x • G x + h x • C i x - G x)) + atTop (𝓝 0) := by + have ho := vectorEnergy_omitted_tendsto_zero hG χ hχ hχb hχlim + have he := vectorEnergy_bounded_smul_tendsto_zero hM hhb C hC0 + have htwo : (2 : ℝ≥0∞) ≠ ⊤ := by norm_num + have hsum : Tendsto (fun i ↦ + 2 * vectorEnergy μ (fun x ↦ (χ i x - 1) • G x) + + 2 * vectorEnergy μ (fun x ↦ h x • C i x)) atTop (𝓝 0) := by + simpa only [mul_zero, add_zero] using + (ENNReal.Tendsto.const_mul ho (Or.inr htwo)).add + (ENNReal.Tendsto.const_mul he (Or.inr htwo)) + apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds hsum (fun _ ↦ zero_le) + intro i + have h₁ : AEStronglyMeasurable (fun x ↦ (χ i x - 1) • G x) μ := + ((hχ i).sub aestronglyMeasurable_const).smul hG.aestronglyMeasurable + have h₂ : AEStronglyMeasurable (fun x ↦ h x • C i x) μ := + hh.smul (hC i).aestronglyMeasurable + have hid : (fun x ↦ χ i x • G x + h x • C i x - G x) = + (fun x ↦ (χ i x - 1) • G x + h x • C i x) := by + funext x + simp only [sub_smul, one_smul] + abel + change vectorEnergy μ (fun x ↦ χ i x • G x + h x • C i x - G x) ≤ + 2 * vectorEnergy μ (fun x ↦ (χ i x - 1) • G x) + + 2 * vectorEnergy μ (fun x ↦ h x • C i x) + rw [hid] + exact vectorEnergy_add_le h₁ h₂ + +theorem capacity_product_pair_tendsto {h : X → ℝ} {G : X → V} + (hh : MemLp h 2 μ) (hG : MemLp G 2 μ) + (χ : ℕ → X → ℝ) (hχ : ∀ i, AEStronglyMeasurable (χ i) μ) + (hχb : ∀ i, ∀ᵐ x ∂μ, χ i x ∈ Icc (0 : ℝ) 1) + (hχlim : ∀ᵐ x ∂μ, Tendsto (fun i ↦ χ i x) atTop (𝓝 1)) + {M : ℝ} (hM : 0 ≤ M) (hhb : ∀ᵐ x ∂μ, ‖h x‖ ≤ M) + (C : ℕ → X → V) (hC : ∀ i, MemLp (C i) 2 μ) + (hC0 : Tendsto (fun i ↦ vectorEnergy μ (C i)) atTop (𝓝 0)) : + ∃ (hm : ∀ i, MemLp (fun x ↦ χ i x * h x) 2 μ) + (hg : ∀ i, MemLp (fun x ↦ χ i x • G x + h x • C i x) 2 μ), + Tendsto (fun i ↦ ((hm i).toLp (fun x ↦ χ i x * h x), + (hg i).toLp (fun x ↦ χ i x • G x + h x • C i x))) atTop + (𝓝 (hh.toLp h, hG.toLp G)) := by + have hχnorm : ∀ i, ∀ᵐ x ∂μ, ‖χ i x‖ ≤ 1 := by + intro i + filter_upwards [hχb i] with x hx + simpa only [Real.norm_eq_abs, abs_of_nonneg hx.1] using hx.2 + have hm : ∀ i, MemLp (fun x ↦ χ i x * h x) 2 μ := by + intro i + apply hh.of_le_mul (c := 1) ((hχ i).mul hh.aestronglyMeasurable) + filter_upwards [hχnorm i] with x hx + change ‖χ i x * h x‖ ≤ 1 * ‖h x‖ + rw [norm_mul] + exact mul_le_mul_of_nonneg_right hx (norm_nonneg _) + have hg : ∀ i, MemLp (fun x ↦ χ i x • G x + h x • C i x) 2 μ := by + intro i + have hg₁ : MemLp (fun x ↦ χ i x • G x) 2 μ := by + apply hG.of_le_mul (c := 1) ((hχ i).smul hG.aestronglyMeasurable) + filter_upwards [hχnorm i] with x hx + change ‖χ i x • G x‖ ≤ 1 * ‖G x‖ + rw [norm_smul] + exact mul_le_mul_of_nonneg_right hx (norm_nonneg _) + have hg₂ : MemLp (fun x ↦ h x • C i x) 2 μ := by + apply (hC i).of_le_mul (c := M) (hh.aestronglyMeasurable.smul (hC i).aestronglyMeasurable) + filter_upwards [hhb] with x hx + change ‖h x • C i x‖ ≤ M * ‖C i x‖ + rw [norm_smul] + exact mul_le_mul_of_nonneg_right hx (norm_nonneg _) + exact hg₁.add hg₂ + refine ⟨hm, hg, ?_⟩ + apply Filter.Tendsto.prodMk_nhds + · apply (Lp.tendsto_Lp_iff_tendsto_eLpNorm'' _ hm h hh).mpr + apply tendsto_eLpNorm_two_of_vectorEnergy_zero_of_aestronglyMeasurable + (fun i ↦ ((hm i).sub hh).aestronglyMeasurable) + change Tendsto (fun i ↦ vectorEnergy μ (fun x ↦ χ i x * h x - h x)) atTop (𝓝 0) + have hid : (fun i ↦ vectorEnergy μ (fun x ↦ χ i x * h x - h x)) = + (fun i ↦ vectorEnergy μ (fun x ↦ (χ i x - 1) • h x)) := by + funext i + congr 1 + funext x + change χ i x * h x - h x = (χ i x - 1) * h x + ring + rw [hid] + exact vectorEnergy_omitted_tendsto_zero hh χ hχ hχb hχlim + · apply (Lp.tendsto_Lp_iff_tendsto_eLpNorm'' _ hg G hG).mpr + apply tendsto_eLpNorm_two_of_vectorEnergy_zero_of_aestronglyMeasurable + (fun i ↦ ((hg i).sub hG).aestronglyMeasurable) + exact capacity_productGradient_tendsto hG χ hχ hχb hχlim + hh.aestronglyMeasurable hM hhb C hC hC0 + +end SobolevLimits + +section Caccioppoli +variable {X V : Type*} [MeasurableSpace X] + [NormedAddCommGroup V] [InnerProductSpace ℝ V] {μ : Measure X} + +theorem truncation_test_pointwise (A B : V) {h : ℝ} (h0 : 0 ≤ h) (h1 : h ≤ 1) : + inner ℝ A ((2 * (1 - h)) • B - A) ≤ + 2 * ‖B‖ ^ 2 - (1 / 2 : ℝ) * ‖A‖ ^ 2 := by + rw [inner_sub_right, real_inner_smul_right, real_inner_self_eq_norm_sq] + have hcoef : 0 ≤ 2 * (1 - h) := by positivity + have hi := mul_le_mul_of_nonneg_left (real_inner_le_norm A B) hcoef + have hn : 0 ≤ ‖A‖ * ‖B‖ := mul_nonneg (norm_nonneg _) (norm_nonneg _) + have hh := mul_nonneg h0 hn + nlinarith [sq_nonneg (‖A‖ - 2 * ‖B‖)] + +theorem truncation_test_energy {A B : X → V} + (hA : MemLp A 2 μ) (hB : MemLp B 2 μ) + {h : X → ℝ} (hh : AEStronglyMeasurable h μ) + (hb : ∀ᵐ x ∂μ, h x ∈ Icc (0 : ℝ) 1) + (htest : 0 ≤ ∫ x, inner ℝ (A x) ((2 * (1 - h x)) • B x - A x) ∂μ) : + (∫ x, ‖A x‖ ^ 2 ∂μ) ≤ 4 * ∫ x, ‖B x‖ ^ 2 ∂μ := by + have hC : MemLp (fun x ↦ (2 * (1 - h x)) • B x) 2 μ := by + apply hB.of_le_mul (c := 2) ((aestronglyMeasurable_const.mul + (aestronglyMeasurable_const.sub hh)).smul hB.aestronglyMeasurable) + filter_upwards [hb] with x hx + change ‖(2 * (1 - h x)) • B x‖ ≤ 2 * ‖B x‖ + rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg (by nlinarith [hx.2])] + exact mul_le_mul_of_nonneg_right (by linarith [hx.1]) (norm_nonneg _) + have hCsub : MemLp (fun x ↦ (2 * (1 - h x)) • B x - A x) 2 μ := hC.sub hA + have hi : Integrable (fun x ↦ inner ℝ (A x) + ((2 * (1 - h x)) • B x - A x)) μ := by + apply (L2.integrable_inner (𝕜 := ℝ) (hA.toLp A) + (hCsub.toLp (fun x ↦ (2 * (1 - h x)) • B x - A x))).congr + filter_upwards [hA.coeFn_toLp, hCsub.coeFn_toLp] with x hx hy + rw [hx, hy] + have hAs := (memLp_two_iff_integrable_sq_norm hA.aestronglyMeasurable).mp hA + have hBs := (memLp_two_iff_integrable_sq_norm hB.aestronglyMeasurable).mp hB + have hu : Integrable (fun x ↦ 2 * ‖B x‖ ^ 2 - (1 / 2 : ℝ) * ‖A x‖ ^ 2) μ := + (hBs.const_mul 2).sub (hAs.const_mul (1 / 2)) + have hle := integral_mono_ae hi hu (by + filter_upwards [hb] with x hx using truncation_test_pointwise (A x) (B x) hx.1 hx.2) + rw [integral_sub (hBs.const_mul 2) (hAs.const_mul (1 / 2)), + integral_const_mul, integral_const_mul] at hle + linarith + +end Caccioppoli +end RPI + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +namespace RPI.Boundary + +theorem capacity_trace_mem_sobolevGraph {n : ℕ} {S Z : Set (Space n)} + (hS : IsClosed S) (V : Set (Space n)) + {h : Space n → ℝ} {G : Space n → Space n} + (hreg : ∀ x ∈ S \ Z, HasSmoothTraceJetAt S h G x) + (hh : MemLp h 2 ((surfaceMeasure S).restrict V)) + (hG : MemLp G 2 ((surfaceMeasure S).restrict V)) + {M : ℝ} (hM : 0 ≤ M) + (hbound : ∀ᵐ x ∂(surfaceMeasure S).restrict V, ‖h x‖ ≤ M) + (χ : ℕ → Space n → ℝ) + (hχ : ∀ i, ContDiff ℝ ∞ (χ i)) + (hχzero : ∀ i, ∃ U : Set (Space n), IsOpen U ∧ Z ⊆ U ∧ ∀ x ∈ U, χ i x = 0) + (hχb : ∀ i, ∀ᵐ x ∂(surfaceMeasure S).restrict V, χ i x ∈ Icc (0 : ℝ) 1) + (hχlim : ∀ᵐ x ∂(surfaceMeasure S).restrict V, + Tendsto (fun i ↦ χ i x) atTop (𝓝 1)) + (hC : ∀ i, MemLp (surfaceGradient S (χ i)) 2 ((surfaceMeasure S).restrict V)) + (hC0 : Tendsto (fun i ↦ vectorEnergy ((surfaceMeasure S).restrict V) + (surfaceGradient S (χ i))) atTop (𝓝 0)) : + (hh.toLp h, hG.toLp G) ∈ closure (smoothGradientGraph S V) := by + obtain ⟨hm, hg, ht⟩ := capacity_product_pair_tendsto hh hG χ + (fun i ↦ (hχ i).continuous.aestronglyMeasurable) hχb hχlim hM hbound + (fun i ↦ surfaceGradient S (χ i)) hC hC0 + apply mem_closure_of_tendsto ht + apply Filter.Eventually.of_forall + intro i + obtain ⟨F, hF, hFe, hFG⟩ := exists_smooth_cutoff_trace hS hreg (χ i) (hχ i) (hχzero i) + have hμS : ∀ᵐ x ∂(surfaceMeasure S).restrict V, x ∈ S := + ae_restrict_of_ae (ae_restrict_mem hS.measurableSet) + have he : F =ᵐ[(surfaceMeasure S).restrict V] (fun x ↦ χ i x * h x) := by + filter_upwards [hμS] with x hx using hFe hx + have hge : surfaceGradient S F =ᵐ[(surfaceMeasure S).restrict V] + (fun x ↦ χ i x • G x + h x • surfaceGradient S (χ i) x) := by + filter_upwards [hμS] with x hx using hFG hx + let hfmem := MemLp.ae_eq he.symm (hm i) + let hgfmem := MemLp.ae_eq hge.symm (hg i) + exact ⟨F, hF, hfmem, hgfmem, Prod.ext + ((hm i).toLp_congr hfmem he.symm) ((hg i).toLp_congr hgfmem hge.symm)⟩ + +end RPI.Boundary + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +namespace RPI +section EnergyClosure +variable {X V : Type*} [MeasurableSpace X] + [NormedAddCommGroup V] {μ : Measure X} + +theorem vectorEnergy_eq_enorm_toLp_sq {F : X → V} (hF : MemLp F 2 μ) : + vectorEnergy μ F = ‖hF.toLp F‖ₑ ^ 2 := by + rw [Lp.enorm_toLp, + eLpNorm_two_eq_vectorEnergy_rpow_of_aestronglyMeasurable hF.aestronglyMeasurable, + ← ENNReal.rpow_natCast, ← ENNReal.rpow_mul] + norm_num + +theorem vectorEnergy_tendsto_of_toLp_tendsto {F : ℕ → X → V} {G : X → V} + (hF : ∀ i, MemLp (F i) 2 μ) (hG : MemLp G 2 μ) + (ht : Tendsto (fun i ↦ (hF i).toLp (F i)) atTop (𝓝 (hG.toLp G))) : + Tendsto (fun i ↦ vectorEnergy μ (F i)) atTop (𝓝 (vectorEnergy μ G)) := by + have he : (fun i ↦ vectorEnergy μ (F i)) = + (fun i ↦ ‖(hF i).toLp (F i)‖ₑ ^ 2) := + funext (fun i ↦ vectorEnergy_eq_enorm_toLp_sq (hF i)) + rw [he, vectorEnergy_eq_enorm_toLp_sq hG] + exact ENNReal.Tendsto.pow ht.enorm + +variable [InnerProductSpace ℝ V] + +theorem memLp_of_regular_caccioppoli + {h η : X → ℝ} {H D : X → V} + (hh : AEStronglyMeasurable h μ) + (hb : ∀ᵐ x ∂μ, h x ∈ Icc (0 : ℝ) 1) + (hη : MemLp η 2 μ) (hD : MemLp D 2 μ) + {M : ℝ} (hM : 0 ≤ M) (hηb : ∀ᵐ x ∂μ, ‖η x‖ ≤ M) + (χ : ℕ → X → ℝ) (hχ : ∀ i, AEStronglyMeasurable (χ i) μ) + (hχb : ∀ i, ∀ᵐ x ∂μ, χ i x ∈ Icc (0 : ℝ) 1) + (hχlim : ∀ᵐ x ∂μ, Tendsto (fun i ↦ χ i x) atTop (𝓝 1)) + (C : ℕ → X → V) (hC : ∀ i, MemLp (C i) 2 μ) + (hC0 : Tendsto (fun i ↦ vectorEnergy μ (C i)) atTop (𝓝 0)) + (hA : ∀ i, MemLp (fun x ↦ χ i x • H x) 2 μ) + (htest : ∀ i, 0 ≤ ∫ x, inner ℝ (χ i x • H x) + ((2 * (1 - h x)) • (χ i x • D x + η x • C i x) - χ i x • H x) ∂μ) : + MemLp H 2 μ ∧ vectorEnergy μ H ≤ 4 * vectorEnergy μ D := by + obtain ⟨_, hB, hBt⟩ := capacity_product_pair_tendsto hη hD χ hχ hχb hχlim + hM hηb C hC hC0 + have hBE := vectorEnergy_tendsto_of_toLp_tendsto hB hD hBt.snd_nhds + have hbound : ∀ i, vectorEnergy μ (fun x ↦ χ i x • H x) ≤ + 4 * vectorEnergy μ (fun x ↦ χ i x • D x + η x • C i x) := by + intro i + have he := truncation_test_energy (hA i) (hB i) hh hb (htest i) + have he' := ENNReal.ofReal_le_ofReal he + rw [ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 4)] at he' + simpa only [vectorEnergy, ofReal_integral_eq_lintegral_ofReal + ((memLp_two_iff_integrable_sq_norm (hA i).aestronglyMeasurable).mp (hA i)) + (ae_of_all μ (fun x ↦ sq_nonneg ‖χ i x • H x‖)), + ofReal_integral_eq_lintegral_ofReal + ((memLp_two_iff_integrable_sq_norm (hB i).aestronglyMeasurable).mp (hB i)) + (ae_of_all μ (fun x ↦ sq_nonneg ‖χ i x • D x + η x • C i x‖)), + ENNReal.ofReal_ofNat] using he' + have hlim : ∀ᵐ x ∂μ, Tendsto (fun i ↦ χ i x • H x) atTop (𝓝 (H x)) := by + filter_upwards [hχlim] with x hx + simpa only [one_smul] using hx.smul_const (H x) + have hH : AEStronglyMeasurable H μ := + aestronglyMeasurable_of_tendsto_ae atTop (fun i ↦ (hA i).aestronglyMeasurable) hlim + have hBE' : Tendsto (fun i ↦ 4 * vectorEnergy μ + (fun x ↦ χ i x • D x + η x • C i x)) atTop (𝓝 (4 * vectorEnergy μ D)) := + ENNReal.Tendsto.const_mul hBE (Or.inr (by norm_num)) + have he := vectorEnergy_le_of_ae_tendsto (fun i ↦ (hA i).aestronglyMeasurable) hlim + (Eventually.of_forall hbound) hBE' + refine ⟨(memLp_two_iff_vectorEnergy hH).mpr (he.trans_lt ?_), he⟩ + exact ENNReal.mul_lt_top (by norm_num) + ((memLp_two_iff_vectorEnergy hD.aestronglyMeasurable).mp hD) + +end EnergyClosure +end RPI + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/VectorQuotient.lean b/lean/OAI/Geometry/Perimeter/Regularity/VectorQuotient.lean new file mode 100644 index 0000000000000000000000000000000000000000..ae0cfe010a1af18d818e0f2c5a8d5aa90dbc3e48 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/VectorQuotient.lean @@ -0,0 +1,83 @@ +import OAI.Geometry.Perimeter.Regularity.EllipticDifference + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +variable {n : ℕ} +variable {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] [CompleteSpace V] + + def vectorQuotient (G : Euc n → V) (e : Euc n) (s : ℝ) (x : Euc n) : V := + s⁻¹•(G (x+s•e)-G x) + +omit [CompleteSpace V] in + theorem vectorQuotient_continuous [CompleteSpace V] {G : Euc n → V} (hG : Continuous G) (e : Euc n) (s : ℝ) : + Continuous (vectorQuotient G e s) := + continuous_const.smul ((hG.comp (continuous_id.add continuous_const)).sub hG) + + theorem vectorQuotient_integral {G : Euc n → V} (hG : ContDiff ℝ 1 G) + (e : Euc n) {s : ℝ} (hs : s≠0) (x : Euc n) : + vectorQuotient G e s x = ∫ t in (0:ℝ)..1, fderiv ℝ G (x+t•(s•e)) e := by + have hc : Continuous (fun t : ℝ ↦ fderiv ℝ G (x+t•(s•e)) e) := + ((hG.continuous_fderiv (by simp)).comp + (continuous_const.add (continuous_id.smul continuous_const))).clm_apply continuous_const + have hd (t : ℝ) : HasDerivAt (fun u : ℝ ↦ G (x+u•(s•e))) + (s•fderiv ℝ G (x+t•(s•e)) e) t := by + have hh := (hG.differentiable (by simp) _).hasFDerivAt.comp_hasDerivAt t + ((hasDerivAt_id t).smul_const (s•e) |>.const_add x) + simpa only [map_smul,one_smul,id_eq,Function.comp_def] using hh + have hh := intervalIntegral.integral_eq_sub_of_hasDerivAt (fun t _ ↦ hd t) + ((continuous_const.smul hc).intervalIntegrable 0 1) + simp only [intervalIntegral.integral_smul,zero_smul,add_zero,one_smul] at hh + rw [vectorQuotient,←hh,smul_smul,inv_mul_cancel₀ hs,one_smul] + + theorem vectorQuotient_bound {G : Euc n → V} (hG : ContDiff ℝ 1 G) + {L : ℝ} (hL : 0 ≤ L) (hbound : ∀ x, ‖fderiv ℝ G x‖ ≤ L) + (e : Euc n) (s : ℝ) (x : Euc n) : ‖vectorQuotient G e s x‖ ≤ L*‖e‖ := by + by_cases hs : s=0 + · simp only [vectorQuotient,hs,inv_zero,zero_smul,norm_zero] + positivity + rw [vectorQuotient_integral hG e hs] + have hh := intervalIntegral.norm_integral_le_of_norm_le_const (a := 0) (b := 1) (fun t _ ↦ + ((fderiv ℝ G (x+t•(s•e))).le_opNorm e).trans + (mul_le_mul_of_nonneg_right (hbound _) (norm_nonneg _))) + simpa using hh + + theorem vectorQuotient_difference {G : Euc n → V} (hG : ContDiff ℝ 1 G) + (e : Euc n) {s : ℝ} (hs : s≠0) (x y : Euc n) {C : ℝ} + (h : ∀ t∈Icc (0:ℝ) 1, + ‖fderiv ℝ G (x+t•(s•e))-fderiv ℝ G (y+t•(s•e))‖ ≤ C) : + ‖vectorQuotient G e s x-vectorQuotient G e s y‖ ≤ C*‖e‖ := by + have hc (x : Euc n) : Continuous (fun t : ℝ ↦ fderiv ℝ G (x+t•(s•e)) e) := + ((hG.continuous_fderiv (by simp)).comp + (continuous_const.add (continuous_id.smul continuous_const))).clm_apply continuous_const + rw [vectorQuotient_integral hG e hs,vectorQuotient_integral hG e hs, + ←intervalIntegral.integral_sub ((hc x).intervalIntegrable 0 1) ((hc y).intervalIntegrable 0 1)] + have hh := intervalIntegral.norm_integral_le_of_norm_le_const (fun t ht ↦ by + have ht' : t∈Icc (0:ℝ) 1 := by + rw [Set.uIoc_of_le (by norm_num : (0:ℝ) ≤ 1)] at ht + exact Ioc_subset_Icc_self ht + change ‖(fderiv ℝ G (x+t•(s•e))-fderiv ℝ G (y+t•(s•e))) e‖ ≤ C*‖e‖ + exact (ContinuousLinearMap.le_opNorm _ e).trans + (mul_le_mul_of_nonneg_right (h t ht') (norm_nonneg _))) + simpa using hh + +omit [CompleteSpace V] in + theorem compact_C1_fderiv_bound [CompleteSpace V] {G : Euc n → V} (hG : ContDiff ℝ 1 G) + (hgc : HasCompactSupport G) : ∃ L : ℝ, 0 ≤ L ∧ ∀ x, ‖fderiv ℝ G x‖ ≤ L := by + have hc := hG.continuous_fderiv (by simp) + have hcc := hgc.fderiv ℝ + obtain ⟨L,hL⟩ := hcc.exists_bound_of_continuousOn hc.continuousOn + refine ⟨max 0 L,le_max_left _ _,fun x ↦ ?_⟩ + by_cases hx : x∈tsupport (fderiv ℝ G) + · exact (hL x hx).trans (le_max_right _ _) + · rw [image_eq_zero_of_notMem_tsupport hx,norm_zero] + exact le_max_left _ _ + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/WeakDerivative.lean b/lean/OAI/Geometry/Perimeter/Regularity/WeakDerivative.lean new file mode 100644 index 0000000000000000000000000000000000000000..a27c083e02d4860ba122a32b52ffefab139588c1 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/WeakDerivative.lean @@ -0,0 +1,83 @@ +import OAI.Geometry.Perimeter.Regularity.GeoComposition + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +variable {n : ℕ} + + theorem scalarDirection_swap {φ : Euc n → ℝ} (hφ : ContDiff ℝ ∞ φ) + (a b x : Euc n) : fderiv ℝ (scalarDirection φ a) x b = + fderiv ℝ (scalarDirection φ b) x a := by + rw [scalarDirection_fderiv hφ,scalarDirection_fderiv hφ] + exact (hφ.contDiffAt.isSymmSndFDerivAt (by simp only [minSmoothness_of_isRCLikeNormedField]; exact WithTop.coe_le_coe.mpr le_top)) b a + + theorem flux_direction_parts {V : Euc n → Euc n} (hV : ContDiff ℝ 1 V) + {U : Set (Euc n)} (φ : SmoothLocalTest U) (e : Euc n) : + (∫ x, inner ℝ (fderiv ℝ V x e) (gradient φ.val x)) = + -(∫ x, inner ℝ (V x) (gradient (scalarDirection φ.val e) x)) := by + let b := EuclideanSpace.basisFun (Fin n) ℝ + let u : Fin n → Euc n → ℝ := fun i x ↦ inner ℝ (b i) (V x) + have hu (i : Fin n) : ContDiff ℝ 1 (u i) := (innerSL ℝ (b i)).contDiff.comp hV + have hdu (i : Fin n) (x : Euc n) : fderiv ℝ (u i) x e = + inner ℝ (b i) (fderiv ℝ V x e) := by + exact congrArg (fun L : Euc n →L[ℝ] ℝ ↦ L e) + (((innerSL ℝ (b i)).hasFDerivAt.comp x (hV.differentiable (by simp) x).hasFDerivAt).fderiv) + have hv (i : Fin n) : ContDiff ℝ 1 (scalarDirection φ.val (b i)) := + (scalarDirection_contDiff φ.property.1 (b i)).of_le (by simp) + have hvc (i : Fin n) : HasCompactSupport (scalarDirection φ.val (b i)) := + φ.property.2.1.of_isClosed_subset (isClosed_tsupport _) (scalarDirection_tsupport _ _) + have hp (i : Fin n) := scalar_compact_integration_parts_C1 (hu i) (hv i) (hvc i) e + have hsum (x : Euc n) : inner ℝ (fderiv ℝ V x e) (gradient φ.val x) = + ∑ i, fderiv ℝ (u i) x e * scalarDirection φ.val (b i) x := by + simp only [hdu,scalarDirection,← inner_gradient_left] + simpa only [real_inner_comm] using (b.sum_inner_mul_inner (fderiv ℝ V x e) (gradient φ.val x)).symm + have hsum' (x : Euc n) : inner ℝ (V x) (gradient (scalarDirection φ.val e) x) = + ∑ i, u i x * fderiv ℝ (scalarDirection φ.val (b i)) x e := by + simp only [scalarDirection_swap φ.property.1 (b _) e,u,← inner_gradient_left] + simpa only [real_inner_comm] using (b.sum_inner_mul_inner (V x) + (gradient (scalarDirection φ.val e) x)).symm + simp_rw [hsum,hsum'] + rw [integral_finsetSum _ (fun i _ ↦ (hp i).2.1), + integral_finsetSum _ (fun i _ ↦ (hp i).1)] + simp only [(fun i ↦ (hp i).2.2),Finset.sum_neg_distrib,neg_neg] + + theorem WeakFluxEquation.derivative {V : Euc n → Euc n} (hV : ContDiff ℝ 1 V) + {U : Set (Euc n)} (h : WeakFluxEquation V U) (e : Euc n) : + WeakFluxEquation (fun x ↦ fderiv ℝ V x e) U := by + intro φ + rw [flux_direction_parts hV φ e] + exact neg_eq_zero.mpr (h (directionLocalTest φ e)) + + theorem gradient_direction_swap {f : Euc n → ℝ} (hf : ContDiff ℝ 2 f) + (e x : Euc n) : gradient (fun y ↦ fderiv ℝ f y e) x = + fderiv ℝ (gradient f) x e := by + have hdf : ContDiff ℝ 1 (fderiv ℝ f) := hf.fderiv_right (by norm_num) + have hg : ContDiff ℝ 1 (gradient f) := (InnerProductSpace.toDual ℝ (Euc n)).symm.toContinuousLinearMap.contDiff.comp hdf + apply ext_inner_right ℝ + intro a + rw [inner_gradient_left] + have hs := (hf.contDiffAt (x := x)).isSymmSndFDerivAt (by simp [minSmoothness_of_isRCLikeNormedField]) a e + have hd := congrArg (fun L : Euc n →L[ℝ] ℝ ↦ L a) + (((ContinuousLinearMap.apply ℝ ℝ e).hasFDerivAt.comp x + (hdf.differentiable (by simp) x).hasFDerivAt).fderiv) + have hga := congrArg (fun L : Euc n →L[ℝ] ℝ ↦ L e) + (((innerSL ℝ a).hasFDerivAt.comp x (hg.differentiable (by simp) x).hasFDerivAt).fderiv) + have heq : (fun y ↦ inner ℝ a (gradient f y)) = fun y ↦ fderiv ℝ f y a := by + funext y + rw [real_inner_comm,inner_gradient_left] + change fderiv ℝ (fun y ↦ inner ℝ a (gradient f y)) x e = inner ℝ a (fderiv ℝ (gradient f) x e) at hga + rw [heq] at hga + have hda := congrArg (fun L : Euc n →L[ℝ] ℝ ↦ L e) + (((ContinuousLinearMap.apply ℝ ℝ a).hasFDerivAt.comp x + (hdf.differentiable (by simp) x).hasFDerivAt).fderiv) + simpa only [ContinuousLinearMap.comp_apply,ContinuousLinearMap.apply_apply,innerSL_apply_apply, + real_inner_comm,Function.comp_def] using hd.trans (hs.trans (hda.symm.trans hga)) + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/WeakHarmonicRadial.lean b/lean/OAI/Geometry/Perimeter/Regularity/WeakHarmonicRadial.lean new file mode 100644 index 0000000000000000000000000000000000000000..827c8beb455710a05a1849261c32c4fd18e77e39 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/WeakHarmonicRadial.lean @@ -0,0 +1,154 @@ +import OAI.Geometry.Perimeter.Regularity.HeightMeanValue + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +open RPI.Boundary ContinuousLinearMap +variable {n : ℕ} + +def WeakHarmonicOn (u : Euc n → ℝ) (U : Set (Euc n)) : Prop := + ∀ φ : Euc n → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → tsupport φ ⊆ U → + (∫ x, u x * divergence (gradient φ) x) = 0 + +theorem divergence_displacement (c x : Euc n) : + divergence (fun y ↦ y-c) x = n := by + have hd : fderiv ℝ (fun y : Euc n ↦ y-c) x = ContinuousLinearMap.id ℝ (Euc n) := + ((hasFDerivAt_id x).sub_const c).fderiv + simp [divergence,hd] + +theorem gradient_radialPrimitive (c : Euc n) (t : ℝ) + {Ψ ψ : ℝ → ℝ} (hΨ : ContDiff ℝ ∞ Ψ) (hdΨ : ∀ s, deriv Ψ s = ψ s) + (x : Euc n) : + gradient (fun y ↦ Ψ (t^2*‖y-c‖^2)) x = + (2*t^2*ψ (t^2*‖x-c‖^2)) • (x-c) := by + have hi := (((hasFDerivAt_id (𝕜 := ℝ) x).sub_const c).norm_sq).const_mul (t^2) + have hh := ((hΨ.differentiable (by simp)) _).hasDerivAt.comp_hasFDerivAt x hi + rw [hdΨ] at hh + change HasFDerivAt (fun y : Euc n ↦ Ψ (t^2*‖y-c‖^2)) _ x at hh + apply (InnerProductSpace.toDual ℝ (Euc n)).injective + rw [toDual_gradient,hh.fderiv] + ext z + simp only [smul_apply,ContinuousLinearMap.comp_apply, + ContinuousLinearMap.id_apply,id_eq,innerSL_apply_apply,map_smul, + InnerProductSpace.toDual_apply_apply,smul_eq_mul] + ring + +theorem laplacian_radialPrimitive (c : Euc n) (t : ℝ) + {Ψ ψ : ℝ → ℝ} (hΨ : ContDiff ℝ ∞ Ψ) (hψ : ContDiff ℝ ∞ ψ) + (hdΨ : ∀ s, deriv Ψ s = ψ s) (x : Euc n) : + divergence (gradient (fun y ↦ Ψ (t^2*‖y-c‖^2))) x = + 2*t^2*((n:ℝ)*ψ (t^2*‖x-c‖^2)+ + 2*t^2*‖x-c‖^2*deriv ψ (t^2*‖x-c‖^2)) := by + rw [funext (gradient_radialPrimitive c t hΨ hdΨ)] + have hq : ContDiff ℝ ∞ (fun y : Euc n ↦ 2*t^2*ψ (t^2*‖y-c‖^2)) := + contDiff_const.mul (hψ.comp (contDiff_const.mul + ((contDiff_id.sub contDiff_const).norm_sq (𝕜 := ℝ)))) + have hV : Differentiable ℝ (fun y : Euc n ↦ y-c) := differentiable_id.sub_const c + rw [divergence_smul (hq.differentiable (by simp)) hV,divergence_displacement,inner_gradient_left] + have hi := (((hasFDerivAt_id (𝕜 := ℝ) x).sub_const c).norm_sq).const_mul (t^2) + have hh := (((hψ.differentiable (by simp)) _).hasDerivAt.comp_hasFDerivAt x hi).const_mul (2*t^2) + change HasFDerivAt (fun y : Euc n ↦ 2*t^2*ψ (t^2*‖y-c‖^2)) _ x at hh + rw [hh.fderiv] + simp only [smul_apply,ContinuousLinearMap.comp_apply, + ContinuousLinearMap.id_apply,id_eq,innerSL_apply_apply,smul_eq_mul, + real_inner_self_eq_norm_sq] + ring + +theorem radial_average_hasDerivAt (c : Euc n) (R : ℝ) (k : ℕ) + {ψ : ℝ → ℝ} (hψ : ContDiff ℝ ∞ ψ) {u : Euc n → ℝ} + (hu : IntegrableOn u (Metric.ball c R) volume) (t : ℝ) : + IntegrableOn (fun x ↦ u x*radialDensityDerivative c k ψ t x) (Metric.ball c R) ∧ + HasDerivAt (fun s ↦ ∫ x in Metric.ball c R, u x*radialDensityIntegrand c k ψ s x) + (∫ x in Metric.ball c R, u x*radialDensityDerivative c k ψ t x) t := by + let μ := volume.restrict (Metric.ball c R) + have hcF (s : ℝ) : Continuous (radialDensityIntegrand c k ψ s) := + (radialDensityIntegrand_continuous c k hψ).comp (continuous_const.prodMk continuous_id) + have hcD (s : ℝ) : Continuous (radialDensityDerivative c k ψ s) := + (radialDensityDerivative_continuous c k hψ).comp (continuous_const.prodMk continuous_id) + obtain ⟨C,hC⟩ := (isCompact_closedBall c R).exists_bound_of_continuousOn (hcF t).continuousOn + have hFi : Integrable (fun x ↦ u x*radialDensityIntegrand c k ψ t x) μ := by + apply hu.mul_bdd (hcF t).aestronglyMeasurable + filter_upwards [ae_restrict_mem measurableSet_ball] with x hx + exact hC x (Metric.ball_subset_closedBall hx) + obtain ⟨B,hB⟩ := (isCompact_Icc.prod (isCompact_closedBall c R)).exists_bound_of_continuousOn + ((radialDensityDerivative_continuous c k hψ).continuousOn : + ContinuousOn _ (Icc (t-1) (t+1) ×ˢ Metric.closedBall c R)) + apply hasDerivAt_integral_of_dominated_loc_of_deriv_le + (s := Ioo (t-1) (t+1)) (bound := fun x ↦ ‖u x‖*B) + (Ioo_mem_nhds (by linarith) (by linarith)) + (Eventually.of_forall fun s ↦ hu.aestronglyMeasurable.mul (hcF s).aestronglyMeasurable) + hFi (hu.aestronglyMeasurable.mul (hcD t).aestronglyMeasurable) + ?_ (hu.norm.mul_const B) (Eventually.of_forall ?_) + · filter_upwards [ae_restrict_mem measurableSet_ball] with x hx + intro s hs + rw [norm_mul] + exact mul_le_mul_of_nonneg_left (hB (s,x) ⟨⟨hs.1.le,hs.2.le⟩, + Metric.ball_subset_closedBall hx⟩) (norm_nonneg _) + · intro x s _ + exact (radialDensityIntegrand_hasDerivAt c k hψ s x).const_mul (u x) + +theorem tsupport_gradient_subset (φ : Euc n → ℝ) : tsupport (gradient φ) ⊆ tsupport φ := by + exact (tsupport_comp_subset (map_zero (InnerProductSpace.toDual ℝ (Euc n)).symm) (fderiv ℝ φ)).trans + (tsupport_fderiv_subset ℝ) + +theorem weakHarmonic_radial_derivative_zero {u : Euc n → ℝ} {U : Set (Euc n)} + (hw : WeakHarmonicOn u U) (hn : 0 < n) (c : Euc n) {R : ℝ} (hR : 0 < R) + (hU : Metric.ball c R ⊆ U) + {Ψ ψ : ℝ → ℝ} (hΨ : ContDiff ℝ ∞ Ψ) (hψ : ContDiff ℝ ∞ ψ) + (hdΨ : ∀ s, deriv Ψ s = ψ s) (hΨz : ∀ s, 1 ≤ s → Ψ s = 0) + {t : ℝ} (ht : 1/R < t) : + (∫ x in Metric.ball c R, u x*radialDensityDerivative c n ψ t x) = 0 := by + have ht0 : 0 < t := (one_div_pos.mpr hR).trans ht + have htR : 1/t < R := (div_lt_iff₀ ht0).mpr (by + have := (div_lt_iff₀ hR).mp ht + nlinarith) + let φ : Euc n → ℝ := fun x ↦ Ψ (t^2*‖x-c‖^2) + have hφ : ContDiff ℝ ∞ φ := + hΨ.comp (contDiff_const.mul ((contDiff_id.sub contDiff_const).norm_sq (𝕜 := ℝ))) + have hsφ : tsupport φ ⊆ Metric.ball c R := + (radialProfile_tsupport c hΨz ht0).trans (Metric.closedBall_subset_ball htR) + have hcφ : HasCompactSupport φ := (isCompact_closedBall c R).of_isClosed_subset + (isClosed_tsupport φ) (hsφ.trans Metric.ball_subset_closedBall) + have hz := hw φ hφ hcφ (hsφ.trans hU) + have hsL : Function.support (fun x ↦ u x*divergence (gradient φ) x) ⊆ Metric.ball c R := + (Function.support_mul_subset_right _ _).trans ((subset_tsupport _).trans + ((tsupport_divergence_subset _).trans ((tsupport_gradient_subset φ).trans hsφ))) + rw [← setIntegral_eq_integral_of_forall_compl_eq_zero (fun x hx ↦ + Function.notMem_support.mp (fun hh ↦ hx (hsL hh)))] at hz + have hp : t^n = t^(n-1)*t := by rw [← pow_succ]; congr 1; omega + have hid (x : Euc n) : u x*radialDensityDerivative c n ψ t x = + (t^(n-1)/(2*t^2))*(u x*divergence (gradient φ) x) := by + dsimp only [φ] + rw [laplacian_radialPrimitive c t hΨ hψ hdΨ] + dsimp only [radialDensityDerivative] + rw [hp] + field_simp [ht0.ne'] + simp_rw [hid] + rw [integral_const_mul,hz,mul_zero] + +theorem weakHarmonic_radial_average_eq {u : Euc n → ℝ} {U : Set (Euc n)} + (hw : WeakHarmonicOn u U) (hn : 0 < n) (c : Euc n) {R : ℝ} (hR : 0 < R) + (hu : IntegrableOn u (Metric.ball c R) volume) (hU : Metric.ball c R ⊆ U) + (j : ℕ) {s t : ℝ} (hs : 1/R < s) (ht : 1/R < t) : + (∫ x in Metric.ball c R, u x*radialDensityIntegrand c n (densityProfile j) s x) = + ∫ x in Metric.ball c R, u x*radialDensityIntegrand c n (densityProfile j) t x := by + apply isOpen_Ioi.is_const_of_deriv_eq_zero (convex_Ioi (1/R)).isPreconnected + (f := fun r ↦ ∫ x in Metric.ball c R, u x*radialDensityIntegrand c n (densityProfile j) r x) + · intro r hr + exact (radial_average_hasDerivAt c R n (densityProfile_contDiff j) hu r).2.differentiableAt.differentiableWithinAt + · intro r hr + rw [(radial_average_hasDerivAt c R n (densityProfile_contDiff j) hu r).2.deriv] + exact weakHarmonic_radial_derivative_zero hw hn c hR hU + (densityPrimitive_contDiff j) (densityProfile_contDiff j) (densityPrimitive_deriv j) + (fun z hz ↦ densityPrimitive_zero j hz) hr + · exact hs + · exact ht + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/WeakHarmonicSmooth.lean b/lean/OAI/Geometry/Perimeter/Regularity/WeakHarmonicSmooth.lean new file mode 100644 index 0000000000000000000000000000000000000000..46310b69bffad7382e22ea850340e7bfb4d48dba --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/WeakHarmonicSmooth.lean @@ -0,0 +1,95 @@ +import OAI.Geometry.Perimeter.Regularity.WeakHarmonicRadial +import OAI.Geometry.Perimeter.Regularity.HarmonicApproxIdentity + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff Convolution InnerProductSpace +namespace RPISingularHarnack +open RPI.Boundary ContinuousLinearMap +variable {n : ℕ} + +def harmonicRegularization (u : Euc n → ℝ) (t : ℝ) : Euc n → ℝ := + scaledHarmonicKernel t ⋆[lsmul ℝ ℝ,volume] u + +theorem harmonicRegularization_eq_integral (u : Euc n → ℝ) (t : ℝ) (c : Euc n) : + harmonicRegularization u t c = ∫ x, scaledHarmonicKernel t (c-x)*u x := by + rw [harmonicRegularization,convolution_eq_swap] + rfl + +theorem harmonicRegularization_contDiff {u : Euc n → ℝ} (hu : LocallyIntegrable u volume) + {t : ℝ} (ht : 0 < t) : ContDiff ℝ ∞ (harmonicRegularization u t) := by + have hc : HasCompactSupport (scaledHarmonicKernel (n := n) t) := + (isCompact_closedBall 0 (1/t)).of_isClosed_subset (isClosed_tsupport _) + (scaledHarmonicKernel_tsupport ht) + exact hc.contDiff_convolution_left _ (scaledHarmonicKernel_contDiff t) hu + +theorem harmonicRegularization_eq_radial (u : Euc n → ℝ) (c : Euc n) + {R t : ℝ} (hR : 0 < R) (ht : 1/R < t) : + harmonicRegularization u t c = + (harmonicKernelMass n)⁻¹ * ∫ x in Metric.ball c R, + u x*radialDensityIntegrand c n (densityProfile 1) t x := by + have ht0 : 0 < t := (one_div_pos.mpr hR).trans ht + have htR : 1/t < R := (div_lt_iff₀ ht0).mpr (by + have := (div_lt_iff₀ hR).mp ht; nlinarith) + have hs : Function.support (fun x ↦ scaledHarmonicKernel t (c-x)*u x) ⊆ Metric.ball c R := + (Function.support_mul_subset_left _ _).trans + ((shifted_scaledHarmonicKernel_support ht0 c).trans (Metric.closedBall_subset_ball htR)) + rw [harmonicRegularization_eq_integral, + ← setIntegral_eq_integral_of_forall_compl_eq_zero (fun x hx ↦ + Function.notMem_support.mp (fun hh ↦ hx (hs hh))), ← integral_const_mul] + apply setIntegral_congr_fun measurableSet_ball + intro x hx + dsimp only + rw [scaledHarmonicKernel_eq ht0,norm_sub_rev] + dsimp only [radialDensityIntegrand] + ring + +theorem weakHarmonic_regularization_eq {u : Euc n → ℝ} {U : Set (Euc n)} + (hu : LocallyIntegrable u volume) (hw : WeakHarmonicOn u U) (hn : 0 < n) + (c : Euc n) {R : ℝ} (hR : 0 < R) (hU : Metric.ball c R ⊆ U) + {s t : ℝ} (hs : 1/R < s) (ht : 1/R < t) : + harmonicRegularization u s c = harmonicRegularization u t c := by + rw [harmonicRegularization_eq_radial u c hR hs,harmonicRegularization_eq_radial u c hR ht, + weakHarmonic_radial_average_eq hw hn c hR + ((hu.integrableOn_isCompact (isCompact_closedBall c R)).mono_set Metric.ball_subset_closedBall) + hU 1 hs ht] + +theorem weakHarmonic_ae_eq_regularization {u : Euc n → ℝ} {U : Set (Euc n)} + (hu : LocallyIntegrable u volume) (hw : WeakHarmonicOn u U) (hn : 0 < n) : + ∀ᵐ c ∂volume, ∀ R : ℝ, 0 < R → Metric.ball c R ⊆ U → + ∀ t : ℝ, 1/R < t → u c = harmonicRegularization u t c := by + filter_upwards [scaledHarmonicKernel_ae_tendsto hu] with c hc + intro R hR hU t ht + have hl : Tendsto (fun i : ℕ ↦ harmonicRegularization u ((i:ℝ)+1) c) atTop (𝓝 (u c)) := by + simpa only [harmonicRegularization_eq_integral] using hc + obtain ⟨N,hN⟩ := exists_nat_gt (1/R) + have he : ∀ᶠ i : ℕ in atTop, + harmonicRegularization u ((i:ℝ)+1) c = harmonicRegularization u t c := by + filter_upwards [eventually_ge_atTop N] with i hi + apply weakHarmonic_regularization_eq hu hw hn c hR hU _ ht + have hni : (N:ℝ) ≤ i := by exact_mod_cast hi + linarith + exact tendsto_nhds_unique hl (tendsto_const_nhds.congr' (he.mono (fun _ h ↦ h.symm))) + +theorem weakHarmonic_smooth_representative_ball {u : Euc n → ℝ} {U : Set (Euc n)} + (hu : LocallyIntegrable u volume) (hw : WeakHarmonicOn u U) (hn : 0 < n) + (c : Euc n) {r : ℝ} (hr : 0 < r) (hU : Metric.ball c (2*r) ⊆ U) : + ∃ f : Euc n → ℝ, ContDiff ℝ ∞ f ∧ + u =ᵐ[volume.restrict (Metric.ball c r)] f := by + refine ⟨harmonicRegularization u (2/r),harmonicRegularization_contDiff hu (by positivity),?_⟩ + filter_upwards [ae_restrict_of_ae (weakHarmonic_ae_eq_regularization hu hw hn), + ae_restrict_mem measurableSet_ball] with x hx hxB + apply hx r hr _ (2/r) (by exact div_lt_div_of_pos_right (by norm_num) hr) + intro y hy + apply hU + have hxy := dist_triangle y x c + rw [Metric.mem_ball] at hxB hy ⊢ + linarith + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/WeightedFiberMoment.lean b/lean/OAI/Geometry/Perimeter/Regularity/WeightedFiberMoment.lean new file mode 100644 index 0000000000000000000000000000000000000000..5ffb59ab8ea02227599476092d3f69029805c972 --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/WeightedFiberMoment.lean @@ -0,0 +1,156 @@ +import OAI.Geometry.Perimeter.Regularity.PhaseMomentLimit +import OAI.Geometry.Perimeter.Regularity.NormalWindowTest + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff Convolution InnerProductSpace +namespace RPISingularHarnack +open RPI.Boundary ContinuousLinearMap +variable {n : ℕ} + +theorem mollified_fiber_weighted_defect {E : Set (Euc n)} (hE : MeasurableSet E) + {v : Euc n} (hv : ‖v‖ = 1) {φ : normalPlane v → ℝ} + (hφ : Continuous φ) (hcφ : HasCompactSupport φ) (hpφ : ∀ y, 0 ≤ φ y) + {k : Euc n → ℝ} (hk : ContDiff ℝ ∞ k) (hc : HasCompactSupport k) + (hp : ∀ x, 0 ≤ k x) (hu : ∫ x, k x = 1) + {a b ε R : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) (hab : a+ε < b) + (hs : Function.support k ⊆ Metric.ball 0 ε) + (hphase : ∀ᵐ x ∂volume, x ∈ Metric.ball 0 R → a < |inner ℝ v x| → + (x ∈ E ↔ inner ℝ v x < 0)) + (hKR : ∀ y ∈ tsupport φ, ‖y‖+b+ε ≤ R) : + let q := phaseMollification E k + let H := fun y : normalPlane v ↦ -b+∫ s in (-b)..b, q ((y:Euc n)+s•v) + let M := ∫ x, normalWindowTest v φ b 2 x * (-fderiv ℝ q x v) + 0 ≤ M - ∫ y in tsupport φ, φ y*(H y)^2 ∧ + M - ∫ y in tsupport φ, φ y*(H y)^2 ≤ + 4*b*(∫ x, normalWindowTest v φ b 0 x * (q x*(1-q x))) + + 8*b^2*(∫ x, normalWindowTest v φ b 0 x * max (fderiv ℝ q x v) 0) := by + dsimp only + let q := phaseMollification E k + have hq : Continuous q := (phaseMollification_contDiff hE hk hc).continuous + have hd : Continuous (fun x ↦ fderiv ℝ q x v) := + ((phaseMollification_contDiff hE hk hc).continuous_fderiv (by simp)).clm_apply continuous_const + have hiM := normalWindowTest_integral hv hφ hcφ hb 2 hd.neg + have hiD := normalWindowTest_integral hv hφ hcφ hb 0 (hq.mul ((continuous_const (y := (1:ℝ))).sub hq)) + have hiP := normalWindowTest_integral hv hφ hcφ hb 0 (hd.max (continuous_const (y := (0:ℝ)))) + dsimp only [q,Pi.neg_apply,Pi.mul_apply,Pi.sub_apply] at hiM hiD hiP + rw [hiM,hiD,hiP] + simp only [pow_zero,one_mul] + simp_rw [← mollifiedNormalProfile_deriv hE hk hc v] + let A := fun y : normalPlane v ↦ ∫ s in (-b)..b, + s^2*(-deriv (mollifiedNormalProfile E k v y) s) + let B := fun y : normalPlane v ↦ (-b+∫ s in (-b)..b, q ((y:Euc n)+s•v))^2 + let D := fun y : normalPlane v ↦ ∫ s in (-b)..b, q ((y:Euc n)+s•v)*(1-q ((y:Euc n)+s•v)) + let P := fun y : normalPlane v ↦ ∫ s in (-b)..b, max (deriv (mollifiedNormalProfile E k v y) s) 0 + have hA : Continuous A := by + have hm : Continuous (fun x ↦ (inner ℝ v x)^2*(-fderiv ℝ q x v)) := + ((continuous_const.inner continuous_id).pow 2).mul hd.neg + have h := continuous_profile_integral (v := v) _ hm (-b) b + dsimp only [q] at h + simp_rw [normal_fiber_inner hv,← mollifiedNormalProfile_deriv hE hk hc v] at h + exact h + have hB : Continuous B := + (continuous_const.add (continuous_profile_integral (v := v) q hq (-b) b)).pow 2 + have hD : Continuous D := continuous_profile_integral (v := v) _ + (hq.mul ((continuous_const (y := (1:ℝ))).sub hq)) (-b) b + have hP : Continuous P := by + have h := continuous_profile_integral (v := v) _ (hd.max (continuous_const (y := (0:ℝ)))) (-b) b + dsimp only [q] at h + simp_rw [← mollifiedNormalProfile_deriv hE hk hc v] at h + exact h + have hAi : IntegrableOn (fun y ↦ φ y*A y) (tsupport φ) volume := + (hφ.mul hA).continuousOn.integrableOn_compact hcφ + have hBi : IntegrableOn (fun y ↦ φ y*B y) (tsupport φ) volume := + (hφ.mul hB).continuousOn.integrableOn_compact hcφ + have hDi : IntegrableOn (fun y ↦ φ y*D y) (tsupport φ) volume := + (hφ.mul hD).continuousOn.integrableOn_compact hcφ + have hPi : IntegrableOn (fun y ↦ φ y*P y) (tsupport φ) volume := + (hφ.mul hP).continuousOn.integrableOn_compact hcφ + change 0 ≤ (∫ y in tsupport φ, φ y*A y)-(∫ y in tsupport φ, φ y*B y) ∧ + (∫ y in tsupport φ, φ y*A y)-(∫ y in tsupport φ, φ y*B y) ≤ + 4*b*(∫ y in tsupport φ, φ y*D y)+8*b^2*(∫ y in tsupport φ, φ y*P y) + rw [← integral_sub hAi hBi,← integral_const_mul,← integral_const_mul, + ← integral_add (hDi.const_mul _) (hPi.const_mul _)] + have hh (y : normalPlane v) (hy : y ∈ tsupport φ) := + mollifiedNormalProfile_flux_defect hE hv hk hc hp hu ha hb hab hs hphase y (hKR y hy) + constructor + · apply setIntegral_nonneg hcφ.measurableSet + intro y hy + have h := mul_nonneg (hpφ y) (hh y hy).1 + change 0 ≤ φ y*A y-φ y*B y + change 0 ≤ φ y*(A y-B y) at h + nlinarith only [h] + · apply setIntegral_mono_on (hAi.sub hBi) ((hDi.const_mul _).add (hPi.const_mul _)) + hcφ.measurableSet + intro y hy + have h := mul_le_mul_of_nonneg_left (hh y hy).2 (hpφ y) + change φ y*A y-φ y*B y ≤ 4*b*(φ y*D y)+8*b^2*(φ y*P y) + change φ y*(A y-B y) ≤ φ y*(4*b*D y+8*b^2*P y) at h + nlinarith only [h] + +theorem normalWindowTest_diffuse_tendsto_zero {E : Set (Euc n)} (hE : MeasurableSet E) + {v : Euc n} (hv : ‖v‖ = 1) {φ : normalPlane v → ℝ} + (hφ : Continuous φ) (hcφ : HasCompactSupport φ) (b : ℝ) : + Tendsto (fun j ↦ ∫ x, normalWindowTest v φ b 0 x * + (phaseMollification E ((c1Mollifier j).normed volume) x * + (1-phaseMollification E ((c1Mollifier j).normed volume) x))) atTop (𝓝 0) := by + have hi := normalWindowTest_integrable hv hφ hcφ b 0 + have ht : ∀ᵐ x ∂volume, Tendsto (fun j ↦ normalWindowTest v φ b 0 x * + (phaseMollification E ((c1Mollifier j).normed volume) x * + (1-phaseMollification E ((c1Mollifier j).normed volume) x))) atTop (𝓝 (0:ℝ)) := by + filter_upwards [phaseMollification_ae_tendsto hE] with x hx + convert tendsto_const_nhds.mul (hx.mul (tendsto_const_nhds.sub hx)) using 1 + by_cases he : x ∈ E <;> simp [he] + have h := tendsto_integral_of_dominated_convergence (fun x ↦ ‖normalWindowTest v φ b 0 x‖) + (fun j ↦ (normalWindowTest_measurable hφ b 0).aestronglyMeasurable.mul + (((phaseMollification_contDiff hE (c1Mollifier j).contDiff_normed + (c1Mollifier j).hasCompactSupport_normed).continuous.mul + (continuous_const.sub (phaseMollification_contDiff hE (c1Mollifier j).contDiff_normed + (c1Mollifier j).hasCompactSupport_normed).continuous)).aestronglyMeasurable)) + hi.norm (fun j ↦ ae_of_all _ fun x ↦ ?_) ht + · simpa only [integral_zero,Pi.mul_apply,Pi.sub_apply] using h + · obtain ⟨h0,h1⟩ := phaseMollification_c1_mem_Icc hE j x + dsimp only [Pi.mul_apply,Pi.sub_apply] + rw [norm_mul] + have hb : ‖phaseMollification E ((c1Mollifier j).normed volume) x * + (1-phaseMollification E ((c1Mollifier j).normed volume) x)‖ ≤ 1 := by + rw [Real.norm_eq_abs,abs_of_nonneg (mul_nonneg h0 (sub_nonneg.mpr h1))] + nlinarith + exact (mul_le_mul_of_nonneg_left hb (norm_nonneg _)).trans_eq (mul_one _) + +theorem mollified_fiber_weighted_height_square_tendsto {E : Set (Euc n)} (hE : MeasurableSet E) + {v : Euc n} (hv : ‖v‖ = 1) {φ : normalPlane v → ℝ} + (hφ : Continuous φ) (hcφ : HasCompactSupport φ) {b : ℝ} (hb : 0 ≤ b) : + Tendsto (fun j ↦ ∫ y in tsupport φ, φ y* + (-b+∫ s in (-b)..b, phaseMollification E ((c1Mollifier j).normed volume) + ((y:Euc n)+s•v))^2) atTop + (𝓝 (∫ y in tsupport φ, φ y*(exactFiberHeight E v b y)^2)) := by + apply tendsto_integral_of_dominated_convergence (fun y ↦ ‖φ y‖*b^2) + · intro j + exact (hφ.mul ((continuous_const.add (continuous_profile_integral (v := v) _ + (phaseMollification_contDiff hE (c1Mollifier j).contDiff_normed + (c1Mollifier j).hasCompactSupport_normed).continuous (-b) b)).pow 2)).aestronglyMeasurable + · exact (hφ.continuousOn.integrableOn_compact hcφ).norm.mul_const _ + · intro j + apply ae_of_all + intro y + rw [norm_mul] + apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) + have h := interval_height_abs_le + (((phaseMollification_contDiff hE (c1Mollifier j).contDiff_normed + (c1Mollifier j).hasCompactSupport_normed).continuous.comp + (continuous_const.add (continuous_id.smul continuous_const))).measurable) + hb (fun s ↦ phaseMollification_c1_mem_Icc hE j ((y:Euc n)+s•v)) + rw [Real.norm_eq_abs,abs_of_nonneg (sq_nonneg _)] + simpa only [sq_abs,Function.comp_def,Pi.add_apply,Pi.smul_apply,Pi.smul_apply',id_eq] using + (sq_le_sq₀ (abs_nonneg _) hb).mpr h + · filter_upwards [ae_restrict_of_ae (mollified_fiber_height_ae_tendsto hE hv hb)] with y hy + exact tendsto_const_nhds.mul (hy.pow 2) + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/WeightedSquareLimit.lean b/lean/OAI/Geometry/Perimeter/Regularity/WeightedSquareLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..bb01449eb36280798659f104f30728719290c00d --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/WeightedSquareLimit.lean @@ -0,0 +1,60 @@ +import OAI.Geometry.Perimeter.Regularity.GeoAlgebra + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff InnerProductSpace +namespace RPISingularHarnack +open RPI.Boundary ContinuousLinearMap +variable {n m : ℕ} + +theorem weighted_square_L1_tendsto_zero {X : Type*} [MeasurableSpace X] + {μ : Measure X} (f : ℕ → X → ℝ) (hf : ∀ i, Integrable (f i) μ) + {g w φ : X → ℝ} (hg : Integrable g μ) (hw : AEStronglyMeasurable w μ) + (hφ : AEStronglyMeasurable φ μ) {M A B : ℝ} (hM : 0≤M) (hA : 0≤A) (hB : 0≤B) + (hbφ : ∀ᵐ x ∂μ, ‖φ x‖≤M) + (heq : ∀ᵐ x ∂μ, φ x≠0 → w x=g x) + (hbw : ∀ᵐ x ∂μ, φ x≠0 → ‖w x‖≤B) + (hbf : ∀ᶠ i in atTop, ∀ᵐ x ∂μ, φ x≠0 → ‖f i x‖≤A) + (hL : Tendsto (fun i ↦ ∫⁻ x, ‖f i x-g x‖ₑ ∂μ) atTop (𝓝 0)) : + Tendsto (fun i ↦ ∫ x, φ x*(f i x-w x)^2 ∂μ) atTop (𝓝 0) := by + have hbound : ∀ᶠ i in atTop, ∀ᵐ x ∂μ, + ‖φ x*(f i x-w x)^2‖≤M*(A+B)*‖f i x-g x‖ := by + filter_upwards [hbf] with i hi + filter_upwards [hi,hbw,heq,hbφ] with x hix hwx hex hφx + by_cases hz : φ x=0 + · simp only [hz,zero_mul,norm_zero] + positivity + · have hab : ‖f i x-w x‖≤A+B := (norm_sub_le _ _).trans (add_le_add (hix hz) (hwx hz)) + rw [norm_mul,norm_pow] + calc + _ ≤ M*(‖f i x-w x‖*‖f i x-w x‖) := by rw [← pow_two]; gcongr + _ ≤ M*((A+B)*‖f i x-w x‖) := by gcongr + _ = _ := by rw [hex hz]; ring + have hi : ∀ᶠ i in atTop, Integrable (fun x ↦ φ x*(f i x-w x)^2) μ := by + filter_upwards [hbound] with i hib + exact (((hf i).sub hg).norm.const_mul (M*(A+B))).mono' + (hφ.mul (((hf i).aestronglyMeasurable.sub hw).pow 2)) hib + have ht : Tendsto (fun i ↦ ENNReal.ofReal (M*(A+B)) * ∫⁻ x, ‖f i x-g x‖ₑ ∂μ) + atTop (𝓝 0) := by + simpa using ENNReal.Tendsto.const_mul hL (Or.inr ENNReal.ofReal_ne_top) + have hl : Tendsto (fun i ↦ ∫⁻ x, ‖φ x*(f i x-w x)^2‖ₑ ∂μ) atTop (𝓝 0) := by + refine tendsto_of_tendsto_of_tendsto_of_le_of_le' tendsto_const_nhds ht + (Eventually.of_forall (fun _ ↦ zero_le)) ?_ + filter_upwards [hbound] with i hib + rw [← lintegral_const_mul' _ _ ENNReal.ofReal_ne_top] + apply lintegral_mono_ae + filter_upwards [hib] with x hx + rw [← ofReal_norm,← ofReal_norm,← ENNReal.ofReal_mul (by positivity)] + exact ENNReal.ofReal_le_ofReal hx + have h := tendsto_integral_of_L1 (fun _ : X ↦ (0:ℝ)) + (aestronglyMeasurable_zero : AEStronglyMeasurable (fun _ : X ↦ (0:ℝ)) μ) hi + (by simpa only [sub_zero] using hl) + simpa only [integral_zero] using h + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/WeightedWrongWayFlux.lean b/lean/OAI/Geometry/Perimeter/Regularity/WeightedWrongWayFlux.lean new file mode 100644 index 0000000000000000000000000000000000000000..c63e3220a7325b605ecd238a7f4d9f676785a89a --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/WeightedWrongWayFlux.lean @@ -0,0 +1,71 @@ +import OAI.Geometry.Perimeter.Regularity.ActualFluxWindowLimit + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff Convolution InnerProductSpace +namespace RPISingularHarnack +open RPI.Boundary ContinuousLinearMap +variable {n : ℕ} + +theorem normalWindowTest_nonneg {v : Euc n} {φ : normalPlane v → ℝ} + (hφ : ∀ y, 0 ≤ φ y) (b : ℝ) (x : Euc n) : + 0 ≤ normalWindowTest v φ b 0 x := by + simp only [normalWindowTest,pow_zero,mul_one] + exact Set.indicator_nonneg (fun y _ ↦ hφ _) x + +theorem weighted_positive_derivative_le_tilt (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + {v : Euc n} (hv : ‖v‖ = 1) {φ : normalPlane v → ℝ} + (hφ : Continuous φ) (hcφ : HasCompactSupport φ) + (hpφ : ∀ y, 0 ≤ φ y) {M b δ R : ℝ} (hM : ∀ y, ‖φ y‖ ≤ M) + (hb : 0 ≤ b) (hR : 0 < R) + (hKR : ∀ y ∈ tsupport φ, ‖y‖+b+δ ≤ R) + {j : ℕ} (hj : (c1Mollifier (n := n) j).rOut < δ) : + (∫ x, normalWindowTest v φ b 0 x * + max (fderiv ℝ (phaseMollification E ((c1Mollifier j).normed volume)) x v) 0) ≤ + M * (orientedTilt E v (Metric.ball 0 R) / 2) := by + let q := phaseMollification E ((c1Mollifier j).normed volume) + let g : Euc n → ℝ := fun x ↦ max (fderiv ℝ q x v) 0 + have hg : Continuous g := + (((phaseMollification_contDiff hmin.1 (c1Mollifier j).contDiff_normed + (c1Mollifier j).hasCompactSupport_normed).continuous_fderiv (by simp)).clm_apply + continuous_const).max continuous_const + have hi := normalWindowTest_mul_integrable hv hφ hcφ b 0 hg + have hgi : IntegrableOn g (Metric.closedBall 0 (R-δ)) volume := + hg.continuousOn.integrableOn_compact (isCompact_closedBall _ _) + have hMt : 0 ≤ M := (norm_nonneg (φ 0)).trans (hM 0) + have hdom : ∀ x, normalWindowTest v φ b 0 x * g x ≤ + (Metric.closedBall 0 (R-δ)).indicator (fun x ↦ M*g x) x := by + intro x + have hg0 : 0 ≤ g x := le_max_right _ _ + by_cases hx : normalWindowTest v φ b 0 x=0 + · rw [hx,zero_mul] + exact Set.indicator_nonneg (fun x _ ↦ mul_nonneg hMt (le_max_right _ _)) _ + · have hxR : x ∈ Metric.closedBall 0 (R-δ) := by + rw [Metric.mem_closedBall,dist_zero_right] + have := normalWindowTest_support_norm hv φ b δ R 0 hKR hx + linarith + rw [Set.indicator_of_mem hxR] + apply mul_le_mul_of_nonneg_right _ hg0 + have h := normalWindowTest_bound hM hb 0 x + simp only [pow_zero,mul_one] at h + rwa [Real.norm_of_nonneg (normalWindowTest_nonneg hpφ b x)] at h + have hbound := phaseMollification_positive_derivative_le_tilt hn hmin hv + (c1Mollifier j).contDiff_normed (c1Mollifier j).hasCompactSupport_normed + (c1Mollifier j).nonneg_normed (c1Mollifier j).integral_normed hR + 0 (R-δ) (fun x hx ↦ c1Mollifier_translated_support (by + rw [Metric.mem_closedBall,dist_zero_right] at hx; linarith)) + calc + _ ≤ ∫ x, (Metric.closedBall 0 (R-δ)).indicator (fun x ↦ M*g x) x := + integral_mono hi (IntegrableOn.integrable_indicator (hgi.const_mul M) measurableSet_closedBall) hdom + _ = M * ∫ x in Metric.closedBall 0 (R-δ), g x := by + rw [integral_indicator measurableSet_closedBall,integral_const_mul] + _ ≤ _ := mul_le_mul_of_nonneg_left hbound hMt + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/WholeBoundarySublevelMeasureStep.lean b/lean/OAI/Geometry/Perimeter/Regularity/WholeBoundarySublevelMeasureStep.lean new file mode 100644 index 0000000000000000000000000000000000000000..686debd7861c4fdb4c0810cfe123096ad8304c9b --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/WholeBoundarySublevelMeasureStep.lean @@ -0,0 +1,519 @@ +import OAI.Geometry.Perimeter.Regularity.TendstoLintegralNormOfL2 + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +open scoped ENNReal Topology ContDiff +namespace RPISingularHarnack +open RPI RPI.Boundary Classical + +theorem wholeBoundary_sublevel_measure_step {n : ℕ} (hn : 2 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + {h : Euc n → ℝ} {G : Euc n → Euc n} + (hSob : WholeBoundarySobolev E h G) (hSuper : WholeBoundarySupersolution E G) + (hh01 : ∀ᵐ x ∂boundaryArea E, 0 ≤ h x ∧ h x ≤ 1) + {p : ℝ} (hp : 1 < p) (hpk : (((n - 1 : ℕ) : ℝ) - 1) * p < (n - 1 : ℕ)) : + ∃ C : ℝ, 0 < C ∧ ∀ s r l k : ℝ, 0 < s → s < r → r ≤ 2 → 0 < l → l < k → + (boundaryArea E).real (Metric.ball 0 s ∩ {x | h x < l}) ≤ + C * (k / ((r-s) * (k-l))) ^ p * + ((boundaryArea E).real (Metric.ball 0 r ∩ {x | h x < k})) ^ p := by + classical + have hp0 : 0 ≤ p := (lt_trans zero_lt_one hp).le + have hn1 : 1 < n := by omega + obtain ⟨L, hL, hcut⟩ := exists_interior_cutoff_constant + obtain ⟨C, hC, hsob⟩ := wholeBoundary_sublevel_sobolev hn hmin hSob hh01 (by norm_num : (0 : ℝ) < 3) hp hpk + refine ⟨(C.toReal + 1) * (10 * L) ^ p, by positivity, ?_⟩ + intro s r l k hs hsr hr2 hl hlk + have hk : 0 < k := hl.trans hlk + have hd : 0 < (k-l)/2 := by linarith + have hN : 0 < L / (r-s) := div_pos hL (sub_pos.mpr hsr) + obtain ⟨η, hη, hcη, hsη, hη01, hηone, hηD⟩ := hcut n E s r hs hsr + let μ := (boundaryArea E).restrict (Metric.ball 0 3) + let : IsFiniteMeasure μ := ⟨by + simpa only [μ, Measure.restrict_apply_univ] using minimizing_boundaryArea_ball_lt_top hn1 hmin 0 (by norm_num : (0 : ℝ) < 3)⟩ + let A := Metric.ball (0 : Euc n) s ∩ {x | h x < l} + let B := Metric.ball (0 : Euc n) r ∩ {x | h x < k} + have hm := (hSob 3 (by norm_num)).1.aestronglyMeasurable.aemeasurable + have hAm : NullMeasurableSet A μ := measurableSet_ball.nullMeasurableSet.inter + (nullMeasurableSet_lt hm aemeasurable_const) + have hBm : NullMeasurableSet B μ := measurableSet_ball.nullMeasurableSet.inter + (nullMeasurableSet_lt hm aemeasurable_const) + have hAeq : μ A = boundaryArea E A := by + change (boundaryArea E).restrict (Metric.ball 0 3) A = _ + rw [Measure.restrict_apply₀ hAm, inter_eq_left.mpr] + exact fun x hx ↦ Metric.ball_subset_ball (by linarith : s ≤ 3) hx.1 + have hBeq : μ B = boundaryArea E B := by + change (boundaryArea E).restrict (Metric.ball 0 3) B = _ + rw [Measure.restrict_apply₀ hBm, inter_eq_left.mpr] + exact fun x hx ↦ Metric.ball_subset_ball (by linarith : r ≤ 3) hx.1 + have hAtop : boundaryArea E A ≠ ⊤ := hAeq ▸ measure_ne_top μ A + have hBtop : boundaryArea E B ≠ ⊤ := hBeq ▸ measure_ne_top μ B + have hlo : ENNReal.ofReal ((k-l)/2) ^ p * boundaryArea E A ≤ + ∫⁻ x, ENNReal.ofReal (η x ^ 2 * sublevelTest ((k-l)/2) k (h x)) ^ p ∂μ := by + rw [← hAeq] + calc + _ = ∫⁻ x, A.indicator (fun _ ↦ ENNReal.ofReal ((k-l)/2) ^ p) x ∂μ := by + rw [lintegral_indicator₀ hAm, lintegral_const, Measure.restrict_apply_univ] + _ ≤ _ := lintegral_mono fun x ↦ by + by_cases hx : x ∈ A + · rw [indicator_of_mem hx, hηone x hx.1, one_pow, one_mul] + apply ENNReal.rpow_le_rpow _ hp0 + apply ENNReal.ofReal_le_ofReal + have H := sub_parameter_le_smoothPositive (s := k - h x) hd + change k - h x - (k-l)/2 ≤ sublevelTest ((k-l)/2) k (h x) at H + have hxl : h x < l := hx.2 + linarith + · rw [indicator_of_notMem hx] + exact bot_le + have hsR := hsη.trans (Metric.ball_subset_ball (by linarith : r ≤ 3)) + have hl1 := wholeBoundary_sublevel_L1 hn1 hmin hSob hSuper hh01 + (by norm_num : (0 : ℝ) < 3) (by linarith : r ≤ 3) hd hk hN hη hcη hsη hη01 hηD + have hso := hsob η hη hcη hsR ((k-l)/2) k hd hk.le + have H : ENNReal.ofReal ((k-l)/2) ^ p * boundaryArea E A ≤ + C * (ENNReal.ofReal (5 * k * (L/(r-s))) * boundaryArea E B) ^ p := by + exact hlo.trans (hso.trans (mul_le_mul_of_nonneg_left (ENNReal.rpow_le_rpow hl1 hp0) (show (0 : ℝ≥0∞) ≤ C from bot_le))) + have hRt : C * (ENNReal.ofReal (5 * k * (L/(r-s))) * boundaryArea E B) ^ p ≠ ⊤ := + ENNReal.mul_ne_top hC (ENNReal.rpow_ne_top_of_nonneg hp0 + (ENNReal.mul_ne_top ENNReal.ofReal_ne_top hBtop)) + have Hr := ENNReal.toReal_mono hRt H + simp only [ENNReal.toReal_mul, ← ENNReal.toReal_rpow, + ENNReal.toReal_ofReal hd.le, ENNReal.toReal_ofReal (show 0 ≤ 5 * k * (L/(r-s)) by positivity)] at Hr + exact (RPIIteration.sublevel_step_division hd (by positivity) Hr).trans + (RPIIteration.sublevel_step_factor ENNReal.toReal_nonneg hL hk hlk hsr ENNReal.toReal_nonneg) + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +open scoped ENNReal Topology ContDiff +open scoped Topology ENNReal +namespace RPIIteration + +lemma exists_small_power {p A e : ℝ} (hp : 1 < p) (he : 0 < e) : + ∃ d : ℝ, 0 < d ∧ d < 1 ∧ A * d ^ p ≤ e * d := by + have hq : 0 < p - 1 := sub_pos.mpr hp + have ht : Tendsto (fun d : ℝ ↦ A * d ^ (p - 1)) (𝓝 (0 : ℝ)) (𝓝 0) := by + simpa only [Real.zero_rpow (ne_of_gt hq), mul_zero] using + tendsto_const_nhds.mul ((Real.continuous_rpow_const hq.le).tendsto 0) + have hb : ∀ᶠ d : ℝ in 𝓝[>] 0, A * d ^ (p - 1) < e := + (ht.eventually (gt_mem_nhds he)).filter_mono nhdsWithin_le_nhds + have h01 : ∀ᶠ d : ℝ in 𝓝[>] 0, 0 < d ∧ d < 1 := + Filter.Eventually.and (show ∀ᶠ d : ℝ in 𝓝[>] 0, 0 < d from self_mem_nhdsWithin) + ((gt_mem_nhds (by norm_num : (0 : ℝ) < 1)).filter_mono nhdsWithin_le_nhds) + obtain ⟨d, ⟨hd, hd1⟩, hAd⟩ := (h01.and hb).exists + refine ⟨d, hd, hd1, ?_⟩ + have heq : d ^ p = d ^ (p - 1) * d := by + calc + d ^ p = d ^ ((p - 1) + 1) := by congr 1; ring + _ = _ := by rw [Real.rpow_add hd, Real.rpow_one] + rw [heq, ← mul_assoc] + exact mul_le_mul_of_nonneg_right hAd.le hd.le + +theorem superlinear_iteration {p A B : ℝ} (hp : 1 < p) (hA : 0 ≤ A) (hB : 0 ≤ B) : + ∃ d : ℝ, 0 < d ∧ ∀ u : ℕ → ℝ, (∀ j, 0 ≤ u j) → u 0 ≤ d → + (∀ j, u (j + 1) ≤ A * B ^ j * (u j) ^ p) → + Tendsto u atTop (𝓝 0) := by + obtain ⟨t, ht, ht1, hBt⟩ := exists_small_power (A := B) hp (by norm_num : (0 : ℝ) < 1) + simp only [one_mul] at hBt + obtain ⟨d, hd, _, hAd⟩ := exists_small_power (A := A) hp ht + refine ⟨d, hd, ?_⟩ + intro u hu hu0 hstep + have hbound : ∀ j, u j ≤ d * t ^ j := by + intro j + induction j with + | zero => simpa using hu0 + | succ j ih => + calc + u (j + 1) ≤ A * B ^ j * (u j) ^ p := hstep j + _ ≤ A * B ^ j * (d * t ^ j) ^ p := by gcongr; exact hu j + _ = (A * d ^ p) * (B * t ^ p) ^ j := by + rw [Real.mul_rpow hd.le (pow_nonneg ht.le _), ← Real.rpow_pow_comm ht.le, mul_pow] + ring + _ ≤ (t * d) * t ^ j := by + apply mul_le_mul hAd (pow_le_pow_left₀ (mul_nonneg hB (Real.rpow_nonneg ht.le _)) hBt j) + (pow_nonneg (mul_nonneg hB (Real.rpow_nonneg ht.le _)) _) (by positivity) + _ = d * t ^ (j + 1) := by rw [pow_succ]; ring + have hgeo := tendsto_pow_atTop_nhds_zero_of_lt_one ht.le ht1 + have hlim : Tendsto (fun j : ℕ ↦ d * t ^ j) atTop (𝓝 0) := by simpa only [mul_zero] using tendsto_const_nhds.mul hgeo + exact squeeze_zero hu hbound hlim + +end RPIIteration + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +open scoped ENNReal Topology ContDiff +open scoped Topology ENNReal +namespace RPIIteration + +lemma exists_small_positive_sublevel {X : Type*} [MeasurableSpace X] + (μ : Measure X) [IsFiniteMeasure μ] (h : X → ℝ) (hm : AEMeasurable h μ) + (hp : ∀ᵐ x ∂μ, 0 < h x) {δ : ℝ} (hδ : 0 < δ) : + ∃ k : ℝ, 0 < k ∧ k ≤ 1 ∧ μ.real {x | h x < k} < δ := by + let q : ℕ → ℝ := fun j ↦ (1 / 2 : ℝ) ^ j + let A : ℕ → Set X := fun j ↦ {x | h x < q j} + have hq : Tendsto q atTop (𝓝 0) := tendsto_pow_atTop_nhds_zero_of_lt_one (by norm_num) (by norm_num) + have hAm (j : ℕ) : NullMeasurableSet (A j) μ := nullMeasurableSet_lt hm aemeasurable_const + have hAa : Antitone A := by + intro i j hij x hx + change h x < q i + change h x < q j at hx + exact hx.trans_le (pow_le_pow_of_le_one (by norm_num) (by norm_num) hij) + have hzero : μ (⋂ j, A j) = 0 := by + apply measure_eq_zero_iff_ae_notMem.mpr + filter_upwards [hp] with x hx + intro hxA + have hle : h x ≤ 0 := ge_of_tendsto hq (Eventually.of_forall fun j ↦ (show h x < q j from (mem_iInter.mp hxA) j).le) + exact (not_le_of_gt hx) hle + have ht := tendsto_measure_iInter_atTop hAm hAa ⟨0, measure_ne_top μ _⟩ + rw [hzero] at ht + have hreal : Tendsto (fun j ↦ μ.real (A j)) atTop (𝓝 0) := by + simpa only [Measure.real, ENNReal.toReal_zero, Function.comp_def] using + (ENNReal.tendsto_toReal ENNReal.zero_ne_top).comp ht + obtain ⟨j, hj⟩ := (hreal.eventually (gt_mem_nhds hδ)).exists + exact ⟨q j, pow_pos (by norm_num) _, pow_le_one₀ (by norm_num) (by norm_num), hj⟩ + +end RPIIteration + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +open scoped ENNReal Topology ContDiff +open scoped Topology ENNReal +namespace RPIIteration + +def radius (j : ℕ) : ℝ := 1 + (1 / 2 : ℝ) ^ j +def level (a : ℝ) (j : ℕ) : ℝ := a / 2 * radius j + +lemma radius_bounds (j : ℕ) : 1 < radius j ∧ radius j ≤ 2 := by + have h0 : 0 < (1/2 : ℝ)^j := pow_pos (by norm_num) _ + have h1 : (1/2 : ℝ)^j ≤ 1 := pow_le_one₀ (by norm_num) (by norm_num) + constructor <;> dsimp [radius] <;> linarith + +lemma radius_succ_lt (j : ℕ) : radius (j + 1) < radius j := by + dsimp [radius] + rw [pow_succ] + nlinarith [pow_pos (by norm_num : (0 : ℝ) < 1/2) j] + +lemma level_bounds {a : ℝ} (ha : 0 < a) (j : ℕ) : + 0 < level a j ∧ a/2 < level a j ∧ level a j ≤ a := by + have hr := radius_bounds j + have hr0 : 0 < radius j := lt_trans zero_lt_one hr.1 + dsimp [level] + constructor + · positivity + constructor + · nlinarith [hr.1] + · nlinarith [hr.2] + +lemma level_succ_lt {a : ℝ} (ha : 0 < a) (j : ℕ) : level a (j + 1) < level a j := by + exact mul_lt_mul_of_pos_left (radius_succ_lt j) (by positivity) + +lemma level_zero (a : ℝ) : level a 0 = a := by simp [level, radius]; ring + +lemma quotient_bound {a : ℝ} (ha : 0 < a) (j : ℕ) : + level a j / ((radius j - radius (j+1)) * (level a j - level a (j+1))) ≤ 8 * (4 : ℝ)^j := by + have hden : 0 < (radius j - radius (j+1)) * (level a j - level a (j+1)) := + mul_pos (sub_pos.mpr (radius_succ_lt j)) (sub_pos.mpr (level_succ_lt ha j)) + rw [div_le_iff₀ hden] + have heq : (radius j - radius (j+1)) * (level a j - level a (j+1)) = a/8 * ((1/2 : ℝ)^j)^2 := by + simp only [radius, level, pow_succ] + ring + have hpow : ((1/2 : ℝ)^j)^2 = ((1/2 : ℝ)^2)^j := by + rw [← pow_mul, ← pow_mul] + congr 1 + omega + have h4 : (4 : ℝ)^j * ((1/2 : ℝ)^j)^2 = 1 := by + rw [hpow, ← mul_pow] + norm_num + rw [heq] + calc + _ ≤ a := (level_bounds ha j).2.2 + _ = 8 * (4 : ℝ)^j * (a/8 * ((1/2 : ℝ)^j)^2) := by + calc + _ = a * ((4 : ℝ)^j * ((1/2 : ℝ)^j)^2) := by rw [h4, mul_one] + _ = _ := by ring + +lemma power_step {a C p : ℝ} (ha : 0 < a) (hC : 0 ≤ C) (hp : 0 ≤ p) + {U V : ℝ} (hU : 0 ≤ U) (j : ℕ) + (hstep : V ≤ C * (level a j / ((radius j - radius (j+1)) * (level a j - level a (j+1)))) ^ p * U ^ p) : + V ≤ (C * (8 : ℝ)^p) * ((4 : ℝ)^p)^j * U ^ p := by + have hpos : 0 ≤ level a j / ((radius j - radius (j+1)) * (level a j - level a (j+1))) := by + exact div_nonneg (level_bounds ha j).1.le + (mul_nonneg (sub_nonneg.mpr (radius_succ_lt j).le) (sub_nonneg.mpr (level_succ_lt ha j).le)) + calc + _ ≤ C * (level a j / ((radius j - radius (j+1)) * (level a j - level a (j+1)))) ^ p * U ^ p := hstep + _ ≤ C * (8 * (4 : ℝ)^j)^p * U ^ p := by + gcongr + exact quotient_bound ha j + _ = _ := by + rw [Real.mul_rpow (by norm_num) (by positivity), ← Real.rpow_pow_comm (by norm_num : (0 : ℝ) ≤ 4)] + ring + +end RPIIteration + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +open scoped ENNReal Topology ContDiff +open scoped Topology ENNReal +namespace RPISingularHarnack +open RPI RPI.Boundary + +theorem no_positive_bounded_supersolution_with_zero_vertex_inf + {n : ℕ} (hn : 8 ≤ n) (E : Set (Euc n)) + (hmin : IsLocallyPerimeterMinimizing E) : + IsCone E → (0 : Euc n) ∈ perimeterSupport E → ∀ (h : Euc n → ℝ) (G : Euc n → Euc n), + WholeBoundarySobolev E h G → WholeBoundarySupersolution E G → + (∀ᵐ x ∂boundaryArea E, 0 < h x ∧ h x ≤ 1) → ZeroEssentialInfAtVertex E h → False := by + intro _ _ h G hSobolev hSuper hpositive hinf + classical + have hn2 : 2 < n := by omega + have hn1 : 1 < n := by omega + let m : ℝ := (n-1 : ℕ) + have hm : 0 < m := by dsimp [m]; exact_mod_cast (show 0 < n-1 by omega) + let p : ℝ := 1 + 1/m + have hp : 1 < p := by dsimp [p]; linarith [one_div_pos.mpr hm] + have hpk : (((n-1 : ℕ) : ℝ)-1) * p < (n-1 : ℕ) := by + have hcan : m * (1/m) = 1 := mul_one_div_cancel (ne_of_gt hm) + have hinv : 0 < 1/m := one_div_pos.mpr hm + change (m-1) * (1+1/m) < m + nlinarith + have hh01 : ∀ᵐ x ∂boundaryArea E, 0 ≤ h x ∧ h x ≤ 1 := + hpositive.mono fun _ hx ↦ ⟨hx.1.le, hx.2⟩ + obtain ⟨C, hC, hstep⟩ := wholeBoundary_sublevel_measure_step hn2 hmin hSobolev hSuper hh01 hp hpk + obtain ⟨δ, hδ, hiter⟩ := RPIIteration.superlinear_iteration (p := p) + (A := C * (8 : ℝ)^p) (B := (4 : ℝ)^p) hp (by positivity) (by positivity) + let μ := (boundaryArea E).restrict (Metric.ball 0 2) + let : IsFiniteMeasure μ := ⟨by + simpa only [μ, Measure.restrict_apply_univ] using minimizing_boundaryArea_ball_lt_top hn1 hmin 0 (by norm_num : (0 : ℝ) < 2)⟩ + have hmμ : AEMeasurable h μ := (hSobolev 2 (by norm_num)).1.aestronglyMeasurable.aemeasurable + have hpμ : ∀ᵐ x ∂μ, 0 < h x := ae_restrict_of_ae (hpositive.mono fun _ hx ↦ hx.1) + obtain ⟨a, ha, ha1, hsmall⟩ := RPIIteration.exists_small_positive_sublevel μ h hmμ hpμ hδ + let u : ℕ → ℝ := fun j ↦ (boundaryArea E).real + (Metric.ball 0 (RPIIteration.radius j) ∩ {x | h x < RPIIteration.level a j}) + have hu : ∀ j, 0 ≤ u j := fun _ ↦ measureReal_nonneg + have hu0 : u 0 ≤ δ := by + have hmA : NullMeasurableSet {x | h x < a} μ := nullMeasurableSet_lt hmμ aemeasurable_const + have heq : u 0 = μ.real {x | h x < a} := by + dsimp [u, Measure.real] + rw [RPIIteration.level_zero] + norm_num only [RPIIteration.radius, pow_zero] + change (boundaryArea E (Metric.ball 0 2 ∩ {x | h x < a})).toReal = _ + rw [Measure.restrict_apply₀ hmA, inter_comm] + rw [heq] + exact hsmall.le + have hrec (j : ℕ) : u (j+1) ≤ (C * (8 : ℝ)^p) * ((4 : ℝ)^p)^j * (u j)^p := by + apply RPIIteration.power_step ha hC.le (lt_trans zero_lt_one hp).le (hu j) j + exact hstep (RPIIteration.radius (j+1)) (RPIIteration.radius j) + (RPIIteration.level a (j+1)) (RPIIteration.level a j) + (lt_trans zero_lt_one (RPIIteration.radius_bounds (j+1)).1) + (RPIIteration.radius_succ_lt j) (RPIIteration.radius_bounds j).2 + (RPIIteration.level_bounds ha (j+1)).1 (RPIIteration.level_succ_lt ha j) + have hlim := hiter u hu hu0 hrec + let A := Metric.ball (0 : Euc n) 1 ∩ {x | h x < a/2} + have hApos : 0 < boundaryArea E A := hinf 1 (by norm_num) (a/2) (by positivity) + have hAtop : boundaryArea E A ≠ ⊤ := ne_top_of_le_ne_top + (ne_of_lt (minimizing_boundaryArea_ball_lt_top hn1 hmin 0 (by norm_num : (0 : ℝ) < 1))) + (measure_mono inter_subset_left) + have hAr : 0 < (boundaryArea E).real A := ENNReal.toReal_pos hApos.ne' hAtop + have hlower (j : ℕ) : (boundaryArea E).real A ≤ u j := by + apply ENNReal.toReal_mono + · apply ne_top_of_le_ne_top + (ne_of_lt (minimizing_boundaryArea_ball_lt_top hn1 hmin 0 + (lt_trans zero_lt_one (RPIIteration.radius_bounds j).1))) + exact measure_mono inter_subset_left + · apply measure_mono + intro x hx + exact ⟨Metric.ball_subset_ball (RPIIteration.radius_bounds j).1.le hx.1, + hx.2.trans (RPIIteration.level_bounds ha j).2.1⟩ + have hzero : (boundaryArea E).real A ≤ 0 := ge_of_tendsto hlim (Eventually.of_forall hlower) + exact (not_le_of_gt hAr) hzero + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +open scoped ENNReal Topology ContDiff +open scoped Topology ENNReal +namespace RPISingularHarnack +open RPI RPI.Boundary + +theorem minimizing_boundaryArea_ball_pos {n : ℕ} (hn : 1 < n) + {E : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + {x : Euc n} (hx : x ∈ perimeterSupport E) {r : ℝ} (hr : 0 < r) : + 0 < boundaryArea E (Metric.ball x r) := by + obtain ⟨C, D, hC0, hCt, hD0, hDt, hc⟩ := minimizing_perimeter_boundaryArea_comparison hn + have hh := Measure.le_iff'.mp (hc E hmin).1 (Metric.ball x r) + rw [perimeterMeasure_open E Metric.isOpen_ball, Measure.smul_apply, smul_eq_mul] at hh + by_contra h + have hz : boundaryArea E (Metric.ball x r) = 0 := le_antisymm (le_of_not_gt h) bot_le + rw [hz, mul_zero] at hh + exact (not_le_of_gt (hx r hr)) hh + +theorem regular_ball_nonempty {n : ℕ} (hn : 8 ≤ n) + {E Z : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (hZd : dimH Z ≤ (n - 8 : ℕ)) + (hvertex : (0 : Euc n) ∈ perimeterSupport E) {r : ℝ} (hr : 0 < r) : + ((perimeterSupport E \ Z) ∩ Metric.ball 0 r).Nonempty := by + have hp := minimizing_boundaryArea_ball_pos (by omega : 1 < n) hmin hvertex hr + have hzs := boundaryArea_zero_of_singular_dim hn E Z hZd + by_contra he + have hsub : Metric.ball (0 : Euc n) r ∩ perimeterSupport E ⊆ Z := by + intro x hx + by_contra hxz + exact he ⟨x, ⟨⟨hx.2, hxz⟩, hx.1⟩⟩ + have hb : boundaryArea E (Metric.ball 0 r) = + boundaryArea E (Metric.ball 0 r ∩ perimeterSupport E) := by + simp only [boundaryArea, Measure.restrict_apply measurableSet_ball, + Measure.restrict_apply (measurableSet_ball.inter (isClosed_perimeterSupport E).measurableSet), + inter_assoc, inter_self] + have hh := measure_mono (μ := boundaryArea E) hsub + rw [← hb, hzs] at hh + exact (not_le_of_gt hp) hh + +theorem zeroEssentialInf_of_median_small_infimum {n : ℕ} (hn : 8 ≤ n) + {E Z : Set (Euc n)} (hmin : IsLocallyPerimeterMinimizing E) + (hZd : dimH Z ≤ (n - 8 : ℕ)) + (hvertex : (0 : Euc n) ∈ perimeterSupport E) + {W : Euc n → ℝ} {D : Euc n → Euc n} + (htrace : ∀ x ∈ perimeterSupport E \ Z, HasC1TraceJetAt (perimeterSupport E) W D x) + (hmedian : ∀ r : ℝ, 0 < r → r ≤ 1 → + sInf (W '' ((perimeterSupport E \ Z) ∩ Metric.ball 0 r)) ≤ 3 * r) : + ZeroEssentialInfAtVertex E (fun x ↦ min (W x) 1) := by + classical + intro R hR ε hε + obtain ⟨r, hr, hrR, hrε, hr1⟩ : ∃ r : ℝ, 0 < r ∧ r < R ∧ 3 * r < ε ∧ r ≤ 1 := by + refine ⟨min (min (R/2) (ε/6)) (1/2), by positivity, ?_, ?_, ?_⟩ + · have := (min_le_left (min (R/2) (ε/6)) (1/2)).trans (min_le_left (R/2) (ε/6)) + linarith + · have := (min_le_left (min (R/2) (ε/6)) (1/2)).trans (min_le_right (R/2) (ε/6)) + linarith + · exact (min_le_right _ _).trans (by norm_num) + obtain ⟨w, hw, hwε⟩ := exists_lt_of_csInf_lt + ((regular_ball_nonempty hn hmin hZd hvertex hr).image W) ((hmedian r hr hr1).trans_lt hrε) + obtain ⟨x, hx, rfl⟩ := hw + obtain ⟨U, hU, hxU, f, hf, he, hD⟩ := htrace x hx.1 + have hfx : f x < ε := by rw [he ⟨hx.1.1, hxU⟩]; exact hwε + have hm : U ∩ Metric.ball (0 : Euc n) R ∩ {y | f y < ε} ∈ 𝓝 x := + inter_mem (inter_mem (hU.mem_nhds hxU) + (Metric.isOpen_ball.mem_nhds (Metric.ball_subset_ball hrR.le hx.2))) + (((hf.contDiffAt (hU.mem_nhds hxU)).continuousAt).eventually (gt_mem_nhds hfx)) + obtain ⟨s, hs, hsm⟩ := Metric.mem_nhds_iff.mp hm + have hsarea := minimizing_boundaryArea_ball_pos (by omega : 1 < n) hmin hx.1.1 hs + have hsub : Metric.ball x s ∩ perimeterSupport E ⊆ + Metric.ball (0 : Euc n) R ∩ {y | min (W y) 1 < ε} := by + intro y hy + have hh := hsm hy.1 + refine ⟨hh.1.2, ?_⟩ + change min (W y) 1 < ε + apply lt_of_le_of_lt (min_le_left _ _) + rw [← he ⟨hy.2, hh.1.1⟩] + exact hh.2 + have heq : boundaryArea E (Metric.ball x s ∩ perimeterSupport E) = + boundaryArea E (Metric.ball x s) := by + simp only [boundaryArea, Measure.restrict_apply measurableSet_ball, + Measure.restrict_apply (measurableSet_ball.inter (isClosed_perimeterSupport E).measurableSet), + inter_assoc, inter_self] + exact hsarea.trans_le (heq ▸ measure_mono (μ := boundaryArea E) hsub) + +end RPISingularHarnack + +end + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff +open scoped Topology ENNReal NNReal +open scoped ENNReal Topology ContDiff Pointwise +open scoped Topology ENNReal ContDiff +open scoped BoundedContinuousFunction +open scoped ENNReal Topology +open scoped ENNReal Topology ContDiff +open scoped Topology ENNReal +namespace RPISingularHarnack +open RPI RPI.Boundary + +theorem no_regular_positive_supersolution_with_median_bound + {n : ℕ} (hn : 8 ≤ n) {E Z : Set (Euc n)} + (hmin : IsLocallyPerimeterMinimizing E) (hcone : IsCone E) + (hvertex : (0 : Euc n) ∈ perimeterSupport E) + (hZ : IsClosed Z) (hZd : dimH Z ≤ (n - 8 : ℕ)) + (hreg : ∀ x ∈ perimeterSupport E \ Z, ∃ U : Set (Euc n), IsOpen U ∧ x ∈ U ∧ + ∃ f : Euc n → ℝ, ContDiffOn ℝ ∞ f U ∧ + (∀ y ∈ U, fderiv ℝ f y ≠ 0) ∧ + (∀ y ∈ U, y ∈ perimeterSupport E ↔ f y = 0) ∧ + (∀ y ∈ U, (f y < 0 → y ∈ E) ∧ (y ∈ E → f y ≤ 0))) + {W : Euc n → ℝ} {D : Euc n → Euc n} + (htrace : ∀ x ∈ perimeterSupport E \ Z, HasC1TraceJetAt (perimeterSupport E) W D x) + (hpositive : ∀ x ∈ perimeterSupport E \ Z, 0 < W x) + (hsup : ∀ φ : Euc n → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → + Disjoint (tsupport φ) Z → (∀ x, 0 ≤ φ x) → + 0 ≤ ∫ x, inner ℝ (D x) (surfaceGradient (perimeterSupport E) φ x) + ∂surfaceMeasure (perimeterSupport E)) + (hmedian : ∀ r : ℝ, 0 < r → r ≤ 1 → + sInf (W '' ((perimeterSupport E \ Z) ∩ Metric.ball 0 r)) ≤ 3 * r) : False := by + obtain ⟨hSob, hSuper⟩ := + c1_min_wholeBoundarySobolev_and_supersolution_of_minimizing_regular_geometry + hn hmin hZ hZd hreg htrace (fun x hx ↦ (hpositive x hx).le) hsup + have hinf := zeroEssentialInf_of_median_small_infimum hn hmin hZd hvertex htrace hmedian + have hs : ∀ᵐ x ∂boundaryArea E, x ∈ perimeterSupport E := + ae_restrict_mem (isClosed_perimeterSupport E).measurableSet + have hz : ∀ᵐ x ∂boundaryArea E, x ∉ Z := by + simpa only [ae_iff, not_not, Set.ofPred_mem_eq] using + boundaryArea_zero_of_singular_dim hn E Z hZd + have hp : ∀ᵐ x ∂boundaryArea E, 0 < min (W x) 1 ∧ min (W x) 1 ≤ 1 := by + filter_upwards [hs, hz] with x hx hxz + exact ⟨lt_min (hpositive x ⟨hx, hxz⟩) zero_lt_one, min_le_right _ _⟩ + exact no_positive_bounded_supersolution_with_zero_vertex_inf hn E hmin hcone hvertex + (fun x ↦ min (W x) 1) (truncatedGradient W D) hSob hSuper hp hinf + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/Perimeter/Regularity/WindowAverage.lean b/lean/OAI/Geometry/Perimeter/Regularity/WindowAverage.lean new file mode 100644 index 0000000000000000000000000000000000000000..719c9402b3f0e967bfbce817157f0545644b9cbb --- /dev/null +++ b/lean/OAI/Geometry/Perimeter/Regularity/WindowAverage.lean @@ -0,0 +1,278 @@ +import OAI.Geometry.Perimeter.Regularity.EllipticLocality + +namespace OAI + +noncomputable section +open Set Filter MeasureTheory +open scoped Topology ENNReal NNReal ContDiff Convolution +namespace RPISingularHarnack +open RPI.Boundary + +def lineWindow (T : ℝ) : ℝ → ℝ := (Icc (-T) T).indicator (fun _ ↦ 1) + +theorem lineWindow_measurable (T : ℝ) : Measurable (lineWindow T) := + measurable_const.indicator measurableSet_Icc + +theorem lineWindow_integrable (T : ℝ) : Integrable (lineWindow T) volume := + continuous_const.integrableOn_Icc.integrable_indicator measurableSet_Icc + +theorem lineWindow_lintegral (T : ℝ) : (∫⁻ s : ℝ, ‖lineWindow T s‖ₑ) = + ENNReal.ofReal (2*T) := by + have he : (fun s ↦ ‖lineWindow T s‖ₑ) = (Icc (-T) T).indicator (fun _ ↦ (1:ℝ≥0∞)) := by + funext s + by_cases hs : s ∈ Icc (-T) T <;> simp [lineWindow,hs] + rw [he,lintegral_indicator measurableSet_Icc] + simp only [lintegral_const,Measure.restrict_apply_univ,one_mul,Real.volume_Icc] + congr 1 + ring + +theorem lineWindow_translation_le (T t : ℝ) : + (∫⁻ s : ℝ, ‖lineWindow T (s-t)-lineWindow T s‖ₑ) ≤ ENNReal.ofReal (4*|t|) := by + let J := Icc (-T-|t|) (-T+|t|) + let K := Icc (T-|t|) (T+|t|) + have hpoint (s : ℝ) : |lineWindow T (s-t)-lineWindow T s| ≤ + J.indicator (fun _ ↦ (1:ℝ)) s + K.indicator (fun _ ↦ (1:ℝ)) s := by + have hJ0 : 0 ≤ J.indicator (fun _ ↦ (1:ℝ)) s := indicator_nonneg (fun _ _ ↦ zero_le_one) s + have hK0 : 0 ≤ K.indicator (fun _ ↦ (1:ℝ)) s := indicator_nonneg (fun _ _ ↦ zero_le_one) s + have hab := abs_nonneg t + have htl := neg_abs_le t + have htu := le_abs_self t + by_cases h₁ : s-t ∈ Icc (-T) T + · by_cases h₂ : s ∈ Icc (-T) T + · simp only [lineWindow,indicator_of_mem h₁,indicator_of_mem h₂,sub_self,abs_zero] + exact add_nonneg hJ0 hK0 + · have hjk : s ∈ J ∨ s ∈ K := by + have h₁a := h₁.1 + have h₁b := h₁.2 + simp only [mem_Icc,not_and_or,not_le] at h₂ + rcases h₂ with h₂ | h₂ + · exact Or.inl ⟨by linarith,by linarith⟩ + · exact Or.inr ⟨by linarith,by linarith⟩ + simp only [lineWindow,indicator_of_mem h₁,indicator_of_notMem h₂,sub_zero,abs_one] + rcases hjk with hj | hk + · rw [indicator_of_mem hj]; linarith + · rw [indicator_of_mem hk]; linarith + · by_cases h₂ : s ∈ Icc (-T) T + · have hjk : s ∈ J ∨ s ∈ K := by + have h₂a := h₂.1 + have h₂b := h₂.2 + simp only [mem_Icc,not_and_or,not_le] at h₁ + rcases h₁ with h₁ | h₁ + · exact Or.inl ⟨by linarith,by linarith⟩ + · exact Or.inr ⟨by linarith,by linarith⟩ + simp only [lineWindow,indicator_of_notMem h₁,indicator_of_mem h₂,zero_sub,abs_neg,abs_one] + rcases hjk with hj | hk + · rw [indicator_of_mem hj]; linarith + · rw [indicator_of_mem hk]; linarith + · simp only [lineWindow,indicator_of_notMem h₁,indicator_of_notMem h₂,sub_self,abs_zero] + exact add_nonneg hJ0 hK0 + have hd : Integrable (fun s ↦ lineWindow T (s-t)-lineWindow T s) volume := + ((lineWindow_integrable T).comp_sub_right t).sub (lineWindow_integrable T) + have hJ : Integrable (J.indicator (fun _ ↦ (1:ℝ))) volume := + continuous_const.integrableOn_Icc.integrable_indicator measurableSet_Icc + have hK : Integrable (K.indicator (fun _ ↦ (1:ℝ))) volume := + continuous_const.integrableOn_Icc.integrable_indicator measurableSet_Icc + rw [← ofReal_integral_norm_eq_lintegral_enorm hd] + apply ENNReal.ofReal_le_ofReal + calc + _ ≤ ∫ s : ℝ, J.indicator (fun _ ↦ (1:ℝ)) s + K.indicator (fun _ ↦ (1:ℝ)) s := + integral_mono hd.norm (hJ.add hK) hpoint + _ = 4*|t| := by + rw [integral_add hJ hK,integral_indicator measurableSet_Icc,integral_indicator measurableSet_Icc] + simp only [setIntegral_const,smul_eq_mul,mul_one,Measure.real,Real.volume_Icc] + rw [show -T+|t|-(-T-|t|) = 2*|t| by ring, + show T+|t|-(T-|t|) = 2*|t| by ring,ENNReal.toReal_ofReal (by positivity)] + ring + +def normalWindowAverage {n : ℕ} (v : Euc n) (T : ℝ) (f : Euc n → ℝ) (x : Euc n) : ℝ := + ∫ s : ℝ, lineWindow T s * f (x+s•v) + +theorem normalWindowAverage_stronglyMeasurable {n : ℕ} {f : Euc n → ℝ} + (hf : Measurable f) (v : Euc n) (T : ℝ) : + StronglyMeasurable (normalWindowAverage v T f) := by + apply StronglyMeasurable.integral_prod_right + exact (((lineWindow_measurable T).comp measurable_snd).mul + (hf.comp (continuous_fst.add (continuous_snd.smul continuous_const)).measurable)).stronglyMeasurable + +theorem integrable_window_fiber {n : ℕ} {f : Euc n → ℝ} (hf : Measurable f) + {C : ℝ} (hb : ∀ x, ‖f x‖ ≤ C) (v : Euc n) (T : ℝ) (x : Euc n) : + Integrable (fun s : ℝ ↦ lineWindow T s * f (x+s•v)) volume := by + have hI : Integrable ((Icc (-T) T).indicator (fun _ ↦ C)) volume := + continuous_const.integrableOn_Icc.integrable_indicator measurableSet_Icc + apply hI.mono' (((lineWindow_measurable T).mul + (hf.comp (continuous_const.add (continuous_id.smul continuous_const)).measurable)).aestronglyMeasurable) + apply ae_of_all + intro s + by_cases hs : s ∈ Icc (-T) T + · simpa [lineWindow,hs] using hb (x+s•v) + · simp [lineWindow,hs] + +theorem normalWindowAverage_lintegral_le {n : ℕ} {f : Euc n → ℝ} + (hf : Measurable f) (v : Euc n) (T : ℝ) : + (∫⁻ x, ‖normalWindowAverage v T f x‖ₑ) ≤ + ENNReal.ofReal (2*T) * ∫⁻ x, ‖f x‖ₑ := by + have hm : Measurable (fun p : Euc n × ℝ ↦ ‖lineWindow T p.2‖ₑ * ‖f (p.1+p.2•v)‖ₑ) := + ((lineWindow_measurable T).comp measurable_snd).enorm.mul + (hf.comp (continuous_fst.add (continuous_snd.smul continuous_const)).measurable).enorm + calc + _ ≤ ∫⁻ x, ∫⁻ s : ℝ, ‖lineWindow T s‖ₑ * ‖f (x+s•v)‖ₑ := by + apply lintegral_mono + intro x + exact (enorm_integral_le_lintegral_enorm _).trans_eq + (lintegral_congr (fun _ ↦ enorm_mul _ _)) + _ = ∫⁻ s : ℝ, ∫⁻ x, ‖lineWindow T s‖ₑ * ‖f (x+s•v)‖ₑ := + lintegral_lintegral_swap hm.aemeasurable + _ = _ := by + have he (s : ℝ) : (∫⁻ x, ‖lineWindow T s‖ₑ * ‖f (x+s•v)‖ₑ) = + ‖lineWindow T s‖ₑ * ∫⁻ x, ‖f x‖ₑ := by + rw [lintegral_const_mul _ (show Measurable (fun x : Euc n ↦ ‖f (x+s•v)‖ₑ) from + (hf.comp (measurable_id.add measurable_const)).enorm)] + rw [lintegral_add_right_eq_self (fun x : Euc n ↦ ‖f x‖ₑ)] + simp_rw [he] + rw [lintegral_mul_const _ (lineWindow_measurable T).enorm,lineWindow_lintegral] + +theorem normalWindowAverage_translation_le {n : ℕ} {f : Euc n → ℝ} + (hf : Measurable f) {C : ℝ} (hb : ∀ x, ‖f x‖ ≤ C) + (v : Euc n) (T : ℝ) (w : Euc n) : + (∫⁻ x, ‖normalWindowAverage v T f (x+w)-normalWindowAverage v T f x‖ₑ) ≤ + ENNReal.ofReal (2*T) * ∫⁻ x, ‖f (x+w)-f x‖ₑ := by + have he (x : Euc n) : normalWindowAverage v T f (x+w)-normalWindowAverage v T f x = + normalWindowAverage v T (fun y ↦ f (y+w)-f y) x := by + unfold normalWindowAverage + rw [← integral_sub (integrable_window_fiber hf hb v T (x+w)) + (integrable_window_fiber hf hb v T x)] + apply integral_congr_ae + apply ae_of_all + intro s + have he : x+w+s•v = (x+s•v)+w := by abel + simp only [he,mul_sub] + simp_rw [he] + exact normalWindowAverage_lintegral_le ((hf.comp (measurable_id.add measurable_const)).sub hf) v T + +theorem normalWindowAverage_add_smul {n : ℕ} (v : Euc n) (T : ℝ) + (f : Euc n → ℝ) (x : Euc n) (t : ℝ) : + normalWindowAverage v T f (x+t•v) = + ∫ s : ℝ, lineWindow T (s-t)*f (x+s•v) := by + unfold normalWindowAverage + have he : (fun s : ℝ ↦ lineWindow T (s-t)*f (x+s•v)) = + (fun s : ℝ ↦ lineWindow T (s-t)*f (x+t•v+(s-t)•v)) := by + funext s + congr 2 + rw [sub_smul] + abel + rw [he] + exact (integral_sub_right_eq_self (fun s : ℝ ↦ lineWindow T s*f (x+t•v+s•v)) t).symm + +theorem normalWindowAverage_normal_translation_le {n : ℕ} {f : Euc n → ℝ} + (hf : Measurable f) {C : ℝ} (hb : ∀ x, ‖f x‖ ≤ C) + (v : Euc n) (T t : ℝ) : + (∫⁻ x, ‖normalWindowAverage v T f (x+t•v)-normalWindowAverage v T f x‖ₑ) ≤ + ENNReal.ofReal (4*|t|) * ∫⁻ x, ‖f x‖ₑ := by + have hishift (x : Euc n) : Integrable (fun s : ℝ ↦ lineWindow T (s-t)*f (x+s•v)) volume := by + have hi := (integrable_window_fiber hf hb v T (x+t•v)).comp_sub_right t + convert hi using 1 + funext s + congr 2 + rw [sub_smul] + abel + have he (x : Euc n) : normalWindowAverage v T f (x+t•v)-normalWindowAverage v T f x = + ∫ s : ℝ, (lineWindow T (s-t)-lineWindow T s)*f (x+s•v) := by + rw [normalWindowAverage_add_smul,normalWindowAverage, + ← integral_sub (hishift x) (integrable_window_fiber hf hb v T x)] + apply integral_congr_ae + exact ae_of_all _ fun s ↦ (sub_mul _ _ _).symm + let d : ℝ → ℝ := fun s ↦ lineWindow T (s-t)-lineWindow T s + have hd : Measurable d := ((lineWindow_measurable T).comp + (measurable_id.sub measurable_const)).sub (lineWindow_measurable T) + have hm : Measurable (fun p : Euc n × ℝ ↦ ‖d p.2‖ₑ * ‖f (p.1+p.2•v)‖ₑ) := + (hd.comp measurable_snd).enorm.mul + (hf.comp (continuous_fst.add (continuous_snd.smul continuous_const)).measurable).enorm + calc + _ ≤ ∫⁻ x, ∫⁻ s : ℝ, ‖d s‖ₑ * ‖f (x+s•v)‖ₑ := by + apply lintegral_mono + intro x + change ‖normalWindowAverage v T f (x+t•v)-normalWindowAverage v T f x‖ₑ ≤ _ + rw [he] + exact (enorm_integral_le_lintegral_enorm _).trans_eq + (lintegral_congr (fun _ ↦ enorm_mul _ _)) + _ = ∫⁻ s : ℝ, ∫⁻ x, ‖d s‖ₑ * ‖f (x+s•v)‖ₑ := + lintegral_lintegral_swap hm.aemeasurable + _ = (∫⁻ s : ℝ, ‖d s‖ₑ) * ∫⁻ x, ‖f x‖ₑ := by + have he' (s : ℝ) : (∫⁻ x, ‖d s‖ₑ * ‖f (x+s•v)‖ₑ) = + ‖d s‖ₑ * ∫⁻ x, ‖f x‖ₑ := by + rw [lintegral_const_mul _ (show Measurable (fun x : Euc n ↦ ‖f (x+s•v)‖ₑ) from + (hf.comp (measurable_id.add measurable_const)).enorm)] + rw [lintegral_add_right_eq_self (fun x : Euc n ↦ ‖f x‖ₑ)] + simp_rw [he'] + exact lintegral_mul_const _ hd.enorm + _ ≤ _ := mul_le_mul_left (lineWindow_translation_le T t) _ + +theorem translation_lintegral_add_le {n : ℕ} {f : Euc n → ℝ} + (hf : Measurable f) (a b : Euc n) : + (∫⁻ x, ‖f (x+(a+b))-f x‖ₑ) ≤ + (∫⁻ x, ‖f (x+a)-f x‖ₑ) + ∫⁻ x, ‖f (x+b)-f x‖ₑ := by + calc + _ ≤ ∫⁻ x, ‖f ((x+b)+a)-f (x+b)‖ₑ + ‖f (x+b)-f x‖ₑ := by + apply lintegral_mono + intro x + have he : f (x+(a+b))-f x = + (f ((x+b)+a)-f (x+b)) + (f (x+b)-f x) := by + abel_nf + change ‖f (x+(a+b))-f x‖ₑ ≤ _ + rw [he] + exact enorm_add_le _ _ + _ = _ := by + rw [lintegral_add_left (show Measurable (fun x : Euc n ↦ ‖f ((x+b)+a)-f (x+b)‖ₑ) from + ((hf.comp ((measurable_id.add measurable_const).add measurable_const)).sub + (hf.comp (measurable_id.add measurable_const))).enorm)] + rw [lintegral_add_right_eq_self (fun x : Euc n ↦ ‖f (x+a)-f x‖ₑ)] + +theorem normalWindowAverage_all_translation_le {n : ℕ} {f : Euc n → ℝ} + (hf : Measurable f) {C : ℝ} (hb : ∀ x, ‖f x‖ ≤ C) + {v : Euc n} (hv : ‖v‖ = 1) {T H V : ℝ} + (hT : 0 ≤ T) (hH : 0 ≤ H) (hV : 0 ≤ V) + (hmass : (∫⁻ x, ‖f x‖ₑ) ≤ ENNReal.ofReal V) + (hhor : ∀ z, inner ℝ v z = 0 → + (∫⁻ x, ‖f (x+z)-f x‖ₑ) ≤ ENNReal.ofReal (‖z‖*H)) + (w : Euc n) : + (∫⁻ x, ‖normalWindowAverage v T f (x+w)-normalWindowAverage v T f x‖ₑ) ≤ + ENNReal.ofReal (‖w‖*(4*T*H+4*V)) := by + let t : ℝ := inner ℝ v w + let z : Euc n := w-t•v + have ht : |t| ≤ ‖w‖ := by simpa only [hv,one_mul] using abs_real_inner_le_norm v w + have hz : inner ℝ v z = 0 := by + dsimp [z,t] + rw [inner_sub_right,inner_smul_right,real_inner_self_eq_norm_sq,hv] + ring + have hnz : ‖z‖ ≤ 2*‖w‖ := by + calc + _ ≤ ‖w‖ + ‖t•v‖ := norm_sub_le _ _ + _ = ‖w‖+|t| := by rw [norm_smul,Real.norm_eq_abs,hv,mul_one] + _ ≤ _ := by linarith + have he : w = z+t•v := by dsimp [z]; abel + calc + _ ≤ (∫⁻ x, ‖normalWindowAverage v T f (x+z)-normalWindowAverage v T f x‖ₑ) + + ∫⁻ x, ‖normalWindowAverage v T f (x+t•v)-normalWindowAverage v T f x‖ₑ := by + conv_lhs => rw [he] + exact translation_lintegral_add_le (normalWindowAverage_stronglyMeasurable hf v T).measurable z (t•v) + _ ≤ ENNReal.ofReal (2*T) * ENNReal.ofReal (‖z‖*H) + + ENNReal.ofReal (4*|t|)*ENNReal.ofReal V := by + exact add_le_add ((normalWindowAverage_translation_le hf hb v T z).trans + (mul_le_mul_right (hhor z hz) _)) + ((normalWindowAverage_normal_translation_le hf hb v T t).trans + (mul_le_mul_right hmass _)) + _ = ENNReal.ofReal ((2*T)*(‖z‖*H)+(4*|t|)*V) := by + rw [← ENNReal.ofReal_mul (by positivity),← ENNReal.ofReal_mul (by positivity), + ← ENNReal.ofReal_add (by positivity) (by positivity)] + _ ≤ _ := by + apply ENNReal.ofReal_le_ofReal + have h₁ : (2*T)*(‖z‖*H) ≤ (2*T)*(2*‖w‖*H) := + mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_right hnz hH) (by positivity) + have h₂ : (4*|t|)*V ≤ (4*‖w‖)*V := by gcongr + nlinarith + +end RPISingularHarnack + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/AETilingCountable.lean b/lean/OAI/Geometry/PeriodicTiling/AETilingCountable.lean new file mode 100644 index 0000000000000000000000000000000000000000..0b72dcffc687d7b2636e70b1b831743435ffefec --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/AETilingCountable.lean @@ -0,0 +1,55 @@ +import OAI.Geometry.PeriodicTiling.SeparatedCenters +import Mathlib.Algebra.Order.Floor.Ring +import Mathlib.Data.Set.Countable + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree + +open Set MeasureTheory + +theorem AETiles.eq_of_voxel_close {d : ℕ} {F : Finset (Lattice d)} + {A : Set (Space d)} (h : AETiles (Thickening F) A) + {z : Lattice d} (hz : z ∈ F) {a b : A} + (hc : ∀ i, |(b : Space d) i - (a : Space d) i| < 1) : a = b := by + by_contra hne + have hpos := unitVoxel_inter_volume_pos + ((a : Space d) + castLattice z) ((b : Space d) + castLattice z) (by + intro i + simpa only [Pi.add_apply, add_sub_add_right_eq_sub] using hc i) + have hsub : ∀ c : A, unitVoxel ((c : Space d) + castLattice z) ⊆ + {x | x - (c : Space d) ∈ Thickening F} := by + intro c x hx + refine ⟨z, hz, ?_⟩ + simpa only [mem_unitVoxel, sub_add_eq_sub_sub] using hx + have hnull := (h.aedisjoint hne).mono (hsub a) (hsub b) + exact (ne_of_gt hpos) hnull + +theorem AETiles.floor_injective {d : ℕ} {F : Finset (Lattice d)} + {A : Set (Space d)} (h : AETiles (Thickening F) A) (hF : F.Nonempty) : + Function.Injective (fun a : A => (fun i => ⌊(a : Space d) i⌋ : Lattice d)) := by + obtain ⟨z, hz⟩ := hF + intro a b he + apply h.eq_of_voxel_close hz + intro i + have hi : ⌊(a : Space d) i⌋ = ⌊(b : Space d) i⌋ := congrFun he i + have ha := Int.floor_le ((a : Space d) i) + have ha' := Int.lt_floor_add_one ((a : Space d) i) + have hb := Int.floor_le ((b : Space d) i) + have hb' := Int.lt_floor_add_one ((b : Space d) i) + rw [hi] at ha ha' + apply abs_lt.mpr + constructor <;> linarith + +theorem AETiles.countable_of_thickening {d : ℕ} {F : Finset (Lattice d)} + {A : Set (Space d)} (h : AETiles (Thickening F) A) (hF : F.Nonempty) : + A.Countable := + Set.countable_coe_iff.mp (h.floor_injective hF).countable + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/Activation.lean b/lean/OAI/Geometry/PeriodicTiling/Activation.lean new file mode 100644 index 0000000000000000000000000000000000000000..c183cd0e139b3251a136f9a5b957b4f95b9662d4 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/Activation.lean @@ -0,0 +1,354 @@ +import OAI.Geometry.PeriodicTiling.ShiftMultiplicity +import Mathlib.Algebra.BigOperators.Ring.Finset +import Mathlib.Data.Finset.Max +import Mathlib.Data.Fintype.BigOperators +import Mathlib.Tactic.Linarith +import Lean.Elab.Tactic.Omega +import Mathlib.Tactic.Ring +import OAI.Geometry.PeriodicTiling.ActivationTiles +import OAI.Geometry.PeriodicTiling.Dependence +import Mathlib.Logic.Equiv.Prod + +namespace OAI + +universe uα uJ uC uK uZ + +noncomputable section + +namespace PeriodicTilingThree + +open scoped BigOperators + +def MixedDifferenceZero {a b : ℕ} (Q : ZMod a × ZMod b → ℤ) : Prop := + ∀ x y, Q (x, y) - Q (x - 1, y) - Q (x, y - 1) + Q (x - 1, y - 1) = 0 + +private theorem zmod_eq_zero_of_pred_invariant {n : ℕ} [NeZero n] {α : Type uα} + (f : ZMod n → α) (hf : ∀ x, f x = f (x - 1)) (x : ZMod n) : f x = f 0 := by + have hnat : ∀ m : ℕ, f (m : ZMod n) = f 0 := by + intro m + induction m with + | zero => simp only [Nat.cast_zero] + | succ m ih => + calc + f ((m + 1 : ℕ) : ZMod n) = f (m : ZMod n) := by + simpa only [Nat.cast_add, Nat.cast_one, add_sub_cancel_right] using + hf ((m : ZMod n) + 1) + _ = f 0 := ih + simpa only [ZMod.natCast_zmod_val] using hnat x.val + +theorem mixedDifference_rectangle {a b : ℕ} [NeZero a] [NeZero b] + (Q : ZMod a × ZMod b → ℤ) (hmixed : MixedDifferenceZero Q) + (x x₀ : ZMod a) (y : ZMod b) : + Q (x, y) - Q (x₀, y) = Q (x, 0) - Q (x₀, 0) := by + have hfirst (z : ZMod a) : + Q (z, y) - Q (z - 1, y) = Q (z, 0) - Q (z - 1, 0) := by + apply zmod_eq_zero_of_pred_invariant + (fun w : ZMod b => Q (z, w) - Q (z - 1, w)) + intro w + have h := hmixed z w + linarith only [h] + have hrow (z : ZMod a) : + Q (z, y) - Q (z, 0) = Q (0, y) - Q (0, 0) := by + apply zmod_eq_zero_of_pred_invariant + (fun w : ZMod a => Q (w, y) - Q (w, 0)) + intro w + have h := hfirst w + linarith only [h] + linarith only [hrow x, hrow x₀] + +theorem histogram_separable {a b : ℕ} [NeZero a] [NeZero b] + (Q : ZMod a × ZMod b → ℕ) + (hmixed : MixedDifferenceZero (fun z => (Q z : ℤ))) : + ∃ u : ZMod a → ℕ, ∃ v : ZMod b → ℕ, ∀ x y, Q (x, y) = u x + v y := by + classical + obtain ⟨x₀, _hx₀, hmin⟩ := Finset.exists_min_image + (Finset.univ : Finset (ZMod a)) (fun x => Q (x, 0)) Finset.univ_nonempty + let u : ZMod a → ℕ := fun x => Q (x, 0) - Q (x₀, 0) + let v : ZMod b → ℕ := fun y => Q (x₀, y) + refine ⟨u, v, ?_⟩ + intro x y + have hle : Q (x₀, 0) ≤ Q (x, 0) := hmin x (Finset.mem_univ x) + have hrectangle := mixedDifference_rectangle + (fun z => (Q z : ℤ)) hmixed x x₀ y + dsimp [u, v] + omega + +theorem histogram_mass_eq {a b : ℕ} [NeZero a] [NeZero b] + (Q : ZMod a × ZMod b → ℕ) (u : ZMod a → ℕ) (v : ZMod b → ℕ) + (hsep : ∀ x y, Q (x, y) = u x + v y) : + (∑ z, Q z) = b * (∑ x, u x) + a * (∑ y, v y) := by + calc + (∑ z, Q z) = ∑ x : ZMod a, ∑ y : ZMod b, (u x + v y) := by + rw [Fintype.sum_prod_type] + apply Finset.sum_congr rfl + intro x _ + apply Finset.sum_congr rfl + intro y _ + exact hsep x y + _ = b * (∑ x, u x) + a * (∑ y, v y) := by + simp [Finset.sum_add_distrib, ← Finset.mul_sum] + +theorem histogram_mass_dvd {a b D : ℕ} [NeZero a] [NeZero b] + (Q : ZMod a × ZMod b → ℕ) + (hmixed : MixedDifferenceZero (fun z => (Q z : ℤ))) + (hmass : (∑ z, Q z) = D) (hlarge : D < b) : a ∣ D := by + obtain ⟨u, v, hsep⟩ := histogram_separable Q hmixed + have htotal : D = b * (∑ x, u x) + a * (∑ y, v y) := by + rw [← hmass] + exact histogram_mass_eq Q u v hsep + have hu : (∑ x, u x) = 0 := by + by_contra hne + have hone : 1 ≤ ∑ x, u x := Nat.one_le_iff_ne_zero.mpr hne + have hmul : b ≤ b * (∑ x, u x) := by + simpa only [Nat.mul_one] using Nat.mul_le_mul_left b hone + omega + refine ⟨∑ y, v y, ?_⟩ + simpa only [hu, Nat.mul_zero, Nat.zero_add] using htotal + +private theorem sum_histogram_corner {a b : ℕ} [NeZero a] [NeZero b] + (f : ZMod a × ZMod b → ℤ) (x : ZMod a) (y : ZMod b) : + (∑ e : ZMod a × ZMod b, + ((if e.1 = x then (1 : ℤ) else 0) * (if e.2 = y then 1 else 0)) * f e) = + f (x, y) := by + classical + have hterm (e : ZMod a × ZMod b) : + ((if e.1 = x then (1 : ℤ) else 0) * (if e.2 = y then 1 else 0)) * f e = + if e = (x, y) then f e else 0 := by + rcases e with ⟨x', y'⟩ + by_cases hx : x' = x <;> by_cases hy : y' = y <;> + simp [hx, hy, Prod.mk.injEq] + simp_rw [hterm] + simp + +theorem sum_shiftOmega_mul {a b : ℕ} [NeZero a] [NeZero b] + (Q : ZMod a × ZMod b → ℤ) (x : ZMod a) (y : ZMod b) : + (∑ e : ZMod a × ZMod b, shiftOmega a b e * Q ((x, y) - e)) = + Q (x, y) - Q (x - 1, y) - Q (x, y - 1) + Q (x - 1, y - 1) := by + classical + have hexpand (e : ZMod a × ZMod b) : + shiftOmega a b e * Q ((x, y) - e) = + ((if e.1 = 0 then (1 : ℤ) else 0) * (if e.2 = 0 then 1 else 0)) * + Q ((x, y) - e) - + ((if e.1 = 1 then (1 : ℤ) else 0) * (if e.2 = 0 then 1 else 0)) * + Q ((x, y) - e) - + ((if e.1 = 0 then (1 : ℤ) else 0) * (if e.2 = 1 then 1 else 0)) * + Q ((x, y) - e) + + ((if e.1 = 1 then (1 : ℤ) else 0) * (if e.2 = 1 then 1 else 0)) * + Q ((x, y) - e) := by + unfold shiftOmega + ring + simp_rw [hexpand] + rw [Finset.sum_add_distrib, Finset.sum_sub_distrib, Finset.sum_sub_distrib] + simp only [sum_histogram_corner, Prod.mk_sub_mk, sub_zero] + +theorem mixedDifferenceZero_of_shift_sum {a b D : ℕ} [NeZero a] [NeZero b] + (ha : 2 ≤ a) (hb : 2 ≤ b) (Q : ZMod a × ZMod b → ℕ) + (hmass : (∑ z, Q z) = D) + (hcoverage : ∀ c : ZMod a × ZMod b, + (∑ δ : ShiftIndex a b, Q (c - shift a b δ)) = D) : + MixedDifferenceZero (fun z => (Q z : ℤ)) := by + classical + intro x y + have hcount : + (∑ δ : ShiftIndex a b, (Q ((x, y) - shift a b δ) : ℤ)) = (D : ℤ) := by + exact_mod_cast hcoverage (x, y) + rw [sum_shift (fun e : ZMod a × ZMod b => (Q ((x, y) - e) : ℤ))] at hcount + simp only [nsmul_eq_mul] at hcount + simp_rw [shiftMultiplicity_cast ha hb] at hcount + simp only [add_mul, one_mul, Finset.sum_add_distrib] at hcount + have hbase : (∑ e : ZMod a × ZMod b, (Q ((x, y) - e) : ℤ)) = (D : ℤ) := by + have hinv : Function.Involutive (fun e : ZMod a × ZMod b => (x, y) - e) := + fun e => sub_sub_cancel (x, y) e + calc + (∑ e : ZMod a × ZMod b, (Q ((x, y) - e) : ℤ)) = ∑ e, (Q e : ℤ) := + hinv.bijective.sum_comp (fun e => (Q e : ℤ)) + _ = (D : ℤ) := by exact_mod_cast hmass + rw [hbase, sum_shiftOmega_mul (fun z => (Q z : ℤ)) x y] at hcount + linarith only [hcount] + +theorem histogram_mass_dvd_of_shift_sum {a b D : ℕ} [NeZero a] [NeZero b] + (ha : 2 ≤ a) (hb : 2 ≤ b) (Q : ZMod a × ZMod b → ℕ) + (hmass : (∑ z, Q z) = D) (hlarge : D < b) + (hcoverage : ∀ c : ZMod a × ZMod b, + (∑ δ : ShiftIndex a b, Q (c - shift a b δ)) = D) : a ∣ D := + histogram_mass_dvd Q (mixedDifferenceZero_of_shift_sum ha hb Q hmass hcoverage) + hmass hlarge + +theorem sum_firstCoordinate_of_bijective + {J : Type uJ} {C : Type uC} {K : Type uK} [Fintype J] [Fintype C] [Fintype K] [DecidableEq C] + (f : J → C × K) (hf : Function.Bijective f) (c : C) : + (∑ j, if (f j).1 = c then (1 : ℕ) else 0) = Fintype.card K := by + calc + _ = ∑ z : C × K, if z.1 = c then (1 : ℕ) else 0 := + hf.sum_comp (fun z => if z.1 = c then (1 : ℕ) else 0) + _ = _ := by + rw [Fintype.sum_prod_type, Finset.sum_comm] + dsimp only + simp only [Fintype.sum_ite_eq', Finset.sum_const, Finset.card_univ, + nsmul_eq_mul, mul_one, Nat.cast_id] + +theorem card_firstCoordinate_of_bijective + {J : Type uJ} {C : Type uC} {K : Type uK} [Fintype J] [Fintype C] [Fintype K] [DecidableEq C] + (f : J → C × K) (hf : Function.Bijective f) (c : C) : + Fintype.card {j : J // (f j).1 = c} = Fintype.card K := by + simpa only [Fintype.card_subtype, Finset.card_filter] using + sum_firstCoordinate_of_bijective f hf c + +theorem sum_firstFirstCoordinate_of_bijective + {J : Type uJ} {C : Type uC} {K : Type uK} {Z : Type uZ} + [Fintype J] [Fintype C] [Fintype K] [Fintype Z] + [DecidableEq C] (f : J → (C × K) × Z) (hf : Function.Bijective f) (c : C) : + (∑ j, if (f j).1.1 = c then (1 : ℕ) else 0) = + Fintype.card K * Fintype.card Z := by + have h := sum_firstCoordinate_of_bijective + (fun j => Equiv.prodAssoc C K Z (f j)) + ((Equiv.prodAssoc C K Z).bijective.comp hf) c + change (∑ j, if (f j).1.1 = c then (1 : ℕ) else 0) = + Fintype.card (K × Z) at h + simpa only [Fintype.card_prod] using h + +theorem card_firstFirstCoordinate_of_bijective + {J : Type uJ} {C : Type uC} {K : Type uK} {Z : Type uZ} + [Fintype J] [Fintype C] [Fintype K] [Fintype Z] + [DecidableEq C] (f : J → (C × K) × Z) (hf : Function.Bijective f) (c : C) : + Fintype.card {j : J // (f j).1.1 = c} = + Fintype.card K * Fintype.card Z := by + simpa only [Fintype.card_subtype, Finset.card_filter] using + sum_firstFirstCoordinate_of_bijective f hf c + +def seedHistogram {p : ℕ} [NeZero p] {C : Type uC} + (q : Residues p → C) (c : C) : ℕ := by + classical + exact Fintype.card {s : Residues p // q s = c} + +theorem seedHistogram_eq_sum {p : ℕ} [NeZero p] {C : Type uC} [DecidableEq C] + (q : Residues p → C) (c : C) : + seedHistogram q c = ∑ s : Residues p, if q s = c then (1 : ℕ) else 0 := by + simp only [seedHistogram, Fintype.card_subtype, Finset.card_filter] + +theorem sum_seedHistogram {p : ℕ} [NeZero p] {C : Type uC} [Fintype C] + (q : Residues p → C) : (∑ c, seedHistogram q c) = p ^ 4 := by + classical + calc + (∑ c, seedHistogram q c) = + Fintype.card (Σ c : C, {s : Residues p // q s = c}) := by + simp only [Fintype.card_sigma, seedHistogram] + _ = Fintype.card (Residues p) := Fintype.card_congr (Equiv.sigmaFiberEquiv q) + _ = p ^ 4 := by + simp only [Residues, Fintype.card_prod, ZMod.card] + ring + +theorem sum_seedHistogram_translate {p : ℕ} [NeZero p] + {C : Type uC} [AddCommGroup C] [DecidableEq C] + (q : Residues p → C) (s : Residues p) (e c : C) : + (∑ τ : Residues p, if q (s - τ) + e = c then (1 : ℕ) else 0) = + seedHistogram q (c - e) := by + have hinv : Function.Involutive (fun τ : Residues p => s - τ) := + fun τ => sub_sub_cancel s τ + rw [seedHistogram_eq_sum] + simpa only [eq_sub_iff_add_eq] using + hinv.bijective.sum_comp (fun τ => if q τ + e = c then (1 : ℕ) else 0) + +variable {p : ℕ} [NeZero p] (E : EncodingParameters p) + +theorem ordinary_active_of_tile (o : Outputs E) (hdep : HasDependence E o) + (n : Column p) (htile : Tiles (ordinaryActivationTile E n) (graph o)) : + ∀ x, ∃ j, Active E o (.inl n) x j := by + classical + intro x + by_contra hno + obtain ⟨c₀, hc⟩ := (no_active_iff_constant E o (.inl n) x).mp + (fun j hj => hno ⟨j, hj⟩) + have hsource (j : ActivationIndex E (.inl n)) : + o.c (ordinarySource E n (x, 0) j) (.inl n) = c₀ := by + calc + _ = usefulAt E o (.inl n) (ordinarySource E n (x, 0) j).1 + ((ordinarySource E n (x, 0) j).2 (.inl n)) := + usefulAt_factor E hdep _ _ _ + _ = usefulAt E o (.inl n) x + ((ordinarySource E n (x, 0) j).2 (.inl n)) := + usefulAt_eq_of_lineValue_eq E hdep n (ordinarySource_lineValue E n (x, 0) j) _ + _ = c₀ := hc _ + have hmap (j : ActivationIndex E (.inl n)) : + (ordinaryActivationMap E n o (x, 0) j).1 = + c₀ + shift (E.a (.inl n)) (E.b (.inl n)) j.2 := by + change o.c (ordinarySource E n (x, 0) j) (.inl n) + _ = _ + rw [hsource] + have htwo : (∑ δ : ShiftIndex (E.a (.inl n)) (E.b (.inl n)), + if shift (E.a (.inl n)) (E.b (.inl n)) δ = 0 then (1 : ℕ) else 0) = 2 := by + calc + _ = ∑ e : P E (.inl n), shiftMultiplicity (E.a (.inl n)) (E.b (.inl n)) e • + (if e = 0 then (1 : ℕ) else 0) := sum_shift _ + _ = shiftMultiplicity (E.a (.inl n)) (E.b (.inl n)) (0 : P E (.inl n)) := by + simp [mul_ite] + _ = 2 := by + change shiftMultiplicity (E.a (.inl n)) (E.b (.inl n)) (0, 0) = 2 + exact shiftMultiplicity_zero + have hcount := sum_firstCoordinate_of_bijective + (ordinaryActivationMap E n o (x, 0)) + ((ordinaryActivationTile_iff E n o).mp htile (x, 0)) c₀ + simp_rw [hmap, add_eq_left] at hcount + rw [Fintype.sum_prod_type] at hcount + have hbad : E.r (.inl n) * 2 = E.r (.inl n) := by + simpa only [htwo, Finset.sum_const, Finset.card_univ, nsmul_eq_mul, Nat.cast_id, K, ZMod.card] + using hcount + have hr := E.r_pos (.inl n) + omega + +theorem seed_active_somewhere_of_tile (o : Outputs E) (hdep : HasDependence E o) + (t : Fin 2) (htile : Tiles (seedActivationTile E t) (graph o)) : + ∃ x, Active E o (.inr t) x () := by + classical + by_contra hno + have hinactive (x : Plane) : ¬ Active E o (.inr t) x () := + fun hx => hno ⟨x, hx⟩ + let q : Residues p → P E (.inr t) := fun s => seedFactor E o t s 0 + have hconstant (s : Residues p) (w : K E (.inr t)) : + seedFactor E o t s w = q s := by + obtain ⟨c, hc⟩ := (no_active_iff_constant E o (.inr t) + (seedRepresentative p s)).mp (by + intro j + cases j + exact hinactive (seedRepresentative p s)) + exact (hc w).trans (hc 0).symm + have hfactor (x : Plane) (k : Input E) : + o.c (x, k) (.inr t) = q (seedResidue p x) := + (seedFactor_spec E hdep t x k).trans (hconstant _ _) + let b₀ : Base E := (0, 0) + have hmap (j : SeedActivationIndex E t) : + (seedActivationMap E t o b₀ j).1.1 = + q (seedResidue p b₀.1 - j.2) + + shift (E.a (.inr t)) (E.b (.inr t)) j.1.2 := by + have hf := hfactor (seedSource E t b₀ j).1 (seedSource E t b₀ j).2 + change o.c (seedSource E t b₀ j) (.inr t) = _ at hf + change o.c (seedSource E t b₀ j) (.inr t) + _ = _ + rw [hf] + have hs : seedResidue p (seedSource E t b₀ j).1 = + seedResidue p b₀.1 - j.2 := seedSource_residue E t b₀ j + rw [hs] + have hcoverage (c : P E (.inr t)) : + (∑ δ : ShiftIndex (E.a (.inr t)) (E.b (.inr t)), + seedHistogram q (c - shift (E.a (.inr t)) (E.b (.inr t)) δ)) = D p := by + have hcount := sum_firstFirstCoordinate_of_bijective + (seedActivationMap E t o b₀) ((seedActivationTile_iff E t o).mp htile b₀) c + simp_rw [hmap] at hcount + rw [Fintype.sum_prod_type, Fintype.sum_prod_type] at hcount + simp_rw [sum_seedHistogram_translate] at hcount + have hmul : E.r (.inr t) * + (∑ δ : ShiftIndex (E.a (.inr t)) (E.b (.inr t)), + seedHistogram q (c - shift (E.a (.inr t)) (E.b (.inr t)) δ)) = + E.r (.inr t) * D p := by + simpa only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul, Nat.cast_id, K, ZMod.card] + using hcount + exact Nat.eq_of_mul_eq_mul_left (E.r_pos (.inr t)) hmul + have hdiv : E.a (.inr t) ∣ p ^ 4 := + histogram_mass_dvd_of_shift_sum (E.a_two_le (.inr t)) (E.b_two_le (.inr t)) + (seedHistogram q) (sum_seedHistogram q) (E.seed_b_large t) hcoverage + exact E.prime_ne_p (.inl (.inr t)) + (Nat.prime_eq_prime_of_dvd_pow (E.a_prime (.inr t)) E.p_prime hdiv) + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/ActivationOffsets.lean b/lean/OAI/Geometry/PeriodicTiling/ActivationOffsets.lean new file mode 100644 index 0000000000000000000000000000000000000000..f08db4b1adcde0cd5bde625ef1d45c0881609522 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/ActivationOffsets.lean @@ -0,0 +1,233 @@ +import OAI.Geometry.PeriodicTiling.CyclicCoordinates +import OAI.Geometry.PeriodicTiling.ShiftMultiplicity +import Mathlib.Tactic.FinCases +import Mathlib.Tactic.Linarith +import Lean.Elab.Tactic.Omega +import Mathlib.Tactic.Ring + +namespace OAI + +universe uJ + +namespace PeriodicTilingThree + +noncomputable section + +def separatedResidueLift {J : Type uJ} [Fintype J] (M : ℕ) [NeZero M] + (v : J → ZMod M) (j : J) : ℤ := + ((v j).val : ℤ) + (M : ℤ) * ((Fintype.equivFin J j).val : ℤ) + +@[simp] theorem separatedResidueLift_cast {J : Type uJ} [Fintype J] + (M : ℕ) [NeZero M] (v : J → ZMod M) (j : J) : + (separatedResidueLift M v j : ZMod M) = v j := by + simp [separatedResidueLift] + +theorem separatedResidueLift_injective {J : Type uJ} [Fintype J] + (M : ℕ) [NeZero M] (v : J → ZMod M) : + Function.Injective (separatedResidueLift M v) := by + intro i j hij + change ((v i).val : ℤ) + (M : ℤ) * ((Fintype.equivFin J i).val : ℤ) = + ((v j).val : ℤ) + (M : ℤ) * ((Fintype.equivFin J j).val : ℤ) at hij + have he : (v i).val + M * (Fintype.equivFin J i).val = + (v j).val + M * (Fintype.equivFin J j).val := by + exact_mod_cast hij + apply (Fintype.equivFin J).injective + apply Fin.ext + by_contra hne + rcases lt_or_gt_of_ne hne with hlt | hgt + · have hmul := Nat.mul_le_mul_left M (Nat.succ_le_of_lt hlt) + have hi := ZMod.val_lt (v i) + nlinarith + · have hmul := Nat.mul_le_mul_left M (Nat.succ_le_of_lt hgt) + have hj := ZMod.val_lt (v j) + nlinarith + +variable {p : ℕ} [NeZero p] (E : EncodingParameters p) + +abbrev ActivationIndex (i : Channel p) := + K E i × ShiftIndex (E.a i) (E.b i) + +abbrev SeedActivationIndex (t : Fin 2) := ActivationIndex E (.inr t) × Residues p + +def otherSeed (t : Fin 2) : Fin 2 := ⟨1 - t.val, by omega⟩ + +@[simp] theorem otherSeed_ne_self (t : Fin 2) : otherSeed t ≠ t := by + fin_cases t <;> decide + +@[simp] theorem otherSeed_otherSeed (t : Fin 2) : otherSeed (otherSeed t) = t := by + fin_cases t <;> decide + +def activationModulus (i : Channel p) : ℕ := (E.r i * E.a i) * E.b i + +instance activationModulus_neZero (i : Channel p) : NeZero (activationModulus E i) := by + unfold activationModulus + infer_instance + +private theorem activationCoprime (i : Channel p) : + Nat.Coprime (E.r i * E.a i) (E.b i) := by + rw [Nat.coprime_mul_iff_left] + exact ⟨E.r_coprime_b i i, E.a_coprime_b i⟩ + +def activationCRT (i : Channel p) : + ZMod (activationModulus E i) ≃+* ((K E i × ZMod (E.a i)) × ZMod (E.b i)) := + (ZMod.chineseRemainder (activationCoprime E i)).trans + (RingEquiv.prodCongr (ZMod.chineseRemainder (E.r_coprime_a i i)) + (RingEquiv.refl _)) + +def activationResidue (i : Channel p) (j : ActivationIndex E i) : + ZMod (activationModulus E i) := + (activationCRT E i).symm + ((j.1, rhoA (E.a_two_le i) (E.b_two_le i) j.2), + rhoB (E.a_two_le i) (E.b_two_le i) j.2) + +def ordinaryFirst (n : Column p) : ActivationIndex E (.inl n) → ℤ := + separatedResidueLift (activationModulus E (.inl n)) (activationResidue E (.inl n)) + +def ordinaryOffset (n : Column p) (j : ActivationIndex E (.inl n)) : Plane := + (ordinaryFirst E n j, -(n.val : ℤ) * ordinaryFirst E n j) + +theorem ordinaryFirst_residues (n : Column p) (j : ActivationIndex E (.inl n)) : + (((ordinaryFirst E n j : K E (.inl n)), + (ordinaryFirst E n j : ZMod (E.a (.inl n)))), + (ordinaryFirst E n j : ZMod (E.b (.inl n)))) = + ((j.1, rhoA (E.a_two_le (.inl n)) (E.b_two_le (.inl n)) j.2), + rhoB (E.a_two_le (.inl n)) (E.b_two_le (.inl n)) j.2) := by + have h := congrArg (activationCRT E (.inl n)) + (separatedResidueLift_cast (activationModulus E (.inl n)) + (activationResidue E (.inl n)) j) + rw [activationResidue, RingEquiv.apply_symm_apply] at h + refine Prod.ext (Prod.ext ?_ ?_) ?_ + · simpa only [ordinaryFirst, map_intCast, Prod.fst_intCast] using + congrArg (fun z => z.1.1) h + · simpa only [ordinaryFirst, map_intCast, Prod.fst_intCast, Prod.snd_intCast] using + congrArg (fun z => z.1.2) h + · simpa only [ordinaryFirst, map_intCast, Prod.snd_intCast] using + congrArg Prod.snd h + +@[simp] theorem ordinaryOffset_low (n : Column p) (j : ActivationIndex E (.inl n)) : + ((ordinaryOffset E n j).1 : K E (.inl n)) = j.1 := + congrArg (fun z => z.1.1) (ordinaryFirst_residues E n j) + +@[simp] theorem ordinaryOffset_rhoA (n : Column p) (j : ActivationIndex E (.inl n)) : + ((ordinaryOffset E n j).1 : ZMod (E.a (.inl n))) = + rhoA (E.a_two_le (.inl n)) (E.b_two_le (.inl n)) j.2 := + congrArg (fun z => z.1.2) (ordinaryFirst_residues E n j) + +@[simp] theorem ordinaryOffset_rhoB (n : Column p) (j : ActivationIndex E (.inl n)) : + ((ordinaryOffset E n j).1 : ZMod (E.b (.inl n))) = + rhoB (E.a_two_le (.inl n)) (E.b_two_le (.inl n)) j.2 := + congrArg Prod.snd (ordinaryFirst_residues E n j) + +@[simp] theorem ordinaryOffset_lineValue (n : Column p) (j : ActivationIndex E (.inl n)) : + lineValue n (ordinaryOffset E n j) = 0 := by + simp [lineValue, ordinaryOffset] + +theorem ordinaryOffset_injective (n : Column p) : Function.Injective (ordinaryOffset E n) := by + intro i j hij + exact separatedResidueLift_injective _ _ (congrArg Prod.fst hij) + +def seedModulus (t : Fin 2) : ℕ := + (activationModulus E (.inr t) * p ^ 2) * E.a (.inr (otherSeed t)) + +instance seedModulus_neZero (t : Fin 2) : NeZero (seedModulus E t) := by + unfold seedModulus + infer_instance + +private theorem activationCoprime_p (i : Channel p) : + Nat.Coprime (activationModulus E i) (p ^ 2) := by + rw [Nat.coprime_pow_right_iff (by decide : 0 < 2)] + simp only [activationModulus, Nat.coprime_mul_iff_left] + exact ⟨⟨E.r_coprime_p i, E.prime_coprime_p (.inl i)⟩, + E.prime_coprime_p (.inr (.inl i))⟩ + +private theorem seedCoprime_other (t : Fin 2) : + Nat.Coprime (activationModulus E (.inr t) * p ^ 2) + (E.a (.inr (otherSeed t))) := by + simp only [activationModulus, Nat.coprime_mul_iff_left] + refine ⟨⟨⟨E.r_coprime_a _ _, ?_⟩, ?_⟩, ?_⟩ + · apply E.prime_coprime + simp only [ne_eq, Sum.inl.injEq, Sum.inr.injEq] + exact (otherSeed_ne_self t).symm + · apply E.prime_coprime + simp + · exact (E.prime_coprime_p (.inl (.inr (otherSeed t)))).symm.pow_left 2 + +def seedCRT (t : Fin 2) : + ZMod (seedModulus E t) ≃+* + ((((K E (.inr t) × ZMod (E.a (.inr t))) × ZMod (E.b (.inr t))) × + ZMod (p ^ 2)) × ZMod (E.a (.inr (otherSeed t)))) := + (ZMod.chineseRemainder (seedCoprime_other E t)).trans + (RingEquiv.prodCongr + ((ZMod.chineseRemainder (activationCoprime_p E (.inr t))).trans + (RingEquiv.prodCongr (activationCRT E (.inr t)) (RingEquiv.refl _))) + (RingEquiv.refl _)) + +def seedActivationResidue (t : Fin 2) (j : SeedActivationIndex E t) : + ZMod (seedModulus E t) := + (seedCRT E t).symm + ((((j.1.1, rhoA (E.a_two_le (.inr t)) (E.b_two_le (.inr t)) j.1.2), + rhoB (E.a_two_le (.inr t)) (E.b_two_le (.inr t)) j.1.2), j.2.1), 0) + +def seedFirst (t : Fin 2) : SeedActivationIndex E t → ℤ := + separatedResidueLift (seedModulus E t) (seedActivationResidue E t) + +def seedOffset (t : Fin 2) (j : SeedActivationIndex E t) : Plane := + (seedFirst E t j, (j.2.2.val : ℤ)) + +theorem seedFirst_residues (t : Fin 2) (j : SeedActivationIndex E t) : + (((((seedFirst E t j : K E (.inr t)), + (seedFirst E t j : ZMod (E.a (.inr t)))), + (seedFirst E t j : ZMod (E.b (.inr t)))), + (seedFirst E t j : ZMod (p ^ 2))), + (seedFirst E t j : ZMod (E.a (.inr (otherSeed t))))) = + ((((j.1.1, rhoA (E.a_two_le (.inr t)) (E.b_two_le (.inr t)) j.1.2), + rhoB (E.a_two_le (.inr t)) (E.b_two_le (.inr t)) j.1.2), j.2.1), 0) := by + have h := congrArg (seedCRT E t) + (separatedResidueLift_cast (seedModulus E t) (seedActivationResidue E t) j) + rw [seedActivationResidue, RingEquiv.apply_symm_apply] at h + refine Prod.ext (Prod.ext (Prod.ext (Prod.ext ?_ ?_) ?_) ?_) ?_ + · simpa only [seedFirst, map_intCast, Prod.fst_intCast] using + congrArg (fun z => z.1.1.1.1) h + · simpa only [seedFirst, map_intCast, Prod.fst_intCast, Prod.snd_intCast] using + congrArg (fun z => z.1.1.1.2) h + · simpa only [seedFirst, map_intCast, Prod.fst_intCast, Prod.snd_intCast] using + congrArg (fun z => z.1.1.2) h + · simpa only [seedFirst, map_intCast, Prod.fst_intCast, Prod.snd_intCast] using + congrArg (fun z => z.1.2) h + · simpa only [seedFirst, map_intCast, Prod.snd_intCast] using + congrArg Prod.snd h + +@[simp] theorem seedOffset_low (t : Fin 2) (j : SeedActivationIndex E t) : + ((seedOffset E t j).1 : K E (.inr t)) = j.1.1 := + congrArg (fun z => z.1.1.1.1) (seedFirst_residues E t j) + +@[simp] theorem seedOffset_rhoA (t : Fin 2) (j : SeedActivationIndex E t) : + ((seedOffset E t j).1 : ZMod (E.a (.inr t))) = + rhoA (E.a_two_le (.inr t)) (E.b_two_le (.inr t)) j.1.2 := + congrArg (fun z => z.1.1.1.2) (seedFirst_residues E t j) + +@[simp] theorem seedOffset_rhoB (t : Fin 2) (j : SeedActivationIndex E t) : + ((seedOffset E t j).1 : ZMod (E.b (.inr t))) = + rhoB (E.a_two_le (.inr t)) (E.b_two_le (.inr t)) j.1.2 := + congrArg (fun z => z.1.1.2) (seedFirst_residues E t j) + +@[simp] theorem seedOffset_other (t : Fin 2) (j : SeedActivationIndex E t) : + ((seedOffset E t j).1 : ZMod (E.a (.inr (otherSeed t)))) = 0 := + congrArg Prod.snd (seedFirst_residues E t j) + +@[simp] theorem seedOffset_residue (t : Fin 2) (j : SeedActivationIndex E t) : + (((seedOffset E t j).1 : ZMod (p ^ 2)), + ((seedOffset E t j).2 : ZMod (p ^ 2))) = j.2 := by + apply Prod.ext + · exact congrArg (fun z => z.1.2) (seedFirst_residues E t j) + · simp [seedOffset] + +theorem seedOffset_injective (t : Fin 2) : Function.Injective (seedOffset E t) := by + intro i j hij + exact separatedResidueLift_injective _ _ (congrArg Prod.fst hij) + +end + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/ActivationTiles.lean b/lean/OAI/Geometry/PeriodicTiling/ActivationTiles.lean new file mode 100644 index 0000000000000000000000000000000000000000..56d6b7cd6dfd39e9b023be198adc816d2b11790d --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/ActivationTiles.lean @@ -0,0 +1,398 @@ +import OAI.Geometry.PeriodicTiling.ActivationOffsets +import OAI.Geometry.PeriodicTiling.GraphTests +import Mathlib.Tactic.Abel + +namespace OAI + +universe uJ uB + +namespace PeriodicTilingThree + +noncomputable section + +variable {p : ℕ} [NeZero p] (E : EncodingParameters p) + +def activationBatch (i : Channel p) (h : Plane) (e : P E i) + (freeZ : Bool) : Finset (Ambient E) := by + classical + exact (Finset.univ.filter fun v : V E => + (v.2 i).1 = (h.1 : ZMod ((E.r i) ^ 2)) ∧ (v.2 i).2 = e ∧ + (∀ j, j ≠ i → low E j (v.2 j).1 = 0) ∧ (freeZ = true ∨ v.1 = 0)).image + (fun v => (h, v)) + +theorem mem_activationBatch (i : Channel p) (h : Plane) (e : P E i) + (freeZ : Bool) (g : Ambient E) : + g ∈ activationBatch E i h e freeZ ↔ + g.1 = h ∧ (g.2.2 i).1 = (h.1 : ZMod ((E.r i) ^ 2)) ∧ + (g.2.2 i).2 = e ∧ (∀ j, j ≠ i → low E j (g.2.2 j).1 = 0) ∧ + (freeZ = true ∨ g.2.1 = 0) := by + classical + simp only [activationBatch, Finset.mem_image, Finset.mem_filter, + Finset.mem_univ, true_and] + constructor + · rintro ⟨v, hv, rfl⟩ + exact ⟨rfl, hv⟩ + · rintro ⟨hh, hv⟩ + exact ⟨g.2, hv, Prod.ext hh.symm rfl⟩ + +theorem activationBatch_nonempty (i : Channel p) (h : Plane) (e : P E i) + (freeZ : Bool) : (activationBatch E i h e freeZ).Nonempty := by + classical + refine ⟨(h, 0, Function.update 0 i ((h.1 : ZMod ((E.r i) ^ 2)), e)), ?_⟩ + apply (mem_activationBatch E i h e freeZ _).mpr + refine ⟨rfl, ?_, ?_, ?_, Or.inr rfl⟩ + · simp + · simp + · intro j hji + simp [hji] + +theorem activationBatch_q0 (i : Channel p) (h : Plane) (e : P E i) + (freeZ : Bool) {g : Ambient E} (hg : g ∈ activationBatch E i h e freeZ) : + q0 E g = (h, Function.update (0 : Input E) i (h.1 : K E i)) := by + classical + obtain ⟨hh, hv, _hc, hother, _hz⟩ := (mem_activationBatch E i h e freeZ g).mp hg + apply Prod.ext hh + funext j + by_cases hji : j = i + · subst j + change low E i (g.2.2 i).1 = _ + rw [hv] + simp [low] + · simpa [hji] using hother j hji + +theorem activationBatch_disjoint (i : Channel p) {h h' : Plane} + (e e' : P E i) (z z' : Bool) (hh : h ≠ h') : + Disjoint (activationBatch E i h e z) (activationBatch E i h' e' z') := by + classical + apply Finset.disjoint_left.mpr + intro g hg hg' + exact hh (((mem_activationBatch E i h e z g).mp hg).1.symm.trans + ((mem_activationBatch E i h' e' z' g).mp hg').1) + +def activationSource (i : Channel p) (b : Base E) (h : Plane) (l : K E i) : Base E := + (b.1 - h, Function.update b.2 i (b.2 i - l)) + +theorem activationSource_eq_sub (i : Channel p) (b : Base E) (h : Plane) (l : K E i) : + activationSource E i b h l = b - (h, Function.update (0 : Input E) i l) := by + classical + refine Prod.ext rfl ?_ + funext j + by_cases hji : j = i + · subst j + simp [activationSource] + · simp [activationSource, hji] + +theorem activationSource_shear (i : Channel p) (b : Base E) (h : Plane) (l β : K E i) + (hl : (h.1 : K E i) = l) : + shear E i (activationSource E i b h l).1.1 + ((activationSource E i b h l).2 i) β + (h.1 : ZMod ((E.r i) ^ 2)) = + shear E i b.1.1 (b.2 i) β := by + simpa [activationSource] using shear_source_add E i b.1.1 h.1 (b.2 i) l β hl + +def targetBeta (y : Ambient E) (i : Channel p) : K E i := + (shearEquiv E i y.1.1 ((q0 E y).2 i)).symm ⟨(y.2.2 i).1, rfl⟩ + +@[simp] theorem shear_targetBeta (y : Ambient E) (i : Channel p) : + shear E i y.1.1 ((q0 E y).2 i) (targetBeta E y i) = (y.2.2 i).1 := + congrArg Subtype.val ((shearEquiv E i y.1.1 ((q0 E y).2 i)).apply_symm_apply + ⟨(y.2.2 i).1, rfl⟩) + +@[simp] theorem targetBeta_point (o : GraphOutputs E) (b : Base E) (i : Channel p) : + targetBeta E (point o b) i = o.beta b i := by + apply shear_injective E i b.1.1 (b.2 i) + simpa only [q0_point, point_horizontal, point_v] using shear_targetBeta E (point o b) i + +theorem difference_mem_activationBatch (o : GraphOutputs E) (i : Channel p) + (h : Plane) (l : K E i) (hl : (h.1 : K E i) = l) (e : P E i) + (freeZ : Bool) (y : Ambient E) (b : Base E) : + y - point o b ∈ activationBatch E i h e freeZ ↔ + activationSource E i (q0 E y) h l = b ∧ + o.c b i + e = (y.2.2 i).2 ∧ o.beta b i = targetBeta E y i ∧ + (freeZ = true ∨ o.z b = y.2.1) := by + constructor + · intro hm + have hq := activationBatch_q0 E i h e freeZ hm + have hq' : q0 E y - b = (h, Function.update (0 : Input E) i l) := by + simpa only [map_sub, q0_point, hl] using hq + have hb : activationSource E i (q0 E y) h l = b := by + rw [activationSource_eq_sub] + have he := congrArg (fun z : Base E => q0 E y - z) hq' + simpa using he.symm + obtain ⟨_hh, hv, hc, _hother, hz⟩ := + (mem_activationBatch E i h e freeZ (y - point o b)).mp hm + refine ⟨hb, ?_, ?_, ?_⟩ + · change (y.2.2 i).2 - o.c b i = e at hc + rw [← hc] + abel + · apply shear_injective E i y.1.1 ((q0 E y).2 i) + rw [shear_targetBeta] + have hs := activationSource_shear E i (q0 E y) h l (o.beta b i) hl + rw [hb] at hs + change (y.2.2 i).1 - shear E i b.1.1 (b.2 i) (o.beta b i) = + (h.1 : ZMod ((E.r i) ^ 2)) at hv + change shear E i b.1.1 (b.2 i) (o.beta b i) + + (h.1 : ZMod ((E.r i) ^ 2)) = + shear E i y.1.1 ((q0 E y).2 i) (o.beta b i) at hs + rw [← hs, ← hv] + abel + · rcases hz with hz | hz + · exact Or.inl hz + · right + change y.2.1 - o.z b = 0 at hz + exact (sub_eq_zero.mp hz).symm + · rintro ⟨hb, hc, hβ, hz⟩ + apply (mem_activationBatch E i h e freeZ (y - point o b)).mpr + have hs := activationSource_shear E i (q0 E y) h l (o.beta b i) hl + rw [hb, hβ] at hs + change shear E i b.1.1 (b.2 i) (targetBeta E y i) + + (h.1 : ZMod ((E.r i) ^ 2)) = + shear E i y.1.1 ((q0 E y).2 i) (targetBeta E y i) at hs + rw [shear_targetBeta] at hs + refine ⟨?_, ?_, ?_, ?_, ?_⟩ + · change y.1 - b.1 = h + rw [← hb] + change y.1 - (y.1 - h) = h + abel + · change (y.2.2 i).1 - shear E i b.1.1 (b.2 i) (o.beta b i) = + (h.1 : ZMod ((E.r i) ^ 2)) + rw [hβ] + rw [← hs] + abel + · change (y.2.2 i).2 - o.c b i = e + rw [← hc] + abel + · intro j hji + change low E j ((y.2.2 j).1 - shear E j b.1.1 (b.2 j) (o.beta b j)) = 0 + rw [map_sub, low_shear, ← hb] + simp [activationSource, hji, q0] + · rcases hz with hz | hz + · exact Or.inl hz + · right + change y.2.1 - o.z b = 0 + rw [hz, sub_self] + +def ordinaryActivationTile (n : Column p) : Finset (Ambient E) := by + classical + exact Finset.univ.biUnion fun j : ActivationIndex E (.inl n) => + activationBatch E (.inl n) (ordinaryOffset E n j) + (shift (E.a (.inl n)) (E.b (.inl n)) j.2) true + +def seedActivationTile (t : Fin 2) : Finset (Ambient E) := by + classical + exact Finset.univ.biUnion fun j : SeedActivationIndex E t => + activationBatch E (.inr t) (seedOffset E t j) + (shift (E.a (.inr t)) (E.b (.inr t)) j.1.2) false + +def ordinarySource (n : Column p) (b : Base E) (j : ActivationIndex E (.inl n)) : Base E := + activationSource E (.inl n) b (ordinaryOffset E n j) j.1 + +def seedSource (t : Fin 2) (b : Base E) (j : SeedActivationIndex E t) : Base E := + activationSource E (.inr t) b (seedOffset E t j) j.1.1 + +@[simp] theorem ordinarySource_horizontal (n : Column p) (b : Base E) + (j : ActivationIndex E (.inl n)) : + (ordinarySource E n b j).1 = b.1 - ordinaryOffset E n j := rfl + +@[simp] theorem ordinarySource_own (n : Column p) (b : Base E) + (j : ActivationIndex E (.inl n)) : + (ordinarySource E n b j).2 (.inl n) = b.2 (.inl n) - j.1 := by + simp [ordinarySource, activationSource] + +@[simp] theorem seedSource_horizontal (t : Fin 2) (b : Base E) + (j : SeedActivationIndex E t) : + (seedSource E t b j).1 = b.1 - seedOffset E t j := rfl + +@[simp] theorem seedSource_own (t : Fin 2) (b : Base E) + (j : SeedActivationIndex E t) : + (seedSource E t b j).2 (.inr t) = b.2 (.inr t) - j.1.1 := by + simp [seedSource, activationSource] + +@[simp] theorem ordinarySource_lineValue (n : Column p) (b : Base E) + (j : ActivationIndex E (.inl n)) : + lineValue n (ordinarySource E n b j).1 = lineValue n b.1 := by + simp only [ordinarySource_horizontal, lineValue, ordinaryOffset, + Prod.fst_sub, Prod.snd_sub] + ring + +theorem seedSource_residue (t : Fin 2) (b : Base E) (j : SeedActivationIndex E t) : + ((((seedSource E t b j).1.1 : ℤ) : ZMod (p ^ 2)), + (((seedSource E t b j).1.2 : ℤ) : ZMod (p ^ 2))) = + ((b.1.1 : ZMod (p ^ 2)), (b.1.2 : ZMod (p ^ 2))) - j.2 := by + rw [seedSource_horizontal] + simpa only [Prod.fst_sub, Prod.snd_sub, Int.cast_sub, Prod.mk_sub_mk] using + congrArg (fun z : Residues p => + ((b.1.1 : ZMod (p ^ 2)), (b.1.2 : ZMod (p ^ 2))) - z) + (seedOffset_residue E t j) + +def ordinaryActivationMap (n : Column p) (o : GraphOutputs E) (b : Base E) + (j : ActivationIndex E (.inl n)) : P E (.inl n) × K E (.inl n) := + (o.c (ordinarySource E n b j) (.inl n) + shift (E.a (.inl n)) (E.b (.inl n)) j.2, + o.beta (ordinarySource E n b j) (.inl n)) + +def seedActivationMap (t : Fin 2) (o : GraphOutputs E) (b : Base E) + (j : SeedActivationIndex E t) : (P E (.inr t) × K E (.inr t)) × ZMod (D p) := + ((o.c (seedSource E t b j) (.inr t) + shift (E.a (.inr t)) (E.b (.inr t)) j.1.2, + o.beta (seedSource E t b j) (.inr t)), o.z (seedSource E t b j)) + +def ordinaryTarget (n : Column p) (y : Ambient E) : P E (.inl n) × K E (.inl n) := + ((y.2.2 (.inl n)).2, targetBeta E y (.inl n)) + +def seedTarget (t : Fin 2) (y : Ambient E) : + (P E (.inr t) × K E (.inr t)) × ZMod (D p) := + (((y.2.2 (.inr t)).2, targetBeta E y (.inr t)), y.2.1) + +theorem ordinarySource_injective (n : Column p) (b : Base E) : + Function.Injective (ordinarySource E n b) := by + intro j j' hj + apply ordinaryOffset_injective E n + have hh := congrArg (fun d : Base E => b.1 - d.1) hj + simpa [ordinarySource, activationSource] using hh + +theorem seedSource_injective (t : Fin 2) (b : Base E) : + Function.Injective (seedSource E t b) := by + intro j j' hj + apply seedOffset_injective E t + have hh := congrArg (fun d : Base E => b.1 - d.1) hj + simpa [seedSource, activationSource] using hh + +theorem difference_mem_ordinaryActivationTile (n : Column p) (o : GraphOutputs E) + (y : Ambient E) (b : Base E) : + y - point o b ∈ ordinaryActivationTile E n ↔ + ∃ j, ordinarySource E n (q0 E y) j = b ∧ + ordinaryActivationMap E n o (q0 E y) j = ordinaryTarget E n y := by + classical + simp only [ordinaryActivationTile, Finset.mem_biUnion, Finset.mem_univ, true_and] + apply exists_congr + intro j + rw [difference_mem_activationBatch E o (.inl n) (ordinaryOffset E n j) j.1 + (ordinaryOffset_low E n j)] + simp only [true_or, and_true] + constructor + · rintro ⟨hb, hc, hβ⟩ + change ordinarySource E n (q0 E y) j = b at hb + refine ⟨hb, ?_⟩ + unfold ordinaryActivationMap ordinaryTarget + rw [hb] + exact Prod.ext hc hβ + · rintro ⟨hb, hmap⟩ + unfold ordinaryActivationMap ordinaryTarget at hmap + rw [hb] at hmap + exact ⟨hb, congrArg Prod.fst hmap, congrArg Prod.snd hmap⟩ + +theorem difference_mem_seedActivationTile (t : Fin 2) (o : GraphOutputs E) + (y : Ambient E) (b : Base E) : + y - point o b ∈ seedActivationTile E t ↔ + ∃ j, seedSource E t (q0 E y) j = b ∧ + seedActivationMap E t o (q0 E y) j = seedTarget E t y := by + classical + simp only [seedActivationTile, Finset.mem_biUnion, Finset.mem_univ, true_and] + apply exists_congr + intro j + rw [difference_mem_activationBatch E o (.inr t) (seedOffset E t j) j.1.1 + (seedOffset_low E t j)] + simp only [Bool.false_eq_true, false_or] + constructor + · rintro ⟨hb, hc, hβ, hz⟩ + change seedSource E t (q0 E y) j = b at hb + refine ⟨hb, ?_⟩ + unfold seedActivationMap seedTarget + rw [hb] + exact Prod.ext (Prod.ext hc hβ) hz + · rintro ⟨hb, hmap⟩ + unfold seedActivationMap seedTarget at hmap + rw [hb] at hmap + exact ⟨hb, congrArg (fun z => z.1.1) hmap, + congrArg (fun z => z.1.2) hmap, congrArg Prod.snd hmap⟩ + +private theorem existsUnique_source_iff {J : Type uJ} {B : Type uB} (s : J → B) + (hs : Function.Injective s) (Q : J → Prop) : + (∃! b, ∃ j, s j = b ∧ Q j) ↔ ∃! j, Q j := by + constructor + · rintro ⟨b, ⟨j, hj, hQ⟩, huniq⟩ + refine ⟨j, hQ, ?_⟩ + intro j' hQ' + apply hs + exact (huniq (s j') ⟨j', rfl, hQ'⟩).trans hj.symm + · rintro ⟨j, hj, huniq⟩ + refine ⟨s j, ⟨j, rfl, hj⟩, ?_⟩ + rintro b ⟨j', hj', hQ'⟩ + rw [← hj', huniq j' hQ'] + +theorem ordinaryTarget_surjective (n : Column p) (b : Base E) + (q : P E (.inl n) × K E (.inl n)) : + ∃ y : Ambient E, q0 E y = b ∧ ordinaryTarget E n y = q := by + classical + let o : GraphOutputs E := + ⟨fun _ => Function.update 0 (.inl n) q.1, + fun _ => Function.update 0 (.inl n) q.2, fun _ => 0⟩ + refine ⟨point o b, q0_point o b, ?_⟩ + simp [ordinaryTarget, o] + +theorem seedTarget_surjective (t : Fin 2) (b : Base E) + (q : (P E (.inr t) × K E (.inr t)) × ZMod (D p)) : + ∃ y : Ambient E, q0 E y = b ∧ seedTarget E t y = q := by + classical + let o : GraphOutputs E := + ⟨fun _ => Function.update 0 (.inr t) q.1.1, + fun _ => Function.update 0 (.inr t) q.1.2, fun _ => q.2⟩ + refine ⟨point o b, q0_point o b, ?_⟩ + simp [seedTarget, o] + +theorem ordinaryActivationTile_iff (n : Column p) (o : GraphOutputs E) : + Tiles (ordinaryActivationTile E n) (graph o) ↔ + ∀ b : Base E, Function.Bijective (ordinaryActivationMap E n o b) := by + rw [graph, tiles_range_iff_unique_base (point o) (point_injective o)] + simp_rw [difference_mem_ordinaryActivationTile, + existsUnique_source_iff _ (ordinarySource_injective E n _)] + constructor + · intro h b + apply (Function.bijective_iff_existsUnique _).mpr + intro q + obtain ⟨y, hy, hq⟩ := ordinaryTarget_surjective E n b q + simpa only [hy, hq] using h y + · intro h y + exact (h (q0 E y)).existsUnique (ordinaryTarget E n y) + +theorem seedActivationTile_iff (t : Fin 2) (o : GraphOutputs E) : + Tiles (seedActivationTile E t) (graph o) ↔ + ∀ b : Base E, Function.Bijective (seedActivationMap E t o b) := by + rw [graph, tiles_range_iff_unique_base (point o) (point_injective o)] + simp_rw [difference_mem_seedActivationTile, + existsUnique_source_iff _ (seedSource_injective E t _)] + constructor + · intro h b + apply (Function.bijective_iff_existsUnique _).mpr + intro q + obtain ⟨y, hy, hq⟩ := seedTarget_surjective E t b q + simpa only [hy, hq] using h y + · intro h y + exact (h (q0 E y)).existsUnique (seedTarget E t y) + +theorem ordinaryActivationTile_nonempty (n : Column p) : + (ordinaryActivationTile E n).Nonempty := by + classical + let δ : ShiftIndex (E.a (.inl n)) (E.b (.inl n)) := + ⟨(0, 0), ⟨0, by simp [shiftMultiplicity]⟩⟩ + let j : ActivationIndex E (.inl n) := (0, δ) + obtain ⟨g, hg⟩ := activationBatch_nonempty E (.inl n) (ordinaryOffset E n j) + (shift (E.a (.inl n)) (E.b (.inl n)) j.2) true + refine ⟨g, ?_⟩ + simp only [ordinaryActivationTile, Finset.mem_biUnion, Finset.mem_univ, true_and] + exact ⟨j, hg⟩ + +theorem seedActivationTile_nonempty (t : Fin 2) : + (seedActivationTile E t).Nonempty := by + classical + let δ : ShiftIndex (E.a (.inr t)) (E.b (.inr t)) := ⟨(0, 0), ⟨0, by simp [shiftMultiplicity]⟩⟩ + let j : SeedActivationIndex E t := ((0, δ), 0) + obtain ⟨g, hg⟩ := activationBatch_nonempty E (.inr t) (seedOffset E t j) + (shift (E.a (.inr t)) (E.b (.inr t)) j.1.2) false + refine ⟨g, ?_⟩ + simp only [seedActivationTile, Finset.mem_biUnion, Finset.mem_univ, true_and] + exact ⟨j, hg⟩ + +end + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/ActivityWord.lean b/lean/OAI/Geometry/PeriodicTiling/ActivityWord.lean new file mode 100644 index 0000000000000000000000000000000000000000..3eaf2f583de25863a03a5a40667398dd57c89fa0 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/ActivityWord.lean @@ -0,0 +1,125 @@ +import OAI.Geometry.PeriodicTiling.Dependence +import Mathlib.GroupTheory.OrderOfElement + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree + +variable {p : ℕ} [NeZero p] (E : EncodingParameters p) + +def activeLabels (o : GraphOutputs E) (i : Channel p) (x : Plane) : + Finset (Label p i) := by + classical + exact Finset.univ.filter (Active E o i x) + +@[simp] theorem mem_activeLabels (o : GraphOutputs E) (i : Channel p) + (x : Plane) (j : Label p i) : + j ∈ activeLabels E o i x ↔ Active E o i x j := by + classical + simp [activeLabels] + +def selectSymbol (S : Finset (Symbol p)) : Symbol p := by + classical + exact if h : S.Nonempty then h.choose else 1 + +theorem selectSymbol_mem + {p : ℕ} [NeZero p] + (S : Finset (Symbol p)) (hS : S.Nonempty) : + selectSymbol S ∈ S := by + classical + simp only [selectSymbol, dite_eq_left hS] + exact hS.choose_spec + +def selectedWord (o : GraphOutputs E) : WordArray p := + fun n m => selectSymbol (activeLabels E o (.inl n) (0, m)) + +theorem selectedWord_active (o : GraphOutputs E) + (hactive : ∀ n x, ∃ j, Active E o (.inl n) x j) (n : Column p) (m : ℤ) : + Active E o (.inl n) (0, m) (selectedWord E o n m) := by + apply (mem_activeLabels E o (.inl n) (0, m) _).mp + apply selectSymbol_mem + obtain ⟨j, hj⟩ := hactive n (0, m) + exact ⟨j, (mem_activeLabels E o (.inl n) (0, m) j).mpr hj⟩ + +theorem selectedWord_active_at (o : GraphOutputs E) (hdep : HasDependence E o) + (hactive : ∀ n x, ∃ j, Active E o (.inl n) x j) (n : Column p) (x : Plane) : + Active E o (.inl n) x (selectedWord E o n (lineValue n x)) := by + apply (active_ordinary_iff E hdep n (y := (0, lineValue n x)) + (by simp) _).mpr + exact selectedWord_active E o hactive n _ + +theorem selectedWord_lineRule (o : GraphOutputs E) (hdep : HasDependence E o) + (hactive : ∀ n x, ∃ j, Active E o (.inl n) x j) + (hwords : ∀ x (w : Word p), (∀ n, Active E o (.inl n) x (w n)) → Allowed p w) : + LineRule p (selectedWord E o) := by + intro d e + apply hwords (d, e) + intro n + simpa only [lineValue, mul_comm, add_comm] using + selectedWord_active_at E o hdep hactive n (d, e) + +theorem selectedWord_nonconstant_of_forced_letters + (o : GraphOutputs E) (hdep : HasDependence E o) + (hactive : ∀ n x, ∃ j, Active E o (.inl n) x j) + (a b : Symbol p) (hab : a ≠ b) (x y : Plane) + (hx : ∀ n j, Active E o (.inl n) x j → j = a) + (hy : ∀ n j, Active E o (.inl n) y j → j = b) : + NonconstantColumns (selectedWord E o) := by + intro n + refine ⟨lineValue n x, lineValue n y, ?_⟩ + have ha := hx n _ (selectedWord_active_at E o hdep hactive n x) + have hb := hy n _ (selectedWord_active_at E o hdep hactive n y) + intro he + exact hab (ha.symm.trans (he.trans hb)) + +theorem graph_period_useful (o : GraphOutputs E) (v : Plane) + (hv : Period (graph o) (v, (0 : V E))) (x : Plane) (k : Input E) : + o.c (x + v, k) = o.c (x, k) := by + have hm : point o (x, k) + (v, (0 : V E)) ∈ graph o := + (hv (point o (x, k))).mpr (point_mem_graph o (x, k)) + have he := eq_point_of_mem_graph o hm + have hq : q0 E (point o (x, k) + (v, (0 : V E))) = (x + v, k) := by + rw [map_add, q0_point] + refine Prod.ext rfl ?_ + funext i + simp [q0] + rw [hq] at he + funext i + have hi := congrArg (fun z : Ambient E => (z.2.2 i).2) he + simpa only [Prod.fst_add, Prod.snd_add, Pi.add_apply, point_c, + Prod.fst_zero, Prod.snd_zero, Pi.zero_apply, add_zero] using hi.symm + +theorem activeLabels_eq_of_graph_period (o : GraphOutputs E) (v : Plane) + (hv : Period (graph o) (v, (0 : V E))) (i : Channel p) (x : Plane) : + activeLabels E o i (x + v) = activeLabels E o i x := by + classical + have hc : usefulAt E o i (x + v) = usefulAt E o i x := by + funext w + exact congrFun (graph_period_useful E o v hv x (Function.update 0 i w)) i + ext j + simp only [mem_activeLabels, Active, hc] + +theorem selectedWord_period_of_graph_period (o : GraphOutputs E) (M : ℤ) + (hv : Period (graph o) ((0, M), (0 : V E))) : + VerticalPeriod (selectedWord E o) M := by + intro n m + have hs := activeLabels_eq_of_graph_period E o (0, M) hv (.inl n) (0, m) + have hs' : activeLabels E o (.inl n) (0, m + M) = + activeLabels E o (.inl n) (0, m) := by simpa only [Prod.mk_add_mk, zero_add] using hs + exact congrArg selectSymbol hs' + +theorem exists_positive_vertical_graph_period (o : GraphOutputs E) + (hper : FullyPeriodic (graph o)) : + ∃ M : ℕ, 0 < M ∧ Period (graph o) ((0, (M : ℤ)), (0 : V E)) := by + obtain ⟨Λ, hΛ, hperiods⟩ := hper + refine ⟨Λ.index, Nat.pos_of_ne_zero hΛ.index_ne_zero, ?_⟩ + have h := hperiods _ (Λ.nsmul_index_mem (((0, 1) : Plane), (0 : V E))) + simpa only [Prod.smul_mk, smul_zero, nsmul_eq_mul, mul_one] using h + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/AuxiliaryCubes.lean b/lean/OAI/Geometry/PeriodicTiling/AuxiliaryCubes.lean new file mode 100644 index 0000000000000000000000000000000000000000..dee52e325ccb3e040b5be05fbc6ddfc5fe04fba0 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/AuxiliaryCubes.lean @@ -0,0 +1,98 @@ +import OAI.Geometry.PeriodicTiling.VoxelMeasure +import OAI.Geometry.PeriodicTiling.ClosedCoverChains +import Mathlib.Analysis.Normed.Group.Bounded +import Mathlib.MeasureTheory.Measure.AEDisjoint +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.NormNum +import Mathlib.Tactic.Positivity +import Mathlib.Tactic.Ring + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree + +open Set MeasureTheory +open scoped ENNReal + +def auxiliaryCube (m : ℕ) (c : Space 3) : Set (Space 3) := + Metric.closedBall c ((m : ℝ) / 2) + +theorem auxiliaryCube_isClosed (m : ℕ) (c : Space 3) : + IsClosed (auxiliaryCube m c) := Metric.isClosed_closedBall + +theorem auxiliaryCube_measurableSet (m : ℕ) (c : Space 3) : + MeasurableSet (auxiliaryCube m c) := (auxiliaryCube_isClosed m c).measurableSet + +theorem auxiliaryCube_nonempty (m : ℕ) (c : Space 3) : + (auxiliaryCube m c).Nonempty := + ⟨c, Metric.mem_closedBall_self (by positivity)⟩ + +theorem auxiliaryCube_volume (m : ℕ) (c : Space 3) : + volume (auxiliaryCube m c) = ((m ^ 3 : ℕ) : ℝ≥0∞) := by + rw [auxiliaryCube, closedBall_volume c (by positivity)] + rw [show 2 * ((m : ℝ) / 2) = (m : ℝ) by ring] + rw [ENNReal.ofReal_pow (Nat.cast_nonneg m) 3, ENNReal.ofReal_natCast] + simp only [Nat.cast_pow] + +theorem auxiliaryCube_translate (m : ℕ) (c : Space 3) : + {x : Space 3 | x - c ∈ auxiliaryCube m 0} = auxiliaryCube m c := by + ext x + simp only [mem_ofPred_eq, auxiliaryCube, Metric.mem_closedBall, + dist_eq_norm, sub_zero] + +theorem auxiliaryCube_aedisjoint {m : ℕ} (hm : 0 < m) + {c c' : Space 3} (hsep : (m : ℝ) ≤ ‖c - c'‖) : + AEDisjoint volume (auxiliaryCube m c) (auxiliaryCube m c') := by + have hmR : (0 : ℝ) < m := by exact_mod_cast hm + have hballs : Disjoint (Metric.ball c ((m : ℝ) / 2)) + (Metric.ball c' ((m : ℝ) / 2)) := by + apply Metric.ball_disjoint_ball + rw [dist_eq_norm] + linarith + exact hballs.aedisjoint.congr + (closedBall_ae_eq_ball c (by positivity)) + (closedBall_ae_eq_ball c' (by positivity)) + +theorem auxiliaryCube_inter_norm_le {m : ℕ} {c c' : Space 3} + (h : (auxiliaryCube m c ∩ auxiliaryCube m c').Nonempty) : + ‖c' - c‖ ≤ (m : ℝ) := by + obtain ⟨x, hx, hx'⟩ := h + have hxle : dist x c ≤ (m : ℝ) / 2 := hx + have hxle' : dist x c' ≤ (m : ℝ) / 2 := hx' + have ht := dist_triangle c' x c + rw [dist_comm c' x, dist_eq_norm c' c] at ht + linarith + +theorem auxiliaryCube_locallyFinite (m : ℕ) (C : Set (Space 3)) + (hfin : ∀ K : Set (Space 3), Bornology.IsBounded K → (C ∩ K).Finite) : + LocallyFinite (fun c : C => auxiliaryCube m c) := by + intro x + have hindex : {c : C | (c : Space 3) ∈ + Metric.closedBall x ((m : ℝ) / 2 + 1)}.Finite := by + have hf := Set.Finite.preimage + (f := fun c : C => (c : Space 3)) Subtype.val_injective.injOn + (hfin (Metric.closedBall x ((m : ℝ) / 2 + 1)) Metric.isBounded_closedBall) + exact hf.subset fun c hc => ⟨c.property, hc⟩ + refine ⟨Metric.ball x 1, Metric.ball_mem_nhds x (by norm_num), hindex.subset ?_⟩ + rintro c ⟨y, hy, hyx⟩ + have hyc : dist y (c : Space 3) ≤ (m : ℝ) / 2 := hy + have hyx' : dist y x < 1 := hyx + change dist (c : Space 3) x ≤ (m : ℝ) / 2 + 1 + have ht := dist_triangle (c : Space 3) y x + rw [dist_comm (c : Space 3) y] at ht + linarith + +theorem auxiliaryCube_cover_of_ae (m : ℕ) (C : Set (Space 3)) + (hfin : ∀ K : Set (Space 3), Bornology.IsBounded K → (C ∩ K).Finite) + (hcover : ∀ᵐ x ∂volume, ∃ c : C, x ∈ auxiliaryCube m c) : + ∀ x, ∃ c : C, x ∈ auxiliaryCube m c := + closed_locallyFinite_cover_of_ae volume (fun c : C => auxiliaryCube m c) + (fun c => auxiliaryCube_isClosed m c) (auxiliaryCube_locallyFinite m C hfin) hcover + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/BlockActivationInverse.lean b/lean/OAI/Geometry/PeriodicTiling/BlockActivationInverse.lean new file mode 100644 index 0000000000000000000000000000000000000000..460db7946fd4b027dab59a6ae9799f03e42133d3 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/BlockActivationInverse.lean @@ -0,0 +1,236 @@ +import OAI.Geometry.PeriodicTiling.LabeledDigitBlocks +import OAI.Geometry.PeriodicTiling.ShiftMultiplicity +import Mathlib.Tactic.Abel + +namespace OAI + +universe uΔ uK uA uB + +namespace PeriodicTilingThree + +structure BlockShiftData (Δ : Type uΔ) (a b : ℕ) where + e : Δ → ZMod a × ZMod b + rhoA : Δ → ZMod a + rhoB : Δ → ZMod b + orderA : Δ ≃ (ZMod b × ZMod a) + orderB : Δ ≃ (ZMod a × ZMod b) + orderA_apply : ∀ δ, orderA δ = ((e δ).2, (e δ).1 + rhoA δ) + orderB_apply : ∀ δ, orderB δ = ((e δ).1, (e δ).2 + rhoB δ) + +namespace BlockShiftData + +noncomputable def ofMultiplicity {a b : ℕ} [NeZero a] [NeZero b] + (ha : 2 ≤ a) (hb : 2 ≤ b) : BlockShiftData (ShiftIndex a b) a b where + e := shift a b + rhoA := PeriodicTilingThree.rhoA ha hb + rhoB := PeriodicTilingThree.rhoB ha hb + orderA := shiftOrderA ha hb + orderB := shiftOrderB ha hb + orderA_apply := shiftOrderA_apply ha hb + orderB_apply := shiftOrderB_apply ha hb + +variable {K : Type uK} {A : Type uA} {B : Type uB} {Δ : Type uΔ} [AddCommGroup K] {a b : ℕ} + +def blockForward (D : LabeledBlocks K A B a b) (S : BlockShiftData Δ a b) + (H : K × Δ → ℤ) (x : ℤ) (k : K) (z : K × Δ) : + (ZMod a × ZMod b) × K := + (D.C (k - z.1) + S.e z.2, D.T (x - H z) (k - z.1)) + +def blockInverse (D : LabeledBlocks K A B a b) (S : BlockShiftData Δ a b) + (x : ℤ) (k : K) (v : (ZMod a × ZMod b) × K) : K × Δ := + match D.decode v.2 with + | .inl (c, q) => + let δ := S.orderA.symm (v.1.2, v.1.1 + (x : ZMod a) - q) + (k - D.decode.symm (.inl (c, v.1.1 - (S.e δ).1)), δ) + | .inr (c, q) => + let δ := S.orderB.symm (v.1.1, v.1.2 + (x : ZMod b) - q) + (k - D.decode.symm (.inr (c, v.1.2 - (S.e δ).2)), δ) + +theorem blockInverse_inl (D : LabeledBlocks K A B a b) (S : BlockShiftData Δ a b) + (x : ℤ) (k : K) (α : ZMod a) (ξ : ZMod b) (c : A) (q : ZMod a) : + blockInverse D S x k ((α, ξ), D.decode.symm (.inl (c, q))) = + let δ := S.orderA.symm (ξ, α + (x : ZMod a) - q) + (k - D.decode.symm (.inl (c, α - (S.e δ).1)), δ) := by + simp only [blockInverse, Equiv.apply_symm_apply] + +theorem blockInverse_inr (D : LabeledBlocks K A B a b) (S : BlockShiftData Δ a b) + (x : ℤ) (k : K) (α : ZMod a) (ξ : ZMod b) (c : B) (q : ZMod b) : + blockInverse D S x k ((α, ξ), D.decode.symm (.inr (c, q))) = + let δ := S.orderB.symm (α, ξ + (x : ZMod b) - q) + (k - D.decode.symm (.inr (c, ξ - (S.e δ).2)), δ) := by + simp only [blockInverse, Equiv.apply_symm_apply] + +theorem blockForward_inl (D : LabeledBlocks K A B a b) (S : BlockShiftData Δ a b) + (H : K × Δ → ℤ) (hA : ∀ z, (H z : ZMod a) = S.rhoA z.2) + (x : ℤ) (k : K) (c : A) (y : ZMod a) (δ : Δ) : + blockForward D S H x k (k - D.decode.symm (.inl (c, y)), δ) = + ((y + (S.e δ).1, (S.e δ).2), + D.decode.symm (.inl (c, y + (x : ZMod a) - S.rhoA δ))) := by + simp [blockForward, Int.cast_sub, hA, add_sub_assoc] + apply Prod.ext <;> simp + +theorem blockForward_inr (D : LabeledBlocks K A B a b) (S : BlockShiftData Δ a b) + (H : K × Δ → ℤ) (hB : ∀ z, (H z : ZMod b) = S.rhoB z.2) + (x : ℤ) (k : K) (c : B) (y : ZMod b) (δ : Δ) : + blockForward D S H x k (k - D.decode.symm (.inr (c, y)), δ) = + (((S.e δ).1, y + (S.e δ).2), + D.decode.symm (.inr (c, y + (x : ZMod b) - S.rhoB δ))) := by + simp [blockForward, Int.cast_sub, hB, add_sub_assoc] + apply Prod.ext <;> simp + +theorem recoverA (S : BlockShiftData Δ a b) (δ : Δ) (y t : ZMod a) : + S.orderA.symm ((S.e δ).2, (y + (S.e δ).1) + t - + (y + t - S.rhoA δ)) = δ := by + apply S.orderA.injective + rw [Equiv.apply_symm_apply, S.orderA_apply] + apply Prod.ext + · rfl + · abel_nf + +theorem recoverB (S : BlockShiftData Δ a b) (δ : Δ) (y t : ZMod b) : + S.orderB.symm ((S.e δ).1, (y + (S.e δ).2) + t - + (y + t - S.rhoB δ)) = δ := by + apply S.orderB.injective + rw [Equiv.apply_symm_apply, S.orderB_apply] + apply Prod.ext + · rfl + · abel_nf + +theorem blockInverse_forward_inl (D : LabeledBlocks K A B a b) + (S : BlockShiftData Δ a b) (H : K × Δ → ℤ) + (hA : ∀ z, (H z : ZMod a) = S.rhoA z.2) + (x : ℤ) (k : K) (c : A) (y : ZMod a) (δ : Δ) : + blockInverse D S x k + (blockForward D S H x k (k - D.decode.symm (.inl (c, y)), δ)) = + (k - D.decode.symm (.inl (c, y)), δ) := by + rw [blockForward_inl D S H hA, blockInverse_inl] + simp only [recoverA] + simp + +theorem blockInverse_forward_inr (D : LabeledBlocks K A B a b) + (S : BlockShiftData Δ a b) (H : K × Δ → ℤ) + (hB : ∀ z, (H z : ZMod b) = S.rhoB z.2) + (x : ℤ) (k : K) (c : B) (y : ZMod b) (δ : Δ) : + blockInverse D S x k + (blockForward D S H x k (k - D.decode.symm (.inr (c, y)), δ)) = + (k - D.decode.symm (.inr (c, y)), δ) := by + rw [blockForward_inr D S H hB, blockInverse_inr] + simp only [recoverB] + simp + +theorem blockInverse_forward (D : LabeledBlocks K A B a b) + (S : BlockShiftData Δ a b) (H : K × Δ → ℤ) + (hA : ∀ z, (H z : ZMod a) = S.rhoA z.2) + (hB : ∀ z, (H z : ZMod b) = S.rhoB z.2) + (x : ℤ) (k : K) : + Function.LeftInverse (blockInverse D S x k) (blockForward D S H x k) := by + rintro ⟨l, δ⟩ + cases he : D.decode (k - l) with + | inl v => + rcases v with ⟨c, y⟩ + have hu : D.decode.symm (.inl (c, y)) = k - l := by + simpa only [he] using D.decode.symm_apply_apply (k - l) + simpa only [hu, sub_sub_cancel] using blockInverse_forward_inl D S H hA x k c y δ + | inr v => + rcases v with ⟨c, y⟩ + have hu : D.decode.symm (.inr (c, y)) = k - l := by + simpa only [he] using D.decode.symm_apply_apply (k - l) + simpa only [hu, sub_sub_cancel] using blockInverse_forward_inr D S H hB x k c y δ + +theorem blockForward_inverse_inl (D : LabeledBlocks K A B a b) + (S : BlockShiftData Δ a b) (H : K × Δ → ℤ) + (hA : ∀ z, (H z : ZMod a) = S.rhoA z.2) + (x : ℤ) (k : K) (α : ZMod a) (ξ : ZMod b) (c : A) (q : ZMod a) : + blockForward D S H x k + (blockInverse D S x k ((α, ξ), D.decode.symm (.inl (c, q)))) = + ((α, ξ), D.decode.symm (.inl (c, q))) := by + let δ := S.orderA.symm (ξ, α + (x : ZMod a) - q) + have horder : ((S.e δ).2, (S.e δ).1 + S.rhoA δ) = + (ξ, α + (x : ZMod a) - q) := + (S.orderA_apply δ).symm.trans (S.orderA.apply_symm_apply _) + have he : (S.e δ).2 = ξ := congrArg Prod.fst horder + have hr : (S.e δ).1 + S.rhoA δ = α + (x : ZMod a) - q := + congrArg Prod.snd horder + have hlabel : (α - (S.e δ).1) + (x : ZMod a) - S.rhoA δ = q := by + calc + _ = (α + (x : ZMod a)) - ((S.e δ).1 + S.rhoA δ) := by abel + _ = (α + (x : ZMod a)) - (α + (x : ZMod a) - q) := by rw [hr] + _ = q := sub_sub_cancel _ _ + rw [blockInverse_inl] + change blockForward D S H x k + (k - D.decode.symm (.inl (c, α - (S.e δ).1)), δ) = _ + rw [blockForward_inl D S H hA] + simp only [sub_add_cancel, he, hlabel] + +theorem blockForward_inverse_inr (D : LabeledBlocks K A B a b) + (S : BlockShiftData Δ a b) (H : K × Δ → ℤ) + (hB : ∀ z, (H z : ZMod b) = S.rhoB z.2) + (x : ℤ) (k : K) (α : ZMod a) (ξ : ZMod b) (c : B) (q : ZMod b) : + blockForward D S H x k + (blockInverse D S x k ((α, ξ), D.decode.symm (.inr (c, q)))) = + ((α, ξ), D.decode.symm (.inr (c, q))) := by + let δ := S.orderB.symm (α, ξ + (x : ZMod b) - q) + have horder : ((S.e δ).1, (S.e δ).2 + S.rhoB δ) = + (α, ξ + (x : ZMod b) - q) := + (S.orderB_apply δ).symm.trans (S.orderB.apply_symm_apply _) + have he : (S.e δ).1 = α := congrArg Prod.fst horder + have hr : (S.e δ).2 + S.rhoB δ = ξ + (x : ZMod b) - q := + congrArg Prod.snd horder + have hlabel : (ξ - (S.e δ).2) + (x : ZMod b) - S.rhoB δ = q := by + calc + _ = (ξ + (x : ZMod b)) - ((S.e δ).2 + S.rhoB δ) := by abel + _ = (ξ + (x : ZMod b)) - (ξ + (x : ZMod b) - q) := by rw [hr] + _ = q := sub_sub_cancel _ _ + rw [blockInverse_inr] + change blockForward D S H x k + (k - D.decode.symm (.inr (c, ξ - (S.e δ).2)), δ) = _ + rw [blockForward_inr D S H hB] + simp only [sub_add_cancel, he, hlabel] + +theorem blockForward_inverse (D : LabeledBlocks K A B a b) + (S : BlockShiftData Δ a b) (H : K × Δ → ℤ) + (hA : ∀ z, (H z : ZMod a) = S.rhoA z.2) + (hB : ∀ z, (H z : ZMod b) = S.rhoB z.2) + (x : ℤ) (k : K) : + Function.RightInverse (blockInverse D S x k) (blockForward D S H x k) := by + rintro ⟨⟨α, ξ⟩, β⟩ + cases he : D.decode β with + | inl v => + rcases v with ⟨c, q⟩ + have hβ : D.decode.symm (.inl (c, q)) = β := by + simpa only [he] using D.decode.symm_apply_apply β + simpa only [hβ] using blockForward_inverse_inl D S H hA x k α ξ c q + | inr v => + rcases v with ⟨c, q⟩ + have hβ : D.decode.symm (.inr (c, q)) = β := by + simpa only [he] using D.decode.symm_apply_apply β + simpa only [hβ] using blockForward_inverse_inr D S H hB x k α ξ c q + +def blockInverseEquiv (D : LabeledBlocks K A B a b) (S : BlockShiftData Δ a b) + (H : K × Δ → ℤ) (hA : ∀ z, (H z : ZMod a) = S.rhoA z.2) + (hB : ∀ z, (H z : ZMod b) = S.rhoB z.2) (x : ℤ) (k : K) : + (K × Δ) ≃ ((ZMod a × ZMod b) × K) where + toFun := blockForward D S H x k + invFun := blockInverse D S x k + left_inv := blockInverse_forward D S H hA hB x k + right_inv := blockForward_inverse D S H hA hB x k + +@[simp] theorem blockInverseEquiv_apply (D : LabeledBlocks K A B a b) + (S : BlockShiftData Δ a b) (H : K × Δ → ℤ) + (hA : ∀ z, (H z : ZMod a) = S.rhoA z.2) + (hB : ∀ z, (H z : ZMod b) = S.rhoB z.2) (x : ℤ) (k : K) (z : K × Δ) : + blockInverseEquiv D S H hA hB x k z = + (D.C (k - z.1) + S.e z.2, D.T (x - H z) (k - z.1)) := rfl + +@[simp] theorem blockInverseEquiv_symm_apply (D : LabeledBlocks K A B a b) + (S : BlockShiftData Δ a b) (H : K × Δ → ℤ) + (hA : ∀ z, (H z : ZMod a) = S.rhoA z.2) + (hB : ∀ z, (H z : ZMod b) = S.rhoB z.2) + (x : ℤ) (k : K) (v : (ZMod a × ZMod b) × K) : + (blockInverseEquiv D S H hA hB x k).symm v = blockInverse D S x k v := rfl + +end BlockShiftData + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/BoundedDifferences.lean b/lean/OAI/Geometry/PeriodicTiling/BoundedDifferences.lean new file mode 100644 index 0000000000000000000000000000000000000000..e8cb0744630e8dd61730ddf6d04b6ae51a31ab40 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/BoundedDifferences.lean @@ -0,0 +1,99 @@ +import OAI.Geometry.PeriodicTiling.ConfigurationDifferences +import OAI.Geometry.PeriodicTiling.ForwardDifference +import Mathlib.Algebra.Order.Archimedean.Real.Basic +import Mathlib.Tactic.Linarith + +namespace OAI + +universe uG uA + +namespace PeriodicTilingThree + +variable {G : Type uG} [AddCommGroup G] + +theorem configDiff_bounded (v : G) (f : G → ℝ) + (hf : ∃ B : ℝ, ∀ x, |f x| ≤ B) : + ∃ B : ℝ, ∀ x, |configDiff v f x| ≤ B := by + obtain ⟨B, hB⟩ := hf + refine ⟨B + B, fun x => ?_⟩ + calc + |configDiff v f x| = |f (x + v) + -f x| := rfl + _ ≤ |f (x + v)| + |-f x| := abs_add_le _ _ + _ = |f (x + v)| + |f x| := by rw [abs_neg] + _ ≤ B + B := add_le_add (hB _) (hB _) + +theorem configDiff_eq_zero_of_second (v : G) (f : G → ℝ) + (hf : ∃ B : ℝ, ∀ x, |f x| ≤ B) + (hsecond : configDiff v (configDiff v f) = 0) : configDiff v f = 0 := by + obtain ⟨B, hB⟩ := hf + let g := configDiff v f + have hg : Function.Periodic g v := (configDiff_eq_zero_iff v g).mp hsecond + ext x + have hg_nat : ∀ n : ℕ, g (x + n • v) = g x := by + intro n + induction n with + | zero => simp + | succ n ih => + simpa only [succ_nsmul, ← add_assoc] using (hg (x + n • v)).trans ih + have hf_nat : ∀ n : ℕ, f (x + n • v) = f x + (n : ℝ) * g x := by + intro n + induction n with + | zero => simp + | succ n ih => + have hd := hg_nat n + change f (x + n • v + v) - f (x + n • v) = g x at hd + simp only [succ_nsmul, ← add_assoc, Nat.cast_add, Nat.cast_one] + linarith + have hx := abs_le.mp (hB x) + have hz : g x = 0 := by + rcases lt_trichotomy (g x) 0 with hneg | hzero | hpos + · obtain ⟨n, hn⟩ := exists_nat_gt (2 * B / (-g x)) + have hn' : 2 * B < (n : ℝ) * (-g x) := + (div_lt_iff₀ (neg_pos.mpr hneg)).mp hn + have hy := abs_le.mp (hB (x + n • v)) + have he := hf_nat n + nlinarith + · exact hzero + · obtain ⟨n, hn⟩ := exists_nat_gt (2 * B / g x) + have hn' : 2 * B < (n : ℝ) * g x := (div_lt_iff₀ hpos).mp hn + have hy := abs_le.mp (hB (x + n • v)) + have he := hf_nat n + nlinarith + exact hz + +theorem configDiff_eq_zero_of_iterate (v : G) (n : ℕ) (f : G → ℝ) + (hf : ∃ B : ℝ, ∀ x, |f x| ≤ B) + (hn : 0 < n) (hiter : (configDiff v)^[n] f = 0) : + configDiff v f = 0 := by + induction n generalizing f with + | zero => exact (Nat.not_lt_zero _ hn).elim + | succ n ih => + cases n with + | zero => + change configDiff v f = 0 at hiter + exact hiter + | succ n => + have hnext : (configDiff v)^[n + 1] (configDiff v f) = 0 := by + simpa only [Function.iterate_succ_apply] using hiter + have hsecond : configDiff v (configDiff v f) = 0 := + ih (configDiff v f) (configDiff_bounded v f hf) (Nat.succ_pos _) hnext + exact configDiff_eq_zero_of_second v f hf hsecond + +theorem periodic_of_bounded_configDiff_iterate (v : G) (n : ℕ) (f : G → ℝ) + (hf : ∃ B : ℝ, ∀ x, |f x| ≤ B) + (hn : 0 < n) (hiter : (configDiff v)^[n] f = 0) : + Function.Periodic f v := + (configDiff_eq_zero_iff v f).mp (configDiff_eq_zero_of_iterate v n f hf hn hiter) + +theorem forwardDiff_eq_configDiff {A : Type uA} [AddCommGroup A] : + (forwardDiff : (ℤ → A) → ℤ → A) = configDiff (1 : ℤ) := rfl + +theorem forwardDiff_eq_zero_of_bounded_iterate (n : ℕ) (f : ℤ → ℝ) + (hf : ∃ B : ℝ, ∀ x, |f x| ≤ B) + (hn : 0 < n) (hiter : (forwardDiff^[n]) f = 0) : forwardDiff f = 0 := by + rw [forwardDiff_eq_configDiff] at hiter ⊢ + exact configDiff_eq_zero_of_iterate 1 n f hf hn hiter + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/CenterFiniteness.lean b/lean/OAI/Geometry/PeriodicTiling/CenterFiniteness.lean new file mode 100644 index 0000000000000000000000000000000000000000..99d4fd56a886dd4adfb6b22b2fff612237ab5c1b --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/CenterFiniteness.lean @@ -0,0 +1,81 @@ +import OAI.Geometry.PeriodicTiling.EuclideanBasic +import Mathlib.Algebra.Order.Floor.Ring +import Mathlib.Analysis.Normed.Group.Bounded +import Mathlib.Data.Int.Interval +import Mathlib.Data.Pi.Interval +import Mathlib.Data.Set.Countable +import Mathlib.Tactic.Linarith + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree + +def centerBoxIndex {n : ℕ} (r : ℝ) (x : Space n) : Lattice n := + fun i => ⌊x i / r⌋ + +theorem norm_sub_lt_of_centerBoxIndex_eq {n : ℕ} {r : ℝ} (hr : 0 < r) + {x y : Space n} (hxy : centerBoxIndex r x = centerBoxIndex r y) : + ‖x - y‖ < r := by + apply (pi_norm_lt_iff hr).mpr + intro i + have heq : ⌊x i / r⌋ = ⌊y i / r⌋ := congrFun hxy i + have hxl := Int.floor_le (x i / r) + have hxu := Int.lt_floor_add_one (x i / r) + have hyl := Int.floor_le (y i / r) + have hyu := Int.lt_floor_add_one (y i / r) + rw [← heq] at hyl hyu + have hxl' := (le_div_iff₀ hr).mp hxl + have hxu' := (div_lt_iff₀ hr).mp hxu + have hyl' := (le_div_iff₀ hr).mp hyl + have hyu' := (div_lt_iff₀ hr).mp hyu + simp only [Pi.sub_apply, Real.norm_eq_abs] + apply abs_lt.mpr + constructor <;> nlinarith + +theorem centerBoxIndex_injOn {n : ℕ} {C : Set (Space n)} {r : ℝ} + (hr : 0 < r) (hsep : C.Pairwise (fun x y => r ≤ ‖x - y‖)) : + Set.InjOn (centerBoxIndex r) C := by + intro x hx y hy hxy + by_contra hne + exact (not_lt_of_ge (hsep hx hy hne)) (norm_sub_lt_of_centerBoxIndex_eq hr hxy) + +theorem centers_countable {n : ℕ} {C : Set (Space n)} {r : ℝ} + (hr : 0 < r) (hsep : C.Pairwise (fun x y => r ≤ ‖x - y‖)) : C.Countable := by + apply Set.countable_of_injective_of_countable_image (centerBoxIndex_injOn hr hsep) + exact Set.to_countable _ + +theorem centerBoxIndex_image_finite {n : ℕ} {r : ℝ} (hr : 0 < r) + {K : Set (Space n)} (hK : Bornology.IsBounded K) : + (centerBoxIndex r '' K).Finite := by + obtain ⟨R, hR⟩ := hK.exists_norm_le + let lo : Lattice n := fun _ => ⌊-R / r⌋ + let hi : Lattice n := fun _ => ⌊R / r⌋ + apply (Set.finite_Icc lo hi).subset + rintro z ⟨x, hx, rfl⟩ + have hcoord (i : Fin n) : |x i| ≤ R := by + calc + |x i| = ‖x i‖ := by simp only [Real.norm_eq_abs] + _ ≤ ‖x‖ := norm_le_pi_norm x i + _ ≤ R := hR x hx + constructor + · intro i + change ⌊-R / r⌋ ≤ ⌊x i / r⌋ + exact Int.floor_mono (div_le_div_of_nonneg_right (abs_le.mp (hcoord i)).1 hr.le) + · intro i + change ⌊x i / r⌋ ≤ ⌊R / r⌋ + exact Int.floor_mono (div_le_div_of_nonneg_right (abs_le.mp (hcoord i)).2 hr.le) + +theorem centers_finite_on_bounded {n : ℕ} {C K : Set (Space n)} {r : ℝ} + (hr : 0 < r) (hsep : C.Pairwise (fun x y => r ≤ ‖x - y‖)) + (hK : Bornology.IsBounded K) : (C ∩ K).Finite := by + have hfin : (centerBoxIndex r '' (C ∩ K)).Finite := + (centerBoxIndex_image_finite hr hK).subset (Set.image_mono Set.inter_subset_right) + exact hfin.of_finite_image ((centerBoxIndex_injOn hr hsep).mono Set.inter_subset_left) + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/ChannelDigitBlocks.lean b/lean/OAI/Geometry/PeriodicTiling/ChannelDigitBlocks.lean new file mode 100644 index 0000000000000000000000000000000000000000..a7e0b2da4128842ee567190d5eea2063effb7c3d --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/ChannelDigitBlocks.lean @@ -0,0 +1,131 @@ +import OAI.Geometry.PeriodicTiling.LabeledDigitBlocks +import OAI.Geometry.PeriodicTiling.CyclicCRT + +namespace OAI + +universe uK uA uB uL uJ uF + +noncomputable section + +namespace PeriodicTilingThree + +variable {p : ℕ} [NeZero p] (E : EncodingParameters p) + +abbrev ChannelOtherDigits (i : Channel p) (j : Label p i) := + ∀ q : {q : Label p i // q ≠ j}, ZMod (E.digitPrime i q) + +abbrev ChannelBlockA (i : Channel p) (j : Label p i) := + Fin (E.blockA i j) × ChannelOtherDigits E i j + +abbrev ChannelBlockB (i : Channel p) (j : Label p i) := + Fin (E.blockB i j) × ChannelOtherDigits E i j + +def channelDigitBase (i : Channel p) (j : Label p i) : + LabeledBlocks (ZMod (E.digitPrime i j)) (Fin (E.blockA i j)) + (Fin (E.blockB i j)) (E.a i) (E.b i) := + LabeledBlocks.digit (E.a i) (E.b i) (E.digitPrime i j) + (E.blockA i j) (E.blockB i j) (E.digit_eq i j) + +def channelDigitBlocks (i : Channel p) (j : Label p i) : + LabeledBlocks (ZMod (E.r i)) (ChannelBlockA E i j) + (ChannelBlockB E i j) (E.a i) (E.b i) := + (LabeledBlocks.onCoordinate (fun q => ZMod (E.digitPrime i q)) j + (channelDigitBase E i j)).transport (digitEquiv E i).toEquiv + +@[simp] theorem channelDigitBlocks_C (i : Channel p) (j : Label p i) + (w : ZMod (E.r i)) : + (channelDigitBlocks E i j).C w = + (channelDigitBase E i j).C (digitEquiv E i w j) := by + simp [channelDigitBlocks] + +theorem channelDigitBlocks_C_eq (i : Channel p) (j : Label p i) + {w w' : ZMod (E.r i)} (h : digitEquiv E i w j = digitEquiv E i w' j) : + (channelDigitBlocks E i j).C w = (channelDigitBlocks E i j).C w' := by + simp only [channelDigitBlocks_C, h] + +theorem channelDigitBlocks_active_iff (i : Channel p) (j q : Label p i) : + (∃ w w' : ZMod (E.r i), w - w' ∈ digitSubgroup E i q ∧ + (channelDigitBlocks E i j).C w ≠ (channelDigitBlocks E i j).C w') ↔ q = j := by + constructor + · rintro ⟨w, w', hdiff, hne⟩ + by_contra hq + apply hne + exact channelDigitBlocks_C_eq E i j + ((sub_mem_digitSubgroup_iff E i q w w').1 hdiff j (Ne.symm hq)) + · intro hq + subst q + let : Fact (1 < E.a i) := ⟨(E.a_prime i).one_lt⟩ + let : Fact (1 < E.b i) := ⟨(E.b_prime i).one_lt⟩ + obtain ⟨x, y, hxy, hne⟩ := + LabeledBlocks.C_designated_witness (fun q => ZMod (E.digitPrime i q)) j + (channelDigitBase E i j) + refine ⟨(digitEquiv E i).symm x, (digitEquiv E i).symm y, ?_, ?_⟩ + · apply (sub_mem_digitSubgroup_iff E i j _ _).2 + simpa only [AddEquiv.apply_symm_apply] using hxy + · simpa only [channelDigitBlocks_C, AddEquiv.apply_symm_apply, + LabeledBlocks.C_onCoordinate] using hne + +namespace LabeledBlocks + +def castSizes {K : Type uK} {A : Type uA} {B : Type uB} {a b a' b' : ℕ} + (D : LabeledBlocks K A B a b) + (ha : a = a') (hb : b = b') : LabeledBlocks K A B a' b' := by + subst a' + subst b' + exact D + +@[simp] theorem T_transport_apply {K : Type uK} {L : Type uL} {A : Type uA} {B : Type uB} {a b : ℕ} + (D : LabeledBlocks K A B a b) (e : L ≃ K) (t : ℤ) (x : L) : + (D.transport e).T t x = e.symm (D.T t (e x)) := rfl + +theorem T_onCoordinate {J : Type uJ} [DecidableEq J] (F : J → Type uF) (j : J) + {A : Type uA} {B : Type uB} {a b : ℕ} (D : LabeledBlocks (F j) A B a b) (t : ℤ) (x : ∀ q, F q) : + (onCoordinate F j D).T t x = + (Equiv.piSplitAt j F).symm (D.T t (x j), fun q => x q) := by + rw [onCoordinate, T_transport_apply, T_copyRight] + rfl + +theorem T_onCoordinate_other {J : Type uJ} [DecidableEq J] (F : J → Type uF) (j : J) + {A : Type uA} {B : Type uB} {a b : ℕ} (D : LabeledBlocks (F j) A B a b) (t : ℤ) + (x : ∀ q, F q) (q : J) (hq : q ≠ j) : + (onCoordinate F j D).T t x q = x q := by + rw [T_onCoordinate] + simp [Equiv.piSplitAt, hq] + +theorem T_onCoordinate_transport_other {J : Type uJ} {L : Type uL} [DecidableEq J] + (F : J → Type uF) (j : J) {A : Type uA} {B : Type uB} {a b : ℕ} + (D : LabeledBlocks (F j) A B a b) (e : L ≃ (∀ q, F q)) (t : ℤ) + (x : L) (q : J) (hq : q ≠ j) : + e (((onCoordinate F j D).transport e).T t x) q = e x q := by + rw [T_transport_apply, Equiv.apply_symm_apply] + exact T_onCoordinate_other F j D t (e x) q hq + +end LabeledBlocks + +theorem channelDigitBlocks_T_other (i : Channel p) (j : Label p i) (t : ℤ) + (w : ZMod (E.r i)) (q : Label p i) (hq : q ≠ j) : + digitEquiv E i ((channelDigitBlocks E i j).T t w) q = digitEquiv E i w q := by + simpa only [channelDigitBlocks, AddEquiv.toEquiv_eq_coe, AddEquiv.coe_toEquiv] using + (LabeledBlocks.T_onCoordinate_transport_other + (fun q : Label p i => ZMod (E.digitPrime i q)) j + (channelDigitBase E i j) (digitEquiv E i).toEquiv t w q hq) + +def seedOneBlocks : + LabeledBlocks (ZMod (E.r (.inr (0 : Fin 2)))) + (ChannelBlockA E (.inr 0) ()) (ChannelBlockB E (.inr 0) ()) + 2 (E.b (.inr 0)) := + (channelDigitBlocks E (.inr 0) ()).castSizes + (by simpa using E.seed_a (0 : Fin 2)) rfl + +def seedTwoBlocks : + LabeledBlocks (ZMod (E.r (.inr (1 : Fin 2)))) + (ChannelBlockA E (.inr 1) ()) (ChannelBlockB E (.inr 1) ()) + 3 (E.b (.inr 1)) := + (channelDigitBlocks E (.inr 1) ()).castSizes + (by simpa using E.seed_a (1 : Fin 2)) rfl + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/CircleWeylCriterion.lean b/lean/OAI/Geometry/PeriodicTiling/CircleWeylCriterion.lean new file mode 100644 index 0000000000000000000000000000000000000000..57d70371a35587dfe4289bb6a944fc8db8d26b09 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/CircleWeylCriterion.lean @@ -0,0 +1,168 @@ +import OAI.Geometry.PeriodicTiling.ScalarAverage +import Mathlib.Analysis.Fourier.AddCircle + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree + +open Filter MeasureTheory Set +open scoped Topology + +private instance unitPeriodPositive : Fact (0 < (1 : ℝ)) := ⟨zero_lt_one⟩ + +abbrev UnitAddCircle := AddCircle (1 : ℝ) + +def CircleFourierCancellation (u : ℕ → UnitAddCircle) : Prop := + ∀ k : ℤ, k ≠ 0 → + Tendsto (complexAverage (fun n => fourier k (u n))) atTop (𝓝 0) + +private theorem circle_continuous_integrable (f : C(UnitAddCircle, ℂ)) : + Integrable f AddCircle.haarAddCircle := + f.continuous.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace f) + +private theorem circle_integral_fourier (k : ℤ) : + (∫ x : UnitAddCircle, fourier k x ∂AddCircle.haarAddCircle) = + if k = 0 then 1 else 0 := by + split_ifs with hk + · subst k + simp only [fourier_zero, integral_const, probReal_univ, one_smul] + · exact integral_eq_zero_of_add_right_eq_neg + (μ := AddCircle.haarAddCircle) + (fourier_add_half_inv_index hk (show (0 : ℝ) < 1 from zero_lt_one)) + +private theorem circle_integral_norm_le (f : C(UnitAddCircle, ℂ)) : + ‖∫ x, f x ∂AddCircle.haarAddCircle‖ ≤ ‖f‖ := by + simpa only [probReal_univ, mul_one] using + (norm_integral_le_of_norm_le_const + (μ := AddCircle.haarAddCircle) + (Filter.Eventually.of_forall fun x => f.norm_coe_le_norm x)) + +private theorem circle_average_norm_le (u : ℕ → UnitAddCircle) + (f : C(UnitAddCircle, ℂ)) (N : ℕ) : + ‖complexAverage (fun n => f (u n)) N‖ ≤ ‖f‖ := + norm_complexAverage_le _ _ (norm_nonneg f) (fun n => f.norm_coe_le_norm (u n)) N + +private def circleAveragingSubmodule (u : ℕ → UnitAddCircle) : + Submodule ℂ C(UnitAddCircle, ℂ) where + carrier := {f | Tendsto (complexAverage (fun n => f (u n))) atTop + (𝓝 (∫ x, f x ∂AddCircle.haarAddCircle))} + zero_mem' := by + change Tendsto (complexAverage (fun _ => (0 : ℂ))) atTop + (𝓝 (∫ _ : UnitAddCircle, (0 : ℂ) ∂AddCircle.haarAddCircle)) + have hz : complexAverage (fun _ => (0 : ℂ)) = fun _ => 0 := by + funext N + simp [complexAverage] + rw [hz, integral_zero] + exact tendsto_const_nhds + add_mem' := by + intro f g hf hg + change Tendsto (complexAverage (fun n => f (u n) + g (u n))) atTop + (𝓝 (∫ x, f x + g x ∂AddCircle.haarAddCircle)) + have ha : complexAverage (fun n => f (u n) + g (u n)) = + fun N => complexAverage (fun n => f (u n)) N + + complexAverage (fun n => g (u n)) N := by + funext N + exact complexAverage_add _ _ N + rw [ha, integral_add (circle_continuous_integrable f) (circle_continuous_integrable g)] + exact hf.add hg + smul_mem' := by + intro c f hf + change Tendsto (complexAverage (fun n => c * f (u n))) atTop + (𝓝 (∫ x, c * f x ∂AddCircle.haarAddCircle)) + have ha : complexAverage (fun n => c * f (u n)) = + fun N => c * complexAverage (fun n => f (u n)) N := by + funext N + exact complexAverage_const_mul _ _ N + rw [ha, integral_const_mul] + exact hf.const_mul c + +private theorem fourier_mem_circleAveragingSubmodule (u : ℕ → UnitAddCircle) + (hu : CircleFourierCancellation u) (k : ℤ) : + fourier k ∈ circleAveragingSubmodule u := by + change Tendsto _ atTop (𝓝 _) + rw [circle_integral_fourier] + by_cases hk : k = 0 + · subst k + simp only [ite_true, fourier_zero] + apply tendsto_const_nhds.congr' + filter_upwards [Filter.eventually_ge_atTop (1 : ℕ)] with N hN + exact (complexAverage_const 1 (Nat.ne_of_gt (lt_of_lt_of_le Nat.zero_lt_one hN))).symm + · simpa only [ite_eq_right hk] using hu k hk + +theorem circle_averages_tendsto_integral (u : ℕ → UnitAddCircle) + (hu : CircleFourierCancellation u) (f : C(UnitAddCircle, ℂ)) : + Tendsto (complexAverage (fun n => f (u n))) atTop + (𝓝 (∫ x, f x ∂AddCircle.haarAddCircle)) := by + have hspan : Submodule.span ℂ (Set.range (@fourier (1 : ℝ))) ≤ + circleAveragingSubmodule u := by + apply Submodule.span_le.mpr + rintro _ ⟨k, rfl⟩ + exact fourier_mem_circleAveragingSubmodule u hu k + have hdense : Dense (Submodule.span ℂ (Set.range (@fourier (1 : ℝ))) : + Set C(UnitAddCircle, ℂ)) := + Submodule.dense_iff_topologicalClosure_eq_top.mpr span_fourier_closure_eq_top + apply Metric.tendsto_nhds.mpr + intro ε hε + obtain ⟨p, hp, hfp⟩ := hdense.exists_dist_lt f (show 0 < ε / 4 by positivity) + have hpconv := hspan hp + change Tendsto (complexAverage (fun n => p (u n))) atTop + (𝓝 (∫ x, p x ∂AddCircle.haarAddCircle)) at hpconv + filter_upwards [Metric.tendsto_nhds.mp hpconv (ε / 2) (by positivity)] with N hN + have havg : ‖complexAverage (fun n => f (u n)) N - + complexAverage (fun n => p (u n)) N‖ ≤ ‖f - p‖ := by + rw [← complexAverage_sub] + exact circle_average_norm_le u (f - p) N + have hint : ‖(∫ x, p x ∂AddCircle.haarAddCircle) - + (∫ x, f x ∂AddCircle.haarAddCircle)‖ ≤ ‖f - p‖ := by + rw [← integral_sub (circle_continuous_integrable p) (circle_continuous_integrable f)] + simpa only [ContinuousMap.sub_apply, norm_sub_rev] using circle_integral_norm_le (p - f) + have hbound := norm_add_le + (complexAverage (fun n => f (u n)) N - complexAverage (fun n => p (u n)) N) + (complexAverage (fun n => p (u n)) N - (∫ x, f x ∂AddCircle.haarAddCircle)) + have hbound' := norm_add_le + (complexAverage (fun n => p (u n)) N - (∫ x, p x ∂AddCircle.haarAddCircle)) + ((∫ x, p x ∂AddCircle.haarAddCircle) - (∫ x, f x ∂AddCircle.haarAddCircle)) + simp only [sub_add_sub_cancel] at hbound hbound' + rw [dist_eq_norm] at hfp hN ⊢ + linarith + +theorem denseRange_of_circleFourierCancellation (u : ℕ → UnitAddCircle) + (hu : CircleFourierCancellation u) : DenseRange u := by + rw [Metric.denseRange_iff] + intro x r hr + by_contra h + have haway : ∀ n, r ≤ dist x (u n) := + fun n => le_of_not_gt (fun hn => h ⟨n, hn⟩) + let b : C(UnitAddCircle, ℝ) := + ⟨fun y => max (r - dist x y) 0, + (continuous_const.sub (continuous_const.dist continuous_id)).max continuous_const⟩ + have hb0 : ∀ n, b (u n) = 0 := by + intro n + exact max_eq_right (sub_nonpos.mpr (haway n)) + have hbx : b x ≠ 0 := by simpa [b, dist_self, max_eq_left hr.le] using hr.ne' + have hbnonneg : (0 : UnitAddCircle → ℝ) ≤ b := fun y => le_max_right _ _ + have hbint : 0 < ∫ y, b y ∂AddCircle.haarAddCircle := + b.continuous.integral_pos_of_hasCompactSupport_nonneg_nonzero + (HasCompactSupport.of_compactSpace b) hbnonneg hbx + let bc : C(UnitAddCircle, ℂ) := ⟨fun y => (b y : ℂ), Complex.continuous_ofReal.comp b.continuous⟩ + have hlim := circle_averages_tendsto_integral u hu bc + have havgzero : complexAverage (fun n => bc (u n)) = fun _ => 0 := by + funext N + simp [complexAverage, bc, hb0] + rw [havgzero] at hlim + have hi : (∫ y, bc y ∂AddCircle.haarAddCircle) = 0 := + tendsto_nhds_unique hlim tendsto_const_nhds + have hir : (∫ y, b y ∂AddCircle.haarAddCircle) = 0 := by + apply Complex.ofReal_injective + change (∫ y, (b y : ℂ) ∂AddCircle.haarAddCircle) = 0 at hi + rw [integral_complex_ofReal] at hi + simpa only [Complex.ofReal_zero] using hi + linarith + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/ClosedBoxRounding.lean b/lean/OAI/Geometry/PeriodicTiling/ClosedBoxRounding.lean new file mode 100644 index 0000000000000000000000000000000000000000..8349fd90b3b3ce20015845f3ab959405bd34e0f8 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/ClosedBoxRounding.lean @@ -0,0 +1,116 @@ +import OAI.Geometry.PeriodicTiling.EuclideanBasic +import Mathlib.Algebra.Order.Floor.Ring +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.NormNum +import Lean.Elab.Tactic.Omega + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree + +private theorem floor_abs_le_nat {m : ℕ} {x : ℝ} (hx : |x| ≤ (m : ℝ)) : + |⌊x⌋| ≤ (m : ℤ) := by + apply abs_le.mpr + constructor + · apply Int.le_floor.mpr + exact_mod_cast (abs_le.mp hx).1 + · have hh : (⌊x⌋ : ℝ) ≤ (m : ℝ) := (Int.floor_le x).trans (abs_le.mp hx).2 + exact_mod_cast hh + +private theorem floor_error_lt_one (x : ℝ) : |x - (⌊x⌋ : ℝ)| < 1 := by + rw [abs_of_nonneg (sub_nonneg.mpr (Int.floor_le x))] + have := Int.lt_floor_add_one x + linarith + +private theorem floor_successor_error_lt_one {x : ℝ} (hx : x ≠ (⌊x⌋ : ℝ)) : + |x - ((⌊x⌋ + 1 : ℤ) : ℝ)| < 1 := by + have hlo : (⌊x⌋ : ℝ) < x := lt_of_le_of_ne (Int.floor_le x) hx.symm + have hhi := Int.lt_floor_add_one x + simp only [Int.cast_add, Int.cast_one] + apply abs_lt.mpr + constructor <;> linarith + +theorem closed_box_rounding_exists {n : ℕ} (m : ℕ) (hm : 2 ≤ m) (δ : Space n) + (hδ : ∀ i, |δ i| ≤ (m : ℝ)) + (hnot : ¬ ∃ z : Lattice n, δ = (m : ℝ) • castLattice z) : + ∃ z : Lattice n, + (∀ i, |z i| ≤ (m : ℤ)) ∧ + (∃ i, ¬ (m : ℤ) ∣ z i) ∧ + (∀ i, |δ i - (z i : ℝ)| < 1) := by + classical + let a : Lattice n := fun i => ⌊δ i⌋ + have habs (i : Fin n) : |a i| ≤ (m : ℤ) := floor_abs_le_nat (hδ i) + have herr (i : Fin n) : |δ i - (a i : ℝ)| < 1 := floor_error_lt_one (δ i) + by_cases hdiv : ∀ i, (m : ℤ) ∣ a i + · have hnonint : ∃ j, δ j ≠ (a j : ℝ) := by + by_contra h + have heq (i : Fin n) : δ i = (a i : ℝ) := by + by_contra hi + exact h ⟨i, hi⟩ + let z : Lattice n := fun i => Classical.choose (hdiv i) + have hz (i : Fin n) : a i = (m : ℤ) * z i := Classical.choose_spec (hdiv i) + apply hnot + refine ⟨z, ?_⟩ + funext i + change δ i = (m : ℝ) * (z i : ℝ) + rw [heq i] + exact_mod_cast hz i + obtain ⟨j, hj⟩ := hnonint + have hjstrict : (a j : ℝ) < δ j := lt_of_le_of_ne (Int.floor_le (δ j)) hj.symm + have hjlt : a j < (m : ℤ) := by + have hh : (a j : ℝ) < (m : ℝ) := hjstrict.trans_le (abs_le.mp (hδ j)).2 + exact_mod_cast hh + let z : Lattice n := Function.update a j (a j + 1) + refine ⟨z, ?_, ?_, ?_⟩ + · intro i + by_cases hij : i = j + · subst i + simp only [z, Function.update_self] + apply abs_le.mpr + have ha := (abs_le.mp (habs j)).1 + constructor <;> omega + · simpa only [z, Function.update_of_ne hij] using habs i + · refine ⟨j, ?_⟩ + simp only [z, Function.update_self] + intro hsucc + have hone : (m : ℤ) ∣ 1 := by + simpa using dvd_sub hsucc (hdiv j) + have hmle : (m : ℤ) ≤ 1 := Int.le_of_dvd (by norm_num : (0 : ℤ) < 1) hone + have hmtwo : (2 : ℤ) ≤ (m : ℤ) := by exact_mod_cast hm + omega + · intro i + by_cases hij : i = j + · subst i + simp only [z, Function.update_self] + exact floor_successor_error_lt_one hj + · simpa only [z, Function.update_of_ne hij] using herr i + · exact ⟨a, habs, not_forall.mp hdiv, herr⟩ + +theorem closed_box_rounding (m : ℕ) (hm : 2 ≤ m) (δ : Space 3) + (hδ : ∀ i, |δ i| ≤ (m : ℝ)) (hnot : δ ∉ scaledGrid m) : + ∃ z : Lattice 3, + (∀ i, |z i| ≤ (m : ℤ)) ∧ + (∃ i, ¬ (m : ℤ) ∣ z i) ∧ + (∀ i, |δ i - (z i : ℝ)| < 1) := by + apply closed_box_rounding_exists m hm δ hδ + rintro ⟨z, hz⟩ + exact hnot (mem_scaledGrid.mpr ⟨z, hz.symm⟩) + +theorem closed_box_rounding_norm (m : ℕ) (hm : 2 ≤ m) (δ : Space 3) + (hδ : ∀ i, |δ i| ≤ (m : ℝ)) (hnot : δ ∉ scaledGrid m) : + ∃ z : Lattice 3, + (∀ i, |z i| ≤ (m : ℤ)) ∧ + (∃ i, ¬ (m : ℤ) ∣ z i) ∧ + ‖δ - castLattice z‖ < 1 := by + obtain ⟨z, hz, hdiv, herr⟩ := closed_box_rounding m hm δ hδ hnot + refine ⟨z, hz, hdiv, (pi_norm_lt_iff (by norm_num : (0 : ℝ) < 1)).mpr ?_⟩ + intro i + simpa only [Pi.sub_apply, castLattice_apply, Real.norm_eq_abs] using herr i + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/ClosedCoverChains.lean b/lean/OAI/Geometry/PeriodicTiling/ClosedCoverChains.lean new file mode 100644 index 0000000000000000000000000000000000000000..78ba5dfd1889cee836718c2fe410659e86f424b4 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/ClosedCoverChains.lean @@ -0,0 +1,79 @@ +import Mathlib.Topology.Connected.Basic +import Mathlib.Topology.LocallyFinite +import Mathlib.MeasureTheory.Measure.OpenPos +import Mathlib.Logic.Relation + +namespace OAI + +universe uX uI + +namespace PeriodicTilingThree + +open Set MeasureTheory + +section Topological + +variable {X : Type uX} {I : Type uI} [TopologicalSpace X] [PreconnectedSpace X] + +def CoverIntersects (K : I → Set X) (i j : I) : Prop := + (K i ∩ K j).Nonempty + +theorem closed_cover_chain_connected (K : I → Set X) + (hne : ∀ i, (K i).Nonempty) (hclosed : ∀ i, IsClosed (K i)) + (hlocal : LocallyFinite K) (hcover : ∀ x : X, ∃ i, x ∈ K i) + (i₀ j : I) : Relation.ReflTransGen (CoverIntersects K) i₀ j := by + classical + let R : I → Prop := Relation.ReflTransGen (CoverIntersects K) i₀ + let A : Set X := ⋃ i : {i // R i}, K i.val + let B : Set X := ⋃ i : {i // ¬ R i}, K i.val + have hA : IsClosed A := + (hlocal.comp_injective (g := fun i : {i // R i} => i.val) + Subtype.val_injective).isClosed_iUnion (fun i => hclosed i.val) + have hB : IsClosed B := + (hlocal.comp_injective (g := fun i : {i // ¬ R i} => i.val) + Subtype.val_injective).isClosed_iUnion (fun i => hclosed i.val) + have hab : (univ : Set X) ⊆ A ∪ B := by + intro x _ + obtain ⟨i, hxi⟩ := hcover x + by_cases hi : R i + · exact Or.inl (mem_iUnion.mpr ⟨⟨i, hi⟩, hxi⟩) + · exact Or.inr (mem_iUnion.mpr ⟨⟨i, hi⟩, hxi⟩) + have hAnonempty : ((univ : Set X) ∩ A).Nonempty := by + obtain ⟨x, hx⟩ := hne i₀ + exact ⟨x, mem_univ x, + mem_iUnion.mpr ⟨⟨i₀, Relation.ReflTransGen.refl⟩, hx⟩⟩ + by_contra hj + have hBnonempty : ((univ : Set X) ∩ B).Nonempty := by + obtain ⟨x, hx⟩ := hne j + exact ⟨x, mem_univ x, mem_iUnion.mpr ⟨⟨j, hj⟩, hx⟩⟩ + obtain ⟨x, _, hxA, hxB⟩ := + isPreconnected_closed_iff.mp isPreconnected_univ A B hA hB hab hAnonempty hBnonempty + obtain ⟨i, hxi⟩ := mem_iUnion.mp hxA + obtain ⟨k, hxk⟩ := mem_iUnion.mp hxB + exact k.property (i.property.tail ⟨x, hxi, hxk⟩) + +end Topological + +section Measure + +variable {X : Type uX} {I : Type uI} [TopologicalSpace X] [MeasurableSpace X] +variable (μ : Measure X) [MeasureTheory.Measure.IsOpenPosMeasure μ] + +theorem closed_locallyFinite_cover_of_ae (K : I → Set X) + (hclosed : ∀ i, IsClosed (K i)) (hlocal : LocallyFinite K) + (hcover : ∀ᵐ x ∂μ, ∃ i, x ∈ K i) : ∀ x, ∃ i, x ∈ K i := by + have hc : IsClosed (⋃ i, K i) := hlocal.isClosed_iUnion hclosed + have hae : ∀ᵐ x ∂μ, x ∈ ⋃ i, K i := + hcover.mono fun _ hx => mem_iUnion.mpr hx + have hnull : μ (⋃ i, K i)ᶜ = 0 := mem_ae_iff.mp hae + have hempty : (⋃ i, K i)ᶜ = ∅ := + (hc.isOpen_compl.measure_eq_zero_iff μ).mp hnull + have huniv : (⋃ i, K i) = univ := Set.compl_empty_iff.mp hempty + intro x + exact mem_iUnion.mp (by rw [huniv]; exact mem_univ x) + +end Measure + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/CommonModel.lean b/lean/OAI/Geometry/PeriodicTiling/CommonModel.lean new file mode 100644 index 0000000000000000000000000000000000000000..09d34d2c6ada3f4ee5a7d639035e2a203ba36c6b --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/CommonModel.lean @@ -0,0 +1,100 @@ +import OAI.Geometry.PeriodicTiling.OrdinaryActivation +import OAI.Geometry.PeriodicTiling.CommonSeedOutputs +import OAI.Geometry.PeriodicTiling.Dependence + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree.CommonModel + +variable {p : ℕ} [NeZero p] (E : EncodingParameters p) + +def outputs : GraphOutputs E where + c b i := match i with + | .inl n => ordinaryUseful E n b.1 (b.2 (.inl n)) + | .inr t => seedC E t b.1 b.2 + beta b i := match i with + | .inl n => ordinaryHigh E n b.1 (b.2 (.inl n)) + | .inr t => seedBeta E t b.1 b.2 + z b := SharedSeed.commonZ E.p_prime E.p_large b.1 b.2 + +def commonGraph : Set (Ambient E) := graph (outputs E) + +@[simp] theorem outputs_c_ordinary (n : Column p) (x : Plane) (k : Input E) : + (outputs E).c (x,k) (.inl n) = ordinaryUseful E n x (k (.inl n)) := rfl + +@[simp] theorem outputs_c_seed (t : Fin 2) (x : Plane) (k : Input E) : + (outputs E).c (x,k) (.inr t) = seedC E t x k := rfl + +@[simp] theorem outputs_beta_ordinary (n : Column p) (x : Plane) (k : Input E) : + (outputs E).beta (x,k) (.inl n) = ordinaryHigh E n x (k (.inl n)) := rfl + +@[simp] theorem outputs_beta_seed (t : Fin 2) (x : Plane) (k : Input E) : + (outputs E).beta (x,k) (.inr t) = seedBeta E t x k := rfl + +@[simp] theorem outputs_z (x : Plane) (k : Input E) : + (outputs E).z (x,k) = SharedSeed.commonZ E.p_prime E.p_large x k := rfl + +@[simp] theorem usefulAt_ordinary (n : Column p) (x : Plane) (w : K E (.inl n)) : + usefulAt E (outputs E) (.inl n) x w = ordinaryUseful E n x w := by + simp [usefulAt] + +@[simp] theorem usefulAt_seed (t : Fin 2) (x : Plane) (w : K E (.inr t)) : + usefulAt E (outputs E) (.inr t) x w = + seedUseful E t (SharedSeed.residue p x) w := by + simp [usefulAt, seedC] + +theorem outputs_hasDependence : HasDependence E (outputs E) := by + constructor + · intro n x k + simp only [outputs_c_ordinary, ordinaryFactor, usefulAt_ordinary] + apply ordinaryUseful_eq_of_lineValue_eq E n + simp + · intro t x k + simp only [outputs_c_seed, seedFactor, usefulAt_seed, seedC] + have hr : SharedSeed.residue p (seedRepresentative p (seedResidue p x)) = + SharedSeed.residue p x := + seedResidue_representative (p := p) (seedResidue p x) + rw [hr] + +theorem active_ordinary_iff (n : Column p) (x : Plane) (j : Symbol p) : + Active E (outputs E) (.inl n) x j ↔ j = ordinarySymbol E n x := by + simpa only [Active, DigitActive, usefulAt_ordinary] using + ordinaryUseful_active_iff E n x j + +theorem active_seed_iff (t : Fin 2) (x : Plane) : + Active E (outputs E) (.inr t) x () ↔ + SharedSeed.residue p x ∈ seedActiveRegion p t := by + simpa only [Active, DigitActive, usefulAt_seed] using + seedUseful_active_iff E t (SharedSeed.residue p x) + +theorem active_word_allowed (x : Plane) (w : Word p) + (hw : ∀ n, Active E (outputs E) (.inl n) x (w n)) : Allowed p w := by + have he : w = ordinaryWord E x := + funext fun n => (active_ordinary_iff E n x (w n)).mp (hw n) + rw [he] + exact ordinaryWord_allowed E x + +theorem active_seed_forces_symbol (t : Fin 2) (n : Column p) (x : Plane) + (j : Symbol p) (ht : Active E (outputs E) (.inr t) x ()) + (hj : Active E (outputs E) (.inl n) x j) : + j = lastDigit p E.p_prime ((t.val : ℤ) + 1) := by + have hj' := (active_ordinary_iff E n x j).mp hj + have hr := (active_seed_iff E t x).mp ht + fin_cases t + · have hfirst : SharedSeed.residue p x ∈ SharedSeed.firstRegion p := by + simpa [seedActiveRegion] using hr + simpa using hj'.trans (ordinarySymbol_firstRegion E n x hfirst) + · have hsecond : SharedSeed.residue p x ∈ SharedSeed.secondRegion p := by + simpa [seedActiveRegion] using hr + simpa using hj'.trans (ordinarySymbol_secondRegion E n x hsecond) + +theorem commonGraph_tiles_kernel : Tiles (kernelTile E) (commonGraph E) := + kernelTile_graph E (outputs E) + +end PeriodicTilingThree.CommonModel + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/CommonSeedOutputs.lean b/lean/OAI/Geometry/PeriodicTiling/CommonSeedOutputs.lean new file mode 100644 index 0000000000000000000000000000000000000000..264f23bd784a3b4bb96ee5b0d62dfd0fbb0585ac --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/CommonSeedOutputs.lean @@ -0,0 +1,209 @@ +import OAI.Geometry.PeriodicTiling.SharedSeedSizeTransport +import OAI.Geometry.PeriodicTiling.ChannelDigitBlocks +import OAI.Geometry.PeriodicTiling.ActivationOffsets + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree + +open SharedSeed + +variable {p : ℕ} [NeZero p] (E : EncodingParameters p) + +theorem seedOneSize + {p : ℕ} [NeZero p] (E : EncodingParameters p) + : E.a (.inr (0 : Fin 2)) = 2 := by + simpa using E.seed_a (0 : Fin 2) + +theorem seedTwoSize + {p : ℕ} [NeZero p] (E : EncodingParameters p) + : E.a (.inr (1 : Fin 2)) = 3 := by + simpa using E.seed_a (1 : Fin 2) + +def seedUseful (t : Fin 2) : Residues p → K E (.inr t) → P E (.inr t) := + Fin.cases + (fun s u => usefulOneOfEq (seedOneSize E) (channelDigitBlocks E (.inr 0) ()) u + (residueEquiv E.p_prime E.p_large s)) + (fun j => by + have hj : j = 0 := Subsingleton.elim _ _ + subst j + exact fun s u => usefulTwoOfEq (seedTwoSize E) (channelDigitBlocks E (.inr 1) ()) u + (residueEquiv E.p_prime E.p_large s)) t + +def seedHigh (t : Fin 2) : ℤ → Residues p → K E (.inr t) → K E (.inr t) := + Fin.cases + (fun x s u => highOneOfEq (seedOneSize E) (channelDigitBlocks E (.inr 0) ()) x u + (residueEquiv E.p_prime E.p_large s)) + (fun j => by + have hj : j = 0 := Subsingleton.elim _ _ + subst j + exact fun x s u => highTwoOfEq (seedTwoSize E) (channelDigitBlocks E (.inr 1) ()) x u + (residueEquiv E.p_prime E.p_large s)) t + +@[simp] theorem seedUseful_zero (s : Residues p) (u : K E (.inr (0 : Fin 2))) : + seedUseful E 0 s u = + usefulOneOfEq (seedOneSize E) (channelDigitBlocks E (.inr 0) ()) u + (residueEquiv E.p_prime E.p_large s) := rfl + +@[simp] theorem seedUseful_one (s : Residues p) (u : K E (.inr (1 : Fin 2))) : + seedUseful E 1 s u = + usefulTwoOfEq (seedTwoSize E) (channelDigitBlocks E (.inr 1) ()) u + (residueEquiv E.p_prime E.p_large s) := rfl + +@[simp] theorem seedHigh_zero (x : ℤ) (s : Residues p) (u : K E (.inr (0 : Fin 2))) : + seedHigh E 0 x s u = + highOneOfEq (seedOneSize E) (channelDigitBlocks E (.inr 0) ()) x u + (residueEquiv E.p_prime E.p_large s) := rfl + +@[simp] theorem seedHigh_one (x : ℤ) (s : Residues p) (u : K E (.inr (1 : Fin 2))) : + seedHigh E 1 x s u = + highTwoOfEq (seedTwoSize E) (channelDigitBlocks E (.inr 1) ()) x u + (residueEquiv E.p_prime E.p_large s) := rfl + +def seedC (t : Fin 2) (x : Plane) (k : Input E) : P E (.inr t) := + seedUseful E t (residue p x) (k (.inr t)) + +def seedBeta (t : Fin 2) (x : Plane) (k : Input E) : K E (.inr t) := + seedHigh E t x.1 (residue p x) (k (.inr t)) + +theorem seedC_eq_of_residue_low (t : Fin 2) {x y : Plane} {k l : Input E} + (hx : residue p x = residue p y) (hk : k (.inr t) = l (.inr t)) : + seedC E t x k = seedC E t y l := by + simp only [seedC, hx, hk] + +def seedSourceInput (t : Fin 2) (k : Input E) (j : SeedActivationIndex E t) : Input E := + Function.update k (.inr t) (k (.inr t) - j.1.1) + +@[simp] theorem seedSourceInput_same (t : Fin 2) (k : Input E) + (j : SeedActivationIndex E t) : + seedSourceInput E t k j (.inr t) = k (.inr t) - j.1.1 := by + simp [seedSourceInput] + +theorem seedSourceInput_low (t : Fin 2) (k : Input E) (j : SeedActivationIndex E t) : + seedSourceInput E t k j (.inr t) = + k (.inr t) - ((seedOffset E t j).1 : K E (.inr t)) := by + rw [seedSourceInput_same, seedOffset_low] + +theorem seed_source_residue (t : Fin 2) (x : Plane) (j : SeedActivationIndex E t) : + residue p (x - seedOffset E t j) = residue p x - j.2 := by + have hs : residue p (seedOffset E t j) = j.2 := seedOffset_residue E t j + have hfirst : ((seedOffset E t j).1 : ZMod (p ^ 2)) = j.2.1 := congrArg Prod.fst hs + have hsecond : ((seedOffset E t j).2 : ZMod (p ^ 2)) = j.2.2 := congrArg Prod.snd hs + apply Prod.ext + · change ((x.1 - (seedOffset E t j).1 : ℤ) : ZMod (p ^ 2)) = + (x.1 : ZMod (p ^ 2)) - j.2.1 + rw [Int.cast_sub, hfirst] + · change ((x.2 - (seedOffset E t j).2 : ℤ) : ZMod (p ^ 2)) = + (x.2 : ZMod (p ^ 2)) - j.2.2 + rw [Int.cast_sub, hsecond] + +def seedActualForward (t : Fin 2) (x : Plane) (k : Input E) + (j : SeedActivationIndex E t) : (P E (.inr t) × K E (.inr t)) × ZMod (D p) := + let x' := x - seedOffset E t j + let k' := seedSourceInput E t k j + ((seedC E t x' k' + shift (E.a (.inr t)) (E.b (.inr t)) j.1.2, + seedBeta E t x' k'), commonZ E.p_prime E.p_large x' k') + +theorem seedActualForward_zero_eq (x : Plane) (k : Input E) : + seedActualForward E 0 x k = + oneForwardOfEq (seedOneSize E) (channelDigitBlocks E (.inr 0) ()) + (BlockShiftData.ofMultiplicity (E.a_two_le (.inr 0)) (E.b_two_le (.inr 0))) + (residueEquiv E.p_prime E.p_large) (outputEquiv E.p_large) + (fun j => (seedOffset E 0 j).1) x.1 (residue p x) (k (.inr 0)) := by + funext j + simp only [seedActualForward, seedC, seedBeta, seedSourceInput_same, + seed_source_residue, seedUseful_zero, seedHigh_zero, commonZ, + oneForwardOfEq, BlockShiftData.ofMultiplicity, Prod.fst_sub] + +theorem seedActualForward_one_eq (x : Plane) (k : Input E) : + seedActualForward E 1 x k = + twoForwardOfEq (seedTwoSize E) (channelDigitBlocks E (.inr 1) ()) + (BlockShiftData.ofMultiplicity (E.a_two_le (.inr 1)) (E.b_two_le (.inr 1))) + (residueEquiv E.p_prime E.p_large) (outputEquiv E.p_large) + (fun j => (seedOffset E 1 j).1) x.1 (residue p x) (k (.inr 1)) := by + funext j + simp only [seedActualForward, seedC, seedBeta, seedSourceInput_same, + seed_source_residue, seedUseful_one, seedHigh_one, commonZ, + twoForwardOfEq, BlockShiftData.ofMultiplicity, Prod.fst_sub] + +theorem seedActualForward_bijective (t : Fin 2) (x : Plane) (k : Input E) : + Function.Bijective (seedActualForward E t x k) := by + fin_cases t + · change Function.Bijective (seedActualForward E (0 : Fin 2) x k) + rw [seedActualForward_zero_eq] + apply oneForwardOfEq_bijective + · intro j + exact seedOffset_rhoA E 0 j + · intro j + exact seedOffset_rhoB E 0 j + · intro j + have h := seedOffset_other E (0 : Fin 2) j + have ha : E.a (.inr (otherSeed (0 : Fin 2))) = 3 := by + change E.a (.inr (1 : Fin 2)) = 3 + exact seedTwoSize E + exact Eq.mp (congrArg (fun modulus : ℕ => + ((seedOffset E (0 : Fin 2) j).1 : ZMod modulus) = 0) ha) h + · change Function.Bijective (seedActualForward E (1 : Fin 2) x k) + rw [seedActualForward_one_eq] + apply twoForwardOfEq_bijective + · intro j + exact seedOffset_rhoA E 1 j + · intro j + exact seedOffset_rhoB E 1 j + · intro j + have h := seedOffset_other E (1 : Fin 2) j + have ha : E.a (.inr (otherSeed (1 : Fin 2))) = 2 := by + change E.a (.inr (0 : Fin 2)) = 2 + exact seedOneSize E + exact Eq.mp (congrArg (fun modulus : ℕ => + ((seedOffset E (1 : Fin 2) j).1 : ZMod modulus) = 0) ha) h + +theorem both_seed_tests (x : Plane) (k : Input E) : + Function.Bijective (seedActualForward E 0 x k) ∧ + Function.Bijective (seedActualForward E 1 x k) := + ⟨seedActualForward_bijective E 0 x k, seedActualForward_bijective E 1 x k⟩ + +def seedActiveRegion (p : ℕ) (t : Fin 2) : Set (Residues p) := + if t = 0 then firstRegion p else secondRegion p + +theorem seedUseful_active_iff (t : Fin 2) (s : Residues p) : + (∃ u v : K E (.inr t), u - v ∈ digitSubgroup E (.inr t) () ∧ + seedUseful E t s u ≠ seedUseful E t s v) ↔ s ∈ seedActiveRegion p t := by + classical + fin_cases t + · change (∃ u v : K E (.inr (0 : Fin 2)), + u - v ∈ digitSubgroup E (.inr (0 : Fin 2)) () ∧ + seedUseful E 0 s u ≠ seedUseful E 0 s v) ↔ + s ∈ seedActiveRegion p (0 : Fin 2) + have hC := (channelDigitBlocks_active_iff E (.inr (0 : Fin 2)) () ()).mpr rfl + have hlabel : ActiveOne (residueEquiv E.p_prime E.p_large s) ↔ s ∈ firstRegion p := by + rw [← residueEquiv_first_iff E.p_prime E.p_large s] + cases hs : residueEquiv E.p_prime E.p_large s <;> simp [ActiveOne] + have h := usefulOneOfEq_activity_iff (seedOneSize E) (channelDigitBlocks E (.inr 0) ()) + (fun u v => u - v ∈ digitSubgroup E (.inr 0) ()) hC + (residueEquiv E.p_prime E.p_large s) + rw [seedActiveRegion, ite_eq_left (rfl : (0 : Fin 2) = 0)] + simpa only [seedUseful_zero] using h.trans hlabel + · change (∃ u v : K E (.inr (1 : Fin 2)), + u - v ∈ digitSubgroup E (.inr (1 : Fin 2)) () ∧ + seedUseful E 1 s u ≠ seedUseful E 1 s v) ↔ + s ∈ seedActiveRegion p (1 : Fin 2) + have hC := (channelDigitBlocks_active_iff E (.inr (1 : Fin 2)) () ()).mpr rfl + have hlabel : ActiveTwo (residueEquiv E.p_prime E.p_large s) ↔ s ∈ secondRegion p := by + rw [← residueEquiv_second_iff E.p_prime E.p_large s] + cases hs : residueEquiv E.p_prime E.p_large s with + | inl y => simp [ActiveTwo] + | inr u => cases u <;> simp [ActiveTwo] + have h := usefulTwoOfEq_activity_iff (seedTwoSize E) (channelDigitBlocks E (.inr 1) ()) + (fun u v => u - v ∈ digitSubgroup E (.inr 1) ()) hC + (residueEquiv E.p_prime E.p_large s) + simpa only [seedUseful_one, seedActiveRegion, ite_eq_right (by decide : (1 : Fin 2) ≠ 0)] + using h.trans hlabel + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/CommonSolution.lean b/lean/OAI/Geometry/PeriodicTiling/CommonSolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..3540b0d7dbf421b913e8386a22cfb3540df4647e --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/CommonSolution.lean @@ -0,0 +1,58 @@ +import OAI.Geometry.PeriodicTiling.CommonModel +import OAI.Geometry.PeriodicTiling.EncodedSystem + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree.CommonModel + +variable {p : ℕ} [NeZero p] (E : EncodingParameters p) + +theorem ordinaryActivationMap_outputs (n : Column p) (b : Base E) : + ordinaryActivationMap E n (outputs E) b = + ordinaryForward E n b.1 (b.2 (.inl n)) := by + funext j + simp [ordinaryActivationMap, ordinarySource, activationSource, outputs, ordinaryForward] + +theorem seedActivationMap_outputs (t : Fin 2) (b : Base E) : + seedActivationMap E t (outputs E) b = seedActualForward E t b.1 b.2 := by + rfl + +theorem common_solution : Solves E (commonGraph E) := by + apply (solves_iff E (commonGraph E)).mpr + refine ⟨commonGraph_tiles_kernel E, ?_, ?_, ?_, ?_, ?_⟩ + · exact (dependenceTiles_iff E (outputs E)).mpr (outputs_hasDependence E) + · exact (wordConstraintTiles_iff E (outputs E) (outputs_hasDependence E)).mpr + (active_word_allowed E) + · apply (seedConstraintTiles_iff E (outputs E) (outputs_hasDependence E)).mpr + intro t n x j ht hj + exact active_seed_forces_symbol E t n x j ht hj + · intro n + apply (ordinaryActivationTile_iff E n (outputs E)).mpr + intro b + rw [ordinaryActivationMap_outputs] + exact ordinaryForward_bijective E n b.1 (b.2 (.inl n)) + · intro t + apply (seedActivationTile_iff E t (outputs E)).mpr + intro b + rw [seedActivationMap_outputs] + exact seedActualForward_bijective E t b.1 b.2 + +theorem commonGraph_tiles_testTile (i : TestIndex E) : + Tiles (testTile E i) (commonGraph E) := + (solves_iff_index E (commonGraph E)).mp (common_solution E) i + +end PeriodicTilingThree.CommonModel + +namespace PeriodicTilingThree + +theorem exists_common_solution {p : ℕ} [NeZero p] (E : EncodingParameters p) : + ∃ A : Set (Ambient E), Solves E A := + ⟨CommonModel.commonGraph E, CommonModel.common_solution E⟩ + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/ComponentTargets.lean b/lean/OAI/Geometry/PeriodicTiling/ComponentTargets.lean new file mode 100644 index 0000000000000000000000000000000000000000..dcab5d9e39179a8973bb7f62fb4980a342a50497 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/ComponentTargets.lean @@ -0,0 +1,247 @@ +import OAI.Geometry.PeriodicTiling.FiniteMasks +import OAI.Geometry.PeriodicTiling.TilesRegion +import OAI.Geometry.PeriodicTiling.PlaneLattices +import OAI.Geometry.PeriodicTiling.ConfigurationDifferenceReduction +import OAI.Geometry.PeriodicTiling.BoundedDifferences +import Mathlib.Tactic.Choose +import Lean.Elab.Tactic.Omega + +namespace OAI + +universe uG uι + +noncomputable section + +open scoped BigOperators Classical + +namespace PeriodicTilingThree + +def componentTarget {G : Type uG} [AddCommGroup G] + (F : Finset G) (D : Set G) : Set G := + {x | tileCount F D x = 1} + +private theorem unique_of_nat_sum_one {ι : Type uι} [Fintype ι] + (c : ι → ℕ) (hc : (∑ i, c i) = 1) : ∃! i, c i = 1 := by + classical + have hle (i : ι) : c i ≤ 1 := by + calc + c i ≤ ∑ j, c j := Finset.single_le_sum (fun j _ => Nat.zero_le (c j)) + (Finset.mem_univ i) + _ = 1 := hc + have hcard : (Finset.univ.filter fun i => c i = 1).card = 1 := by + calc + (Finset.univ.filter fun i => c i = 1).card = + ∑ i, if c i = 1 then (1 : ℕ) else 0 := by simp + _ = ∑ i, c i := by + apply Finset.sum_congr rfl + intro i _ + have hi := hle i + split_ifs <;> omega + _ = 1 := hc + obtain ⟨i, hi⟩ := Finset.card_eq_one.mp hcard + have hmem : i ∈ Finset.univ.filter (fun i => c i = 1) := by + rw [hi] + exact Finset.mem_singleton_self i + refine ⟨i, (Finset.mem_filter.mp hmem).2, ?_⟩ + intro j hj + have hjmem : j ∈ Finset.univ.filter (fun i => c i = 1) := by simp [hj] + simpa only [hi, Finset.mem_singleton] using hjmem + +theorem component_tileCount_sum {G : Type uG} [AddCommGroup G] + {ι : Type uι} [Fintype ι] {F : Finset G} {A : Set G} + (parts : ι → Set G) (hTile : Tiles F A) + (hpartition : ∀ x, (∑ j, tileIndicator ℝ (parts j) x) = tileIndicator ℝ A x) + (x : G) : (∑ j, tileCount F (parts j) x) = 1 := by + have hreal : ((∑ j, tileCount F (parts j) x : ℕ) : ℝ) = 1 := by + rw [Nat.cast_sum] + simp_rw [tileCount_cast] + rw [Finset.sum_comm] + simp_rw [hpartition] + exact hTile.sum_tileIndicator_eq_one ℝ x + exact_mod_cast hreal + +theorem component_tileCount_le_one {G : Type uG} [AddCommGroup G] + {ι : Type uι} [Fintype ι] {F : Finset G} {A : Set G} + (parts : ι → Set G) (hTile : Tiles F A) + (hpartition : ∀ x, (∑ j, tileIndicator ℝ (parts j) x) = tileIndicator ℝ A x) + (j : ι) (x : G) : tileCount F (parts j) x ≤ 1 := by + calc + tileCount F (parts j) x ≤ ∑ i, tileCount F (parts i) x := + Finset.single_le_sum (f := fun i => tileCount F (parts i) x) + (fun i _ => Nat.zero_le _) (Finset.mem_univ j) + _ = 1 := component_tileCount_sum parts hTile hpartition x + +theorem tilesRegion_componentTarget {G : Type uG} [AddCommGroup G] + (F : Finset G) (D : Set G) (hcount : ∀ x, tileCount F D x ≤ 1) : + TilesRegion F D (componentTarget F D) := by + classical + constructor + · intro f hf d hd + change tileCount F D (f + d) = 1 + apply Nat.le_antisymm (hcount (f + d)) + have hterm : tileIndicator ℕ D (f + d - f) = 1 := by + simp [tileIndicator, hd] + calc + 1 = tileIndicator ℕ D (f + d - f) := hterm.symm + _ ≤ tileCount F D (f + d) := + Finset.single_le_sum (f := fun g => tileIndicator ℕ D (f + d - g)) + (fun g _ => Nat.zero_le _) hf + · intro x hx + change tileCount F D x = 1 at hx + have hcard : (F.filter fun f => x - f ∈ D).card = 1 := by + rw [← tileCount_eq_card_filter] + exact hx + obtain ⟨f, hf⟩ := Finset.card_eq_one.mp hcard + have hm : f ∈ F ∧ x - f ∈ D := by + apply Finset.mem_filter.mp + rw [hf] + exact Finset.mem_singleton_self f + refine ⟨⟨f, hm.1⟩, hm.2, ?_⟩ + intro g hg + apply Subtype.ext + have hg' : g.val ∈ F.filter (fun f => x - f ∈ D) := + Finset.mem_filter.mpr ⟨g.property, hg⟩ + simpa only [hf, Finset.mem_singleton] using hg' + +theorem component_targets_partition {G : Type uG} [AddCommGroup G] + {ι : Type uι} [Fintype ι] {F : Finset G} {A : Set G} + (parts : ι → Set G) (hTile : Tiles F A) + (hpartition : ∀ x, (∑ j, tileIndicator ℝ (parts j) x) = tileIndicator ℝ A x) + (x : G) : ∃! j, x ∈ componentTarget F (parts j) := + unique_of_nat_sum_one (fun j => tileCount F (parts j) x) + (component_tileCount_sum parts hTile hpartition x) + +private theorem real_tileCount_periodic {G : Type uG} [AddCommGroup G] + (F : Finset G) (D : Set G) (v : G) (hD : Period D v) : + Function.Periodic (fun x => (tileCount F D x : ℝ)) v := by + intro x + change (tileCount F D (x + v) : ℝ) = (tileCount F D x : ℝ) + rw [tileCount_cast, tileCount_cast] + apply Finset.sum_congr rfl + intro f _ + have he : x + v - f = (x - f) + v := by abel + simp only [tileIndicator, he, hD (x - f)] + +private theorem componentTarget_period_of_count {G : Type uG} [AddCommGroup G] + (F : Finset G) (D : Set G) (v : G) + (h : Function.Periodic (fun x => (tileCount F D x : ℝ)) v) : + Period (componentTarget F D) v := by + intro x + have he : tileCount F D (x + v) = tileCount F D x := by + have hreal : (tileCount F D (x + v) : ℝ) = (tileCount F D x : ℝ) := h x + exact_mod_cast hreal + change tileCount F D (x + v) = 1 ↔ tileCount F D x = 1 + rw [he] + +private theorem bounded_component_periodic {ι : Type uι} [Fintype ι] + (g : ι → Plane → ℝ) (w : ι → Plane) (j : ι) (e : Plane) + (hperiod : ∀ i, Function.Periodic (g i) (w i)) + (hsum : (∑ i, g i) = fun _ => (1 : ℝ)) + (hbound : ∃ B : ℝ, ∀ x, |g j x| ≤ B) + (hother : ∃ i, i ≠ j) + (hspan : ∀ i, i ≠ j → ∃ a b : ℤ, e = a • w i + b • w j) : + Function.Periodic (g j) e := by + classical + have hchoice : ∀ i, ∃ a b : ℤ, i ≠ j → e = a • w i + b • w j := by + intro i + by_cases hij : i = j + · exact ⟨0, 0, fun h => (h hij).elim⟩ + · obtain ⟨a, b, h⟩ := hspan i hij + exact ⟨a, b, fun _ => h⟩ + choose a b hab using hchoice + let vs : List Plane := (Finset.univ.erase j).toList.map (fun i => a i • w i) + have hmem (i : ι) (hij : i ≠ j) : a i • w i ∈ vs := by + apply List.mem_map.mpr + refine ⟨i, ?_, rfl⟩ + simpa only [Finset.mem_toList, Finset.mem_erase, Finset.mem_univ, and_true] using hij + have hvs : vs ≠ [] := by + obtain ⟨i, hij⟩ := hother + intro he + have h := hmem i hij + rw [he] at h + exact List.not_mem_nil h + have hkill : ∀ i, i ≠ j → ∃ v ∈ vs, Function.Periodic (g i) v := by + intro i hij + exact ⟨a i • w i, hmem i hij, (hperiod i).zsmul (a i)⟩ + have hmods : ∀ u ∈ vs, ∃ k : ℤ, u = e + k • w j := by + intro u hu + obtain ⟨i, hi, rfl⟩ := List.mem_map.mp hu + have hij : i ≠ j := (Finset.mem_erase.mp (Finset.mem_toList.mp hi)).1 + refine ⟨-b i, ?_⟩ + rw [hab i hij, neg_smul] + abel + have hzero := configDiffs_component_zero j vs hvs g 1 hsum hkill + rw [configDiffs_eq_iterate_of_period vs e (w j) (g j) (hperiod j) hmods] at hzero + exact periodic_of_bounded_configDiff_iterate e vs.length (g j) hbound + (List.length_pos_iff.mpr hvs) hzero + +theorem componentTarget_fullyPeriodic {m : ℕ} {F : Finset Plane} {A : Set Plane} + (parts : Fin m → Set Plane) (w : Fin m → Plane) (hTile : Tiles F A) + (hpartition : ∀ x, (∑ j, tileIndicator ℝ (parts j) x) = tileIndicator ℝ A x) + (hw : ∀ j, w j ≠ 0) (hperiod : ∀ j, Period (parts j) (w j)) + (htrans : ∀ i j, i ≠ j → planeDet (w i) (w j) ≠ 0) + (j : Fin m) : FullyPeriodic (componentTarget F (parts j)) := by + classical + let g : Fin m → Plane → ℝ := fun i x => tileCount F (parts i) x + have hgperiod : ∀ i, Function.Periodic (g i) (w i) := + fun i => real_tileCount_periodic F (parts i) (w i) (hperiod i) + have hsum : (∑ i, g i) = fun _ => (1 : ℝ) := by + ext x + simp only [Finset.sum_apply, g, ← Nat.cast_sum] + rw [component_tileCount_sum parts hTile hpartition x] + simp + have hbound : ∃ B : ℝ, ∀ x, |g j x| ≤ B := by + refine ⟨1, fun x => ?_⟩ + have hn := component_tileCount_le_one parts hTile hpartition j x + have hr : (tileCount F (parts j) x : ℝ) ≤ 1 := by exact_mod_cast hn + change |(tileCount F (parts j) x : ℝ)| ≤ 1 + rw [abs_of_nonneg (Nat.cast_nonneg _)] + exact hr + by_cases hother : ∃ i, i ≠ j + · obtain ⟨e, _he, hdet, hspan⟩ := exists_common_transverse w hw htrans + have hge : Function.Periodic (g j) e := bounded_component_periodic g w j e + hgperiod hsum hbound hother (fun i hij => hspan i j hij) + exact fullyPeriodic_of_independent_periods + (componentTarget_period_of_count F (parts j) e hge) + (componentTarget_period_of_count F (parts j) (w j) (hgperiod j)) (hdet j) + · have hall : ∀ i : Fin m, i = j := by + intro i + by_contra hij + exact hother ⟨i, hij⟩ + have hone : ∀ x, tileCount F (parts j) x = 1 := by + intro x + have he := component_tileCount_sum parts hTile hpartition x + have hs : (∑ i, tileCount F (parts i) x) = tileCount F (parts j) x := by + apply Finset.sum_eq_single j + · intro i _ hij + exact (hij (hall i)).elim + · intro hj + exact (hj (Finset.mem_univ j)).elim + rwa [hs] at he + have hE : componentTarget F (parts j) = Set.univ := by + ext x + simp only [componentTarget, Set.mem_ofPred_eq, hone x, Set.mem_univ] + rw [hE] + refine ⟨⊤, ?_, fun v _ x => ?_⟩ + · exact ⟨by simp⟩ + · simp + +theorem component_targets {m : ℕ} {F : Finset Plane} {A : Set Plane} + (parts : Fin m → Set Plane) (w : Fin m → Plane) (hTile : Tiles F A) + (hpartition : ∀ x, (∑ j, tileIndicator ℝ (parts j) x) = tileIndicator ℝ A x) + (hw : ∀ j, w j ≠ 0) (hperiod : ∀ j, Period (parts j) (w j)) + (htrans : ∀ i j, i ≠ j → planeDet (w i) (w j) ≠ 0) : + (∀ j, TilesRegion F (parts j) (componentTarget F (parts j))) ∧ + (∀ x, ∃! j, x ∈ componentTarget F (parts j)) ∧ + ∀ j, FullyPeriodic (componentTarget F (parts j)) := by + refine ⟨?_, component_targets_partition parts hTile hpartition, ?_⟩ + · intro j + exact tilesRegion_componentTarget F (parts j) + (component_tileCount_le_one parts hTile hpartition j) + · exact componentTarget_fullyPeriodic parts w hTile hpartition hw hperiod htrans + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/ConfigurationDifferenceReduction.lean b/lean/OAI/Geometry/PeriodicTiling/ConfigurationDifferenceReduction.lean new file mode 100644 index 0000000000000000000000000000000000000000..4e7b1a5f72bbc792f16e24c1bf888855c1777d73 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/ConfigurationDifferenceReduction.lean @@ -0,0 +1,60 @@ +import OAI.Geometry.PeriodicTiling.ConfigurationDifferences + +namespace OAI + +universe uG uA uB uι + +namespace PeriodicTilingThree + +variable {G : Type uG} {A : Type uA} {B : Type uB} + [AddCommGroup G] [AddCommGroup A] [AddCommGroup B] + +theorem configDiffs_eq_iterate_of_period (vs : List G) (v p : G) (f : G → A) + (hp : Function.Periodic f p) + (hvs : ∀ u ∈ vs, ∃ k : ℤ, u = v + k • p) : + configDiffs vs f = (configDiff v)^[vs.length] f := by + induction vs with + | nil => rfl + | cons u vs ih => + obtain ⟨k, hk⟩ := hvs u (List.mem_cons_self ..) + have htail : ∀ w ∈ vs, ∃ k : ℤ, w = v + k • p := by + intro w hw + exact hvs w (List.mem_cons_of_mem _ hw) + have hper := (configDiffs_preserves_period vs p f hp).zsmul k + rw [configDiffs_cons, hk, configDiff_add_period v (k • p) _ hper, + ih htail, List.length_cons, Function.iterate_succ_apply'] + +theorem configDiffs_component_zero {ι : Type uι} [Fintype ι] + (j : ι) (vs : List G) (hvs : vs ≠ []) (f : ι → G → A) (a : A) + (hsum : (∑ i, f i) = fun _ => a) + (hkill : ∀ i, i ≠ j → ∃ v ∈ vs, Function.Periodic (f i) v) : + configDiffs vs (f j) = 0 := by + classical + have hsum' := congrArg (configDiffs vs) hsum + rw [configDiffs_sum, configDiffs_const hvs] at hsum' + have hone : (∑ i, configDiffs vs (f i)) = configDiffs vs (f j) := by + apply Finset.sum_eq_single j + · intro i _hi hij + obtain ⟨v, hv, hp⟩ := hkill i hij + exact configDiffs_eq_zero_of_mem hv (f i) + ((configDiff_eq_zero_iff v (f i)).mpr hp) + · intro hj + exact (hj (Finset.mem_univ j)).elim + rw [hone] at hsum' + exact hsum' + +theorem map_configDiff (φ : A →+ B) (v : G) (f : G → A) : + (fun x => φ (configDiff v f x)) = configDiff v (fun x => φ (f x)) := by + ext x + exact map_sub φ _ _ + +theorem map_configDiffs (φ : A →+ B) (vs : List G) (f : G → A) : + (fun x => φ (configDiffs vs f x)) = configDiffs vs (fun x => φ (f x)) := by + induction vs with + | nil => rfl + | cons v vs ih => + rw [configDiffs_cons, map_configDiff, ih, configDiffs_cons] + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/ConfigurationDifferences.lean b/lean/OAI/Geometry/PeriodicTiling/ConfigurationDifferences.lean new file mode 100644 index 0000000000000000000000000000000000000000..0e5c36c0feed5a9ede45bdadfd1a64b086e2a301 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/ConfigurationDifferences.lean @@ -0,0 +1,154 @@ +import Mathlib.Algebra.BigOperators.Group.Finset.Basic +import Mathlib.Algebra.Group.Pi.Lemmas +import Mathlib.Algebra.Ring.Periodic +import Mathlib.Logic.Function.Iterate +import Mathlib.Tactic.Abel + +namespace OAI + +universe uG uA uι + +namespace PeriodicTilingThree + +variable {G : Type uG} {A : Type uA} [AddCommGroup G] [AddCommGroup A] + +def configDiff (v : G) (f : G → A) : G → A := + fun x => f (x + v) - f x + +@[simp] theorem configDiff_apply (v : G) (f : G → A) (x : G) : + configDiff v f x = f (x + v) - f x := rfl + +@[simp] theorem configDiff_zero (v : G) : configDiff v (0 : G → A) = 0 := by + ext x + simp [configDiff] + +@[simp] theorem configDiff_const (v : G) (a : A) : + configDiff v (fun _ : G => a) = 0 := by + ext x + simp [configDiff] + +theorem configDiff_add (v : G) (f g : G → A) : + configDiff v (f + g) = configDiff v f + configDiff v g := by + ext x + simp only [configDiff_apply, Pi.add_apply] + abel + +theorem configDiff_sub (v : G) (f g : G → A) : + configDiff v (f - g) = configDiff v f - configDiff v g := by + ext x + simp only [configDiff_apply, Pi.sub_apply] + abel + +theorem configDiff_comm (v w : G) (f : G → A) : + configDiff v (configDiff w f) = configDiff w (configDiff v f) := by + ext x + have h : x + v + w = x + w + v := by abel + simp only [configDiff_apply, h] + abel + +theorem configDiff_eq_zero_iff (v : G) (f : G → A) : + configDiff v f = 0 ↔ Function.Periodic f v := by + constructor + · intro h x + have hx := congrFun h x + exact sub_eq_zero.mp hx + · intro h + ext x + exact sub_eq_zero.mpr (h x) + +theorem configDiff_add_period (v p : G) (f : G → A) + (hp : Function.Periodic f p) : configDiff (v + p) f = configDiff v f := by + ext x + simp only [configDiff_apply, ← add_assoc, hp (x + v)] + +theorem configDiff_preserves_period (v p : G) (f : G → A) + (hp : Function.Periodic f p) : Function.Periodic (configDiff v f) p := by + apply (configDiff_eq_zero_iff p _).mp + rw [configDiff_comm, (configDiff_eq_zero_iff p f).mpr hp, configDiff_zero] + +theorem configDiff_sum {ι : Type uι} (s : Finset ι) (v : G) (f : ι → G → A) : + configDiff v (∑ i ∈ s, f i) = ∑ i ∈ s, configDiff v (f i) := by + classical + induction s using Finset.induction_on with + | empty => simp + | @insert i s hi ih => + simp only [Finset.sum_insert hi, configDiff_add, ih] + +def configDiffs : List G → (G → A) → (G → A) + | [], f => f + | v :: vs, f => configDiff v (configDiffs vs f) + +@[simp] theorem configDiffs_nil (f : G → A) : configDiffs [] f = f := rfl + +@[simp] theorem configDiffs_cons (v : G) (vs : List G) (f : G → A) : + configDiffs (v :: vs) f = configDiff v (configDiffs vs f) := rfl + +@[simp] theorem configDiffs_zero (vs : List G) : + configDiffs vs (0 : G → A) = 0 := by + induction vs with + | nil => rfl + | cons v vs ih => simp only [configDiffs_cons, ih, configDiff_zero] + +theorem configDiff_configDiffs (v : G) (vs : List G) (f : G → A) : + configDiff v (configDiffs vs f) = configDiffs vs (configDiff v f) := by + induction vs with + | nil => rfl + | cons w vs ih => + simp only [configDiffs_cons, configDiff_comm v w, ih] + +theorem configDiffs_add (vs : List G) (f g : G → A) : + configDiffs vs (f + g) = configDiffs vs f + configDiffs vs g := by + induction vs with + | nil => rfl + | cons v vs ih => simp only [configDiffs_cons, ih, configDiff_add] + +theorem configDiffs_sub (vs : List G) (f g : G → A) : + configDiffs vs (f - g) = configDiffs vs f - configDiffs vs g := by + induction vs with + | nil => rfl + | cons v vs ih => simp only [configDiffs_cons, ih, configDiff_sub] + +theorem configDiffs_sum {ι : Type uι} (s : Finset ι) (vs : List G) + (f : ι → G → A) : + configDiffs vs (∑ i ∈ s, f i) = ∑ i ∈ s, configDiffs vs (f i) := by + classical + induction s using Finset.induction_on with + | empty => simp + | @insert i s hi ih => + simp only [Finset.sum_insert hi, configDiffs_add, ih] + +theorem configDiffs_eq_zero_of_mem {v : G} {vs : List G} (hv : v ∈ vs) + (f : G → A) (hf : configDiff v f = 0) : configDiffs vs f = 0 := by + induction vs with + | nil => simp at hv + | cons w vs ih => + rcases List.mem_cons.mp hv with h | h + · subst w + rw [configDiffs_cons, configDiff_configDiffs, hf, configDiffs_zero] + · rw [configDiffs_cons, ih h, configDiff_zero] + +theorem configDiffs_const {vs : List G} (hvs : vs ≠ []) (a : A) : + configDiffs vs (fun _ : G => a) = 0 := by + cases vs with + | nil => exact (hvs rfl).elim + | cons v vs => + rw [configDiffs_cons, configDiff_configDiffs, configDiff_const, + configDiffs_zero] + +theorem configDiffs_preserves_period (vs : List G) (p : G) (f : G → A) + (hp : Function.Periodic f p) : Function.Periodic (configDiffs vs f) p := by + apply (configDiff_eq_zero_iff p _).mp + rw [configDiff_configDiffs, (configDiff_eq_zero_iff p f).mpr hp, + configDiffs_zero] + +theorem configDiffs_replicate (n : ℕ) (v : G) (f : G → A) : + configDiffs (List.replicate n v) f = (configDiff v)^[n] f := by + induction n with + | zero => rfl + | succ n ih => + simp only [List.replicate_succ, configDiffs_cons, ih, + Function.iterate_succ_apply'] + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/ConstituentAssembly.lean b/lean/OAI/Geometry/PeriodicTiling/ConstituentAssembly.lean new file mode 100644 index 0000000000000000000000000000000000000000..153f175059149a582b7a72097f66f6f1c9c6d355 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/ConstituentAssembly.lean @@ -0,0 +1,200 @@ +import OAI.Geometry.PeriodicTiling.ConstituentGeometry +import OAI.Geometry.PeriodicTiling.AETilingCountable + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree.MarkedTile + +open Set MeasureTheory Filter + +namespace ResidueSection + +variable {m : ℕ} [NeZero m] (s : ResidueSection m) + +theorem translated_parts_unique_ae {w : Lattice 3} {U : Finset (Lattice 3)} + (hw : w ∉ U) (a : Space 3) (u u' : ↥U) : + ∀ᵐ x ∂volume, + x - center m a u ∈ Thickening (s.constituent w u) → + x - center m a u' ∈ Thickening (s.constituent w u') → u = u' := by + classical + by_cases he : u = u' + · exact Eventually.of_forall (fun _ _ _ => he) + · have hnull := thickening_inter_measure_zero_of_disjoint (s.parts_disjoint hw he) + have havoid : ∀ᵐ x ∂volume, + x ∉ Thickening (s.part w u) ∩ Thickening (s.part w u') := + compl_mem_ae_iff.mpr hnull + have hshift := (measurePreserving_sub_right volume a).quasiMeasurePreserving.ae havoid + filter_upwards [hshift] with x hx + intro hu hu' + exact False.elim (hx ⟨s.mem_translated_part.mpr hu, + s.mem_translated_part.mpr hu'⟩) + +theorem indexed_constituents_ae {w : Lattice 3} {U : Finset (Lattice 3)} + (h0 : 0 ∈ U) (hw : w ∉ U) {A : Set (Space 3)} + (htile : AETiles (Thickening (s.finalTile w U)) A) : + ∀ᵐ x ∂volume, ∃! q : A × ↥U, + x - center m q.1 q.2 ∈ Thickening (s.constituent w q.2) := by + classical + have hcount := htile.countable_of_thickening (s.finalTile_nonempty w h0) + let : Countable A := hcount.to_subtype + have hall : ∀ᵐ x ∂volume, ∀ (a : A) (u u' : ↥U), + x - center m a u ∈ Thickening (s.constituent w u) → + x - center m a u' ∈ Thickening (s.constituent w u') → u = u' := by + apply ae_all_iff.mpr + intro a + apply ae_all_iff.mpr + intro u + apply ae_all_iff.mpr + intro u' + exact s.translated_parts_unique_ae hw a u u' + filter_upwards [htile, hall] with x hx hpieces + obtain ⟨a, ha, haunique⟩ := hx + obtain ⟨u, hu⟩ := s.mem_translated_finalTile.mp ha + refine ⟨(a, u), hu, ?_⟩ + rintro ⟨a', u'⟩ hq + have ha' : a' = a := haunique a' (s.mem_translated_finalTile.mpr ⟨u', hq⟩) + subst a' + exact Prod.ext rfl (hpieces a u' u hq hu) + +theorem center_injective {w : Lattice 3} {U : Finset (Lattice 3)} + (hm : 2 ≤ m) (h0 : 0 ∈ U) (hw : w ∉ U) {A : Set (Space 3)} + (htile : AETiles (Thickening (s.finalTile w U)) A) : + Function.Injective (fun q : A × ↥U => center m q.1 q.2) := by + classical + have hcover := s.indexed_constituents_ae h0 hw htile + obtain ⟨t, ht⟩ := s.Tstar_nonempty hm + intro q q' he + by_contra hne + have hnull : volume (unitVoxel (center m q.1 q.2 + castLattice t)) = 0 := by + apply measure_mono_null ?_ (ae_iff.mp hcover) + intro x hx huniq + obtain ⟨r, _hr, hruniq⟩ := huniq + have hq : x - center m q.1 q.2 ∈ Thickening (s.constituent w q.2) := + s.common_voxel_subset_constituent w q.2 q.1 ht hx + have hq' : x - center m q'.1 q'.2 ∈ Thickening (s.constituent w q'.2) := by + apply s.common_voxel_subset_constituent w q'.2 q'.1 ht + simpa only [he] using hx + exact hne ((hruniq q hq).trans (hruniq q' hq').symm) + rw [unitVoxel_volume] at hnull + exact one_ne_zero hnull + +theorem center_mem_A_iff + {m : ℕ} [NeZero m] + {U : Finset (Lattice 3)} (h0 : 0 ∈ U) + {A : Set (Space 3)} + (hinj : Function.Injective (fun q : A × ↥U => center m q.1 q.2)) + (q : A × ↥U) : center m q.1 q.2 ∈ A ↔ (q.2 : Lattice 3) = 0 := by + constructor + · intro hc + have he : q = ((⟨center m q.1 q.2, hc⟩ : A), (⟨0, h0⟩ : ↥U)) := by + apply hinj + simp + exact congrArg (fun p : A × ↥U => (p.2 : Lattice 3)) he + · intro hu + simpa only [hu, center_zero] using q.1.property + +open scoped Classical in +theorem constituent_type_eq {w : Lattice 3} {U : Finset (Lattice 3)} (h0 : 0 ∈ U) + {A : Set (Space 3)} + (hinj : Function.Injective (fun q : A × ↥U => center m q.1 q.2)) + (q : A × ↥U) : + (if center m q.1 q.2 ∈ A then Thickening (s.T1 w) else Thickening s.T0) = + Thickening (s.constituent w q.2) := by + classical + by_cases hu : (q.2 : Lattice 3) = 0 + · rw [ite_eq_left ((center_mem_A_iff h0 hinj q).mpr hu)] + simp only [constituent, ite_eq_left hu] + · have hc : center m q.1 q.2 ∉ A := fun h => hu ((center_mem_A_iff h0 hinj q).mp h) + simp only [hc, ite_false, constituent, hu] + +theorem typed_constituents {w : Lattice 3} {U : Finset (Lattice 3)} + (hm : 2 ≤ m) (h0 : 0 ∈ U) (hw : w ∉ U) {A : Set (Space 3)} + (htile : AETiles (Thickening (s.finalTile w U)) A) : + TypedAETiles (Thickening s.T0) (Thickening (s.T1 w)) (centers m U A) A := by + classical + have hinj := s.center_injective hm h0 hw htile + have hcover := s.indexed_constituents_ae h0 hw htile + filter_upwards [hcover] with x hx + obtain ⟨q, hq, hqunique⟩ := hx + let c : centers m U A := ⟨center m q.1 q.2, ⟨q, rfl⟩⟩ + refine ⟨c, ?_, ?_⟩ + · change x - center m q.1 q.2 ∈ + if center m q.1 q.2 ∈ A then Thickening (s.T1 w) else Thickening s.T0 + rw [s.constituent_type_eq h0 hinj q] + exact hq + · intro c' hc' + obtain ⟨q', he⟩ := c'.property + change center m q'.1 q'.2 = (c' : Space 3) at he + have hq' : x - center m q'.1 q'.2 ∈ Thickening (s.constituent w q'.2) := by + rw [← s.constituent_type_eq h0 hinj q', he] + exact hc' + have hqq := hqunique q' hq' + apply Subtype.ext + change (c' : Space 3) = center m q.1 q.2 + rw [← he, hqq] + +end ResidueSection + +theorem period_centers {m : ℕ} {U : Finset (Lattice 3)} {A : Set (Space 3)} + {v : Space 3} (hA : Period A v) : Period (centers m U A) v := by + intro c + constructor + · intro hc + obtain ⟨a, ha, u, hu, he⟩ := mem_centers.mp hc + have hav : a - v ∈ A := (hA (a - v)).mp (by simpa using ha) + refine mem_centers.mpr ⟨a - v, hav, u, hu, ?_⟩ + calc + center m (a - v) u = center m a u - v := by unfold center; abel + _ = c := by rw [he]; abel + · intro hc + obtain ⟨a, ha, u, hu, he⟩ := mem_centers.mp hc + refine mem_centers.mpr ⟨a + v, (hA a).mpr ha, u, hu, ?_⟩ + calc + center m (a + v) u = center m a u + v := by unfold center; abel + _ = c + v := by rw [he] + +theorem fullyPeriodic_centers {m : ℕ} {U : Finset (Lattice 3)} {A : Set (Space 3)} + (hA : EuclideanFullyPeriodic A) : EuclideanFullyPeriodic (centers m U A) := by + obtain ⟨b, hb⟩ := hA + exact ⟨b, fun v hv => period_centers (hb v hv)⟩ + +theorem tiles_of_centers_grid {m : ℕ} {U : Finset (Lattice 3)} {A : Set (Space 3)} + {c0 : Space 3} + (hinj : Function.Injective (fun q : A × ↥U => center m q.1 q.2)) + (hgrid : centers m U A = Set.range (fun z : Lattice 3 => c0 + scaledCast m z)) : + Tiles U {z : Lattice 3 | c0 + scaledCast m z ∈ A} := by + classical + rw [tiles_iff_unique_tile] + intro z + have hz : c0 + scaledCast m z ∈ centers m U A := by + rw [hgrid] + exact ⟨z, rfl⟩ + obtain ⟨q, hq⟩ := hz + have hd : c0 + scaledCast m (z - (q.2 : Lattice 3)) = (q.1 : Space 3) := by + have he : (q.1 : Space 3) + scaledCast m (q.2 : Lattice 3) = + c0 + scaledCast m z := hq + rw [map_sub] + calc + c0 + (scaledCast m z - scaledCast m (q.2 : Lattice 3)) = + (c0 + scaledCast m z) - scaledCast m (q.2 : Lattice 3) := by abel + _ = (q.1 : Space 3) := by rw [← he]; abel + refine ⟨q.2, ?_, ?_⟩ + · change c0 + scaledCast m (z - (q.2 : Lattice 3)) ∈ A + rw [hd] + exact q.1.property + · intro u hu + let a : A := ⟨c0 + scaledCast m (z - (u : Lattice 3)), hu⟩ + have hc : center m a u = c0 + scaledCast m z := by + change (c0 + scaledCast m (z - (u : Lattice 3))) + scaledCast m u = _ + rw [map_sub] + abel + have he : (a, u) = q := hinj (hc.trans hq.symm) + exact congrArg Prod.snd he + +end PeriodicTilingThree.MarkedTile + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/ConstituentGeometry.lean b/lean/OAI/Geometry/PeriodicTiling/ConstituentGeometry.lean new file mode 100644 index 0000000000000000000000000000000000000000..dc982381e65d1c37a4e1411871481a3a32f23236 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/ConstituentGeometry.lean @@ -0,0 +1,146 @@ +import OAI.Geometry.PeriodicTiling.MarkedTile +import OAI.Geometry.PeriodicTiling.VoxelMeasure +import Mathlib.MeasureTheory.Group.Measure + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree.MarkedTile + +open Set MeasureTheory + +@[simp] theorem castLattice_scale (m : ℕ) (u : Lattice 3) : + castLattice (scale m u) = scaledCast m u := by + ext i + simp [scale, scaledCast, castLattice] + +def center (m : ℕ) (a : Space 3) (u : Lattice 3) : Space 3 := + a + scaledCast m u + +@[simp] theorem center_zero (m : ℕ) (a : Space 3) : center m a 0 = a := by + simp [center] + +def centers (m : ℕ) (U : Finset (Lattice 3)) (A : Set (Space 3)) : Set (Space 3) := + Set.range (fun q : A × ↥U => center m q.1 q.2) + +theorem mem_centers {m : ℕ} {U : Finset (Lattice 3)} {A : Set (Space 3)} + {c : Space 3} : c ∈ centers m U A ↔ ∃ a ∈ A, ∃ u ∈ U, center m a u = c := by + constructor + · rintro ⟨⟨a, u⟩, h⟩ + exact ⟨a, a.property, u, u.property, h⟩ + · rintro ⟨a, ha, u, hu, h⟩ + exact ⟨(⟨a, ha⟩, ⟨u, hu⟩), h⟩ + +theorem subset_centers {m : ℕ} {U : Finset (Lattice 3)} (h0 : 0 ∈ U) + (A : Set (Space 3)) : A ⊆ centers m U A := by + intro a ha + exact mem_centers.mpr ⟨a, ha, 0, h0, center_zero m a⟩ + +namespace ResidueSection + +variable {m : ℕ} [NeZero m] (s : ResidueSection m) + +def constituent (w u : Lattice 3) : Finset (Lattice 3) := + if u = 0 then s.T1 w else s.T0 + +def part (w u : Lattice 3) : Finset (Lattice 3) := + (s.constituent w u).image (fun t => scale m u + t) + +theorem mem_part {w u z : Lattice 3} : + z ∈ s.part w u ↔ ∃ v, s.point w u v = z := by + classical + by_cases hu : u = 0 + · subst u + simp [part, constituent, mem_T1] + · simp only [part, constituent, hu, ite_false, Finset.mem_image] + constructor + · rintro ⟨t, ht, he⟩ + obtain ⟨v, rfl⟩ := s.mem_T0.mp ht + exact ⟨v, by simpa only [s.point_of_ne_zero w hu] using he⟩ + · rintro ⟨v, hv⟩ + exact ⟨s.t v, s.mem_T0.mpr ⟨v, rfl⟩, + by simpa only [s.point_of_ne_zero w hu] using hv⟩ + +theorem part_subset_finalTile {w : Lattice 3} {U : Finset (Lattice 3)} + {u : Lattice 3} (hu : u ∈ U) : s.part w u ⊆ s.finalTile w U := by + intro z hz + obtain ⟨v, hv⟩ := s.mem_part.mp hz + exact s.mem_finalTile.mpr ⟨u, hu, v, hv⟩ + +theorem parts_disjoint {w : Lattice 3} {U : Finset (Lattice 3)} (hw : w ∉ U) + {u u' : ↥U} (hne : u ≠ u') : Disjoint (s.part w u) (s.part w u') := by + classical + apply Finset.disjoint_left.mpr + intro z hz hz' + obtain ⟨v, hv⟩ := s.mem_part.mp hz + obtain ⟨v', hv'⟩ := s.mem_part.mp hz' + have hp : (u, v) = (u', v') := s.point_injective hw (hv.trans hv'.symm) + exact hne (congrArg Prod.fst hp) + +theorem mem_thickening_part {w u : Lattice 3} {x : Space 3} : + x ∈ Thickening (s.part w u) ↔ + x - scaledCast m u ∈ Thickening (s.constituent w u) := by + classical + constructor + · rintro ⟨z, hz, hx⟩ + obtain ⟨t, ht, rfl⟩ := Finset.mem_image.mp hz + refine ⟨t, ht, ?_⟩ + simpa only [map_add, castLattice_scale, sub_add_eq_sub_sub] using hx + · rintro ⟨t, ht, hx⟩ + refine ⟨scale m u + t, Finset.mem_image.mpr ⟨t, ht, rfl⟩, ?_⟩ + simpa only [map_add, castLattice_scale, sub_add_eq_sub_sub] using hx + +theorem mem_translated_part {w u : Lattice 3} {a x : Space 3} : + x - a ∈ Thickening (s.part w u) ↔ + x - center m a u ∈ Thickening (s.constituent w u) := by + simpa only [center, sub_add_eq_sub_sub] using + (s.mem_thickening_part (w := w) (u := u) (x := x - a)) + +theorem mem_thickening_finalTile {w : Lattice 3} {U : Finset (Lattice 3)} + {x : Space 3} : + x ∈ Thickening (s.finalTile w U) ↔ + ∃ u : ↥U, x ∈ Thickening (s.part w u) := by + constructor + · rintro ⟨z, hz, hx⟩ + obtain ⟨u, hu, v, hv⟩ := s.mem_finalTile.mp hz + exact ⟨⟨u, hu⟩, z, s.mem_part.mpr ⟨v, hv⟩, hx⟩ + · rintro ⟨u, z, hz, hx⟩ + exact ⟨z, s.part_subset_finalTile u.property hz, hx⟩ + +theorem mem_translated_finalTile {w : Lattice 3} {U : Finset (Lattice 3)} + {a x : Space 3} : + x - a ∈ Thickening (s.finalTile w U) ↔ + ∃ u : ↥U, x - center m a u ∈ Thickening (s.constituent w u) := by + rw [s.mem_thickening_finalTile] + exact exists_congr fun u => s.mem_translated_part + +theorem Tstar_subset_constituent (w u : Lattice 3) : + s.Tstar ⊆ s.constituent w u := by + classical + intro z hz + by_cases hu : u = 0 + · simp only [constituent, hu, ite_true, s.T1_eq_insert] + exact Finset.mem_insert_of_mem hz + · simpa only [constituent, hu, ite_false] using (Finset.mem_erase.mp hz).2 + +theorem Tstar_nonempty (hm : 2 ≤ m) : s.Tstar.Nonempty := by + apply Finset.card_pos.mp + rw [s.card_Tstar] + have hp := Nat.pow_le_pow_left hm 3 + exact Nat.sub_pos_of_lt ((by decide : 1 < 2 ^ 3).trans_le hp) + +theorem common_voxel_subset_constituent (w u : Lattice 3) (a : Space 3) + {t : Lattice 3} (ht : t ∈ s.Tstar) : + unitVoxel (center m a u + castLattice t) ⊆ + {x | x - center m a u ∈ Thickening (s.constituent w u)} := by + intro x hx + refine ⟨t, s.Tstar_subset_constituent w u ht, ?_⟩ + simpa only [mem_unitVoxel, sub_add_eq_sub_sub] using hx + +end ResidueSection +end PeriodicTilingThree.MarkedTile + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/ConstraintCycles.lean b/lean/OAI/Geometry/PeriodicTiling/ConstraintCycles.lean new file mode 100644 index 0000000000000000000000000000000000000000..05fa51e167655df9bce0f6e444beabbd4d03ea54 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/ConstraintCycles.lean @@ -0,0 +1,171 @@ +import OAI.Geometry.PeriodicTiling.CycleTests +import OAI.Geometry.PeriodicTiling.SeedSymbols +import Mathlib.Data.Finset.Union +import Mathlib.Tactic.FinCases + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree + +variable {p : ℕ} [NeZero p] + +def ordinaryCycle (p : ℕ) [NeZero p] : ZMod (p ^ 2) ↪ Channel p where + toFun j := .inl ((ZMod.finEquiv (p ^ 2)).symm j) + inj' _ _ h := (ZMod.finEquiv (p ^ 2)).symm.injective (Sum.inl.inj h) + +def ordinaryCycleLabels (w : Word p) (j : ZMod (p ^ 2)) : + Label p (ordinaryCycle p j) := + w ((ZMod.finEquiv (p ^ 2)).symm j) + +def seedCycle (t : Fin 2) (n : Column p) : ZMod 2 ↪ Channel p where + toFun j := Fin.cases (.inr t) (fun _ => .inl n) j + inj' := by + intro i j h + fin_cases i <;> fin_cases j + · rfl + · change Sum.inr t = Sum.inl n at h + cases h + · change Sum.inl n = Sum.inr t at h + cases h + · rfl + +@[simp] theorem seedCycle_zero + {p : ℕ} [NeZero p] + (t : Fin 2) (n : Column p) : + seedCycle t n 0 = .inr t := rfl + +@[simp] theorem seedCycle_one + {p : ℕ} [NeZero p] + (t : Fin 2) (n : Column p) : + seedCycle t n 1 = .inl n := rfl + +def seedCycleLabels (t : Fin 2) (n : Column p) (j : Symbol p) (z : ZMod 2) : + Label p (seedCycle t n z) := + Fin.cases (motive := fun z : Fin 2 => Label p (seedCycle t n z)) + () (fun _ => j) z + +@[simp] theorem seedCycleLabels_zero + {p : ℕ} [NeZero p] + (t : Fin 2) (n : Column p) (j : Symbol p) : + seedCycleLabels t n j 0 = () := rfl + +@[simp] theorem seedCycleLabels_one + {p : ℕ} [NeZero p] + (t : Fin 2) (n : Column p) (j : Symbol p) : + seedCycleLabels t n j 1 = j := rfl + +variable (E : EncodingParameters p) + +theorem ordinaryCycle_exclusion_iff (w : Word p) (o : GraphOutputs E) + (hdep : HasDependence E o) : + (∀ F ∈ cycleTiles E (ordinaryCycle p) (ordinaryCycleLabels w), + Tiles F (graph o)) ↔ + ∀ x, ¬ (∀ n : Column p, Active E o (.inl n) x (w n)) := by + classical + rw [cycle_exclusion_iff E (ordinaryCycle p) (ordinaryCycleLabels w) o hdep] + constructor + · intro h x hall + obtain ⟨z, hz⟩ := h x + exact hz (hall ((ZMod.finEquiv (p ^ 2)).symm z)) + · intro h x + obtain ⟨n, hn⟩ := not_forall.mp (h x) + refine ⟨(ZMod.finEquiv (p ^ 2)) n, ?_⟩ + exact Eq.mpr + (congrArg (fun m : Column p => ¬ Active E o (.inl m) x (w m)) + ((ZMod.finEquiv (p ^ 2)).symm_apply_apply n)) hn + +theorem seedCycle_exclusion_iff (t : Fin 2) (n : Column p) (j : Symbol p) + (o : GraphOutputs E) (hdep : HasDependence E o) : + (∀ F ∈ cycleTiles E (seedCycle t n) (seedCycleLabels t n j), + Tiles F (graph o)) ↔ + ∀ x, ¬ (Active E o (.inr t) x () ∧ Active E o (.inl n) x j) := by + classical + rw [cycle_exclusion_iff E (seedCycle t n) (seedCycleLabels t n j) o hdep] + constructor + · intro h x hx + obtain ⟨z, hz⟩ := h x + fin_cases z + · exact hz hx.1 + · exact hz hx.2 + · intro h x + by_cases hs : Active E o (.inr t) x () + · refine ⟨1, ?_⟩ + change ¬ Active E o (.inl n) x j + intro hj + exact h x ⟨hs, hj⟩ + · exact ⟨0, hs⟩ + +def wordConstraintTiles : Finset (Finset (Ambient E)) := by + classical + exact (Finset.univ.filter (fun w : Word p => w ∉ allowedWords p)).biUnion + (fun w => cycleTiles E (ordinaryCycle p) (ordinaryCycleLabels w)) + +def seedConstraintTiles : Finset (Finset (Ambient E)) := by + classical + exact (Finset.univ.filter (fun q : Fin 2 × Column p × Symbol p => + q.2.2 ≠ seedSymbol E q.1)).biUnion + (fun q => cycleTiles E (seedCycle q.1 q.2.1) (seedCycleLabels q.1 q.2.1 q.2.2)) + +theorem nonempty_of_mem_wordConstraintTiles {F : Finset (Ambient E)} + (hF : F ∈ wordConstraintTiles E) : F.Nonempty := by + classical + obtain ⟨w, _, hF⟩ := Finset.mem_biUnion.mp hF + exact nonempty_of_mem_cycleTiles E (ordinaryCycle p) (ordinaryCycleLabels w) hF + +theorem nonempty_of_mem_seedConstraintTiles {F : Finset (Ambient E)} + (hF : F ∈ seedConstraintTiles E) : F.Nonempty := by + classical + obtain ⟨q, _, hF⟩ := Finset.mem_biUnion.mp hF + exact nonempty_of_mem_cycleTiles E (seedCycle q.1 q.2.1) + (seedCycleLabels q.1 q.2.1 q.2.2) hF + +theorem wordConstraintTiles_iff (o : GraphOutputs E) (hdep : HasDependence E o) : + (∀ F ∈ wordConstraintTiles E, Tiles F (graph o)) ↔ + ∀ x w, (∀ n : Column p, Active E o (.inl n) x (w n)) → Allowed p w := by + classical + constructor + · intro h x w hw + by_contra hnot + have hcycle : ∀ F ∈ cycleTiles E (ordinaryCycle p) (ordinaryCycleLabels w), + Tiles F (graph o) := by + intro F hF + apply h F + apply Finset.mem_biUnion.mpr + exact ⟨w, by simp [hnot], hF⟩ + exact (ordinaryCycle_exclusion_iff E w o hdep).mp hcycle x hw + · intro h F hF + obtain ⟨w, hw, hF⟩ := Finset.mem_biUnion.mp hF + have hnot : ¬ Allowed p w := by simpa using (Finset.mem_filter.mp hw).2 + apply (ordinaryCycle_exclusion_iff E w o hdep).mpr ?_ F hF + intro x hx + exact hnot (h x w hx) + +theorem seedConstraintTiles_iff (o : GraphOutputs E) (hdep : HasDependence E o) : + (∀ F ∈ seedConstraintTiles E, Tiles F (graph o)) ↔ + ∀ t n x j, Active E o (.inr t) x () → Active E o (.inl n) x j → + j = seedSymbol E t := by + classical + constructor + · intro h t n x j hseed hord + by_contra hj + have hcycle : ∀ F ∈ cycleTiles E (seedCycle t n) (seedCycleLabels t n j), + Tiles F (graph o) := by + intro F hF + apply h F + apply Finset.mem_biUnion.mpr + exact ⟨(t, n, j), Finset.mem_filter.mpr ⟨Finset.mem_univ _, hj⟩, hF⟩ + exact (seedCycle_exclusion_iff E t n j o hdep).mp hcycle x ⟨hseed, hord⟩ + · intro h F hF + obtain ⟨⟨t, n, j⟩, hq, hF⟩ := Finset.mem_biUnion.mp hF + have hj : j ≠ seedSymbol E t := (Finset.mem_filter.mp hq).2 + apply (seedCycle_exclusion_iff E t n j o hdep).mpr ?_ F hF + intro x hx + exact hj (h t n x j hx.1 hx.2) + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/CosetParts.lean b/lean/OAI/Geometry/PeriodicTiling/CosetParts.lean new file mode 100644 index 0000000000000000000000000000000000000000..ca5159a62e43bc1961d85b4aedaf5ae79bf2c8fb --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/CosetParts.lean @@ -0,0 +1,114 @@ +import OAI.Geometry.PeriodicTiling.PlaneLattices +import OAI.Geometry.PeriodicTiling.FiniteMasks +import Mathlib.Data.Fintype.EquivFin +import Mathlib.Algebra.Ring.Periodic +import Mathlib.Tactic.LinearCombination + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree + +open scoped BigOperators + +theorem integerCombination_injective {e H : Plane} (hdet : planeDet e H ≠ 0) : + Function.Injective (integerCombination e H) := by + rintro ⟨a, b⟩ ⟨c, d⟩ he + have hx := congrArg Prod.fst he + have hy := congrArg Prod.snd he + change a * e.1 + b * H.1 = c * e.1 + d * H.1 at hx + change a * e.2 + b * H.2 = c * e.2 + d * H.2 at hy + apply Prod.ext + · have hz : planeDet e H * (a - c) = 0 := by + dsimp [planeDet] + linear_combination H.2 * hx - H.1 * hy + exact sub_eq_zero.mp ((mul_eq_zero.mp hz).resolve_left hdet) + · have hz : planeDet e H * (b - d) = 0 := by + dsimp [planeDet] + linear_combination e.1 * hy - e.2 * hx + exact sub_eq_zero.mp ((mul_eq_zero.mp hz).resolve_left hdet) + +def cosetPart (P : AddSubgroup Plane) (A : Set Plane) (c : Plane ⧸ P) : Set Plane := + {x | x ∈ A ∧ (x : Plane ⧸ P) = c} + +theorem sum_cosetPart_indicator (P : AddSubgroup Plane) [Fintype (Plane ⧸ P)] + (A : Set Plane) (x : Plane) : + (∑ c : Plane ⧸ P, tileIndicator ℝ (cosetPart P A c) x) = tileIndicator ℝ A x := by + classical + by_cases hx : x ∈ A <;> simp [tileIndicator, cosetPart, hx] + +private theorem mem_iff_of_tileIndicator_eq (A : Set Plane) (x y : Plane) + (h : tileIndicator ℝ A x = tileIndicator ℝ A y) : x ∈ A ↔ y ∈ A := by + classical + by_cases hx : x ∈ A <;> by_cases hy : y ∈ A <;> simp_all [tileIndicator] + +theorem cosetPart_period_of_coordinate_period (A : Set Plane) (e H x v : Plane) + (hper : Function.Periodic + (fun st : Plane => tileIndicator ℝ A (x + st.1 • e + st.2 • H)) v) : + Period (cosetPart (integerSpan2 e H) A (x : Plane ⧸ integerSpan2 e H)) + (integerCombination e H v) := by + classical + let P := integerSpan2 e H + let L := integerCombination e H + have hvP : L v ∈ P := ⟨v, rfl⟩ + intro y + have hclass : ((y + L v : Plane) : Plane ⧸ P) = (y : Plane ⧸ P) := + QuotientAddGroup.mk_add_of_mem y hvP + change ((y + L v ∈ A) ∧ ((y + L v : Plane) : Plane ⧸ P) = (x : Plane ⧸ P)) ↔ + (y ∈ A ∧ (y : Plane ⧸ P) = (x : Plane ⧸ P)) + rw [hclass] + by_cases hyclass : (y : Plane ⧸ P) = (x : Plane ⧸ P) + · simp only [hyclass, and_true] + have hdiff : y - x ∈ P := QuotientAddGroup.eq_iff_sub_mem.mp hyclass + obtain ⟨st, hst⟩ := hdiff + have hyrep : y = x + L st := by + rw [hst] + abel + have hyshift : y + L v = x + L (st + v) := by + rw [hyrep, map_add] + abel + apply mem_iff_of_tileIndicator_eq + rw [hyshift, hyrep] + simpa only [L, integerCombination, AddMonoidHom.coe_mk, ZeroHom.coe_mk, add_assoc] using hper st + · simp only [hyclass, and_false] + +theorem finite_periodic_parts_of_coset_periods {A : Set Plane} + (e H : Plane) (hdet : planeDet e H ≠ 0) + (hlocal : ∀ x : Plane, ∃ v : Plane, v ≠ 0 ∧ Function.Periodic + (fun st : Plane => tileIndicator ℝ A (x + st.1 • e + st.2 • H)) v) : + ∃ m : ℕ, ∃ parts : Fin m → Set Plane, ∃ w : Fin m → Plane, + (∀ x, (∑ j, tileIndicator ℝ (parts j) x) = tileIndicator ℝ A x) ∧ + ∀ j, w j ≠ 0 ∧ Period (parts j) (w j) := by + classical + let P := integerSpan2 e H + let : P.FiniteIndex := integerSpan2_finiteIndex e H hdet + let : Fintype (Plane ⧸ P) := P.fintypeQuotientOfFiniteIndex + have hex : ∀ c : Plane ⧸ P, ∃ w : Plane, w ≠ 0 ∧ Period (cosetPart P A c) w := by + intro c + let x : Plane := Quotient.out c + have hx : (x : Plane ⧸ P) = c := Quotient.out_eq' c + obtain ⟨v, hv, hper⟩ := hlocal x + refine ⟨integerCombination e H v, ?_, ?_⟩ + · intro hz + apply hv + apply integerCombination_injective hdet + simpa only [map_zero] using hz + · rw [← hx] + exact cosetPart_period_of_coordinate_period A e H x v hper + choose w hw0 hwper using hex + let eqv : Fin (Fintype.card (Plane ⧸ P)) ≃ (Plane ⧸ P) := + (Fintype.equivFin (Plane ⧸ P)).symm + refine ⟨Fintype.card (Plane ⧸ P), (fun j => cosetPart P A (eqv j)), + (fun j => w (eqv j)), ?_, ?_⟩ + · intro x + rw [eqv.sum_comp (fun c => tileIndicator ℝ (cosetPart P A c) x)] + exact sum_cosetPart_indicator P A x + · intro j + exact ⟨hw0 (eqv j), hwper (eqv j)⟩ + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/CosetPeriodicity.lean b/lean/OAI/Geometry/PeriodicTiling/CosetPeriodicity.lean new file mode 100644 index 0000000000000000000000000000000000000000..612be1d6640a1055fc1da6e8e5aeea5fe7503234 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/CosetPeriodicity.lean @@ -0,0 +1,83 @@ +import OAI.Geometry.PeriodicTiling.TilingBasic +import OAI.Geometry.PeriodicTiling.ScalarPolynomialPeriodicity +import Mathlib.Algebra.BigOperators.Group.Finset.Piecewise +import Mathlib.Algebra.Order.BigOperators.Ring.Finset +import Mathlib.Tactic.Choose +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Ring + +namespace OAI + +namespace PeriodicTilingThree + +theorem coset_configuration_has_period {m : ℕ} + (P : Fin m → ℤ → ℝ) (b : Fin m → ℤ) (a : Plane → ℝ) + (hzero : ∀ j n, 0 ≤ P j n) + (hpair : ∀ i j, i ≠ j → ∀ n r, P i n + P j r ≤ 1) + (hsum : ∀ x : Plane, a x = 1 - ∑ j, P j (x.1 + b j * x.2)) + (degree : ℕ) (hdegree : 0 < degree) + (hpoly : ∀ j, (forwardDiff^[degree]) + (fun n => (P j n : AddCircle (1 : ℝ))) = 0) : + ∃ v : Plane, v ≠ 0 ∧ Function.Periodic a v := by + classical + by_cases hbounded : ∀ j, ∃ c : ℝ, c < 1 ∧ ∀ n, P j n ≤ c + · have hp : ∀ j, ∃ q : ℕ, 0 < q ∧ Function.Periodic (P j) (q : ℤ) := by + intro j + obtain ⟨c, hc, hPc⟩ := hbounded j + exact real_polynomial_periodic_of_bounded_lt_one degree hdegree + (P j) c (hzero j) hPc hc (hpoly j) + choose p hp hperiod using hp + let Q : ℕ := ∏ j, p j + have hQ : 0 < Q := Finset.prod_pos fun j _ => hp j + refine ⟨(0, (Q : ℤ)), ?_, ?_⟩ + · intro h + have hz : (Q : ℤ) = 0 := congrArg Prod.snd h + exact (Nat.cast_ne_zero.mpr (Nat.ne_of_gt hQ)) hz + · intro x + rw [hsum, hsum] + apply congrArg (fun y : ℝ => 1 - y) + apply Finset.sum_congr rfl + intro j _hj + have hd : p j ∣ Q := Finset.dvd_prod_of_mem p (Finset.mem_univ j) + obtain ⟨k, hk⟩ := hd + have hperiodQ : Function.Periodic (P j) (b j * (Q : ℤ)) := by + simpa only [hk, Nat.cast_mul, Int.cast_id, mul_assoc, mul_left_comm, mul_comm] using + (hperiod j).int_mul (b j * (k : ℤ)) + change P j (x.1 + 0 + b j * (x.2 + (Q : ℤ))) = + P j (x.1 + b j * x.2) + rw [show x.1 + 0 + b j * (x.2 + (Q : ℤ)) = + (x.1 + b j * x.2) + b j * (Q : ℤ) by ring] + exact hperiodQ _ + · obtain ⟨j, hj⟩ := not_forall.mp hbounded + have hother : ∀ i, i ≠ j → ∀ n, P i n = 0 := by + intro i hij n + apply le_antisymm _ (hzero i n) + apply le_of_not_gt + intro hpos + apply hj + refine ⟨1 - P i n, by linarith, ?_⟩ + intro r + have hcross := hpair j i (Ne.symm hij) r n + linarith + have hone : ∀ x : Plane, a x = 1 - P j (x.1 + b j * x.2) := by + intro x + rw [hsum] + apply congrArg (fun y : ℝ => 1 - y) + apply Finset.sum_eq_single j + · intro i _hi hij + exact hother i hij _ + · intro hj' + exact (hj' (Finset.mem_univ j)).elim + refine ⟨(-b j, 1), ?_, ?_⟩ + · intro h + have hz : (1 : ℤ) = 0 := congrArg Prod.snd h + exact one_ne_zero hz + · intro x + rw [hone, hone] + apply congrArg (fun n : ℤ => 1 - P j n) + change x.1 + -b j + b j * (x.2 + 1) = x.1 + b j * x.2 + ring + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/Counterexample.lean b/lean/OAI/Geometry/PeriodicTiling/Counterexample.lean new file mode 100644 index 0000000000000000000000000000000000000000..7988070a1c82287df771ea98f9b211c95542f573 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/Counterexample.lean @@ -0,0 +1,35 @@ +import OAI.Geometry.PeriodicTiling.LowerDimensions +import OAI.Geometry.PeriodicTiling.ThreeDimensions + +namespace OAI + +namespace PeriodicTilingThree + +theorem least_lattice_dimension_three : + IsLeast {d : ℕ | HasTileWithoutPeriodicComplement d} 3 := by + classical + constructor + · obtain ⟨T, hT, hTiles, hNoPeriod, _hRealTiles, _hNoRealPeriod⟩ := + exists_three_dimensional_tile + exact ⟨T, hT, hTiles, hNoPeriod⟩ + · intro d hd + by_contra hnot + have hlt : d < 3 := Nat.lt_of_not_ge hnot + obtain ⟨T, _hT, hTiles, hNoPeriod⟩ := hd + obtain ⟨A, hA, hPeriod⟩ := + tiles_below_three_have_fullyPeriodic_complements d hlt T hTiles + exact hNoPeriod A hA hPeriod + +theorem periodic_tiling_counterexample_and_minimality : + (∃ T : Finset (Lattice 3), T.Nonempty ∧ + (∃ A : Set (Lattice 3), Tiles T A) ∧ + (∀ A : Set (Lattice 3), Tiles T A → ¬ FullyPeriodic A) ∧ + (∃ A : Set (Space 3), AETiles (Thickening T) A) ∧ + (∀ A : Set (Space 3), + AETiles (Thickening T) A → ¬ EuclideanFullyPeriodic A)) ∧ + IsLeast {d : ℕ | HasTileWithoutPeriodicComplement d} 3 := + ⟨exists_three_dimensional_tile, least_lattice_dimension_three⟩ + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/CycleTests.lean b/lean/OAI/Geometry/PeriodicTiling/CycleTests.lean new file mode 100644 index 0000000000000000000000000000000000000000..5de21c76db0bbe59dc71aa08105e9b34fbd2e0a3 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/CycleTests.lean @@ -0,0 +1,434 @@ +import OAI.Geometry.PeriodicTiling.Dependence +import Mathlib.Algebra.BigOperators.Pi +import Mathlib.Data.ZMod.Basic +import Mathlib.Tactic.Abel + +namespace OAI + +universe uι uM uN uA uB uH uC + +noncomputable section + +namespace PeriodicTilingThree + +open scoped BigOperators + +section CycleCombinatorics + +variable {ι : Type uι} [Fintype ι] +variable {M : ι → Type uM} {N : ι → Type uN} +variable [∀ i, AddCommGroup (M i)] [∀ i, AddCommGroup (N i)] +variable {t : ℕ} [NeZero t] + +def cycleExtend (cycle : ZMod t ↪ ι) (v : ∀ j, M (cycle j)) : ∀ i, M i := by + classical + exact ∑ j : ZMod t, Pi.single (cycle j) (v j) + +@[simp] theorem cycleExtend_apply + {ι : Type uι} [Fintype ι] + {M : ι → Type uM} [∀ i, AddCommGroup (M i)] {t : ℕ} [NeZero t] + (cycle : ZMod t ↪ ι) + (v : ∀ j, M (cycle j)) (j : ZMod t) : + cycleExtend cycle v (cycle j) = v j := by + classical + rw [cycleExtend, Finset.sum_apply, Finset.sum_eq_single j] + · simp + · intro l _ hlj + have hne : cycle l ≠ cycle j := fun h => hlj (cycle.injective h) + simp [Ne.symm hne] + · simp + +theorem cycleExtend_eq_zero + {ι : Type uι} [Fintype ι] + {M : ι → Type uM} [∀ i, AddCommGroup (M i)] {t : ℕ} [NeZero t] + (cycle : ZMod t ↪ ι) + (v : ∀ j, M (cycle j)) {i : ι} (hi : ∀ j, cycle j ≠ i) : + cycleExtend cycle v i = 0 := by + classical + rw [cycleExtend, Finset.sum_apply] + apply Finset.sum_eq_zero + intro j _ + simp [Ne.symm (hi j)] + +def cycleShift (cycle : ZMod t ↪ ι) (U : ∀ j, AddSubgroup (M (cycle j))) + (d : ∀ j, N (cycle (j - 1)) → U j) (e : ∀ i, N i) : ∀ i, M i := + cycleExtend cycle (fun j => (d j (e (cycle (j - 1))) : M (cycle j))) + +@[simp] theorem cycleShift_apply + {ι : Type uι} [Fintype ι] + {M : ι → Type uM} {N : ι → Type uN} + [∀ i, AddCommGroup (M i)] [∀ i, AddCommGroup (N i)] {t : ℕ} [NeZero t] + (cycle : ZMod t ↪ ι) + (U : ∀ j, AddSubgroup (M (cycle j))) + (d : ∀ j, N (cycle (j - 1)) → U j) (e : ∀ i, N i) (j : ZMod t) : + cycleShift cycle U d e (cycle j) = (d j (e (cycle (j - 1))) : M (cycle j)) := + cycleExtend_apply cycle _ j + +theorem cycleShift_eq_zero + {ι : Type uι} [Fintype ι] + {M : ι → Type uM} {N : ι → Type uN} + [∀ i, AddCommGroup (M i)] [∀ i, AddCommGroup (N i)] {t : ℕ} [NeZero t] + (cycle : ZMod t ↪ ι) + (U : ∀ j, AddSubgroup (M (cycle j))) + (d : ∀ j, N (cycle (j - 1)) → U j) (e : ∀ i, N i) + {i : ι} (hi : ∀ j, cycle j ≠ i) : cycleShift cycle U d e i = 0 := + cycleExtend_eq_zero cycle _ hi + +def cycleMap (cycle : ZMod t ↪ ι) (U : ∀ j, AddSubgroup (M (cycle j))) + (d : ∀ j, N (cycle (j - 1)) → U j) + (g : ∀ i, M i → N i) (k : ∀ i, M i) (e : ∀ i, N i) : ∀ i, N i := + fun i => e i + g i (k i - cycleShift cycle U d e i) + +@[simp] theorem cycleMap_apply_cycle (cycle : ZMod t ↪ ι) + (U : ∀ j, AddSubgroup (M (cycle j))) + (d : ∀ j, N (cycle (j - 1)) → U j) + (g : ∀ i, M i → N i) (k : ∀ i, M i) (e : ∀ i, N i) (j : ZMod t) : + cycleMap cycle U d g k e (cycle j) = + e (cycle j) + g (cycle j) (k (cycle j) - d j (e (cycle (j - 1)))) := by + simp only [cycleMap, cycleShift_apply] + +theorem forall_of_cyclic_step {Q : ZMod t → Prop} (j₀ : ZMod t) (h₀ : Q j₀) + (hstep : ∀ j, Q j → Q (j + 1)) : ∀ j, Q j := by + have hnat : ∀ n : ℕ, Q (j₀ + (n : ZMod t)) := by + intro n + induction n with + | zero => simpa using h₀ + | succ n ih => simpa only [Nat.cast_succ, add_assoc] using hstep _ ih + intro j + have h := hnat (j - j₀).val + simpa only [ZMod.natCast_zmod_val, add_sub_cancel] using h + +theorem cycleMap_injective_of_inactive (cycle : ZMod t ↪ ι) + (U : ∀ j, AddSubgroup (M (cycle j))) + (d : ∀ j, N (cycle (j - 1)) → U j) + (g : ∀ i, M i → N i) (k : ∀ i, M i) + (j₀ : ZMod t) (hinactive : ¬ DigitActive (g (cycle j₀)) (U j₀)) : + Function.Injective (cycleMap cycle U d g k) := by + classical + have hagree {w w' : M (cycle j₀)} (hw : w - w' ∈ U j₀) : + g (cycle j₀) w = g (cycle j₀) w' := by + by_contra hne + exact hinactive ⟨w, w', hw, hne⟩ + have hconstant (e : ∀ i, N i) : + g (cycle j₀) (k (cycle j₀) - d j₀ (e (cycle (j₀ - 1)))) = + g (cycle j₀) (k (cycle j₀)) := by + apply hagree + have heq : (k (cycle j₀) - (d j₀ (e (cycle (j₀ - 1))) : M (cycle j₀))) - + k (cycle j₀) = -((d j₀ (e (cycle (j₀ - 1)))) : M (cycle j₀)) := by abel + rw [heq] + exact (U j₀).neg_mem (d j₀ (e (cycle (j₀ - 1)))).property + intro e e' he + have hstart : e (cycle j₀) = e' (cycle j₀) := by + have h := congrFun he (cycle j₀) + rw [cycleMap_apply_cycle, cycleMap_apply_cycle, hconstant, hconstant] at h + exact add_right_cancel h + have hstep (j : ZMod t) (hj : e (cycle j) = e' (cycle j)) : + e (cycle (j + 1)) = e' (cycle (j + 1)) := by + have h := congrFun he (cycle (j + 1)) + simp only [cycleMap_apply_cycle] at h + have hprev : e (cycle (j + 1 - 1)) = e' (cycle (j + 1 - 1)) := by + exact Eq.mpr (congrArg (fun l : ZMod t => e (cycle l) = e' (cycle l)) + (add_sub_cancel_right j 1)) hj + rw [hprev] at h + exact add_right_cancel h + have hon := forall_of_cyclic_step j₀ hstart hstep + funext i + by_cases hi : ∃ j, cycle j = i + · obtain ⟨j, rfl⟩ := hi + exact hon j + · have hoff : ∀ j, cycle j ≠ i := by simpa only [not_exists] using hi + have h := congrFun he i + simp only [cycleMap, cycleShift_eq_zero cycle U d e hoff, + cycleShift_eq_zero cycle U d e' hoff, sub_zero] at h + exact add_right_cancel h + +theorem cycleMap_bijective_of_inactive [∀ i, Fintype (N i)] + (cycle : ZMod t ↪ ι) (U : ∀ j, AddSubgroup (M (cycle j))) + (d : ∀ j, N (cycle (j - 1)) → U j) + (g : ∀ i, M i → N i) (k : ∀ i, M i) + (j₀ : ZMod t) (hinactive : ¬ DigitActive (g (cycle j₀)) (U j₀)) : + Function.Bijective (cycleMap cycle U d g k) := + (cycleMap_injective_of_inactive cycle U d g k j₀ hinactive).bijective_of_finite + +theorem cycleMap_collision_of_all_active (cycle : ZMod t ↪ ι) + (U : ∀ j, AddSubgroup (M (cycle j))) (g : ∀ i, M i → N i) + (hactive : ∀ j, DigitActive (g (cycle j)) (U j)) : + ∃ (k : ∀ i, M i) (d : ∀ j, N (cycle (j - 1)) → U j) + (ε : ∀ i, N i), ε ≠ 0 ∧ + cycleMap cycle U d g k 0 = cycleMap cycle U d g k ε := by + classical + choose w w' hmem hne using hactive + let ε₀ : ∀ j, N (cycle j) := fun j => g (cycle j) (w j) - g (cycle j) (w' j) + have hε₀ (j : ZMod t) : ε₀ j ≠ 0 := sub_ne_zero.mpr (hne j) + let ε : ∀ i, N i := cycleExtend cycle ε₀ + let k : ∀ i, M i := cycleExtend cycle w + let d : ∀ j, N (cycle (j - 1)) → U j := fun j v => + if v = ε₀ (j - 1) then ⟨w j - w' j, hmem j⟩ else 0 + have hd₀ (j : ZMod t) : d j 0 = 0 := by + simp only [d, ite_eq_right (Ne.symm (hε₀ (j - 1)))] + have hdε (j : ZMod t) : d j (ε (cycle (j - 1))) = ⟨w j - w' j, hmem j⟩ := by + simp only [d, ε, cycleExtend_apply, ite_eq_left rfl] + refine ⟨k, d, ε, ?_, ?_⟩ + · intro hz + have h := congrFun hz (cycle 0) + apply hε₀ 0 + simpa only [ε, cycleExtend_apply, Pi.zero_apply] using h + · funext i + by_cases hi : ∃ j, cycle j = i + · obtain ⟨j, rfl⟩ := hi + calc + cycleMap cycle U d g k 0 (cycle j) = g (cycle j) (w j) := by + simp only [cycleMap_apply_cycle, Pi.zero_apply, hd₀, ZeroMemClass.coe_zero, + sub_zero, zero_add, k, cycleExtend_apply] + _ = ε₀ j + g (cycle j) (w' j) := (sub_add_cancel _ _).symm + _ = cycleMap cycle U d g k ε (cycle j) := by + rw [cycleMap_apply_cycle, hdε] + simp only [k, ε, cycleExtend_apply, sub_sub_cancel] + · have hoff : ∀ j, cycle j ≠ i := by simpa only [not_exists] using hi + simp only [cycleMap, Pi.zero_apply, ε, cycleExtend_eq_zero cycle ε₀ hoff, + cycleShift_eq_zero cycle U d 0 hoff, + cycleShift_eq_zero cycle U d (cycleExtend cycle ε₀) hoff] + +theorem forall_cycleMap_bijective_iff [∀ i, Fintype (N i)] + (cycle : ZMod t ↪ ι) (U : ∀ j, AddSubgroup (M (cycle j))) + (g : ∀ i, M i → N i) : + (∀ (d : ∀ j, N (cycle (j - 1)) → U j) (k : ∀ i, M i), + Function.Bijective (cycleMap cycle U d g k)) ↔ + ∃ j, ¬ DigitActive (g (cycle j)) (U j) := by + constructor + · intro hall + by_contra hnone + have hactive : ∀ j, DigitActive (g (cycle j)) (U j) := by + simpa only [not_exists, not_not] using hnone + obtain ⟨k, d, ε, hε, hcollision⟩ := + cycleMap_collision_of_all_active cycle U g hactive + exact hε ((hall d k).1 hcollision).symm + · rintro ⟨j, hj⟩ d k + exact cycleMap_bijective_of_inactive cycle U d g k j hj + +end CycleCombinatorics + +theorem existsUnique_fixed_comp_iff {A : Type uA} {B : Type uB} (f : A → B) (g : B → A) : + (∃! a, g (f a) = a) ↔ ∃! b, f (g b) = b := by + constructor + · rintro ⟨a, ha, hu⟩ + refine ⟨f a, ?_, ?_⟩ + · exact congrArg f ha + · intro b hb + have hg : g b = a := hu _ (congrArg g hb) + calc + b = f (g b) := hb.symm + _ = f a := congrArg f hg + · rintro ⟨b, hb, hu⟩ + refine ⟨g b, ?_, ?_⟩ + · exact congrArg g hb + · intro a ha + have hf : f a = b := hu _ (congrArg f ha) + calc + a = g (f a) := ha.symm + _ = g b := congrArg g hf + +theorem tiles_offset_iff_permutation + {H : Type uH} {B : Type uB} {C : Type uC} [AddCommGroup H] [AddCommGroup B] [AddCommGroup C] + (q : H →+ B) (ψ : H →+ C) (s : B → H) (hs : ∀ b, q (s b) = b) + (hjoint : Function.Surjective (fun y => (q y, ψ y))) + (Δ : C → B) (F : Finset H) + (hF : ∀ y, y ∈ F ↔ q y = Δ (ψ y)) : + Tiles F (Set.range s) ↔ + ∀ b, Function.Bijective (fun e => e + ψ (s (b - Δ e))) := by + have hinj : Function.Injective s := by + intro b b' h + simpa only [hs] using congrArg q h + have hmem (y : H) (b : B) : y - s b ∈ F ↔ + q y - Δ (ψ y - ψ (s b)) = b := by + rw [hF, map_sub, hs, map_sub] + simp only [sub_eq_iff_eq_add] + exact ⟨fun h => h.trans (add_comm _ _), fun h => h.trans (add_comm _ _)⟩ + have hfibre (y : H) : (∃! b, y - s b ∈ F) ↔ + ∃! e, e + ψ (s (q y - Δ e)) = ψ y := by + calc + _ ↔ ∃! b, q y - Δ (ψ y - ψ (s b)) = b := existsUnique_congr (hmem y) + _ ↔ ∃! e, ψ y - ψ (s (q y - Δ e)) = e := + existsUnique_fixed_comp_iff (fun b => ψ y - ψ (s b)) (fun e => q y - Δ e) + _ ↔ _ := existsUnique_congr (fun e => by rw [sub_eq_iff_eq_add]; exact eq_comm) + rw [tiles_range_iff_unique_base s hinj F] + constructor + · intro h b + apply (Function.bijective_iff_existsUnique _).mpr + intro c + obtain ⟨y, hy⟩ := hjoint (b, c) + have hq : q y = b := congrArg Prod.fst hy + have hψ : ψ y = c := congrArg Prod.snd hy + simpa only [hq, hψ] using (hfibre y).mp (h y) + · intro h y + exact (hfibre y).mpr ((h (q y)).existsUnique (ψ y)) + +section ConcreteTiles + +variable {p : ℕ} [NeZero p] (E : EncodingParameters p) + +def usefulProjection : Ambient E →+ Useful E where + toFun v := fun i => (v.2.2 i).2 + map_zero' := rfl + map_add' _ _ := rfl + +@[simp] theorem usefulProjection_apply (v : Ambient E) (i : Channel p) : + usefulProjection E v i = (v.2.2 i).2 := rfl + +@[simp] theorem usefulProjection_point (o : GraphOutputs E) (b : Base E) : + usefulProjection E (point o b) = o.c b := rfl + +theorem q0_usefulProjection_surjective : + Function.Surjective (fun y : Ambient E => (q0 E y, usefulProjection E y)) := by + rintro ⟨b, c⟩ + let o : GraphOutputs E := ⟨fun _ => c, fun _ => 0, fun _ => 0⟩ + refine ⟨point o b, ?_⟩ + exact Prod.ext (q0_point o b) rfl + +private theorem offset_horizontal_zero (D : Useful E → Low E) + (v : {v : Ambient E // q0 E v = (0, D (usefulProjection E v))}) : + (v : Ambient E).1 = 0 := congrArg Prod.fst v.property + +noncomputable instance offsetFintype (D : Useful E → Low E) : + Fintype {v : Ambient E // q0 E v = (0, D (usefulProjection E v))} := + Fintype.ofInjective (fun v => (v : Ambient E).2) (by + intro v w h + apply Subtype.ext + exact Prod.ext ((offset_horizontal_zero E D v).trans + (offset_horizontal_zero E D w).symm) h) + +def offsetTile (D : Useful E → Low E) : Finset (Ambient E) := + (Finset.univ : Finset {v : Ambient E // q0 E v = (0, D (usefulProjection E v))}).map + ⟨Subtype.val, Subtype.val_injective⟩ + +@[simp] theorem mem_offsetTile (D : Useful E → Low E) (v : Ambient E) : + v ∈ offsetTile E D ↔ q0 E v = (0, D (usefulProjection E v)) := by + constructor + · intro h + obtain ⟨w, _, rfl⟩ := Finset.mem_map.mp h + exact w.property + · intro h + exact Finset.mem_map.mpr ⟨⟨v, h⟩, Finset.mem_univ _, rfl⟩ + +theorem offsetTile_nonempty (D : Useful E → Low E) : (offsetTile E D).Nonempty := by + let o : GraphOutputs E := ⟨fun _ => 0, fun _ => 0, fun _ => 0⟩ + refine ⟨point o (0, D 0), (mem_offsetTile E D _).mpr ?_⟩ + exact q0_point o (0, D 0) + +theorem offsetTile_iff (D : Useful E → Low E) (o : GraphOutputs E) : + Tiles (offsetTile E D) (graph o) ↔ + ∀ x k, Function.Bijective (fun e : Useful E => e + o.c (x, k - D e)) := by + have h := tiles_offset_iff_permutation (q0 E) (usefulProjection E) (point o) + (q0_point o) (q0_usefulProjection_surjective E) (fun e => (0, D e)) + (offsetTile E D) (mem_offsetTile E D) + change Tiles (offsetTile E D) (graph o) ↔ _ at h + constructor + · intro htile x k + have hb := h.mp htile (x, k) + change Function.Bijective (fun e : Useful E => e + o.c (x - 0, k - D e)) at hb + simpa only [sub_zero] using hb + · intro hmap + apply h.mpr + rintro ⟨x, k⟩ + change Function.Bijective (fun e : Useful E => e + o.c (x - 0, k - D e)) + simpa only [sub_zero] using hmap x k + +variable {t : ℕ} [NeZero t] + +def cycleTile (cycle : ZMod t ↪ Channel p) + (labels : ∀ j, Label p (cycle j)) + (d : ∀ j, P E (cycle (j - 1)) → digitSubgroup E (cycle j) (labels j)) : + Finset (Ambient E) := + offsetTile E (cycleShift cycle (fun j => digitSubgroup E (cycle j) (labels j)) d) + +theorem cycleTile_nonempty (cycle : ZMod t ↪ Channel p) + (labels : ∀ j, Label p (cycle j)) + (d : ∀ j, P E (cycle (j - 1)) → digitSubgroup E (cycle j) (labels j)) : + (cycleTile E cycle labels d).Nonempty := offsetTile_nonempty E _ + +theorem cycleTile_iff (cycle : ZMod t ↪ Channel p) + (labels : ∀ j, Label p (cycle j)) + (d : ∀ j, P E (cycle (j - 1)) → digitSubgroup E (cycle j) (labels j)) + (o : GraphOutputs E) (g : ∀ i, Plane → K E i → P E i) + (hfactor : ∀ x k i, o.c (x, k) i = g i x (k i)) : + Tiles (cycleTile E cycle labels d) (graph o) ↔ + ∀ x k, Function.Bijective + (cycleMap cycle (fun j => digitSubgroup E (cycle j) (labels j)) d + (fun i => g i x) k) := by + let U := fun j => digitSubgroup E (cycle j) (labels j) + have hm (x : Plane) (k : Low E) : + (fun e : Useful E => e + o.c (x, k - cycleShift cycle U d e)) = + cycleMap cycle U d (fun i => g i x) k := by + funext e i + change e i + o.c (x, k - cycleShift cycle U d e) i = + e i + g i x (k i - cycleShift cycle U d e i) + exact congrArg (fun v => e i + v) (hfactor x (k - cycleShift cycle U d e) i) + simpa only [cycleTile, hm] using offsetTile_iff E (cycleShift cycle U d) o + +theorem all_cycleTile_iff (cycle : ZMod t ↪ Channel p) + (labels : ∀ j, Label p (cycle j)) + (o : GraphOutputs E) (g : ∀ i, Plane → K E i → P E i) + (hfactor : ∀ x k i, o.c (x, k) i = g i x (k i)) : + (∀ d : ∀ j, P E (cycle (j - 1)) → digitSubgroup E (cycle j) (labels j), + Tiles (cycleTile E cycle labels d) (graph o)) ↔ + ∀ x, ∃ j, ¬ DigitActive (g (cycle j) x) (digitSubgroup E (cycle j) (labels j)) := by + constructor + · intro h x + apply (forall_cycleMap_bijective_iff cycle + (fun j => digitSubgroup E (cycle j) (labels j)) (fun i => g i x)).mp + intro d k + exact (cycleTile_iff E cycle labels d o g hfactor).mp (h d) x k + · intro h d + apply (cycleTile_iff E cycle labels d o g hfactor).mpr + intro x k + obtain ⟨j, hj⟩ := h x + exact cycleMap_bijective_of_inactive cycle + (fun j => digitSubgroup E (cycle j) (labels j)) d (fun i => g i x) k j hj + +def cycleTiles (cycle : ZMod t ↪ Channel p) (labels : ∀ j, Label p (cycle j)) : + Finset (Finset (Ambient E)) := by + classical + exact Finset.univ.image (cycleTile E cycle labels) + +theorem cycleTiles_nonempty (cycle : ZMod t ↪ Channel p) + (labels : ∀ j, Label p (cycle j)) : (cycleTiles E cycle labels).Nonempty := by + classical + exact ⟨cycleTile E cycle labels (fun _ _ => 0), + Finset.mem_image.mpr ⟨(fun _ _ => 0), Finset.mem_univ _, rfl⟩⟩ + +theorem nonempty_of_mem_cycleTiles (cycle : ZMod t ↪ Channel p) + (labels : ∀ j, Label p (cycle j)) {F : Finset (Ambient E)} + (hF : F ∈ cycleTiles E cycle labels) : F.Nonempty := by + classical + obtain ⟨d, _, rfl⟩ := Finset.mem_image.mp hF + exact cycleTile_nonempty E cycle labels d + +theorem forall_mem_cycleTiles_iff (cycle : ZMod t ↪ Channel p) + (labels : ∀ j, Label p (cycle j)) (A : Set (Ambient E)) : + (∀ F ∈ cycleTiles E cycle labels, Tiles F A) ↔ + ∀ d : ∀ j, P E (cycle (j - 1)) → digitSubgroup E (cycle j) (labels j), + Tiles (cycleTile E cycle labels d) A := by + classical + simp only [cycleTiles, Finset.mem_image, Finset.mem_univ, true_and] + constructor + · intro h d + exact h _ ⟨d, rfl⟩ + · intro h F hF + obtain ⟨d, rfl⟩ := hF + exact h d + +theorem cycle_exclusion_iff (cycle : ZMod t ↪ Channel p) + (labels : ∀ j, Label p (cycle j)) (o : GraphOutputs E) + (hdep : HasDependence E o) : + (∀ F ∈ cycleTiles E cycle labels, Tiles F (graph o)) ↔ + ∀ x, ∃ j, ¬ Active E o (cycle j) x (labels j) := by + rw [forall_mem_cycleTiles_iff] + exact all_cycleTile_iff E cycle labels o (usefulAt E o) (usefulAt_factor E hdep) + +end ConcreteTiles + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/CyclicCRT.lean b/lean/OAI/Geometry/PeriodicTiling/CyclicCRT.lean new file mode 100644 index 0000000000000000000000000000000000000000..ecc098ec9e9b773fcdb0ba42a5d38d8012f38eb0 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/CyclicCRT.lean @@ -0,0 +1,78 @@ +import OAI.Geometry.PeriodicTiling.EncodingParameters +import Mathlib.Data.ZMod.QuotientRing +import Mathlib.Algebra.Group.Pi.Basic + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree + +open scoped BigOperators + +variable {p : ℕ} [NeZero p] (E : EncodingParameters p) + +def digitEquivRing (i : Channel p) : + ZMod (E.r i) ≃+* (∀ j : Label p i, ZMod (E.digitPrime i j)) := + ZMod.prodEquivPi (E.digitPrime i) (E.digitPrime_pairwise i) + +def digitEquiv (i : Channel p) : + ZMod (E.r i) ≃+ (∀ j : Label p i, ZMod (E.digitPrime i j)) := + (digitEquivRing E i).toAddEquiv + +theorem digitPrime_dvd_r (i : Channel p) (j : Label p i) : + E.digitPrime i j ∣ E.r i := + Finset.dvd_prod_of_mem (E.digitPrime i) (Finset.mem_univ j) + +@[simp] theorem digitEquiv_intCast (i : Channel p) (z : ℤ) (j : Label p i) : + digitEquiv E i (z : ZMod (E.r i)) j = (z : ZMod (E.digitPrime i j)) := by + exact congrArg (fun f : ∀ j : Label p i, ZMod (E.digitPrime i j) => f j) + (map_intCast (digitEquivRing E i) z) + +theorem digitEquiv_apply (i : Channel p) (x : ZMod (E.r i)) (j : Label p i) : + digitEquiv E i x j = (ZMod.cast x : ZMod (E.digitPrime i j)) := by + obtain ⟨z, rfl⟩ := ZMod.intCast_surjective x + rw [digitEquiv_intCast, ZMod.cast_intCast (digitPrime_dvd_r E i j)] + +def digitSubgroup (i : Channel p) (j : Label p i) : AddSubgroup (ZMod (E.r i)) where + carrier := {x | ∀ k : Label p i, k ≠ j → digitEquiv E i x k = 0} + zero_mem' := by + intro k _hk + simp + add_mem' := by + intro x y hx hy k hk + simp [map_add, hx k hk, hy k hk] + neg_mem' := by + intro x hx k hk + simp [map_neg, hx k hk] + +@[simp] theorem mem_digitSubgroup (i : Channel p) (j : Label p i) (x : ZMod (E.r i)) : + x ∈ digitSubgroup E i j ↔ + ∀ k : Label p i, k ≠ j → digitEquiv E i x k = 0 := Iff.rfl + +theorem sub_mem_digitSubgroup_iff (i : Channel p) (j : Label p i) + (x y : ZMod (E.r i)) : + x - y ∈ digitSubgroup E i j ↔ + ∀ k : Label p i, k ≠ j → digitEquiv E i x k = digitEquiv E i y k := by + simp [mem_digitSubgroup, map_sub, sub_eq_zero] + +def digitSingle (i : Channel p) (j : Label p i) (x : ZMod (E.digitPrime i j)) : + ZMod (E.r i) := + (digitEquiv E i).symm (Pi.single j x) + +@[simp] theorem digitEquiv_digitSingle (i : Channel p) (j : Label p i) + (x : ZMod (E.digitPrime i j)) : + digitEquiv E i (digitSingle E i j x) = Pi.single j x := + (digitEquiv E i).apply_symm_apply _ + +theorem digitSingle_mem (i : Channel p) (j : Label p i) + (x : ZMod (E.digitPrime i j)) : digitSingle E i j x ∈ digitSubgroup E i j := by + intro k hk + rw [digitEquiv_digitSingle] + exact Pi.single_eq_of_ne (M := fun j : Label p i => ZMod (E.digitPrime i j)) hk x + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/CyclicCoordinates.lean b/lean/OAI/Geometry/PeriodicTiling/CyclicCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..24c2daa53ae082fa2b7a7cab0ddcb3e00d15c767 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/CyclicCoordinates.lean @@ -0,0 +1,135 @@ +import OAI.Geometry.PeriodicTiling.CyclicTypes +import OAI.Geometry.PeriodicTiling.CyclicShear + +namespace OAI + +namespace PeriodicTilingThree + +noncomputable section + +variable {p : ℕ} [NeZero p] (E : EncodingParameters p) + +abbrev low (i : Channel p) : ZMod ((E.r i) ^ 2) →+ K E i := + CyclicShear.low (E.r i) + +abbrev highMul (i : Channel p) : K E i →+ ZMod ((E.r i) ^ 2) := + CyclicShear.highMul (E.r i) + +abbrev shear (i : Channel p) (x : ℤ) (k b : K E i) : ZMod ((E.r i) ^ 2) := + CyclicShear.shear (E.r i) x k b + +abbrev shearEquiv (i : Channel p) (x : ℤ) (k : K E i) : + K E i ≃ {v : ZMod ((E.r i) ^ 2) // low E i v = k} := + CyclicShear.shearEquiv (E.r i) x k + +@[simp] theorem low_shear (i : Channel p) (x : ℤ) (k b : K E i) : + low E i (shear E i x k b) = k := CyclicShear.low_shear _ _ _ _ + +theorem highMul_injective (i : Channel p) : Function.Injective (highMul E i) := + CyclicShear.highMul_injective _ + +@[simp] theorem low_highMul (i : Channel p) (b : K E i) : low E i (highMul E i b) = 0 := + CyclicShear.low_highMul _ _ + +theorem shear_injective (i : Channel p) (x : ℤ) (k : K E i) : + Function.Injective (shear E i x k) := CyclicShear.shear_injective _ _ _ + +theorem shear_add (i : Channel p) (x h : ℤ) (k b : K E i) : + shear E i (x + h) (k + (h : K E i)) b = + shear E i x k b + (h : ZMod ((E.r i) ^ 2)) := + CyclicShear.shear_add _ _ _ _ _ + +theorem shear_source_add (i : Channel p) (x h : ℤ) (k l b : K E i) + (hl : (h : K E i) = l) : + shear E i (x - h) (k - l) b + (h : ZMod ((E.r i) ^ 2)) = shear E i x k b := + CyclicShear.shear_source_add _ _ _ _ _ _ hl + +def q0 : Ambient E →+ Base E where + toFun g := (g.1, fun i => low E i (g.2.2 i).1) + map_zero' := by + refine Prod.ext ?_ ?_ + · rfl + · funext i + exact map_zero (low E i) + map_add' g h := by + refine Prod.ext ?_ ?_ + · rfl + · funext i + exact map_add (low E i) (g.2.2 i).1 (h.2.2 i).1 + +@[simp] theorem q0_apply (g : Ambient E) : + q0 E g = (g.1, fun i => low E i (g.2.2 i).1) := rfl + +variable {E} + +def point (o : GraphOutputs E) (b : Base E) : Ambient E := + (b.1, o.z b, fun i => (shear E i b.1.1 (b.2 i) (o.beta b i), o.c b i)) + +@[simp] theorem point_horizontal (o : GraphOutputs E) (b : Base E) : (point o b).1 = b.1 := rfl +@[simp] theorem point_z (o : GraphOutputs E) (b : Base E) : (point o b).2.1 = o.z b := rfl +@[simp] theorem point_c (o : GraphOutputs E) (b : Base E) (i : Channel p) : + ((point o b).2.2 i).2 = o.c b i := rfl +@[simp] theorem point_v (o : GraphOutputs E) (b : Base E) (i : Channel p) : + ((point o b).2.2 i).1 = shear E i b.1.1 (b.2 i) (o.beta b i) := rfl + +@[simp] theorem q0_point (o : GraphOutputs E) (b : Base E) : q0 E (point o b) = b := by + refine Prod.ext ?_ ?_ + · rfl + · funext i + exact low_shear E i b.1.1 (b.2 i) (o.beta b i) + +theorem point_injective (o : GraphOutputs E) : Function.Injective (point o) := by + intro b d h + have hq := congrArg (q0 E) h + simpa only [q0_point] using hq + +def graph (o : GraphOutputs E) : Set (Ambient E) := Set.range (point o) + +@[simp] theorem point_mem_graph (o : GraphOutputs E) (b : Base E) : point o b ∈ graph o := + ⟨b, rfl⟩ + +theorem eq_point_of_mem_graph (o : GraphOutputs E) {g : Ambient E} (hg : g ∈ graph o) : + g = point o (q0 E g) := by + obtain ⟨b, rfl⟩ := hg + rw [q0_point] + +def zeroOutputs (E : EncodingParameters p) : GraphOutputs E := + ⟨fun _ _ => 0, fun _ _ => 0, fun _ => 0⟩ + +theorem q0_surjective (E : EncodingParameters p) : Function.Surjective (q0 E) := by + intro b + exact ⟨point (zeroOutputs E) b, q0_point _ _⟩ + +private theorem section_low (s : Base E → Ambient E) (hs : ∀ b, q0 E (s b) = b) + (b : Base E) (i : Channel p) : low E i ((s b).2.2 i).1 = b.2 i := + congrArg (fun t : Base E => t.2 i) (hs b) + +def outputsOfSection (s : Base E → Ambient E) (hs : ∀ b, q0 E (s b) = b) : GraphOutputs E where + c b i := ((s b).2.2 i).2 + beta b i := (shearEquiv E i b.1.1 (b.2 i)).symm + ⟨((s b).2.2 i).1, section_low s hs b i⟩ + z b := (s b).2.1 + +@[simp] theorem point_outputsOfSection (s : Base E → Ambient E) + (hs : ∀ b, q0 E (s b) = b) (b : Base E) : + point (outputsOfSection s hs) b = s b := by + refine Prod.ext ?_ ?_ + · exact (congrArg (fun t : Base E => t.1) (hs b)).symm + · refine Prod.ext ?_ ?_ + · rfl + · funext i + refine Prod.ext ?_ ?_ + · exact congrArg Subtype.val ((shearEquiv E i b.1.1 (b.2 i)).apply_symm_apply + ⟨((s b).2.2 i).1, section_low s hs b i⟩) + · rfl + +theorem graph_outputsOfSection (s : Base E → Ambient E) (hs : ∀ b, q0 E (s b) = b) : + graph (outputsOfSection s hs) = Set.range s := by + exact congrArg (fun f : Base E → Ambient E => Set.range f) + (funext (point_outputsOfSection s hs)) + +end + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/CyclicCounterexample.lean b/lean/OAI/Geometry/PeriodicTiling/CyclicCounterexample.lean new file mode 100644 index 0000000000000000000000000000000000000000..3a4a84c41759d6d481900031f563d7cae5d097d5 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/CyclicCounterexample.lean @@ -0,0 +1,35 @@ +import OAI.Geometry.PeriodicTiling.CommonSolution +import OAI.Geometry.PeriodicTiling.EncodedSystemObstruction +import OAI.Geometry.PeriodicTiling.EncodingPrimeSelection +import OAI.Geometry.PeriodicTiling.CyclicFactorCRT +import OAI.Geometry.PeriodicTiling.CyclicSystemStacking + +namespace OAI + +namespace PeriodicTilingThree + +theorem cyclic_counterexample_of_parameters {p : ℕ} [NeZero p] + (E : EncodingParameters p) : + ∃ Q : ℕ, 0 < Q ∧ + ∃ F : Finset (Plane × ZMod Q), F.Nonempty ∧ + (∃ A, Tiles F A) ∧ ∀ A, Tiles F A → ¬ FullyPeriodic A := by + classical + let : IsAddCyclic (V E) := isAddCyclic_of_surjective + (finiteFactorEquiv E).symm (finiteFactorEquiv E).symm.surjective + apply exists_cyclic_stack_of_system (V E) (testTile E) + · exact ⟨CommonModel.commonGraph E, CommonModel.commonGraph_tiles_testTile E⟩ + · intro A hA + exact testTile_not_fully_periodic E hA + +theorem exists_cyclic_counterexample : + ∃ Q : ℕ, 0 < Q ∧ + ∃ F : Finset (Plane × ZMod Q), F.Nonempty ∧ + (∃ A, Tiles F A) ∧ ∀ A, Tiles F A → ¬ FullyPeriodic A := by + obtain ⟨p, hpbound, hp⟩ := Nat.exists_infinite_primes 201 + let : NeZero p := ⟨hp.ne_zero⟩ + let E : EncodingParameters p := encodingParameters hp (by omega) + exact cyclic_counterexample_of_parameters E + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/CyclicFactorCRT.lean b/lean/OAI/Geometry/PeriodicTiling/CyclicFactorCRT.lean new file mode 100644 index 0000000000000000000000000000000000000000..901912b7f894118a3d6c24334c24b01256038d2c --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/CyclicFactorCRT.lean @@ -0,0 +1,111 @@ +import OAI.Geometry.PeriodicTiling.CyclicTypes +import Mathlib.Data.ZMod.QuotientRing +import Mathlib.Algebra.Group.Prod +import Mathlib.Algebra.Group.Equiv.Basic + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree + +open scoped BigOperators + +variable {p : ℕ} [NeZero p] + +namespace EncodingParameters + +variable (E : EncodingParameters p) + +def blockModulus (i : Channel p) : ℕ := (E.r i) ^ 2 * E.a i * E.b i +def cyclicOrder : ℕ := p ^ 4 * ∏ i : Channel p, E.blockModulus i + +theorem blockModulus_pos (i : Channel p) : 0 < E.blockModulus i := + Nat.mul_pos (Nat.mul_pos (pow_pos (E.r_pos i) 2) (E.a_pos i)) (E.b_pos i) + +theorem cyclicOrder_pos : 0 < E.cyclicOrder := + Nat.mul_pos (pow_pos E.p_prime.pos 4) + (Finset.prod_pos (fun i _ => E.blockModulus_pos i)) + +instance blockModulus_neZero (i : Channel p) : NeZero (E.blockModulus i) := + ⟨(E.blockModulus_pos i).ne'⟩ +instance cyclicOrder_neZero : NeZero E.cyclicOrder := ⟨E.cyclicOrder_pos.ne'⟩ + +theorem a_coprime_b_all + {p : ℕ} [NeZero p] (E : EncodingParameters p) + (i j : Channel p) : Nat.Coprime (E.a i) (E.b j) := by + apply E.prime_coprime + simp + +theorem a_pairwise_coprime + {p : ℕ} [NeZero p] (E : EncodingParameters p) + : Pairwise (fun i j : Channel p => Nat.Coprime (E.a i) (E.a j)) := by + intro i j hij + apply E.prime_coprime + simpa using hij + +theorem b_pairwise_coprime + {p : ℕ} [NeZero p] (E : EncodingParameters p) + : Pairwise (fun i j : Channel p => Nat.Coprime (E.b i) (E.b j)) := by + intro i j hij + apply E.prime_coprime + simpa using hij + +theorem blockModulus_pairwise : + Pairwise (fun i j : Channel p => Nat.Coprime (E.blockModulus i) (E.blockModulus j)) := by + intro i j hij + have hrr := (E.r_pairwise_coprime hij).pow 2 2 + have hra := (E.r_coprime_a i j).pow_left 2 + have hrb := (E.r_coprime_b i j).pow_left 2 + have har := (E.r_coprime_a j i).symm.pow_right 2 + have haa := E.a_pairwise_coprime hij + have hab := E.a_coprime_b_all i j + have hbr := (E.r_coprime_b j i).symm.pow_right 2 + have hba := (E.a_coprime_b_all j i).symm + have hbb := E.b_pairwise_coprime hij + simp only [blockModulus, Nat.coprime_mul_iff_left, Nat.coprime_mul_iff_right] + exact ⟨⟨⟨⟨hrr, har⟩, hbr⟩, ⟨⟨hra, haa⟩, hba⟩⟩, ⟨⟨hrb, hab⟩, hbb⟩⟩ + +theorem p_coprime_blockModulus (i : Channel p) : + Nat.Coprime p (E.blockModulus i) := by + have hr := (E.r_coprime_p i).symm.pow_right 2 + have ha : Nat.Coprime p (E.a i) := (E.prime_coprime_p (.inl i)).symm + have hb : Nat.Coprime p (E.b i) := (E.prime_coprime_p (.inr (.inl i))).symm + simp only [blockModulus, Nat.coprime_mul_iff_right] + exact ⟨⟨hr, ha⟩, hb⟩ + +theorem p4_coprime_blocks : + Nat.Coprime (p ^ 4) (∏ i : Channel p, E.blockModulus i) := by + apply Nat.coprime_fintype_prod_right_iff.mpr + intro i + exact (E.p_coprime_blockModulus i).pow_left 4 + +end EncodingParameters + +variable (E : EncodingParameters p) + +def channelCRT (i : Channel p) : + ZMod (E.blockModulus i) ≃+ (ZMod ((E.r i) ^ 2) × P E i) := by + have hRA : Nat.Coprime ((E.r i) ^ 2) (E.a i) := (E.r_coprime_a i i).pow_left 2 + have hRAB : Nat.Coprime ((E.r i) ^ 2 * E.a i) (E.b i) := + Nat.coprime_mul_iff_left.mpr ⟨(E.r_coprime_b i i).pow_left 2, E.a_coprime_b i⟩ + exact ((ZMod.chineseRemainder hRAB).toAddEquiv.trans + (AddEquiv.prodCongr (ZMod.chineseRemainder hRA).toAddEquiv + (AddEquiv.refl (ZMod (E.b i))))).trans AddEquiv.prodAssoc + +def cyclicToFiniteFactor : ZMod E.cyclicOrder ≃+ V E := + (ZMod.chineseRemainder E.p4_coprime_blocks).toAddEquiv.trans + (AddEquiv.prodCongr (AddEquiv.refl (ZMod (p ^ 4))) + ((ZMod.prodEquivPi E.blockModulus E.blockModulus_pairwise).toAddEquiv.trans + (AddEquiv.piCongrRight (fun i => channelCRT E i)))) + +def finiteFactorEquiv : V E ≃+ ZMod E.cyclicOrder := (cyclicToFiniteFactor E).symm + +def ambientCyclicEquiv : Ambient E ≃+ (Plane × ZMod E.cyclicOrder) := + AddEquiv.prodCongr (AddEquiv.refl Plane) (finiteFactorEquiv E) + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/CyclicQuotient.lean b/lean/OAI/Geometry/PeriodicTiling/CyclicQuotient.lean new file mode 100644 index 0000000000000000000000000000000000000000..c4dbcb4efced01181d9d8d4652b9e0a142b8f71e --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/CyclicQuotient.lean @@ -0,0 +1,156 @@ +import OAI.Geometry.PeriodicTiling.TilingBasic +import Mathlib.Data.ZMod.Basic +import Mathlib.LinearAlgebra.Matrix.Notation +import Mathlib.Tactic.Abel +import Mathlib.Tactic.NormNum + +namespace OAI + +namespace PeriodicTilingThree +namespace CyclicQuotient + +abbrev Group (Q : ℕ) := Plane × ZMod Q + +def projection (Q : ℕ) : Lattice 3 →+ Group Q where + toFun z := ((z 0, z 1), (z 2 : ZMod Q)) + map_zero' := by simp + map_add' x y := by simp + +def kernelStep (Q : ℕ) : Lattice 3 := ![0, 0, (Q : ℤ)] + +@[simp] theorem projection_kernelStep (Q : ℕ) : + projection Q (kernelStep Q) = 0 := by + simp [projection, kernelStep] + +theorem kernelStep_ne_zero (Q : ℕ) [NeZero Q] : kernelStep Q ≠ 0 := by + intro h + have hz : (Q : ℤ) = 0 := by + simpa [kernelStep] using congrFun h 2 + exact (NeZero.ne Q) (Int.ofNat_inj.mp hz) + +def lift (Q : ℕ) (g : Group Q) : Lattice 3 := + ![g.1.1, g.1.2, (g.2.val : ℤ)] + +@[simp] theorem projection_lift (Q : ℕ) [NeZero Q] (g : Group Q) : + projection Q (lift Q g) = g := by + rcases g with ⟨⟨x, y⟩, r⟩ + simp [projection, lift] + +@[simp] theorem lift_zero (Q : ℕ) : lift Q 0 = 0 := by + ext i + fin_cases i <;> simp [lift] + +theorem projection_surjective (Q : ℕ) [NeZero Q] : + Function.Surjective (projection Q) := + fun g => ⟨lift Q g, projection_lift Q g⟩ + +theorem lift_injective (Q : ℕ) [NeZero Q] : Function.Injective (lift Q) := by + intro g h hgh + have he := congrArg (projection Q) hgh + simpa only [projection_lift] using he + +theorem mem_ker_iff_zsmul_kernelStep (Q : ℕ) (z : Lattice 3) : + z ∈ (projection Q).ker ↔ ∃ k : ℤ, z = k • kernelStep Q := by + constructor + · intro hz + have hp : projection Q z = 0 := hz + have h0 : z 0 = 0 := congrArg (fun g : Group Q => g.1.1) hp + have h1 : z 1 = 0 := congrArg (fun g : Group Q => g.1.2) hp + have h2 : (z 2 : ZMod Q) = 0 := congrArg (fun g : Group Q => g.2) hp + obtain ⟨k, hk⟩ := (ZMod.intCast_zmod_eq_zero_iff_dvd (z 2) Q).mp h2 + refine ⟨k, ?_⟩ + ext i + fin_cases i <;> simp [kernelStep, h0, h1, hk, mul_comm] + · rintro ⟨k, rfl⟩ + change projection Q (k • kernelStep Q) = 0 + simp only [map_zsmul, projection_kernelStep, zsmul_zero] + +def representatives (Q : ℕ) (F : Finset (Group Q)) : Finset (Lattice 3) := + F.image (lift Q) + +theorem lift_mem_representatives (Q : ℕ) {F : Finset (Group Q)} + {f : Group Q} (hf : f ∈ F) : lift Q f ∈ representatives Q F := + Finset.mem_image_of_mem _ hf + +theorem projection_mem_of_mem_representatives (Q : ℕ) [NeZero Q] + {F : Finset (Group Q)} {u : Lattice 3} (hu : u ∈ representatives Q F) : + projection Q u ∈ F := by + obtain ⟨f, hf, rfl⟩ := Finset.mem_image.mp hu + simpa only [projection_lift] using hf + +theorem projection_injOn_representatives (Q : ℕ) [NeZero Q] + (F : Finset (Group Q)) : + Set.InjOn (projection Q) (representatives Q F : Set (Lattice 3)) := by + intro u hu v hv huv + obtain ⟨f, hf, rfl⟩ := Finset.mem_image.mp hu + obtain ⟨g, hg, rfl⟩ := Finset.mem_image.mp hv + have hfg : f = g := by simpa only [projection_lift] using huv + exact congrArg (lift Q) hfg + +theorem projection_image_representatives (Q : ℕ) [NeZero Q] + (F : Finset (Group Q)) : + (representatives Q F).image (projection Q) = F := by + ext f + constructor + · intro hf + obtain ⟨u, hu, huf⟩ := Finset.mem_image.mp hf + rw [← huf] + exact projection_mem_of_mem_representatives Q hu + · intro hf + exact Finset.mem_image.mpr + ⟨lift Q f, lift_mem_representatives Q hf, projection_lift Q f⟩ + +theorem zero_mem_representatives (Q : ℕ) {F : Finset (Group Q)} + (hF : 0 ∈ F) : 0 ∈ representatives Q F := by + simpa only [lift_zero] using lift_mem_representatives Q hF + +theorem eq_zero_of_mem_representatives_mem_ker (Q : ℕ) [NeZero Q] + {F : Finset (Group Q)} {u : Lattice 3} + (hu : u ∈ representatives Q F) (hk : u ∈ (projection Q).ker) : u = 0 := by + obtain ⟨f, hf, rfl⟩ := Finset.mem_image.mp hu + have hf0 : f = 0 := by + simpa only [AddMonoidHom.mem_ker, projection_lift] using hk + rw [hf0, lift_zero] + +theorem kernelStep_not_mem_representatives (Q : ℕ) [NeZero Q] + (F : Finset (Group Q)) : kernelStep Q ∉ representatives Q F := by + intro h + exact kernelStep_ne_zero Q + (eq_zero_of_mem_representatives_mem_ker Q h (projection_kernelStep Q)) + +theorem preimage_tiles (Q : ℕ) [NeZero Q] + {F : Finset (Group Q)} {A : Set (Group Q)} (h : Tiles F A) : + Tiles (representatives Q F) ((projection Q) ⁻¹' A) := by + rw [tiles_iff_unique_tile] + intro x + obtain ⟨f, hf, huniq⟩ := (tiles_iff_unique_tile.mp h) (projection Q x) + refine ⟨⟨lift Q f, lift_mem_representatives Q f.property⟩, ?_, ?_⟩ + · change projection Q (x - lift Q f) ∈ A + simpa only [map_sub, projection_lift] using hf + · intro u hu + have hpu : projection Q u ∈ F := + projection_mem_of_mem_representatives Q u.property + have hp : projection Q x - projection Q u ∈ A := by + simpa only [Set.mem_preimage, map_sub] using hu + have he := huniq ⟨projection Q u, hpu⟩ hp + apply Subtype.ext + apply projection_injOn_representatives Q F u.property + (lift_mem_representatives Q f.property) + simpa only [projection_lift] using congrArg Subtype.val he + +theorem period_preimage_of_mem_ker (Q : ℕ) (A : Set (Group Q)) + {k : Lattice 3} (hk : k ∈ (projection Q).ker) : + Period ((projection Q) ⁻¹' A) k := by + intro x + change projection Q (x + k) ∈ A ↔ projection Q x ∈ A + have hk' : projection Q k = 0 := hk + simp only [map_add, hk', add_zero] + +theorem period_preimage_kernelStep (Q : ℕ) (A : Set (Group Q)) : + Period ((projection Q) ⁻¹' A) (kernelStep Q) := + period_preimage_of_mem_ker Q A (projection_kernelStep Q) + +end CyclicQuotient +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/CyclicShear.lean b/lean/OAI/Geometry/PeriodicTiling/CyclicShear.lean new file mode 100644 index 0000000000000000000000000000000000000000..1a2620eb96dac72c4e3c33ca2cfa7e414ff198dd --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/CyclicShear.lean @@ -0,0 +1,153 @@ +import Mathlib.Data.ZMod.Basic +import Mathlib.Tactic.Abel +import Mathlib.Tactic.NormNum +import Mathlib.Tactic.Positivity + +namespace OAI + +namespace PeriodicTilingThree.CyclicShear + +noncomputable section + +def low (r : ℕ) : ZMod (r ^ 2) →+ ZMod r := + (ZMod.castHom (dvd_pow_self r (by decide : 2 ≠ 0)) (ZMod r)).toAddMonoidHom + +@[simp] theorem low_natCast (r m : ℕ) : low r (m : ZMod (r ^ 2)) = (m : ZMod r) := by + simp [low] + +@[simp] theorem low_intCast (r : ℕ) (m : ℤ) : + low r (m : ZMod (r ^ 2)) = (m : ZMod r) := by + simp [low] + +private def highInteger (r : ℕ) : ℤ →+ ZMod (r ^ 2) where + toFun z := (r : ZMod (r ^ 2)) * (z : ZMod (r ^ 2)) + map_zero' := by simp + map_add' x y := by simp [mul_add] + +private theorem highInteger_modulus (r : ℕ) : highInteger r r = 0 := by + dsimp only [highInteger] + change (r : ZMod (r ^ 2)) * ((r : ℤ) : ZMod (r ^ 2)) = 0 + rw [Int.cast_natCast, ← pow_two, ← Nat.cast_pow] + exact ZMod.natCast_self (r ^ 2) + +def highMul (r : ℕ) : ZMod r →+ ZMod (r ^ 2) := + ZMod.lift r ⟨highInteger r, highInteger_modulus r⟩ + +@[simp] theorem highMul_intCast (r : ℕ) (m : ℤ) : + highMul r (m : ZMod r) = (r : ZMod (r ^ 2)) * (m : ZMod (r ^ 2)) := by + exact ZMod.lift_coe r ⟨highInteger r, highInteger_modulus r⟩ m + +@[simp] theorem highMul_natCast (r m : ℕ) : + highMul r (m : ZMod r) = (r : ZMod (r ^ 2)) * (m : ZMod (r ^ 2)) := by + simpa using highMul_intCast r (m : ℤ) + +theorem highMul_apply (r : ℕ) [NeZero r] (b : ZMod r) : + highMul r b = (r : ZMod (r ^ 2)) * (b.val : ZMod (r ^ 2)) := by + simpa using highMul_natCast r b.val + +theorem highMul_val (r : ℕ) [NeZero r] (b : ZMod r) : + (highMul r b).val = r * b.val := by + rw [highMul_apply, ← Nat.cast_mul] + apply ZMod.val_natCast_of_lt + have hr : 0 < r := Nat.pos_of_ne_zero (NeZero.ne r) + simpa [pow_two] using Nat.mul_lt_mul_of_pos_left (ZMod.val_lt b) hr + +theorem highMul_injective (r : ℕ) [NeZero r] : Function.Injective (highMul r) := by + intro b c h + have hv := congrArg ZMod.val h + rw [highMul_val, highMul_val] at hv + have hv' : b.val = c.val := Nat.eq_of_mul_eq_mul_left + (Nat.pos_of_ne_zero (NeZero.ne r)) hv + exact ZMod.val_injective r hv' + +@[simp] theorem low_highMul (r : ℕ) (b : ZMod r) : low r (highMul r b) = 0 := by + obtain ⟨m, rfl⟩ := ZMod.intCast_surjective b + rw [highMul_intCast] + change (ZMod.castHom (dvd_pow_self r (by decide : 2 ≠ 0)) (ZMod r)) + ((r : ZMod (r ^ 2)) * (m : ZMod (r ^ 2))) = 0 + simp only [map_mul, map_natCast, map_intCast, ZMod.natCast_self, zero_mul] + +theorem mem_range_highMul_iff (r : ℕ) [NeZero r] (v : ZMod (r ^ 2)) : + v ∈ Set.range (highMul r) ↔ low r v = 0 := by + constructor + · rintro ⟨b, rfl⟩ + exact low_highMul r b + · intro h + have hcast : (v.val : ZMod r) = 0 := by + have hv := congrArg (low r) (ZMod.natCast_zmod_val v) + simpa only [low_natCast, h] using hv + obtain ⟨m, hm⟩ := (ZMod.natCast_eq_zero_iff v.val r).mp hcast + refine ⟨(m : ZMod r), ?_⟩ + rw [highMul_natCast, ← Nat.cast_mul, ← hm] + exact ZMod.natCast_zmod_val v + +theorem range_highMul (r : ℕ) [NeZero r] : + Set.range (highMul r) = ((low r).ker : Set (ZMod (r ^ 2))) := by + ext v + exact mem_range_highMul_iff r v + +def highEquiv (r : ℕ) [NeZero r] : ZMod r ≃ (low r).ker := + Equiv.ofBijective (fun b => ⟨highMul r b, low_highMul r b⟩) + ⟨fun _ _ h => highMul_injective r (congrArg Subtype.val h), by + intro v + obtain ⟨b, hb⟩ := (mem_range_highMul_iff r v).mpr v.property + exact ⟨b, Subtype.ext hb⟩⟩ + +@[simp] theorem highEquiv_apply (r : ℕ) [NeZero r] (b : ZMod r) : + (highEquiv r b : ZMod (r ^ 2)) = highMul r b := rfl + +def shear (r : ℕ) (x : ℤ) (k b : ZMod r) : ZMod (r ^ 2) := + (x : ZMod (r ^ 2)) + ((k - (x : ZMod r)).val : ZMod (r ^ 2)) + highMul r b + +@[simp] theorem low_shear (r : ℕ) [NeZero r] (x : ℤ) (k b : ZMod r) : + low r (shear r x k b) = k := by + simp only [shear, map_add, low_intCast, low_natCast, low_highMul, add_zero, + ZMod.natCast_zmod_val] + abel + +theorem shear_injective (r : ℕ) [NeZero r] (x : ℤ) (k : ZMod r) : + Function.Injective (shear r x k) := by + intro b c h + apply highMul_injective r + exact add_left_cancel h + +theorem shear_eq_zero_add (r : ℕ) (x : ℤ) (k b : ZMod r) : + shear r x k b = shear r x k 0 + highMul r b := by + simp [shear] + +theorem shear_surjective_fiber (r : ℕ) [NeZero r] (x : ℤ) (k : ZMod r) : + Function.Surjective (fun b : ZMod r => + (⟨shear r x k b, low_shear r x k b⟩ : {v : ZMod (r ^ 2) // low r v = k})) := by + intro v + have hz : low r (v.val - shear r x k 0) = 0 := by + rw [map_sub, v.property, low_shear, sub_self] + obtain ⟨b, hb⟩ := (mem_range_highMul_iff r _).mpr hz + refine ⟨b, Subtype.ext ?_⟩ + change shear r x k b = v.val + rw [shear_eq_zero_add, hb] + abel + +def shearEquiv (r : ℕ) [NeZero r] (x : ℤ) (k : ZMod r) : + ZMod r ≃ {v : ZMod (r ^ 2) // low r v = k} := + Equiv.ofBijective (fun b => ⟨shear r x k b, low_shear r x k b⟩) + ⟨fun _ _ h => shear_injective r x k (congrArg Subtype.val h), + shear_surjective_fiber r x k⟩ + +@[simp] theorem shearEquiv_apply (r : ℕ) [NeZero r] (x : ℤ) (k b : ZMod r) : + (shearEquiv r x k b : ZMod (r ^ 2)) = shear r x k b := rfl + +theorem shear_add (r : ℕ) (x h : ℤ) (k b : ZMod r) : + shear r (x + h) (k + (h : ZMod r)) b = shear r x k b + (h : ZMod (r ^ 2)) := by + simp only [shear, Int.cast_add] + abel_nf + +theorem shear_source_add (r : ℕ) (x h : ℤ) (k l b : ZMod r) + (hl : (h : ZMod r) = l) : + shear r (x - h) (k - l) b + (h : ZMod (r ^ 2)) = shear r x k b := by + simpa [hl] using (shear_add r (x - h) h (k - l) b).symm + +end + +end PeriodicTilingThree.CyclicShear + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/CyclicStack.lean b/lean/OAI/Geometry/PeriodicTiling/CyclicStack.lean new file mode 100644 index 0000000000000000000000000000000000000000..66b0051cd35e476e6096ce3dfeae28d0b6c2975c --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/CyclicStack.lean @@ -0,0 +1,149 @@ +import OAI.Geometry.PeriodicTiling.Stacking +import Mathlib.GroupTheory.SpecificGroups.Cyclic + +namespace OAI + +universe uV uι + +namespace PeriodicTilingThree + +theorem not_dvd_card_of_lt (V : Type uV) [AddCommGroup V] [Finite V] + {q : ℕ} (hq : Nat.card V < q) : ¬ q ∣ Nat.card V := by + intro hdiv + exact (Nat.not_le_of_gt hq) (Nat.le_of_dvd Nat.card_pos hdiv) + +theorem cyclicStackOrder_pos (V : Type uV) [AddCommGroup V] [Finite V] + (q : ℕ) (hq : q.Prime) : 0 < q * Nat.card V := + Nat.mul_pos hq.pos Nat.card_pos + +noncomputable def freshCyclicEquiv + (V : Type uV) [AddCommGroup V] [Finite V] [IsAddCyclic V] + (q : ℕ) (hq : q.Prime) (havoid : ¬ q ∣ Nat.card V) : + V × ZMod q ≃+ ZMod (q * Nat.card V) := by + let eV : V ≃+ ZMod (Nat.card V) := + (zmodAddCyclicAddEquiv (G := V) inferInstance).symm + let hcop : q.Coprime (Nat.card V) := + hq.coprime_iff_not_dvd.mpr havoid + exact + ((eV.prodCongr (AddEquiv.refl (ZMod q))).trans + (AddEquiv.prodComm : + ZMod (Nat.card V) × ZMod q ≃+ + ZMod q × ZMod (Nat.card V))).trans + (ZMod.chineseRemainder hcop).toAddEquiv.symm + +noncomputable def cyclicStackEquiv + (V : Type uV) [AddCommGroup V] [Finite V] [IsAddCyclic V] + (q : ℕ) (hq : q.Prime) (havoid : ¬ q ∣ Nat.card V) : + ((Plane × V) × ZMod q) ≃+ Plane × ZMod (q * Nat.card V) := + (AddEquiv.prodAssoc : + ((Plane × V) × ZMod q) ≃+ Plane × (V × ZMod q)).trans + ((AddEquiv.refl Plane).prodCongr (freshCyclicEquiv V q hq havoid)) + +@[simp] +theorem cyclicStackEquiv_fst + (V : Type uV) [AddCommGroup V] [Finite V] [IsAddCyclic V] + (q : ℕ) (hq : q.Prime) (havoid : ¬ q ∣ Nat.card V) + (x : (Plane × V) × ZMod q) : + (cyclicStackEquiv V q hq havoid x).1 = x.1.1 := rfl + +section Transport + +variable (V : Type uV) [AddCommGroup V] [Finite V] [IsAddCyclic V] +variable (q : ℕ) (hq : q.Prime) (havoid : ¬ q ∣ Nat.card V) + +noncomputable def cyclicStackComplement (A : Set (Plane × V)) : + Set (Plane × ZMod (q * Nat.card V)) := + cyclicStackEquiv V q hq havoid '' (A ×ˢ ({0} : Set (ZMod q))) + +noncomputable def cyclicStackProjection + (B : Set (Plane × ZMod (q * Nat.card V))) : Set (Plane × V) := + Prod.fst '' (cyclicStackEquiv V q hq havoid ⁻¹' B) + +theorem fullyPeriodic_cyclicStackComplement {A : Set (Plane × V)} + (hA : FullyPeriodic A) : + FullyPeriodic (cyclicStackComplement V q hq havoid A) := by + let : NeZero q := ⟨hq.ne_zero⟩ + exact (fullyPeriodic_image_addEquiv_iff + (cyclicStackEquiv V q hq havoid)).mpr hA.prod_singleton_zero + +theorem fullyPeriodic_cyclicStackProjection + {B : Set (Plane × ZMod (q * Nat.card V))} (hB : FullyPeriodic B) : + FullyPeriodic (cyclicStackProjection V q hq havoid B) := by + exact FullyPeriodic.image_of_surjective + (AddMonoidHom.fst (Plane × V) (ZMod q)) + (fun x => ⟨(x, 0), rfl⟩) + (FullyPeriodic.preimage_addEquiv (cyclicStackEquiv V q hq havoid) hB) + +end Transport + +section FiniteFamily + +variable {ι : Type uι} [Fintype ι] +variable (V : Type uV) [AddCommGroup V] [Finite V] [IsAddCyclic V] +variable (q : ℕ) (hq : q.Prime) (havoid : ¬ q ∣ Nat.card V) + +noncomputable def cyclicStackTile + (F : ι → Finset (Plane × V)) (E : ι → Finset (ZMod q)) : + Finset (Plane × ZMod (q * Nat.card V)) := by + classical + letI : NeZero q := ⟨hq.ne_zero⟩ + exact (stack F E).image (cyclicStackEquiv V q hq havoid) + +theorem tiles_cyclicStackTile + {F : ι → Finset (Plane × V)} {E : ι → Finset (ZMod q)} + (hpart : IsColorPartition E) {A : Set (Plane × V)} + (hA : ∀ ν, Tiles (F ν) A) : + Tiles (cyclicStackTile V q hq havoid F E) + (cyclicStackComplement V q hq havoid A) := by + classical + let : NeZero q := ⟨hq.ne_zero⟩ + exact Tiles.image_addEquiv (cyclicStackEquiv V q hq havoid) + (tiles_stack_lift hpart hA) + +theorem tiles_stack_of_tiles_cyclicStackTile + {F : ι → Finset (Plane × V)} {E : ι → Finset (ZMod q)} + {B : Set (Plane × ZMod (q * Nat.card V))} + (hB : Tiles (cyclicStackTile V q hq havoid F E) B) : + Tiles (stack F E) (cyclicStackEquiv V q hq havoid ⁻¹' B) := by + classical + let : NeZero q := ⟨hq.ne_zero⟩ + simpa only [cyclicStackTile, Finset.image_image, Function.comp_def, + AddEquiv.symm_apply_apply, Finset.image_id'] using + Tiles.preimage_addEquiv (cyclicStackEquiv V q hq havoid) hB + +theorem tiles_of_tiles_cyclicStackTile + {F : ι → Finset (Plane × V)} {E : ι → Finset (ZMod q)} + (hpart : IsColorPartition E) (hfull : HasFullDifferences E) + (hE : ∀ ν, (E ν).Nonempty) + {B : Set (Plane × ZMod (q * Nat.card V))} + (hB : Tiles (cyclicStackTile V q hq havoid F E) B) : + ∀ ν, Tiles (F ν) (cyclicStackProjection V q hq havoid B) := by + classical + let : NeZero q := ⟨hq.ne_zero⟩ + exact tiles_of_tiles_stack hpart hfull hE + (tiles_stack_of_tiles_cyclicStackTile V q hq havoid hB) + +theorem cyclicStack_counterexample_of_common_system + {F : ι → Finset (Plane × V)} {E : ι → Finset (ZMod q)} + (hpart : IsColorPartition E) (hfull : HasFullDifferences E) + (hE : ∀ ν, (E ν).Nonempty) + (hcommon : ∃ A, ∀ ν, Tiles (F ν) A) + (hnone : ∀ A, (∀ ν, Tiles (F ν) A) → ¬ FullyPeriodic A) : + (cyclicStackTile V q hq havoid F E).Nonempty ∧ + (∃ A, Tiles (cyclicStackTile V q hq havoid F E) + (cyclicStackComplement V q hq havoid A)) ∧ + ∀ B, Tiles (cyclicStackTile V q hq havoid F E) B → + ¬ FullyPeriodic B := by + obtain ⟨A, hA⟩ := hcommon + have ht := tiles_cyclicStackTile V q hq havoid hpart hA + refine ⟨ht.tile_nonempty, ⟨A, ht⟩, ?_⟩ + intro B hB hperiod + exact hnone (cyclicStackProjection V q hq havoid B) + (tiles_of_tiles_cyclicStackTile V q hq havoid hpart hfull hE hB) + (fullyPeriodic_cyclicStackProjection V q hq havoid hperiod) + +end FiniteFamily + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/CyclicSystemStacking.lean b/lean/OAI/Geometry/PeriodicTiling/CyclicSystemStacking.lean new file mode 100644 index 0000000000000000000000000000000000000000..8858c0ffa21be34c34afe886abc6bfe8f5d9bc37 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/CyclicSystemStacking.lean @@ -0,0 +1,44 @@ +import OAI.Geometry.PeriodicTiling.CyclicStack +import OAI.Geometry.PeriodicTiling.FullDifferencePartition + +namespace OAI + +universe uι uV + +namespace PeriodicTilingThree + +theorem exists_cyclic_stack_of_system + {ι : Type uι} [Fintype ι] [Nonempty ι] + (V : Type uV) [AddCommGroup V] [Finite V] [IsAddCyclic V] + (F : ι → Finset (Plane × V)) + (hcommon : ∃ A, ∀ ν, Tiles (F ν) A) + (hnone : ∀ A, (∀ ν, Tiles (F ν) A) → ¬ FullyPeriodic A) : + ∃ Q : ℕ, 0 < Q ∧ + ∃ T : Finset (Plane × ZMod Q), T.Nonempty ∧ + (∃ B, Tiles T B) ∧ ∀ B, Tiles T B → ¬ FullyPeriodic B := by + classical + let s := Fintype.card ι + have hs : 0 < s := Fintype.card_pos + let e : ι ≃ Fin s := Fintype.equivFin ι + let F' : Fin s → Finset (Plane × V) := fun ν => F (e.symm ν) + have hcommon' : ∃ A, ∀ ν, Tiles (F' ν) A := by + obtain ⟨A, hA⟩ := hcommon + exact ⟨A, fun ν => hA (e.symm ν)⟩ + have hnone' : ∀ A, (∀ ν, Tiles (F' ν) A) → ¬ FullyPeriodic A := by + intro A hA + apply hnone A + intro ν + simpa only [F', Equiv.symm_apply_apply] using hA (e ν) + obtain ⟨q, hq, hcard, _hfresh, E, hE, hpart, hfull⟩ := + exists_fresh_prime_fullDifference_partition s hs ∅ (Nat.card V) + let havoid : ¬ q ∣ Nat.card V := not_dvd_card_of_lt V hcard + have hc := cyclicStack_counterexample_of_common_system V q hq havoid + (F := F') (E := E) hpart hfull hE hcommon' hnone' + refine ⟨q * Nat.card V, cyclicStackOrder_pos V q hq, + cyclicStackTile V q hq havoid F' E, hc.1, ?_, hc.2.2⟩ + obtain ⟨A, hA⟩ := hc.2.1 + exact ⟨cyclicStackComplement V q hq havoid A, hA⟩ + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/CyclicTypes.lean b/lean/OAI/Geometry/PeriodicTiling/CyclicTypes.lean new file mode 100644 index 0000000000000000000000000000000000000000..135ec887e80697618673f96034c8841f95f8aa6a --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/CyclicTypes.lean @@ -0,0 +1,35 @@ +import OAI.Geometry.PeriodicTiling.EncodingParameters + +namespace OAI + +namespace PeriodicTilingThree + +abbrev D (p : ℕ) := p ^ 4 +abbrev Residues (p : ℕ) := ZMod (p ^ 2) × ZMod (p ^ 2) + +variable {p : ℕ} [NeZero p] + +abbrev K (E : EncodingParameters p) (i : Channel p) := ZMod (E.r i) +abbrev P (E : EncodingParameters p) (i : Channel p) := ZMod (E.a i) × ZMod (E.b i) +abbrev Input (E : EncodingParameters p) := ∀ i : Channel p, K E i +abbrev Useful (E : EncodingParameters p) := ∀ i : Channel p, P E i + +abbrev V (E : EncodingParameters p) := + ZMod (D p) × (∀ i : Channel p, ZMod ((E.r i) ^ 2) × P E i) + +abbrev Ambient (E : EncodingParameters p) := Plane × V E +abbrev Base (E : EncodingParameters p) := Plane × Input E + +abbrev Low (E : EncodingParameters p) := Input E +abbrev G (E : EncodingParameters p) := Ambient E + +structure GraphOutputs (E : EncodingParameters p) where + c : Base E → Useful E + beta : Base E → Input E + z : Base E → ZMod (D p) + +abbrev Outputs (E : EncodingParameters p) := GraphOutputs E + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/Dependence.lean b/lean/OAI/Geometry/PeriodicTiling/Dependence.lean new file mode 100644 index 0000000000000000000000000000000000000000..6749d0524a2463c775c221f480452516a62d8ce6 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/Dependence.lean @@ -0,0 +1,355 @@ +import OAI.Geometry.PeriodicTiling.GraphTests +import OAI.Geometry.PeriodicTiling.CyclicCRT +import Mathlib.Algebra.Ring.Periodic +import Mathlib.Data.Finset.Piecewise +import Mathlib.Data.Fintype.Sigma +import Mathlib.Tactic.Ring + +namespace OAI + +universe uι uA uB + +noncomputable section + +namespace PeriodicTilingThree + +section CoordinateReplacement + +variable {ι : Type uι} [Fintype ι] [DecidableEq ι] +variable {A : ι → Type uA} {B : Type uB} + +theorem eq_of_update_invariant (f : (∀ i, A i) → B) + (hf : ∀ x i (a : A i), f (Function.update x i a) = f x) + (x y : ∀ i, A i) : f x = f y := by + have h : ∀ s : Finset ι, f (s.piecewise x y) = f y := by + intro s + induction s using Finset.induction_on with + | empty => simp + | insert i s hi ih => rw [Finset.piecewise_insert, hf, ih] + simpa using h Finset.univ + +theorem eq_of_update_invariant_off (f : (∀ i, A i) → B) (i : ι) + (hf : ∀ j, j ≠ i → ∀ x (a : A j), f (Function.update x j a) = f x) + (x y : ∀ i, A i) (hxy : x i = y i) : f x = f y := by + have h : ∀ s : Finset ι, f (s.piecewise x y) = f y := by + intro s + induction s using Finset.induction_on with + | empty => simp + | insert j s hj ih => + rw [Finset.piecewise_insert] + by_cases hji : j = i + · subst j + have hv : s.piecewise x y i = x i := by + by_cases hi : i ∈ s <;> simp [Finset.piecewise, hi, hxy] + rw [← hv, Function.update_eq_self] + exact ih + · exact (hf j hji _ _).trans ih + simpa using h Finset.univ + +end CoordinateReplacement + +section Activity + +variable {A : Type uA} {B : Type uB} [AddGroup A] + +def DigitActive (g : A → B) (U : AddSubgroup A) : Prop := + ∃ w w', w - w' ∈ U ∧ g w ≠ g w' + +theorem not_digitActive_iff (g : A → B) (U : AddSubgroup A) : + ¬ DigitActive g U ↔ ∀ w w', w - w' ∈ U → g w = g w' := by + simp only [DigitActive, not_exists, not_and, not_not] + +end Activity + +variable {p : ℕ} [NeZero p] (E : EncodingParameters p) + +def seedResidue (p : ℕ) (x : Plane) : Residues p := + ((x.1 : ZMod (p ^ 2)), (x.2 : ZMod (p ^ 2))) + +def seedRepresentative (p : ℕ) (s : Residues p) : Plane := + ((s.1.val : ℤ), (s.2.val : ℤ)) + +@[simp] theorem seedResidue_representative (s : Residues p) : + seedResidue p (seedRepresentative p s) = s := by + apply Prod.ext <;> simp [seedResidue, seedRepresentative] + +def usefulAt (o : Outputs E) (i : Channel p) (x : Plane) (w : K E i) : P E i := + o.c (x, Function.update 0 i w) i + +def ordinaryFactor (o : Outputs E) (n : Column p) (m : ℤ) + (w : K E (.inl n)) : P E (.inl n) := + usefulAt E o (.inl n) (0, m) w + +def seedFactor (o : Outputs E) (t : Fin 2) (s : Residues p) + (w : K E (.inr t)) : P E (.inr t) := + usefulAt E o (.inr t) (seedRepresentative p s) w + +def HasDependence (o : Outputs E) : Prop := + (∀ n x k, o.c (x, k) (.inl n) = + ordinaryFactor E o n (lineValue n x) (k (.inl n))) ∧ + (∀ t x k, o.c (x, k) (.inr t) = + seedFactor E o t (seedResidue p x) (k (.inr t))) + +theorem ordinaryFactor_spec {o : Outputs E} (h : HasDependence E o) + (n : Column p) (x : Plane) (k : Low E) : + o.c (x, k) (.inl n) = ordinaryFactor E o n (lineValue n x) (k (.inl n)) := + h.1 n x k + +theorem seedFactor_spec {o : Outputs E} (h : HasDependence E o) + (t : Fin 2) (x : Plane) (k : Low E) : + o.c (x, k) (.inr t) = seedFactor E o t (seedResidue p x) (k (.inr t)) := + h.2 t x k + +theorem usefulAt_factor {o : Outputs E} (h : HasDependence E o) + (x : Plane) (k : Low E) (i : Channel p) : + o.c (x, k) i = usefulAt E o i x (k i) := by + cases i with + | inl n => + rw [h.1 n x k] + symm + simpa [usefulAt] using h.1 n x (Function.update 0 (.inl n) (k (.inl n))) + | inr t => + rw [h.2 t x k] + symm + simpa [usefulAt] using h.2 t x (Function.update 0 (.inr t) (k (.inr t))) + +theorem usefulAt_eq_of_lineValue_eq {o : Outputs E} (h : HasDependence E o) + (n : Column p) {x y : Plane} (hxy : lineValue n x = lineValue n y) + (w : K E (.inl n)) : + usefulAt E o (.inl n) x w = usefulAt E o (.inl n) y w := by + unfold usefulAt + rw [h.1 n x _, h.1 n y _, hxy] + +theorem usefulAt_eq_of_seedResidue_eq {o : Outputs E} (h : HasDependence E o) + (t : Fin 2) {x y : Plane} (hxy : seedResidue p x = seedResidue p y) + (w : K E (.inr t)) : + usefulAt E o (.inr t) x w = usefulAt E o (.inr t) y w := by + unfold usefulAt + rw [h.2 t x _, h.2 t y _, hxy] + +def Active (o : Outputs E) (i : Channel p) (x : Plane) (j : Label p i) : Prop := + DigitActive (usefulAt E o i x) (digitSubgroup E i j) + +theorem digitActive_iff_coordinates (i : Channel p) (g : K E i → P E i) + (j : Label p i) : + DigitActive g (digitSubgroup E i j) ↔ + ∃ w w', (∀ q, q ≠ j → digitEquiv E i w q = digitEquiv E i w' q) ∧ + g w ≠ g w' := by + simp only [DigitActive, sub_mem_digitSubgroup_iff] + +theorem no_digitActive_iff_constant (i : Channel p) (g : K E i → P E i) : + (∀ j, ¬ DigitActive g (digitSubgroup E i j)) ↔ ∃ c, ∀ w, g w = c := by + constructor + · intro h + let e := digitEquiv E i + have hu : ∀ z j (a : ZMod (E.digitPrime i j)), + g (e.symm (Function.update z j a)) = g (e.symm z) := by + intro z j a + apply (not_digitActive_iff g (digitSubgroup E i j)).mp (h j) + apply (sub_mem_digitSubgroup_iff E i j _ _).mpr + intro q hq + simp [e, hq] + refine ⟨g 0, fun w => ?_⟩ + simpa [e] using eq_of_update_invariant (fun z => g (e.symm z)) hu (e w) (e 0) + · rintro ⟨c, hc⟩ j + apply (not_digitActive_iff g (digitSubgroup E i j)).mpr + intro w w' _hww' + exact (hc w).trans (hc w').symm + +theorem no_active_iff_constant (o : Outputs E) (i : Channel p) (x : Plane) : + (∀ j, ¬ Active E o i x j) ↔ ∃ c, ∀ w, usefulAt E o i x w = c := + no_digitActive_iff_constant E i (usefulAt E o i x) + +theorem active_ordinary_iff {o : Outputs E} (h : HasDependence E o) + (n : Column p) {x y : Plane} (hxy : lineValue n x = lineValue n y) + (j : Label p (.inl n)) : Active E o (.inl n) x j ↔ Active E o (.inl n) y j := by + have he : usefulAt E o (.inl n) x = usefulAt E o (.inl n) y := + funext (usefulAt_eq_of_lineValue_eq E h n hxy) + unfold Active + rw [he] + +theorem active_seed_iff {o : Outputs E} (h : HasDependence E o) + (t : Fin 2) {x y : Plane} (hxy : seedResidue p x = seedResidue p y) + (j : Label p (.inr t)) : Active E o (.inr t) x j ↔ Active E o (.inr t) y j := by + have he : usefulAt E o (.inr t) x = usefulAt E o (.inr t) y := + funext (usefulAt_eq_of_seedResidue_eq E h t hxy) + unfold Active + rw [he] + +abbrev DependenceIndex (p : ℕ) := + (Σ i : Channel p, {j : Channel p // j ≠ i}) ⊕ + (Column p ⊕ (Fin 2 × Bool)) + +def lowGenerator (j : Channel p) : Base E := + (0, Function.update 0 j 1) + +def seedStep (p : ℕ) (second : Bool) : Plane := + if second then (0, ((p ^ 2 : ℕ) : ℤ)) else (((p ^ 2 : ℕ) : ℤ), 0) + +def dependenceChannel : DependenceIndex p → Channel p + | .inl ⟨i, _⟩ => i + | .inr (.inl n) => .inl n + | .inr (.inr (t, _)) => .inr t + +def dependenceShift : DependenceIndex p → Base E + | .inl ⟨_, j⟩ => lowGenerator E j.1 + | .inr (.inl n) => (lineKernelStep n, 0) + | .inr (.inr (_, axis)) => (seedStep p axis, 0) + +def dependenceTile (d : DependenceIndex p) : Finset (G E) := + invarianceTile E (dependenceChannel d) (dependenceShift E d) + +theorem dependenceTile_nonempty (d : DependenceIndex p) : + (dependenceTile E d).Nonempty := + invarianceTile_nonempty E (dependenceChannel d) (dependenceShift E d) + +theorem dependenceTile_card (d : DependenceIndex p) : + (dependenceTile E d).card = (kernelTile E).card := + invarianceTile_card E (dependenceChannel d) (dependenceShift E d) + +def dependenceTiles : Finset (Finset (G E)) := by + classical + exact Finset.univ.image (dependenceTile E) + +def DependenceTests (o : Outputs E) : Prop := + ∀ d : DependenceIndex p, Tiles (dependenceTile E d) (graph o) + +def DependenceInvariance (o : Outputs E) : Prop := + ∀ d : DependenceIndex p, ∀ b : Base E, + o.c (b - dependenceShift E d) (dependenceChannel d) = o.c b (dependenceChannel d) + +private theorem periodic_of_sub_eq {A : Type uA} {B : Type uB} [AddGroup A] + (f : A → B) (v : A) (h : ∀ x, f (x - v) = f x) : Function.Periodic f v := by + intro x + simpa using (h (x + v)).symm + +private theorem useful_update_of_generator (o : Outputs E) (i j : Channel p) + (h : ∀ b, o.c (b - lowGenerator E j) i = o.c b i) + (x : Plane) (k : Low E) (w : K E j) : + o.c (x, Function.update k j w) i = o.c (x, k) i := by + obtain ⟨a, ha⟩ := ZMod.intCast_surjective (k j - w) + have he : (x, Function.update k j w) = (x, k) - a • lowGenerator E j := by + apply Prod.ext + · simp [lowGenerator] + · funext l + by_cases hlj : l = j + · subst l + simp [lowGenerator, zsmul_eq_mul, ha] + · simp [lowGenerator, hlj] + rw [he] + exact (periodic_of_sub_eq (fun b => o.c b i) (lowGenerator E j) h).sub_zsmul_eq a + +private theorem usefulAt_factor_of_generators (o : Outputs E) + (h : ∀ i j, j ≠ i → ∀ b, o.c (b - lowGenerator E j) i = o.c b i) + (x : Plane) (k : Low E) (i : Channel p) : + o.c (x, k) i = usefulAt E o i x (k i) := by + unfold usefulAt + apply eq_of_update_invariant_off (fun k => o.c (x, k) i) i + · intro j hji k' w + exact useful_update_of_generator E o i j (h i j hji) x k' w + · simp + +@[simp] theorem seedResidue_sub_step + {p : ℕ} [NeZero p] + (x : Plane) (axis : Bool) : + seedResidue p (x - seedStep p axis) = seedResidue p x := by + have hp2 : (p : ZMod (p ^ 2)) ^ 2 = 0 := by + rw [← Nat.cast_pow, ZMod.natCast_self] + cases axis <;> apply Prod.ext <;> simp [seedResidue, seedStep, hp2] + +theorem dependenceInvariance_iff (o : Outputs E) : + DependenceInvariance E o ↔ HasDependence E o := by + constructor + · intro h + have hlow : ∀ i j, j ≠ i → ∀ b, o.c (b - lowGenerator E j) i = o.c b i := by + intro i j hji b + exact h (.inl ⟨i, ⟨j, hji⟩⟩) b + have hfactor := usefulAt_factor_of_generators E o hlow + constructor + · intro n x k + have hstep : ∀ b : Base E, + o.c (b - (lineKernelStep n, 0)) (.inl n) = o.c b (.inl n) := + h (.inr (.inl n)) + have hp := periodic_of_sub_eq (fun b : Base E => o.c b (.inl n)) + (lineKernelStep n, 0) hstep + have he : (x, k) - x.1 • (lineKernelStep n, (0 : Low E)) = + ((0, lineValue n x), k) := by + apply Prod.ext + · apply Prod.ext + · simp [lineKernelStep] + · simp [lineKernelStep, lineValue] + ring + · simp + have hs := hp.sub_zsmul_eq (x := (x, k)) x.1 + rw [he] at hs + exact hs.symm.trans (hfactor (0, lineValue n x) k (.inl n)) + · intro t x k + have hfirst : ∀ b : Base E, + o.c (b - (seedStep p false, 0)) (.inr t) = o.c b (.inr t) := + h (.inr (.inr (t, false))) + have hsecond : ∀ b : Base E, + o.c (b - (seedStep p true, 0)) (.inr t) = o.c b (.inr t) := + h (.inr (.inr (t, true))) + have hp := periodic_of_sub_eq (fun b : Base E => o.c b (.inr t)) + (seedStep p false, 0) hfirst + have hq := periodic_of_sub_eq (fun b : Base E => o.c b (.inr t)) + (seedStep p true, 0) hsecond + obtain ⟨a, ha⟩ := (ZMod.intCast_eq_iff (p ^ 2) x.1 (seedResidue p x).1).mp rfl + obtain ⟨b, hb⟩ := (ZMod.intCast_eq_iff (p ^ 2) x.2 (seedResidue p x).2).mp rfl + have he : (x, k) - a • (seedStep p false, (0 : Low E)) - + b • (seedStep p true, (0 : Low E)) = + (seedRepresentative p (seedResidue p x), k) := by + apply Prod.ext + · apply Prod.ext + · simpa [seedStep, seedRepresentative, zsmul_eq_mul, + sub_eq_iff_eq_add, mul_comm] using ha + · simpa [seedStep, seedRepresentative, zsmul_eq_mul, + sub_eq_iff_eq_add, mul_comm] using hb + · simp + have hs := (hq.sub_zsmul_eq + (x := (x, k) - a • (seedStep p false, (0 : Low E))) b).trans + (hp.sub_zsmul_eq (x := (x, k)) a) + rw [he] at hs + exact hs.symm.trans (hfactor (seedRepresentative p (seedResidue p x)) k (.inr t)) + · intro h d xb + rcases xb with ⟨x, k⟩ + rcases d with ⟨i, j⟩ | d + · change o.c ((x, k) - (0, Function.update (0 : Low E) j.1 1)) i = o.c (x, k) i + simp only [Prod.mk_sub_mk, sub_zero] + rw [usefulAt_factor E h, usefulAt_factor E h] + simp [Ne.symm j.property] + · rcases d with n | ⟨t, axis⟩ + · change o.c ((x, k) - (lineKernelStep n, 0)) (.inl n) = o.c (x, k) (.inl n) + simp only [Prod.mk_sub_mk, sub_zero] + rw [h.1 n (x - lineKernelStep n) k, h.1 n x k] + have he : lineValue n (x - lineKernelStep n) = lineValue n x := by + simp [lineValue, lineKernelStep] ; ring + rw [he] + · change o.c ((x, k) - (seedStep p axis, 0)) (.inr t) = o.c (x, k) (.inr t) + simp only [Prod.mk_sub_mk, sub_zero] + rw [h.2 t (x - seedStep p axis) k, h.2 t x k, seedResidue_sub_step] + +theorem dependenceTests_iff (o : Outputs E) : + DependenceTests E o ↔ HasDependence E o := by + have he : DependenceTests E o ↔ DependenceInvariance E o := by + unfold DependenceTests DependenceInvariance dependenceTile + simp only [invarianceTile_iff] + exact he.trans (dependenceInvariance_iff E o) + +theorem dependenceTiles_iff (o : Outputs E) : + (∀ F ∈ dependenceTiles E, Tiles F (graph o)) ↔ HasDependence E o := by + classical + rw [← dependenceTests_iff E o] + constructor + · intro h d + apply h (dependenceTile E d) + exact Finset.mem_image.mpr ⟨d, Finset.mem_univ d, rfl⟩ + · intro h F hF + obtain ⟨d, _hd, rfl⟩ := Finset.mem_image.mp hF + exact h d + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/DirectionalLimits.lean b/lean/OAI/Geometry/PeriodicTiling/DirectionalLimits.lean new file mode 100644 index 0000000000000000000000000000000000000000..d572ac2f18dc1b001457c96b5a839c4a4bb86b55 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/DirectionalLimits.lean @@ -0,0 +1,274 @@ +import OAI.Geometry.PeriodicTiling.TileDilation +import OAI.Geometry.PeriodicTiling.PlaneLattices +import Mathlib.Algebra.BigOperators.Field +import Mathlib.Algebra.Ring.Periodic +import Mathlib.Analysis.SpecificLimits.Basic +import Mathlib.Data.Fintype.EquivFin +import Mathlib.Topology.Bases +import Mathlib.Topology.Compactness.Compact +import Mathlib.Topology.Order.Compact +import Mathlib.Topology.Sequences +import Mathlib.Tactic.Abel +import Mathlib.Tactic.FieldSimp +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Positivity +import Mathlib.Tactic.Ring + +namespace OAI + +universe uι + +noncomputable section + +namespace PeriodicTilingThree + +open Set Filter +open scoped BigOperators Topology + +def directionalAverage (a : Plane → ℝ) (q : ℕ) (v : Plane) (N : ℕ) (x : Plane) : ℝ := + (∑ k ∈ Finset.range (N + 1), a (x - (1 + q * (k + 1)) • v)) / (N + 1 : ℕ) + +theorem directionalAverage_nonneg {a : Plane → ℝ} (ha : ∀ x, 0 ≤ a x) + (q : ℕ) (v : Plane) (N : ℕ) (x : Plane) : + 0 ≤ directionalAverage a q v N x := by + unfold directionalAverage + exact div_nonneg (Finset.sum_nonneg fun k _ => ha _) (by positivity) + +theorem directionalAverage_le_one {a : Plane → ℝ} (ha : ∀ x, a x ≤ 1) + (q : ℕ) (v : Plane) (N : ℕ) (x : Plane) : + directionalAverage a q v N x ≤ 1 := by + have hN : (0 : ℝ) < (N + 1 : ℕ) := by positivity + apply (div_le_iff₀ hN).2 + calc + _ ≤ ∑ _k ∈ Finset.range (N + 1), (1 : ℝ) := + Finset.sum_le_sum fun k _ => ha _ + _ = _ := by simp + +theorem directionalAverage_translate_sub (a : Plane → ℝ) (q : ℕ) + (v : Plane) (N : ℕ) (x : Plane) : + directionalAverage a q v N (x + q • v) - directionalAverage a q v N x = + (a (x - v) - a (x - (1 + q * (N + 1)) • v)) / (N + 1 : ℕ) := by + have hshift (k : ℕ) : + x + q • v - (1 + q * (k + 1)) • v = x - (1 + q * k) • v := by + have hk : 1 + q * (k + 1) = (1 + q * k) + q := by ring + rw [hk, add_nsmul] + abel + unfold directionalAverage + simp_rw [hshift] + rw [← sub_div, ← Finset.sum_sub_distrib] + congr 1 + simpa only [Nat.mul_zero, Nat.add_zero, one_nsmul] using + Finset.sum_range_sub' (fun k => a (x - (1 + q * k) • v)) (N + 1) + +theorem directionalAverage_translate_error {a : Plane → ℝ} + (ha0 : ∀ x, 0 ≤ a x) (ha1 : ∀ x, a x ≤ 1) + (q : ℕ) (v : Plane) (N : ℕ) (x : Plane) : + |directionalAverage a q v N (x + q • v) - directionalAverage a q v N x| ≤ + 1 / (N + 1 : ℕ) := by + rw [directionalAverage_translate_sub, abs_div, + abs_of_pos (show (0 : ℝ) < (N + 1 : ℕ) by positivity)] + apply div_le_div_of_nonneg_right _ (by positivity) + apply abs_le.mpr + constructor <;> linarith [ha0 (x - v), ha1 (x - v), + ha0 (x - (1 + q * (N + 1)) • v), ha1 (x - (1 + q * (N + 1)) • v)] + +theorem sum_directionalAverage {F : Finset Plane} (h0 : (0 : Plane) ∈ F) + {a : Plane → ℝ} {q : ℕ} + (hD : ∀ (k : ℕ) (x : Plane), ∑ f ∈ F, a (x - (1 + q * k) • f) = 1) + (N : ℕ) (x : Plane) : + (∑ f ∈ F.erase 0, directionalAverage a q f N x) = 1 - a x := by + classical + have hs (k : ℕ) : + (∑ f ∈ F.erase 0, a (x - (1 + q * (k + 1)) • f)) = 1 - a x := by + have he := Finset.sum_erase_add F + (fun f => a (x - (1 + q * (k + 1)) • f)) h0 + rw [hD (k + 1) x] at he + simpa only [smul_zero, sub_zero] using (eq_sub_iff_add_eq.mpr he) + unfold directionalAverage + rw [← Finset.sum_div, Finset.sum_comm] + simp_rw [hs] + simp only [Finset.sum_const, Finset.card_range, nsmul_eq_mul] + exact mul_div_cancel_left₀ (1 - a x) (by positivity) + +theorem exists_common_directional_subsequence {ι : Type uι} [Countable ι] + (u : ℕ → ι → Plane → ℝ) + (hu0 : ∀ N i x, 0 ≤ u N i x) (hu1 : ∀ N i x, u N i x ≤ 1) : + ∃ (φ : ι → Plane → ℝ) (σ : ℕ → ℕ), StrictMono σ ∧ + (∀ i x, 0 ≤ φ i x ∧ φ i x ≤ 1) ∧ + ∀ i x, Tendsto (fun N => u (σ N) i x) atTop (𝓝 (φ i x)) := by + let u' : ℕ → ((ι × Plane) → Set.Icc (0 : ℝ) 1) := + fun N ix => ⟨u N ix.1 ix.2, hu0 N ix.1 ix.2, hu1 N ix.1 ix.2⟩ + obtain ⟨l, σ, hσ, hl⟩ := CompactSpace.tendsto_subseq u' + refine ⟨fun i x => (l (i, x) : ℝ), σ, hσ, ?_, ?_⟩ + · intro i x + exact (l (i, x)).property + · intro i x + exact ((continuous_subtype_val.comp (continuous_apply (i, x))).tendsto l).comp hl + +theorem exists_ungrouped_directional_limits {F : Finset Plane} (h0 : (0 : Plane) ∈ F) + {a : Plane → ℝ} (ha0 : ∀ x, 0 ≤ a x) (ha1 : ∀ x, a x ≤ 1) + {q : ℕ} + (hD : ∀ (k : ℕ) (x : Plane), ∑ f ∈ F, a (x - (1 + q * k) • f) = 1) : + ∃ φ : ↥(F.erase 0) → Plane → ℝ, + (∀ f x, 0 ≤ φ f x ∧ φ f x ≤ 1) ∧ + (∀ x, a x + ∑ f, φ f x = 1) ∧ + ∀ f, Function.Periodic (φ f) (q • (f : Plane)) := by + classical + obtain ⟨φ, σ, hσ, hφ, hlim⟩ := exists_common_directional_subsequence + (fun N (f : ↥(F.erase 0)) x => directionalAverage a q f N x) + (fun N f x => directionalAverage_nonneg ha0 q f N x) + (fun N f x => directionalAverage_le_one ha1 q f N x) + refine ⟨φ, hφ, ?_, ?_⟩ + · intro x + have hsum := tendsto_finsetSum Finset.univ (fun (f : ↥(F.erase 0)) _ => hlim f x) + have havg (N : ℕ) : + (∑ f : ↥(F.erase 0), directionalAverage a q f (σ N) x) = 1 - a x := by + exact (Finset.sum_coe_sort (F.erase 0) + (fun f : Plane => directionalAverage a q f (σ N) x)).trans + (sum_directionalAverage h0 hD (σ N) x) + have heq : (∑ f, φ f x) = 1 - a x := + tendsto_nhds_unique hsum (by simpa only [havg] using + (tendsto_const_nhds : Tendsto (fun _ : ℕ => 1 - a x) atTop (𝓝 (1 - a x)))) + linarith + · intro f x + have herr := (hlim f (x + q • (f : Plane))).sub (hlim f x) + have hbound : Tendsto (fun N : ℕ => (1 : ℝ) / (σ N + 1 : ℕ)) atTop (𝓝 0) := + (tendsto_one_div_atTop_nhds_zero_nat.comp (tendsto_add_atTop_nat 1)).comp + hσ.tendsto_atTop + have hz := squeeze_zero (fun N => abs_nonneg + (directionalAverage a q f (σ N) (x + q • (f : Plane)) - + directionalAverage a q f (σ N) x)) + (fun N => directionalAverage_translate_error ha0 ha1 q f (σ N) x) hbound + have heq : |φ f (x + q • (f : Plane)) - φ f x| = 0 := + tendsto_nhds_unique herr.abs hz + exact sub_eq_zero.mp (abs_eq_zero.mp heq) + +theorem Tiles.exists_ungrouped_directional_limits {F : Finset Plane} {A : Set Plane} + (h : Tiles F A) (h0 : (0 : Plane) ∈ F) : + ∃ φ : ↥(F.erase 0) → Plane → ℝ, + (∀ f x, 0 ≤ φ f x ∧ φ f x ≤ 1) ∧ + (∀ x, tileIndicator ℝ A x + ∑ f, φ f x = 1) ∧ + ∀ f, Function.Periodic (φ f) (F.card.factorial • (f : Plane)) := by + exact PeriodicTilingThree.exists_ungrouped_directional_limits h0 + (fun x => tileIndicator_nonneg A x) (fun x => tileIndicator_le_one A x) + (fun k x => h.sum_tileIndicator_dilate_factorial k x) + +theorem exists_grouped_directional_functions {ι : Type uι} [Fintype ι] + (v : ι → Plane) (hv : ∀ i, v i ≠ 0) (φ : ι → Plane → ℝ) + (hφ : ∀ i x, 0 ≤ φ i x) (hp : ∀ i, Function.Periodic (φ i) (v i)) + {a : Plane → ℝ} (ha : ∀ x, 0 ≤ a x) + (hsum : ∀ x, a x + ∑ i, φ i x = 1) : + ∃ (m : ℕ) (w : Fin m → Plane) (ψ : Fin m → Plane → ℝ), + (∀ j, w j ≠ 0) ∧ + (∀ i j, i ≠ j → planeDet (w i) (w j) ≠ 0) ∧ + (∀ j x, 0 ≤ ψ j x ∧ ψ j x ≤ 1) ∧ + (∀ x, a x + ∑ j, ψ j x = 1) ∧ + ∀ j, Function.Periodic (ψ j) (w j) := by + classical + let r : Setoid ι := + { r := fun i j => planeDet (v i) (v j) = 0 + iseqv := ⟨fun i => planeDet_self (v i), + fun {i j} hij => by rw [planeDet_swap, hij, neg_zero], + fun {i j k} hij hjk => planeDet_zero_trans (hv j) hij hjk⟩ } + let Q := Quotient r + let : Fintype Q := Fintype.ofFinite Q + let cls : ι → Q := Quotient.mk r + let fiber (j : Q) : Finset ι := Finset.univ.filter (fun i => cls i = j) + have mem_fiber (i : ι) (j : Q) : i ∈ fiber j ↔ cls i = j := by + simp [fiber] + have out_mem (j : Q) : j.out ∈ fiber j := + (mem_fiber _ _).2 (Quotient.out_eq j) + have hex (j : Q) : ∃ w : Plane, w ≠ 0 ∧ ∀ i ∈ fiber j, ∃ n : ℤ, w = n • v i := by + have himage : ((fiber j).image v).Nonempty := + ⟨v j.out, Finset.mem_image_of_mem v (out_mem j)⟩ + obtain ⟨w, hw, hm⟩ := exists_common_collinear_multiple ((fiber j).image v) himage + (by + intro z hz + obtain ⟨i, _, rfl⟩ := Finset.mem_image.mp hz + exact hv i) + (by + intro z hz z' hz' + obtain ⟨i, hi, rfl⟩ := Finset.mem_image.mp hz + obtain ⟨i', hi', rfl⟩ := Finset.mem_image.mp hz' + exact Quotient.exact (((mem_fiber i j).1 hi).trans ((mem_fiber i' j).1 hi').symm)) + exact ⟨w, hw, fun i hi => hm (v i) (Finset.mem_image_of_mem v hi)⟩ + choose w hw hm using hex + let ψ : Q → Plane → ℝ := fun j x => ∑ i ∈ fiber j, φ i x + have hψ (j : Q) (x : Plane) : 0 ≤ ψ j x := + Finset.sum_nonneg (fun i _ => hφ i x) + have htotal (x : Plane) : (∑ j, ψ j x) = ∑ i, φ i x := by + simp only [ψ, fiber, Finset.sum_filter] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro i _ + rw [Finset.sum_eq_single (cls i)] + · simp only [ite_true] + · intro j _ hji + exact ite_eq_right (Ne.symm hji) + · intro hi + exact False.elim (hi (Finset.mem_univ _)) + have hψone (j : Q) (x : Plane) : ψ j x ≤ 1 := by + have hj : ψ j x ≤ ∑ j', ψ j' x := + Finset.single_le_sum (fun j' _ => hψ j' x) (Finset.mem_univ j) + rw [htotal] at hj + linarith [hsum x, ha x] + have hper (j : Q) : Function.Periodic (ψ j) (w j) := by + intro x + apply Finset.sum_congr rfl + intro i hi + obtain ⟨n, hn⟩ := hm j i hi + rw [hn] + exact (hp i).zsmul n x + have hpair (j k : Q) (hjk : j ≠ k) : planeDet (w j) (w k) ≠ 0 := by + intro hdet + obtain ⟨n, hn⟩ := hm j j.out (out_mem j) + obtain ⟨m, hmk⟩ := hm k k.out (out_mem k) + have hn0 : n ≠ 0 := by + intro hn0 + exact hw j (by simpa [hn0] using hn) + have hm0 : m ≠ 0 := by + intro hm0 + exact hw k (by simpa [hm0] using hmk) + rw [hn, hmk, planeDet_zsmul_left, planeDet_zsmul_right] at hdet + have hz : planeDet (v j.out) (v k.out) = 0 := + (mul_eq_zero.mp ((mul_eq_zero.mp hdet).resolve_left hn0)).resolve_left hm0 + apply hjk + calc + j = cls j.out := (Quotient.out_eq j).symm + _ = cls k.out := Quotient.sound hz + _ = k := Quotient.out_eq k + let e : Fin (Fintype.card Q) ≃ Q := (Fintype.equivFin Q).symm + refine ⟨Fintype.card Q, fun j => w (e j), fun j => ψ (e j), + fun j => hw (e j), ?_, ?_, ?_, fun j => hper (e j)⟩ + · intro i j hij + exact hpair (e i) (e j) (fun he => hij (e.injective he)) + · intro j x + exact ⟨hψ (e j) x, hψone (e j) x⟩ + · intro x + rw [e.sum_comp (fun j => ψ j x), htotal] + exact hsum x + +theorem Tiles.exists_directional_decomposition {F : Finset Plane} {A : Set Plane} + (h : Tiles F A) (h0 : (0 : Plane) ∈ F) : + ∃ (m : ℕ) (v : Fin m → Plane) (φ : Fin m → Plane → ℝ), + (∀ j, v j ≠ 0) ∧ + (∀ i j, i ≠ j → planeDet (v i) (v j) ≠ 0) ∧ + (∀ j x, 0 ≤ φ j x ∧ φ j x ≤ 1) ∧ + (∀ x, tileIndicator ℝ A x + ∑ j, φ j x = 1) ∧ + ∀ j, Function.Periodic (φ j) (v j) := by + classical + obtain ⟨φ, hφ, hsum, hp⟩ := h.exists_ungrouped_directional_limits h0 + apply exists_grouped_directional_functions + (fun f : ↥(F.erase 0) => F.card.factorial • (f : Plane)) _ φ + (fun f x => (hφ f x).1) hp (fun x => tileIndicator_nonneg A x) hsum + intro f + have hq : (F.card.factorial : ℤ) ≠ 0 := by + exact_mod_cast Nat.factorial_ne_zero F.card + simpa only [natCast_zsmul] using + zsmul_plane_ne_zero hq (Finset.mem_erase.mp f.property).1 + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/DirectionalSlices.lean b/lean/OAI/Geometry/PeriodicTiling/DirectionalSlices.lean new file mode 100644 index 0000000000000000000000000000000000000000..1d3fd8f30e5739a95654e749a44d43436cbb3143 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/DirectionalSlices.lean @@ -0,0 +1,133 @@ +import OAI.Geometry.PeriodicTiling.ConfigurationDifferenceReduction +import OAI.Geometry.PeriodicTiling.ForwardDifference +import OAI.Geometry.PeriodicTiling.FiniteMasks +import OAI.Geometry.PeriodicTiling.PlaneLattices +import Mathlib.Topology.Instances.AddCircle.Defs +import Mathlib.Tactic.Choose +import Mathlib.Tactic.Linarith + +namespace OAI + +universe uB + +namespace PeriodicTilingThree + +theorem forwardDiff_slice {B : Type uB} [AddCommGroup B] + (f : Plane → B) (x e : Plane) : + forwardDiff (fun n : ℤ => f (x + n • e)) = + fun n => configDiff e f (x + n • e) := by + ext n + simp only [forwardDiff_apply, configDiff_apply, add_zsmul, one_zsmul, add_assoc] + +theorem forwardDiff_iterate_slice {B : Type uB} [AddCommGroup B] + (k : ℕ) (f : Plane → B) (x e : Plane) : + (forwardDiff^[k]) (fun n : ℤ => f (x + n • e)) = + fun n => ((configDiff e)^[k] f) (x + n • e) := by + induction k generalizing f with + | zero => rfl + | succ k ih => + rw [Function.iterate_succ_apply, forwardDiff_slice, ih, + Function.iterate_succ_apply] + +theorem circle_sum_of_indicator_decomposition {m : ℕ} (A : Set Plane) + (φ : Fin m → Plane → ℝ) + (hsum : ∀ x, tileIndicator ℝ A x + ∑ j, φ j x = 1) : + (∑ j, (fun x => (φ j x : AddCircle (1 : ℝ)))) = fun _ => 0 := by + classical + ext x + simp only [Finset.sum_apply] + change (∑ j, (φ j x : AddCircle (1 : ℝ))) = 0 + have hcast : (∑ j, (φ j x : AddCircle (1 : ℝ))) = + ((∑ j, φ j x : ℝ) : AddCircle (1 : ℝ)) := by + exact (map_sum (QuotientAddGroup.mk' (AddSubgroup.zmultiples (1 : ℝ))) + (fun j => φ j x) Finset.univ).symm + rw [hcast, show (∑ j, φ j x) = 1 - tileIndicator ℝ A x by linarith [hsum x]] + by_cases hx : x ∈ A <;> simp [tileIndicator, hx, AddCircle.coe_period] + +theorem directional_circle_slice_polynomial {m : ℕ} (hm : 0 < m) + (A : Set Plane) (v : Fin m → Plane) (φ : Fin m → Plane → ℝ) + (e : Plane) + (hspan : ∀ i j, i ≠ j → ∃ a b : ℤ, e = a • v i + b • v j) + (hp : ∀ j, Function.Periodic (φ j) (v j)) + (hsum : ∀ x, tileIndicator ℝ A x + ∑ j, φ j x = 1) + (j : Fin m) (x : Plane) : + (forwardDiff^[m]) (fun n : ℤ => + (φ j (x + n • e) : AddCircle (1 : ℝ))) = 0 := by + classical + let ψ : Fin m → Plane → AddCircle (1 : ℝ) := fun i y => (φ i y : AddCircle (1 : ℝ)) + have hψ : ∀ i, Function.Periodic (ψ i) (v i) := by + intro i y + change (φ i (y + v i) : AddCircle (1 : ℝ)) = (φ i y : AddCircle (1 : ℝ)) + rw [hp i y] + have hrep : ∀ i : Fin m, ∃ a b : ℤ, i = j ∨ e = a • v i + b • v j := by + intro i + by_cases hij : i = j + · exact ⟨0, 0, Or.inl hij⟩ + · obtain ⟨a, b, hab⟩ := hspan i j hij + exact ⟨a, b, Or.inr hab⟩ + choose α β hrep using hrep + let u : Fin m → Plane := fun i => if i = j then e else α i • v i + let vs : List Plane := Finset.univ.toList.map u + have hlen : vs.length = m := by simp [vs] + have hne : vs ≠ [] := by + intro h + have hz : m = 0 := by simpa only [h, List.length_nil] using hlen.symm + exact (Nat.ne_of_gt hm) hz + have hkill : ∀ i, i ≠ j → ∃ w ∈ vs, Function.Periodic (ψ i) w := by + intro i hij + refine ⟨u i, ?_, ?_⟩ + · exact List.mem_map.mpr ⟨i, by simp, rfl⟩ + · simpa only [u, ite_eq_right hij] using (hψ i).zsmul (α i) + have hz : configDiffs vs (ψ j) = 0 := + configDiffs_component_zero j vs hne ψ 0 + (circle_sum_of_indicator_decomposition A φ hsum) hkill + have hreplace : ∀ w ∈ vs, ∃ k : ℤ, w = e + k • v j := by + intro w hw + obtain ⟨i, _hi, rfl⟩ := List.mem_map.mp hw + by_cases hij : i = j + · refine ⟨0, ?_⟩ + simp [u, hij] + · refine ⟨-β i, ?_⟩ + have he := (hrep i).resolve_left hij + simp only [u, ite_eq_right hij, he, neg_smul] + abel + rw [configDiffs_eq_iterate_of_period vs e (v j) (ψ j) (hψ j) hreplace, + hlen] at hz + change (forwardDiff^[m]) (fun n : ℤ => ψ j (x + n • e)) = 0 + rw [forwardDiff_iterate_slice, hz] + rfl + +theorem directional_slice_pair_bound {m : ℕ} (A : Set Plane) + (v : Fin m → Plane) (φ : Fin m → Plane → ℝ) (e : Plane) + (hspan : ∀ i j, i ≠ j → ∃ a b : ℤ, e = a • v i + b • v j) + (hφ : ∀ j x, 0 ≤ φ j x) + (hp : ∀ j, Function.Periodic (φ j) (v j)) + (hsum : ∀ x, tileIndicator ℝ A x + ∑ j, φ j x = 1) + (x : Plane) (i j : Fin m) (hij : i ≠ j) (n r : ℤ) : + φ i (x + n • e) + φ j (x + r • e) ≤ 1 := by + classical + obtain ⟨a, b, he⟩ := hspan i j hij + let y : Plane := x + n • e + ((r - n) * a) • v i + have hy : y = x + r • e + ((n - r) * b) • v j := by + dsimp [y] + rw [he] + simp only [smul_add, mul_smul, sub_smul] + abel + have hi : φ i y = φ i (x + n • e) := + (hp i).zsmul ((r - n) * a) _ + have hj : φ j y = φ j (x + r • e) := by + rw [hy] + exact (hp j).zsmul ((n - r) * b) _ + have hle : φ i y + φ j y ≤ ∑ k, φ k y := by + have h := Finset.sum_le_sum_of_subset_of_nonneg + (Finset.subset_univ ({i, j} : Finset (Fin m))) + (fun k _hk _hnot => hφ k y) + simpa [hij] using h + have htotal := hsum y + have ha := tileIndicator_nonneg A y + rw [hi, hj] at hle + linarith + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/DisjointSuccessorPairs.lean b/lean/OAI/Geometry/PeriodicTiling/DisjointSuccessorPairs.lean new file mode 100644 index 0000000000000000000000000000000000000000..6db3e98600b64517d0447a03a62e6a22a539f51c --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/DisjointSuccessorPairs.lean @@ -0,0 +1,121 @@ +import Mathlib.Data.Fintype.EquivFin +import Mathlib.Tactic.FinCases + +namespace OAI + +universe uV + +namespace PeriodicTilingThree + +private theorem exists_successor_anchors {V : Type uV} [Fintype V] [DecidableEq V] + (τ : Equiv.Perm V) (hτ : ∀ v, τ v ≠ v) (marked : V) (k : ℕ) + (hcard : 3 * (k + 1) ≤ Fintype.card V) : + ∃ M : Finset V, M.card = k ∧ + (∀ u ∈ M, u ≠ marked ∧ τ u ≠ marked) ∧ + ∀ u ∈ M, ∀ v ∈ M, u ≠ τ v := by + revert hcard + induction k with + | zero => + intro _ + refine ⟨∅, rfl, ?_, ?_⟩ <;> simp + | succ k ih => + intro hcard + obtain ⟨M, hM, hmarked, hseparated⟩ := ih (by omega) + let B : Finset V := insert marked (insert (τ.symm marked) + ((M ∪ M.image τ) ∪ M.image τ.symm)) + have hB : B.card ≤ 3 * k + 2 := by + have hi₁ : (M.image τ).card ≤ M.card := Finset.card_image_le + have hi₂ : (M.image τ.symm).card ≤ M.card := Finset.card_image_le + have hu₁ := Finset.card_union_le M (M.image τ) + have hu₂ := Finset.card_union_le (M ∪ M.image τ) (M.image τ.symm) + have ha₁ := Finset.card_insert_le (τ.symm marked) + ((M ∪ M.image τ) ∪ M.image τ.symm) + have ha₂ := Finset.card_insert_le marked (insert (τ.symm marked) + ((M ∪ M.image τ) ∪ M.image τ.symm)) + dsimp only [B] + omega + have hBlt : B.card < (Finset.univ : Finset V).card := by + rw [Finset.card_univ] + omega + obtain ⟨x, _, hx⟩ := Finset.exists_mem_notMem_of_card_lt_card hBlt + have hxM : x ∉ M := by + intro h + exact hx (by simp [B, h]) + have hximage : x ∉ M.image τ := by + intro h + exact hx (by simp [B, h]) + have hxpreimage : x ∉ M.image τ.symm := by + intro h + exact hx (by simp [B, h]) + have hxmarked : x ≠ marked := by + intro h + exact hx (by simp [B, h]) + have hτxmarked : τ x ≠ marked := by + intro h + have he : x = τ.symm marked := by + rw [← h] + exact (τ.symm_apply_apply x).symm + exact hx (by simp [B, he]) + refine ⟨insert x M, ?_, ?_, ?_⟩ + · rw [Finset.card_insert_of_notMem hxM, hM] + · intro u hu + rcases Finset.mem_insert.mp hu with rfl | hu + · exact ⟨hxmarked, hτxmarked⟩ + · exact hmarked u hu + · intro u hu v hv + rcases Finset.mem_insert.mp hu with hux | huM + · subst u + rcases Finset.mem_insert.mp hv with hvx | hvM + · subst v + exact (hτ x).symm + · intro he + exact hximage (Finset.mem_image.mpr ⟨v, hvM, he.symm⟩) + · rcases Finset.mem_insert.mp hv with hvx | hvM + · subst v + intro he + apply hxpreimage + refine Finset.mem_image.mpr ⟨u, huM, ?_⟩ + rw [he, τ.symm_apply_apply] + · exact hseparated u huM v hvM + +theorem exists_disjoint_successor_pairs {V : Type uV} [Fintype V] + (τ : Equiv.Perm V) (hτ : ∀ v, τ v ≠ v) (marked : V) (k : ℕ) + (hcard : 3 * (k + 1) ≤ Fintype.card V) : + ∃ pair : (Fin k × Fin 2) ↪ V, + (∀ j, pair (j, 1) = τ (pair (j, 0))) ∧ ∀ x, pair x ≠ marked := by + classical + obtain ⟨M, hM, hmarked, hseparated⟩ := + exists_successor_anchors τ hτ marked k hcard + let e : Fin k ≃ ↥M := (Finset.equivFinOfCardEq hM).symm + let a : Fin k → V := fun j => (e j : V) + have ha : Function.Injective a := by + intro i j h + apply e.injective + exact Subtype.ext h + have hamem (j : Fin k) : a j ∈ M := (e j).property + let f : Fin k × Fin 2 → V := + fun p => if p.2 = 0 then a p.1 else τ (a p.1) + have hf : Function.Injective f := by + rintro ⟨i, b⟩ ⟨j, c⟩ h + fin_cases b <;> fin_cases c + · have hij : i = j := ha (by simpa [f] using h) + cases hij + rfl + · exact False.elim (hseparated (a i) (hamem i) (a j) (hamem j) + (by simpa [f] using h)) + · exact False.elim (hseparated (a j) (hamem j) (a i) (hamem i) + (by simpa [f] using h.symm)) + · have hij : i = j := ha (τ.injective (by simpa [f] using h)) + cases hij + rfl + refine ⟨⟨f, hf⟩, ?_, ?_⟩ + · intro j + simp [f] + · rintro ⟨j, b⟩ + fin_cases b + · simpa [f] using (hmarked (a j) (hamem j)).1 + · simpa [f] using (hmarked (a j) (hamem j)).2 + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/EncodedSystem.lean b/lean/OAI/Geometry/PeriodicTiling/EncodedSystem.lean new file mode 100644 index 0000000000000000000000000000000000000000..024f6552c6ac579e0cbc0f65a481f9e6e374db34 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/EncodedSystem.lean @@ -0,0 +1,120 @@ +import OAI.Geometry.PeriodicTiling.ConstraintCycles +import OAI.Geometry.PeriodicTiling.ActivationTiles + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree + +variable {p : ℕ} [NeZero p] (E : EncodingParameters p) + +def testTiles : Finset (Finset (Ambient E)) := by + classical + exact {kernelTile E} ∪ dependenceTiles E ∪ wordConstraintTiles E ∪ + seedConstraintTiles E ∪ Finset.univ.image (ordinaryActivationTile E) ∪ + Finset.univ.image (seedActivationTile E) + +theorem mem_testTiles_iff (F : Finset (Ambient E)) : + F ∈ testTiles E ↔ F = kernelTile E ∨ F ∈ dependenceTiles E ∨ + F ∈ wordConstraintTiles E ∨ F ∈ seedConstraintTiles E ∨ + (∃ n : Column p, ordinaryActivationTile E n = F) ∨ + (∃ t : Fin 2, seedActivationTile E t = F) := by + classical + simp only [testTiles, Finset.mem_union, Finset.mem_singleton, Finset.mem_image, + Finset.mem_univ, true_and, or_assoc] + +theorem kernelTile_mem_testTiles : kernelTile E ∈ testTiles E := + (mem_testTiles_iff E _).mpr (Or.inl rfl) + +theorem dependenceTiles_subset_testTiles : dependenceTiles E ⊆ testTiles E := by + intro F hF + exact (mem_testTiles_iff E F).mpr (Or.inr (Or.inl hF)) + +theorem wordConstraintTiles_subset_testTiles : wordConstraintTiles E ⊆ testTiles E := by + intro F hF + exact (mem_testTiles_iff E F).mpr (Or.inr (Or.inr (Or.inl hF))) + +theorem seedConstraintTiles_subset_testTiles : seedConstraintTiles E ⊆ testTiles E := by + intro F hF + exact (mem_testTiles_iff E F).mpr (Or.inr (Or.inr (Or.inr (Or.inl hF)))) + +theorem ordinaryActivationTile_mem_testTiles (n : Column p) : + ordinaryActivationTile E n ∈ testTiles E := + (mem_testTiles_iff E _).mpr + (Or.inr (Or.inr (Or.inr (Or.inr (Or.inl ⟨n, rfl⟩))))) + +theorem seedActivationTile_mem_testTiles (t : Fin 2) : + seedActivationTile E t ∈ testTiles E := + (mem_testTiles_iff E _).mpr + (Or.inr (Or.inr (Or.inr (Or.inr (Or.inr ⟨t, rfl⟩))))) + +theorem testTiles_nonempty : (testTiles E).Nonempty := + ⟨kernelTile E, kernelTile_mem_testTiles E⟩ + +theorem nonempty_of_mem_testTiles {F : Finset (Ambient E)} + (hF : F ∈ testTiles E) : F.Nonempty := by + classical + rcases (mem_testTiles_iff E F).mp hF with rfl | hF | hF | hF | ⟨n, rfl⟩ | ⟨t, rfl⟩ + · exact kernelTile_nonempty E + · obtain ⟨d, _hd, rfl⟩ := Finset.mem_image.mp hF + exact invarianceTile_nonempty E (dependenceChannel d) (dependenceShift E d) + · exact nonempty_of_mem_wordConstraintTiles E hF + · exact nonempty_of_mem_seedConstraintTiles E hF + · exact ordinaryActivationTile_nonempty E n + · exact seedActivationTile_nonempty E t + +def Solves (A : Set (Ambient E)) : Prop := + ∀ F ∈ testTiles E, Tiles F A + +theorem solves_iff (A : Set (Ambient E)) : Solves E A ↔ + Tiles (kernelTile E) A ∧ + (∀ F ∈ dependenceTiles E, Tiles F A) ∧ + (∀ F ∈ wordConstraintTiles E, Tiles F A) ∧ + (∀ F ∈ seedConstraintTiles E, Tiles F A) ∧ + (∀ n, Tiles (ordinaryActivationTile E n) A) ∧ + (∀ t, Tiles (seedActivationTile E t) A) := by + constructor + · intro h + exact ⟨h _ (kernelTile_mem_testTiles E), + fun F hF => h F (dependenceTiles_subset_testTiles E hF), + fun F hF => h F (wordConstraintTiles_subset_testTiles E hF), + fun F hF => h F (seedConstraintTiles_subset_testTiles E hF), + fun n => h _ (ordinaryActivationTile_mem_testTiles E n), + fun t => h _ (seedActivationTile_mem_testTiles E t)⟩ + · rintro ⟨hg, hd, hw, hs, ha, hb⟩ F hF + rcases (mem_testTiles_iff E F).mp hF with rfl | hF | hF | hF | ⟨n, rfl⟩ | ⟨t, rfl⟩ + · exact hg + · exact hd F hF + · exact hw F hF + · exact hs F hF + · exact ha n + · exact hb t + +abbrev TestIndex := ↥(testTiles E) + +def testTile (i : TestIndex E) : Finset (Ambient E) := i.val + +theorem testTile_nonempty (i : TestIndex E) : (testTile E i).Nonempty := + nonempty_of_mem_testTiles E i.property + +instance testIndex_nonempty : Nonempty (TestIndex E) := + ⟨⟨kernelTile E, kernelTile_mem_testTiles E⟩⟩ + +theorem solves_iff_index (A : Set (Ambient E)) : + Solves E A ↔ ∀ i : TestIndex E, Tiles (testTile E i) A := by + constructor + · intro h i + exact h i.val i.property + · intro h F hF + exact h ⟨F, hF⟩ + +theorem exists_graph_of_solves {A : Set (Ambient E)} (hA : Solves E A) : + ∃ o : GraphOutputs E, graph o = A := + (kernelTile_iff_graph E A).mp (hA _ (kernelTile_mem_testTiles E)) + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/EncodedSystemObstruction.lean b/lean/OAI/Geometry/PeriodicTiling/EncodedSystemObstruction.lean new file mode 100644 index 0000000000000000000000000000000000000000..c0f50d4aa5dcea28b8d9829c0e84399591a39578 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/EncodedSystemObstruction.lean @@ -0,0 +1,35 @@ +import OAI.Geometry.PeriodicTiling.EncodedSystem +import OAI.Geometry.PeriodicTiling.Activation +import OAI.Geometry.PeriodicTiling.SystemObstruction + +namespace OAI + +namespace PeriodicTilingThree + +variable {p : ℕ} [NeZero p] (E : EncodingParameters p) + +theorem solves_not_fully_periodic {A : Set (Ambient E)} (hA : Solves E A) : + ¬ FullyPeriodic A := by + obtain ⟨o, rfl⟩ := exists_graph_of_solves E hA + obtain ⟨_hg, hd, hw, hs, ho, ht⟩ := (solves_iff E (graph o)).mp hA + have hdep : HasDependence E o := (dependenceTiles_iff E o).mp hd + apply graph_not_fully_periodic_of_activity E o hdep + · exact (wordConstraintTiles_iff E o hdep).mp hw + · exact (seedConstraintTiles_iff E o hdep).mp hs + · intro n + exact ordinary_active_of_tile E o hdep n (ho n) + · intro t + exact seed_active_somewhere_of_tile E o hdep t (ht t) + +theorem testTile_not_fully_periodic {A : Set (Ambient E)} + (hA : ∀ i : TestIndex E, Tiles (testTile E i) A) : ¬ FullyPeriodic A := + solves_not_fully_periodic E ((solves_iff_index E A).mpr hA) + +theorem no_periodic_common_solution : + ¬ ∃ A : Set (Ambient E), Solves E A ∧ FullyPeriodic A := by + rintro ⟨A, hA, hperiod⟩ + exact solves_not_fully_periodic E hA hperiod + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/EncodingParameters.lean b/lean/OAI/Geometry/PeriodicTiling/EncodingParameters.lean new file mode 100644 index 0000000000000000000000000000000000000000..4ee85efc0d47a24b18fd56f3f6391a8a5e40c1b0 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/EncodingParameters.lean @@ -0,0 +1,127 @@ +import OAI.Geometry.PeriodicTiling.WordRule +import Mathlib.Data.Nat.Prime.Basic +import Mathlib.Data.Nat.GCD.BigOperators +import Mathlib.Algebra.Order.BigOperators.Ring.Finset + +namespace OAI + +namespace PeriodicTilingThree + +open scoped BigOperators + +abbrev PrimeTag (p : ℕ) := + Channel p ⊕ (Channel p ⊕ (Σ i : Channel p, Label p i)) + +structure EncodingParameters (p : ℕ) where + p_prime : Nat.Prime p + p_large : 200 < p + primeAt : PrimeTag p → ℕ + prime_isPrime : ∀ t, Nat.Prime (primeAt t) + prime_injective : Function.Injective primeAt + prime_ne_p : ∀ t, primeAt t ≠ p + seed_a_eq : ∀ t : Fin 2, primeAt (.inl (.inr t)) = t.val + 2 + seed_b_large : ∀ t : Fin 2, p ^ 4 < primeAt (.inr (.inl (.inr t))) + blockA : ∀ i : Channel p, Label p i → ℕ + blockB : ∀ i : Channel p, Label p i → ℕ + blockA_pos : ∀ i j, 0 < blockA i j + blockB_pos : ∀ i j, 0 < blockB i j + digit_representation : ∀ i j, + primeAt (.inr (.inr ⟨i, j⟩)) = + blockA i j * primeAt (.inl i) + blockB i j * primeAt (.inr (.inl i)) + +namespace EncodingParameters + +variable {p : ℕ} (E : EncodingParameters p) + +def a (i : Channel p) : ℕ := E.primeAt (.inl i) +def b (i : Channel p) : ℕ := E.primeAt (.inr (.inl i)) +def digitPrime (i : Channel p) (j : Label p i) : ℕ := + E.primeAt (.inr (.inr ⟨i, j⟩)) + +theorem a_prime (i : Channel p) : Nat.Prime (E.a i) := E.prime_isPrime _ +theorem b_prime (i : Channel p) : Nat.Prime (E.b i) := E.prime_isPrime _ +theorem digitPrime_prime (i : Channel p) (j : Label p i) : + Nat.Prime (E.digitPrime i j) := E.prime_isPrime _ + +theorem a_pos (i : Channel p) : 0 < E.a i := (E.a_prime i).pos +theorem b_pos (i : Channel p) : 0 < E.b i := (E.b_prime i).pos +theorem digitPrime_pos (i : Channel p) (j : Label p i) : + 0 < E.digitPrime i j := (E.digitPrime_prime i j).pos + +theorem a_two_le (i : Channel p) : 2 ≤ E.a i := (E.a_prime i).two_le +theorem b_two_le (i : Channel p) : 2 ≤ E.b i := (E.b_prime i).two_le + +theorem seed_a (t : Fin 2) : E.a (.inr t) = t.val + 2 := E.seed_a_eq t + +theorem digit_eq (i : Channel p) (j : Label p i) : + E.digitPrime i j = E.blockA i j * E.a i + E.blockB i j * E.b i := + E.digit_representation i j + +theorem prime_coprime {s t : PrimeTag p} (hst : s ≠ t) : + Nat.Coprime (E.primeAt s) (E.primeAt t) := + (Nat.coprime_primes (E.prime_isPrime s) (E.prime_isPrime t)).2 + (fun h => hst (E.prime_injective h)) + +theorem prime_coprime_p (t : PrimeTag p) : Nat.Coprime (E.primeAt t) p := + (Nat.coprime_primes (E.prime_isPrime t) E.p_prime).2 (E.prime_ne_p t) + +theorem a_coprime_b (i : Channel p) : Nat.Coprime (E.a i) (E.b i) := by + apply E.prime_coprime + simp + +theorem digitPrime_pairwise (i : Channel p) : + Pairwise (fun j j' : Label p i => Nat.Coprime (E.digitPrime i j) (E.digitPrime i j')) := by + intro j j' hj + apply E.prime_coprime + intro he + exact hj (by simpa using he) + +section Finite + +variable [NeZero p] + +def r (i : Channel p) : ℕ := ∏ j : Label p i, E.digitPrime i j + +theorem r_pos (i : Channel p) : 0 < E.r i := by + exact Finset.prod_pos (fun j _ => E.digitPrime_pos i j) + +instance a_neZero (i : Channel p) : NeZero (E.a i) := ⟨(E.a_pos i).ne'⟩ +instance b_neZero (i : Channel p) : NeZero (E.b i) := ⟨(E.b_pos i).ne'⟩ +instance digitPrime_neZero (i : Channel p) (j : Label p i) : + NeZero (E.digitPrime i j) := ⟨(E.digitPrime_pos i j).ne'⟩ +instance r_neZero (i : Channel p) : NeZero (E.r i) := ⟨(E.r_pos i).ne'⟩ + +theorem r_coprime_a (i j : Channel p) : Nat.Coprime (E.r i) (E.a j) := by + apply Nat.coprime_fintype_prod_left_iff.mpr + intro k + apply E.prime_coprime + simp + +theorem r_coprime_b (i j : Channel p) : Nat.Coprime (E.r i) (E.b j) := by + apply Nat.coprime_fintype_prod_left_iff.mpr + intro k + apply E.prime_coprime + simp + +theorem r_coprime_p (i : Channel p) : Nat.Coprime (E.r i) p := by + apply Nat.coprime_fintype_prod_left_iff.mpr + intro k + exact E.prime_coprime_p _ + +theorem r_pairwise_coprime : Pairwise (fun i j : Channel p => Nat.Coprime (E.r i) (E.r j)) := by + intro i j hij + apply Nat.coprime_fintype_prod_left_iff.mpr + intro k + apply Nat.coprime_fintype_prod_right_iff.mpr + intro l + apply E.prime_coprime + intro he + have hs : (⟨i, k⟩ : Σ i : Channel p, Label p i) = ⟨j, l⟩ := + Sum.inr.inj (Sum.inr.inj he) + exact hij (congrArg Sigma.fst hs) + +end Finite +end EncodingParameters +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/EncodingPrimeSelection.lean b/lean/OAI/Geometry/PeriodicTiling/EncodingPrimeSelection.lean new file mode 100644 index 0000000000000000000000000000000000000000..0918ca18aec148dade303bfa27a9aa404220a535 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/EncodingPrimeSelection.lean @@ -0,0 +1,236 @@ +import OAI.Geometry.PeriodicTiling.EncodingParameters +import Mathlib.Data.Nat.Prime.Infinite +import Mathlib.Data.Fintype.EquivFin +import Mathlib.Data.Fintype.Sigma +import Mathlib.Data.Finset.Lattice.Fold +import Mathlib.Data.Sum.Basic +import Mathlib.Logic.Equiv.Sum +import Mathlib.NumberTheory.FrobeniusNumber +import Mathlib.Tactic.FinCases +import Mathlib.Tactic.NormNum +import Lean.Elab.Tactic.Omega +import Mathlib.Tactic.Choose + +namespace OAI + +universe uι + +noncomputable section + +namespace PeriodicTilingThree +namespace EncodingPrimeSelection + +private def nextPrime (bound : ℕ) : ℕ := + Classical.choose (Nat.exists_infinite_primes (bound + 1)) + +private theorem nextPrime_prime (bound : ℕ) : Nat.Prime (nextPrime bound) := + (Classical.choose_spec (Nat.exists_infinite_primes (bound + 1))).2 + +private theorem nextPrime_gt (bound : ℕ) : bound < nextPrime bound := by + have h := (Classical.choose_spec (Nat.exists_infinite_primes (bound + 1))).1 + exact h + +private def primeSequence (bound : ℕ) : ℕ → ℕ + | 0 => nextPrime bound + | n + 1 => nextPrime (primeSequence bound n) + +private theorem primeSequence_strictMono (bound : ℕ) : + StrictMono (primeSequence bound) := by + apply strictMono_nat_of_lt_succ + intro n + exact nextPrime_gt _ + +private theorem primeSequence_prime (bound n : ℕ) : + Nat.Prime (primeSequence bound n) := by + cases n with + | zero => exact nextPrime_prime _ + | succ n => exact nextPrime_prime _ + +private theorem primeSequence_gt (bound n : ℕ) : bound < primeSequence bound n := + lt_of_lt_of_le (nextPrime_gt bound) + ((primeSequence_strictMono bound).monotone (Nat.zero_le n)) + +theorem exists_prime_family (ι : Type uι) [Fintype ι] (bound : ℕ) : + ∃ f : ι → ℕ, Function.Injective f ∧ + ∀ i, Nat.Prime (f i) ∧ bound < f i := by + let e := Fintype.equivFin ι + refine ⟨fun i => primeSequence bound (e i).val, ?_, ?_⟩ + · intro i j hij + apply e.injective + apply Fin.ext + exact (primeSequence_strictMono bound).injective hij + · intro i + exact ⟨primeSequence_prime _ _, primeSequence_gt _ _⟩ + +theorem exists_positive_combination {a b r : ℕ} (hab : Nat.Coprime a b) + (ha : 1 < a) (hb : 1 < b) (hr : a * b + a + b < r) : + ∃ A B : ℕ, 0 < A ∧ 0 < B ∧ r = A * a + B * b := by + have hmem : r - a - b ∈ AddSubmonoid.closure ({a, b} : Set ℕ) := by + by_contra hnot + have hle := (frobeniusNumber_pair hab ha hb).2 hnot + have hbound : a * b - a - b ≤ a * b := + (Nat.sub_le (a * b - a) b).trans (Nat.sub_le (a * b) a) + omega + obtain ⟨A, B, hAB⟩ := (AddSubmonoid.mem_closure_pair a b (r - a - b)).mp hmem + simp only [smul_eq_mul] at hAB + refine ⟨A + 1, B + 1, by omega, by omega, ?_⟩ + calc + r = (r - a - b) + a + b := by omega + _ = (A * a + B * b) + a + b := by rw [hAB] + _ = (A + 1) * a + (B + 1) * b := by ring + +private abbrev UsefulTag (p : ℕ) := Channel p ⊕ Channel p +private abbrev FreshUsefulTag (p : ℕ) := Column p ⊕ Channel p +private abbrev DigitTag (p : ℕ) := Σ i, Label p i + +private def usefulTagEquiv (p : ℕ) : + UsefulTag p ≃ Fin 2 ⊕ FreshUsefulTag p := + (Equiv.sumCongr (Equiv.sumComm (Column p) (Fin 2)) + (Equiv.refl (Channel p))).trans (Equiv.sumAssoc (Fin 2) (Column p) (Channel p)) + +private def usefulPrime {p : ℕ} (f : FreshUsefulTag p → ℕ) : UsefulTag p → ℕ := + Sum.elim (fun t : Fin 2 => t.val + 2) f ∘ usefulTagEquiv p + +private theorem usefulPrime_injective {p : ℕ} {f : FreshUsefulTag p → ℕ} + (hf : Function.Injective f) (hlarge : ∀ t, 3 < f t) : + Function.Injective (usefulPrime f) := by + have hseed : Function.Injective (fun t : Fin 2 => t.val + 2) := by + intro t u htu + apply Fin.ext + change t.val + 2 = u.val + 2 at htu + exact Nat.add_right_cancel htu + have hsep : ∀ t : Fin 2, ∀ i, t.val + 2 ≠ f i := by + intro t i heq + have ht := t.isLt + have hi := hlarge i + omega + exact (hseed.sumElim hf hsep).comp (usefulTagEquiv p).injective + +private theorem usefulPrime_prime {p : ℕ} {f : FreshUsefulTag p → ℕ} + (hf : ∀ i, Nat.Prime (f i)) (i : UsefulTag p) : + Nat.Prime (usefulPrime f i) := by + rcases i with (i | t) | i + · exact hf (.inl i) + · change Nat.Prime (t.val + 2) + fin_cases t + · exact Nat.prime_two + · exact Nat.prime_three + · exact hf (.inr i) + +private def attachDigits {p : ℕ} (f : UsefulTag p → ℕ) (g : DigitTag p → ℕ) : + PrimeTag p → ℕ := + Sum.elim f g ∘ (Equiv.sumAssoc (Channel p) (Channel p) (DigitTag p)).symm + +private theorem attachDigits_injective {p : ℕ} + {f : UsefulTag p → ℕ} {g : DigitTag p → ℕ} + (hf : Function.Injective f) (hg : Function.Injective g) + (hsep : ∀ i j, f i ≠ g j) : Function.Injective (attachDigits f g) := + (hf.sumElim hg hsep).comp + (Equiv.sumAssoc (Channel p) (Channel p) (DigitTag p)).symm.injective + +theorem exists_parameters {p : ℕ} (hp : Nat.Prime p) (hlarge : 200 < p) : + Nonempty (EncodingParameters p) := by + classical + let : NeZero p := ⟨hp.ne_zero⟩ + obtain ⟨f, hfinj, hf⟩ := exists_prime_family (FreshUsefulTag p) (p ^ 4 + p + 3) + let useful : UsefulTag p → ℕ := usefulPrime f + have huseful_prime : ∀ i, Nat.Prime (useful i) := + usefulPrime_prime (fun i => (hf i).1) + have huseful_inj : Function.Injective useful := by + apply usefulPrime_injective hfinj + intro i + have := (hf i).2 + omega + have huseful_ne_p : ∀ i, useful i ≠ p := by + intro i + rcases i with (i | t) | i + · change f (.inl i) ≠ p + have := (hf (.inl i)).2 + omega + · change t.val + 2 ≠ p + have := t.isLt + omega + · change f (.inr i) ≠ p + have := (hf (.inr i)).2 + omega + let threshold : Channel p → ℕ := fun i => + useful (.inl i) * useful (.inr i) + useful (.inl i) + useful (.inr i) + let bound := p + Finset.univ.sup useful + Finset.univ.sup threshold + obtain ⟨g, hginj, hg⟩ := exists_prime_family (DigitTag p) bound + have hseparate : ∀ i j, useful i < g j := by + intro i j + have hi : useful i ≤ Finset.univ.sup useful := Finset.le_sup (Finset.mem_univ i) + have hj := (hg j).2 + dsimp [bound] at hj + omega + have hthreshold : ∀ i j, threshold i < g ⟨i, j⟩ := by + intro i j + have hi : threshold i ≤ Finset.univ.sup threshold := + Finset.le_sup (Finset.mem_univ i) + have hj := (hg ⟨i, j⟩).2 + dsimp [bound] at hj + omega + have hrepresentation : ∀ i (j : Label p i), ∃ A B : ℕ, + 0 < A ∧ 0 < B ∧ g ⟨i, j⟩ = A * useful (.inl i) + B * useful (.inr i) := by + intro i j + have hcop : Nat.Coprime (useful (.inl i)) (useful (.inr i)) := by + apply (Nat.coprime_primes (huseful_prime _) (huseful_prime _)).2 + intro h + have htags := huseful_inj h + cases htags + exact exists_positive_combination hcop + (huseful_prime _).one_lt (huseful_prime _).one_lt (hthreshold i j) + choose A B hA hB hrepresentation using hrepresentation + refine ⟨{ + p_prime := hp + p_large := hlarge + primeAt := attachDigits useful g + prime_isPrime := ?_ + prime_injective := attachDigits_injective huseful_inj hginj + (fun i j => (hseparate i j).ne) + prime_ne_p := ?_ + seed_a_eq := ?_ + seed_b_large := ?_ + blockA := A + blockB := B + blockA_pos := hA + blockB_pos := hB + digit_representation := ?_ + }⟩ + · intro t + rcases t with i | (i | j) + · exact huseful_prime (.inl i) + · exact huseful_prime (.inr i) + · exact (hg j).1 + · intro t + rcases t with i | (i | j) + · exact huseful_ne_p (.inl i) + · exact huseful_ne_p (.inr i) + · change g j ≠ p + have hj := (hg j).2 + dsimp [bound] at hj + omega + · intro t + rfl + · intro t + change p ^ 4 < f (.inr (.inr t)) + have ht := (hf (.inr (.inr t))).2 + omega + · intro i j + exact hrepresentation i j + +end EncodingPrimeSelection + +theorem exists_encodingParameters {p : ℕ} (hp : Nat.Prime p) (hlarge : 200 < p) : + Nonempty (EncodingParameters p) := + EncodingPrimeSelection.exists_parameters hp hlarge + +def encodingParameters {p : ℕ} (hp : Nat.Prime p) (hlarge : 200 < p) : + EncodingParameters p := + Classical.choice (exists_encodingParameters hp hlarge) + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/EuclideanBasic.lean b/lean/OAI/Geometry/PeriodicTiling/EuclideanBasic.lean new file mode 100644 index 0000000000000000000000000000000000000000..d231ea92d41dbe60dce92b3651b4fc4fa888735c --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/EuclideanBasic.lean @@ -0,0 +1,95 @@ +import OAI.Geometry.PeriodicTiling.TilingBasic +import Mathlib.MeasureTheory.Measure.Lebesgue.Basic +import Mathlib.Algebra.Module.ZLattice.Basic + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree + +open MeasureTheory + +@[simp] theorem castLattice_apply {d : ℕ} (z : Lattice d) (i : Fin d) : + castLattice z i = (z i : ℝ) := rfl + +theorem castLattice_injective {d : ℕ} : + Function.Injective (castLattice : Lattice d → Space d) := by + intro z w h + funext i + exact Int.cast_injective (congrArg (fun x : Space d => x i) h) + +def unitVoxel {d : ℕ} (c : Space d) : Set (Space d) := + {x | x - c ∈ unitCube d} + +theorem mem_unitCube {d : ℕ} {x : Space d} : + x ∈ unitCube d ↔ ∀ i, 0 ≤ x i ∧ x i ≤ 1 := by + constructor + · intro h i + exact ⟨h.1 i, h.2 i⟩ + · intro h + exact ⟨fun i => (h i).1, fun i => (h i).2⟩ + +@[simp] theorem mem_unitVoxel {d : ℕ} {c x : Space d} : + x ∈ unitVoxel c ↔ x - c ∈ unitCube d := Iff.rfl + +theorem unitVoxel_eq_Icc {d : ℕ} (c : Space d) : + unitVoxel c = Set.Icc c (c + 1) := by + ext x + constructor + · intro hx + have h := mem_unitCube.mp hx + constructor + · intro i + exact sub_nonneg.mp (h i).1 + · intro i + have hi := (sub_le_iff_le_add.mp (h i).2) + simpa [add_comm] using hi + · intro hx + apply mem_unitCube.mpr + intro i + constructor + · exact sub_nonneg.mpr (hx.1 i) + · apply sub_le_iff_le_add.mpr + simpa [add_comm] using hx.2 i + +@[simp] theorem mem_Thickening {d : ℕ} {F : Finset (Lattice d)} {x : Space d} : + x ∈ Thickening F ↔ ∃ z ∈ F, x - castLattice z ∈ unitCube d := Iff.rfl + +theorem unitVoxel_subset_Thickening {d : ℕ} {F : Finset (Lattice d)} + {z : Lattice d} (hz : z ∈ F) : unitVoxel (castLattice z) ⊆ Thickening F := by + intro x hx + exact ⟨z, hz, hx⟩ + +def TypedAETiles {d : ℕ} (Ω0 Ω1 C C1 : Set (Space d)) : Prop := by + classical + exact ∀ᵐ x ∂volume, ∃! c : C, + x - (c : Space d) ∈ if (c : Space d) ∈ C1 then Ω1 else Ω0 + +def scaledCast {d : ℕ} (m : ℕ) : Lattice d →+ Space d where + toFun z := (m : ℝ) • castLattice z + map_zero' := by simp + map_add' z w := by simp [smul_add] + +@[simp] theorem scaledCast_apply {d : ℕ} (m : ℕ) (z : Lattice d) : + scaledCast m z = (m : ℝ) • castLattice z := rfl + +theorem scaledCast_injective {d : ℕ} {m : ℕ} (hm : m ≠ 0) : + Function.Injective (scaledCast m : Lattice d → Space d) := by + intro z w h + funext i + have hi := congrArg (fun x : Space d => x i) h + change (m : ℝ) * (z i : ℝ) = (m : ℝ) * (w i : ℝ) at hi + exact Int.cast_injective (mul_left_cancel₀ (Nat.cast_ne_zero.mpr hm) hi) + +def scaledGrid (m : ℕ) : AddSubgroup (Space 3) := + (scaledCast m : Lattice 3 →+ Space 3).range + +theorem mem_scaledGrid {m : ℕ} {x : Space 3} : + x ∈ scaledGrid m ↔ ∃ z : Lattice 3, (m : ℝ) • castLattice z = x := Iff.rfl + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/FiniteCylinder.lean b/lean/OAI/Geometry/PeriodicTiling/FiniteCylinder.lean new file mode 100644 index 0000000000000000000000000000000000000000..f79fb392142e9f522cf44dbbefa0fa0079ca9a44 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/FiniteCylinder.lean @@ -0,0 +1,125 @@ +import Mathlib.Data.Fintype.Pigeonhole +import Mathlib.Data.ZMod.Basic +import Mathlib.Tactic.Linarith +import Lean.Elab.Tactic.Omega + +namespace OAI + +universe uA + +namespace PeriodicTilingThree.FiniteCylinder + +def wrap (i L n : ℤ) : ℤ := i + (n - i) % L + +theorem wrap_bounds (i n : ℤ) {L : ℤ} (hL : 0 < L) : + i ≤ wrap i L n ∧ wrap i L n < i + L := by + have hnonneg := Int.emod_nonneg (n - i) (ne_of_gt hL) + have hlt := Int.emod_lt_of_pos (n - i) hL + dsimp [wrap] + omega + +theorem wrap_eq_self {i L n : ℤ} (hi : i ≤ n) (hn : n < i + L) : + wrap i L n = n := by + unfold wrap + rw [Int.emod_eq_of_lt (by omega) (by omega)] + omega + +theorem wrap_add_period (i L n : ℤ) : wrap i L (n + L) = wrap i L n := by + unfold wrap + rw [show n + L - i = (n - i) + L by omega] + simp + +theorem wrap_dvd (i L n : ℤ) : L ∣ n - wrap i L n := by + refine ⟨(n - i) / L, ?_⟩ + have h := Int.emod_add_mul_ediv (n - i) L + dsimp [wrap] + omega + +theorem wrap_shift (i L n k : ℤ) : + wrap i L (n + k) = wrap i L (wrap i L n + k) := by + unfold wrap + congr 1 + rw [show n + k - i = (n - i) + k by omega, + show i + (n - i) % L + k - i = (n - i) % L + k by omega] + exact (Int.emod_add_emod (n - i) L k).symm + +theorem window_at_wrap {A : Type uA} (a : ℤ → A) (H : ℕ) (i L : ℤ) + (hL : (H : ℤ) < L) + (hrows : ∀ c : Fin H, a (i + (c : ℕ)) = a (i + L + (c : ℕ))) + (n k : ℤ) (hk0 : 0 ≤ k) (hkH : k ≤ H) : + a (wrap i L (n + k)) = a (wrap i L n + k) := by + have hL0 : 0 < L := by omega + obtain ⟨hb0, hbL⟩ := wrap_bounds i n hL0 + rw [wrap_shift] + by_cases hcross : wrap i L n + k < i + L + · exact congrArg a (wrap_eq_self (by omega) hcross) + · let c : ℤ := wrap i L n + k - (i + L) + have hc0 : 0 ≤ c := by dsimp [c]; omega + have hcH : c < H := by dsimp [c]; omega + have hcL : c < L := by omega + let cN : Fin H := ⟨c.toNat, by omega⟩ + have hcN : ((cN : ℕ) : ℤ) = c := by dsimp [cN]; omega + have heq : wrap i L n + k = (i + c) + L := by dsimp [c]; omega + have h := hrows cN + rw [hcN] at h + calc + a (wrap i L (wrap i L n + k)) = a (wrap i L ((i + c) + L)) := + congrArg (fun z => a (wrap i L z)) heq + _ = a (i + c) := congrArg a + ((wrap_add_period i L (i + c)).trans (wrap_eq_self (by omega) (by omega))) + _ = a (i + L + c) := h + _ = a (wrap i L n + k) := congrArg a (by dsimp [c]; omega) + +theorem exists_periodic_windows {A : Type uA} [Fintype A] + (a : ℤ → A) (q H : ℕ) (hq : 0 < q) : + ∃ (b : ℤ → A) (L : ℤ), 0 < L ∧ (q : ℤ) ∣ L ∧ + (∀ n : ℤ, b (n + L) = b n) ∧ + (∀ n : ℤ, ∃ t : ℤ, (q : ℤ) ∣ t - n ∧ + ∀ k : ℤ, 0 ≤ k → k ≤ H → b (n + k) = a (t + k)) := by + classical + let : NeZero q := ⟨Nat.ne_of_gt hq⟩ + let State := ZMod q × (Fin H → A) + let time (k : ℕ) : ℤ := (k : ℤ) * ((H : ℤ) + 1) + let state (k : ℕ) : State := + ((time k : ZMod q), fun c => a (time k + (c : ℕ))) + let N := Fintype.card State + obtain ⟨x, y, hxy, hs⟩ := Fintype.exists_ne_map_eq_of_card_lt + (fun k : Fin (N + 1) => state k.val) (by simp [N]) + have hvals : x.val ≠ y.val := fun h => hxy (Fin.ext h) + have ordered : ∃ x y : ℕ, x < y ∧ state x = state y := by + rcases lt_or_gt_of_ne hvals with hlt | hgt + · exact ⟨x.val, y.val, hlt, hs⟩ + · exact ⟨y.val, x.val, hgt, hs.symm⟩ + obtain ⟨x, y, hxy, hs⟩ := ordered + let i := time x + let L := time y - time x + have hxyZ : (x : ℤ) + 1 ≤ (y : ℤ) := by omega + have hL : (H : ℤ) < L := by + dsimp [L, time] + have hH : (0 : ℤ) ≤ H := by omega + nlinarith + have hL0 : 0 < L := by omega + have hphase : (q : ℤ) ∣ L := by + have heq : (time x : ZMod q) = (time y : ZMod q) := congrArg Prod.fst hs + exact (ZMod.intCast_eq_intCast_iff_dvd_sub (time x) (time y) q).mp heq + have hrows : ∀ c : Fin H, a (i + (c : ℕ)) = a (i + L + (c : ℕ)) := by + intro c + have heq := congrFun (congrArg Prod.snd hs) c + change a (time x + (c : ℕ)) = a (time y + (c : ℕ)) at heq + have htime : i + L = time y := by dsimp [i, L]; omega + rw [htime] + exact heq + let b : ℤ → A := fun n => a (wrap i L n) + refine ⟨b, L, hL0, hphase, ?_, ?_⟩ + · intro n + exact congrArg a (wrap_add_period i L n) + · intro n + refine ⟨wrap i L n, ?_, ?_⟩ + · have hd : (q : ℤ) ∣ n - wrap i L n := hphase.trans (wrap_dvd i L n) + simpa only [neg_sub] using (dvd_neg.mpr hd) + · intro k hk0 hkH + exact window_at_wrap a H i L hL hrows n k hk0 hkH + +end PeriodicTilingThree.FiniteCylinder + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/FiniteDifferencePolynomial.lean b/lean/OAI/Geometry/PeriodicTiling/FiniteDifferencePolynomial.lean new file mode 100644 index 0000000000000000000000000000000000000000..0cae29441746d4bbc72c806352d150f9ed60bc98 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/FiniteDifferencePolynomial.lean @@ -0,0 +1,142 @@ +import OAI.Geometry.PeriodicTiling.ForwardDifference +import Mathlib.Algebra.BigOperators.Fin +import Mathlib.Basic.Real.Basic +import Mathlib.RingTheory.Binomial +import Mathlib.Topology.Instances.AddCircle.Defs + +namespace OAI + +universe uA + +noncomputable section + +namespace PeriodicTilingThree + +open scoped BigOperators + +section AddCommGroup + +variable {A : Type uA} [AddCommGroup A] + +theorem intSequence_eq_of_forwardDiff_eq {f g : ℤ → A} + (hd : forwardDiff f = forwardDiff g) (hzero : f 0 = g 0) : f = g := by + have hsucc (n : ℤ) (hn : f n = g n) : f (n + 1) = g (n + 1) := by + have h := congrFun hd n + change f (n + 1) - f n = g (n + 1) - g n at h + rw [hn] at h + exact sub_left_inj.mp h + have hpred (n : ℤ) (hn : f n = g n) : f (n - 1) = g (n - 1) := by + have h := congrFun hd (n - 1) + change f (n - 1 + 1) - f (n - 1) = g (n - 1 + 1) - g (n - 1) at h + rw [sub_add_cancel, hn] at h + exact sub_right_inj.mp h + funext n + refine Int.induction_on n hzero ?_ ?_ + · intro m hm + exact hsucc (m : ℤ) hm + · intro m hm + exact hpred (-(m : ℤ)) hm + +def newtonSequence {k : ℕ} (c : Fin k → A) (n : ℤ) : A := + ∑ i : Fin k, Ring.choose n i.val • c i + +theorem newtonSequence_cons {k : ℕ} (a : A) (c : Fin k → A) (n : ℤ) : + newtonSequence (Fin.cons a c) n = + a + ∑ i : Fin k, Ring.choose n (i.val + 1) • c i := by + rw [newtonSequence, Fin.sum_univ_succ] + simp only [Fin.val_zero, Ring.choose_zero_right, one_zsmul, + Fin.cons_zero, Fin.val_succ, Fin.cons_succ] + +@[simp] theorem newtonSequence_cons_zero {k : ℕ} (a : A) (c : Fin k → A) : + newtonSequence (Fin.cons a c) 0 = a := by + simp [newtonSequence_cons] + +theorem forwardDiff_newtonSequence_cons {k : ℕ} (a : A) (c : Fin k → A) : + forwardDiff (newtonSequence (Fin.cons a c)) = newtonSequence c := by + funext n + simp only [forwardDiff_apply, newtonSequence_cons] + unfold newtonSequence + calc + (a + ∑ i : Fin k, Ring.choose (n + 1) (i.val + 1) • c i) - + (a + ∑ i : Fin k, Ring.choose n (i.val + 1) • c i) = + ∑ i : Fin k, + (Ring.choose (n + 1) (i.val + 1) • c i - + Ring.choose n (i.val + 1) • c i) := by + rw [Finset.sum_sub_distrib] + abel + _ = ∑ i : Fin k, Ring.choose n i.val • c i := by + apply Finset.sum_congr rfl + intro i hi + rw [Ring.choose_succ_succ, add_zsmul, add_sub_cancel_right] + +theorem exists_newtonSequence_of_iter_forwardDiff_eq_zero + (k : ℕ) (f : ℤ → A) (hk : (forwardDiff^[k]) f = 0) : + ∃ c : Fin k → A, f = newtonSequence c := by + induction k generalizing f with + | zero => + have hf : f = 0 := by simpa using hk + refine ⟨Fin.elim0, ?_⟩ + subst f + funext n + simp [newtonSequence] + | succ k ih => + have hdiff : (forwardDiff^[k]) (forwardDiff f) = 0 := by + simpa only [Function.iterate_succ_apply] using hk + obtain ⟨c, hc⟩ := ih (forwardDiff f) hdiff + refine ⟨Fin.cons (f 0) c, intSequence_eq_of_forwardDiff_eq ?_ ?_⟩ + · rw [forwardDiff_newtonSequence_cons] + exact hc + · simp + +end AddCommGroup + +def newtonBasisPolynomial (k : ℕ) : Polynomial ℝ := + Polynomial.C ((k.factorial : ℝ)⁻¹) * descPochhammer ℝ k + +theorem descPochhammer_eval_int_eq_factorial_mul_choose (k : ℕ) (n : ℤ) : + (descPochhammer ℝ k).eval (n : ℝ) = + (k.factorial : ℝ) * ((Ring.choose n k : ℤ) : ℝ) := by + have h : (descPochhammer ℤ k).eval n = (k.factorial : ℤ) * Ring.choose n k := by + simpa only [Polynomial.eval_eq_smeval, nsmul_eq_mul] using + (Ring.descPochhammer_eq_factorial_smul_choose n k) + rw [← descPochhammer_eval_cast ℝ k n, h, Int.cast_mul, Int.cast_natCast] + +@[simp] theorem newtonBasisPolynomial_eval_int (k : ℕ) (n : ℤ) : + (newtonBasisPolynomial k).eval (n : ℝ) = ((Ring.choose n k : ℤ) : ℝ) := by + have hk : (k.factorial : ℝ) ≠ 0 := Nat.cast_ne_zero.mpr (Nat.factorial_ne_zero k) + rw [newtonBasisPolynomial, Polynomial.eval_mul, Polynomial.eval_C, + descPochhammer_eval_int_eq_factorial_mul_choose, ← mul_assoc, inv_mul_cancel₀ hk, one_mul] + +def newtonPolynomial {k : ℕ} (c : Fin k → ℝ) : Polynomial ℝ := + ∑ i : Fin k, Polynomial.C (c i) * newtonBasisPolynomial i.val + +theorem newtonPolynomial_eval_int {k : ℕ} (c : Fin k → ℝ) (n : ℤ) : + (newtonPolynomial c).eval (n : ℝ) = + ∑ i : Fin k, Ring.choose n i.val • c i := by + rw [newtonPolynomial, Polynomial.eval_finsetSum] + apply Finset.sum_congr rfl + intro i hi + simp only [Polynomial.eval_mul, Polynomial.eval_C, + newtonBasisPolynomial_eval_int, zsmul_eq_mul] + exact mul_comm (c i) ((Ring.choose n i.val : ℤ) : ℝ) + +theorem exists_polynomial_lift_of_iter_forwardDiff_eq_zero + (f : ℤ → AddCircle (1 : ℝ)) (k : ℕ) (hk : (forwardDiff^[k]) f = 0) : + ∃ P : Polynomial ℝ, ∀ n : ℤ, ((P.eval (n : ℝ) : ℝ) : AddCircle (1 : ℝ)) = f n := by + obtain ⟨c, hc⟩ := exists_newtonSequence_of_iter_forwardDiff_eq_zero k f hk + have hrepr : ∀ i : Fin k, ∃ x : ℝ, (x : AddCircle (1 : ℝ)) = c i := by + intro i + exact QuotientAddGroup.mk_surjective (c i) + choose a ha using hrepr + refine ⟨newtonPolynomial a, ?_⟩ + intro n + change QuotientAddGroup.mk' (AddSubgroup.zmultiples (1 : ℝ)) + ((newtonPolynomial a).eval (n : ℝ)) = f n + rw [newtonPolynomial_eval_int, map_sum, hc] + simp only [newtonSequence, map_zsmul, QuotientAddGroup.mk'_apply, ha] + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/FiniteEventUnion.lean b/lean/OAI/Geometry/PeriodicTiling/FiniteEventUnion.lean new file mode 100644 index 0000000000000000000000000000000000000000..b66c569129c7248f11102d09b1dfd18681a10cf0 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/FiniteEventUnion.lean @@ -0,0 +1,48 @@ +import Mathlib.Algebra.BigOperators.Ring.Finset +import Mathlib.Algebra.Order.BigOperators.Group.Finset +import Mathlib.Algebra.Order.Field.Rat + +namespace OAI + +universe uΩ uI + +namespace PeriodicTilingThree + +open scoped BigOperators + +theorem exists_avoiding_of_sum_card_lt {Ω : Type uΩ} {I : Type uI} [Fintype Ω] + (events : Finset I) (bad : I → Finset Ω) + (hsmall : (∑ i ∈ events, (bad i).card) < Fintype.card Ω) : + ∃ ω, ∀ i ∈ events, ω ∉ bad i := by + classical + have hUnion : (events.biUnion bad).card < (Finset.univ : Finset Ω).card := by + rw [Finset.card_univ] + exact lt_of_le_of_lt Finset.card_biUnion_le hsmall + obtain ⟨ω, _, hω⟩ := Finset.exists_mem_notMem_of_card_lt_card hUnion + refine ⟨ω, ?_⟩ + intro i hi hbad + exact hω (Finset.mem_biUnion.mpr ⟨i, hi, hbad⟩) + +theorem exists_avoiding_of_uniform_ratio_lt {Ω : Type uΩ} {I : Type uI} [Fintype Ω] + (events : Finset I) (bad : I → Finset Ω) (r : ℚ) + (hΩ : 0 < Fintype.card Ω) + (hbound : ∀ i ∈ events, ((bad i).card : ℚ) / (Fintype.card Ω : ℚ) ≤ r) + (hsmall : (events.card : ℚ) * r < 1) : + ∃ ω, ∀ i ∈ events, ω ∉ bad i := by + have hpos : (0 : ℚ) < (Fintype.card Ω : ℚ) := Nat.cast_pos.mpr hΩ + have hsum : (∑ i ∈ events, ((bad i).card : ℚ)) < (Fintype.card Ω : ℚ) := by + calc + (∑ i ∈ events, ((bad i).card : ℚ)) + ≤ ∑ i ∈ events, r * (Fintype.card Ω : ℚ) := + Finset.sum_le_sum fun i hi => (div_le_iff₀ hpos).mp (hbound i hi) + _ = (events.card : ℚ) * r * (Fintype.card Ω : ℚ) := by + simp only [Finset.sum_const, nsmul_eq_mul, mul_assoc] + _ < 1 * (Fintype.card Ω : ℚ) := mul_lt_mul_of_pos_right hsmall hpos + _ = (Fintype.card Ω : ℚ) := one_mul _ + apply exists_avoiding_of_sum_card_lt events bad + apply (Nat.cast_lt (α := ℚ)).mp + simpa only [Nat.cast_sum] using hsum + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/FiniteMasks.lean b/lean/OAI/Geometry/PeriodicTiling/FiniteMasks.lean new file mode 100644 index 0000000000000000000000000000000000000000..5e73b3c05068240332ab8a68dde4854b90d7b5fe --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/FiniteMasks.lean @@ -0,0 +1,220 @@ +import OAI.Geometry.PeriodicTiling.TilingBasic +import Mathlib.Algebra.MonoidAlgebra.Basic +import Mathlib.Algebra.BigOperators.Ring.Finset +import Mathlib.Basic.Real.Basic +import Mathlib.Tactic.Abel + +namespace OAI + +universe uG uR uι + +noncomputable section + +open scoped BigOperators Classical + +namespace PeriodicTilingThree + +variable {G : Type uG} + +def tileIndicator (R : Type uR) [Zero R] [One R] (A : Set G) (x : G) : R := + if x ∈ A then 1 else 0 + +theorem tileIndicator_nonneg (A : Set G) (x : G) : + 0 ≤ tileIndicator ℝ A x := by + classical + unfold tileIndicator + split_ifs <;> simp + +theorem tileIndicator_le_one (A : Set G) (x : G) : + tileIndicator ℝ A x ≤ 1 := by + classical + unfold tileIndicator + split_ifs <;> simp + +theorem tileIndicator_nat_le_one (A : Set G) (x : G) : + tileIndicator ℕ A x ≤ 1 := by + classical + unfold tileIndicator + split_ifs <;> simp + +theorem sum_tileIndicator_cast (R : Type uR) [AddCommMonoidWithOne R] + {ι : Type uι} (s : Finset ι) (A : Set G) (v : ι → G) : + ((∑ i ∈ s, tileIndicator ℕ A (v i) : ℕ) : R) = + ∑ i ∈ s, tileIndicator R A (v i) := by + classical + simp only [Nat.cast_sum] + apply Finset.sum_congr rfl + intro i hi + by_cases h : v i ∈ A <;> simp [tileIndicator, h] + +section Counts + +variable [AddCommGroup G] + +def tileCount (F : Finset G) (A : Set G) (x : G) : ℕ := + ∑ f ∈ F, tileIndicator ℕ A (x - f) + +theorem tileCount_eq_card_filter (F : Finset G) (A : Set G) (x : G) : + tileCount F A x = (F.filter fun f => x - f ∈ A).card := by + classical + simp [tileCount, tileIndicator] + +theorem tileCount_le_card (F : Finset G) (A : Set G) (x : G) : + tileCount F A x ≤ F.card := by + classical + rw [tileCount_eq_card_filter] + exact Finset.card_filter_le _ _ + +theorem tileCount_cast (R : Type uR) [AddCommMonoidWithOne R] + (F : Finset G) (A : Set G) (x : G) : + (tileCount F A x : R) = ∑ f ∈ F, tileIndicator R A (x - f) := + sum_tileIndicator_cast R F A (fun f => x - f) + +theorem tiles_iff_tileCount_eq_one {F : Finset G} {A : Set G} : + Tiles F A ↔ ∀ x : G, tileCount F A x = 1 := by + classical + rw [tiles_iff_unique_tile] + constructor + · intro h x + obtain ⟨f, hf, hu⟩ := h x + have he : (F.filter fun g => x - g ∈ A) = {f.val} := by + ext g + simp only [Finset.mem_filter, Finset.mem_singleton] + constructor + · rintro ⟨hg, hga⟩ + exact congrArg Subtype.val (hu ⟨g, hg⟩ hga) + · intro hg + subst g + exact ⟨f.property, hf⟩ + rw [tileCount_eq_card_filter, he, Finset.card_singleton] + · intro h x + obtain ⟨f, hf⟩ := Finset.card_eq_one.mp ((tileCount_eq_card_filter F A x).symm.trans (h x)) + have hm : f ∈ F ∧ x - f ∈ A := by + apply Finset.mem_filter.mp + rw [hf] + exact Finset.mem_singleton_self f + refine ⟨⟨f, hm.1⟩, hm.2, ?_⟩ + intro g hg + apply Subtype.ext + have hg' : g.val ∈ F.filter fun f => x - f ∈ A := + Finset.mem_filter.mpr ⟨g.property, hg⟩ + simpa only [hf, Finset.mem_singleton] using hg' + +theorem Tiles.tileCount_eq_one {F : Finset G} {A : Set G} + (h : Tiles F A) (x : G) : tileCount F A x = 1 := + tiles_iff_tileCount_eq_one.mp h x + +theorem Tiles.sum_tileIndicator_eq_one {F : Finset G} {A : Set G} + (h : Tiles F A) (R : Type uR) [AddCommMonoidWithOne R] (x : G) : + (∑ f ∈ F, tileIndicator R A (x - f)) = 1 := by + rw [← tileCount_cast, h.tileCount_eq_one x, Nat.cast_one] + +end Counts + +section MaskAction + +variable {R : Type uR} [Semiring R] [AddCommGroup G] + +def maskAction (m : AddMonoidAlgebra R G) (a : G → R) (x : G) : R := + m.coeff.sum fun y c => c * a (x - y) + +@[simp] theorem maskAction_zero (a : G → R) (x : G) : + maskAction (0 : AddMonoidAlgebra R G) a x = 0 := by + simp [maskAction] + +@[simp] theorem maskAction_single (y : G) (c : R) (a : G → R) (x : G) : + maskAction (AddMonoidAlgebra.single y c) a x = c * a (x - y) := by + simp [maskAction] + +theorem maskAction_add (m n : AddMonoidAlgebra R G) (a : G → R) (x : G) : + maskAction (m + n) a x = maskAction m a x + maskAction n a x := by + simpa only [maskAction, AddMonoidAlgebra.coeff_add] using + (Finsupp.sum_add_index' (f := m.coeff) (g := n.coeff) + (h := fun y c => c * a (x - y)) + (fun _ => zero_mul _) (fun _ _ _ => add_mul _ _ _)) + +theorem maskAction_sum {ι : Type uι} (s : Finset ι) + (m : ι → AddMonoidAlgebra R G) (a : G → R) (x : G) : + maskAction (∑ i ∈ s, m i) a x = ∑ i ∈ s, maskAction (m i) a x := by + simpa only [maskAction, AddMonoidAlgebra.coeff_sum] using + (Finsupp.sum_finsetSum_index (s := s) (g := fun i => (m i).coeff) + (h := fun y c => c * a (x - y)) + (fun _ => zero_mul _) (fun _ _ _ => add_mul _ _ _)).symm + +private theorem maskAction_single_mul (y : G) (c : R) + (m : AddMonoidAlgebra R G) (a : G → R) (x : G) : + maskAction (AddMonoidAlgebra.single y c * m) a x = + c * maskAction m a (x - y) := by + induction m using AddMonoidAlgebra.induction with + | zero => simp + | single_add z d m hz hd ih => + rw [mul_add, maskAction_add, maskAction_add, mul_add, ih] + rw [AddMonoidAlgebra.single_mul_single, maskAction_single, maskAction_single] + rw [mul_assoc, sub_sub] + +theorem maskAction_mul (m n : AddMonoidAlgebra R G) (a : G → R) (x : G) : + maskAction (m * n) a x = maskAction m (fun y => maskAction n a y) x := by + induction m using AddMonoidAlgebra.induction with + | zero => simp + | single_add y c m hy hc ih => + rw [add_mul, maskAction_add, maskAction_add, ih] + rw [maskAction_single_mul, maskAction_single] + +@[simp] theorem maskAction_one (a : G → R) (x : G) : + maskAction (1 : AddMonoidAlgebra R G) a x = a x := by + rw [AddMonoidAlgebra.one_def, maskAction_single] + simp + +theorem maskAction_translate (m : AddMonoidAlgebra R G) (a : G → R) (x v : G) : + maskAction m (fun y => a (y + v)) x = maskAction m a (x + v) := by + unfold maskAction + apply Finsupp.sum_congr + intro y hy + congr 2 + abel_nf + +def familyMask (R : Type uR) [Semiring R] {ι : Type uι} (s : Finset ι) (v : ι → G) : + AddMonoidAlgebra R G := + ∑ i ∈ s, AddMonoidAlgebra.single (v i) 1 + +def tileMask (R : Type uR) [Semiring R] (F : Finset G) : AddMonoidAlgebra R G := + familyMask R F id + +theorem maskAction_familyMask {ι : Type uι} (s : Finset ι) (v : ι → G) + (a : G → R) (x : G) : + maskAction (familyMask R s v) a x = ∑ i ∈ s, a (x - v i) := by + simp only [familyMask, maskAction_sum, maskAction_single, one_mul] + +theorem maskAction_tileMask (F : Finset G) (a : G → R) (x : G) : + maskAction (tileMask R F) a x = ∑ f ∈ F, a (x - f) := + maskAction_familyMask F id a x + +theorem maskAction_familyMask_const {ι : Type uι} (s : Finset ι) (v : ι → G) + (c : R) (x : G) : + maskAction (familyMask R s v) (fun _ => c) x = (s.card : R) * c := by + simp [maskAction_familyMask, nsmul_eq_mul] + +theorem maskAction_familyMask_pow_const {ι : Type uι} (s : Finset ι) (v : ι → G) + (n : ℕ) (c : R) (x : G) : + maskAction (familyMask R s v ^ n) (fun _ => c) x = (s.card : R) ^ n * c := by + induction n generalizing x with + | zero => simp + | succ n ih => + rw [pow_succ', maskAction_mul] + simp_rw [ih] + rw [maskAction_familyMask_const, pow_succ', mul_assoc] + +theorem maskAction_familyMask_pow_succ {ι : Type uι} (s : Finset ι) (v : ι → G) + (a : G → R) (h : ∀ x, (∑ i ∈ s, a (x - v i)) = 1) (n : ℕ) (x : G) : + maskAction (familyMask R s v ^ (n + 1)) a x = (s.card : R) ^ n := by + rw [pow_succ, maskAction_mul] + simp_rw [maskAction_familyMask, h] + rw [maskAction_familyMask_pow_const, mul_one] + +end MaskAction + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/FinitePairCounting.lean b/lean/OAI/Geometry/PeriodicTiling/FinitePairCounting.lean new file mode 100644 index 0000000000000000000000000000000000000000..389a9c1da5d629f063cd779fad930b9732386617 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/FinitePairCounting.lean @@ -0,0 +1,126 @@ +import Mathlib.Data.Fintype.BigOperators +import Mathlib.Data.Fintype.Card +import Mathlib.Data.Fintype.Sum +import Mathlib.Logic.Equiv.Set +import Mathlib.Logic.Equiv.Prod +import Mathlib.Algebra.Order.BigOperators.Ring.Finset +import Mathlib.Tactic.FinCases + +namespace OAI + +universe uV uC uι uA uB + +namespace PeriodicTilingThree + +open scoped BigOperators Classical + +section + +variable {V : Type uV} {C : Type uC} [Fintype V] [Fintype C] {k : ℕ} + +noncomputable def allBadAssignments + (pair : (Fin k × Fin 2) ↪ V) (Good : Fin k → Finset (C × C)) : + Finset (V → C) := by + classical + exact Finset.univ.filter fun f => + ∀ j, (f (pair (j, 0)), f (pair (j, 1))) ∉ Good j + +@[simp] theorem mem_allBadAssignments + (pair : (Fin k × Fin 2) ↪ V) (Good : Fin k → Finset (C × C)) (f : V → C) : + f ∈ allBadAssignments pair Good ↔ + ∀ j, (f (pair (j, 0)), f (pair (j, 1))) ∉ Good j := by + classical + simp [allBadAssignments] + +private abbrev Outside (pair : (Fin k × Fin 2) ↪ V) := + {v : V // v ∉ Set.range pair} + +private noncomputable def vertexDecomposition (pair : (Fin k × Fin 2) ↪ V) : + ((Fin k × Fin 2) ⊕ Outside pair) ≃ V := by + classical + exact (Equiv.sumCongr (Equiv.ofInjective pair pair.injective) (Equiv.refl _)).trans + (Equiv.Set.sumCompl (Set.range pair)) + +private theorem vertexDecomposition_inl {V : Type uV} [Fintype V] (pair : (Fin k × Fin 2) ↪ V) + (x : Fin k × Fin 2) : vertexDecomposition pair (Sum.inl x) = pair x := rfl + +private theorem outside_card (pair : (Fin k × Fin 2) ↪ V) : + Fintype.card (Outside pair) = Fintype.card V - 2 * k := by + classical + have h := Fintype.card_congr (vertexDecomposition pair) + simp only [Fintype.card_sum, Fintype.card_prod, Fintype.card_fin] at h + omega + +private def edgeAssignmentEquiv : ((Fin k × Fin 2) → C) ≃ (Fin k → C × C) where + toFun f j := (f (j, 0), f (j, 1)) + invFun f x := if x.2 = 0 then (f x.1).1 else (f x.1).2 + left_inv f := by + funext x + rcases x with ⟨j, b⟩ + fin_cases b <;> simp + right_inv f := by + funext j + simp + +private noncomputable def assignmentDecomposition (pair : (Fin k × Fin 2) ↪ V) : + (V → C) ≃ (Fin k → C × C) × (Outside pair → C) := + ((Equiv.arrowCongr (vertexDecomposition pair).symm (Equiv.refl C)).trans + (Equiv.sumArrowEquivProdArrow _ _ _)).trans + (Equiv.prodCongr edgeAssignmentEquiv (Equiv.refl _)) + +private theorem assignmentDecomposition_apply + {V : Type uV} {C : Type uC} [Fintype V] [Fintype C] (pair : (Fin k × Fin 2) ↪ V) + (f : V → C) (j : Fin k) : + (assignmentDecomposition pair f).1 j = (f (pair (j, 0)), f (pair (j, 1))) := rfl + +private def constrainedProductEquiv {ι : Type uι} {A : Type uA} {B : Type uB} (p : ι → A → Prop) : + {x : (ι → A) × B // ∀ i, p i (x.1 i)} ≃ (∀ i, {a : A // p i a}) × B where + toFun x := (fun i => ⟨x.1.1 i, x.2 i⟩, x.1.2) + invFun x := ⟨(fun i => (x.1 i).1, x.2), fun i => (x.1 i).2⟩ + left_inv x := by cases x; rfl + right_inv x := by cases x; rfl + +private noncomputable def badAssignmentEquiv + (pair : (Fin k × Fin 2) ↪ V) (Good : Fin k → Finset (C × C)) : + {f : V → C // ∀ j, (f (pair (j, 0)), f (pair (j, 1))) ∉ Good j} ≃ + (∀ j : Fin k, {c : C × C // c ∉ Good j}) × (Outside pair → C) := + ((assignmentDecomposition pair).subtypeEquiv (fun _ => Iff.rfl)).trans + (constrainedProductEquiv fun j c => c ∉ Good j) + +theorem allBadAssignments_card + (pair : (Fin k × Fin 2) ↪ V) (Good : Fin k → Finset (C × C)) : + (allBadAssignments pair Good).card = + (∏ j : Fin k, (Fintype.card C ^ 2 - (Good j).card)) * + Fintype.card C ^ (Fintype.card V - 2 * k) := by + classical + have hbad : (allBadAssignments pair Good).card = + Fintype.card {f : V → C // ∀ j, (f (pair (j, 0)), f (pair (j, 1))) ∉ Good j} := by + rw [Fintype.card_subtype] + rfl + have hcolor (j : Fin k) : Fintype.card {c : C × C // c ∉ Good j} = + Fintype.card C ^ 2 - (Good j).card := by + rw [Fintype.card_subtype_compl] + simp [Fintype.card_prod, pow_two] + rw [hbad, Fintype.card_congr (badAssignmentEquiv pair Good), Fintype.card_prod, + Fintype.card_pi, Fintype.card_fun, outside_card] + simp_rw [hcolor] + +theorem allBadAssignments_card_le + (pair : (Fin k × Fin 2) ↪ V) (Good : Fin k → Finset (C × C)) (g : ℕ) + (hgood : ∀ j, g ≤ (Good j).card) : + (allBadAssignments pair Good).card ≤ + (Fintype.card C ^ 2 - g) ^ k * Fintype.card C ^ (Fintype.card V - 2 * k) := by + classical + rw [allBadAssignments_card] + apply Nat.mul_le_mul_right + calc + (∏ j : Fin k, (Fintype.card C ^ 2 - (Good j).card)) ≤ + ∏ _j : Fin k, (Fintype.card C ^ 2 - g) := + Finset.prod_le_prod (fun j _ => Nat.sub_le_sub_left (hgood j) _) + _ = (Fintype.card C ^ 2 - g) ^ k := by simp + +end + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/FinitePairRatio.lean b/lean/OAI/Geometry/PeriodicTiling/FinitePairRatio.lean new file mode 100644 index 0000000000000000000000000000000000000000..ee4cf599225246675d4d3c241dd4263be7972f9f --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/FinitePairRatio.lean @@ -0,0 +1,49 @@ +import OAI.Geometry.PeriodicTiling.FinitePairCounting +import Mathlib.Algebra.Order.Field.Rat +import Mathlib.Algebra.Order.Field.Power + +namespace OAI + +universe uV uC + +namespace PeriodicTilingThree + +open scoped Classical + +theorem allBadAssignments_card_ratio_le {V : Type uV} {C : Type uC} [Fintype V] [Fintype C] + {k : ℕ} (pair : (Fin k × Fin 2) ↪ V) (Good : Fin k → Finset (C × C)) + (g : ℕ) (hC : 0 < Fintype.card C) (hgB : g ≤ Fintype.card C ^ 2) + (hgood : ∀ j, g ≤ (Good j).card) : + ((allBadAssignments pair Good).card : ℚ) / (Fintype.card (V → C) : ℚ) ≤ + (1 - (g : ℚ) / (Fintype.card C : ℚ) ^ 2) ^ k := by + let B : ℚ := Fintype.card C + let N : ℕ := Fintype.card V + have hBpos : 0 < B := Nat.cast_pos.mpr hC + have hBne : B ≠ 0 := ne_of_gt hBpos + have hdim : 2 * k ≤ N := by + have h := Fintype.card_le_of_embedding pair + simpa only [Fintype.card_prod, Fintype.card_fin, mul_comm, N] using h + have hcast : ((allBadAssignments pair Good).card : ℚ) ≤ + (B ^ 2 - (g : ℚ)) ^ k * B ^ (N - 2 * k) := by + have h := (Nat.cast_le (α := ℚ)).mpr + (allBadAssignments_card_le pair Good g hgood) + simpa only [Nat.cast_mul, Nat.cast_pow, Nat.cast_sub hgB, B, N] using h + have hsplit : B ^ N = (B ^ 2) ^ k * B ^ (N - 2 * k) := by + rw [← pow_mul, ← pow_add, Nat.add_sub_of_le hdim] + rw [Fintype.card_fun, Nat.cast_pow] + change ((allBadAssignments pair Good).card : ℚ) / B ^ N ≤ + (1 - (g : ℚ) / B ^ 2) ^ k + calc + ((allBadAssignments pair Good).card : ℚ) / B ^ N + ≤ ((B ^ 2 - (g : ℚ)) ^ k * B ^ (N - 2 * k)) / B ^ N := + div_le_div_of_nonneg_right hcast (pow_pos hBpos N).le + _ = (B ^ 2 - (g : ℚ)) ^ k / (B ^ 2) ^ k := by + rw [hsplit] + exact mul_div_mul_right _ _ (pow_ne_zero _ hBne) + _ = ((B ^ 2 - (g : ℚ)) / B ^ 2) ^ k := (div_pow _ _ _).symm + _ = (1 - (g : ℚ) / B ^ 2) ^ k := by + rw [sub_div, div_self (pow_ne_zero _ hBne)] + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/ForwardDifference.lean b/lean/OAI/Geometry/PeriodicTiling/ForwardDifference.lean new file mode 100644 index 0000000000000000000000000000000000000000..07aef27f095199292d111ae146968a8287cdb76b --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/ForwardDifference.lean @@ -0,0 +1,18 @@ +import Mathlib.Algebra.Group.Pi.Basic +import Mathlib.Logic.Function.Iterate + +namespace OAI + +universe uA + +namespace PeriodicTilingThree + +def forwardDiff {A : Type uA} [AddCommGroup A] (f : ℤ → A) (n : ℤ) : A := + f (n + 1) - f n + +@[simp] theorem forwardDiff_apply {A : Type uA} [AddCommGroup A] + (f : ℤ → A) (n : ℤ) : forwardDiff f n = f (n + 1) - f n := rfl + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/FullDifferenceBound.lean b/lean/OAI/Geometry/PeriodicTiling/FullDifferenceBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..cf5c849db9f9732a173dd11c2e04770063a39670 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/FullDifferenceBound.lean @@ -0,0 +1,84 @@ +import Mathlib.Data.Nat.Choose.Sum + +namespace OAI + +namespace PeriodicTilingThree + +open scoped BigOperators + +private theorem binomial_two_terms_le (a m : ℕ) (hm : 2 ≤ m) : + a ^ m + a ^ (m - 2) * m.choose 2 ≤ (1 + a) ^ m := by + have hsub : ({0, 2} : Finset ℕ) ⊆ Finset.range (m + 1) := by + intro k hk + simp only [Finset.mem_insert, Finset.mem_singleton] at hk + rcases hk with rfl | rfl + · simp only [Finset.mem_range] + omega + · simp only [Finset.mem_range] + omega + calc + a ^ m + a ^ (m - 2) * m.choose 2 = + ∑ k ∈ ({0, 2} : Finset ℕ), 1 ^ k * a ^ (m - k) * m.choose k := by + simp + _ ≤ ∑ k ∈ Finset.range (m + 1), 1 ^ k * a ^ (m - k) * m.choose k := + Finset.sum_le_sum_of_subset hsub + _ = (1 + a) ^ m := (add_pow 1 a m).symm + +theorem fullDifference_bad_bound (s m : ℕ) (hs : 2 ≤ s) + (hm : 4 * s * (s ^ 2 - 1) ^ 2 + 1 ≤ m) : + s * (2 * m) * (s ^ 2 - 1) ^ m < s ^ (2 * m) := by + let a : ℕ := s ^ 2 - 1 + have hsquare : 4 ≤ s ^ 2 := by + simpa using Nat.pow_le_pow_left hs 2 + have ha : 0 < a := by + dsimp [a] + omega + have ha_succ : 1 + a = s ^ 2 := by + dsimp [a] + omega + change 4 * s * a ^ 2 + 1 ≤ m at hm + have hthreshold : 0 < 4 * s * a ^ 2 := + Nat.mul_pos (Nat.mul_pos (by decide) (by omega)) (pow_pos ha 2) + have hm_two : 2 ≤ m := by omega + have hpred : 4 * s * a ^ 2 ≤ m - 1 := by omega + have hchoose : m.choose 2 * 2 = m * (m - 1) := by + simpa using Nat.choose_succ_right_eq m 1 + have hdoubled : (2 * s * m * a ^ 2) * 2 ≤ m.choose 2 * 2 := by + calc + (2 * s * m * a ^ 2) * 2 = m * (4 * s * a ^ 2) := by ring + _ ≤ m * (m - 1) := Nat.mul_le_mul_left m hpred + _ = m.choose 2 * 2 := hchoose.symm + have hcoefficient : 2 * s * m * a ^ 2 ≤ m.choose 2 := by + omega + have hpower : a ^ 2 * a ^ (m - 2) = a ^ m := by + rw [← pow_add, Nat.add_sub_cancel' hm_two] + have hterm : (2 * s * m) * a ^ m ≤ a ^ (m - 2) * m.choose 2 := by + calc + (2 * s * m) * a ^ m = a ^ (m - 2) * (2 * s * m * a ^ 2) := by + rw [← hpower] + ring + _ ≤ a ^ (m - 2) * m.choose 2 := + Nat.mul_le_mul_left (a ^ (m - 2)) hcoefficient + have hpositive : 0 < a ^ m := pow_pos ha m + calc + s * (2 * m) * (s ^ 2 - 1) ^ m = (2 * s * m) * a ^ m := by + dsimp [a] + ring + _ < a ^ m + a ^ (m - 2) * m.choose 2 := by omega + _ ≤ (1 + a) ^ m := binomial_two_terms_le a m hm_two + _ = s ^ (2 * m) := by rw [ha_succ, ← pow_mul] + +theorem fullDifference_bad_bound_poly (s m : ℕ) (hs : 2 ≤ s) + (hm : 4 * s ^ 5 + 1 ≤ m) : + s * (2 * m) * (s ^ 2 - 1) ^ m < s ^ (2 * m) := by + apply fullDifference_bad_bound s m hs + calc + 4 * s * (s ^ 2 - 1) ^ 2 + 1 ≤ 4 * s * (s ^ 2) ^ 2 + 1 := + Nat.add_le_add_right + (Nat.mul_le_mul_left (4 * s) (Nat.pow_le_pow_left (Nat.sub_le _ _) 2)) 1 + _ = 4 * s ^ 5 + 1 := by ring + _ ≤ m := hm + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/FullDifferencePartition.lean b/lean/OAI/Geometry/PeriodicTiling/FullDifferencePartition.lean new file mode 100644 index 0000000000000000000000000000000000000000..745aad3c43f7b3f821f995dfc79b4462d04cdaeb --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/FullDifferencePartition.lean @@ -0,0 +1,183 @@ +import OAI.Geometry.PeriodicTiling.FinitePairCounting +import OAI.Geometry.PeriodicTiling.PrimeDifferencePairs +import OAI.Geometry.PeriodicTiling.FullDifferenceBound +import Mathlib.Data.Nat.Prime.Infinite +import Mathlib.Algebra.BigOperators.Group.Finset.Basic + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree + +open Classical +open scoped BigOperators + +abbrev Coloring (q s : ℕ) := ZMod q → Fin s + +def BadDifference {q s : ℕ} (c : Coloring q s) (ν : Fin s) (d : ZMod q) : Prop := + ¬ ∃ x y, c x = ν ∧ c y = ν ∧ x - y = d + +def badDifferenceColorings {q s : ℕ} [NeZero q] + (ν : Fin s) (d : ZMod q) : Finset (Coloring q s) := + Finset.univ.filter (fun c => BadDifference c ν d) + +@[simp] +theorem mem_badDifferenceColorings {q s : ℕ} [NeZero q] + (c : Coloring q s) (ν : Fin s) (d : ZMod q) : + c ∈ badDifferenceColorings ν d ↔ BadDifference c ν d := by + simp [badDifferenceColorings] + +theorem badDifference_card_le {q s m : ℕ} [Fact q.Prime] + (hq : q = 2 * m + 1) (ν : Fin s) (d : ZMod q) (hd : d ≠ 0) : + (badDifferenceColorings ν d).card ≤ s * (s ^ 2 - 1) ^ m := by + let pair := primeDifferencePairs q m hq d hd + let good : Fin m → Finset (Fin s × Fin s) := fun _ => {(ν, ν)} + have hsub : badDifferenceColorings ν d ⊆ allBadAssignments pair good := by + intro c hc + apply (mem_allBadAssignments pair good c).mpr + intro j hj + have heq : (c (pair (j, 0)), c (pair (j, 1))) = (ν, ν) := + Finset.mem_singleton.mp hj + apply (mem_badDifferenceColorings c ν d).mp hc + refine ⟨pair (j, 1), pair (j, 0), congrArg Prod.snd heq, + congrArg Prod.fst heq, ?_⟩ + exact primeDifferencePairs_step q m hq d hd j + have hleft : q - 2 * m = 1 := by omega + calc + (badDifferenceColorings ν d).card ≤ (allBadAssignments pair good).card := + Finset.card_le_card hsub + _ ≤ (Fintype.card (Fin s) ^ 2 - 1) ^ m * + Fintype.card (Fin s) ^ (Fintype.card (ZMod q) - 2 * m) := + allBadAssignments_card_le pair good 1 (by intro j; simp [good]) + _ = s * (s ^ 2 - 1) ^ m := by + simp only [Fintype.card_fin, ZMod.card, hleft, pow_one] + exact Nat.mul_comm _ _ + +def badDifferenceLabels (q s : ℕ) [NeZero q] : Finset (Fin s × ZMod q) := + Finset.univ.product ((Finset.univ : Finset (ZMod q)).erase 0) + +@[simp] +theorem badDifferenceLabels_card (q s : ℕ) [NeZero q] : + (badDifferenceLabels q s).card = s * (q - 1) := by + simp [badDifferenceLabels, ZMod.card] + +def someBadDifferenceColorings (q s : ℕ) [NeZero q] : Finset (Coloring q s) := + (badDifferenceLabels q s).biUnion (fun p => badDifferenceColorings p.1 p.2) + +theorem someBadDifferenceColorings_card_le {q s m : ℕ} [Fact q.Prime] + (hq : q = 2 * m + 1) : + (someBadDifferenceColorings q s).card ≤ + (s * (q - 1)) * (s * (s ^ 2 - 1) ^ m) := by + calc + (someBadDifferenceColorings q s).card ≤ + ∑ p ∈ badDifferenceLabels q s, (badDifferenceColorings p.1 p.2).card := + Finset.card_biUnion_le + _ ≤ ∑ _p ∈ badDifferenceLabels q s, s * (s ^ 2 - 1) ^ m := by + apply Finset.sum_le_sum + intro p hp + have hd : p.2 ≠ 0 := (Finset.mem_erase.mp (Finset.mem_product.mp hp).2).1 + exact badDifference_card_le hq p.1 p.2 hd + _ = (s * (q - 1)) * (s * (s ^ 2 - 1) ^ m) := by + rw [Finset.sum_const, nsmul_eq_mul, badDifferenceLabels_card, Nat.cast_id] + +theorem exists_coloring_nonzero_differences {q s m : ℕ} [Fact q.Prime] + (hs : 2 ≤ s) (hq : q = 2 * m + 1) (hm : 4 * s ^ 5 + 1 ≤ m) : + ∃ c : Coloring q s, ∀ ν d, d ≠ 0 → + ∃ x y, c x = ν ∧ c y = ν ∧ x - y = d := by + have hspos : 0 < s := by omega + have hstrict := Nat.mul_lt_mul_of_pos_left + (fullDifference_bad_bound_poly s m hs hm) hspos + have hcard : (someBadDifferenceColorings q s).card < + (Finset.univ : Finset (Coloring q s)).card := by + calc + (someBadDifferenceColorings q s).card ≤ + (s * (q - 1)) * (s * (s ^ 2 - 1) ^ m) := + someBadDifferenceColorings_card_le hq + _ = s * (s * (2 * m) * (s ^ 2 - 1) ^ m) := by + rw [hq] + simp only [Nat.add_sub_cancel] + ring + _ < s * s ^ (2 * m) := hstrict + _ = (Finset.univ : Finset (Coloring q s)).card := by + simp only [Finset.card_univ, Fintype.card_fun, Fintype.card_fin, ZMod.card] + rw [hq, pow_succ] + exact Nat.mul_comm _ _ + obtain ⟨c, _hc, hgood⟩ := Finset.exists_mem_notMem_of_card_lt_card hcard + refine ⟨c, ?_⟩ + intro ν d hd + by_contra hbad + apply hgood + apply Finset.mem_biUnion.mpr + refine ⟨(ν, d), ?_, ?_⟩ + · exact Finset.mem_product.mpr + ⟨Finset.mem_univ _, Finset.mem_erase.mpr ⟨hd, Finset.mem_univ _⟩⟩ + · exact (mem_badDifferenceColorings c ν d).mpr hbad + +theorem exists_partition_of_nonzero_coloring {q s : ℕ} [Fact q.Prime] + (c : Coloring q s) + (hc : ∀ ν d, d ≠ 0 → ∃ x y, c x = ν ∧ c y = ν ∧ x - y = d) : + ∃ E : Fin s → Finset (ZMod q), + (∀ ν, (E ν).Nonempty) ∧ + (∀ x, ∃! ν, x ∈ E ν) ∧ + (∀ ν d, ∃ x ∈ E ν, ∃ y ∈ E ν, x - y = d) := by + let E : Fin s → Finset (ZMod q) := + fun ν => Finset.univ.filter (fun x => c x = ν) + have hne : ∀ ν, (E ν).Nonempty := by + intro ν + obtain ⟨x, _y, hx, _hy, _hxy⟩ := hc ν 1 one_ne_zero + exact ⟨x, by simp [E, hx]⟩ + refine ⟨E, hne, ?_, ?_⟩ + · intro x + refine ⟨c x, by simp [E], ?_⟩ + intro ν hν + exact (Finset.mem_filter.mp hν).2.symm + · intro ν d + by_cases hd : d = 0 + · subst d + obtain ⟨x, hx⟩ := hne ν + exact ⟨x, hx, x, hx, sub_self x⟩ + · obtain ⟨x, y, hx, hy, hxy⟩ := hc ν d hd + exact ⟨x, by simp [E, hx], y, by simp [E, hy], hxy⟩ + +theorem exists_fresh_prime_fullDifference_partition + (s : ℕ) (hs : 0 < s) (forbidden : Finset ℕ) (lower : ℕ) : + ∃ q : ℕ, q.Prime ∧ lower < q ∧ q ∉ forbidden ∧ + ∃ E : Fin s → Finset (ZMod q), + (∀ ν, (E ν).Nonempty) ∧ + (∀ x, ∃! ν, x ∈ E ν) ∧ + (∀ ν d, ∃ x ∈ E ν, ∃ y ∈ E ν, x - y = d) := by + let N := max (8 * s ^ 5 + 3) (max (lower + 1) (forbidden.sup id + 1)) + obtain ⟨q, hqN, hprime⟩ := Nat.exists_infinite_primes N + have hqbig : 8 * s ^ 5 + 3 ≤ q := (le_max_left _ _).trans hqN + have hqrest : max (lower + 1) (forbidden.sup id + 1) ≤ q := + (le_max_right _ _).trans hqN + have hqlower : lower + 1 ≤ q := (le_max_left _ _).trans hqrest + have hqforbidden : forbidden.sup id + 1 ≤ q := (le_max_right _ _).trans hqrest + have hfresh : q ∉ forbidden := by + intro hmem + have hsup : q ≤ forbidden.sup id := Finset.le_sup (f := id) hmem + omega + have hq2 : 2 < q := by omega + let : Fact q.Prime := ⟨hprime⟩ + refine ⟨q, hprime, by omega, hfresh, ?_⟩ + by_cases hs1 : s = 1 + · subst s + let c : Coloring q 1 := fun _ => 0 + apply exists_partition_of_nonzero_coloring c + intro ν d _hd + have hν : (0 : Fin 1) = ν := Subsingleton.elim _ _ + exact ⟨d, 0, hν, hν, sub_zero d⟩ + · have hs2 : 2 ≤ s := by omega + have hodd : q % 2 = 1 := hprime.eq_two_or_odd.resolve_left (by omega) + let m := q / 2 + have hqm : q = 2 * m + 1 := by dsimp [m]; omega + have hm : 4 * s ^ 5 + 1 ≤ m := by dsimp [m]; omega + obtain ⟨c, hc⟩ := exists_coloring_nonzero_differences hs2 hqm hm + exact exists_partition_of_nonzero_coloring c hc + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/GraphTests.lean b/lean/OAI/Geometry/PeriodicTiling/GraphTests.lean new file mode 100644 index 0000000000000000000000000000000000000000..79da27f45651855e422ebdc8ce1be1f27d92a22f --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/GraphTests.lean @@ -0,0 +1,323 @@ +import OAI.Geometry.PeriodicTiling.CyclicCoordinates +import Mathlib.Tactic.Abel + +namespace OAI + +universe uH uB uC + +namespace PeriodicTilingThree + +section RepresentationFibres + +variable {H : Type uH} {B : Type uB} {C : Type uC} [AddCommGroup H] + +theorem tiles_range_iff_unique_base (s : B → H) (hs : Function.Injective s) + (F : Finset H) : + Tiles F (Set.range s) ↔ ∀ y : H, ∃! b : B, y - s b ∈ F := by + rw [tiles_iff_unique_tile] + constructor + · intro h y + obtain ⟨f, hf, huniq⟩ := h y + obtain ⟨b, hb⟩ := hf + have hbf : y - s b = (f : H) := by rw [hb]; simp + refine ⟨b, ?_, ?_⟩ + · change y - s b ∈ F + rw [hbf] + exact f.property + · intro b' hb' + let f' : ↥F := ⟨y - s b', hb'⟩ + have hf' : y - (f' : H) ∈ Set.range s := by + refine ⟨b', ?_⟩ + simp [f'] + have he : (f' : H) = (f : H) := congrArg Subtype.val (huniq f' hf') + apply hs + exact sub_right_inj.mp (he.trans hbf.symm) + · intro h y + obtain ⟨b, hb, huniq⟩ := h y + let f : ↥F := ⟨y - s b, hb⟩ + refine ⟨f, ?_, ?_⟩ + · refine ⟨b, ?_⟩ + simp [f] + · intro f' hf' + obtain ⟨b', hb'⟩ := hf' + have hbf : y - s b' = (f' : H) := by rw [hb']; simp + have hbb : b' = b := huniq b' (by + change y - s b' ∈ F + rw [hbf] + exact f'.property) + apply Subtype.ext + change (f' : H) = y - s b + rw [← hbf, hbb] + +variable [AddCommGroup B] [AddCommGroup C] + +theorem tiles_kernel_iff_unique_fibre (q : H →+ B) + (hq : Function.Surjective q) (F : Finset H) + (hF : ∀ x : H, x ∈ F ↔ q x = 0) (A : Set H) : + Tiles F A ↔ ∀ b : B, ∃! a : A, q (a : H) = b := by + constructor + · intro h b + obtain ⟨y, hy⟩ := hq b + obtain ⟨⟨f, a⟩, hfa⟩ := h.2 y + change (f : H) + (a : H) = y at hfa + have hqa : q (a : H) = b := by + have he := congrArg q hfa + rw [map_add, (hF _).mp f.property, zero_add, hy] at he + exact he + refine ⟨a, hqa, ?_⟩ + intro a' ha' + have hmem : y - (a' : H) ∈ F := by + apply (hF _).mpr + rw [map_sub, hy, ha', sub_self] + let f' : ↥F := ⟨y - (a' : H), hmem⟩ + have he : ((f', a') : ↥F × A) = (f, a) := by + apply h.1 + change (y - (a' : H)) + (a' : H) = (f : H) + (a : H) + rw [sub_add_cancel, hfa] + exact congrArg Prod.snd he + · intro h + constructor + · rintro ⟨f, a⟩ ⟨f', a'⟩ he + have hqa : q (a : H) = q (a' : H) := by + have he' := congrArg q he + simpa only [map_add, (hF _).mp f.property, + (hF _).mp f'.property, zero_add] using he' + obtain ⟨a₀, _ha₀, huniq⟩ := h (q (a : H)) + have haa : a = a' := (huniq a rfl).trans (huniq a' hqa.symm).symm + have hff : f = f' := by + apply Subtype.ext + have hv := congrArg Subtype.val haa + change (f : H) + (a : H) = (f' : H) + (a' : H) at he + rw [hv] at he + exact add_right_cancel he + exact Prod.ext hff haa + · intro y + obtain ⟨a, ha, _huniq⟩ := h (q y) + have hmem : y - (a : H) ∈ F := by + apply (hF _).mpr + rw [map_sub, ha, sub_self] + refine ⟨(⟨y - (a : H), hmem⟩, a), ?_⟩ + exact sub_add_cancel y (a : H) + +theorem tiles_invariance_iff (q : H →+ B) (ψ : H →+ C) + (s : B → H) (hs : ∀ b, q (s b) = b) + (σ : B) (F : Finset H) + (hF : ∀ v : H, v ∈ F ↔ + (q v = 0 ∧ ψ v ≠ 0) ∨ (q v = σ ∧ ψ v = 0)) : + Tiles F (Set.range s) ↔ ∀ b, ψ (s (b - σ)) = ψ (s b) := by + have hinj : Function.Injective s := fun b b' h => by + have := congrArg q h + simpa only [hs] using this + have hmem (y : H) (b : B) : y - s b ∈ F ↔ + (q y = b ∧ ψ y ≠ ψ (s b)) ∨ + (q y = σ + b ∧ ψ y = ψ (s b)) := by + simpa only [map_sub, hs, sub_eq_zero, sub_ne_zero, + sub_eq_iff_eq_add, zero_add] using hF (y - s b) + rw [tiles_range_iff_unique_base s hinj F] + constructor + · intro h b + obtain ⟨b', hb', _huniq⟩ := h (s b) + rcases (hmem _ _).mp hb' with ⟨hq, hne⟩ | ⟨hq, he⟩ + · rw [hs] at hq + exact False.elim (hne (congrArg (fun b => ψ (s b)) hq)) + · rw [hs] at hq + have hb : b' = b - σ := by rw [hq]; abel + rw [hb] at he + exact he.symm + · intro h y + by_cases he : ψ y = ψ (s (q y)) + · refine ⟨q y - σ, ?_, ?_⟩ + · apply (hmem _ _).mpr + exact Or.inr ⟨by abel, he.trans (h (q y)).symm⟩ + · intro b hb + rcases (hmem _ _).mp hb with ⟨hq, hne⟩ | ⟨hq, _he⟩ + · exact False.elim (hne (hq ▸ he)) + · rw [hq] + abel + · refine ⟨q y, (hmem _ _).mpr (Or.inl ⟨rfl, he⟩), ?_⟩ + intro b hb + rcases (hmem _ _).mp hb with ⟨hq, _hne⟩ | ⟨hq, he'⟩ + · exact hq.symm + · have hb : b = q y - σ := by rw [hq]; abel + rw [hb, h (q y)] at he' + exact False.elim (he he') + +end RepresentationFibres + +noncomputable section Concrete + +variable {p : ℕ} [NeZero p] (E : EncodingParameters p) + +local instance : DecidableEq (Ambient E) := Classical.decEq _ + +def usefulCoord (i : Channel p) : Ambient E →+ P E i where + toFun v := (v.2.2 i).2 + map_zero' := rfl + map_add' _ _ := rfl + +@[simp] theorem usefulCoord_apply (i : Channel p) (v : Ambient E) : + usefulCoord E i v = (v.2.2 i).2 := rfl + +@[simp] theorem usefulCoord_point (i : Channel p) (o : GraphOutputs E) (b : Base E) : + usefulCoord E i (point o b) = o.c b i := rfl + +private theorem kernel_horizontal_zero (v : (q0 E).ker) : + (v : Ambient E).1 = 0 := by + have hv := congrArg Prod.fst v.property + exact hv + +noncomputable instance kernelFintype : Fintype (q0 E).ker := + Fintype.ofInjective (fun v : (q0 E).ker => (v : Ambient E).2) (by + intro v w h + apply Subtype.ext + exact Prod.ext ((kernel_horizontal_zero E v).trans + (kernel_horizontal_zero E w).symm) h) + +def kernelTile : Finset (Ambient E) := + (Finset.univ : Finset (q0 E).ker).map ⟨Subtype.val, Subtype.val_injective⟩ + +@[simp] theorem mem_kernelTile (v : Ambient E) : + v ∈ kernelTile E ↔ q0 E v = 0 := by + constructor + · intro hv + obtain ⟨w, _hw, rfl⟩ := Finset.mem_map.mp hv + exact w.property + · intro hv + exact Finset.mem_map.mpr ⟨⟨v, hv⟩, Finset.mem_univ _, rfl⟩ + +theorem kernelTile_nonempty : (kernelTile E).Nonempty := + ⟨0, (mem_kernelTile E 0).mpr (map_zero _)⟩ + +def baseLift (b : Base E) : Ambient E := point (zeroOutputs E) b + +@[simp] theorem q0_baseLift (b : Base E) : q0 E (baseLift E b) = b := + q0_point (zeroOutputs E) b + +@[simp] theorem usefulCoord_baseLift (i : Channel p) (b : Base E) : + usefulCoord E i (baseLift E b) = 0 := rfl + +theorem kernelTile_iff_unique_fibre (A : Set (Ambient E)) : + Tiles (kernelTile E) A ↔ + ∀ b : Base E, ∃! a : A, q0 E (a : Ambient E) = b := + tiles_kernel_iff_unique_fibre (q0 E) (q0_surjective E) (kernelTile E) + (mem_kernelTile E) A + +theorem kernelTile_graph (o : GraphOutputs E) : Tiles (kernelTile E) (graph o) := by + apply (tiles_range_iff_unique_base (point o) (point_injective o) (kernelTile E)).mpr + intro y + refine ⟨q0 E y, ?_, ?_⟩ + · change y - point o (q0 E y) ∈ kernelTile E + rw [mem_kernelTile, map_sub, q0_point, sub_self] + · intro b hb + rw [mem_kernelTile, map_sub, q0_point, sub_eq_zero] at hb + exact hb.symm + +theorem kernelTile_iff_graph (A : Set (Ambient E)) : + Tiles (kernelTile E) A ↔ ∃ o : GraphOutputs E, graph o = A := by + classical + constructor + · intro h + have hf := (kernelTile_iff_unique_fibre E A).mp h + let a : Base E → A := fun b => Classical.choose (hf b) + have ha (b : Base E) : q0 E (a b : Ambient E) = b := + (Classical.choose_spec (hf b)).1 + let s : Base E → Ambient E := fun b => (a b : Ambient E) + have hs : ∀ b, q0 E (s b) = b := ha + refine ⟨outputsOfSection s hs, ?_⟩ + rw [graph_outputsOfSection] + ext y + constructor + · rintro ⟨b, rfl⟩ + exact (a b).property + · intro hy + refine ⟨q0 E y, ?_⟩ + have he : (⟨y, hy⟩ : A) = a (q0 E y) := + (Classical.choose_spec (hf (q0 E y))).2 ⟨y, hy⟩ rfl + exact (congrArg Subtype.val he).symm + · rintro ⟨o, rfl⟩ + exact kernelTile_graph E o + +def invarianceZero (i : Channel p) : Finset (Ambient E) := + (kernelTile E).filter (fun v => usefulCoord E i v = 0) + +def invarianceNonzero (i : Channel p) : Finset (Ambient E) := + (kernelTile E).filter (fun v => usefulCoord E i v ≠ 0) + +def invarianceTile (i : Channel p) (σ : Base E) : Finset (Ambient E) := + invarianceNonzero E i ∪ + (invarianceZero E i).image (fun v => baseLift E σ + v) + +theorem mem_invarianceTile (i : Channel p) (σ : Base E) (v : Ambient E) : + v ∈ invarianceTile E i σ ↔ + (q0 E v = 0 ∧ usefulCoord E i v ≠ 0) ∨ + (q0 E v = σ ∧ usefulCoord E i v = 0) := by + constructor + · intro hv + rcases Finset.mem_union.mp hv with hv | hv + · exact Or.inl (by simpa only [invarianceNonzero, Finset.mem_filter, + mem_kernelTile] using hv) + · obtain ⟨w, hw, rfl⟩ := Finset.mem_image.mp hv + have hw' : q0 E w = 0 ∧ usefulCoord E i w = 0 := by + simpa only [invarianceZero, Finset.mem_filter, mem_kernelTile] using hw + exact Or.inr ⟨by rw [map_add, q0_baseLift, hw'.1, add_zero], + by rw [map_add, usefulCoord_baseLift, hw'.2, add_zero]⟩ + · rintro (⟨hq, hc⟩ | ⟨hq, hc⟩) + · apply Finset.mem_union.mpr + exact Or.inl (by simpa only [invarianceNonzero, Finset.mem_filter, + mem_kernelTile] using And.intro hq hc) + · apply Finset.mem_union.mpr + apply Or.inr + apply Finset.mem_image.mpr + refine ⟨v - baseLift E σ, ?_, ?_⟩ + · rw [invarianceZero, Finset.mem_filter, mem_kernelTile] + constructor + · rw [map_sub, hq, q0_baseLift, sub_self] + · rw [map_sub, hc, usefulCoord_baseLift, sub_self] + · abel + +theorem invarianceTile_nonempty (i : Channel p) (σ : Base E) : + (invarianceTile E i σ).Nonempty := by + refine ⟨baseLift E σ, (mem_invarianceTile E i σ _).mpr (Or.inr ?_)⟩ + exact ⟨q0_baseLift E σ, usefulCoord_baseLift E i σ⟩ + +theorem invarianceTile_disjoint (i : Channel p) (σ : Base E) : + Disjoint (invarianceNonzero E i) + ((invarianceZero E i).image (fun v => baseLift E σ + v)) := by + apply Finset.disjoint_left.mpr + intro v hv hv' + have hne : usefulCoord E i v ≠ 0 := (Finset.mem_filter.mp hv).2 + obtain ⟨w, hw, rfl⟩ := Finset.mem_image.mp hv' + have hw0 : usefulCoord E i w = 0 := (Finset.mem_filter.mp hw).2 + apply hne + rw [map_add, usefulCoord_baseLift, hw0, add_zero] + +theorem invarianceTile_card (i : Channel p) (σ : Base E) : + (invarianceTile E i σ).card = (kernelTile E).card := by + rw [invarianceTile, Finset.card_union_of_disjoint (invarianceTile_disjoint E i σ), + Finset.card_image_of_injective _ (fun _ _ h => add_left_cancel h)] + have hpart : invarianceNonzero E i ∪ invarianceZero E i = kernelTile E := by + ext v + simp only [invarianceNonzero, invarianceZero, Finset.mem_union, Finset.mem_filter] + constructor + · rintro (⟨hv, _⟩ | ⟨hv, _⟩) <;> exact hv + · intro hv + by_cases hc : usefulCoord E i v = 0 + · exact Or.inr ⟨hv, hc⟩ + · exact Or.inl ⟨hv, hc⟩ + have hdisj : Disjoint (invarianceNonzero E i) (invarianceZero E i) := by + apply Finset.disjoint_left.mpr + intro v hv hw + exact (Finset.mem_filter.mp hv).2 (Finset.mem_filter.mp hw).2 + rw [← Finset.card_union_of_disjoint hdisj, hpart] + +theorem invarianceTile_iff (i : Channel p) (σ : Base E) (o : GraphOutputs E) : + Tiles (invarianceTile E i σ) (graph o) ↔ + ∀ b, o.c (b - σ) i = o.c b i := by + exact tiles_invariance_iff (q0 E) (usefulCoord E i) (point o) + (q0_point o) σ (invarianceTile E i σ) (mem_invarianceTile E i σ) + +end Concrete + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/GridRigidity.lean b/lean/OAI/Geometry/PeriodicTiling/GridRigidity.lean new file mode 100644 index 0000000000000000000000000000000000000000..3403668a915a8bb1011bd66d7f06143b5f385764 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/GridRigidity.lean @@ -0,0 +1,152 @@ +import OAI.Geometry.PeriodicTiling.SeparatedCenters +import OAI.Geometry.PeriodicTiling.CenterFiniteness +import OAI.Geometry.PeriodicTiling.AuxiliaryCubes +import OAI.Geometry.PeriodicTiling.PeriodicVolume +import Mathlib.Topology.Order.IntermediateValue +import Mathlib.Tactic.Abel + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree + +open Set MeasureTheory + +theorem grid_difference_of_cube_chain {m : ℕ} {C : Set (Space 3)} + (hnear : ∀ c c' : C, ‖(c' : Space 3) - (c : Space 3)‖ ≤ (m : ℝ) → + (c' : Space 3) - (c : Space 3) ∈ scaledGrid m) + {c₀ c : C} + (hchain : Relation.ReflTransGen + (CoverIntersects (fun a : C => auxiliaryCube m a)) c₀ c) : + (c : Space 3) - (c₀ : Space 3) ∈ scaledGrid m := by + induction hchain with + | refl => simpa only [sub_self] using (scaledGrid m).zero_mem + | @tail a b _ hab ih => + have hedge := hnear a b (auxiliaryCube_inter_norm_le hab) + have hid : (b : Space 3) - (c₀ : Space 3) = + ((b : Space 3) - (a : Space 3)) + ((a : Space 3) - (c₀ : Space 3)) := by + abel + rw [hid] + exact (scaledGrid m).add_mem hedge ih + +theorem grid_coset_of_auxiliary_cover {m : ℕ} (hm : 0 < m) + (C : Set (Space 3)) + (hlocal : LocallyFinite (fun c : C => auxiliaryCube m c)) + (hcover : ∀ x : Space 3, ∃ c : C, x ∈ auxiliaryCube m c) + (hnear : ∀ c c' : C, ‖(c' : Space 3) - (c : Space 3)‖ ≤ (m : ℝ) → + (c' : Space 3) - (c : Space 3) ∈ scaledGrid m) : + ∃ c₀ ∈ C, C = {x : Space 3 | x - c₀ ∈ scaledGrid m} := by + obtain ⟨c₀, _hc₀⟩ := hcover 0 + have hmR : (0 : ℝ) < m := by exact_mod_cast hm + have hgrid (c : C) : (c : Space 3) - (c₀ : Space 3) ∈ scaledGrid m := by + apply grid_difference_of_cube_chain hnear + exact closed_cover_chain_connected (fun a : C => auxiliaryCube m a) + (fun a => auxiliaryCube_nonempty m a) (fun a => auxiliaryCube_isClosed m a) + hlocal hcover c₀ c + refine ⟨c₀, c₀.property, ?_⟩ + ext x + constructor + · intro hx + exact hgrid ⟨x, hx⟩ + · intro hx + obtain ⟨c, hxc⟩ := hcover x + have hdiff : x - (c : Space 3) ∈ scaledGrid m := by + have h := (scaledGrid m).sub_mem hx (hgrid c) + have hid : (x - (c₀ : Space 3)) - ((c : Space 3) - (c₀ : Space 3)) = + x - (c : Space 3) := by abel + rwa [hid] at h + have hnorm : ‖x - (c : Space 3)‖ < (m : ℝ) := by + have hle : dist x (c : Space 3) ≤ (m : ℝ) / 2 := hxc + rw [dist_eq_norm] at hle + linarith + have hxc' : x = (c : Space 3) := + sub_eq_zero.mp (scaledGrid_eq_zero_of_norm_lt hm hdiff hnorm) + rw [hxc'] + exact c.property + +theorem periodic_voxel_assembly_grid + {m : ℕ} (hm : 2 ≤ m) {S0 S1 S : Finset (Lattice 3)} + (h0 : S ⊆ S0) (h1 : S ⊆ S1) (hdiff : RigidDifferences m S) + (hcard0 : S0.card = m ^ 3) (hcard1 : S1.card = m ^ 3) + {C C1 : Set (Space 3)} + (b : Module.Basis (Fin 3) ℝ (Space 3)) + (hp : ∀ v ∈ latticeOfBasis b, Period C v) + (ht : ∀ v ∈ latticeOfBasis b, Period C1 v) + (htile : TypedAETiles (Thickening S0) (Thickening S1) C C1) : + ∃ c₀ ∈ C, C = {x : Space 3 | x - c₀ ∈ scaledGrid m} := by + have hmpos : 0 < m := lt_of_lt_of_le (by decide : 0 < 2) hm + have hmR : (0 : ℝ) < m := by exact_mod_cast hmpos + have hsep : C.Pairwise (fun x y => (m : ℝ) ≤ ‖x - y‖) := by + intro x hx y hy hxy + have hne : (⟨y, hy⟩ : C) ≠ ⟨x, hx⟩ := by + intro heq + exact hxy (congrArg Subtype.val heq).symm + exact typed_centers_separated hm h0 h1 hdiff htile hne + have hcount := centers_countable hmR hsep + have hfin : ∀ K : Set (Space 3), Bornology.IsBounded K → (C ∩ K).Finite := + fun _ hK => centers_finite_on_bounded hmR hsep hK + have hnear : ∀ c c' : C, ‖(c' : Space 3) - (c : Space 3)‖ ≤ (m : ℝ) → + (c' : Space 3) - (c : Space 3) ∈ scaledGrid m := by + intro c c' hcc' + by_cases heq : c = c' + · subst c' + simpa only [sub_self] using (scaledGrid m).zero_mem + · exact typed_nearby_centers_mem_scaledGrid hm h0 h1 hdiff htile heq hcc' + have hvol : volume (Thickening S1) = volume (Thickening S0) := by + rw [thickening_volume, thickening_volume, hcard0, hcard1] + have hJvol : volume (auxiliaryCube m 0) = volume (Thickening S0) := by + rw [auxiliaryCube_volume, thickening_volume, hcard0] + have hpack : Pairwise fun c c' : C => AEDisjoint volume + (PeriodicVolume.translate c (auxiliaryCube m 0)) + (PeriodicVolume.translate c' (auxiliaryCube m 0)) := by + intro c c' hne + change AEDisjoint volume {x | x - (c : Space 3) ∈ auxiliaryCube m 0} + {x | x - (c' : Space 3) ∈ auxiliaryCube m 0} + rw [auxiliaryCube_translate, auxiliaryCube_translate] + apply auxiliaryCube_aedisjoint hmpos + exact hsep c.property c'.property (fun heq => hne (Subtype.ext heq)) + have hae := PeriodicVolume.replacement_ae_covers b + (Thickening S0) (Thickening S1) (auxiliaryCube m 0) C C1 + hcount hfin (thickening_measurableSet S0) (thickening_measurableSet S1) + (auxiliaryCube_measurableSet m 0) hvol hJvol hp ht htile hpack + have haecubes : ∀ᵐ x ∂volume, ∃ c : C, x ∈ auxiliaryCube m c := by + filter_upwards [hae] with x hx + obtain ⟨c, hc⟩ := hx + refine ⟨c, ?_⟩ + rw [← auxiliaryCube_translate] + exact hc + exact grid_coset_of_auxiliary_cover hmpos C (auxiliaryCube_locallyFinite m C hfin) + (auxiliaryCube_cover_of_ae m C hfin haecubes) hnear + +theorem periodic_voxel_assembly_grid_range + {m : ℕ} (hm : 2 ≤ m) {S0 S1 S : Finset (Lattice 3)} + (h0 : S ⊆ S0) (h1 : S ⊆ S1) (hdiff : RigidDifferences m S) + (hcard0 : S0.card = m ^ 3) (hcard1 : S1.card = m ^ 3) + {C C1 : Set (Space 3)} + (b : Module.Basis (Fin 3) ℝ (Space 3)) + (hp : ∀ v ∈ latticeOfBasis b, Period C v) + (ht : ∀ v ∈ latticeOfBasis b, Period C1 v) + (htile : TypedAETiles (Thickening S0) (Thickening S1) C C1) : + ∃ c₀ ∈ C, C = Set.range (fun z : Lattice 3 => c₀ + (m : ℝ) • castLattice z) := by + obtain ⟨c₀, hc₀, heq⟩ := periodic_voxel_assembly_grid hm h0 h1 hdiff + hcard0 hcard1 b hp ht htile + refine ⟨c₀, hc₀, heq.trans ?_⟩ + ext x + constructor + · intro hx + obtain ⟨z, hz⟩ := mem_scaledGrid.mp hx + refine ⟨z, ?_⟩ + change c₀ + (m : ℝ) • castLattice z = x + rw [hz, add_sub_cancel] + · rintro ⟨z, rfl⟩ + apply mem_scaledGrid.mpr + refine ⟨z, ?_⟩ + change (m : ℝ) • castLattice z = (c₀ + (m : ℝ) • castLattice z) - c₀ + exact (add_sub_cancel_left c₀ ((m : ℝ) • castLattice z)).symm + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/IntegerMatrixIndex.lean b/lean/OAI/Geometry/PeriodicTiling/IntegerMatrixIndex.lean new file mode 100644 index 0000000000000000000000000000000000000000..7ac6e19c23f3dccf3dcbccf5fff0b5541b9742bc --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/IntegerMatrixIndex.lean @@ -0,0 +1,100 @@ +import OAI.Geometry.PeriodicTiling.EuclideanBasic +import OAI.Geometry.PeriodicTiling.MarkedTile +import Mathlib.LinearAlgebra.Matrix.Adjugate +import Mathlib.LinearAlgebra.Determinant + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree + +open Matrix +open scoped BigOperators + +theorem integer_mulVec_mem_of_columns + (L : AddSubgroup (Lattice 3)) (M : Matrix (Fin 3) (Fin 3) ℤ) + (hM : ∀ j, M.col j ∈ L) (z : Lattice 3) : M *ᵥ z ∈ L := by + have hs : (∑ j : Fin 3, z j • M.col j) ∈ L := by + apply L.sum_mem + intro j _hj + exact L.zsmul_mem (hM j) (z j) + have he : M *ᵥ z = ∑ j : Fin 3, z j • M.col j := by + ext i + simp [Matrix.mulVec, dotProduct, Matrix.col, mul_comm] + rwa [he] + +theorem determinant_smul_mem_of_columns + (L : AddSubgroup (Lattice 3)) (M : Matrix (Fin 3) (Fin 3) ℤ) + (hM : ∀ j, M.col j ∈ L) (z : Lattice 3) : M.det • z ∈ L := by + have h := integer_mulVec_mem_of_columns L M hM (M.adjugate *ᵥ z) + simpa only [Matrix.mulVec_mulVec, Matrix.mul_adjugate, + Matrix.smul_mulVec, Matrix.one_mulVec] using h + +theorem finiteIndex_of_integer_columns + (L : AddSubgroup (Lattice 3)) (M : Matrix (Fin 3) (Fin 3) ℤ) + (hdet : M.det ≠ 0) (hM : ∀ j, M.col j ∈ L) : L.FiniteIndex := by + let d : ℕ := M.det.natAbs + have hd : d ≠ 0 := (Int.natAbs_pos.mpr hdet).ne' + let : NeZero d := ⟨hd⟩ + have hker : (MarkedTile.residue d).ker ≤ L := by + intro x hx + obtain ⟨z, hz⟩ := MarkedTile.exists_scale_of_residue_eq_zero d hx + have habs : (d : ℤ) • z ∈ L := by + have h := determinant_smul_mem_of_columns L M hM z + change (M.det.natAbs : ℤ) • z ∈ L + rw [Int.natCast_natAbs] + by_cases hsign : 0 ≤ M.det + · simpa only [abs_of_nonneg hsign] using h + · simpa only [abs_of_nonpos (le_of_not_ge hsign), neg_smul] using L.neg_mem h + have he : MarkedTile.scale d z = (d : ℤ) • z := by + ext i + simp only [MarkedTile.scale_apply, Pi.smul_apply, smul_eq_mul] + rw [← hz, he] + exact habs + let : (MarkedTile.residue d).ker.FiniteIndex := inferInstance + exact AddSubgroup.finiteIndex_of_le hker + +theorem det_ne_zero_of_scaled_columns_basis (m : ℕ) + (b : Module.Basis (Fin 3) ℝ (Space 3)) (z : Fin 3 → Lattice 3) + (hz : ∀ j, scaledCast m (z j) = b j) : + Matrix.det (fun i j : Fin 3 => z j i) ≠ 0 := by + let M : Matrix (Fin 3) (Fin 3) ℤ := fun i j => z j i + let e := Pi.basisFun ℝ (Fin 3) + have hreal : (e.toMatrix b).det ≠ 0 := (e.isUnit_det b).ne_zero + have hmatrix : e.toMatrix b = (m : ℝ) • (M.map fun a => (a : ℝ)) := by + ext i j + change (e.repr (b j)) i = (m : ℝ) * (z j i : ℝ) + rw [Pi.basisFun_repr] + exact (congrFun (hz j) i).symm + change M.det ≠ 0 + intro hzero + have hcast : (M.map fun a => (a : ℝ)).det = 0 := by + rw [← Int.cast_det, hzero, Int.cast_zero] + apply hreal + rw [hmatrix, Matrix.det_smul, hcast, mul_zero] + +theorem lattice_pullback_finiteIndex (m : ℕ) + (b : Module.Basis (Fin 3) ℝ (Space 3)) + (hb : latticeOfBasis b ≤ scaledGrid m) : + ((latticeOfBasis b).comap (scaledCast m)).FiniteIndex := by + have hbmem : ∀ j : Fin 3, b j ∈ latticeOfBasis b := by + intro j + exact Submodule.subset_span ⟨j, rfl⟩ + have hex : ∀ j : Fin 3, ∃ z : Lattice 3, scaledCast m z = b j := by + intro j + exact hb (hbmem j) + choose z hz using hex + let M : Matrix (Fin 3) (Fin 3) ℤ := fun i j => z j i + apply finiteIndex_of_integer_columns _ M + (det_ne_zero_of_scaled_columns_basis m b z hz) + intro j + change scaledCast m (z j) ∈ latticeOfBasis b + rw [hz j] + exact hbmem j + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/LabeledDigitBlocks.lean b/lean/OAI/Geometry/PeriodicTiling/LabeledDigitBlocks.lean new file mode 100644 index 0000000000000000000000000000000000000000..56161e5ba5a8b02e03f12eef1c4281bf483c505b --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/LabeledDigitBlocks.lean @@ -0,0 +1,251 @@ +import Mathlib.Data.ZMod.Basic +import Mathlib.Data.Fintype.EquivFin +import Mathlib.Logic.Equiv.Prod +import Mathlib.Tactic.FinCases + +namespace OAI + +universe uK uA uB uL uR uJ uF + +namespace PeriodicTilingThree + +structure LabeledBlocks (K : Type uK) (A : Type uA) (B : Type uB) (a b : ℕ) where + decode : K ≃ ((A × ZMod a) ⊕ (B × ZMod b)) + +namespace LabeledBlocks + +variable {K : Type uK} {A : Type uA} {B : Type uB} {a b : ℕ} + +def labelRotation (t : ℤ) : Equiv.Perm ((A × ZMod a) ⊕ (B × ZMod b)) where + toFun + | .inl (c, y) => .inl (c, y + (t : ZMod a)) + | .inr (c, y) => .inr (c, y + (t : ZMod b)) + invFun + | .inl (c, y) => .inl (c, y - (t : ZMod a)) + | .inr (c, y) => .inr (c, y - (t : ZMod b)) + left_inv := by rintro (⟨c, y⟩ | ⟨c, y⟩) <;> simp + right_inv := by rintro (⟨c, y⟩ | ⟨c, y⟩) <;> simp + +def C (D : LabeledBlocks K A B a b) (x : K) : ZMod a × ZMod b := + match D.decode x with + | .inl (_, y) => (y, 0) + | .inr (_, y) => (0, y) + +def T (D : LabeledBlocks K A B a b) (t : ℤ) : Equiv.Perm K := + D.decode.trans ((labelRotation t).trans D.decode.symm) + +def blockId (D : LabeledBlocks K A B a b) (x : K) : A ⊕ B := + match D.decode x with + | .inl (c, _) => .inl c + | .inr (c, _) => .inr c + +def block (D : LabeledBlocks K A B a b) (c : A ⊕ B) : Set K := + {x | D.blockId x = c} + +theorem unique_block (D : LabeledBlocks K A B a b) (x : K) : + ∃! c : A ⊕ B, x ∈ D.block c := by + exact ⟨D.blockId x, rfl, fun c hc => hc.symm⟩ + +noncomputable def blockEquivA (D : LabeledBlocks K A B a b) (c : A) : + {x : K // x ∈ D.block (.inl c)} ≃ ZMod a := + (Equiv.ofBijective + (fun y : ZMod a => (⟨D.decode.symm (.inl (c, y)), by simp [block, blockId]⟩ : + {x : K // x ∈ D.block (.inl c)})) + (by + constructor + · intro y z h + have hh := congrArg (fun x => D.decode x.val) h + simpa using hh + · rintro ⟨x, hx⟩ + cases h : D.decode x with + | inl z => + have hz : z.1 = c := by simpa [block, blockId, h] using hx + refine ⟨z.2, Subtype.ext ?_⟩ + apply D.decode.injective + rw [Equiv.apply_symm_apply, h] + exact congrArg Sum.inl (Prod.ext hz.symm rfl) + | inr z => simp [block, blockId, h] at hx)).symm + +noncomputable def blockEquivB (D : LabeledBlocks K A B a b) (c : B) : + {x : K // x ∈ D.block (.inr c)} ≃ ZMod b := + (Equiv.ofBijective + (fun y : ZMod b => (⟨D.decode.symm (.inr (c, y)), by simp [block, blockId]⟩ : + {x : K // x ∈ D.block (.inr c)})) + (by + constructor + · intro y z h + have hh := congrArg (fun x => D.decode x.val) h + simpa using hh + · rintro ⟨x, hx⟩ + cases h : D.decode x with + | inl z => simp [block, blockId, h] at hx + | inr z => + have hz : z.1 = c := by simpa [block, blockId, h] using hx + refine ⟨z.2, Subtype.ext ?_⟩ + apply D.decode.injective + rw [Equiv.apply_symm_apply, h] + exact congrArg Sum.inr (Prod.ext hz.symm rfl))).symm + +@[simp] theorem C_decode_symm_inl (D : LabeledBlocks K A B a b) + (c : A) (y : ZMod a) : D.C (D.decode.symm (.inl (c, y))) = (y, 0) := by + simp [C] + +@[simp] theorem C_decode_symm_inr (D : LabeledBlocks K A B a b) + (c : B) (y : ZMod b) : D.C (D.decode.symm (.inr (c, y))) = (0, y) := by + simp [C] + +@[simp] theorem decode_T (D : LabeledBlocks K A B a b) (t : ℤ) (x : K) : + D.decode (D.T t x) = labelRotation t (D.decode x) := by + simp [T] + +@[simp] theorem T_decode_symm_inl (D : LabeledBlocks K A B a b) + (t : ℤ) (c : A) (y : ZMod a) : + D.T t (D.decode.symm (.inl (c, y))) = + D.decode.symm (.inl (c, y + (t : ZMod a))) := by + simp [T, labelRotation] + +@[simp] theorem T_decode_symm_inr (D : LabeledBlocks K A B a b) + (t : ℤ) (c : B) (y : ZMod b) : + D.T t (D.decode.symm (.inr (c, y))) = + D.decode.symm (.inr (c, y + (t : ZMod b))) := by + simp [T, labelRotation] + +@[simp] theorem blockId_T (D : LabeledBlocks K A B a b) (t : ℤ) (x : K) : + D.blockId (D.T t x) = D.blockId x := by + unfold blockId + rw [decode_T] + cases D.decode x <;> rfl + +@[simp] theorem T_zero (D : LabeledBlocks K A B a b) (x : K) : D.T 0 x = x := by + apply D.decode.injective + rw [decode_T] + cases h : D.decode x with + | inl z => simp [labelRotation] + | inr z => simp [labelRotation] + +theorem T_add (D : LabeledBlocks K A B a b) (t u : ℤ) (x : K) : + D.T (t + u) x = D.T t (D.T u x) := by + apply D.decode.injective + simp only [decode_T] + cases h : D.decode x with + | inl z => simp [labelRotation, add_comm, add_left_comm] + | inr z => simp [labelRotation, add_comm, add_left_comm] + +@[simp] theorem T_neg_T (D : LabeledBlocks K A B a b) (t : ℤ) (x : K) : + D.T (-t) (D.T t x) = x := by + rw [← T_add] + simp + +@[simp] theorem T_T_neg (D : LabeledBlocks K A B a b) (t : ℤ) (x : K) : + D.T t (D.T (-t) x) = x := by + rw [← T_add] + simp + +def transport {L : Type uL} (D : LabeledBlocks K A B a b) (e : L ≃ K) : + LabeledBlocks L A B a b := ⟨e.trans D.decode⟩ + +@[simp] theorem C_transport {L : Type uL} (D : LabeledBlocks K A B a b) + (e : L ≃ K) (x : L) : (D.transport e).C x = D.C (e x) := rfl + +def copyRight (D : LabeledBlocks K A B a b) (R : Type uR) : + LabeledBlocks (K × R) (A × R) (B × R) a b where + decode := + { toFun := fun x => match D.decode x.1 with + | .inl (c, y) => .inl ((c, x.2), y) + | .inr (c, y) => .inr ((c, x.2), y) + invFun := fun x => match x with + | .inl ((c, r), y) => (D.decode.symm (.inl (c, y)), r) + | .inr ((c, r), y) => (D.decode.symm (.inr (c, y)), r) + left_inv := by + rintro ⟨x, r⟩ + cases h : D.decode x with + | inl z => simpa [h] using congrArg (fun w => (w, r)) (D.decode.symm_apply_apply x) + | inr z => simpa [h] using congrArg (fun w => (w, r)) (D.decode.symm_apply_apply x) + right_inv := by + rintro (⟨⟨c, r⟩, y⟩ | ⟨⟨c, r⟩, y⟩) <;> simp } + +@[simp] theorem C_copyRight (D : LabeledBlocks K A B a b) (R : Type uR) (x : K × R) : + (D.copyRight R).C x = D.C x.1 := by + rcases x with ⟨x, r⟩ + cases h : D.decode x <;> simp [C, copyRight, h] + +@[simp] theorem T_copyRight (D : LabeledBlocks K A B a b) (R : Type uR) (t : ℤ) + (x : K × R) : (D.copyRight R).T t x = (D.T t x.1, x.2) := by + rcases x with ⟨x, r⟩ + cases h : D.decode x with + | inl z => simp [T, copyRight, labelRotation, h] + | inr z => simp [T, copyRight, labelRotation, h] + +noncomputable def digit (a b r A B : ℕ) [NeZero a] [NeZero b] [NeZero r] + (h : r = A * a + B * b) : LabeledBlocks (ZMod r) (Fin A) (Fin B) a b where + decode := Fintype.equivOfCardEq (by + simp only [ZMod.card, Fintype.card_sum, Fintype.card_prod, Fintype.card_fin] + exact h) + +theorem C_nonconstant (D : LabeledBlocks K A B a b) [Nonempty K] + [Nontrivial (ZMod a)] [Nontrivial (ZMod b)] : + ∃ x y : K, D.C x ≠ D.C y := by + obtain ⟨x⟩ := ‹Nonempty K› + cases h : D.decode x with + | inl z => + refine ⟨D.decode.symm (.inl (z.1, 0)), D.decode.symm (.inl (z.1, 1)), ?_⟩ + rw [C_decode_symm_inl, C_decode_symm_inl] + intro he + exact zero_ne_one (congrArg Prod.fst he) + | inr z => + refine ⟨D.decode.symm (.inr (z.1, 0)), D.decode.symm (.inr (z.1, 1)), ?_⟩ + rw [C_decode_symm_inr, C_decode_symm_inr] + intro he + exact zero_ne_one (congrArg Prod.snd he) + +section Coordinate + +variable {J : Type uJ} [DecidableEq J] (F : J → Type uF) (j : J) +variable {a b : ℕ} {A : Type uA} {B : Type uB} + +def onCoordinate (D : LabeledBlocks (F j) A B a b) : + LabeledBlocks (∀ q, F q) + (A × (∀ q : {q // q ≠ j}, F q)) + (B × (∀ q : {q // q ≠ j}, F q)) a b := + (D.copyRight (∀ q : {q // q ≠ j}, F q)).transport (Equiv.piSplitAt j F) + +@[simp] theorem C_onCoordinate (D : LabeledBlocks (F j) A B a b) (x : ∀ q, F q) : + (onCoordinate F j D).C x = D.C (x j) := by + simp [onCoordinate] + +theorem C_eq_of_coordinate_eq (D : LabeledBlocks (F j) A B a b) + {x y : ∀ q, F q} (h : x j = y j) : + (onCoordinate F j D).C x = (onCoordinate F j D).C y := by + simp only [C_onCoordinate, h] + +theorem C_designated_witness (D : LabeledBlocks (F j) A B a b) + [∀ q, Nonempty (F q)] [Nontrivial (ZMod a)] [Nontrivial (ZMod b)] : + ∃ x y : ∀ q, F q, (∀ q, q ≠ j → x q = y q) ∧ + (onCoordinate F j D).C x ≠ (onCoordinate F j D).C y := by + classical + obtain ⟨u, v, huv⟩ := D.C_nonconstant + let base : ∀ q, F q := fun q => Classical.choice (inferInstance : Nonempty (F q)) + refine ⟨Function.update base j u, Function.update base j v, ?_, ?_⟩ + · intro q hq + simp [Function.update_of_ne hq] + · simpa only [C_onCoordinate, Function.update_self] using huv + +theorem C_active_iff (D : LabeledBlocks (F j) A B a b) + [∀ q, Nonempty (F q)] [Nontrivial (ZMod a)] [Nontrivial (ZMod b)] (q : J) : + (∃ x y : ∀ r, F r, (∀ r, r ≠ q → x r = y r) ∧ + (onCoordinate F j D).C x ≠ (onCoordinate F j D).C y) ↔ q = j := by + constructor + · rintro ⟨x, y, hxy, hne⟩ + by_contra hq + exact hne (C_eq_of_coordinate_eq F j D (hxy j (Ne.symm hq))) + · intro hq + subst q + exact C_designated_witness F j D + +end Coordinate + +end LabeledBlocks + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/LastDigit.lean b/lean/OAI/Geometry/PeriodicTiling/LastDigit.lean new file mode 100644 index 0000000000000000000000000000000000000000..8abab296e1e8f3bc84ae1e25dc1337d7b272d2f5 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/LastDigit.lean @@ -0,0 +1,226 @@ +import OAI.Geometry.PeriodicTiling.WordRule +import Mathlib.NumberTheory.Padics.PadicVal.Basic +import Mathlib.Data.Int.GCD +import Mathlib.Tactic.Ring +import Lean.Elab.Tactic.Omega + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree + +def pFreeQuotient (p : ℕ) (t : ℤ) : ℤ := + t / (p : ℤ) ^ padicValInt p t + +theorem pFreeQuotient_factor (p : ℕ) (_hp : p.Prime) (t : ℤ) : + t = (p : ℤ) ^ padicValInt p t * pFreeQuotient p t := by + exact (Int.mul_ediv_cancel' (padicValInt_dvd (p := p) t)).symm + +theorem pFreeQuotient_not_dvd (p : ℕ) (hp : p.Prime) {t : ℤ} + (ht : t ≠ 0) : ¬ (p : ℤ) ∣ pFreeQuotient p t := by + let : Fact p.Prime := ⟨hp⟩ + rintro ⟨u, hu⟩ + have hpow : (p : ℤ) ^ (padicValInt p t + 1) ∣ t := by + refine ⟨u, ?_⟩ + calc + t = (p : ℤ) ^ padicValInt p t * pFreeQuotient p t := + pFreeQuotient_factor p hp t + _ = (p : ℤ) ^ padicValInt p t * ((p : ℤ) * u) := by rw [hu] + _ = (p : ℤ) ^ (padicValInt p t + 1) * u := by + rw [pow_succ, mul_assoc] + rcases (padicValInt_dvd_iff (p := p) (padicValInt p t + 1) t).mp hpow with h | h + · exact ht h + · omega + +theorem pFreeQuotient_prime_pow_mul (p : ℕ) (hp : p.Prime) + (r : ℕ) (u : ℤ) (hu : ¬ (p : ℤ) ∣ u) : + pFreeQuotient p ((p : ℤ) ^ r * u) = u := by + let : Fact p.Prime := ⟨hp⟩ + have hp0 : (p : ℤ) ≠ 0 := Int.natCast_ne_zero.mpr hp.ne_zero + have hu0 : u ≠ 0 := by + intro h + apply hu + rw [h] + exact dvd_zero _ + have hvpow : padicValInt p ((p : ℤ) ^ r) = r := by + rw [← Int.natCast_pow, padicValInt.of_nat, padicValNat.prime_pow] + have hv : padicValInt p ((p : ℤ) ^ r * u) = r := by + rw [padicValInt.mul (pow_ne_zero _ hp0) hu0, hvpow, + padicValInt.eq_zero_of_not_dvd hu, add_zero] + rw [pFreeQuotient, hv] + exact Int.mul_ediv_cancel_left u (pow_ne_zero r hp0) + +theorem pFreeQuotient_mul_prime_pow (p : ℕ) (hp : p.Prime) + (r : ℕ) {t : ℤ} (ht : t ≠ 0) : + pFreeQuotient p ((p : ℤ) ^ r * t) = pFreeQuotient p t := by + have hfactor : (p : ℤ) ^ r * t = + (p : ℤ) ^ (r + padicValInt p t) * pFreeQuotient p t := by + calc + (p : ℤ) ^ r * t = + (p : ℤ) ^ r * ((p : ℤ) ^ padicValInt p t * pFreeQuotient p t) := + congrArg (fun z : ℤ => (p : ℤ) ^ r * z) (pFreeQuotient_factor p hp t) + _ = (p : ℤ) ^ (r + padicValInt p t) * pFreeQuotient p t := by + rw [pow_add, mul_assoc] + rw [hfactor] + exact pFreeQuotient_prime_pow_mul p hp _ _ (pFreeQuotient_not_dvd p hp ht) + +theorem exists_primitive_pair (p : ℕ) (hp : p.Prime) (d e : ℤ) + (hde : d ≠ 0 ∨ e ≠ 0) : + ∃ r : ℕ, ∃ a b : ℤ, d = (p : ℤ) ^ r * a ∧ + e = (p : ℤ) ^ r * b ∧ (¬ (p : ℤ) ∣ a ∨ ¬ (p : ℤ) ∣ b) := by + let : Fact p.Prime := ⟨hp⟩ + let r := padicValInt p (Int.gcd d e : ℤ) + have hg : (Int.gcd d e : ℤ) ≠ 0 := + Int.natCast_ne_zero.mpr (ne_of_gt (Int.gcd_pos_iff.mpr hde)) + have hr : (p : ℤ) ^ r ∣ (Int.gcd d e : ℤ) := padicValInt_dvd _ + obtain ⟨a, ha⟩ := hr.trans (show (Int.gcd d e : ℤ) ∣ d from Int.gcd_dvd_left d e) + obtain ⟨b, hb⟩ := hr.trans (show (Int.gcd d e : ℤ) ∣ e from Int.gcd_dvd_right d e) + refine ⟨r, a, b, ha, hb, ?_⟩ + by_cases hpa : (p : ℤ) ∣ a + · right + intro hpb + have hd' : (p : ℤ) ^ (r + 1) ∣ d := by + obtain ⟨u, hu⟩ := hpa + refine ⟨u, ?_⟩ + rw [ha, hu, pow_succ, mul_assoc] + have he' : (p : ℤ) ^ (r + 1) ∣ e := by + obtain ⟨v, hv⟩ := hpb + refine ⟨v, ?_⟩ + rw [hb, hv, pow_succ, mul_assoc] + rcases (padicValInt_dvd_iff (p := p) (r + 1) (Int.gcd d e : ℤ)).mp + (Int.dvd_coe_gcd hd' he') with hzero | hle + · exact hg hzero + · change r + 1 ≤ r at hle + omega + · exact Or.inl hpa + +def lastDigit (p : ℕ) (hp : p.Prime) (t : ℤ) : Symbol p := by + letI : Fact p.Prime := ⟨hp⟩ + exact if ht : t = 0 then 1 else + Units.mk0 (pFreeQuotient p t : ZMod p) (by + intro h + exact pFreeQuotient_not_dvd p hp ht + ((ZMod.intCast_zmod_eq_zero_iff_dvd (pFreeQuotient p t) p).mp h)) + +@[simp] theorem lastDigit_zero (p : ℕ) (hp : p.Prime) : + lastDigit p hp 0 = 1 := by + simp [lastDigit] + +theorem lastDigit_val_of_ne_zero (p : ℕ) (hp : p.Prime) {t : ℤ} + (ht : t ≠ 0) : + (lastDigit p hp t : ZMod p) = (pFreeQuotient p t : ZMod p) := by + simp [lastDigit, ht] + +theorem lastDigit_eq_of_not_dvd (p : ℕ) (hp : p.Prime) {t : ℤ} + (ht : ¬ (p : ℤ) ∣ t) : (lastDigit p hp t : ZMod p) = (t : ZMod p) := by + have ht0 : t ≠ 0 := by + intro h + apply ht + rw [h] + exact dvd_zero _ + rw [lastDigit_val_of_ne_zero p hp ht0] + simp only [pFreeQuotient, padicValInt.eq_zero_of_not_dvd ht, pow_zero, + Int.ediv_one] + +@[simp] theorem lastDigit_one (p : ℕ) (hp : p.Prime) : + lastDigit p hp 1 = 1 := by + apply Units.ext + have hnot : ¬ (p : ℤ) ∣ (1 : ℤ) := + fun h => hp.not_dvd_one (Int.natCast_dvd_natCast.mp h) + simpa only [Units.val_one, Int.cast_one] using lastDigit_eq_of_not_dvd p hp hnot + +theorem lastDigit_two (p : ℕ) (hp : p.Prime) (hlarge : 2 < p) : + (lastDigit p hp 2 : ZMod p) = 2 := by + have hnot : ¬ (p : ℤ) ∣ (2 : ℤ) := by + intro h + exact Nat.not_dvd_of_pos_of_lt (by decide : 0 < 2) hlarge + (Int.natCast_dvd_natCast.mp h) + simpa only [Int.cast_ofNat] using lastDigit_eq_of_not_dvd p hp hnot + +theorem lastDigit_mul_prime_pow (p : ℕ) (hp : p.Prime) (r : ℕ) (t : ℤ) : + lastDigit p hp ((p : ℤ) ^ r * t) = lastDigit p hp t := by + by_cases ht : t = 0 + · subst t + simp + · have hp0 : (p : ℤ) ≠ 0 := Int.natCast_ne_zero.mpr hp.ne_zero + have hprod : (p : ℤ) ^ r * t ≠ 0 := mul_ne_zero (pow_ne_zero _ hp0) ht + apply Units.ext + rw [lastDigit_val_of_ne_zero p hp hprod, lastDigit_val_of_ne_zero p hp ht, + pFreeQuotient_mul_prime_pow p hp r ht] + +theorem lastDigit_eq_div_of_dvd_not_sq_dvd (p : ℕ) (hp : p.Prime) {t : ℤ} + (hdiv : (p : ℤ) ∣ t) (hsq : ¬ (p : ℤ) ^ 2 ∣ t) : + (lastDigit p hp t : ZMod p) = ((t / (p : ℤ) : ℤ) : ZMod p) := by + have ht : t ≠ 0 := by + intro h + apply hsq + rw [h] + exact dvd_zero _ + have hquot : ¬ (p : ℤ) ∣ t / (p : ℤ) := by + rintro ⟨u, hu⟩ + apply hsq + refine ⟨u, ?_⟩ + calc + t = (p : ℤ) * (t / (p : ℤ)) := (Int.mul_ediv_cancel' hdiv).symm + _ = (p : ℤ) * ((p : ℤ) * u) := by rw [hu] + _ = (p : ℤ) ^ 2 * u := by rw [pow_two, mul_assoc] + have hfree := pFreeQuotient_prime_pow_mul p hp 1 (t / (p : ℤ)) hquot + rw [pow_one, Int.mul_ediv_cancel' hdiv] at hfree + rw [lastDigit_val_of_ne_zero p hp ht, hfree] + +theorem lastDigit_affine_allowed (p : ℕ) (hp : p.Prime) (d e : ℤ) : + Allowed p (fun n => lastDigit p hp (d * (n.val : ℤ) + e)) := by + classical + by_cases hzero : d = 0 ∧ e = 0 + · rcases hzero with ⟨hd, he⟩ + subst d + subst e + have hnot : ¬ (p : ℤ) ∣ (1 : ℤ) := + fun h => hp.not_dvd_one (Int.natCast_dvd_natCast.mp h) + refine ⟨0, 1, Or.inr hnot, ?_⟩ + intro n + dsimp only + constructor + · intro _ + simp only [zero_mul, zero_add, lastDigit_zero, Units.val_one, Int.cast_one] + · intro h _ + exact (hnot (by simpa only [zero_mul, zero_add] using h)).elim + · obtain ⟨r, a, b, hd, he, hab⟩ := + exists_primitive_pair p hp d e (not_and_or.mp hzero) + refine ⟨a, b, hab, ?_⟩ + intro n + have harg : d * (n.val : ℤ) + e = + (p : ℤ) ^ r * (a * (n.val : ℤ) + b) := by + rw [hd, he] + ring + dsimp only + rw [harg, lastDigit_mul_prime_pow] + exact ⟨fun h => lastDigit_eq_of_not_dvd p hp h, + fun h₁ h₂ => lastDigit_eq_div_of_dvd_not_sq_dvd p hp h₁ h₂⟩ + +theorem lastDigit_lineRule (p : ℕ) (hp : p.Prime) : + LineRule p (fun _ m => lastDigit p hp m) := by + intro d e + exact lastDigit_affine_allowed p hp d e + +theorem lastDigit_nonconstantColumns (p : ℕ) (hp : p.Prime) (hlarge : 2 < p) : + NonconstantColumns (fun (_ : Column p) m => lastDigit p hp m) := by + intro n + refine ⟨1, 2, ?_⟩ + intro h + have hcoe : (1 : ZMod p) = 2 := by + simpa only [lastDigit_one, Units.val_one, lastDigit_two p hp hlarge] using + congrArg (fun u : Symbol p => (u : ZMod p)) h + have hnat : 1 % p = 2 % p := + (ZMod.natCast_eq_natCast_iff' 1 2 p).mp + (by simpa only [Nat.cast_one, Nat.cast_ofNat] using hcoe) + have h1 : 1 < p := lt_trans (by decide : 1 < 2) hlarge + rw [Nat.mod_eq_of_lt h1, Nat.mod_eq_of_lt hlarge] at hnat + omega + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/LatticeDescent.lean b/lean/OAI/Geometry/PeriodicTiling/LatticeDescent.lean new file mode 100644 index 0000000000000000000000000000000000000000..41c4ef3f45c513c402675fbb824de8016409315a --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/LatticeDescent.lean @@ -0,0 +1,91 @@ +import OAI.Geometry.PeriodicTiling.IntegerMatrixIndex +import Mathlib.MeasureTheory.Group.Measure +import Mathlib.Tactic.Abel + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree + +open MeasureTheory +open scoped Classical + +def normalizedComplement (m : ℕ) (c₀ : Space 3) (A : Set (Space 3)) : + Set (Lattice 3) := {z | c₀ + scaledCast m z ∈ A} + +theorem period_lattice_le_scaledGrid (m : ℕ) (c₀ : Space 3) + {A : Set (Space 3)} (hne : A.Nonempty) + (hgrid : ∀ a ∈ A, ∃ z : Lattice 3, c₀ + scaledCast m z = a) + (b : Module.Basis (Fin 3) ℝ (Space 3)) + (hp : ∀ v ∈ latticeOfBasis b, Period A v) : + latticeOfBasis b ≤ scaledGrid m := by + obtain ⟨a, ha⟩ := hne + obtain ⟨z₀, hz₀⟩ := hgrid a ha + intro v hv + obtain ⟨z₁, hz₁⟩ := hgrid (a + v) ((hp v hv a).mpr ha) + refine ⟨z₁ - z₀, ?_⟩ + change scaledCast m (z₁ - z₀) = v + calc + scaledCast m (z₁ - z₀) = + (c₀ + scaledCast m z₁) - (c₀ + scaledCast m z₀) := by + rw [map_sub] + abel + _ = (a + v) - a := by rw [hz₀, hz₁] + _ = v := by abel + +theorem fullyPeriodic_normalizedComplement (m : ℕ) (c₀ : Space 3) + {A : Set (Space 3)} (hne : A.Nonempty) + (hgrid : ∀ a ∈ A, ∃ z : Lattice 3, c₀ + scaledCast m z = a) + (hperiodic : EuclideanFullyPeriodic A) : + FullyPeriodic (normalizedComplement m c₀ A) := by + obtain ⟨b, hb⟩ := hperiodic + have hle := period_lattice_le_scaledGrid m c₀ hne hgrid b hb + refine ⟨(latticeOfBasis b).comap (scaledCast m), + lattice_pullback_finiteIndex m b hle, ?_⟩ + intro v hv z + change c₀ + scaledCast m (z + v) ∈ A ↔ c₀ + scaledCast m z ∈ A + rw [map_add, ← add_assoc] + exact hb (scaledCast m v) hv (c₀ + scaledCast m z) + +theorem normalized_typedAETiles (m : ℕ) (hm : m ≠ 0) (c₀ : Space 3) + {Ω₀ Ω₁ C A : Set (Space 3)} + (hgrid : C = Set.range (fun z : Lattice 3 => c₀ + scaledCast m z)) + (htile : TypedAETiles Ω₀ Ω₁ C A) : + ∀ᵐ x ∂volume, ∃! z : Lattice 3, + x - scaledCast m z ∈ + if z ∈ normalizedComplement m c₀ A then Ω₁ else Ω₀ := by + classical + have hshift : ∀ᵐ x ∂volume, ∃! c : C, + (c₀ + x) - (c : Space 3) ∈ + if (c : Space 3) ∈ A then Ω₁ else Ω₀ := + (eventually_add_left_iff volume c₀).mpr htile + filter_upwards [hshift] with x hx + obtain ⟨c, hc, huniq⟩ := hx + obtain ⟨z, hz⟩ : ∃ z : Lattice 3, c₀ + scaledCast m z = (c : Space 3) := by + exact Eq.mp + (congrArg (fun S : Set (Space 3) => (c : Space 3) ∈ S) hgrid) c.property + refine ⟨z, ?_, ?_⟩ + · rw [← hz] at hc + have he : (c₀ + x) - (c₀ + scaledCast m z) = x - scaledCast m z := by abel + by_cases hzA : c₀ + scaledCast m z ∈ A + · simpa only [he, normalizedComplement, Set.mem_ofPred_eq, hzA, ite_true] using hc + · simpa only [he, normalizedComplement, Set.mem_ofPred_eq, hzA, ite_false] using hc + · intro y hy + let cy : C := ⟨c₀ + scaledCast m y, by rw [hgrid]; exact ⟨y, rfl⟩⟩ + have hcy : (c₀ + x) - (cy : Space 3) ∈ + if (cy : Space 3) ∈ A then Ω₁ else Ω₀ := by + change (c₀ + x) - (c₀ + scaledCast m y) ∈ + if c₀ + scaledCast m y ∈ A then Ω₁ else Ω₀ + have he : (c₀ + x) - (c₀ + scaledCast m y) = x - scaledCast m y := by abel + rw [he] + exact hy + have he : c₀ + scaledCast m y = c₀ + scaledCast m z := by + exact (congrArg Subtype.val (huniq cy hcy)).trans hz.symm + exact scaledCast_injective hm (add_left_cancel he) + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/LatticeDimensions.lean b/lean/OAI/Geometry/PeriodicTiling/LatticeDimensions.lean new file mode 100644 index 0000000000000000000000000000000000000000..694878c3d0fa8f1d6b9925b06fd653527ecee423 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/LatticeDimensions.lean @@ -0,0 +1,32 @@ +import OAI.Geometry.PeriodicTiling.TilingBasic + +namespace OAI + +namespace PeriodicTilingThree + +def intEquiv : ℤ ≃+ Lattice 1 where + toFun z := fun _ => z + invFun x := x 0 + left_inv _ := rfl + right_inv x := by + funext i + have hi : i = 0 := Subsingleton.elim _ _ + subst i + rfl + map_add' _ _ := rfl + +theorem fullyPeriodic_lattice_zero (A : Set (Lattice 0)) : FullyPeriodic A := by + refine ⟨⊤, inferInstance, ?_⟩ + intro v _hv x + have hx : x + v = x := Subsingleton.elim _ _ + rw [hx] + +theorem lattice_zero_tile_has_fullyPeriodic_complement + (F : Finset (Lattice 0)) (h : ∃ A, Tiles F A) : + ∃ A, Tiles F A ∧ FullyPeriodic A := by + obtain ⟨A, hA⟩ := h + exact ⟨A, hA, fullyPeriodic_lattice_zero A⟩ + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/LatticePeriodicity.lean b/lean/OAI/Geometry/PeriodicTiling/LatticePeriodicity.lean new file mode 100644 index 0000000000000000000000000000000000000000..b5fd9fa7ca30b695e0025fde1474f93b72cf70f3 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/LatticePeriodicity.lean @@ -0,0 +1,55 @@ +import OAI.Geometry.PeriodicTiling.EuclideanBasic +import OAI.Geometry.PeriodicTiling.TilingTransport +import Mathlib.GroupTheory.OrderOfElement +import Mathlib.LinearAlgebra.Basis.SMul +import Mathlib.LinearAlgebra.StdBasis + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree + +def scaledCoordinateBasis (d q : ℕ) (hq : q ≠ 0) : Module.Basis (Fin d) ℝ (Space d) := + (Units.mk0 (q : ℝ) (Nat.cast_ne_zero.mpr hq)) • Pi.basisFun ℝ (Fin d) + +theorem scaledCoordinateBasis_eq_cast {d q : ℕ} (hq : q ≠ 0) (i : Fin d) : + scaledCoordinateBasis d q hq i = + castLattice (q • (Pi.single i 1 : Lattice d)) := by + classical + ext j + by_cases hji : j = i + · subst j + simp [scaledCoordinateBasis, Module.Basis.smul_apply, Units.smul_def] + · simp [scaledCoordinateBasis, Module.Basis.smul_apply, + hji] + +theorem exists_positive_scalar_sublattice {d : ℕ} (P : AddSubgroup (Lattice d)) + (hP : P.FiniteIndex) : ∃ q : ℕ, 0 < q ∧ ∀ z : Lattice d, q • z ∈ P := by + refine ⟨P.index, Nat.pos_of_ne_zero hP.index_ne_zero, ?_⟩ + intro z + exact P.nsmul_index_mem z + +theorem FullyPeriodic.castLattice_image {d : ℕ} {A : Set (Lattice d)} + (hA : FullyPeriodic A) : EuclideanFullyPeriodic (castLattice '' A) := by + classical + obtain ⟨P, hP, hPeriods⟩ := hA + obtain ⟨q, hq, hqP⟩ := exists_positive_scalar_sublattice P hP + refine ⟨scaledCoordinateBasis d q hq.ne', ?_⟩ + intro v hv + change v ∈ Submodule.span ℤ (Set.range (scaledCoordinateBasis d q hq.ne')) at hv + induction hv using Submodule.span_induction with + | mem v hv => + obtain ⟨i, rfl⟩ := hv + rw [scaledCoordinateBasis_eq_cast] + exact (hPeriods _ (hqP (Pi.single i 1))).image castLattice + | zero => exact period_zero _ + | add x y _ _ hx hy => exact hx.add hy + | smul n x _ hx => + exact (periodSubgroup (castLattice '' A)).zsmul_mem hx n + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/LatticeThickening.lean b/lean/OAI/Geometry/PeriodicTiling/LatticeThickening.lean new file mode 100644 index 0000000000000000000000000000000000000000..263cceb4b23d6e8032da79a93c73e6a8004d904a --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/LatticeThickening.lean @@ -0,0 +1,90 @@ +import OAI.Geometry.PeriodicTiling.LatticePeriodicity +import Mathlib.MeasureTheory.Constructions.Pi +import Mathlib.Algebra.Order.Floor.Ring +import Mathlib.Tactic.Abel +import Mathlib.Tactic.Linarith + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree + +open MeasureTheory + +def floorLattice {d : ℕ} (x : Space d) : Lattice d := fun i => ⌊x i⌋ + +theorem ae_noninteger_coordinates (d : ℕ) : + ∀ᵐ x : Space d ∂volume, ∀ i : Fin d, ∀ z : ℤ, x i ≠ (z : ℝ) := by + apply ae_all_iff.mpr + intro i + apply ae_all_iff.mpr + intro z + exact Measure.ae_eval_ne (fun _ : Fin d => (volume : Measure ℝ)) i (z : ℝ) + +theorem sub_floorLattice_mem_unitCube {d : ℕ} (x : Space d) : + x - castLattice (floorLattice x) ∈ unitCube d := by + apply mem_unitCube.mpr + intro i + change 0 ≤ x i - (⌊x i⌋ : ℝ) ∧ x i - (⌊x i⌋ : ℝ) ≤ 1 + have hl := Int.floor_le (x i) + have hu := Int.lt_floor_add_one (x i) + constructor <;> linarith + +theorem floorLattice_eq_of_mem_unitVoxel {d : ℕ} {x : Space d} + (hx : ∀ i : Fin d, ∀ z : ℤ, x i ≠ (z : ℝ)) {z : Lattice d} + (hz : x - castLattice z ∈ unitCube d) : floorLattice x = z := by + funext i + apply Int.floor_eq_iff.mpr + have hi := mem_unitCube.mp hz i + change 0 ≤ x i - (z i : ℝ) ∧ x i - (z i : ℝ) ≤ 1 at hi + constructor + · linarith + · have hne : x i ≠ (z i : ℝ) + 1 := by + simpa using hx i (z i + 1) + by_contra hn + apply hne + linarith + +theorem Tiles.aeTiles_thickening {d : ℕ} {F : Finset (Lattice d)} + {A : Set (Lattice d)} (h : Tiles F A) : + AETiles (Thickening F) (castLattice '' A) := by + apply (ae_noninteger_coordinates d).mono + intro x hx + obtain ⟨⟨f, a⟩, hfa⟩ := h.2 (floorLattice x) + change (f : Lattice d) + (a : Lattice d) = floorLattice x at hfa + refine ⟨⟨castLattice (a : Lattice d), ⟨(a : Lattice d), a.property, rfl⟩⟩, ?_, ?_⟩ + · refine ⟨(f : Lattice d), f.property, ?_⟩ + change x - castLattice (a : Lattice d) - castLattice (f : Lattice d) ∈ unitCube d + have heq : x - castLattice (a : Lattice d) - castLattice (f : Lattice d) = + x - castLattice (floorLattice x) := by + rw [← hfa, map_add] + abel + rw [heq] + exact sub_floorLattice_mem_unitCube x + · intro b hb + obtain ⟨b', hb', hb_eq⟩ := b.property + obtain ⟨f', hf', hf'b⟩ := hb + have hvoxel : x - castLattice (f' + b') ∈ unitCube d := by + have heq : x - castLattice (f' + b') = + x - (b : Space d) - castLattice f' := by + rw [map_add, ← hb_eq] + abel + rw [heq] + exact hf'b + have hcorner := floorLattice_eq_of_mem_unitVoxel hx hvoxel + have hp : ((⟨f', hf'⟩ : ↥F), (⟨b', hb'⟩ : A)) = (f, a) := by + apply h.1 + change f' + b' = (f : Lattice d) + (a : Lattice d) + exact hcorner.symm.trans hfa.symm + apply Subtype.ext + calc + (b : Space d) = castLattice b' := hb_eq.symm + _ = castLattice (a : Lattice d) := + congrArg castLattice (congrArg (fun p : ↥F × A => (p.2 : Lattice d)) hp) + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/LowerDimensions.lean b/lean/OAI/Geometry/PeriodicTiling/LowerDimensions.lean new file mode 100644 index 0000000000000000000000000000000000000000..a3bcf64c3d895a1dc9c597a99578f929468700a1 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/LowerDimensions.lean @@ -0,0 +1,38 @@ +import OAI.Geometry.PeriodicTiling.OneDimensionalLattice +import OAI.Geometry.PeriodicTiling.PlanarPeriodicity +import OAI.Geometry.PeriodicTiling.TilingTransport +import Lean.Elab.Tactic.Omega + +namespace OAI + +namespace PeriodicTilingThree + +theorem lattice_two_tile_has_fullyPeriodic_complement + (F : Finset (Lattice 2)) (h : ∃ A, Tiles F A) : + ∃ B, Tiles F B ∧ FullyPeriodic B := by + classical + obtain ⟨A, hA⟩ := h + have hPlane := hA.preimage_addEquiv planeEquiv + obtain ⟨B, hB, hPeriod⟩ := plane_tile_has_fullyPeriodic_complement + (F.image planeEquiv.symm) hPlane.tile_nonempty ⟨_, hPlane⟩ + refine ⟨planeEquiv '' B, ?_, (fullyPeriodic_image_addEquiv_iff planeEquiv).mpr hPeriod⟩ + have hImage := hB.image_addEquiv planeEquiv + simpa only [Finset.image_image, Function.comp_def, planeEquiv.apply_symm_apply, + Finset.image_id'] using hImage + +theorem tiles_below_three_have_fullyPeriodic_complements + (d : ℕ) (hd : d < 3) (F : Finset (Lattice d)) (h : ∃ A, Tiles F A) : + ∃ B, Tiles F B ∧ FullyPeriodic B := by + cases d with + | zero => exact lattice_zero_tile_has_fullyPeriodic_complement F h + | succ d => + cases d with + | zero => exact lattice_one_tile_has_fullyPeriodic_complement F h + | succ d => + cases d with + | zero => exact lattice_two_tile_has_fullyPeriodic_complement F h + | succ d => omega + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/Main.lean b/lean/OAI/Geometry/PeriodicTiling/Main.lean new file mode 100644 index 0000000000000000000000000000000000000000..df1299355309afd1ba5d7f1e93402483584a2e9e --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/Main.lean @@ -0,0 +1 @@ +import OAI.Geometry.PeriodicTiling.Counterexample diff --git a/lean/OAI/Geometry/PeriodicTiling/MarkedCell.lean b/lean/OAI/Geometry/PeriodicTiling/MarkedCell.lean new file mode 100644 index 0000000000000000000000000000000000000000..f13125187a7fe82a6763c86c8ffda62084d2b17d --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/MarkedCell.lean @@ -0,0 +1,155 @@ +import OAI.Geometry.PeriodicTiling.MarkedTile +import OAI.Geometry.PeriodicTiling.CyclicQuotient +import OAI.Geometry.PeriodicTiling.VoxelMeasure +import Mathlib.Tactic.Abel + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree.MarkedTile + +open MeasureTheory +open scoped Classical + +private theorem cast_scale_eq (m : ℕ) (z : Lattice 3) : + castLattice (scale m z) = scaledCast m z := by + ext i + simp [scaledCast, scale] + +namespace ResidueSection + +variable {m : ℕ} [NeZero m] (s : ResidueSection m) + +theorem Tstar_subset_T0 : s.Tstar ⊆ s.T0 := Finset.erase_subset _ _ + +theorem Tstar_subset_T1 (w : Lattice 3) : s.Tstar ⊆ s.T1 w := by + rw [s.T1_eq_insert w] + exact Finset.subset_insert _ _ + +theorem marked_cell_mem_thickening_iff + {m : ℕ} [NeZero m] (s : ResidueSection m) + {a g : Lattice 3} {x : Space 3} + (hx : x ∈ openUnitVoxel (castLattice (scale m a + s.t0))) + (F : Finset (Lattice 3)) : + x - scaledCast m g ∈ Thickening F ↔ + ∃ z ∈ F, scale m g + z = scale m a + s.t0 := by + have he (z : Lattice 3) : + x - castLattice (scale m g + z) = + (x - scaledCast m g) - castLattice z := by + rw [map_add, cast_scale_eq] + abel + constructor + · rintro ⟨z, hz, hcell⟩ + refine ⟨z, hz, (mem_unitVoxel_cast_iff_of_mem_open hx).mp ?_⟩ + change x - castLattice (scale m g + z) ∈ unitCube 3 + rwa [he z] + · rintro ⟨z, hz, hcorner⟩ + refine ⟨z, hz, ?_⟩ + have hcell := (mem_unitVoxel_cast_iff_of_mem_open hx).mpr hcorner + change x - castLattice (scale m g + z) ∈ unitCube 3 at hcell + rwa [he z] at hcell + +theorem marked_cell_T0_iff {a g : Lattice 3} {x : Space 3} + (hx : x ∈ openUnitVoxel (castLattice (scale m a + s.t0))) : + x - scaledCast m g ∈ Thickening s.T0 ↔ g = a := by + rw [s.marked_cell_mem_thickening_iff hx] + constructor + · rintro ⟨z, hz, he⟩ + obtain ⟨v, hv⟩ := s.mem_T0.mp hz + rw [← hv] at he + have hp : (g, v) = (a, (0 : Residue m)) := by + apply s.coordinates_injective + exact he + exact congrArg Prod.fst hp + · rintro rfl + exact ⟨s.t0, s.t0_mem_T0, rfl⟩ + +theorem marked_cell_T1_iff (w : Lattice 3) {a g : Lattice 3} {x : Space 3} + (hx : x ∈ openUnitVoxel (castLattice (scale m a + s.t0))) : + x - scaledCast m g ∈ Thickening (s.T1 w) ↔ g = a - w := by + rw [s.marked_cell_mem_thickening_iff hx] + constructor + · rintro ⟨z, hz, he⟩ + obtain ⟨v, hv⟩ := s.mem_T1.mp hz + rw [← hv] at he + have hv0 : v = 0 := by + have hr := congrArg (residue m) he + simpa only [map_add, residue_scale, s.residue_t1, s.residue_t0, + zero_add] using hr + subst v + have hga : g + w = a := by + apply scale_injective m + apply add_right_cancel (b := s.t0) + simpa only [t1, ite_eq_left rfl, ite_true, map_add, add_assoc] using he + exact eq_sub_iff_add_eq.mpr hga + · rintro rfl + refine ⟨s.t1 w 0, s.mem_T1.mpr ⟨0, rfl⟩, ?_⟩ + simp only [t1, ite_true] + rw [← add_assoc, ← map_add, sub_add_cancel] + +theorem marked_cell_sources (w : Lattice 3) (B : Set (Lattice 3)) + {a g : Lattice 3} {x : Space 3} + (hx : x ∈ openUnitVoxel (castLattice (scale m a + s.t0))) : + (x - scaledCast m g ∈ if g ∈ B then Thickening (s.T1 w) else Thickening s.T0) ↔ + (g = a ∧ g ∉ B) ∨ (g = a - w ∧ g ∈ B) := by + by_cases hg : g ∈ B + · simp only [hg, ite_eq_left, not_true_eq_false, and_false, false_or, and_true, + s.marked_cell_T1_iff w hx] + · simp only [hg, ite_false, not_false_eq_true, and_true, and_false, or_false, + s.marked_cell_T0_iff hx] + +theorem period_of_marked_cells (w : Lattice 3) (hw : w ≠ 0) + (B : Set (Lattice 3)) + (hcover : ∀ᵐ x ∂volume, ∃! g : Lattice 3, + x - scaledCast m g ∈ + if g ∈ B then Thickening (s.T1 w) else Thickening s.T0) : + Period B w := by + have hiff : ∀ a : Lattice 3, a ∈ B ↔ a - w ∈ B := by + intro a + have hvol : volume (openUnitVoxel (castLattice (scale m a + s.t0))) ≠ 0 := by + rw [openUnitVoxel_volume] + exact one_ne_zero + obtain ⟨x, hx, hgcover⟩ := + Measure.exists_mem_of_measure_ne_zero_of_ae hvol (ae_restrict_of_ae hcover) + obtain ⟨g, hg, huniq⟩ := hgcover + constructor + · intro ha + rcases (s.marked_cell_sources w B hx).mp hg with ⟨hga, hgB⟩ | ⟨hga, hgB⟩ + · exact False.elim (hgB (hga.symm ▸ ha)) + · exact hga ▸ hgB + · intro haw + by_contra ha + have hpa : x - scaledCast m a ∈ + if a ∈ B then Thickening (s.T1 w) else Thickening s.T0 := + (s.marked_cell_sources w B hx).mpr (Or.inl ⟨rfl, ha⟩) + have hpaw : x - scaledCast m (a - w) ∈ + if a - w ∈ B then Thickening (s.T1 w) else Thickening s.T0 := + (s.marked_cell_sources w B hx).mpr (Or.inr ⟨rfl, haw⟩) + have he : a = a - w := (huniq a hpa).trans (huniq (a - w) hpaw).symm + apply hw + calc + w = a - (a - w) := by abel + _ = a - a := by rw [← he] + _ = 0 := sub_self a + intro z + simpa only [add_sub_cancel_right] using hiff (z + w) + +theorem kernel_periods_of_marked_cells (Q : ℕ) [NeZero Q] + (B : Set (Lattice 3)) + (hcover : ∀ᵐ x ∂volume, ∃! g : Lattice 3, + x - scaledCast m g ∈ if g ∈ B then + Thickening (s.T1 (CyclicQuotient.kernelStep Q)) else Thickening s.T0) : + ∀ k ∈ (CyclicQuotient.projection Q).ker, Period B k := by + have hw := s.period_of_marked_cells (CyclicQuotient.kernelStep Q) + (CyclicQuotient.kernelStep_ne_zero Q) B hcover + intro k hk + obtain ⟨n, rfl⟩ := (CyclicQuotient.mem_ker_iff_zsmul_kernelStep Q k).mp hk + exact (periodSubgroup B).zsmul_mem hw n + +end ResidueSection +end PeriodicTilingThree.MarkedTile + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/MarkedTile.lean b/lean/OAI/Geometry/PeriodicTiling/MarkedTile.lean new file mode 100644 index 0000000000000000000000000000000000000000..39e9c04e37e263db691a6596c29df54db32874d0 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/MarkedTile.lean @@ -0,0 +1,309 @@ +import OAI.Geometry.PeriodicTiling.TilingBasic +import Mathlib.Data.ZMod.Basic +import Mathlib.Data.Fintype.BigOperators +import Mathlib.Data.Finset.Union +import Mathlib.Tactic.Abel +import Mathlib.Tactic.NormNum + +namespace OAI + +namespace PeriodicTilingThree.MarkedTile + +abbrev Residue (m : ℕ) := Fin 3 → ZMod m + +def scale (m : ℕ) : Lattice 3 →+ Lattice 3 where + toFun x i := (m : ℤ) * x i + map_zero' := by ext i; simp + map_add' x y := by ext i; simp [mul_add] + +@[simp] theorem scale_apply (m : ℕ) (x : Lattice 3) (i : Fin 3) : + scale m x i = (m : ℤ) * x i := rfl + +theorem scale_injective (m : ℕ) [NeZero m] : Function.Injective (scale m) := by + have hm : (m : ℤ) ≠ 0 := by exact_mod_cast (NeZero.ne m) + intro x y h + funext i + exact mul_left_cancel₀ hm (congrFun h i) + +def residue (m : ℕ) : Lattice 3 →+ Residue m where + toFun x i := (x i : ZMod m) + map_zero' := by ext i; simp + map_add' x y := by ext i; simp + +@[simp] theorem residue_apply (m : ℕ) (x : Lattice 3) (i : Fin 3) : + residue m x i = (x i : ZMod m) := rfl + +@[simp] theorem residue_scale (m : ℕ) (x : Lattice 3) : + residue m (scale m x) = 0 := by + ext i + simp [scale, residue] + +theorem exists_scale_of_residue_eq_zero (m : ℕ) {x : Lattice 3} + (h : residue m x = 0) : ∃ a : Lattice 3, scale m a = x := by + have hd : ∀ i : Fin 3, ∃ a : ℤ, x i = (m : ℤ) * a := by + intro i + apply (ZMod.intCast_zmod_eq_zero_iff_dvd (x i) m).mp + exact congrFun h i + choose a ha using hd + exact ⟨a, funext fun i => (ha i).symm⟩ + +structure ResidueSection (m : ℕ) where + t : Residue m → Lattice 3 + residue_t : ∀ v, residue m (t v) = v + +namespace ResidueSection + +variable {m : ℕ} (s : ResidueSection m) + +@[simp] theorem residue_t_apply (v : Residue m) : residue m (s.t v) = v := + s.residue_t v + +theorem t_injective : Function.Injective s.t := by + intro v v' h + have := congrArg (residue m) h + simpa using this + +def t0 : Lattice 3 := s.t 0 + +@[simp] theorem residue_t0 : residue m s.t0 = 0 := s.residue_t 0 + +theorem coordinates_injective [NeZero m] : + Function.Injective (fun p : Lattice 3 × Residue m => scale m p.1 + s.t p.2) := by + rintro ⟨a, v⟩ ⟨a', v'⟩ h + have hv : v = v' := by + have := congrArg (residue m) h + simpa using this + subst v' + have ha : a = a' := scale_injective m (add_right_cancel h) + exact Prod.ext ha rfl + +theorem coordinates_surjective : + Function.Surjective (fun p : Lattice 3 × Residue m => scale m p.1 + s.t p.2) := by + intro x + have hz : residue m (x - s.t (residue m x)) = 0 := by simp + obtain ⟨a, ha⟩ := exists_scale_of_residue_eq_zero m hz + refine ⟨(a, residue m x), ?_⟩ + change scale m a + s.t (residue m x) = x + rw [ha, sub_add_cancel] + +theorem coordinates_bijective [NeZero m] : + Function.Bijective (fun p : Lattice 3 × Residue m => scale m p.1 + s.t p.2) := + ⟨s.coordinates_injective, s.coordinates_surjective⟩ + +noncomputable section + +variable [NeZero m] + +def T0 : Finset (Lattice 3) := Finset.univ.image s.t + +def Tstar : Finset (Lattice 3) := s.T0.erase s.t0 + +def t1 (w : Lattice 3) (v : Residue m) : Lattice 3 := + if v = 0 then scale m w + s.t0 else s.t v + +def T1 (w : Lattice 3) : Finset (Lattice 3) := Finset.univ.image (s.t1 w) + +@[simp] theorem mem_T0 {x : Lattice 3} : x ∈ s.T0 ↔ ∃ v, s.t v = x := by + classical + simp [T0] + +@[simp] theorem t0_mem_T0 : s.t0 ∈ s.T0 := by + exact s.mem_T0.mpr ⟨0, rfl⟩ + +theorem mem_Tstar {x : Lattice 3} : + x ∈ s.Tstar ↔ ∃ v : Residue m, v ≠ 0 ∧ s.t v = x := by + classical + constructor + · intro hx + obtain ⟨hx0, hxT⟩ := Finset.mem_erase.mp hx + obtain ⟨v, hv⟩ := s.mem_T0.mp hxT + refine ⟨v, ?_, hv⟩ + intro h0 + apply hx0 + simpa [h0, t0] using hv.symm + · rintro ⟨v, hv0, rfl⟩ + apply Finset.mem_erase.mpr + refine ⟨?_, s.mem_T0.mpr ⟨v, rfl⟩⟩ + intro h + exact hv0 (s.t_injective h) + +@[simp] theorem residue_t1 + {m : ℕ} (s : ResidueSection m) [NeZero m] + (w : Lattice 3) (v : Residue m) : + residue m (s.t1 w v) = v := by + classical + by_cases hv : v = 0 + · simp [t1, hv] + · simp [t1, hv] + +theorem t1_injective (w : Lattice 3) : Function.Injective (s.t1 w) := by + intro v v' h + have := congrArg (residue m) h + simpa using this + +@[simp] theorem mem_T1 {w x : Lattice 3} : x ∈ s.T1 w ↔ ∃ v, s.t1 w v = x := by + classical + simp [T1] + +theorem T1_eq_insert (w : Lattice 3) : + s.T1 w = insert (scale m w + s.t0) s.Tstar := by + classical + ext x + constructor + · intro hx + obtain ⟨v, rfl⟩ := s.mem_T1.mp hx + by_cases hv : v = 0 + · simp [t1, hv] + · apply Finset.mem_insert_of_mem + exact s.mem_Tstar.mpr ⟨v, hv, by simp [t1, hv]⟩ + · intro hx + rcases Finset.mem_insert.mp hx with hx | hx + · exact s.mem_T1.mpr ⟨0, by simp [t1, hx]⟩ + · obtain ⟨v, hv, rfl⟩ := s.mem_Tstar.mp hx + exact s.mem_T1.mpr ⟨v, by simp [t1, hv]⟩ + +theorem card_T0 : s.T0.card = m ^ 3 := by + classical + rw [T0, Finset.card_image_of_injective _ s.t_injective] + simp [Residue] + +theorem card_Tstar : s.Tstar.card = m ^ 3 - 1 := by + classical + rw [Tstar, Finset.card_erase_of_mem s.t0_mem_T0, s.card_T0] + +theorem card_T1 (w : Lattice 3) : (s.T1 w).card = m ^ 3 := by + classical + rw [T1, Finset.card_image_of_injective _ (s.t1_injective w)] + simp [Residue] + +def point (w u : Lattice 3) (v : Residue m) : Lattice 3 := + if u = 0 ∧ v = 0 then scale m w + s.t0 else scale m u + s.t v + +@[simp] theorem point_zero + {m : ℕ} (s : ResidueSection m) [NeZero m] + (w : Lattice 3) (v : Residue m) : + s.point w 0 v = s.t1 w v := by + classical + by_cases hv : v = 0 <;> simp [point, t1, hv] + +theorem point_of_ne_zero + {m : ℕ} (s : ResidueSection m) [NeZero m] + (w : Lattice 3) {u : Lattice 3} (hu : u ≠ 0) + (v : Residue m) : s.point w u v = scale m u + s.t v := by + classical + simp [point, hu] + +@[simp] theorem residue_point + {m : ℕ} (s : ResidueSection m) [NeZero m] + (w u : Lattice 3) (v : Residue m) : + residue m (s.point w u v) = v := by + classical + by_cases h : u = 0 ∧ v = 0 + · simp [point, h] + · simp [point, h] + +theorem point_injective {w : Lattice 3} {U : Finset (Lattice 3)} + (hw : w ∉ U) : + Function.Injective (fun q : ↥U × Residue m => s.point w q.1 q.2) := by + classical + rintro ⟨u, v⟩ ⟨u', v'⟩ h + have hv : v = v' := by + have := congrArg (residue m) h + simpa using this + subst v' + suffices hu : u = u' from congrArg (fun a : ↥U => (a, v)) hu + apply Subtype.ext + by_cases h0 : (u : Lattice 3) = 0 + · by_cases h0' : (u' : Lattice 3) = 0 + · exact h0.trans h0'.symm + · by_cases hv0 : v = 0 + · have he : scale m w = scale m (u' : Lattice 3) := by + apply add_right_cancel (b := s.t0) + simpa [point, h0, h0', hv0, t0] using h + have he' := scale_injective m he + exact False.elim (hw (he'.symm ▸ u'.property)) + · have he : scale m (u : Lattice 3) = scale m (u' : Lattice 3) := by + apply add_right_cancel (b := s.t v) + simpa [point, hv0] using h + exact scale_injective m he + · by_cases h0' : (u' : Lattice 3) = 0 + · by_cases hv0 : v = 0 + · have he : scale m (u : Lattice 3) = scale m w := by + apply add_right_cancel (b := s.t0) + simpa [point, h0, h0', hv0, t0] using h + have he' := scale_injective m he + exact False.elim (hw (he' ▸ u.property)) + · have he : scale m (u : Lattice 3) = scale m (u' : Lattice 3) := by + apply add_right_cancel (b := s.t v) + simpa [point, hv0] using h + exact scale_injective m he + · have he : scale m (u : Lattice 3) = scale m (u' : Lattice 3) := by + apply add_right_cancel (b := s.t v) + simpa [point, h0, h0'] using h + exact scale_injective m he + +def finalTile (w : Lattice 3) (U : Finset (Lattice 3)) : Finset (Lattice 3) := + Finset.univ.image (fun q : ↥U × Residue m => s.point w q.1 q.2) + +theorem mem_finalTile {w x : Lattice 3} {U : Finset (Lattice 3)} : + x ∈ s.finalTile w U ↔ ∃ u ∈ U, ∃ v, s.point w u v = x := by + classical + simp only [finalTile, Finset.mem_image, Finset.mem_univ, true_and] + constructor + · rintro ⟨⟨u, v⟩, h⟩ + exact ⟨u, u.property, v, h⟩ + · rintro ⟨u, hu, v, h⟩ + exact ⟨(⟨u, hu⟩, v), h⟩ + +theorem card_finalTile {w : Lattice 3} {U : Finset (Lattice 3)} (hw : w ∉ U) : + (s.finalTile w U).card = U.card * m ^ 3 := by + classical + rw [finalTile, Finset.card_image_of_injective _ (s.point_injective hw)] + simp [Residue] + +theorem finalTile_nonempty (w : Lattice 3) {U : Finset (Lattice 3)} + (h0 : 0 ∈ U) : (s.finalTile w U).Nonempty := by + exact ⟨s.point w 0 0, s.mem_finalTile.mpr ⟨0, h0, 0, rfl⟩⟩ + +theorem finalTile_eq_union (w : Lattice 3) {U : Finset (Lattice 3)} (h0 : 0 ∈ U) : + s.finalTile w U = s.T1 w ∪ + (U.erase 0).biUnion (fun u => s.T0.image (fun x => scale m u + x)) := by + classical + ext x + constructor + · intro hx + obtain ⟨u, hu, v, rfl⟩ := s.mem_finalTile.mp hx + by_cases hu0 : u = 0 + · apply Finset.mem_union_left + exact s.mem_T1.mpr ⟨v, by simp [hu0]⟩ + · apply Finset.mem_union_right + apply Finset.mem_biUnion.mpr + refine ⟨u, Finset.mem_erase.mpr ⟨hu0, hu⟩, ?_⟩ + apply Finset.mem_image.mpr + exact ⟨s.t v, s.mem_T0.mpr ⟨v, rfl⟩, (s.point_of_ne_zero w hu0 v).symm⟩ + · intro hx + rcases Finset.mem_union.mp hx with hx | hx + · obtain ⟨v, hv⟩ := s.mem_T1.mp hx + exact s.mem_finalTile.mpr ⟨0, h0, v, by simpa using hv⟩ + · obtain ⟨u, hu, hx⟩ := Finset.mem_biUnion.mp hx + obtain ⟨hu0, huU⟩ := Finset.mem_erase.mp hu + obtain ⟨t, ht, htx⟩ := Finset.mem_image.mp hx + obtain ⟨v, hv⟩ := s.mem_T0.mp ht + refine s.mem_finalTile.mpr ⟨u, huU, v, ?_⟩ + rw [s.point_of_ne_zero w hu0 v, hv, htx] + +theorem constituent_disjoint {w : Lattice 3} {U : Finset (Lattice 3)} + (hw : w ∉ U) {u u' : ↥U} (hne : u ≠ u') : + Disjoint (Set.range (s.point w (u : Lattice 3))) + (Set.range (s.point w (u' : Lattice 3))) := by + rw [Set.disjoint_left] + rintro x ⟨v, hv⟩ ⟨v', hv'⟩ + apply hne + have hp : (u, v) = (u', v') := s.point_injective hw (hv.trans hv'.symm) + exact congrArg Prod.fst hp + +end +end ResidueSection +end PeriodicTilingThree.MarkedTile + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/MarkedTileDescent.lean b/lean/OAI/Geometry/PeriodicTiling/MarkedTileDescent.lean new file mode 100644 index 0000000000000000000000000000000000000000..e264c40ac29513be69173986d6ce444ac39c3826 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/MarkedTileDescent.lean @@ -0,0 +1,65 @@ +import OAI.Geometry.PeriodicTiling.ConstituentAssembly +import OAI.Geometry.PeriodicTiling.MarkedCell +import OAI.Geometry.PeriodicTiling.GridRigidity +import OAI.Geometry.PeriodicTiling.LatticeDescent +import OAI.Geometry.PeriodicTiling.QuotientTiling +import OAI.Geometry.PeriodicTiling.TilingTransport + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree.MarkedTile.ResidueSection + +open CyclicQuotient + +variable {m : ℕ} [NeZero m] (s : ResidueSection m) + +theorem no_euclideanFullyPeriodic + (hm : 2 ≤ m) (hdiff : RigidDifferences m s.Tstar) + (Q : ℕ) [NeZero Q] (F : Finset (CyclicQuotient.Group Q)) (hF0 : 0 ∈ F) + (haperiodic : ∀ B, Tiles F B → ¬ FullyPeriodic B) + {A : Set (Space 3)} + (htile : AETiles + (Thickening (s.finalTile (kernelStep Q) (representatives Q F))) A) : + ¬ EuclideanFullyPeriodic A := by + classical + rintro ⟨b, hb⟩ + let U := representatives Q F + let w := kernelStep Q + have h0 : 0 ∈ U := zero_mem_representatives Q hF0 + have hw : w ∉ U := kernelStep_not_mem_representatives Q F + have htyped := s.typed_constituents hm h0 hw htile + have hinj := s.center_injective hm h0 hw htile + obtain ⟨c₀, _hc₀, hgrid'⟩ := periodic_voxel_assembly_grid_range hm + s.Tstar_subset_T0 (s.Tstar_subset_T1 w) hdiff s.card_T0 (s.card_T1 w) + b (fun v hv => period_centers (hb v hv)) hb htyped + have hgrid : centers m U A = + Set.range (fun z : Lattice 3 => c₀ + scaledCast m z) := hgrid' + let B := normalizedComplement m c₀ A + have hBtile : Tiles U B := tiles_of_centers_grid hinj hgrid + have hAne : A.Nonempty := by + obtain ⟨z, hz⟩ := hBtile.complement_nonempty + exact ⟨c₀ + scaledCast m z, hz⟩ + have hAgrid : ∀ a ∈ A, ∃ z : Lattice 3, c₀ + scaledCast m z = a := by + intro a ha + have hc := subset_centers (m := m) h0 A ha + rw [hgrid] at hc + exact hc + have hBperiodic : FullyPeriodic B := + fullyPeriodic_normalizedComplement m c₀ hAne hAgrid ⟨b, hb⟩ + have hnormalized := normalized_typedAETiles m (NeZero.ne m) c₀ hgrid htyped + have hkernel : ∀ k ∈ (projection Q).ker, Period B k := + s.kernel_periods_of_marked_cells Q B hnormalized + have hquotient : Tiles F ((projection Q) '' B) := by + have h := tiles_image_of_kernel_periods (projection Q) (projection_surjective Q) + hBtile hkernel + simpa only [U, projection_image_representatives] using h + exact haperiodic _ hquotient + (FullyPeriodic.image_of_surjective (projection Q) (projection_surjective Q) hBperiodic) + +end PeriodicTilingThree.MarkedTile.ResidueSection + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/MarkedTileExistence.lean b/lean/OAI/Geometry/PeriodicTiling/MarkedTileExistence.lean new file mode 100644 index 0000000000000000000000000000000000000000..5bf9a97b627bfd8081f8915432a251f037f0ab95 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/MarkedTileExistence.lean @@ -0,0 +1,145 @@ +import OAI.Geometry.PeriodicTiling.MarkedTile +import OAI.Geometry.PeriodicTiling.CyclicQuotient + +namespace OAI + +namespace PeriodicTilingThree.MarkedTile + +noncomputable section + +def periodEquiv {B : Set (Lattice 3)} {w : Lattice 3} (hB : Period B w) : B ≃ B where + toFun b := ⟨(b : Lattice 3) + w, (hB b).mpr b.property⟩ + invFun b := ⟨(b : Lattice 3) - w, by + have h := (hB ((b : Lattice 3) - w)).mp + apply h + simp [b.property]⟩ + left_inv b := by + apply Subtype.ext + change ((b : Lattice 3) + w) - w = (b : Lattice 3) + exact add_sub_cancel_right _ _ + right_inv b := by + apply Subtype.ext + change ((b : Lattice 3) - w) + w = (b : Lattice 3) + exact sub_add_cancel _ _ + +@[simp] theorem periodEquiv_apply {B : Set (Lattice 3)} {w : Lattice 3} + (hB : Period B w) (b : B) : (periodEquiv hB b : Lattice 3) = (b : Lattice 3) + w := rfl + +@[simp] theorem periodEquiv_symm_apply {B : Set (Lattice 3)} {w : Lattice 3} + (hB : Period B w) (b : B) : ((periodEquiv hB).symm b : Lattice 3) = (b : Lattice 3) - w := rfl + +def relocate {m : ℕ} {U : Finset (Lattice 3)} {B : Set (Lattice 3)} + {w : Lattice 3} (hB : Period B w) : + ((↥U × B) × Residue m) ≃ ((↥U × B) × Residue m) where + toFun q := if (q.1.1 : Lattice 3) = 0 ∧ q.2 = 0 then + ((q.1.1, periodEquiv hB q.1.2), q.2) else q + invFun q := if (q.1.1 : Lattice 3) = 0 ∧ q.2 = 0 then + ((q.1.1, (periodEquiv hB).symm q.1.2), q.2) else q + left_inv q := by + rcases q with ⟨⟨u, b⟩, v⟩ + by_cases h : (u : Lattice 3) = 0 ∧ v = 0 <;> simp [h] + right_inv q := by + rcases q with ⟨⟨u, b⟩, v⟩ + by_cases h : (u : Lattice 3) = 0 ∧ v = 0 <;> simp [h] + +namespace ResidueSection + +variable {m : ℕ} [NeZero m] (s : ResidueSection m) + +def baseline {U : Finset (Lattice 3)} {B : Set (Lattice 3)} + (q : (↥U × B) × Residue m) : Lattice 3 := + scale m ((q.1.1 : Lattice 3) + (q.1.2 : Lattice 3)) + s.t q.2 + +theorem baseline_bijective {U : Finset (Lattice 3)} {B : Set (Lattice 3)} + (h : Tiles U B) : Function.Bijective (s.baseline (U := U) (B := B)) := by + constructor + · rintro ⟨⟨u, b⟩, v⟩ ⟨⟨u', b'⟩, v'⟩ he + have hc : ((u : Lattice 3) + (b : Lattice 3), v) = + ((u' : Lattice 3) + (b' : Lattice 3), v') := + s.coordinates_injective he + have hi : (u, b) = (u', b') := h.1 (congrArg Prod.fst hc) + have hv : v = v' := congrArg (fun p : Lattice 3 × Residue m => p.2) hc + exact Prod.ext hi hv + · intro x + obtain ⟨⟨a, v⟩, hx⟩ := s.coordinates_surjective x + obtain ⟨⟨u, b⟩, ha⟩ := h.2 a + refine ⟨((u, b), v), ?_⟩ + change scale m ((u : Lattice 3) + (b : Lattice 3)) + s.t v = x + change (u : Lattice 3) + (b : Lattice 3) = a at ha + rw [ha] + exact hx + +def placement {U : Finset (Lattice 3)} {B : Set (Lattice 3)} + (w : Lattice 3) (q : (↥U × B) × Residue m) : Lattice 3 := + s.point w q.1.1 q.2 + scale m q.1.2 + +theorem placement_eq_baseline_relocate + {m : ℕ} [NeZero m] (s : ResidueSection m) + {U : Finset (Lattice 3)} + {B : Set (Lattice 3)} {w : Lattice 3} (hB : Period B w) + (q : (↥U × B) × Residue m) : + s.placement w q = s.baseline (relocate hB q) := by + classical + rcases q with ⟨⟨u, b⟩, v⟩ + by_cases h : (u : Lattice 3) = 0 ∧ v = 0 + · simp only [placement, point, relocate, Equiv.coe_fn_mk, baseline, + h.1, h.2, and_self, ite_true, periodEquiv_apply, zero_add, map_add, t0] + abel + · simp only [placement, point, h, ite_false, relocate, Equiv.coe_fn_mk, baseline, + map_add] + abel + +theorem placement_bijective {U : Finset (Lattice 3)} {B : Set (Lattice 3)} + {w : Lattice 3} (h : Tiles U B) (hB : Period B w) : + Function.Bijective (s.placement (U := U) (B := B) w) := by + have he : s.placement (U := U) (B := B) w = s.baseline ∘ relocate hB := by + funext q + exact s.placement_eq_baseline_relocate hB q + rw [he] + exact (s.baseline_bijective h).comp (relocate hB).bijective + +theorem finalTile_tiles {U : Finset (Lattice 3)} {B : Set (Lattice 3)} + {w : Lattice 3} (h : Tiles U B) (hB : Period B w) : + Tiles (s.finalTile w U) ((scale m) '' B) := by + classical + have hp := s.placement_bijective h hB + constructor + · rintro ⟨⟨t, ht⟩, ⟨c, hc⟩⟩ ⟨⟨t', ht'⟩, ⟨c', hc'⟩⟩ he + obtain ⟨u, hu, v, hv⟩ := s.mem_finalTile.mp ht + obtain ⟨u', hu', v', hv'⟩ := s.mem_finalTile.mp ht' + obtain ⟨b, hb, hbc⟩ := hc + obtain ⟨b', hb', hbc'⟩ := hc' + have hi : (((⟨u, hu⟩ : ↥U), (⟨b, hb⟩ : B)), v) = + (((⟨u', hu'⟩ : ↥U), (⟨b', hb'⟩ : B)), v') := by + apply hp.1 + change s.point w u v + scale m b = s.point w u' v' + scale m b' + rw [hv, hv', hbc, hbc'] + exact he + have htt : t = t' := by + have hh := congrArg + (fun q : (↥U × B) × Residue m => s.point w q.1.1 q.2) hi + simpa only [hv, hv'] using hh + have hcc : c = c' := by + have hh := congrArg + (fun q : (↥U × B) × Residue m => scale m q.1.2) hi + simpa only [hbc, hbc'] using hh + exact Prod.ext (Subtype.ext htt) (Subtype.ext hcc) + · intro x + obtain ⟨⟨⟨u, b⟩, v⟩, hx⟩ := hp.2 x + refine ⟨(⟨s.point w u v, s.mem_finalTile.mpr ⟨u, u.property, v, rfl⟩⟩, + ⟨scale m b, ⟨b, b.property, rfl⟩⟩), ?_⟩ + exact hx + +theorem cyclic_finalTile_tiles (Q : ℕ) [NeZero Q] + {F : Finset (CyclicQuotient.Group Q)} {A : Set (CyclicQuotient.Group Q)} + (h : Tiles F A) : + Tiles (s.finalTile (CyclicQuotient.kernelStep Q) (CyclicQuotient.representatives Q F)) + ((scale m) '' ((CyclicQuotient.projection Q) ⁻¹' A)) := + s.finalTile_tiles (CyclicQuotient.preimage_tiles Q h) + (CyclicQuotient.period_preimage_kernelStep Q A) + +end ResidueSection +end +end PeriodicTilingThree.MarkedTile + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/Model.lean b/lean/OAI/Geometry/PeriodicTiling/Model.lean new file mode 100644 index 0000000000000000000000000000000000000000..f191d50f2e570c9fcf5de5c5e3e6a2d35b65b820 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/Model.lean @@ -0,0 +1,60 @@ +import Mathlib + +namespace OAI + +noncomputable section + +universe u + +namespace PeriodicTilingThree + +abbrev Lattice (d : ℕ) := Fin d → ℤ + +section AdditiveGroup + +variable {G : Type u} [AddCommGroup G] + +def Tiles (F : Finset G) (A : Set G) : Prop := + Function.Bijective (fun p : ↥F × A => (p.1 : G) + (p.2 : G)) + +def Period (A : Set G) (v : G) : Prop := + ∀ x : G, x + v ∈ A ↔ x ∈ A + +def FullyPeriodic (A : Set G) : Prop := + ∃ P : AddSubgroup G, P.FiniteIndex ∧ ∀ v ∈ P, Period A v + +end AdditiveGroup + +open MeasureTheory + +abbrev Space (d : ℕ) := Fin d → ℝ + +def castLattice {d : ℕ} : Lattice d →+ Space d where + toFun z i := (z i : ℝ) + map_zero' := by ext i; simp + map_add' z w := by ext i; simp + +def unitCube (d : ℕ) : Set (Space d) := Set.Icc 0 1 + +def Thickening {d : ℕ} (F : Finset (Lattice d)) : Set (Space d) := + {x | ∃ z ∈ F, x - castLattice z ∈ unitCube d} + +def AETiles {d : ℕ} (Ω A : Set (Space d)) : Prop := + ∀ᵐ x ∂volume, ∃! a : A, x - (a : Space d) ∈ Ω + +def latticeOfBasis {d : ℕ} (b : Module.Basis (Fin d) ℝ (Space d)) : + AddSubgroup (Space d) := (Submodule.span ℤ (Set.range b)).toAddSubgroup + +def EuclideanFullyPeriodic {d : ℕ} (A : Set (Space d)) : Prop := + ∃ b : Module.Basis (Fin d) ℝ (Space d), ∀ v ∈ latticeOfBasis b, Period A v + +def HasTileWithoutPeriodicComplement (d : ℕ) : Prop := + ∃ T : Finset (Lattice d), T.Nonempty ∧ + (∃ A : Set (Lattice d), Tiles T A) ∧ + ∀ A : Set (Lattice d), Tiles T A → ¬ FullyPeriodic A + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/OneDimensional.lean b/lean/OAI/Geometry/PeriodicTiling/OneDimensional.lean new file mode 100644 index 0000000000000000000000000000000000000000..09579d0cbdbed8a090ae35da99260c71fa5ca58f --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/OneDimensional.lean @@ -0,0 +1,286 @@ +import OAI.Geometry.PeriodicTiling.TilingBasic +import Mathlib.Algebra.Ring.Periodic +import Mathlib.Data.Finset.Max +import Mathlib.Data.Fintype.BigOperators +import Mathlib.Data.Fintype.Pigeonhole +import Mathlib.Data.ZMod.QuotientGroup +import Lean.Elab.Tactic.Omega + +namespace OAI + +noncomputable section + +open scoped BigOperators + +namespace PeriodicTilingThree + +def oneDValue (b : Fin 2) : ℤ := (b.val : ℤ) + +private theorem oneDValue_injective : Function.Injective oneDValue := by + intro a b h + apply Fin.ext + unfold oneDValue at h + omega + +def OneDConv (T : Finset ℤ) (a : ℤ → Fin 2) : Prop := + ∀ z : ℤ, (∑ t ∈ T, oneDValue (a (z - t))) = 1 + +def oneDWindow (M : ℕ) (a : ℤ → Fin 2) (n : ℤ) : Fin M → Fin 2 := + fun i => a (n + (i.val : ℤ)) + +def OneDBlockEq (M : ℕ) (a : ℤ → Fin 2) (n m : ℤ) : Prop := + ∀ i : ℤ, 0 ≤ i → i < (M : ℤ) → a (n + i) = a (m + i) + +private theorem oneDBlockEq_of_window_eq {M : ℕ} {a : ℤ → Fin 2} {n m : ℤ} + (h : oneDWindow M a n = oneDWindow M a m) : OneDBlockEq M a n m := by + intro i hi hiM + have hcast : (i.toNat : ℤ) = i := Int.toNat_of_nonneg hi + have hbound : i.toNat < M := by omega + have he := congrFun h (⟨i.toNat, hbound⟩ : Fin M) + simpa only [oneDWindow, hcast] using he + +def oneDIndicator (A : Set ℤ) (n : ℤ) : Fin 2 := by + classical + exact if n ∈ A then 1 else 0 + +theorem oneDConv_of_tiles {T : Finset ℤ} {A : Set ℤ} (hTile : Tiles T A) : + OneDConv T (oneDIndicator A) := by + classical + intro z + obtain ⟨t₀, ht₀, huniq⟩ := tiles_iff_unique_tile.mp hTile z + calc + (∑ t ∈ T, oneDValue (oneDIndicator A (z - t))) = + oneDValue (oneDIndicator A (z - t₀.val)) := by + apply Finset.sum_eq_single t₀.val + · intro t ht hne + have hnot : z - t ∉ A := by + intro hmem + have he := congrArg Subtype.val (huniq (⟨t, ht⟩ : ↥T) hmem) + exact hne he + simp [oneDIndicator, hnot, oneDValue] + · intro hnot + exact (hnot t₀.property).elim + _ = 1 := by simp [oneDIndicator, ht₀, oneDValue] + +theorem oneD_right_recurrence {T : Finset ℤ} {a : ℤ → Fin 2} + (lo : ℤ) (M : ℕ) (hlo : lo ∈ T) (hConv : OneDConv T a) (n : ℤ) : + oneDValue (a (n + (M : ℤ))) = + 1 - ∑ t ∈ T.erase lo, oneDValue (a (n + (M : ℤ) + lo - t)) := by + have hs := Finset.sum_erase_add T + (fun t => oneDValue (a (n + (M : ℤ) + lo - t))) hlo + rw [hConv (n + (M : ℤ) + lo)] at hs + have harg : n + (M : ℤ) + lo - lo = n + (M : ℤ) := by omega + rw [harg] at hs + omega + +theorem oneD_left_recurrence {T : Finset ℤ} {a : ℤ → Fin 2} + (lo : ℤ) (M : ℕ) (hhi : lo + (M : ℤ) ∈ T) + (hConv : OneDConv T a) (n : ℤ) : + oneDValue (a (n - 1)) = + 1 - ∑ t ∈ T.erase (lo + (M : ℤ)), + oneDValue (a (n + (M : ℤ) + lo - 1 - t)) := by + have hs := Finset.sum_erase_add T + (fun t => oneDValue (a (n + (M : ℤ) + lo - 1 - t))) hhi + rw [hConv (n + (M : ℤ) + lo - 1)] at hs + have harg : n + (M : ℤ) + lo - 1 - (lo + (M : ℤ)) = n - 1 := by omega + rw [harg] at hs + omega + +theorem oneD_block_eq_add_one {T : Finset ℤ} {a : ℤ → Fin 2} + {lo : ℤ} {M : ℕ} (hlo : lo ∈ T) + (hBounds : ∀ t ∈ T, lo ≤ t ∧ t ≤ lo + (M : ℤ)) + (hConv : OneDConv T a) {n m : ℤ} (hBlock : OneDBlockEq M a n m) : + OneDBlockEq M a (n + 1) (m + 1) := by + have hsum : + (∑ t ∈ T.erase lo, oneDValue (a (n + (M : ℤ) + lo - t))) = + ∑ t ∈ T.erase lo, oneDValue (a (m + (M : ℤ) + lo - t)) := by + apply Finset.sum_congr rfl + intro t ht + obtain ⟨hne, hmem⟩ := Finset.mem_erase.mp ht + obtain ⟨hlo', hhi'⟩ := hBounds t hmem + have he := hBlock ((M : ℤ) + lo - t) (by omega) (by omega) + have hn : n + ((M : ℤ) + lo - t) = n + (M : ℤ) + lo - t := by omega + have hm : m + ((M : ℤ) + lo - t) = m + (M : ℤ) + lo - t := by omega + rw [hn, hm] at he + exact congrArg oneDValue he + have hnext : a (n + (M : ℤ)) = a (m + (M : ℤ)) := by + apply oneDValue_injective + rw [oneD_right_recurrence lo M hlo hConv n, + oneD_right_recurrence lo M hlo hConv m, hsum] + intro i hi hiM + by_cases hinner : i + 1 < (M : ℤ) + · have he := hBlock (i + 1) (by omega) hinner + have hn : n + (i + 1) = n + 1 + i := by omega + have hm : m + (i + 1) = m + 1 + i := by omega + simpa only [hn, hm] using he + · have hieq : i + 1 = (M : ℤ) := by omega + have hn : n + 1 + i = n + (M : ℤ) := by omega + have hm : m + 1 + i = m + (M : ℤ) := by omega + simpa only [hn, hm] using hnext + +theorem oneD_block_eq_sub_one {T : Finset ℤ} {a : ℤ → Fin 2} + {lo : ℤ} {M : ℕ} (hhi : lo + (M : ℤ) ∈ T) + (hBounds : ∀ t ∈ T, lo ≤ t ∧ t ≤ lo + (M : ℤ)) + (hConv : OneDConv T a) {n m : ℤ} (hBlock : OneDBlockEq M a n m) : + OneDBlockEq M a (n - 1) (m - 1) := by + have hsum : + (∑ t ∈ T.erase (lo + (M : ℤ)), + oneDValue (a (n + (M : ℤ) + lo - 1 - t))) = + ∑ t ∈ T.erase (lo + (M : ℤ)), + oneDValue (a (m + (M : ℤ) + lo - 1 - t)) := by + apply Finset.sum_congr rfl + intro t ht + obtain ⟨hne, hmem⟩ := Finset.mem_erase.mp ht + obtain ⟨hlo', hhi'⟩ := hBounds t hmem + have he := hBlock ((M : ℤ) + lo - 1 - t) (by omega) (by omega) + have hn : n + ((M : ℤ) + lo - 1 - t) = n + (M : ℤ) + lo - 1 - t := by omega + have hm : m + ((M : ℤ) + lo - 1 - t) = m + (M : ℤ) + lo - 1 - t := by omega + rw [hn, hm] at he + exact congrArg oneDValue he + have hprev : a (n - 1) = a (m - 1) := by + apply oneDValue_injective + rw [oneD_left_recurrence lo M hhi hConv n, + oneD_left_recurrence lo M hhi hConv m, hsum] + intro i hi hiM + by_cases hiz : i = 0 + · simpa only [hiz, add_zero] using hprev + · have he := hBlock (i - 1) (by omega) (by omega) + have hn : n + (i - 1) = n - 1 + i := by omega + have hm : m + (i - 1) = m - 1 + i := by omega + simpa only [hn, hm] using he + +theorem oneD_block_eq_add_int {T : Finset ℤ} {a : ℤ → Fin 2} + {lo : ℤ} {M : ℕ} (hlo : lo ∈ T) (hhi : lo + (M : ℤ) ∈ T) + (hBounds : ∀ t ∈ T, lo ≤ t ∧ t ≤ lo + (M : ℤ)) + (hConv : OneDConv T a) {n m : ℤ} (hBlock : OneDBlockEq M a n m) : + ∀ z : ℤ, OneDBlockEq M a (n + z) (m + z) := by + have hpos : ∀ r : ℕ, OneDBlockEq M a (n + (r : ℤ)) (m + (r : ℤ)) := by + intro r + induction r with + | zero => simpa only [Nat.cast_zero, add_zero] using hBlock + | succ r ih => + have he := oneD_block_eq_add_one hlo hBounds hConv ih + simpa only [Nat.cast_add, Nat.cast_one, Nat.succ_eq_add_one, add_assoc] using he + have hneg : ∀ r : ℕ, OneDBlockEq M a (n - (r : ℤ)) (m - (r : ℤ)) := by + intro r + induction r with + | zero => simpa only [Nat.cast_zero, sub_zero] using hBlock + | succ r ih => + have he := oneD_block_eq_sub_one hhi hBounds hConv ih + simpa only [Nat.cast_add, Nat.cast_one, Nat.succ_eq_add_one, sub_sub] using he + intro z + cases z with + | ofNat r => exact hpos r + | negSucc r => + have hn : n + Int.negSucc r = n - ((r + 1 : ℕ) : ℤ) := by omega + have hm : m + Int.negSucc r = m - ((r + 1 : ℕ) : ℤ) := by omega + rw [hn, hm] + exact hneg (r + 1) + +theorem oneD_period_of_conv + (T : Finset ℤ) (a : ℤ → Fin 2) (lo : ℤ) (M : ℕ) (hM : 0 < M) + (hlo : lo ∈ T) (hhi : lo + (M : ℤ) ∈ T) + (hBounds : ∀ t ∈ T, lo ≤ t ∧ t ≤ lo + (M : ℤ)) + (hConv : OneDConv T a) : + ∃ p : ℕ, 0 < p ∧ p ≤ 2 ^ M ∧ Function.Periodic a (p : ℤ) := by + classical + have hcard : Fintype.card (Fin M → Fin 2) < Fintype.card (Fin (2 ^ M + 1)) := by + simp only [Fintype.card_fun, Fintype.card_fin] + omega + obtain ⟨i, j, hne, heq⟩ := Fintype.exists_ne_map_eq_of_card_lt + (fun i : Fin (2 ^ M + 1) => oneDWindow M a (i.val : ℤ)) hcard + have derive : ∀ i j : Fin (2 ^ M + 1), i.val < j.val → + oneDWindow M a (i.val : ℤ) = oneDWindow M a (j.val : ℤ) → + ∃ p : ℕ, 0 < p ∧ p ≤ 2 ^ M ∧ Function.Periodic a (p : ℤ) := by + intro i j hij hstate + refine ⟨j.val - i.val, by omega, by have := j.isLt; omega, ?_⟩ + intro x + have hBlock := oneDBlockEq_of_window_eq hstate + have hshift := oneD_block_eq_add_int hlo hhi hBounds hConv hBlock (x - (i.val : ℤ)) + have he := hshift 0 (by omega) (by omega) + have hn : (i.val : ℤ) + (x - (i.val : ℤ)) + 0 = x := by omega + have hm : (j.val : ℤ) + (x - (i.val : ℤ)) + 0 = + x + ((j.val - i.val : ℕ) : ℤ) := by omega + rw [hn, hm] at he + exact he.symm + have hneval : i.val ≠ j.val := fun h => hne (Fin.ext h) + rcases lt_or_gt_of_ne hneval with hij | hji + · exact derive i j hij heq + · exact derive j i hji heq.symm + +theorem periodic_of_tiles_int + (T : Finset ℤ) (hT : T.Nonempty) (A : Set ℤ) (hTile : Tiles T A) : + ∃ p : ℕ, 0 < p ∧ Period A (p : ℤ) := by + classical + let lo : ℤ := T.min' hT + let hi : ℤ := T.max' hT + have hlo : lo ∈ T := T.min'_mem hT + have hhi : hi ∈ T := T.max'_mem hT + have hlohi : lo ≤ hi := T.min'_le hi hhi + let M : ℕ := (hi - lo).toNat + have hMcast : (M : ℤ) = hi - lo := Int.toNat_of_nonneg (by omega) + have hmax : lo + (M : ℤ) ∈ T := by + have he : lo + (M : ℤ) = hi := by omega + rw [he] + exact hhi + have hBounds : ∀ t ∈ T, lo ≤ t ∧ t ≤ lo + (M : ℤ) := by + intro t ht + have hl : lo ≤ t := T.min'_le t ht + have hr : t ≤ hi := T.le_max' t ht + constructor <;> omega + by_cases hzero : M = 0 + · have hall : ∀ z : ℤ, z ∈ A := by + intro z + obtain ⟨t, ht, _⟩ := tiles_iff_unique_tile.mp hTile (lo + z) + obtain ⟨hl, hr⟩ := hBounds t.val t.property + have hteq : t.val = lo := by omega + simpa only [hteq, add_sub_cancel_left] using ht + refine ⟨1, by omega, ?_⟩ + intro z + exact ⟨fun _ => hall z, fun _ => hall (z + (1 : ℤ))⟩ + · have hM : 0 < M := Nat.pos_of_ne_zero hzero + obtain ⟨p, hp, _, hperiod⟩ := oneD_period_of_conv T (oneDIndicator A) lo M hM + hlo hmax hBounds (oneDConv_of_tiles hTile) + refine ⟨p, hp, ?_⟩ + intro z + have he := hperiod z + constructor + · intro hz + by_contra hn + simp [oneDIndicator, hz, hn] at he + · intro hz + by_contra hn + simp [oneDIndicator, hz, hn] at he + +theorem fullyPeriodic_of_nat_period + (A : Set ℤ) (p : ℕ) (hp : 0 < p) (hPeriod : Period A (p : ℤ)) : + FullyPeriodic A := by + refine ⟨AddSubgroup.zmultiples (p : ℤ), ?_, ?_⟩ + · refine ⟨?_⟩ + simpa only [Int.index_zmultiples, Int.natAbs_natCast] using (Nat.ne_of_gt hp) + · intro v hv + obtain ⟨k, rfl⟩ := Int.mem_zmultiples_iff.mp hv + have hFun : Function.Periodic (fun z : ℤ => z ∈ A) (p : ℤ) := + fun z => propext (hPeriod z) + intro z + have he : (z + (p : ℤ) * k ∈ A) = (z ∈ A) := by + simpa only [Int.cast_id, id_def, mul_comm] using hFun.int_mul k z + exact ⟨fun hz => Eq.mp he hz, fun hz => Eq.mpr he hz⟩ + +theorem fullyPeriodic_of_tiles_int + (T : Finset ℤ) (hT : T.Nonempty) (A : Set ℤ) (hTile : Tiles T A) : + FullyPeriodic A := by + obtain ⟨p, hp, hPeriod⟩ := periodic_of_tiles_int T hT A hTile + exact fullyPeriodic_of_nat_period A p hp hPeriod + +theorem exists_fullyPeriodic_tiling_int + (T : Finset ℤ) (hT : T.Nonempty) (hTile : ∃ A : Set ℤ, Tiles T A) : + ∃ A : Set ℤ, Tiles T A ∧ FullyPeriodic A := by + obtain ⟨A, hA⟩ := hTile + exact ⟨A, hA, fullyPeriodic_of_tiles_int T hT A hA⟩ + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/OneDimensionalLattice.lean b/lean/OAI/Geometry/PeriodicTiling/OneDimensionalLattice.lean new file mode 100644 index 0000000000000000000000000000000000000000..2fc84cef5b9ce7c923285264bfc4feb081751798 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/OneDimensionalLattice.lean @@ -0,0 +1,24 @@ +import OAI.Geometry.PeriodicTiling.LatticeDimensions +import OAI.Geometry.PeriodicTiling.OneDimensional +import OAI.Geometry.PeriodicTiling.TilingTransport + +namespace OAI + +namespace PeriodicTilingThree + +theorem fullyPeriodic_of_tiles_lattice_one + {F : Finset (Lattice 1)} {A : Set (Lattice 1)} (h : Tiles F A) : + FullyPeriodic A := by + have hInt := h.preimage_addEquiv intEquiv + have hPeriod := fullyPeriodic_of_tiles_int _ hInt.tile_nonempty _ hInt + exact (fullyPeriodic_preimage_addEquiv_iff intEquiv).mp hPeriod + +theorem lattice_one_tile_has_fullyPeriodic_complement + (F : Finset (Lattice 1)) (h : ∃ A, Tiles F A) : + ∃ A, Tiles F A ∧ FullyPeriodic A := by + obtain ⟨A, hA⟩ := h + exact ⟨A, hA, fullyPeriodic_of_tiles_lattice_one hA⟩ + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/OrdinaryActivation.lean b/lean/OAI/Geometry/PeriodicTiling/OrdinaryActivation.lean new file mode 100644 index 0000000000000000000000000000000000000000..b26d33625dc83d6bff5b85a96c3f5f8323edd449 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/OrdinaryActivation.lean @@ -0,0 +1,38 @@ +import OAI.Geometry.PeriodicTiling.OrdinaryModel +import OAI.Geometry.PeriodicTiling.BlockActivationInverse + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree.CommonModel + +variable {p : ℕ} [NeZero p] (E : EncodingParameters p) + +def ordinaryForward (n : Column p) (x : Plane) (k : K E (.inl n)) + (j : ActivationIndex E (.inl n)) : P E (.inl n) × K E (.inl n) := + (ordinaryUseful E n (x - ordinaryOffset E n j) (k - j.1) + + shift (E.a (.inl n)) (E.b (.inl n)) j.2, + ordinaryHigh E n (x - ordinaryOffset E n j) (k - j.1)) + +theorem ordinaryForward_bijective (n : Column p) (x : Plane) (k : K E (.inl n)) : + Function.Bijective (ordinaryForward E n x k) := by + let D := channelDigitBlocks E (.inl n) (ordinarySymbol E n x) + let S := BlockShiftData.ofMultiplicity + (E.a_two_le (.inl n)) (E.b_two_le (.inl n)) + let e := BlockShiftData.blockInverseEquiv D S + (fun j => (ordinaryOffset E n j).1) + (fun j => ordinaryOffset_rhoA E n j) + (fun j => ordinaryOffset_rhoB E n j) x.1 k + have he : ordinaryForward E n x k = e := by + funext j + simp only [ordinaryForward, ordinaryUseful_offset, ordinaryHigh_offset] + rfl + rw [he] + exact e.bijective + +end PeriodicTilingThree.CommonModel + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/OrdinaryModel.lean b/lean/OAI/Geometry/PeriodicTiling/OrdinaryModel.lean new file mode 100644 index 0000000000000000000000000000000000000000..45dd203be448fa9daf0bc83c0abb9e131f0389a0 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/OrdinaryModel.lean @@ -0,0 +1,125 @@ +import OAI.Geometry.PeriodicTiling.ChannelDigitBlocks +import OAI.Geometry.PeriodicTiling.LastDigit +import OAI.Geometry.PeriodicTiling.ActivationOffsets +import OAI.Geometry.PeriodicTiling.SharedSeedRegions +import Mathlib.Tactic.Ring + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree.CommonModel + +variable {p : ℕ} [NeZero p] (E : EncodingParameters p) + +def ordinarySymbol (n : Column p) (x : Plane) : Symbol p := + lastDigit p E.p_prime (lineValue n x) + +def ordinaryUseful (n : Column p) (x : Plane) (w : K E (.inl n)) : P E (.inl n) := + (channelDigitBlocks E (.inl n) (ordinarySymbol E n x)).C w + +def ordinaryHigh (n : Column p) (x : Plane) (w : K E (.inl n)) : K E (.inl n) := + (channelDigitBlocks E (.inl n) (ordinarySymbol E n x)).T x.1 w + +def ordinaryWord (x : Plane) : Word p := fun n => ordinarySymbol E n x + +theorem ordinaryWord_allowed + {p : ℕ} [NeZero p] (E : EncodingParameters p) + (x : Plane) : Allowed p (ordinaryWord E x) := by + have hword : ordinaryWord E x = + (fun n : Column p => lastDigit p E.p_prime (x.1 * (n.val : ℤ) + x.2)) := by + funext n + change lastDigit p E.p_prime (lineValue n x) = _ + congr 1 + unfold lineValue + ring + rw [hword] + exact lastDigit_affine_allowed p E.p_prime x.1 x.2 + +theorem ordinaryUseful_eq_of_lineValue_eq (n : Column p) {x y : Plane} + (hxy : lineValue n x = lineValue n y) (w : K E (.inl n)) : + ordinaryUseful E n x w = ordinaryUseful E n y w := by + exact congrArg + (fun t : ℤ => (channelDigitBlocks E (.inl n) (lastDigit p E.p_prime t)).C w) hxy + +theorem ordinaryUseful_active_iff (n : Column p) (x : Plane) (j : Symbol p) : + (∃ w w' : K E (.inl n), w - w' ∈ digitSubgroup E (.inl n) j ∧ + ordinaryUseful E n x w ≠ ordinaryUseful E n x w') ↔ + j = ordinarySymbol E n x := + channelDigitBlocks_active_iff E (.inl n) (ordinarySymbol E n x) j + +theorem ordinarySymbol_offset (n : Column p) (x : Plane) + (j : ActivationIndex E (.inl n)) : + ordinarySymbol E n (x - ordinaryOffset E n j) = ordinarySymbol E n x := by + unfold ordinarySymbol + congr 1 + simp only [lineValue, ordinaryOffset, Prod.fst_sub, Prod.snd_sub] + ring + +theorem ordinaryUseful_offset (n : Column p) (x : Plane) + (j : ActivationIndex E (.inl n)) (w : K E (.inl n)) : + ordinaryUseful E n (x - ordinaryOffset E n j) w = ordinaryUseful E n x w := by + exact congrArg (fun s : Symbol p => (channelDigitBlocks E (.inl n) s).C w) + (ordinarySymbol_offset E n x j) + +theorem ordinaryHigh_offset (n : Column p) (x : Plane) + (j : ActivationIndex E (.inl n)) (w : K E (.inl n)) : + ordinaryHigh E n (x - ordinaryOffset E n j) w = + (channelDigitBlocks E (.inl n) (ordinarySymbol E n x)).T + (x.1 - (ordinaryOffset E n j).1) w := by + exact congrArg (fun s : Symbol p => (channelDigitBlocks E (.inl n) s).T + (x.1 - (ordinaryOffset E n j).1) w) (ordinarySymbol_offset E n x j) + +theorem ordinarySymbol_val_of_residue + {p : ℕ} [NeZero p] (E : EncodingParameters p) + (n : Column p) (x : Plane) + (t : ZMod p) (ht : t ≠ 0) + (hx₁ : (x.1 : ZMod p) = 0) (hx₂ : (x.2 : ZMod p) = t) : + (ordinarySymbol E n x : ZMod p) = t := by + have hv : (lineValue n x : ZMod p) = t := by + simp [lineValue, hx₁, hx₂] + have hnot : ¬ (p : ℤ) ∣ lineValue n x := by + intro h + have hz : (lineValue n x : ZMod p) = 0 := + (ZMod.intCast_zmod_eq_zero_iff_dvd _ _).mpr h + exact ht (hv.symm.trans hz) + exact (lastDigit_eq_of_not_dvd p E.p_prime hnot).trans hv + +theorem reduce_residue + {p : ℕ} [NeZero p] + (x : Plane) : + SharedSeed.reduce p (SharedSeed.residue p x) = + ((x.1 : ZMod p), (x.2 : ZMod p)) := by + simp [SharedSeed.reduce, SharedSeed.residue] + +theorem ordinarySymbol_firstRegion (n : Column p) (x : Plane) + (hx : SharedSeed.residue p x ∈ SharedSeed.firstRegion p) : + ordinarySymbol E n x = 1 := by + let : Fact (1 < p) := ⟨E.p_prime.one_lt⟩ + have h := SharedSeed.reduce_of_firstRegion hx + rw [reduce_residue (p := p) x] at h + apply Units.ext + exact ordinarySymbol_val_of_residue E n x 1 one_ne_zero + (congrArg Prod.fst h) (congrArg Prod.snd h) + +theorem ordinarySymbol_secondRegion (n : Column p) (x : Plane) + (hx : SharedSeed.residue p x ∈ SharedSeed.secondRegion p) : + ordinarySymbol E n x = lastDigit p E.p_prime 2 := by + have h := SharedSeed.reduce_of_secondRegion hx + rw [reduce_residue (p := p) x] at h + have htwo : (2 : ZMod p) ≠ 0 := by + intro hz + have hd : p ∣ 2 := (ZMod.natCast_eq_zero_iff 2 p).mp hz + have hle := Nat.le_of_dvd (by decide : 0 < 2) hd + have hlarge := E.p_large + omega + apply Units.ext + rw [lastDigit_two p E.p_prime (by have h := E.p_large; omega)] + exact ordinarySymbol_val_of_residue E n x 2 htwo + (congrArg Prod.fst h) (congrArg Prod.snd h) + +end PeriodicTilingThree.CommonModel + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/PeriodicPartGrouping.lean b/lean/OAI/Geometry/PeriodicTiling/PeriodicPartGrouping.lean new file mode 100644 index 0000000000000000000000000000000000000000..95b917c80d2ab52b46999749770decc064e9bd7d --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/PeriodicPartGrouping.lean @@ -0,0 +1,152 @@ +import OAI.Geometry.PeriodicTiling.FiniteMasks +import OAI.Geometry.PeriodicTiling.PlaneLattices +import Mathlib.Data.Fintype.EquivFin +import Mathlib.Algebra.Order.BigOperators.Group.Finset + +namespace OAI + +universe uG uι + +noncomputable section + +namespace PeriodicTilingThree + +open scoped BigOperators + +theorem tileIndicator_finite_union_eq_sum {G : Type uG} {ι : Type uι} [Fintype ι] + (parts : ι → Set G) + (hbound : ∀ x, (∑ i, tileIndicator ℝ (parts i) x) ≤ 1) + (s : Finset ι) (x : G) : + tileIndicator ℝ {x | ∃ i ∈ s, x ∈ parts i} x = + ∑ i ∈ s, tileIndicator ℝ (parts i) x := by + classical + by_cases hx : ∃ i ∈ s, x ∈ parts i + · obtain ⟨i, hi, hix⟩ := hx + have hlo : (1 : ℝ) ≤ ∑ j ∈ s, tileIndicator ℝ (parts j) x := by + simpa only [tileIndicator, ite_eq_left hix] using + (Finset.single_le_sum (fun j _ => tileIndicator_nonneg (parts j) x) hi) + have hhi : (∑ j ∈ s, tileIndicator ℝ (parts j) x) ≤ 1 := by + calc + _ ≤ ∑ j, tileIndicator ℝ (parts j) x := + Finset.sum_le_univ_sum_of_nonneg (fun j => tileIndicator_nonneg (parts j) x) + _ ≤ 1 := hbound x + have hmem : x ∈ {x | ∃ j ∈ s, x ∈ parts j} := ⟨i, hi, hix⟩ + rw [tileIndicator, ite_eq_left hmem] + exact le_antisymm hlo hhi + · have hz : (∑ i ∈ s, tileIndicator ℝ (parts i) x) = 0 := by + apply Finset.sum_eq_zero + intro i hi + have hix : x ∉ parts i := fun h => hx ⟨i, hi, h⟩ + simp only [tileIndicator, ite_eq_right hix] + rw [hz] + simp only [tileIndicator, Set.mem_ofPred_eq, ite_eq_right hx] + +theorem exists_grouped_periodic_parts {ι : Type uι} [Fintype ι] + (parts : ι → Set Plane) (v : ι → Plane) + (hv : ∀ i, v i ≠ 0) (hp : ∀ i, Period (parts i) (v i)) + {A : Set Plane} + (hsum : ∀ x, (∑ i, tileIndicator ℝ (parts i) x) = tileIndicator ℝ A x) : + ∃ (m : ℕ) (w : Fin m → Plane) (grouped : Fin m → Set Plane), + (∀ j, w j ≠ 0) ∧ + (∀ i j, i ≠ j → planeDet (w i) (w j) ≠ 0) ∧ + (∀ x, (∑ j, tileIndicator ℝ (grouped j) x) = tileIndicator ℝ A x) ∧ + ∀ j, Period (grouped j) (w j) := by + classical + let r : Setoid ι := + { r := fun i j => planeDet (v i) (v j) = 0 + iseqv := ⟨fun i => planeDet_self (v i), + fun {i j} hij => by rw [planeDet_swap, hij, neg_zero], + fun {i j k} hij hjk => planeDet_zero_trans (hv j) hij hjk⟩ } + let Q := Quotient r + let : Fintype Q := Fintype.ofFinite Q + let cls : ι → Q := Quotient.mk r + let fiber (j : Q) : Finset ι := Finset.univ.filter (fun i => cls i = j) + have mem_fiber (i : ι) (j : Q) : i ∈ fiber j ↔ cls i = j := by + simp [fiber] + have out_mem (j : Q) : j.out ∈ fiber j := + (mem_fiber _ _).2 (Quotient.out_eq j) + have hex (j : Q) : ∃ w : Plane, w ≠ 0 ∧ + ∀ i ∈ fiber j, ∃ n : ℤ, w = n • v i := by + have himage : ((fiber j).image v).Nonempty := + ⟨v j.out, Finset.mem_image_of_mem v (out_mem j)⟩ + obtain ⟨w, hw, hm⟩ := exists_common_collinear_multiple ((fiber j).image v) himage + (by + intro z hz + obtain ⟨i, _, rfl⟩ := Finset.mem_image.mp hz + exact hv i) + (by + intro z hz z' hz' + obtain ⟨i, hi, rfl⟩ := Finset.mem_image.mp hz + obtain ⟨i', hi', rfl⟩ := Finset.mem_image.mp hz' + exact Quotient.exact (((mem_fiber i j).1 hi).trans ((mem_fiber i' j).1 hi').symm)) + exact ⟨w, hw, fun i hi => hm (v i) (Finset.mem_image_of_mem v hi)⟩ + choose w hw hm using hex + let grouped : Q → Set Plane := fun j => {x | ∃ i ∈ fiber j, x ∈ parts i} + have hbound (x : Plane) : (∑ i, tileIndicator ℝ (parts i) x) ≤ 1 := by + rw [hsum] + exact tileIndicator_le_one A x + have hind (j : Q) (x : Plane) : tileIndicator ℝ (grouped j) x = + ∑ i ∈ fiber j, tileIndicator ℝ (parts i) x := + tileIndicator_finite_union_eq_sum parts hbound (fiber j) x + have htotal (x : Plane) : (∑ j, tileIndicator ℝ (grouped j) x) = + tileIndicator ℝ A x := by + simp_rw [hind] + simp only [fiber, Finset.sum_filter] + rw [Finset.sum_comm] + calc + (∑ i, ∑ j : Q, if cls i = j then tileIndicator ℝ (parts i) x else 0) = + ∑ i, tileIndicator ℝ (parts i) x := by + apply Finset.sum_congr rfl + intro i _ + simpa only [ite_eq_left rfl, ite_true] using + (Finset.sum_eq_single (s := Finset.univ) + (f := fun j : Q => if cls i = j then tileIndicator ℝ (parts i) x else 0) + (cls i) (fun j _ hji => ite_eq_right (Ne.symm hji)) + (fun h => (h (Finset.mem_univ (cls i))).elim)) + _ = tileIndicator ℝ A x := hsum x + have hper (j : Q) : Period (grouped j) (w j) := by + intro x + change (∃ i ∈ fiber j, x + w j ∈ parts i) ↔ ∃ i ∈ fiber j, x ∈ parts i + constructor + · rintro ⟨i, hi, hx⟩ + obtain ⟨n, hn⟩ := hm j i hi + refine ⟨i, hi, ?_⟩ + rw [hn] at hx + exact ((hp i).zsmul n x).mp hx + · rintro ⟨i, hi, hx⟩ + obtain ⟨n, hn⟩ := hm j i hi + refine ⟨i, hi, ?_⟩ + rw [hn] + exact ((hp i).zsmul n x).mpr hx + have hpair (j k : Q) (hjk : j ≠ k) : planeDet (w j) (w k) ≠ 0 := by + intro hdet + obtain ⟨n, hn⟩ := hm j j.out (out_mem j) + obtain ⟨m, hmk⟩ := hm k k.out (out_mem k) + have hn0 : n ≠ 0 := by + intro hn0 + exact hw j (by simpa [hn0] using hn) + have hm0 : m ≠ 0 := by + intro hm0 + exact hw k (by simpa [hm0] using hmk) + rw [hn, hmk, planeDet_zsmul_left, planeDet_zsmul_right] at hdet + have hz : planeDet (v j.out) (v k.out) = 0 := + (mul_eq_zero.mp ((mul_eq_zero.mp hdet).resolve_left hn0)).resolve_left hm0 + apply hjk + calc + j = cls j.out := (Quotient.out_eq j).symm + _ = cls k.out := Quotient.sound hz + _ = k := Quotient.out_eq k + let e : Fin (Fintype.card Q) ≃ Q := (Fintype.equivFin Q).symm + refine ⟨Fintype.card Q, fun j => w (e j), fun j => grouped (e j), + fun j => hw (e j), ?_, ?_, fun j => hper (e j)⟩ + · intro i j hij + exact hpair (e i) (e j) (fun he => hij (e.injective he)) + · intro x + rw [e.sum_comp (fun j => tileIndicator ℝ (grouped j) x)] + exact htotal x + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/PeriodicRegion.lean b/lean/OAI/Geometry/PeriodicTiling/PeriodicRegion.lean new file mode 100644 index 0000000000000000000000000000000000000000..d8acfe8852565d4a27a3e3df54b6d847ae6cbad8 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/PeriodicRegion.lean @@ -0,0 +1,141 @@ +import OAI.Geometry.PeriodicTiling.TilesRegion +import OAI.Geometry.PeriodicTiling.FiniteCylinder +import OAI.Geometry.PeriodicTiling.PlaneLattices +import Mathlib.Tactic.NormNum + +namespace OAI + +namespace PeriodicTilingThree + +namespace PeriodicRegion + +def residue (m : ℕ) (hm : 0 < m) (x : ℤ) : Fin m := + ⟨(x % (m : ℤ)).toNat, by + have hmZ : (0 : ℤ) < m := by exact_mod_cast hm + have hlo := Int.emod_nonneg x (ne_of_gt hmZ) + have hhi := Int.emod_lt_of_pos x hmZ + omega⟩ + +theorem residue_cast (m : ℕ) (hm : 0 < m) (x : ℤ) : + ((residue m hm x : ℕ) : ℤ) = x % (m : ℤ) := by + have hmZ : (0 : ℤ) < m := by exact_mod_cast hm + have hlo := Int.emod_nonneg x (ne_of_gt hmZ) + dsimp [residue] + omega + +theorem residue_add (m : ℕ) (hm : 0 < m) (x : ℤ) : + residue m hm (x + m) = residue m hm x := by + apply Fin.ext + simp [residue] + +private theorem coordinate_sub (T : Plane ≃+ Plane) (x y : ℤ) (f : Plane) : + T (x, y) - f = T (x - (T.symm f).1, y - (T.symm f).2) := by + calc + T (x, y) - f = T (x, y) - T (T.symm f) := by rw [T.apply_symm_apply] + _ = T ((x, y) - T.symm f) := (map_sub T (x, y) (T.symm f)).symm + _ = T (x - (T.symm f).1, y - (T.symm f).2) := rfl + +private theorem target_phase {E : Set Plane} (T : Plane ≃+ Plane) (q : ℕ) + (hE : Period E (T (0, (q : ℤ)))) (x y y' : ℤ) + (hphase : (q : ℤ) ∣ y' - y) : + T (x, y') ∈ E ↔ T (x, y) ∈ E := by + obtain ⟨c, hc⟩ := hphase + have hv := hE.zsmul c + have heq : T (x, y) + c • T (0, (q : ℤ)) = T (x, y') := by + rw [← map_zsmul, ← map_add] + congr 1 + apply Prod.ext + · simp + · simp + nlinarith + simpa only [heq] using hv (T (x, y)) + +end PeriodicRegion + +theorem periodic_region_replacement {F : Finset Plane} {D E : Set Plane} + (htile : TilesRegion F D E) + (hperiod : ∃ h : Plane, h ≠ 0 ∧ Period D h) + (htarget : FullyPeriodic E) : + ∃ D' : Set Plane, TilesRegion F D' E ∧ FullyPeriodic D' := by + classical + obtain ⟨h, hh, hD⟩ := hperiod + obtain ⟨m, hm, T, hT⟩ := exists_primitive_coordinates hh + have hDcoord : Period D (T ((m : ℤ), 0)) := hT.symm ▸ hD + obtain ⟨q, hq, hEcoord⟩ := htarget.exists_coordinate_period T + let row : ℤ → (Fin m → Bool) := fun n r => decide (T ((r : ℕ), n) ∈ D) + have row_iff (x n : ℤ) : + row n (PeriodicRegion.residue m hm x) = true ↔ T (x, n) ∈ D := by + change decide (T (((PeriodicRegion.residue m hm x : ℕ) : ℤ), n) ∈ D) = true ↔ + T (x, n) ∈ D + rw [decide_eq_true_eq, PeriodicRegion.residue_cast] + exact (hDcoord.mem_coordinate_mod x n).symm + let R : ℕ := F.sup (fun f => (T.symm f).2.natAbs) + have offset_bounds (f : ↥F) : + 0 ≤ (R : ℤ) - (T.symm (f : Plane)).2 ∧ + (R : ℤ) - (T.symm (f : Plane)).2 ≤ (2 * R : ℕ) := by + have habs : (T.symm (f : Plane)).2.natAbs ≤ R := + Finset.le_sup (f := fun f : Plane => (T.symm f).2.natAbs) f.property + have habsZ : ((T.symm (f : Plane)).2.natAbs : ℤ) ≤ R := by + exact_mod_cast habs + have hupper : (T.symm (f : Plane)).2 ≤ + ((T.symm (f : Plane)).2.natAbs : ℤ) := Int.le_natAbs + have hlower : -(T.symm (f : Plane)).2 ≤ + ((T.symm (f : Plane)).2.natAbs : ℤ) := by + simpa only [Int.natAbs_neg] using + (Int.le_natAbs (a := -(T.symm (f : Plane)).2)) + have htwo : ((2 * R : ℕ) : ℤ) = 2 * (R : ℤ) := by simp + rw [htwo] + omega + obtain ⟨b, L, hL, hqL, hbperiod, hwindows⟩ := + FiniteCylinder.exists_periodic_windows row q (2 * R) hq + let D' : Set Plane := {z | b (T.symm z).2 + (PeriodicRegion.residue m hm (T.symm z).1) = true} + have mem_new (x y : ℤ) : + T (x, y) ∈ D' ↔ b y (PeriodicRegion.residue m hm x) = true := by + simp only [D', Set.mem_ofPred_eq, T.symm_apply_apply] + have htiles : TilesRegion F D' E := by + apply htile.of_local_copy + intro z + obtain ⟨⟨x, y⟩, rfl⟩ := T.surjective z + obtain ⟨t, htphase, hwindow⟩ := hwindows (y - R) + refine ⟨T (x, t + R), ?_, ?_⟩ + · apply PeriodicRegion.target_phase T q hEcoord + have heq : t + (R : ℤ) - y = t - (y - (R : ℤ)) := by omega + simpa only [heq] using htphase + · intro f + obtain ⟨hk0, hkH⟩ := offset_bounds f + have hrow := hwindow ((R : ℤ) - (T.symm (f : Plane)).2) hk0 hkH + have hind : y - (R : ℤ) + ((R : ℤ) - (T.symm (f : Plane)).2) = + y - (T.symm (f : Plane)).2 := by omega + rw [hind] at hrow + rw [PeriodicRegion.coordinate_sub T x y f, + PeriodicRegion.coordinate_sub T x (t + R) f, mem_new, hrow] + have heq : t + (R : ℤ) - (T.symm (f : Plane)).2 = + t + ((R : ℤ) - (T.symm (f : Plane)).2) := by omega + rw [heq] + exact row_iff (x - (T.symm (f : Plane)).1) + (t + ((R : ℤ) - (T.symm (f : Plane)).2)) + have hx : Period D' (T ((m : ℤ), 0)) := by + intro z + obtain ⟨⟨x, y⟩, rfl⟩ := T.surjective z + have heq : T (x, y) + T ((m : ℤ), 0) = T (x + m, y) := by + rw [← map_add] + change T (x + (m : ℤ), y + 0) = T (x + (m : ℤ), y) + rw [add_zero] + rw [heq, mem_new, mem_new, PeriodicRegion.residue_add] + have hy : Period D' (T (0, L)) := by + intro z + obtain ⟨⟨x, y⟩, rfl⟩ := T.surjective z + have heq : T (x, y) + T (0, L) = T (x, y + L) := by + rw [← map_add] + change T (x + 0, y + L) = T (x, y + L) + rw [add_zero] + rw [heq, mem_new, mem_new, hbperiod] + have hLn : 0 < L.toNat := by omega + have hLcast : (L.toNat : ℤ) = L := by omega + refine ⟨D', htiles, fullyPeriodic_of_coordinate_periods T m L.toNat hm hLn hx ?_⟩ + simpa only [hLcast] using hy + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/PeriodicVolume.lean b/lean/OAI/Geometry/PeriodicTiling/PeriodicVolume.lean new file mode 100644 index 0000000000000000000000000000000000000000..f0cac4f89d8f11b65eb31cb0ab48a5cf1267904d --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/PeriodicVolume.lean @@ -0,0 +1,207 @@ +import OAI.Geometry.PeriodicTiling.PeriodicVolumeMass +import Mathlib.Tactic.Tauto + +namespace OAI + +noncomputable section + +open Set MeasureTheory Filter +open scoped Pointwise ENNReal + +namespace PeriodicTilingThree.PeriodicVolume + +variable {d : ℕ} + +def typedPiece (Ω0 Ω1 C1 : Set (Space d)) (c : Space d) : Set (Space d) := by + classical + exact if c ∈ C1 then Ω1 else Ω0 + +theorem typedPiece_measurable (Ω0 Ω1 C1 : Set (Space d)) + (h0 : MeasurableSet Ω0) (h1 : MeasurableSet Ω1) (c : Space d) : + MeasurableSet (typedPiece Ω0 Ω1 C1 c) := by + classical + unfold typedPiece + split_ifs <;> assumption + +theorem typedPiece_periodic (b : Module.Basis (Fin d) ℝ (Space d)) + (Ω0 Ω1 C1 : Set (Space d)) + (ht : ∀ v ∈ latticeOfBasis b, Period C1 v) + (g : latticeOfBasis b) (x : Space d) : + typedPiece Ω0 Ω1 C1 (x + (g : Space d)) = typedPiece Ω0 Ω1 C1 x := by + classical + simp only [typedPiece, ht g g.property x] + +theorem typedPiece_volume (Ω0 Ω1 C1 : Set (Space d)) + (hv : volume Ω1 = volume Ω0) (c : Space d) : + volume (typedPiece Ω0 Ω1 C1 c) = volume Ω0 := by + classical + unfold typedPiece + split_ifs + · exact hv + · rfl + +theorem typed_aedisjoint (Ω0 Ω1 C C1 : Set (Space d)) + (htile : TypedAETiles Ω0 Ω1 C C1) : + Pairwise fun c c' : C => AEDisjoint volume + (translate c (typedPiece Ω0 Ω1 C1 c)) + (translate c' (typedPiece Ω0 Ω1 C1 c')) := by + classical + intro c c' hne + have ha : ∀ᵐ x ∂volume, + x ∉ translate c (typedPiece Ω0 Ω1 C1 c) ∩ + translate c' (typedPiece Ω0 Ω1 C1 c') := by + filter_upwards [htile] with x hx + intro hmem + exact hne (hx.unique hmem.1 hmem.2) + simpa only [AEDisjoint, not_not, Set.ofPred_mem_eq] using (ae_iff.mp ha) + +theorem typed_assembly_ae_eq_univ (Ω0 Ω1 C C1 : Set (Space d)) + (htile : TypedAETiles Ω0 Ω1 C C1) : + assembly C (typedPiece Ω0 Ω1 C1) =ᵐ[volume] Set.univ := by + classical + filter_upwards [htile] with x hx + apply propext + exact ⟨fun _ => mem_univ x, fun _ => mem_assembly.mpr hx.exists⟩ + +theorem typed_cell_mass (b : Module.Basis (Fin d) ℝ (Space d)) + (Ω0 Ω1 C C1 : Set (Space d)) + (hC : C.Countable) + (hfin : ∀ B : Set (Space d), Bornology.IsBounded B → (C ∩ B).Finite) + (h0 : MeasurableSet Ω0) (h1 : MeasurableSet Ω1) + (hv : volume Ω1 = volume Ω0) + (hp : ∀ v ∈ latticeOfBasis b, Period C v) + (ht : ∀ v ∈ latticeOfBasis b, Period C1 v) + (htile : TypedAETiles Ω0 Ω1 C C1) : + volume (ZSpan.fundamentalDomain b) = + Nat.card (representatives b C) • volume Ω0 := by + classical + let := (representatives_finite b C hfin).fintype + have hu := ae_eq_set_inter (typed_assembly_ae_eq_univ Ω0 Ω1 C C1 htile) + (Filter.EventuallyEq.rfl : ZSpan.fundamentalDomain b =ᵐ[volume] + ZSpan.fundamentalDomain b) + calc + volume (ZSpan.fundamentalDomain b) = + volume (assembly C (typedPiece Ω0 Ω1 C1) ∩ ZSpan.fundamentalDomain b) := by + simpa only [univ_inter] using (measure_congr hu).symm + _ = ∑' r : representatives b C, volume (typedPiece Ω0 Ω1 C1 r) := + packed_assembly_mass b C hC hp (typedPiece Ω0 Ω1 C1) + (typedPiece_periodic b Ω0 Ω1 C1 ht) + (fun c _ => typedPiece_measurable Ω0 Ω1 C1 h0 h1 c) + (typed_aedisjoint Ω0 Ω1 C C1 htile) + _ = Nat.card (representatives b C) • volume Ω0 := by + simp only [typedPiece_volume Ω0 Ω1 C1 hv, tsum_fintype, + Finset.sum_const, Finset.card_univ, Nat.card_eq_fintype_card] + +theorem assembly_period (b : Module.Basis (Fin d) ℝ (Space d)) + (C : Set (Space d)) (hp : ∀ v ∈ latticeOfBasis b, Period C v) + (K : Space d → Set (Space d)) + (hKp : ∀ (g : latticeOfBasis b) x, K (x + (g : Space d)) = K x) + (g : latticeOfBasis b) : Period (assembly C K) (g : Space d) := by + intro x + rw [mem_assembly, mem_assembly] + constructor + · rintro ⟨c, hc⟩ + have hcg : (c : Space d) - (g : Space d) ∈ C := by + simpa only [sub_eq_add_neg] using + (hp _ ((latticeOfBasis b).neg_mem g.property) c).2 c.property + refine ⟨⟨(c : Space d) - (g : Space d), hcg⟩, ?_⟩ + have hKm : K ((c : Space d) - (g : Space d)) = K c := by + simpa only [NegMemClass.coe_neg, sub_eq_add_neg] using hKp (-g) c + change x - ((c : Space d) - (g : Space d)) ∈ K ((c : Space d) - (g : Space d)) + rw [hKm] + have he : x - ((c : Space d) - (g : Space d)) = + (x + (g : Space d)) - (c : Space d) := by abel + rw [he] + exact hc + · rintro ⟨c, hc⟩ + have hcg : (c : Space d) + (g : Space d) ∈ C := + (hp g g.property c).2 c.property + refine ⟨⟨(c : Space d) + (g : Space d), hcg⟩, ?_⟩ + change (x + (g : Space d)) - ((c : Space d) + (g : Space d)) ∈ + K ((c : Space d) + (g : Space d)) + rw [hKp g c, add_sub_add_right_eq_sub] + exact hc + +theorem lattice_vadd_assembly (b : Module.Basis (Fin d) ℝ (Space d)) + (C : Set (Space d)) (hp : ∀ v ∈ latticeOfBasis b, Period C v) + (K : Space d → Set (Space d)) + (hKp : ∀ (g : latticeOfBasis b) x, K (x + (g : Space d)) = K x) + (g : latticeOfBasis b) : g +ᵥ assembly C K = assembly C K := by + ext x + rw [mem_vadd_set_iff_neg_vadd_mem] + change -(g : Space d) + x ∈ assembly C K ↔ x ∈ assembly C K + simpa only [NegMemClass.coe_neg, add_comm] using + assembly_period b C hp K hKp (-g) x + +theorem ae_covers_of_cell_mass (b : Module.Basis (Fin d) ℝ (Space d)) + (C : Set (Space d)) (hC : C.Countable) + (hp : ∀ v ∈ latticeOfBasis b, Period C v) + (K : Space d → Set (Space d)) + (hKp : ∀ (g : latticeOfBasis b) x, K (x + (g : Space d)) = K x) + (hK : ∀ c ∈ C, MeasurableSet (K c)) + (hmass : volume (assembly C K ∩ ZSpan.fundamentalDomain b) = + volume (ZSpan.fundamentalDomain b)) : + ∀ᵐ x ∂volume, ∃ c : C, x - (c : Space d) ∈ K c := by + let : Countable (Submodule.span ℤ (Set.range b)).toAddSubgroup := + inferInstanceAs (Countable (Submodule.span ℤ (Set.range b))) + have hU := measurableSet_assembly C hC K hK + have hP := ZSpan.fundamentalDomain_measurableSet b + have hPfin : volume (ZSpan.fundamentalDomain b) ≠ ⊤ := + (ZSpan.fundamentalDomain_isBounded b).measure_lt_top.ne + have hae : (assembly C K ∩ ZSpan.fundamentalDomain b : Set (Space d)) =ᵐ[volume] + ZSpan.fundamentalDomain b := + ae_eq_of_subset_of_measure_ge inter_subset_right hmass.symm.le + (hU.inter hP).nullMeasurableSet hPfin + have hnull := (ae_eq_set.mp hae).2 + have hdiff : ZSpan.fundamentalDomain b \ + (assembly C K ∩ ZSpan.fundamentalDomain b) = + (assembly C K)ᶜ ∩ ZSpan.fundamentalDomain b := by + ext x + simp only [Set.mem_sdiff, mem_inter_iff, mem_compl_iff] + tauto + rw [hdiff] at hnull + have hglobal : volume (assembly C K)ᶜ = 0 := + (ZSpan.isAddFundamentalDomain' b volume).measure_zero_of_invariant + ((assembly C K)ᶜ) + (fun g => by + ext x + rw [mem_vadd_set_iff_neg_vadd_mem] + change (-(g : Space d) + x ∉ assembly C K) ↔ x ∉ assembly C K + simpa only [NegMemClass.coe_neg, add_comm] using + not_congr (assembly_period b C hp K hKp (-g) x)) + hnull + have hcover : ∀ᵐ x ∂volume, x ∈ assembly C K := ae_iff.mpr hglobal + exact hcover.mono fun _ hx => mem_assembly.mp hx + +theorem replacement_ae_covers (b : Module.Basis (Fin d) ℝ (Space d)) + (Ω0 Ω1 J C C1 : Set (Space d)) + (hC : C.Countable) + (hfin : ∀ B : Set (Space d), Bornology.IsBounded B → (C ∩ B).Finite) + (h0 : MeasurableSet Ω0) (h1 : MeasurableSet Ω1) (hJ : MeasurableSet J) + (hv : volume Ω1 = volume Ω0) (hJv : volume J = volume Ω0) + (hp : ∀ v ∈ latticeOfBasis b, Period C v) + (ht : ∀ v ∈ latticeOfBasis b, Period C1 v) + (htile : TypedAETiles Ω0 Ω1 C C1) + (hpack : Pairwise fun c c' : C => + AEDisjoint volume (translate c J) (translate c' J)) : + ∀ᵐ x ∂volume, ∃ c : C, x - (c : Space d) ∈ J := by + classical + let := (representatives_finite b C hfin).fintype + apply ae_covers_of_cell_mass b C hC hp (fun _ => J) (fun _ _ => rfl) + (fun _ _ => hJ) + calc + volume (assembly C (fun _ => J) ∩ ZSpan.fundamentalDomain b) = + ∑' _r : representatives b C, volume J := + packed_assembly_mass b C hC hp (fun _ => J) (fun _ _ => rfl) + (fun _ _ => hJ) hpack + _ = Nat.card (representatives b C) • volume Ω0 := by + simp only [hJv, tsum_fintype, Finset.sum_const, Finset.card_univ, + Nat.card_eq_fintype_card] + _ = volume (ZSpan.fundamentalDomain b) := + (typed_cell_mass b Ω0 Ω1 C C1 hC hfin h0 h1 hv hp ht htile).symm + +end PeriodicTilingThree.PeriodicVolume + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/PeriodicVolumeMass.lean b/lean/OAI/Geometry/PeriodicTiling/PeriodicVolumeMass.lean new file mode 100644 index 0000000000000000000000000000000000000000..68ccf38aa53b53ab346e3fb6b860941dc90e0ac4 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/PeriodicVolumeMass.lean @@ -0,0 +1,134 @@ +import OAI.Geometry.PeriodicTiling.PeriodicVolumeOrbits +import Mathlib.MeasureTheory.Measure.Typeclasses.Finite +import Mathlib.Tactic.Abel + +namespace OAI + +noncomputable section + +open Set MeasureTheory +open scoped Pointwise ENNReal + +namespace PeriodicTilingThree.PeriodicVolume + +variable {d : ℕ} + +def translate (c : Space d) (K : Set (Space d)) : Set (Space d) := + {x | x - c ∈ K} + +@[simp] theorem mem_translate {c x : Space d} {K : Set (Space d)} : + x ∈ translate c K ↔ x - c ∈ K := Iff.rfl + +theorem translate_eq_vadd (c : Space d) (K : Set (Space d)) : + translate c K = c +ᵥ K := by + ext x + simp only [mem_translate, mem_vadd_set_iff_neg_vadd_mem, vadd_eq_add] + rw [sub_eq_add_neg, add_comm x (-c)] + +@[simp] theorem measure_translate (c : Space d) (K : Set (Space d)) : + volume (translate c K) = volume K := by + rw [translate_eq_vadd, measure_vadd] + +theorem measurableSet_translate (c : Space d) {K : Set (Space d)} + (hK : MeasurableSet K) : MeasurableSet (translate c K) := + hK.preimage (measurable_id.sub measurable_const) + +theorem lattice_vadd_translate (b : Module.Basis (Fin d) ℝ (Space d)) + (g : latticeOfBasis b) (r : Space d) (K : Set (Space d)) : + g +ᵥ translate r K = translate (r + (g : Space d)) K := by + ext x + rw [mem_vadd_set_iff_neg_vadd_mem] + change (-(g : Space d) + x) - r ∈ K ↔ x - (r + (g : Space d)) ∈ K + have he : (-(g : Space d) + x) - r = x - (r + (g : Space d)) := by abel + rw [he] + +def assembly (C : Set (Space d)) (K : Space d → Set (Space d)) : Set (Space d) := + ⋃ c : C, translate c (K c) + +@[simp] theorem mem_assembly {C : Set (Space d)} {K : Space d → Set (Space d)} + {x : Space d} : x ∈ assembly C K ↔ ∃ c : C, x - (c : Space d) ∈ K c := by + simp only [assembly, mem_iUnion, mem_translate] + +theorem measurableSet_assembly (C : Set (Space d)) (hC : C.Countable) + (K : Space d → Set (Space d)) (hK : ∀ c ∈ C, MeasurableSet (K c)) : + MeasurableSet (assembly C K) := by + let : Countable C := hC.to_subtype + exact MeasurableSet.iUnion fun c : C => measurableSet_translate c (hK c c.property) + +theorem periodic_piece_mass (b : Module.Basis (Fin d) ℝ (Space d)) + (C : Set (Space d)) (hp : ∀ v ∈ latticeOfBasis b, Period C v) + (K : Space d → Set (Space d)) + (hKp : ∀ (g : latticeOfBasis b) x, K (x + (g : Space d)) = K x) : + (∑' c : C, volume (translate c (K c) ∩ ZSpan.fundamentalDomain b)) = + ∑' r : representatives b C, volume (K r) := by + let : Countable (Submodule.span ℤ (Set.range b)).toAddSubgroup := + inferInstanceAs (Countable (Submodule.span ℤ (Set.range b))) + have hP := ZSpan.isAddFundamentalDomain' b (volume : Measure (Space d)) + calc + (∑' c : C, volume (translate c (K c) ∩ ZSpan.fundamentalDomain b)) = + ∑' p : representatives b C × latticeOfBasis b, + volume (translate (orbitEquiv b C hp p) (K (orbitEquiv b C hp p)) ∩ + ZSpan.fundamentalDomain b) := + ((orbitEquiv b C hp).tsum_eq _).symm + _ = ∑' r : representatives b C, ∑' g : latticeOfBasis b, + volume (translate ((r : Space d) + (g : Space d)) + (K ((r : Space d) + (g : Space d))) ∩ ZSpan.fundamentalDomain b) := + ENNReal.tsum_prod' + _ = ∑' r : representatives b C, volume (K r) := by + apply tsum_congr + intro r + calc + (∑' g : latticeOfBasis b, + volume (translate ((r : Space d) + (g : Space d)) + (K ((r : Space d) + (g : Space d))) ∩ ZSpan.fundamentalDomain b)) = + ∑' g : latticeOfBasis b, + volume ((g +ᵥ translate r (K r)) ∩ ZSpan.fundamentalDomain b) := by + apply tsum_congr + intro g + rw [hKp g r, lattice_vadd_translate] + _ = volume (translate r (K r)) := (hP.measure_eq_tsum _).symm + _ = volume (K r) := measure_translate _ _ + +theorem periodic_piece_mass_eq_card (b : Module.Basis (Fin d) ℝ (Space d)) + (C : Set (Space d)) (hp : ∀ v ∈ latticeOfBasis b, Period C v) + (hfin : ∀ B : Set (Space d), Bornology.IsBounded B → (C ∩ B).Finite) + (K : Space d → Set (Space d)) + (hKp : ∀ (g : latticeOfBasis b) x, K (x + (g : Space d)) = K x) + (v : ℝ≥0∞) (hv : ∀ c ∈ C, volume (K c) = v) : + (∑' c : C, volume (translate c (K c) ∩ ZSpan.fundamentalDomain b)) = + Nat.card (representatives b C) • v := by + let := (representatives_finite b C hfin).fintype + rw [periodic_piece_mass b C hp K hKp] + have hvr : ∀ r : representatives b C, volume (K r) = v := fun r => hv r r.property.1 + simp only [hvr, tsum_fintype, Finset.sum_const, + Finset.card_univ, Nat.card_eq_fintype_card] + +theorem packed_assembly_mass (b : Module.Basis (Fin d) ℝ (Space d)) + (C : Set (Space d)) (hC : C.Countable) + (hp : ∀ v ∈ latticeOfBasis b, Period C v) + (K : Space d → Set (Space d)) + (hKp : ∀ (g : latticeOfBasis b) x, K (x + (g : Space d)) = K x) + (hK : ∀ c ∈ C, MeasurableSet (K c)) + (hpack : Pairwise fun c c' : C => + AEDisjoint volume (translate c (K c)) (translate c' (K c'))) : + volume (assembly C K ∩ ZSpan.fundamentalDomain b) = + ∑' r : representatives b C, volume (K r) := by + let : Countable C := hC.to_subtype + calc + volume (assembly C K ∩ ZSpan.fundamentalDomain b) = + ∑' c : C, volume (translate c (K c) ∩ ZSpan.fundamentalDomain b) := by + rw [assembly, iUnion_inter] + apply measure_iUnion₀ + · intro c c' hne + exact (hpack hne).mono inter_subset_left inter_subset_left + · intro c + exact ((measurableSet_translate c (hK c c.property)).inter + (ZSpan.fundamentalDomain_measurableSet b)).nullMeasurableSet + _ = ∑' r : representatives b C, volume (K r) := + periodic_piece_mass b C hp K hKp + +end PeriodicTilingThree.PeriodicVolume + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/PeriodicVolumeOrbits.lean b/lean/OAI/Geometry/PeriodicTiling/PeriodicVolumeOrbits.lean new file mode 100644 index 0000000000000000000000000000000000000000..9ec7763e35e2f496a21dd4c6572cee59d4ec26ca --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/PeriodicVolumeOrbits.lean @@ -0,0 +1,87 @@ +import OAI.Geometry.PeriodicTiling.EuclideanBasic +import Mathlib.Algebra.Module.ZLattice.Basic + +namespace OAI + +noncomputable section + +open Set MeasureTheory +open scoped Pointwise ENNReal + +namespace PeriodicTilingThree.PeriodicVolume + +variable {d : ℕ} + +def representatives (b : Module.Basis (Fin d) ℝ (Space d)) (C : Set (Space d)) : Set (Space d) := + C ∩ ZSpan.fundamentalDomain b + +theorem representatives_finite (b : Module.Basis (Fin d) ℝ (Space d)) (C : Set (Space d)) + (hfin : ∀ K : Set (Space d), Bornology.IsBounded K → (C ∩ K).Finite) : + (representatives b C).Finite := + hfin _ (ZSpan.fundamentalDomain_isBounded b) + +def orbitMap (b : Module.Basis (Fin d) ℝ (Space d)) (C : Set (Space d)) + (hp : ∀ v ∈ latticeOfBasis b, Period C v) + (p : representatives b C × latticeOfBasis b) : C := + ⟨(p.1 : Space d) + (p.2 : Space d), + (hp p.2 p.2.property p.1).2 p.1.property.1⟩ + +theorem orbitMap_injective (b : Module.Basis (Fin d) ℝ (Space d)) (C : Set (Space d)) + (hp : ∀ v ∈ latticeOfBasis b, Period C v) : + Function.Injective (orbitMap b C hp) := by + rintro ⟨r, g⟩ ⟨s, h⟩ he + have he' : (r : Space d) + (g : Space d) = s + (h : Space d) := + congrArg Subtype.val he + have hr : ZSpan.fract b (r : Space d) = r := + ZSpan.fract_eq_self.mpr r.property.2 + have hs : ZSpan.fract b (s : Space d) = s := + ZSpan.fract_eq_self.mpr s.property.2 + have hfract := congrArg (ZSpan.fract b) he' + rw [ZSpan.fract_add_ZSpan b _ g.property, + ZSpan.fract_add_ZSpan b _ h.property, hr, hs] at hfract + have hrs : r = s := Subtype.ext hfract + subst s + have hgh : g = h := Subtype.ext (add_left_cancel he') + subst h + rfl + +theorem orbitMap_surjective (b : Module.Basis (Fin d) ℝ (Space d)) (C : Set (Space d)) + (hp : ∀ v ∈ latticeOfBasis b, Period C v) : + Function.Surjective (orbitMap b C hp) := by + intro c + let g : latticeOfBasis b := ZSpan.floor b (c : Space d) + have hneg : -(g : Space d) ∈ latticeOfBasis b := + (latticeOfBasis b).neg_mem g.property + have hc : ZSpan.fract b (c : Space d) ∈ C := by + rw [ZSpan.fract_apply, sub_eq_add_neg] + exact (hp _ hneg c).2 c.property + let r : representatives b C := + ⟨ZSpan.fract b c, hc, ZSpan.fract_mem_fundamentalDomain b c⟩ + refine ⟨(r, g), Subtype.ext ?_⟩ + change ZSpan.fract b (c : Space d) + (ZSpan.floor b (c : Space d) : Space d) = c + rw [ZSpan.fract_apply, sub_add_cancel] + +def orbitEquiv (b : Module.Basis (Fin d) ℝ (Space d)) (C : Set (Space d)) + (hp : ∀ v ∈ latticeOfBasis b, Period C v) : + representatives b C × latticeOfBasis b ≃ C := + Equiv.ofBijective (orbitMap b C hp) + ⟨orbitMap_injective b C hp, orbitMap_surjective b C hp⟩ + +@[simp] theorem orbitEquiv_apply_coe (b : Module.Basis (Fin d) ℝ (Space d)) + (C : Set (Space d)) (hp : ∀ v ∈ latticeOfBasis b, Period C v) + (r : representatives b C) (g : latticeOfBasis b) : + ((orbitEquiv b C hp (r, g) : C) : Space d) = (r : Space d) + (g : Space d) := + rfl + +theorem type_constant_on_orbit (b : Module.Basis (Fin d) ℝ (Space d)) + (C C1 : Set (Space d)) (hp : ∀ v ∈ latticeOfBasis b, Period C v) + (ht : ∀ v ∈ latticeOfBasis b, Period C1 v) + (r : representatives b C) (g : latticeOfBasis b) : + ((orbitEquiv b C hp (r, g) : C) : Space d) ∈ C1 ↔ (r : Space d) ∈ C1 := + ht g g.property r + +end PeriodicTilingThree.PeriodicVolume + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/PlanarPeriodicity.lean b/lean/OAI/Geometry/PeriodicTiling/PlanarPeriodicity.lean new file mode 100644 index 0000000000000000000000000000000000000000..515fb966a0f2d51f54c58c1ad403aa5088f372c7 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/PlanarPeriodicity.lean @@ -0,0 +1,117 @@ +import OAI.Geometry.PeriodicTiling.WeakPeriodicity +import OAI.Geometry.PeriodicTiling.PeriodicPartGrouping +import OAI.Geometry.PeriodicTiling.ComponentTargets +import OAI.Geometry.PeriodicTiling.PeriodicRegion + +namespace OAI + +universe uG uι + +noncomputable section + +namespace PeriodicTilingThree + +open scoped BigOperators Classical + +theorem Tiles.image_add {G : Type uG} [AddCommGroup G] + {F : Finset G} {A : Set G} (h : Tiles F A) (u : G) : + Tiles (F.image (fun f => f + u)) A := by + classical + apply tiles_iff_unique_tile.mpr + intro x + obtain ⟨f, hf, huniq⟩ := tiles_iff_unique_tile.mp h (x - u) + let f' : ↥(F.image (fun f => f + u)) := + ⟨(f : G) + u, Finset.mem_image_of_mem _ f.property⟩ + have hsub (g : G) : x - (g + u) = (x - u) - g := by abel + refine ⟨f', ?_, ?_⟩ + · change x - ((f : G) + u) ∈ A + rwa [hsub] + · intro g hg + obtain ⟨z, hz, hzg⟩ := Finset.mem_image.mp g.property + have hzA : (x - u) - z ∈ A := by + rw [← hsub, hzg] + exact hg + have hzf : (⟨z, hz⟩ : ↥F) = f := huniq ⟨z, hz⟩ hzA + apply Subtype.ext + change (g : G) = (f : G) + u + have hzf' : z = (f : G) := congrArg Subtype.val hzf + rw [← hzg, hzf'] + +theorem fullyPeriodic_finite_union {G : Type uG} {ι : Type uι} [AddCommGroup G] [Finite ι] + (parts : ι → Set G) (hp : ∀ i, FullyPeriodic (parts i)) : + FullyPeriodic {x | ∃ i, x ∈ parts i} := by + classical + choose P hindex hperiod using hp + let common : AddSubgroup G := ⨅ i, P i + refine ⟨common, AddSubgroup.finiteIndex_iInf hindex, ?_⟩ + intro v hv x + have hv' (i : ι) : v ∈ P i := (AddSubgroup.mem_iInf.mp hv) i + change (∃ i, x + v ∈ parts i) ↔ ∃ i, x ∈ parts i + constructor + · rintro ⟨i, hi⟩ + exact ⟨i, (hperiod i v (hv' i) x).mp hi⟩ + · rintro ⟨i, hi⟩ + exact ⟨i, (hperiod i v (hv' i) x).mpr hi⟩ + +theorem tiles_union_of_region_partition {G : Type uG} {ι : Type uι} [AddCommGroup G] + (F : Finset G) (parts targets : ι → Set G) + (htile : ∀ i, TilesRegion F (parts i) (targets i)) + (hcover : ∀ x, ∃! i, x ∈ targets i) : + Tiles F {x | ∃ i, x ∈ parts i} := by + apply tiles_iff_unique_tile.mpr + intro x + obtain ⟨i, hi, huniq⟩ := hcover x + obtain ⟨f, hf, hfuniq⟩ := (htile i).unique x hi + refine ⟨f, ⟨i, hf⟩, ?_⟩ + rintro g ⟨j, hj⟩ + have hxj : x ∈ targets j := by + simpa [add_comm] using (htile j).add_mem g g.property (x - g) hj + have hji : j = i := huniq j hxj + subst j + exact hfuniq g hj + +theorem Tiles.fullyPeriodic_of_finite_periodic_partition + {ι : Type uι} [Fintype ι] {F : Finset Plane} {A : Set Plane} + (h : Tiles F A) (parts : ι → Set Plane) (v : ι → Plane) + (hpartition : ∀ x, (∑ i, tileIndicator ℝ (parts i) x) = tileIndicator ℝ A x) + (hv : ∀ i, v i ≠ 0) (hperiod : ∀ i, Period (parts i) (v i)) : + ∃ B : Set Plane, Tiles F B ∧ FullyPeriodic B := by + classical + obtain ⟨m, w, grouped, hw, htrans, hsum, hp⟩ := + exists_grouped_periodic_parts parts v hv hperiod hpartition + obtain ⟨htiles, hcover, htargets⟩ := component_targets grouped w h hsum hw hp htrans + have hex (j : Fin m) : ∃ B : Set Plane, + TilesRegion F B (componentTarget F (grouped j)) ∧ FullyPeriodic B := + periodic_region_replacement (htiles j) ⟨w j, hw j, hp j⟩ (htargets j) + choose replacements hregion hfull using hex + refine ⟨{x | ∃ j, x ∈ replacements j}, ?_, ?_⟩ + · exact tiles_union_of_region_partition F replacements + (fun j => componentTarget F (grouped j)) hregion hcover + · exact fullyPeriodic_finite_union replacements hfull + +theorem plane_tile_has_fullyPeriodic_complement + (F : Finset Plane) (hF : F.Nonempty) + (h : ∃ A : Set Plane, Tiles F A) : + ∃ B : Set Plane, Tiles F B ∧ FullyPeriodic B := by + classical + obtain ⟨A, hA⟩ := h + obtain ⟨f, hf⟩ := hF + let : DecidableEq Plane := fun a b => Classical.propDecidable (a = b) + let F₀ := F.image (fun x => x + -f) + have hzero : (0 : Plane) ∈ F₀ := by + apply Finset.mem_image.mpr + exact ⟨f, hf, add_neg_cancel f⟩ + have hA₀ : Tiles F₀ A := hA.image_add (-f) + obtain ⟨m, parts, v, hpartition, hv, hp⟩ := hA₀.exists_weak_periodic_partition hzero + obtain ⟨B, hB, hfull⟩ := + hA₀.fullyPeriodic_of_finite_periodic_partition parts v hpartition hv hp + refine ⟨B, ?_, hfull⟩ + have hback := hB.image_add f + simpa only [F₀, Finset.image_image, Function.comp_def, add_assoc, + neg_add_cancel, add_zero, Finset.image_id'] using hback + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/PlaneLattices.lean b/lean/OAI/Geometry/PeriodicTiling/PlaneLattices.lean new file mode 100644 index 0000000000000000000000000000000000000000..60bf6ef36906bb4ff7ce1d2395de099f054bf0d6 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/PlaneLattices.lean @@ -0,0 +1,361 @@ +import OAI.Geometry.PeriodicTiling.TilingBasic +import Mathlib.Data.Int.GCD +import Mathlib.Data.ZMod.QuotientGroup +import Mathlib.Data.Set.Finite.Basic +import Mathlib.Tactic.Ring +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.NormNum +import Mathlib.Tactic.Abel + +namespace OAI + +universe uG uι + +noncomputable section + +namespace PeriodicTilingThree + +open scoped BigOperators + +section Periods + +variable {G : Type uG} [AddCommGroup G] {A : Set G} {v : G} + +theorem Period.zsmul (hv : Period A v) (n : ℤ) : Period A (n • v) := + (periodSubgroup A).zsmul_mem hv n + +theorem Period.nsmul (hv : Period A v) (n : ℕ) : Period A (n • v) := + (periodSubgroup A).nsmul_mem hv n + +theorem exists_pos_zsmul_mem (P : AddSubgroup G) (hP : P.FiniteIndex) (v : G) : + ∃ q : ℕ, 0 < q ∧ (q : ℤ) • v ∈ P := by + obtain ⟨q, hq, _, hmem⟩ := + AddSubgroup.exists_nsmul_mem_of_index_ne_zero (H := P) hP.index_ne_zero v + exact ⟨q, hq, by simpa only [natCast_zsmul] using hmem⟩ + +end Periods + +def bezoutCoordinates (a b s t : ℤ) (h : s * a + t * b = 1) : Plane ≃+ Plane where + toFun z := (a * z.1 - t * z.2, b * z.1 + s * z.2) + invFun z := (s * z.1 + t * z.2, -b * z.1 + a * z.2) + left_inv := by + rintro ⟨x, y⟩ + apply Prod.ext + · change s * (a * x - t * y) + t * (b * x + s * y) = x + calc + _ = (s * a + t * b) * x := by ring + _ = x := by rw [h, one_mul] + · change -b * (a * x - t * y) + a * (b * x + s * y) = y + calc + _ = (s * a + t * b) * y := by ring + _ = y := by rw [h, one_mul] + right_inv := by + rintro ⟨x, y⟩ + apply Prod.ext + · change a * (s * x + t * y) - t * (-b * x + a * y) = x + calc + _ = (s * a + t * b) * x := by ring + _ = x := by rw [h, one_mul] + · change b * (s * x + t * y) + s * (-b * x + a * y) = y + calc + _ = (s * a + t * b) * y := by ring + _ = y := by rw [h, one_mul] + map_add' := by + rintro ⟨x, y⟩ ⟨z, w⟩ + apply Prod.ext <;> dsimp <;> ring + +theorem exists_primitive_coordinates {h : Plane} (hh : h ≠ 0) : + ∃ m : ℕ, 0 < m ∧ ∃ T : Plane ≃+ Plane, T ((m : ℤ), 0) = h := by + have hcoords : h.1 ≠ 0 ∨ h.2 ≠ 0 := by + by_cases hx : h.1 = 0 + · right + intro hy + exact hh (Prod.ext hx hy) + · exact Or.inl hx + have hg : 0 < Int.gcd h.1 h.2 := Int.gcd_pos_iff.mpr hcoords + obtain ⟨a, b, hab, ha, hb⟩ := Int.exists_gcd_one hg + have hbez : Int.gcdA a b * a + Int.gcdB a b * b = 1 := by + have he := Int.gcd_eq_gcd_ab a b + rw [hab] at he + simpa only [Int.natCast_one, mul_comm] using he.symm + refine ⟨Int.gcd h.1 h.2, hg, bezoutCoordinates a b _ _ hbez, ?_⟩ + change (a * (Int.gcd h.1 h.2 : ℤ) - Int.gcdB a b * 0, + b * (Int.gcd h.1 h.2 : ℤ) + Int.gcdA a b * 0) = h + apply Prod.ext + · simpa using ha.symm + · simpa using hb.symm + +def coordinateSubgroup (T : Plane ≃+ Plane) (m L : ℤ) : AddSubgroup Plane := + ((AddSubgroup.zmultiples m).prod (AddSubgroup.zmultiples L)).map T.toAddMonoidHom + +theorem index_coordinateSubgroup (T : Plane ≃+ Plane) (m L : ℤ) : + (coordinateSubgroup T m L).index = m.natAbs * L.natAbs := by + rw [coordinateSubgroup, AddSubgroup.index_map_of_bijective T.bijective, + AddSubgroup.index_prod, Int.index_zmultiples, Int.index_zmultiples] + +theorem coordinateSubgroup_le (P : AddSubgroup Plane) (T : Plane ≃+ Plane) (m L : ℤ) + (hm : T (m, 0) ∈ P) (hL : T (0, L) ∈ P) : coordinateSubgroup T m L ≤ P := by + rintro z ⟨x, hx, rfl⟩ + obtain ⟨a, ha⟩ := AddSubgroup.mem_zmultiples_iff.mp hx.1 + obtain ⟨b, hb⟩ := AddSubgroup.mem_zmultiples_iff.mp hx.2 + have he : a • (m, (0 : ℤ)) + b • ((0 : ℤ), L) = x := by + apply Prod.ext + · simpa using ha + · simpa using hb + have hmem := P.add_mem (P.zsmul_mem hm a) (P.zsmul_mem hL b) + rwa [← map_zsmul, ← map_zsmul, ← map_add, he] at hmem + +theorem finiteIndex_of_coordinate_mem (P : AddSubgroup Plane) (T : Plane ≃+ Plane) + (m L : ℤ) (hm : m ≠ 0) (hL : L ≠ 0) + (hpm : T (m, 0) ∈ P) (hpL : T (0, L) ∈ P) : P.FiniteIndex := by + let : (coordinateSubgroup T m L).FiniteIndex := ⟨by + rw [index_coordinateSubgroup] + exact mul_ne_zero (fun h => hm (Int.natAbs_eq_zero.mp h)) + (fun h => hL (Int.natAbs_eq_zero.mp h))⟩ + exact AddSubgroup.finiteIndex_of_le (coordinateSubgroup_le P T m L hpm hpL) + +theorem FullyPeriodic.exists_coordinate_period {E : Set Plane} + (hE : FullyPeriodic E) (T : Plane ≃+ Plane) : + ∃ Q : ℕ, 0 < Q ∧ Period E (T (0, (Q : ℤ))) := by + obtain ⟨P, hP, hperiod⟩ := hE + obtain ⟨Q, hQ, hmem⟩ := exists_pos_zsmul_mem P hP (T (0, 1)) + have he : (Q : ℤ) • T (0, 1) = T (0, (Q : ℤ)) := by + rw [← map_zsmul] + congr 1 + ext <;> simp + refine ⟨Q, hQ, ?_⟩ + rw [← he] + exact hperiod _ hmem + +theorem fullyPeriodic_of_coordinate_periods {E : Set Plane} + (T : Plane ≃+ Plane) (m L : ℕ) (hm : 0 < m) (hL : 0 < L) + (hx : Period E (T ((m : ℤ), 0))) (hy : Period E (T (0, (L : ℤ)))) : + FullyPeriodic E := by + refine ⟨periodSubgroup E, ?_, fun _ hv => hv⟩ + exact finiteIndex_of_coordinate_mem (periodSubgroup E) T m L + (by exact_mod_cast (ne_of_gt hm)) (by exact_mod_cast (ne_of_gt hL)) hx hy + +theorem Period.mem_coordinate_mod {D : Set Plane} {T : Plane ≃+ Plane} {m : ℕ} + (hv : Period D (T ((m : ℤ), 0))) (x y : ℤ) : + T (x, y) ∈ D ↔ T (x % (m : ℤ), y) ∈ D := by + have he : T (x % (m : ℤ), y) + (x / (m : ℤ)) • T ((m : ℤ), 0) = T (x, y) := by + rw [← map_zsmul, ← map_add] + congr 1 + apply Prod.ext + · change x % (m : ℤ) + (x / (m : ℤ)) * (m : ℤ) = x + simpa only [add_comm, mul_comm] using Int.emod_add_mul_ediv x (m : ℤ) + · simp + have hp := (hv.zsmul (x / (m : ℤ))) (T (x % (m : ℤ), y)) + rwa [he] at hp + +def planeDet (u v : Plane) : ℤ := u.1 * v.2 - u.2 * v.1 + +@[simp] theorem planeDet_self (u : Plane) : planeDet u u = 0 := by + simp [planeDet, mul_comm] + +theorem planeDet_swap (u v : Plane) : planeDet u v = -planeDet v u := by + dsimp [planeDet] + ring + +theorem planeDet_zsmul_left (n : ℤ) (u v : Plane) : + planeDet (n • u) v = n * planeDet u v := by + change (n * u.1) * v.2 - (n * u.2) * v.1 = n * (u.1 * v.2 - u.2 * v.1) + ring + +theorem planeDet_zsmul_right (n : ℤ) (u v : Plane) : + planeDet u (n • v) = n * planeDet u v := by + change u.1 * (n * v.2) - u.2 * (n * v.1) = n * (u.1 * v.2 - u.2 * v.1) + ring + +theorem zsmul_plane_ne_zero {n : ℤ} {v : Plane} (hn : n ≠ 0) (hv : v ≠ 0) : + n • v ≠ 0 := by + intro he + apply hv + apply Prod.ext + · have h := congrArg Prod.fst he + change n * v.1 = 0 at h + exact (mul_eq_zero.mp h).resolve_left hn + · have h := congrArg Prod.snd he + change n * v.2 = 0 at h + exact (mul_eq_zero.mp h).resolve_left hn + +def integerCombination (u v : Plane) : Plane →+ Plane where + toFun z := z.1 • u + z.2 • v + map_zero' := by simp + map_add' := by + intro x y + change (x.1 + y.1) • u + (x.2 + y.2) • v = + (x.1 • u + x.2 • v) + (y.1 • u + y.2 • v) + rw [add_smul, add_smul] + abel + +def integerSpan2 (u v : Plane) : AddSubgroup Plane := (integerCombination u v).range + +theorem mem_integerSpan2 (u v z : Plane) : + z ∈ integerSpan2 u v ↔ ∃ a b : ℤ, a • u + b • v = z := by + constructor + · rintro ⟨⟨a, b⟩, he⟩ + exact ⟨a, b, he⟩ + · rintro ⟨a, b, he⟩ + exact ⟨(a, b), he⟩ + +theorem determinant_smul_eq (u v z : Plane) : + planeDet u v • z = planeDet z v • u + planeDet u z • v := by + apply Prod.ext + · change (u.1 * v.2 - u.2 * v.1) * z.1 = + (z.1 * v.2 - z.2 * v.1) * u.1 + (u.1 * z.2 - u.2 * z.1) * v.1 + ring + · change (u.1 * v.2 - u.2 * v.1) * z.2 = + (z.1 * v.2 - z.2 * v.1) * u.2 + (u.1 * z.2 - u.2 * z.1) * v.2 + ring + +theorem integerSpan2_finiteIndex (u v : Plane) (huv : planeDet u v ≠ 0) : + (integerSpan2 u v).FiniteIndex := by + have hm (z : Plane) : planeDet u v • z ∈ integerSpan2 u v := + (mem_integerSpan2 u v _).mpr ⟨planeDet z v, planeDet u z, + (determinant_smul_eq u v z).symm⟩ + apply finiteIndex_of_coordinate_mem (integerSpan2 u v) (AddEquiv.refl Plane) + (planeDet u v) (planeDet u v) huv huv + · simpa using hm (1, 0) + · simpa using hm (0, 1) + +theorem fullyPeriodic_of_independent_periods {E : Set Plane} {u v : Plane} + (hu : Period E u) (hv : Period E v) (huv : planeDet u v ≠ 0) : FullyPeriodic E := by + refine ⟨integerSpan2 u v, integerSpan2_finiteIndex u v huv, ?_⟩ + intro z hz + obtain ⟨a, b, rfl⟩ := (mem_integerSpan2 u v z).mp hz + exact (hu.zsmul a).add (hv.zsmul b) + +theorem exists_smul_eq_of_collinear {u v : Plane} + (hu : u ≠ 0) (hv : v ≠ 0) (huv : planeDet u v = 0) : + ∃ a b : ℤ, a ≠ 0 ∧ b ≠ 0 ∧ a • u = b • v := by + by_cases hu₁ : u.1 = 0 + · have hu₂ : u.2 ≠ 0 := fun h => hu (Prod.ext hu₁ h) + have he : u.2 * v.1 = 0 := by + simpa only [planeDet, hu₁, zero_mul, zero_sub, neg_eq_zero] using huv + have hv₁ : v.1 = 0 := (mul_eq_zero.mp he).resolve_left hu₂ + have hv₂ : v.2 ≠ 0 := fun h => hv (Prod.ext hv₁ h) + refine ⟨v.2, u.2, hv₂, hu₂, ?_⟩ + apply Prod.ext + · change v.2 * u.1 = u.2 * v.1 + simp [hu₁, hv₁] + · change v.2 * u.2 = u.2 * v.2 + exact mul_comm _ _ + · have he : u.1 * v.2 = u.2 * v.1 := sub_eq_zero.mp huv + have hv₁ : v.1 ≠ 0 := by + intro hv₁ + have hv₂ : v.2 = 0 := (mul_eq_zero.mp (by simpa [hv₁] using he)).resolve_left hu₁ + exact hv (Prod.ext hv₁ hv₂) + refine ⟨v.1, u.1, hv₁, hu₁, ?_⟩ + apply Prod.ext + · change v.1 * u.1 = u.1 * v.1 + exact mul_comm _ _ + · change v.1 * u.2 = u.1 * v.2 + simpa only [mul_comm] using he.symm + +theorem planeDet_zero_trans {u v w : Plane} (hv : v ≠ 0) + (huv : planeDet u v = 0) (hvw : planeDet v w = 0) : planeDet u w = 0 := by + by_cases hu : u = 0 + · simp [hu, planeDet] + obtain ⟨a, b, ha, _, he⟩ := exists_smul_eq_of_collinear hu hv huv + have hd : planeDet (a • u) w = planeDet (b • v) w := + congrArg (fun z => planeDet z w) he + rw [planeDet_zsmul_left, planeDet_zsmul_left, hvw, mul_zero] at hd + exact (mul_eq_zero.mp hd).resolve_left ha + +theorem exists_common_collinear_multiple (s : Finset Plane) (hne : s.Nonempty) + (h0 : ∀ v ∈ s, v ≠ 0) + (hcol : ∀ v ∈ s, ∀ w ∈ s, planeDet v w = 0) : + ∃ u : Plane, u ≠ 0 ∧ ∀ v ∈ s, ∃ n : ℤ, u = n • v := by + classical + obtain ⟨v₀, hv₀⟩ := hne + have hex : ∀ w : ↥s, ∃ a b : ℤ, a ≠ 0 ∧ b ≠ 0 ∧ a • v₀ = b • (w : Plane) := + fun w => exists_smul_eq_of_collinear (h0 v₀ hv₀) (h0 w w.property) + (hcol v₀ hv₀ w w.property) + choose a b ha hb he using hex + let c : ℤ := ∏ w : ↥s, a w + have hc : c ≠ 0 := Finset.prod_ne_zero_iff.mpr (fun w _ => ha w) + refine ⟨c • v₀, zsmul_plane_ne_zero hc (h0 v₀ hv₀), ?_⟩ + intro v hv + let w : ↥s := ⟨v, hv⟩ + let d : ℤ := ∏ w' ∈ (Finset.univ.erase w), a w' + have hdc : d * a w = c := by + exact Finset.prod_erase_mul _ _ (Finset.mem_univ w) + refine ⟨d * b w, ?_⟩ + calc + c • v₀ = (d * a w) • v₀ := by rw [hdc] + _ = d • (a w • v₀) := mul_smul _ _ _ + _ = d • (b w • v) := by rw [he w] + _ = (d * b w) • v := (mul_smul _ _ _).symm + +theorem exists_transverse_vector (s : Finset Plane) (h0 : ∀ v ∈ s, v ≠ 0) : + ∃ e : Plane, e ≠ 0 ∧ ∀ v ∈ s, planeDet e v ≠ 0 := by + classical + obtain ⟨N, hN⟩ := (s.image (fun v => v.2 / v.1)).exists_notMem + refine ⟨(1, N), by simp, ?_⟩ + intro v hv he + have he' : v.2 = N * v.1 := by + change 1 * v.2 - N * v.1 = 0 at he + simpa only [one_mul] using sub_eq_zero.mp he + have hv₁ : v.1 ≠ 0 := by + intro hv₁ + have hv₂ : v.2 = 0 := by simpa [hv₁] using he' + exact h0 v hv (Prod.ext hv₁ hv₂) + apply hN + apply Finset.mem_image.mpr + refine ⟨v, hv, ?_⟩ + rw [he'] + exact Int.mul_ediv_cancel N hv₁ + +theorem exists_common_transverse {ι : Type uι} [Fintype ι] + (v : ι → Plane) (h0 : ∀ i, v i ≠ 0) + (hpair : ∀ i j, i ≠ j → planeDet (v i) (v j) ≠ 0) : + ∃ e : Plane, e ≠ 0 ∧ (∀ i, planeDet e (v i) ≠ 0) ∧ + ∀ i j, i ≠ j → ∃ a b : ℤ, e = a • v i + b • v j := by + classical + obtain ⟨w, hw, htrans⟩ := exists_transverse_vector (Finset.univ.image v) (by + intro z hz + obtain ⟨i, _, rfl⟩ := Finset.mem_image.mp hz + exact h0 i) + let J := {ij : ι × ι // ij.1 ≠ ij.2} + let P : AddSubgroup Plane := ⨅ ij : J, integerSpan2 (v ij.val.1) (v ij.val.2) + have hP : P.FiniteIndex := AddSubgroup.finiteIndex_iInf + (fun ij : J => integerSpan2_finiteIndex _ _ (hpair _ _ ij.property)) + obtain ⟨q, hq, hmem⟩ := exists_pos_zsmul_mem P hP w + have hq' : (q : ℤ) ≠ 0 := by exact_mod_cast (ne_of_gt hq) + refine ⟨(q : ℤ) • w, zsmul_plane_ne_zero hq' hw, ?_, ?_⟩ + · intro i + rw [planeDet_zsmul_left] + exact mul_ne_zero hq' (htrans (v i) (Finset.mem_image_of_mem v (Finset.mem_univ i))) + · intro i j hij + have hm : (q : ℤ) • w ∈ integerSpan2 (v i) (v j) := + (AddSubgroup.mem_iInf.mp hmem) (⟨(i, j), hij⟩ : J) + obtain ⟨a, b, he⟩ := (mem_integerSpan2 _ _ _).mp hm + exact ⟨a, b, he.symm⟩ + +theorem exists_common_second_vector {ι : Type uι} [Fintype ι] + (v : ι → Plane) (i₀ : ι) (e : Plane) + (htrans : ∀ i, planeDet e (v i) ≠ 0) : + ∃ K : ℕ, 0 < K ∧ ∀ i, ∃ a b : ℤ, a ≠ 0 ∧ + (K : ℤ) • v i₀ = b • e + a • v i := by + let P : AddSubgroup Plane := ⨅ i, integerSpan2 e (v i) + have hP : P.FiniteIndex := AddSubgroup.finiteIndex_iInf + (fun i => integerSpan2_finiteIndex e (v i) (htrans i)) + obtain ⟨K, hK, hmem⟩ := exists_pos_zsmul_mem P hP (v i₀) + have hK' : (K : ℤ) ≠ 0 := by exact_mod_cast (ne_of_gt hK) + refine ⟨K, hK, ?_⟩ + intro i + obtain ⟨b, a, he⟩ := (mem_integerSpan2 e (v i) _).mp + ((AddSubgroup.mem_iInf.mp hmem) i) + refine ⟨a, b, ?_, he.symm⟩ + intro ha + have hd : planeDet e ((K : ℤ) • v i₀) = 0 := by + rw [← he, ha, zero_smul, add_zero, planeDet_zsmul_right, planeDet_self, mul_zero] + rw [planeDet_zsmul_right] at hd + exact mul_ne_zero hK' (htrans i₀) hd + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/PolynomialShiftDifference.lean b/lean/OAI/Geometry/PeriodicTiling/PolynomialShiftDifference.lean new file mode 100644 index 0000000000000000000000000000000000000000..303dbc43a7a739c48bfedd2f7756f5f9cad5f09a --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/PolynomialShiftDifference.lean @@ -0,0 +1,104 @@ +import Mathlib.Algebra.Polynomial.Taylor +import Mathlib.NumberTheory.Real.Irrational +import Mathlib.Tactic.NormNum +import Mathlib.Tactic.Ring +import Lean.Elab.Tactic.Omega + +namespace OAI + +namespace PeriodicTilingThree + +open Polynomial + +theorem polynomial_taylor_coeff_top (P : Polynomial ℝ) (r : ℝ) : + (taylor r P).coeff P.natDegree = P.leadingCoeff := by + have hd : (hasseDeriv P.natDegree P).natDegree < 1 := by + have h := natDegree_hasseDeriv_le P P.natDegree + omega + rw [taylor_coeff, eval_eq_sum_range' hd] + simp only [Finset.sum_range_succ, Finset.sum_range_zero, zero_add, + pow_zero, mul_one, hasseDeriv_coeff, Nat.choose_self, + Nat.cast_one, one_mul, Polynomial.leadingCoeff] + +theorem polynomial_taylor_coeff_pred (P : Polynomial ℝ) + (hP : 0 < P.natDegree) (r : ℝ) : + (taylor r P).coeff (P.natDegree - 1) = + P.coeff (P.natDegree - 1) + + (P.natDegree : ℝ) * P.leadingCoeff * r := by + have hd : (hasseDeriv (P.natDegree - 1) P).natDegree < 2 := by + have h := natDegree_hasseDeriv_le P (P.natDegree - 1) + omega + have hs : 1 + (P.natDegree - 1) = P.natDegree := by omega + have hc : P.natDegree.choose (P.natDegree - 1) = P.natDegree := by + have hs' : P.natDegree - 1 + 1 = P.natDegree := by omega + simpa only [hs'] using Nat.choose_succ_self_right (P.natDegree - 1) + rw [taylor_coeff, eval_eq_sum_range' hd] + simp only [Finset.sum_range_succ, Finset.sum_range_zero, zero_add, + pow_zero, pow_one, mul_one, hasseDeriv_coeff, + Nat.choose_self, Nat.cast_one, one_mul, hs, hc, Polynomial.leadingCoeff] + +theorem polynomial_shift_difference_coeff_pred (P : Polynomial ℝ) + (hP : 0 < P.natDegree) (a b : ℝ) : + (taylor a P - taylor b P).coeff (P.natDegree - 1) = + (P.natDegree : ℝ) * P.leadingCoeff * (a - b) := by + rw [coeff_sub, polynomial_taylor_coeff_pred P hP, + polynomial_taylor_coeff_pred P hP] + ring + +theorem polynomial_shift_difference_natDegree_le (P : Polynomial ℝ) + (hP : 0 < P.natDegree) (a b : ℝ) : + (taylor a P - taylor b P).natDegree ≤ P.natDegree - 1 := by + apply natDegree_le_iff_coeff_eq_zero.mpr + intro n hn + by_cases heq : n = P.natDegree + · subst n + rw [coeff_sub, polynomial_taylor_coeff_top, polynomial_taylor_coeff_top, + sub_self] + · have hlt : P.natDegree < n := by omega + have ha : (taylor a P).coeff n = 0 := + coeff_eq_zero_of_natDegree_lt (by simpa only [natDegree_taylor] using hlt) + have hb : (taylor b P).coeff n = 0 := + coeff_eq_zero_of_natDegree_lt (by simpa only [natDegree_taylor] using hlt) + rw [coeff_sub, ha, hb, sub_self] + +theorem polynomial_shift_difference_degree_irrational (P : Polynomial ℝ) + (hP : 1 < P.natDegree) (hI : Irrational P.leadingCoeff) + (h k : ℕ) (hhk : h ≠ k) : + let D := taylor (h : ℝ) P - taylor (k : ℝ) P + D.natDegree = P.natDegree - 1 ∧ Irrational D.leadingCoeff := by + dsimp only + have hp : 0 < P.natDegree := by omega + have hdiff : (h : ℤ) - (k : ℤ) ≠ 0 := by + apply sub_ne_zero.mpr + exact_mod_cast hhk + have hprod : Irrational + ((P.natDegree : ℝ) * P.leadingCoeff * ((h : ℝ) - (k : ℝ))) := by + simpa only [Int.cast_sub, Int.cast_natCast] using + (hI.natCast_mul (Nat.ne_of_gt hp)).mul_intCast hdiff + have hc := polynomial_shift_difference_coeff_pred P hp (h : ℝ) (k : ℝ) + have hcn : (taylor (h : ℝ) P - taylor (k : ℝ) P).coeff + (P.natDegree - 1) ≠ 0 := by + rw [hc] + exact hprod.ne_zero + have hd := natDegree_eq_of_le_of_coeff_ne_zero + (polynomial_shift_difference_natDegree_le P hp (h : ℝ) (k : ℝ)) hcn + refine ⟨hd, ?_⟩ + rw [Polynomial.leadingCoeff, hd, hc] + exact hprod + +theorem polynomial_shift_difference_leadingCoeff (P : Polynomial ℝ) + (hP : 1 < P.natDegree) (hI : Irrational P.leadingCoeff) + (h k : ℕ) (hhk : h ≠ k) : + (taylor (h : ℝ) P - taylor (k : ℝ) P).leadingCoeff = + (P.natDegree : ℝ) * P.leadingCoeff * ((h : ℝ) - (k : ℝ)) := by + have hd := (polynomial_shift_difference_degree_irrational P hP hI h k hhk).1 + rw [Polynomial.leadingCoeff, hd] + exact polynomial_shift_difference_coeff_pred P (by omega) (h : ℝ) (k : ℝ) + +theorem polynomial_shift_difference_eval (P : Polynomial ℝ) (a b x : ℝ) : + (taylor a P - taylor b P).eval x = P.eval (x + a) - P.eval (x + b) := by + rw [eval_sub, taylor_eval, taylor_eval] + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/PolynomialWeyl.lean b/lean/OAI/Geometry/PeriodicTiling/PolynomialWeyl.lean new file mode 100644 index 0000000000000000000000000000000000000000..78ea3191cd55fc7f8394e4499c4995cb294385d5 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/PolynomialWeyl.lean @@ -0,0 +1,137 @@ +import OAI.Geometry.PeriodicTiling.CircleWeylCriterion +import OAI.Geometry.PeriodicTiling.ScalarVanDerCorput +import OAI.Geometry.PeriodicTiling.PolynomialShiftDifference +import Mathlib.NumberTheory.Real.Irrational +import Mathlib.Tactic.Ring +import Lean.Elab.Tactic.Omega + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree + +open Filter Polynomial +open scoped Topology ComplexConjugate + +def scalarPhase (x : ℝ) : ℂ := + AddCircle.toCircle (x : UnitAddCircle) + +@[simp] theorem scalarPhase_zero : scalarPhase 0 = 1 := by + simp only [scalarPhase, AddCircle.coe_zero, AddCircle.toCircle_zero, Circle.coe_one] + +@[simp] theorem norm_scalarPhase (x : ℝ) : ‖scalarPhase x‖ = 1 := + Circle.norm_coe _ + +theorem scalarPhase_add (x y : ℝ) : + scalarPhase (x + y) = scalarPhase x * scalarPhase y := by + simp only [scalarPhase, AddCircle.coe_add, AddCircle.toCircle_add, Circle.coe_mul] + +theorem scalarPhase_nat_mul (n : ℕ) (x : ℝ) : + scalarPhase ((n : ℝ) * x) = scalarPhase x ^ n := by + induction n with + | zero => simp + | succ n ih => + rw [Nat.cast_succ, add_mul, one_mul, scalarPhase_add, ih, pow_succ] + +theorem scalarPhase_sub (x y : ℝ) : + scalarPhase (x - y) = scalarPhase x * conj (scalarPhase y) := by + have hy : scalarPhase y ≠ 0 := Circle.coe_ne_zero _ + apply mul_right_cancel₀ hy + rw [← scalarPhase_add, sub_add_cancel, mul_assoc, Complex.conj_mul', norm_scalarPhase] + norm_num + +theorem scalarPhase_ne_one_of_irrational {x : ℝ} (hx : Irrational x) : + scalarPhase x ≠ 1 := by + intro h + have he : AddCircle.toCircle (x : UnitAddCircle) = AddCircle.toCircle (0 : UnitAddCircle) := by + apply Subtype.ext + simpa only [AddCircle.toCircle_zero, Circle.coe_one, scalarPhase] using h + have hz : (x : UnitAddCircle) = 0 := + AddCircle.injective_toCircle (by norm_num : (1 : ℝ) ≠ 0) he + obtain ⟨m, hm⟩ := (AddCircle.coe_eq_zero_iff (1 : ℝ)).mp hz + exact hx.ne_int m (by simpa only [zsmul_eq_mul, mul_one] using hm.symm) + +theorem fourier_eq_scalarPhase (k : ℤ) (x : ℝ) : + fourier k (x : UnitAddCircle) = scalarPhase ((k : ℝ) * x) := by + simp only [fourier_apply, scalarPhase, ← AddCircle.coe_zsmul, zsmul_eq_mul] + +private theorem eval_degree_one (P : Polynomial ℝ) (hP : P.natDegree = 1) (x : ℝ) : + P.eval x = P.coeff 0 + P.leadingCoeff * x := by + have hc : P.coeff 1 = P.leadingCoeff := by + simpa only [hP] using P.coeff_natDegree + rw [Polynomial.eval_eq_sum_range' (by omega : P.natDegree < 2)] + simp only [Finset.sum_range_succ, Finset.sum_range_zero, zero_add, pow_zero, + mul_one, pow_one, hc] + +theorem polynomial_phase_average_tendsto_zero (P : Polynomial ℝ) + (hP : 0 < P.natDegree) (hI : Irrational P.leadingCoeff) : + Tendsto (complexAverage (fun n : ℕ => scalarPhase (P.eval (n : ℝ)))) + atTop (𝓝 0) := by + have hall : ∀ d : ℕ, ∀ Q : Polynomial ℝ, Q.natDegree = d → + 0 < d → Irrational Q.leadingCoeff → + Tendsto (complexAverage (fun n : ℕ => scalarPhase (Q.eval (n : ℝ)))) + atTop (𝓝 0) := by + intro d + induction d using Nat.strong_induction_on with + | h d ih => + intro Q hQ hd hI + by_cases hd1 : d = 1 + · have heval : ∀ n : ℕ, scalarPhase (Q.eval (n : ℝ)) = + scalarPhase (Q.coeff 0) * scalarPhase Q.leadingCoeff ^ n := by + intro n + rw [eval_degree_one Q (hQ.trans hd1), scalarPhase_add, + mul_comm Q.leadingCoeff (n : ℝ), scalarPhase_nat_mul] + simpa only [heval] using complexAverage_const_mul_geometric_tendsto + (scalarPhase (Q.coeff 0)) (scalarPhase Q.leadingCoeff) + (norm_scalarPhase _) (scalarPhase_ne_one_of_irrational hI) + · apply complexAverage_vanDerCorput + · intro n + exact (norm_scalarPhase _).le + · intro h k hhk + let D := Polynomial.taylor (h : ℝ) Q - Polynomial.taylor (k : ℝ) Q + obtain ⟨hDdeg, hDirr⟩ := + polynomial_shift_difference_degree_irrational Q (by omega) hI h k hhk + have hDpos : 0 < D.natDegree := by dsimp [D]; rw [hDdeg]; omega + have hDlt : D.natDegree < d := by dsimp [D]; rw [hDdeg, hQ]; omega + have hDlim := ih D.natDegree hDlt D rfl hDpos hDirr + have hseq : + (fun n : ℕ => scalarPhase (Q.eval ((n + h : ℕ) : ℝ)) * + conj (scalarPhase (Q.eval ((n + k : ℕ) : ℝ)))) = + (fun n : ℕ => scalarPhase (D.eval (n : ℝ))) := by + funext n + rw [← scalarPhase_sub] + congr 1 + simp only [D, Polynomial.eval_sub, Polynomial.taylor_eval, Nat.cast_add] + rw [hseq] + exact hDlim + exact hall P.natDegree P rfl hP hI + +theorem denseRange_circlePolynomial_of_irrational_leadingCoeff (P : Polynomial ℝ) + (hP : 0 < P.natDegree) (hI : Irrational P.leadingCoeff) : + DenseRange (fun n : ℕ => ((P.eval (n : ℝ) : ℝ) : UnitAddCircle)) := by + apply denseRange_of_circleFourierCancellation + intro k hk + let Q : Polynomial ℝ := Polynomial.C (k : ℝ) * P + have hkreal : (k : ℝ) ≠ 0 := Int.cast_ne_zero.mpr hk + have hQdeg : Q.natDegree = P.natDegree := Polynomial.natDegree_C_mul hkreal + have hQirr : Irrational Q.leadingCoeff := by + simpa only [Q, Polynomial.leadingCoeff_mul, Polynomial.leadingCoeff_C] + using hI.intCast_mul hk + have hQlim := polynomial_phase_average_tendsto_zero Q (hQdeg.symm ▸ hP) hQirr + have hseq : + (fun n : ℕ => fourier k (((P.eval (n : ℝ) : ℝ) : UnitAddCircle))) = + (fun n : ℕ => scalarPhase (Q.eval (n : ℝ))) := by + funext n + rw [fourier_eq_scalarPhase] + simp only [Q, Polynomial.eval_mul, Polynomial.eval_C] + change Tendsto (complexAverage + (fun n : ℕ => fourier k (((P.eval (n : ℝ) : ℝ) : UnitAddCircle)))) atTop (𝓝 0) + rw [hseq] + exact hQlim + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/PrimeDifferencePairs.lean b/lean/OAI/Geometry/PeriodicTiling/PrimeDifferencePairs.lean new file mode 100644 index 0000000000000000000000000000000000000000..26373d9ec8a930a01c648da5cb668903fc00bcd7 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/PrimeDifferencePairs.lean @@ -0,0 +1,49 @@ +import Mathlib.Algebra.Field.ZMod + +namespace OAI + +namespace PeriodicTilingThree + +def primeDifferencePairs (q m : ℕ) [Fact q.Prime] + (hq : q = 2 * m + 1) (d : ZMod q) (hd : d ≠ 0) : + (Fin m × Fin 2) ↪ ZMod q where + toFun p := ((2 * p.1.val + p.2.val : ℕ) : ZMod q) * d + inj' := by + rintro ⟨j, b⟩ ⟨k, c⟩ h + have hj := j.isLt + have hk := k.isLt + have hb := b.isLt + have hc := c.isLt + have hjb : 2 * j.val + b.val < q := by omega + have hkc : 2 * k.val + c.val < q := by omega + have hcast : ((2 * j.val + b.val : ℕ) : ZMod q) = + ((2 * k.val + c.val : ℕ) : ZMod q) := + mul_right_cancel₀ hd h + have hindices := congrArg ZMod.val hcast + rw [ZMod.val_natCast_of_lt hjb, ZMod.val_natCast_of_lt hkc] at hindices + apply Prod.ext + · apply Fin.ext + change j.val = k.val + omega + · apply Fin.ext + change b.val = c.val + omega + +@[simp] +theorem primeDifferencePairs_apply (q m : ℕ) [Fact q.Prime] + (hq : q = 2 * m + 1) (d : ZMod q) (hd : d ≠ 0) + (j : Fin m) (b : Fin 2) : + primeDifferencePairs q m hq d hd (j, b) = + ((2 * j.val + b.val : ℕ) : ZMod q) * d := rfl + +theorem primeDifferencePairs_step (q m : ℕ) [Fact q.Prime] + (hq : q = 2 * m + 1) (d : ZMod q) (hd : d ≠ 0) (j : Fin m) : + primeDifferencePairs q m hq d hd (j, 1) - + primeDifferencePairs q m hq d hd (j, 0) = d := by + change ((2 * j.val + 1 : ℕ) : ZMod q) * d - + ((2 * j.val : ℕ) : ZMod q) * d = d + rw [Nat.cast_add, Nat.cast_one, add_mul, one_mul, add_sub_cancel_left] + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/QuotientTiling.lean b/lean/OAI/Geometry/PeriodicTiling/QuotientTiling.lean new file mode 100644 index 0000000000000000000000000000000000000000..34259e05b86ca85041e3f83cbdc55dc813bcf8f1 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/QuotientTiling.lean @@ -0,0 +1,75 @@ +import OAI.Geometry.PeriodicTiling.TilingBasic + +namespace OAI + +universe uG uH + +namespace PeriodicTilingThree + +section + +variable {G : Type uG} {H : Type uH} [AddCommGroup G] [AddCommGroup H] [DecidableEq H] + +theorem tiles_preimage_of_section (φ : G →+ H) + {U : Finset G} {F : Finset H} {A : Set H} + (himage : U.image φ = F) (hinj : Set.InjOn φ (U : Set G)) + (h : Tiles F A) : Tiles U (φ ⁻¹' A) := by + classical + apply tiles_iff_unique_tile.mpr + intro g + obtain ⟨f, hf, huniq⟩ := tiles_iff_unique_tile.mp h (φ g) + have hfimage : (f : H) ∈ U.image φ := by + rw [himage] + exact f.property + obtain ⟨u, hu, huf⟩ := Finset.mem_image.mp hfimage + refine ⟨⟨u, hu⟩, ?_, ?_⟩ + · change φ (g - u) ∈ A + simpa only [map_sub, huf] using hf + · intro v hv + have hvF : φ (v : G) ∈ F := by + rw [← himage] + exact Finset.mem_image.mpr ⟨v, v.property, rfl⟩ + have hvA : φ g - φ (v : G) ∈ A := by + simpa only [Set.mem_preimage, map_sub] using hv + have hvf : (⟨φ (v : G), hvF⟩ : ↥F) = f := huniq _ hvA + apply Subtype.ext + apply hinj v.property hu + exact (congrArg Subtype.val hvf).trans huf.symm + +theorem tiles_image_of_kernel_periods (φ : G →+ H) + (hφ : Function.Surjective φ) {U : Finset G} {B : Set G} + (h : Tiles U B) (hker : ∀ k ∈ φ.ker, Period B k) : + Tiles (U.image φ) (φ '' B) := by + classical + apply tiles_iff_unique_tile.mpr + intro y + obtain ⟨g, hg⟩ := hφ y + obtain ⟨u, hu, huniq⟩ := tiles_iff_unique_tile.mp h g + have hfu : φ (u : G) ∈ U.image φ := + Finset.mem_image.mpr ⟨u, u.property, rfl⟩ + refine ⟨⟨φ (u : G), hfu⟩, ?_, ?_⟩ + · refine ⟨g - (u : G), hu, ?_⟩ + simp only [map_sub, hg] + · intro f hf + obtain ⟨v, hv, hvf⟩ := Finset.mem_image.mp f.property + obtain ⟨b, hb, hbf⟩ := hf + have hgvb : φ (g - v - b) = 0 := by + simp only [map_sub, hg, hvf, hbf, sub_self] + have hk : g - v - b ∈ φ.ker := hgvb + have hgv : g - v ∈ B := by + have hp := (hker (g - v - b) hk b).mpr hb + have heq : b + (g - v - b) = g - v := by + rw [add_comm, sub_add_cancel] + rw [heq] at hp + exact hp + have hvu : (⟨v, hv⟩ : ↥U) = u := huniq _ hgv + apply Subtype.ext + calc + (f : H) = φ v := hvf.symm + _ = φ (u : G) := congrArg φ (congrArg Subtype.val hvu) + +end + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/RationalPolynomialPeriod.lean b/lean/OAI/Geometry/PeriodicTiling/RationalPolynomialPeriod.lean new file mode 100644 index 0000000000000000000000000000000000000000..0f7a5b067924f5d0ba85b80032e16ffec41e7d32 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/RationalPolynomialPeriod.lean @@ -0,0 +1,169 @@ +import Mathlib.Algebra.BigOperators.Group.Finset.Piecewise +import Mathlib.Algebra.Ring.GeomSum +import Mathlib.Algebra.Order.BigOperators.Ring.Finset +import Mathlib.Algebra.Polynomial.Degree.Lemmas +import Mathlib.NumberTheory.Real.Irrational +import Mathlib.Topology.Instances.AddCircle.Defs + +namespace OAI + +universe uι + +noncomputable section + +open scoped BigOperators + +namespace PeriodicTilingThree + +private theorem finite_common_denominator {ι : Type uι} (s : Finset ι) (c : ι → ℝ) + (hc : ∀ i ∈ s, ∃ q : ℚ, c i = (q : ℝ)) : + ∃ a : ℕ, 0 < a ∧ ∀ i ∈ s, ∃ z : ℤ, c i * (a : ℝ) = (z : ℝ) := by + classical + let q : s → ℚ := fun i => Classical.choose (hc i.1 i.2) + have hq : ∀ i : s, c i.1 = (q i : ℝ) := fun i => Classical.choose_spec (hc i.1 i.2) + let a : ℕ := ∏ i : s, (q i).den + refine ⟨a, Finset.prod_pos (fun i _ => (q i).den_pos), ?_⟩ + intro i hi + let j : s := ⟨i, hi⟩ + have hj : (q j).den ∣ a := Finset.dvd_prod_of_mem _ (Finset.mem_univ j) + obtain ⟨b, hb⟩ := hj + refine ⟨(q j).num * (b : ℤ), ?_⟩ + have hiq : c i = (q j : ℝ) := hq j + have hden : ((q j).den : ℝ) ≠ 0 := Nat.cast_ne_zero.mpr (q j).den_ne_zero + rw [hiq, hb, Nat.cast_mul, ← mul_assoc, Rat.cast_def, + div_mul_cancel₀ _ hden, + Int.cast_mul, Int.cast_natCast] + +private theorem circle_eval_eq_sum (P : Polynomial ℝ) (x : ℝ) : + ((P.eval x : ℝ) : AddCircle (1 : ℝ)) = + ∑ i ∈ P.support, ((P.coeff i * x ^ i : ℝ) : AddCircle (1 : ℝ)) := by + change (QuotientAddGroup.mk' (AddSubgroup.zmultiples (1 : ℝ))) (P.eval x) = _ + rw [Polynomial.eval_eq_sum, Polynomial.sum_def, map_sum] + simp only [QuotientAddGroup.mk'_apply] + +private theorem circle_monomial_add_period (c : ℝ) (a : ℕ) (z : ℤ) + (hc : c * (a : ℝ) = (z : ℝ)) (i : ℕ) (n : ℤ) : + ((c * ((n + (a : ℤ) : ℤ) : ℝ) ^ i : ℝ) : AddCircle (1 : ℝ)) = + ((c * (n : ℝ) ^ i : ℝ) : AddCircle (1 : ℝ)) := by + apply sub_eq_zero.mp + rw [← AddCircle.coe_sub] + apply (AddCircle.coe_eq_zero_iff (1 : ℝ)).mpr + have hdiv : (a : ℤ) ∣ (n + (a : ℤ)) ^ i - n ^ i := by + simpa using sub_dvd_pow_sub_pow (n + (a : ℤ)) n i + obtain ⟨k, hk⟩ := hdiv + refine ⟨z * k, ?_⟩ + have hk' : (((n + (a : ℤ) : ℤ) : ℝ) ^ i - (n : ℝ) ^ i) = + (a : ℝ) * (k : ℝ) := by + exact_mod_cast hk + rw [← mul_sub, hk', ← mul_assoc, hc] + simp only [zsmul_eq_mul, mul_one, Int.cast_mul] + +theorem rational_nonconstant_circlePolynomial_periodic (P : Polynomial ℝ) + (hP : ∀ i : ℕ, 0 < i → ∃ q : ℚ, P.coeff i = (q : ℝ)) : + ∃ q : ℕ, 0 < q ∧ ∀ n : ℤ, + ((P.eval ((n + (q : ℤ) : ℤ) : ℝ) : ℝ) : AddCircle (1 : ℝ)) = + ((P.eval (n : ℝ) : ℝ) : AddCircle (1 : ℝ)) := by + classical + obtain ⟨a, ha, hcoeff⟩ := finite_common_denominator (P.support.erase 0) P.coeff + (fun i hi => hP i (Nat.pos_of_ne_zero (Finset.mem_erase.mp hi).1)) + refine ⟨a, ha, ?_⟩ + intro n + rw [circle_eval_eq_sum, circle_eval_eq_sum] + apply Finset.sum_congr rfl + intro i hi + by_cases hi0 : i = 0 + · simp only [hi0, pow_zero, mul_one] + · obtain ⟨z, hz⟩ := hcoeff i (Finset.mem_erase.mpr ⟨hi0, hi⟩) + exact circle_monomial_add_period (P.coeff i) a z hz i n + +private theorem circle_monomial_scaled_eq_zero (c : ℝ) (a : ℕ) (z : ℤ) + (hc : c * (a : ℝ) = (z : ℝ)) (i : ℕ) (hi : 0 < i) (n : ℕ) : + ((c * ((a * n : ℕ) : ℝ) ^ i : ℝ) : AddCircle (1 : ℝ)) = 0 := by + obtain ⟨k, rfl⟩ := Nat.exists_eq_succ_of_ne_zero hi.ne' + apply (AddCircle.coe_eq_zero_iff (1 : ℝ)).mpr + refine ⟨z * (a : ℤ) ^ k * (n : ℤ) ^ (k + 1), ?_⟩ + have hmul : c * ((a * n : ℕ) : ℝ) ^ (k + 1) = + (z : ℝ) * (a : ℝ) ^ k * (n : ℝ) ^ (k + 1) := by + calc + _ = (c * (a : ℝ)) * ((a : ℝ) ^ k * (n : ℝ) ^ (k + 1)) := by + rw [Nat.cast_mul, mul_pow, pow_succ] + ring + _ = _ := by rw [hc]; ring + simpa only [zsmul_eq_mul, mul_one, Int.cast_mul, Int.cast_pow, Int.cast_natCast] + using hmul.symm + +theorem exists_progression_irrational_leadingCoeff (P : Polynomial ℝ) + (hP : ∃ i : ℕ, 0 < i ∧ Irrational (P.coeff i)) : + ∃ a : ℕ, 0 < a ∧ ∃ Q : Polynomial ℝ, + 0 < Q.natDegree ∧ Irrational Q.leadingCoeff ∧ ∀ n : ℕ, + ((P.eval ((a * n : ℕ) : ℝ) : ℝ) : AddCircle (1 : ℝ)) = + ((Q.eval (n : ℝ) : ℝ) : AddCircle (1 : ℝ)) := by + classical + let s := P.support.filter fun i => 0 < i ∧ Irrational (P.coeff i) + have hs : s.Nonempty := by + obtain ⟨i, hi, hirr⟩ := hP + exact ⟨i, Finset.mem_filter.mpr ⟨Polynomial.mem_support_iff.mpr hirr.ne_zero, hi, hirr⟩⟩ + let d := s.max' hs + have hdmem : d ∈ s := Finset.max'_mem s hs + have hdpos : 0 < d := (Finset.mem_filter.mp hdmem).2.1 + have hdirr : Irrational (P.coeff d) := (Finset.mem_filter.mp hdmem).2.2 + have hrat : ∀ j : ℕ, d < j → ∃ q : ℚ, P.coeff j = (q : ℝ) := by + intro j hj + have hnot : ¬ Irrational (P.coeff j) := by + intro hirr + have hjmem : j ∈ s := Finset.mem_filter.mpr + ⟨Polynomial.mem_support_iff.mpr hirr.ne_zero, hdpos.trans hj, hirr⟩ + exact (not_le_of_gt hj) (Finset.le_max' s j hjmem) + simpa only [Irrational, Set.mem_range, not_not, eq_comm] using hnot + obtain ⟨a, ha, hcoeff⟩ := + finite_common_denominator (P.support.filter fun i => d < i) P.coeff + (fun i hi => hrat i (Finset.mem_filter.mp hi).2) + let t := P.support.filter fun i => i ≤ d + let Q : Polynomial ℝ := + ∑ i ∈ t, Polynomial.monomial i (P.coeff i * (a : ℝ) ^ i) + have hQcoeff : ∀ j : ℕ, Q.coeff j = + if j ∈ t then P.coeff j * (a : ℝ) ^ j else 0 := by + intro j + simp only [Q, Polynomial.finsetSum_coeff, Polynomial.coeff_monomial, + Finset.sum_ite_eq'] + have hdmemt : d ∈ t := Finset.mem_filter.mpr + ⟨Polynomial.mem_support_iff.mpr hdirr.ne_zero, le_rfl⟩ + have hQirr : Irrational (Q.coeff d) := by + rw [hQcoeff, ite_eq_left hdmemt] + simpa only [Nat.cast_pow] using hdirr.mul_natCast (pow_ne_zero d ha.ne') + have hQdeg : Q.natDegree = d := by + apply Polynomial.natDegree_eq_of_le_of_coeff_ne_zero _ hQirr.ne_zero + apply Polynomial.natDegree_le_iff_coeff_eq_zero.mpr + intro j hj + rw [hQcoeff, ite_eq_right] + intro hjmem + exact (not_le_of_gt hj) (Finset.mem_filter.mp hjmem).2 + refine ⟨a, ha, Q, hQdeg.symm ▸ hdpos, ?_, ?_⟩ + · simpa only [Polynomial.leadingCoeff, hQdeg] using hQirr + · intro n + have hQeval : ((Q.eval (n : ℝ) : ℝ) : AddCircle (1 : ℝ)) = + ∑ i ∈ t, ((P.coeff i * ((a * n : ℕ) : ℝ) ^ i : ℝ) : AddCircle (1 : ℝ)) := by + simp only [Q, Polynomial.eval_finsetSum, Polynomial.eval_monomial] + change (QuotientAddGroup.mk' (AddSubgroup.zmultiples (1 : ℝ))) + (∑ i ∈ t, (P.coeff i * (a : ℝ) ^ i) * (n : ℝ) ^ i) = _ + rw [map_sum] + simp only [QuotientAddGroup.mk'_apply] + apply Finset.sum_congr rfl + intro i hi + congr 1 + rw [Nat.cast_mul, mul_pow] + ring + rw [circle_eval_eq_sum, hQeval] + symm + apply Finset.sum_subset (Finset.filter_subset _ _) + intro i hi hit + have hdi : d < i := lt_of_not_ge fun hid => + hit (Finset.mem_filter.mpr ⟨hi, hid⟩) + obtain ⟨z, hz⟩ := hcoeff i (Finset.mem_filter.mpr ⟨hi, hdi⟩) + exact circle_monomial_scaled_eq_zero (P.coeff i) a z hz i (hdpos.trans hdi) n + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/ResidueCoordinates.lean b/lean/OAI/Geometry/PeriodicTiling/ResidueCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..0cc8048eaa078ce6fb093f759fae571e5bddc52a --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/ResidueCoordinates.lean @@ -0,0 +1,145 @@ +import OAI.Geometry.PeriodicTiling.TilingBasic +import Mathlib.Data.ZMod.Basic +import Mathlib.Data.Int.Interval +import Mathlib.Data.Fintype.BigOperators +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Ring + +namespace OAI + +namespace PeriodicTilingThree + +abbrev Residue3 (m : ℕ) := Fin 3 → ZMod m +abbrev LiftAlphabet := Fin 3 → Fin 5 +abbrev LiftAssignment (m : ℕ) := Residue3 m → LiftAlphabet + +def residueMod (m : ℕ) (d : Lattice 3) : Residue3 m := fun i => (d i : ZMod m) + +def can {m : ℕ} (v : Residue3 m) : Lattice 3 := fun i => ((v i).val : ℤ) + +def signed (h : LiftAlphabet) : Lattice 3 := fun i => (h i).val - (2 : ℤ) + +def representative (m : ℕ) [NeZero m] (ω : LiftAssignment m) + (v : Residue3 m) : Lattice 3 := + fun i => can v i + (m : ℤ) * signed (ω v) i + +@[simp] theorem residueMod_can {m : ℕ} [NeZero m] (v : Residue3 m) : + residueMod m (can v) = v := by + funext i + simp [residueMod, can] + +@[simp] theorem representative_residue (m : ℕ) [NeZero m] + (ω : LiftAssignment m) (v : Residue3 m) : + residueMod m (representative m ω v) = v := by + funext i + simp [residueMod, representative, can] + +theorem representative_injective (m : ℕ) [NeZero m] (ω : LiftAssignment m) : + Function.Injective (representative m ω) := by + intro u v huv + have h := congrArg (residueMod m) huv + simpa only [representative_residue] using h + +theorem can_nonneg {m : ℕ} (v : Residue3 m) (i : Fin 3) : 0 ≤ can v i := by + dsimp only [can] + exact_mod_cast (Nat.zero_le (v i).val) + +theorem can_lt {m : ℕ} [NeZero m] (v : Residue3 m) (i : Fin 3) : + can v i < (m : ℤ) := by + dsimp only [can] + exact_mod_cast (v i).val_lt + +theorem signed_bounds (h : LiftAlphabet) (i : Fin 3) : + -2 ≤ signed h i ∧ signed h i ≤ 2 := by + have hi := (h i).isLt + dsimp [signed] + omega + +def Requested (m : ℕ) (d : Lattice 3) : Prop := + (∀ i, |d i| ≤ (m : ℤ)) ∧ ¬ ∀ i, (m : ℤ) ∣ d i + +noncomputable def requestedVectors (m : ℕ) : Finset (Lattice 3) := by + classical + exact (Fintype.piFinset (fun _ : Fin 3 => Finset.Icc (-(m : ℤ)) (m : ℤ))).filter + (fun d => ¬ ∀ i, (m : ℤ) ∣ d i) + +@[simp] theorem mem_requestedVectors {m : ℕ} {d : Lattice 3} : + d ∈ requestedVectors m ↔ Requested m d := by + classical + simp only [requestedVectors, Finset.mem_filter, Fintype.mem_piFinset, + Finset.mem_Icc, Requested, abs_le] + +theorem card_requestedVectors_le (m : ℕ) : + (requestedVectors m).card ≤ (2 * m + 1) ^ 3 := by + classical + have hc : (Finset.Icc (-(m : ℤ)) (m : ℤ)).card = 2 * m + 1 := by + rw [Int.card_Icc] + omega + calc + (requestedVectors m).card ≤ + (Fintype.piFinset (fun _ : Fin 3 => Finset.Icc (-(m : ℤ)) (m : ℤ))).card := + Finset.card_filter_le _ _ + _ = (2 * m + 1) ^ 3 := by rw [Fintype.card_piFinset_const, hc] + +theorem requested_residueMod_ne_zero {m : ℕ} {d : Lattice 3} + (hd : Requested m d) : residueMod m d ≠ 0 := by + intro h + apply hd.2 + intro i + apply (ZMod.intCast_zmod_eq_zero_iff_dvd (d i) m).mp + exact congrFun h i + +theorem requested_successor_ne {m : ℕ} {d : Lattice 3} + (hd : Requested m d) (u : Residue3 m) : u + residueMod m d ≠ u := by + intro h + apply requested_residueMod_ne_zero hd + apply add_left_cancel (a := u) + simpa using h + +theorem card_residue3 (m : ℕ) [NeZero m] : Fintype.card (Residue3 m) = m ^ 3 := by + simp [Residue3] + +theorem card_liftAlphabet : Fintype.card LiftAlphabet = 125 := by + norm_num [LiftAlphabet] + +theorem card_liftAlphabet_pairs : Fintype.card (LiftAlphabet × LiftAlphabet) = 15625 := by + norm_num [Fintype.card_prod, card_liftAlphabet] + +def liftDifference (m : ℕ) (d : Lattice 3) (u v : Residue3 m) : Lattice 3 := + fun i => (d i - (can v i - can u i)) / (m : ℤ) + +theorem liftDifference_eq {m : ℕ} [NeZero m] {d : Lattice 3} {u v : Residue3 m} + (hv : v = u + residueMod m d) (i : Fin 3) : + (m : ℤ) * liftDifference m d u v i = d i - (can v i - can u i) := by + apply Int.mul_ediv_cancel' + apply (ZMod.intCast_zmod_eq_zero_iff_dvd _ m).mp + have hvi := congrFun hv i + change v i = u i + (d i : ZMod m) at hvi + simp only [Int.cast_sub, can, Int.cast_natCast, ZMod.natCast_zmod_val] + rw [hvi] + ring + +theorem liftDifference_bounds {m : ℕ} [NeZero m] {d : Lattice 3} {u v : Residue3 m} + (hd : Requested m d) (hv : v = u + residueMod m d) (i : Fin 3) : + -1 ≤ liftDifference m d u v i ∧ liftDifference m d u v i ≤ 1 := by + have hm : (0 : ℤ) < m := by exact_mod_cast Nat.pos_of_ne_zero (NeZero.ne m) + have hdu := (abs_le.mp (hd.1 i)).1 + have hdv := (abs_le.mp (hd.1 i)).2 + have hu0 := can_nonneg u i + have hv0 := can_nonneg v i + have hum := can_lt u i + have hvm := can_lt v i + have heq := liftDifference_eq hv i + constructor + · by_contra h + have hz : liftDifference m d u v i ≤ -2 := by omega + have hmz := mul_le_mul_of_nonneg_left hz (le_of_lt hm) + nlinarith + · by_contra h + have hz : 2 ≤ liftDifference m d u v i := by omega + have hmz := mul_le_mul_of_nonneg_left hz (le_of_lt hm) + nlinarith + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/ResidueCountBound.lean b/lean/OAI/Geometry/PeriodicTiling/ResidueCountBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..6cee7ebf5ca31f3468889d250e0c944c842ef77f --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/ResidueCountBound.lean @@ -0,0 +1,80 @@ +import Mathlib.Algebra.Order.Field.Rat +import Mathlib.Algebra.Order.GroupWithZero.Basic +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Ring + +namespace OAI + +namespace PeriodicTilingThree + +theorem one_sub_pow_mul_linear_le_one (c : ℚ) (_hc0 : 0 ≤ c) (hc1 : c ≤ 1) + (r : ℕ) : (1 - c) ^ r * (1 + (r : ℚ) * c) ≤ 1 := by + induction r with + | zero => simp + | succ r ih => + have hstep : (1 - c) * (1 + ((r : ℚ) + 1) * c) ≤ 1 + (r : ℚ) * c := by + calc + (1 - c) * (1 + ((r : ℚ) + 1) * c) = + (1 + (r : ℚ) * c) - ((r : ℚ) + 1) * c ^ 2 := by ring + _ ≤ 1 + (r : ℚ) * c := + sub_le_self _ (mul_nonneg (add_nonneg (Nat.cast_nonneg r) zero_le_one) + (sq_nonneg c)) + calc + (1 - c) ^ (r + 1) * (1 + ((r + 1 : ℕ) : ℚ) * c) = + (1 - c) ^ r * ((1 - c) * (1 + ((r : ℚ) + 1) * c)) := by + rw [pow_succ, Nat.cast_add, Nat.cast_one] + ring + _ ≤ (1 - c) ^ r * (1 + (r : ℚ) * c) := + mul_le_mul_of_nonneg_left hstep (pow_nonneg (sub_nonneg.mpr hc1) r) + _ ≤ 1 := ih + +private theorem scalar_half_bound (x c : ℚ) (hx : 0 ≤ x) + (hc : (1 : ℚ) / 1000 ≤ c) (h : x * (1 + 1000 * c) ≤ 1) : x ≤ 1 / 2 := by + have htwo : (2 : ℚ) ≤ 1 + 1000 * c := by linarith only [hc] + apply (le_div_iff₀ (by norm_num : (0 : ℚ) < 2)).mpr + exact (mul_le_mul_of_nonneg_left htwo hx).trans h + +theorem residue_block_bound (c : ℚ) (hc0 : 0 ≤ c) (hc1 : c ≤ 1) + (hc : (1 : ℚ) / 1000 ≤ c) : (1 - c) ^ 1000 ≤ 1 / 2 := by + apply scalar_half_bound ((1 - c) ^ 1000) c + (pow_nonneg (sub_nonneg.mpr hc1) 1000) hc + exact one_sub_pow_mul_linear_le_one c hc0 hc1 1000 + +theorem residue_failure_block_bound : ((15598 : ℚ) / 15625) ^ 1000 ≤ 1 / 2 := by + have h := residue_block_bound ((27 : ℚ) / 15625) (by norm_num) + (by norm_num) (by norm_num) + have heq : (1 : ℚ) - 27 / 15625 = 15598 / 15625 := by norm_num + rw [heq] at h + exact h + +private theorem union_bound_from_block (p : ℚ) (hp : 0 ≤ p) + (hblock : p ^ 1000 ≤ 1 / 2) : (129 : ℚ) ^ 3 * p ^ 32000 < 1 := by + have hblocks : p ^ 32000 ≤ ((1 : ℚ) / 2) ^ 32 := by + rw [show (32000 : ℕ) = 1000 * 32 by norm_num, pow_mul] + exact pow_le_pow_left₀ (a := p ^ 1000) (b := (1 : ℚ) / 2) + (pow_nonneg hp 1000) hblock 32 + calc + (129 : ℚ) ^ 3 * p ^ 32000 ≤ + (129 : ℚ) ^ 3 * ((1 : ℚ) / 2) ^ 32 := + mul_le_mul_of_nonneg_left hblocks (by norm_num) + _ < 1 := by norm_num + +theorem residue_union_bound_32000 : + (129 : ℚ) ^ 3 * ((15598 : ℚ) / 15625) ^ 32000 < 1 := by + exact union_bound_from_block ((15598 : ℚ) / 15625) (by norm_num) + residue_failure_block_bound + +theorem residue_union_bound_of_large_exponent {k : ℕ} (hk : 32000 ≤ k) : + (129 : ℚ) ^ 3 * ((15598 : ℚ) / 15625) ^ k < 1 := by + apply lt_of_le_of_lt _ residue_union_bound_32000 + exact mul_le_mul_of_nonneg_left + (pow_le_pow_of_le_one (by norm_num) (by norm_num) hk) (by norm_num) + +theorem residue_cube_64 : (64 : ℕ) ^ 3 = 262144 := by norm_num + +theorem residue_matching_budget_64 : 32000 ≤ (64 : ℕ) ^ 3 / 3 - 1 := by + norm_num + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/ResidueLiftPairs.lean b/lean/OAI/Geometry/PeriodicTiling/ResidueLiftPairs.lean new file mode 100644 index 0000000000000000000000000000000000000000..71b4af255932ab0557d0a9029dff1e23b71997c8 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/ResidueLiftPairs.lean @@ -0,0 +1,111 @@ +import OAI.Geometry.PeriodicTiling.ResidueCoordinates + +namespace OAI + +universe uA uB + +namespace PeriodicTilingThree + +noncomputable def PairGood (m : ℕ) (d : Lattice 3) (u v : Residue3 m) : + Finset (LiftAlphabet × LiftAlphabet) := by + classical + exact Finset.univ.filter (fun p => ∀ i, + can v i + (m : ℤ) * signed p.2 i - (can u i + (m : ℤ) * signed p.1 i) = d i) + +@[simp] theorem mem_PairGood {m : ℕ} {d : Lattice 3} {u v : Residue3 m} + {p : LiftAlphabet × LiftAlphabet} : + p ∈ PairGood m d u v ↔ ∀ i, + can v i + (m : ℤ) * signed p.2 i - (can u i + (m : ℤ) * signed p.1 i) = d i := by + classical + simp only [PairGood, Finset.mem_filter, Finset.mem_univ, true_and] + +theorem pairGood_assignment_iff {m : ℕ} [NeZero m] {d : Lattice 3} + (ω : LiftAssignment m) (u v : Residue3 m) : + (ω u, ω v) ∈ PairGood m d u v ↔ representative m ω v - representative m ω u = d := by + rw [mem_PairGood, funext_iff] + rfl + +private def coordinateLiftPair (z : ℤ) (hz : -2 ≤ z ∧ z ≤ 2) (j : Fin 3) : + Fin 5 × Fin 5 := + (⟨j.val + (-z).toNat, by have hj := j.isLt; omega⟩, + ⟨j.val + z.toNat, by have hj := j.isLt; omega⟩) + +private theorem coordinateLiftPair_difference (z : ℤ) (hz : -2 ≤ z ∧ z ≤ 2) + (j : Fin 3) : + ((coordinateLiftPair z hz j).2.val : ℤ) - (coordinateLiftPair z hz j).1.val = z := by + dsimp [coordinateLiftPair] + omega + +private theorem coordinateLiftPair_injective (z : ℤ) (hz : -2 ≤ z ∧ z ≤ 2) : + Function.Injective (coordinateLiftPair z hz) := by + intro a b hab + apply Fin.ext + have h := congrArg (fun p : Fin 5 × Fin 5 => p.1.val) hab + dsimp [coordinateLiftPair] at h + exact Nat.add_right_cancel h + +private def liftPairForDifference (z : Lattice 3) (hz : ∀ i, -2 ≤ z i ∧ z i ≤ 2) + (a : Fin 3 → Fin 3) : LiftAlphabet × LiftAlphabet := + (fun i => (coordinateLiftPair (z i) (hz i) (a i)).1, + fun i => (coordinateLiftPair (z i) (hz i) (a i)).2) + +private theorem liftPairForDifference_injective (z : Lattice 3) + (hz : ∀ i, -2 ≤ z i ∧ z i ≤ 2) : Function.Injective (liftPairForDifference z hz) := by + intro a b hab + funext i + apply coordinateLiftPair_injective (z i) (hz i) + apply Prod.ext + · exact congrArg (fun p : LiftAlphabet × LiftAlphabet => p.1 i) hab + · exact congrArg (fun p : LiftAlphabet × LiftAlphabet => p.2 i) hab + +private theorem liftPairForDifference_signed_sub (z : Lattice 3) + (hz : ∀ i, -2 ≤ z i ∧ z i ≤ 2) (a : Fin 3 → Fin 3) (i : Fin 3) : + signed (liftPairForDifference z hz a).2 i - + signed (liftPairForDifference z hz a).1 i = z i := by + have h := coordinateLiftPair_difference (z i) (hz i) (a i) + dsimp [signed, liftPairForDifference] + omega + +private theorem card_le_finset_of_injective {A : Type uA} {B : Type uB} [Fintype A] + (s : Finset B) (f : A → B) (hfinj : Function.Injective f) + (hmem : ∀ a, f a ∈ s) : Fintype.card A ≤ s.card := by + classical + let g : A → ↥s := fun a => ⟨f a, hmem a⟩ + have hginj : Function.Injective g := by + intro a b hab + exact hfinj (congrArg Subtype.val hab) + have hc := Fintype.card_le_of_injective g hginj + simpa only [Fintype.card_coe] using hc + +theorem card_PairGood_ge {m : ℕ} [NeZero m] {d : Lattice 3} {u v : Residue3 m} + (hd : Requested m d) (hv : v = u + residueMod m d) : + 27 ≤ (PairGood m d u v).card := by + classical + let z := liftDifference m d u v + have hz : ∀ i, -2 ≤ z i ∧ z i ≤ 2 := by + intro i + have h := liftDifference_bounds hd hv i + change -2 ≤ liftDifference m d u v i ∧ liftDifference m d u v i ≤ 2 + omega + let f : (Fin 3 → Fin 3) → LiftAlphabet × LiftAlphabet := liftPairForDifference z hz + have hfinj : Function.Injective f := liftPairForDifference_injective z hz + have hf : ∀ a, f a ∈ PairGood m d u v := by + intro a + rw [mem_PairGood] + intro i + have hdiff := liftPairForDifference_signed_sub z hz a i + have hcarry := liftDifference_eq hv i + change (m : ℤ) * z i = d i - (can v i - can u i) at hcarry + change can v i + (m : ℤ) * signed (liftPairForDifference z hz a).2 i - + (can u i + (m : ℤ) * signed (liftPairForDifference z hz a).1 i) = d i + rw [← hdiff] at hcarry + nlinarith + generalize hS : PairGood m d u v = S at hf ⊢ + have hc : Fintype.card (Fin 3 → Fin 3) ≤ S.card := + card_le_finset_of_injective S f hfinj hf + have h27 : Fintype.card (Fin 3 → Fin 3) = 27 := by norm_num + rwa [h27] at hc + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/ResidueTransversal.lean b/lean/OAI/Geometry/PeriodicTiling/ResidueTransversal.lean new file mode 100644 index 0000000000000000000000000000000000000000..72a96bf45cbbf9aa83f6aae6d6c88e5b3d636576 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/ResidueTransversal.lean @@ -0,0 +1,199 @@ +import OAI.Geometry.PeriodicTiling.ResidueLiftPairs +import OAI.Geometry.PeriodicTiling.ResidueCountBound +import OAI.Geometry.PeriodicTiling.DisjointSuccessorPairs +import OAI.Geometry.PeriodicTiling.FinitePairRatio +import OAI.Geometry.PeriodicTiling.FiniteEventUnion +import OAI.Geometry.PeriodicTiling.MarkedTile +import Mathlib.Tactic.Push + +namespace OAI + +universe uV uC uI + +namespace PeriodicTilingThree + +open scoped Classical + +private def residueSuccessor (m : ℕ) (d : Lattice 3) : Equiv.Perm (Residue3 m) where + toFun u := u + residueMod m d + invFun u := u - residueMod m d + left_inv u := add_sub_cancel_right u _ + right_inv u := sub_add_cancel u _ + +private theorem exists_residue_pairs + {D : Finset (Lattice 3)} (hD : ∀ d, d ∈ D ↔ Requested 64 d) (d : ↥D) : + ∃ pair : (Fin 32000 × Fin 2) ↪ Residue3 64, + (∀ j, pair (j, 1) = pair (j, 0) + residueMod 64 d.1) ∧ + ∀ x, pair x ≠ 0 := by + have hd : Requested 64 d.1 := (hD d.1).mp d.2 + exact exists_disjoint_successor_pairs (residueSuccessor 64 d.1) + (requested_successor_ne hd) 0 32000 (by rw [card_residue3]; norm_num) + +private noncomputable def residuePairs + {D : Finset (Lattice 3)} (hD : ∀ d, d ∈ D ↔ Requested 64 d) (d : ↥D) : + (Fin 32000 × Fin 2) ↪ Residue3 64 := + Classical.choose (exists_residue_pairs hD d) + +private theorem residuePairs_step + {D : Finset (Lattice 3)} (hD : ∀ d, d ∈ D ↔ Requested 64 d) + (d : ↥D) (j : Fin 32000) : + residuePairs hD d (j, 1) = residuePairs hD d (j, 0) + residueMod 64 d.1 := + (Classical.choose_spec (exists_residue_pairs hD d)).1 j + +private theorem residuePairs_ne_zero + {D : Finset (Lattice 3)} (hD : ∀ d, d ∈ D ↔ Requested 64 d) + (d : ↥D) (x : Fin 32000 × Fin 2) : residuePairs hD d x ≠ 0 := + (Classical.choose_spec (exists_residue_pairs hD d)).2 x + +private noncomputable def residuePairGood + {D : Finset (Lattice 3)} (hD : ∀ d, d ∈ D ↔ Requested 64 d) + (d : ↥D) (j : Fin 32000) : Finset (LiftAlphabet × LiftAlphabet) := + PairGood 64 d.1 (residuePairs hD d (j, 0)) (residuePairs hD d (j, 1)) + +private theorem normalized_bad_assignment_ratio + {V : Type uV} {C : Type uC} [Fintype V] [Fintype C] {k : ℕ} + (pair : (Fin k × Fin 2) ↪ V) (Good : Fin k → Finset (C × C)) + (Bad : Finset (V → C)) (hBad : Bad = allBadAssignments pair Good) + (N : ℕ) (hN : N = Fintype.card C ^ Fintype.card V) + (hC : Fintype.card C = 125) (hgood : ∀ j, 27 ≤ (Good j).card) : + (Bad.card : ℚ) / (N : ℚ) ≤ ((15598 : ℚ) / 15625) ^ k := by + have hCpos : 0 < Fintype.card C := by rw [hC]; norm_num + have hg : 27 ≤ Fintype.card C ^ 2 := by rw [hC]; norm_num + have heq : (1 : ℚ) - ((27 : ℕ) : ℚ) / (Fintype.card C : ℚ) ^ 2 = + 15598 / 15625 := by + rw [hC] + norm_num + have h := allBadAssignments_card_ratio_le pair Good 27 hCpos hg hgood + rw [Fintype.card_fun, ← hN, ← hBad, heq] at h + exact h + +private theorem residuePairGood_card + {D : Finset (Lattice 3)} (hD : ∀ d, d ∈ D ↔ Requested 64 d) + (d : ↥D) (j : Fin 32000) : 27 ≤ (residuePairGood hD d j).card := by + have hd : Requested 64 d.1 := (hD d.1).mp d.2 + exact card_PairGood_ge (m := 64) (d := d.1) + (u := residuePairs hD d (j, 0)) (v := residuePairs hD d (j, 1)) + hd (residuePairs_step hD d j) + +private theorem representative_difference_of_pairGood {m : ℕ} [NeZero m] + (ω : LiftAssignment m) (d : Lattice 3) (u v : Residue3 m) : + (ω u, ω v) ∈ PairGood m d u v → + representative m ω v - representative m ω u = d := by + have hiff := pairGood_assignment_iff (m := m) (d := d) ω u v + generalize hset : PairGood m d u v = S at hiff ⊢ + exact hiff.mp + +private theorem exists_good_pair {V : Type uV} {C : Type uC} [Fintype V] [Fintype C] {k : ℕ} + (pair : (Fin k × Fin 2) ↪ V) (Good : Fin k → Finset (C × C)) (ω : V → C) + (P : Fin k → Prop) + (hP : ∀ j, (ω (pair (j, 0)), ω (pair (j, 1))) ∈ Good j → P j) + (hbad : ω ∉ allBadAssignments pair Good) : ∃ j, P j := by + rw [mem_allBadAssignments] at hbad + push Not at hbad + obtain ⟨j, hj⟩ := hbad + exact ⟨j, hP j hj⟩ + +private theorem exists_simultaneous_good_pairs + {I : Type uI} {V : Type uV} {C : Type uC} [Fintype V] [Fintype C] {k : ℕ} + (events : Finset I) (pair : I → (Fin k × Fin 2) ↪ V) + (Good : I → Fin k → Finset (C × C)) + (hC : Fintype.card C = 125) (hgood : ∀ i j, 27 ≤ (Good i j).card) + (P : I → (V → C) → Fin k → Prop) + (hP : ∀ i ω j, (ω (pair i (j, 0)), ω (pair i (j, 1))) ∈ Good i j → P i ω j) + (hsmall : (events.card : ℚ) * ((15598 : ℚ) / 15625) ^ k < 1) : + ∃ ω : V → C, ∀ i ∈ events, ∃ j, P i ω j := by + classical + have hΩ : 0 < Fintype.card (V → C) := by + rw [Fintype.card_fun, hC] + exact pow_pos (by norm_num) _ + have hbound (i : I) : + ((allBadAssignments (pair i) (Good i)).card : ℚ) / + (Fintype.card (V → C) : ℚ) ≤ ((15598 : ℚ) / 15625) ^ k := by + exact normalized_bad_assignment_ratio (pair i) (Good i) + (allBadAssignments (pair i) (Good i)) rfl (Fintype.card (V → C)) + (by rw [Fintype.card_fun]) hC (hgood i) + obtain ⟨ω, hω⟩ := exists_avoiding_of_uniform_ratio_lt events + (fun i => allBadAssignments (pair i) (Good i)) + (((15598 : ℚ) / 15625) ^ k) hΩ (fun i _ => hbound i) hsmall + refine ⟨ω, ?_⟩ + intro i hi + exact exists_good_pair (pair i) (Good i) ω (P i ω) (hP i ω) (hω i hi) + +private theorem exists_rigid_assignment_of_requests + (D : Finset (Lattice 3)) (hD : ∀ d, d ∈ D ↔ Requested 64 d) + (hcardD : D.card ≤ 129 ^ 3) : + ∃ ω : LiftAssignment 64, ∀ d : Lattice 3, Requested 64 d → + ∃ u v : Residue3 64, u ≠ 0 ∧ v ≠ 0 ∧ + representative 64 ω v - representative 64 ω u = d := by + classical + have hcard : (Finset.univ : Finset ↥D).card ≤ 129 ^ 3 := by + rw [Finset.card_univ, Fintype.card_coe] + exact hcardD + have hsmall : ((Finset.univ : Finset ↥D).card : ℚ) * + ((15598 : ℚ) / 15625) ^ 32000 < 1 := by + apply lt_of_le_of_lt _ residue_union_bound_32000 + apply mul_le_mul_of_nonneg_right + · exact_mod_cast hcard + · exact pow_nonneg (by norm_num) _ + have himp (e : ↥D) (ω : LiftAssignment 64) (j : Fin 32000) : + (ω (residuePairs hD e (j, 0)), ω (residuePairs hD e (j, 1))) ∈ + residuePairGood hD e j → + representative 64 ω (residuePairs hD e (j, 1)) - + representative 64 ω (residuePairs hD e (j, 0)) = e.1 := by + dsimp only [residuePairGood] + exact representative_difference_of_pairGood (m := 64) ω e.1 + (residuePairs hD e (j, 0)) (residuePairs hD e (j, 1)) + obtain ⟨ω, hω⟩ := exists_simultaneous_good_pairs + (Finset.univ : Finset ↥D) (residuePairs hD) (residuePairGood hD) + card_liftAlphabet (residuePairGood_card hD) + (fun e ω j => representative 64 ω (residuePairs hD e (j, 1)) - + representative 64 ω (residuePairs hD e (j, 0)) = e.1) himp hsmall + refine ⟨ω, ?_⟩ + intro d hd + let e : ↥D := ⟨d, (hD d).mpr hd⟩ + obtain ⟨j, hj⟩ := hω e (Finset.mem_univ _) + exact ⟨residuePairs hD e (j, 0), residuePairs hD e (j, 1), + residuePairs_ne_zero hD e (j, 0), residuePairs_ne_zero hD e (j, 1), hj⟩ + +theorem exists_rigid_assignment64 : + ∃ ω : LiftAssignment 64, ∀ d : Lattice 3, Requested 64 d → + ∃ u v : Residue3 64, u ≠ 0 ∧ v ≠ 0 ∧ + representative 64 ω v - representative 64 ω u = d := by + exact exists_rigid_assignment_of_requests (requestedVectors 64) + (fun d => mem_requestedVectors (m := 64) (d := d)) (card_requestedVectors_le 64) + +noncomputable def rigidAssignment64 : LiftAssignment 64 := + Classical.choose exists_rigid_assignment64 + +theorem rigidAssignment64_difference (d : Lattice 3) (hd : Requested 64 d) : + ∃ u v : Residue3 64, u ≠ 0 ∧ v ≠ 0 ∧ + representative 64 rigidAssignment64 v - representative 64 rigidAssignment64 u = d := + Classical.choose_spec exists_rigid_assignment64 d hd + +noncomputable def rigidSection : MarkedTile.ResidueSection 64 where + t := representative 64 rigidAssignment64 + residue_t v := representative_residue 64 rigidAssignment64 v + +theorem rigidSection_difference (d : Lattice 3) (hd : Requested 64 d) : + ∃ u v : MarkedTile.Residue 64, u ≠ 0 ∧ v ≠ 0 ∧ rigidSection.t v - rigidSection.t u = d := + rigidAssignment64_difference d hd + +private theorem section_difference_to_Tstar {m : ℕ} [NeZero m] + (s : MarkedTile.ResidueSection m) (d : Lattice 3) + (h : ∃ u v : MarkedTile.Residue m, + u ≠ 0 ∧ v ≠ 0 ∧ s.t v - s.t u = d) : + ∃ x ∈ s.Tstar, ∃ y ∈ s.Tstar, x - y = d := by + obtain ⟨u, v, hu, hv, hdiff⟩ := h + have hvT : s.t v ∈ s.Tstar := + (s.mem_Tstar (x := s.t v)).mpr ⟨v, hv, rfl⟩ + have huT : s.t u ∈ s.Tstar := + (s.mem_Tstar (x := s.t u)).mpr ⟨u, hu, rfl⟩ + exact ⟨s.t v, hvT, s.t u, huT, hdiff⟩ + +theorem rigidSection_Tstar_difference (d : Lattice 3) (hd : Requested 64 d) : + ∃ x ∈ rigidSection.Tstar, ∃ y ∈ rigidSection.Tstar, x - y = d := by + exact section_difference_to_Tstar rigidSection d (rigidSection_difference d hd) + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/RigidSectionGeometry.lean b/lean/OAI/Geometry/PeriodicTiling/RigidSectionGeometry.lean new file mode 100644 index 0000000000000000000000000000000000000000..3c08c3bda8c4430fcf6a7107c45b638682d757fe --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/RigidSectionGeometry.lean @@ -0,0 +1,38 @@ +import OAI.Geometry.PeriodicTiling.ResidueTransversal +import OAI.Geometry.PeriodicTiling.SeparatedCenters +import Mathlib.Tactic.NormNum + +namespace OAI + +namespace PeriodicTilingThree + +theorem rigidSection_rigidDifferences : RigidDifferences 64 rigidSection.Tstar := by + intro d hbound hdiv + apply rigidSection_Tstar_difference d + refine ⟨hbound, ?_⟩ + intro hall + obtain ⟨i, hi⟩ := hdiv + exact hi (hall i) + +theorem rigidSection_Tstar_subset_T0 : rigidSection.Tstar ⊆ rigidSection.T0 := + Finset.erase_subset _ _ + +theorem rigidSection_Tstar_subset_T1 (w : Lattice 3) : + rigidSection.Tstar ⊆ rigidSection.T1 w := by + rw [rigidSection.T1_eq_insert w] + exact Finset.subset_insert _ _ + +theorem rigidSection_Tstar_nonempty : rigidSection.Tstar.Nonempty := by + apply Finset.card_pos.mp + rw [rigidSection.card_Tstar] + norm_num + +theorem rigidSection_T0_card : rigidSection.T0.card = 64 ^ 3 := + rigidSection.card_T0 + +theorem rigidSection_T1_card (w : Lattice 3) : (rigidSection.T1 w).card = 64 ^ 3 := + rigidSection.card_T1 w + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/ScalarAverage.lean b/lean/OAI/Geometry/PeriodicTiling/ScalarAverage.lean new file mode 100644 index 0000000000000000000000000000000000000000..afa7867c53c61f4398fb4bb6e160361a939e0c8b --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/ScalarAverage.lean @@ -0,0 +1,109 @@ +import Mathlib.Analysis.Complex.Basic +import Mathlib.Analysis.SpecificLimits.Normed +import Mathlib.Tactic.FieldSimp +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Positivity + +namespace OAI + +universe uE + +noncomputable section + +namespace PeriodicTilingThree + +open Finset Filter +open scoped Topology + +def complexAverage (u : ℕ → ℂ) (N : ℕ) : ℂ := + (N : ℂ)⁻¹ * ∑ n ∈ range N, u n + +def vectorAverage {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] + (u : ℕ → E) (N : ℕ) : E := + (N : ℝ)⁻¹ • ∑ n ∈ range N, u n + +theorem complexAverage_eq_vectorAverage (u : ℕ → ℂ) (N : ℕ) : + complexAverage u N = vectorAverage u N := by + simp only [complexAverage, vectorAverage, Complex.real_smul, + Complex.ofReal_inv, Complex.ofReal_natCast] + +@[simp] theorem complexAverage_zero (u : ℕ → ℂ) : complexAverage u 0 = 0 := by + simp [complexAverage] + +theorem complexAverage_add (u v : ℕ → ℂ) (N : ℕ) : + complexAverage (fun n => u n + v n) N = complexAverage u N + complexAverage v N := by + simp only [complexAverage, Finset.sum_add_distrib, mul_add] + +theorem complexAverage_sub (u v : ℕ → ℂ) (N : ℕ) : + complexAverage (fun n => u n - v n) N = complexAverage u N - complexAverage v N := by + simp only [complexAverage, Finset.sum_sub_distrib, mul_sub] + +theorem complexAverage_const (c : ℂ) {N : ℕ} (hN : N ≠ 0) : + complexAverage (fun _ => c) N = c := by + have hNc : (N : ℂ) ≠ 0 := Nat.cast_ne_zero.mpr hN + simp only [complexAverage, Finset.sum_const, Finset.card_range, nsmul_eq_mul, + ← mul_assoc, inv_mul_cancel₀ hNc, one_mul] + +theorem complexAverage_mul_const (u : ℕ → ℂ) (c : ℂ) (N : ℕ) : + complexAverage (fun n => u n * c) N = complexAverage u N * c := by + simp only [complexAverage, ← Finset.sum_mul, mul_assoc] + +theorem complexAverage_const_mul (u : ℕ → ℂ) (c : ℂ) (N : ℕ) : + complexAverage (fun n => c * u n) N = c * complexAverage u N := by + simp only [complexAverage, ← Finset.mul_sum] + ring + +theorem norm_complexAverage (u : ℕ → ℂ) (N : ℕ) : + ‖complexAverage u N‖ = (N : ℝ)⁻¹ * ‖∑ n ∈ range N, u n‖ := by + simp only [complexAverage, norm_mul, norm_inv, Complex.norm_natCast] + +theorem norm_complexAverage_le (u : ℕ → ℂ) (C : ℝ) (hC : 0 ≤ C) + (hu : ∀ n, ‖u n‖ ≤ C) (N : ℕ) : ‖complexAverage u N‖ ≤ C := by + by_cases hN : N = 0 + · simpa [hN] using hC + have hNr : (N : ℝ) ≠ 0 := Nat.cast_ne_zero.mpr hN + have hs : ‖∑ n ∈ range N, u n‖ ≤ (N : ℝ) * C := by + calc + _ ≤ ∑ n ∈ range N, ‖u n‖ := norm_sum_le _ _ + _ ≤ ∑ _n ∈ range N, C := Finset.sum_le_sum fun n _ => hu n + _ = (N : ℝ) * C := by simp + rw [norm_complexAverage] + calc + _ ≤ (N : ℝ)⁻¹ * ((N : ℝ) * C) := + mul_le_mul_of_nonneg_left hs (by positivity) + _ = C := by rw [← mul_assoc, inv_mul_cancel₀ hNr, one_mul] + +theorem norm_geometric_sum_le (z : ℂ) (hz : ‖z‖ = 1) (hz1 : z ≠ 1) (N : ℕ) : + ‖∑ n ∈ range N, z ^ n‖ ≤ 2 / ‖z - 1‖ := by + rw [geom_sum_eq hz1, norm_div] + apply div_le_div_of_nonneg_right _ (norm_nonneg _) + calc + ‖z ^ N - 1‖ ≤ ‖z ^ N‖ + ‖(1 : ℂ)‖ := norm_sub_le _ _ + _ = 2 := by norm_num [norm_pow, hz] + +theorem complexAverage_geometric_tendsto (z : ℂ) (hz : ‖z‖ = 1) (hz1 : z ≠ 1) : + Tendsto (complexAverage (fun n => z ^ n)) atTop (𝓝 0) := by + apply tendsto_zero_iff_norm_tendsto_zero.mpr + have hb : Tendsto (fun N : ℕ => (N : ℝ)⁻¹ * (2 / ‖z - 1‖)) atTop (𝓝 0) := by + simpa only [zero_mul] using + tendsto_inv_atTop_nhds_zero_nat.mul_const (2 / ‖z - 1‖) + refine squeeze_zero (fun N => norm_nonneg _) (fun N => ?_) hb + rw [norm_complexAverage] + exact mul_le_mul_of_nonneg_left (norm_geometric_sum_le z hz hz1 N) (by positivity) + +theorem complexAverage_const_mul_geometric_tendsto (c z : ℂ) + (hz : ‖z‖ = 1) (hz1 : z ≠ 1) : + Tendsto (complexAverage (fun n => c * z ^ n)) atTop (𝓝 0) := by + have hfun : complexAverage (fun n => c * z ^ n) = + fun N => c * complexAverage (fun n => z ^ n) N := by + funext N + exact complexAverage_const_mul (fun n => z ^ n) c N + rw [hfun] + simpa only [mul_zero] using + (complexAverage_geometric_tendsto z hz hz1).const_mul c + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/ScalarPolynomialPeriodicity.lean b/lean/OAI/Geometry/PeriodicTiling/ScalarPolynomialPeriodicity.lean new file mode 100644 index 0000000000000000000000000000000000000000..3fbc8588797636c2ca0a8b53ce8a980ee4d6ca17 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/ScalarPolynomialPeriodicity.lean @@ -0,0 +1,97 @@ +import OAI.Geometry.PeriodicTiling.FiniteDifferencePolynomial +import OAI.Geometry.PeriodicTiling.PolynomialWeyl +import OAI.Geometry.PeriodicTiling.RationalPolynomialPeriod + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree + +open Set Polynomial +open scoped Topology + +theorem denseRange_circlePolynomial_of_irrational_coefficient (P : Polynomial ℝ) + (hP : ∃ i : ℕ, 0 < i ∧ Irrational (P.coeff i)) : + DenseRange (fun n : ℤ => ((P.eval (n : ℝ) : ℝ) : UnitAddCircle)) := by + obtain ⟨a, ha, Q, hQ, hI, hvalues⟩ := exists_progression_irrational_leadingCoeff P hP + have hd := denseRange_circlePolynomial_of_irrational_leadingCoeff Q hQ hI + apply Dense.mono (s₁ := Set.range (fun n : ℕ => ((Q.eval (n : ℝ) : ℝ) : UnitAddCircle))) _ hd + rintro _ ⟨n, rfl⟩ + refine ⟨((a * n : ℕ) : ℤ), ?_⟩ + simpa only [Int.cast_natCast] using hvalues n + +theorem circle_polynomial_periodic_of_not_dense (f : ℤ → UnitAddCircle) + (r : ℕ) (hpoly : (forwardDiff^[r]) f = 0) (hnd : ¬ DenseRange f) : + ∃ q : ℕ, 0 < q ∧ Function.Periodic f (q : ℤ) := by + obtain ⟨P, hP⟩ := exists_polynomial_lift_of_iter_forwardDiff_eq_zero f r hpoly + have hrat : ∀ i : ℕ, 0 < i → ∃ q : ℚ, P.coeff i = (q : ℝ) := by + intro i hi + by_contra h + have hirr : Irrational (P.coeff i) := by + rintro ⟨q, hq⟩ + exact h ⟨q, hq.symm⟩ + apply hnd + have hd := denseRange_circlePolynomial_of_irrational_coefficient P ⟨i, hi, hirr⟩ + have heq : (fun n : ℤ => ((P.eval (n : ℝ) : ℝ) : UnitAddCircle)) = f := funext hP + rwa [heq] at hd + obtain ⟨q, hq, hper⟩ := rational_nonconstant_circlePolynomial_periodic P hrat + refine ⟨q, hq, ?_⟩ + intro n + rw [← hP (n + q), ← hP n] + exact hper n + +theorem circle_polynomial_periodic_of_omits_open (f : ℤ → UnitAddCircle) + (r : ℕ) (hpoly : (forwardDiff^[r]) f = 0) + (U : Set UnitAddCircle) (hU : IsOpen U) (hne : U.Nonempty) + (hmiss : ∀ n, f n ∉ U) : + ∃ q : ℕ, 0 < q ∧ Function.Periodic f (q : ℤ) := by + apply circle_polynomial_periodic_of_not_dense f r hpoly + intro hd + obtain ⟨n, hn⟩ := hd.exists_mem_open hU hne + exact hmiss n hn + +private theorem not_denseRange_circle_of_bounded_lt_one (f : ℤ → ℝ) (c : ℝ) + (h0 : ∀ n, 0 ≤ f n) (hc : ∀ n, f n ≤ c) (hc1 : c < 1) : + ¬ DenseRange (fun n => (f n : UnitAddCircle)) := by + intro hd + have hc0 : 0 ≤ c := (h0 0).trans (hc 0) + let K : Set UnitAddCircle := ((↑) : ℝ → UnitAddCircle) '' Set.Icc 0 c + have hK : IsClosed K := + (isCompact_Icc.image (AddCircle.continuous_mk' (1 : ℝ))).isClosed + have hsub : Set.range (fun n => (f n : UnitAddCircle)) ⊆ K := by + rintro _ ⟨n, rfl⟩ + exact ⟨f n, ⟨h0 n, hc n⟩, rfl⟩ + have hm : (((c + 1) / 2 : ℝ) : UnitAddCircle) ∈ K := + (closure_minimal hsub hK) (hd _) + obtain ⟨y, hy, heq⟩ := hm + have hyI : y ∈ Set.Ico (0 : ℝ) (0 + 1) := ⟨hy.1, by linarith [hy.2]⟩ + have hmI : (c + 1) / 2 ∈ Set.Ico (0 : ℝ) (0 + 1) := by + constructor <;> linarith + have hyEq : y = (c + 1) / 2 := + (AddCircle.coe_eq_coe_iff_of_mem_Ico hyI hmI).mp heq + rw [hyEq] at hy + linarith [hy.2] + +theorem real_polynomial_periodic_of_bounded_lt_one + (r : ℕ) (_hr : 0 < r) (f : ℤ → ℝ) (c : ℝ) + (h0 : ∀ n, 0 ≤ f n) (hc : ∀ n, f n ≤ c) (hc1 : c < 1) + (hpoly : (forwardDiff^[r]) (fun n => (f n : AddCircle (1 : ℝ))) = 0) : + ∃ q : ℕ, 0 < q ∧ Function.Periodic f (q : ℤ) := by + obtain ⟨q, hq, hper⟩ := circle_polynomial_periodic_of_not_dense + (fun n => (f n : UnitAddCircle)) r hpoly + (not_denseRange_circle_of_bounded_lt_one f c h0 hc hc1) + refine ⟨q, hq, ?_⟩ + intro n + apply (AddCircle.coe_eq_coe_iff_of_mem_Ico + (show f (n + q) ∈ Set.Ico (0 : ℝ) (0 + 1) from + ⟨h0 _, by simpa using (hc _).trans_lt hc1⟩) + (show f n ∈ Set.Ico (0 : ℝ) (0 + 1) from + ⟨h0 _, by simpa using (hc _).trans_lt hc1⟩)).mp + exact hper n + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/ScalarVanDerCorput.lean b/lean/OAI/Geometry/PeriodicTiling/ScalarVanDerCorput.lean new file mode 100644 index 0000000000000000000000000000000000000000..f39f596eb4da72b6134becc95b5683f0b233e5eb --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/ScalarVanDerCorput.lean @@ -0,0 +1,325 @@ +import OAI.Geometry.PeriodicTiling.ScalarAverage +import Mathlib.Analysis.InnerProductSpace.Basic +import Mathlib.Algebra.Order.Chebyshev +import Mathlib.Tactic.Abel +import Mathlib.Tactic.Module + +namespace OAI + +noncomputable section + +universe uE uInner + +namespace PeriodicTilingThree + +open Finset Filter +open scoped Topology InnerProductSpace ComplexConjugate + +section Normed + +variable {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] + +theorem norm_vectorAverage (u : ℕ → E) (N : ℕ) : + ‖vectorAverage u N‖ = (N : ℝ)⁻¹ * ‖∑ n ∈ range N, u n‖ := by + rw [vectorAverage, norm_smul, Real.norm_eq_abs, + abs_of_nonneg (inv_nonneg.mpr (Nat.cast_nonneg N))] + +theorem sum_shift_sub_sum {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] + (u : ℕ → E) (N h : ℕ) : + (∑ n ∈ range N, u (n + h)) - (∑ n ∈ range N, u n) = + (∑ n ∈ range h, u (n + N)) - (∑ n ∈ range h, u n) := by + have h₁ : (∑ n ∈ range (N + h), u n) = + (∑ n ∈ range N, u n) + (∑ n ∈ range h, u (n + N)) := by + simpa only [Nat.add_comm] using sum_range_add u N h + have h₂ : (∑ n ∈ range (N + h), u n) = + (∑ n ∈ range h, u n) + (∑ n ∈ range N, u (n + h)) := by + simpa only [Nat.add_comm] using sum_range_add u h N + apply sub_eq_sub_iff_add_eq_add.mpr + simpa only [add_comm] using h₂.symm.trans h₁ + +theorem norm_sum_range_le_length + {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] + (u : ℕ → E) (hu : ∀ n, ‖u n‖ ≤ 1) (N : ℕ) : + ‖∑ n ∈ range N, u n‖ ≤ (N : ℝ) := by + calc + _ ≤ ∑ n ∈ range N, ‖u n‖ := norm_sum_le _ _ + _ ≤ ∑ _n ∈ range N, (1 : ℝ) := sum_le_sum fun n _ => hu n + _ = (N : ℝ) := by simp + +theorem norm_shift_sum_sub_le (u : ℕ → E) (hu : ∀ n, ‖u n‖ ≤ 1) (N h : ℕ) : + ‖(∑ n ∈ range N, u (n + h)) - (∑ n ∈ range N, u n)‖ ≤ 2 * (h : ℝ) := by + rw [sum_shift_sub_sum] + calc + _ ≤ ‖∑ n ∈ range h, u (n + N)‖ + ‖∑ n ∈ range h, u n‖ := norm_sub_le _ _ + _ ≤ (h : ℝ) + h := add_le_add + (norm_sum_range_le_length (fun n => u (n + N)) (fun n => hu (n + N)) h) + (norm_sum_range_le_length u hu h) + _ = 2 * (h : ℝ) := by ring + +theorem norm_shift_average_sub_le (u : ℕ → E) (hu : ∀ n, ‖u n‖ ≤ 1) (N h : ℕ) : + ‖vectorAverage (fun n => u (n + h)) N - vectorAverage u N‖ ≤ + (N : ℝ)⁻¹ * (2 * (h : ℝ)) := by + simp only [vectorAverage, ← smul_sub] + rw [norm_smul, Real.norm_eq_abs, + abs_of_nonneg (inv_nonneg.mpr (Nat.cast_nonneg N))] + exact mul_le_mul_of_nonneg_left (norm_shift_sum_sub_le u hu N h) (by positivity) + +def smoothedAverage (u : ℕ → E) (H N : ℕ) : E := + (H : ℝ)⁻¹ • vectorAverage (fun n => ∑ h ∈ range H, u (n + h)) N + +theorem smoothedAverage_eq_sum (u : ℕ → E) (H N : ℕ) : + smoothedAverage u H N = + (H : ℝ)⁻¹ • ∑ h ∈ range H, vectorAverage (fun n => u (n + h)) N := by + simp only [smoothedAverage, vectorAverage, smul_sum] + rw [sum_comm] + +theorem smoothedAverage_sub (u : ℕ → E) {H : ℕ} (hH : 0 < H) (N : ℕ) : + smoothedAverage u H N - vectorAverage u N = + (H : ℝ)⁻¹ • ∑ h ∈ range H, + (vectorAverage (fun n => u (n + h)) N - vectorAverage u N) := by + have hHr : (H : ℝ) ≠ 0 := Nat.cast_ne_zero.mpr hH.ne' + rw [sum_sub_distrib, smul_sub, ← smoothedAverage_eq_sum] + congr 1 + simp only [sum_const, card_range, ← Nat.cast_smul_eq_nsmul ℝ, + smul_smul, inv_mul_cancel₀ hHr, one_smul] + +theorem norm_smoothedAverage_sub_le (u : ℕ → E) (hu : ∀ n, ‖u n‖ ≤ 1) + {H : ℕ} (hH : 0 < H) (N : ℕ) : + ‖smoothedAverage u H N - vectorAverage u N‖ ≤ + (N : ℝ)⁻¹ * (2 * (H : ℝ)) := by + have hHr : (H : ℝ) ≠ 0 := Nat.cast_ne_zero.mpr hH.ne' + rw [smoothedAverage_sub u hH N, norm_smul, Real.norm_eq_abs, + abs_of_nonneg (inv_nonneg.mpr (Nat.cast_nonneg H))] + have hsum : + ‖∑ h ∈ range H, (vectorAverage (fun n => u (n + h)) N - vectorAverage u N)‖ ≤ + (H : ℝ) * ((N : ℝ)⁻¹ * (2 * (H : ℝ))) := by + calc + _ ≤ ∑ h ∈ range H, + ‖vectorAverage (fun n => u (n + h)) N - vectorAverage u N‖ := norm_sum_le _ _ + _ ≤ ∑ _h ∈ range H, ((N : ℝ)⁻¹ * (2 * (H : ℝ))) := by + apply sum_le_sum + intro h hh + refine (norm_shift_average_sub_le u hu N h).trans ?_ + apply mul_le_mul_of_nonneg_left _ (by positivity) + have hh' : (h : ℝ) ≤ H := by exact_mod_cast (mem_range.mp hh).le + linarith + _ = (H : ℝ) * ((N : ℝ)⁻¹ * (2 * (H : ℝ))) := by simp + calc + _ ≤ (H : ℝ)⁻¹ * ((H : ℝ) * ((N : ℝ)⁻¹ * (2 * (H : ℝ)))) := + mul_le_mul_of_nonneg_left hsum (by positivity) + _ = (N : ℝ)⁻¹ * (2 * (H : ℝ)) := by + rw [← mul_assoc, inv_mul_cancel₀ hHr, one_mul] + +theorem norm_vectorAverage_sq_le (u : ℕ → E) (N : ℕ) : + ‖vectorAverage u N‖ ^ 2 ≤ (N : ℝ)⁻¹ * ∑ n ∈ range N, ‖u n‖ ^ 2 := by + by_cases hN : N = 0 + · simp [hN, vectorAverage] + have hNr : (N : ℝ) ≠ 0 := Nat.cast_ne_zero.mpr hN + have hsum : ‖∑ n ∈ range N, u n‖ ^ 2 ≤ (∑ n ∈ range N, ‖u n‖) ^ 2 := by + have hn : 0 ≤ ∑ n ∈ range N, ‖u n‖ := sum_nonneg fun _ _ => norm_nonneg _ + exact (sq_le_sq₀ (norm_nonneg _) hn).mpr (norm_sum_le (range N) u) + have hc : (∑ n ∈ range N, ‖u n‖) ^ 2 ≤ + (N : ℝ) * ∑ n ∈ range N, ‖u n‖ ^ 2 := by + simpa only [card_range] using + (sq_sum_le_card_mul_sum_sq (s := range N) (f := fun n => ‖u n‖)) + rw [norm_vectorAverage, mul_pow] + calc + _ ≤ ((N : ℝ)⁻¹) ^ 2 * ((N : ℝ) * ∑ n ∈ range N, ‖u n‖ ^ 2) := + mul_le_mul_of_nonneg_left (hsum.trans hc) (sq_nonneg _) + _ = (N : ℝ)⁻¹ * ∑ n ∈ range N, ‖u n‖ ^ 2 := by + field_simp [hNr] + +end Normed + +section InnerProduct + +variable {E : Type uInner} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +def offDiagonalAverage (u : ℕ → E) (H N : ℕ) : ℝ := + ∑ h ∈ range H, ∑ k ∈ range H, + if h = k then 0 else vectorAverage (fun n => ⟪u (n + h), u (n + k)⟫_ℝ) N + +theorem block_energy_eq (u : ℕ → E) (H N : ℕ) : + (N : ℝ)⁻¹ * ∑ n ∈ range N, ‖∑ h ∈ range H, u (n + h)‖ ^ 2 = + ∑ h ∈ range H, ∑ k ∈ range H, + vectorAverage (fun n => ⟪u (n + h), u (n + k)⟫_ℝ) N := by + simp only [← real_inner_self_eq_norm_sq, sum_inner, inner_sum, + vectorAverage, smul_eq_mul, mul_sum] + rw [sum_comm] + apply sum_congr rfl + intro h _hh + rw [sum_comm] + apply sum_congr rfl + intro k _hk + apply sum_congr rfl + intro n _hn + rw [real_inner_comm] + +theorem diagonal_average_le_one (u : ℕ → E) (hu : ∀ n, ‖u n‖ ≤ 1) (h N : ℕ) : + vectorAverage (fun n => ⟪u (n + h), u (n + h)⟫_ℝ) N ≤ 1 := by + by_cases hN : N = 0 + · simp [hN, vectorAverage] + have hNr : (N : ℝ) ≠ 0 := Nat.cast_ne_zero.mpr hN + have hb : ∀ n, ⟪u (n + h), u (n + h)⟫_ℝ ≤ 1 := by + intro n + rw [real_inner_self_eq_norm_sq] + simpa only [one_pow] using + (sq_le_sq₀ (norm_nonneg (u (n + h))) zero_le_one).mpr (hu (n + h)) + simp only [vectorAverage, smul_eq_mul] + calc + _ ≤ (N : ℝ)⁻¹ * (∑ _n ∈ range N, (1 : ℝ)) := + mul_le_mul_of_nonneg_left (sum_le_sum fun n _ => hb n) (by positivity) + _ = 1 := by simp [inv_mul_cancel₀ hNr] + +theorem block_energy_le (u : ℕ → E) (hu : ∀ n, ‖u n‖ ≤ 1) (H N : ℕ) : + (N : ℝ)⁻¹ * ∑ n ∈ range N, ‖∑ h ∈ range H, u (n + h)‖ ^ 2 ≤ + (H : ℝ) + offDiagonalAverage u H N := by + rw [block_energy_eq] + calc + _ ≤ ∑ h ∈ range H, (1 + ∑ k ∈ range H, + if h = k then 0 else vectorAverage (fun n => ⟪u (n + h), u (n + k)⟫_ℝ) N) := by + apply sum_le_sum + intro h hh + calc + _ ≤ ∑ k ∈ range H, + ((if h = k then (1 : ℝ) else 0) + + (if h = k then 0 else vectorAverage (fun n => ⟪u (n + h), u (n + k)⟫_ℝ) N)) := by + apply sum_le_sum + intro k _hk + by_cases he : h = k + · subst k + simpa using diagonal_average_le_one u hu h N + · simp [he] + _ = _ := by simp [sum_add_distrib, hh] + _ = (H : ℝ) + offDiagonalAverage u H N := by + simp [sum_add_distrib, offDiagonalAverage] + +theorem norm_smoothedAverage_sq_le (u : ℕ → E) (hu : ∀ n, ‖u n‖ ≤ 1) + {H : ℕ} (hH : 0 < H) (N : ℕ) : + ‖smoothedAverage u H N‖ ^ 2 ≤ + (H : ℝ)⁻¹ + ((H : ℝ)⁻¹) ^ 2 * offDiagonalAverage u H N := by + have hHr : (H : ℝ) ≠ 0 := Nat.cast_ne_zero.mpr hH.ne' + have hb := (norm_vectorAverage_sq_le (fun n => ∑ h ∈ range H, u (n + h)) N).trans + (block_energy_le u hu H N) + rw [smoothedAverage, norm_smul, Real.norm_eq_abs, + abs_of_nonneg (inv_nonneg.mpr (Nat.cast_nonneg H)), mul_pow] + calc + _ ≤ ((H : ℝ)⁻¹) ^ 2 * ((H : ℝ) + offDiagonalAverage u H N) := + mul_le_mul_of_nonneg_left hb (sq_nonneg _) + _ = (H : ℝ)⁻¹ + ((H : ℝ)⁻¹) ^ 2 * offDiagonalAverage u H N := by + field_simp [hHr] + +theorem finite_vanDerCorput (u : ℕ → E) (hu : ∀ n, ‖u n‖ ≤ 1) + {H : ℕ} (hH : 0 < H) (N : ℕ) : + ‖vectorAverage u N‖ ^ 2 ≤ + 2 * ((H : ℝ)⁻¹ + ((H : ℝ)⁻¹) ^ 2 * offDiagonalAverage u H N) + + 2 * ((N : ℝ)⁻¹ * (2 * (H : ℝ))) ^ 2 := by + have hs := norm_smoothedAverage_sq_le u hu hH N + have he := norm_smoothedAverage_sub_le u hu hH N + have ht : ‖vectorAverage u N‖ ≤ + ‖smoothedAverage u H N‖ + ‖smoothedAverage u H N - vectorAverage u N‖ := by + have ht' := norm_sub_le (smoothedAverage u H N) + (smoothedAverage u H N - vectorAverage u N) + simpa only [sub_sub_cancel] using ht' + have he0 : 0 ≤ (N : ℝ)⁻¹ * (2 * (H : ℝ)) := by positivity + have hn := norm_nonneg (smoothedAverage u H N) + have hn' := norm_nonneg (smoothedAverage u H N - vectorAverage u N) + have hn'' := norm_nonneg (vectorAverage u N) + have hsq : ‖vectorAverage u N‖ ^ 2 ≤ + 2 * ‖smoothedAverage u H N‖ ^ 2 + + 2 * ‖smoothedAverage u H N - vectorAverage u N‖ ^ 2 := by + have ht₂ := (sq_le_sq₀ hn'' (add_nonneg hn hn')).mpr ht + nlinarith [sq_nonneg (‖smoothedAverage u H N‖ - + ‖smoothedAverage u H N - vectorAverage u N‖)] + have he' : ‖smoothedAverage u H N - vectorAverage u N‖ ^ 2 ≤ + ((N : ℝ)⁻¹ * (2 * (H : ℝ))) ^ 2 := (sq_le_sq₀ hn' he0).mpr he + linarith + +theorem offDiagonalAverage_tendsto_zero (u : ℕ → E) + (hcor : ∀ h k : ℕ, h ≠ k → + Tendsto (vectorAverage (fun n => ⟪u (n + h), u (n + k)⟫_ℝ)) atTop (𝓝 0)) + (H : ℕ) : Tendsto (offDiagonalAverage u H) atTop (𝓝 0) := by + have hk (h k : ℕ) : Tendsto + (fun N => if h = k then (0 : ℝ) else + vectorAverage (fun n => ⟪u (n + h), u (n + k)⟫_ℝ) N) atTop (𝓝 0) := by + by_cases he : h = k + · simp only [he, ite_true] + exact tendsto_const_nhds + · simpa only [he, ite_false] using hcor h k he + have hh (h : ℕ) : Tendsto + (fun N => ∑ k ∈ range H, if h = k then (0 : ℝ) else + vectorAverage (fun n => ⟪u (n + h), u (n + k)⟫_ℝ) N) atTop (𝓝 0) := by + simpa using tendsto_finsetSum (range H) (fun k _ => hk h k) + unfold offDiagonalAverage + simpa only [sum_const_zero] using + tendsto_finsetSum (range H) (fun h _ => hh h) + +theorem vectorAverage_tendsto_zero_of_shift_inner (u : ℕ → E) + (hu : ∀ n, ‖u n‖ ≤ 1) + (hcor : ∀ h k : ℕ, h ≠ k → + Tendsto (vectorAverage (fun n => ⟪u (n + h), u (n + k)⟫_ℝ)) atTop (𝓝 0)) : + Tendsto (vectorAverage u) atTop (𝓝 0) := by + have hsq : Tendsto (fun N => ‖vectorAverage u N‖ ^ 2) atTop (𝓝 (0 : ℝ)) := by + apply tendsto_order.mpr + constructor + · intro a ha + exact Filter.Eventually.of_forall fun N => lt_of_lt_of_le ha (sq_nonneg _) + · intro b hb + obtain ⟨H, hH⟩ := exists_nat_gt (2 / b) + have hHr : (0 : ℝ) < H := lt_trans (by positivity : (0 : ℝ) < 2 / b) hH + have hHn : 0 < H := Nat.cast_pos.mp hHr + have hlimit : 2 * (H : ℝ)⁻¹ < b := by + have hx : 2 < (H : ℝ) * b := (div_lt_iff₀ hb).mp hH + have hy : 2 / (H : ℝ) < b := (div_lt_iff₀ hHr).mpr (by nlinarith) + simpa only [div_eq_mul_inv] using hy + have hoff := offDiagonalAverage_tendsto_zero u hcor H + have hfirst : Tendsto + (fun N => (H : ℝ)⁻¹ + ((H : ℝ)⁻¹) ^ 2 * offDiagonalAverage u H N) + atTop (𝓝 ((H : ℝ)⁻¹)) := by + simpa only [mul_zero, add_zero] using + tendsto_const_nhds.add (hoff.const_mul (((H : ℝ)⁻¹) ^ 2)) + have hsecond : Tendsto (fun N : ℕ => ((N : ℝ)⁻¹ * (2 * (H : ℝ))) ^ 2) + atTop (𝓝 (0 : ℝ)) := by + simpa only [zero_mul, zero_pow (by decide : (2 : ℕ) ≠ 0)] using + (tendsto_inv_atTop_nhds_zero_nat.mul_const (2 * (H : ℝ))).pow 2 + have hg : Tendsto + (fun N => 2 * ((H : ℝ)⁻¹ + ((H : ℝ)⁻¹) ^ 2 * offDiagonalAverage u H N) + + 2 * ((N : ℝ)⁻¹ * (2 * (H : ℝ))) ^ 2) + atTop (𝓝 (2 * (H : ℝ)⁻¹)) := by + simpa only [mul_zero, add_zero] using (hfirst.const_mul 2).add (hsecond.const_mul 2) + filter_upwards [(tendsto_order.mp hg).2 b hlimit] with N hN + exact lt_of_le_of_lt (finite_vanDerCorput u hu hHn N) hN + apply tendsto_zero_iff_norm_tendsto_zero.mpr + simpa only [Real.sqrt_sq_eq_abs, abs_norm, Real.sqrt_zero] using hsq.sqrt + +end InnerProduct + +theorem vectorAverage_complex_inner_eq_re (u : ℕ → ℂ) (h k N : ℕ) : + vectorAverage (fun n => ⟪u (n + h), u (n + k)⟫_ℝ) N = + (complexAverage (fun n => u (n + k) * conj (u (n + h))) N).re := by + rw [complexAverage_eq_vectorAverage] + simp only [vectorAverage, Complex.inner, Complex.real_smul, Complex.mul_re, + Complex.ofReal_re, Complex.ofReal_im, zero_mul, sub_zero, Complex.re_sum, smul_eq_mul] + +theorem complexAverage_vanDerCorput (u : ℕ → ℂ) + (hu : ∀ n, ‖u n‖ ≤ 1) + (hcor : ∀ h k : ℕ, h ≠ k → + Tendsto (complexAverage (fun n => u (n + h) * conj (u (n + k)))) atTop (𝓝 0)) : + Tendsto (complexAverage u) atTop (𝓝 0) := by + have hi : ∀ h k : ℕ, h ≠ k → + Tendsto (vectorAverage (fun n => ⟪u (n + h), u (n + k)⟫_ℝ)) atTop (𝓝 0) := by + intro h k hne + have hr := (Complex.continuous_re.tendsto 0).comp (hcor k h hne.symm) + simp only [Complex.zero_re] at hr + convert hr using 1 + · funext N + exact vectorAverage_complex_inner_eq_re u h k N + convert vectorAverage_tendsto_zero_of_shift_inner u hu hi using 1 + funext N + exact complexAverage_eq_vectorAverage u N + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/SeedSymbols.lean b/lean/OAI/Geometry/PeriodicTiling/SeedSymbols.lean new file mode 100644 index 0000000000000000000000000000000000000000..a79ba8148f62d81e12949def81074bbc25b423b8 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/SeedSymbols.lean @@ -0,0 +1,64 @@ +import OAI.Geometry.PeriodicTiling.EncodingParameters +import OAI.Geometry.PeriodicTiling.LastDigit + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree + +def seedSymbol {p : ℕ} [NeZero p] (E : EncodingParameters p) (t : Fin 2) : Symbol p := + lastDigit p E.p_prime ((t.val : ℤ) + 1) + +variable {p : ℕ} [NeZero p] (E : EncodingParameters p) + +@[simp] theorem seedSymbol_coe (t : Fin 2) : + (seedSymbol E t : ZMod p) = (t.val : ZMod p) + 1 := by + have hlt : t.val + 1 < p := by + have ht := t.isLt + have hp := E.p_large + omega + have hnot : ¬ (p : ℤ) ∣ (t.val : ℤ) + 1 := by + intro h + apply Nat.not_dvd_of_pos_of_lt (Nat.succ_pos t.val) hlt + apply Int.natCast_dvd_natCast.mp + simpa only [Nat.cast_succ] using h + simpa only [seedSymbol, Int.cast_add, Int.cast_natCast, Int.cast_one] using + lastDigit_eq_of_not_dvd p E.p_prime hnot + +theorem seedSymbol_injective : Function.Injective (seedSymbol E) := by + intro s t h + apply Fin.ext + have hcoe : (seedSymbol E s : ZMod p) = (seedSymbol E t : ZMod p) := + congrArg (fun u : Symbol p => (u : ZMod p)) h + rw [seedSymbol_coe, seedSymbol_coe] at hcoe + have hcast : (s.val : ZMod p) = (t.val : ZMod p) := add_right_cancel hcoe + have hmod := (ZMod.natCast_eq_natCast_iff' s.val t.val p).mp hcast + have hp : 2 < p := by have := E.p_large; omega + rw [Nat.mod_eq_of_lt (lt_trans s.isLt hp), + Nat.mod_eq_of_lt (lt_trans t.isLt hp)] at hmod + exact hmod + +@[simp] theorem seedSymbol_eq_iff {s t : Fin 2} : + seedSymbol E s = seedSymbol E t ↔ s = t := + ⟨fun h => seedSymbol_injective E h, fun h => congrArg (seedSymbol E) h⟩ + +theorem seedSymbol_ne {s t : Fin 2} (h : s ≠ t) : + seedSymbol E s ≠ seedSymbol E t := + fun hst => h (seedSymbol_injective E hst) + +@[simp] theorem seedSymbol_zero : seedSymbol E 0 = 1 := by + simp [seedSymbol] + +@[simp] theorem seedSymbol_one_coe : (seedSymbol E 1 : ZMod p) = 2 := by + change (lastDigit p E.p_prime 2 : ZMod p) = 2 + exact lastDigit_two p E.p_prime (by have := E.p_large; omega) + +theorem seedSymbol_zero_ne_one : seedSymbol E 0 ≠ seedSymbol E 1 := + seedSymbol_ne E (by decide) + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/SeparatedCenters.lean b/lean/OAI/Geometry/PeriodicTiling/SeparatedCenters.lean new file mode 100644 index 0000000000000000000000000000000000000000..f60ed12c053a210e647222a34a50499532d7d538 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/SeparatedCenters.lean @@ -0,0 +1,124 @@ +import OAI.Geometry.PeriodicTiling.EuclideanBasic +import OAI.Geometry.PeriodicTiling.ClosedBoxRounding +import OAI.Geometry.PeriodicTiling.VoxelMeasure +import Mathlib.MeasureTheory.Measure.AEDisjoint +import Mathlib.Tactic.Abel +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.NormNum +import Mathlib.Tactic.Ring + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree + +open Set MeasureTheory +open scoped Classical + +def RigidDifferences (m : ℕ) (S : Finset (Lattice 3)) : Prop := + ∀ d : Lattice 3, (∀ i, |d i| ≤ (m : ℤ)) → (∃ i, ¬ (m : ℤ) ∣ d i) → + ∃ t ∈ S, ∃ t' ∈ S, t - t' = d + +theorem TypedAETiles.aedisjoint {d : ℕ} {Ω0 Ω1 C C1 : Set (Space d)} + (h : TypedAETiles Ω0 Ω1 C C1) {c c' : C} (hne : c ≠ c') : + AEDisjoint volume + {x | x - (c : Space d) ∈ if (c : Space d) ∈ C1 then Ω1 else Ω0} + {x | x - (c' : Space d) ∈ if (c' : Space d) ∈ C1 then Ω1 else Ω0} := by + apply measure_mono_null ?_ (ae_iff.mp h) + rintro x ⟨hx, hx'⟩ ⟨a, _ha, huniq⟩ + exact hne ((huniq c hx).trans (huniq c' hx').symm) + +theorem AETiles.aedisjoint {d : ℕ} {Ω A : Set (Space d)} + (h : AETiles Ω A) {a a' : A} (hne : a ≠ a') : + AEDisjoint volume {x | x - (a : Space d) ∈ Ω} + {x | x - (a' : Space d) ∈ Ω} := by + apply measure_mono_null ?_ (ae_iff.mp h) + rintro x ⟨hx, hx'⟩ ⟨c, _hc, huniq⟩ + exact hne ((huniq a hx).trans (huniq a' hx').symm) + +theorem common_unitVoxel_subset_piece {d : ℕ} + {S0 S1 S : Finset (Lattice d)} (h0 : S ⊆ S0) (h1 : S ⊆ S1) + (C1 : Set (Space d)) (c : Space d) {t : Lattice d} (ht : t ∈ S) : + unitVoxel (c + castLattice t) ⊆ + {x | x - c ∈ if c ∈ C1 then Thickening S1 else Thickening S0} := by + intro x hx + have hcube : (x - c) - castLattice t ∈ unitCube d := by + simpa only [mem_unitVoxel, sub_add_eq_sub_sub] using hx + by_cases hc : c ∈ C1 + · simp only [hc, ite_eq_left, mem_ofPred_eq] + exact ⟨t, h1 ht, hcube⟩ + · simp only [hc, mem_ofPred_eq] + exact ⟨t, h0 ht, hcube⟩ + +theorem typed_nearby_centers_mem_scaledGrid + {m : ℕ} (hm : 2 ≤ m) {S0 S1 S : Finset (Lattice 3)} + (h0 : S ⊆ S0) (h1 : S ⊆ S1) (hdiff : RigidDifferences m S) + {C C1 : Set (Space 3)} (htile : TypedAETiles (Thickening S0) (Thickening S1) C C1) + {c c' : C} (hne : c ≠ c') (hclose : ‖(c' : Space 3) - (c : Space 3)‖ ≤ (m : ℝ)) : + (c' : Space 3) - (c : Space 3) ∈ scaledGrid m := by + by_contra hnot + have hcoords : ∀ i, |((c' : Space 3) - (c : Space 3)) i| ≤ (m : ℝ) := by + intro i + have hcoord : |((c' : Space 3) - (c : Space 3)) i| ≤ + ‖(c' : Space 3) - (c : Space 3)‖ := by + simpa only [Real.norm_eq_abs] using + norm_le_pi_norm ((c' : Space 3) - (c : Space 3)) i + exact hcoord.trans hclose + obtain ⟨d, hd, hdiv, hround⟩ := + closed_box_rounding m hm ((c' : Space 3) - (c : Space 3)) hcoords hnot + obtain ⟨t, ht, t', ht', htd⟩ := hdiff d hd hdiv + have hcorners : ∀ i, + |((c' : Space 3) + castLattice t') i - ((c : Space 3) + castLattice t) i| < 1 := by + intro i + have hid : ((c' : Space 3) + castLattice t') i - + ((c : Space 3) + castLattice t) i = + (((c' : Space 3) - (c : Space 3)) i - (d i : ℝ)) := by + rw [← htd] + simp only [Pi.add_apply, Pi.sub_apply, castLattice_apply, Int.cast_sub] + ring + rw [hid] + exact hround i + have hpos := unitVoxel_inter_volume_pos + ((c : Space 3) + castLattice t) ((c' : Space 3) + castLattice t') hcorners + have hnull := (htile.aedisjoint hne).mono + (common_unitVoxel_subset_piece h0 h1 C1 c ht) + (common_unitVoxel_subset_piece h0 h1 C1 c' ht') + exact (ne_of_gt hpos) hnull + +theorem scaledGrid_eq_zero_of_norm_lt {m : ℕ} (hm : 0 < m) + {x : Space 3} (hx : x ∈ scaledGrid m) (hnorm : ‖x‖ < (m : ℝ)) : x = 0 := by + obtain ⟨z, rfl⟩ := mem_scaledGrid.mp hx + have hmR : (0 : ℝ) < m := by exact_mod_cast hm + have hz : z = 0 := by + funext i + have hi : |(m : ℝ) * (z i : ℝ)| < (m : ℝ) := by + have hle := norm_le_pi_norm ((m : ℝ) • castLattice z) i + have hle' : |(m : ℝ) * (z i : ℝ)| ≤ ‖(m : ℝ) • castLattice z‖ := by + simpa only [Pi.smul_apply, smul_eq_mul, castLattice_apply, + Real.norm_eq_abs] using hle + exact hle'.trans_lt hnorm + rw [abs_mul, abs_of_nonneg hmR.le] at hi + have hzi : |(z i : ℝ)| < 1 := by + exact (mul_lt_mul_iff_right₀ hmR).mp (by simpa only [mul_one] using hi) + rw [← Int.cast_abs, ← Int.cast_one, Int.cast_lt] at hzi + exact Int.abs_lt_one_iff.mp hzi + simp [hz] + +theorem typed_centers_separated + {m : ℕ} (hm : 2 ≤ m) {S0 S1 S : Finset (Lattice 3)} + (h0 : S ⊆ S0) (h1 : S ⊆ S1) (hdiff : RigidDifferences m S) + {C C1 : Set (Space 3)} (htile : TypedAETiles (Thickening S0) (Thickening S1) C C1) + {c c' : C} (hne : c ≠ c') : (m : ℝ) ≤ ‖(c' : Space 3) - (c : Space 3)‖ := by + by_contra h + have hsmall := lt_of_not_ge h + have hgrid := typed_nearby_centers_mem_scaledGrid hm h0 h1 hdiff htile hne hsmall.le + have hzero := scaledGrid_eq_zero_of_norm_lt + (lt_of_lt_of_le (by decide : 0 < 2) hm) hgrid hsmall + exact hne (Subtype.ext (sub_eq_zero.mp hzero).symm) + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/SharedSeedInactive.lean b/lean/OAI/Geometry/PeriodicTiling/SharedSeedInactive.lean new file mode 100644 index 0000000000000000000000000000000000000000..2ac1ec639b5e61628f08301efdb9ca60939841f9 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/SharedSeedInactive.lean @@ -0,0 +1,69 @@ +import OAI.Geometry.PeriodicTiling.BlockActivationInverse +import Mathlib.Tactic.Abel + +namespace OAI + +universe uK uΔ + +noncomputable section + +namespace PeriodicTilingThree.SharedSeed + +variable {K : Type uK} {Δ : Type uΔ} [AddCommGroup K] {a b : ℕ} + +def inactiveForward (S : BlockShiftData Δ a b) (x : ZMod a) (k : K) + (v : (K × Δ) × ZMod a) : ((ZMod a × ZMod b) × K) × ZMod a := + ((((v.2 + (S.e v.1.2).1), (S.e v.1.2).2), k - v.1.1), + v.2 + x - S.rhoA v.1.2) + +def inactiveInverse (S : BlockShiftData Δ a b) (x : ZMod a) (k : K) + (v : ((ZMod a × ZMod b) × K) × ZMod a) : (K × Δ) × ZMod a := + let δ := S.orderA.symm (v.1.1.2, v.1.1.1 + x - v.2) + ((k - v.1.2, δ), v.1.1.1 - (S.e δ).1) + +theorem inactiveInverse_forward (S : BlockShiftData Δ a b) (x : ZMod a) (k : K) + (v : (K × Δ) × ZMod a) : + inactiveInverse S x k (inactiveForward S x k v) = v := by + rcases v with ⟨⟨l, δ⟩, y⟩ + have hd : S.orderA.symm ((S.e δ).2, + (y + (S.e δ).1) + x - (y + x - S.rhoA δ)) = δ := by + apply S.orderA.injective + rw [Equiv.apply_symm_apply, S.orderA_apply] + apply Prod.ext + · rfl + · abel_nf + dsimp [inactiveInverse, inactiveForward] + rw [hd] + simp + +theorem inactiveForward_inverse (S : BlockShiftData Δ a b) (x : ZMod a) (k : K) + (v : ((ZMod a × ZMod b) × K) × ZMod a) : + inactiveForward S x k (inactiveInverse S x k v) = v := by + rcases v with ⟨⟨⟨α, ξ⟩, β⟩, q⟩ + let δ := S.orderA.symm (ξ, α + x - q) + have hd : ((S.e δ).2, (S.e δ).1 + S.rhoA δ) = (ξ, α + x - q) := by + rw [← S.orderA_apply] + exact S.orderA.apply_symm_apply _ + have hb : (S.e δ).2 = ξ := congrArg Prod.fst hd + have ha : (S.e δ).1 + S.rhoA δ = α + x - q := congrArg Prod.snd hd + have hq : α - (S.e δ).1 + x - S.rhoA δ = q := by + calc + α - (S.e δ).1 + x - S.rhoA δ = α + x - ((S.e δ).1 + S.rhoA δ) := by abel + _ = α + x - (α + x - q) := by rw [ha] + _ = q := by abel + change ((((α - (S.e δ).1 + (S.e δ).1), (S.e δ).2), k - (k - β)), + α - (S.e δ).1 + x - S.rhoA δ) = (((α, ξ), β), q) + simp only [sub_add_cancel, sub_sub_cancel, hb, hq] + +def inactiveEquiv (S : BlockShiftData Δ a b) (x : ZMod a) (k : K) : + ((K × Δ) × ZMod a) ≃ (((ZMod a × ZMod b) × K) × ZMod a) where + toFun := inactiveForward S x k + invFun := inactiveInverse S x k + left_inv := inactiveInverse_forward S x k + right_inv := inactiveForward_inverse S x k + +end PeriodicTilingThree.SharedSeed + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/SharedSeedInverse.lean b/lean/OAI/Geometry/PeriodicTiling/SharedSeedInverse.lean new file mode 100644 index 0000000000000000000000000000000000000000..a25ce54f9d60396c057aa862a0eec8a2db9e63ed --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/SharedSeedInverse.lean @@ -0,0 +1,197 @@ +import OAI.Geometry.PeriodicTiling.SharedSeedLabelEquiv + +namespace OAI + +universe uK uΔ uA uB uR + +noncomputable section + +namespace PeriodicTilingThree.SharedSeed + +variable {K : Type uK} {Δ : Type uΔ} {A : Type uA} {B : Type uB} {R : Type uR} + [AddCommGroup K] [AddCommGroup R] {m b n : ℕ} + +def sourceResidueEquiv (sx : R) (e : R ≃ LabelledResidue m) : R ≃ LabelledResidue m where + toFun τ := e (sx - τ) + invFun s := sx - e.symm s + left_inv τ := by simp + right_inv s := by simp + +@[simp] theorem sourceResidueEquiv_apply (sx : R) (e : R ≃ LabelledResidue m) (τ : R) : + sourceResidueEquiv sx e τ = e (sx - τ) := rfl + +@[simp] theorem sourceResidueEquiv_symm_apply (sx : R) (e : R ≃ LabelledResidue m) + (s : LabelledResidue m) : (sourceResidueEquiv sx e).symm s = sx - e.symm s := rfl + +def usefulOne (D : LabeledBlocks K A B 2 b) (u : K) : LabelledResidue m → ZMod 2 × ZMod b + | Sum.inl _ => D.C u + | Sum.inr (Sum.inl (_, y)) => (y, 0) + | Sum.inr (Sum.inr (_, y, _)) => (y, 0) + +def highOne (D : LabeledBlocks K A B 2 b) (t : ℤ) (u : K) : LabelledResidue m → K + | Sum.inl _ => D.T t u + | Sum.inr _ => u + +def usefulTwo (D : LabeledBlocks K A B 3 b) (u : K) : LabelledResidue m → ZMod 3 × ZMod b + | Sum.inl y => (y, 0) + | Sum.inr (Sum.inl _) => D.C u + | Sum.inr (Sum.inr (_, _, y)) => (y, 0) + +def highTwo (D : LabeledBlocks K A B 3 b) (t : ℤ) (u : K) : LabelledResidue m → K + | Sum.inl _ => u + | Sum.inr (Sum.inl _) => D.T t u + | Sum.inr (Sum.inr _) => u + +def oneForward (D : LabeledBlocks K A B 2 b) (S : BlockShiftData Δ 2 b) + (e : R ≃ LabelledResidue m) (code : R ≃ ZMod n) + (H : (K × Δ) × R → ℤ) (x : ℤ) (sx : R) (k : K) + (v : (K × Δ) × R) : ((ZMod 2 × ZMod b) × K) × ZMod n := + let s := e (sx - v.2) + let u := k - v.1.1 + let t := x - H v + ((usefulOne D u s + S.e v.1.2, highOne D t u s), + sharedOutput e code t (sx - v.2)) + +def twoForward (D : LabeledBlocks K A B 3 b) (S : BlockShiftData Δ 3 b) + (e : R ≃ LabelledResidue m) (code : R ≃ ZMod n) + (H : (K × Δ) × R → ℤ) (x : ℤ) (sx : R) (k : K) + (v : (K × Δ) × R) : ((ZMod 3 × ZMod b) × K) × ZMod n := + let s := e (sx - v.2) + let u := k - v.1.1 + let t := x - H v + ((usefulTwo D u s + S.e v.1.2, highTwo D t u s), + sharedOutput e code t (sx - v.2)) + +def oneActivationEquiv (D : LabeledBlocks K A B 2 b) (S : BlockShiftData Δ 2 b) + (e : R ≃ LabelledResidue m) (code : R ≃ ZMod n) + (H : (K × Δ) × R → ℤ) + (hA : ∀ v, (H v : ZMod 2) = S.rhoA v.1.2) + (hB : ∀ v, (H v : ZMod b) = S.rhoB v.1.2) + (x : ℤ) (sx : R) (k : K) : + ((K × Δ) × R) ≃ (((ZMod 2 × ZMod b) × K) × ZMod n) := + let E := sourceResidueEquiv sx e + let blocks := fun y : ZMod 3 => + BlockShiftData.blockInverseEquiv D S (fun v => H (v, E.symm (Sum.inl y))) + (fun v => hA (v, E.symm (Sum.inl y))) + (fun v => hB (v, E.symm (Sum.inl y))) x k + ((Equiv.prodCongr (Equiv.refl (K × Δ)) E).trans + (oneLabelEquiv S x k blocks)).trans + (Equiv.prodCongr (Equiv.refl ((ZMod 2 × ZMod b) × K)) (e.symm.trans code)) + +def twoActivationEquiv (D : LabeledBlocks K A B 3 b) (S : BlockShiftData Δ 3 b) + (e : R ≃ LabelledResidue m) (code : R ≃ ZMod n) + (H : (K × Δ) × R → ℤ) + (hA : ∀ v, (H v : ZMod 3) = S.rhoA v.1.2) + (hB : ∀ v, (H v : ZMod b) = S.rhoB v.1.2) + (x : ℤ) (sx : R) (k : K) : + ((K × Δ) × R) ≃ (((ZMod 3 × ZMod b) × K) × ZMod n) := + let E := sourceResidueEquiv sx e + let blocks := fun y : Fin 2 × ZMod 2 => + BlockShiftData.blockInverseEquiv D S (fun v => H (v, E.symm (Sum.inr (Sum.inl y)))) + (fun v => hA (v, E.symm (Sum.inr (Sum.inl y)))) + (fun v => hB (v, E.symm (Sum.inr (Sum.inl y)))) x k + ((Equiv.prodCongr (Equiv.refl (K × Δ)) E).trans + (twoLabelEquiv S x k blocks)).trans + (Equiv.prodCongr (Equiv.refl ((ZMod 3 × ZMod b) × K)) (e.symm.trans code)) + +theorem oneActivationEquiv_apply + (D : LabeledBlocks K A B 2 b) (S : BlockShiftData Δ 2 b) + (e : R ≃ LabelledResidue m) (code : R ≃ ZMod n) + (H : (K × Δ) × R → ℤ) + (hA : ∀ v, (H v : ZMod 2) = S.rhoA v.1.2) + (hB : ∀ v, (H v : ZMod b) = S.rhoB v.1.2) + (hOther : ∀ v, (H v : ZMod 3) = 0) + (x : ℤ) (sx : R) (k : K) (v : (K × Δ) × R) : + oneActivationEquiv D S e code H hA hB x sx k v = + oneForward D S e code H x sx k v := by + rcases v with ⟨⟨l, δ⟩, τ⟩ + have hback : sx - e.symm (e (sx - τ)) = τ := by simp + cases hs : e (sx - τ) with + | inl y => + rw [hs] at hback + simp [oneActivationEquiv, oneLabelEquiv, sourceResidueEquiv, + BlockShiftData.blockInverseEquiv, BlockShiftData.blockForward, + oneForward, usefulOne, highOne, sharedOutput, rotation, rotate, rotateMap, + hs, hback, Int.cast_sub, hOther] + | inr s => + cases s with + | inl cy => + rcases cy with ⟨c, y⟩ + simp [oneActivationEquiv, oneLabelEquiv, sourceResidueEquiv, + inactiveEquiv, inactiveForward, oneForward, usefulOne, highOne, + sharedOutput, rotation, rotate, rotateMap, hs, Int.cast_sub, hA, + add_sub_assoc, Prod.add_def] + | inr cyz => + rcases cyz with ⟨c, y, z⟩ + simp [oneActivationEquiv, oneLabelEquiv, sourceResidueEquiv, + inactiveEquiv, inactiveForward, oneForward, usefulOne, highOne, + sharedOutput, rotation, rotate, rotateMap, hs, Int.cast_sub, hA, hOther, + add_sub_assoc, Prod.add_def] + +theorem twoActivationEquiv_apply + (D : LabeledBlocks K A B 3 b) (S : BlockShiftData Δ 3 b) + (e : R ≃ LabelledResidue m) (code : R ≃ ZMod n) + (H : (K × Δ) × R → ℤ) + (hA : ∀ v, (H v : ZMod 3) = S.rhoA v.1.2) + (hB : ∀ v, (H v : ZMod b) = S.rhoB v.1.2) + (hOther : ∀ v, (H v : ZMod 2) = 0) + (x : ℤ) (sx : R) (k : K) (v : (K × Δ) × R) : + twoActivationEquiv D S e code H hA hB x sx k v = + twoForward D S e code H x sx k v := by + rcases v with ⟨⟨l, δ⟩, τ⟩ + have hback : sx - e.symm (e (sx - τ)) = τ := by simp + cases hs : e (sx - τ) with + | inl y => + simp [twoActivationEquiv, twoLabelEquiv, sourceResidueEquiv, + inactiveEquiv, inactiveForward, twoForward, usefulTwo, highTwo, + sharedOutput, rotation, rotate, rotateMap, hs, Int.cast_sub, hA, + add_sub_assoc, Prod.add_def] + | inr s => + cases s with + | inl cy => + rcases cy with ⟨c, y⟩ + rw [hs] at hback + simp [twoActivationEquiv, twoLabelEquiv, sourceResidueEquiv, + BlockShiftData.blockInverseEquiv, BlockShiftData.blockForward, + twoForward, usefulTwo, highTwo, sharedOutput, rotation, rotate, rotateMap, + hs, hback, Int.cast_sub, hOther] + | inr cyz => + rcases cyz with ⟨c, y, z⟩ + simp [twoActivationEquiv, twoLabelEquiv, sourceResidueEquiv, + inactiveEquiv, inactiveForward, twoForward, usefulTwo, highTwo, + sharedOutput, rotation, rotate, rotateMap, hs, Int.cast_sub, hA, hOther, + add_sub_assoc, Prod.add_def] + +theorem oneForward_bijective + (D : LabeledBlocks K A B 2 b) (S : BlockShiftData Δ 2 b) + (e : R ≃ LabelledResidue m) (code : R ≃ ZMod n) + (H : (K × Δ) × R → ℤ) + (hA : ∀ v, (H v : ZMod 2) = S.rhoA v.1.2) + (hB : ∀ v, (H v : ZMod b) = S.rhoB v.1.2) + (hOther : ∀ v, (H v : ZMod 3) = 0) (x : ℤ) (sx : R) (k : K) : + Function.Bijective (oneForward D S e code H x sx k) := by + have he : oneForward D S e code H x sx k = + oneActivationEquiv D S e code H hA hB x sx k := + funext fun v => (oneActivationEquiv_apply D S e code H hA hB hOther x sx k v).symm + rw [he] + exact (oneActivationEquiv D S e code H hA hB x sx k).bijective + +theorem twoForward_bijective + (D : LabeledBlocks K A B 3 b) (S : BlockShiftData Δ 3 b) + (e : R ≃ LabelledResidue m) (code : R ≃ ZMod n) + (H : (K × Δ) × R → ℤ) + (hA : ∀ v, (H v : ZMod 3) = S.rhoA v.1.2) + (hB : ∀ v, (H v : ZMod b) = S.rhoB v.1.2) + (hOther : ∀ v, (H v : ZMod 2) = 0) (x : ℤ) (sx : R) (k : K) : + Function.Bijective (twoForward D S e code H x sx k) := by + have he : twoForward D S e code H x sx k = + twoActivationEquiv D S e code H hA hB x sx k := + funext fun v => (twoActivationEquiv_apply D S e code H hA hB hOther x sx k v).symm + rw [he] + exact (twoActivationEquiv D S e code H hA hB x sx k).bijective + +end PeriodicTilingThree.SharedSeed + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/SharedSeedLabelEquiv.lean b/lean/OAI/Geometry/PeriodicTiling/SharedSeedLabelEquiv.lean new file mode 100644 index 0000000000000000000000000000000000000000..e01bdfff5ee586c83340cb4fb359729858ab73bc --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/SharedSeedLabelEquiv.lean @@ -0,0 +1,81 @@ +import OAI.Geometry.PeriodicTiling.SharedSeedLabels +import OAI.Geometry.PeriodicTiling.SharedSeedInactive + +namespace OAI + +universe uK uΔ + +noncomputable section + +namespace PeriodicTilingThree.SharedSeed + +variable {K : Type uK} {Δ : Type uΔ} [AddCommGroup K] {m b : ℕ} + +def oneLabelEquiv (S : BlockShiftData Δ 2 b) (x : ℤ) (k : K) + (B : ZMod 3 → (K × Δ) ≃ ((ZMod 2 × ZMod b) × K)) : + ((K × Δ) × LabelledResidue m) ≃ (((ZMod 2 × ZMod b) × K) × LabelledResidue m) where + toFun + | (v, Sum.inl y) => (B y v, Sum.inl (y + (x : ZMod 3))) + | (v, Sum.inr (Sum.inl (c, y))) => + let w := inactiveEquiv S (x : ZMod 2) k (v, y) + (w.1, Sum.inr (Sum.inl (c, w.2))) + | (v, Sum.inr (Sum.inr (c, y, z))) => + let w := inactiveEquiv S (x : ZMod 2) k (v, y) + (w.1, Sum.inr (Sum.inr (c, w.2, z + (x : ZMod 3)))) + invFun + | (v, Sum.inl q) => ((B (q - (x : ZMod 3))).symm v, Sum.inl (q - (x : ZMod 3))) + | (v, Sum.inr (Sum.inl (c, q))) => + let w := (inactiveEquiv S (x : ZMod 2) k).symm (v, q) + (w.1, Sum.inr (Sum.inl (c, w.2))) + | (v, Sum.inr (Sum.inr (c, q, r))) => + let w := (inactiveEquiv S (x : ZMod 2) k).symm (v, q) + (w.1, Sum.inr (Sum.inr (c, w.2, r - (x : ZMod 3)))) + left_inv v := by + rcases v with ⟨v, y | (⟨c, y⟩ | ⟨c, y, z⟩)⟩ + · simp only [add_sub_cancel_right, Equiv.symm_apply_apply] + · simp only [Prod.mk.eta, Equiv.symm_apply_apply] + · simp only [Prod.mk.eta, Equiv.symm_apply_apply, add_sub_cancel_right] + right_inv v := by + rcases v with ⟨v, q | (⟨c, q⟩ | ⟨c, q, r⟩)⟩ + · simp only [Equiv.apply_symm_apply, sub_add_cancel] + · simp only [Prod.mk.eta, Equiv.apply_symm_apply] + · simp only [Prod.mk.eta, Equiv.apply_symm_apply, sub_add_cancel] + +def twoLabelEquiv (S : BlockShiftData Δ 3 b) (x : ℤ) (k : K) + (B : (Fin 2 × ZMod 2) → (K × Δ) ≃ ((ZMod 3 × ZMod b) × K)) : + ((K × Δ) × LabelledResidue m) ≃ (((ZMod 3 × ZMod b) × K) × LabelledResidue m) where + toFun + | (v, Sum.inl y) => + let w := inactiveEquiv S (x : ZMod 3) k (v, y) + (w.1, Sum.inl w.2) + | (v, Sum.inr (Sum.inl (c, y))) => + (B (c, y) v, Sum.inr (Sum.inl (c, y + (x : ZMod 2)))) + | (v, Sum.inr (Sum.inr (c, y, z))) => + let w := inactiveEquiv S (x : ZMod 3) k (v, z) + (w.1, Sum.inr (Sum.inr (c, y + (x : ZMod 2), w.2))) + invFun + | (v, Sum.inl q) => + let w := (inactiveEquiv S (x : ZMod 3) k).symm (v, q) + (w.1, Sum.inl w.2) + | (v, Sum.inr (Sum.inl (c, q))) => + ((B (c, q - (x : ZMod 2))).symm v, + Sum.inr (Sum.inl (c, q - (x : ZMod 2)))) + | (v, Sum.inr (Sum.inr (c, q, r))) => + let w := (inactiveEquiv S (x : ZMod 3) k).symm (v, r) + (w.1, Sum.inr (Sum.inr (c, q - (x : ZMod 2), w.2))) + left_inv v := by + rcases v with ⟨v, y | (⟨c, y⟩ | ⟨c, y, z⟩)⟩ + · simp only [Prod.mk.eta, Equiv.symm_apply_apply] + · simp only [add_sub_cancel_right, Equiv.symm_apply_apply] + · simp only [Prod.mk.eta, Equiv.symm_apply_apply, add_sub_cancel_right] + right_inv v := by + rcases v with ⟨v, q | (⟨c, q⟩ | ⟨c, q, r⟩)⟩ + · simp only [Prod.mk.eta, Equiv.apply_symm_apply] + · simp only [Equiv.apply_symm_apply, sub_add_cancel] + · simp only [Prod.mk.eta, Equiv.apply_symm_apply, sub_add_cancel] + +end PeriodicTilingThree.SharedSeed + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/SharedSeedLabels.lean b/lean/OAI/Geometry/PeriodicTiling/SharedSeedLabels.lean new file mode 100644 index 0000000000000000000000000000000000000000..5097f3756273388df8cc4baf0fda82fd9d64d863 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/SharedSeedLabels.lean @@ -0,0 +1,135 @@ +import OAI.Geometry.PeriodicTiling.SharedSeedRegions +import OAI.Geometry.PeriodicTiling.TilingBasic + +namespace OAI + +universe uS uK + +noncomputable section + +namespace PeriodicTilingThree.SharedSeed + +def ActiveOne {m : ℕ} : LabelledResidue m → Prop + | Sum.inl _ => True + | Sum.inr _ => False + +def ActiveTwo {m : ℕ} : LabelledResidue m → Prop + | Sum.inl _ => False + | Sum.inr (Sum.inl _) => True + | Sum.inr (Sum.inr _) => False + +def firstLabel {m : ℕ} : LabelledResidue m → ZMod 2 + | Sum.inl _ => 0 + | Sum.inr (Sum.inl v) => v.2 + | Sum.inr (Sum.inr v) => v.2.1 + +def secondLabel {m : ℕ} : LabelledResidue m → ZMod 3 + | Sum.inl y => y + | Sum.inr (Sum.inl _) => 0 + | Sum.inr (Sum.inr v) => v.2.2 + +def rotateMap {m : ℕ} (t : ℤ) : LabelledResidue m → LabelledResidue m + | Sum.inl y => Sum.inl (y + (t : ZMod 3)) + | Sum.inr (Sum.inl (c, y)) => Sum.inr (Sum.inl (c, y + (t : ZMod 2))) + | Sum.inr (Sum.inr (c, y, z)) => + Sum.inr (Sum.inr (c, y + (t : ZMod 2), z + (t : ZMod 3))) + +@[simp] theorem rotateMap_zero {m : ℕ} (s : LabelledResidue m) : + rotateMap 0 s = s := by + rcases s with y | (⟨c, y⟩ | ⟨c, y, z⟩) <;> simp [rotateMap] + +theorem rotateMap_add {m : ℕ} (t u : ℤ) (s : LabelledResidue m) : + rotateMap (t + u) s = rotateMap t (rotateMap u s) := by + rcases s with y | (⟨c, y⟩ | ⟨c, y, z⟩) <;> + simp [rotateMap, Int.cast_add, add_comm, add_left_comm] + +def rotate {m : ℕ} (t : ℤ) : Equiv.Perm (LabelledResidue m) where + toFun := rotateMap t + invFun := rotateMap (-t) + left_inv s := by rw [← rotateMap_add, neg_add_cancel, rotateMap_zero] + right_inv s := by rw [← rotateMap_add, add_neg_cancel, rotateMap_zero] + +@[simp] theorem rotate_apply {m : ℕ} (t : ℤ) (s : LabelledResidue m) : + rotate t s = rotateMap t s := rfl + +@[simp] theorem rotate_zero {m : ℕ} (s : LabelledResidue m) : rotate 0 s = s := + rotateMap_zero s + +theorem rotate_add {m : ℕ} (t u : ℤ) (s : LabelledResidue m) : + rotate (t + u) s = rotate t (rotate u s) := rotateMap_add t u s + +@[simp] theorem activeOne_rotate {m : ℕ} (t : ℤ) (s : LabelledResidue m) : + ActiveOne (rotate t s) ↔ ActiveOne s := by + rcases s with y | (⟨c, y⟩ | ⟨c, y, z⟩) <;> rfl + +@[simp] theorem activeTwo_rotate {m : ℕ} (t : ℤ) (s : LabelledResidue m) : + ActiveTwo (rotate t s) ↔ ActiveTwo s := by + rcases s with y | (⟨c, y⟩ | ⟨c, y, z⟩) <;> rfl + +theorem firstLabel_rotate {m : ℕ} (t : ℤ) (s : LabelledResidue m) + (hs : ¬ ActiveOne s) : firstLabel (rotate t s) = firstLabel s + (t : ZMod 2) := by + rcases s with y | (⟨c, y⟩ | ⟨c, y, z⟩) + · exact False.elim (hs trivial) + · rfl + · rfl + +theorem secondLabel_rotate {m : ℕ} (t : ℤ) (s : LabelledResidue m) + (hs : ¬ ActiveTwo s) : secondLabel (rotate t s) = secondLabel s + (t : ZMod 3) := by + rcases s with y | (⟨c, y⟩ | ⟨c, y, z⟩) + · rfl + · exact False.elim (hs trivial) + · rfl + +theorem rotate_fixed_on_activeOne {m : ℕ} {t : ℤ} {s : LabelledResidue m} + (hs : ActiveOne s) (ht : (t : ZMod 3) = 0) : rotate t s = s := by + rcases s with y | (⟨c, y⟩ | ⟨c, y, z⟩) + · simp [rotate, rotateMap, ht] + · exact False.elim hs + · exact False.elim hs + +theorem rotate_fixed_on_activeTwo {m : ℕ} {t : ℤ} {s : LabelledResidue m} + (hs : ActiveTwo s) (ht : (t : ZMod 2) = 0) : rotate t s = s := by + rcases s with y | (⟨c, y⟩ | ⟨c, y, z⟩) + · exact False.elim hs + · simp [rotate, rotateMap, ht] + · exact False.elim hs + +def rotation {S : Type uS} {m : ℕ} (e : S ≃ LabelledResidue m) (t : ℤ) : Equiv.Perm S := + (e.trans (rotate t)).trans e.symm + +@[simp] theorem rotation_apply {S : Type uS} {m : ℕ} + (e : S ≃ LabelledResidue m) (t : ℤ) (s : S) : + rotation e t s = e.symm (rotate t (e s)) := rfl + +@[simp] theorem label_rotation {S : Type uS} {m : ℕ} + (e : S ≃ LabelledResidue m) (t : ℤ) (s : S) : + e (rotation e t s) = rotate t (e s) := e.apply_symm_apply _ + +theorem rotation_add {S : Type uS} {m : ℕ} + (e : S ≃ LabelledResidue m) (t u : ℤ) (s : S) : + rotation e (t + u) s = rotation e t (rotation e u s) := by + simp only [rotation_apply, Equiv.apply_symm_apply, rotate_add] + +def sharedOutput {S : Type uS} {m D : ℕ} + (e : S ≃ LabelledResidue m) (code : S ≃ ZMod D) (t : ℤ) (s : S) : ZMod D := + code (rotation e t s) + +@[simp] theorem decode_sharedOutput {S : Type uS} {m D : ℕ} + (e : S ≃ LabelledResidue m) (code : S ≃ ZMod D) (t : ℤ) (s : S) : + e (code.symm (sharedOutput e code t s)) = rotate t (e s) := by + simp only [sharedOutput, Equiv.symm_apply_apply, label_rotation] + +def sharedZ {p m : ℕ} {K : Type uK} + (e : Residues p ≃ LabelledResidue m) (code : Residues p ≃ ZMod (p ^ 4)) + (x : Plane) (_k : K) : ZMod (p ^ 4) := + sharedOutput e code x.1 ((x.1 : ZMod (p ^ 2)), (x.2 : ZMod (p ^ 2))) + +def commonZ {p : ℕ} {K : Type uK} (hp : p.Prime) (hlarge : 200 < p) + (x : Plane) (_k : K) : ZMod (p ^ 4) := + sharedOutput (residueEquiv hp hlarge) (outputEquiv hlarge) x.1 (residue p x) + +end PeriodicTilingThree.SharedSeed + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/SharedSeedRegions.lean b/lean/OAI/Geometry/PeriodicTiling/SharedSeedRegions.lean new file mode 100644 index 0000000000000000000000000000000000000000..141aa42c0c1eb54d089d194867f0b8af57f5ac87 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/SharedSeedRegions.lean @@ -0,0 +1,260 @@ +import Mathlib.Data.ZMod.Basic +import Mathlib.Data.Nat.Prime.Basic +import Mathlib.Data.Fintype.EquivFin +import Mathlib.Data.Fintype.Sum +import Mathlib.Data.Fintype.Prod +import Mathlib.Logic.Equiv.Set +import Mathlib.Logic.Equiv.Sum +import Lean.Elab.Tactic.Omega +import Mathlib.Tactic.NormNum +import Mathlib.Tactic.Positivity +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Ring + +namespace OAI + +namespace PeriodicTilingThree.SharedSeed + +abbrev Residues (p : ℕ) := ZMod (p ^ 2) × ZMod (p ^ 2) +abbrev ActiveLabels := ZMod 3 ⊕ (Fin 2 × ZMod 2) +abbrev InactiveLabels (m : ℕ) := Fin m × (ZMod 2 × ZMod 3) +abbrev LabelledResidue (m : ℕ) := + ZMod 3 ⊕ ((Fin 2 × ZMod 2) ⊕ InactiveLabels m) + +def residue (p : ℕ) (x : ℤ × ℤ) : Residues p := (x.1, x.2) + +def firstPoint (p : ℕ) (y : ZMod 3) : Residues p := + ((p * y.val : ℕ), 1) + +def secondPoint (p : ℕ) (u : Fin 2 × ZMod 2) : Residues p := + ((p * (2 * u.1.val + u.2.val) : ℕ), 2) + +def activePoint (p : ℕ) : ActiveLabels → Residues p := + Sum.elim (firstPoint p) (secondPoint p) + +def firstRegion (p : ℕ) : Set (Residues p) := Set.range (firstPoint p) +def secondRegion (p : ℕ) : Set (Residues p) := Set.range (secondPoint p) +def Rest (p : ℕ) := {s : Residues p // s ∉ Set.range (activePoint p)} +def copyCount (p : ℕ) : ℕ := (p ^ 4 - 7) / 6 + +private theorem nat_multiple_cast_injective {p u v : ℕ} + (hp : 0 < p) (hu : u < p) (hv : v < p) + (h : (p * u : ZMod (p ^ 2)) = (p * v : ZMod (p ^ 2))) : u = v := by + have hu' : p * u < p ^ 2 := by + simpa [pow_two] using Nat.mul_lt_mul_of_pos_left hu hp + have hv' : p * v < p ^ 2 := by + simpa [pow_two] using Nat.mul_lt_mul_of_pos_left hv hp + have hn : ((p * u : ℕ) : ZMod (p ^ 2)) = ((p * v : ℕ) : ZMod (p ^ 2)) := by + simpa only [Nat.cast_mul] using h + have hh := congrArg ZMod.val hn + rw [ZMod.val_natCast_of_lt hu', ZMod.val_natCast_of_lt hv'] at hh + exact Nat.eq_of_mul_eq_mul_left hp hh + +theorem firstPoint_injective {p : ℕ} (hlarge : 200 < p) : + Function.Injective (firstPoint p) := by + intro y y' h + apply ZMod.val_injective 3 + apply nat_multiple_cast_injective (by omega) + (lt_trans (ZMod.val_lt y) (by omega : 3 < p)) + (lt_trans (ZMod.val_lt y') (by omega : 3 < p)) + simpa only [firstPoint, Nat.cast_mul] using congrArg Prod.fst h + +theorem secondPoint_injective {p : ℕ} (hlarge : 200 < p) : + Function.Injective (secondPoint p) := by + rintro ⟨c,y⟩ ⟨c',y'⟩ h + have hc := c.isLt + have hc' := c'.isLt + have hy := ZMod.val_lt y + have hy' := ZMod.val_lt y' + have hcode : 2 * c.val + y.val = 2 * c'.val + y'.val := by + apply nat_multiple_cast_injective (p := p) (by omega) (by omega) (by omega) + simpa only [secondPoint, Nat.cast_mul, Nat.cast_add, Nat.cast_ofNat] + using congrArg Prod.fst h + have hcc : c.val = c'.val := by omega + have hyy : y.val = y'.val := by omega + exact Prod.ext (Fin.ext hcc) (ZMod.val_injective 2 hyy) + +theorem firstPoint_ne_secondPoint {p : ℕ} (hlarge : 200 < p) + (y : ZMod 3) (u : Fin 2 × ZMod 2) : firstPoint p y ≠ secondPoint p u := by + intro h + have hp2 : 2 < p ^ 2 := lt_of_lt_of_le (by norm_num : 2 < 201 ^ 2) + (Nat.pow_le_pow_left (by omega : 201 ≤ p) 2) + have hh := congrArg (fun s : Residues p => s.2.val) h + change (1 : ZMod (p ^ 2)).val = (2 : ZMod (p ^ 2)).val at hh + have h1 : (1 : ZMod (p ^ 2)).val = 1 := by + simpa only [Nat.cast_one] using ZMod.val_natCast_of_lt (by omega : 1 < p ^ 2) + have h2 : (2 : ZMod (p ^ 2)).val = 2 := by + simpa only [Nat.cast_ofNat] using ZMod.val_natCast_of_lt hp2 + have h12 : (1 : ℕ) = 2 := h1.symm.trans (hh.trans h2) + omega + +theorem activePoint_injective {p : ℕ} (hlarge : 200 < p) : + Function.Injective (activePoint p) := by + intro a b h + cases a with + | inl y => + cases b with + | inl y' => exact congrArg Sum.inl (firstPoint_injective hlarge h) + | inr u => exact (firstPoint_ne_secondPoint hlarge y u h).elim + | inr u => + cases b with + | inl y => exact (firstPoint_ne_secondPoint hlarge y u h.symm).elim + | inr u' => exact congrArg Sum.inr (secondPoint_injective hlarge h) + +theorem first_second_disjoint {p : ℕ} (hlarge : 200 < p) : + Disjoint (firstRegion p) (secondRegion p) := by + rw [Set.disjoint_left] + rintro s ⟨y, rfl⟩ ⟨u, hu⟩ + exact firstPoint_ne_secondPoint hlarge y u hu.symm + +theorem seven_le_pow {p : ℕ} (hlarge : 200 < p) : 7 ≤ p ^ 4 := by + exact le_trans (by norm_num : 7 ≤ 201 ^ 4) + (Nat.pow_le_pow_left (by omega : 201 ≤ p) 4) + +theorem pow_four_mod_six {p : ℕ} (hp : p.Prime) (hlarge : 200 < p) : + p ^ 4 % 6 = 1 := by + have htwo : p % 2 = 1 := hp.eq_two_or_odd.resolve_left (by omega) + have hthree : p % 3 ≠ 0 := by + intro h + have hd : 3 ∣ p := Nat.dvd_of_mod_eq_zero h + have he : 3 = p := (Nat.prime_dvd_prime_iff_eq Nat.prime_three hp).mp hd + omega + have hsix : p % 6 = 1 ∨ p % 6 = 5 := by omega + rw [Nat.pow_mod] + rcases hsix with h | h <;> norm_num [h] + +theorem six_dvd_remainder {p : ℕ} (hp : p.Prime) (hlarge : 200 < p) : + 6 ∣ p ^ 4 - 7 := by + apply Nat.dvd_of_mod_eq_zero + have hmod := pow_four_mod_six hp hlarge + have hge := seven_le_pow hlarge + omega + +theorem copyCount_mul_six {p : ℕ} (hp : p.Prime) (hlarge : 200 < p) : + copyCount p * 6 = p ^ 4 - 7 := by + exact Nat.div_mul_cancel (six_dvd_remainder hp hlarge) + +theorem six_mul_copyCount_add_seven {p : ℕ} (hp : p.Prime) + (hlarge : 200 < p) : 6 * copyCount p + 7 = p ^ 4 := by + have h := copyCount_mul_six hp hlarge + have hge := seven_le_pow hlarge + omega + +noncomputable def restEquiv {p : ℕ} (hp : p.Prime) (hlarge : 200 < p) : + Rest p ≃ InactiveLabels (copyCount p) := by + classical + letI : NeZero (p ^ 2) := ⟨pow_ne_zero 2 (by omega)⟩ + letI : Fintype (Rest p) := by unfold Rest; infer_instance + apply Fintype.equivOfCardEq + have hactive : Fintype.card (Set.range (activePoint p)) = 7 := by + rw [← Fintype.card_congr (Equiv.ofInjective _ (activePoint_injective hlarge))] + norm_num [ActiveLabels] + have hrest : Fintype.card (Rest p) = p ^ 4 - 7 := by + change Fintype.card ((Set.range (activePoint p))ᶜ : Set (Residues p)) = _ + rw [Fintype.card_compl_set, hactive] + simp only [Residues, Fintype.card_prod, ZMod.card] + congr 1 + ring + rw [hrest] + simpa [InactiveLabels, Fintype.card_prod, Nat.mul_assoc] + using (copyCount_mul_six hp hlarge).symm + +noncomputable def residueAssembly {p : ℕ} (hp : p.Prime) (hlarge : 200 < p) : + LabelledResidue (copyCount p) ≃ Residues p := by + classical + exact (Equiv.sumAssoc (ZMod 3) (Fin 2 × ZMod 2) + (InactiveLabels (copyCount p))).symm |>.trans + ((Equiv.sumCongr (Equiv.ofInjective (activePoint p) + (activePoint_injective hlarge)) (restEquiv hp hlarge).symm).trans + (Equiv.Set.sumCompl (Set.range (activePoint p)))) + +noncomputable def residueEquiv {p : ℕ} (hp : p.Prime) (hlarge : 200 < p) : + Residues p ≃ LabelledResidue (copyCount p) := + (residueAssembly hp hlarge).symm + +@[simp] theorem residueAssembly_first {p : ℕ} (hp : p.Prime) + (hlarge : 200 < p) (y : ZMod 3) : + residueAssembly hp hlarge (Sum.inl y) = firstPoint p y := rfl + +@[simp] theorem residueAssembly_second {p : ℕ} (hp : p.Prime) + (hlarge : 200 < p) (u : Fin 2 × ZMod 2) : + residueAssembly hp hlarge (Sum.inr (Sum.inl u)) = secondPoint p u := rfl + +@[simp] theorem residueEquiv_firstPoint {p : ℕ} (hp : p.Prime) + (hlarge : 200 < p) (y : ZMod 3) : + residueEquiv hp hlarge (firstPoint p y) = Sum.inl y := + (residueAssembly hp hlarge).symm_apply_apply (Sum.inl y) + +@[simp] theorem residueEquiv_secondPoint {p : ℕ} (hp : p.Prime) + (hlarge : 200 < p) (u : Fin 2 × ZMod 2) : + residueEquiv hp hlarge (secondPoint p u) = Sum.inr (Sum.inl u) := + (residueAssembly hp hlarge).symm_apply_apply (Sum.inr (Sum.inl u)) + +theorem residueEquiv_first_iff {p : ℕ} (hp : p.Prime) + (hlarge : 200 < p) (s : Residues p) : + (∃ y, residueEquiv hp hlarge s = Sum.inl y) ↔ s ∈ firstRegion p := by + constructor + · rintro ⟨y, hy⟩ + refine ⟨y, ?_⟩ + apply (residueEquiv hp hlarge).injective + rw [residueEquiv_firstPoint, hy] + · rintro ⟨y, rfl⟩ + exact ⟨y, residueEquiv_firstPoint hp hlarge y⟩ + +theorem residueEquiv_second_iff {p : ℕ} (hp : p.Prime) + (hlarge : 200 < p) (s : Residues p) : + (∃ u, residueEquiv hp hlarge s = Sum.inr (Sum.inl u)) ↔ + s ∈ secondRegion p := by + constructor + · rintro ⟨u, hu⟩ + refine ⟨u, ?_⟩ + apply (residueEquiv hp hlarge).injective + rw [residueEquiv_secondPoint, hu] + · rintro ⟨u, rfl⟩ + exact ⟨u, residueEquiv_secondPoint hp hlarge u⟩ + +def reduce (p : ℕ) (s : Residues p) : ZMod p × ZMod p := + let f := ZMod.castHom (show p ∣ p ^ 2 from ⟨p, by ring⟩) (ZMod p) + (f s.1, f s.2) + +@[simp] theorem reduce_firstPoint (p : ℕ) (y : ZMod 3) : + reduce p (firstPoint p y) = (0, 1) := by + let f : ZMod (p ^ 2) →+* ZMod p := + ZMod.castHom (show p ∣ p ^ 2 from ⟨p, by ring⟩) (ZMod p) + change (f ((p * y.val : ℕ) : ZMod (p ^ 2)), f 1) = (0, 1) + apply Prod.ext + · rw [map_natCast] + simp [Nat.cast_mul] + · exact map_one f + +@[simp] theorem reduce_secondPoint (p : ℕ) (u : Fin 2 × ZMod 2) : + reduce p (secondPoint p u) = (0, 2) := by + let f : ZMod (p ^ 2) →+* ZMod p := + ZMod.castHom (show p ∣ p ^ 2 from ⟨p, by ring⟩) (ZMod p) + change (f ((p * (2 * u.1.val + u.2.val) : ℕ) : ZMod (p ^ 2)), f 2) = (0, 2) + apply Prod.ext + · rw [map_natCast] + simp [Nat.cast_mul] + · simpa only [Nat.cast_ofNat] using map_natCast f 2 + +theorem reduce_of_firstRegion {p : ℕ} {s : Residues p} + (hs : s ∈ firstRegion p) : reduce p s = (0, 1) := by + obtain ⟨y, rfl⟩ := hs + exact reduce_firstPoint p y + +theorem reduce_of_secondRegion {p : ℕ} {s : Residues p} + (hs : s ∈ secondRegion p) : reduce p s = (0, 2) := by + obtain ⟨u, rfl⟩ := hs + exact reduce_secondPoint p u + +noncomputable def outputEquiv {p : ℕ} (hlarge : 200 < p) : + Residues p ≃ ZMod (p ^ 4) := by + letI : NeZero (p ^ 2) := ⟨pow_ne_zero 2 (by omega)⟩ + letI : NeZero (p ^ 4) := ⟨pow_ne_zero 4 (by omega)⟩ + apply Fintype.equivOfCardEq + simp only [Residues, Fintype.card_prod, ZMod.card] + ring + +end PeriodicTilingThree.SharedSeed + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/SharedSeedSizeTransport.lean b/lean/OAI/Geometry/PeriodicTiling/SharedSeedSizeTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..2eb97c952a4172d7ec8bda2826f11714ed294ac8 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/SharedSeedSizeTransport.lean @@ -0,0 +1,150 @@ +import OAI.Geometry.PeriodicTiling.SharedSeedInverse + +namespace OAI + +universe uK uΔ uA uB uR + +noncomputable section + +namespace PeriodicTilingThree.SharedSeed + +variable {K : Type uK} {Δ : Type uΔ} {A : Type uA} {B : Type uB} {R : Type uR} + [AddCommGroup K] [AddCommGroup R] {a b m n : ℕ} + +def usefulOneOfEq (ha : a = 2) (D : LabeledBlocks K A B a b) + (u : K) (s : LabelledResidue m) : ZMod a × ZMod b := by + subst a + exact usefulOne D u s + +def highOneOfEq (ha : a = 2) (D : LabeledBlocks K A B a b) + (t : ℤ) (u : K) (s : LabelledResidue m) : K := by + subst a + exact highOne D t u s + +def usefulTwoOfEq (ha : a = 3) (D : LabeledBlocks K A B a b) + (u : K) (s : LabelledResidue m) : ZMod a × ZMod b := by + subst a + exact usefulTwo D u s + +def highTwoOfEq (ha : a = 3) (D : LabeledBlocks K A B a b) + (t : ℤ) (u : K) (s : LabelledResidue m) : K := by + subst a + exact highTwo D t u s + +def oneForwardOfEq (ha : a = 2) (D : LabeledBlocks K A B a b) (S : BlockShiftData Δ a b) + (e : R ≃ LabelledResidue m) (code : R ≃ ZMod n) + (H : (K × Δ) × R → ℤ) (x : ℤ) (sx : R) (k : K) + (v : (K × Δ) × R) : ((ZMod a × ZMod b) × K) × ZMod n := + ((usefulOneOfEq ha D (k - v.1.1) (e (sx - v.2)) + S.e v.1.2, + highOneOfEq ha D (x - H v) (k - v.1.1) (e (sx - v.2))), + sharedOutput e code (x - H v) (sx - v.2)) + +def twoForwardOfEq (ha : a = 3) (D : LabeledBlocks K A B a b) (S : BlockShiftData Δ a b) + (e : R ≃ LabelledResidue m) (code : R ≃ ZMod n) + (H : (K × Δ) × R → ℤ) (x : ℤ) (sx : R) (k : K) + (v : (K × Δ) × R) : ((ZMod a × ZMod b) × K) × ZMod n := + ((usefulTwoOfEq ha D (k - v.1.1) (e (sx - v.2)) + S.e v.1.2, + highTwoOfEq ha D (x - H v) (k - v.1.1) (e (sx - v.2))), + sharedOutput e code (x - H v) (sx - v.2)) + +theorem oneForwardOfEq_bijective + (ha : a = 2) (D : LabeledBlocks K A B a b) (S : BlockShiftData Δ a b) + (e : R ≃ LabelledResidue m) (code : R ≃ ZMod n) + (H : (K × Δ) × R → ℤ) + (hA : ∀ v, (H v : ZMod a) = S.rhoA v.1.2) + (hB : ∀ v, (H v : ZMod b) = S.rhoB v.1.2) + (hOther : ∀ v, (H v : ZMod 3) = 0) (x : ℤ) (sx : R) (k : K) : + Function.Bijective (oneForwardOfEq ha D S e code H x sx k) := by + subst a + exact oneForward_bijective D S e code H hA hB hOther x sx k + +theorem twoForwardOfEq_bijective + (ha : a = 3) (D : LabeledBlocks K A B a b) (S : BlockShiftData Δ a b) + (e : R ≃ LabelledResidue m) (code : R ≃ ZMod n) + (H : (K × Δ) × R → ℤ) + (hA : ∀ v, (H v : ZMod a) = S.rhoA v.1.2) + (hB : ∀ v, (H v : ZMod b) = S.rhoB v.1.2) + (hOther : ∀ v, (H v : ZMod 2) = 0) (x : ℤ) (sx : R) (k : K) : + Function.Bijective (twoForwardOfEq ha D S e code H x sx k) := by + subst a + exact twoForward_bijective D S e code H hA hB hOther x sx k + +theorem usefulOneOfEq_active + {K : Type uK} {A : Type uA} {B : Type uB} + [AddCommGroup K] {a b m : ℕ} + (ha : a = 2) (D : LabeledBlocks K A B a b) + (u : K) {s : LabelledResidue m} (hs : ActiveOne s) : usefulOneOfEq ha D u s = D.C u := by + subst a + rcases s with y | (⟨c, y⟩ | ⟨c, y, z⟩) + · rfl + · exact False.elim hs + · exact False.elim hs + +theorem usefulTwoOfEq_active + {K : Type uK} {A : Type uA} {B : Type uB} + [AddCommGroup K] {a b m : ℕ} + (ha : a = 3) (D : LabeledBlocks K A B a b) + (u : K) {s : LabelledResidue m} (hs : ActiveTwo s) : usefulTwoOfEq ha D u s = D.C u := by + subst a + rcases s with y | (⟨c, y⟩ | ⟨c, y, z⟩) + · exact False.elim hs + · rfl + · exact False.elim hs + +theorem usefulOneOfEq_inactive_eq + {K : Type uK} {A : Type uA} {B : Type uB} + [AddCommGroup K] {a b m : ℕ} + (ha : a = 2) (D : LabeledBlocks K A B a b) + (u v : K) {s : LabelledResidue m} (hs : ¬ ActiveOne s) : + usefulOneOfEq ha D u s = usefulOneOfEq ha D v s := by + subst a + rcases s with y | (⟨c, y⟩ | ⟨c, y, z⟩) + · exact False.elim (hs trivial) + · rfl + · rfl + +theorem usefulTwoOfEq_inactive_eq + {K : Type uK} {A : Type uA} {B : Type uB} + [AddCommGroup K] {a b m : ℕ} + (ha : a = 3) (D : LabeledBlocks K A B a b) + (u v : K) {s : LabelledResidue m} (hs : ¬ ActiveTwo s) : + usefulTwoOfEq ha D u s = usefulTwoOfEq ha D v s := by + subst a + rcases s with y | (⟨c, y⟩ | ⟨c, y, z⟩) + · rfl + · exact False.elim (hs trivial) + · rfl + +theorem usefulOneOfEq_activity_iff (ha : a = 2) (D : LabeledBlocks K A B a b) + (rel : K → K → Prop) (hC : ∃ u v, rel u v ∧ D.C u ≠ D.C v) + (s : LabelledResidue m) : + (∃ u v, rel u v ∧ usefulOneOfEq ha D u s ≠ usefulOneOfEq ha D v s) ↔ ActiveOne s := by + classical + constructor + · rintro ⟨u, v, _, hne⟩ + by_contra hs + exact hne (usefulOneOfEq_inactive_eq ha D u v hs) + · intro hs + obtain ⟨u, v, huv, hne⟩ := hC + refine ⟨u, v, huv, ?_⟩ + simpa only [usefulOneOfEq_active ha D u hs, usefulOneOfEq_active ha D v hs] using hne + +theorem usefulTwoOfEq_activity_iff (ha : a = 3) (D : LabeledBlocks K A B a b) + (rel : K → K → Prop) (hC : ∃ u v, rel u v ∧ D.C u ≠ D.C v) + (s : LabelledResidue m) : + (∃ u v, rel u v ∧ usefulTwoOfEq ha D u s ≠ usefulTwoOfEq ha D v s) ↔ ActiveTwo s := by + classical + constructor + · rintro ⟨u, v, _, hne⟩ + by_contra hs + exact hne (usefulTwoOfEq_inactive_eq ha D u v hs) + · intro hs + obtain ⟨u, v, huv, hne⟩ := hC + refine ⟨u, v, huv, ?_⟩ + simpa only [usefulTwoOfEq_active ha D u hs, usefulTwoOfEq_active ha D v hs] using hne + +end PeriodicTilingThree.SharedSeed + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/ShiftMultiplicity.lean b/lean/OAI/Geometry/PeriodicTiling/ShiftMultiplicity.lean new file mode 100644 index 0000000000000000000000000000000000000000..52cb945752a61a556cfe9f93c87e49b3bf96b9cf --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/ShiftMultiplicity.lean @@ -0,0 +1,255 @@ +import Mathlib.Data.ZMod.Basic +import Mathlib.Algebra.BigOperators.Ring.Finset +import Mathlib.Data.Fintype.BigOperators +import Mathlib.Data.Fintype.EquivFin +import Mathlib.Logic.Equiv.Prod +import Mathlib.Tactic.NormNum + +namespace OAI + +universe uM + +namespace PeriodicTilingThree + +open scoped BigOperators + +def shiftMultiplicity (a b : ℕ) (e : ZMod a × ZMod b) : ℕ := + if e.2 = 0 then + if e.1 = 0 then 2 else if e.1 = 1 then 0 else 1 + else if e.2 = 1 then + if e.1 = 0 then 0 else if e.1 = 1 then 2 else 1 + else 1 + +def shiftOmega (a b : ℕ) (e : ZMod a × ZMod b) : ℤ := + ((if e.1 = 0 then 1 else 0) - (if e.1 = 1 then 1 else 0)) * + ((if e.2 = 0 then 1 else 0) - (if e.2 = 1 then 1 else 0)) + +abbrev ShiftIndex (a b : ℕ) := + Σ e : ZMod a × ZMod b, Fin (shiftMultiplicity a b e) + +def shift (a b : ℕ) (δ : ShiftIndex a b) : ZMod a × ZMod b := δ.1 + +section Counts + +variable {a b : ℕ} [NeZero a] [NeZero b] + +theorem shiftMultiplicity_cast {a b : ℕ} [NeZero a] [NeZero b] (ha : 2 ≤ a) (hb : 2 ≤ b) + (e : ZMod a × ZMod b) : + (shiftMultiplicity a b e : ℤ) = 1 + shiftOmega a b e := by + let : Fact (1 < a) := ⟨ha⟩ + let : Fact (1 < b) := ⟨hb⟩ + have ha01 : (0 : ZMod a) ≠ 1 := zero_ne_one + have hb01 : (0 : ZMod b) ≠ 1 := zero_ne_one + by_cases hα0 : e.1 = 0 <;> by_cases hα1 : e.1 = 1 <;> + by_cases hξ0 : e.2 = 0 <;> by_cases hξ1 : e.2 = 1 <;> + simp_all [shiftMultiplicity, shiftOmega] + +@[simp] theorem shiftMultiplicity_zero {a b : ℕ} [NeZero a] [NeZero b] : + shiftMultiplicity a b (0, 0) = 2 := by + simp [shiftMultiplicity] + +theorem sum_shiftMultiplicity_fst (ha : 2 ≤ a) (hb : 2 ≤ b) + (ξ : ZMod b) : + ∑ α : ZMod a, shiftMultiplicity a b (α, ξ) = a := by + have hω : (∑ α : ZMod a, shiftOmega a b (α, ξ)) = 0 := by + unfold shiftOmega + dsimp only + rw [← Finset.sum_mul (Finset.univ : Finset (ZMod a)) + (fun α : ZMod a => + (if α = 0 then (1 : ℤ) else 0) - + (if α = 1 then (1 : ℤ) else 0)) + ((if ξ = 0 then (1 : ℤ) else 0) - + (if ξ = 1 then (1 : ℤ) else 0))] + rw [Finset.sum_sub_distrib] + simp + have h : (∑ α : ZMod a, (shiftMultiplicity a b (α, ξ) : ℤ)) = a := by + simp_rw [shiftMultiplicity_cast ha hb] + rw [Finset.sum_add_distrib, hω] + simp [ZMod.card] + exact_mod_cast h + +theorem sum_shiftMultiplicity_snd (ha : 2 ≤ a) (hb : 2 ≤ b) + (α : ZMod a) : + ∑ ξ : ZMod b, shiftMultiplicity a b (α, ξ) = b := by + have hω : (∑ ξ : ZMod b, shiftOmega a b (α, ξ)) = 0 := by + unfold shiftOmega + dsimp only + rw [← Finset.mul_sum (Finset.univ : Finset (ZMod b)) + (fun ξ : ZMod b => + (if ξ = 0 then (1 : ℤ) else 0) - + (if ξ = 1 then (1 : ℤ) else 0)) + ((if α = 0 then (1 : ℤ) else 0) - + (if α = 1 then (1 : ℤ) else 0))] + rw [Finset.sum_sub_distrib] + simp + have h : (∑ ξ : ZMod b, (shiftMultiplicity a b (α, ξ) : ℤ)) = b := by + simp_rw [shiftMultiplicity_cast ha hb] + rw [Finset.sum_add_distrib, hω] + simp [ZMod.card] + exact_mod_cast h + +theorem sum_shiftMultiplicity (ha : 2 ≤ a) (hb : 2 ≤ b) : + ∑ e : ZMod a × ZMod b, shiftMultiplicity a b e = a * b := by + rw [Fintype.sum_prod_type] + simp_rw [sum_shiftMultiplicity_snd ha hb] + simp [ZMod.card] + +theorem card_shiftIndex (ha : 2 ≤ a) (hb : 2 ≤ b) : + Fintype.card (ShiftIndex a b) = a * b := by + simpa only [ShiftIndex, Fintype.card_sigma, Fintype.card_fin] using + sum_shiftMultiplicity ha hb + +theorem sum_shift {M : Type uM} [AddCommMonoid M] (f : ZMod a × ZMod b → M) : + (∑ δ : ShiftIndex a b, f (shift a b δ)) = + ∑ e : ZMod a × ZMod b, shiftMultiplicity a b e • f e := by + simp [ShiftIndex, shift, Fintype.sum_sigma] + +private def shiftFibreEquiv (e : ZMod a × ZMod b) : + {δ : ShiftIndex a b // shift a b δ = e} ≃ Fin (shiftMultiplicity a b e) where + toFun δ := by + rcases δ with ⟨⟨e', k⟩, h⟩ + change e' = e at h + subst e' + exact k + invFun k := ⟨⟨e, k⟩, rfl⟩ + left_inv := by + rintro ⟨⟨e', k⟩, h⟩ + change e' = e at h + subst e' + rfl + right_inv _ := rfl + +theorem card_shift_fibre (e : ZMod a × ZMod b) : + Fintype.card {δ : ShiftIndex a b // shift a b δ = e} = + shiftMultiplicity a b e := by + simpa using Fintype.card_congr (shiftFibreEquiv e) + +private def shiftFibreAEquiv (ξ : ZMod b) : + {δ : ShiftIndex a b // (shift a b δ).2 = ξ} ≃ + Σ α : ZMod a, Fin (shiftMultiplicity a b (α, ξ)) where + toFun δ := by + rcases δ with ⟨⟨⟨α, ξ'⟩, k⟩, h⟩ + change ξ' = ξ at h + subst ξ' + exact ⟨α, k⟩ + invFun δ := ⟨⟨(δ.1, ξ), δ.2⟩, rfl⟩ + left_inv := by + rintro ⟨⟨⟨α, ξ'⟩, k⟩, h⟩ + change ξ' = ξ at h + subst ξ' + rfl + right_inv _ := rfl + +private def shiftFibreBEquiv (α : ZMod a) : + {δ : ShiftIndex a b // (shift a b δ).1 = α} ≃ + Σ ξ : ZMod b, Fin (shiftMultiplicity a b (α, ξ)) where + toFun δ := by + rcases δ with ⟨⟨⟨α', ξ⟩, k⟩, h⟩ + change α' = α at h + subst α' + exact ⟨ξ, k⟩ + invFun δ := ⟨⟨(α, δ.1), δ.2⟩, rfl⟩ + left_inv := by + rintro ⟨⟨⟨α', ξ⟩, k⟩, h⟩ + change α' = α at h + subst α' + rfl + right_inv _ := rfl + +theorem card_shift_fibreA (ha : 2 ≤ a) (hb : 2 ≤ b) (ξ : ZMod b) : + Fintype.card {δ : ShiftIndex a b // (shift a b δ).2 = ξ} = a := by + calc + _ = Fintype.card (Σ α : ZMod a, Fin (shiftMultiplicity a b (α, ξ))) := + Fintype.card_congr (shiftFibreAEquiv ξ) + _ = a := by + simpa only [Fintype.card_sigma, Fintype.card_fin] using + sum_shiftMultiplicity_fst ha hb ξ + +theorem card_shift_fibreB (ha : 2 ≤ a) (hb : 2 ≤ b) (α : ZMod a) : + Fintype.card {δ : ShiftIndex a b // (shift a b δ).1 = α} = b := by + calc + _ = Fintype.card (Σ ξ : ZMod b, Fin (shiftMultiplicity a b (α, ξ))) := + Fintype.card_congr (shiftFibreBEquiv α) + _ = b := by + simpa only [Fintype.card_sigma, Fintype.card_fin] using + sum_shiftMultiplicity_snd ha hb α + +end Counts + +section Orderings + +variable {a b : ℕ} [NeZero a] [NeZero b] (ha : 2 ≤ a) (hb : 2 ≤ b) + +noncomputable def fibreOrderA (ξ : ZMod b) : + {δ : ShiftIndex a b // (shift a b δ).2 = ξ} ≃ ZMod a := + Fintype.equivOfCardEq ((card_shift_fibreA ha hb ξ).trans (ZMod.card a).symm) + +noncomputable def fibreOrderB (α : ZMod a) : + {δ : ShiftIndex a b // (shift a b δ).1 = α} ≃ ZMod b := + Fintype.equivOfCardEq ((card_shift_fibreB ha hb α).trans (ZMod.card b).symm) + +noncomputable def rhoA (δ : ShiftIndex a b) : ZMod a := + fibreOrderA ha hb (shift a b δ).2 ⟨δ, rfl⟩ - (shift a b δ).1 + +noncomputable def rhoB (δ : ShiftIndex a b) : ZMod b := + fibreOrderB ha hb (shift a b δ).1 ⟨δ, rfl⟩ - (shift a b δ).2 + +theorem fibreOrderA_apply (ξ : ZMod b) + (δ : {δ : ShiftIndex a b // (shift a b δ).2 = ξ}) : + fibreOrderA ha hb ξ δ = (shift a b δ.1).1 + rhoA ha hb δ.1 := by + rcases δ with ⟨δ, h⟩ + subst ξ + simp [rhoA] + +theorem fibreOrderB_apply (α : ZMod a) + (δ : {δ : ShiftIndex a b // (shift a b δ).1 = α}) : + fibreOrderB ha hb α δ = (shift a b δ.1).2 + rhoB ha hb δ.1 := by + rcases δ with ⟨δ, h⟩ + subst α + simp [rhoB] + +noncomputable def shiftOrderA : ShiftIndex a b ≃ ZMod b × ZMod a := + (Equiv.sigmaFiberEquiv (fun δ : ShiftIndex a b => (shift a b δ).2)).symm.trans + (Equiv.sigmaEquivProdOfEquiv (fibreOrderA ha hb)) + +noncomputable def shiftOrderB : ShiftIndex a b ≃ ZMod a × ZMod b := + (Equiv.sigmaFiberEquiv (fun δ : ShiftIndex a b => (shift a b δ).1)).symm.trans + (Equiv.sigmaEquivProdOfEquiv (fibreOrderB ha hb)) + +theorem shiftOrderA_apply (δ : ShiftIndex a b) : + shiftOrderA ha hb δ = ((shift a b δ).2, (shift a b δ).1 + rhoA ha hb δ) := by + change ((shift a b δ).2, fibreOrderA ha hb (shift a b δ).2 ⟨δ, rfl⟩) = _ + exact congrArg (fun z : ZMod a => ((shift a b δ).2, z)) + (fibreOrderA_apply ha hb (shift a b δ).2 ⟨δ, rfl⟩) + +theorem shiftOrderB_apply (δ : ShiftIndex a b) : + shiftOrderB ha hb δ = ((shift a b δ).1, (shift a b δ).2 + rhoB ha hb δ) := by + change ((shift a b δ).1, fibreOrderB ha hb (shift a b δ).1 ⟨δ, rfl⟩) = _ + exact congrArg (fun z : ZMod b => ((shift a b δ).1, z)) + (fibreOrderB_apply ha hb (shift a b δ).1 ⟨δ, rfl⟩) + +theorem bijective_fibreOrderA (ξ : ZMod b) : + Function.Bijective (fun δ : {δ : ShiftIndex a b // (shift a b δ).2 = ξ} => + (shift a b δ.1).1 + rhoA ha hb δ.1) := by + have he : (fun δ : {δ : ShiftIndex a b // (shift a b δ).2 = ξ} => + (shift a b δ.1).1 + rhoA ha hb δ.1) = (fibreOrderA ha hb ξ) := by + funext δ + exact (fibreOrderA_apply ha hb ξ δ).symm + rw [he] + exact (fibreOrderA ha hb ξ).bijective + +theorem bijective_fibreOrderB (α : ZMod a) : + Function.Bijective (fun δ : {δ : ShiftIndex a b // (shift a b δ).1 = α} => + (shift a b δ.1).2 + rhoB ha hb δ.1) := by + have he : (fun δ : {δ : ShiftIndex a b // (shift a b δ).1 = α} => + (shift a b δ.1).2 + rhoB ha hb δ.1) = (fibreOrderB ha hb α) := by + funext δ + exact (fibreOrderB_apply ha hb α δ).symm + rw [he] + exact (fibreOrderB ha hb α).bijective + +end Orderings + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/Stacking.lean b/lean/OAI/Geometry/PeriodicTiling/Stacking.lean new file mode 100644 index 0000000000000000000000000000000000000000..b63a5e2eadaf19d1fe2ea47c2fe1ddb61240d5d4 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/Stacking.lean @@ -0,0 +1,93 @@ +import OAI.Geometry.PeriodicTiling.StackingContributions +import OAI.Geometry.PeriodicTiling.TilingTransport + +namespace OAI + +universe uH uK uι + +namespace PeriodicTilingThree + +section Stacking + +variable {H : Type uH} {K : Type uK} {ι : Type uι} [AddCommGroup H] [AddCommGroup K] +variable [Fintype K] [Fintype ι] + +theorem tiles_stack_lift + {H : Type uH} {K : Type uK} {ι : Type uι} + [AddCommGroup H] [AddCommGroup K] [Fintype K] [Fintype ι] + {F : ι → Finset H} {E : ι → Finset K} {A : Set H} + (hpart : IsColorPartition E) (hA : ∀ ν, Tiles (F ν) A) : + Tiles (stack F E) (A ×ˢ ({0} : Set K)) := by + classical + apply tiles_iff_unique_tile.mpr + intro x + obtain ⟨ν, hν, _⟩ := hpart x.2 + obtain ⟨f, hf, huniq⟩ := tiles_iff_unique_tile.mp (hA ν) x.1 + refine ⟨⟨((f : H), x.2), mem_stack.mpr ⟨ν, f.property, hν⟩⟩, ?_, ?_⟩ + · change x.1 - (f : H) ∈ A ∧ x.2 - x.2 ∈ ({0} : Set K) + exact ⟨hf, by simp⟩ + · intro y hy + change x.1 - y.1.1 ∈ A ∧ x.2 - y.1.2 ∈ ({0} : Set K) at hy + obtain ⟨μ, hyF, hyE⟩ := mem_stack.mp y.property + have hy2 : y.1.2 = x.2 := (sub_eq_zero.mp (Set.mem_singleton_iff.mp hy.2)).symm + have hμν : μ = ν := hpart.eq_of_mem (hy2 ▸ hyE) hν + cases hμν + have hy1 : (⟨y.1.1, hyF⟩ : ↥(F ν)) = f := huniq ⟨y.1.1, hyF⟩ hy.1 + apply Subtype.ext + exact Prod.ext (congrArg Subtype.val hy1) hy2 + +theorem fullyPeriodic_stack_lift {A : Set H} (hA : FullyPeriodic A) : + FullyPeriodic (A ×ˢ ({0} : Set K)) := + hA.prod_singleton_zero + +theorem fullyPeriodic_stack_project + {H : Type uH} {K : Type uK} + [AddCommGroup H] [AddCommGroup K] [Fintype K] + {B : Set (H × K)} (hB : FullyPeriodic B) : + FullyPeriodic (Prod.fst '' B) := + FullyPeriodic.image_of_surjective (AddMonoidHom.fst H K) + (fun x => ⟨(x, 0), rfl⟩) hB + +theorem exists_tiles_stack_iff {F : ι → Finset H} {E : ι → Finset K} + (hpart : IsColorPartition E) (hfull : HasFullDifferences E) + (hE : ∀ ν, (E ν).Nonempty) : + (∃ A : Set H, ∀ ν, Tiles (F ν) A) ↔ + ∃ B : Set (H × K), Tiles (stack F E) B := by + constructor + · rintro ⟨A, hA⟩ + exact ⟨A ×ˢ ({0} : Set K), tiles_stack_lift hpart hA⟩ + · rintro ⟨B, hB⟩ + exact ⟨Prod.fst '' B, tiles_of_tiles_stack hpart hfull hE hB⟩ + +theorem exists_fullyPeriodic_tiles_stack_iff + {F : ι → Finset H} {E : ι → Finset K} + (hpart : IsColorPartition E) (hfull : HasFullDifferences E) + (hE : ∀ ν, (E ν).Nonempty) : + (∃ A : Set H, (∀ ν, Tiles (F ν) A) ∧ FullyPeriodic A) ↔ + ∃ B : Set (H × K), Tiles (stack F E) B ∧ FullyPeriodic B := by + constructor + · rintro ⟨A, hA, hperiod⟩ + exact ⟨A ×ˢ ({0} : Set K), tiles_stack_lift hpart hA, + fullyPeriodic_stack_lift hperiod⟩ + · rintro ⟨B, hB, hperiod⟩ + exact ⟨Prod.fst '' B, tiles_of_tiles_stack hpart hfull hE hB, + fullyPeriodic_stack_project hperiod⟩ + +theorem stack_counterexample_of_common_system [Nonempty ι] + {F : ι → Finset H} {E : ι → Finset K} + (hF : ∀ ν, (F ν).Nonempty) (hE : ∀ ν, (E ν).Nonempty) + (hpart : IsColorPartition E) (hfull : HasFullDifferences E) + (hcommon : ∃ A : Set H, ∀ ν, Tiles (F ν) A) + (hnone : ∀ A : Set H, (∀ ν, Tiles (F ν) A) → ¬ FullyPeriodic A) : + (stack F E).Nonempty ∧ (∃ B, Tiles (stack F E) B) ∧ + ∀ B, Tiles (stack F E) B → ¬ FullyPeriodic B := by + refine ⟨stack_nonempty hF hE, (exists_tiles_stack_iff hpart hfull hE).mp hcommon, ?_⟩ + intro B hB hperiod + exact hnone (Prod.fst '' B) (tiles_of_tiles_stack hpart hfull hE hB) + (fullyPeriodic_stack_project hperiod) + +end Stacking + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/StackingContributions.lean b/lean/OAI/Geometry/PeriodicTiling/StackingContributions.lean new file mode 100644 index 0000000000000000000000000000000000000000..cfb6a8ae150c88ad90a1b239b0e688a515b6ff5d --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/StackingContributions.lean @@ -0,0 +1,275 @@ +import OAI.Geometry.PeriodicTiling.TilingBasic +import Mathlib.Data.Finset.Prod +import Mathlib.Data.Finset.Union +import Mathlib.Data.Fintype.BigOperators +import Mathlib.Algebra.Order.BigOperators.Group.Finset +import Mathlib.Tactic.Abel +import Lean.Elab.Tactic.Omega + +namespace OAI + +universe uH uK uι + +namespace PeriodicTilingThree + +section FiniteStack + +variable {H : Type uH} {K : Type uK} {ι : Type uι} [Fintype ι] + +def IsColorPartition (E : ι → Finset K) : Prop := + ∀ t : K, ∃! ν : ι, t ∈ E ν + +def HasFullDifferences [AddGroup K] (E : ι → Finset K) : Prop := + ∀ (ν : ι) (d : K), ∃ e ∈ E ν, ∃ e' ∈ E ν, e - e' = d + +noncomputable def stack (F : ι → Finset H) (E : ι → Finset K) : + Finset (H × K) := by + classical + exact Finset.univ.biUnion (fun ν => (F ν).product (E ν)) + +@[simp] theorem mem_stack {F : ι → Finset H} {E : ι → Finset K} {p : H × K} : + p ∈ stack F E ↔ ∃ ν, p.1 ∈ F ν ∧ p.2 ∈ E ν := by + classical + simp [stack] + +theorem stack_nonempty [Nonempty ι] {F : ι → Finset H} {E : ι → Finset K} + (hF : ∀ ν, (F ν).Nonempty) (hE : ∀ ν, (E ν).Nonempty) : + (stack F E).Nonempty := by + obtain ⟨ν⟩ := ‹Nonempty ι› + obtain ⟨f, hf⟩ := hF ν + obtain ⟨e, he⟩ := hE ν + exact ⟨(f, e), mem_stack.mpr ⟨ν, hf, he⟩⟩ + +theorem IsColorPartition.eq_of_mem + {K : Type uK} {ι : Type uι} [Fintype ι] + {E : ι → Finset K} (hpart : IsColorPartition E) + {ν μ : ι} {e : K} (hν : e ∈ E ν) (hμ : e ∈ E μ) : ν = μ := by + obtain ⟨i, _, hi⟩ := hpart e + exact (hi ν hν).trans (hi μ hμ).symm + +theorem HasFullDifferences.nonempty + {K : Type uK} {ι : Type uι} [Fintype ι] + [AddGroup K] {E : ι → Finset K} + (hfull : HasFullDifferences E) (ν : ι) : (E ν).Nonempty := by + obtain ⟨e, he, _, _, _⟩ := hfull ν 0 + exact ⟨e, he⟩ + +theorem card_stack {F : ι → Finset H} {E : ι → Finset K} + (hpart : IsColorPartition E) : + (stack F E).card = ∑ ν, (F ν).card * (E ν).card := by + classical + have hdisj : ((Finset.univ : Finset ι) : Set ι).PairwiseDisjoint + (fun ν => (F ν).product (E ν)) := by + intro ν _ μ _ hne + apply Finset.disjoint_left.mpr + intro p hp hp' + exact hne (hpart.eq_of_mem (Finset.mem_product.mp hp).2 + (Finset.mem_product.mp hp').2) + simpa only [stack, Finset.product_eq_sprod, Finset.card_product] using + Finset.card_biUnion hdisj + +theorem IsColorPartition.sum_card [Fintype K] {E : ι → Finset K} + (hpart : IsColorPartition E) : ∑ ν, (E ν).card = Fintype.card K := by + classical + let f : (Σ ν, ↥(E ν)) → K := fun z => z.2.1 + have hf : Function.Bijective f := by + constructor + · rintro ⟨ν, e⟩ ⟨μ, e'⟩ heq + change (e : K) = (e' : K) at heq + have hνμ : ν = μ := hpart.eq_of_mem e.property (heq.symm ▸ e'.property) + cases hνμ + have he : e = e' := Subtype.ext heq + cases he + rfl + · intro e + obtain ⟨ν, hν, _⟩ := hpart e + exact ⟨⟨ν, ⟨e, hν⟩⟩, rfl⟩ + simpa only [Fintype.card_sigma, Fintype.card_coe] using + Fintype.card_congr (Equiv.ofBijective f hf) + +end FiniteStack + +section Contributions + +variable {H : Type uH} {K : Type uK} {ι : Type uι} [AddCommGroup H] [AddCommGroup K] +variable [Fintype K] [Fintype ι] + +noncomputable def stackContributions (F : ι → Finset H) (B : Set (H × K)) + (g : H) (ν : ι) : Finset (H × K) := by + classical + exact ((F ν).product Finset.univ).filter (fun ft => (g - ft.1, ft.2) ∈ B) + +@[simp] theorem mem_stackContributions + {H : Type uH} {K : Type uK} {ι : Type uι} + [AddCommGroup H] [AddCommGroup K] [Fintype K] [Fintype ι] + {F : ι → Finset H} {B : Set (H × K)} + {g : H} {ν : ι} {c : H × K} : + c ∈ stackContributions F B g ν ↔ c.1 ∈ F ν ∧ (g - c.1, c.2) ∈ B := by + classical + simp [stackContributions] + +theorem stackContributions_eq_of_mem {F : ι → Finset H} {E : ι → Finset K} + {B : Set (H × K)} (hfull : HasFullDifferences E) (hB : Tiles (stack F E) B) + {g : H} {ν : ι} {c c' : H × K} + (hc : c ∈ stackContributions F B g ν) + (hc' : c' ∈ stackContributions F B g ν) : c = c' := by + obtain ⟨hcf, hcB⟩ := mem_stackContributions.mp hc + obtain ⟨hc'f, hc'B⟩ := mem_stackContributions.mp hc' + obtain ⟨e, he, e', he', hd⟩ := hfull ν (c'.2 - c.2) + have hvertical : c.2 + e = c'.2 + e' := by + calc + c.2 + e = c.2 + (e - e') + e' := by abel + _ = c.2 + (c'.2 - c.2) + e' := by rw [hd] + _ = c'.2 + e' := by abel + let p : ↥(stack F E) × B := + (⟨(c.1, e), mem_stack.mpr ⟨ν, hcf, he⟩⟩, ⟨(g - c.1, c.2), hcB⟩) + let p' : ↥(stack F E) × B := + (⟨(c'.1, e'), mem_stack.mpr ⟨ν, hc'f, he'⟩⟩, ⟨(g - c'.1, c'.2), hc'B⟩) + have hp : p = p' := by + apply hB.1 + apply Prod.ext + · change c.1 + (g - c.1) = c'.1 + (g - c'.1) + simp + · change e + c.2 = e' + c'.2 + simpa only [add_comm] using hvertical + apply Prod.ext + · exact congrArg (fun z : ↥(stack F E) × B => z.1.1.1) hp + · exact congrArg (fun z : ↥(stack F E) × B => z.2.1.2) hp + +theorem stackContributions_card_le_one {F : ι → Finset H} {E : ι → Finset K} + {B : Set (H × K)} (hfull : HasFullDifferences E) (hB : Tiles (stack F E) B) + (g : H) (ν : ι) : (stackContributions F B g ν).card ≤ 1 := by + classical + exact Finset.card_le_one.mpr fun _ hc _ hc' => + stackContributions_eq_of_mem hfull hB hc hc' + +theorem stack_projection_injective [Nonempty ι] + {F : ι → Finset H} {E : ι → Finset K} {B : Set (H × K)} + (hF : ∀ ν, (F ν).Nonempty) (hfull : HasFullDifferences E) + (hB : Tiles (stack F E) B) : Set.InjOn Prod.fst B := by + obtain ⟨ν⟩ := ‹Nonempty ι› + obtain ⟨f, hf⟩ := hF ν + intro b hb b' hb' heq + have hc : (f, b.2) ∈ stackContributions F B (b.1 + f) ν := by + apply mem_stackContributions.mpr + exact ⟨hf, by simpa using hb⟩ + have hc' : (f, b'.2) ∈ stackContributions F B (b.1 + f) ν := by + apply mem_stackContributions.mpr + refine ⟨hf, ?_⟩ + simpa [heq] using hb' + have ht := congrArg Prod.snd (stackContributions_eq_of_mem hfull hB hc hc') + exact Prod.ext heq ht + +def StackFiber (F : ι → Finset H) (E : ι → Finset K) + (B : Set (H × K)) (g : H) := + Σ ν : ι, ↥(stackContributions F B g ν) × ↥(E ν) + +def stackFiberSum {F : ι → Finset H} {E : ι → Finset K} + {B : Set (H × K)} {g : H} (z : StackFiber F E B g) : K := + z.2.1.1.2 + z.2.2.1 + +theorem stackFiberSum_bijective {F : ι → Finset H} {E : ι → Finset K} + {B : Set (H × K)} (hpart : IsColorPartition E) (hB : Tiles (stack F E) B) + (g : H) : Function.Bijective (stackFiberSum (F := F) (E := E) (B := B) (g := g)) := by + classical + constructor + · rintro ⟨ν, c, e⟩ ⟨μ, c', e'⟩ heq + obtain ⟨hcf, hcB⟩ := mem_stackContributions.mp c.property + obtain ⟨hc'f, hc'B⟩ := mem_stackContributions.mp c'.property + let p : ↥(stack F E) × B := + (⟨(c.1.1, e.1), mem_stack.mpr ⟨ν, hcf, e.property⟩⟩, + ⟨(g - c.1.1, c.1.2), hcB⟩) + let p' : ↥(stack F E) × B := + (⟨(c'.1.1, e'.1), mem_stack.mpr ⟨μ, hc'f, e'.property⟩⟩, + ⟨(g - c'.1.1, c'.1.2), hc'B⟩) + have hp : p = p' := by + apply hB.1 + apply Prod.ext + · change c.1.1 + (g - c.1.1) = c'.1.1 + (g - c'.1.1) + simp + · change e.1 + c.1.2 = e'.1 + c'.1.2 + simpa only [stackFiberSum, add_comm] using heq + have hf : c.1.1 = c'.1.1 := + congrArg (fun z : ↥(stack F E) × B => z.1.1.1) hp + have ht : c.1.2 = c'.1.2 := + congrArg (fun z : ↥(stack F E) × B => z.2.1.2) hp + have he : (e : K) = (e' : K) := + congrArg (fun z : ↥(stack F E) × B => z.1.1.2) hp + have hνμ : ν = μ := hpart.eq_of_mem e.property (he.symm ▸ e'.property) + cases hνμ + have hc : c = c' := Subtype.ext (Prod.ext hf ht) + have he' : e = e' := Subtype.ext he + cases hc + cases he' + rfl + · intro u + obtain ⟨p, hp⟩ := hB.2 (g, u) + obtain ⟨ν, hf, he⟩ := mem_stack.mp p.1.property + have hhorizontal : p.1.1.1 + p.2.1.1 = g := congrArg Prod.fst hp + have hcenter : g - p.1.1.1 = p.2.1.1 := by + rw [← hhorizontal] + simp + have hc : (p.1.1.1, p.2.1.2) ∈ stackContributions F B g ν := by + apply mem_stackContributions.mpr + exact ⟨hf, by simpa only [hcenter] using p.2.property⟩ + refine ⟨⟨ν, ⟨(p.1.1.1, p.2.1.2), hc⟩, ⟨p.1.1.2, he⟩⟩, ?_⟩ + change p.2.1.2 + p.1.1.2 = u + have hvertical : p.1.1.2 + p.2.1.2 = u := congrArg Prod.snd hp + simpa only [add_comm] using hvertical + +theorem stackContributions_sum_card {F : ι → Finset H} {E : ι → Finset K} + {B : Set (H × K)} (hpart : IsColorPartition E) (hB : Tiles (stack F E) B) + (g : H) : + ∑ ν, (stackContributions F B g ν).card * (E ν).card = Fintype.card K := by + classical + let e : (Σ ν : ι, ↥(stackContributions F B g ν) × ↥(E ν)) ≃ K := + Equiv.ofBijective (stackFiberSum (F := F) (E := E) (B := B) (g := g)) + (stackFiberSum_bijective hpart hB g) + simpa only [Fintype.card_sigma, Fintype.card_prod, Fintype.card_coe] using + Fintype.card_congr e + +theorem stackContributions_card_eq_one {F : ι → Finset H} {E : ι → Finset K} + {B : Set (H × K)} (hpart : IsColorPartition E) (hfull : HasFullDifferences E) + (hE : ∀ ν, (E ν).Nonempty) (hB : Tiles (stack F E) B) + (g : H) (ν : ι) : (stackContributions F B g ν).card = 1 := by + classical + have hle := stackContributions_card_le_one hfull hB g ν + by_contra hne + have hz : (stackContributions F B g ν).card = 0 := by omega + have hstrict : + (∑ i, (stackContributions F B g i).card * (E i).card) < ∑ i, (E i).card := by + apply Finset.sum_lt_sum + · intro i _ + calc + (stackContributions F B g i).card * (E i).card ≤ 1 * (E i).card := + Nat.mul_le_mul_right _ (stackContributions_card_le_one hfull hB g i) + _ = (E i).card := one_mul _ + · exact ⟨ν, Finset.mem_univ ν, by simpa only [hz, zero_mul] using (hE ν).card_pos⟩ + rw [stackContributions_sum_card hpart hB g, hpart.sum_card] at hstrict + exact (lt_irrefl _) hstrict + +theorem tiles_of_tiles_stack {F : ι → Finset H} {E : ι → Finset K} + {B : Set (H × K)} (hpart : IsColorPartition E) (hfull : HasFullDifferences E) + (hE : ∀ ν, (E ν).Nonempty) (hB : Tiles (stack F E) B) : + ∀ ν, Tiles (F ν) (Prod.fst '' B) := by + classical + intro ν + apply tiles_iff_unique_tile.mpr + intro g + have hcard := stackContributions_card_eq_one hpart hfull hE hB g ν + obtain ⟨c, hc⟩ := Finset.card_pos.mp (by omega : 0 < (stackContributions F B g ν).card) + obtain ⟨hcf, hcB⟩ := mem_stackContributions.mp hc + refine ⟨⟨c.1, hcf⟩, ⟨(g - c.1, c.2), hcB, rfl⟩, ?_⟩ + intro f hf + obtain ⟨b, hb, hbf⟩ := hf + have hc' : ((f : H), b.2) ∈ stackContributions F B g ν := by + apply mem_stackContributions.mpr + exact ⟨f.property, by simpa only [← hbf] using hb⟩ + apply Subtype.ext + exact congrArg Prod.fst (stackContributions_eq_of_mem hfull hB hc' hc) + +end Contributions + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/SystemObstruction.lean b/lean/OAI/Geometry/PeriodicTiling/SystemObstruction.lean new file mode 100644 index 0000000000000000000000000000000000000000..fb457c7fd6e4894237fff5c4a28d8321ab55c496 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/SystemObstruction.lean @@ -0,0 +1,35 @@ +import OAI.Geometry.PeriodicTiling.ActivityWord +import OAI.Geometry.PeriodicTiling.SeedSymbols +import OAI.Geometry.PeriodicTiling.WordObstruction + +namespace OAI + +namespace PeriodicTilingThree + +variable {p : ℕ} [NeZero p] (E : EncodingParameters p) + +theorem graph_not_fully_periodic_of_activity + (o : GraphOutputs E) (hdep : HasDependence E o) + (hwords : ∀ x (w : Word p), (∀ n, Active E o (.inl n) x (w n)) → Allowed p w) + (hseeds : ∀ (t : Fin 2) (n : Column p) (x : Plane) (j : Symbol p), + Active E o (.inr t) x () → Active E o (.inl n) x j → j = seedSymbol E t) + (hordinary : ∀ n x, ∃ j, Active E o (.inl n) x j) + (hseedactive : ∀ t : Fin 2, ∃ x : Plane, Active E o (.inr t) x ()) : + ¬ FullyPeriodic (graph o) := by + intro hper + obtain ⟨x, hx⟩ := hseedactive 0 + obtain ⟨y, hy⟩ := hseedactive 1 + have hline : LineRule p (selectedWord E o) := + selectedWord_lineRule E o hdep hordinary hwords + have hcolumns : NonconstantColumns (selectedWord E o) := + selectedWord_nonconstant_of_forced_letters E o hdep hordinary + (seedSymbol E 0) (seedSymbol E 1) (seedSymbol_zero_ne_one E) x y + (fun n j hj => hseeds 0 n x j hx hj) + (fun n j hj => hseeds 1 n y j hy hj) + obtain ⟨M, hM, hperiod⟩ := exists_positive_vertical_graph_period E o hper + exact no_positive_vertical_period E.p_prime E.p_large hline hcolumns + (Int.natCast_pos.mpr hM) (selectedWord_period_of_graph_period E o (M : ℤ) hperiod) + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/ThreeDimensionalTransfer.lean b/lean/OAI/Geometry/PeriodicTiling/ThreeDimensionalTransfer.lean new file mode 100644 index 0000000000000000000000000000000000000000..c7e4a17cdc9add27e3c6eb472a904885378f5edf --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/ThreeDimensionalTransfer.lean @@ -0,0 +1,47 @@ +import OAI.Geometry.PeriodicTiling.TilingTranslation +import OAI.Geometry.PeriodicTiling.RigidSectionGeometry +import OAI.Geometry.PeriodicTiling.MarkedTileExistence +import OAI.Geometry.PeriodicTiling.MarkedTileDescent +import OAI.Geometry.PeriodicTiling.LatticeThickening +import OAI.Geometry.PeriodicTiling.LatticePeriodicity + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree + +theorem three_dimensional_tile_of_cyclic_counterexample + (Q : ℕ) [NeZero Q] (F : Finset (CyclicQuotient.Group Q)) + (hF : F.Nonempty) (htile : ∃ A, Tiles F A) + (haperiodic : ∀ A, Tiles F A → ¬ FullyPeriodic A) : + ∃ T : Finset (Lattice 3), + T.Nonempty ∧ + (∃ A : Set (Lattice 3), Tiles T A) ∧ + (∀ A : Set (Lattice 3), Tiles T A → ¬ FullyPeriodic A) ∧ + (∃ A : Set (Space 3), AETiles (Thickening T) A) ∧ + (∀ A : Set (Space 3), AETiles (Thickening T) A → + ¬ EuclideanFullyPeriodic A) := by + classical + obtain ⟨F₀, hF₀, ⟨B, hB⟩, hBaperiodic⟩ := + exists_zero_mem_normalization F hF htile haperiodic + let T : Finset (Lattice 3) := rigidSection.finalTile + (CyclicQuotient.kernelStep Q) (CyclicQuotient.representatives Q F₀) + let C : Set (Lattice 3) := + (MarkedTile.scale 64) '' ((CyclicQuotient.projection Q) ⁻¹' B) + have hT : Tiles T C := rigidSection.cyclic_finalTile_tiles Q hB + have hreal : ∀ A : Set (Space 3), + AETiles (Thickening T) A → ¬ EuclideanFullyPeriodic A := by + intro A hA + exact rigidSection.no_euclideanFullyPeriodic (by norm_num) + rigidSection_rigidDifferences Q F₀ hF₀ hBaperiodic hA + refine ⟨T, hT.tile_nonempty, ⟨C, hT⟩, ?_, + ⟨castLattice '' C, hT.aeTiles_thickening⟩, hreal⟩ + intro A hA hperiodic + exact hreal (castLattice '' A) hA.aeTiles_thickening hperiodic.castLattice_image + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/ThreeDimensions.lean b/lean/OAI/Geometry/PeriodicTiling/ThreeDimensions.lean new file mode 100644 index 0000000000000000000000000000000000000000..d1ae7b54308ac067dbb1f938d8c48625b29051cb --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/ThreeDimensions.lean @@ -0,0 +1,22 @@ +import OAI.Geometry.PeriodicTiling.CyclicCounterexample +import OAI.Geometry.PeriodicTiling.ThreeDimensionalTransfer + +namespace OAI + +namespace PeriodicTilingThree + +theorem exists_three_dimensional_tile : + ∃ T : Finset (Lattice 3), + T.Nonempty ∧ + (∃ A : Set (Lattice 3), Tiles T A) ∧ + (∀ A : Set (Lattice 3), Tiles T A → ¬ FullyPeriodic A) ∧ + (∃ A : Set (Space 3), AETiles (Thickening T) A) ∧ + (∀ A : Set (Space 3), AETiles (Thickening T) A → + ¬ EuclideanFullyPeriodic A) := by + obtain ⟨Q, hQ, F, hF, htile, haperiodic⟩ := exists_cyclic_counterexample + let : NeZero Q := ⟨Nat.ne_of_gt hQ⟩ + exact three_dimensional_tile_of_cyclic_counterexample Q F hF htile haperiodic + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/TileDilation.lean b/lean/OAI/Geometry/PeriodicTiling/TileDilation.lean new file mode 100644 index 0000000000000000000000000000000000000000..fe64dd24bda2d8353ff25dc3381a50f69396ea4c --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/TileDilation.lean @@ -0,0 +1,193 @@ +import OAI.Geometry.PeriodicTiling.FiniteMasks +import Mathlib.FieldTheory.Finite.Basic +import Mathlib.Data.Nat.Factorization.Induction +import Mathlib.Data.Nat.Factorial.Basic +import Lean.Elab.Tactic.Omega + +namespace OAI + +universe uG uι + +noncomputable section + +open scoped BigOperators Classical + +namespace PeriodicTilingThree + +section ArbitraryGroup + +variable {G : Type uG} [AddCommGroup G] + +theorem sum_tileIndicator_nat_le_card + {G : Type uG} [AddCommGroup G] + {ι : Type uι} (s : Finset ι) + (A : Set G) (v : ι → G) : + (∑ i ∈ s, tileIndicator ℕ A (v i)) ≤ s.card := by + calc + (∑ i ∈ s, tileIndicator ℕ A (v i)) ≤ ∑ _i ∈ s, (1 : ℕ) := + Finset.sum_le_sum fun i _hi => tileIndicator_nat_le_one A (v i) + _ = s.card := by simp + +theorem familyMask_pow_prime {ι : Type uι} (s : Finset ι) (v : ι → G) + {p : ℕ} (hp : p.Prime) : + familyMask (ZMod p) s v ^ p = familyMask (ZMod p) s (fun i => p • v i) := by + let : Fact p.Prime := ⟨hp⟩ + let : CharP (AddMonoidAlgebra (ZMod p) G) p := + ⟨fun n => by + rw [AddMonoidAlgebra.natCast_def, AddMonoidAlgebra.single_eq_zero, + CharP.cast_eq_zero_iff (ZMod p) p]⟩ + unfold familyMask + rw [sum_pow_char] + apply Finset.sum_congr rfl + intro i hi + rw [AddMonoidAlgebra.single_pow, one_pow] + +theorem sum_tileIndicator_dilate_prime {ι : Type uι} (s : Finset ι) + (v : ι → G) (A : Set G) + (h : ∀ x, (∑ i ∈ s, tileIndicator ℕ A (x - v i)) = 1) + {p : ℕ} (hp : p.Prime) (hcard : s.card < p) (x : G) : + (∑ i ∈ s, tileIndicator ℕ A (x - p • v i)) = 1 := by + let : Fact p.Prime := ⟨hp⟩ + have hpos : 0 < s.card := by + have hb := sum_tileIndicator_nat_le_card s A (fun i => (0 : G) - v i) + rw [h 0] at hb + exact lt_of_lt_of_le Nat.zero_lt_one hb + have hne : (s.card : ZMod p) ≠ 0 := by + intro hz + have hv := congrArg ZMod.val hz + rw [ZMod.val_natCast_of_lt hcard, ZMod.val_zero] at hv + exact (Nat.ne_of_gt hpos) hv + have hfermat : (s.card : ZMod p) ^ (p - 1) = 1 := by + simpa only [ZMod.card] using + (FiniteField.pow_card_sub_one_eq_one (s.card : ZMod p) hne) + have hmod : ∀ y, (∑ i ∈ s, tileIndicator (ZMod p) A (y - v i)) = 1 := by + intro y + rw [← sum_tileIndicator_cast, h y, Nat.cast_one] + have hpower : maskAction (familyMask (ZMod p) s v ^ p) + (tileIndicator (ZMod p) A) x = (s.card : ZMod p) ^ (p - 1) := by + simpa only [Nat.sub_add_cancel hp.one_lt.le] using + (maskAction_familyMask_pow_succ s v (tileIndicator (ZMod p) A) hmod (p - 1) x) + have hmod_dilate : + (∑ i ∈ s, tileIndicator (ZMod p) A (x - p • v i)) = 1 := by + rw [← maskAction_familyMask, ← familyMask_pow_prime s v hp, hpower, hfermat] + have hc : + ((∑ i ∈ s, tileIndicator ℕ A (x - p • v i) : ℕ) : ZMod p) = 1 := by + rw [sum_tileIndicator_cast] + exact hmod_dilate + have hv := congrArg ZMod.val hc + have hbound : (∑ i ∈ s, tileIndicator ℕ A (x - p • v i)) < p := + lt_of_le_of_lt (sum_tileIndicator_nat_le_card s A _) hcard + rwa [ZMod.val_natCast_of_lt hbound, ZMod.val_one_eq_one_mod, + Nat.mod_eq_of_lt hp.one_lt] at hv + +theorem sum_tileIndicator_dilate_of_prime_factors {ι : Type uι} (s : Finset ι) + (v : ι → G) (A : Set G) + (h : ∀ x, (∑ i ∈ s, tileIndicator ℕ A (x - v i)) = 1) + (r : ℕ) (hr : r ≠ 0) + (hlarge : ∀ p : ℕ, p.Prime → p ∣ r → s.card < p) (x : G) : + (∑ i ∈ s, tileIndicator ℕ A (x - r • v i)) = 1 := by + have hall : ∀ n : ℕ, n ≠ 0 → + (∀ p : ℕ, p.Prime → p ∣ n → s.card < p) → + ∀ y, (∑ i ∈ s, tileIndicator ℕ A (y - n • v i)) = 1 := by + apply induction_on_primes + · intro hn + exact (hn rfl).elim + · intro _hn _hpr y + simpa only [one_nsmul] using h y + · intro p n hp ih hpn hpr y + have hn : n ≠ 0 := by + intro hn + apply hpn + simp [hn] + have hprn : ∀ q : ℕ, q.Prime → q ∣ n → s.card < q := by + intro q hq hqn + exact hpr q hq (dvd_mul_of_dvd_right hqn p) + have hpp : s.card < p := hpr p hp (dvd_mul_right p n) + simpa only [mul_smul] using + (sum_tileIndicator_dilate_prime s (fun i => n • v i) A + (ih hn hprn) hp hpp y) + exact hall r hr hlarge x + +theorem prime_factor_factorial_mul_add_one_gt (N k p : ℕ) + (hp : p.Prime) (hd : p ∣ 1 + N.factorial * k) : N < p := by + by_contra hnp + have hpf : p ∣ N.factorial := Nat.dvd_factorial hp.pos (Nat.le_of_not_gt hnp) + have hpm : p ∣ N.factorial * k := dvd_mul_of_dvd_left hpf k + have hpone : p ∣ 1 := (Nat.dvd_add_left hpm).mp hd + exact hp.ne_one (Nat.dvd_one.mp hpone) + +theorem Tiles.sum_tileIndicator_nat_dilate_factorial {F : Finset G} {A : Set G} + (h : Tiles F A) (k : ℕ) (x : G) : + (∑ f ∈ F, tileIndicator ℕ A (x - (1 + F.card.factorial * k) • f)) = 1 := by + apply sum_tileIndicator_dilate_of_prime_factors F id A + (fun y => h.tileCount_eq_one y) (1 + F.card.factorial * k) + · omega + · intro p hp hd + exact prime_factor_factorial_mul_add_one_gt F.card k p hp hd + +theorem Tiles.sum_tileIndicator_dilate_factorial {F : Finset G} {A : Set G} + (h : Tiles F A) (k : ℕ) (x : G) : + (∑ f ∈ F, tileIndicator ℝ A (x - (1 + F.card.factorial * k) • f)) = 1 := by + rw [← sum_tileIndicator_cast, h.sum_tileIndicator_nat_dilate_factorial k x, + Nat.cast_one] + +def dilateTile (r : ℕ) (F : Finset G) : Finset G := + F.image (fun f => r • f) + +end ArbitraryGroup + +theorem plane_nsmul_injective {r : ℕ} (hr : r ≠ 0) : + Function.Injective (fun x : Plane => r • x) := by + intro x y hxy + have hrz : (r : ℤ) ≠ 0 := Int.natCast_ne_zero.mpr hr + apply Prod.ext + · apply mul_left_cancel₀ hrz + have hx : r • x.1 = r • y.1 := congrArg Prod.fst hxy + simpa only [nsmul_eq_mul] using hx + · apply mul_left_cancel₀ hrz + have hy : r • x.2 = r • y.2 := congrArg Prod.snd hxy + simpa only [nsmul_eq_mul] using hy + +theorem dilateTile_card (r : ℕ) (hr : r ≠ 0) (F : Finset Plane) : + (dilateTile r F).card = F.card := by + let : DecidableEq Plane := fun a b => Classical.propDecidable (a = b) + exact Finset.card_image_of_injective F (plane_nsmul_injective hr) + +theorem tileCount_dilateTile (r : ℕ) (hr : r ≠ 0) + (F : Finset Plane) (A : Set Plane) (x : Plane) : + tileCount (dilateTile r F) A x = ∑ f ∈ F, tileIndicator ℕ A (x - r • f) := by + let : DecidableEq Plane := fun a b => Classical.propDecidable (a = b) + unfold tileCount dilateTile + apply Finset.sum_image + intro f hf g hg hfg + exact plane_nsmul_injective hr hfg + +theorem Tiles.dilate_prime {F : Finset Plane} {A : Set Plane} (h : Tiles F A) + {p : ℕ} (hp : p.Prime) (hcard : F.card < p) : Tiles (dilateTile p F) A := by + apply tiles_iff_tileCount_eq_one.mpr + intro x + rw [tileCount_dilateTile p hp.ne_zero] + exact sum_tileIndicator_dilate_prime F id A (fun y => h.tileCount_eq_one y) hp hcard x + +theorem Tiles.dilate_of_prime_factors {F : Finset Plane} {A : Set Plane} + (h : Tiles F A) (r : ℕ) (hr : r ≠ 0) + (hlarge : ∀ p : ℕ, p.Prime → p ∣ r → F.card < p) : + Tiles (dilateTile r F) A := by + apply tiles_iff_tileCount_eq_one.mpr + intro x + rw [tileCount_dilateTile r hr] + exact sum_tileIndicator_dilate_of_prime_factors F id A + (fun y => h.tileCount_eq_one y) r hr hlarge x + +theorem Tiles.dilate_factorial {F : Finset Plane} {A : Set Plane} + (h : Tiles F A) (k : ℕ) : Tiles (dilateTile (1 + F.card.factorial * k) F) A := by + apply h.dilate_of_prime_factors (1 + F.card.factorial * k) + · omega + · intro p hp hd + exact prime_factor_factorial_mul_add_one_gt F.card k p hp hd + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/TilesRegion.lean b/lean/OAI/Geometry/PeriodicTiling/TilesRegion.lean new file mode 100644 index 0000000000000000000000000000000000000000..2648c942f48d32245487c64f98570a5bc8aee7a6 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/TilesRegion.lean @@ -0,0 +1,59 @@ +import OAI.Geometry.PeriodicTiling.TilingBasic + +namespace OAI + +universe uG + +namespace PeriodicTilingThree + +section Region + +variable {G : Type uG} [AddCommGroup G] + +structure TilesRegion (F : Finset G) (D E : Set G) : Prop where + add_mem : ∀ f ∈ F, ∀ d ∈ D, f + d ∈ E + unique : ∀ x ∈ E, ∃! f : ↥F, x - (f : G) ∈ D + +theorem tilesRegion_univ_iff {F : Finset G} {D : Set G} : + TilesRegion F D Set.univ ↔ Tiles F D := by + rw [tiles_iff_unique_tile] + constructor + · intro h x + exact h.unique x (Set.mem_univ x) + · intro h + exact ⟨fun _ _ _ _ => Set.mem_univ _, fun x _ => h x⟩ + +theorem TilesRegion.mem_iff {F : Finset G} {D E : Set G} + (h : TilesRegion F D E) (x : G) : + x ∈ E ↔ ∃ f : ↥F, x - (f : G) ∈ D := by + constructor + · intro hx + obtain ⟨f, hf, _⟩ := h.unique x hx + exact ⟨f, hf⟩ + · rintro ⟨f, hf⟩ + simpa [add_comm] using h.add_mem f f.property (x - f) hf + +theorem TilesRegion.of_local_copy {F : Finset G} {D D' E : Set G} + (h : TilesRegion F D E) + (hcopy : ∀ x : G, ∃ y : G, (y ∈ E ↔ x ∈ E) ∧ + ∀ f : ↥F, (x - (f : G) ∈ D' ↔ y - (f : G) ∈ D)) : + TilesRegion F D' E := by + constructor + · intro f hf d hd + obtain ⟨y, hE, htests⟩ := hcopy (f + d) + apply hE.mp + apply (h.mem_iff y).mpr + refine ⟨⟨f, hf⟩, (htests ⟨f, hf⟩).mp ?_⟩ + simpa using hd + · intro x hx + obtain ⟨y, hE, htests⟩ := hcopy x + obtain ⟨f, hf, huniq⟩ := h.unique y (hE.mpr hx) + refine ⟨f, (htests f).mpr hf, ?_⟩ + intro g hg + exact huniq g ((htests g).mp hg) + +end Region + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/TilingBasic.lean b/lean/OAI/Geometry/PeriodicTiling/TilingBasic.lean new file mode 100644 index 0000000000000000000000000000000000000000..b4d275421c4df218636f4322ab9fceeeaafde9ed --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/TilingBasic.lean @@ -0,0 +1,95 @@ +import OAI.Geometry.PeriodicTiling.Model +import Mathlib.GroupTheory.Index +import Mathlib.Logic.Equiv.Fin.Basic +import Mathlib.Tactic.FinCases + +namespace OAI + +universe uG + +namespace PeriodicTilingThree + +abbrev Plane := ℤ × ℤ + +def planeEquiv : Plane ≃+ Lattice 2 where + toEquiv := (finTwoArrowEquiv ℤ).symm + map_add' p q := by + ext i + fin_cases i <;> rfl + +section AdditiveGroup + +variable {G : Type uG} [AddCommGroup G] + +theorem tiles_iff_unique_tile {F : Finset G} {A : Set G} : + Tiles F A ↔ ∀ x : G, ∃! f : ↥F, x - (f : G) ∈ A := by + constructor + · intro h x + obtain ⟨⟨f, a⟩, hx⟩ := h.2 x + have hfa : x - (f : G) = (a : G) := by + rw [← hx] + simp + refine ⟨f, ?_, ?_⟩ + · change x - (f : G) ∈ A + rw [hfa] + exact a.property + · intro g hg + have hp : (g, (⟨x - (g : G), hg⟩ : A)) = (f, a) := by + apply h.1 + change (g : G) + (x - (g : G)) = (f : G) + (a : G) + simpa [add_comm] using hx.symm + exact congrArg Prod.fst hp + · intro h + constructor + · rintro ⟨f, a⟩ ⟨g, b⟩ he + obtain ⟨f₀, _hf₀, huniq⟩ := h ((f : G) + (a : G)) + have hf : (f : G) + (a : G) - (f : G) ∈ A := by + simp [a.property] + have hg : (f : G) + (a : G) - (g : G) ∈ A := by + change (f : G) + (a : G) = (g : G) + (b : G) at he + rw [he] + simp [b.property] + have hfg : f = g := (huniq f hf).trans (huniq g hg).symm + cases hfg + have hab : a = b := Subtype.ext (add_left_cancel he) + exact Prod.ext rfl hab + · intro x + obtain ⟨f, hf, _huniq⟩ := h x + refine ⟨(f, ⟨x - (f : G), hf⟩), ?_⟩ + change (f : G) + (x - (f : G)) = x + simp + +theorem Tiles.tile_nonempty {F : Finset G} {A : Set G} (h : Tiles F A) : + F.Nonempty := by + obtain ⟨⟨f, _a⟩, _hx⟩ := h.2 0 + exact ⟨f, f.property⟩ + +theorem Tiles.complement_nonempty {F : Finset G} {A : Set G} (h : Tiles F A) : + A.Nonempty := by + obtain ⟨⟨_f, a⟩, _hx⟩ := h.2 0 + exact ⟨a, a.property⟩ + +theorem period_zero (A : Set G) : Period A 0 := by + intro x + simp + +theorem Period.add {A : Set G} {v w : G} (hv : Period A v) (hw : Period A w) : + Period A (v + w) := by + intro x + rw [← add_assoc, hw, hv] + +theorem Period.neg {A : Set G} {v : G} (hv : Period A v) : Period A (-v) := by + intro x + simpa [sub_eq_add_neg, add_assoc] using (hv (x - v)).symm + +def periodSubgroup (A : Set G) : AddSubgroup G where + carrier := {v | Period A v} + zero_mem' := period_zero A + add_mem' := fun hv hw => hv.add hw + neg_mem' := fun hv => hv.neg + +end AdditiveGroup + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/TilingTranslation.lean b/lean/OAI/Geometry/PeriodicTiling/TilingTranslation.lean new file mode 100644 index 0000000000000000000000000000000000000000..371bdf188cf5d844f8ac5c2ff4af0f6e5e44c3d1 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/TilingTranslation.lean @@ -0,0 +1,59 @@ +import OAI.Geometry.PeriodicTiling.TilingBasic +import Mathlib.Tactic.Abel + +namespace OAI + +universe uG + +namespace PeriodicTilingThree + +variable {G : Type uG} [AddCommGroup G] [DecidableEq G] + +theorem Tiles.translate_tile {F : Finset G} {A : Set G} + (h : Tiles F A) (v : G) : Tiles (F.image (fun f => f + v)) A := by + classical + apply tiles_iff_unique_tile.mpr + intro x + obtain ⟨f, hf, huniq⟩ := tiles_iff_unique_tile.mp h (x - v) + refine ⟨⟨(f : G) + v, Finset.mem_image.mpr ⟨f, f.property, rfl⟩⟩, ?_, ?_⟩ + · change x - ((f : G) + v) ∈ A + have heq : x - ((f : G) + v) = x - v - (f : G) := by abel + rw [heq] + exact hf + · intro g hg + obtain ⟨f', hf', hfg⟩ := Finset.mem_image.mp g.property + have heq : x - (f' + v) = x - v - f' := by abel + change x - (g : G) ∈ A at hg + rw [← hfg, heq] at hg + have hff : (⟨f', hf'⟩ : ↥F) = f := huniq _ hg + apply Subtype.ext + change (g : G) = (f : G) + v + rw [← hfg] + exact congrArg (fun z : G => z + v) (congrArg Subtype.val hff) + +theorem tiles_translate_tile_iff (F : Finset G) (A : Set G) (v : G) : + Tiles (F.image (fun f => f + v)) A ↔ Tiles F A := by + constructor + · intro h + have h' := h.translate_tile (-v) + simpa only [Finset.image_image, Function.comp_def, add_neg_cancel_right, Finset.image_id'] using h' + · intro h + exact h.translate_tile v + +theorem exists_zero_mem_normalization (F : Finset G) (hF : F.Nonempty) + (htile : ∃ A, Tiles F A) + (haperiodic : ∀ A, Tiles F A → ¬ FullyPeriodic A) : + ∃ U : Finset G, 0 ∈ U ∧ + (∃ A, Tiles U A) ∧ (∀ A, Tiles U A → ¬ FullyPeriodic A) := by + classical + obtain ⟨f0, hf0⟩ := hF + refine ⟨F.image (fun f => f + -f0), ?_, ?_, ?_⟩ + · exact Finset.mem_image.mpr ⟨f0, hf0, add_neg_cancel f0⟩ + · obtain ⟨A, hA⟩ := htile + exact ⟨A, hA.translate_tile (-f0)⟩ + · intro A hA + exact haperiodic A ((tiles_translate_tile_iff F A (-f0)).mp hA) + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/TilingTransport.lean b/lean/OAI/Geometry/PeriodicTiling/TilingTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..9887cb86c3f8a18b0f1edb7b3e68fe0910ee4032 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/TilingTransport.lean @@ -0,0 +1,151 @@ +import OAI.Geometry.PeriodicTiling.TilingBasic +import Mathlib.Logic.Equiv.Set + +namespace OAI + +universe uG uH uK + +namespace PeriodicTilingThree + +section AdditiveEquivalence + +variable {G : Type uG} {H : Type uH} [AddCommGroup G] [AddCommGroup H] + +theorem Tiles.image_addEquiv [DecidableEq H] {F : Finset G} {A : Set G} + (e : G ≃+ H) (h : Tiles F A) : Tiles (F.image e) (e '' A) := by + classical + apply tiles_iff_unique_tile.mpr + intro x + obtain ⟨f, hf, huniq⟩ := tiles_iff_unique_tile.mp h (e.symm x) + refine ⟨⟨e (f : G), Finset.mem_image.mpr ⟨(f : G), f.property, rfl⟩⟩, ?_, ?_⟩ + · refine ⟨e.symm x - (f : G), hf, ?_⟩ + change e (e.symm x - (f : G)) = x - e (f : G) + rw [map_sub, e.apply_symm_apply] + · intro g hg + obtain ⟨y, hyF, hey⟩ := Finset.mem_image.mp g.property + obtain ⟨a, ha, hea⟩ := hg + have hyA : e.symm x - y ∈ A := by + have heq : e.symm x - y = a := by + apply e.injective + rw [map_sub, e.apply_symm_apply, hey] + exact hea.symm + rw [heq] + exact ha + have hyf : (⟨y, hyF⟩ : ↥F) = f := huniq ⟨y, hyF⟩ hyA + apply Subtype.ext + calc + (g : H) = e y := hey.symm + _ = e (f : G) := congrArg e (congrArg Subtype.val hyf) + +theorem tiles_image_addEquiv_iff [DecidableEq H] (e : G ≃+ H) + {F : Finset G} {A : Set G} : + Tiles (F.image e) (e '' A) ↔ Tiles F A := by + classical + constructor + · intro h + simpa only [Finset.image_image, Set.image_image, Function.comp_def, + e.symm_apply_apply, Finset.image_id', Set.image_id'] + using Tiles.image_addEquiv e.symm h + · exact Tiles.image_addEquiv e + +theorem addEquiv_image_symm_eq_preimage (e : G ≃+ H) (A : Set H) : + e.symm '' A = e ⁻¹' A := by + exact e.toEquiv.image_symm_eq_preimage A + +theorem Tiles.preimage_addEquiv [DecidableEq G] (e : G ≃+ H) + {F : Finset H} {A : Set H} (h : Tiles F A) : + Tiles (F.image e.symm) (e ⁻¹' A) := by + rw [← addEquiv_image_symm_eq_preimage e A] + exact Tiles.image_addEquiv e.symm h + +theorem tiles_preimage_addEquiv_iff [DecidableEq G] (e : G ≃+ H) + {F : Finset H} {A : Set H} : + Tiles (F.image e.symm) (e ⁻¹' A) ↔ Tiles F A := by + rw [← addEquiv_image_symm_eq_preimage e A] + exact tiles_image_addEquiv_iff e.symm + +end AdditiveEquivalence + +section PeriodImages + +variable {G : Type uG} {H : Type uH} [AddCommGroup G] [AddCommGroup H] + +theorem Period.image {A : Set G} {v : G} (hv : Period A v) (f : G →+ H) : + Period (f '' A) (f v) := by + intro y + constructor + · rintro ⟨x, hx, hxy⟩ + refine ⟨x - v, ?_, ?_⟩ + · apply (hv (x - v)).mp + simpa only [sub_add_cancel] using hx + · rw [map_sub, hxy, add_sub_cancel_right] + · rintro ⟨x, hx, rfl⟩ + exact ⟨x + v, (hv x).mpr hx, f.map_add x v⟩ + +theorem finiteIndex_map_of_surjective (P : AddSubgroup G) (hP : P.FiniteIndex) + (f : G →+ H) (hf : Function.Surjective f) : (P.map f).FiniteIndex := by + constructor + intro hz + have hd := P.index_map_dvd hf + rw [hz] at hd + exact hP.index_ne_zero (Nat.eq_zero_of_zero_dvd hd) + +theorem FullyPeriodic.image_of_surjective (f : G →+ H) + (hf : Function.Surjective f) {A : Set G} (h : FullyPeriodic A) : + FullyPeriodic (f '' A) := by + obtain ⟨P, hP, hperiod⟩ := h + refine ⟨P.map f, finiteIndex_map_of_surjective P hP f hf, ?_⟩ + intro w hw + obtain ⟨v, hv, rfl⟩ := AddSubgroup.mem_map.mp hw + exact (hperiod v hv).image f + +theorem fullyPeriodic_image_addEquiv_iff (e : G ≃+ H) {A : Set G} : + FullyPeriodic (e '' A) ↔ FullyPeriodic A := by + constructor + · intro h + have h' := FullyPeriodic.image_of_surjective e.symm.toAddMonoidHom + e.symm.surjective h + change FullyPeriodic (e.symm '' (e '' A)) at h' + simpa only [Set.image_image, Function.comp_def, e.symm_apply_apply, + Set.image_id'] using h' + · exact FullyPeriodic.image_of_surjective e.toAddMonoidHom e.surjective + +theorem FullyPeriodic.preimage_addEquiv (e : G ≃+ H) {A : Set H} + (h : FullyPeriodic A) : FullyPeriodic (e ⁻¹' A) := by + rw [← addEquiv_image_symm_eq_preimage e A] + exact FullyPeriodic.image_of_surjective e.symm.toAddMonoidHom e.symm.surjective h + +theorem fullyPeriodic_preimage_addEquiv_iff (e : G ≃+ H) {A : Set H} : + FullyPeriodic (e ⁻¹' A) ↔ FullyPeriodic A := by + rw [← addEquiv_image_symm_eq_preimage e A] + exact fullyPeriodic_image_addEquiv_iff e.symm + +end PeriodImages + +section FiniteCoordinate + +variable {G : Type uG} {K : Type uK} [AddCommGroup G] [AddCommGroup K] [Finite K] + +theorem finiteIndex_prod_bot (P : AddSubgroup G) (hP : P.FiniteIndex) : + (P.prod (⊥ : AddSubgroup K)).FiniteIndex := by + constructor + rw [AddSubgroup.index_prod, AddSubgroup.index_bot] + exact mul_ne_zero hP.index_ne_zero (ne_of_gt (Nat.card_pos : 0 < Nat.card K)) + +theorem FullyPeriodic.prod_singleton_zero {A : Set G} (h : FullyPeriodic A) : + FullyPeriodic (A ×ˢ ({0} : Set K)) := by + obtain ⟨P, hP, hperiod⟩ := h + refine ⟨P.prod (⊥ : AddSubgroup K), finiteIndex_prod_bot P hP, ?_⟩ + intro v hv x + obtain ⟨hp, hz⟩ := AddSubgroup.mem_prod.mp hv + have hzero : v.2 = 0 := AddSubgroup.mem_bot.mp hz + change (x.1 + v.1 ∈ A ∧ x.2 + v.2 ∈ ({0} : Set K)) ↔ + (x.1 ∈ A ∧ x.2 ∈ ({0} : Set K)) + rw [hzero, add_zero] + exact and_congr (hperiod v.1 hp x.1) Iff.rfl + +end FiniteCoordinate + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/VoxelCubeMeasure.lean b/lean/OAI/Geometry/PeriodicTiling/VoxelCubeMeasure.lean new file mode 100644 index 0000000000000000000000000000000000000000..a7e3a726a7ee4ce63371c76e24c52684736d237d --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/VoxelCubeMeasure.lean @@ -0,0 +1,94 @@ +import OAI.Geometry.PeriodicTiling.VoxelGeometry +import Mathlib.MeasureTheory.Constructions.Pi +import Mathlib.MeasureTheory.Measure.AEDisjoint + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree + +open Set MeasureTheory Filter +open scoped ENNReal + +theorem unitVoxel_volume {d : ℕ} (c : Space d) : + volume (unitVoxel c) = 1 := by + rw [unitVoxel_eq_Icc, Real.volume_Icc_pi] + simp + +theorem unitCube_volume (d : ℕ) : volume (unitCube d) = 1 := by + simpa only [unitVoxel, sub_zero, Set.ofPred_mem_eq] using + unitVoxel_volume (0 : Space d) + +theorem openUnitVoxel_volume {d : ℕ} (c : Space d) : + volume (openUnitVoxel c) = 1 := by + rw [openUnitVoxel, Real.volume_pi_Ioo] + simp + +theorem openUnitVoxel_ae_eq_unitVoxel {d : ℕ} (c : Space d) : + openUnitVoxel c =ᵐ[volume] unitVoxel c := by + rw [unitVoxel_eq_Icc] + exact Measure.univ_pi_Ioo_ae_eq_Icc + +theorem unitVoxel_frontier_volume_zero {d : ℕ} (c : Space d) : + volume (frontier (unitVoxel c)) = 0 := by + have hnull : volume (unitVoxel c \ openUnitVoxel c) = 0 := + ae_le_set.mp (openUnitVoxel_ae_eq_unitVoxel c).symm.le + apply measure_mono_null _ hnull + intro x hx + refine ⟨(unitVoxel_isClosed c).frontier_subset hx, ?_⟩ + intro ho + exact hx.2 (interior_maximal (openUnitVoxel_subset c) + (isOpen_openUnitVoxel c) ho) + +theorem unitVoxel_inter_volume_pos {d : ℕ} (a b : Space d) + (h : ∀ i, |b i - a i| < 1) : + 0 < volume (unitVoxel a ∩ unitVoxel b) := by + rw [unitVoxel_inter_eq_Icc, Real.volume_Icc_pi] + apply bot_lt_iff_ne_bot.mpr + apply Finset.prod_ne_zero_iff.mpr + intro i _ + apply ne_of_gt + apply ENNReal.ofReal_pos.mpr + apply sub_pos.mpr + apply max_lt + · apply lt_min + · linarith + · have hi := (abs_lt.mp (h i)).1 + linarith + · apply lt_min + · have hi := (abs_lt.mp (h i)).2 + linarith + · linarith + +theorem closedBall_volume {d : ℕ} (c : Space d) {r : ℝ} (hr : 0 ≤ r) : + volume (Metric.closedBall c r) = ENNReal.ofReal ((2 * r) ^ d) := by + simpa using Real.volume_pi_closedBall c hr + +theorem closedBall_ae_eq_ball {d : ℕ} (c : Space d) {r : ℝ} (hr : 0 < r) : + Metric.closedBall c r =ᵐ[volume] Metric.ball c r := by + rw [closedBall_pi c hr.le, ball_pi c hr] + simp only [Real.closedBall_eq_Icc, Real.ball_eq_Ioo] + exact Measure.pi_Ioo_ae_eq_pi_Icc.symm + +theorem closedBall_frontier_volume_zero {d : ℕ} (c : Space d) + {r : ℝ} (hr : 0 < r) : + volume (frontier (Metric.closedBall c r)) = 0 := by + have hnull : volume (Metric.closedBall c r \ Metric.ball c r) = 0 := + ae_le_set.mp (closedBall_ae_eq_ball c hr).le + apply measure_mono_null _ hnull + intro x hx + refine ⟨Metric.isClosed_closedBall.frontier_subset hx, ?_⟩ + intro hb + exact hx.2 (Metric.ball_subset_interior_closedBall hb) + +theorem unitVoxel_aedisjoint_int {d : ℕ} {z z' : Lattice d} (hne : z ≠ z') : + AEDisjoint volume (unitVoxel (castLattice z)) (unitVoxel (castLattice z')) := by + exact (openUnitVoxel_disjoint_unitVoxel_int hne).aedisjoint.congr + (openUnitVoxel_ae_eq_unitVoxel _).symm EventuallyEq.rfl + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/VoxelGeometry.lean b/lean/OAI/Geometry/PeriodicTiling/VoxelGeometry.lean new file mode 100644 index 0000000000000000000000000000000000000000..0bb56ffe49adfb75d5ad5a6fb8fe36c0dc82d4c4 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/VoxelGeometry.lean @@ -0,0 +1,103 @@ +import OAI.Geometry.PeriodicTiling.EuclideanBasic +import Mathlib.Tactic.Linarith + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree + +open Set MeasureTheory + +def openUnitVoxel {d : ℕ} (c : Space d) : Set (Space d) := + Set.pi Set.univ (fun i => Set.Ioo (c i) (c i + 1)) + +theorem mem_openUnitVoxel {d : ℕ} {c x : Space d} : + x ∈ openUnitVoxel c ↔ ∀ i, c i < x i ∧ x i < c i + 1 := by + simp [openUnitVoxel, Set.mem_pi] + +theorem openUnitVoxel_nonempty {d : ℕ} (c : Space d) : + (openUnitVoxel c).Nonempty := by + refine ⟨fun i => c i + 1 / 2, mem_openUnitVoxel.mpr ?_⟩ + intro i + constructor <;> linarith + +theorem isOpen_openUnitVoxel {d : ℕ} (c : Space d) : + IsOpen (openUnitVoxel c) := + isOpen_set_pi Set.finite_univ (fun _ _ => isOpen_Ioo) + +theorem openUnitVoxel_subset {d : ℕ} (c : Space d) : + openUnitVoxel c ⊆ unitVoxel c := by + intro x hx + rw [unitVoxel_eq_Icc] + have h := mem_openUnitVoxel.mp hx + exact ⟨fun i => (h i).1.le, fun i => (h i).2.le⟩ + +theorem unitVoxel_isCompact {d : ℕ} (c : Space d) : + IsCompact (unitVoxel c) := by + rw [unitVoxel_eq_Icc] + exact isCompact_Icc + +theorem unitVoxel_isClosed {d : ℕ} (c : Space d) : + IsClosed (unitVoxel c) := (unitVoxel_isCompact c).isClosed + +theorem unitVoxel_measurableSet {d : ℕ} (c : Space d) : + MeasurableSet (unitVoxel c) := (unitVoxel_isClosed c).measurableSet + +theorem unitVoxel_inter_eq_Icc {d : ℕ} (a b : Space d) : + unitVoxel a ∩ unitVoxel b = + Set.Icc (fun i => max (a i) (b i)) + (fun i => min (a i + 1) (b i + 1)) := by + rw [unitVoxel_eq_Icc, unitVoxel_eq_Icc] + ext x + constructor + · rintro ⟨ha, hb⟩ + exact ⟨fun i => max_le (ha.1 i) (hb.1 i), + fun i => le_min (ha.2 i) (hb.2 i)⟩ + · rintro ⟨hl, hu⟩ + exact ⟨⟨fun i => (le_max_left _ _).trans (hl i), + fun i => (hu i).trans (min_le_left _ _)⟩, + ⟨fun i => (le_max_right _ _).trans (hl i), + fun i => (hu i).trans (min_le_right _ _)⟩⟩ + +theorem mem_unitVoxel_cast_iff_of_mem_open {d : ℕ} {x : Space d} + {z z' : Lattice d} (hx : x ∈ openUnitVoxel (castLattice z)) : + x ∈ unitVoxel (castLattice z') ↔ z' = z := by + constructor + · intro hx' + have ho := mem_openUnitVoxel.mp hx + rw [unitVoxel_eq_Icc] at hx' + funext i + have hi := ho i + have hl := hx'.1 i + have hu := hx'.2 i + change (z i : ℝ) < x i ∧ x i < (z i : ℝ) + 1 at hi + change (z' i : ℝ) ≤ x i at hl + change x i ≤ (z' i : ℝ) + 1 at hu + rcases lt_trichotomy (z' i) (z i) with hlt | heq | hgt + · have hh : (z' i : ℝ) + 1 ≤ (z i : ℝ) := by + have hh' : ((z' i + 1 : ℤ) : ℝ) ≤ (z i : ℝ) := + Int.cast_le.mpr (Int.add_one_le_of_lt hlt) + simpa only [Int.cast_add, Int.cast_one] using hh' + linarith + · exact heq + · have hh : (z i : ℝ) + 1 ≤ (z' i : ℝ) := by + have hh' : ((z i + 1 : ℤ) : ℝ) ≤ (z' i : ℝ) := + Int.cast_le.mpr (Int.add_one_le_of_lt hgt) + simpa only [Int.cast_add, Int.cast_one] using hh' + linarith + · rintro rfl + exact openUnitVoxel_subset _ hx + +theorem openUnitVoxel_disjoint_unitVoxel_int {d : ℕ} {z z' : Lattice d} + (hne : z ≠ z') : + Disjoint (openUnitVoxel (castLattice z)) (unitVoxel (castLattice z')) := by + apply Set.disjoint_left.mpr + intro x hx hx' + exact hne ((mem_unitVoxel_cast_iff_of_mem_open hx).mp hx').symm + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/VoxelMeasure.lean b/lean/OAI/Geometry/PeriodicTiling/VoxelMeasure.lean new file mode 100644 index 0000000000000000000000000000000000000000..3972a2e575a26f7c7dae34651a1fa06eec8b60ec --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/VoxelMeasure.lean @@ -0,0 +1,62 @@ +import OAI.Geometry.PeriodicTiling.VoxelCubeMeasure +import Mathlib.Topology.MetricSpace.Bounded + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree + +open Set MeasureTheory +open scoped ENNReal + +theorem Thickening_eq_iUnion {d : ℕ} (F : Finset (Lattice d)) : + Thickening F = ⋃ z ∈ F, unitVoxel (castLattice z) := by + ext x + simp only [mem_Thickening, Set.mem_iUnion, mem_unitVoxel, exists_prop] + +theorem thickening_isCompact {d : ℕ} (F : Finset (Lattice d)) : + IsCompact (Thickening F) := by + rw [Thickening_eq_iUnion] + exact F.isCompact_biUnion (fun z _ => unitVoxel_isCompact (castLattice z)) + +theorem thickening_isClosed {d : ℕ} (F : Finset (Lattice d)) : + IsClosed (Thickening F) := (thickening_isCompact F).isClosed + +theorem thickening_measurableSet {d : ℕ} (F : Finset (Lattice d)) : + MeasurableSet (Thickening F) := (thickening_isClosed F).measurableSet + +theorem thickening_isBounded {d : ℕ} (F : Finset (Lattice d)) : + Bornology.IsBounded (Thickening F) := (thickening_isCompact F).isBounded + +theorem thickening_volume {d : ℕ} (F : Finset (Lattice d)) : + volume (Thickening F) = (F.card : ℝ≥0∞) := by + classical + rw [Thickening_eq_iUnion] + rw [measure_biUnion_finset₀ + (fun z _ z' _ hne => unitVoxel_aedisjoint_int hne) + (fun z _ => (unitVoxel_measurableSet (castLattice z)).nullMeasurableSet)] + simp [unitVoxel_volume] + +theorem thickening_aedisjoint_of_disjoint {d : ℕ} + {S T : Finset (Lattice d)} (h : Disjoint S T) : + AEDisjoint volume (Thickening S) (Thickening T) := by + classical + simp only [Thickening_eq_iUnion, AEDisjoint.iUnion_left_iff, + AEDisjoint.iUnion_right_iff] + intro z hz z' hz' + apply unitVoxel_aedisjoint_int + intro heq + subst z' + exact Finset.disjoint_left.mp h hz' hz + +theorem thickening_inter_measure_zero_of_disjoint {d : ℕ} + {S T : Finset (Lattice d)} (h : Disjoint S T) : + volume (Thickening S ∩ Thickening T) = 0 := + (thickening_aedisjoint_of_disjoint h).eq + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/WeakPeriodicity.lean b/lean/OAI/Geometry/PeriodicTiling/WeakPeriodicity.lean new file mode 100644 index 0000000000000000000000000000000000000000..27bcc57f2be596bb7a6f9678669a0c0a103d6849 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/WeakPeriodicity.lean @@ -0,0 +1,84 @@ +import OAI.Geometry.PeriodicTiling.DirectionalLimits +import OAI.Geometry.PeriodicTiling.DirectionalSlices +import OAI.Geometry.PeriodicTiling.CosetPeriodicity +import OAI.Geometry.PeriodicTiling.CosetParts +import Mathlib.Tactic.Choose +import Mathlib.Tactic.Ring + +namespace OAI + +namespace PeriodicTilingThree + +theorem Tiles.exists_weak_periodic_partition {F : Finset Plane} {A : Set Plane} + (h : Tiles F A) (h0 : (0 : Plane) ∈ F) : + ∃ (m : ℕ) (parts : Fin m → Set Plane) (v : Fin m → Plane), + (∀ x, (∑ j, tileIndicator ℝ (parts j) x) = tileIndicator ℝ A x) ∧ + (∀ j, v j ≠ 0) ∧ ∀ j, Period (parts j) (v j) := by + classical + obtain ⟨m, v, φ, hv, hpair, hφ, hsum, hp⟩ := + h.exists_directional_decomposition h0 + by_cases hm0 : m = 0 + · subst m + have hA : A = Set.univ := by + apply Set.eq_univ_of_forall + intro x + have hx := hsum x + by_contra hnot + simp [tileIndicator, hnot] at hx + refine ⟨1, fun _ => A, fun _ => (1, 0), ?_, ?_, ?_⟩ + · intro x + simp + · intro j hj + have hz : (1 : ℤ) = 0 := congrArg Prod.fst hj + exact one_ne_zero hz + · intro j x + simp [hA] + · have hm : 0 < m := Nat.pos_of_ne_zero hm0 + let j₀ : Fin m := ⟨0, hm⟩ + obtain ⟨e, he, htrans, hspan⟩ := exists_common_transverse v hv hpair + obtain ⟨K, hK, hKrep⟩ := exists_common_second_vector v j₀ e htrans + let H : Plane := (K : ℤ) • v j₀ + choose α β hα hH using hKrep + have hdet : planeDet e H ≠ 0 := by + dsimp [H] + rw [planeDet_zsmul_right] + exact mul_ne_zero (Nat.cast_ne_zero.mpr (Nat.ne_of_gt hK)) (htrans j₀) + have hlocal : ∀ x : Plane, ∃ w : Plane, w ≠ 0 ∧ + Function.Periodic + (fun st : Plane => tileIndicator ℝ A (x + st.1 • e + st.2 • H)) w := by + intro x + let P : Fin m → ℤ → ℝ := fun j n => φ j (x + n • e) + have hcoord (j : Fin m) (s t : ℤ) : + φ j (x + s • e + t • H) = P j (s + β j * t) := by + have hpoint : x + s • e + t • H = + (x + (s + β j * t) • e) + (t * α j) • v j := by + change x + s • e + t • ((K : ℤ) • v j₀) = _ + rw [hH j] + apply Prod.ext <;> simp [smul_add, add_smul, zsmul_eq_mul] <;> ring + rw [hpoint] + exact (hp j).zsmul (t * α j) _ + have hlocalSum (st : Plane) : + tileIndicator ℝ A (x + st.1 • e + st.2 • H) = + 1 - ∑ j, P j (st.1 + β j * st.2) := by + have hz := hsum (x + st.1 • e + st.2 • H) + have heq : (∑ j, φ j (x + st.1 • e + st.2 • H)) = + ∑ j, P j (st.1 + β j * st.2) := by + apply Finset.sum_congr rfl + intro j _ + exact hcoord j st.1 st.2 + rw [heq] at hz + linarith + refine coset_configuration_has_period P β _ + (fun j n => (hφ j _).1) ?_ hlocalSum m hm ?_ + · intro i j hij n r + exact directional_slice_pair_bound A v φ e hspan + (fun j y => (hφ j y).1) hp hsum x i j hij n r + · intro j + exact directional_circle_slice_polynomial hm A v φ e hspan hp hsum j x + obtain ⟨n, parts, w, hparts, hw⟩ := + finite_periodic_parts_of_coset_periods e H hdet hlocal + exact ⟨n, parts, w, hparts, fun j => (hw j).1, fun j => (hw j).2⟩ + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/WordAffine.lean b/lean/OAI/Geometry/PeriodicTiling/WordAffine.lean new file mode 100644 index 0000000000000000000000000000000000000000..102e70f0071bd8d69e25cfa2727279dc609a8881 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/WordAffine.lean @@ -0,0 +1,352 @@ +import OAI.Geometry.PeriodicTiling.WordAffineAlgebra +import OAI.Geometry.PeriodicTiling.WordAffineCount +import OAI.Geometry.PeriodicTiling.WordAffineGeometry +import Mathlib.Tactic.Push + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree + +theorem allowed_affine {p : ℕ} {w : Word p} (hw : Allowed p w) : + ∃ a b : ZMod p, (a ≠ 0 ∨ b ≠ 0) ∧ + ∀ n : Column p, a * (n.val : ZMod p) + b ≠ 0 → + (w n : ZMod p) = a * (n.val : ZMod p) + b := by + obtain ⟨a, b, hab, hw⟩ := hw + refine ⟨(a : ZMod p), (b : ZMod p), ?_, ?_⟩ + · simpa only [ne_eq, ZMod.intCast_zmod_eq_zero_iff_dvd] using hab + · intro n hn + have hnd : ¬ (p : ℤ) ∣ a * (n.val : ℤ) + b := by + intro hd + apply hn + have h := (ZMod.intCast_zmod_eq_zero_iff_dvd + (a * (n.val : ℤ) + b) p).mpr hd + simpa only [Int.cast_add, Int.cast_mul, Int.cast_natCast] using h + simpa only [Int.cast_add, Int.cast_mul, Int.cast_natCast] using (hw n).1 hnd + +private def intColumn {p : ℕ} (n : ℤ) (hn : 0 ≤ n ∧ n < (p ^ 2 : ℕ)) : + Column p := ⟨n.toNat, by omega⟩ + +private theorem intColumn_val {p : ℕ} (n : ℤ) + (hn : 0 ≤ n ∧ n < (p ^ 2 : ℕ)) : + ((intColumn n hn).val : ℤ) = n := Int.toNat_of_nonneg hn.1 + +private theorem intColumn_cast {p : ℕ} (n : ℤ) + (hn : 0 ≤ n ∧ n < (p ^ 2 : ℕ)) : + ((intColumn n hn).val : ZMod p) = (n : ZMod p) := by + simpa only [Int.cast_natCast] using + congrArg (fun x : ℤ => (x : ZMod p)) (intColumn_val n hn) + +private def rawArray {p : ℕ} (W : WordArray p) (n m : ℤ) : ZMod p := + if hn : 0 ≤ n ∧ n < (p ^ 2 : ℕ) then (W (intColumn n hn) m : ZMod p) else 1 + +private theorem rawArray_column {p : ℕ} (W : WordArray p) (n : Column p) (m : ℤ) : + rawArray W n.val m = (W n m : ZMod p) := by + have hn : (0 : ℤ) ≤ n.val ∧ (n.val : ℤ) < (p ^ 2 : ℕ) := by + exact ⟨Int.natCast_nonneg _, by exact_mod_cast n.isLt⟩ + have hc : intColumn (n.val : ℤ) hn = n := by + apply Fin.ext + simp [intColumn] + rw [rawArray, dite_eq_left hn, hc] + +private theorem rawArray_ne_zero {p : ℕ} [Fact p.Prime] (W : WordArray p) + (n m : ℤ) (hn : 0 ≤ n ∧ n < (p ^ 2 : ℕ)) : rawArray W n m ≠ 0 := by + rw [rawArray, dite_eq_left hn] + exact Units.ne_zero _ + +private structure LineAffine {p : ℕ} (W : WordArray p) (d e : ℤ) where + a : ZMod p + b : ZMod p + nonzero : a ≠ 0 ∨ b ≠ 0 + agrees : ∀ n : Column p, a * (n.val : ZMod p) + b ≠ 0 → + (W n (d * (n.val : ℤ) + e) : ZMod p) = a * (n.val : ZMod p) + b + +private def chooseLine {p : ℕ} {W : WordArray p} (hW : LineRule p W) + (d e : ℤ) : LineAffine W d e := by + let h := allowed_affine (hW d e) + exact ⟨h.choose, h.choose_spec.choose, h.choose_spec.choose_spec.1, + h.choose_spec.choose_spec.2⟩ + +private theorem LineAffine.raw_agrees {p : ℕ} {W : WordArray p} {d e : ℤ} + (L : LineAffine W d e) (n : ℤ) (hn : 0 ≤ n ∧ n < (p ^ 2 : ℕ)) + (hz : L.a * (n : ZMod p) + L.b ≠ 0) : + rawArray W n (d * n + e) = L.a * (n : ZMod p) + L.b := by + have h := L.agrees (intColumn n hn) (by simpa only [intColumn_cast] using hz) + rw [intColumn_val, intColumn_cast] at h + simpa only [rawArray, dite_eq_left hn] using h + +private theorem clean_second_difference {p : ℕ} {W : WordArray p} + (hW : LineRule p W) (r q : ℤ) + (hc : ∀ i j : Fin 4, ∀ d : ℤ, (d = -1 ∨ d = 0 ∨ d = 1) → + rawArray W (r + i.val) (q + j.val) = + (chooseLine hW d ((q + j.val) - d * (r + i.val))).a * + ((r + i.val : ℤ) : ZMod p) + + (chooseLine hW d ((q + j.val) - d * (r + i.val))).b) + (x₀ y₀ x₁ y₁ x₂ y₂ : Fin 4) (d : ℤ) + (hd : d = -1 ∨ d = 0 ∨ d = 1) + (h₁ : (y₁.val : ℤ) - y₀.val = d * ((x₁.val : ℤ) - x₀.val)) + (h₂ : (y₂.val : ℤ) - y₀.val = d * ((x₂.val : ℤ) - x₀.val)) + (hx : (x₂.val : ℤ) - 2 * x₁.val + x₀.val = 0) : + rawArray W (r + x₂.val) (q + y₂.val) - + 2 * rawArray W (r + x₁.val) (q + y₁.val) + + rawArray W (r + x₀.val) (q + y₀.val) = 0 := by + let e := (q + y₀.val) - d * (r + x₀.val) + have he₁ : (q + y₁.val) - d * (r + x₁.val) = e := by + dsimp [e] + linear_combination h₁ + have he₂ : (q + y₂.val) - d * (r + x₂.val) = e := by + dsimp [e] + linear_combination h₂ + have h₀' := hc x₀ y₀ d hd + have h₁' := hc x₁ y₁ d hd + have h₂' := hc x₂ y₂ d hd + change rawArray W (r + x₀.val) (q + y₀.val) = + (chooseLine hW d e).a * ((r + x₀.val : ℤ) : ZMod p) + + (chooseLine hW d e).b at h₀' + rw [he₁] at h₁' + rw [he₂] at h₂' + have hx' : (x₂.val : ZMod p) - 2 * x₁.val + x₀.val = 0 := by + simpa only [Int.cast_sub, Int.cast_add, Int.cast_mul, Int.cast_ofNat, + Int.cast_natCast, Int.cast_zero] using + congrArg (fun z : ℤ => (z : ZMod p)) hx + rw [h₀', h₁', h₂'] + push_cast + linear_combination (chooseLine hW d e).a * hx' + +private theorem affine_four_line_closure {p : ℕ} (hp : p.Prime) (hlarge : 200 < p) + {W : WordArray p} (hW : LineRule p W) (A B C : ZMod p) : + FourLineClosure (p ^ 2 : ℕ) + (fun n m => A * (n : ZMod p) + B * (m : ZMod p) + C = 0 ∨ + rawArray W n m = A * (n : ZMod p) + B * (m : ZMod p) + C) := by + let : Fact p.Prime := ⟨hp⟩ + intro d e hd r hr₀ hr₃ hgood n hn₀ hn + let a : ZMod p := A + B * (d : ZMod p) + let b : ZMod p := B * (e : ZMod p) + C + let L := chooseLine hW d e + have hrest (k : ℤ) : A * (k : ZMod p) + B * ((d * k + e : ℤ) : ZMod p) + C = + a * (k : ZMod p) + b := by + dsimp [a, b] + push_cast + ring + by_cases ha : a = 0 + · by_cases hb : b = 0 + · left + rw [hrest, ha, hb] + simp + · have hab : a ≠ 0 ∨ b ≠ 0 := Or.inr hb + obtain ⟨i, j, hij, hiA, hiL, hjA, hjL⟩ := two_common_nonzero_of_four + (fun k : Fin 4 => ((r + k.val : ℤ) : ZMod p)) + (four_residues_injective (by omega) r) a b L.a L.b hab L.nonzero + have heq (k : Fin 4) (hkA : a * ((r + k.val : ℤ) : ZMod p) + b ≠ 0) + (hkL : L.a * ((r + k.val : ℤ) : ZMod p) + L.b ≠ 0) : + a * ((r + k.val : ℤ) : ZMod p) + b = + L.a * ((r + k.val : ℤ) : ZMod p) + L.b := by + have hk := hgood k + dsimp only at hk + rw [hrest] at hk + have hk' := hk.resolve_left hkA + have hbound : 0 ≤ r + k.val ∧ r + k.val < (p ^ 2 : ℕ) := by + have := k.isLt + omega + exact hk'.symm.trans (L.raw_agrees _ hbound hkL) + have hcoef := affine_coefficients_eq_of_two + (fun h => hij ((four_residues_injective (by omega) r) h)) + (heq i hiA hiL) (heq j hjA hjL) + by_cases hz : a * (n : ZMod p) + b = 0 + · left + rw [hrest] + exact hz + · right + rw [hrest] + rw [hcoef.1, hcoef.2] at hz ⊢ + exact L.raw_agrees n ⟨hn₀, hn⟩ hz + · have hab : a ≠ 0 ∨ b ≠ 0 := Or.inl ha + obtain ⟨i, j, hij, hiA, hiL, hjA, hjL⟩ := two_common_nonzero_of_four + (fun k : Fin 4 => ((r + k.val : ℤ) : ZMod p)) + (four_residues_injective (by omega) r) a b L.a L.b hab L.nonzero + have heq (k : Fin 4) (hkA : a * ((r + k.val : ℤ) : ZMod p) + b ≠ 0) + (hkL : L.a * ((r + k.val : ℤ) : ZMod p) + L.b ≠ 0) : + a * ((r + k.val : ℤ) : ZMod p) + b = + L.a * ((r + k.val : ℤ) : ZMod p) + L.b := by + have hk := hgood k + dsimp only at hk + rw [hrest] at hk + have hk' := hk.resolve_left hkA + have hbound : 0 ≤ r + k.val ∧ r + k.val < (p ^ 2 : ℕ) := by + have := k.isLt + omega + exact hk'.symm.trans (L.raw_agrees _ hbound hkL) + have hcoef := affine_coefficients_eq_of_two + (fun h => hij ((four_residues_injective (by omega) r) h)) + (heq i hiA hiL) (heq j hjA hjL) + by_cases hz : a * (n : ZMod p) + b = 0 + · left + rw [hrest] + exact hz + · right + rw [hrest] + rw [hcoef.1, hcoef.2] at hz ⊢ + exact L.raw_agrees n ⟨hn₀, hn⟩ hz + +theorem global_affine_approximation {p : ℕ} (hp : p.Prime) (hlarge : 200 < p) + {W : WordArray p} (hW : LineRule p W) : + ∃ A B C : ZMod p, AffineApproximation W A B C := by + classical + let : Fact p.Prime := ⟨hp⟩ + let bad : ℤ → ℤ → ℤ → Prop := fun d e n => + (chooseLine hW d e).a * (n : ZMod p) + (chooseLine hW d e).b = 0 + have hbad : ∀ d e, d = -1 ∨ d = 0 ∨ d = 1 → + ((Finset.Ico (0 : ℤ) (p ^ 2 : ℕ)).filter (bad d e)).card ≤ p := by + intro d e _ + exact affine_int_roots_card_le hp _ _ (chooseLine hW d e).nonzero + obtain ⟨r, q, hr₀, hr₃, _, _, hclean⟩ := + exists_clean_four_square p hlarge bad + (by + intro d e hd + have hfilter := @Finset.filter_congr_decidable ℤ + (Finset.Ico (0 : ℤ) (p ^ 2 : ℕ)) (bad d e) + (fun n => Classical.propDecidable (bad d e n)) + (fun n => ZMod.decidableEq p + ((chooseLine hW d e).a * (n : ZMod p) + (chooseLine hW d e).b) 0) + exact (congrArg (fun s : Finset ℤ => s.card ≤ p) hfilter).mpr (hbad d e hd)) + have hcell : ∀ i j : Fin 4, ∀ d : ℤ, (d = -1 ∨ d = 0 ∨ d = 1) → + rawArray W (r + i.val) (q + j.val) = + (chooseLine hW d ((q + j.val) - d * (r + i.val))).a * + ((r + i.val : ℤ) : ZMod p) + + (chooseLine hW d ((q + j.val) - d * (r + i.val))).b := by + intro i j d hd + have hn : 0 ≤ r + i.val ∧ r + i.val < (p ^ 2 : ℕ) := by + have := i.isLt + omega + have h := (chooseLine hW d ((q + j.val) - d * (r + i.val))).raw_agrees + (r + i.val) hn (hclean i j d hd) + have he : d * (r + i.val) + ((q + j.val) - d * (r + i.val)) = q + j.val := by ring + simpa only [he] using h + let U : Fin 4 → ZMod p := fun j => (chooseLine hW 0 (q + j.val)).a + let V : Fin 4 → ZMod p := fun j => U j * (r : ZMod p) + + (chooseLine hW 0 (q + j.val)).b + have hrow (i j : Fin 4) : rawArray W (r + i.val) (q + j.val) = + U j * (i.val : ZMod p) + V j := by + have h := hcell i j 0 (Or.inr (Or.inl rfl)) + have he : (q + j.val) - (0 : ℤ) * (r + i.val) = q + j.val := by ring + rw [he] at h + rw [h] + dsimp [V, U] + push_cast + ring + have hv0 : (0 : Fin 4).val = 0 := rfl + have hv1 : (1 : Fin 4).val = 1 := rfl + have hv2 : (2 : Fin 4).val = 2 := rfl + have hv3 : (3 : Fin 4).val = 3 := rfl + have hp₀ := clean_second_difference hW r q hcell 0 0 1 1 2 2 1 + (Or.inr (Or.inr rfl)) + (by norm_num [hv0, hv1, hv2, hv3]) + (by norm_num [hv0, hv1, hv2, hv3]) + (by norm_num [hv0, hv1, hv2, hv3]) + have hp₀' := clean_second_difference hW r q hcell 1 0 2 1 3 2 1 + (Or.inr (Or.inr rfl)) + (by norm_num [hv0, hv1, hv2, hv3]) + (by norm_num [hv0, hv1, hv2, hv3]) + (by norm_num [hv0, hv1, hv2, hv3]) + have hm₀ := clean_second_difference hW r q hcell 2 0 1 1 0 2 (-1) + (Or.inl rfl) + (by norm_num [hv0, hv1, hv2, hv3]) + (by norm_num [hv0, hv1, hv2, hv3]) + (by norm_num [hv0, hv1, hv2, hv3]) + have hp₁ := clean_second_difference hW r q hcell 0 1 1 2 2 3 1 + (Or.inr (Or.inr rfl)) + (by norm_num [hv0, hv1, hv2, hv3]) + (by norm_num [hv0, hv1, hv2, hv3]) + (by norm_num [hv0, hv1, hv2, hv3]) + have hp₁' := clean_second_difference hW r q hcell 1 1 2 2 3 3 1 + (Or.inr (Or.inr rfl)) + (by norm_num [hv0, hv1, hv2, hv3]) + (by norm_num [hv0, hv1, hv2, hv3]) + (by norm_num [hv0, hv1, hv2, hv3]) + have hm₁ := clean_second_difference hW r q hcell 2 1 1 2 0 3 (-1) + (Or.inl rfl) + (by norm_num [hv0, hv1, hv2, hv3]) + (by norm_num [hv0, hv1, hv2, hv3]) + (by norm_num [hv0, hv1, hv2, hv3]) + have htwo : (2 : ZMod p) ≠ 0 := by + intro h + have hv := congrArg ZMod.val h + have hlt : 2 < p := by omega + have hv₂ : (2 : ZMod p).val = 2 := ZMod.val_natCast_of_lt hlt + rw [hv₂, ZMod.val_zero] at hv + omega + have hpatch := four_rows_affine htwo U V + (by + have h := hp₀ + simp only [hrow] at h + simp only [hv0, hv1, hv2, Nat.cast_zero, Nat.cast_one, Nat.cast_ofNat] at h + linear_combination h) + (by + have h := hp₀' + simp only [hrow] at h + simp only [hv1, hv2, hv3, Nat.cast_one, Nat.cast_ofNat] at h + linear_combination h) + (by + have h := hm₀ + simp only [hrow] at h + simp only [hv0, hv1, hv2, Nat.cast_zero, Nat.cast_one, Nat.cast_ofNat] at h + linear_combination h) + (by + have h := hp₁ + simp only [hrow] at h + simp only [hv0, hv1, hv2, Nat.cast_zero, Nat.cast_one, Nat.cast_ofNat] at h + linear_combination h) + (by + have h := hp₁' + simp only [hrow] at h + simp only [hv1, hv2, hv3, Nat.cast_one, Nat.cast_ofNat] at h + linear_combination h) + (by + have h := hm₁ + simp only [hrow] at h + simp only [hv0, hv1, hv2, Nat.cast_zero, Nat.cast_one, Nat.cast_ofNat] at h + linear_combination h) + let A := U 0 + let B := V 1 - V 0 + let C := V 0 - A * (r : ZMod p) - B * (q : ZMod p) + have hsquare (i j : Fin 4) : rawArray W (r + i.val) (q + j.val) = + A * ((r + i.val : ℤ) : ZMod p) + + B * ((q + j.val : ℤ) : ZMod p) + C := by + rw [hrow, hpatch] + dsimp [A, B, C] + push_cast + ring + have hnonzero : A ≠ 0 ∨ B ≠ 0 ∨ C ≠ 0 := by + by_cases hA : A = 0 + · by_cases hB : B = 0 + · refine Or.inr (Or.inr ?_) + intro hC + have hz := hsquare 0 0 + simp only [Fin.val_zero, Nat.cast_zero, add_zero, hA, hB, hC, + zero_mul] at hz + exact rawArray_ne_zero W r q ⟨hr₀, by omega⟩ hz + · exact Or.inr (Or.inl hB) + · exact Or.inl hA + have hN : (8 : ℤ) ≤ (p ^ 2 : ℕ) := by + have hp' : 201 ≤ p := by omega + have hsq : 201 ^ 2 ≤ p ^ 2 := Nat.pow_le_pow_left hp' 2 + exact_mod_cast (show 8 ≤ p ^ 2 by omega) + have hglobal := good_everywhere_of_four_square (p ^ 2 : ℕ) hN + (fun n m => A * (n : ZMod p) + B * (m : ZMod p) + C = 0 ∨ + rawArray W n m = A * (n : ZMod p) + B * (m : ZMod p) + C) + (affine_four_line_closure hp hlarge hW A B C) r q hr₀ hr₃ + (fun i j => Or.inr (hsquare i j)) + refine ⟨A, B, C, hnonzero, ?_⟩ + intro n m hn + have h := hglobal (n.val : ℤ) m (Int.natCast_nonneg _) + (by exact_mod_cast n.isLt) + rw [rawArray_column] at h + simpa only [affineValue, Int.cast_natCast] using + (h.resolve_left (by simpa only [affineValue, Int.cast_natCast] using hn)) + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/WordAffineAlgebra.lean b/lean/OAI/Geometry/PeriodicTiling/WordAffineAlgebra.lean new file mode 100644 index 0000000000000000000000000000000000000000..6519fd0e69d974cc1bf489e784997ef3a59dc307 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/WordAffineAlgebra.lean @@ -0,0 +1,139 @@ +import OAI.Geometry.PeriodicTiling.WordRule +import Mathlib.Data.Int.Interval +import Mathlib.Data.Finset.Card +import Mathlib.Tactic.LinearCombination +import Mathlib.Tactic.FinCases +import Mathlib.Tactic.Ring + +namespace OAI + +universe uK uα + +namespace PeriodicTilingThree + +attribute [local instance] Classical.propDecidable + +section Field + +variable {K : Type uK} [Field K] + +theorem affine_coefficients_eq_of_two {a b c d x y : K} (hxy : x ≠ y) + (hx : a * x + b = c * x + d) (hy : a * y + b = c * y + d) : + a = c ∧ b = d := by + have hm : (a - c) * (x - y) = 0 := by linear_combination hx - hy + have ha : a = c := sub_eq_zero.mp ((mul_eq_zero.mp hm).resolve_right + (sub_ne_zero.mpr hxy)) + refine ⟨ha, ?_⟩ + linear_combination hx - x * ha + +theorem affine_root_unique {a b x y : K} (hab : a ≠ 0 ∨ b ≠ 0) + (hx : a * x + b = 0) (hy : a * y + b = 0) : x = y := by + by_contra hxy + have h := affine_coefficients_eq_of_two hxy + (show a * x + b = 0 * x + 0 by simpa using hx) + (show a * y + b = 0 * y + 0 by simpa using hy) + exact hab.elim (fun ha => ha h.1) (fun hb => hb h.2) + +theorem affine_roots_card_le_one {α : Type uα} [DecidableEq α] + (s : Finset α) (x : α → K) (hx : Set.InjOn x s) + (a b : K) (hab : a ≠ 0 ∨ b ≠ 0) : + (s.filter (fun i => a * x i + b = 0)).card ≤ 1 := by + classical + apply Finset.card_le_one.mpr + intro i hi j hj + exact hx (Finset.mem_filter.mp hi).1 (Finset.mem_filter.mp hj).1 + (affine_root_unique hab (Finset.mem_filter.mp hi).2 (Finset.mem_filter.mp hj).2) + +theorem two_common_nonzero_of_four (x : Fin 4 → K) (hx : Function.Injective x) + (a b c d : K) (hab : a ≠ 0 ∨ b ≠ 0) (hcd : c ≠ 0 ∨ d ≠ 0) : + ∃ i j : Fin 4, i ≠ j ∧ a * x i + b ≠ 0 ∧ c * x i + d ≠ 0 ∧ + a * x j + b ≠ 0 ∧ c * x j + d ≠ 0 := by + classical + let U := Finset.univ.filter (fun i => a * x i + b = 0) + let V := Finset.univ.filter (fun i => c * x i + d = 0) + have hu : U.card ≤ 1 := affine_roots_card_le_one _ _ (fun _ _ _ _ h => hx h) _ _ hab + have hv : V.card ≤ 1 := affine_roots_card_le_one _ _ (fun _ _ _ _ h => hx h) _ _ hcd + have huv : (U ∪ V).card ≤ 2 := (Finset.card_union_le U V).trans (by omega) + have hsub : U ∪ V ⊆ (Finset.univ : Finset (Fin 4)) := Finset.subset_univ _ + have hcard := Finset.card_sdiff_add_card_eq_card hsub + have hfour : (Finset.univ : Finset (Fin 4)).card = 4 := by simp + have hgood : 1 < (Finset.univ \ (U ∪ V)).card := by omega + obtain ⟨i, hi, j, hj, hij⟩ := Finset.one_lt_card.mp hgood + have hi' : a * x i + b ≠ 0 ∧ c * x i + d ≠ 0 := by + simpa [U, V] using hi + have hj' : a * x j + b ≠ 0 ∧ c * x j + d ≠ 0 := by + simpa [U, V] using hj + exact ⟨i, j, hij, hi'.1, hi'.2, hj'.1, hj'.2⟩ + +private theorem three_rows (h2 : (2 : K) ≠ 0) + (u₀ u₁ u₂ v₀ v₁ v₂ : K) + (hp : 2 * u₂ + v₂ - 2 * (u₁ + v₁) + v₀ = 0) + (hp' : 3 * u₂ + v₂ - 2 * (2 * u₁ + v₁) + u₀ + v₀ = 0) + (hm : v₂ - 2 * (u₁ + v₁) + 2 * u₀ + v₀ = 0) : + u₁ = u₀ ∧ u₂ = u₀ ∧ v₂ - 2 * v₁ + v₀ = 0 := by + have hu : 2 * (u₂ - u₀) = 0 := by linear_combination hp - hm + have hu₂ : u₂ = u₀ := sub_eq_zero.mp ((mul_eq_zero.mp hu).resolve_left h2) + have hu' : 2 * (u₁ - u₀) = 0 := by linear_combination hp - hp' + hu₂ + have hu₁ : u₁ = u₀ := sub_eq_zero.mp ((mul_eq_zero.mp hu').resolve_left h2) + refine ⟨hu₁, hu₂, ?_⟩ + linear_combination hp - 2 * hu₂ + 2 * hu₁ + +theorem four_rows_affine (h2 : (2 : K) ≠ 0) (U V : Fin 4 → K) + (hp₀ : 2 * U 2 + V 2 - 2 * (U 1 + V 1) + V 0 = 0) + (hp₀' : 3 * U 2 + V 2 - 2 * (2 * U 1 + V 1) + U 0 + V 0 = 0) + (hm₀ : V 2 - 2 * (U 1 + V 1) + 2 * U 0 + V 0 = 0) + (hp₁ : 2 * U 3 + V 3 - 2 * (U 2 + V 2) + V 1 = 0) + (hp₁' : 3 * U 3 + V 3 - 2 * (2 * U 2 + V 2) + U 1 + V 1 = 0) + (hm₁ : V 3 - 2 * (U 2 + V 2) + 2 * U 1 + V 1 = 0) : + ∀ i j : Fin 4, U j * (i.val : K) + V j = + U 0 * (i.val : K) + (V 1 - V 0) * (j.val : K) + V 0 := by + obtain ⟨hu₁, hu₂, hv₂⟩ := three_rows h2 _ _ _ _ _ _ hp₀ hp₀' hm₀ + obtain ⟨_, hu₃, hv₃⟩ := three_rows h2 _ _ _ _ _ _ hp₁ hp₁' hm₁ + have hu₃' : U 3 = U 0 := hu₃.trans hu₁ + have hv₂' : V 2 = 2 * V 1 - V 0 := by linear_combination hv₂ + have hv₃' : V 3 = 3 * V 1 - 2 * V 0 := by linear_combination hv₃ + 2 * hv₂ + intro i j + fin_cases j <;> simp only [Fin.reduceFinMk, + Nat.cast_zero, Nat.cast_one, Nat.cast_ofNat, hu₁, hu₂, hu₃', hv₂', hv₃'] <;> ring + +end Field + +theorem four_residues_injective {p : ℕ} (hp : 4 ≤ p) (r : ℤ) : + Function.Injective (fun i : Fin 4 => ((r + i.val : ℤ) : ZMod p)) := by + intro i j hij + have hv : (i.val : ZMod p) = (j.val : ZMod p) := by + simpa only [Int.cast_add, Int.cast_natCast, add_right_inj] using hij + apply Fin.ext + have h := congrArg ZMod.val hv + simpa only [ZMod.val_natCast_of_lt (i.isLt.trans_le hp), + ZMod.val_natCast_of_lt (j.isLt.trans_le hp)] using h + +theorem affine_int_roots_card_le {p : ℕ} (hp : p.Prime) (a b : ZMod p) + (hab : a ≠ 0 ∨ b ≠ 0) : + ((Finset.Ico (0 : ℤ) (p ^ 2 : ℕ)).filter + (fun n : ℤ => a * (n : ZMod p) + b = 0)).card ≤ p := by + classical + let : Fact p.Prime := ⟨hp⟩ + have hpz : (0 : ℤ) < p := by exact_mod_cast hp.pos + have hc : (Finset.Ico (0 : ℤ) (p : ℤ)).card = p := by simp + refine le_trans ?_ (le_of_eq hc) + apply Finset.card_le_card_of_injOn (fun n : ℤ => n / p) + · intro n hn + have hn' := Finset.mem_Ico.mp (Finset.mem_filter.mp hn).1 + apply Finset.mem_Ico.mpr + refine ⟨Int.ediv_nonneg hn'.1 hpz.le, ?_⟩ + apply Int.ediv_lt_of_lt_mul hpz + simpa only [pow_two, Nat.cast_mul] using hn'.2 + · intro n hn m hm hq + have hnm : (n : ZMod p) = (m : ZMod p) := affine_root_unique hab + (Finset.mem_filter.mp hn).2 (Finset.mem_filter.mp hm).2 + have hr := (ZMod.intCast_eq_intCast_iff' n m p).mp hnm + have hnq := Int.emod_add_mul_ediv n (p : ℤ) + have hmq := Int.emod_add_mul_ediv m (p : ℤ) + change n / (p : ℤ) = m / (p : ℤ) at hq + rw [hr, hq] at hnq + omega + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/WordAffineCount.lean b/lean/OAI/Geometry/PeriodicTiling/WordAffineCount.lean new file mode 100644 index 0000000000000000000000000000000000000000..6d7e02510719985809ec63f64ee51123f8ede0af --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/WordAffineCount.lean @@ -0,0 +1,157 @@ +import Mathlib.Data.Int.Interval +import Mathlib.Data.Finset.Prod +import Mathlib.Algebra.Order.BigOperators.Group.Finset +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.NormNum +import Mathlib.Tactic.Ring + +namespace OAI + +namespace PeriodicTilingThree + +noncomputable section + +attribute [local instance] Classical.propDecidable + +def wordExceptionalCells (N : ℕ) (bad : ℤ → ℤ → ℤ → Prop) : Finset (ℤ × ℤ) := + (Finset.Icc (-1 : ℤ) 1).biUnion fun d => + (Finset.Ico (-(N : ℤ)) (2 * (N : ℤ))).biUnion fun e => + ((Finset.Ico (0 : ℤ) N).filter (bad d e)).image fun n => (n, d * n + e) + +theorem card_wordExceptionalCells_le (N p : ℕ) (bad : ℤ → ℤ → ℤ → Prop) + (hbad : ∀ d e : ℤ, (d = -1 ∨ d = 0 ∨ d = 1) → + ((Finset.Ico (0 : ℤ) N).filter (bad d e)).card ≤ p) : + (wordExceptionalCells N bad).card ≤ 9 * N * p := by + have hE : (Finset.Ico (-(N : ℤ)) (2 * (N : ℤ))).card = 3 * N := by + rw [Int.card_Ico] + omega + have hD : (Finset.Icc (-1 : ℤ) 1).card = 3 := by + norm_num [Int.card_Icc] + have hinner : ∀ d ∈ Finset.Icc (-1 : ℤ) 1, + ((Finset.Ico (-(N : ℤ)) (2 * (N : ℤ))).biUnion fun e => + ((Finset.Ico (0 : ℤ) N).filter (bad d e)).image + fun n => (n, d * n + e)).card ≤ 3 * N * p := by + intro d hd + have hd' : d = -1 ∨ d = 0 ∨ d = 1 := by + have hd'' := Finset.mem_Icc.mp hd + omega + calc + _ ≤ (Finset.Ico (-(N : ℤ)) (2 * (N : ℤ))).card * p := by + apply Finset.card_biUnion_le_card_mul + intro e _he + exact Finset.card_image_le.trans (hbad d e hd') + _ = 3 * N * p := by rw [hE] + calc + (wordExceptionalCells N bad).card ≤ + (Finset.Icc (-1 : ℤ) 1).card * (3 * N * p) := + Finset.card_biUnion_le_card_mul _ _ _ hinner + _ = 9 * N * p := by rw [hD]; ring + +theorem mem_wordExceptionalCells (N : ℕ) (bad : ℤ → ℤ → ℤ → Prop) + (n m d : ℤ) (hn0 : 0 ≤ n) (hnN : n < N) + (hm0 : 0 ≤ m) (hmN : m < N) + (hd : d = -1 ∨ d = 0 ∨ d = 1) (hb : bad d (m - d * n) n) : + (n, m) ∈ wordExceptionalCells N bad := by + have hdmem : d ∈ Finset.Icc (-1 : ℤ) 1 := by + rcases hd with rfl | rfl | rfl <;> simp + have hemem : m - d * n ∈ Finset.Ico (-(N : ℤ)) (2 * (N : ℤ)) := by + apply Finset.mem_Ico.mpr + rcases hd with rfl | rfl | rfl <;> + simp only [neg_one_mul, zero_mul, one_mul, sub_zero] <;> constructor <;> omega + apply Finset.mem_biUnion.mpr + refine ⟨d, hdmem, Finset.mem_biUnion.mpr ⟨m - d * n, hemem, ?_⟩⟩ + apply Finset.mem_image.mpr + refine ⟨n, Finset.mem_filter.mpr ⟨Finset.mem_Ico.mpr ⟨hn0, hnN⟩, hb⟩, ?_⟩ + exact Prod.ext rfl (by omega) + +def wordBlockedOrigins (B : Finset (ℤ × ℤ)) : Finset (ℤ × ℤ) := + B.biUnion fun c => + ((Finset.Icc (0 : ℤ) 3).product (Finset.Icc (0 : ℤ) 3)).image + fun o => (c.1 - o.1, c.2 - o.2) + +theorem card_wordBlockedOrigins_le (B : Finset (ℤ × ℤ)) : + (wordBlockedOrigins B).card ≤ B.card * 16 := by + apply Finset.card_biUnion_le_card_mul + intro c _hc + calc + _ ≤ ((Finset.Icc (0 : ℤ) 3).product (Finset.Icc (0 : ℤ) 3)).card := + Finset.card_image_le + _ = 16 := by norm_num [Finset.card_product, Int.card_Icc] + +theorem mem_wordBlockedOrigins (B : Finset (ℤ × ℤ)) (r q : ℤ) + (i j : Fin 4) (hc : (r + i.val, q + j.val) ∈ B) : + (r, q) ∈ wordBlockedOrigins B := by + apply Finset.mem_biUnion.mpr + refine ⟨(r + i.val, q + j.val), hc, Finset.mem_image.mpr ?_⟩ + refine ⟨((i.val : ℤ), (j.val : ℤ)), ?_, ?_⟩ + · apply Finset.mem_product.mpr + constructor <;> apply Finset.mem_Icc.mpr <;> constructor <;> omega + · apply Prod.ext <;> simp + +private theorem four_square_count_inequality (p : ℕ) (hp : 200 < p) : + 144 * (p ^ 2) * p < (p ^ 2 - 3) ^ 2 := by + have hp0 : 0 < p := by omega + have hp201 : 201 ≤ p := by omega + have hpred : p - 1 + 1 = p := by omega + have hpredsq := congrArg (fun k : ℕ => k * k) hpred + have hpredmul := congrArg (fun k : ℕ => p * k) hpred + have hsq : 3 ≤ p ^ 2 := by nlinarith + have hsub : p ^ 2 - 3 + 3 = p ^ 2 := Nat.sub_add_cancel hsq + have hmul : 201 * p ≤ p * p := by nlinarith [Nat.mul_le_mul_right p hp201] + have hgap : 144 * p < (p - 1) * (p - 1) := by nlinarith + have hsmall : p * (p - 1) ≤ p ^ 2 - 3 := by nlinarith + have hlarge := Nat.mul_lt_mul_of_pos_left hgap (pow_pos hp0 2) + have hbound := Nat.mul_le_mul hsmall hsmall + nlinarith + +theorem exists_clean_four_square (p : ℕ) (hp : 200 < p) + (bad : ℤ → ℤ → ℤ → Prop) + (hbad : ∀ d e : ℤ, (d = -1 ∨ d = 0 ∨ d = 1) → + ((Finset.Ico (0 : ℤ) (p ^ 2 : ℕ)).filter (bad d e)).card ≤ p) : + ∃ r q : ℤ, 0 ≤ r ∧ r + 3 < (p ^ 2 : ℕ) ∧ + 0 ≤ q ∧ q + 3 < (p ^ 2 : ℕ) ∧ + ∀ i j : Fin 4, ∀ d : ℤ, (d = -1 ∨ d = 0 ∨ d = 1) → + ¬ bad d ((q + j.val) - d * (r + i.val)) (r + i.val) := by + let N : ℕ := p ^ 2 + have hN : 3 ≤ N := by dsimp [N]; nlinarith + let C : Finset (ℤ × ℤ) := + (Finset.Ico (0 : ℤ) (N - 3 : ℕ)).product + (Finset.Ico (0 : ℤ) (N - 3 : ℕ)) + let B := wordBlockedOrigins (wordExceptionalCells N bad) + have hC : C.card = (N - 3) ^ 2 := by + simp [C, Finset.card_product, Int.card_Ico, pow_two] + have hB : B.card ≤ 144 * N * p := by + calc + B.card ≤ (wordExceptionalCells N bad).card * 16 := + card_wordBlockedOrigins_le _ + _ ≤ (9 * N * p) * 16 := + Nat.mul_le_mul_right 16 (card_wordExceptionalCells_le N p bad hbad) + _ = 144 * N * p := by ring + have hlt : B.card < C.card := by + rw [hC] + exact hB.trans_lt (four_square_count_inequality p hp) + obtain ⟨⟨r, q⟩, hc, hnblocked⟩ := Finset.exists_mem_notMem_of_card_lt_card hlt + obtain ⟨hr, hq⟩ := Finset.mem_product.mp hc + have hr' := Finset.mem_Ico.mp hr + have hq' := Finset.mem_Ico.mp hq + have hr0 : 0 ≤ r := hr'.1 + have hq0 : 0 ≤ q := hq'.1 + have hr3 : r + 3 < (N : ℤ) := by omega + have hq3 : q + 3 < (N : ℤ) := by omega + refine ⟨r, q, hr0, hr3, hq0, hq3, ?_⟩ + intro i j d hd hb + apply hnblocked + apply mem_wordBlockedOrigins _ r q i j + apply mem_wordExceptionalCells N bad (r + i.val) (q + j.val) d + · omega + · omega + · omega + · omega + · exact hd + · exact hb + +end + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/WordAffineGeometry.lean b/lean/OAI/Geometry/PeriodicTiling/WordAffineGeometry.lean new file mode 100644 index 0000000000000000000000000000000000000000..bb8728e4acc173491173eb32fbac5cbe994e8402 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/WordAffineGeometry.lean @@ -0,0 +1,120 @@ +import Mathlib.Data.Int.Basic +import Mathlib.Algebra.Order.Ring.Int + +namespace OAI + +namespace PeriodicTilingThree + +def FourLineClosure (N : ℤ) (Good : ℤ → ℤ → Prop) : Prop := + ∀ d e : ℤ, (d = -1 ∨ d = 0 ∨ d = 1) → + ∀ r : ℤ, 0 ≤ r → r + 3 < N → + (∀ i : Fin 4, Good (r + i.val) (d * (r + i.val) + e)) → + ∀ n : ℤ, 0 ≤ n → n < N → Good n (d * n + e) + +def FourGoodRows (N : ℤ) (Good : ℤ → ℤ → Prop) (q : ℤ) : Prop := + ∀ m : ℤ, q ≤ m → m ≤ q + 3 → + ∀ n : ℤ, 0 ≤ n → n < N → Good n m + +theorem fourGoodRows_row_above (N : ℤ) (hN : 8 ≤ N) + (Good : ℤ → ℤ → Prop) (hline : FourLineClosure N Good) + (q : ℤ) (hrows : FourGoodRows N Good q) : + ∀ n : ℤ, 0 ≤ n → n < N → Good n (q + 4) := by + intro n hn0 hnN + by_cases hr : n + 4 < N + · have hseed : ∀ i : Fin 4, + Good (n + 1 + i.val) ((-1) * (n + 1 + i.val) + (n + q + 4)) := by + intro i + have hi : 0 ≤ (i.val : ℤ) ∧ (i.val : ℤ) < 4 := by omega + have hg := hrows (q + 3 - i.val) (by omega) (by omega) + (n + 1 + i.val) (by omega) (by omega) + convert hg using 1; simp only [neg_one_mul]; omega + have h := hline (-1) (n + q + 4) (Or.inl rfl) + (n + 1) (by omega) (by omega) hseed n hn0 hnN + convert h using 1; simp only [neg_one_mul]; omega + · have hl : 4 ≤ n := by omega + have hseed : ∀ i : Fin 4, + Good (n - 4 + i.val) (1 * (n - 4 + i.val) + (q + 4 - n)) := by + intro i + have hi : 0 ≤ (i.val : ℤ) ∧ (i.val : ℤ) < 4 := by omega + have hg := hrows (q + i.val) (by omega) (by omega) + (n - 4 + i.val) (by omega) (by omega) + convert hg using 1; simp only [one_mul]; omega + have h := hline 1 (q + 4 - n) (Or.inr (Or.inr rfl)) + (n - 4) (by omega) (by omega) hseed n hn0 hnN + convert h using 1; simp only [one_mul]; omega + +theorem fourGoodRows_row_below (N : ℤ) (hN : 8 ≤ N) + (Good : ℤ → ℤ → Prop) (hline : FourLineClosure N Good) + (q : ℤ) (hrows : FourGoodRows N Good q) : + ∀ n : ℤ, 0 ≤ n → n < N → Good n (q - 1) := by + intro n hn0 hnN + by_cases hr : n + 4 < N + · have hseed : ∀ i : Fin 4, + Good (n + 1 + i.val) (1 * (n + 1 + i.val) + (q - 1 - n)) := by + intro i + have hi : 0 ≤ (i.val : ℤ) ∧ (i.val : ℤ) < 4 := by omega + have hg := hrows (q + i.val) (by omega) (by omega) + (n + 1 + i.val) (by omega) (by omega) + convert hg using 1; simp only [one_mul]; omega + have h := hline 1 (q - 1 - n) (Or.inr (Or.inr rfl)) + (n + 1) (by omega) (by omega) hseed n hn0 hnN + convert h using 1; simp only [one_mul]; omega + · have hl : 4 ≤ n := by omega + have hseed : ∀ i : Fin 4, + Good (n - 4 + i.val) ((-1) * (n - 4 + i.val) + (q - 1 + n)) := by + intro i + have hi : 0 ≤ (i.val : ℤ) ∧ (i.val : ℤ) < 4 := by omega + have hg := hrows (q + 3 - i.val) (by omega) (by omega) + (n - 4 + i.val) (by omega) (by omega) + convert hg using 1; simp only [neg_one_mul]; omega + have h := hline (-1) (q - 1 + n) (Or.inl rfl) + (n - 4) (by omega) (by omega) hseed n hn0 hnN + convert h using 1; simp only [neg_one_mul]; omega + +theorem fourGoodRows_add_one (N : ℤ) (hN : 8 ≤ N) + (Good : ℤ → ℤ → Prop) (hline : FourLineClosure N Good) + (q : ℤ) (hrows : FourGoodRows N Good q) : + FourGoodRows N Good (q + 1) := by + intro m hm0 hm3 n hn0 hnN + by_cases hm : m ≤ q + 3 + · exact hrows m (by omega) hm n hn0 hnN + · have he : m = q + 4 := by omega + rw [he] + exact fourGoodRows_row_above N hN Good hline q hrows n hn0 hnN + +theorem fourGoodRows_sub_one (N : ℤ) (hN : 8 ≤ N) + (Good : ℤ → ℤ → Prop) (hline : FourLineClosure N Good) + (q : ℤ) (hrows : FourGoodRows N Good q) : + FourGoodRows N Good (q - 1) := by + intro m hm0 hm3 n hn0 hnN + by_cases hm : q ≤ m + · exact hrows m hm (by omega) n hn0 hnN + · have he : m = q - 1 := by omega + rw [he] + exact fourGoodRows_row_below N hN Good hline q hrows n hn0 hnN + +theorem good_everywhere_of_four_square (N : ℤ) (hN : 8 ≤ N) + (Good : ℤ → ℤ → Prop) (hline : FourLineClosure N Good) + (r q : ℤ) (hr0 : 0 ≤ r) (hr3 : r + 3 < N) + (hsquare : ∀ i j : Fin 4, Good (r + i.val) (q + j.val)) : + ∀ n m : ℤ, 0 ≤ n → n < N → Good n m := by + have hbase : FourGoodRows N Good q := by + intro m hm0 hm3 n hn0 hnN + let j : Fin 4 := ⟨(m - q).toNat, by omega⟩ + have hj : q + (j.val : ℤ) = m := by dsimp [j]; omega + have hseed : ∀ i : Fin 4, Good (r + i.val) (0 * (r + i.val) + m) := by + intro i + simpa only [zero_mul, zero_add, hj] using hsquare i j + have h := hline 0 m (Or.inr (Or.inl rfl)) r hr0 hr3 hseed n hn0 hnN + simpa only [zero_mul, zero_add] using h + have hall : ∀ t : ℤ, FourGoodRows N Good t := by + intro t + exact Int.inductionOn' t q hbase + (fun k _ hk => fourGoodRows_add_one N hN Good hline k hk) + (fun k _ hk => fourGoodRows_sub_one N hN Good hline k hk) + intro n m hn0 hnN + exact hall m m le_rfl (by omega) n hn0 hnN + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/WordObstruction.lean b/lean/OAI/Geometry/PeriodicTiling/WordObstruction.lean new file mode 100644 index 0000000000000000000000000000000000000000..45ead822bbe1279221588de20d629a685fb58ab4 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/WordObstruction.lean @@ -0,0 +1,374 @@ +import OAI.Geometry.PeriodicTiling.WordAffine +import OAI.Geometry.PeriodicTiling.WordAffineAlgebra +import Mathlib.Tactic.LinearCombination +import Mathlib.Tactic.Ring +import Mathlib.Tactic.Linarith +import Lean.Elab.Tactic.Omega + +namespace OAI + +noncomputable section + +namespace PeriodicTilingThree + +private theorem word_one_ne_two {p : ℕ} (hlarge : 200 < p) : + (1 : ZMod p) ≠ 2 := by + intro h + have hv := congrArg (fun x : ZMod p => x.val) h + rw [ZMod.val_one_eq_one_mod, ZMod.val_two_eq_two_mod, + Nat.mod_eq_of_lt (by omega : 1 < p), + Nat.mod_eq_of_lt (by omega : 2 < p)] at hv + omega + +private theorem word_two_ne_zero {p : ℕ} (hlarge : 200 < p) : + (2 : ZMod p) ≠ 0 := by + intro h + have hd : p ∣ 2 := (ZMod.natCast_eq_zero_iff 2 p).mp h + exact Nat.not_dvd_of_pos_of_lt (by decide : 0 < 2) (by omega : 2 < p) hd + +private def smallColumn {p : ℕ} (hlarge : 200 < p) (n : Fin p) : Column p := + ⟨n.val, by have := n.isLt; nlinarith⟩ + +private def fourColumn {p : ℕ} (hlarge : 200 < p) (i : Fin 4) : Column p := + smallColumn hlarge ⟨i.val, by have := i.isLt; omega⟩ + +private theorem small_affine_nonzero {p : ℕ} (hp : p.Prime) + (A C : ZMod p) (hAC : A ≠ 0 ∨ C ≠ 0) : + ∃ n : Fin p, A * (n.val : ZMod p) + C ≠ 0 := by + by_cases hC : C = 0 + · have hA : A ≠ 0 := hAC.resolve_right (fun h => h hC) + refine ⟨⟨1, hp.one_lt⟩, ?_⟩ + simpa only [Nat.cast_one, mul_one, hC, add_zero] using hA + · refine ⟨⟨0, hp.pos⟩, ?_⟩ + simpa only [Nat.cast_zero, mul_zero, zero_add] using hC + +private theorem exists_vertical_value {p : ℕ} (hp : p.Prime) + (A B C : ZMod p) (hB : B ≠ 0) (n : Column p) (t : ZMod p) : + ∃ m : ℤ, affineValue A B C n m = t := by + let : Fact p.Prime := ⟨hp⟩ + obtain ⟨m, hm⟩ := ZMod.intCast_surjective + (B⁻¹ * (t - A * (n.val : ZMod p) - C)) + refine ⟨m, ?_⟩ + have hBm : B * (m : ZMod p) = t - A * (n.val : ZMod p) - C := by + rw [hm, ← mul_assoc, mul_inv_cancel₀ hB, one_mul] + unfold affineValue + rw [hBm] + ring + +theorem nonconstantColumns_iff_vertical_coefficient {p : ℕ} (hp : p.Prime) + (hlarge : 200 < p) {W : WordArray p} {A B C : ZMod p} + (hH : AffineApproximation W A B C) : NonconstantColumns W ↔ B ≠ 0 := by + let : Fact p.Prime := ⟨hp⟩ + constructor + · intro hcolumns hB + have hAC : A ≠ 0 ∨ C ≠ 0 := by + rcases hH.1 with hA | hB' | hC + · exact Or.inl hA + · exact (hB' hB).elim + · exact Or.inr hC + obtain ⟨n₀, hn₀⟩ := small_affine_nonzero hp A C hAC + let n := smallColumn hlarge n₀ + obtain ⟨m, m', hmm'⟩ := hcolumns n + apply hmm' + apply Units.ext + have hval (z : ℤ) : (W n z : ZMod p) = A * (n₀.val : ZMod p) + C := by + have hn : affineValue A B C n z ≠ 0 := by + simpa only [affineValue, n, smallColumn, hB, zero_mul, add_zero] using hn₀ + simpa only [affineValue, n, smallColumn, hB, zero_mul, add_zero] using hH.2 n z hn + exact (hval m).trans (hval m').symm + · intro hB n + obtain ⟨m, hm⟩ := exists_vertical_value hp A B C hB n 1 + obtain ⟨m', hm'⟩ := exists_vertical_value hp A B C hB n 2 + refine ⟨m, m', ?_⟩ + intro heq + have hwm : (W n m : ZMod p) = 1 := + (hH.2 n m (by rw [hm]; exact one_ne_zero)).trans hm + have hwm' : (W n m' : ZMod p) = 2 := + (hH.2 n m' (by rw [hm']; exact word_two_ne_zero hlarge)).trans hm' + exact word_one_ne_two hlarge + (hwm.symm.trans ((congrArg (fun u : Symbol p => (u : ZMod p)) heq).trans hwm')) + +theorem prime_dvd_vertical_period {p : ℕ} (hp : p.Prime) + (hlarge : 200 < p) {W : WordArray p} {A B C : ZMod p} + (hH : AffineApproximation W A B C) (hB : B ≠ 0) {M : ℤ} + (hperiod : VerticalPeriod W M) : (p : ℤ) ∣ M := by + let : Fact p.Prime := ⟨hp⟩ + let n : Column p := ⟨0, pow_pos hp.pos 2⟩ + let x : Fin 4 → ZMod p := fun i => (i.val : ZMod p) + have hx : Function.Injective x := by + simpa only [zero_add, Int.cast_natCast] using + (four_residues_injective (p := p) (by omega : 4 ≤ p) 0) + obtain ⟨i, j, hij, hi, hiM, hj, hjM⟩ := two_common_nonzero_of_four x hx + B (A * (n.val : ZMod p) + C) + B (B * (M : ZMod p) + A * (n.val : ZMod p) + C) + (Or.inl hB) (Or.inl hB) + let m : ℤ := i.val + have hm : affineValue A B C n m ≠ 0 := by + have heq : affineValue A B C n m = B * x i + (A * (n.val : ZMod p) + C) := by + simp only [affineValue, m, x, Int.cast_natCast] + ring + rw [heq] + exact hi + have hmM : affineValue A B C n (m + M) ≠ 0 := by + have heq : affineValue A B C n (m + M) = + B * x i + (B * (M : ZMod p) + A * (n.val : ZMod p) + C) := by + simp only [affineValue, m, x, Int.cast_add, Int.cast_natCast] + ring + rw [heq] + exact hiM + have heq : affineValue A B C n (m + M) = affineValue A B C n m := + (hH.2 n (m + M) hmM).symm.trans + ((congrArg (fun u : Symbol p => (u : ZMod p)) (hperiod n m)).trans (hH.2 n m hm)) + have hBM : B * (M : ZMod p) = 0 := by + simp only [affineValue, Int.cast_add] at heq + linear_combination heq + exact (ZMod.intCast_zmod_eq_zero_iff_dvd M p).mp + ((mul_eq_zero.mp hBM).resolve_left hB) + +def straighten {p : ℕ} (W : WordArray p) (u v : ℤ) : WordArray p := + fun n m => W n (m + u * (n.val : ℤ) + v) + +theorem straighten_lineRule {p : ℕ} {W : WordArray p} + (hW : LineRule p W) (u v : ℤ) : LineRule p (straighten W u v) := by + intro d e + have heq : (fun n => straighten W u v n (d * (n.val : ℤ) + e)) = + (fun n => W n ((d + u) * (n.val : ℤ) + (e + v))) := by + funext n + unfold straighten + congr 1 + ring + rw [heq] + exact hW (d + u) (e + v) + +theorem straighten_nonconstantColumns_iff {p : ℕ} (W : WordArray p) (u v : ℤ) : + NonconstantColumns (straighten W u v) ↔ NonconstantColumns W := by + constructor + · intro h n + obtain ⟨m, m', hmm'⟩ := h n + exact ⟨m + u * (n.val : ℤ) + v, m' + u * (n.val : ℤ) + v, hmm'⟩ + · intro h n + obtain ⟨m, m', hmm'⟩ := h n + refine ⟨m - u * (n.val : ℤ) - v, m' - u * (n.val : ℤ) - v, ?_⟩ + have hm : m - u * (n.val : ℤ) - v + u * (n.val : ℤ) + v = m := by ring + have hm' : m' - u * (n.val : ℤ) - v + u * (n.val : ℤ) + v = m' := by ring + simpa only [straighten, hm, hm'] using hmm' + +theorem straighten_verticalPeriod_iff {p : ℕ} (W : WordArray p) + (u v M : ℤ) : VerticalPeriod (straighten W u v) M ↔ VerticalPeriod W M := by + constructor + · intro h n m + have hh := h n (m - u * (n.val : ℤ) - v) + change W n ((m - u * (n.val : ℤ) - v + M) + u * (n.val : ℤ) + v) = + W n ((m - u * (n.val : ℤ) - v) + u * (n.val : ℤ) + v) at hh + convert hh using 1 <;> congr 1 <;> ring + · intro h n m + change W n ((m + M) + u * (n.val : ℤ) + v) = W n (m + u * (n.val : ℤ) + v) + convert h n (m + u * (n.val : ℤ) + v) using 1 ; congr 1 ; ring + +theorem exists_straighten_affine {p : ℕ} (hp : p.Prime) + {W : WordArray p} {A B C : ZMod p} (hH : AffineApproximation W A B C) + (hB : B ≠ 0) : ∃ u v : ℤ, AffineApproximation (straighten W u v) 0 B 0 := by + let : Fact p.Prime := ⟨hp⟩ + obtain ⟨u, hu⟩ := ZMod.intCast_surjective (-(B⁻¹ * A)) + obtain ⟨v, hv⟩ := ZMod.intCast_surjective (-(B⁻¹ * C)) + have hbu : A + B * (u : ZMod p) = 0 := by + rw [hu, mul_neg, ← mul_assoc, mul_inv_cancel₀ hB, one_mul, add_neg_cancel] + have hbv : C + B * (v : ZMod p) = 0 := by + rw [hv, mul_neg, ← mul_assoc, mul_inv_cancel₀ hB, one_mul, add_neg_cancel] + refine ⟨u, v, Or.inr (Or.inl hB), ?_⟩ + intro n m hm + have hnorm : affineValue A B C n (m + u * (n.val : ℤ) + v) = + affineValue 0 B 0 n m := by + simp only [affineValue, Int.cast_add, Int.cast_mul, Int.cast_natCast] + linear_combination (n.val : ZMod p) * hbu + hbv + exact (hH.2 n _ (by rw [hnorm]; exact hm)).trans hnorm + +def rescale {p : ℕ} (W : WordArray p) : WordArray p := + fun n m => W n ((p : ℤ) * m) + +theorem rescale_lineRule {p : ℕ} {W : WordArray p} (hW : LineRule p W) : + LineRule p (rescale W) := by + intro d e + have heq : (fun n => rescale W n (d * (n.val : ℤ) + e)) = + (fun n => W n (((p : ℤ) * d) * (n.val : ℤ) + (p : ℤ) * e)) := by + funext n + unfold rescale + congr 1 + ring + rw [heq] + exact hW ((p : ℤ) * d) ((p : ℤ) * e) + +private theorem exists_nonzero_affine_ne {p : ℕ} (hp : p.Prime) + (hlarge : 200 < p) (a z c : ZMod p) (ha : a ≠ 0) : + ∃ k : Fin p, z + a * (k.val : ZMod p) ≠ 0 ∧ + z + a * (k.val : ZMod p) ≠ c := by + let : Fact p.Prime := ⟨hp⟩ + let : NeZero p := ⟨hp.ne_zero⟩ + have ht : ∃ t : ZMod p, t ≠ 0 ∧ t ≠ c := by + by_cases hc : c = 1 + · exact ⟨2, word_two_ne_zero hlarge, by + rw [hc] + exact Ne.symm (word_one_ne_two hlarge)⟩ + · exact ⟨1, one_ne_zero, Ne.symm hc⟩ + obtain ⟨t, ht0, htc⟩ := ht + let x : ZMod p := a⁻¹ * (t - z) + let k : Fin p := ⟨x.val, ZMod.val_lt x⟩ + have hk : (k.val : ZMod p) = x := ZMod.natCast_zmod_val x + have heq : z + a * (k.val : ZMod p) = t := by + rw [hk] + dsimp only [x] + rw [← mul_assoc, mul_inv_cancel₀ ha, one_mul] + ring + exact ⟨k, by rw [heq]; exact ht0, by rw [heq]; exact htc⟩ + +private def fiberColumn {p : ℕ} (n₀ k : Fin p) : Column p := + ⟨n₀.val + p * k.val, by + calc + n₀.val + p * k.val < p + p * k.val := Nat.add_lt_add_right n₀.isLt _ + _ = p * (k.val + 1) := by ring + _ ≤ p * p := Nat.mul_le_mul_left p (Nat.succ_le_of_lt k.isLt) + _ = p ^ 2 := by ring⟩ + +theorem rescale_vertical_coefficient_ne_zero {p : ℕ} (hp : p.Prime) + (hlarge : 200 < p) {W : WordArray p} (hW : LineRule p W) + {B : ZMod p} (hB : B ≠ 0) (hH : AffineApproximation W 0 B 0) + {A₁ B₁ C₁ : ZMod p} (hH₁ : AffineApproximation (rescale W) A₁ B₁ C₁) : + B₁ ≠ 0 := by + classical + let : Fact p.Prime := ⟨hp⟩ + intro hB₁ + have hAC : A₁ ≠ 0 ∨ C₁ ≠ 0 := by + rcases hH₁.1 with hA | hB' | hC + · exact Or.inl hA + · exact (hB' hB₁).elim + · exact Or.inr hC + obtain ⟨n₀, hc⟩ := small_affine_nonzero hp A₁ C₁ hAC + let c : ZMod p := A₁ * (n₀.val : ZMod p) + C₁ + obtain ⟨a, b, hab, hw⟩ := hW 1 (-(n₀.val : ℤ)) + have hab' : (a : ZMod p) ≠ 0 ∨ (b : ZMod p) ≠ 0 := by + rcases hab with ha | hb + · exact Or.inl (fun h => ha ((ZMod.intCast_zmod_eq_zero_iff_dvd a p).mp h)) + · exact Or.inr (fun h => hb ((ZMod.intCast_zmod_eq_zero_iff_dvd b p).mp h)) + let x : Fin 4 → ZMod p := fun i => (i.val : ZMod p) + have hx : Function.Injective x := by + simpa only [zero_add, Int.cast_natCast] using + (four_residues_injective (p := p) (by omega : 4 ≤ p) 0) + obtain ⟨i, j, hij, hai, hbi, haj, hbj⟩ := two_common_nonzero_of_four x hx + (a : ZMod p) (b : ZMod p) B (-B * (n₀.val : ZMod p)) hab' (Or.inl hB) + have hmatch (s : Fin 4) + (has : (a : ZMod p) * x s + (b : ZMod p) ≠ 0) + (hbs : B * x s + -B * (n₀.val : ZMod p) ≠ 0) : + (a : ZMod p) * x s + (b : ZMod p) = + B * x s + -B * (n₀.val : ZMod p) := by + let n := fourColumn hlarge s + have hnot : ¬ (p : ℤ) ∣ a * (n.val : ℤ) + b := by + intro hd + apply has + simpa only [Int.cast_add, Int.cast_mul, Int.cast_natCast, n, fourColumn, smallColumn, x] using + (ZMod.intCast_zmod_eq_zero_iff_dvd (a * (n.val : ℤ) + b) p).mpr hd + have harg : affineValue 0 B 0 n (1 * (n.val : ℤ) + -(n₀.val : ℤ)) = + B * x s + -B * (n₀.val : ZMod p) := by + simp only [affineValue, zero_mul, zero_add, add_zero, one_mul, + Int.cast_add, Int.cast_neg, Int.cast_natCast] + change B * ((s.val : ZMod p) + -(n₀.val : ZMod p)) = + B * (s.val : ZMod p) + -B * (n₀.val : ZMod p) + ring + have hw' := (hw n).1 hnot + dsimp only at hw' + have hH' := hH.2 n (1 * (n.val : ℤ) + -(n₀.val : ℤ)) + (by rw [harg]; exact hbs) + calc + (a : ZMod p) * x s + (b : ZMod p) = + (W n (1 * (n.val : ℤ) + -(n₀.val : ℤ)) : ZMod p) := by + simpa only [Int.cast_add, Int.cast_mul, Int.cast_natCast, n, fourColumn, smallColumn, x] using hw'.symm + _ = B * x s + -B * (n₀.val : ZMod p) := hH'.trans harg + obtain ⟨haB, hbB⟩ := affine_coefficients_eq_of_two (fun h => hij (hx h)) + (hmatch i hai hbi) (hmatch j haj hbj) + have ha0 : (a : ZMod p) ≠ 0 := by rw [haB]; exact hB + have hdiv : (p : ℤ) ∣ a * (n₀.val : ℤ) + b := by + apply (ZMod.intCast_zmod_eq_zero_iff_dvd _ p).mp + simp only [Int.cast_add, Int.cast_mul, Int.cast_natCast] + rw [haB, hbB] + ring + obtain ⟨z, hz⟩ := hdiv + obtain ⟨k, hk0, hkc⟩ := exists_nonzero_affine_ne hp hlarge (a : ZMod p) (z : ZMod p) c ha0 + let n := fiberColumn n₀ k + have hnv : (n.val : ℤ) = (n₀.val : ℤ) + (p : ℤ) * (k.val : ℤ) := by + simp only [n, fiberColumn, Nat.cast_add, Nat.cast_mul] + have hnvmod : (n.val : ZMod p) = (n₀.val : ZMod p) := by + simp only [n, fiberColumn, Nat.cast_add, Nat.cast_mul, ZMod.natCast_self, + zero_mul, add_zero] + have hnew : affineValue A₁ B₁ C₁ n (k.val : ℤ) = c := by + simp only [affineValue, hB₁, zero_mul, add_zero, hnvmod, c] + have hvalue : (W n ((p : ℤ) * (k.val : ℤ)) : ZMod p) = c := + (hH₁.2 n (k.val : ℤ) (by rw [hnew]; exact hc)).trans hnew + have hfactor : a * (n.val : ℤ) + b = (p : ℤ) * (z + a * (k.val : ℤ)) := by + rw [hnv] + linear_combination hz + have hnot : ¬ (p : ℤ) ∣ z + a * (k.val : ℤ) := by + intro hd + apply hk0 + simpa only [Int.cast_add, Int.cast_mul, Int.cast_natCast] using + (ZMod.intCast_zmod_eq_zero_iff_dvd (z + a * (k.val : ℤ)) p).mpr hd + have hp0 : (p : ℤ) ≠ 0 := Int.natCast_ne_zero.mpr hp.ne_zero + have hnotSq : ¬ (p : ℤ) ^ 2 ∣ a * (n.val : ℤ) + b := by + intro hd + apply hnot + apply (Int.mul_dvd_mul_iff_left hp0).mp + simpa only [pow_two, hfactor] using hd + have hdivn : (p : ℤ) ∣ a * (n.val : ℤ) + b := ⟨z + a * (k.val : ℤ), hfactor⟩ + have hsecond := (hw n).2 hdivn hnotSq + dsimp only at hsecond + have hline : 1 * (n.val : ℤ) + -(n₀.val : ℤ) = (p : ℤ) * (k.val : ℤ) := by + rw [hnv] + ring + rw [hline, hvalue, hfactor, Int.mul_ediv_cancel_left _ hp0] at hsecond + apply hkc + simpa only [Int.cast_add, Int.cast_mul, Int.cast_natCast] using hsecond.symm + +theorem no_positive_nat_vertical_period {p : ℕ} (hp : p.Prime) + (hlarge : 200 < p) : + ∀ M : ℕ, ∀ W : WordArray p, LineRule p W → NonconstantColumns W → + 0 < M → VerticalPeriod W (M : ℤ) → False := by + intro M + induction M using Nat.strong_induction_on with + | h M ih => + intro W hW hcolumns hM hperiod + obtain ⟨A, B, C, hH⟩ := global_affine_approximation hp hlarge hW + have hB := (nonconstantColumns_iff_vertical_coefficient hp hlarge hH).mp hcolumns + have hdivZ := prime_dvd_vertical_period hp hlarge hH hB hperiod + have hdiv : p ∣ M := Int.natCast_dvd_natCast.mp hdivZ + obtain ⟨u, v, hnorm⟩ := exists_straighten_affine hp hH hB + let W₀ := straighten W u v + have hW₀ : LineRule p W₀ := straighten_lineRule hW u v + have hperiod₀ : VerticalPeriod W₀ (M : ℤ) := + (straighten_verticalPeriod_iff W u v (M : ℤ)).mpr hperiod + have hW₁ : LineRule p (rescale W₀) := rescale_lineRule hW₀ + obtain ⟨A₁, B₁, C₁, hH₁⟩ := global_affine_approximation hp hlarge hW₁ + have hB₁ := rescale_vertical_coefficient_ne_zero hp hlarge hW₀ hB hnorm hH₁ + have hcolumns₁ := (nonconstantColumns_iff_vertical_coefficient hp hlarge hH₁).mpr hB₁ + have hsmall : M / p < M := Nat.div_lt_self hM hp.one_lt + have hpos : 0 < M / p := Nat.div_pos (Nat.le_of_dvd hM hdiv) hp.pos + have hquot : (p : ℤ) * ((M / p : ℕ) : ℤ) = (M : ℤ) := by + exact_mod_cast Nat.mul_div_cancel' hdiv + have hperiod₁ : VerticalPeriod (rescale W₀) ((M / p : ℕ) : ℤ) := by + intro n m + change W₀ n ((p : ℤ) * (m + ((M / p : ℕ) : ℤ))) = W₀ n ((p : ℤ) * m) + rw [mul_add, hquot] + exact hperiod₀ n ((p : ℤ) * m) + exact ih (M / p) hsmall (rescale W₀) hW₁ hcolumns₁ hpos hperiod₁ + +theorem no_positive_vertical_period {p : ℕ} (hp : p.Prime) + (hlarge : 200 < p) {W : WordArray p} (hW : LineRule p W) + (hcolumns : NonconstantColumns W) {M : ℤ} (hM : 0 < M) + (hperiod : VerticalPeriod W M) : False := by + have hpos : 0 < M.toNat := Int.pos_iff_toNat_pos.mp hM + have hcast : (M.toNat : ℤ) = M := Int.toNat_of_nonneg hM.le + exact no_positive_nat_vertical_period hp hlarge M.toNat W hW hcolumns hpos + (by simpa only [hcast] using hperiod) + +end PeriodicTilingThree + +end + +end OAI diff --git a/lean/OAI/Geometry/PeriodicTiling/WordRule.lean b/lean/OAI/Geometry/PeriodicTiling/WordRule.lean new file mode 100644 index 0000000000000000000000000000000000000000..b1e1e14558f43a53e2c052593d2ef6f46b9b1d53 --- /dev/null +++ b/lean/OAI/Geometry/PeriodicTiling/WordRule.lean @@ -0,0 +1,76 @@ +import OAI.Geometry.PeriodicTiling.TilingBasic +import Mathlib.Algebra.Field.ZMod +import Mathlib.Data.Fintype.Pi +import Mathlib.Data.Fintype.Sum + +namespace OAI + +namespace PeriodicTilingThree + +abbrev Column (p : ℕ) := Fin (p ^ 2) +abbrev Symbol (p : ℕ) := (ZMod p)ˣ +abbrev Word (p : ℕ) := Column p → Symbol p +abbrev WordArray (p : ℕ) := Column p → ℤ → Symbol p +abbrev Channel (p : ℕ) := Column p ⊕ Fin 2 + +def Label (p : ℕ) : Channel p → Type + | .inl _ => Symbol p + | .inr _ => Unit + +instance instFintypeLabel (p : ℕ) [NeZero p] (i : Channel p) : Fintype (Label p i) := by + cases i <;> dsimp [Label] <;> infer_instance + +instance instDecidableEqLabel (p : ℕ) (i : Channel p) : DecidableEq (Label p i) := by + cases i <;> dsimp [Label] <;> infer_instance + +instance instInhabitedLabel (p : ℕ) (i : Channel p) : Inhabited (Label p i) := by + cases i <;> dsimp [Label] <;> infer_instance + +def Allowed (p : ℕ) (w : Word p) : Prop := + ∃ a b : ℤ, + (¬ (p : ℤ) ∣ a ∨ ¬ (p : ℤ) ∣ b) ∧ + ∀ n : Column p, + let t := a * (n.val : ℤ) + b + (¬ (p : ℤ) ∣ t → (w n : ZMod p) = (t : ZMod p)) ∧ + ((p : ℤ) ∣ t → ¬ (p : ℤ) ^ 2 ∣ t → + (w n : ZMod p) = ((t / (p : ℤ) : ℤ) : ZMod p)) + +def LineRule (p : ℕ) (W : WordArray p) : Prop := + ∀ d e : ℤ, Allowed p (fun n => W n (d * (n.val : ℤ) + e)) + +def NonconstantColumns {p : ℕ} (W : WordArray p) : Prop := + ∀ n, ∃ m m' : ℤ, W n m ≠ W n m' + +def VerticalPeriod {p : ℕ} (W : WordArray p) (M : ℤ) : Prop := + ∀ n m, W n (m + M) = W n m + +def affineValue {p : ℕ} (A B C : ZMod p) (n : Column p) (m : ℤ) : ZMod p := + A * (n.val : ZMod p) + B * (m : ZMod p) + C + +def AffineApproximation {p : ℕ} (W : WordArray p) (A B C : ZMod p) : Prop := + (A ≠ 0 ∨ B ≠ 0 ∨ C ≠ 0) ∧ + ∀ n m, affineValue A B C n m ≠ 0 → + (W n m : ZMod p) = affineValue A B C n m + +def lineValue {p : ℕ} (n : Column p) (x : Plane) : ℤ := + x.2 + (n.val : ℤ) * x.1 + +def lineKernelStep {p : ℕ} (n : Column p) : Plane := + (1, -(n.val : ℤ)) + +@[simp] theorem lineValue_vertical {p : ℕ} (n : Column p) (m : ℤ) : + lineValue n (0, m) = m := by + simp [lineValue] + +noncomputable def allowedWords (p : ℕ) [NeZero p] : Finset (Word p) := by + classical + exact Finset.univ.filter (Allowed p) + +@[simp] theorem mem_allowedWords {p : ℕ} [NeZero p] (w : Word p) : + w ∈ allowedWords p ↔ Allowed p w := by + classical + simp [allowedWords] + +end PeriodicTilingThree + +end OAI diff --git a/lean/OAI/Geometry/PinnedDistances/ArithmeticContradiction.lean b/lean/OAI/Geometry/PinnedDistances/ArithmeticContradiction.lean new file mode 100644 index 0000000000000000000000000000000000000000..7147fd9873f2c0bc7803858a867d0cd74470e18f --- /dev/null +++ b/lean/OAI/Geometry/PinnedDistances/ArithmeticContradiction.lean @@ -0,0 +1,69 @@ +import OAI.Geometry.PinnedDistances.BoundedContradiction + +namespace OAI + +universe u1 u2 u3 + +section +noncomputable section +open Filter +open scoped Topology +namespace WeakPinned + +lemma sequence_bounded_subsequence (W : ℕ → ℝ) (hW : ¬Tendsto W atTop atTop) + (p : ℕ → Prop) (hp : ∀ᶠ n in atTop,p n) : + ∃ (φ : ℕ → ℕ) (C : ℝ),Tendsto φ atTop atTop ∧ 0≤C ∧ ∀ n,W (φ n)≤C ∧ p (φ n) := by + rw [tendsto_atTop] at hW + push Not at hW + obtain ⟨C,hC⟩ := hW + obtain ⟨φ,hφ,hφC⟩ := exists_seq_forall_of_frequently (hC.and_eventually hp) + exact ⟨φ,max C 0,hφ,le_max_right _ _,fun n => ⟨(hφC n).1.le.trans (le_max_left _ _),(hφC n).2⟩⟩ + +end WeakPinned + +end +end +section +noncomputable section +open Filter +open scoped Topology +namespace WeakPinned +open Global + +variable {V : ℕ → Type u1} {I : ℕ → Type u2} {K : ℕ → Type u3} [∀ j,Fintype (V j)] [∀ j,Fintype (I j)] [∀ j,DecidableEq (V j)] + [∀ j,Field (K j)] [∀ j,NumberField (K j)] + +/-- Both alternatives of the genuine arithmetic sequence have been eliminated. -/ +theorem arithmetic_sequence_impossible + (G : ∀ j,Core.Fibers (V j) (I j)) (θ γ c : ℝ) (η : ℕ → ℝ) + (Z₁ Z₂ : ∀ j,V j → K j) (h₁ : ∀ j,Function.Injective (Z₁ j)) (h₂ : ∀ j,Function.Injective (Z₂ j)) + (hθ : 0<θ) (hγ : 0<γ) (hγ1 : γ<1) (hc : 0 (Fintype.card (V j):ℝ)) atTop atTop) + (hη : Tendsto η atTop (𝓝 0)) (hη0 : ∀ j,0≤η j) (hηb : ∀ j,η j≤θ/2) + (hG : ∀ j,PreparedGraph (V j) (I j) (G j) θ γ c (η j)) + (t : ∀ j,I j → K j) (ht : ∀ j e y,y∈(G j).targets e → + (Z₁ j ((G j).source e)-Z₁ j y)*(Z₂ j ((G j).source e)-Z₂ j y)=t j e) : False := by + let W := fun j => overlapScale (Z₁ j) (Z₂ j) (h₁ j) (h₂ j) + let A := fun j => potentialScale (Z₁ j) (Z₂ j) (h₁ j) (h₂ j) + by_cases htop : Tendsto W atTop atTop + · exact arithmetic_no_unbounded G θ γ c η Z₁ Z₂ h₁ h₂ hθ hγ hγ1 hc hcγ hn hη hη0 hηb hG t ht htop + have hcomp := arithmetic_scale_comparison G θ γ c η Z₁ Z₂ h₁ h₂ hθ hγ hγ1 hcγ hn hη hη0 hηb hG t ht + obtain ⟨φ,C,hφ,hC,hbound⟩ := sequence_bounded_subsequence W htop + (fun j => A j≤(64+8/θ)*(W j+1)) hcomp + apply arithmetic_no_bounded (fun j => G (φ j)) θ γ c (η ∘ φ) + (fun j => Z₁ (φ j)) (fun j => Z₂ (φ j)) (fun j => h₁ (φ j)) (fun j => h₂ (φ j)) + hθ hγ hγ1 hc hcγ (hn.comp hφ) (hη.comp hφ) (fun j => hη0 (φ j)) (fun j => hηb (φ j)) + (fun j => hG (φ j)) (fun j => t (φ j)) (fun j => ht (φ j)) + (C+(64+8/θ)*(C+1)) (by positivity) + intro j + change W (φ j)+A (φ j)≤_ + have hA := (hbound j).2.trans (mul_le_mul_of_nonneg_left + (show W (φ j)+1≤C+1 by linarith [(hbound j).1]) (by positivity : 0≤64+8/θ)) + linarith [(hbound j).1] + +end WeakPinned + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PinnedDistances/ArithmeticGraphs.lean b/lean/OAI/Geometry/PinnedDistances/ArithmeticGraphs.lean new file mode 100644 index 0000000000000000000000000000000000000000..b3cdae4e8cdfe28f9c92d6a4c22597571766999b --- /dev/null +++ b/lean/OAI/Geometry/PinnedDistances/ArithmeticGraphs.lean @@ -0,0 +1,487 @@ +import OAI.Geometry.PinnedDistances.IncomingFibers + +namespace OAI + +universe u1 u2 u3 u4 u5 u6 u7 u8 u9 u10 u11 u12 +universe u13 u14 u15 + +section +noncomputable section +open NumberField +open scoped BigOperators +noncomputable section +open MeasureTheory +open scoped Topology +noncomputable section +open MeasureTheory +open scoped Topology ENNReal +noncomputable section +open MeasureTheory NumberField +open scoped BigOperators +noncomputable section +open scoped BigOperators +open MeasureTheory +noncomputable section +open Filter +open scoped Topology +noncomputable section +open scoped BigOperators + +namespace WeakPinned +open scoped BigOperators +open Variance +variable {V : Type u1} {I : Type u2} [Fintype V] [Fintype I] [DecidableEq V] +variable {G : Core.Fibers V I} {θ γ c η : ℝ} + +lemma PreparedGraph.edgeCount_pos (h : PreparedGraph V I G θ γ c η) (hη : η<θ) : 0 prob (G.targets e)) G.source C := by + unfold qCell SmallFiber.edgeCell SmallFiber.edgeLaw + simp_rw [G.sampling_fiber] + +omit [Fintype V] in +omit [Fintype I] in +lemma fiber_mass (e : I) (C : Finset V) : mass (prob (G.targets e)) C=(G.size C e : ℝ)/(G.targets e).card := by + rw [mass,sum_prob_cell] + rfl + +lemma qCell_split (hne : ∀ e, (G.targets e).Nonempty) (lam : ℝ) (C : Finset V) : + G.qCell C = slice G.fiberWeight (fun e => prob (G.targets e)) G.source lam C + G.heavyCount lam C/G.edgeCount := by + classical + rw [G.qCell_eq,edgeCell_formula] + unfold slice heavyCount + simp only [Finset.sum_div,← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro e _ + have hk : (0:ℝ)<(G.targets e).card := by exact_mod_cast Finset.card_pos.mpr (hne e) + have hm := G.fiber_mass e C + have hprod : G.fiberWeight e*mass (prob (G.targets e)) C=(G.size C e : ℝ)/G.edgeCount := by + rw [hm,fiberWeight] + field_simp + have hcmp : lam*((G.targets e).card : ℝ) ≤ (G.size C e : ℝ) ↔ lam ≤ mass (prob (G.targets e)) C := by + rw [hm,le_div_iff₀ hk] + simp only [hcmp] + by_cases hx : G.source e ∈ C <;> by_cases hp : mass (prob (G.targets e)) C Finset.sum_le_sum (fun y _ => hdom x y)) + +end WeakPinned.Core.Fibers + +namespace WeakPinned.Variance +open scoped BigOperators +variable {V : Type u5} [Fintype V] [DecidableEq V] + +lemma weighted_pair (m : Finset V → ℝ) (q : V → V → ℝ) : + weightedIntegral m (fun C => ∑ x ∈ C, ∑ y ∈ C, q x y)= + ∑ x, ∑ y, q x y*weightedOverlap m x y := by + have hc (C : Finset V) : (∑ x ∈ C, ∑ y ∈ C, q x y)= + ∑ x, ∑ y, q x y*(if x∈C ∧ y∈C then (1:ℝ) else 0) := by + simp only [mul_ite,mul_one,mul_zero,ite_and,Finset.sum_ite_irrel,Finset.sum_const_zero] + simp + simp only [weightedIntegral,hc,Finset.mul_sum] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro x _ + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro y _ + simp only [weightedOverlap,weightedIntegral,Finset.mul_sum] + apply Finset.sum_congr rfl + intro C _ + ring + +lemma weighted_additive (m : Finset V → ℝ) (b : ℝ) (S : V → ℝ) + (hL : ∀ x y, x≠y → weightedOverlap m x y=b+S x+S y) + (q : V → V → ℝ) (hdiag : ∀ x, q x x=0) (h1 : (∑ x, ∑ y, q x y)=1) : + weightedIntegral m (fun C => ∑ x ∈ C, ∑ y ∈ C, q x y)= + b+∑ x, ((∑ y, q x y)+(∑ y, q y x))*S x := by + rw [weighted_pair] + have hp (x y : V) : q x y*weightedOverlap m x y=q x y*(b+S x+S y) := by + by_cases hxy : x=y + · subst y; simp [hdiag] + · rw [hL x y hxy] + simp_rw [hp,mul_add,Finset.sum_add_distrib] + have hb : (∑ x, ∑ y, q x y*b)=b := by + simp only [← Finset.sum_mul,h1,one_mul] + rw [hb] + simp only [← Finset.sum_mul,add_mul,Finset.sum_add_distrib] + rw [Finset.sum_comm (f:=fun x y => q x y*S y)] + simp only [← Finset.sum_mul] + ring + +lemma uniform_additive (m : Finset V → ℝ) (b : ℝ) (S : V → ℝ) + (hL : ∀ x y, x≠y → weightedOverlap m x y=b+S x+S y) (hn : 2≤Fintype.card V) : + weightedIntegral m (pairCell Finset.univ)=b+2*(∑ x, prob Finset.univ x*S x) := by + have hsum : (∑ x : V, ∑ y : V, pairProb Finset.univ x y)=1 := by + simp_rw [sum_pairProb Finset.univ (by simpa using hn)] + exact sum_prob Finset.univ (Finset.card_pos.mp (by simpa using (show 0 ∑ x ∈ C, ∑ y ∈ C, pairProb Finset.univ x y) = _ + rw [hh] + simp_rw [pairProb_symm Finset.univ _ _,sum_pairProb Finset.univ (by simpa using hn)] + simp only [Finset.mul_sum] + congr 1 + apply Finset.sum_congr rfl + intro x _ + ring + +end WeakPinned.Variance + +namespace WeakPinned +open scoped BigOperators +open Variance SmallFiber +variable {V : Type u6} {I : Type u7} [Fintype V] [Fintype I] [DecidableEq V] +variable {G : Core.Fibers V I} {θ γ c η : ℝ} + +lemma PreparedGraph.overlap_lower (h : PreparedGraph V I G θ γ c η) (hη : η<θ) (hη0 : 0≤η) + (m : Finset V → ℝ) (b : ℝ) (S : V → ℝ) (hS : ∀ x, 0≤S x) + (hL : ∀ x y, x≠y → weightedOverlap m x y=b+S x+S y) : + weightedIntegral m (pairCell Finset.univ) - + (2-2*((θ-η)/(θ+η/8)))*(∑ x, prob Finset.univ x*S x) ≤ weightedIntegral m G.qCell := by + change _ ≤ weightedIntegral m (fun C => ∑ x ∈ C, ∑ y ∈ C, G.edgeLaw x y) + rw [weighted_additive m b S hL G.edgeLaw G.edgeLaw_diag (G.sum_edgeLaw (h.edgeCount_pos hη)), + uniform_additive m b S hL h.card_ge] + have hh := Finset.sum_le_sum (s:=Finset.univ) (fun x _ => + mul_le_mul_of_nonneg_right (h.degree_law hη hη0 x) (hS x)) + have he : (∑ x : V, 2*((θ-η)/(θ+η/8))*prob Finset.univ x*S x)= + (2*((θ-η)/(θ+η/8)))*(∑ x : V, prob Finset.univ x*S x) := by + simp only [Finset.mul_sum,mul_assoc] + rw [he] at hh + linarith + +/-- A fully quantitative version of small-overlap before either scale branch. +The slice is the actual original fiber mass, not an assumed error term. -/ +lemma PreparedGraph.small_overlap (h : PreparedGraph V I G θ γ c η) (hη : η<θ) (hη0 : 0≤η) + (m : Finset V → ℝ) (hm : ∀ C, 0 ≤ m C) (b : ℝ) (S : V → ℝ) (hS : ∀ x, 0≤S x) + (hL : ∀ x y, x≠y → weightedOverlap m x y=b+S x+S y) : + (θ/(θ-η))*weightedIntegral m (fun C => if (C.card : ℝ)≤(Fintype.card V : ℝ)^(1-c) + then pairCell Finset.univ C else 0) ≤ + weightedIntegral m (slice G.fiberWeight (fun e => prob (G.targets e)) G.source (1/Real.log (Fintype.card V : ℝ))) + + ((θ+η)/(θ-η)-1)*weightedIntegral m (pairCell Finset.univ) + + (2-2*((θ-η)/(θ+η/8)))*(∑ x, prob Finset.univ x*S x) := by + have hlo := h.overlap_lower hη hη0 m b S hS hL + have hne : ∀ e, (G.targets e).Nonempty := by + intro e + have hn : (0:ℝ) prob (G.targets e)) G.source (1/Real.log (Fintype.card V : ℝ)) C + + ((θ+η)/(θ-η))*pairCell Finset.univ C - + (θ/(θ-η))*(if (C.card : ℝ)≤(Fintype.card V : ℝ)^(1-c) then pairCell Finset.univ C else 0) := by + rw [G.qCell_split hne (1/Real.log (Fintype.card V : ℝ)) C] + by_cases hC : (C.card : ℝ)≤(Fintype.card V : ℝ)^(1-c) + · rw [ite_eq_left hC] + have hh := h.small_heavy_bound hη hη0 C hC + have he : (θ+η)/(θ-η)-θ/(θ-η)=η/(θ-η) := by ring + calc + _ ≤ slice G.fiberWeight (fun e => prob (G.targets e)) G.source (1/Real.log (Fintype.card V : ℝ)) C + (η/(θ-η))*pairCell Finset.univ C := add_le_add_right hh _ + _ = _ := by rw [← he]; ring + · simp only [ite_eq_right hC,mul_zero,sub_zero] + exact add_le_add_right (h.heavy_bound hη hη0 C) _ + have hint := Finset.sum_le_sum (s:=Finset.univ) (fun C _ => mul_le_mul_of_nonneg_left (hpoint C) (hm C)) + change weightedIntegral m G.qCell ≤ _ at hint + simp only [mul_sub,mul_add,Finset.sum_sub_distrib,Finset.sum_add_distrib] at hint + have hcomm (a : ℝ) (f : Finset V → ℝ) : (∑ C, m C*(a*f C))=a*weightedIntegral m f := by + simp only [weightedIntegral,Finset.mul_sum] + exact Finset.sum_congr rfl (fun C _ => by ring) + simp only [hcomm] at hint + change weightedIntegral m G.qCell ≤ weightedIntegral m _+_ - _ at hint + nlinarith + +end WeakPinned + +namespace WeakPinned +open scoped BigOperators +open Variance SmallFiber Global +variable {V : Type u8} {I : Type u9} [Fintype V] [Fintype I] [DecidableEq V] +variable {G : Core.Fibers V I} {θ γ c η : ℝ} +variable {K : Type u10} [Field K] [NumberField K] +variable (Z₁ Z₂ : V → K) (h₁ : Function.Injective Z₁) (h₂ : Function.Injective Z₂) + +def overlapScale : ℝ := weightedIntegral (totalMass Z₁ Z₂ h₁ h₂) (pairCell Finset.univ) +def potentialScale : ℝ := ∑ x, prob Finset.univ x * totalPotential Z₁ Z₂ h₁ h₂ x + +def smallOverlapScale (c : ℝ) : ℝ := weightedIntegral (totalMass Z₁ Z₂ h₁ h₂) + (fun C => if (C.card : ℝ) ≤ (Fintype.card V : ℝ)^(1-c) then pairCell Finset.univ C else 0) + +lemma overlapScale_nonneg : 0 ≤ overlapScale Z₁ Z₂ h₁ h₂ := by + exact Finset.sum_nonneg (fun C _ => mul_nonneg (totalMass_nonneg Z₁ Z₂ h₁ h₂ C) (pairCell_nonneg _ _)) + +lemma potentialScale_nonneg : 0 ≤ potentialScale Z₁ Z₂ h₁ h₂ := by + apply Finset.sum_nonneg + intro x _ + apply mul_nonneg _ (totalPotential_nonneg Z₁ Z₂ h₁ h₂ x) + simp only [prob,Finset.mem_univ,ite_true] + positivity + +lemma smallOverlapScale_nonneg (c : ℝ) : 0 ≤ smallOverlapScale Z₁ Z₂ h₁ h₂ c := by + apply Finset.sum_nonneg + intro C _ + apply mul_nonneg (totalMass_nonneg Z₁ Z₂ h₁ h₂ C) + dsimp only + split_ifs + · exact pairCell_nonneg _ _ + · exact le_refl _ + +lemma PreparedGraph.arithmetic_slice (h : PreparedGraph V I G θ γ c η) (hη : η < θ) + (t : I → K) (ht : ∀ e y, y ∈ G.targets e → (Z₁ (G.source e)-Z₁ y)*(Z₂ (G.source e)-Z₂ y)=t e) + (τ lam H : ℝ) (hlam : 0 ≤ lam) (hlam2 : lam ≤ 1/2) + (hτ : 0 < τ) (hτ1 : τ ≤ 1) (hτn : 2 ≤ τ*(Fintype.card V:ℝ)) (hH : 0 ≤ H) : + weightedIntegral (totalMass Z₁ Z₂ h₁ h₂) (slice G.fiberWeight (fun e => prob (G.targets e)) G.source lam) ≤ + (2*lam/τ^2+2*lam/(θ-η))*overlapScale Z₁ Z₂ h₁ h₂ + + (2*τ/(θ-η))*potentialScale Z₁ Z₂ h₁ h₂ + 4*lam*H + 32*Real.exp (-H/2) := by + have hne : ∀ e, (G.targets e).Nonempty := by + intro e + have hn : (0:ℝ) positivity + have hx : ∀ e, prob (G.targets e) (G.source e)=0 := by intro e; simp [prob,G.no_loop] + have ht' : ∀ e y, prob (G.targets e) y ≠ 0 → (Z₁ (G.source e)-Z₁ y)*(Z₂ (G.source e)-Z₂ y)=t e := by + intro e y hy + apply ht e y + by_contra hn + exact hy (by simp [prob,hn]) + have hdom : ∀ a b, a ≠ b → SmallFiber.edgeLaw G.fiberWeight (fun e => prob (G.targets e)) G.source a b ≤ + (1/(θ-η))/((Fintype.card V:ℝ)*((Fintype.card V:ℝ)-1)) := by + intro a b hab + have hh := h.edge_domination hη a b + simpa [SmallFiber.edgeLaw,G.sampling_fiber,pairProb,hab, div_eq_mul_inv,mul_assoc,mul_comm,mul_left_comm] using hh + have hh := arithmetic_small_fiber Z₁ Z₂ h₁ h₂ h.card_ge G.fiberWeight (fun e => prob (G.targets e)) G.source t + G.fiberWeight_nonneg (G.sum_fiberWeight (h.edgeCount_pos hη)) hp (fun e => sum_prob _ (hne e)) hx ht' + (1/(θ-η)) τ lam H (by positivity) hlam hlam2 hτ hτ1 hτn hH hdom + have he : (∑ x : V, totalPotential Z₁ Z₂ h₁ h₂ x)/(Fintype.card V:ℝ) = potentialScale Z₁ Z₂ h₁ h₂ := by + simp only [potentialScale,prob,Finset.mem_univ,ite_true,Finset.card_univ,Finset.sum_div] + exact Finset.sum_congr rfl (fun x _ => by ring) + have ha : 2*(1/(θ-η))*τ/(Fintype.card V:ℝ)*(∑ x, totalPotential Z₁ Z₂ h₁ h₂ x) = + (2*τ/(θ-η))*potentialScale Z₁ Z₂ h₁ h₂ := by rw [← he]; ring + rw [ha] at hh + convert hh using 1; unfold overlapScale; ring + +/-- The genuine scale estimate, valid for every prepared arithmetic model. +All error terms are explicit and can be sent to zero uniformly in the field. -/ +lemma PreparedGraph.arithmetic_small_overlap (h : PreparedGraph V I G θ γ c η) (hη : η < θ) (hη0 : 0 ≤ η) + (t : I → K) (ht : ∀ e y, y ∈ G.targets e → (Z₁ (G.source e)-Z₁ y)*(Z₂ (G.source e)-Z₂ y)=t e) + (τ H : ℝ) (hlam : 0 ≤ 1/Real.log (Fintype.card V:ℝ)) (hlam2 : 1/Real.log (Fintype.card V:ℝ) ≤ 1/2) + (hτ : 0 < τ) (hτ1 : τ ≤ 1) (hτn : 2 ≤ τ*(Fintype.card V:ℝ)) (hH : 0 ≤ H) : + smallOverlapScale Z₁ Z₂ h₁ h₂ c ≤ + (2*(1/Real.log (Fintype.card V:ℝ))/τ^2+2*(1/Real.log (Fintype.card V:ℝ))/(θ-η)+((θ+η)/(θ-η)-1))*overlapScale Z₁ Z₂ h₁ h₂ + + (2*τ/(θ-η)+(2-2*((θ-η)/(θ+η/8))))*potentialScale Z₁ Z₂ h₁ h₂ + + 4*(1/Real.log (Fintype.card V:ℝ))*H + 32*Real.exp (-H/2) := by + have hs := h.small_overlap hη hη0 (totalMass Z₁ Z₂ h₁ h₂) (totalMass_nonneg Z₁ Z₂ h₁ h₂) + (baseConstant Z₁ Z₂ h₁ h₂) (totalPotential Z₁ Z₂ h₁ h₂) (totalPotential_nonneg Z₁ Z₂ h₁ h₂) + (totalMass_overlap Z₁ Z₂ h₁ h₂ h.card_ge) + have htS := h.arithmetic_slice Z₁ Z₂ h₁ h₂ hη t ht τ (1/Real.log (Fintype.card V:ℝ)) H hlam hlam2 hτ hτ1 hτn hH + have hf : 1 ≤ θ/(θ-η) := (one_le_div (sub_pos.mpr hη)).mpr (by linarith) + have he := mul_le_mul_of_nonneg_right hf (smallOverlapScale_nonneg Z₁ Z₂ h₁ h₂ c) + change (θ/(θ-η))*smallOverlapScale Z₁ Z₂ h₁ h₂ c ≤ _ at hs + change _ ≤ _ + ((θ+η)/(θ-η)-1)*overlapScale Z₁ Z₂ h₁ h₂ + + (2-2*((θ-η)/(θ+η/8)))*potentialScale Z₁ Z₂ h₁ h₂ at hs + nlinarith +end WeakPinned + +namespace WeakPinned.Variance +open scoped BigOperators +variable {P : Type u11} {I : Type u12} [Fintype P] [DecidableEq P] [Fintype I] +lemma varianceCell_nonneg (w : I → ℝ) (B : I → Finset P) (T : ℝ) + (hw : ∀ i, 0≤w i) (C : Finset P) : 0≤varianceCell w B T C := by + unfold varianceCell + split_ifs + · exact Finset.sum_nonneg (fun i _ => mul_nonneg (hw i) (sq_nonneg _)) + · apply mul_nonneg (by norm_num) + apply Finset.sum_nonneg + intro i _ + apply mul_nonneg (hw i) + split_ifs <;> positivity + +lemma reciprocal_card_sub_one {n k : ℝ} (hn : 2≤n) (hnk : n≤k) : + 1/(k-1) ≤ 2/n := by + apply (div_le_div_iff₀ (by linarith : 0 (Fintype.card (V j):ℝ)) atTop atTop) + (hw : ∀ j i, 0≤w j i) (hW : ∀ j, (∑ i, w j i)≤1) + (hsize : ∀ᶠ j in atTop, ∀ i, (Fintype.card (V j):ℝ)^γ ≤ ((B j i).card:ℝ)) + (hdom : ∀ᶠ j in atTop, ∀ x, (∑ i, w j i*prob (B j i) x)≤ M₀*prob Finset.univ x) + (hsmall : Tendsto (fun j => smallOverlapScale (Z₁ j) (Z₂ j) (h₁ j) (h₂ j) c / + (overlapScale (Z₁ j) (Z₂ j) (h₁ j) (h₂ j)+potentialScale (Z₁ j) (Z₂ j) (h₁ j) (h₂ j)+1)) atTop (𝓝 0)) : + Tendsto (fun j => weightedIntegral (totalMass (Z₁ j) (Z₂ j) (h₁ j) (h₂ j)) + (varianceCell (w j) (B j) ((Fintype.card (V j):ℝ)^(1-c))) / + (overlapScale (Z₁ j) (Z₂ j) (h₁ j) (h₂ j)+potentialScale (Z₁ j) (Z₂ j) (h₁ j) (h₂ j)+1)) atTop (𝓝 0) := by + let n := fun j => (Fintype.card (V j):ℝ) + let U := fun j => overlapScale (Z₁ j) (Z₂ j) (h₁ j) (h₂ j) + let A := fun j => potentialScale (Z₁ j) (Z₂ j) (h₁ j) (h₂ j) + let D := fun j => smallOverlapScale (Z₁ j) (Z₂ j) (h₁ j) (h₂ j) c + have hU (j) : 0≤U j := overlapScale_nonneg _ _ _ _ + have hA (j) : 0≤A j := potentialScale_nonneg _ _ _ _ + have hden (j) : 0 n j^γ) atTop atTop := (tendsto_rpow_atTop hγ).comp hn + have hcT : Tendsto (fun j => n j^(c-γ)) atTop (𝓝 0) := + by + have h := (tendsto_rpow_neg_atTop (by linarith : 0<γ-c)).comp hn + convert h using 1; funext j; congr 1; ring + have hlim : Tendsto (fun j => 4*(M₀+1)*n j^(c-γ)+4*M₀*(D j/(U j+A j+1))) atTop (𝓝 0) := by + convert (hcT.const_mul (4*(M₀+1))).add (hsmall.const_mul (4*M₀)) using 1; simp + apply squeeze_zero' _ _ hlim + · exact Filter.Eventually.of_forall fun j => div_nonneg + (Finset.sum_nonneg fun C _ => mul_nonneg (totalMass_nonneg _ _ _ _ C) + (varianceCell_nonneg _ _ _ (hw j) C)) (hden j).le + · filter_upwards [hn.eventually (eventually_ge_atTop (2:ℝ)), + hNγ.eventually (eventually_ge_atTop (2:ℝ)), hsize,hdom] with j hjn hjγ hjs hjd + have hnpos : 0 by exact_mod_cast (hjγ.trans (hjs i)) + have hbn : n j^γ ≤ n j := by + simpa only [Real.rpow_one] using Real.rpow_le_rpow_of_exponent_le (show 1≤n j by linarith) hγ1.le + have hk : ∀ i, 1/(((B j i).card:ℝ)-1)≤2/(n j^γ) := fun i => reciprocal_card_sub_one hjγ (hjs i) + have hnerr : 1/(n j-1)≤2/(n j^γ) := reciprocal_card_sub_one hjγ hbn + have hT : 1≤n j^(1-c) := Real.one_le_rpow (by linarith) (by linarith) + have hτ : 0 hne (hZ (v.embedding.injective hh)) + +omit [DecidableEq P] [NumberField K] in +lemma measurableSet_good (v : InfinitePlace K) : MeasurableSet {ω | good Z v ω} := by + simp only [good, Set.ofPred_forall] + apply MeasurableSet.iInter + intro x + apply MeasurableSet.iInter + intro y + apply MeasurableSet.iInter + intro z + apply MeasurableSet.iInter + intro hxy + apply MeasurableSet.iInter + intro hyz + apply MeasurableSet.iInter + intro hxz + exact measurableSet_le + ((Grid.measurable_depth (embedding_ne Z hZ v hxy)).min + (Grid.measurable_depth (embedding_ne Z hZ v hyz))) + (Grid.measurable_depth (embedding_ne Z hZ v hxz)) + +omit [DecidableEq P] [NumberField K] in +lemma good_ae (v : InfinitePlace K) : ∀ᵐ ω ∂Grid.fullLaw, good Z v ω := by + simp only [good, Filter.eventually_all] + intro x y z hxy hyz hxz + exact Grid.depth_ultra_ae (embedding_ne Z hZ v hxy) + (embedding_ne Z hZ v hyz) (embedding_ne Z hZ v hxz) + +instance good_decidable (v : InfinitePlace K) (ω : Grid.FullSample) : Decidable (good Z v ω) := + Classical.propDecidable _ + +def arch (v : InfinitePlace K) (ω : Grid.FullSample) : Depth P where + value x y := if good Z v ω ∧ x ≠ y then Grid.depth ω (v.embedding (Z x)) (v.embedding (Z y)) else 0 + symm x y := by + by_cases h : good Z v ω + · by_cases hxy : x = y + · subst y; rfl + · simp [h, hxy, Ne.symm hxy, Grid.depth_symm] + · simp [h] + ultra x y z hxy hyz hxz := by + by_cases h : good Z v ω + · simpa [h,hxy,hyz,hxz] using h x y z hxy hyz hxz + · simp [h] + +omit [NumberField K] in +lemma arch_value_ae (v : InfinitePlace K) {x y : P} (hxy : x ≠ y) : + (fun ω => (arch Z v ω).value x y) =ᵐ[Grid.fullLaw] + (fun ω => Grid.depth ω (v.embedding (Z x)) (v.embedding (Z y))) := by + filter_upwards [good_ae Z hZ v] with ω h + simp [arch,h,hxy] + +omit [NumberField K] in +lemma arch_measurable (v : InfinitePlace K) (x y : P) : + Measurable (fun ω => (arch Z v ω).value x y) := by + by_cases hxy : x = y + · subst y + simpa only [arch,ne_eq,not_true_eq_false,and_false,reduceIte] using + (measurable_const : Measurable (fun _ : Grid.FullSample => (0:ℝ))) + · simpa [arch,hxy] using (Grid.measurable_depth (embedding_ne Z hZ v hxy)).ite + (measurableSet_good Z hZ v) (measurable_const : Measurable (fun _ : Grid.FullSample => (0:ℝ))) + +omit [NumberField K] in +lemma arch_integrable (v : InfinitePlace K) (x y : P) : + Integrable (fun ω => (arch Z v ω).value x y) Grid.fullLaw := by + by_cases hxy : x = y + · subst y + simpa only [arch,ne_eq,not_true_eq_false,and_false,reduceIte] using + (integrable_const (0:ℝ) : Integrable (fun _ : Grid.FullSample => (0:ℝ)) Grid.fullLaw) + · have hi := (Grid.error_integrable_full (embedding_ne Z hZ v hxy)).sub + (integrable_const (Real.log ‖v.embedding (Z x) - v.embedding (Z y)‖)) + have he : (fun ω => Grid.error ω (v.embedding (Z x)) (v.embedding (Z y)) - + Real.log ‖v.embedding (Z x) - v.embedding (Z y)‖) = + (fun ω => Grid.depth ω (v.embedding (Z x)) (v.embedding (Z y))) := by + funext ω; simp only [Grid.error,add_sub_cancel_right] + change Integrable (fun ω => Grid.error ω (v.embedding (Z x)) (v.embedding (Z y)) - + Real.log ‖v.embedding (Z x) - v.embedding (Z y)‖) Grid.fullLaw at hi + rw [he] at hi + exact hi.congr (arch_value_ae Z hZ v hxy).symm + +lemma arch_mean (v : InfinitePlace K) (x y : P) (hxy : x ≠ y) : + (∫ ω, (arch Z v ω).value x y ∂Grid.fullLaw) = -Real.log (v (Z x-Z y)) + Grid.kappa := by + rw [integral_congr_ae (arch_value_ae Z hZ v hxy)] + have hh := Grid.mean_error_full (embedding_ne Z hZ v hxy) + have hi := (arch_integrable Z hZ v x y).congr (arch_value_ae Z hZ v hxy) + simp only [Grid.error] at hh + rw [integral_add hi (integrable_const _)] at hh + simp only [integral_const,probReal_univ,one_smul] at hh + rw [← map_sub, InfinitePlace.norm_embedding_eq] at hh + linarith + +def finite (v : FinitePlace K) : Depth P where + value x y := if x = y then 0 else -Real.log (v (Z x-Z y)) + symm x y := by + by_cases hxy : x = y + · subst y; rfl + · simp only [hxy,Ne.symm hxy,reduceIte] + rw [← neg_sub (Z x) (Z y), map_neg_eq_map] + ultra x y z hxy hyz hxz := by + simp only [hxy,hyz,hxz,reduceIte] + exact Arithmetic.finite_raw_ultra v (hZ.ne hxy) (hZ.ne hyz) (hZ.ne hxz) + +abbrev DiffPair := {p : P × P // p.1 ≠ p.2} + +def badPlaces : Finset (FinitePlace K) := + (Arithmetic.finite_nonunit_places (fun p : DiffPair (P := P) => Z p.1.1 - Z p.1.2) + (fun p => sub_ne_zero.mpr (hZ.ne p.2))).toFinset + +omit [DecidableEq P] in +lemma badPlaces_mem (v : FinitePlace K) : v ∈ badPlaces Z hZ ↔ ∃ x y, x ≠ y ∧ v (Z x-Z y) ≠ 1 := by + simp only [badPlaces, Set.Finite.mem_toFinset] + constructor + · rintro ⟨⟨⟨x,y⟩,hne⟩,hh⟩ + exact ⟨x,y,hne,hh⟩ + · rintro ⟨x,y,hne,hh⟩ + exact ⟨⟨(x,y),hne⟩,hh⟩ + +lemma finite_value_sum (x y : P) (hxy : x ≠ y) : + (∑ v ∈ badPlaces Z hZ, (finite Z hZ v).value x y) = + ∑ᶠ v : FinitePlace K, -Real.log (v (Z x-Z y)) := by + simp only [finite,hxy,reduceIte] + symm + apply finsum_eq_sum_of_support_subset + intro v hv + apply (badPlaces_mem Z hZ v).mpr + refine ⟨x,y,hxy,?_⟩ + intro hh + exact hv (by simp [hh]) + +def S (x : P) : ℝ := + (∑ v : InfinitePlace K, Arithmetic.archWeight v * ∫ ω, (arch Z v ω).potential x ∂Grid.fullLaw) + + (Module.finrank ℚ K : ℝ)⁻¹ * ∑ v ∈ badPlaces Z hZ, (finite Z hZ v).potential x + +def L (x y : P) (hxy : x ≠ y) : ℝ := + (∑ v : InfinitePlace K, Arithmetic.archWeight v * ∫ ω, (arch Z v ω).overlapLength x y hxy ∂Grid.fullLaw) + + (Module.finrank ℚ K : ℝ)⁻¹ * ∑ v ∈ badPlaces Z hZ, (finite Z hZ v).overlapLength x y hxy + +def M : ℝ := + (∑ v : InfinitePlace K, Arithmetic.archWeight v * ∫ ω, (arch Z v ω).M ∂Grid.fullLaw) + + (Module.finrank ℚ K : ℝ)⁻¹ * ∑ v ∈ badPlaces Z hZ, (finite Z hZ v).M + +lemma coordinate_overlap_identity (hn : 2 ≤ Fintype.card P) (x y : P) (hxy : x ≠ y) : + L Z hZ x y hxy = Grid.kappa - M Z hZ + S Z hZ x + S Z hZ y := by + have harch : (∑ v : InfinitePlace K, Arithmetic.archWeight v * + (∫ ω, (arch Z v ω).M ∂Grid.fullLaw)) + + (∑ v : InfinitePlace K, Arithmetic.archWeight v * + (∫ ω, (arch Z v ω).overlapLength x y hxy ∂Grid.fullLaw)) - + (∑ v : InfinitePlace K, Arithmetic.archWeight v * + (∫ ω, (arch Z v ω).potential x ∂Grid.fullLaw)) - + (∑ v : InfinitePlace K, Arithmetic.archWeight v * + (∫ ω, (arch Z v ω).potential y ∂Grid.fullLaw)) = + (∑ v : InfinitePlace K, Arithmetic.archWeight v * (-Real.log (v (Z x-Z y)))) + Grid.kappa := by + rw [← Finset.sum_add_distrib, ← Finset.sum_sub_distrib, ← Finset.sum_sub_distrib] + have he : ∀ v : InfinitePlace K, + Arithmetic.archWeight v * (∫ ω, (arch Z v ω).M ∂Grid.fullLaw) + + Arithmetic.archWeight v * (∫ ω, (arch Z v ω).overlapLength x y hxy ∂Grid.fullLaw) - + Arithmetic.archWeight v * (∫ ω, (arch Z v ω).potential x ∂Grid.fullLaw) - + Arithmetic.archWeight v * (∫ ω, (arch Z v ω).potential y ∂Grid.fullLaw) = + Arithmetic.archWeight v * (-Real.log (v (Z x-Z y))) + Arithmetic.archWeight v * Grid.kappa := by + intro v + have hh := Depth.integral_depth_identity (arch Z v) (arch_measurable Z hZ v) + (arch_integrable Z hZ v) hn x y hxy + rw [arch_mean Z hZ v x y hxy] at hh + linear_combination -Arithmetic.archWeight v * hh + simp_rw [he] + rw [Finset.sum_add_distrib, ← Finset.sum_mul, Arithmetic.sum_archWeight,one_mul] + have hfin : (∑ v ∈ badPlaces Z hZ, (finite Z hZ v).M) + + (∑ v ∈ badPlaces Z hZ, (finite Z hZ v).overlapLength x y hxy) - + (∑ v ∈ badPlaces Z hZ, (finite Z hZ v).potential x) - + (∑ v ∈ badPlaces Z hZ, (finite Z hZ v).potential y) = + ∑ᶠ v : FinitePlace K, -Real.log (v (Z x-Z y)) := by + rw [← finite_value_sum Z hZ x y hxy, ← Finset.sum_add_distrib, + ← Finset.sum_sub_distrib, ← Finset.sum_sub_distrib] + apply Finset.sum_congr rfl + intro v _ + exact ((finite Z hZ v).depth_identity hn x y hxy).symm + have hprod := Arithmetic.normalized_log_product_formula (Z x-Z y) (sub_ne_zero.mpr (hZ.ne hxy)) + dsimp only [L,M,S] + linear_combination harch + (Module.finrank ℚ K : ℝ)⁻¹ * hfin + hprod + +lemma S_nonneg (x : P) : 0 ≤ S Z hZ x := by + apply add_nonneg + · exact Finset.sum_nonneg (fun v _ => mul_nonneg (Arithmetic.archWeight_nonneg v) + (integral_nonneg (fun ω => (arch Z v ω).potential_nonneg x))) + · exact mul_nonneg (by positivity) (Finset.sum_nonneg (fun v _ => (finite Z hZ v).potential_nonneg x)) + +lemma L_nonneg (x y : P) (hxy : x ≠ y) : 0 ≤ L Z hZ x y hxy := by + apply add_nonneg + · exact Finset.sum_nonneg (fun v _ => mul_nonneg (Arithmetic.archWeight_nonneg v) + (integral_nonneg (fun ω => (arch Z v ω).overlapLength_nonneg x y hxy))) + · exact mul_nonneg (by positivity) (Finset.sum_nonneg (fun v _ => (finite Z hZ v).overlapLength_nonneg x y hxy)) + +end WeakPinned.Global + +namespace WeakPinned.Hierarchy.Depth +open MeasureTheory +variable {P : Type u3} [Fintype P] [DecidableEq P] +variable (d : Depth P) + +def count (r : ℝ) (C : Finset P) : ℝ := (d.transformed r).count C + +def mass (C : Finset P) : ℝ := if 2 ≤ C.card then ∫ r, d.count r C else 0 + +lemma sum_map_count (m : Multiset (Finset P)) (f : Finset P → ℝ) : + (m.map f).sum = ∑ C, (m.count C : ℝ) * f C := by + induction m using Multiset.induction_on with + | empty => simp + | @cons a m ih => + simp only [Multiset.map_cons, Multiset.sum_cons, ih, Multiset.count_cons] + simp_rw [Nat.cast_add, add_mul] + rw [Finset.sum_add_distrib] + simp [add_comm] + +lemma sumCells_count (f : Finset P → ℝ) (r : ℝ) : + d.sumCells f r = ∑ C, d.count r C * f C := sum_map_count _ _ + +lemma count_nonneg (r : ℝ) (C : Finset P) : 0 ≤ d.count r C := Nat.cast_nonneg _ + +lemma count_le_overlap (r : ℝ) (C : Finset P) (x y : P) (hx : x ∈ C) (hy : y ∈ C) : + d.count r C ≤ d.pairOverlap r x y := by + rw [pairOverlap, d.sumCells_count] + calc + d.count r C = d.count r C * (if x ∈ C ∧ y ∈ C then (1 : ℝ) else 0) := by simp [hx,hy] + _ ≤ _ := Finset.single_le_sum (f := fun D => d.count r D * (if x ∈ D ∧ y ∈ D then (1 : ℝ) else 0)) (fun D _ => mul_nonneg (d.count_nonneg r D) (by positivity)) (Finset.mem_univ C) + +lemma measurable_count (C : Finset P) : Measurable (fun r => d.count r C) := by + let F : Finset (Finset P) × Finset (Finset P) → ℝ := fun st => + (((st.1.filter (fun D => ¬Fintype.card P < 2*D.card)).val + + st.2.val.map (fun D => Dᶜ)).count C : ℝ) + have hh : Measurable (fun r => F (d.cells r, d.giants r)) := + (measurable_of_finite F).comp (d.measurable_cells.prodMk d.measurable_giants) + change Measurable (fun r => F (d.cells r, d.giants r)) + exact hh + +lemma integrable_count (hn : 2 ≤ Fintype.card P) (C : Finset P) (hC : 2 ≤ C.card) : + Integrable (fun r => d.count r C) := by + obtain ⟨x,hx,y,hy,hxy⟩ := Finset.one_lt_card.mp hC + apply (d.integrable_pairOverlap hn x y hxy).mono' (d.measurable_count C).aestronglyMeasurable + filter_upwards with r + simpa only [Real.norm_eq_abs, abs_of_nonneg (d.count_nonneg r C)] using d.count_le_overlap r C x y hx hy + +lemma mass_nonneg (C : Finset P) : 0 ≤ d.mass C := by + unfold mass + split_ifs + · exact integral_nonneg (fun r => d.count_nonneg r C) + · rfl + +lemma mass_singleton (C : Finset P) (hC : C.card ≤ 1) : d.mass C = 0 := by + simp [mass, show ¬2 ≤ C.card by omega] + +lemma mass_le_overlap (hn : 2 ≤ Fintype.card P) (C : Finset P) (x y : P) + (hxy : x ≠ y) (hx : x ∈ C) (hy : y ∈ C) : + d.mass C ≤ d.overlapLength x y hxy := by + have hC : 2 ≤ C.card := Finset.one_lt_card.mpr ⟨x,hx,y,hy,hxy⟩ + rw [mass, ite_eq_left hC, overlapLength] + exact integral_mono (d.integrable_count hn C hC) (d.integrable_pairOverlap hn x y hxy) + (fun r => d.count_le_overlap r C x y hx hy) + +lemma integral_sumCells (hn : 2 ≤ Fintype.card P) (f : Finset P → ℝ) + (hf : ∀ C, C.card ≤ 1 → f C = 0) : + (∫ r, d.sumCells f r) = ∑ C, d.mass C * f C := by + have hi (C : Finset P) : Integrable (fun r => d.count r C * f C) := by + by_cases hC : 2 ≤ C.card + · exact (d.integrable_count hn C hC).mul_const _ + · simp [hf C (by omega)] + simp_rw [d.sumCells_count] + rw [integral_finsetSum _ (fun C _ => hi C)] + apply Finset.sum_congr rfl + intro C _ + by_cases hC : 2 ≤ C.card + · simp [mass,hC,integral_mul_const] + · simp [mass,hC,hf C (by omega)] + +lemma mass_overlap (hn : 2 ≤ Fintype.card P) (x y : P) (hxy : x ≠ y) : + (∑ C, d.mass C * (if x ∈ C ∧ y ∈ C then (1 : ℝ) else 0)) = + d.overlapLength x y hxy := by + symm + apply d.integral_sumCells hn + intro C hC + have hh : ¬(x ∈ C ∧ y ∈ C) := by + rintro ⟨hx,hy⟩ + have := Finset.one_lt_card.mpr ⟨x,hx,y,hy,hxy⟩ + omega + simp [hh] + +section Param +variable {Ω : Type u4} [MeasurableSpace Ω] (D : Ω → Depth P) + (hD : ∀ x y, Measurable (fun ω => (D ω).value x y)) +include hD +lemma measurable_count_param (C : Finset P) : + Measurable (fun p : Ω × ℝ => (D p.1).count p.2 C) := by + let F : Finset (Finset P) × Finset (Finset P) → ℝ := fun st => + (((st.1.filter (fun E => ¬Fintype.card P < 2*E.card)).val + + st.2.val.map (fun E => Eᶜ)).count C : ℝ) + have hm : Measurable (fun p : Ω×ℝ => ((D p.1).cells p.2, (D p.1).giants p.2)) := + (measurable_cells_param (P:=P) (Ω:=Ω×ℝ) (fun p : Ω×ℝ => D p.1) + (fun x y => (hD x y).comp measurable_fst) Prod.snd measurable_snd).prodMk + (measurable_giants_param (P:=P) (Ω:=Ω×ℝ) (fun p : Ω×ℝ => D p.1) + (fun x y => (hD x y).comp measurable_fst) Prod.snd measurable_snd) + have hh : Measurable (fun p : Ω×ℝ => F ((D p.1).cells p.2, (D p.1).giants p.2)) := + (measurable_of_finite F).comp hm + change Measurable (fun p : Ω×ℝ => F ((D p.1).cells p.2, (D p.1).giants p.2)) + exact hh + +lemma measurable_mass_param (C : Finset P) : Measurable (fun ω => (D ω).mass C) := by + unfold mass + split_ifs with hC + · exact (measurable_count_param D hD C).stronglyMeasurable.integral_prod_right.measurable + · exact measurable_const + +lemma integrable_mass_param {μ : Measure Ω} + (hi : ∀ x y, Integrable (fun ω => (D ω).value x y) μ) + (hn : 2 ≤ Fintype.card P) (C : Finset P) : + Integrable (fun ω => (D ω).mass C) μ := by + by_cases hC : 2 ≤ C.card + · obtain ⟨x,hx,y,hy,hxy⟩ := Finset.one_lt_card.mp hC + apply (integrable_overlapLength_param D hD hi hn x y hxy).mono' + (measurable_mass_param D hD C).aestronglyMeasurable + filter_upwards with ω + simpa only [Real.norm_eq_abs, abs_of_nonneg ((D ω).mass_nonneg C)] using + (D ω).mass_le_overlap hn C x y hxy hx hy + · simp only [mass, hC, reduceIte] + exact integrable_zero _ _ _ + +lemma averaged_mass_overlap {μ : Measure Ω} + (hi : ∀ x y, Integrable (fun ω => (D ω).value x y) μ) + (hn : 2 ≤ Fintype.card P) (x y : P) (hxy : x ≠ y) : + (∑ C, (∫ ω, (D ω).mass C ∂μ) * (if x ∈ C ∧ y ∈ C then (1 : ℝ) else 0)) = + ∫ ω, (D ω).overlapLength x y hxy ∂μ := by + simp_rw [← integral_mul_const] + rw [← integral_finsetSum _ (fun C _ => (integrable_mass_param D hD hi hn C).mul_const _)] + exact integral_congr_ae (Filter.Eventually.of_forall (fun ω => (D ω).mass_overlap hn x y hxy)) +end Param +end WeakPinned.Hierarchy.Depth + +end +end +end +end +end + +end OAI diff --git a/lean/OAI/Geometry/PinnedDistances/ArithmeticSequence.lean b/lean/OAI/Geometry/PinnedDistances/ArithmeticSequence.lean new file mode 100644 index 0000000000000000000000000000000000000000..8a5036e662b7ce3f6b920d68a08db3769e6e4b2e --- /dev/null +++ b/lean/OAI/Geometry/PinnedDistances/ArithmeticSequence.lean @@ -0,0 +1,305 @@ +import OAI.Geometry.PinnedDistances.ArithmeticContradiction + +namespace OAI + +universe u1 u2 u3 u4 u5 u6 u7 u8 u9 u10 u11 + +section +noncomputable section +namespace WeakPinned +open Filter +open scoped Topology BigOperators + +/-- Diagonalized extraction of genuine configurations. The errors tend to zero +and vertex numbers tend to infinity. -/ +theorem graph_sequence_of_failure (hfail : ¬ MainStatement) : + ∃ c s γ : ℝ, 0 (C j).card) atTop atTop := + tendsto_atTop_mono (fun j => (hC j).le) tendsto_id + +lemma graph_error_tendsto (θ : ℝ) : Tendsto (fun j : ℕ => θ/((j:ℝ)+2)) atTop (𝓝 0) := by + have ht : Tendsto (fun j : ℕ => (j:ℝ)+2) atTop atTop := tendsto_atTop_add_const_right _ _ tendsto_natCast_atTop_atTop + exact tendsto_const_nhds.div_atTop ht + +end WeakPinned + +/- Algebraic representation of the finite rational polynomial pattern of a + real configuration in a number field. -/ + +noncomputable section + +namespace WeakPinned.Transfer +open MvPolynomial + +/-- A system of rational polynomial equations with a complex solution has an + algebraic solution. No finite set assumption on the equations is needed. -/ +theorem equations {ι : Type u1} [Finite ι] + (S : Set (MvPolynomial ι ℚ)) (x : ι → ℂ) + (hx : ∀ p ∈ S, aeval x p = 0) : + ∃ y : ι → AlgebraicClosure ℚ, ∀ p ∈ S, aeval y p = 0 := by + let I : Ideal (MvPolynomial ι ℚ) := vanishingIdeal ℚ {x} + have hI : I ≠ ⊤ := by + intro h + have h1 : (1 : MvPolynomial ι ℚ) ∈ I := by rw [h]; trivial + have hz := (mem_vanishingIdeal_singleton_iff x 1).mp h1 + simp at hz + obtain ⟨M, hM, hIM⟩ := Ideal.exists_le_maximal I hI + obtain ⟨y, hy⟩ := eq_vanishingIdeal_singleton_of_isMaximal (AlgebraicClosure ℚ) hM + refine ⟨y, fun p hp => ?_⟩ + apply (mem_vanishingIdeal_singleton_iff y p).mp + rw [← hy] + exact hIM ((mem_vanishingIdeal_singleton_iff x p).mpr (hx p hp)) + +/-- Simultaneous equations and finitely many inequations transfer to algebraic + coordinates. The inverse-variable equation enforces every inequation. -/ +theorem equations_and_inequations {ι : Type u2} [Finite ι] + (S : Set (MvPolynomial ι ℚ)) (T : Finset (MvPolynomial ι ℚ)) (x : ι → ℂ) + (hx : ∀ p ∈ S, aeval x p = 0) (hT : ∀ p ∈ T, aeval x p ≠ 0) : + ∃ y : ι → AlgebraicClosure ℚ, + (∀ p ∈ S, aeval y p = 0) ∧ (∀ p ∈ T, aeval y p ≠ 0) := by + let q : MvPolynomial ι ℚ := ∏ p ∈ T, p + let r : MvPolynomial (Option ι) ℚ := X none * rename some q - 1 + let S' : Set (MvPolynomial (Option ι) ℚ) := (rename some) '' S ∪ {r} + let x' : Option ι → ℂ := fun j => j.elim (aeval x q)⁻¹ x + have hq : aeval x q ≠ 0 := by + simpa [q] using Finset.prod_ne_zero_iff.mpr hT + have hl (p : MvPolynomial ι ℚ) : aeval x' (rename some p) = aeval x p := by + simp [aeval_rename, Function.comp_def, x'] + have hx' : ∀ p ∈ S', aeval x' p = 0 := by + intro p hp + rcases hp with ⟨p, hp, rfl⟩ | rfl + · rw [hl] + exact hx p hp + · simp [r, hl, x', hq] + obtain ⟨y', hy'⟩ := equations S' x' hx' + let y : ι → AlgebraicClosure ℚ := fun i => y' (some i) + have hl' (p : MvPolynomial ι ℚ) : aeval y' (rename some p) = aeval y p := by + simp [aeval_rename, Function.comp_def, y] + refine ⟨y, ?_, ?_⟩ + · intro p hp + rw [← hl'] + exact hy' _ (Or.inl ⟨p, hp, rfl⟩) + · have hr := hy' r (Or.inr rfl) + have hq' : aeval y q ≠ 0 := by + intro hz + simp [r, hl', hz] at hr + have hprod : (∏ p ∈ T, aeval y p) ≠ 0 := by simpa [q] using hq' + exact Finset.prod_ne_zero_iff.mp hprod + +/-- The algebraic realization lies in a single number field generated by its + finitely many coordinates. The field is not fixed in advance. -/ +theorem numberField_pattern {ι : Type u3} [Finite ι] + (S : Set (MvPolynomial ι ℚ)) (T : Finset (MvPolynomial ι ℚ)) (x : ι → ℂ) + (hx : ∀ p ∈ S, aeval x p = 0) (hT : ∀ p ∈ T, aeval x p ≠ 0) : + ∃ K : IntermediateField ℚ (AlgebraicClosure ℚ), NumberField K ∧ + ∃ y : ι → K, (∀ p ∈ S, aeval y p = 0) ∧ (∀ p ∈ T, aeval y p ≠ 0) := by + obtain ⟨y, hy, hTy⟩ := equations_and_inequations S T x hx hT + let K := IntermediateField.adjoin ℚ (Set.range y) + have : Finite (Set.range y) := (Set.finite_range y).to_subtype + have : Algebra.IsAlgebraic ℚ (AlgebraicClosure ℚ) := AlgebraicClosure.isAlgebraic ℚ + have : Algebra.IsIntegral ℚ (AlgebraicClosure ℚ) := Algebra.IsAlgebraic.isIntegral + have hfd : FiniteDimensional ℚ K := + IntermediateField.finiteDimensional_adjoin (fun z _ => Algebra.IsIntegral.isIntegral z) + have hnf : NumberField K := { to_charZero := inferInstance, to_finiteDimensional := hfd } + let z : ι → K := fun i => ⟨y i, IntermediateField.subset_adjoin ℚ (Set.range y) ⟨i, rfl⟩⟩ + have he (p : MvPolynomial ι ℚ) : K.val (aeval z p) = aeval y p := + comp_aeval_apply z K.val p + refine ⟨K, hnf, z, ?_, ?_⟩ + · intro p hp + apply K.val.injective + change K.val (aeval z p) = K.val 0 + rw [he, map_zero, hy p hp] + · intro p hp hz + apply hTy p hp + rw [← he, hz, map_zero] + +/-- Preservation of an arbitrary finite zero-pattern, simultaneously, in one + number field. In particular this preserves all selected equalities exactly. -/ +theorem numberField_zero_pattern {ι : Type u4} [Finite ι] + (T : Finset (MvPolynomial ι ℚ)) (x : ι → ℂ) : + ∃ K : IntermediateField ℚ (AlgebraicClosure ℚ), NumberField K ∧ + ∃ y : ι → K, ∀ p ∈ T, aeval y p = 0 ↔ aeval x p = 0 := by + classical + let S : Set (MvPolynomial ι ℚ) := {p | p ∈ T ∧ aeval x p = 0} + let U := T.filter (fun p => aeval x p ≠ 0) + obtain ⟨K, hK, y, hy, hUy⟩ := numberField_pattern S U x + (fun _ hp => hp.2) (fun p hp => (Finset.mem_filter.mp hp).2) + refine ⟨K, hK, y, fun p hp => ⟨?_, ?_⟩⟩ + · intro h + by_contra h' + exact hUy p (Finset.mem_filter.mpr ⟨hp, h'⟩) h + · intro h + exact hy p ⟨hp, h⟩ + +abbrev Plane := EuclideanSpace ℝ (Fin 2) + +/-- Complexified variables; the extra variable forces a square root of -1 + into the field, so every archimedean place is complex. -/ +abbrev Variables (ι : Type u5) := Option (Bool × ι) + +def secondCoord (b : Bool) (z : Plane) : ℂ := + if b then ⟨z 0, -z 1⟩ else ⟨z 0, z 1⟩ + +def complexAssignment {ι : Type u6} (x : ι → Plane) : Variables ι → ℂ := + fun j => j.elim Complex.I (fun bi => secondCoord bi.1 (x bi.2)) + +def distancePoly {ι : Type u7} (a b : ι) : MvPolynomial (Variables ι) ℚ := + (X (some (false, a)) - X (some (false, b))) * + (X (some (true, a)) - X (some (true, b))) + +lemma eval_distancePoly {ι : Type u8} (x : ι → Plane) (a b : ι) : + aeval (complexAssignment x) (distancePoly a b) = ((dist (x a) (x b)) ^ 2 : ℝ) := by + simp only [distancePoly, map_mul, map_sub, aeval_X, complexAssignment, + Option.elim_some, secondCoord, Bool.false_eq_true, reduceIte] + rw [EuclideanSpace.dist_sq_eq] + simp only [Fin.sum_univ_two, Real.dist_eq, sq_abs] + apply Complex.ext <;> simp [-Complex.ofReal_pow] <;> ring + +/-- Every finite real planar configuration has a faithful number-field model + for BOTH distance factors. The real configuration is not restricted or + replaced: the exact equality pattern of ALL its distances is retained. + The factorization at every place does not require conjugacy in the new field. -/ +theorem planar_factor_model {ι : Type u9} [Finite ι] + (x : ι → Plane) (hx : Function.Injective x) : + ∃ K : IntermediateField ℚ (AlgebraicClosure ℚ), NumberField K ∧ + ∃ (ii : K) (Z₁ Z₂ : ι → K), ii ^ 2 = -1 ∧ + Function.Injective Z₁ ∧ Function.Injective Z₂ ∧ + ∀ a b c d, (Z₁ a - Z₁ b) * (Z₂ a - Z₂ b) = + (Z₁ c - Z₁ d) * (Z₂ c - Z₂ d) ↔ dist (x a) (x b) = dist (x c) (x d) := by + classical + let := Fintype.ofFinite ι + let D := @distancePoly ι + let root : MvPolynomial (Variables ι) ℚ := X none ^ 2 + 1 + let pairs := Finset.univ.image (fun t : ι × ι => D t.1 t.2) + let quadruples := Finset.univ.image (fun t : (ι × ι) × (ι × ι) => + D t.1.1 t.1.2 - D t.2.1 t.2.2) + let T := pairs ∪ quadruples ∪ {root} + obtain ⟨K, hK, y, hy⟩ := numberField_zero_pattern T (complexAssignment x) + let Z₁ : ι → K := fun a => y (some (false, a)) + let Z₂ : ι → K := fun a => y (some (true, a)) + have he (a b : ι) : aeval y (D a b) = (Z₁ a - Z₁ b) * (Z₂ a - Z₂ b) := by + simp [D, distancePoly, Z₁, Z₂] + have hp (a b : ι) : D a b ∈ T := by + apply Finset.mem_union.mpr + left + apply Finset.mem_union.mpr + left + exact Finset.mem_image.mpr ⟨(a,b), Finset.mem_univ _, rfl⟩ + have h0 (a b : ι) : (Z₁ a - Z₁ b) * (Z₂ a - Z₂ b) = 0 ↔ a = b := by + rw [← he, hy _ (hp a b), eval_distancePoly] + simp [hx.eq_iff] + have hdist (a b c d : ι) : D a b - D c d ∈ T := by + apply Finset.mem_union.mpr + left + apply Finset.mem_union.mpr + right + exact Finset.mem_image.mpr ⟨((a,b),(c,d)), Finset.mem_univ _, rfl⟩ + have hroot : y none ^ 2 + 1 = 0 := by + have hm : root ∈ T := Finset.mem_union.mpr (Or.inr (Finset.mem_singleton_self _)) + have hc : aeval (complexAssignment x) root = 0 := by + simp [root, complexAssignment, Complex.I_sq] + simpa [root] using (hy root hm).mpr hc + refine ⟨K, hK, y none, Z₁, Z₂, eq_neg_of_add_eq_zero_left hroot, ?_, ?_, ?_⟩ + · intro a b hab + apply (h0 a b).mp + rw [hab, sub_self, zero_mul] + · intro a b hab + apply (h0 a b).mp + rw [hab, sub_self, mul_zero] + · intro a b c d + rw [← he, ← he] + have h := hy _ (hdist a b c d) + rw [map_sub, sub_eq_zero, map_sub, sub_eq_zero, eval_distancePoly, + eval_distancePoly, Complex.ofReal_inj] at h + exact h.trans (sq_eq_sq₀ dist_nonneg dist_nonneg) + +end WeakPinned.Transfer + +namespace WeakPinned +open scoped BigOperators + +/-- The exact arithmetic model for each extracted real graph. No point is +assumed algebraic; the original graph's complete distance-equality pattern +is preserved by the proved finite specialization theorem. -/ +theorem core_arithmetic_model (P : Finset Plane) (s : ℝ) (C : Finset P) + (hne : ∀ e, ((coreGraph P s C).targets e).Nonempty) : + ∃ K : IntermediateField ℚ (AlgebraicClosure ℚ), NumberField K ∧ + ∃ (ii : K) (Z₁ Z₂ : C → K) (t : (planarFibers P s).Active (cutoff s P.card) C → K), + ii^2 = -1 ∧ Function.Injective Z₁ ∧ Function.Injective Z₂ ∧ + (∀ e, t e ≠ 0) ∧ + (∀ e y, y ∈ (coreGraph P s C).targets e → + (Z₁ ((coreGraph P s C).source e)-Z₁ y)*(Z₂ ((coreGraph P s C).source e)-Z₂ y)=t e) ∧ + (∀ a b c d : C, (Z₁ a-Z₁ b)*(Z₂ a-Z₂ b)=(Z₁ c-Z₁ d)*(Z₂ c-Z₂ d) ↔ + dist a.val.val b.val.val=dist c.val.val d.val.val) := by + classical + let x : C → Plane := fun a => a.val.val + have hx : Function.Injective x := Subtype.val_injective.comp Subtype.val_injective + obtain ⟨K,hK,ii,Z₁,Z₂,hii,h₁,h₂,hpat⟩ := Transfer.planar_factor_model x hx + choose y hy using hne + let G := coreGraph P s C + let t := fun e => (Z₁ (G.source e)-Z₁ (y e))*(Z₂ (G.source e)-Z₂ (y e)) + refine ⟨K,hK,ii,Z₁,Z₂,t,hii,h₁,h₂,?_,?_,hpat⟩ + · intro e + have hxy : G.source e ≠ y e := by intro he; exact G.no_loop e (he ▸ hy e) + exact mul_ne_zero (sub_ne_zero.mpr (h₁.ne hxy)) (sub_ne_zero.mpr (h₂.ne hxy)) + · intro e z hz + apply (hpat _ _ _ _).mpr + have hz' := (Finset.mem_filter.mp hz).2 + have hy' := (Finset.mem_filter.mp (hy e)).2 + have hzdist := (planar_target_iff P s e.val z.val).mp hz' + have hydist := (planar_target_iff P s e.val (y e).val).mp hy' + change dist e.val.val.1 z.val.val=dist e.val.val.1 (y e).val.val + rw [dist_comm,dist_comm e.val.val.1,hzdist,hydist] + +lemma PreparedGraph.targets_nonempty {V : Type u10} {I : Type u11} [Fintype V] [Fintype I] [DecidableEq V] + {G : Core.Fibers V I} {θ γ c η : ℝ} (h : PreparedGraph V I G θ γ c η) : + ∀ e, (G.targets e).Nonempty := by + intro e + have hn : (0:ℝ) mul_nonneg (Arithmetic.archWeight_nonneg v) + (integral_nonneg (fun ω => (arch Z v ω).mass_nonneg C)))) + (mul_nonneg (by positivity) (Finset.sum_nonneg (fun v _ => (finite Z hZ v).mass_nonneg C))) + +lemma cellMass_singleton (C : Finset P) (hC : C.card ≤ 1) : cellMass Z hZ C = 0 := by + simp only [cellMass, Depth.mass_singleton _ C hC, integral_zero, mul_zero, Finset.sum_const_zero, add_zero] + +lemma cellMass_overlap (hn : 2 ≤ Fintype.card P) (x y : P) (hxy : x ≠ y) : + (∑ C, cellMass Z hZ C * (if x ∈ C ∧ y ∈ C then (1 : ℝ) else 0)) = L Z hZ x y hxy := by + simp only [cellMass, add_mul, Finset.sum_add_distrib, Finset.sum_mul, + mul_assoc, L] + rw [← Finset.mul_sum] + congr 1 + · rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro v _ + rw [← Finset.mul_sum, Depth.averaged_mass_overlap (arch Z v) (arch_measurable Z hZ v) + (arch_integrable Z hZ v) hn x y hxy] + · congr 1 + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro v _ + exact (finite Z hZ v).mass_overlap hn x y hxy + +end WeakPinned.Global + +namespace WeakPinned.Variance +variable {P : Type u3} [Fintype P] [DecidableEq P] + +/-- Finite linear model of the actual occurrence integral on expressions + vanishing on singleton and empty cells. Multiplicities are in m. -/ +def weightedIntegral (m : Finset P → ℝ) (f : Finset P → ℝ) : ℝ := ∑ C, m C * f C + +def weightedOverlap (m : Finset P → ℝ) (x y : P) : ℝ := + weightedIntegral m (fun C => if x ∈ C ∧ y ∈ C then 1 else 0) + +lemma weighted_cancel (m : Finset P → ℝ) (b : ℝ) (S : P → ℝ) + (hL : ∀ x y, x ≠ y → weightedOverlap m x y = b+S x+S y) + (B : Finset P) (hB : 2 ≤ B.card) : weightedIntegral m (signedCell B) = 0 := by + have he : weightedIntegral m (signedCell B) = + ∑ x, ∑ y, signedPair B x y * weightedOverlap m x y := by + simp only [weightedIntegral, signedCell_eq] + have hc (C : Finset P) : (∑ x ∈ C, ∑ y ∈ C, signedPair B x y) = + ∑ x, ∑ y, signedPair B x y * (if x ∈ C ∧ y ∈ C then (1:ℝ) else 0) := by + simp only [mul_ite, mul_one, mul_zero, ite_and] + simp only [Finset.sum_ite_irrel, Finset.sum_const_zero] + simp + simp_rw [hc, Finset.mul_sum] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro x _ + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro y _ + simp only [weightedOverlap, weightedIntegral, Finset.mul_sum] + apply Finset.sum_congr rfl + intro C _ + ring + rw [he] + exact variance_cancel B hB _ b S hL + +lemma weighted_variance {I : Type u4} [Fintype I] + (m : Finset P → ℝ) (hm : ∀ C, 0 ≤ m C) (b : ℝ) (S : P → ℝ) + (hL : ∀ x y, x ≠ y → weightedOverlap m x y = b+S x+S y) + (w : I → ℝ) (B : I → Finset P) (T M ε τ : ℝ) + (hw : ∀ i, 0 ≤ w i) (hW : (∑ i, w i) ≤ 1) + (hT : 1 ≤ T) (hM : 0 ≤ M) (hε : 0 ≤ ε) (hτ : 0 < τ) + (hscale : τ * Fintype.card P ≤ T) + (hB : ∀ i, 2 ≤ (B i).card) + (hk : ∀ i, 1 / (((B i).card : ℝ)-1) ≤ ε) + (hn : 1 / ((Fintype.card P : ℝ)-1) ≤ ε) + (hdom : ∀ x, (∑ i, w i * prob (B i) x) ≤ M * prob Finset.univ x) : + weightedIntegral m (varianceCell w B T) ≤ + (2*ε*(M+1)/τ)*weightedIntegral m (pairCell Finset.univ) + + 4*M*weightedIntegral m (fun C => if (C.card : ℝ) ≤ T then pairCell Finset.univ C else 0) := by + have hh := Finset.sum_le_sum (s := Finset.univ) (fun C _ => + mul_le_mul_of_nonneg_left + (varianceCell_bound w B T M ε τ hw hW hT hM hε hτ hscale hB hk hn hdom C) (hm C)) + simp only [mul_add, Finset.sum_add_distrib] at hh + have hz : (∑ C, m C * ∑ i, w i * signedCell (B i) C) = 0 := by + simp_rw [Finset.mul_sum] + rw [Finset.sum_comm] + have hi (i : I) : (∑ C, m C * (w i * signedCell (B i) C)) = 0 := by + calc + _ = w i * weightedIntegral m (signedCell (B i)) := by + simp only [weightedIntegral, Finset.mul_sum] + apply Finset.sum_congr rfl + intro C _ + ring + _ = 0 := by rw [weighted_cancel m b S hL _ (hB i),mul_zero] + simp_rw [hi] + exact Finset.sum_const_zero + rw [hz,zero_add] at hh + simp only [← mul_add] at hh + change weightedIntegral m (varianceCell w B T) ≤ _ at hh + have he₁ : (∑ C, m C * (2*ε*(M+1)/τ * pairCell Finset.univ C)) = + (2*ε*(M+1)/τ)*weightedIntegral m (pairCell Finset.univ) := by + simp only [weightedIntegral, Finset.mul_sum] + apply Finset.sum_congr rfl + intro C _ + ring + have he₂ : (∑ C, m C * (4*M*(if (C.card : ℝ) ≤ T then pairCell Finset.univ C else 0))) = + 4*M*weightedIntegral m (fun C => if (C.card : ℝ) ≤ T then pairCell Finset.univ C else 0) := by + simp only [weightedIntegral, Finset.mul_sum] + apply Finset.sum_congr rfl + intro C _ + ring + rwa [he₁,he₂] at hh +end WeakPinned.Variance + +namespace WeakPinned.Global +open Hierarchy Variance +variable {P : Type u5} [Fintype P] [DecidableEq P] +variable {K : Type u6} [Field K] [NumberField K] +variable (Z₁ Z₂ : P → K) (h₁ : Function.Injective Z₁) (h₂ : Function.Injective Z₂) + +def totalMass (C : Finset P) : ℝ := cellMass Z₁ h₁ C + cellMass Z₂ h₂ C + +def totalPotential (x : P) : ℝ := S Z₁ h₁ x + S Z₂ h₂ x + +def baseConstant : ℝ := 2*Grid.kappa - M Z₁ h₁ - M Z₂ h₂ + +lemma totalMass_nonneg (C : Finset P) : 0 ≤ totalMass Z₁ Z₂ h₁ h₂ C := + add_nonneg (cellMass_nonneg Z₁ h₁ C) (cellMass_nonneg Z₂ h₂ C) + +lemma totalPotential_nonneg (x : P) : 0 ≤ totalPotential Z₁ Z₂ h₁ h₂ x := + add_nonneg (S_nonneg Z₁ h₁ x) (S_nonneg Z₂ h₂ x) + +lemma totalMass_overlap (hn : 2 ≤ Fintype.card P) (x y : P) (hxy : x ≠ y) : + weightedOverlap (totalMass Z₁ Z₂ h₁ h₂) x y = + baseConstant Z₁ Z₂ h₁ h₂ + totalPotential Z₁ Z₂ h₁ h₂ x + totalPotential Z₁ Z₂ h₁ h₂ y := by + simp only [weightedOverlap,weightedIntegral,totalMass,add_mul,Finset.sum_add_distrib] + rw [cellMass_overlap Z₁ h₁ hn x y hxy,cellMass_overlap Z₂ h₂ hn x y hxy, + coordinate_overlap_identity Z₁ h₁ hn x y hxy,coordinate_overlap_identity Z₂ h₂ hn x y hxy] + simp only [baseConstant,totalPotential] + ring + +/-- Unconditional arithmetic-hierarchy instance of the quantitative variance + bound. The overlap identity follows from the product formula, and the + family hypotheses are exactly finite sampling data. -/ +theorem arithmetic_variance {I : Type u7} [Fintype I] + (hnP : 2 ≤ Fintype.card P) + (w : I → ℝ) (B : I → Finset P) (T M₀ ε τ : ℝ) + (hw : ∀ i, 0 ≤ w i) (hW : (∑ i, w i) ≤ 1) + (hT : 1 ≤ T) (hM : 0 ≤ M₀) (hε : 0 ≤ ε) (hτ : 0 < τ) + (hscale : τ * Fintype.card P ≤ T) + (hB : ∀ i, 2 ≤ (B i).card) + (hk : ∀ i, 1 / (((B i).card : ℝ)-1) ≤ ε) + (hn : 1 / ((Fintype.card P : ℝ)-1) ≤ ε) + (hdom : ∀ x, (∑ i, w i * prob (B i) x) ≤ M₀ * prob Finset.univ x) : + weightedIntegral (totalMass Z₁ Z₂ h₁ h₂) (varianceCell w B T) ≤ + (2*ε*(M₀+1)/τ)*weightedIntegral (totalMass Z₁ Z₂ h₁ h₂) (pairCell Finset.univ) + + 4*M₀*weightedIntegral (totalMass Z₁ Z₂ h₁ h₂) + (fun C => if (C.card : ℝ) ≤ T then pairCell Finset.univ C else 0) := + weighted_variance _ (totalMass_nonneg Z₁ Z₂ h₁ h₂) _ _ + (totalMass_overlap Z₁ Z₂ h₁ h₂ hnP) w B T M₀ ε τ hw hW hT hM hε hτ hscale hB hk hn hdom +end WeakPinned.Global + +end +end +end +end +end +end + +end OAI diff --git a/lean/OAI/Geometry/PinnedDistances/BoundedContradiction.lean b/lean/OAI/Geometry/PinnedDistances/BoundedContradiction.lean new file mode 100644 index 0000000000000000000000000000000000000000..bacf7f0cab7501b6a7c261022cda87d230dbf92f --- /dev/null +++ b/lean/OAI/Geometry/PinnedDistances/BoundedContradiction.lean @@ -0,0 +1,117 @@ +import OAI.Geometry.PinnedDistances.BoundedRates + +namespace OAI + +universe u1 u2 u3 + +section +noncomputable section +open Filter MeasureTheory +open scoped Topology BigOperators +namespace WeakPinned +open Bounded Global Variance Hierarchy NumberField + +variable {V : ℕ → Type u1} {I : ℕ → Type u2} {K : ℕ → Type u3} [∀ j,Fintype (V j)] [∀ j,Fintype (I j)] [∀ j,DecidableEq (V j)] + [∀ j,Field (K j)] [∀ j,NumberField (K j)] +variable (G : ∀ j,Core.Fibers (V j) (I j)) (θ γ c : ℝ) (η : ℕ → ℝ) + (Z₁ Z₂ : ∀ j,V j → K j) (h₁ : ∀ j,Function.Injective (Z₁ j)) (h₂ : ∀ j,Function.Injective (Z₂ j)) + +/-- The bounded arithmetic regime is impossible as well. The embedding and +normalization are chosen from the actual global mass and finite graph laws. -/ +theorem arithmetic_no_bounded (hθ : 0<θ) (hγ : 0<γ) (hγ1 : γ<1) (hc : 0 (Fintype.card (V j):ℝ)) atTop atTop) + (hη : Tendsto η atTop (𝓝 0)) (hη0 : ∀ j,0≤η j) (hηb : ∀ j,η j≤θ/2) + (hG : ∀ j,PreparedGraph (V j) (I j) (G j) θ γ c (η j)) + (t : ∀ j,I j → K j) (ht : ∀ j e y,y∈(G j).targets e → + (Z₁ j ((G j).source e)-Z₁ j y)*(Z₂ j ((G j).source e)-Z₂ j y)=t j e) + (C : ℝ) (hC : 0≤C) (hscale : ∀ j,overlapScale (Z₁ j) (Z₂ j) (h₁ j) (h₂ j)+ + potentialScale (Z₁ j) (Z₂ j) (h₁ j) (h₂ j)≤C) : False := by + let n := fun j => (Fintype.card (V j):ℝ) + let T := fun j => n j^(1-c) + let S := fun j => n j^γ + let q := fun j => varianceCell (G j).fiberWeight (G j).targets (T j) + let r := fun j => varianceCell ((G j).retainedWeight (S j)) ((G j).retainedSet (S j)) (T j) + have hq (j D) : 0≤q j D := varianceCell_nonneg _ _ _ (G j).fiberWeight_nonneg D + have hr (j D) : 0≤r j D := varianceCell_nonneg _ _ _ ((G j).retainedWeight_nonneg _) D + have h2 (j) : 2≤Fintype.card (V j) := (hG j).card_ge + have hn2 (j) : (2:ℝ)≤n j := by dsimp only [n]; exact_mod_cast h2 j + have hn0 (j) : 0 overlapScale (Z₁ j) (Z₂ j) (h₁ j) (h₂ j)+potentialScale (Z₁ j) (Z₂ j) (h₁ j) (h₂ j) + have hW (j) : 0≤W j := add_nonneg (overlapScale_nonneg _ _ _ _) (potentialScale_nonneg _ _ _ _) + have hf0 (j) : 0≤fiberVariance G c Z₁ Z₂ h₁ h₂ j := + Finset.sum_nonneg (fun D _ => mul_nonneg (totalMass_nonneg _ _ _ _ D) (hq j D)) + have hr0 (j) : 0≤ incomingVariance G γ c Z₁ Z₂ h₁ h₂ j := + Finset.sum_nonneg (fun D _ => mul_nonneg (totalMass_nonneg _ _ _ _ D) (hr j D)) + have hft := bounded_denominator_rate _ W C hf0 hW hscale hvar.1 + have hrt := bounded_denominator_rate _ W C hr0 hW hscale hvar.2 + obtain ⟨v,hv,hvf,hvr⟩ := bounded_place_selection Z₁ Z₂ h₁ h₂ h2 q r hq hr C hC hscale hft hrt + let z₁ := fun j x => (v j).embedding (Z₁ j x) + let z₂ := fun j x => (v j).embedding (Z₂ j x) + have hz₁ (j) : Function.Injective (z₁ j) := (v j).embedding.injective.comp (h₁ j) + have hz₂ (j) : Function.Injective (z₂ j) := (v j).embedding.injective.comp (h₂ j) + let u₁ := fun j => logNormalize (z₁ j) + let u₂ := fun j => logNormalize (z₂ j) + let D : ℝ := 4*(2*C+1)+8 + have hD : 0≤D := by dsimp [D]; positivity + have hlog₁ (j) : logAverage (u₁ j)≤D := by + rw [logNormalize_bound _ (hz₁ j) (h2 j)] + exact (arch_log_center_bound (Z₁ j) (Z₂ j) (h₁ j) (h₂ j) (h2 j) (v j)).trans (by dsimp [D]; linarith [hv j]) + have hlog₂ (j) : logAverage (u₂ j)≤D := by + rw [logNormalize_bound _ (hz₂ j) (h2 j)] + have hh := arch_log_center_bound (Z₂ j) (Z₁ j) (h₂ j) (h₁ j) (h2 j) (v j) + rw [archMean_scale_swap] at hh + exact hh.trans (by dsimp [D]; linarith [hv j]) + choose x₁ hx₁ using (fun j => log_center (u₁ j) D (h2 j) (hlog₁ j)) + choose x₂ hx₂ using (fun j => log_center (u₂ j) D (h2 j) (hlog₂ j)) + have hsmall := power_fraction_rate n hn0 hn c hc + let m₁ := fun j => pairMean (rawDepth (z₁ j)) + let m₂ := fun j => pairMean (rawDepth (z₂ j)) + have hd₁ := sphere_arch_test_rate Z₁ Z₂ h₁ h₂ v m₁ (fun j => -u₁ j (x₁ j)) + (fun j => (G j).fiberWeight) (fun j => (G j).targets) T (2/θ) h2 hT (by positivity) + (fun j => (G j).fiberWeight_nonneg) (fun j => (G j).sum_fiberWeight (hpos j) |>.le) hB + (fun j => (G j).fiber_domination _ (hdom j) (h2 j)) hvf hsmall + have hvf₂ : Tendsto (fun j => archMean (Z₂ j) (Z₁ j) (massEval (q j)) (v j)) atTop (𝓝 0) := by + simpa only [archMean_mass_swap] using hvf + have hd₂ := sphere_arch_test_rate Z₂ Z₁ h₂ h₁ v m₂ (fun j => -u₂ j (x₂ j)) + (fun j => (G j).fiberWeight) (fun j => (G j).targets) T (2/θ) h2 hT (by positivity) + (fun j => (G j).fiberWeight_nonneg) (fun j => (G j).sum_fiberWeight (hpos j) |>.le) hB + (fun j => (G j).fiber_domination _ (hdom j) (h2 j)) hvf₂ hsmall + have hdR := sphere_arch_test_rate Z₁ Z₂ h₁ h₂ v m₁ (fun j => -u₁ j (x₁ j)) + (fun j => (G j).retainedWeight (S j)) (fun j => (G j).retainedSet (S j)) T (2/θ) h2 hT (by positivity) + (fun j => (G j).retainedWeight_nonneg _) (fun j => (G j).sum_retainedWeight _ (hpos j)) hR + (fun j => (G j).retained_domination _ _ (hdom j) (h2 j)) hvr hsmall + apply normalized_graph_impossible G u₁ u₂ x₁ x₂ + (fun j => logNormalize_injective _ (hz₁ j)) (fun j => logNormalize_injective _ (hz₂ j)) + hpos (fun j e => Finset.card_pos.mp (by have := hB j e; omega)) h2 hn D hD hlog₁ hlog₂ hx₁ hx₂ + (by simpa only [sub_eq_add_neg,u₁,logNormalize,z₁,m₁] using hd₁) + (by simpa only [sub_eq_add_neg,u₂,logNormalize,z₂,m₂] using hd₂) + S (fun j => Real.rpow_pos_of_pos (hn0 j) γ) + (by simpa only [sub_eq_add_neg,u₁,logNormalize,z₁,m₁] using hdR) + (omitted_rate G θ γ c η hθ hγ1 hηb hn hG) (2/θ) (by positivity) hdom + intro j e y z hy hz + have he := (ht j e y hy).trans (ht j e z hz).symm + have hem := congrArg (v j).embedding he + simp only [map_mul,map_sub] at hem + dsimp only [u₁,u₂,logNormalize,z₁,z₂] + linear_combination (Real.exp (pairMean (rawDepth (z₁ j))):ℂ)* + (Real.exp (pairMean (rawDepth (z₂ j))):ℂ)*hem + +end WeakPinned + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PinnedDistances/BoundedRates.lean b/lean/OAI/Geometry/PinnedDistances/BoundedRates.lean new file mode 100644 index 0000000000000000000000000000000000000000..0451ca253f19afcaa74767ff4012d8858b52e378 --- /dev/null +++ b/lean/OAI/Geometry/PinnedDistances/BoundedRates.lean @@ -0,0 +1,133 @@ +import OAI.Geometry.PinnedDistances.NormalizedGraphs + +namespace OAI + +universe u1 u2 u3 u4 + +section +noncomputable section +open MeasureTheory Filter +open scoped Topology BigOperators +namespace WeakPinned.Bounded +open Hierarchy Global Variance NumberField + +lemma bounded_denominator_rate (x w : ℕ → ℝ) (C : ℝ) + (hx : ∀ n,0≤x n) (hw : ∀ n,0≤w n) (hC : ∀ n,w n≤C) + (ht : Tendsto (fun n => x n/(w n+1)) atTop (𝓝 0)) : + Tendsto x atTop (𝓝 0) := by + apply squeeze_zero hx _ (by simpa only [mul_zero] using tendsto_const_nhds.mul ht (a:=C+1)) + intro n + have hp : 0 q C+r C) d d'=massEval q d d'+massEval r d d' := by + simp only [massEval,weightedIntegral,mul_add,Finset.sum_add_distrib] + ring + +omit [NumberField K] in +lemma archMean_mass_add (Z₁ Z₂ : P → K) (h₁ : Function.Injective Z₁) (h₂ : Function.Injective Z₂) + (hn : 2≤Fintype.card P) (q r : Finset P → ℝ) (v : InfinitePlace K) : + archMean Z₁ Z₂ (massEval (fun C => q C+r C)) v= + archMean Z₁ Z₂ (massEval q) v+archMean Z₁ Z₂ (massEval r) v := by + unfold archMean + simp only [massEval_add] + exact integral_add (integrable_massEval Z₁ Z₂ h₁ h₂ hn q v) + (integrable_massEval Z₁ Z₂ h₁ h₂ hn r v) + +omit [NumberField K] in +lemma archMean_mass_swap (Z₁ Z₂ : P → K) (q : Finset P → ℝ) (v : InfinitePlace K) : + archMean Z₂ Z₁ (massEval q) v=archMean Z₁ Z₂ (massEval q) v := by + unfold archMean + congr 1 + funext ω + exact add_comm _ _ + +omit [NumberField K] in +lemma archMean_scale_swap (Z₁ Z₂ : P → K) (v : InfinitePlace K) : + archMean Z₂ Z₁ scaleEval v=archMean Z₁ Z₂ scaleEval v := by + unfold archMean + congr 1 + funext ω + simp only [scaleEval,massEval,potentialEval] + congr 1 + · exact add_comm _ _ + · apply Finset.sum_congr rfl + intro x _ + rw [add_comm ((arch Z₂ v ω).potential x)] + +omit [DecidableEq P] in +lemma weightedIntegral_add (m q r : Finset P → ℝ) : + weightedIntegral m (fun C => q C+r C)=weightedIntegral m q+weightedIntegral m r := by + simp only [weightedIntegral,mul_add,Finset.sum_add_distrib] + +variable {V : ℕ → Type u3} {L : ℕ → Type u4} [∀ n,Fintype (V n)] [∀ n,DecidableEq (V n)] + [∀ n,Field (L n)] [∀ n,NumberField (L n)] + +lemma bounded_place_selection (Z₁ Z₂ : ∀ n,V n → L n) + (h₁ : ∀ n,Function.Injective (Z₁ n)) (h₂ : ∀ n,Function.Injective (Z₂ n)) + (hn : ∀ n,2≤Fintype.card (V n)) (q r : ∀ n,Finset (V n) → ℝ) + (hq : ∀ n C,0≤q n C) (hr : ∀ n C,0≤r n C) + (C : ℝ) (hC : 0≤C) + (hscale : ∀ n,overlapScale (Z₁ n) (Z₂ n) (h₁ n) (h₂ n)+ + potentialScale (Z₁ n) (Z₂ n) (h₁ n) (h₂ n)≤C) + (hqt : Tendsto (fun n => weightedIntegral (totalMass (Z₁ n) (Z₂ n) (h₁ n) (h₂ n)) (q n)) atTop (𝓝 0)) + (hrt : Tendsto (fun n => weightedIntegral (totalMass (Z₁ n) (Z₂ n) (h₁ n) (h₂ n)) (r n)) atTop (𝓝 0)) : + ∃ v : ∀ n,InfinitePlace (L n), + (∀ n,archMean (Z₁ n) (Z₂ n) scaleEval (v n)≤2*C+1) ∧ + Tendsto (fun n => archMean (Z₁ n) (Z₂ n) (massEval (q n)) (v n)) atTop (𝓝 0) ∧ + Tendsto (fun n => archMean (Z₁ n) (Z₂ n) (massEval (r n)) (v n)) atTop (𝓝 0) := by + let m := fun n => totalMass (Z₁ n) (Z₂ n) (h₁ n) (h₂ n) + let ε := fun n => weightedIntegral (m n) (q n)+weightedIntegral (m n) (r n)+1/((n:ℝ)+1) + have hq0 (n) : 0≤weightedIntegral (m n) (q n) := + Finset.sum_nonneg (fun D _ => mul_nonneg (totalMass_nonneg _ _ _ _ _) (hq n D)) + have hr0 (n) : 0≤weightedIntegral (m n) (r n) := + Finset.sum_nonneg (fun D _ => mul_nonneg (totalMass_nonneg _ _ _ _ _) (hr n D)) + have he (n) : 0<ε n := by + have hh : 0<1/((n:ℝ)+1) := by positivity + dsimp only [ε] + linarith [hq0 n,hr0 n] + have het : Tendsto ε atTop (𝓝 0) := by + have hi : Tendsto (fun n : ℕ => 1/((n:ℝ)+1)) atTop (𝓝 0) := by + simpa only [one_div,Function.comp_def] using tendsto_inv_atTop_zero.comp (tendsto_atTop_add_const_right _ _ tendsto_natCast_atTop_atTop) + simpa only [add_zero] using (hqt.add hrt).add hi + have hs (n) := select_arch (Z₁ n) (Z₂ n) (h₁ n) (h₂ n) (hn n) + (fun D => q n D+r n D) (fun D => add_nonneg (hq n D) (hr n D)) C (ε n) hC (he n) (hscale n) + (by rw [weightedIntegral_add]; dsimp [ε,m]; linarith [show 0≤1/((n:ℝ)+1) by positivity]) + choose v hvscale hv using hs + have hvq (n) : 0≤archMean (Z₁ n) (Z₂ n) (massEval (q n)) (v n) := + archMean_nonneg _ _ _ (massEval_nonneg _ (hq n)) _ + have hvr (n) : 0≤archMean (Z₁ n) (Z₂ n) (massEval (r n)) (v n) := + archMean_nonneg _ _ _ (massEval_nonneg _ (hr n)) _ + have hsum (n) := hv n + simp only [archMean_mass_add _ _ (h₁ _) (h₂ _) (hn _)] at hsum + refine ⟨v,hvscale,?_,?_⟩ + · apply squeeze_zero hvq _ (by simpa only [mul_zero] using het.const_mul 2) + intro n + linarith [hsum n,hvr n] + · apply squeeze_zero hvr _ (by simpa only [mul_zero] using het.const_mul 2) + intro n + linarith [hsum n,hvq n] + +lemma power_fraction_rate (n : ℕ → ℝ) (hn : ∀ j,0 (n j)^(1-c)/n j) atTop (𝓝 0) := by + have hh := (tendsto_rpow_neg_atTop hc).comp ht + convert hh using 1 + funext j + rw [show 1-c=1+(-c) by ring,Real.rpow_add (hn j),Real.rpow_one] + simp only [Function.comp_apply] + exact mul_div_cancel_left₀ _ (hn j).ne' + +end WeakPinned.Bounded + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PinnedDistances/ChartLimits.lean b/lean/OAI/Geometry/PinnedDistances/ChartLimits.lean new file mode 100644 index 0000000000000000000000000000000000000000..fdbd80d4f955fe2ba7a75561051521a2b09c545b --- /dev/null +++ b/lean/OAI/Geometry/PinnedDistances/ChartLimits.lean @@ -0,0 +1,174 @@ +import OAI.Geometry.PinnedDistances.FiniteMixtures + +namespace OAI + +universe u1 u2 u3 u4 u5 u6 u7 u8 u9 u10 u11 u12 + +section +noncomputable section +open MeasureTheory Filter Set +open scoped Topology +namespace WeakPinned.Bounded + +variable {X : Type u1} {Y : Type u2} [MeasurableSpace X] [MeasurableSpace Y] + +lemma chart_probability (j : X → Y) (hj : MeasurableEmbedding j) + (μ : Measure Y) [IsProbabilityMeasure μ] (hfin : ∀ᵐ y ∂ μ,y∈range j) : + IsProbabilityMeasure (μ.comap j) := by + constructor + rw [hj.comap_apply,image_univ] + exact measure_eq_measure_of_null_sdiff (subset_univ _) (by + convert ae_iff.mp hfin using 2 + ext y + simp) |>.trans measure_univ + +lemma chart_map_comap (j : X → Y) (hj : MeasurableEmbedding j) + (μ : Measure Y) (hfin : ∀ᵐ y ∂ μ,y∈range j) : (μ.comap j).map j=μ := by + rw [hj.map_comap] + exact Measure.restrict_eq_self_of_ae_mem hfin + +lemma chart_ae_iff (j : X → Y) (hj : MeasurableEmbedding j) (μ : Measure Y) + {s : Set X} : (∀ᵐ x ∂ μ.comap j,x∈s) ↔ μ (j '' sᶜ)=0 := by + rw [ae_iff,hj.comap_apply] + rfl + +variable [TopologicalSpace X] [TopologicalSpace Y] [BorelSpace X] [BorelSpace Y] + +lemma weak_chart_closed (j : X → Y) (hj : Topology.IsOpenEmbedding j) + [HasOuterApproxClosed Y] (α : ℕ → ProbabilityMeasure Y) (β : ProbabilityMeasure Y) + (ht : Tendsto α atTop (𝓝 β)) (s : Set X) (hs : IsClosed s) + (hα : ∀ n,(α n : Measure Y) (j '' sᶜ)=0) : + ∀ᵐ x ∂ (β : Measure Y).comap j,x∈s := by + rw [chart_ae_iff j hj.measurableEmbedding] + apply le_antisymm _ zero_le + apply (ProbabilityMeasure.le_liminf_measure_open_of_tendsto ht + (hj.isOpenMap _ hs.isOpen_compl)).trans + apply liminf_le_of_frequently_le' + exact (Eventually.of_forall (fun n => le_of_eq (hα n))).frequently + +end WeakPinned.Bounded + +end +end +section +noncomputable section +open MeasureTheory Filter Set +open scoped Topology +namespace WeakPinned.Bounded + +lemma map_transport {A : Type u3} {B : Type u4} {X : Type u5} {Y : Type u6} [MeasurableSpace A] [MeasurableSpace B] + [MeasurableSpace X] [MeasurableSpace Y] (j : A → X) (k : B → Y) + (hj : Measurable j) (hk : MeasurableEmbedding k) + (f : A → B) (g : X → Y) (hf : Measurable f) (hg : Measurable g) + (μ : Measure A) (ν : Measure B) (hcomm : k ∘ f=g ∘ j) + (hm : (μ.map j).map g=ν.map k) : μ.map f=ν := by + apply hk.map_injective + rw [Measure.map_map hk.measurable hf,hcomm,← Measure.map_map hg hj] + exact hm + +lemma map_pull_ac {A : Type u7} {B : Type u8} [MeasurableSpace A] [MeasurableSpace B] + (j : A → B) (hj : MeasurableEmbedding j) (μ ν : Measure A) + (h : μ.map j ≪ ν.map j) : μ≪ν := by + intro s hs + have hν : ν.map j (j '' s)=0 := by + rw [hj.map_apply,hj.injective.preimage_image] + exact hs + have hμ := h hν + rwa [hj.map_apply,hj.injective.preimage_image] at hμ + +lemma map_full_range {A : Type u9} {B : Type u10} [MeasurableSpace A] [MeasurableSpace B] + (j : A → B) (hj : MeasurableEmbedding j) (μ : Measure A) : + ∀ᵐ x ∂ μ.map j,x∈range j := by + apply (ae_map_iff hj.measurable.aemeasurable hj.measurableSet_range).mpr + exact Eventually.of_forall (fun _ => mem_range_self _) + +abbrev pairCoe : ℂ × ℂ → Sphere × Sphere := Prod.map OnePoint.some OnePoint.some +abbrev quadCoe : Quad ℂ → Quad Sphere := Prod.map OnePoint.some + (Prod.map OnePoint.some pairCoe) +abbrev expandedCoe : Expanded ℂ → Expanded Sphere := Prod.map quadCoe (Prod.map pairCoe pairCoe) + +lemma pairCoe_open : Topology.IsOpenEmbedding pairCoe := + OnePoint.isOpenEmbedding_coe.prodMap OnePoint.isOpenEmbedding_coe + +lemma quadCoe_open : Topology.IsOpenEmbedding quadCoe := + OnePoint.isOpenEmbedding_coe.prodMap (OnePoint.isOpenEmbedding_coe.prodMap pairCoe_open) + +lemma expandedCoe_open : Topology.IsOpenEmbedding expandedCoe := + quadCoe_open.prodMap (pairCoe_open.prodMap pairCoe_open) + +end WeakPinned.Bounded + +end +end +section +noncomputable section +open MeasureTheory Filter +open scoped BigOperators Topology ENNReal +namespace WeakPinned.Bounded +open Variance +variable {V : Type u11} {I : Type u12} [Fintype V] [DecidableEq V] [Fintype I] +variable (G : Core.Fibers V I) +local instance : MeasurableSpace Sphere := borel Sphere +local instance : BorelSpace Sphere := ⟨rfl⟩ + +omit [Fintype I] in +lemma graph_edgeWeight_nonneg (r : I × V) : + 0≤edgeWeight G.fiberWeight (fun e => prob (G.targets e)) r := + mul_nonneg (G.fiberWeight_nonneg _) (Core.Fibers.prob_nn _ _) + +omit [Fintype I] in +lemma graph_tripleWeight_nonneg (r : I × V × V × V) : + 0≤tripleWeight G.fiberWeight (fun e => prob (G.targets e)) r := + mul_nonneg (mul_nonneg (mul_nonneg (G.fiberWeight_nonneg _) (Core.Fibers.prob_nn _ _)) + (Core.Fibers.prob_nn _ _)) (Core.Fibers.prob_nn _ _) + +def edgeProbability (U₁ U₂ : V → Sphere) (hG : 0 prob (G.targets e))) + (edgeValue G.source U₁ U₂) (graph_edgeWeight_nonneg G) + (sum_edgeWeight _ _ (G.sum_fiberWeight hG) (fun e => sum_prob _ (hB e))) + +def expandedProbability (U₁ U₂ : V → Sphere) (hG : 0 prob (G.targets e))) + (tripleValue G.source U₁ U₂) (graph_tripleWeight_nonneg G) + (sum_tripleWeight _ _ (G.sum_fiberWeight hG) (fun e => sum_prob _ (hB e))) + +lemma expandedProbability_edge (U₁ U₂ : V → Sphere) (hG : 0 prob (G.targets e)) (edgeValue G.source U₁ U₂) G.fiberWeight_nonneg (fun e => Core.Fibers.prob_nn _) (fun e => sum_prob _ (hB e)) + +lemma edgeProbability_dom₁ (U₁ U₂ : V → Sphere) (hG : 0 (q.1,q.2.2.1))≤ + ENNReal.ofReal (2*M) • (uniformLaw U₁).prod (uniformLaw U₁) := by + change (finiteLaw (edgeWeight G.fiberWeight (fun e => prob (G.targets e))) + (edgeValue G.source U₁ U₂)).map (fun q => (q.1,q.2.2.1))≤_ + rw [finiteLaw_map _ _ (fun q : Quad Sphere => (q.1,q.2.2.1)) (by fun_prop)] + change finiteLaw (edgeWeight G.fiberWeight (fun e => prob (G.targets e))) (fun r => (U₁ (G.source r.1),U₁ r.2))≤_ + rw [graph_edge_law G (fun x y => (U₁ x,U₁ y)) hG hB] + exact graph_domination G U₁ hn M hM hdom + +lemma edgeProbability_dom₂ (U₁ U₂ : V → Sphere) (hG : 0 (q.2.1,q.2.2.2))≤ + ENNReal.ofReal (2*M) • (uniformLaw U₂).prod (uniformLaw U₂) := by + change (finiteLaw (edgeWeight G.fiberWeight (fun e => prob (G.targets e))) + (edgeValue G.source U₁ U₂)).map (fun q => (q.2.1,q.2.2.2))≤_ + rw [finiteLaw_map _ _ (fun q : Quad Sphere => (q.2.1,q.2.2.2)) (by fun_prop)] + change finiteLaw (edgeWeight G.fiberWeight (fun e => prob (G.targets e))) (fun r => (U₂ (G.source r.1),U₂ r.2))≤_ + rw [graph_edge_law G (fun x y => (U₂ x,U₂ y)) hG hB] + exact graph_domination G U₂ hn M hM hdom + +end WeakPinned.Bounded + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PinnedDistances/ConditionalIntegral.lean b/lean/OAI/Geometry/PinnedDistances/ConditionalIntegral.lean new file mode 100644 index 0000000000000000000000000000000000000000..7eef3aaf5f7183dc45261c73bdec94a14ebe332c --- /dev/null +++ b/lean/OAI/Geometry/PinnedDistances/ConditionalIntegral.lean @@ -0,0 +1,67 @@ +import OAI.Geometry.PinnedDistances.FiniteLaw + +namespace OAI + +universe u1 u2 u3 u4 u5 + +section +noncomputable section +open MeasureTheory Filter +open scoped Topology +namespace WeakPinned.Bounded + +lemma integrable_one_bound {X : Type u1} [MeasurableSpace X] (μ : Measure X) [IsFiniteMeasure μ] + (f : X → ℝ) (hf : Measurable f) (hbound : ∀ x,‖f x‖≤1) : Integrable f μ := by + exact (integrable_const (1:ℝ)).mono' hf.aestronglyMeasurable (Eventually.of_forall hbound) + +variable {Ω : Type u2} {E : Type u3} {X : Type u4} {Y : Type u5} [MeasurableSpace Ω] [MeasurableSpace E] + [MeasurableSpace X] [MeasurableSpace Y] + +lemma integral_fiber_indicator (Q : Measure E) (μ : Measure X) + [IsProbabilityMeasure Q] [IsProbabilityMeasure μ] + (f : E × X → ℝ) (hf : Measurable f) (hbound : ∀ p,‖f p‖≤1) + (s : Set E) (hs : MeasurableSet s) : + (∫ e in s, ∫ x,f (e,x) ∂ μ ∂ Q)= + ∫ p,(s ×ˢ Set.univ).indicator f p ∂ Q.prod μ := by + have hi := integrable_one_bound (Q.prod μ) f hf hbound + rw [integral_prod _ (hi.indicator (hs.prod MeasurableSet.univ))] + rw [← integral_indicator hs] + apply integral_congr_ae + filter_upwards [] with e + by_cases he : e∈s + · simp [Set.indicator_of_mem,he] + · simp [Set.indicator_of_notMem,he] + +lemma conditional_integral_eq + (R : Measure Ω) (Q : Measure E) (μ : Measure X) (ν : Measure Y) + [IsProbabilityMeasure R] [IsProbabilityMeasure Q] + [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] + (e : Ω → E) (z : Ω → X) (w : Ω → Y) + (he : Measurable e) (hz : Measurable z) (hw : Measurable w) + (hmz : R.map (fun r => (e r,z r))=Q.prod μ) + (hmw : R.map (fun r => (e r,w r))=Q.prod ν) + (f : E × X → ℝ) (g : E × Y → ℝ) + (hf : Measurable f) (hg : Measurable g) + (hfb : ∀ p,‖f p‖≤1) (hgb : ∀ p,‖g p‖≤1) + (heq : ∀ᵐ r ∂ R,f (e r,z r)=g (e r,w r)) : + ∀ᵐ a ∂ Q,(∫ x,f (a,x) ∂ μ)=(∫ y,g (a,y) ∂ ν) := by + apply Integrable.ae_eq_of_forall_setIntegral_eq + · exact (integrable_one_bound (Q.prod μ) f hf hfb).integral_prod_left + · exact (integrable_one_bound (Q.prod ν) g hg hgb).integral_prod_left + · intro s hs _ + rw [integral_fiber_indicator Q μ f hf hfb s hs, + integral_fiber_indicator Q ν g hg hgb s hs,← hmz,← hmw] + rw [integral_map_of_stronglyMeasurable (he.prodMk hz) + (hf.indicator (hs.prod MeasurableSet.univ)).stronglyMeasurable, + integral_map_of_stronglyMeasurable (he.prodMk hw) + (hg.indicator (hs.prod MeasurableSet.univ)).stronglyMeasurable] + apply integral_congr_ae + filter_upwards [heq] with r hr + by_cases h : e r∈s <;> simp [h,hr] + +end WeakPinned.Bounded + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PinnedDistances/CutApproximation.lean b/lean/OAI/Geometry/PinnedDistances/CutApproximation.lean new file mode 100644 index 0000000000000000000000000000000000000000..efb3afb2c81bbfc675962b642f012440031b9d20 --- /dev/null +++ b/lean/OAI/Geometry/PinnedDistances/CutApproximation.lean @@ -0,0 +1,368 @@ +import OAI.Geometry.PinnedDistances.GlobalPotentials + +namespace OAI + +universe u1 u2 u3 u4 u5 u6 u7 u8 u9 + +section +noncomputable section +open NumberField +open scoped BigOperators +noncomputable section +open MeasureTheory +open scoped Topology +noncomputable section +open MeasureTheory +open scoped Topology ENNReal +noncomputable section +open MeasureTheory NumberField +open scoped BigOperators +noncomputable section +open scoped BigOperators +open MeasureTheory +noncomputable section +open Filter +open scoped Topology +noncomputable section +open scoped BigOperators +noncomputable section +open Filter +open scoped Topology +noncomputable section +open MeasureTheory +open scoped BigOperators +noncomputable section + +namespace WeakPinned.Cuts +open scoped BigOperators + +def tent (δ u : ℝ) : ℝ := max 0 (min (u-δ) (1-δ-u)) +lemma tent_nonneg (δ u : ℝ) : 0≤tent δ u := le_max_left _ _ +lemma tent_symm (δ u : ℝ) : tent δ (1-u)=tent δ u := by + unfold tent + rw [show 1-u-δ=1-δ-u by ring,show 1-δ-(1-u)=u-δ by ring,min_comm] +lemma tent_zero_left {δ u : ℝ} (hu : u≤δ) : tent δ u=0 := by + unfold tent + exact max_eq_left ((min_le_left _ _).trans (sub_nonpos.mpr hu)) +lemma tent_zero_right {δ u : ℝ} (hu : 1-δ≤u) : tent δ u=0 := by + rw [← tent_symm] + exact tent_zero_left (by linarith) +lemma tent_le_one {δ u : ℝ} (hδ : 0≤δ) (hu : u≤1) : tent δ u≤1 := by + exact max_le (by norm_num) ((min_le_left _ _).trans (by linarith)) +lemma tent_lipschitz (δ u v : ℝ) : |tent δ u-tent δ v|≤|u-v| := by + have hm := abs_max_sub_max_le_max (0:ℝ) (min (u-δ) (1-δ-u)) 0 (min (v-δ) (1-δ-v)) + have hn := abs_min_sub_min_le_max (u-δ) (1-δ-u) (v-δ) (1-δ-v) + have he : 1-δ-u-(1-δ-v)=-(u-v) := by ring + have hf : u-δ-(v-δ)=u-v := by ring + simp only [he,hf,abs_neg,max_self] at hn + exact hm.trans (max_le (by simp [abs_nonneg]) hn) +lemma tent_positive {δ u : ℝ} (hu : 0 linarith +lemma tent_lower {δ u : ℝ} (hu : 2*δ≤u) (hu' : u≤1-2*δ) : δ≤tent δ u := by + exact le_max_iff.mpr (Or.inr (le_min (by linarith) (by linarith))) + +def cutError (δ p a : ℝ) : ℝ := |tent δ p-tent δ a|+tent δ a*|p-a| +lemma cutError_nonneg (δ p a : ℝ) : 0≤cutError δ p a := + add_nonneg (abs_nonneg _) (mul_nonneg (tent_nonneg _ _) (abs_nonneg _)) +lemma cutError_symm (δ p a : ℝ) : cutError δ (1-p) (1-a)=cutError δ p a := by + simp only [cutError,tent_symm,show 1-p-(1-a)=-(p-a) by ring,abs_neg] +lemma cutError_le {δ p a : ℝ} (hδ : 0≤δ) (ha : a≤1) : cutError δ p a≤2*|p-a| := by + have := tent_lipschitz δ p a + have := mul_le_mul_of_nonneg_right (tent_le_one hδ ha) (abs_nonneg (p-a)) + unfold cutError + linarith +lemma cutError_young {δ p a ε : ℝ} (hδ : 0≤δ) (ha : a≤1) (hε : 0<ε) : + cutError δ p a≤ε+(p-a)^2/ε := by + apply (cutError_le hδ ha).trans + apply (mul_le_mul_iff_left₀ hε).mp + have he : (ε+(p-a)^2/ε)*ε=ε^2+(p-a)^2 := by field_simp + rw [he] + nlinarith [sq_nonneg (|p-a|-ε),sq_abs (p-a)] + +/-- Tiny uniform cells have nonzero balanced-cut weight only if their sampled +mass is separated from zero. The variance quadratic then pays the cut error. -/ +lemma cutError_tiny {δ p a : ℝ} (hδ : 0<δ) (ha : a<δ/2) (hp : p≤1) : + cutError δ p a≤(4/δ^2)*(p-a)^2 ∧ cutError δ p a≤(4/δ^2)*(p^2/2) := by + have hz : tent δ a=0 := tent_zero_left (by linarith) + rw [cutError,hz,sub_zero,abs_of_nonneg (tent_nonneg _ _),zero_mul,add_zero] + by_cases hh : tent δ p=0 + · rw [hh]; constructor <;> positivity + · have ht : 0 + mul_le_mul_of_nonneg_left (cutError_young (p:=cellProb (B i) C) hδ.le (cellProb_le_one (Finset.univ : Finset P) C) hε) (hw i)) + change familyCutError w B δ C≤_ at he + simp only [mul_add,Finset.sum_add_distrib,← Finset.sum_mul,← mul_div_assoc,← Finset.sum_div] at he + have hvf : varianceCell w B T C=∑ i, w i*(cellProb (B i) C-cellProb Finset.univ C)^2 := by + simp only [varianceCell,ite_eq_left (hlarge ha)] + rw [← hvf] at he + have he2 : (∑ i, w i)*ε≤ε := by nlinarith + have he3 : ε≤(8*ε/δ^2)*pairCell Finset.univ C := by + have hh := mul_le_mul_of_nonneg_left (hpair ha) hε.le + calc + ε = ε*1 := by ring + _ ≤ ε*((8/δ^2)*pairCell Finset.univ C) := hh + _ = _ := by ring + have hx : 0≤(4/δ^2)*varianceCell w B T C := mul_nonneg (by positivity) hv + have hh : varianceCell w B T C/ε=(1/ε)*varianceCell w B T C := by ring + rw [hh] at he + nlinarith + · have hat : cellProb Finset.univ C<δ/2 := lt_of_not_ge ha + have hb : familyCutError w B δ C≤(4/δ^2)*varianceCell w B T C := by + unfold familyCutError varianceCell + split_ifs with hl + · rw [Finset.mul_sum] + apply Finset.sum_le_sum + intro i _ + have hh := (cutError_tiny hδ hat (cellProb_le_one (B i) C)).1 + have hm := mul_le_mul_of_nonneg_left hh (hw i) + convert hm using 1; ring + · simp only [Finset.mul_sum] + apply Finset.sum_le_sum + intro i _ + by_cases hpk : 2/((B i).card:ℝ)≤cellProb (B i) C + · rw [ite_eq_left hpk] + have hh := (cutError_tiny hδ hat (cellProb_le_one (B i) C)).2 + have hm := mul_le_mul_of_nonneg_left hh (hw i) + convert hm using 1; ring + · rw [ite_eq_right hpk] + have hp : cellProb (B i) C≤δ := (le_of_lt (lt_of_not_ge hpk)).trans (hk i) + simp only [cutError,tent_zero_left hp,tent_zero_left (show cellProb Finset.univ C≤δ by linarith), + sub_self,abs_zero,zero_mul,add_zero,mul_zero] + norm_num + have hx : 0≤(8*ε/δ^2)*pairCell Finset.univ C := mul_nonneg (by positivity) (pairCell_nonneg _ _) + have hy : 0≤(1/ε)*varianceCell w B T C := mul_nonneg (by positivity) hv + nlinarith +end WeakPinned.Variance + +namespace WeakPinned.Variance +open scoped BigOperators +variable {P : Type u3} {I : Type u4} [Fintype P] [Fintype I] [DecidableEq P] + +lemma balanced_cell_size (δ : ℝ) (hδ : 0<δ) (hn : 4≤δ*(Fintype.card P:ℝ)) + (C : Finset P) (ha : δ/2≤cellProb Finset.univ C) : 2≤C.card := by + have hn0 : (0:ℝ)

le_max_left (diskAverage c ε i q-α) 0) + simpa [thresholdTotal,thresholdWeight,Finset.sum_sub_distrib,hs] using hh + linarith +lemma thresholdMap_nonneg {c : ℂ → Fin 5} (hc : Measurable c) {ε α : ℝ} + (hε : 0<ε) (hα : α<1/5) (q : ℂ) (i : Fin 5) : 0≤thresholdMap c ε α q i := + div_nonneg (le_max_right _ _) (thresholdTotal_pos hc hε hα q).le +lemma thresholdMap_sum {c : ℂ → Fin 5} (hc : Measurable c) {ε α : ℝ} + (hε : 0<ε) (hα : α<1/5) (q : ℂ) : ∑i,thresholdMap c ε α q i=1 := by + unfold thresholdMap + rw [←Finset.sum_div] + exact div_self (thresholdTotal_pos hc hε hα q).ne' +lemma thresholdMap_pos {c : ℂ → Fin 5} (hc : Measurable c) {ε α : ℝ} + (hε : 0<ε) (hα : α<1/5) (q : ℂ) (i : Fin 5) : + 0 thresholdWeight c ε α q i) := + ((diskAverage_lipschitz hc hε i).continuous.sub continuous_const).max continuous_const + have ht : Continuous (thresholdTotal c ε α) := continuous_finsetSum _ (fun i _ => hw i) + exact continuous_pi fun i => (hw i).div ht (fun q => (thresholdTotal_pos hc hε hα q).ne') +lemma thresholdMap_mem_forest {c : ℂ → Fin 5} (hc : Measurable c) {ε α : ℝ} + (hε : 0<ε) (hα : α<1/5) (q : ℂ) {G : SimpleGraph (Fin 5)} (hG : G.IsAcyclic) + (hb : ∀i j,i≠j → α gt_mem_nhds (hR i) + obtain ⟨δ,hδ,hd⟩ := Metric.mem_nhds_iff.mp hh + refine ⟨δ/2,half_pos hδ,hd ?_⟩ + change dist (δ/2) (0:ℝ)<δ + rw [Real.dist_eq,sub_zero,abs_of_pos (half_pos hδ)] + exact half_lt_self hδ +lemma finite_small_scale {ι : Type*} [Finite ι] (P : ι → ℝ → Prop) + (h : ∀i,∃δ>0,∀ε,0<ε → ε<δ → P i ε) : ∃δ>0,∀ε,0<ε → ε<δ → ∀i,P i ε := by + choose δ hδ hd using h + obtain ⟨s,hs,hsi⟩ := finite_pos_lt δ hδ + exact ⟨s,hs,fun ε hε hεs i => hd i ε hε (hεs.trans (hsi i))⟩ + +/-- A genuine local forest chart; its exception disks have arbitrarily small total +radius at sufficiently small averaging scale. -/ +theorem forest_chart {c : ℂ → Fin 5} (hc : Measurable c) {α : ℝ} + (hα : 0<α) (hα' : α<1/5) (x : ℂ) (hf : (transitionGraph c x).IsAcyclic) : + ∃s>0,∀η>0,∃δ>0,∀ε,0<ε → ε<δ → ∃C : Finset ℂ, + (C.card:ℝ)*(α*ε/4)<η ∧ ∀q∈Metric.ball x s, + q∉⋃z∈C,Metric.ball z (α*ε/4) → thresholdMap c ε α q∈graphRealization (transitionGraph c x) := by + have hall : ∀p : Fin 5 × Fin 5,∃R>0, p.1≠p.2 → ¬TransitionEdge c p.1 p.2 x → + ∀s0,∃δ>0,∀ε,0<ε → ε<δ → ∃C : Finset ℂ, + (∀q∈Metric.ball x s,α hcov s hs α hα η hη⟩ + · exact ⟨1,by norm_num,fun h₁ h₂ => False.elim (hp ⟨h₁,h₂⟩)⟩ + choose R hR hcov using hall + obtain ⟨s,hs,hsR⟩ := finite_pos_lt R hR + refine ⟨s,hs,fun η hη => ?_⟩ + let P (p : Fin 5 × Fin 5) (ε : ℝ) : Prop := ∃C : Finset ℂ, + (C.card:ℝ)*(α*ε/4)<η/25 ∧ (p.1≠p.2 → ¬TransitionEdge c p.1 p.2 x → + ∀q∈Metric.ball x s,α0,∀ε,0<ε → ε<δ → P p ε := by + intro p + by_cases hp : p.1≠p.2 ∧ ¬TransitionEdge c p.1 p.2 x + · obtain ⟨δ,hδ,hd⟩ := hcov p hp.1 hp.2 s (hsR p) (η/25) (by positivity) + refine ⟨δ,hδ,fun ε hε hεδ => ?_⟩ + obtain ⟨C,hC,hCr⟩ := hd ε hε hεδ + exact ⟨C,hCr,fun _ _ => hC⟩ + · refine ⟨1,by norm_num,fun ε _ _ => ⟨∅,by simpa using (show 0<η/25 by positivity),?_⟩⟩ + exact fun h₁ h₂ => False.elim (hp ⟨h₁,h₂⟩) + obtain ⟨δ,hδ,hd⟩ := finite_small_scale P hP + refine ⟨δ,hδ,fun ε hε hεδ => ?_⟩ + choose C hCr hC using hd ε hε hεδ + let T := Finset.univ.biUnion C + have hr : 0≤α*ε/4 := by positivity + refine ⟨T,?_,?_⟩ + · have hcard : (T.card:ℝ)≤∑p : Fin 5 × Fin 5,((C p).card:ℝ) := by + exact_mod_cast (Finset.card_biUnion_le (s := Finset.univ) (t := C)) + have hsum : (∑p : Fin 5 × Fin 5,((C p).card:ℝ)*(α*ε/4))<∑_p : Fin 5 × Fin 5,η/25 := + Finset.sum_lt_sum_of_nonempty Finset.univ_nonempty (fun p _ => hCr p) + have hb := mul_le_mul_of_nonneg_right hcard hr + rw [Finset.sum_mul] at hb + have hsum' : (∑p : Fin 5 × Fin 5,((C p).card:ℝ)*(α*ε/4))<25*(η/25) := by simpa using hsum + exact hb.trans_lt (by linarith [hsum']) + · intro q hq hqT + apply thresholdMap_mem_forest hc hε hα' q hf + intro i j hij hi hj + by_contra he + obtain ⟨z,hz,hqz⟩ := hC (i,j) hij he q hq hi hj + apply hqT + exact mem_iUnion.mpr ⟨z,mem_iUnion.mpr ⟨Finset.mem_biUnion.mpr ⟨(i,j),Finset.mem_univ _,hz⟩,hqz⟩⟩ +end EuclideanFiveColor +end + +noncomputable section +open scoped Classical +open Set Filter Topology MeasureTheory +namespace EuclideanFiveColor +/-- Compact local forest control with one Lebesgue radius, chosen before the hole +budget and the disk-average scale. The resulting forest controls the WHOLE nearby +ball off the common exception disks, not merely the compact set. -/ +theorem compact_forest_charts {c : ℂ → Fin 5} (hc : Measurable c) {α : ℝ} + (hα : 0<α) (hα' : α<1/5) (M : Set ℂ) (hM : IsCompact M) + (hf : ∀x∈M,(transitionGraph c x).IsAcyclic) : + ∃l>0,∀η>0,∃δ>0,∀ε,0<ε → ε<δ → ∃C : Finset ℂ, + (C.card:ℝ)*(α*ε/4)<η ∧ ∀a∈M,∃G : SimpleGraph (Fin 5),G.IsAcyclic ∧ + ∀q∈Metric.ball a l,q∉⋃z∈C,Metric.ball z (α*ε/4) → thresholdMap c ε α q∈graphRealization G := by + choose s hs hchart using fun x : M => forest_chart hc hα hα' x.val (hf x.val x.property) + have hcover : M⊆⋃x : M,Metric.ball x.val (s x) := by + intro x hx + exact mem_iUnion.mpr ⟨⟨x,hx⟩,Metric.mem_ball_self (hs _)⟩ + obtain ⟨S,hS⟩ := hM.elim_finite_subcover (fun x : M => Metric.ball x.val (s x)) + (fun _ => Metric.isOpen_ball) hcover + have hS' : M⊆⋃x : S,Metric.ball x.val.val (s x.val) := by + intro x hx + obtain ⟨a,ha⟩ := mem_iUnion.mp (hS hx) + obtain ⟨haS,hxa⟩ := mem_iUnion.mp ha + exact mem_iUnion.mpr ⟨⟨a,haS⟩,hxa⟩ + obtain ⟨l,hl,hleb⟩ := lebesgue_number_lemma_of_metric hM (fun _ => Metric.isOpen_ball) hS' + refine ⟨l,hl,fun η hη => ?_⟩ + let β := η/((S.card:ℝ)+1) + have hβ : 0<β := div_pos hη (by positivity) + let P (x : S) (ε : ℝ) : Prop := ∃C : Finset ℂ, + (C.card:ℝ)*(α*ε/4)<β ∧ ∀q∈Metric.ball x.val.val (s x.val), + q∉⋃z∈C,Metric.ball z (α*ε/4) → thresholdMap c ε α q∈graphRealization (transitionGraph c x.val.val) + obtain ⟨δ,hδ,hd⟩ := finite_small_scale P (fun x => hchart x.val β hβ) + refine ⟨δ,hδ,fun ε hε hεδ => ?_⟩ + choose C hCr hC using hd ε hε hεδ + let T := Finset.univ.biUnion C + refine ⟨T,?_,?_⟩ + · have hcard : (T.card:ℝ)≤∑p : S,((C p).card:ℝ) := by + exact_mod_cast (Finset.card_biUnion_le (s := Finset.univ) (t := C)) + have hb := mul_le_mul_of_nonneg_right hcard (show 0≤α*ε/4 by positivity) + rw [Finset.sum_mul] at hb + have hsum := Finset.sum_le_sum (s:=(Finset.univ : Finset S)) (fun p _ => (hCr p).le) + have hsum' : (∑p:S,((C p).card:ℝ)*(α*ε/4))≤(S.card:ℝ)*β := by simpa using hsum + have hβeq : β*((S.card:ℝ)+1)=η := div_mul_cancel₀ η (by positivity) + exact hb.trans hsum' |>.trans_lt (by nlinarith) + · intro a ha + obtain ⟨x,hx⟩ := hleb a ha + refine ⟨transitionGraph c x.val.val,hf x.val.val x.val.property,fun q hq hqT => ?_⟩ + apply hC x q (hx hq) + intro hh + obtain ⟨z,hz⟩ := mem_iUnion.mp hh + obtain ⟨hzC,hqz⟩ := mem_iUnion.mp hz + exact hqT (mem_iUnion.mpr ⟨z,mem_iUnion.mpr ⟨Finset.mem_biUnion.mpr ⟨x,Finset.mem_univ _,hzC⟩,hqz⟩⟩) +end EuclideanFiveColor +end + +end OAI diff --git a/lean/OAI/Geometry/PlaneColoring/HoleApproximation.lean b/lean/OAI/Geometry/PlaneColoring/HoleApproximation.lean new file mode 100644 index 0000000000000000000000000000000000000000..808947d4b29895f9f151ab9749f13ec2746ce7f4 --- /dev/null +++ b/lean/OAI/Geometry/PlaneColoring/HoleApproximation.lean @@ -0,0 +1,328 @@ +import OAI.Geometry.PlaneColoring.DiskExtension + +namespace OAI + +noncomputable section +open scoped Classical +open Set Topology +namespace EuclideanFiveColor +namespace MarkedDisk +lemma radius_le_sum {S : Finset MarkedDisk} (hS : ∀d∈S,0≤d.radius) {d : MarkedDisk} (hd : d∈S) : + d.radius≤∑e∈S,e.radius := Finset.single_le_sum hS hd +lemma noncoreCost_nonneg {d : MarkedDisk} (hd : 0≤d.radius) : 0≤d.noncoreCost := by + unfold noncoreCost + split <;> positivity +lemma noncore_radius_le_sum {S : Finset MarkedDisk} (hS : ∀d∈S,0≤d.radius) + {d : MarkedDisk} (hd : d∈S) (hc : d.core=false) : d.radius≤∑e∈S,e.noncoreCost := by + have hh := Finset.single_le_sum (fun e he => noncoreCost_nonneg (hS e he)) hd + simpa [noncoreCost,hc] using hh +lemma sphere_avoids_holes {S : Finset MarkedDisk} + (hdis : (S : Set MarkedDisk).Pairwise (fun a b => Disjoint a.closedBall b.closedBall)) + {d : MarkedDisk} (hd : d∈S) {z : ℂ} (hz : z∈Metric.sphere d.center d.radius) : z∉diskHoles S := by + rintro hh + obtain ⟨e,he,hze⟩ := mem_diskHoles.mp hh + by_cases hde : d=e + · subst e + have hh' : dist z d.center ?_⟩ + have hx' : dist d.center x ⟨x,δ,true⟩) ∪ C.image (fun x => ⟨x,u,false⟩) +lemma mem_initialDisks {L C : Finset ℂ} {δ u : ℝ} {d : MarkedDisk} : + d∈initialDisks L C δ u ↔ (∃x∈L,d=⟨x,δ,true⟩) ∨ (∃x∈C,d=⟨x,u,false⟩) := by + simp [initialDisks,eq_comm] +lemma initialDisks_valid (L C : Finset ℂ) {δ u : ℝ} (hδ : 0<δ) (hu : 0 ⟨x,hx,Metric.mem_ball_self hδ⟩⟩ + · exact ⟨hu,by simp⟩ +lemma initialDisks_sum (L C : Finset ℂ) (δ u : ℝ) : + (∑d∈initialDisks L C δ u,d.radius)=(L.card:ℝ)*δ+(C.card:ℝ)*u ∧ + (∑d∈initialDisks L C δ u,d.noncoreCost)=(C.card:ℝ)*u := by + have hd : Disjoint (L.image (fun x => (⟨x,δ,true⟩ : MarkedDisk))) + (C.image (fun x => (⟨x,u,false⟩ : MarkedDisk))) := by + apply Finset.disjoint_left.mpr + intro d hd he + obtain ⟨x,hx,hxd⟩ := Finset.mem_image.mp hd + obtain ⟨y,hy,hyd⟩ := Finset.mem_image.mp he + have hh := congrArg MarkedDisk.core (hxd.trans hyd.symm) + exact Bool.noConfusion hh + have hi (r : ℝ) (b : Bool) : Function.Injective (fun x : ℂ => (⟨x,r,b⟩ : MarkedDisk)) := by + intro x y h; exact congrArg MarkedDisk.center h + simp only [initialDisks,Finset.sum_union hd] + rw [Finset.sum_image (fun x _ y _ h => hi δ true h),Finset.sum_image (fun x _ y _ h => hi u false h), + Finset.sum_image (fun x _ y _ h => hi δ true h),Finset.sum_image (fun x _ y _ h => hi u false h)] + simp [noncoreCost] +lemma initial_core_cover (L C : Finset ℂ) (δ u : ℝ) {x z : ℂ} (hx : x∈L) + (hz : z∈Metric.ball x δ) : z∈coreHoles (initialDisks L C δ u) := by + exact mem_coreHoles.mpr ⟨⟨x,δ,true⟩,mem_initialDisks.mpr (Or.inl ⟨x,hx,rfl⟩),rfl,hz⟩ +lemma initial_marked_cover (L C : Finset ℂ) (δ u : ℝ) {x z : ℂ} (hx : x∈C) + (hz : z∈Metric.ball x u) : z∈diskHoles (initialDisks L C δ u) := by + exact mem_diskHoles.mpr ⟨⟨x,u,false⟩,mem_initialDisks.mpr (Or.inr ⟨x,hx,rfl⟩),hz⟩ +lemma holes_subset_of_cover {S T : Finset MarkedDisk} + (hcov : ∀d∈S,∃e∈T,d.ball⊆e.ball ∧ (d.core=true → e.core=true)) : + diskHoles S⊆diskHoles T ∧ coreHoles S⊆coreHoles T := by + constructor + · intro z hz + obtain ⟨d,hd,hzd⟩ := mem_diskHoles.mp hz + obtain ⟨e,he,hde,_⟩ := hcov d hd + exact mem_diskHoles.mpr ⟨e,he,hde hzd⟩ + · intro z hz + obtain ⟨d,hd,hcd,hzd⟩ := mem_coreHoles.mp hz + obtain ⟨e,he,hde,hc⟩ := hcov d hd + exact mem_coreHoles.mpr ⟨e,he,hc hcd,hde hzd⟩ +end MarkedDisk +end EuclideanFiveColor +end + +noncomputable section +open scoped Classical +open Set Filter Topology MeasureTheory ContinuousMap +namespace EuclideanFiveColor +open MarkedDisk +/-- Actual small-hole maps on a fixed disk, with arbitrarily small total radii. +The core witnesses lie in the finite actual cyclic core; all other holes have been +filled by genuine tree extensions. -/ +theorem small_hole_map {c : ℂ → Fin 5} (hc : Measurable c) {α : ℝ} + (hα : 0<α) (hα' : α<1/5) (L : Finset ℂ) + (hL : ∀x∈Metric.closedBall (0:ℂ) 8,¬(transitionGraph c x).IsAcyclic → x∈L) + {t : ℝ} (ht : 00,∀ε,0<ε → ε Disjoint a.closedBall b.closedBall) ∧ + (∑d∈S,d.radius) isOpen_iUnion fun _ => Metric.isOpen_ball) + have hf : ∀x∈M,(transitionGraph c x).IsAcyclic := by + intro x hx + by_contra hn + exact hx.2 (mem_iUnion.mpr ⟨x,mem_iUnion.mpr ⟨hL x hx.1 hn,Metric.mem_ball_self hδ⟩⟩) + obtain ⟨l,hl,hcharts⟩ := compact_forest_charts hc hα hα' M hM hf + let κ := min (t/4) (l/6) + have hκ : 0<κ := lt_min (by positivity) (by positivity) + have hκt : κ≤t/4 := min_le_left _ _ + have hκl : κ≤l/6 := min_le_right _ _ + obtain ⟨e,he,hC⟩ := hcharts κ hκ + refine ⟨e,he,fun ε hε hεe => ?_⟩ + obtain ⟨C,hCr,hCv⟩ := hC ε hε hεe + let u := α*ε/4 + have hu : 0 (hS a ha).1.le) hd hdf + change (C.card:ℝ)*u<κ at hCr + linarith + have hcover := holes_subset_of_cover hcov + have hMof (z : ℂ) (hz : z∈Metric.closedBall (0:ℂ) 8) (hzS : z∉diskHoles S) : z∈M := by + refine ⟨hz,?_⟩ + intro hh + obtain ⟨x,hx⟩ := mem_iUnion.mp hh + obtain ⟨hxL,hzx⟩ := mem_iUnion.mp hx + exact hzS (hcover.1 (mem_diskHoles.mpr ⟨⟨x,δ,true⟩, + mem_initialDisks.mpr (Or.inl ⟨x,hxL,rfl⟩),hzx⟩)) + have hmarked (z : ℂ) (hz : z∉diskHoles S) : z∉⋃x∈C,Metric.ball x u := by + intro hh + obtain ⟨x,hx⟩ := mem_iUnion.mp hh + obtain ⟨hxC,hzx⟩ := mem_iUnion.mp hx + exact hz (hcover.1 (initial_marked_cover L C δ u hxC hzx)) + let f : C(ℂ,Fin 5 → ℝ) := ⟨thresholdMap c ε α,continuous_thresholdMap hc hε hα'⟩ + have hg : ∀z∈Metric.closedBall (0:ℂ) 7,z∉diskHoles S → + f z∈graphRealization (⊤ : SimpleGraph (Fin 5)) := by + intro z hz hzS + have hzM := hMof z (Metric.closedBall_subset_closedBall (by norm_num) hz) hzS + obtain ⟨G,hG,hq⟩ := hCv z hzM + exact graphRealization_mono le_top (hq z (Metric.mem_ball_self hl) (hmarked z hzS)) + have hb : ∀d∈S,d.core=false → (d.closedBall∩Metric.closedBall (0:ℂ) 7).Nonempty → + ∃G : SimpleGraph (Fin 5),G.IsAcyclic ∧ ∀z∈Metric.sphere d.center d.radius, + f z∈graphRealization G := by + intro d hd hdf hmeet + have hr := (hS d hd).1 + have hsph (z : ℂ) (hz : z∈Metric.sphere d.center d.radius) : z∈Metric.closedBall (0:ℂ) 8 := by + have hzr := sphere_norm_bound hmeet hz + have hd' := radius_le_sum (fun a ha => (hS a ha).1.le) hd + change dist z 0≤8 + linarith + obtain ⟨a,ha⟩ := (NormedSpace.sphere_nonempty (x:=d.center)).mpr hr.le + have haM := hMof a (hsph a ha) (sphere_avoids_holes hdis hd ha) + obtain ⟨G,hG,hq⟩ := hCv a haM + refine ⟨G,hG,fun z hz => hq z ?_ (hmarked z (sphere_avoids_holes hdis hd hz))⟩ + have hza : dist z a≤2*d.radius := calc + dist z a≤dist z d.center+dist d.center a := dist_triangle _ _ _ + _ = 2*d.radius := by + have hz' : dist z d.center=d.radius := hz + have ha' : dist d.center a=d.radius := by simpa only [Metric.mem_sphere,dist_comm] using ha + rw [hz',ha']; ring + exact hza.trans_lt (hnrad d hd hdf) + obtain ⟨g,hg'⟩ := fill_noncore_disks (Metric.closedBall (0:ℂ) 7) S + (fun d hd => (hS d hd).1) hdis f hg hb + exact ⟨S,hS,hdis,htot,g,hg'⟩ +end EuclideanFiveColor +end + +noncomputable section +open scoped Classical ENNReal +open Set Filter Topology MeasureTheory +namespace EuclideanFiveColor +/-- Exception annuli for exact unit distances from the small closed disks. -/ +def diskAnnulus (d : MarkedDisk) : Set ℂ := + Metric.closedBall d.center (1+d.radius) \ Metric.ball d.center (1-d.radius) +def holeAnnuli (S : Finset MarkedDisk) : Set ℂ := ⋃d∈S,diskAnnulus d +lemma diskAnnulus_measurable (d : MarkedDisk) : MeasurableSet (diskAnnulus d) := + Metric.isClosed_closedBall.measurableSet.diff Metric.isOpen_ball.measurableSet +lemma unit_from_disk_mem_annulus {d : MarkedDisk} {z q : ℂ} + (hq : q∈d.closedBall) (hzq : dist z q=1) : z∈diskAnnulus d := by + have hq' : dist q d.center≤d.radius := hq + constructor + · change dist z d.center≤1+d.radius + exact (dist_triangle z q d.center).trans (by linarith) + · change ¬ dist z d.center<1-d.radius + have hh := dist_triangle z d.center q + rw [dist_comm d.center q,hzq] at hh + linarith +lemma volume_diskAnnulus {d : MarkedDisk} (h0 : 0≤d.radius) (h1 : d.radius≤1) : + volume (diskAnnulus d)=ENNReal.ofReal (4*Real.pi*d.radius) := by + have hsub : Metric.ball d.center (1-d.radius)⊆Metric.closedBall d.center (1+d.radius) := + Metric.ball_subset_closedBall.trans (Metric.closedBall_subset_closedBall (by linarith)) + have hvol (r : ℝ) (hr : 0≤r) : ENNReal.ofReal r ^ 2 * (NNReal.pi : ℝ≥0∞)=ENNReal.ofReal (r^2*Real.pi) := by + rw [ENNReal.ofReal_mul (sq_nonneg r),ENNReal.ofReal_pow hr] + congr 1 + rw [←NNReal.coe_real_pi,ENNReal.ofReal_coe_nnreal] + rw [diskAnnulus,measure_sdiff hsub Metric.isOpen_ball.measurableSet.nullMeasurableSet (by finiteness), + Complex.volume_closedBall,Complex.volume_ball,hvol _ (by linarith),hvol _ (by linarith), + ←ENNReal.ofReal_sub _ (by positivity : 0≤(1-d.radius)^2*Real.pi)] + congr 1 + ring + +lemma volume_holeAnnuli_le {S : Finset MarkedDisk} + (hS : ∀d∈S,0≤d.radius ∧ d.radius≤1) : + volume (holeAnnuli S)≤ENNReal.ofReal (4*Real.pi*(∑d∈S,d.radius)) := by + calc + volume (holeAnnuli S)≤∑d∈S,volume (diskAnnulus d) := measure_biUnion_finset_le S _ + _ = ∑d∈S,ENNReal.ofReal (4*Real.pi*d.radius) := by + apply Finset.sum_congr rfl + intro d hd + exact volume_diskAnnulus (hS d hd).1 (hS d hd).2 + _ = ENNReal.ofReal (∑d∈S,4*Real.pi*d.radius) := by + rw [ENNReal.ofReal_sum_of_nonneg (fun d hd => mul_nonneg (by positivity) (hS d hd).1)] + _ = ENNReal.ofReal (4*Real.pi*(∑d∈S,d.radius)) := by rw [Finset.mul_sum] +lemma unit_from_hole_mem_annuli {S : Finset MarkedDisk} {z q : ℂ} + (hq : q∈diskHoles S) (hzq : dist z q=1) : z∈holeAnnuli S := by + obtain ⟨d,hd,hqd⟩ := mem_diskHoles.mp hq + exact mem_iUnion.mpr ⟨d,mem_iUnion.mpr ⟨hd,unit_from_disk_mem_annulus (Metric.ball_subset_closedBall hqd) hzq⟩⟩ +lemma holeAnnuli_tendsto_zero (S : ℕ → Finset MarkedDisk) + (hS : ∀n d,d∈S n → 0≤d.radius) + (hlim : Tendsto (fun n => ∑d∈S n,d.radius) atTop (𝓝 0)) : + Tendsto (fun n => volume (holeAnnuli (S n))) atTop (𝓝 0) := by + have hsmall : ∀ᶠ n in atTop,(∑d∈S n,d.radius)≤1 := + hlim.eventually (eventually_le_nhds (by norm_num : (0:ℝ)<1)) + have hbound : ∀ᶠ n in atTop,volume (holeAnnuli (S n))≤ENNReal.ofReal (4*Real.pi*(∑d∈S n,d.radius)) := by + filter_upwards [hsmall] with n hn + apply volume_holeAnnuli_le + exact fun d hd => ⟨hS n d hd,(MarkedDisk.radius_le_sum (hS n) hd).trans hn⟩ + have ht : Tendsto (fun n => ENNReal.ofReal (4*Real.pi*(∑d∈S n,d.radius))) atTop (𝓝 0) := by + simpa [Function.comp_def] using ENNReal.continuous_ofReal.continuousAt.tendsto.comp (hlim.const_mul (4*Real.pi)) + apply ENNReal.tendsto_nhds_zero.mpr + intro a ha + filter_upwards [hbound,ENNReal.tendsto_nhds_zero.mp ht a ha] with n hn hn' + exact hn.trans hn' +end EuclideanFiveColor +end + +noncomputable section +open scoped Classical +open Set Filter Topology MeasureTheory ContinuousMap +namespace EuclideanFiveColor +/-- Data actually constructed by the small-hole lemma. -/ +structure HoleApprox (c : ℂ → Fin 5) (α : ℝ) (L : Finset ℂ) (t : ℝ) where + ε : ℝ + ε_pos : 0<ε + ε_lt : ε Disjoint a.closedBall b.closedBall) + sum_lt : (∑d∈disks,d.radius) (a.valid e he).1.le) hd + exact mem_iUnion.mpr ⟨x,mem_iUnion.mpr ⟨hx, + Metric.ball_subset_ball (by linarith [a.sum_lt]) (hsub (Metric.ball_subset_closedBall hzd))⟩⟩ +lemma ε_tendsto {c : ℂ → Fin 5} {α : ℝ} {L : Finset ℂ} {t : ℕ → ℝ} + (a : ∀n,HoleApprox c α L (t n)) (ht : Tendsto t atTop (𝓝 0)) : + Tendsto (fun n => (a n).ε) atTop (𝓝 0) := + squeeze_zero (fun n => (a n).ε_pos.le) (fun n => (a n).ε_lt.le) ht +lemma sum_tendsto {c : ℂ → Fin 5} {α : ℝ} {L : Finset ℂ} {t : ℕ → ℝ} + (a : ∀n,HoleApprox c α L (t n)) (ht : Tendsto t atTop (𝓝 0)) : + Tendsto (fun n => ∑d∈(a n).disks,d.radius) atTop (𝓝 0) := + squeeze_zero (fun n => Finset.sum_nonneg fun d hd => ((a n).valid d hd).1.le) + (fun n => (a n).sum_lt.le) ht +lemma annuli_tendsto {c : ℂ → Fin 5} {α : ℝ} {L : Finset ℂ} {t : ℕ → ℝ} + (a : ∀n,HoleApprox c α L (t n)) (ht : Tendsto t atTop (𝓝 0)) : + Tendsto (fun n => volume (holeAnnuli (a n).disks)) atTop (𝓝 0) := + holeAnnuli_tendsto_zero _ (fun n d hd => ((a n).valid d hd).1.le) (sum_tendsto a ht) +end HoleApprox +end EuclideanFiveColor +end + +end OAI diff --git a/lean/OAI/Geometry/PlaneColoring/Interfaces.lean b/lean/OAI/Geometry/PlaneColoring/Interfaces.lean new file mode 100644 index 0000000000000000000000000000000000000000..f3c7964fd9178a2d1bb39330f0bdb25380b1c078 --- /dev/null +++ b/lean/OAI/Geometry/PlaneColoring/Interfaces.lean @@ -0,0 +1,527 @@ +import OAI.Geometry.PlaneColoring.AngularBoundary + +namespace OAI + +noncomputable section +open Set +namespace EuclideanFiveColor +/-- The four cyclic edges, with outsider label `4`. This definition is local to +this interface argument and agrees extensionally with `fourEdge`. -/ +def interfaceFourEdge (i : Fin 4) : Finset (Fin 5) := + if i=0 then {0,1} else if i=1 then {1,2} else if i=2 then {2,3} else {3,0} +def interfaceFourAllowed (s : Fin 4 → Bool) (b : Bool) : Finset (Fin 5) := + Finset.univ.filter fun j => ∀i, s i=b → j∉interfaceFourEdge i +def InterfaceFourCompatible (s : Fin 4 → Bool) (p : Finset (Fin 5)) : Prop := + p.Nonempty ∧ p.card≤2 ∧ + (p∩interfaceFourAllowed s true).Nonempty ∧ (p∩interfaceFourAllowed s false).Nonempty +def InterfaceFourSplit (s : Fin 4 → Bool) : Prop := s 0≠s 2 ∧ s 1≠s 3 +def interfaceFourDiagonal (s : Fin 4 → Bool) : Fin 3 := if s 0=s 1 then 2 else 1 +lemma interface_four_not_edge : ∀s : Fin 4 → Bool, ∀p : Finset (Fin 5), + InterfaceFourCompatible s p → ∀i, ¬p⊆interfaceFourEdge i := by + unfold InterfaceFourCompatible interfaceFourAllowed + decide +lemma interface_four_split : ∀s : Fin 4 → Bool, ∀p : Finset (Fin 5), + InterfaceFourCompatible s p → 4∉p → InterfaceFourSplit s ∧ + (if 4∈p then (0:Fin 3) else if 0∈p then 1 else 2)=interfaceFourDiagonal s := by + unfold InterfaceFourCompatible InterfaceFourSplit interfaceFourAllowed interfaceFourDiagonal + decide +lemma interface_four_split_neg (s : Fin 4 → Bool) : + InterfaceFourSplit (fun i => !(s i)) ↔ InterfaceFourSplit s := by + simp [InterfaceFourSplit] +lemma interface_four_diagonal_neg (s : Fin 4 → Bool) : + interfaceFourDiagonal (fun i => !(s i))=interfaceFourDiagonal s := by + simp [interfaceFourDiagonal] +lemma interface_four_diagonal_ne_zero (s : Fin 4 → Bool) : interfaceFourDiagonal s≠0 := by + unfold interfaceFourDiagonal + split <;> decide +lemma interface_four_split_no_opposite : ∀s : Fin 4 → Bool, + InterfaceFourSplit s → ∀i,¬(s i=true ∧ s (i+2)=true) := by + unfold InterfaceFourSplit + decide +end EuclideanFiveColor +end + +noncomputable section +open Set Filter Topology MeasureTheory +open scoped RealInnerProductSpace +namespace EuclideanFiveColor +def fourInterfaceSign (v : Fin 4 → ℂ) (t : Angles) (i : Fin 4) : Bool := + decide (0<⟪direction t,v i⟫) +lemma interfaceFourEdge_eq (i : Fin 4) : interfaceFourEdge i=fourEdge i := rfl +lemma fourInterfaceSign_opposite {v : Fin 4 → ℂ} {t : Angles} + (hn : ∀i,⟪direction t,v i⟫≠0) : + fourInterfaceSign v (t+(Real.pi : Angles))=fun i => !(fourInterfaceSign v t i) := by + funext i + simp only [fourInterfaceSign,direction_add_pi,inner_neg_left] + by_cases hi : 0<⟪direction t,v i⟫ + · simp only [hi,show ¬0< -⟪direction t,v i⟫ by linarith,decide_true,decide_false,Bool.not_true] + · have hneg : ⟪direction t,v i⟫<0 := lt_of_le_of_ne (le_of_not_gt hi) (hn i) + simp only [hi,show 0< -⟪direction t,v i⟫ by linarith,decide_true,decide_false,Bool.not_false] +variable {c : ℂ → Fin 5} (hc : Measurable c) +lemma four_interface_compatible (hw : WeakColoring 5 c) {x : ℂ} + {K : Fin 4 → Set ℂ} {v : Fin 4 → ℂ} (hv : ∀i,‖v i‖=1) + (hK : ∀i,ApproachingContinuum x (K i) (v i)) + (hH : ∀i,∀j∈fourEdge i,Disjoint (spatialSupport c j) (Straddle (K i))) : + ∀ᵐt∂angularMeasure,InterfaceFourCompatible (fourInterfaceSign v t) (palette c hc x t) := by + classical + let E (s : Fin 4 → Bool) (b : Bool) : Finset (Fin 4) := Finset.univ.filter fun i => s i=b + have hex := finite_support_exclusion_ae c hc K fourEdge hH + have hJ (s : Fin 4 → Bool) (b : Bool) : + ∀ᵐz : ℂ∂volume,(∀i∈E s b,z∈Straddle (K i)) → c z∈interfaceFourAllowed s b := by + filter_upwards [hex] with z hz hzE + simp only [interfaceFourAllowed,Finset.mem_filter,Finset.mem_univ,true_and] + intro i hi + exact hz i (hzE i (Finset.mem_filter.mpr ⟨Finset.mem_univ _,hi⟩)) + have hout (s : Fin 4 → Bool) := continuum_outer_restriction c hc (E s true) hK (hJ s true) + have hin (s : Fin 4 → Bool) := continuum_inner_restriction c hc (E s false) hK (hJ s false) + filter_upwards [ae_all_iff.mpr hout,ae_all_iff.mpr hin,palette_nonempty c hc x, + palette_cardinality c hc hw x,ae_all_iff.mpr (fun i => ae_direction_nonorthogonal (hv i))] + with t ho hi hp hcard hn + refine ⟨hp,hcard.2,ho (fourInterfaceSign v t) ?_,hi (fourInterfaceSign v t) ?_⟩ + · intro i hi + exact of_decide_eq_true (Finset.mem_filter.mp hi).2 + · intro i hi + have hn' : ¬0<⟪direction t,v i⟫ := of_decide_eq_false (Finset.mem_filter.mp hi).2 + exact lt_of_le_of_ne (le_of_not_gt hn') (hn i) +lemma four_interface_admissible {x : ℂ} {v : Fin 4 → ℂ} + (h : ∀ᵐt∂angularMeasure,InterfaceFourCompatible (fourInterfaceSign v t) (palette c hc x t)) : + ∀ᵐt∂angularMeasure,FourAdmissible (palette c hc x t) := by + filter_upwards [h] with t ht + exact ⟨ht.1,ht.2.1,interface_four_not_edge _ _ ht⟩ +lemma four_state_group_of_admissible {x : ℂ} + (h : ∀ᵐt∂angularMeasure,FourAdmissible (palette c hc x t)) : + ∀ᵐt∂angularMeasure,fourGroup (fourState c hc x t)⊆palette c hc x t := + h.mono fun _ ht => four_admissible_group _ ht +lemma four_state_represents_of_group {x : ℂ} + (hg : ∀ᵐt∂angularMeasure,fourGroup (fourState c hc x t)⊆palette c hc x t) + (s : Fin 3) : + RealState hc x {t : ℝ | fourState c hc x (t : Angles)=s} (fourGroup s) := by + refine ⟨measurableSet_eq_fun ((fourState_measurable c hc x).comp angleMk_quasiMeasurePreserving.measurable) measurable_const,?_⟩ + intro i hi + filter_upwards [angleMk_quasiMeasurePreserving.ae hg] with t ht hts + change fourState c hc x (t : Angles)=s at hts + exact (mem_palette c hc x (t : Angles) i).mp (ht (by simpa only [hts] using hi)) +lemma four_state_changes_of_group (hw : WeakColoring 5 c) {x : ℂ} + (hg : ∀ᵐt∂angularMeasure,fourGroup (fourState c hc x t)⊆palette c hc x t) : + ∀ᵐt∂angularMeasure,fourState c hc x t≠fourState c hc x (t+(sixty : Angles)) := by + filter_upwards [hg,(measurePreserving_add_right angularMeasure (sixty : Angles)).quasiMeasurePreserving.ae hg, + palette_sixty_disjoint c hc hw x] with t ht hu hd he + obtain ⟨i,hi⟩ := fourGroup_nonempty (fourState c hc x t) + exact Finset.disjoint_left.mp hd (ht hi) (hu (by simpa only [he] using hi)) +lemma four_state_diagonal_positive_of_group (hw : WeakColoring 5 c) {x : ℂ} + (hg : ∀ᵐt∂angularMeasure,fourGroup (fourState c hc x t)⊆palette c hc x t) + (s : Fin 3) (hs : s≠0) : 0 if fourState c hc x t=0 then false else true + have hf : Measurable f := Measurable.ite + (measurableSet_eq_fun (fourState_measurable c hc x) measurable_const) measurable_const measurable_const + have hrep (v : Bool) : RealState hc x {t : ℝ | f (t : Angles)=v} (if v then fourGroup r else fourGroup 0) := by + refine ⟨measurableSet_eq_fun (hf.comp angleMk_quasiMeasurePreserving.measurable) measurable_const,?_⟩ + intro i hi + filter_upwards [angleMk_quasiMeasurePreserving.ae hg,angleMk_quasiMeasurePreserving.ae hnot] + with t ht htn htv + change f (t : Angles)=v at htv + apply (mem_palette c hc x (t : Angles) i).mp + apply ht + cases v + · have hz : fourState c hc x (t : Angles)=0 := by simpa [f] using htv + simpa only [hz,Bool.false_eq_true,ite_false] using hi + · have hz : fourState c hc x (t : Angles)=r := hr.2.2 _ (by simpa [f] using htv) htn + simpa only [hz,ite_true] using hi + have hcard : (Finset.univ\(fourGroup 0∪fourGroup r)).card≤2 := by + exact (show ∀s : Fin 3,s≠0 → (Finset.univ\(fourGroup 0∪fourGroup (if s=1 then 2 else 1))).card≤2 from by decide) s hs + apply two_state_impossible hc hw x (fourGroup 0) (fourGroup r) hcard f hf (hrep false) (hrep true) + filter_upwards [hnot,(measurePreserving_add_right angularMeasure (sixty : Angles)).quasiMeasurePreserving.ae hnot, + four_state_changes_of_group hc hw hg] with t ht hu hne + exact three_exclude_flip _ _ s hs ht hu hne +lemma four_interface_state_rule {x : ℂ} {v : Fin 4 → ℂ} + (h : ∀ᵐt∂angularMeasure,InterfaceFourCompatible (fourInterfaceSign v t) (palette c hc x t)) : + ∀ᵐt∂angularMeasure,fourState c hc x t≠0 → + InterfaceFourSplit (fourInterfaceSign v t) ∧ fourState c hc x t=interfaceFourDiagonal (fourInterfaceSign v t) := by + filter_upwards [h] with t ht hn + have ho : 4∉palette c hc x t := by + intro ho + exact hn (by simp only [fourState,fourCanonical,ho,ite_true]) + exact interface_four_split _ _ ht ho +end EuclideanFiveColor +end + +noncomputable section +open Set Filter Topology MeasureTheory +namespace EuclideanFiveColor +lemma angle_state_preimage_positive {A : Set Angles} (hA : MeasurableSet A) (hp : 0 simp only [Complex.sub_re,Complex.sub_im,Complex.add_re,Complex.add_im, + Complex.mul_re,Complex.mul_im,Complex.ofReal_re,Complex.ofReal_im,Complex.I_re,Complex.I_im, + Real.cos_add,Real.cos_sub,Real.sin_add,Real.sin_sub,sixty,Real.cos_pi_div_three] <;> ring + rw [he] + exact Circle.norm_coe _ +lemma compact_no_unit_margin {F : Set Angles} (hF : IsCompact F) + (hu : ∀t∈F,∀u∈F,‖direction t-direction u‖≠1) : + ∃ε : ℝ,0<ε ∧ ∀t∈F,∀u,dist t u<ε → u+(sixty : Angles)∉F ∧ u-(sixty : Angles)∉F := by + let T : Set Angles := {u | u+(sixty : Angles)∉F ∧ u-(sixty : Angles)∉F} + have ho : IsOpen T := (hF.isClosed.isOpen_compl.preimage (continuous_id.add_const _)).inter + (hF.isClosed.isOpen_compl.preimage (continuous_id.sub continuous_const)) + have hs : F⊆T := by + intro t ht + refine ⟨fun hh => hu t ht _ hh (direction_sixty_unit t),fun hh => ?_⟩ + apply hu (t-(sixty : Angles)) hh t ht + simpa only [sub_add_cancel] using direction_sixty_unit (t-(sixty : Angles)) + obtain ⟨ε,hε,hsub⟩ := hF.exists_thickening_subset_open ho hs + exact ⟨ε,hε,fun t ht u htu => hsub (Metric.mem_thickening_iff.mpr ⟨t,ht,by simpa only [dist_comm] using htu⟩)⟩ + +variable {c : ℂ → Fin 5} (hc : Measurable c) +def interfaceStateSet (x : ℂ) (s : Fin 3) : Set Angles := {t | fourState c hc x t=s} +def interfaceStateSupport (x : ℂ) (s : Fin 3) : Set Angles := + (angularMeasure.restrict (interfaceStateSet hc x s)).support +lemma interfaceStateSet_measurable (x : ℂ) (s : Fin 3) : MeasurableSet (interfaceStateSet hc x s) := + measurableSet_eq_fun (fourState_measurable c hc x) measurable_const +lemma interfaceStateSupport_ae (x : ℂ) : + ∀ᵐt∂angularMeasure,∀s : Fin 3,fourState c hc x t=s → t∈interfaceStateSupport hc x s := by + apply ae_all_iff.mpr + intro s + exact (ae_restrict_iff' (interfaceStateSet_measurable hc x s)).mp Measure.support_mem_ae +lemma interfaceStateSupport_no_unit (hw : WeakColoring 5 c) {x : ℂ} + (hg : ∀ᵐt∂angularMeasure,fourGroup (fourState c hc x t)⊆palette c hc x t) + {s : Fin 3} (hs : s≠0) {t u : Angles} + (ht : t∈interfaceStateSupport hc x s) (hu : u∈interfaceStateSupport hc x s) : + ‖direction t-direction u‖≠1 := by + let r : Fin 3 := if s=1 then 2 else 1 + have hr : r≠0 := by dsimp [r]; split <;> decide + have hl : ∀i : Fin 5,i∉fourGroup r∪fourGroup s ↔ i=4 := by + exact (show ∀s : Fin 3,s≠0 → ∀i : Fin 5,i∉fourGroup (if s=1 then 2 else 1)∪fourGroup s ↔ i=4 from by decide) s hs + obtain ⟨b,rfl,hb⟩ := angle_support_lift (interfaceStateSet_measurable hc x s) ht + obtain ⟨d,rfl,hd⟩ := angle_support_lift (interfaceStateSet_measurable hc x s) hu + exact strict_state_no_unit_support hc hw hl (four_state_represents_of_group hc hg r) + (four_state_represents_of_group hc hg s) + (angle_state_preimage_positive (interfaceStateSet_measurable hc x r) + (four_state_diagonal_positive_of_group hc hw hg r hr)) hb hd +lemma interfaceStateSupport_margin (hw : WeakColoring 5 c) {x : ℂ} + (hg : ∀ᵐt∂angularMeasure,fourGroup (fourState c hc x t)⊆palette c hc x t) : + ∃ε : ℝ,0<ε ∧ ∀s : Fin 3,s≠0 → ∀t∈interfaceStateSupport hc x s,∀u,dist t u<ε → + u+(sixty : Angles)∉interfaceStateSupport hc x s ∧ u-(sixty : Angles)∉interfaceStateSupport hc x s := by + have h (s : Fin 3) (hs : s≠0) := compact_no_unit_margin + (show IsCompact (interfaceStateSupport hc x s) from Measure.isClosed_support.isCompact) + (fun t ht u hu => interfaceStateSupport_no_unit hc hw hg hs ht hu) + obtain ⟨ε₁,hε₁,h₁⟩ := h 1 (by decide) + obtain ⟨ε₂,hε₂,h₂⟩ := h 2 (by decide) + refine ⟨min ε₁ ε₂,lt_min hε₁ hε₂,?_⟩ + intro s hs t ht u htu + fin_cases s + · exact (hs rfl).elim + · exact h₁ t ht u (htu.trans_le (min_le_left _ _)) + · exact h₂ t ht u (htu.trans_le (min_le_right _ _)) +end EuclideanFiveColor +end + +noncomputable section +open Set Filter Topology MeasureTheory +open scoped RealInnerProductSpace +namespace EuclideanFiveColor +lemma four_diagonal_product_neg {v : Fin 4 → ℂ} {t : Angles} + (hn : ∀i,⟪direction t,v i⟫≠0) (hd : interfaceFourDiagonal (fourInterfaceSign v t)=1) : + ⟪direction t,v 0⟫*⟪direction t,v 1⟫<0 := by + by_cases h0 : 0<⟪direction t,v 0⟫ <;> by_cases h1 : 0<⟪direction t,v 1⟫ + · simp only [interfaceFourDiagonal,fourInterfaceSign,h0,h1] at hd + norm_num at hd + · exact mul_neg_of_pos_of_neg h0 (lt_of_le_of_ne (le_of_not_gt h1) (hn 1)) + · exact mul_neg_of_neg_of_pos (lt_of_le_of_ne (le_of_not_gt h0) (hn 0)) h1 + · simp only [interfaceFourDiagonal,fourInterfaceSign,h0,h1] at hd + norm_num at hd +lemma four_diagonal_product_pos {v : Fin 4 → ℂ} {t : Angles} + (hn : ∀i,⟪direction t,v i⟫≠0) (hd : interfaceFourDiagonal (fourInterfaceSign v t)=2) : + 0<⟪direction t,v 0⟫*⟪direction t,v 1⟫ := by + by_cases h0 : 0<⟪direction t,v 0⟫ <;> by_cases h1 : 0<⟪direction t,v 1⟫ + · exact mul_pos h0 h1 + · simp only [interfaceFourDiagonal,fourInterfaceSign,h0,h1,decide_true,decide_false] at hd + norm_num at hd + · simp only [interfaceFourDiagonal,fourInterfaceSign,h0,h1,decide_true,decide_false] at hd + norm_num at hd + · exact mul_pos_of_neg_of_neg (lt_of_le_of_ne (le_of_not_gt h0) (hn 0)) + (lt_of_le_of_ne (le_of_not_gt h1) (hn 1)) +lemma four_diagonal_orbit_half {v : Fin 4 → ℂ} {t : Angles} {j : Fin 6} + (hn : ∀i,⟪direction (t+sixAngle j),v i⟫≠0) : + interfaceFourDiagonal (fourInterfaceSign v (t+sixAngle (j+3)))= + interfaceFourDiagonal (fourInterfaceSign v (t+sixAngle j)) := by + rw [sixAngle_half,← add_assoc,fourInterfaceSign_opposite hn,interface_four_diagonal_neg] +lemma four_diagonal_uniform_of_parity {v : Fin 4 → ℂ} {t : Angles} {a : Fin 3} {p : Fin 2} + (hn : ∀j i,⟪direction (t+sixAngle j),v i⟫≠0) + (hd : ∀j : Fin 6,j.val%2≠p.val → interfaceFourDiagonal (fourInterfaceSign v (t+sixAngle j))=a) : + ∀j : Fin 6,interfaceFourDiagonal (fourInterfaceSign v (t+sixAngle j))=a := by + intro j + by_cases hj : j.val%2≠p.val + · exact hd j hj + have hh : (j+3).val%2≠p.val := by + have h : ∀p : Fin 2,∀j : Fin 6,¬j.val%2≠p.val → (j+3).val%2≠p.val := by decide + exact h p j hj + rw [← four_diagonal_orbit_half (hn j)] + exact hd (j+3) hh +lemma four_uniform_diagonal_one {v : Fin 4 → ℂ} {t : Angles} + (hn : ∀j i,⟪direction (t+sixAngle j),v i⟫≠0) + (hd : ∀j : Fin 6,interfaceFourDiagonal (fourInterfaceSign v (t+sixAngle j))=1) : + ⟪v 0,v 1⟫<0 := by + have h0 := four_diagonal_product_neg (hn 0) (hd 0) + have h1 := four_diagonal_product_neg (hn 1) (hd 1) + have h2 := four_diagonal_product_neg (hn 2) (hd 2) + norm_num only [sixAngle,Fin.val_zero,Fin.val_one,Fin.val_two,zero_nsmul,one_nsmul,add_zero] at h0 h1 h2 + have hm := three_direction_moment t (v 0) (v 1) + linarith +lemma four_uniform_diagonal_two {v : Fin 4 → ℂ} {t : Angles} + (hn : ∀j i,⟪direction (t+sixAngle j),v i⟫≠0) + (hd : ∀j : Fin 6,interfaceFourDiagonal (fourInterfaceSign v (t+sixAngle j))=2) : + 0<⟪v 0,v 1⟫ := by + have h0 := four_diagonal_product_pos (hn 0) (hd 0) + have h1 := four_diagonal_product_pos (hn 1) (hd 1) + have h2 := four_diagonal_product_pos (hn 2) (hd 2) + norm_num only [sixAngle,Fin.val_zero,Fin.val_one,Fin.val_two,zero_nsmul,one_nsmul,add_zero] at h0 h1 h2 + have hm := three_direction_moment t (v 0) (v 1) + linarith +/-- The three-direction quadratic moment replaces the source's projective arc +length argument. No assumption about antipodal ray pairs or the collinear case +is required: two opposite uniform diagonal triples are already contradictory. -/ +lemma four_opposite_uniform_diagonals_false {v : Fin 4 → ℂ} {t u : Angles} + (hnt : ∀j i,⟪direction (t+sixAngle j),v i⟫≠0) + (hnu : ∀j i,⟪direction (u+sixAngle j),v i⟫≠0) + {a b : Fin 3} (ha : a≠0) (hb : b≠0) (hab : a≠b) + (hdt : ∀j : Fin 6,interfaceFourDiagonal (fourInterfaceSign v (t+sixAngle j))=a) + (hdu : ∀j : Fin 6,interfaceFourDiagonal (fourInterfaceSign v (u+sixAngle j))=b) : False := by + have hab' : (a=1 ∧ b=2) ∨ (a=2 ∧ b=1) := + (show ∀a b : Fin 3,a≠0 → b≠0 → a≠b → (a=1 ∧ b=2) ∨ (a=2 ∧ b=1) from by decide) a b ha hb hab + rcases hab' with ⟨rfl,rfl⟩|⟨rfl,rfl⟩ + · exact (four_uniform_diagonal_one hnt hdt).not_gt (four_uniform_diagonal_two hnu hdu) + · exact (four_uniform_diagonal_one hnu hdu).not_gt (four_uniform_diagonal_two hnt hdt) +end EuclideanFiveColor +end + +noncomputable section +open Set Filter Topology MeasureTheory +open scoped RealInnerProductSpace +namespace EuclideanFiveColor +lemma sixAngle_prev (j : Fin 6) : sixAngle (j-1)=sixAngle j-(sixty : Angles) := by + have h := sixAngle_step (j-1) + simpa only [sub_add_cancel] using eq_sub_iff_add_eq.mpr h.symm +variable {c : ℂ → Fin 5} (hc : Measurable c) +def fourInterfaceWord (x : ℂ) (t : Angles) (j : Fin 6) : Fin 3 := + fourState c hc x (t+sixAngle j) +lemma fourInterfaceWord_shift (x : ℂ) (t : Angles) (j : Fin 6) : + fourInterfaceWord hc x (t+(sixty : Angles)) j=fourInterfaceWord hc x t (j+1) := by + simp only [fourInterfaceWord,sixAngle_step] + congr 1 + abel +/-- Construction of the dense conull shift-invariant set and its actual +six-position words, from the previously established genuine state system. -/ +lemma four_interface_word_data (hw : WeakColoring 5 c) {x : ℂ} {v : Fin 4 → ℂ} + (hv : ∀i,‖v i‖=1) + (hcompat : ∀ᵐt∂angularMeasure,InterfaceFourCompatible (fourInterfaceSign v t) (palette c hc x t)) : + ∃G : Set Angles,Dense G ∧ (∀t∈G,t+(sixty : Angles)∈G) ∧ + (∀t∈G,∀j i,⟪direction (t+sixAngle j),v i⟫≠0) ∧ + (∀t∈G,∀j,fourInterfaceWord hc x t j≠0 → fourInterfaceWord hc x t j= + interfaceFourDiagonal (fourInterfaceSign v (t+sixAngle j))) ∧ + (∀t∈G,FourWordValid (fourInterfaceWord hc x t)) ∧ + ∃ε : ℝ,0<ε ∧ ∀t∈G,∀u∈G,dist t u<ε → + FourWordCross (fourInterfaceWord hc x t) (fourInterfaceWord hc x u) := by + have hg := four_state_group_of_admissible hc (four_interface_admissible hc hcompat) + obtain ⟨ε,hε,hmargin⟩ := interfaceStateSupport_margin hc hw hg + let Q (t : Angles) : Prop := (∀i,⟪direction t,v i⟫≠0) ∧ + (fourState c hc x t≠0 → fourState c hc x t=interfaceFourDiagonal (fourInterfaceSign v t)) ∧ + fourState c hc x t≠fourState c hc x (t+(sixty : Angles)) ∧ + ∀s : Fin 3,fourState c hc x t=s → t∈interfaceStateSupport hc x s + have hQ : ∀ᵐt∂angularMeasure,Q t := by + filter_upwards [ae_all_iff.mpr (fun i => ae_direction_nonorthogonal (hv i)), + four_interface_state_rule hc hcompat,four_state_changes_of_group hc hw hg, + interfaceStateSupport_ae hc x] with t hn hr hs hF + exact ⟨hn,fun h => (hr h).2,hs,hF⟩ + let G : Set Angles := {t | ∀j : Fin 6,Q (t+sixAngle j)} + have hGae : ∀ᵐt∂angularMeasure,t∈G := ae_all_iff.mpr fun j => + (measurePreserving_add_right angularMeasure (sixAngle j)).quasiMeasurePreserving.ae hQ + have hGshift : ∀t∈G,t+(sixty : Angles)∈G := by + intro t ht j + have he : t+(sixty : Angles)+sixAngle j=t+sixAngle (j+1) := by + rw [sixAngle_step] + abel + rw [he] + exact ht (j+1) + refine ⟨G,Measure.dense_of_ae hGae,hGshift,fun t ht j => (ht j).1,fun t ht j => (ht j).2.1,?_,ε,hε,?_⟩ + · intro t ht + refine ⟨?_,?_⟩ + · intro j + simpa only [fourInterfaceWord,sixAngle_step,← add_assoc] using (ht j).2.2.1 + · intro j hj hj3 + dsimp only [fourInterfaceWord] + rw [(ht (j+3)).2.1 hj3,(ht j).2.1 hj] + exact four_diagonal_orbit_half (ht j).1 + · intro t ht u hu htu j hj + have hm := hmargin (fourInterfaceWord hc x t j) hj (t+sixAngle j) + ((ht j).2.2.2 _ rfl) (u+sixAngle j) (by simpa only [dist_add_right] using htu) + constructor + · intro he + apply hm.1 + have hh := (hu (j+1)).2.2.2 _ he + simpa only [sixAngle_step,← add_assoc] using hh + · intro he + apply hm.2 + have hh := (hu (j-1)).2.2.2 _ he + simpa only [sixAngle_prev,add_sub_assoc] using hh +end EuclideanFiveColor +end + +noncomputable section +open Set Filter Topology MeasureTheory +open scoped RealInnerProductSpace +namespace EuclideanFiveColor +lemma four_word_opposite_geometry_false {v : Fin 4 → ℂ} {t u : Angles} + {w z : Fin 6 → Fin 3} (hw : FourWordValid w) (hz : FourWordValid z) + (hzero : ∀j,w j=0 → j.val%2=0) (hzero' : ∀j,z j=0 → j.val%2=1) + (hcross : FourWordCross w z) + (hnt : ∀j i,⟪direction (t+sixAngle j),v i⟫≠0) + (hnu : ∀j i,⟪direction (u+sixAngle j),v i⟫≠0) + (hdt : ∀j,w j≠0 → w j=interfaceFourDiagonal (fourInterfaceSign v (t+sixAngle j))) + (hdu : ∀j,z j≠0 → z j=interfaceFourDiagonal (fourInterfaceSign v (u+sixAngle j))) : False := by + obtain ⟨a,b,ha,hb,hab,hwa,hzb⟩ := four_word_opposite_parity w hw hzero z hz hzero' hcross + apply four_opposite_uniform_diagonals_false hnt hnu ha hb hab + · apply four_diagonal_uniform_of_parity (p:=0) hnt + intro j hj + have hh := hwa j (by norm_num only [Fin.val_zero] at hj; omega) + exact (hdt j (fun h => ha (hh.symm.trans h))).symm.trans hh + · apply four_diagonal_uniform_of_parity (p:=1) hnu + intro j hj + have hh := hzb j (by norm_num only [Fin.val_one] at hj; omega) + exact (hdu j (fun h => hb (hh.symm.trans h))).symm.trans hh + +lemma no_four_word_geometry (v : Fin 4 → ℂ) (G : Set Angles) (hG : Dense G) + (w : Angles → Fin 6 → Fin 3) (hw : ∀t∈G,FourWordValid (w t)) + (hshiftG : ∀t∈G,t+(sixty : Angles)∈G) + (hshift : ∀t∈G,∀j,w (t+(sixty : Angles)) j=w t (j+1)) + (hn : ∀t∈G,∀j i,⟪direction (t+sixAngle j),v i⟫≠0) + (hd : ∀t∈G,∀j,w t j≠0 → w t j=interfaceFourDiagonal (fourInterfaceSign v (t+sixAngle j))) + {ε : ℝ} (hε : 0<ε) + (hcross : ∀t∈G,∀u∈G,dist t u<ε → FourWordCross (w t) (w u)) : False := by + classical + have hnomix := four_words_no_mixed G hG w hw hshiftG hshift hε hcross + have hpar (t : Angles) (ht : t∈G) := four_word_parity (w t) (hw t ht) (hnomix t ht) + let p : Angles → Fin 2 := fun t => if ht : t∈G then (hpar t ht).choose else 0 + have hp (t : Angles) (ht : t∈G) : ∀j,w t j=0 → j.val%2=(p t).val := by + simpa only [p,dite_eq_left ht] using (hpar t ht).choose_spec + have hclose (t : Angles) (ht : t∈G) (u : Angles) (hu : u∈G) (htu : dist t u<ε) : p t=p u := by + by_contra hne + have hcases : (p t=0 ∧ p u=1) ∨ (p t=1 ∧ p u=0) := + (show ∀a b : Fin 2,a≠b → (a=0 ∧ b=1) ∨ (a=1 ∧ b=0) from by decide) _ _ hne + rcases hcases with ⟨hpt,hpu⟩|⟨hpt,hpu⟩ + · exact four_word_opposite_geometry_false (hw t ht) (hw u hu) + (by simpa only [hpt,Fin.val_zero] using hp t ht) + (by simpa only [hpu,Fin.val_one] using hp u hu) + (hcross t ht u hu htu) (hn t ht) (hn u hu) (hd t ht) (hd u hu) + · exact four_word_opposite_geometry_false (hw u hu) (hw t ht) + (by simpa only [hpu,Fin.val_zero] using hp u hu) + (by simpa only [hpt,Fin.val_one] using hp t ht) + (hcross u hu t ht (by simpa only [dist_comm] using htu)) + (hn u hu) (hn t ht) (hd u hu) (hd t ht) + obtain ⟨t,ht⟩ := hG.nonempty + have hconst : ∀u∈G,p u=p t := by + apply dense_isolated_value_constant hG p hε ⟨t,ht,rfl⟩ + intro u hu hut z hz huz + exact (hclose u hu z hz huz).symm.trans hut + obtain ⟨j,hj⟩ := four_word_has_outsider (w (t+(sixty : Angles))) (hw _ (hshiftG t ht)) + have hh := four_word_shift_parity (w t) (p t) (hp t ht) j + (by simpa only [hshift t ht j] using hj) + have hh' := hp _ (hshiftG t ht) j hj + rw [hconst _ (hshiftG t ht)] at hh' + have he : (p t).val=(p t+1).val := hh'.symm.trans hh + exact (show ∀a : Fin 2,a.val≠(a+1).val from by decide) (p t) he + +/-- The actual length-four interface cycle is impossible. All hypotheses are +exactly approach directions and common straddling exclusion of both endpoints. -/ +lemma no_four_interfaces {c : ℂ → Fin 5} (hc : Measurable c) (hw : WeakColoring 5 c) + {x : ℂ} {K : Fin 4 → Set ℂ} {v : Fin 4 → ℂ} (hv : ∀i,‖v i‖=1) + (hK : ∀i,ApproachingContinuum x (K i) (v i)) + (hH : ∀i,∀j∈fourEdge i,Disjoint (spatialSupport c j) (Straddle (K i))) : False := by + obtain ⟨G,hG,hshiftG,hn,hd,hw',ε,hε,hcross⟩ := four_interface_word_data hc hw hv + (four_interface_compatible hc hw hv hK hH) + exact no_four_word_geometry v G hG (fourInterfaceWord hc x) hw' hshiftG + (fun t _ j => fourInterfaceWord_shift hc x t j) hn hd hε hcross +end EuclideanFiveColor +end + +end OAI diff --git a/lean/OAI/Geometry/PlaneColoring/Lattice.lean b/lean/OAI/Geometry/PlaneColoring/Lattice.lean new file mode 100644 index 0000000000000000000000000000000000000000..bbebe2a89c619158aa93f14d79fec556a9297431 --- /dev/null +++ b/lean/OAI/Geometry/PlaneColoring/Lattice.lean @@ -0,0 +1,66 @@ +import Mathlib + +namespace OAI + +/-! Integer arithmetic for the classical seven-color triangular lattice. -/ + +namespace Problem160 +namespace SevenLattice + +/-- Squared Euclidean norm in a triangular lattice of unit spacing. -/ +def normSq (a b : ℤ) : ℤ := a ^ 2 + a * b + b ^ 2 + +/-- The index-seven coloring of triangular-lattice sites. -/ +def color (a b : ℤ) : ZMod 7 := (a : ZMod 7) + 3 * (b : ZMod 7) + +lemma normSq_nonneg (a b : ℤ) : 0 ≤ normSq a b := by + unfold normSq + nlinarith [sq_nonneg (2 * a + b), sq_nonneg b] + +lemma normSq_pos {a b : ℤ} (h : a ≠ 0 ∨ b ≠ 0) : 0 < normSq a b := by + unfold normSq + rcases h with ha | hb + · have ha' : 0 < a ^ 2 := sq_pos_of_ne_zero ha + nlinarith [sq_nonneg (a + 2 * b)] + · have hb' : 0 < b ^ 2 := sq_pos_of_ne_zero hb + nlinarith [sq_nonneg (2 * a + b)] + +lemma seven_dvd_normSq {a b : ℤ} (h : 7 ∣ a + 3 * b) : 7 ∣ normSq a b := by + have hi : normSq a b = (a + 3 * b) * (a - 2 * b) + 7 * b ^ 2 := by + unfold normSq + ring + rw [hi] + exact dvd_add (dvd_mul_of_dvd_left h _) (dvd_mul_right _ _) + +lemma normSq_ge_seven {a b : ℤ} (h : 7 ∣ a + 3 * b) + (hn : a ≠ 0 ∨ b ≠ 0) : 7 ≤ normSq a b := by + exact Int.le_of_dvd (normSq_pos hn) (seven_dvd_normSq h) + +lemma color_eq_iff_dvd {a b c d : ℤ} : + color a b = color c d ↔ 7 ∣ (a - c) + 3 * (b - d) := by + have hd := ZMod.intCast_zmod_eq_zero_iff_dvd ((a - c) + 3 * (b - d)) 7 + norm_num only [Nat.cast_ofNat] at hd + rw [← hd] + change color a b = color c d ↔ (((a - c) + 3 * (b - d) : ℤ) : ZMod 7) = 0 + simp only [Int.cast_add, Int.cast_sub, Int.cast_mul, Int.cast_ofNat] + unfold color + constructor <;> intro h <;> linear_combination h + +lemma same_color_separation {a b c d : ℤ} (hc : color a b = color c d) + (hne : (a, b) ≠ (c, d)) : 7 ≤ normSq (a - c) (b - d) := by + apply normSq_ge_seven (color_eq_iff_dvd.mp hc) + by_contra h + push Not at h + apply hne + apply Prod.ext <;> omega + +/-- The colors can be used directly as the `Fin 7` target of a coloring. -/ +def colorFin (a b : ℤ) : Fin 7 := color a b + +lemma colorFin_injective_value {a b c d : ℤ} + (h : colorFin a b = colorFin c d) : color a b = color c d := h + +end SevenLattice +end Problem160 + +end OAI diff --git a/lean/OAI/Geometry/PlaneColoring/Main.lean b/lean/OAI/Geometry/PlaneColoring/Main.lean new file mode 100644 index 0000000000000000000000000000000000000000..1df81c07905687feaaa0fbef285338e13c717216 --- /dev/null +++ b/lean/OAI/Geometry/PlaneColoring/Main.lean @@ -0,0 +1 @@ +import OAI.Geometry.PlaneColoring.Seven diff --git a/lean/OAI/Geometry/PlaneColoring/MeasurableAssembly.lean b/lean/OAI/Geometry/PlaneColoring/MeasurableAssembly.lean new file mode 100644 index 0000000000000000000000000000000000000000..a89d3d71d3c61ab66c5ea561b56cd5484456c231 --- /dev/null +++ b/lean/OAI/Geometry/PlaneColoring/MeasurableAssembly.lean @@ -0,0 +1,57 @@ +import Mathlib + +namespace OAI + +noncomputable section + +namespace Problem160 + +/-- A countable cover admits a measurable least-index choice, so separated +small cells give a measurable proper coloring, not merely an arbitrary one. -/ +theorem exists_measurable_unit_distance_coloring_of_center_cover + {X I : Type*} [PseudoMetricSpace X] [MeasurableSpace X] [BorelSpace X] + [Countable I] [Nonempty I] {k : ℕ} + (center : I → X) (color : I → Fin k) (r : ℝ) + (hcover : ∀ x : X, ∃ i : I, dist x (center i) ≤ r) + (hdiam : 2 * r < 1) + (hsep : ∀ i j : I, i ≠ j → color i = color j → + 1 + 2 * r < dist (center i) (center j)) : + ∃ c : X → Fin k, Measurable c ∧ + ∀ x y : X, dist x y = 1 → c x ≠ c y := by + classical + obtain ⟨e, he⟩ := exists_surjective_nat I + have hcoverNat : ∀ x : X, ∃ n : ℕ, dist x (center (e n)) ≤ r := by + intro x + obtain ⟨i, hi⟩ := hcover x + obtain ⟨n, rfl⟩ := he i + exact ⟨n, hi⟩ + let pick : X → ℕ := fun x => Nat.find (hcoverNat x) + have hpick : Measurable pick := by + apply measurable_find hcoverNat + intro n + exact (isClosed_le (continuous_id.dist continuous_const) continuous_const).measurableSet + let cell : X → I := fun x => e (pick x) + have hcell (x : X) : dist x (center (cell x)) ≤ r := Nat.find_spec (hcoverNat x) + refine ⟨fun x => color (cell x), ?_, ?_⟩ + · exact (measurable_of_countable (fun n => color (e n))).comp hpick + · intro x y hdist hcolor + by_cases hsame : cell x = cell y + · have htriangle := dist_triangle x (center (cell x)) y + have hx := hcell x + have hy := hcell y + rw [← hsame] at hy + rw [dist_comm (center (cell x)) y] at htriangle + linarith + · have hfar := hsep (cell x) (cell y) hsame hcolor + have htriangle₁ := dist_triangle (center (cell x)) x (center (cell y)) + have htriangle₂ := dist_triangle x y (center (cell y)) + have hx := hcell x + have hy := hcell y + rw [dist_comm (center (cell x)) x] at htriangle₁ + linarith + +end Problem160 + +end + +end OAI diff --git a/lean/OAI/Geometry/PlaneColoring/MeasurableProper.lean b/lean/OAI/Geometry/PlaneColoring/MeasurableProper.lean new file mode 100644 index 0000000000000000000000000000000000000000..666106a2d44f4d31b3562f997c6a1ec4eaad5a65 --- /dev/null +++ b/lean/OAI/Geometry/PlaneColoring/MeasurableProper.lean @@ -0,0 +1,68 @@ +import OAI.Geometry.PlaneColoring.Basic + +namespace OAI + +noncomputable section + +open MeasureTheory + +namespace Problem160 + +@[continuity, fun_prop] +theorem continuous_circleDir : Continuous circleDir := by + unfold circleDir + fun_prop + +@[fun_prop] +theorem measurable_circleDir : Measurable circleDir := + continuous_circleDir.measurable + +instance normalizedAngleMeasure_isProbabilityMeasure : + IsProbabilityMeasure normalizedAngleMeasure where + measure_univ := by + have hpos : 0 < (2 : ℝ) * Real.pi := by positivity + simp only [normalizedAngleMeasure, Measure.smul_apply, Measure.restrict_apply_univ, + Real.volume_Ico, sub_zero, smul_eq_mul] + exact ENNReal.inv_mul_cancel (ne_of_gt (ENNReal.ofReal_pos.mpr hpos)) + ENNReal.ofReal_ne_top + +instance circleMeasure_isProbabilityMeasure : IsProbabilityMeasure circleMeasure := + inferInstanceAs (IsProbabilityMeasure (Measure.map circleDir normalizedAngleMeasure)) + +@[simp] +theorem norm_circleDir (t : ℝ) : ‖circleDir t‖ = 1 := by + have h : ‖circleDir t‖ ^ 2 = 1 := by + rw [EuclideanSpace.real_norm_sq_eq] + simp [circleDir, Fin.sum_univ_two] + nlinarith [norm_nonneg (circleDir t)] + +theorem ae_circleMeasure_norm : ∀ᵐ u ∂circleMeasure, ‖u‖ = 1 := by + unfold circleMeasure + rw [ae_map_iff measurable_circleDir.aemeasurable] + · exact Filter.Eventually.of_forall norm_circleDir + · exact isClosed_eq continuous_norm continuous_const |>.measurableSet + +theorem ae_weakPairMeasure_unit (R : ℝ) : + ∀ᵐ p ∂weakPairMeasure R, ‖p.2‖ = 1 := by + exact Measure.quasiMeasurePreserving_snd.ae ae_circleMeasure_norm + +theorem weakMeasurableColoring_of_aemeasurable_proper {k : ℕ} + (c : Plane → Fin k) (hc : AEMeasurable c volume) + (hproper : ∀ x y : Plane, dist x y = 1 → c x ≠ c y) : + WeakMeasurableColoring k := by + refine ⟨c, hc, ?_⟩ + intro R hR + apply Finset.sum_eq_zero + intro i hi + apply measure_mono_null (t := {p : Plane × Plane | ‖p.2‖ ≠ 1}) + · intro p hp hnorm + have hd : dist p.1 (p.1 + p.2) = 1 := by + simpa [dist_eq_norm] using hnorm + exact hproper _ _ hd (hp.1.trans hp.2.symm) + · exact ae_iff.mp (ae_weakPairMeasure_unit R) + +end Problem160 + +end + +end OAI diff --git a/lean/OAI/Geometry/PlaneColoring/Mesh.lean b/lean/OAI/Geometry/PlaneColoring/Mesh.lean new file mode 100644 index 0000000000000000000000000000000000000000..019fbacaad551666bb89ed9b31044135a0a07b04 --- /dev/null +++ b/lean/OAI/Geometry/PlaneColoring/Mesh.lean @@ -0,0 +1,154 @@ +import OAI.Geometry.PlaneColoring.FullApproximation + +namespace OAI + +noncomputable section +open scoped Classical +open Set Filter Topology MeasureTheory +namespace EuclideanFiveColor +/-- A point of a connected set with a distant partner can be moved to the +boundary of its (unique) small hole. Pairwise disjoint closed disks make the +new point lie outside every open hole. No path regularity is required. -/ +lemma connected_escape_holes {S : Finset MarkedDisk} {t : ℝ} + (hS : ∀d∈S,0≤d.radius) + (hdis : (S : Set MarkedDisk).Pairwise (fun a b => Disjoint a.closedBall b.closedBall)) + (hsum : (∑d∈S,d.radius) (a n).ε) atTop (𝓝 0) := + squeeze_zero (fun n => (a n).ε_pos.le) (fun n => (a n).ε_lt.le) ht +lemma annuli_tendsto {c : ℂ → Fin 5} {α : ℝ} {t : ℕ → ℝ} + (a : ∀n,FullApprox c α (t n)) (ht : Tendsto t atTop (𝓝 0)) : + Tendsto (fun n => volume (holeAnnuli (a n).disks)) atTop (𝓝 0) := by + apply holeAnnuli_tendsto_zero _ (fun n d hd => ((a n).positive d hd).le) + exact squeeze_zero (fun n => Finset.sum_nonneg fun d hd => ((a n).positive d hd).le) + (fun n => (a n).sum_lt.le) ht +lemma positive_average {c : ℂ → Fin 5} (hc : Measurable c) {α t : ℝ} (hα : α<1/5) + (a : FullApprox c α t) (i : Fin 5) (q : Metric.closedBall (0:ℂ) 5) + (hq : q.val∉diskHoles a.disks) (hp : 0<(a.map q).val i) : α connected_escape_holes + (fun d hd => ((F n).positive d hd).le) (F n).disjoint (F n).sum_lt (hK n) (hx n) (hy n) (hxy' n) + choose b hbK hbH hby using fun n => connected_escape_holes + (fun d hd => ((F n).positive d hd).le) (F n).disjoint (F n).sum_lt (hK n) (hy n) (hx n) (hyx' n) + have hab (n : ℕ) : 3/2≤dist (a n) (b n) := by + have h1 := dist_triangle (x n) (a n) (y n) + have h2 := dist_triangle (a n) (b n) (y n) + rw [dist_comm (b n) (y n)] at h2 + linarith [hxy n,hax n,hby n,htsmall n] + obtain ⟨p,hp,φ,hφ,hlim⟩ := ((isCompact_closedBall (0:ℂ) 5).prod + (isCompact_closedBall (0:ℂ) 5)).tendsto_subseq (x := fun n => (a n,b n)) (fun n => ⟨hsub n (haK n),hsub n (hbK n)⟩) + have halim : Tendsto (fun n => a (φ n)) atTop (𝓝 p.1) := (continuous_fst.tendsto p).comp hlim + have hblim : Tendsto (fun n => b (φ n)) atTop (𝓝 p.2) := (continuous_snd.tendsto p).comp hlim + have hpdist : 3/2≤dist p.1 p.2 := ge_of_tendsto (halim.dist hblim) (Eventually.of_forall (fun n => hab (φ n))) + have hεlim := (ε_tendsto F htlim).comp hφ.tendsto_atTop + have hE := (annuli_tendsto F htlim).comp hφ.tendsto_atTop + have hasup : p.1∈spatialSupport c i := support_of_positive_diskAverage_limit hc hεlim halim i + (fun n => hα.trans (positive_average hc hα' (F (φ n)) i ⟨a (φ n),hsub _ (haK _)⟩ + (haH _) (hprob _ _ (haK _)))) + have hexc : Disjoint (spatialSupport c i) (Metric.ball p.1 (1/8)) := by + apply diskAverage_support_exclusion hc hεlim (fun n => (F (φ n)).ε_pos) hE hα Metric.isOpen_ball i + intro z hz + have hane : ∀ᶠn in atTop,dist (a (φ n)) p.1<1/8 := + halim.eventually (Metric.ball_mem_nhds _ (by norm_num)) + have hbne : ∀ᶠn in atTop,dist (b (φ n)) p.2<1/8 := + hblim.eventually (Metric.ball_mem_nhds _ (by norm_num)) + filter_upwards [hane,hbne] with n han hbn hzE + have hza : dist z (a (φ n))<1 := by + have hh := dist_triangle z p.1 (a (φ n)) + rw [dist_comm p.1 (a (φ n))] at hh + change dist z p.1<1/8 at hz + linarith + have hzb : 1 hzE (unit_from_hole_mem_annuli hh hunit) + have hqprob := positive_average hc hα' (F (φ n)) i ⟨q,hsub _ hq⟩ hqH (hprob _ _ hq) + have hu : ‖q-z‖=1 := by simpa only [dist_eq_norm,norm_sub_rev] using hunit + have hh := diskAverage_unit_pair hc hw (F (φ n)).ε_pos hu i + change diskAverage c (F (φ n)).ε i z≤1-α + change α simp [triangularLattice] <;> ring + +theorem triangularLattice_dist_sq (a b c d : ℤ) : + dist (triangularLattice a b) (triangularLattice c d) ^ 2 = + (16 / 25 : ℝ) * (((a-c : ℤ) : ℝ)^2 + + ((a-c : ℤ) : ℝ)*(b-d : ℤ) + ((b-d : ℤ) : ℝ)^2) := by + rw [dist_eq_norm, triangularLattice_sub, triangularLattice_norm_sq] + +theorem triangularLattice_dist_gt_two (a b c d : ℤ) + (h : 7 ≤ (a-c)^2 + (a-c)*(b-d) + (b-d)^2) : + (2 : ℝ) < dist (triangularLattice a b) (triangularLattice c d) := by + have hr : (7 : ℝ) ≤ ((a-c : ℤ) : ℝ)^2 + + ((a-c : ℤ) : ℝ)*(b-d : ℤ) + ((b-d : ℤ) : ℝ)^2 := by + exact_mod_cast h + have heq := triangularLattice_dist_sq a b c d + have hd := dist_nonneg (x := triangularLattice a b) (y := triangularLattice c d) + nlinarith + +theorem dist_triangularLattice_sq (x : Plane) (a b : ℤ) : + dist x (triangularLattice a b)^2 = + (16 / 25 : ℝ) * + (((5 / 4 : ℝ) * x 0 - ((a : ℝ) + (b : ℝ)/2))^2 + + ((5 / 4 : ℝ) * x 1 - Real.sqrt 3 * b / 2)^2) := by + rw [dist_eq_norm, EuclideanSpace.real_norm_sq_eq] + simp only [Fin.sum_univ_two, PiLp.sub_apply, triangularLattice_zero, + triangularLattice_one] + ring + +theorem dist_triangularLattice_le_of_coordinates (x : Plane) (a b : ℤ) + (h : ((5 / 4 : ℝ) * x 0 - ((a : ℝ) + (b : ℝ)/2))^2 + + ((5 / 4 : ℝ) * x 1 - Real.sqrt 3 * b / 2)^2 ≤ (1 / 3 : ℝ)) : + dist x (triangularLattice a b) ≤ (7 / 15 : ℝ) := by + have heq := dist_triangularLattice_sq x a b + have hd := dist_nonneg (x := x) (y := triangularLattice a b) + nlinarith + +end Problem160 + +end + +end OAI diff --git a/lean/OAI/Geometry/PlaneColoring/Moser.lean b/lean/OAI/Geometry/PlaneColoring/Moser.lean new file mode 100644 index 0000000000000000000000000000000000000000..c215fe51831de770114226fc606f0cc65afbefa7 --- /dev/null +++ b/lean/OAI/Geometry/PlaneColoring/Moser.lean @@ -0,0 +1,439 @@ +import Mathlib + +namespace OAI + +noncomputable section +namespace EuclideanFiveColor +def ThreeLabelRegion (x y : ℝ) : Prop := + 0 linarith +end EuclideanFiveColor +end + +noncomputable section +namespace EuclideanFiveColor +lemma sin_sub_add_product (a b : ℝ) : + Real.sin (a-b)*Real.sin (a+b)=Real.sin a^2-Real.sin b^2 := by + rw [Real.sin_sub,Real.sin_add] + have ha : Real.cos a^2=1-Real.sin a^2 := by linarith [Real.sin_sq_add_cos_sq a] + have hb : Real.cos b^2=1-Real.sin b^2 := by linarith [Real.sin_sq_add_cos_sq b] + calc _ = Real.sin a^2*Real.cos b^2-Real.cos a^2*Real.sin b^2 := by ring + _ = _ := by rw [ha,hb]; ring +lemma sin_three_using_cos (a : ℝ) : + Real.sin (3*a)=Real.sin a*(4*Real.cos a^2-1) := by + rw [Real.sin_three_mul] + nlinarith [congrArg (fun x : ℝ => Real.sin a*x) (Real.sin_sq_add_cos_sq a)] +/-- Exact strict angular form of the manuscript's polynomial region. -/ +lemma polynomial_region_angles {z : ℂ} (hz : ThreeLabelRegion z.re z.im) : + ∃ t u : ℝ, (Circle.exp t : ℂ)+(Circle.exp u : ℂ)=z ∧ + Real.sin (u-t)≠0 ∧ Real.sin (3*t)*Real.sin (3*u)<0 := by + let r : ℝ := ‖z‖ + let p : ℝ := z.arg + let d : ℝ := Real.arccos (r/2) + have hr2 : r^2=z.re^2+z.im^2 := by + change ‖z‖^2=_ + rw [Complex.sq_norm,Complex.normSq_apply] + ring + have hr0 : 0 rcases h with ⟨rfl,rfl⟩ + all_goals + apply complex_norm_one_of_sq + norm_num [moserA,moserB,moserT,moserU,Complex.mul_re,Complex.mul_im, + Complex.div_ofReal_re,Complex.div_ofReal_im,Complex.sub_re,Complex.sub_im, + Complex.add_re,Complex.add_im] <;> + (ring_nf; norm_num [h3,h11]) +lemma three_color_diamond {a b p q : Fin 3} (hab : a≠b) + (hpa : p≠a) (hpb : p≠b) (hqa : q≠a) (hqb : q≠b) : p=q := by + fin_cases a <;> fin_cases b <;> fin_cases p <;> fin_cases q <;> simp_all +lemma moser_not_three_colorable (f : Fin 7 → Fin 3) + (hf : ∀i j,(i,j)∈moserEdges → f i≠f j) : False := by + have h03 : f 0=f 3 := three_color_diamond + (hf 1 2 (by decide)) (hf 0 1 (by decide)) (hf 0 2 (by decide)) + (hf 3 1 (by decide)) (hf 3 2 (by decide)) + have h06 : f 0=f 6 := three_color_diamond + (hf 4 5 (by decide)) (hf 0 4 (by decide)) (hf 0 5 (by decide)) + (hf 6 4 (by decide)) (hf 6 5 (by decide)) + exact hf 3 6 (by decide) (h03.symm.trans h06) +def moserRotation : ℂ := (35+12*Complex.I)/37 +def placedMoser (i : Fin 7) : ℂ := moserRotation*(moserPoint i+(-290+149*Complex.I)/250) +lemma moserRotation_unit : ‖moserRotation‖=1 := by + apply complex_norm_one_of_sq + norm_num [moserRotation,Complex.div_ofReal_re,Complex.div_ofReal_im] +lemma placedMoser_edge_unit {i j : Fin 7} (h : (i,j)∈moserEdges) : ‖placedMoser i-placedMoser j‖=1 := by + have he : placedMoser i-placedMoser j=moserRotation*(moserPoint i-moserPoint j) := by + unfold placedMoser; ring + rw [he,norm_mul,moserRotation_unit,moser_edge_unit h,one_mul] +end EuclideanFiveColor +end + +noncomputable section +namespace EuclideanFiveColor +def certificateX : Fin 7 → ℝ := ![-1.2906,-0.6335,-0.3092,0.3478,-1.1598,-0.3666,-0.2358] +def certificateY : Fin 7 → ℝ := ![0.1876,0.9414,-0.0045,0.7493,1.1790,0.5700,1.5614] +lemma radical_bounds : 1.73205 nlinarith +lemma radical_product_bounds : (1.73205*3.31662 : ℝ)≤Real.sqrt 3*Real.sqrt 11 ∧ + Real.sqrt 3*Real.sqrt 11≤1.73206*3.31663 := by + obtain ⟨ha,hb,hc,hd⟩ := radical_bounds + constructor <;> gcongr +lemma seven_point_box_0 : + |(placedMoser 0).re-certificateX 0|≤(0.00011 : ℝ) ∧ + |(placedMoser 0).im-certificateY 0|≤(0.00011 : ℝ) := by + obtain ⟨ha,hb,hc,hd⟩ := radical_bounds + obtain ⟨hp,hq⟩ := radical_product_bounds + change |(placedMoser 0).re-(-1.2906)|≤0.00011 ∧ |(placedMoser 0).im-(0.1876)|≤0.00011 + norm_num [placedMoser,moserRotation,moserA,moserB,moserT,moserU, + Complex.mul_re,Complex.mul_im,Complex.div_ofReal_re,Complex.div_ofReal_im, + Complex.add_re,Complex.add_im,Complex.sub_re,Complex.sub_im] +lemma seven_point_box_1 : + |(placedMoser 1).re-certificateX 1|≤(0.00011 : ℝ) ∧ + |(placedMoser 1).im-certificateY 1|≤(0.00011 : ℝ) := by + obtain ⟨ha,hb,hc,hd⟩ := radical_bounds + obtain ⟨hp,hq⟩ := radical_product_bounds + change |(placedMoser 1).re-(-0.6335)|≤0.00011 ∧ |(placedMoser 1).im-(0.9414)|≤0.00011 + norm_num [placedMoser,moserRotation,moserA,moserB,moserT,moserU, + Complex.mul_re,Complex.mul_im,Complex.div_ofReal_re,Complex.div_ofReal_im, + Complex.add_re,Complex.add_im,Complex.sub_re,Complex.sub_im] + constructor <;> rw [abs_le] <;> constructor <;> nlinarith +lemma seven_point_box_2 : + |(placedMoser 2).re-certificateX 2|≤(0.00011 : ℝ) ∧ + |(placedMoser 2).im-certificateY 2|≤(0.00011 : ℝ) := by + obtain ⟨ha,hb,hc,hd⟩ := radical_bounds + obtain ⟨hp,hq⟩ := radical_product_bounds + change |(placedMoser 2).re-(-0.3092)|≤0.00011 ∧ |(placedMoser 2).im-(-0.0045)|≤0.00011 + norm_num [placedMoser,moserRotation,moserA,moserB,moserT,moserU, + Complex.mul_re,Complex.mul_im,Complex.div_ofReal_re,Complex.div_ofReal_im, + Complex.add_re,Complex.add_im,Complex.sub_re,Complex.sub_im] + constructor <;> rw [abs_le] <;> constructor <;> nlinarith +lemma seven_point_box_3 : + |(placedMoser 3).re-certificateX 3|≤(0.00011 : ℝ) ∧ + |(placedMoser 3).im-certificateY 3|≤(0.00011 : ℝ) := by + obtain ⟨ha,hb,hc,hd⟩ := radical_bounds + obtain ⟨hp,hq⟩ := radical_product_bounds + change |(placedMoser 3).re-(0.3478)|≤0.00011 ∧ |(placedMoser 3).im-(0.7493)|≤0.00011 + norm_num [placedMoser,moserRotation,moserA,moserB,moserT,moserU, + Complex.mul_re,Complex.mul_im,Complex.div_ofReal_re,Complex.div_ofReal_im, + Complex.add_re,Complex.add_im,Complex.sub_re,Complex.sub_im] + constructor <;> rw [abs_le] <;> constructor <;> nlinarith +lemma seven_point_box_4 : + |(placedMoser 4).re-certificateX 4|≤(0.00011 : ℝ) ∧ + |(placedMoser 4).im-certificateY 4|≤(0.00011 : ℝ) := by + obtain ⟨ha,hb,hc,hd⟩ := radical_bounds + obtain ⟨hp,hq⟩ := radical_product_bounds + change |(placedMoser 4).re-(-1.1598)|≤0.00011 ∧ |(placedMoser 4).im-(1.1790)|≤0.00011 + norm_num [placedMoser,moserRotation,moserA,moserB,moserT,moserU, + Complex.mul_re,Complex.mul_im,Complex.div_ofReal_re,Complex.div_ofReal_im, + Complex.add_re,Complex.add_im,Complex.sub_re,Complex.sub_im] + constructor <;> rw [abs_le] <;> constructor <;> nlinarith +lemma seven_point_box_5 : + |(placedMoser 5).re-certificateX 5|≤(0.00011 : ℝ) ∧ + |(placedMoser 5).im-certificateY 5|≤(0.00011 : ℝ) := by + obtain ⟨ha,hb,hc,hd⟩ := radical_bounds + obtain ⟨hp,hq⟩ := radical_product_bounds + change |(placedMoser 5).re-(-0.3666)|≤0.00011 ∧ |(placedMoser 5).im-(0.5700)|≤0.00011 + norm_num [placedMoser,moserRotation,moserA,moserB,moserT,moserU, + Complex.mul_re,Complex.mul_im,Complex.div_ofReal_re,Complex.div_ofReal_im, + Complex.add_re,Complex.add_im,Complex.sub_re,Complex.sub_im] + constructor <;> rw [abs_le] <;> constructor <;> nlinarith +lemma seven_point_box_6 : + |(placedMoser 6).re-certificateX 6|≤(0.00011 : ℝ) ∧ + |(placedMoser 6).im-certificateY 6|≤(0.00011 : ℝ) := by + obtain ⟨ha,hb,hc,hd⟩ := radical_bounds + obtain ⟨hp,hq⟩ := radical_product_bounds + change |(placedMoser 6).re-(-0.2358)|≤0.00011 ∧ |(placedMoser 6).im-(1.5614)|≤0.00011 + norm_num [placedMoser,moserRotation,moserA,moserB,moserT,moserU, + Complex.mul_re,Complex.mul_im,Complex.div_ofReal_re,Complex.div_ofReal_im, + Complex.add_re,Complex.add_im,Complex.sub_re,Complex.sub_im] + constructor <;> rw [abs_le] <;> constructor <;> nlinarith +lemma seven_point_boxes (i : Fin 7) : + |(placedMoser i).re-certificateX i|≤(0.00011 : ℝ) ∧ + |(placedMoser i).im-certificateY i|≤(0.00011 : ℝ) := by + fin_cases i + · exact seven_point_box_0 + · exact seven_point_box_1 + · exact seven_point_box_2 + · exact seven_point_box_3 + · exact seven_point_box_4 + · exact seven_point_box_5 + · exact seven_point_box_6 +end EuclideanFiveColor +end + +noncomputable section +namespace EuclideanFiveColor +/-- Exact rational interval certificate for the manuscript's seven placed vertices. -/ +lemma seven_point_certificate (i : Fin 7) : + ThreeLabelRegion (placedMoser i).re (placedMoser i).im := by + obtain ⟨hx,hy⟩ := seven_point_boxes i + fin_cases i + · change ThreeLabelRegion (placedMoser 0).re (placedMoser 0).im + change |(placedMoser 0).re-(-1.2906)|≤0.00011 at hx + change |(placedMoser 0).im-(0.1876)|≤0.00011 at hy + have hxx := square_coordinate_bounds (by norm_num : (0:ℝ)≤0.00011) + (by norm_num : (0.00011:ℝ)≤|(-1.2906:ℝ)|) hx + have hyy := square_coordinate_bounds (by norm_num : (0:ℝ)≤0.00011) + (by norm_num : (0.00011:ℝ)≤|(0.1876:ℝ)|) hy + norm_num at hxx hyy + apply region_of_rational_bounds (a := 1.70) (b := 1.71) (Y := 0.0353) (H := 4.963) (d := 0.70) + · norm_num + · norm_num + · norm_num + · norm_num + · norm_num + · nlinarith [hxx.1,hyy.1] + · nlinarith [hxx.2,hyy.2] + · nlinarith [hyy.2] + · rw [abs_le]; constructor <;> nlinarith [hxx.1,hxx.2,hyy.1,hyy.2] + · have hh := le_abs_self ((placedMoser 0).re^2+(placedMoser 0).im^2-1) + nlinarith [hxx.1,hxx.2,hyy.1,hyy.2] + · norm_num + · change ThreeLabelRegion (placedMoser 1).re (placedMoser 1).im + change |(placedMoser 1).re-(-0.6335)|≤0.00011 at hx + change |(placedMoser 1).im-(0.9414)|≤0.00011 at hy + have hxx := square_coordinate_bounds (by norm_num : (0:ℝ)≤0.00011) + (by norm_num : (0.00011:ℝ)≤|(-0.6335:ℝ)|) hx + have hyy := square_coordinate_bounds (by norm_num : (0:ℝ)≤0.00011) + (by norm_num : (0.00011:ℝ)≤|(0.9414:ℝ)|) hy + norm_num at hxx hyy + apply region_of_rational_bounds (a := 1.28) (b := 1.29) (Y := 0.887) (H := 0.319) (d := 0.28) + · norm_num + · norm_num + · norm_num + · norm_num + · norm_num + · nlinarith [hxx.1,hyy.1] + · nlinarith [hxx.2,hyy.2] + · nlinarith [hyy.2] + · rw [abs_le]; constructor <;> nlinarith [hxx.1,hxx.2,hyy.1,hyy.2] + · have hh := le_abs_self ((placedMoser 1).re^2+(placedMoser 1).im^2-1) + nlinarith [hxx.1,hxx.2,hyy.1,hyy.2] + · norm_num + · change ThreeLabelRegion (placedMoser 2).re (placedMoser 2).im + change |(placedMoser 2).re-(-0.3092)|≤0.00011 at hx + change |(placedMoser 2).im-(-0.0045)|≤0.00011 at hy + have hxx := square_coordinate_bounds (by norm_num : (0:ℝ)≤0.00011) + (by norm_num : (0.00011:ℝ)≤|(-0.3092:ℝ)|) hx + have hyy := square_coordinate_bounds (by norm_num : (0:ℝ)≤0.00011) + (by norm_num : (0.00011:ℝ)≤|(-0.0045:ℝ)|) hy + norm_num at hxx hyy + apply region_of_rational_bounds (a := 0.095) (b := 0.096) (Y := 0.000022) (H := 0.287) (d := 0.904) + · norm_num + · norm_num + · norm_num + · norm_num + · norm_num + · nlinarith [hxx.1,hyy.1] + · nlinarith [hxx.2,hyy.2] + · nlinarith [hyy.2] + · rw [abs_le]; constructor <;> nlinarith [hxx.1,hxx.2,hyy.1,hyy.2] + · have hh := neg_le_abs ((placedMoser 2).re^2+(placedMoser 2).im^2-1) + nlinarith [hxx.1,hxx.2,hyy.1,hyy.2] + · norm_num + · change ThreeLabelRegion (placedMoser 3).re (placedMoser 3).im + change |(placedMoser 3).re-(0.3478)|≤0.00011 at hx + change |(placedMoser 3).im-(0.7493)|≤0.00011 at hy + have hxx := square_coordinate_bounds (by norm_num : (0:ℝ)≤0.00011) + (by norm_num : (0.00011:ℝ)≤|(0.3478:ℝ)|) hx + have hyy := square_coordinate_bounds (by norm_num : (0:ℝ)≤0.00011) + (by norm_num : (0.00011:ℝ)≤|(0.7493:ℝ)|) hy + norm_num at hxx hyy + apply region_of_rational_bounds (a := 0.682) (b := 0.683) (Y := 0.562) (H := 0.199) (d := 0.317) + · norm_num + · norm_num + · norm_num + · norm_num + · norm_num + · nlinarith [hxx.1,hyy.1] + · nlinarith [hxx.2,hyy.2] + · nlinarith [hyy.2] + · rw [abs_le]; constructor <;> nlinarith [hxx.1,hxx.2,hyy.1,hyy.2] + · have hh := neg_le_abs ((placedMoser 3).re^2+(placedMoser 3).im^2-1) + nlinarith [hxx.1,hxx.2,hyy.1,hyy.2] + · norm_num + · change ThreeLabelRegion (placedMoser 4).re (placedMoser 4).im + change |(placedMoser 4).re-(-1.1598)|≤0.00011 at hx + change |(placedMoser 4).im-(1.1790)|≤0.00011 at hy + have hxx := square_coordinate_bounds (by norm_num : (0:ℝ)≤0.00011) + (by norm_num : (0.00011:ℝ)≤|(-1.1598:ℝ)|) hx + have hyy := square_coordinate_bounds (by norm_num : (0:ℝ)≤0.00011) + (by norm_num : (0.00011:ℝ)≤|(1.1790:ℝ)|) hy + norm_num at hxx hyy + apply region_of_rational_bounds (a := 2.73) (b := 2.74) (Y := 1.391) (H := 2.647) (d := 1.73) + · norm_num + · norm_num + · norm_num + · norm_num + · norm_num + · nlinarith [hxx.1,hyy.1] + · nlinarith [hxx.2,hyy.2] + · nlinarith [hyy.2] + · rw [abs_le]; constructor <;> nlinarith [hxx.1,hxx.2,hyy.1,hyy.2] + · have hh := le_abs_self ((placedMoser 4).re^2+(placedMoser 4).im^2-1) + nlinarith [hxx.1,hxx.2,hyy.1,hyy.2] + · norm_num + · change ThreeLabelRegion (placedMoser 5).re (placedMoser 5).im + change |(placedMoser 5).re-(-0.3666)|≤0.00011 at hx + change |(placedMoser 5).im-(0.5700)|≤0.00011 at hy + have hxx := square_coordinate_bounds (by norm_num : (0:ℝ)≤0.00011) + (by norm_num : (0.00011:ℝ)≤|(-0.3666:ℝ)|) hx + have hyy := square_coordinate_bounds (by norm_num : (0:ℝ)≤0.00011) + (by norm_num : (0.00011:ℝ)≤|(0.5700:ℝ)|) hy + norm_num at hxx hyy + apply region_of_rational_bounds (a := 0.459) (b := 0.46) (Y := 0.326) (H := 0.079) (d := 0.54) + · norm_num + · norm_num + · norm_num + · norm_num + · norm_num + · nlinarith [hxx.1,hyy.1] + · nlinarith [hxx.2,hyy.2] + · nlinarith [hyy.2] + · rw [abs_le]; constructor <;> nlinarith [hxx.1,hxx.2,hyy.1,hyy.2] + · have hh := neg_le_abs ((placedMoser 5).re^2+(placedMoser 5).im^2-1) + nlinarith [hxx.1,hxx.2,hyy.1,hyy.2] + · norm_num + · change ThreeLabelRegion (placedMoser 6).re (placedMoser 6).im + change |(placedMoser 6).re-(-0.2358)|≤0.00011 at hx + change |(placedMoser 6).im-(1.5614)|≤0.00011 at hy + have hxx := square_coordinate_bounds (by norm_num : (0:ℝ)≤0.00011) + (by norm_num : (0.00011:ℝ)≤|(-0.2358:ℝ)|) hx + have hyy := square_coordinate_bounds (by norm_num : (0:ℝ)≤0.00011) + (by norm_num : (0.00011:ℝ)≤|(1.5614:ℝ)|) hy + norm_num at hxx hyy + apply region_of_rational_bounds (a := 2.493) (b := 2.495) (Y := 2.44) (H := 2.273) (d := 1.493) + · norm_num + · norm_num + · norm_num + · norm_num + · norm_num + · nlinarith [hxx.1,hyy.1] + · nlinarith [hxx.2,hyy.2] + · nlinarith [hyy.2] + · rw [abs_le]; constructor <;> nlinarith [hxx.1,hxx.2,hyy.1,hyy.2] + · have hh := le_abs_self ((placedMoser 6).re^2+(placedMoser 6).im^2-1) + nlinarith [hxx.1,hxx.2,hyy.1,hyy.2] + · norm_num +end EuclideanFiveColor +end + +end OAI diff --git a/lean/OAI/Geometry/PlaneColoring/PaletteDensity.lean b/lean/OAI/Geometry/PlaneColoring/PaletteDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..c06bb17af276fd9a2ce94ca0c4653baeecca6314 --- /dev/null +++ b/lean/OAI/Geometry/PlaneColoring/PaletteDensity.lean @@ -0,0 +1,485 @@ +import OAI.Geometry.PlaneColoring.CircleTransport +import OAI.Geometry.PlaneColoring.Palettes + +namespace OAI + +noncomputable section +open MeasureTheory Filter Topology +namespace EuclideanFiveColor +lemma weak_strong_disjoint {X Y : Type*} [MeasurableSpace X] [MeasurableSpace Y] + {μ : Measure X} {ν : Measure Y} [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] + {F : ℕ → X → ℝ} {b : X → ℝ} {G : ℕ → X × Y → ℝ} {g : X × Y → ℝ} + (hF : ∀ n, Measurable (F n)) (hb : Measurable b) + (hG : ∀ n, Measurable (G n)) (hg : Measurable g) + (hFb : ∀ n x, 0 ≤ F n x ∧ F n x ≤ 1) + (hbb : ∀ᵐ x ∂μ, 0 ≤ b x ∧ b x ≤ 1) + (hGb : ∀ n p, 0 ≤ G n p ∧ G n p ≤ 1) + (hgb : ∀ p, 0 ≤ g p ∧ g p ≤ 1) + (hw : ∀ v : X → ℝ, Integrable v μ → + Tendsto (fun n => ∫ x, F n x*v x ∂μ) atTop (𝓝 (∫ x, b x*v x ∂μ))) + (hs : Tendsto (fun n => ∫ p, ‖G n p-g p‖ ∂μ.prod ν) atTop (𝓝 0)) + (hz : ∀ n, ∀ᵐ p ∂μ.prod ν, F n p.1*G n p=0) : + ∀ᵐ p ∂μ.prod ν, b p.1*g p=0 := by + have hgi : Integrable g (μ.prod ν) := Integrable.of_bound hg.aestronglyMeasurable 1 + (Eventually.of_forall fun p => by rw [Real.norm_eq_abs,abs_of_nonneg (hgb p).1]; exact (hgb p).2) + have hFi (n : ℕ) : Integrable (fun p : X × Y => F n p.1*g p) (μ.prod ν) := by + apply Integrable.of_bound (((hF n).comp measurable_fst).mul hg).aestronglyMeasurable 1 + exact Eventually.of_forall fun p => by + change ‖F n p.1*g p‖ ≤ 1 + rw [Real.norm_eq_abs,abs_of_nonneg (mul_nonneg (hFb n p.1).1 (hgb p).1)] + exact (mul_le_of_le_one_left (hgb p).1 (hFb n p.1).2).trans (hgb p).2 + have hbi : Integrable (fun p : X × Y => b p.1*g p) (μ.prod ν) := by + apply Integrable.of_bound ((hb.comp measurable_fst).mul hg).aestronglyMeasurable 1 + filter_upwards [Measure.quasiMeasurePreserving_fst.ae hbb] with p hp + change ‖b p.1*g p‖ ≤ 1 + rw [Real.norm_eq_abs,abs_of_nonneg (mul_nonneg hp.1 (hgb p).1)] + exact (mul_le_of_le_one_left (hgb p).1 hp.2).trans (hgb p).2 + have herr (n : ℕ) : Integrable (fun p => ‖G n p-g p‖) (μ.prod ν) := by + apply Integrable.of_bound ((hG n).sub hg).norm.aestronglyMeasurable 1 + exact Eventually.of_forall fun p => by + rw [norm_norm,Real.norm_eq_abs,abs_le] + change -1 ≤ G n p-g p ∧ G n p-g p ≤ 1 + constructor <;> linarith [(hGb n p).1,(hGb n p).2,(hgb p).1,(hgb p).2] + have hi0 : Tendsto (fun n => ∫ p, F n p.1*g p ∂μ.prod ν) atTop (𝓝 0) := by + apply squeeze_zero (fun n => integral_nonneg fun p => mul_nonneg (hFb n p.1).1 (hgb p).1) _ hs + intro n + apply integral_mono_ae (hFi n) (herr n) + filter_upwards [hz n] with p hp + rw [Real.norm_eq_abs] + calc + F n p.1*g p = F n p.1*(g p-G n p) := by rw [mul_sub,hp,sub_zero] + _ ≤ |g p-G n p| := by + calc + _ ≤ F n p.1*|g p-G n p| := mul_le_mul_of_nonneg_left (le_abs_self _) (hFb n p.1).1 + _ ≤ 1*|g p-G n p| := mul_le_mul_of_nonneg_right (hFb n p.1).2 (abs_nonneg _) + _ = _ := one_mul _ + _ = |G n p-g p| := abs_sub_comm _ _ + let v : X → ℝ := fun x => ∫ y, g (x,y) ∂ν + have hvi : Integrable v μ := hgi.integral_prod_left + have hlim := hw v hvi + have hconvert (f : X → ℝ) (hi : Integrable (fun p : X × Y => f p.1*g p) (μ.prod ν)) : + (∫ p, f p.1*g p ∂μ.prod ν) = ∫ x, f x*v x ∂μ := by + rw [integral_prod _ hi] + apply integral_congr_ae + exact Eventually.of_forall fun x => by + exact integral_const_mul (f x) (fun y => g (x,y)) + have he0 : (∫ p, b p.1*g p ∂μ.prod ν)=0 := by + have ht : Tendsto (fun n => ∫ p, F n p.1*g p ∂μ.prod ν) atTop + (𝓝 (∫ p, b p.1*g p ∂μ.prod ν)) := by + simpa only [hconvert b hbi,hconvert (F _) (hFi _)] using hlim + exact tendsto_nhds_unique ht hi0 + exact (integral_eq_zero_iff_of_nonneg_ae + ((Measure.quasiMeasurePreserving_fst.ae hbb).mono fun p hp => mul_nonneg hp.1 (hgb p).1) hbi).mp he0 +end EuclideanFiveColor +end + +noncomputable section +open MeasureTheory Filter Topology +namespace EuclideanFiveColor +variable {k : ℕ} (c : ℂ → Fin k) (hc : Measurable c) +def colorIndicator (i : Fin k) (z : ℂ) : ℝ := if c z=i then 1 else 0 +include hc in +lemma colorIndicator_measurable (i : Fin k) : Measurable (colorIndicator c i) := + measurable_one.piecewise (measurableSet_eq_fun hc measurable_const) measurable_zero +lemma colorIndicator_bounds (i : Fin k) (z : ℂ) : 0 ≤ colorIndicator c i z ∧ colorIndicator c i z ≤ 1 := by + simp only [colorIndicator]; split_ifs <;> norm_num +include hc in +lemma sample_pair_disjoint (hw : WeakColoring k c) {y : ℂ} {r : ℝ} + (hy : TypicalSampling c y r) (i : Fin k) : + ∀ᵐ p ∂angularMeasure.prod angularMeasure, + sampleFn c y r i p.1*colorIndicator c i (angularSum y r p)=0 := by + have h1 : ∀ᵐ p ∂angularMeasure.prod angularMeasure, Typical c (y+(r : ℂ)*direction p.1) := + Measure.quasiMeasurePreserving_fst.ae hy.2 + have h2 := (angularSum_quasiMeasurePreserving y hy.1.ne').ae (ae_density_actual c hc) + filter_upwards [h1,h2] with p hp1 hp2 + by_cases ha : c (y+(r : ℂ)*direction p.1)=i + · have hb : c (angularSum y r p) ≠ i := by + intro hb + have hdist : ‖(y+(r : ℂ)*direction p.1)-angularSum y r p‖=1 := by + simp [angularSum] + apply weak_density_proper c hc hw i hdist + · simpa only [Typical,ha] using hp1 + · simpa only [hb] using hp2 + simp [sampleFn,colorIndicator,ha,hb] + · simp [sampleFn,ha] +lemma trace_pair_disjoint (hw : WeakColoring k c) {x : ℂ} {b : TraceVector k} + (hb : IsTrace c hc x b) (i : Fin k) : + ∀ᵐ p ∂angularMeasure.prod angularMeasure, + traceValue b i p.1*colorIndicator c i (angularSum x 1 p)=0 := by + obtain ⟨y,r,ht,hy,hr,hweak⟩ := trace_realization_weakStar c hc hb + have hbnd := trace_bounds c hc hb + apply weak_strong_disjoint (F := fun n => sampleFn c (y n) (r n) i) + (G := fun n p => colorIndicator c i (angularSum (y n) (r n) p)) + (fun n => sampleFn_measurable c hc (y n) (r n) i) (Lp.stronglyMeasurable _).measurable + (fun n => (colorIndicator_measurable c hc i).comp (angularSum_measurable _ _)) + ((colorIndicator_measurable c hc i).comp (angularSum_measurable _ _)) + (fun n t => ⟨sampleFn_nonneg c _ _ _ t,sampleFn_le_one c _ _ _ t⟩) + (Eventually.and (hbnd.1 i) (hbnd.2.1 i)) + (fun n p => colorIndicator_bounds c i _) (fun p => colorIndicator_bounds c i _) + (hweak i) (angularSum_tendsto_L1 hr hy (colorIndicator_measurable c hc i) (colorIndicator_bounds c i)) + (fun n => sample_pair_disjoint c hc hw (ht n) i) +lemma palette_first_exclusion (hw : WeakColoring k c) (x : ℂ) (i : Fin k) : + ∀ᵐ p ∂angularMeasure.prod angularMeasure, + p.1 ∈ paletteSet c hc x i → c (angularSum x 1 p) ≠ i := by + have hall : ∀ᵐ p ∂angularMeasure.prod angularMeasure, ∀ b ∈ paletteGenerators c hc x i, + traceValue b.1 i p.1*colorIndicator c i (angularSum x 1 p)=0 := + (ae_ball_iff (paletteGenerators_countable c hc x i)).mpr + (fun b _ => trace_pair_disjoint c hc hw b.2 i) + filter_upwards [hall] with p hp + intro hm he + obtain ⟨b,hb,hpos⟩ := Set.mem_iUnion₂.mp hm + have hzero := hp b hb + have hval : colorIndicator c i (angularSum x 1 p)=1 := by simp [colorIndicator,he] + rw [hval,mul_one] at hzero + exact (show 0 < traceValue b.1 i p.1 from hpos).ne' hzero +lemma palette_second_exclusion (hw : WeakColoring k c) (x : ℂ) (i : Fin k) : + ∀ᵐ p ∂angularMeasure.prod angularMeasure, + p.2 ∈ paletteSet c hc x i → c (angularSum x 1 p) ≠ i := by + have h := (Measure.measurePreserving_swap (μ := angularMeasure) (ν := angularMeasure)).quasiMeasurePreserving.ae + (palette_first_exclusion c hc hw x i) + simp only [Prod.swap,angularSum,Complex.ofReal_one,one_mul] at h ⊢ + filter_upwards [h] with p hp + convert hp using 1; rw [add_right_comm] +lemma palette_transfer_pair (hw : WeakColoring k c) (x : ℂ) : + ∀ᵐ p ∂angularMeasure.prod angularMeasure, + c (angularSum x 1 p) ∉ palette c hc x p.1 ∪ palette c hc x p.2 := by + classical + filter_upwards [ae_all_iff.mpr (fun i => (palette_first_exclusion c hc hw x i).and + (palette_second_exclusion c hc hw x i))] with p hp + simpa only [Finset.mem_union,mem_palette,not_or] using + And.intro (fun h => (hp _).1 h rfl) (fun h => (hp _).2 h rfl) +end EuclideanFiveColor + +end + +noncomputable section +open MeasureTheory Set +namespace EuclideanFiveColor +lemma angleMk_quasiMeasurePreserving : + Measure.QuasiMeasurePreserving ((↑) : ℝ → Angles) volume angularMeasure := by + have hm : Measurable ((↑) : ℝ → Angles) := (AddCircle.measurePreserving_mk (2*Real.pi) 0).measurable + refine ⟨hm,Measure.AbsolutelyContinuous.mk (fun A hA hz => ?_)⟩ + rw [Measure.map_apply hm hA] + have hzv : (volume : Measure Angles) A=0 := by + rw [AddCircle.volume_eq_smul_haarAddCircle,Measure.smul_apply] + change ENNReal.ofReal (2*Real.pi) * angularMeasure A=0 + rw [hz,mul_zero] + have hh (n : ℤ) : volume (((↑) : ℝ → Angles) ⁻¹' A ∩ + Ioc (n • (2*Real.pi)) ((n+1) • (2*Real.pi)))=0 := by + have h := (AddCircle.measurePreserving_mk (2*Real.pi) (n • (2*Real.pi))).quasiMeasurePreserving.preimage_null hzv + rw [Measure.restrict_apply' measurableSet_Ioc] at h + simpa only [add_zsmul,one_zsmul] using h + have hcov := iUnion_Ioc_zsmul (by positivity : 0 < 2*Real.pi) + have he : ((↑) : ℝ → Angles) ⁻¹' A = ⋃ n : ℤ, + ((↑) : ℝ → Angles) ⁻¹' A ∩ Ioc (n • (2*Real.pi)) ((n+1) • (2*Real.pi)) := by + rw [← inter_iUnion,hcov,inter_univ] + rw [he] + exact measure_iUnion_null hh +lemma anglePair_quasiMeasurePreserving : + Measure.QuasiMeasurePreserving (fun p : ℝ × ℝ => ((p.1 : Angles),(p.2 : Angles))) + volume (angularMeasure.prod angularMeasure) := by + convert QuasiMeasurePreserving.prodMap angleMk_quasiMeasurePreserving + angleMk_quasiMeasurePreserving using 1; rfl +end EuclideanFiveColor +end + +noncomputable section +open MeasureTheory Filter Topology Set +open scoped NNReal +namespace EuclideanFiveColor +def FlatDensityZero (A : Set (ℝ × ℝ)) (p : ℝ × ℝ) : Prop := + Tendsto (fun r : ℝ => volume.real (A ∩ Metric.closedBall p r)/r^2) (𝓝[>] 0) (𝓝 0) +def LineDensityZero (D : Set ℝ) (t : ℝ) : Prop := + Tendsto (fun r : ℝ => volume.real (D ∩ Metric.closedBall t r)/r) (𝓝[>] 0) (𝓝 0) +lemma volume_image_bound {F : ℝ × ℝ → ℝ × ℝ} {s : Set (ℝ × ℝ)} {K : ℝ≥0} + (hF : LipschitzWith K (s.domRestrict F)) (A : Set (ℝ × ℝ)) (hA : A ⊆ s) : + volume (F '' A) ≤ (K : ENNReal)^2 * volume A := by + let B : Set s := Subtype.val ⁻¹' A + have he1 : (s.domRestrict F) '' B = F '' A := by + ext y + constructor + · rintro ⟨z,hz,rfl⟩; exact ⟨z.1,hz,rfl⟩ + · rintro ⟨z,hz,rfl⟩; exact ⟨⟨z,hA hz⟩,hz,rfl⟩ + have he2 : Subtype.val '' B = A := by + ext z + exact ⟨fun ⟨q,hq,he⟩ => he ▸ hq,fun hz => ⟨⟨z,hA hz⟩,hz,rfl⟩⟩ + have hi := (isometry_subtype_coe : Isometry (Subtype.val : s → ℝ × ℝ)).hausdorffMeasure_image + (Or.inl (by norm_num : (0 : ℝ)≤2)) B + have ha := hF.hausdorffMeasure_image_le (by norm_num : (0 : ℝ)≤2) B + rw [he1,hausdorffMeasure_prod_real,ENNReal.rpow_two] at ha + rw [he2,hausdorffMeasure_prod_real] at hi + rwa [← hi] at ha +lemma FlatDensityZero.mono_ae {A B : Set (ℝ × ℝ)} {p : ℝ × ℝ} + (hb : FlatDensityZero B p) (hAB : A ≤ᵐ[volume] B) : FlatDensityZero A p := by + apply squeeze_zero (fun r => div_nonneg (measureReal_nonneg) (sq_nonneg r)) _ hb + intro r + apply div_le_div_of_nonneg_right _ (sq_nonneg r) + apply ENNReal.toReal_mono + · exact ne_top_of_le_ne_top (isCompact_closedBall p r).measure_ne_top (measure_mono inter_subset_right) + · exact measure_mono_ae (hAB.mono fun z hz h => ⟨hz h.1,h.2⟩) +lemma flatDensityZero_prod {D : Set ℝ} {t u : ℝ} (hD : LineDensityZero D t) : + FlatDensityZero (D ×ˢ univ) (t,u) := by + have h := hD.const_mul 2 + simp only [mul_zero] at h + apply h.congr' + filter_upwards [self_mem_nhdsWithin] with r hr + have hp : 0 < r := hr + rw [← closedBall_prod_same,prod_inter_prod,univ_inter,Measure.volume_eq_prod] + simp only [Measure.real,Measure.prod_prod,ENNReal.toReal_mul,Real.volume_closedBall, + ENNReal.toReal_ofReal (by positivity : 0 ≤ 2*r)] + change 2*(volume.real (D ∩ Metric.closedBall t r)/r) = + volume.real (D ∩ Metric.closedBall t r)*(2*r)/r^2 + field_simp [hp.ne'] +lemma tendsto_pos_mul_nhdsWithin {a : ℝ} (ha : 0 a*r) (𝓝[>] 0) (𝓝[>] 0) := by + apply tendsto_nhdsWithin_iff.mpr + constructor + · simpa using (tendsto_const_nhds.mul (tendsto_id.mono_left nhdsWithin_le_nhds : Tendsto (fun r : ℝ => r) (𝓝[>] 0) (𝓝 0))) + · filter_upwards [self_mem_nhdsWithin] with r hr + exact mul_pos ha hr +lemma FlatDensityZero.image {D s : Set (ℝ × ℝ)} {p : ℝ × ℝ} {F : ℝ × ℝ → ℝ × ℝ} + {K L : ℝ≥0} (hD : FlatDensityZero D p) (hps : p ∈ s) + (hF : LipschitzWith K (s.domRestrict F)) (hA : AntilipschitzWith L (s.domRestrict F)) + (hL : 0 < L) : FlatDensityZero (F '' (D ∩ s)) (F p) := by + have h := (hD.comp (tendsto_pos_mul_nhdsWithin (show 0 < (L : ℝ) from hL))).const_mul + ((K : ℝ)^2*(L : ℝ)^2) + simp only [mul_zero] at h + apply squeeze_zero' (Eventually.of_forall fun r => div_nonneg measureReal_nonneg (sq_nonneg r)) _ h + filter_upwards [self_mem_nhdsWithin] with r hr + have hp : 0 < r := hr + let E : Set (ℝ × ℝ) := D ∩ s ∩ Metric.closedBall p ((L : ℝ)*r) + have he : F '' (D ∩ s) ∩ Metric.closedBall (F p) r ⊆ F '' E := by + rintro z ⟨⟨q,hq,rfl⟩,hz⟩ + refine ⟨q,⟨hq,?_⟩,rfl⟩ + exact (hA.le_mul_dist ⟨q,hq.2⟩ ⟨p,hps⟩).trans + (mul_le_mul_of_nonneg_left hz L.2) + have hm := (measure_mono he).trans (volume_image_bound hF E (fun q hq => hq.1.2)) + have hsub : E ⊆ D ∩ Metric.closedBall p ((L : ℝ)*r) := fun q hq => ⟨hq.1.1,hq.2⟩ + have hfin : volume (D ∩ Metric.closedBall p ((L : ℝ)*r)) ≠ ⊤ := + ne_top_of_le_ne_top (isCompact_closedBall _ _).measure_ne_top (measure_mono inter_subset_right) + have hm' := hm.trans (mul_le_mul (le_refl _) (measure_mono hsub) bot_le bot_le) + have hreal := ENNReal.toReal_mono (ENNReal.mul_ne_top (by finiteness) hfin) hm' + simp only [ENNReal.toReal_mul,ENNReal.toReal_pow,ENNReal.coe_toReal] at hreal + calc + _ ≤ (K : ℝ)^2*volume.real (D ∩ Metric.closedBall p ((L : ℝ)*r))/r^2 := + div_le_div_of_nonneg_right hreal (sq_nonneg r) + _ = _ := by + change _ = ((K : ℝ)^2*(L : ℝ)^2)* + (volume.real (D ∩ Metric.closedBall p ((L : ℝ)*r))/((L : ℝ)*r)^2) + have hLr : (L : ℝ) ≠ 0 := ne_of_gt hL + field_simp [hp.ne',hLr] +end EuclideanFiveColor +end + +noncomputable section +open MeasureTheory Filter Topology Set +open scoped NNReal +namespace EuclideanFiveColor +lemma FlatDensityZero.of_locally_le {A B s : Set (ℝ × ℝ)} {p : ℝ × ℝ} + (hb : FlatDensityZero B p) (hs : s ∈ 𝓝 p) (hAB : (A ∩ s : Set (ℝ × ℝ)) ≤ᵐ[volume] B) : + FlatDensityZero A p := by + obtain ⟨δ,hδ,hsδ⟩ := Metric.mem_nhds_iff.mp hs + apply squeeze_zero' (Eventually.of_forall fun r => div_nonneg measureReal_nonneg (sq_nonneg r)) _ hb + filter_upwards [(eventually_lt_nhds hδ).filter_mono nhdsWithin_le_nhds] with r hr + apply div_le_div_of_nonneg_right _ (sq_nonneg r) + apply ENNReal.toReal_mono + · exact ne_top_of_le_ne_top (isCompact_closedBall p r).measure_ne_top (measure_mono inter_subset_right) + · apply measure_mono_ae + filter_upwards [hAB] with q hq + intro hqa + exact ⟨hq ⟨hqa.1,hsδ (Metric.closedBall_subset_ball hr hqa.2)⟩,hqa.2⟩ +lemma FlatDensityZero.transport {A D s : Set (ℝ × ℝ)} {p : ℝ × ℝ} + {F : ℝ × ℝ → ℝ × ℝ} {K L : ℝ≥0} (hD : FlatDensityZero D p) + (hps : p ∈ s) (hs : F '' s ∈ 𝓝 (F p)) + (hF : LipschitzWith K (s.domRestrict F)) (hA : AntilipschitzWith L (s.domRestrict F)) + (hL : 0 < L) (hAD : (F ⁻¹' A ∩ s : Set (ℝ × ℝ)) ≤ᵐ[volume] D) : FlatDensityZero A (F p) := by + let N := (F ⁻¹' A ∩ s) \ D + have hN : volume N=0 := measure_eq_zero_iff_ae_notMem.mpr (hAD.mono fun q hq h => h.2 (hq h.1)) + have himg : volume (F '' N)=0 := by + apply le_antisymm _ (zero_le : (0 : ENNReal) ≤ volume (F '' N)) + simpa only [hN,mul_zero] using volume_image_bound hF N (fun q hq => hq.1.2) + apply (hD.image hps hF hA hL).of_locally_le hs + filter_upwards [measure_eq_zero_iff_ae_notMem.mp himg] with q hq + rintro ⟨hqa,⟨t,ht,rfl⟩⟩ + by_cases hd : t ∈ D + · exact ⟨t,⟨hd,ht⟩,rfl⟩ + · exact (hq ⟨t,⟨⟨hqa,ht⟩,hd⟩,rfl⟩).elim +end EuclideanFiveColor +end + +noncomputable section +open MeasureTheory Filter Topology Set +open scoped NNReal +namespace EuclideanFiveColor +lemma circleSum_one_lipschitz : LipschitzWith 2 (circleSum 1) := by + apply LipschitzWith.of_dist_le_mul + intro a b + have h₁ := realDirection_lipschitz.dist_le_mul a.1 b.1 + have h₂ := realDirection_lipschitz.dist_le_mul a.2 b.2 + have h := dist_add_add_le (Real.cos a.1,Real.sin a.1) (Real.cos a.2,Real.sin a.2) + (Real.cos b.1,Real.sin b.1) (Real.cos b.2,Real.sin b.2) + have he (p : RealPlane) : circleSum 1 p = + (Real.cos p.1,Real.sin p.1)+(Real.cos p.2,Real.sin p.2) := by simp [circleSum] + rw [he a,he b] + norm_num only [NNReal.coe_ofNat,NNReal.coe_one,one_mul] at * + have ha : dist a.1 b.1 ≤ dist a b := by rw [Prod.dist_eq]; exact le_max_left _ _ + have hb : dist a.2 b.2 ≤ dist a b := by rw [Prod.dist_eq]; exact le_max_right _ _ + linarith +lemma circleSum_densityZero {D : Set ℝ} {A : Set RealPlane} {t u : ℝ} (x : RealPlane) + (hD : LineDensityZero D t) (hu : Real.sin (u-t) ≠ 0) + (hAD : ∀ᵐ q : RealPlane ∂volume, x+circleSum 1 q ∈ A → q.1 ∈ D) : + FlatDensityZero A (x+circleSum 1 (t,u)) := by + let F : RealPlane → RealPlane := fun q => x+circleSum 1 q + have hreg : (1 : ℝ)*Real.sin (u-t) ≠ 0 := by simpa only [one_mul] using hu + obtain ⟨s,hso,hps,K,hK⟩ := circleSum_local_antilipschitz (r := 1) (p := (t,u)) hreg + have ha : AntilipschitzWith (K+1) (s.domRestrict F) := by + apply AntilipschitzWith.of_le_mul_dist + intro a b + have h := hK.le_mul_dist a b + simp only [domRestrict] at h + simp only [domRestrict,F,dist_add_left,NNReal.coe_add,NNReal.coe_one] + nlinarith [dist_nonneg (x := circleSum 1 a.1) (y := circleSum 1 b.1)] + let L := circleSumDerivEquiv (r := 1) (p := (t,u)) hreg + have hd : HasStrictFDerivAt F (L : RealPlane →L[ℝ] RealPlane) (t,u) := + (circleSum_strict 1 (t,u)).const_add x + have him : F '' s ∈ 𝓝 (F (t,u)) := by + rw [← hd.map_nhds_eq_of_equiv] + exact image_mem_map (hso.mem_nhds hps) + have hl : LipschitzWith 2 F := LipschitzWith.of_dist_le_mul fun a b => by + simpa only [F,dist_add_left] using circleSum_one_lipschitz.dist_le_mul a b + apply (flatDensityZero_prod hD).transport hps him + (show LipschitzWith 2 (s.domRestrict F) from fun a b => hl a.1 b.1) ha (by positivity) + filter_upwards [hAD] with q hq + rintro ⟨hm,_⟩ + exact ⟨hq hm,mem_univ _⟩ +end EuclideanFiveColor +end + +noncomputable section +open MeasureTheory Filter Topology Set +namespace EuclideanFiveColor +lemma complex_ball_flat_ball {z w : ℂ} {r : ℝ} (h : w ∈ Metric.closedBall z r) : + Complex.equivRealProdCLM w ∈ Metric.closedBall (Complex.equivRealProdCLM z) r := by + rw [Metric.mem_closedBall,dist_eq_norm] at h ⊢ + change max ‖w.re-z.re‖ ‖w.im-z.im‖ ≤ r + simpa only [Real.norm_eq_abs,Complex.sub_re,Complex.sub_im] using + max_le ((Complex.abs_re_le_norm (w-z)).trans h) ((Complex.abs_im_le_norm (w-z)).trans h) +lemma flat_to_complex_densityZero {A : Set ℂ} {z : ℂ} + (h : FlatDensityZero (Complex.equivRealProdCLM.symm ⁻¹' A) (Complex.equivRealProdCLM z)) : + Tendsto (fun r : ℝ => volume (A ∩ Metric.closedBall z r)/volume (Metric.closedBall z r)) + (𝓝[>] 0) (𝓝 (0 : ENNReal)) := by + have ht := h.const_mul (Real.pi)⁻¹ + simp only [mul_zero] at ht + have he := ENNReal.continuous_ofReal.continuousAt.tendsto.comp ht + simp only [ENNReal.ofReal_zero] at he + apply tendsto_of_tendsto_of_tendsto_of_le_of_le' tendsto_const_nhds he + (Eventually.of_forall fun _ => zero_le) ?_ + filter_upwards [self_mem_nhdsWithin] with r hr + have hp : 0 < r := hr + let B := Complex.equivRealProdCLM.symm ⁻¹' A ∩ Metric.closedBall (Complex.equivRealProdCLM z) r + have hm : volume (A ∩ Metric.closedBall z r) ≤ (volume : Measure (ℝ × ℝ)) B := by + apply (measure_mono (t := Complex.equivRealProdCLM ⁻¹' B) ?_).trans + (Complex.volume_preserving_equiv_real_prod.measure_preimage_le B) + intro w hw + exact ⟨by simpa only [Set.mem_preimage,ContinuousLinearEquiv.symm_apply_apply] using hw.1,complex_ball_flat_ball hw.2⟩ + have hfin : (volume : Measure (ℝ × ℝ)) B ≠ ⊤ := + ne_top_of_le_ne_top (isCompact_closedBall _ _).measure_ne_top (measure_mono inter_subset_right) + have hfinA : volume (A ∩ Metric.closedBall z r) ≠ ⊤ := ne_top_of_le_ne_top (isCompact_closedBall z r).measure_ne_top + (measure_mono (s := A ∩ Metric.closedBall z r) inter_subset_right) + apply (ENNReal.toReal_le_toReal (ENNReal.div_ne_top hfinA + (Metric.measure_closedBall_pos volume z hp).ne') ENNReal.ofReal_ne_top).mp + rw [ENNReal.toReal_div,Complex.volume_closedBall,ENNReal.toReal_mul,ENNReal.toReal_pow, + ENNReal.toReal_ofReal hp.le,ENNReal.coe_toReal,NNReal.coe_real_pi, + ENNReal.toReal_ofReal (by positivity)] + calc + _ ≤ volume.real B/(r^2*Real.pi) := div_le_div_of_nonneg_right (ENNReal.toReal_mono hfin hm) (by positivity) + _ = _ := by dsimp [B]; ring +lemma flat_density_not_one {A : Set ℂ} {z : ℂ} + (h : FlatDensityZero (Complex.equivRealProdCLM.symm ⁻¹' A) (Complex.equivRealProdCLM z)) : + ¬ DensityOne A z := by + intro hd + have he := tendsto_nhds_unique (flat_to_complex_densityZero h) hd + exact zero_ne_one he +end EuclideanFiveColor +end + +noncomputable section +open MeasureTheory Filter Topology Set +namespace EuclideanFiveColor +lemma ae_lineDensityZero_compl {D : Set ℝ} (hD : MeasurableSet D) : + ∀ᵐ t : ℝ ∂volume, t ∈ D → LineDensityZero Dᶜ t := by + have hh := Besicovitch.ae_tendsto_measure_inter_div_of_measurableSet volume hD.compl + filter_upwards [hh] with t ht htd + rw [Set.indicator_of_notMem (show t ∉ Dᶜ from by simpa only [mem_compl_iff,not_not] using htd)] at ht + have hreal := (ENNReal.tendsto_toReal (by simp : (0 : ENNReal) ≠ ⊤)).comp ht + simp only [ENNReal.toReal_zero,Function.comp_def,ENNReal.toReal_div] at hreal + have h := hreal.const_mul 2 + simp only [mul_zero] at h + apply h.congr' + filter_upwards [self_mem_nhdsWithin] with r hr + have hp : 0 < r := hr + rw [Real.volume_closedBall,ENNReal.toReal_ofReal (by positivity : 0 ≤ 2*r)] + change 2*(volume.real (Dᶜ ∩ Metric.closedBall t r)/(2*r)) = _ + field_simp +end EuclideanFiveColor +end + +noncomputable section +open MeasureTheory Filter Topology Set +namespace EuclideanFiveColor +variable {k : ℕ} (c : ℂ → Fin k) (hc : Measurable c) +def liftPalette (x : ℂ) (i : Fin k) : Set ℝ := + ((↑) : ℝ → Angles) ⁻¹' paletteSet c hc x i +lemma liftPalette_measurable (x : ℂ) (i : Fin k) : MeasurableSet (liftPalette c hc x i) := + (paletteSet_measurable c hc x i).preimage angleMk_quasiMeasurePreserving.measurable +lemma palette_spatial_densityZero (hw : WeakColoring k c) {x : ℂ} {i : Fin k} {t u : ℝ} + (ht : LineDensityZero (liftPalette c hc x i)ᶜ t) (hu : Real.sin (u-t) ≠ 0) : + Tendsto (fun r : ℝ => volume ({z | c z=i} ∩ Metric.closedBall (angularSum x 1 (angleChart (t,u))) r)/ + volume (Metric.closedBall (angularSum x 1 (angleChart (t,u))) r)) + (𝓝[>] 0) (𝓝 (0 : ENNReal)) := by + apply flat_to_complex_densityZero + have he := anglePair_quasiMeasurePreserving.ae (palette_first_exclusion c hc hw x i) + have hAD : ∀ᵐ q : RealPlane ∂volume, Complex.equivRealProdCLM x+circleSum 1 q ∈ + Complex.equivRealProdCLM.symm ⁻¹' {z | c z=i} → q.1 ∈ (liftPalette c hc x i)ᶜ := by + filter_upwards [he] with q hq hm hd + apply hq hd + change c (Complex.equivRealProdCLM.symm (Complex.equivRealProdCLM x+circleSum 1 q))=i at hm + change c (angularSum x 1 (angleChart q))=i + rwa [angularSum_chart] + have hb := circleSum_densityZero (Complex.equivRealProdCLM x) ht hu hAD + rwa [← circleSum_chart x 1 (t,u)] at hb +lemma palette_spatial_not_densityOne (hw : WeakColoring k c) {x : ℂ} {i : Fin k} {t u : ℝ} + (ht : LineDensityZero (liftPalette c hc x i)ᶜ t) (hu : Real.sin (u-t) ≠ 0) : + ¬ DensityOne {z | c z=i} (angularSum x 1 (angleChart (t,u))) := by + intro hd + exact zero_ne_one (tendsto_nhds_unique (palette_spatial_densityZero c hc hw ht hu) hd) +end EuclideanFiveColor +end + +noncomputable section +open MeasureTheory Filter Topology Set +namespace EuclideanFiveColor +variable {k : ℕ} (c : ℂ → Fin k) (hc : Measurable c) +lemma palette_sample_branch_exclusion (hw : WeakColoring k c) {x y : ℂ} {r : ℝ} + (hy : TypicalSampling c y r) (i : Fin k) {I : Set ℝ} (hI : MeasurableSet I) {s t : ℝ → ℝ} + (hq : Measure.QuasiMeasurePreserving s (volume.restrict I) volume) + (hn : ∀ f ∈ I, Real.sin (t f-s f) ≠ 0) + (he : ∀ f ∈ I, y+(r : ℂ)*direction (f : Angles)=angularSum x 1 (angleChart (s f,t f))) : + ∀ᵐ f : ℝ ∂volume.restrict I, + sampleFn c y r i (f : Angles)*(liftPalette c hc x i).indicator (fun _ => (1 : ℝ)) (s f)=0 := by + have hd := hq.ae (ae_lineDensityZero_compl (liftPalette_measurable c hc x i)) + have ht := ae_restrict_of_ae (s := I) (angleMk_quasiMeasurePreserving.ae hy.2) + filter_upwards [hd,ht,ae_restrict_mem hI] with f hfd hft hf + by_cases hs : s f ∈ liftPalette c hc x i + · have hzero := palette_spatial_not_densityOne c hc hw (hfd hs) (hn f hf) + have hi : c (y+(r : ℂ)*direction (f : Angles)) ≠ i := by + intro hi + apply hzero + rw [← he f hf] + simpa only [Typical,hi] using hft + simp only [sampleFn,ite_eq_right hi,zero_mul] + · rw [indicator_of_notMem hs,mul_zero] +end EuclideanFiveColor +end + +end OAI diff --git a/lean/OAI/Geometry/PlaneColoring/PaletteTransport.lean b/lean/OAI/Geometry/PlaneColoring/PaletteTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..dab3fbec7feaef6bf5a7ac839097062028692943 --- /dev/null +++ b/lean/OAI/Geometry/PlaneColoring/PaletteTransport.lean @@ -0,0 +1,458 @@ +import OAI.Geometry.PlaneColoring.PaletteDensity + +namespace OAI + +noncomputable section +open MeasureTheory Filter Topology Set +namespace EuclideanFiveColor +lemma angleRep_preserving (a : ℝ) : + MeasurePreserving (fun t : Angles => (AddCircle.equivIoc (2*Real.pi) a t : ℝ)) + volume (volume.restrict (Ioc a (a+2*Real.pi))) := + (measurePreserving_subtype_coe measurableSet_Ioc).comp (AddCircle.measurePreserving_equivIoc _) +lemma weak_lift_Ioc {F : ℕ → Angles → ℝ} {b : Angles → ℝ} + (hw : ∀ v : Angles → ℝ, Integrable v angularMeasure → + Tendsto (fun n => ∫ t, F n t*v t ∂angularMeasure) atTop (𝓝 (∫ t, b t*v t ∂angularMeasure))) + (a : ℝ) (v : ℝ → ℝ) (hv : Integrable v (volume.restrict (Ioc a (a+2*Real.pi)))) : + Tendsto (fun n => ∫ t in Ioc a (a+2*Real.pi), F n (t : Angles)*v t) atTop + (𝓝 (∫ t in Ioc a (a+2*Real.pi), b (t : Angles)*v t)) := by + let V : Angles → ℝ := AddCircle.liftIoc (2*Real.pi) a v + have hvi : Integrable V (volume : Measure Angles) := (angleRep_preserving a).integrable_comp_of_integrable hv + have hva : Integrable V angularMeasure := by + rw [AddCircle.volume_eq_smul_haarAddCircle] at hvi + exact (integrable_smul_measure (by positivity : ENNReal.ofReal (2*Real.pi) ≠ 0) (ENNReal.ofReal_ne_top)).mp hvi + have h := (hw V hva).const_mul (2*Real.pi) + have he (f : Angles → ℝ) : (∫ t in Ioc a (a+2*Real.pi), f (t : Angles)*v t) = + (2*Real.pi)*(∫ t, f t*V t ∂angularMeasure) := by + have hpre := AddCircle.integral_preimage (2*Real.pi) a (fun t => f t*V t) + have hi : (∫ t in Ioc a (a+2*Real.pi), f (t : Angles)*v t) = + ∫ t in Ioc a (a+2*Real.pi), f (t : Angles)*V (t : Angles) := by + apply setIntegral_congr_fun measurableSet_Ioc + intro t ht + change f (t : Angles)*v t=f (t : Angles)*V (t : Angles) + rw [show V (t : Angles)=v t from AddCircle.liftIoc_coe_apply ht] + rw [hi,hpre,AddCircle.volume_eq_smul_haarAddCircle,integral_smul_measure, + ENNReal.toReal_ofReal (by positivity : 0 ≤ 2*Real.pi),smul_eq_mul] + rfl + simpa only [← he] using h +lemma weak_restrict {X : Type*} [MeasurableSpace X] {μ : Measure X} + {F : ℕ → X → ℝ} {b : X → ℝ} + (hw : ∀ v : X → ℝ, Integrable v μ → + Tendsto (fun n => ∫ t, F n t*v t ∂μ) atTop (𝓝 (∫ t, b t*v t ∂μ))) + {I : Set X} (hI : MeasurableSet I) : + ∀ v : X → ℝ, Integrable v (μ.restrict I) → + Tendsto (fun n => ∫ t, F n t*v t ∂μ.restrict I) atTop + (𝓝 (∫ t, b t*v t ∂μ.restrict I)) := by + intro v hv + have hvi : Integrable (I.indicator v) μ := (integrable_indicator_iff hI).mpr hv + have h := hw (I.indicator v) hvi + have he (f : X → ℝ) : (fun t => f t*I.indicator v t)=I.indicator (fun t => f t*v t) := by + funext t + by_cases ht : t ∈ I <;> simp [ht] + simpa only [he,integral_indicator hI] using h +lemma weak_lift_set {F : ℕ → Angles → ℝ} {b : Angles → ℝ} + (hw : ∀ v : Angles → ℝ, Integrable v angularMeasure → + Tendsto (fun n => ∫ t, F n t*v t ∂angularMeasure) atTop (𝓝 (∫ t, b t*v t ∂angularMeasure))) + {I : Set ℝ} (hI : MeasurableSet I) {a : ℝ} (hIa : I ⊆ Ioc a (a+2*Real.pi)) : + ∀ v : ℝ → ℝ, Integrable v (volume.restrict I) → + Tendsto (fun n => ∫ t in I, F n (t : Angles)*v t) atTop + (𝓝 (∫ t in I, b (t : Angles)*v t)) := by + have h := weak_restrict (weak_lift_Ioc hw a) hI + simpa only [Measure.restrict_restrict hI,inter_eq_left.mpr hIa] using h +end EuclideanFiveColor +end + +noncomputable section +open MeasureTheory Filter Topology +namespace EuclideanFiveColor +lemma weak_strong_disjoint_single {X : Type*} [MeasurableSpace X] + {μ : Measure X} [IsFiniteMeasure μ] + {F : ℕ → X → ℝ} {b : X → ℝ} {G : ℕ → X → ℝ} {g : X → ℝ} + (hF : ∀ n, Measurable (F n)) (hb : Measurable b) + (hG : ∀ n, Measurable (G n)) (hg : Measurable g) + (hFb : ∀ n x, 0 ≤ F n x ∧ F n x ≤ 1) + (hbb : ∀ᵐ x ∂μ, 0 ≤ b x ∧ b x ≤ 1) + (hGb : ∀ n p, 0 ≤ G n p ∧ G n p ≤ 1) + (hgb : ∀ p, 0 ≤ g p ∧ g p ≤ 1) + (hw : ∀ v : X → ℝ, Integrable v μ → + Tendsto (fun n => ∫ x, F n x*v x ∂μ) atTop (𝓝 (∫ x, b x*v x ∂μ))) + (hs : Tendsto (fun n => ∫ p, ‖G n p-g p‖ ∂μ) atTop (𝓝 0)) + (hz : ∀ n, ∀ᵐ p ∂μ, F n p*G n p=0) : + ∀ᵐ p ∂μ, b p*g p=0 := by + have hgi : Integrable g (μ) := Integrable.of_bound hg.aestronglyMeasurable 1 + (Eventually.of_forall fun p => by rw [Real.norm_eq_abs,abs_of_nonneg (hgb p).1]; exact (hgb p).2) + have hFi (n : ℕ) : Integrable (fun p : X => F n p*g p) (μ) := by + apply Integrable.of_bound ((hF n).mul hg).aestronglyMeasurable 1 + exact Eventually.of_forall fun p => by + change ‖F n p*g p‖ ≤ 1 + rw [Real.norm_eq_abs,abs_of_nonneg (mul_nonneg (hFb n p).1 (hgb p).1)] + exact (mul_le_of_le_one_left (hgb p).1 (hFb n p).2).trans (hgb p).2 + have hbi : Integrable (fun p : X => b p*g p) (μ) := by + apply Integrable.of_bound (hb.mul hg).aestronglyMeasurable 1 + filter_upwards [hbb] with p hp + change ‖b p*g p‖ ≤ 1 + rw [Real.norm_eq_abs,abs_of_nonneg (mul_nonneg hp.1 (hgb p).1)] + exact (mul_le_of_le_one_left (hgb p).1 hp.2).trans (hgb p).2 + have herr (n : ℕ) : Integrable (fun p => ‖G n p-g p‖) (μ) := by + apply Integrable.of_bound ((hG n).sub hg).norm.aestronglyMeasurable 1 + exact Eventually.of_forall fun p => by + rw [norm_norm,Real.norm_eq_abs,abs_le] + change -1 ≤ G n p-g p ∧ G n p-g p ≤ 1 + constructor <;> linarith [(hGb n p).1,(hGb n p).2,(hgb p).1,(hgb p).2] + have hi0 : Tendsto (fun n => ∫ p, F n p*g p ∂μ) atTop (𝓝 0) := by + apply squeeze_zero (fun n => integral_nonneg fun p => mul_nonneg (hFb n p).1 (hgb p).1) _ hs + intro n + apply integral_mono_ae (hFi n) (herr n) + filter_upwards [hz n] with p hp + rw [Real.norm_eq_abs] + calc + F n p*g p = F n p*(g p-G n p) := by rw [mul_sub,hp,sub_zero] + _ ≤ |g p-G n p| := by + calc + _ ≤ F n p*|g p-G n p| := mul_le_mul_of_nonneg_left (le_abs_self _) (hFb n p).1 + _ ≤ 1*|g p-G n p| := mul_le_mul_of_nonneg_right (hFb n p).2 (abs_nonneg _) + _ = _ := one_mul _ + _ = |G n p-g p| := abs_sub_comm _ _ + have he0 : (∫ p, b p*g p ∂μ)=0 := tendsto_nhds_unique (hw g hgi) hi0 + exact (integral_eq_zero_iff_of_nonneg_ae + (hbb.mono fun p hp => mul_nonneg hp.1 (hgb p).1) hbi).mp he0 +lemma weak_strong_disjoint_single_eventual {X : Type*} [MeasurableSpace X] + {μ : Measure X} [IsFiniteMeasure μ] + {F : ℕ → X → ℝ} {b : X → ℝ} {G : ℕ → X → ℝ} {g : X → ℝ} + (hF : ∀ n, Measurable (F n)) (hb : Measurable b) + (hG : ∀ n, Measurable (G n)) (hg : Measurable g) + (hFb : ∀ n x, 0 ≤ F n x ∧ F n x ≤ 1) + (hbb : ∀ᵐ x ∂μ, 0 ≤ b x ∧ b x ≤ 1) + (hGb : ∀ n p, 0 ≤ G n p ∧ G n p ≤ 1) + (hgb : ∀ p, 0 ≤ g p ∧ g p ≤ 1) + (hw : ∀ v : X → ℝ, Integrable v μ → + Tendsto (fun n => ∫ x, F n x*v x ∂μ) atTop (𝓝 (∫ x, b x*v x ∂μ))) + (hs : Tendsto (fun n => ∫ p, ‖G n p-g p‖ ∂μ) atTop (𝓝 0)) + (hz : ∀ᶠ n in atTop, ∀ᵐ p ∂μ, F n p*G n p=0) : + ∀ᵐ p ∂μ, b p*g p=0 := by + obtain ⟨N,hN⟩ := eventually_atTop.mp hz + exact weak_strong_disjoint_single (fun n => hF (n+N)) hb (fun n => hG (n+N)) hg + (fun n => hFb (n+N)) hbb (fun n => hGb (n+N)) hgb + (fun v hv => (tendsto_add_atTop_iff_nat N).mpr (hw v hv)) + ((tendsto_add_atTop_iff_nat N).mpr hs) (fun n => hN _ (Nat.le_add_left N n)) +end EuclideanFiveColor +end + +noncomputable section +open MeasureTheory Filter Topology Set +open scoped NNReal +namespace EuclideanFiveColor +variable {k : ℕ} (c : ℂ → Fin k) (hc : Measurable c) +lemma palette_trace_branch (hw : WeakColoring k c) {x z : ℂ} {t u a : ℝ} + (h : Real.sin (u-t) ≠ 0) {P : Set CircleParameter} {I : Set ℝ} {K : ℝ≥0} + (hP : P ∈ 𝓝 (samplingParameter x z 1)) + (hI : MeasurableSet I) (hIa : I ⊆ Ioc a (a+2*Real.pi)) + (hA : ∀ q ∈ P, AntilipschitzWith K (I.domRestrict (fun v => circleEndpoint h (q,v)))) + (hB : ∀ q ∈ P, ∀ v ∈ I, circleTarget (q,v) ∈ (circleInverseHomeo h).target ∧ + Real.sin ((circleInverse h (circleTarget (q,v))).2-(circleInverse h (circleTarget (q,v))).1) ≠ 0 ∧ + circleEndpoint h (q,v) ∈ Metric.closedBall t 1) + {b : TraceVector k} (hb : IsTrace c hc z b) (i : Fin k) : + ∀ᵐ f : ℝ ∂volume.restrict I, traceValue b i (f : Angles)* + (liftPalette c hc x i).indicator (fun _ => (1 : ℝ)) (circleEndpoint h (samplingParameter x z 1,f))=0 := by + have : IsFiniteMeasure (volume.restrict I) := isFiniteMeasure_restrict.mpr + (ne_of_lt ((measure_mono (hIa.trans Ioc_subset_Icc_self)).trans_lt isCompact_Icc.measure_lt_top)) + have : IsFiniteMeasure (volume.restrict (Metric.closedBall t 1)) := + isFiniteMeasure_restrict.mpr (isCompact_closedBall t 1).measure_lt_top.ne + have hp : samplingParameter x z 1 ∈ P := mem_of_mem_nhds hP + obtain ⟨y,r,hy,hyt,hrt,hwt⟩ := trace_realization_weakStar c hc hb + let p : ℕ → CircleParameter := fun n => samplingParameter x (y n) (r n) + let p₀ := samplingParameter x z 1 + let T : ℕ → ℝ → ℝ := fun n f => circleEndpoint h (p n,f) + let S : ℝ → ℝ := fun f => circleEndpoint h (p₀,f) + have hpt : Tendsto p atTop (𝓝 p₀) := samplingParameter_tendsto hyt hrt + have hpn : ∀ᶠ n in atTop, p n ∈ P := hpt hP + have hTm (n : ℕ) : Measurable (T n) := + (circleEndpoint_measurable h).comp (measurable_const.prodMk measurable_id) + have hSm : Measurable S := (circleEndpoint_measurable h).comp (measurable_const.prodMk measurable_id) + let D := liftPalette c hc x i + have hDm : MeasurableSet D := liftPalette_measurable c hc x i + have hDind : Measurable (D.indicator (fun _ => (1 : ℝ))) := measurable_const.indicator hDm + have hs : Tendsto (fun n => ∫ f in I, ‖D.indicator (fun _ => (1 : ℝ)) (T n f)- + D.indicator (fun _ => (1 : ℝ)) (S f)‖) atTop (𝓝 0) := by + apply line_indicator_pullback_L1 hTm hSm (isCompact_closedBall t 1) hDm + · exact hpn.mono fun n hn => hA (p n) hn + · exact hA p₀ hp + · exact hpn.mono fun n hn f hf => (hB (p n) hn f hf).2.2 + · exact fun f hf => (hB p₀ hp f hf).2.2 + · filter_upwards [ae_restrict_mem hI] with f hf + exact ((circleInverse_continuousAt h (hB p₀ hp f hf).1).fst.comp + circleTarget_continuous.continuousAt).tendsto.comp (hpt.prodMk_nhds tendsto_const_nhds) + have hz : ∀ᶠ n in atTop, ∀ᵐ f : ℝ ∂volume.restrict I, + sampleFn c (y n) (r n) i (f : Angles)*D.indicator (fun _ => (1 : ℝ)) (T n f)=0 := by + filter_upwards [hpn] with n hn + exact palette_sample_branch_exclusion c hc hw (hy n) i hI + (line_antilipschitz_qmp (hTm n) (hA (p n) hn)) + (fun f hf => (hB (p n) hn f hf).2.1) + (fun f hf => circleInverse_sampling h (hB (p n) hn f hf).1) + have hbb : ∀ᵐ f : ℝ ∂volume.restrict I, 0 ≤ traceValue b i (f : Angles) ∧ traceValue b i (f : Angles) ≤ 1 := + ae_restrict_of_ae (angleMk_quasiMeasurePreserving.ae + (((trace_bounds c hc hb).1 i).and ((trace_bounds c hc hb).2.1 i))) + have hgi (f : ℝ) : 0 ≤ D.indicator (fun _ => (1 : ℝ)) f ∧ D.indicator (fun _ => (1 : ℝ)) f ≤ 1 := by + by_cases hf : f ∈ D <;> simp [hf] + exact weak_strong_disjoint_single_eventual + (fun n => (sampleFn_measurable c hc (y n) (r n) i).comp angleMk_quasiMeasurePreserving.measurable) + ((Lp.stronglyMeasurable (traceValue b i)).measurable.comp angleMk_quasiMeasurePreserving.measurable) + (fun n => hDind.comp (hTm n)) (hDind.comp hSm) + (fun n f => ⟨sampleFn_nonneg c _ _ _ _,sampleFn_le_one c _ _ _ _⟩) hbb + (fun n f => hgi (T n f)) (fun f => hgi (S f)) + (weak_lift_set (hwt i) hI hIa) hs hz +end EuclideanFiveColor +end + +noncomputable section +open MeasureTheory Filter Topology Set +namespace EuclideanFiveColor +variable {k : ℕ} (c : ℂ → Fin k) (hc : Measurable c) +lemma palette_branch_local (hw : WeakColoring k c) {x z : ℂ} {t u a : ℝ} + (h : Real.sin (u-t) ≠ 0) + (he : circleTarget (samplingParameter x z 1,a)=circleSum 1 (t,u)) + (ha : Real.sin (a-u) ≠ 0) : + ∃ I : Set ℝ, IsOpen I ∧ a ∈ I ∧ ∀ i : Fin k, + ∀ᵐ f : ℝ ∂volume.restrict I, + f ∈ liftPalette c hc z i → circleEndpoint h (samplingParameter x z 1,f) ∉ liftPalette c hc x i := by + obtain ⟨P,I,hP,hp,hI,haI,hIa,K,hA,hB⟩ := circleEndpoint_good_neighborhood h he rfl ha + refine ⟨I,hI,haI,fun i => ?_⟩ + have ht : ∀ᵐ f : ℝ ∂volume.restrict I, ∀ b ∈ paletteGenerators c hc z i, + traceValue b.1 i (f : Angles)*(liftPalette c hc x i).indicator (fun _ => (1 : ℝ)) + (circleEndpoint h (samplingParameter x z 1,f))=0 := by + apply (ae_ball_iff (paletteGenerators_countable c hc z i)).mpr + intro b _ + exact palette_trace_branch c hc hw h (hP.mem_nhds hp) hI.measurableSet hIa hA hB b.2 i + filter_upwards [ht] with f hf hfm hxs + obtain ⟨b,hb,hbf⟩ := mem_iUnion₂.mp (show (f : Angles) ∈ paletteSet c hc z i from hfm) + have hz := hf b hb + rw [indicator_of_mem hxs,mul_one] at hz + exact (ne_of_gt hbf) hz +end EuclideanFiveColor +end + +noncomputable section +open Set Filter Topology MeasureTheory +namespace EuclideanFiveColor +lemma circleInverse_left {t u : ℝ} (h : Real.sin (u-t) ≠ 0) {q : RealPlane} + (hq : q ∈ (circleInverseHomeo h).source) : circleInverse h (circleSum 1 q)=q := by + have ht : circleSum 1 q ∈ (circleInverseHomeo h).target := (circleInverseHomeo h).map_source hq + rw [circleInverse_eq h ht] + exact (circleInverseHomeo h).left_inv hq +lemma circleEndpoint_eventuallyEq {x z : ℂ} {a : ℝ} {s t : ℝ → ℝ} + (hs : ContinuousAt s a) (ht : ContinuousAt t a) (h : Real.sin (t a-s a) ≠ 0) + (he : ∀ᶠ f in 𝓝 a, circleTarget (samplingParameter x z 1,f)=circleSum 1 (s f,t f)) : + ∀ᶠ f in 𝓝 a, circleEndpoint h (samplingParameter x z 1,f)=s f := by + have hp : (s a,t a) ∈ (circleInverseHomeo h).source := + (show HasStrictFDerivAt (circleSum 1) + (circleSumDerivEquiv (r := 1) (p := (s a,t a)) (by simpa only [one_mul] using h) : RealPlane →L[ℝ] RealPlane) + (s a,t a) from circleSum_strict 1 (s a,t a)).mem_toOpenPartialHomeomorph_source + have hf := (hs.prodMk ht) ((circleInverseHomeo h).open_source.mem_nhds hp) + filter_upwards [hf,he] with f hf he + simp only [circleEndpoint,he,circleInverse_left h hf] +end EuclideanFiveColor +end + +noncomputable section +open Set Filter Topology MeasureTheory +namespace EuclideanFiveColor +lemma ae_of_locally_ae {X : Type*} [TopologicalSpace X] [SecondCountableTopology X] + [MeasurableSpace X] (μ : Measure X) {S : Set X} {P : X → Prop} + (h : ∀x∈S,∃U : Set X,IsOpen U ∧ x∈U ∧ ∀ᵐy∂μ,y∈U → P y) : + ∀ᵐx∂μ,x∈S → P x := by + choose U ho hm ha using fun x : S => h x x.2 + obtain ⟨T,hT,hcov⟩ := (HereditarilyLindelofSpace.isLindelof S).elim_countable_subcover U ho + (by intro x hx; exact mem_iUnion.mpr ⟨⟨x,hx⟩,hm ⟨x,hx⟩⟩) + have hh : ∀ᵐy∂μ,∀x∈T,y∈U x → P y := (ae_ball_iff hT).mpr (fun x _ => ha x) + filter_upwards [hh] with y hy hs + obtain ⟨x,hx,hyU⟩ := mem_iUnion₂.mp (hcov hs) + exact hy x hx hyU +lemma ae_restrict_of_locally_ae {X : Type*} [TopologicalSpace X] [SecondCountableTopology X] + [MeasurableSpace X] [BorelSpace X] {μ : Measure X} {S : Set X} {P : X → Prop} + (hS : MeasurableSet S) + (h : ∀x∈S,∃U : Set X,IsOpen U ∧ x∈U ∧ ∀ᵐy∂μ.restrict U,P y) : + ∀ᵐx∂μ.restrict S,P x := by + apply (ae_restrict_iff' hS).mpr + apply ae_of_locally_ae μ + intro x hx + obtain ⟨U,hU,hxU,ha⟩ := h x hx + exact ⟨U,hU,hxU,(ae_restrict_iff' hU.measurableSet).mp ha⟩ +end EuclideanFiveColor +end + +noncomputable section +open MeasureTheory Filter Topology Set +namespace EuclideanFiveColor +variable {k : ℕ} (c : ℂ → Fin k) (hc : Measurable c) +lemma palette_transport_real (hw : WeakColoring k c) {x z : ℂ} {U : Set ℝ} (hU : IsOpen U) + {s t : ℝ → ℝ} (hs : ContinuousOn s U) (ht : ContinuousOn t U) + (hnp : ∀ a ∈ U, Real.sin (t a-s a) ≠ 0) + (hss : ∀ a ∈ U, Real.sin (a-t a) ≠ 0) + (he : ∀ a ∈ U, circleTarget (samplingParameter x z 1,a)=circleSum 1 (s a,t a)) (i : Fin k) : + ∀ᵐ f : ℝ ∂volume.restrict U, f ∈ liftPalette c hc z i → s f ∉ liftPalette c hc x i := by + apply ae_restrict_of_locally_ae hU.measurableSet + intro a ha + obtain ⟨I,hI,haI,hb⟩ := palette_branch_local c hc hw (hnp a ha) (he a ha) (hss a ha) + have heq := circleEndpoint_eventuallyEq (hs.continuousAt (hU.mem_nhds ha)) + (ht.continuousAt (hU.mem_nhds ha)) (hnp a ha) + ((show ∀ᶠ f in 𝓝 a, f ∈ U from hU.mem_nhds ha).mono fun f hf => he f hf) + obtain ⟨V,hV,hVo,haV⟩ := mem_nhds_iff.mp heq + refine ⟨I ∩ V,hI.inter hVo,⟨haI,haV⟩,?_⟩ + have hb' := ae_restrict_of_ae_restrict_of_subset (s := I ∩ V) (t := I) inter_subset_left (hb i) + filter_upwards [hb',ae_restrict_mem (hI.inter hVo).measurableSet] with f hf hfI + rw [hV hfI.2] at hf + exact hf +end EuclideanFiveColor +end + +noncomputable section +open Filter Topology Set MeasureTheory +namespace EuclideanFiveColor +lemma endpoint_fiber_nonzero {x z : ℂ} {a ds dt : ℝ} {s t : ℝ → ℝ} + (hs : HasDerivAt s ds a) (ht : HasDerivAt t dt a) (hds : ds ≠ 0) + (hn : Real.sin (t a-s a) ≠ 0) + (he : ∀ᶠ f in 𝓝 a, circleTarget (samplingParameter x z 1,f)=circleSum 1 (s f,t f)) : + Real.sin (a-t a) ≠ 0 := by + have hv : HasDerivAt (fun f => circleTarget (samplingParameter x z 1,f)) + (-Real.sin a,Real.cos a) a := by + simpa only [circleTarget,samplingParameter,one_smul] using + ((Real.hasDerivAt_cos a).prodMk (Real.hasDerivAt_sin a)).const_add (Complex.equivRealProdCLM (z-x)) + have hc₁ := (Real.hasDerivAt_cos (s a)).comp a hs + have hc₂ := (Real.hasDerivAt_cos (t a)).comp a ht + have hs₁ := (Real.hasDerivAt_sin (s a)).comp a hs + have hs₂ := (Real.hasDerivAt_sin (t a)).comp a ht + have hw : HasDerivAt (fun f => circleSum 1 (s f,t f)) + (-Real.sin (s a)*ds+-Real.sin (t a)*dt,Real.cos (s a)*ds+Real.cos (t a)*dt) a := by + have h := (hc₁.add hc₂).prodMk (hs₁.add hs₂) + convert h using 1; simp [circleSum,Function.comp_def] + have hd := (hv.congr_of_eventuallyEq (Filter.EventuallyEq.symm he)).unique hw + have h₁ := congrArg Prod.fst hd + have h₂ := congrArg Prod.snd hd + dsimp only at h₁ h₂ + have hid : Real.sin (a-t a)=ds*Real.sin (s a-t a) := by + rw [Real.sin_sub,Real.sin_sub] + linear_combination -(Real.cos (t a))*h₁-(Real.sin (t a))*h₂ + rw [hid] + apply mul_ne_zero hds + rw [show s a-t a=-(t a-s a) by ring,Real.sin_neg,neg_ne_zero] + exact hn +end EuclideanFiveColor +end + +noncomputable section +open MeasureTheory Filter Topology Set +namespace EuclideanFiveColor +variable {k : ℕ} (c : ℂ → Fin k) (hc : Measurable c) +lemma palette_smooth_transport (hw : WeakColoring k c) {x z : ℂ} {U : Set ℝ} (hU : IsOpen U) + {s t ds dt : ℝ → ℝ} (hs : ∀ a ∈ U, HasDerivAt s (ds a) a) + (ht : ∀ a ∈ U, HasDerivAt t (dt a) a) (hds : ∀ a ∈ U, ds a ≠ 0) + (hnp : ∀ a ∈ U, Real.sin (t a-s a) ≠ 0) + (he : ∀ a ∈ U, circleTarget (samplingParameter x z 1,a)=circleSum 1 (s a,t a)) (i : Fin k) : + ∀ᵐ f : ℝ ∂volume.restrict U, f ∈ liftPalette c hc z i → s f ∉ liftPalette c hc x i := by + apply palette_transport_real c hc hw hU (fun a ha => (hs a ha).continuousAt.continuousWithinAt) + (fun a ha => (ht a ha).continuousAt.continuousWithinAt) hnp ?_ he i + intro a ha + exact endpoint_fiber_nonzero (hs a ha) (ht a ha) (hds a ha) (hnp a ha) + ((show ∀ᶠ f in 𝓝 a, f ∈ U from hU.mem_nhds ha).mono fun f hf => he f hf) +end EuclideanFiveColor +end + +noncomputable section +open MeasureTheory Set Filter Topology +namespace EuclideanFiveColor +lemma palette_transport_param {k : ℕ} (c : ℂ → Fin k) (hc : Measurable c) (hw : WeakColoring k c) + {x z : ℂ} {a s t Da Ds Dt : ℝ → ℝ} + (ha : ∀ r, HasDerivAt a (Da r) r) (hpos : ∀ r, (1/2 : ℝ) ≤ Da r) + (hs : ∀ r, HasDerivAt s (Ds r) r) (ht : ∀ r, HasDerivAt t (Dt r) r) + (hDs : ∀ r, Ds r ≠ 0) (hnp : ∀ r, Real.sin (t r-s r) ≠ 0) + (he : ∀ r, circleTarget (samplingParameter x z 1,a r)=circleSum 1 (s r,t r)) (i : Fin k) : + ∀ᵐ r : ℝ ∂volume, a r ∈ liftPalette c hc z i → s r ∉ liftPalette c hc x i := by + let e := derivLowerOrderIso ha hpos + have heq : ∀ r, e r=a r := fun _ => rfl + have hinv : ∀ y, HasDerivAt e.symm (Da (e.symm y))⁻¹ y := by + intro y + apply HasDerivAt.of_local_left_inverse e.symm.continuous.continuousAt (ha (e.symm y)) + (ne_of_gt (lt_of_lt_of_le (by norm_num) (hpos _))) + exact Filter.Eventually.of_forall fun r => by rw [← heq,e.apply_symm_apply] + have h := palette_smooth_transport c hc hw (x := x) (z := z) isOpen_univ + (s := s ∘ e.symm) (t := t ∘ e.symm) + (fun y _ => (hs _).comp y (hinv y)) (fun y _ => (ht _).comp y (hinv y)) + (fun y _ => mul_ne_zero (hDs _) (inv_ne_zero (ne_of_gt (lt_of_lt_of_le (by norm_num) (hpos _))))) + (fun y _ => hnp _) (fun y _ => by simpa only [Function.comp_apply,← heq,e.apply_symm_apply] using he (e.symm y)) i + rw [Measure.restrict_univ] at h + have h' := (deriv_lower_qmp ha hpos).ae h + simpa only [Function.comp_apply,← heq,e.symm_apply_apply] using h' +end EuclideanFiveColor +end + +noncomputable section +open Filter Topology Set MeasureTheory +namespace EuclideanFiveColor +def sixty : ℝ := Real.pi/3 +lemma sin_sixty_ne : Real.sin sixty ≠ 0 := by + rw [sixty,Real.sin_pi_div_three] + positivity +lemma sin_twice_sixty_ne : Real.sin (2*sixty) ≠ 0 := by + rw [Real.sin_two_mul,sixty,Real.sin_pi_div_three,Real.cos_pi_div_three] + positivity +lemma sixty_sum (x : ℂ) (a : ℝ) : + circleTarget (samplingParameter x x 1,a)=circleSum 1 (a+sixty,a-sixty) := by + simp only [circleTarget,samplingParameter,sub_self,map_zero,one_smul,zero_add] + ext <;> simp only [circleSum,one_mul,Real.cos_add,Real.cos_sub,Real.sin_add,Real.sin_sub] + · rw [sixty,Real.cos_pi_div_three] + ring + · rw [sixty,Real.cos_pi_div_three] + ring +end EuclideanFiveColor +end + +noncomputable section +open Filter Topology Set MeasureTheory +namespace EuclideanFiveColor +lemma ae_angular_of_ae_line {p : Angles → Prop} (hp : MeasurableSet {t | p t}) + (h : ∀ᵐ t : ℝ ∂volume, p (t : Angles)) : ∀ᵐ t ∂angularMeasure, p t := by + have hh : ∀ᵐ t ∂(volume : Measure Angles), p t := by + rw [← (AddCircle.measurePreserving_mk (2*Real.pi) 0).map_eq] + exact (ae_map_iff (AddCircle.measurePreserving_mk (2*Real.pi) 0).measurable.aemeasurable hp).mpr + (ae_restrict_of_ae h) + rw [AddCircle.volume_eq_smul_haarAddCircle] at hh + exact (Measure.ae_ennreal_smul_measure_iff (by positivity : ENNReal.ofReal (2*Real.pi) ≠ 0)).mp hh +lemma ae_sin_sub_ne_zero (t : ℝ) : ∀ᵐ a : ℝ ∂volume, Real.sin (a-t) ≠ 0 := by + have hs : {a : ℝ | Real.sin (a-t)=0} ⊆ range (fun n : ℤ => t+n*Real.pi) := by + intro a ha + obtain ⟨n,hn⟩ := Real.sin_eq_zero_iff.mp ha + exact ⟨n,by linarith⟩ + change volume {a : ℝ | ¬Real.sin (a-t) ≠ 0}=0 + simpa only [not_not] using measure_mono_null hs ((countable_range _).measure_zero volume) +end EuclideanFiveColor +end + +noncomputable section +open MeasureTheory Filter Topology Set +namespace EuclideanFiveColor +variable {k : ℕ} (c : ℂ → Fin k) (hc : Measurable c) +lemma palette_sixty_real (hw : WeakColoring k c) (x : ℂ) (i : Fin k) : + ∀ᵐ f : ℝ ∂volume, f ∈ liftPalette c hc x i → f+sixty ∉ liftPalette c hc x i := by + have h := palette_transport_real c hc hw (x := x) (z := x) isOpen_univ + (s := fun a => a+sixty) (t := fun a => a-sixty) + (continuous_id.add continuous_const).continuousOn (continuous_id.sub continuous_const).continuousOn + (fun a _ => by + rw [show (a-sixty)-(a+sixty)=-(2*sixty) by ring,Real.sin_neg,neg_ne_zero] + exact sin_twice_sixty_ne) + (fun a _ => by simpa only [sub_sub_cancel] using sin_sixty_ne) + (fun a _ => sixty_sum x a) i + simpa only [Measure.restrict_univ] using h +lemma palette_sixty (hw : WeakColoring k c) (x : ℂ) (i : Fin k) : + ∀ᵐ f ∂angularMeasure, f ∈ paletteSet c hc x i → f+(sixty : Angles) ∉ paletteSet c hc x i := by + apply ae_angular_of_ae_line + · simpa only [imp_iff_not_or,Set.compl_def,Set.union_def,Set.preimage,Function.id_def,Set.mem_ofPred_eq] using (paletteSet_measurable c hc x i).compl.union + (((paletteSet_measurable c hc x i).preimage (measurable_id.add_const (sixty : Angles))).compl) + · simpa only [liftPalette,mem_preimage,AddCircle.coe_add] using palette_sixty_real c hc hw x i +lemma palette_sixty_disjoint (hw : WeakColoring k c) (x : ℂ) : + ∀ᵐ f ∂angularMeasure, Disjoint (palette c hc x f) (palette c hc x (f+(sixty : Angles))) := by + filter_upwards [ae_all_iff.mpr (fun i => palette_sixty c hc hw x i)] with f hf + exact Finset.disjoint_left.mpr fun i hi hj => hf i ((mem_palette c hc x f i).mp hi) + ((mem_palette c hc x (f+(sixty : Angles)) i).mp hj) +end EuclideanFiveColor +end + +end OAI diff --git a/lean/OAI/Geometry/PlaneColoring/Palettes.lean b/lean/OAI/Geometry/PlaneColoring/Palettes.lean new file mode 100644 index 0000000000000000000000000000000000000000..9ea57bc871baed5237d7b3cca892cb628057bbf9 --- /dev/null +++ b/lean/OAI/Geometry/PlaneColoring/Palettes.lean @@ -0,0 +1,124 @@ +import OAI.Geometry.PlaneColoring.Transitions + +namespace OAI + +noncomputable section +open MeasureTheory Filter Topology +namespace EuclideanFiveColor +variable {k : ℕ} (c : ℂ → Fin k) (hc : Measurable c) +abbrev Traces (x : ℂ) := {b : TraceVector k // IsTrace c hc x b} +def tracePositive (x : ℂ) (i : Fin k) (b : Traces c hc x) : Set Angles := + {t | 0 < traceValue b.1 i t} +lemma tracePositive_measurable (x : ℂ) (i : Fin k) (b : Traces c hc x) : + MeasurableSet (tracePositive c hc x i b) := + measurableSet_lt measurable_const (Lp.stronglyMeasurable _).measurable +def paletteGenerators (x : ℂ) (i : Fin k) : Set (Traces c hc x) := + (exists_countable_essential_union angularMeasure (tracePositive c hc x i) (tracePositive_measurable c hc x i)).choose +lemma paletteGenerators_countable (x : ℂ) (i : Fin k) : (paletteGenerators c hc x i).Countable := + (exists_countable_essential_union angularMeasure (tracePositive c hc x i) (tracePositive_measurable c hc x i)).choose_spec.1 +def paletteSet (x : ℂ) (i : Fin k) : Set Angles := + ⋃ b ∈ paletteGenerators c hc x i, tracePositive c hc x i b +lemma paletteSet_measurable (x : ℂ) (i : Fin k) : MeasurableSet (paletteSet c hc x i) := + MeasurableSet.biUnion (paletteGenerators_countable c hc x i) (fun b _ => tracePositive_measurable c hc x i b) +lemma tracePositive_le_palette (x : ℂ) (i : Fin k) (b : Traces c hc x) : + tracePositive c hc x i b ≤ᵐ[angularMeasure] paletteSet c hc x i := + (exists_countable_essential_union angularMeasure (tracePositive c hc x i) (tracePositive_measurable c hc x i)).choose_spec.2 b +lemma paletteSet_minimal (x : ℂ) (i : Fin k) {A : Set Angles} + (hA : ∀ b : Traces c hc x, tracePositive c hc x i b ≤ᵐ[angularMeasure] A) : + paletteSet c hc x i ≤ᵐ[angularMeasure] A := by + have hh : ∀ᵐ t ∂angularMeasure, ∀ b ∈ paletteGenerators c hc x i, t ∈ tracePositive c hc x i b → t ∈ A := + (ae_ball_iff (paletteGenerators_countable c hc x i)).mpr (fun b _ => hA b) + filter_upwards [hh] with t ht + intro hm + rcases Set.mem_iUnion₂.mp hm with ⟨b,hb,hbt⟩ + exact ht b hb hbt +def palette (x : ℂ) (t : Angles) : Finset (Fin k) := by + classical + exact Finset.univ.filter (fun i => t ∈ paletteSet c hc x i) +@[simp] lemma mem_palette (x : ℂ) (t : Angles) (i : Fin k) : + i ∈ palette c hc x t ↔ t ∈ paletteSet c hc x i := by simp [palette] +lemma palette_nonempty (x : ℂ) : ∀ᵐ t ∂angularMeasure, (palette c hc x t).Nonempty := by + obtain ⟨b,hb⟩ := exists_trace c hc x + let B : Traces c hc x := ⟨b,hb⟩ + have hsum := (trace_bounds c hc hb).2.2 + have hs : (fun t => ∑ i, traceValue b i t) =ᵐ[angularMeasure] (fun _ => (1 : ℝ)) := by + have hh := Lp.coeFn_fun_finsetSum Finset.univ (traceValue b) + rw [hsum] at hh + exact hh.symm.trans (oneL2_ae angularMeasure) + filter_upwards [hs,ae_all_iff.mpr (fun i => tracePositive_le_palette c hc x i B)] with t ht hP + have he : ∃ i : Fin k, 0 < traceValue b i t := by + by_contra! hh + have hz : (∑ i, traceValue b i t) ≤ 0 := Finset.sum_nonpos (fun i _ => hh i) + linarith + obtain ⟨i,hi⟩ := he + exact ⟨i,(mem_palette c hc x t i).mpr ((hP i) hi)⟩ +end EuclideanFiveColor +end + +noncomputable section +open MeasureTheory Filter Topology +open scoped RealInnerProductSpace +namespace EuclideanFiveColor +variable {k : ℕ} (c : ℂ → Fin k) (hc : Measurable c) +lemma inner_oneL2_integral (f : RealL2 angularMeasure) : + ⟪f,oneL2 angularMeasure⟫ = ∫ t, f t ∂angularMeasure := by + rw [real_inner_comm] + exact (L2.inner_indicatorConstLp_one MeasurableSet.univ (measure_ne_top angularMeasure Set.univ) f).trans + (by simp) +lemma sample_inner_one (i : Fin k) (q : ℂ) : + ⟪sample c hc q 1 i,oneL2 angularMeasure⟫ = colorMass c i q := by + rw [inner_oneL2_integral] + exact integral_congr_ae (sample_ae c hc q 1 i) +lemma transition_avoiding_trace (hw : WeakColoring k c) {i j : Fin k} {x : ℂ} + (he : TransitionEdge c i j x) : + ∃ b : TraceVector k, IsTrace c hc x b ∧ traceValue b i=0 ∧ traceValue b j=0 := by + obtain ⟨q,hq⟩ := Classical.axiomOfChoice (fun n : ℕ => transition_small_mass c hc hw he + (R := 1/((n:ℝ)+1)) (ε := 1/((n:ℝ)+1)) (by positivity) (by positivity)) + have hqt : Tendsto q atTop (𝓝 x) := by + rw [tendsto_iff_dist_tendsto_zero] + apply squeeze_zero (fun n => dist_nonneg) + (fun n => (hq n).1.le) + exact tendsto_one_div_add_atTop_nhds_zero_nat + obtain ⟨b,_,φ,hφ,hb⟩ := (isCompact_univ : IsCompact (Set.univ : Set (TraceVector k))).isSeqCompact.subseq_of_frequently_in + (Eventually.frequently (Eventually.of_forall fun n => Set.mem_univ (sampleCode c hc (q n) 1))) + have htrace : IsTrace c hc x b := trace_of_realization c hc + (fun n => (hq (φ n)).2.1) (hqt.comp hφ.tendsto_atTop) tendsto_const_nhds hb + have hmass (a : Fin k) (ha : a=i ∨ a=j) : ∫ t, traceValue b a t ∂angularMeasure = 0 := by + have ht := (traceCode_tendsto_iff.mp hb) a (oneL2 angularMeasure) + simp only [Function.comp_apply,traceValue_sampleCode,sample_inner_one] at ht + rw [inner_oneL2_integral] at ht + have ht' : Tendsto (fun n => colorMass c a (q n)) atTop (𝓝 0) := by + apply squeeze_zero (fun n => colorMass_nonneg c a (q n)) (fun n => ?_) + tendsto_one_div_add_atTop_nhds_zero_nat + rcases ha with rfl | rfl + · exact (le_add_of_nonneg_right (colorMass_nonneg c j (q n))).trans (hq n).2.2.le + · exact (le_add_of_nonneg_left (colorMass_nonneg c i (q n))).trans (hq n).2.2.le + exact tendsto_nhds_unique ht (ht'.comp hφ.tendsto_atTop) + have hzero (a : Fin k) (ha : a=i ∨ a=j) : traceValue b a=0 := by + apply Lp.ext + have hi : Integrable (traceValue b a) angularMeasure := (Lp.memLp _).integrable (by norm_num) + have hz := (integral_eq_zero_iff_of_nonneg_ae ((trace_bounds c hc htrace).1 a) hi).mp (hmass a ha) + exact hz.trans (Lp.coeFn_zero ℝ 2 angularMeasure).symm + exact ⟨b,htrace,hzero i (Or.inl rfl),hzero j (Or.inr rfl)⟩ +lemma edge_palette_not_pair (hw : WeakColoring k c) {i j : Fin k} {x : ℂ} + (he : TransitionEdge c i j x) : ∀ᵐ t ∂angularMeasure, ¬ palette c hc x t ⊆ {i,j} := by + obtain ⟨b,hb,hi,hj⟩ := transition_avoiding_trace c hc hw he + have hs : (fun t => ∑ a, traceValue b a t) =ᵐ[angularMeasure] (fun _ => (1 : ℝ)) := by + have hh := Lp.coeFn_fun_finsetSum Finset.univ (traceValue b) + rw [(trace_bounds c hc hb).2.2] at hh + exact hh.symm.trans (oneL2_ae angularMeasure) + have hzi : traceValue b i =ᵐ[angularMeasure] (fun _ => (0:ℝ)) := by rw [hi]; exact Lp.coeFn_zero _ _ _ + have hzj : traceValue b j =ᵐ[angularMeasure] (fun _ => (0:ℝ)) := by rw [hj]; exact Lp.coeFn_zero _ _ _ + filter_upwards [hs,hzi,hzj,ae_all_iff.mpr (fun a => tracePositive_le_palette c hc x a ⟨b,hb⟩)] with t ht hi0 hj0 hp hsub + have hnon : ∀ a : Fin k, traceValue b a t ≤ 0 := by + intro a + by_contra! ha + have ham := hsub ((mem_palette c hc x t a).mpr (hp a ha)) + simp only [Finset.mem_insert,Finset.mem_singleton] at ham + rcases ham with rfl | rfl <;> linarith + have hh := Finset.sum_nonpos (s := Finset.univ) (fun a _ => hnon a) + linarith +end EuclideanFiveColor +end + +end OAI diff --git a/lean/OAI/Geometry/PlaneColoring/PlanarCovers.lean b/lean/OAI/Geometry/PlaneColoring/PlanarCovers.lean new file mode 100644 index 0000000000000000000000000000000000000000..63b9f996a82d11c410e191c4fdef1f7aa1eba075 --- /dev/null +++ b/lean/OAI/Geometry/PlaneColoring/PlanarCovers.lean @@ -0,0 +1,402 @@ +import OAI.Geometry.PlaneColoring.DiskAverages + +namespace OAI + +noncomputable section +open Set +open scoped NNReal ENNReal +namespace EuclideanFiveColor +lemma finite_packed_cover {X : Type*} [MetricSpace X] {A : Set X} (hA : TotallyBounded A) + {ρ : ℝ} (hρ : 0<ρ) : ∃ C : Finset X, (↑C : Set X)⊆A ∧ + (∀ x∈A, ∃ c∈C, dist x c≤ρ) ∧ + (↑C : Set X).Pairwise (fun x y => ρ diskAverage c ε i q*diskAverage c ε j q) (Metric.ball x r) := by + let : IsFiniteMeasure (volume.restrict (Metric.ball x r)) := ⟨by simpa using (lt_top_iff_ne_top.mpr (ball_ne_top x r))⟩ + apply Integrable.of_bound (((diskAverage_lipschitz hc hε i).continuous.mul + (diskAverage_lipschitz hc hε j).continuous).aestronglyMeasurable) 1 + exact Eventually.of_forall fun q => by + change ‖diskAverage c ε i q*diskAverage c ε j q‖≤1 + rw [Real.norm_eq_abs,abs_of_nonneg (mul_nonneg (diskAverage_nonneg c ε i q) (diskAverage_nonneg c ε j q))] + exact (mul_le_of_le_one_left (diskAverage_nonneg c ε j q) + (diskAverage_le_one hc hε i q)).trans (diskAverage_le_one hc hε j q) +lemma finite_disk_overlap_cover (hc : Measurable c) {ε α : ℝ} (hε : 0<ε) (hα : 0<α) + (i j : Fin k) (x : ℂ) {s r : ℝ} (hr : s+α*ε/16≤r) : + ∃ C : Finset ℂ, (∀ q∈Metric.ball x s, + α Metric.ball_subset_closedBall hq.1)) hρ + have hsub : ∀ z∈C, Metric.ball z (ρ/2)⊆Metric.ball x r := by + intro z hz q hq + have hz' := (hCA hz).1 + have hq' : dist q z<ρ/2 := hq + have hz'' : dist z x Metric.ball z (ρ/2)) := by + intro z hz w hw hne + apply Set.disjoint_left.mpr + intro q hq hq' + have hh := dist_triangle z q w + have h₁ : dist q z<ρ/2 := hq + have h₂ : dist q w<ρ/2 := hq' + rw [dist_comm z q] at hh + linarith [hsep hz hw hne] + have hint : (C.card:ℝ)*(Real.pi*(ρ/2)^2*(α^2/4)) ≤ + ∫ q in Metric.ball x r, diskAverage c ε i q*diskAverage c ε j q := by + calc (C.card:ℝ)*(Real.pi*(ρ/2)^2*(α^2/4)) = + ∑ z∈C, ∫ _q in Metric.ball z (ρ/2), (α^2/4) := by + simp only [setIntegral_const,smul_eq_mul,volumeReal_ball _ (by positivity : 0≤ρ/2)] + simp + _ ≤ ∑ z∈C, ∫ q in Metric.ball z (ρ/2), diskAverage c ε i q*diskAverage c ε j q := by + apply Finset.sum_le_sum + intro z hz + apply setIntegral_mono_on (integrableOn_const (ball_ne_top z (ρ/2))) + (diskAverage_product_integrable hc hε i j z (ρ/2)) measurableSet_ball + exact hlow z hz + _ = ∫ q in ⋃ z∈C, Metric.ball z (ρ/2), diskAverage c ε i q*diskAverage c ε j q := by + exact (integral_biUnion_finset C (fun _ _ => measurableSet_ball) hdj + (fun z _ => diskAverage_product_integrable hc hε i j z (ρ/2))).symm + _ ≤ _ := setIntegral_mono_set (diskAverage_product_integrable hc hε i j x r) + (Eventually.of_forall fun q => mul_nonneg (diskAverage_nonneg c ε i q) (diskAverage_nonneg c ε j q)) + (Eventually.of_forall (fun q hq => by + obtain ⟨z,hz,hq⟩ := mem_iUnion₂.mp hq + exact hsub z hz hq)) + refine ⟨C,?_,?_⟩ + · intro q hq hi hj + obtain ⟨z,hz,hd⟩ := hcover q ⟨hq,hi,hj⟩ + refine ⟨z,hz,?_⟩ + change dist q z<α*ε/4 + dsimp [ρ] at hd + nlinarith [mul_pos hα hε] + · have hconst : 00, ∀ s0, ∀ η>0, + ∃ δ>0, ∀ ε, 0<ε → ε<δ → ∃ C : Finset ℂ, + (∀ q∈Metric.ball x s, α ?_⟩ + let r := (s+R)/2 + have hsr : s] 0, s+α*ε/16 s+α*ε/16) (𝓝[>] 0) (𝓝 s) := by + have hid : Tendsto (fun ε : ℝ => ε) (𝓝[>] 0) (𝓝 0) := nhdsWithin_le_nhds + simpa using (tendsto_const_nhds (x := s)).add ((hid.const_mul α).div_const 16) + exact ht'.eventually (gt_mem_nhds hsr) + obtain ⟨δ,hδ,hd⟩ := Metric.mem_nhdsWithin_iff.mp (he₁.and he₂) + refine ⟨δ,hδ,fun ε hε hεδ => ?_⟩ + have hε' := hd (show ε∈Metric.ball 0 δ∩Ioi 0 from ⟨by simpa [Real.dist_eq,abs_of_pos hε] using hεδ,hε⟩) + obtain ⟨C,hC,hb⟩ := finite_disk_overlap_cover hc hε hα i j x hε'.2.le + exact ⟨C,hC,hb.trans_lt hε'.1⟩ +end EuclideanFiveColor +end + +noncomputable section +open Set Filter Topology +namespace PlanarCover +lemma ball_simplyConnected (y : ℂ) {r : ℝ} (hr : 0 < r) : + IsSimplyConnected (Metric.ball y r) := by + let := (convex_ball y r).contractibleSpace (Metric.nonempty_ball.mpr hr) + change SimplyConnectedSpace (Metric.ball y r) + infer_instance +lemma hit_center {F : ℂ → ℂ} {y : ℂ} + (hc : ContinuousOn F (Metric.ball y 4)) + (hb : ∀ z ∈ Metric.ball y 4, ‖F z-z‖ ≤ 2) : + y ∈ F '' Metric.ball y 4 := by + by_contra hn + have hzero : 0 ∉ (fun z => F z-y) '' Metric.ball y 4 := by + rintro ⟨z,hz,he⟩ + apply hn + exact ⟨z,hz,sub_eq_zero.mp he⟩ + obtain ⟨L,hLc,hL⟩ := Complex.exists_continuousOn_eqOn_exp_comp + (ball_simplyConnected y (by norm_num : (0:ℝ)<4)) Metric.isOpen_ball + (hc.sub continuousOn_const) hzero + let e : ℝ → ℂ := fun t => Complex.exp (t*Complex.I) + have ec : Continuous e := by fun_prop + have en (t : ℝ) : ‖e t‖ = 1 := by simp [e,Complex.norm_exp] + let γ : ℝ → ℂ := fun t => y+3*e t + have γc : Continuous γ := by fun_prop + have γmem (t : ℝ) : γ t ∈ Metric.ball y 4 := by + norm_num [γ,Metric.mem_ball,dist_eq_norm,en] + let H : ℝ → ℂ := fun t => (F (γ t)-y) / e t + have Hc : Continuous H := (hc.comp_continuous γc γmem).sub continuous_const |>.div ec (fun t => Complex.exp_ne_zero _) + have Hnear (t : ℝ) : ‖H t-3‖ ≤ 2 := by + have he : e t ≠ 0 := Complex.exp_ne_zero _ + have h : H t-3 = (F (γ t)-γ t)/e t := by dsimp [H,γ]; field_simp; ring + rw [h,norm_div,en,div_one] + exact hb _ (γmem t) + have Hpos (t : ℝ) : 0 < (H t).re := by + have : |(H t-3).re| ≤ 2 := (Complex.abs_re_le_norm (H t-3)).trans (Hnear t) + have := (abs_le.mp this).1 + norm_num at this + linarith + have Hslit (t : ℝ) : H t ∈ Complex.slitPlane := Or.inl (Hpos t) + have logHc : Continuous (fun t => Complex.log (H t)) := + Hc.clog Hslit + let d : ℝ → ℂ := fun t => L (γ t) - Complex.log (H t) - t*Complex.I + have dc : Continuous d := ((hLc.comp_continuous γc γmem).sub logHc).sub (by fun_prop) + have de (t : ℝ) : Complex.exp (d t) = 1 := by + have hH : H t ≠ 0 := fun hz => by have := Hpos t; simp [hz] at this + have hLe : Complex.exp (L (γ t)) = F (γ t)-y := hL (γmem t) + simp only [d,Complex.exp_sub,Complex.exp_log hH,hLe] + change (F (γ t)-y) / ((F (γ t)-y)/e t) / e t = 1 + have hF : F (γ t)-y ≠ 0 := fun hz => hzero ⟨_,γmem t,hz⟩ + have he : e t ≠ 0 := Complex.exp_ne_zero _ + field_simp + have hconst : d 0 = d (2*Real.pi) := + Complex.isCoveringMap_exp.constOn_of_comp isPreconnected_univ dc.continuousOn + (fun a _ b _ => Subtype.ext ((de a).trans (de b).symm)) (mem_univ _) (mem_univ _) + have e0 : e 0 = 1 := by simp [e] + have e2 : e (2*Real.pi) = 1 := by simp [e,Complex.exp_two_pi_mul_I] + have γeq : γ (2*Real.pi) = γ 0 := by dsimp [γ]; rw [e0,e2] + have Heq : H (2*Real.pi) = H 0 := by dsimp [H]; rw [γeq,e0,e2] + dsimp [d] at hconst + rw [γeq,Heq] at hconst + have hi := congrArg Complex.im hconst + norm_num at hi + nlinarith [Real.pi_pos] +end PlanarCover +end + +noncomputable section +open Set MeasureTheory MeasureTheory.Measure +namespace PlanarCover +lemma affinePair_null (a b : ℂ) : volume (affineSpan ℝ ({a,b} : Set ℂ) : Set ℂ)=0 := by + apply addHaar_affineSubspace volume + intro he + have hd : Submodule.span ℝ ({a-b} : Set ℂ)=⊤ := by + change Submodule.span ℝ ({a -ᵥ b} : Set ℂ)=⊤ + rw [← vectorSpan_pair ℝ a b,← direction_affineSpan,he] + exact AffineSubspace.direction_top _ _ _ + have hf := finrank_span_le_card (R := ℝ) ({a-b} : Set ℂ) + rw [hd,finrank_top,Complex.finrank_real_complex] at hf + norm_num at hf +lemma hit_center_subtype {Q : Set ℂ} {y : ℂ} (hQ : Metric.ball y 4 ⊆ Q) + {F : Q → ℂ} (hc : Continuous F) (hb : ∀ z, ‖F z-z.val‖ ≤ 2) : + y ∈ Set.range F := by + classical + let g : ℂ → ℂ := fun z => if hz:z∈Q then F ⟨z,hz⟩ else 0 + have ge (z : ℂ) (hz : z∈Q) : g z=F ⟨z,hz⟩ := dite_eq_left hz + have hgc : ContinuousOn g (Metric.ball y 4) := by + rw [continuousOn_iff_continuous_domRestrict] + have hh := hc.comp (continuous_subtype_val.subtype_mk (fun z : Metric.ball y 4 => hQ z.property)) + convert hh using 1 + ext z + exact ge _ (hQ z.property) + obtain ⟨z,hz,he⟩ := hit_center hgc (fun z hz => by rw [ge _ (hQ hz)]; exact hb _) + exact ⟨⟨z,hQ hz⟩,by rwa [ge _ (hQ hz)] at he⟩ +lemma small_support_pair {ι : Type*} [DecidableEq ι] {s : Finset ι} + (hs : s.Nonempty) (hc : s.card≤2) : ∃ a b, s ⊆ {a,b} := by + by_cases h1 : s.card=1 + · obtain ⟨a,rfl⟩ := Finset.card_eq_one.mp h1 + exact ⟨a,a,by simp⟩ + · have h2 : s.card=2 := by have := hs.card_pos; omega + obtain ⟨a,b,_,rfl⟩ := Finset.card_eq_two.mp h2 + exact ⟨a,b,Finset.Subset.refl _⟩ +lemma barycenter_two {ι : Type*} [Fintype ι] (p : ι → ℂ) (w : ι → ℝ) + (hn : ∀ i,0≤w i) (hs : ∑ i,w i=1) + (hcard : (Finset.univ.filter (fun i => w i≠0)).card≤2) : + ∑ i,w i • p i ∈ ⋃ a, ⋃ b, (affineSpan ℝ ({p a,p b} : Set ℂ) : Set ℂ) := by + classical + let s := Finset.univ.filter (fun i => w i≠0) + have hsw : ∑ i ∈ s, w i = ∑ i, w i := by + apply Finset.sum_subset (Finset.filter_subset _ _) + intro i _ hi + simpa [s] using hi + have hsv : ∑ i∈s,w i=1 := hsw.trans hs + have hne : s.Nonempty := by + by_contra he + rw [Finset.not_nonempty_iff_eq_empty.mp he,Finset.sum_empty] at hsv + exact zero_ne_one hsv + obtain ⟨a,b,hab⟩ := small_support_pair hne hcard + refine mem_iUnion.mpr ⟨a,mem_iUnion.mpr ⟨b,?_⟩⟩ + have hm := (affineSpan ℝ ({p a,p b} : Set ℂ)).convex.sum_mem + (z := p) (fun i _ => hn i) hsv (fun i hi => mem_affineSpan ℝ (by + have hh := hab hi + simp only [Finset.mem_insert,Finset.mem_singleton] at hh + rcases hh with rfl|rfl <;> simp)) + have hh : ∑ i ∈ s, w i • p i = ∑ i, w i • p i := by + apply Finset.sum_subset (Finset.filter_subset _ _) + intro i _ hi + have hi0 : w i = 0 := by simpa [s] using hi + simp [hi0] + rwa [hh] at hm +lemma finite_partition_impossible {ι : Type*} [Fintype ι] {Q : Set ℂ} + (hQ : Metric.ball (0:ℂ) 5 ⊆ Q) (p : ι → ℂ) (w : ι → C(Q,ℝ)) + (hn : ∀ i z,0≤w i z) (hs : ∀ z,∑ i,w i z=1) + (hm : ∀ z,(Finset.univ.filter (fun i => w i z≠0)).card≤2) + (hd : ∀ i z, w i z≠0 → ‖p i-z.val‖≤2) : False := by + classical + let F : Q → ℂ := fun z => ∑ i,w i z • p i + have Fc : Continuous F := by fun_prop + have Fb (z : Q) : ‖F z-z.val‖≤2 := by + have he : F z-z.val=∑ i,w i z • (p i-z.val) := by + simp only [smul_sub,Finset.sum_sub_distrib,← Finset.sum_smul,hs,one_smul,F] + rw [he] + calc + ‖∑ i,w i z • (p i-z.val)‖ ≤ ∑ i,‖w i z • (p i-z.val)‖ := norm_sum_le _ _ + _ ≤ ∑ i,w i z*2 := by + apply Finset.sum_le_sum + intro i _ + by_cases hi : w i z=0 + · simp [hi] + · rw [norm_smul,Real.norm_eq_abs,abs_of_nonneg (hn i z)] + exact mul_le_mul_of_nonneg_left (hd i z hi) (hn i z) + _ = 2 := by rw [← Finset.sum_mul,hs]; ring + have hsub : Metric.ball (0:ℂ) 1 ⊆ Set.range F := by + intro y hy + apply hit_center_subtype (F := F) ?_ Fc Fb + intro z hz + apply hQ + rw [Metric.mem_ball,dist_zero_right] at hy ⊢ + have hh := norm_add_le (z-y) y + rw [sub_add_cancel] at hh + have hz' : ‖z-y‖<4 := by simpa [Metric.mem_ball,dist_eq_norm] using hz + exact hh.trans_lt (by linarith) + have hnull : volume (⋃ a, ⋃ b, (affineSpan ℝ ({p a,p b} : Set ℂ) : Set ℂ))=0 := + measure_iUnion_null fun a => measure_iUnion_null fun b => affinePair_null _ _ + have hfsub : Set.range F ⊆ ⋃ a, ⋃ b, (affineSpan ℝ ({p a,p b} : Set ℂ) : Set ℂ) := by + rintro _ ⟨z,rfl⟩ + exact barycenter_two p (fun i => w i z) (fun i => hn i z) (hs z) (hm z) + have hz := measure_mono_null (hsub.trans hfsub) hnull + exact (Metric.isOpen_ball.measure_pos volume (Metric.nonempty_ball.mpr (by norm_num : (0:ℝ)<1))).ne' hz +end PlanarCover +end + +noncomputable section +open scoped Classical +open Set MeasureTheory +namespace PlanarCover +lemma finite_open_cover_impossible {ι : Type*} [Fintype ι] {Q : Set ℂ} + (hQ : Metric.ball (0:ℂ) 5 ⊆ Q) (U : ι → Set Q) + (ho : ∀ i, IsOpen (U i)) (hcov : ∀ z : Q, ∃ i, z∈U i) + (hm : ∀ z : Q, (Finset.univ.filter (fun i => z∈U i)).card≤2) + (hd : ∀ i, ∀ x∈U i, ∀ y∈U i, ‖x.val-y.val‖≤2) : False := by + classical + obtain ⟨w,hw⟩ := PartitionOfUnity.exists_isSubordinate isClosed_univ U ho (by + intro z _ + exact mem_iUnion.mpr (hcov z)) + have hz0 : (0:ℂ)∈Q := hQ (Metric.mem_ball_self (by norm_num)) + let p : ι → Q := fun i => if h : (U i).Nonempty then h.choose else ⟨0,hz0⟩ + apply finite_partition_impossible hQ (fun i => (p i).val) w (w.nonneg) ?_ ?_ ?_ + · intro z + simpa only [finsum_eq_sum_of_fintype] using w.sum_eq_one (mem_univ z) + · intro z + apply le_trans (Finset.card_le_card ?_) (hm z) + intro i hi + simp only [Finset.mem_filter,Finset.mem_univ,true_and] at hi ⊢ + exact hw i (subset_closure hi) + · intro i z hz + have hzu : z∈U i := hw i (subset_closure hz) + have hp : p i∈U i := by + dsimp [p] + rw [dite_eq_left ⟨z,hzu⟩] + exact Classical.choose_spec _ + exact hd i _ hp z hzu +lemma compact_open_cover_impossible {ι : Type*} {Q : Set ℂ} + (hQ : Metric.ball (0:ℂ) 5 ⊆ Q) (hQc : IsCompact Q) (U : ι → Set Q) + (ho : ∀ i, IsOpen (U i)) (hcov : ∀ z : Q, ∃ i, z∈U i) + (hm : ∀ z : Q, ∀ i j l, z∈U i → z∈U j → z∈U l → i=j ∨ i=l ∨ j=l) + (hd : ∀ i, ∀ x∈U i, ∀ y∈U i, ‖x.val-y.val‖≤2) : False := by + classical + have : CompactSpace Q := isCompact_iff_compactSpace.mp hQc + obtain ⟨s,hs⟩ := isCompact_univ.elim_finite_subcover U ho (by + intro z _ + exact mem_iUnion.mpr (hcov z)) + apply finite_open_cover_impossible hQ (fun i : s => U i.val) (fun i => ho i.val) ?_ ?_ ?_ + · intro z + rcases mem_iUnion.mp (hs (mem_univ z)) with ⟨i,hi⟩ + rcases mem_iUnion.mp hi with ⟨his,hiz⟩ + exact ⟨⟨i,his⟩,hiz⟩ + · intro z + by_contra! hcard + obtain ⟨i,hi,j,hj,l,hl,hij,hil,hjl⟩ := Finset.two_lt_card.mp hcard + simp only [Finset.mem_filter,Finset.mem_univ,true_and] at hi hj hl + rcases hm z i.val j.val l.val hi hj hl with h|h|h + · exact hij (Subtype.ext h) + · exact hil (Subtype.ext h) + · exact hjl (Subtype.ext h) + · intro i + exact hd i.val +end PlanarCover +end + +end OAI diff --git a/lean/OAI/Geometry/PlaneColoring/Rigidity.lean b/lean/OAI/Geometry/PlaneColoring/Rigidity.lean new file mode 100644 index 0000000000000000000000000000000000000000..407c49a8368fe189b0e3a383bb7b95e84a16176f --- /dev/null +++ b/lean/OAI/Geometry/PlaneColoring/Rigidity.lean @@ -0,0 +1,443 @@ +import OAI.Geometry.PlaneColoring.PaletteTransport + +namespace OAI + +noncomputable section +open Set Filter Topology +namespace EuclideanFiveColor +/-- Common unit neighbor for the transverse chord of length `t`. -/ +def evenOffset (v : ℂ) (t : ℝ) : ℂ := + ((Real.sqrt (1-t^2/4) : ℂ)+((t/2 : ℝ) : ℂ)*Complex.I)*v +lemma norm_even_wing {t : ℝ} (ht : |t|<2) : + ‖(Real.sqrt (1-t^2/4) : ℂ)+((t/2 : ℝ) : ℂ)*Complex.I‖=1 := by + have ht2 : t^2≤4 := by + have hh := mul_self_le_mul_self (abs_nonneg t) ht.le + nlinarith [sq_abs t] + have hsq := Real.sq_sqrt (show 0≤1-t^2/4 by linarith) + apply (sq_eq_sq₀ (norm_nonneg _) (by norm_num : 0≤(1:ℝ))).mp + rw [Complex.sq_norm,Complex.normSq_apply] + norm_num only [Complex.add_re,Complex.ofReal_re,Complex.mul_re,Complex.ofReal_im, + Complex.I_re,Complex.I_im,Complex.add_im,Complex.mul_im,mul_zero,zero_mul,sub_zero, + add_zero,zero_add,mul_one] + nlinarith +lemma evenOffset_distances {v : ℂ} (hv : ‖v‖=1) {t : ℝ} (ht : |t|<2) : + ‖evenOffset v t‖=1 ∧ ‖evenOffset v t-(t:ℂ)*(Complex.I*v)‖=1 := by + constructor + · rw [evenOffset,norm_mul,norm_even_wing ht,hv,mul_one] + · have he : evenOffset v t-(t:ℂ)*(Complex.I*v)=evenOffset v (-t) := by + simp only [evenOffset,neg_sq,neg_div,Complex.ofReal_neg,Complex.ofReal_div,Complex.ofReal_ofNat] + ring + rw [he,evenOffset,norm_mul,norm_even_wing (by simpa only [abs_neg] using ht),hv,mul_one] +@[fun_prop] lemma continuous_evenOffset (v : ℂ) : Continuous (evenOffset v) := by + unfold evenOffset + fun_prop +lemma evenOffset_zero (v : ℂ) : evenOffset v 0=v := by simp [evenOffset] +def transverseDet (v w : ℂ) : ℝ := + (Complex.I*v).re*(Complex.I*w).im-(Complex.I*w).re*(Complex.I*v).im +def transverseFirst (v w h : ℂ) : ℝ := + (h.re*(Complex.I*w).im-(Complex.I*w).re*h.im)/transverseDet v w +def transverseSecond (v w h : ℂ) : ℝ := + ((Complex.I*v).re*h.im-h.re*(Complex.I*v).im)/transverseDet v w +lemma transverse_decompose {v w : ℂ} (hd : transverseDet v w≠0) (h : ℂ) : + (transverseFirst v w h : ℂ)*(Complex.I*v)+ + (transverseSecond v w h : ℂ)*(Complex.I*w)=h := by + apply Complex.ext <;> + simp only [Complex.add_re,Complex.mul_re,Complex.ofReal_re,Complex.ofReal_im, + Complex.add_im,Complex.mul_im,zero_mul,sub_zero,add_zero, + transverseFirst,transverseSecond] <;> + field_simp <;> dsimp [transverseDet] <;> + simp only [Complex.mul_re,Complex.mul_im,Complex.I_re,Complex.I_im,zero_mul,one_mul,zero_sub,zero_add] <;> ring +@[fun_prop] lemma continuous_transverseFirst (v w : ℂ) : Continuous (transverseFirst v w) := by + unfold transverseFirst + fun_prop +@[fun_prop] lemma continuous_transverseSecond (v w : ℂ) : Continuous (transverseSecond v w) := by + unfold transverseSecond + fun_prop +lemma transverseFirst_zero (v w : ℂ) : transverseFirst v w 0=0 := by simp [transverseFirst] +lemma transverseSecond_zero (v w : ℂ) : transverseSecond v w 0=0 := by simp [transverseSecond] +def evenPath (v w h : ℂ) : Fin 5 → ℂ := ![0, + evenOffset v (transverseFirst v w h), + (transverseFirst v w h : ℂ)*(Complex.I*v), + (transverseFirst v w h : ℂ)*(Complex.I*v)+evenOffset w (transverseSecond v w h),h] +lemma evenPath_edges {v w h : ℂ} (hv : ‖v‖=1) (hw : ‖w‖=1) + (hd : transverseDet v w≠0) (h₁ : |transverseFirst v w h|<2) + (h₂ : |transverseSecond v w h|<2) : + ∀i : Fin 4, ‖evenPath v w h i.castSucc-evenPath v w h i.succ‖=1 := by + have he₁ := evenOffset_distances hv h₁ + have he₂ := evenOffset_distances hw h₂ + have hdec := transverse_decompose hd h + intro i + fin_cases i + · change ‖0-evenOffset v (transverseFirst v w h)‖=1 + simpa only [zero_sub,norm_neg] using he₁.1 + · exact he₁.2 + · change ‖(transverseFirst v w h : ℂ)*(Complex.I*v)- + ((transverseFirst v w h : ℂ)*(Complex.I*v)+evenOffset w (transverseSecond v w h))‖=1 + simpa only [sub_add_cancel_left,norm_neg] using he₂.1 + · change ‖(transverseFirst v w h : ℂ)*(Complex.I*v)+evenOffset w (transverseSecond v w h)-h‖=1 + calc + _ = ‖evenOffset w (transverseSecond v w h)-(transverseSecond v w h : ℂ)*(Complex.I*w)‖ := + congrArg norm (by linear_combination hdec) + _ = 1 := he₂.2 +/-- Actual four-unit-edge paths stay inside the prescribed two open sets for +all small starting-point and displacement perturbations. -/ +lemma evenPath_local {U V : Set ℂ} (hU : IsOpen U) (hV : IsOpen V) + {p v w : ℂ} (hp : p∈U) (hpv : p+v∈V) (hpw : p+w∈V) : + ∃r>0,∃δ>0,∀q h : ℂ,q∈Metric.ball p r → ‖h‖<δ → + |transverseFirst v w h|<2 ∧ |transverseSecond v w h|<2 ∧ + (∀i : Fin 5,(q+evenPath v w h i)∈if i.val%2=0 then U else V) := by + let P : ℂ × ℂ → Prop := fun z => |transverseFirst v w z.2|<2 ∧ + |transverseSecond v w z.2|<2 ∧ + (∀i : Fin 5,(z.1+evenPath v w z.2 i)∈if i.val%2=0 then U else V) + have hm : ∀ᶠz in 𝓝 (p,(0:ℂ)),P z := by + have ha : ∀ᶠz : ℂ × ℂ in 𝓝 (p,(0:ℂ)), |transverseFirst v w z.2|<2 := by + apply ((continuous_transverseFirst v w).comp continuous_snd).abs.continuousAt.eventually_lt continuousAt_const + simp [transverseFirst_zero] + have hb : ∀ᶠz : ℂ × ℂ in 𝓝 (p,(0:ℂ)), |transverseSecond v w z.2|<2 := by + apply ((continuous_transverseSecond v w).comp continuous_snd).abs.continuousAt.eventually_lt continuousAt_const + simp [transverseSecond_zero] + have hc (i : Fin 5) : ∀ᶠz : ℂ × ℂ in 𝓝 (p,(0:ℂ)), + (z.1+evenPath v w z.2 i)∈if i.val%2=0 then U else V := by + have hco : Continuous (fun z : ℂ × ℂ => z.1+evenPath v w z.2 i) := by + fin_cases i <;> dsimp [evenPath] <;> fun_prop + apply hco.continuousAt.eventually + fin_cases i <;> norm_num [evenPath,transverseFirst_zero,transverseSecond_zero,evenOffset_zero] + · exact hU.mem_nhds hp + · exact hV.mem_nhds hpv + · exact hU.mem_nhds hp + · exact hV.mem_nhds hpw + · exact hU.mem_nhds hp + exact ha.and (hb.and (eventually_all.mpr hc)) + obtain ⟨ε,hε,hb⟩ := Metric.mem_nhds_iff.mp hm + refine ⟨ε,hε,ε,hε,?_⟩ + intro q h hq hh + exact hb (show (q,h)∈Metric.ball (p,(0:ℂ)) ε by + simpa only [Metric.mem_ball,Prod.dist_eq,dist_zero_right,max_lt_iff] using And.intro hq hh) +end EuclideanFiveColor +end + +noncomputable section +open Set Filter Topology MeasureTheory +namespace EuclideanFiveColor +/-- Local invariance for every sufficiently small fixed translation forces +local essential constancy. This is the Fubini/shear step of angular-binary-local. -/ +lemma local_ae_translation_constant {ι : Type*} [MeasurableSpace ι] [MeasurableSingletonClass ι] + [Countable ι] (c : ℂ → ι) (hc : Measurable c) {p : ℂ} {r δ : ℝ} + (hr : 00,s≤r ∧ ∃i,∀ᵐq : ℂ∂volume,q∈Metric.ball p s → c q=i := by + let s : ℝ := min r δ/4 + have hs : 0 by + by_cases hh : ‖h‖<δ + · exact (hshift h hh).mono fun q hq _ => hq + · exact Eventually.of_forall fun _ hh' => (hh hh').elim + · have hx : MeasurableSet {z : ℂ × ℂ | ‖z.1‖<δ} := measurableSet_lt measurable_fst.norm measurable_const + have hy : MeasurableSet {z : ℂ × ℂ | z.2∈Metric.ball p r} := Metric.isOpen_ball.measurableSet.preimage measurable_snd + have hz : MeasurableSet {z : ℂ × ℂ | c (z.2+z.1)=c z.2} := + measurableSet_eq_fun (hc.comp (measurable_snd.add measurable_fst)) (hc.comp measurable_snd) + exact hx.imp (hy.imp hz) + have hd := (measurePreserving_sub_prod (volume : Measure ℂ) volume).quasiMeasurePreserving.ae hpair + have he : ∀ᵐz : ℂ × ℂ∂volume.prod volume, + z.1∈Metric.ball p s → z.2∈Metric.ball p s → c z.1=c z.2 := by + filter_upwards [hd] with z hz h1 h2 + have hdist : ‖z.1-z.2‖<δ := by + rw [←dist_eq_norm] + have h := dist_triangle z.1 p z.2 + have h2' : dist p z.2 (hz hq hzs).symm +end EuclideanFiveColor +end + +noncomputable section +open Set Filter Topology MeasureTheory +namespace EuclideanFiveColor +lemma binary_two_edges {ι : Type*} {a b u v w : ι} (hu : u=a ∨ u=b) + (hv : v=a ∨ v=b) (hw : w=a ∨ w=b) (huv : u≠v) (hvw : v≠w) : u=w := by + rcases hu with rfl|rfl <;> rcases hv with rfl|rfl <;> rcases hw with rfl|rfl <;> tauto +lemma ae_translated_unit_pair {k : ℕ} {c : ℂ → Fin k} (hc : Measurable c) (hw : WeakColoring k c) + {a b : ℂ} (hab : ‖a-b‖=1) : ∀ᵐq : ℂ∂volume,c (q+a)≠c (q+b) := by + obtain ⟨t,ht⟩ := direction_exists (u:=b-a) (by simpa only [norm_sub_rev] using hab) + have hh := (measurePreserving_add_right volume a).quasiMeasurePreserving.ae (weak_all_directions c hc hw t) + filter_upwards [hh] with q hq + simpa only [ht,show q+a+(b-a)=q+b by ring] using hq +/-- Local essential constancy inside two-color open regions, from the source's +actual four-edge paths. The directions are genuine unit directions landing in V. -/ +lemma binary_open_local_rigidity {k : ℕ} {c : ℂ → Fin k} (hc : Measurable c) (hw : WeakColoring k c) + {a b : Fin k} {U V : Set ℂ} (hU : IsOpen U) (hV : IsOpen V) + (hUc : ∀ᵐq : ℂ∂volume,q∈U → c q=a ∨ c q=b) + (hVc : ∀ᵐq : ℂ∂volume,q∈V → c q=a ∨ c q=b) + {p v w : ℂ} (hp : p∈U) (hpv : p+v∈V) (hpw : p+w∈V) + (hv : ‖v‖=1) (hw' : ‖w‖=1) (hd : transverseDet v w≠0) : + ∃r>0,∃i : Fin k,∀ᵐq : ℂ∂volume,q∈Metric.ball p r → c q=i := by + obtain ⟨r,hr,δ,hδ,hinside⟩ := evenPath_local hU hV hp hpv hpw + have hshift (h : ℂ) (hh : ‖h‖<δ) : + ∀ᵐq : ℂ∂volume,q∈Metric.ball p r → c (q+h)=c q := by + have hsmall := hinside p h (Metric.mem_ball_self hr) hh + have hedges := evenPath_edges hv hw' hd hsmall.1 hsmall.2.1 + have hcm (i : Fin 5) := (measurePreserving_add_right volume (evenPath v w h i)).quasiMeasurePreserving.ae (hUc.and hVc) + have hne (i : Fin 4) := ae_translated_unit_pair hc hw (hedges i) + filter_upwards [ae_all_iff.mpr hcm,ae_all_iff.mpr hne] with q hqc hqp hq + have hi := (hinside q h hq hh).2.2 + have hcol (i : Fin 5) : c (q+evenPath v w h i)=a ∨ c (q+evenPath v w h i)=b := by + have hii := hi i + by_cases he : i.val%2=0 + · exact (hqc i).1 (by simpa only [he,ite_true] using hii) + · exact (hqc i).2 (by simpa only [he,ite_false] using hii) + have he02 := binary_two_edges (hcol 0) (hcol 1) (hcol 2) (hqp 0) (hqp 1) + have he24 := binary_two_edges (hcol 2) (hcol 3) (hcol 4) (hqp 2) (hqp 3) + change c (q+0)=c (q+evenPath v w h 2) at he02 + change c (q+evenPath v w h 2)=c (q+h) at he24 + simpa only [add_zero] using (he02.trans he24).symm + obtain ⟨s,hs,_,i,hi⟩ := local_ae_translation_constant c hc hr hδ hshift + exact ⟨s,hs,i,hi⟩ +end EuclideanFiveColor +end + +noncomputable section +open Set Filter Topology +namespace EuclideanFiveColor +lemma transverseDet_mul_unit {v : ℂ} (hv : ‖v‖=1) (z : ℂ) : + transverseDet v (z*v)=z.im := by + have hh : v.re^2+v.im^2=1 := by + calc + v.re^2+v.im^2 = ‖v‖^2 := by rw [Complex.sq_norm,Complex.normSq_apply]; ring + _ = 1 := by rw [hv]; norm_num + calc + transverseDet v (z*v) = (v.re^2+v.im^2)*z.im := by + simp only [transverseDet,Complex.mul_re,Complex.mul_im,Complex.I_re,Complex.I_im] + ring + _ = z.im := by rw [hh,one_mul] +/-- An open set meeting a unit circle contains two nonparallel unit directions +from its center. No regularity of the color classes is involved. -/ +lemma open_two_unit_directions {V : Set ℂ} (hV : IsOpen V) {p v : ℂ} + (hv : ‖v‖=1) (hpv : p+v∈V) : + ∃w : ℂ,p+w∈V ∧ ‖w‖=1 ∧ transverseDet v w≠0 := by + have ht : Continuous (fun t : ℝ => p+(Circle.exp t : ℂ)*v) := by fun_prop + have hm : (fun t : ℝ => p+(Circle.exp t : ℂ)*v) ⁻¹' V∈𝓝 0 := by + apply ht.continuousAt.preimage_mem_nhds + simpa only [Circle.exp_zero,Circle.coe_one,one_mul] using hV.mem_nhds hpv + obtain ⟨δ,hδ,hd⟩ := Metric.mem_nhds_iff.mp hm + let t : ℝ := min δ Real.pi/2 + have hp := Real.pi_pos + have hmin : 0 < min δ Real.pi := lt_min hδ hp + have htp : 0 + simp only [Circle.coe_exp,Complex.exp_mul_I,←Complex.ofReal_cos,←Complex.ofReal_sin, + Complex.add_re,Complex.add_im,Complex.mul_re,Complex.mul_im,Complex.sub_re, + Complex.sub_im,Complex.ofReal_re,Complex.ofReal_im,Complex.I_re,Complex.I_im, + Complex.one_re,Complex.one_im,Complex.re_ofNat,Complex.im_ofNat, + Real.cos_two_mul,Real.sin_two_mul] <;> ring +/-- The unit circle from one endpoint penetrates either prescribed radial side +near its equilateral neighbor. This is the constructive version of the source IFT step. -/ +lemma radial_unit_contact {x e : ℂ} (he : ‖e‖=1) {δ : ℝ} (hδ : 0<δ) + {V : Set ℂ} (b : Bool) + (hstrip : ∀e' : ℂ,‖e'‖=1 → dist e' (e*(Circle.exp (Real.pi/3) : ℂ))<δ → + ∀r : ℝ,0 2*Real.cos t + let E : ℝ → ℂ := fun t => e*(Circle.exp t : ℂ) + have hr : Continuous r := by fun_prop + have hE : Continuous E := by fun_prop + have hra : r a=1 := by norm_num [r,a,Real.cos_pi_div_three] + have ha : 0 linarith [Real.pi_pos] + have hn : ∀ᶠt in 𝓝 a,0] a,t∈Ioi a)).exists + refine ⟨t,⟨ht.1,ht.2.1,ht.2.2.1⟩,?_⟩ + have hc := Real.cos_lt_cos_of_nonneg_of_le_pi ha.1.le ht.2.2.2.2.le hat + dsimp [r] + have hh : 2*Real.cos a=1 := hra + linarith + · obtain ⟨t,ht,hta⟩ := ((hn.filter_mono nhdsWithin_le_nhds).and + (self_mem_nhdsWithin : ∀ᶠt in 𝓝[<] a,t∈Iio a)).exists + refine ⟨t,⟨ht.1,ht.2.1,ht.2.2.1⟩,?_⟩ + have hc := Real.cos_lt_cos_of_nonneg_of_le_pi ht.2.2.2.1.le ha.2.le hta + dsimp [r] + have hh : 2*Real.cos a=1 := hra + linarith + obtain ⟨t,ht,hside⟩ := hex + have hEt : ‖E t‖=1 := by + change ‖e*(Circle.exp t : ℂ)‖=1 + rw [norm_mul,he,Circle.norm_coe,one_mul] + have hmem := hstrip (E t) hEt ht.2.2 (r t) ht.1 ht.2.1 hside + let v : ℂ := (r t:ℂ)*E t-e + have hve : v=e*(Circle.exp (2*t) : ℂ) := by + change ((2*Real.cos t : ℝ):ℂ)*(e*(Circle.exp t : ℂ))-e=e*(Circle.exp (2*t) : ℂ) + calc + _ = e*((2*Real.cos t : ℂ)*(Circle.exp t : ℂ)-1) := by push_cast; ring + _ = _ := by rw [double_cos_circle] + refine ⟨v,by rw [hve,norm_mul,he,Circle.norm_coe,one_mul],?_⟩ + have hvq : (x+e)+v=x+(r t:ℂ)*E t := by dsimp [v]; ring + exact hvq ▸ hmem +end EuclideanFiveColor +end + +noncomputable section +open Set Filter Topology +namespace EuclideanFiveColor +def radialSide (b : Bool) (ε : ℝ) : Set ℝ := if b then Ioo 1 (1+ε) else Ioo (1-ε) 1 +def polarBox (x e : ℂ) (b : Bool) (ε : ℝ) : Set ℂ := + (fun rt : ℝ × ℝ => x+(rt.1:ℂ)*(e*(Circle.exp rt.2 : ℂ))) '' + (radialSide b ε ×ˢ Ioo (-ε) ε) +lemma radialSide_connected (b : Bool) {ε : ℝ} (hε : 0<ε) : IsConnected (radialSide b ε) := by + cases b <;> dsimp [radialSide] <;> apply isConnected_Ioo <;> linarith +lemma radialSide_abs {b : Bool} {ε r : ℝ} (hr : r∈radialSide b ε) : |r-1|<ε := by + cases b <;> dsimp [radialSide] at hr + all_goals rw [abs_lt]; constructor <;> linarith [hr.1,hr.2] +lemma mem_radialSide {b : Bool} {ε r : ℝ} (hr : |r-1|<ε) + (hb : if b then 1 dsimp [radialSide] at * <;> constructor <;> linarith [hr.1,hr.2] +lemma polarBox_connected (x e : ℂ) (b : Bool) {ε : ℝ} (hε : 0<ε) : + IsConnected (polarBox x e b ε) := by + apply ((radialSide_connected b hε).prod (isConnected_Ioo (by linarith : -ε<ε))).image + fun_prop +/-- Arbitrarily small connected polar boxes on either side of a unit circle. -/ +lemma polarBox_small {x e : ℂ} {b : Bool} {δ : ℝ} (hδ : 0<δ) + {U W : Set ℂ} (hW : IsOpen W) (hp : x+e∈W) + (hstrip : ∀e' : ℂ,‖e'‖=1 → dist e' e<δ → ∀r : ℝ, + 00,polarBox x e b ε⊆U∩W := by + let F : ℝ × ℝ → ℂ := fun rt => x+(rt.1:ℂ)*(e*(Circle.exp rt.2 : ℂ)) + let E : ℝ × ℝ → ℂ := fun rt => e*(Circle.exp rt.2 : ℂ) + have hF : Continuous F := by fun_prop + have hE : Continuous E := by fun_prop + have hF0 : F (1,0)=x+e := by simp [F] + have hE0 : E (1,0)=e := by simp [E] + have hn : ∀ᶠrt in 𝓝 ((1,0) : ℝ × ℝ),F rt∈W ∧ dist (E rt) e<δ ∧ 0 dsimp [radialSide] at hr ⊢ + · exact hr.2 + · exact hr.1 +/-- A polar box contains a complete one-sided radial strip, not just selected rays. -/ +lemma polarBox_contains_strip {x e : ℂ} (he : ‖e‖=1) (b : Bool) + {ε : ℝ} (hε : 0<ε) : ∃δ>0,∀e' : ℂ,‖e'‖=1 → dist e' e<δ → ∀r : ℝ, + |r-1|<δ → (if b then 1 Complex.arg (z/e)) e := by + have hh : ContinuousAt Complex.arg (e/e) := Complex.continuousAt_arg (by + simpa only [div_self he0] using Complex.one_mem_slitPlane) + exact hh.comp (f := fun z : ℂ => z/e) (by fun_prop) + have hn : ∀ᶠz in 𝓝 e,|Complex.arg (z/e)|<ε := + ha.abs.eventually_lt_const (by simpa [div_self he0] using hε) + obtain ⟨δ,hδ,hh⟩ := Metric.mem_nhds_iff.mp hn + refine ⟨min δ ε,lt_min hδ hε,?_⟩ + intro e' he' hdist r hr hb + let t : ℝ := Complex.arg (e'/e) + have ht : -ε ⟨U,hU,hq,hae⟩,hU,hp⟩ +lemma essentialLocalSet_disjoint {ι : Type*} (c : ℂ → ι) {i j : ι} (hne : i≠j) : + Disjoint (essentialLocalSet c i) (essentialLocalSet c j) := by + apply disjoint_left.mpr + rintro p ⟨U,hU,hp,hu⟩ ⟨V,hV,hp',hv⟩ + have hpos := (hU.inter hV).measure_pos (volume : Measure ℂ) ⟨p,hp,hp'⟩ + obtain ⟨q,hq,hqa⟩ := Measure.exists_mem_of_measure_ne_zero_of_ae hpos.ne' (ae_restrict_of_ae (hu.and hv)) + exact hne ((hqa.1 hq.1).symm.trans (hqa.2 hq.2)) +lemma essentialLocalSet_ae {ι : Type*} (c : ℂ → ι) (i : ι) : + ∀ᵐq : ℂ∂volume,q∈essentialLocalSet c i → c q=i := + ae_of_locally_ae volume (fun _ h => h) +/-- Local essential constancy on a connected set has one global essential value. +The connected set need not be open, which permits polar product images directly. -/ +lemma connected_local_ae_constant {ι : Type*} {c : ℂ → ι} {S : Set ℂ} + (hS : IsConnected S) (hl : ∀p∈S,∃i,p∈essentialLocalSet c i) : + ∃i,S⊆essentialLocalSet c i ∧ (∀ᵐq : ℂ∂volume,q∈S → c q=i) := by + classical + obtain ⟨p,hp⟩ := hS.nonempty + obtain ⟨i,hi⟩ := hl p hp + let V : Set ℂ := ⋃j≠i,essentialLocalSet c j + have hv : IsOpen V := isOpen_iUnion fun j => isOpen_iUnion fun _ => essentialLocalSet_open c j + have hd : Disjoint (essentialLocalSet c i) V := by + apply disjoint_iUnion_right.mpr + intro j + apply disjoint_iUnion_right.mpr + intro hji + exact essentialLocalSet_disjoint c (Ne.symm hji) + have hsuv : S⊆essentialLocalSet c i∪V := by + intro q hq + obtain ⟨j,hj⟩ := hl q hq + by_cases hji : j=i + · exact Or.inl (hji ▸ hj) + · exact Or.inr (mem_iUnion₂.mpr ⟨j,hji,hj⟩) + have hs := hS.isPreconnected.subset_left_of_subset_union (essentialLocalSet_open c i) hv hd hsuv ⟨p,hp,hi⟩ + exact ⟨i,hs,(essentialLocalSet_ae c i).mono fun q hq hs' => hq (hs hs')⟩ +end EuclideanFiveColor +end + +end OAI diff --git a/lean/OAI/Geometry/PlaneColoring/Sectors.lean b/lean/OAI/Geometry/PlaneColoring/Sectors.lean new file mode 100644 index 0000000000000000000000000000000000000000..6965c9e8db1387ab9caa31459c32ce6c51725ea1 --- /dev/null +++ b/lean/OAI/Geometry/PlaneColoring/Sectors.lean @@ -0,0 +1,453 @@ +import OAI.Geometry.PlaneColoring.AngularBoundary +import OAI.Geometry.PlaneColoring.Moser + +namespace OAI + +noncomputable section +open Set Filter Topology MeasureTheory +open scoped RealInnerProductSpace +namespace EuclideanFiveColor +def triangleEdge (i : Fin 3) : Finset (Fin 5) := if i=0 then {0,1} else if i=1 then {1,2} else {2,0} +lemma triangle_majority_cover : ∀s : Fin 3 → Bool,∃b : Bool, + ∀j∈({0,1,2} : Finset (Fin 5)),∃i : Fin 3,s i=b ∧ j∈triangleEdge i := by decide +lemma triangle_outsider : ∀s : Fin 3 → Bool,∀b : Bool, + (∀j∈({0,1,2} : Finset (Fin 5)),∃i : Fin 3,s i=b ∧ j∈triangleEdge i) → + ∀j : Fin 5,(∀i : Fin 3,s i=b → j∉triangleEdge i) → j=3 ∨ j=4 := by decide +lemma ApproachingContinuum.side_strip {x : ℂ} {K : Set ℂ} {v e : ℂ} + (h : ApproachingContinuum x K v) (he : ‖e‖=1) (hn : ⟪e,v⟫≠0) (b : Bool) + (hs : decide (0<⟪e,v⟫)=b) : ∃δ>0,∀e' : ℂ,‖e'‖=1 → dist e' e<δ → ∀r : ℝ, + 0 hh e' he' hd r hr ?_ hr1⟩ + have := (abs_lt.mp hab).1 + linarith + · obtain ⟨δ,hδ,hh⟩ := h.outer_strip he (of_decide_eq_true hs) + refine ⟨δ,hδ,fun e' he' hd r _ hab hr1 => hh e' he' hd r hr1 ?_⟩ + have := (abs_lt.mp hab).2 + linarith +/-- Three interface edges supply an actual outsider-only open strip in every +nonexceptional direction, with the radial side chosen by the majority sign. -/ +lemma triangle_outsider_strip {c : ℂ → Fin 5} (hc : Measurable c) + {x : ℂ} {K : Fin 3 → Set ℂ} {v : Fin 3 → ℂ} + (hK : ∀i,ApproachingContinuum x (K i) (v i)) + (hH : ∀i,∀j∈triangleEdge i,Disjoint (spatialSupport c j) (Straddle (K i))) + {e : ℂ} (he : ‖e‖=1) (hn : ∀i,⟪e,v i⟫≠0) : + ∃b : Bool,∃δ>0,∃W : Set ℂ,IsOpen W ∧ + (∀ᵐz : ℂ∂volume,z∈W → c z=3 ∨ c z=4) ∧ + ∀e' : ℂ,‖e'‖=1 → dist e' e<δ → ∀r : ℝ, + 0 decide (0<⟪e,v i⟫) + obtain ⟨b,hb⟩ := triangle_majority_cover s + let E : Finset (Fin 3) := Finset.univ.filter fun i => s i=b + have hex (i : E) := (hK i).side_strip he (hn i) b ((Finset.mem_filter.mp i.2).2) + choose d hd hs using hex + obtain ⟨δ,hδ,_,hδd⟩ := finite_positive_lower_bound Finset.univ d (fun i _ => hd i) + let W : Set ℂ := ⋂i : E,Straddle (K i) + refine ⟨b,δ,hδ,W,isOpen_iInter_of_finite (fun i => straddle_isOpen (K i)),?_,?_⟩ + · filter_upwards [finite_support_exclusion_ae c hc K triangleEdge hH] with z hz hzW + apply triangle_outsider s b hb (c z) + intro i hi + exact hz i (mem_iInter.mp hzW ⟨i,Finset.mem_filter.mpr ⟨Finset.mem_univ _,hi⟩⟩) + · intro e' he' heδ r hr hrδ hside + apply mem_iInter.mpr + intro i + exact hs i e' he' (heδ.trans_le (hδd i (Finset.mem_univ _))) r hr + (hrδ.trans_le (hδd i (Finset.mem_univ _))) hside +/-- Actual local triangle palette rigidity, without terminal angular sectors +or boundary information as hypotheses. -/ +lemma triangle_palette_local {c : ℂ → Fin 5} (hc : Measurable c) (hw : WeakColoring 5 c) + {x : ℂ} {K : Fin 3 → Set ℂ} {v : Fin 3 → ℂ} + (hK : ∀i,ApproachingContinuum x (K i) (v i)) + (hH : ∀i,∀j∈triangleEdge i,Disjoint (spatialSupport c j) (Straddle (K i))) + {t : Angles} (hn : ∀i,⟪direction t,v i⟫≠0) + (hnR : ∀i,⟪direction t*(Circle.exp (Real.pi/3) : ℂ),v i⟫≠0) : + ∃i : Fin 5,(i=3 ∨ i=4) ∧ ∃A : Set Angles,IsOpen A ∧ t∈A ∧ + ∀ᵐu∂angularMeasure,u∈A → i∈palette c hc x u := by + obtain ⟨bu,δu,hδu,U,hU,hUc,hsU⟩ := triangle_outsider_strip hc hK hH (direction_norm t) hn + have hunit : ‖direction t*(Circle.exp (Real.pi/3) : ℂ)‖=1 := by + rw [norm_mul,direction_norm,Circle.norm_coe,one_mul] + obtain ⟨bv,δv,hδv,V,hV,hVc,hsV⟩ := triangle_outsider_strip hc hK hH hunit hnR + apply binary_strip_palette_rigidity c hc hw hU hV hUc hVc (lt_min hδu hδv) bu bv + · intro e' he' hd r hr hrd hb + exact hsU e' he' (hd.trans_le (min_le_left _ _)) r hr (hrd.trans_le (min_le_left _ _)) hb + · intro e' he' hd r hr hrd hb + exact hsV e' he' (hd.trans_le (min_le_right _ _)) r hr (hrd.trans_le (min_le_right _ _)) hb +end EuclideanFiveColor +end + +noncomputable section +open Set Filter Topology MeasureTheory +open scoped RealInnerProductSpace +namespace EuclideanFiveColor +lemma triangle_binary_from_continua {c : ℂ → Fin 5} (hc : Measurable c) + {x : ℂ} {K : Fin 3 → Set ℂ} {v : Fin 3 → ℂ} (hv : ∀i,‖v i‖=1) + (hK : ∀i,ApproachingContinuum x (K i) (v i)) + (hH : ∀i,∀j∈triangleEdge i,Disjoint (spatialSupport c j) (Straddle (K i))) : + BinaryCenter c hc x 3 4 := by + have hh : ∀ᵐt∂angularMeasure,(∀i,⟪direction t,v i⟫≠0) → + t∈paletteSet c hc x 3 ∨ t∈paletteSet c hc x 4 := by + apply ae_of_locally_ae angularMeasure + intro t ht + obtain ⟨b,δ,hδ,W,hW,hWc,hs⟩ := triangle_outsider_strip hc hK hH (direction_norm t) ht + have hcols : ∀ᵐz : ℂ∂volume,z∈W → c z∈({3,4} : Finset (Fin 5)) := + hWc.mono fun z hz hzw => by simpa only [Finset.mem_insert,Finset.mem_singleton] using hz hzw + have hex : ∃A : Set Angles,IsOpen A ∧ t∈A ∧ + ∀ᵐu∂angularMeasure,u∈A → (palette c hc x u∩{3,4}).Nonempty := by + cases b + · apply inner_strip_trace c hc hδ hW hcols + intro u hu r hr hrδ hr1 + apply hs (direction u) (direction_norm u) hu r hr _ hr1 + rw [abs_lt]; constructor <;> linarith + · apply outer_strip_trace c hc hδ hW hcols + intro u hu r hr1 hrδ + apply hs (direction u) (direction_norm u) hu r (by linarith) _ hr1 + rw [abs_lt]; constructor <;> linarith + obtain ⟨A,hA,htA,hae⟩ := hex + refine ⟨A,hA,htA,hae.mono fun u hu hAu => ?_⟩ + obtain ⟨i,hi⟩ := hu hAu + rcases Finset.mem_inter.mp hi with ⟨hip,hi⟩ + rcases Finset.mem_insert.mp hi with rfl|hi + · exact Or.inl ((mem_palette c hc x u 3).mp hip) + · rw [Finset.mem_singleton] at hi + subst i + exact Or.inr ((mem_palette c hc x u 4).mp hip) + filter_upwards [hh,ae_all_iff.mpr (fun i => ae_direction_nonorthogonal (hv i))] with t ht hn + exact ht hn +def triangleState (c : ℂ → Fin 5) (hc : Measurable c) (x : ℂ) (t : Angles) : Bool := by + classical + exact if t∈paletteSet c hc x 3 then false else true +lemma triangleState_measurable (c : ℂ → Fin 5) (hc : Measurable c) (x : ℂ) : + Measurable (triangleState c hc x) := Measurable.ite (paletteSet_measurable c hc x 3) measurable_const measurable_const +lemma triangleState_flip {c : ℂ → Fin 5} (hc : Measurable c) (hw : WeakColoring 5 c) {x : ℂ} + (hb : BinaryCenter c hc x 3 4) : + ∀ᵐt∂angularMeasure,triangleState c hc x (t+(sixty : Angles))= !(triangleState c hc x t) := by + filter_upwards [binary_alternation c hc hw hb] with t ht + by_cases hp : t∈paletteSet c hc x 3 + · have hn : t+(sixty : Angles)∉paletteSet c hc x 3 := fun h => (ht.1.mp h) hp + simp only [triangleState,hp,hn,ite_true,ite_false,Bool.not_false] + · have hn : t+(sixty : Angles)∈paletteSet c hc x 3 := ht.1.mpr hp + simp only [triangleState,hp,hn,ite_true,ite_false,Bool.not_true] +lemma triangleState_local {c : ℂ → Fin 5} (hc : Measurable c) (hw : WeakColoring 5 c) + {x : ℂ} {K : Fin 3 → Set ℂ} {v : Fin 3 → ℂ} (hv : ∀i,‖v i‖=1) + (hK : ∀i,ApproachingContinuum x (K i) (v i)) + (hH : ∀i,∀j∈triangleEdge i,Disjoint (spatialSupport c j) (Straddle (K i))) + {t : Angles} (hn : ∀i,⟪direction t,v i⟫≠0) + (hnR : ∀i,⟪direction t*(Circle.exp (Real.pi/3) : ℂ),v i⟫≠0) : + ∃b,t∈angleEssential (triangleState c hc x) b := by + obtain ⟨i,hi,A,hA,htA,hae⟩ := triangle_palette_local hc hw hK hH hn hnR + have hb := binary_alternation c hc hw (triangle_binary_from_continua hc hv hK hH) + rcases hi with rfl|rfl + · refine ⟨false,A,hA,htA,hae.mono fun u hu hAu => ?_⟩ + have hp := (mem_palette c hc x u 3).mp (hu hAu) + simp only [triangleState,hp,ite_true] + · refine ⟨true,A,hA,htA,?_⟩ + filter_upwards [hae,hb] with u hu hu' hAu + have hp := hu'.2.mp ((mem_palette c hc x u 4).mp (hu hAu)) + simp only [triangleState,hp,ite_false] +lemma direction_injective : Function.Injective direction := fun _ _ h => + AddCircle.injective_toCircle (by positivity : (2*Real.pi:ℝ)≠0) (Subtype.ext h) +lemma direction_plus_sixty (t : Angles) : + direction (t+(sixty : Angles))=direction t*(Circle.exp (Real.pi/3) : ℂ) := by + obtain ⟨a,rfl⟩ := QuotientAddGroup.mk_surjective t + rw [←AddCircle.coe_add,direction_real,direction_real,Circle.exp_add] + rfl +lemma triple_orthogonal_cover (v : Fin 3 → ℂ) (hv : ∀i,‖v i‖=1) : + ∃B : Finset Angles,B.card≤6 ∧ (∀t,t+(Real.pi : Angles)∈B ↔ t∈B) ∧ + ∀t,t∉B → ∀i,⟪direction t,v i⟫≠0 := by + classical + have hex (i : Fin 3) : ∃t : Angles,direction t=Complex.I*v i := direction_exists + (by rw [norm_mul,Complex.norm_I,hv,one_mul]) + choose a ha using hex + let B : Finset Angles := Finset.univ.biUnion fun i : Fin 3 => {a i,a i+(Real.pi : Angles)} + have hmem (t : Angles) : t∈B ↔ ∃i : Fin 3,t=a i ∨ t=a i+(Real.pi : Angles) := by + simp only [B,Finset.mem_biUnion,Finset.mem_univ,true_and,Finset.mem_insert,Finset.mem_singleton] + have hdouble (t : Angles) : t+(Real.pi : Angles)+(Real.pi : Angles)=t := by + apply direction_injective + simp only [direction_add_pi,neg_neg] + refine ⟨B,?_,?_,?_⟩ + · calc B.card ≤ ∑i : Fin 3,({a i,a i+(Real.pi : Angles)} : Finset Angles).card := Finset.card_biUnion_le + _ ≤ ∑_i : Fin 3,2 := Finset.sum_le_sum fun _ _ => by simpa using (Finset.card_insert_le (a _) ({a _+(Real.pi : Angles)} : Finset Angles)) + _ = 6 := by norm_num + · intro t + rw [hmem,hmem] + constructor + · rintro ⟨i,hi|hi⟩ + · exact ⟨i,Or.inr (by rw [←hi,hdouble])⟩ + · exact ⟨i,Or.inl (add_right_cancel hi)⟩ + · rintro ⟨i,rfl|rfl⟩ + · exact ⟨i,Or.inr rfl⟩ + · exact ⟨i,Or.inl (hdouble _)⟩ + · intro t ht i hinner + apply ht + rw [hmem] + rcases complex_unit_orthogonal (direction_norm t) (hv i) hinner with he|he + · exact ⟨i,Or.inl (direction_injective (he.trans (ha i).symm))⟩ + · refine ⟨i,Or.inr (direction_injective ?_)⟩ + rw [direction_add_pi,ha,he] + ring +/-- The actual three-interface data force the source's unique six-position +boundary orbit. This theorem does not assume local rigidity or orbit finiteness. -/ +lemma triangle_boundary_one_orbit {c : ℂ → Fin 5} (hc : Measurable c) (hw : WeakColoring 5 c) + {x : ℂ} {K : Fin 3 → Set ℂ} {v : Fin 3 → ℂ} (hv : ∀i,‖v i‖=1) + (hK : ∀i,ApproachingContinuum x (K i) (v i)) + (hH : ∀i,∀j∈triangleEdge i,Disjoint (spatialSupport c j) (Straddle (K i))) : + ∃t,angleBoundary (triangleState c hc x)={u | ∃j : Fin 6,u=t+sixAngle j} := by + obtain ⟨B,hB,ha,hn⟩ := triple_orthogonal_cover v hv + apply angleBoundary_one_orbit (triangleState_flip hc hw (triangle_binary_from_continua hc hv hK hH)) B hB ha + intro t ht htR + apply triangleState_local hc hw hv hK hH (hn t ht) + simpa only [direction_plus_sixty] using hn (t+(sixty : Angles)) htR +end EuclideanFiveColor +end + +noncomputable section +open Set Filter Topology MeasureTheory +namespace EuclideanFiveColor +lemma angleEssential_connected {s : Angles → Bool} {U : Set Angles} + (hU : IsPreconnected U) (hne : U.Nonempty) (hbound : Disjoint U (angleBoundary s)) : + ∃b,U⊆angleEssential s b := by + have hcov : U⊆angleEssential s false∪angleEssential s true := by + intro t ht + have hn := disjoint_left.mp hbound ht + simp only [angleBoundary,mem_compl_iff,not_not,mem_iUnion] at hn + obtain ⟨b,hb⟩ := hn + cases b + · exact Or.inl hb + · exact Or.inr hb + obtain ⟨t,ht⟩ := hne + rcases hcov ht with hb|hb + · exact ⟨false,hU.subset_left_of_subset_union (angleEssential_open s false) (angleEssential_open s true) + (angleEssential_disjoint s (by decide)) hcov ⟨t,ht,hb⟩⟩ + · exact ⟨true,hU.subset_left_of_subset_union (angleEssential_open s true) (angleEssential_open s false) + (angleEssential_disjoint s (by decide)) (by simpa only [union_comm] using hcov) ⟨t,ht,hb⟩⟩ +lemma one_orbit_first_arc {s : Angles → Bool} {φ : ℝ} + (hboundary : angleBoundary s={u | ∃j : Fin 6,u=(φ : Angles)+sixAngle j}) : + ∃b,∀t∈Ioo φ (φ+Real.pi/3),(t : Angles)∈angleEssential s b := by + let U : Set Angles := ((↑) : ℝ → Angles) '' Ioo φ (φ+Real.pi/3) + have hU : IsPreconnected U := isPreconnected_Ioo.image _ continuous_quotient_mk'.continuousOn + have hne : U.Nonempty := (nonempty_Ioo.mpr (by linarith [Real.pi_pos] : φ<φ+Real.pi/3)).image _ + have hd : Disjoint U (angleBoundary s) := by + apply disjoint_left.mpr + rintro q ⟨t,ht,rfl⟩ hq + rw [hboundary] at hq + obtain ⟨j,hj⟩ := hq + have he : (t : Angles)=((φ+(j.val:ℝ)*(Real.pi/3) : ℝ) : Angles) := by + have hx : sixAngle j=((j.val:ℝ)*(Real.pi/3) : ℝ) := by + rw [sixAngle,←AddCircle.coe_nsmul] + simp only [nsmul_eq_mul,sixty] + simpa only [hx,AddCircle.coe_add] using hj + have htI : t∈Ico φ (φ+2*Real.pi) := ⟨ht.1.le,by linarith [Real.pi_pos,ht.2]⟩ + have hjI : φ+(j.val:ℝ)*(Real.pi/3)∈Ico φ (φ+2*Real.pi) := by + have hj0 : 0≤(j.val:ℝ) := Nat.cast_nonneg _ + have hj6 : (j.val:ℝ)<6 := by exact_mod_cast j.isLt + constructor + · nlinarith [Real.pi_pos] + · nlinarith [Real.pi_pos] + have hv := (AddCircle.coe_eq_coe_iff_of_mem_Ico htI hjI).mp he + by_cases hz : j.val=0 + · simp only [hz,Nat.cast_zero,zero_mul,add_zero] at hv + linarith [ht.1] + · have hj1 : (1:ℝ)≤j.val := by exact_mod_cast Nat.one_le_iff_ne_zero.mpr hz + nlinarith [ht.2,Real.pi_pos] + obtain ⟨b,hb⟩ := angleEssential_connected hU hne hd + exact ⟨b,fun t ht => hb ⟨t,ht,rfl⟩⟩ +lemma angleEssential_real_periodic {s : Angles → Bool} + (hf : ∀ᵐt∂angularMeasure,s (t+(sixty : Angles))= !(s t)) (b : Bool) : + Function.Periodic (fun t : ℝ => (t : Angles)∈angleEssential s b) (2*(Real.pi/3)) := by + intro t + apply propext + have hh := angleEssential_shift hf ((t : Angles)+(sixty : Angles)) (!b) + rw [Bool.not_not] at hh + have hh' := angleEssential_shift hf (t : Angles) b + have he : ((t+2*(Real.pi/3) : ℝ) : Angles) = (t : Angles)+(sixty : Angles)+(sixty : Angles) := by + calc ((t+2*(Real.pi/3) : ℝ) : Angles) = ((t+sixty+sixty : ℝ) : Angles) := by + congr 1 + dsimp [sixty] + ring + _ = _ := by rw [AddCircle.coe_add,AddCircle.coe_add] + dsimp only + rw [he] + exact hh.trans hh' +lemma one_orbit_sectors {s : Angles → Bool} {φ : ℝ} + (hf : ∀ᵐt∂angularMeasure,s (t+(sixty : Angles))= !(s t)) + (hboundary : angleBoundary s={u | ∃j : Fin 6,u=(φ : Angles)+sixAngle j}) : + ∃b,(∀t,0 x+v*placedMoser i) + (fun _ => J) hD + have hh : Fintype.card J≤Fintype.card (Fin 3) := by simpa using hJ + obtain ⟨f⟩ := Function.Embedding.nonempty_of_card_le hh + apply moser_not_three_colorable (fun i => f ⟨c (q+(x+v*placedMoser i)),hq i⟩) + intro i j hij he + have hd : ‖(x+v*placedMoser i)-(x+v*placedMoser j)‖=1 := by + rw [show (x+v*placedMoser i)-(x+v*placedMoser j)=v*(placedMoser i-placedMoser j) by ring, + norm_mul,hv,placedMoser_edge_unit hij,one_mul] + exact hp i j hd (congrArg Subtype.val (f.injective he)) +end EuclideanFiveColor +end + +noncomputable section +open Set Filter Topology MeasureTheory +namespace EuclideanFiveColor +lemma lineDensityZero_compl_of_mem_nhds {A : Set ℝ} {t : ℝ} (hA : A∈𝓝 t) : + LineDensityZero Aᶜ t := by + obtain ⟨ε,hε,hsub⟩ := Metric.mem_nhds_iff.mp hA + apply tendsto_const_nhds.congr' + filter_upwards [(eventually_lt_nhds hε).filter_mono nhdsWithin_le_nhds] with r hr + have hempty : Aᶜ∩Metric.closedBall t r=∅ := by + ext q + simp only [mem_empty_iff_false,iff_false] + rintro ⟨hq,hqr⟩ + exact hq (hsub (lt_of_le_of_lt hqr hr)) + simp [hempty] +def positiveSector (φ : ℝ) : Set ℝ := {t | 0 fun_prop +lemma negativeSector_open (φ : ℝ) : IsOpen (negativeSector φ) := by + apply isOpen_lt <;> fun_prop +variable {k : ℕ} {c : ℂ → Fin k} (hc : Measurable c) +lemma polynomial_region_density (hw : WeakColoring k c) {x : ℂ} {a b : Fin k} {φ : ℝ} + (hpos : RealState hc x (positiveSector φ) {a}) + (hneg : RealState hc x (negativeSector φ) {b}) + {z : ℂ} (hz : ThreeLabelRegion z.re z.im) : + DensityOne {q | c q∉({a,b} : Finset (Fin k))} (x+(Circle.exp φ:ℂ)*z) := by + obtain ⟨t,u,hs,hn,ht⟩ := polynomial_region_angles hz + have hpoint : angularSum x 1 (angleChart (φ+t,φ+u))=x+(Circle.exp φ:ℂ)*z := by + simp only [angularSum,angleChart,Complex.ofReal_one,one_mul,direction_real,Circle.exp_add,Circle.coe_mul] + rw [add_assoc,←mul_add,hs] + have hnon : Real.sin ((φ+u)-(φ+t))≠0 := by + simpa only [show φ+u-(φ+t)=u-t by ring] using hn + rcases mul_neg_iff.mp ht with ⟨ht,hu⟩|⟨ht,hu⟩ + · have htm : φ+t∈positiveSector φ := by simpa [positiveSector] using ht + have hum : φ+u∈negativeSector φ := by simpa [negativeSector] using hu + have hd := states_densityOne hc hw hpos hneg + (lineDensityZero_compl_of_mem_nhds ((positiveSector_open φ).mem_nhds htm)) + (lineDensityZero_compl_of_mem_nhds ((negativeSector_open φ).mem_nhds hum)) hnon + rw [hpoint] at hd + simpa only [Finset.singleton_union] using hd + · have htm : φ+t∈negativeSector φ := by simpa [negativeSector] using ht + have hum : φ+u∈positiveSector φ := by simpa [positiveSector] using hu + have hd := states_densityOne hc hw hneg hpos + (lineDensityZero_compl_of_mem_nhds ((negativeSector_open φ).mem_nhds htm)) + (lineDensityZero_compl_of_mem_nhds ((positiveSector_open φ).mem_nhds hum)) hnon + rw [hpoint] at hd + simpa only [Finset.singleton_union,Finset.pair_comm b a] using hd +/-- The exact six-sector outcome of triangle rigidity is impossible, for every center and phase. -/ +lemma no_alternating_sectors {c : ℂ → Fin 5} (hc : Measurable c) (hw : WeakColoring 5 c) + {x : ℂ} {a b : Fin 5} (hab : a≠b) (φ : ℝ) + (hpos : RealState hc x (positiveSector φ) {a}) + (hneg : RealState hc x (negativeSector φ) {b}) : False := by + let J : Finset (Fin 5) := {a,b}ᶜ + have hJ : J.card≤3 := by + change ({a,b}ᶜ : Finset (Fin 5)).card≤3 + rw [Finset.card_compl,Finset.card_pair hab] + decide + apply moser_density_impossible hc hw x (Circle.exp φ) (Circle.norm_coe _) J hJ + intro i + simpa only [J,Finset.mem_compl] using polynomial_region_density hc hw hpos hneg + (seven_point_certificate i) +end EuclideanFiveColor +end + +noncomputable section +open Set Filter Topology MeasureTheory +namespace EuclideanFiveColor +lemma triangleState_palette {c : ℂ → Fin 5} (hc : Measurable c) (hw : WeakColoring 5 c) + {x : ℂ} (hb : BinaryCenter c hc x 3 4) (b : Bool) : + ∀ᵐt∂angularMeasure,triangleState c hc x t=b → t∈paletteSet c hc x (if b then 4 else 3) := by + classical + filter_upwards [binary_alternation c hc hw hb] with t ht he + cases b + · simp only [Bool.false_eq_true,ite_false] + by_contra hn + simp only [triangleState,hn,ite_false] at he + exact Bool.noConfusion he + · simp only [ite_true] + apply ht.2.mpr + intro hp + simp only [triangleState,hp,ite_true] at he + exact Bool.noConfusion he +/-- Complete actual triangle-interface endgame, including boundary rigidity, +sector extraction and the exact seven-point unit-distance certificate. -/ +lemma no_triangle_interfaces {c : ℂ → Fin 5} (hc : Measurable c) (hw : WeakColoring 5 c) + {x : ℂ} {K : Fin 3 → Set ℂ} {v : Fin 3 → ℂ} (hv : ∀i,‖v i‖=1) + (hK : ∀i,ApproachingContinuum x (K i) (v i)) + (hH : ∀i,∀j∈triangleEdge i,Disjoint (spatialSupport c j) (Straddle (K i))) : False := by + have hbinary := triangle_binary_from_continua hc hv hK hH + obtain ⟨q,hq⟩ := triangle_boundary_one_orbit hc hw hv hK hH + obtain ⟨φ,rfl⟩ := QuotientAddGroup.mk_surjective q + obtain ⟨b,hpos,hneg⟩ := one_orbit_sectors (triangleState_flip hc hw hbinary) hq + have hstate (d : Bool) (A : Set ℝ) (hA : MeasurableSet A) + (hAd : ∀t∈A,(t : Angles)∈angleEssential (triangleState c hc x) d) : + RealState hc x A {if d then 4 else 3} := by + refine ⟨hA,?_⟩ + intro i hi + rw [Finset.mem_singleton] at hi + subst i + have hh := angleMk_quasiMeasurePreserving.ae + ((angleEssential_ae (triangleState c hc x) d).and (triangleState_palette hc hw hbinary d)) + filter_upwards [hh] with t ht hAt + exact ht.2 (ht.1 (hAd t hAt)) + have hp := hstate b (positiveSector φ) (positiveSector_open φ).measurableSet hpos + have hn := hstate (!b) (negativeSector φ) (negativeSector_open φ).measurableSet hneg + exact no_alternating_sectors hc hw (by cases b <;> decide) φ hp hn +end EuclideanFiveColor +end + +end OAI diff --git a/lean/OAI/Geometry/PlaneColoring/Seven.lean b/lean/OAI/Geometry/PlaneColoring/Seven.lean new file mode 100644 index 0000000000000000000000000000000000000000..b23cd2d0189d3ec3829b81af92afd9d9a4ce5dc1 --- /dev/null +++ b/lean/OAI/Geometry/PlaneColoring/Seven.lean @@ -0,0 +1,68 @@ +import OAI.Geometry.PlaneColoring.Assembly +import OAI.Geometry.PlaneColoring.Lattice +import OAI.Geometry.PlaneColoring.Metric +import OAI.Geometry.PlaneColoring.Covering +import OAI.Geometry.PlaneColoring.MeasurableAssembly +import OAI.Geometry.PlaneColoring.MeasurableProper + +namespace OAI + +noncomputable section + +namespace Problem160 + +/-- The elementary covering-radius statement is the only geometric input +needed to turn the index-seven lattice coloring into a plane coloring. -/ +theorem properColoring_seven_of_normalized_cover + (hcover : ∀ x y : ℝ, ∃ a b : ℤ, + (x - ((a : ℝ) + (b : ℝ) / 2)) ^ 2 + + (y - Real.sqrt 3 * b / 2) ^ 2 ≤ (1 / 3 : ℝ)) : + ProperColoring 7 := by + apply exists_unit_distance_coloring_of_center_cover + (fun p : ℤ × ℤ => triangularLattice p.1 p.2) + (fun p : ℤ × ℤ => SevenLattice.colorFin p.1 p.2) (7 / 15 : ℝ) + · intro x + obtain ⟨a, b, hab⟩ := hcover ((5 / 4 : ℝ) * x 0) ((5 / 4 : ℝ) * x 1) + exact ⟨(a, b), dist_triangularLattice_le_of_coordinates x a b hab⟩ + · norm_num + · intro i j hij hc + have hq := SevenLattice.same_color_separation + (SevenLattice.colorFin_injective_value hc) hij + have hsep := triangularLattice_dist_gt_two i.1 i.2 j.1 j.2 hq + linarith + +/-- The classical seven-color upper bound, with all boundary points assigned +using the closed triangular-lattice cover. -/ +theorem properColoring_seven : ProperColoring 7 := + properColoring_seven_of_normalized_cover triangular_lattice_cover + +/-- The seven-color construction admits a measurable choice on its boundary +points: select the first covering center in a countable enumeration. -/ +theorem exists_measurable_proper_seven : + ∃ c : Plane → Fin 7, Measurable c ∧ + ∀ x y : Plane, dist x y = 1 → c x ≠ c y := by + apply exists_measurable_unit_distance_coloring_of_center_cover + (fun p : ℤ × ℤ => triangularLattice p.1 p.2) + (fun p : ℤ × ℤ => SevenLattice.colorFin p.1 p.2) (7 / 15 : ℝ) + · intro x + obtain ⟨a, b, hab⟩ := triangular_lattice_cover + ((5 / 4 : ℝ) * x 0) ((5 / 4 : ℝ) * x 1) + exact ⟨(a, b), dist_triangularLattice_le_of_coordinates x a b hab⟩ + · norm_num + · intro i j hij hc + have hq := SevenLattice.same_color_separation + (SevenLattice.colorFin_injective_value hc) hij + have hsep := triangularLattice_dist_gt_two i.1 i.2 j.1 j.2 hq + linarith + +/-- The classical measurable seven-color construction satisfies the exact +weak pair-measure condition. -/ +theorem weakMeasurableColoring_seven : WeakMeasurableColoring 7 := by + obtain ⟨c, hc, hproper⟩ := exists_measurable_proper_seven + exact weakMeasurableColoring_of_aemeasurable_proper c hc.aemeasurable hproper + +end Problem160 + +end + +end OAI diff --git a/lean/OAI/Geometry/PlaneColoring/States.lean b/lean/OAI/Geometry/PlaneColoring/States.lean new file mode 100644 index 0000000000000000000000000000000000000000..d4b162d37aa7493b00981ef696b89a60715c48eb --- /dev/null +++ b/lean/OAI/Geometry/PlaneColoring/States.lean @@ -0,0 +1,764 @@ +import OAI.Geometry.PlaneColoring.BinaryPalettes + +namespace OAI + +noncomputable section +open Set +namespace EuclideanFiveColor +def fourGroup (s : Fin 3) : Finset (Fin 5) := if s=0 then {4} else if s=1 then {0,2} else {1,3} +def fourEdge (e : Fin 4) : Finset (Fin 5) := + if e=0 then {0,1} else if e=1 then {1,2} else if e=2 then {2,3} else {3,0} +def fourCanonical (p : Finset (Fin 5)) : Fin 3 := if 4∈p then 0 else if 0∈p then 1 else 2 +def FourAdmissible (p : Finset (Fin 5)) : Prop := + p.Nonempty ∧ p.card≤2 ∧ ∀ e : Fin 4, ¬p⊆fourEdge e +lemma fourGroup_nonempty (s : Fin 3) : (fourGroup s).Nonempty := by + fin_cases s <;> simp [fourGroup] +lemma four_admissible_group : ∀ p : Finset (Fin 5), FourAdmissible p → fourGroup (fourCanonical p)⊆p := by + unfold FourAdmissible + decide +lemma four_group_unique : ∀ p : Finset (Fin 5), p.card≤2 → ∀ s t : Fin 3, + fourGroup s⊆p → fourGroup t⊆p → s=t := by decide +lemma four_admissible_character : ∀ p : Finset (Fin 5), FourAdmissible p → ∀ s : Fin 3, + fourGroup s⊆p ↔ fourCanonical p=s := by + intro p hp s + constructor + · intro hs + exact (four_group_unique p hp.2.1 s (fourCanonical p) hs (four_admissible_group p hp)).symm + · rintro rfl + exact four_admissible_group p hp +lemma four_trace_edge : ∀ p : Finset (Fin 5), FourAdmissible p → ∀ i∈fourGroup (fourCanonical p), + ∃ e : Fin 4, i∉fourEdge e ∧ p\{i}⊆fourEdge e := by + unfold FourAdmissible + decide +end EuclideanFiveColor +end + +noncomputable section +open Set Filter Topology MeasureTheory +namespace EuclideanFiveColor +lemma LineDensityZero.mono_ae {A B : Set ℝ} {t : ℝ} + (hB : LineDensityZero B t) (hAB : A≤ᵐ[volume] B) : LineDensityZero A t := by + apply squeeze_zero' ?_ ?_ hB + · filter_upwards [self_mem_nhdsWithin] with r hr + exact div_nonneg measureReal_nonneg (le_of_lt hr) + · filter_upwards [self_mem_nhdsWithin] with r hr + apply div_le_div_of_nonneg_right _ (le_of_lt hr) + apply ENNReal.toReal_mono + · exact ne_top_of_le_ne_top (isCompact_closedBall t r).measure_ne_top (measure_mono inter_subset_right) + · exact measure_mono_ae (hAB.mono fun _ hz h => ⟨hz h.1,h.2⟩) +def DensityZero (A : Set ℂ) (x : ℂ) : Prop := + Tendsto (fun r : ℝ => volume (A∩Metric.closedBall x r)/volume (Metric.closedBall x r)) + (𝓝[>] 0) (𝓝 (0:ENNReal)) +lemma DensityZero.mono {A B : Set ℂ} {x : ℂ} (hB : DensityZero B x) (hAB : A⊆B) : + DensityZero A x := by + apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds hB (fun _ => zero_le) + intro r + exact ENNReal.div_le_div_right (measure_mono (inter_subset_inter_left _ hAB)) _ +lemma DensityZero.union {A B : Set ℂ} {x : ℂ} (hA : DensityZero A x) (hB : DensityZero B x) : + DensityZero (A∪B) x := by + have hh := hA.add hB + rw [add_zero] at hh + apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds hh (fun _ => zero_le) + intro r + dsimp only + rw [← ENNReal.add_div,union_inter_distrib_right] + exact ENNReal.div_le_div_right (measure_union_le _ _) _ +lemma densityZero_empty (x : ℂ) : DensityZero ∅ x := by + simp only [DensityZero,empty_inter,measure_empty,ENNReal.zero_div] + exact tendsto_const_nhds +lemma DensityZero.biUnion_finset {ι : Type*} (J : Finset ι) {A : ι → Set ℂ} {x : ℂ} + (hA : ∀ i∈J,DensityZero (A i) x) : DensityZero (⋃ i∈J,A i) x := by + classical + induction J using Finset.induction_on with + | empty => simpa using densityZero_empty x + | @insert i J hi ih => + rw [Finset.set_biUnion_insert] + exact (hA i (Finset.mem_insert_self _ _)).union + (ih (fun j hj => hA j (Finset.mem_insert_of_mem hj))) +lemma DensityZero.compl {A : Set ℂ} {x : ℂ} (hA : MeasurableSet A) (hz : DensityZero A x) : + DensityOne Aᶜ x := by + have ht := ENNReal.Tendsto.sub (tendsto_const_nhds (x := (1:ENNReal))) hz (Or.inl (by finiteness)) + rw [tsub_zero] at ht + apply ht.congr' + filter_upwards [self_mem_nhdsWithin] with r hr + have hfin : volume (A∩Metric.closedBall x r)≠⊤ := + ne_top_of_le_ne_top (isCompact_closedBall x r).measure_ne_top (measure_mono inter_subset_right) + have hp := (Metric.measure_closedBall_pos volume x hr).ne' + have he : Aᶜ∩Metric.closedBall x r=Metric.closedBall x r\(A∩Metric.closedBall x r) := by + ext z; simp; tauto + rw [he,measure_sdiff inter_subset_right (hA.inter measurableSet_closedBall).nullMeasurableSet hfin, + ENNReal.sub_div (fun _ _ => hp),ENNReal.div_self hp (isCompact_closedBall x r).measure_ne_top] +variable {k : ℕ} {c : ℂ → Fin k} (hc : Measurable c) +def RealState (x : ℂ) (A : Set ℝ) (J : Finset (Fin k)) : Prop := + MeasurableSet A ∧ ∀ i∈J, A≤ᵐ[volume] liftPalette c hc x i +lemma state_densityZero (hw : WeakColoring k c) {x : ℂ} {A : Set ℝ} {J : Finset (Fin k)} + (hA : RealState hc x A J) {t u : ℝ} (ht : LineDensityZero Aᶜ t) + (hu : Real.sin (u-t)≠0) {i : Fin k} (hi : i∈J) : + DensityZero {z | c z=i} (angularSum x 1 (angleChart (t,u))) := by + apply palette_spatial_densityZero c hc hw _ hu + apply ht.mono_ae + filter_upwards [hA.2 i hi] with v hv + exact mt hv +lemma angularSum_swap (x : ℂ) (t u : ℝ) : + angularSum x 1 (angleChart (u,t))=angularSum x 1 (angleChart (t,u)) := by + simp only [angularSum,angleChart,Complex.ofReal_one,one_mul] + ring +lemma states_densityOne (hw : WeakColoring k c) {x : ℂ} {A B : Set ℝ} {J K : Finset (Fin k)} + (hA : RealState hc x A J) (hB : RealState hc x B K) {t u : ℝ} + (ht : LineDensityZero Aᶜ t) (hu : LineDensityZero Bᶜ u) (hne : Real.sin (u-t)≠0) : + DensityOne {z | c z∉J∪K} (angularSum x 1 (angleChart (t,u))) := by + have hz : DensityZero (⋃ i∈J∪K, {z | c z=i}) (angularSum x 1 (angleChart (t,u))) := by + apply DensityZero.biUnion_finset + intro i hi + rcases Finset.mem_union.mp hi with hi|hi + · exact state_densityZero hc hw hA ht hne hi + · rw [← angularSum_swap x t u] + apply state_densityZero hc hw hB hu _ hi + rwa [← neg_sub u t,Real.sin_neg,neg_ne_zero] + have hm : MeasurableSet (⋃ i∈J∪K, {z | c z=i}) := + (J∪K).measurableSet_biUnion fun _ _ => measurableSet_eq_fun hc measurable_const + convert hz.compl hm using 1 + ext z + simp only [mem_compl_iff,mem_iUnion,mem_ofPred_eq] + aesop +end EuclideanFiveColor +end + +noncomputable section +open Set Filter Topology MeasureTheory +namespace EuclideanFiveColor +lemma DensityOne.compl {A : Set ℂ} {x : ℂ} (hA : MeasurableSet A) (h : DensityOne A x) : + DensityZero Aᶜ x := by + have ht := ENNReal.Tendsto.sub (tendsto_const_nhds (x := (1:ENNReal))) h (Or.inl (by finiteness)) + rw [tsub_self] at ht + apply ht.congr' + filter_upwards [self_mem_nhdsWithin] with r hr + have hfin : volume (A∩Metric.closedBall x r)≠⊤ := + ne_top_of_le_ne_top (isCompact_closedBall x r).measure_ne_top (measure_mono inter_subset_right) + have hp := (Metric.measure_closedBall_pos volume x hr).ne' + have he : Aᶜ∩Metric.closedBall x r=Metric.closedBall x r\(A∩Metric.closedBall x r) := by + ext z; simp; tauto + rw [he,measure_sdiff inter_subset_right (hA.inter measurableSet_closedBall).nullMeasurableSet hfin, + ENNReal.sub_div (fun _ _ => hp),ENNReal.div_self hp (isCompact_closedBall x r).measure_ne_top] +lemma DensityOne.inter {A B : Set ℂ} {x : ℂ} (hA : MeasurableSet A) (hB : MeasurableSet B) + (ha : DensityOne A x) (hb : DensityOne B x) : DensityOne (A∩B) x := by + have hh := ((ha.compl hA).union (hb.compl hB)).compl (hA.compl.union hB.compl) + simpa using hh +lemma DensityOne.measure_ne_zero {A : Set ℂ} {x : ℂ} (h : DensityOne A x) : volume A≠0 := by + intro hz + have hzero : (fun r => volume (A∩Metric.closedBall x r)/volume (Metric.closedBall x r))=fun _ : ℝ => (0:ENNReal) := by + funext r + rw [measure_mono_null inter_subset_left hz,ENNReal.zero_div] + change Tendsto _ _ _ at h + rw [hzero] at h + exact zero_ne_one (tendsto_nhds_unique tendsto_const_nhds h) +lemma densityOne_univ (x : ℂ) : DensityOne univ x := by + apply tendsto_const_nhds.congr' + filter_upwards [self_mem_nhdsWithin] with r hr + simp only [univ_inter] + exact (ENNReal.div_self (Metric.measure_closedBall_pos volume x hr).ne' + (isCompact_closedBall x r).measure_ne_top).symm +lemma DensityOne.iInter {ι : Type*} [Finite ι] {A : ι → Set ℂ} {x : ℂ} + (hm : ∀i,MeasurableSet (A i)) (h : ∀i,DensityOne (A i) x) : DensityOne (⋂i,A i) x := by + classical + let := Fintype.ofFinite ι + have hh (J : Finset ι) : DensityOne (⋂i∈J,A i) x := by + induction J using Finset.induction_on with + | empty => simpa using densityOne_univ x + | @insert i J hi ih => + simp only [Finset.set_biInter_insert] + exact (h i).inter (hm i) (J.measurableSet_biInter fun j _ => hm j) ih + simpa using hh Finset.univ +variable {k : ℕ} {c : ℂ → Fin k} +lemma finite_density_realization (hc : Measurable c) (hw : WeakColoring k c) + {ι : Type*} [Finite ι] (z : ι → ℂ) (J : ι → Finset (Fin k)) + (hz : ∀v,DensityOne {q | c q∈J v} (z v)) : + ∃q : ℂ, (∀v,c (q+z v)∈J v) ∧ + ∀v w, ‖z v-z w‖=1 → c (q+z v)≠c (q+z w) := by + have hmem : DensityOne (⋂v,{q | c (q+z v)∈J v}) 0 := by + apply DensityOne.iInter + · intro v + exact (J v).finite_toSet.measurableSet.preimage (hc.comp (measurable_id.add_const _)) + · intro v + simpa only [zero_add,preimage_ofPred_eq] using (densityOne_translate (A := {q | c q∈J v}) (x := 0) (u := z v)).mpr (by simpa using hz v) + have hproper : ∀ᵐ q : ℂ ∂volume, ∀v w, ‖z v-z w‖=1 → c (q+z v)≠c (q+z w) := by + apply ae_all_iff.mpr + intro v + apply ae_all_iff.mpr + intro w + by_cases hh : ‖z v-z w‖=1 + · obtain ⟨t,ht⟩ := direction_exists (u := z w-z v) (by simpa only [norm_sub_rev] using hh) + have hd := (measurePreserving_add_right volume (z v)).quasiMeasurePreserving.ae + (weak_all_directions c hc hw t) + filter_upwards [hd] with q hq _ + simpa only [ht,show q+z v+(z w-z v)=q+z w by ring] using hq + · exact Eventually.of_forall fun _ => fun h => (hh h).elim + obtain ⟨q,hq,hqp⟩ := Measure.exists_mem_of_measure_ne_zero_of_ae hmem.measure_ne_zero (ae_restrict_of_ae hproper) + exact ⟨q,fun v => mem_iInter.mp hq v,hqp⟩ +lemma two_label_triangle_impossible (hc : Measurable c) (hw : WeakColoring k c) + (z : Fin 3 → ℂ) (J : Finset (Fin k)) (hJ : J.card≤2) + (hd : ∀v w,v≠w → ‖z v-z w‖=1) : + ¬(∀v,DensityOne {q | c q∈J} (z v)) := by + intro hz + obtain ⟨q,hq,hp⟩ := finite_density_realization hc hw z (fun _ => J) hz + have hinj : Function.Injective (fun v : Fin 3 => (⟨c (q+z v),hq v⟩ : J)) := by + intro v w he + by_contra hne + exact hp v w (hd v w hne) (congrArg Subtype.val he) + have hcard := Fintype.card_le_of_injective _ hinj + simp only [Fintype.card_fin,Fintype.card_coe] at hcard + omega +end EuclideanFiveColor +end + +noncomputable section +open Set Filter Topology MeasureTheory +namespace EuclideanFiveColor +lemma bool_flip_two {s : ℝ → Bool} {κ : ℝ} + (h : ∀ᵐt∂volume,s (t+κ)= !(s t)) : ∀ᵐt∂volume,s (t+2*κ)=s t := by + have h' := (measurePreserving_add_right volume κ).quasiMeasurePreserving.ae h + filter_upwards [h,h'] with t ht ht' + rw [show t+κ+κ=t+2*κ by ring,ht,Bool.not_not] at ht' + exact ht' +lemma bool_flip_three {s : ℝ → Bool} {κ : ℝ} + (h : ∀ᵐt∂volume,s (t+κ)= !(s t)) : ∀ᵐt∂volume,s (t+3*κ)= !(s t) := by + have h' := (measurePreserving_add_right volume (2*κ)).quasiMeasurePreserving.ae h + filter_upwards [bool_flip_two h,h'] with t ht ht' + rwa [show t+2*κ+κ=t+3*κ by ring,ht] at ht' +lemma bool_flip_even {s : ℝ → Bool} {κ : ℝ} + (h : ∀ᵐt∂volume,s (t+κ)= !(s t)) (n : ℕ) : ∀ᵐt∂volume,s (t+2*n*κ)=s t := by + induction n with + | zero => simp + | succ n ih => + have h' := (measurePreserving_add_right volume (2*n*κ)).quasiMeasurePreserving.ae (bool_flip_two h) + filter_upwards [ih,h'] with t ht ht' + rw [ht] at ht' + convert ht' using 1 + norm_num + congr 1 + ring +lemma triangleAngle_nonparallel : Real.sin (Real.pi+triangleAngle)≠0 := by + rw [add_comm,Real.sin_add_pi,neg_ne_zero] + exact (Real.sin_pos_of_pos_of_lt_pi triangleAngle_pos triangleAngle_lt_pi).ne' +lemma two_state_impossible {k : ℕ} {c : ℂ → Fin k} (hc : Measurable c) (hw : WeakColoring k c) + (x : ℂ) (J K : Finset (Fin k)) (hcard : (Finset.univ\(J∪K)).card≤2) + (s : Angles → Bool) (hs : Measurable s) + (hJ : RealState hc x {t : ℝ | s (t : Angles)=false} J) + (hK : RealState hc x {t : ℝ | s (t : Angles)=true} K) + (hflip : ∀ᵐt∂angularMeasure,s (t+(Real.pi/3 : ℝ))= !(s t)) : False := by + let f : ℝ → Bool := fun t => s (t : Angles) + have hf : Measurable f := hs.comp angleMk_quasiMeasurePreserving.measurable + have hflip' : ∀ᵐt : ℝ ∂volume, f (t+Real.pi/3)= !(f t) := by + have hh := angleMk_quasiMeasurePreserving.ae hflip + simpa only [← AddCircle.coe_add] using hh + have heven (n : ℕ) := bool_flip_even hflip' n + have hπ : ∀ᵐt : ℝ ∂volume, f (t+Real.pi)= !(f t) := by + simpa only [show 3*(Real.pi/3)=Real.pi by ring] using bool_flip_three hflip' + have hden : ∀ᵐt : ℝ ∂volume, ∀b : Bool, f t=b → LineDensityZero {a : ℝ | f a≠b} t := by + apply ae_all_iff.mpr + intro b + exact ae_lineDensityZero_compl (measurableSet_eq_fun hf measurable_const) + have hgood : ∀ᵐt : ℝ ∂volume, ∀j : Fin 3, + f (t+2*(j:ℝ)*(Real.pi/3))=f t ∧ + f (t+2*(j:ℝ)*(Real.pi/3)+Real.pi+triangleAngle)= !(f (t+triangleAngle)) ∧ + (∀b : Bool,f (t+2*(j:ℝ)*(Real.pi/3))=b → + LineDensityZero {a : ℝ | f a≠b} (t+2*(j:ℝ)*(Real.pi/3))) ∧ + (∀b : Bool,f (t+2*(j:ℝ)*(Real.pi/3)+Real.pi+triangleAngle)=b → + LineDensityZero {a : ℝ | f a≠b} (t+2*(j:ℝ)*(Real.pi/3)+Real.pi+triangleAngle)) := by + apply ae_all_iff.mpr + intro j + have h₁ := heven j.val + have h₂ := (measurePreserving_add_right volume triangleAngle).quasiMeasurePreserving.ae (heven j.val) + have h₃ := (measurePreserving_add_right volume (triangleAngle+2*(j:ℝ)*(Real.pi/3))).quasiMeasurePreserving.ae hπ + have h₄ := (measurePreserving_add_right volume (2*(j:ℝ)*(Real.pi/3))).quasiMeasurePreserving.ae hden + have h₅ := (measurePreserving_add_right volume (2*(j:ℝ)*(Real.pi/3)+Real.pi+triangleAngle)).quasiMeasurePreserving.ae hden + filter_upwards [h₁,h₂,h₃,h₄,h₅] with t ht₁ ht₂ ht₃ ht₄ ht₅ + refine ⟨ht₁,?_,ht₄,?_⟩ + · change f (t+(triangleAngle+2*(j:ℝ)*(Real.pi/3))+Real.pi)= !(f (t+(triangleAngle+2*(j:ℝ)*(Real.pi/3)))) at ht₃ + rw [show t+(triangleAngle+2*(j:ℝ)*(Real.pi/3))=t+triangleAngle+2*(j:ℝ)*(Real.pi/3) by ring,ht₂] at ht₃ + simpa only [show t+triangleAngle+2*(j:ℝ)*(Real.pi/3)+Real.pi = t+2*(j:ℝ)*(Real.pi/3)+Real.pi+triangleAngle by ring] using ht₃ + · simpa only [show t+(2*(j:ℝ)*(Real.pi/3)+Real.pi+triangleAngle)=t+2*(j:ℝ)*(Real.pi/3)+Real.pi+triangleAngle by ring] using ht₅ + have hfreq : ∃ᶠt : ℝ in ae volume, f t=f (t+triangleAngle) := by + by_contra hh + have hn : ∀ᵐt : ℝ ∂volume, f t≠f (t+triangleAngle) := not_frequently.mp hh + have ha : ∀ᵐt∂angularMeasure,s t≠s (t+(triangleAngle : Angles)) := by + apply ae_angular_of_ae_line + · exact (measurableSet_eq_fun hs (hs.comp (measurable_id.add_const _))).compl + · simpa only [f,← AddCircle.coe_add] using hn + exact (ne_of_gt (equal_triangleAngle_positive hs hflip)) + (measure_eq_zero_iff_ae_notMem.mpr ha) + obtain ⟨t,hteq,htgood⟩ := (hfreq.and_eventually hgood).exists + apply two_label_triangle_impossible hc hw (sourceTriangle x t) (Finset.univ\(J∪K)) hcard + (sourceTriangle_pair x t) + intro j + obtain ⟨h₁,h₂,h₃,h₄⟩ := htgood j + rw [← hteq] at h₂ + have hne : Real.sin ((t+2*(j:ℝ)*(Real.pi/3)+Real.pi+triangleAngle)-(t+2*(j:ℝ)*(Real.pi/3)))≠0 := by + rw [show (t+2*(j:ℝ)*(Real.pi/3)+Real.pi+triangleAngle)-(t+2*(j:ℝ)*(Real.pi/3))=Real.pi+triangleAngle by ring] + exact triangleAngle_nonparallel + have hd : DensityOne {q | c q∉J∪K} (sourceTriangle x t j) := by + cases hb : f t + · have ha := h₃ false (h₁.trans hb) + have hb' := h₄ true (by simpa [hb] using h₂) + exact states_densityOne hc hw hJ hK ha hb' hne + · have ha := h₃ true (h₁.trans hb) + have hb' := h₄ false (by simpa [hb] using h₂) + simpa only [Finset.union_comm,sourceTriangle] using states_densityOne hc hw hK hJ ha hb' hne + simpa only [Finset.mem_sdiff,Finset.mem_univ,true_and] using hd +end EuclideanFiveColor +end + +noncomputable section +open Set Filter Topology MeasureTheory +namespace EuclideanFiveColor +variable (c : ℂ → Fin 5) (hc : Measurable c) +def FourCenter (x : ℂ) : Prop := + TransitionEdge c 0 1 x ∧ TransitionEdge c 1 2 x ∧ TransitionEdge c 2 3 x ∧ TransitionEdge c 3 0 x +lemma four_palette_admissible (hw : WeakColoring 5 c) {x : ℂ} (hx : FourCenter c x) : + ∀ᵐ t∂angularMeasure, FourAdmissible (palette c hc x t) := by + filter_upwards [palette_nonempty c hc x,palette_cardinality c hc hw x, + edge_palette_not_pair c hc hw hx.1,edge_palette_not_pair c hc hw hx.2.1, + edge_palette_not_pair c hc hw hx.2.2.1,edge_palette_not_pair c hc hw hx.2.2.2] with t ht hcard h01 h12 h23 h30 + refine ⟨ht,hcard.2,?_⟩ + intro e + fin_cases e <;> simp only [fourEdge] <;> assumption +def fourState (x : ℂ) (t : Angles) : Fin 3 := fourCanonical (palette c hc x t) +lemma fourState_measurable (x : ℂ) : Measurable (fourState c hc x) := by + change Measurable (fun t => if 4∈palette c hc x t then (0:Fin 3) else if 0∈palette c hc x t then 1 else 2) + exact Measurable.ite (by simpa only [mem_palette,Set.ofPred_mem_eq] using paletteSet_measurable c hc x 4) measurable_const + (Measurable.ite (by simpa only [mem_palette,Set.ofPred_mem_eq] using paletteSet_measurable c hc x 0) measurable_const measurable_const) +lemma fourState_group (hw : WeakColoring 5 c) {x : ℂ} (hx : FourCenter c x) : + ∀ᵐ t∂angularMeasure, fourGroup (fourState c hc x t)⊆palette c hc x t := + (four_palette_admissible c hc hw hx).mono fun _ ht => four_admissible_group _ ht +lemma fourState_represents (hw : WeakColoring 5 c) {x : ℂ} (hx : FourCenter c x) (s : Fin 3) : + RealState hc x {t : ℝ | fourState c hc x (t : Angles)=s} (fourGroup s) := by + refine ⟨measurableSet_eq_fun ((fourState_measurable c hc x).comp angleMk_quasiMeasurePreserving.measurable) measurable_const,?_⟩ + intro i hi + have hh := angleMk_quasiMeasurePreserving.ae (fourState_group c hc hw hx) + filter_upwards [hh] with t ht hts + change fourState c hc x (t : Angles)=s at hts + exact (mem_palette c hc x (t : Angles) i).mp (ht (by simpa only [hts] using hi)) +lemma fourState_changes (hw : WeakColoring 5 c) {x : ℂ} (hx : FourCenter c x) : + ∀ᵐ t∂angularMeasure, fourState c hc x t≠fourState c hc x (t+(Real.pi/3 : ℝ)) := by + have hgp := fourState_group c hc hw hx + filter_upwards [hgp,(measurePreserving_add_right angularMeasure (sixty : Angles)).quasiMeasurePreserving.ae hgp, + palette_sixty_disjoint c hc hw x] with t ht hu hd he + obtain ⟨i,hi⟩ := fourGroup_nonempty (fourState c hc x t) + have hi' : i∈palette c hc x (t+(sixty : Angles)) := hu (by simpa only [sixty,he] using hi) + exact Finset.disjoint_left.mp hd (ht hi) hi' +lemma three_exclude_flip : ∀ (s t o : Fin 3), o≠0 → s≠o → t≠o → s≠t → + (if t=0 then false else true) = !(if s=0 then false else true) := by decide +lemma fourState_diagonal_positive (hw : WeakColoring 5 c) {x : ℂ} (hx : FourCenter c x) + (s : Fin 3) (hs : s≠0) : 0 if fourState c hc x t=0 then false else true + have hf : Measurable f := Measurable.ite + (measurableSet_eq_fun (fourState_measurable c hc x) measurable_const) measurable_const measurable_const + have hrep (v : Bool) : RealState hc x {t : ℝ | f (t : Angles)=v} (if v then fourGroup r else fourGroup 0) := by + refine ⟨measurableSet_eq_fun (hf.comp angleMk_quasiMeasurePreserving.measurable) measurable_const,?_⟩ + intro i hi + filter_upwards [angleMk_quasiMeasurePreserving.ae (fourState_group c hc hw hx), + angleMk_quasiMeasurePreserving.ae hnot] with t ht htn htv + change f (t : Angles)=v at htv + apply (mem_palette c hc x (t : Angles) i).mp + apply ht + cases v + · have hz : fourState c hc x (t : Angles)=0 := by simpa [f] using htv + simpa only [hz,Bool.false_eq_true,ite_false] using hi + · have hz : fourState c hc x (t : Angles)=r := hr.2.2 _ (by simpa [f] using htv) htn + simpa only [hz,ite_true] using hi + have hcard : (Finset.univ\(fourGroup 0∪fourGroup r)).card≤2 := by + exact (show ∀s : Fin 3,s≠0 → (Finset.univ\(fourGroup 0∪fourGroup (if s=1 then 2 else 1))).card≤2 from by decide) s hs + apply two_state_impossible hc hw x (fourGroup 0) (fourGroup r) hcard f hf (hrep false) (hrep true) + filter_upwards [hnot,(measurePreserving_add_right angularMeasure (Real.pi/3 : ℝ)).quasiMeasurePreserving.ae hnot, + fourState_changes c hc hw hx] with t ht hu hne + exact three_exclude_flip _ _ s hs ht hu hne +end EuclideanFiveColor +end + +noncomputable section +open MeasureTheory Filter Topology Set +open scoped NNReal +namespace EuclideanFiveColor +lemma varying_pullback_L1 {X Y : Type*} [MeasurableSpace X] + [TopologicalSpace Y] [NormalSpace Y] [MeasurableSpace Y] [BorelSpace Y] + {μ : Measure X} {ν : Measure Y} [IsFiniteMeasure μ] [ν.WeaklyRegular] + {T : ℕ → X → Y} {S : X → Y} {C : ℝ≥0} + (hT : ∀ n, Measurable (T n)) (hS : Measurable S) + (hmT : ∀ᶠ n in atTop, μ.map (T n) ≤ (C : ENNReal) • ν) (hmS : μ.map S ≤ (C : ENNReal) • ν) + (ht : ∀ᵐ x ∂μ, Tendsto (fun n => T n x) atTop (𝓝 (S x))) + {f : Y → ℝ} {g : ℕ → Y → ℝ} (hf : Integrable f ν) (hg : ∀ n, Integrable (g n) ν) + (hgf : Tendsto (fun n => ∫ y, ‖g n y-f y‖ ∂ν) atTop (𝓝 0)) : + Tendsto (fun n => ∫ x, ‖g n (T n x)-f (S x)‖ ∂μ) atTop (𝓝 0) := by + have hfixed := tendsto_integral_norm_comp_sub_eventual hT hS hmT hmS ht hf + have hbound : Tendsto (fun n => (C : ℝ)*(∫ y, ‖g n y-f y‖ ∂ν)+ + ∫ x, ‖f (T n x)-f (S x)‖ ∂μ) atTop (𝓝 0) := by + simpa only [mul_zero,add_zero] using (hgf.const_mul (C : ℝ)).add hfixed + apply squeeze_zero' (Eventually.of_forall fun n => integral_nonneg fun _ => norm_nonneg _) ?_ hbound + filter_upwards [hmT] with n hn + have hgT := integrable_comp_of_map_le (hT n) hn (hg n) + have hfT := integrable_comp_of_map_le (hT n) hn hf + have hfS := integrable_comp_of_map_le hS hmS hf + calc + _ ≤ ∫ x, ‖g n (T n x)-f (T n x)‖+‖f (T n x)-f (S x)‖ ∂μ := + integral_mono (hgT.sub hfS).norm ((hgT.sub hfT).norm.add (hfT.sub hfS).norm) + (fun x => norm_sub_le_norm_sub_add_norm_sub _ _ _) + _ = (∫ x, ‖g n (T n x)-f (T n x)‖ ∂μ)+(∫ x, ‖f (T n x)-f (S x)‖ ∂μ) := + integral_add (hgT.sub hfT).norm (hfT.sub hfS).norm + _ ≤ _ := add_le_add (integral_norm_comp_le (hT n) hn ((hg n).sub hf)) le_rfl +lemma indicator_inter_positive {X : Type*} [MeasurableSpace X] {μ : Measure X} [IsFiniteMeasure μ] + {A : Set X} {B D : ℕ → Set X} (hA : MeasurableSet A) + (hB : ∀ n,MeasurableSet (B n)) (hD : ∀ n,MeasurableSet (D n)) (hp : 0<μ A) + (hBA : Tendsto (fun n => ∫ x, ‖(B n).indicator (fun _ => (1:ℝ)) x-A.indicator (fun _ => (1:ℝ)) x‖ ∂μ) atTop (𝓝 0)) + (hDA : Tendsto (fun n => ∫ x, ‖(D n).indicator (fun _ => (1:ℝ)) x-A.indicator (fun _ => (1:ℝ)) x‖ ∂μ) atTop (𝓝 0)) : + ∀ᶠ n in atTop, 0<μ (B n∩D n) := by + have hpos : 0<(μ A).toReal := ENNReal.toReal_pos hp.ne' (measure_ne_top _ _) + have ht := hBA.add hDA + rw [add_zero] at ht + filter_upwards [ht.eventually (gt_mem_nhds hpos)] with n hn + by_contra hh + have hz : μ (B n∩D n)=0 := nonpos_iff_eq_zero.mp (le_of_not_gt hh) + have hiA : Integrable (A.indicator (fun _ => (1:ℝ))) μ := (integrable_const _).indicator hA + have hiB : Integrable ((B n).indicator (fun _ => (1:ℝ))) μ := (integrable_const _).indicator (hB n) + have hiD : Integrable ((D n).indicator (fun _ => (1:ℝ))) μ := (integrable_const _).indicator (hD n) + have hi := integral_mono_ae hiA ((hiB.sub hiA).norm.add (hiD.sub hiA).norm) ?_ + · simp only [Pi.add_apply] at hi + rw [integral_add (hiB.sub hiA).norm (hiD.sub hiA).norm,integral_indicator_const (1:ℝ) hA,smul_eq_mul,mul_one] at hi + exact (not_lt_of_ge hi) hn + · filter_upwards [measure_eq_zero_iff_ae_notMem.mp hz] with x hx + by_cases ha : x∈A + · by_cases hb : x∈B n + · have hd : x∉D n := fun hd => hx ⟨hb,hd⟩ + simp [ha,hb,hd] + · by_cases hd : x∈D n <;> simp [ha,hb,hd] + · simp only [Pi.add_apply,Set.indicator_of_notMem ha] + positivity +end EuclideanFiveColor +end + +noncomputable section +open Set Filter Topology MeasureTheory +open scoped NNReal +namespace EuclideanFiveColor +lemma circleEndpoint_identity_neighborhood {a u : ℝ} (h : Real.sin (u-a)≠0) : + ∃ I : Set ℝ, IsOpen I ∧ a∈I ∧ + ∀ v∈I, circleTarget (samplingParameter 0 (direction (u : Angles)) 1,v)∈(circleInverseHomeo h).target ∧ + circleEndpoint h (samplingParameter 0 (direction (u : Angles)) 1,v)=v := by + let V := (circleInverseHomeo h).source + have ha : (a,u)∈V := (circleSum_strict 1 (a,u)).mem_toOpenPartialHomeomorph_source + let I := (fun v : ℝ => (v,u)) ⁻¹' V + refine ⟨I,(circleInverseHomeo h).open_source.preimage (continuous_id.prodMk continuous_const),ha,?_⟩ + intro v hv + have he : circleTarget (samplingParameter 0 (direction (u : Angles)) 1,v)=circleSum 1 (v,u) := by + simp [circleTarget,samplingParameter,circleSum,add_comm] + have hv' : (v,u)∈(circleInverseHomeo h).source := hv + have ht : circleSum 1 (v,u)∈(circleInverseHomeo h).target := (circleInverseHomeo h).map_source hv' + refine ⟨he ▸ ht,?_⟩ + rw [circleEndpoint,he,circleInverse_eq h ht] + exact congrArg Prod.fst ((circleInverseHomeo h).left_inv hv') +lemma near_identity_circle_in {a u : ℝ} (h : Real.sin (u-a)≠0) + {w : ℕ → ℂ} (hw : Tendsto w atTop (𝓝 (direction (u : Angles)))) + {V : Set ℝ} (hV : IsOpen V) (haV : a∈V) : + ∃ δ : ℝ, 0<δ ∧ δ≤1 ∧ ∃ C : ℝ≥0, 1≤C ∧ ∃ T : ℕ → ℝ → ℝ, + (∀ n,Measurable (T n)) ∧ + (∀ v∈Metric.ball a δ,Tendsto (fun n => T n v) atTop (𝓝 v)) ∧ + (∀ᶠ n in atTop, AntilipschitzWith C ((Metric.ball a δ).domRestrict (T n)) ∧ + MapsTo (T n) (Metric.ball a δ) (Metric.closedBall a 1) ∧ + MapsTo (T n) (Metric.ball a δ) V ∧ + ∀ v∈Metric.ball a δ, ‖w n+direction (v : Angles)-direction (T n v : Angles)‖=1) := by + let p := samplingParameter 0 (direction (u : Angles)) 1 + have he : circleTarget (p,a)=circleSum 1 (a,u) := by + simp [p,circleTarget,samplingParameter,circleSum,add_comm] + have ha : Real.sin (a-u)≠0 := by rwa [← neg_sub u a,Real.sin_neg,neg_ne_zero] + obtain ⟨P,I,hP,hp,hI,hai,hIp,K,hK,hctrl⟩ := circleEndpoint_good_neighborhood h he rfl ha + obtain ⟨J,hJ,haj,hid⟩ := circleEndpoint_identity_neighborhood h + have hcv : ∀ᶠ q in 𝓝 (p,a),circleEndpoint h q∈V := by + apply (circleEndpoint_strict h he).continuousAt + simpa only [circleEndpoint,he,circleInverse_at] using hV.mem_nhds haV + obtain ⟨P₁,hP₁,I₁,hI₁,hsubV⟩ := mem_nhds_prod_iff.mp hcv + obtain ⟨δ,hδ,hsub⟩ := Metric.mem_nhds_iff.mp + (inter_mem ((hI.inter hJ).mem_nhds ⟨hai,haj⟩) hI₁) + let ε := min δ 1 + have hε : 0<ε := lt_min hδ (by norm_num) + let T : ℕ → ℝ → ℝ := fun n v => circleEndpoint h (samplingParameter 0 (w n) 1,v) + have hparam := samplingParameter_tendsto (x := 0) hw tendsto_const_nhds + have hT (n : ℕ) : Measurable (T n) := + (circleEndpoint_measurable h).comp (measurable_const.prodMk measurable_id) + refine ⟨ε,hε,min_le_right _ _,max K 1,le_max_right _ _,T,hT,?_,?_⟩ + · intro v hv + have hvI := (hsub ((Metric.ball_subset_ball (min_le_left δ 1)) hv)).1 + have hh := (circleInverse_continuousAt h (hid v hvI.2).1).fst.tendsto.comp + (circleTarget_continuous.continuousAt.tendsto.comp (hparam.prodMk_nhds tendsto_const_nhds)) + have hid' := (hid v hvI.2).2 + change Tendsto (fun n => T n v) atTop (𝓝 (circleEndpoint h (p,v))) at hh + simpa only [p,hid'] using hh + · filter_upwards [hparam.eventually (hP.mem_nhds hp),hparam.eventually hP₁] with n hn hnV + refine ⟨?_,?_,?_,?_⟩ + · apply AntilipschitzWith.of_le_mul_dist + intro v z + have hv := (hsub ((Metric.ball_subset_ball (min_le_left δ 1)) v.2)).1.1 + have hz := (hsub ((Metric.ball_subset_ball (min_le_left δ 1)) z.2)).1.1 + exact ((hK _ hn).le_mul_dist ⟨v,hv⟩ ⟨z,hz⟩).trans + (mul_le_mul_of_nonneg_right (by exact_mod_cast le_max_left K 1) dist_nonneg) + · intro v hv + exact (hctrl _ hn v (hsub ((Metric.ball_subset_ball (min_le_left δ 1)) hv)).1.1).2.2 + · intro v hv + exact hsubV ⟨hnV,(hsub ((Metric.ball_subset_ball (min_le_left δ 1)) hv)).2⟩ + · intro v hv + have ht := (hctrl _ hn v (hsub ((Metric.ball_subset_ball (min_le_left δ 1)) hv)).1.1).1 + have hh := circleInverse_sampling h ht + simp only [Complex.ofReal_one,one_mul,angularSum,zero_add,angleChart] at hh + change w n+direction (v : Angles)=direction (T n v : Angles)+ + direction (((circleInverse h (circleTarget (samplingParameter 0 (w n) 1,v))).2) : Angles) at hh + rw [hh,add_sub_cancel_left] + exact Circle.norm_coe _ +end EuclideanFiveColor +end + +noncomputable section +open Set Filter Topology +namespace EuclideanFiveColor +lemma nonparallel_neighborhood {a b : ℝ} (h : Real.sin (b-a)≠0) + {s : ℕ → ℝ} (hs : Tendsto s atTop (𝓝 b)) : + ∃ V : Set ℝ, IsOpen V ∧ a∈V ∧ ∀ᶠ n in atTop, ∀ v∈V, Real.sin (s n-v)≠0 := by + have hf : Continuous (fun q : ℝ×ℝ => Real.sin (q.2-q.1)) := + Real.continuous_sin.comp (continuous_snd.sub continuous_fst) + have ho : IsOpen {q : ℝ×ℝ | Real.sin (q.2-q.1)≠0} := + isOpen_compl_singleton.preimage hf + have hh : {q : ℝ×ℝ | Real.sin (q.2-q.1)≠0}∈𝓝 (a,b) := ho.mem_nhds h + obtain ⟨ε,hε,hsub⟩ := Metric.mem_nhds_iff.mp hh + refine ⟨Metric.ball a ε,Metric.isOpen_ball,Metric.mem_ball_self hε,?_⟩ + filter_upwards [hs.eventually (Metric.ball_mem_nhds b hε)] with n hn + intro v hv + exact @hsub (v,s n) (show max (dist v a) (dist (s n) b)<ε from max_lt hv hn) +end EuclideanFiveColor +end + +noncomputable section +open Set Filter Topology MeasureTheory +open scoped NNReal +namespace EuclideanFiveColor +lemma strict_state_sequence_local_false {k : ℕ} {c : ℂ → Fin k} + (hc : Measurable c) (hw : WeakColoring k c) + (x : ℕ → ℂ) (J K : Finset (Fin k)) (X : Fin k) + (hlabels : ∀i, i∉J∪K ↔ i=X) + (A B : ℕ → Set ℝ) (D : Set ℝ) (hD : MeasurableSet D) + (hA : ∀n,RealState hc (x n) (A n) J) (hB : ∀n,RealState hc (x n) (B n) K) + (b d : ℕ → ℝ) (b₀ d₀ a u : ℝ) + (hb : Tendsto b atTop (𝓝 b₀)) (hd : Tendsto d atTop (𝓝 d₀)) + (hbden : ∀n,LineDensityZero (B n)ᶜ (b n)) (hdden : ∀n,LineDensityZero (B n)ᶜ (d n)) + (hu : direction (u : Angles)=direction (b₀ : Angles)-direction (d₀ : Angles)) + (hab : Real.sin (b₀-a)≠0) (had : Real.sin (d₀-a)≠0) (hau : Real.sin (u-a)≠0) + (hpos : ∀ε>0,0 ∫ v in E, ‖(A n).indicator (fun _ => (1:ℝ)) v-D.indicator (fun _ => (1:ℝ)) v‖) + atTop (𝓝 0)) : False := by + let w : ℕ → ℂ := fun n => direction (b n : Angles)-direction (d n : Angles) + have hdir : Continuous (fun v : ℝ => direction (v : Angles)) := direction_continuous.comp (AddCircle.continuous_mk' (2*Real.pi)) + have hwt : Tendsto w atTop (𝓝 (direction (u : Angles))) := by + rw [hu] + exact (hdir.tendsto b₀ |>.comp hb).sub (hdir.tendsto d₀ |>.comp hd) + obtain ⟨V,hV,haV,hparb⟩ := nonparallel_neighborhood hab hb + obtain ⟨W,hW,haW,hpard⟩ := nonparallel_neighborhood had hd + obtain ⟨δ,hδ,hδ1,C,hC,T,hT,hTlim,hctrl⟩ := near_identity_circle_in hau hwt hW haW + obtain ⟨η,hη,hηV⟩ := Metric.mem_nhds_iff.mp (hV.mem_nhds haV) + let ε := min δ η + have hε : 0<ε := lt_min hδ hη + let I := Metric.ball a ε + let E := Metric.closedBall a 1 + have hIE : I⊆E := (Metric.ball_subset_ball ((min_le_left δ η).trans hδ1)).trans Metric.ball_subset_closedBall + have hIδ : I⊆Metric.ball a δ := Metric.ball_subset_ball (min_le_left δ η) + have hIV : I⊆V := (Metric.ball_subset_ball (min_le_right δ η)).trans hηV + let μ := volume.restrict I + let ν := volume.restrict E + have hEc : IsCompact E := isCompact_closedBall a 1 + have : IsFiniteMeasure ν := isFiniteMeasure_restrict.mpr hEc.measure_ne_top + have : IsFiniteMeasure μ := isFiniteMeasure_restrict.mpr + (ne_top_of_le_ne_top hEc.measure_ne_top (measure_mono hIE)) + have : ν.WeaklyRegular := Measure.WeaklyRegular.restrict_of_measure_ne_top hEc.measure_lt_top.ne + have hS : AntilipschitzWith C (I.domRestrict id) := by + apply AntilipschitzWith.of_le_mul_dist + intro v z + change dist v.1 z.1≤(C:ℝ)*dist v.1 z.1 + simpa only [one_mul] using mul_le_mul_of_nonneg_right (show (1:ℝ)≤C by exact_mod_cast hC) (dist_nonneg (x := v.1) (y := z.1)) + have hmS : μ.map id≤(C:ENNReal) •ν := line_map_restrict_volume_le measurable_id hEc.measurableSet hS hIE + have hmT : ∀ᶠ n in atTop, μ.map (T n)≤(C:ENNReal) •ν := by + filter_upwards [hctrl] with n hn + apply line_map_restrict_volume_le (hT n) hEc.measurableSet + (AntilipschitzWith.of_le_mul_dist fun v z => hn.1.le_mul_dist ⟨v,hIδ v.2⟩ ⟨z,hIδ z.2⟩) + exact hn.2.1.mono_left hIδ + have hiD : Integrable (D.indicator (fun _ => (1:ℝ))) ν := (integrable_const _).indicator hD + have hiA (n : ℕ) : Integrable ((A n).indicator (fun _ => (1:ℝ))) ν := (integrable_const _).indicator (hA n).1 + have hlimT : ∀ᵐ v ∂μ,Tendsto (fun n => T n v) atTop (𝓝 (id v)) := by + filter_upwards [ae_restrict_mem measurableSet_ball] with v hv + exact hTlim v (hIδ hv) + have hcomp := varying_pullback_L1 hT measurable_id hmT hmS hlimT hiD hiA (hL1 E hEc) + have hdirect : Tendsto (fun n => ∫ v, ‖(A n).indicator (fun _ => (1:ℝ)) v-D.indicator (fun _ => (1:ℝ)) v‖ ∂μ) + atTop (𝓝 0) := by + apply squeeze_zero' (Eventually.of_forall fun n => integral_nonneg fun v => norm_nonneg _) _ + (by simpa only [mul_zero] using (hL1 E hEc).const_mul (C:ℝ)) + exact Eventually.of_forall fun n => integral_norm_comp_le measurable_id hmS ((hiA n).sub hiD) + have hpre (n : ℕ) : MeasurableSet (T n ⁻¹' A n) := (hA n).1.preimage (hT n) + have hcompeq (n : ℕ) (v : ℝ) : (T n ⁻¹' A n).indicator (fun _ => (1:ℝ)) v = + (A n).indicator (fun _ => (1:ℝ)) (T n v) := by + by_cases hv : T n v∈A n <;> simp [hv] + have hpositive : ∀ᶠ n in atTop,0<μ (A n∩T n ⁻¹' A n) := by + apply indicator_inter_positive hD (fun n => (hA n).1) hpre ?_ hdirect + · simpa only [hcompeq,id_eq] using hcomp + · simpa only [μ,Measure.restrict_apply hD,I] using hpos ε hε + obtain ⟨n,hn,hbp,hdp,hp⟩ := (hctrl.and (hparb.and (hpard.and hpositive))).exists + have hqmp : Measure.QuasiMeasurePreserving (T n) μ volume := + line_antilipschitz_qmp (hT n) + (AntilipschitzWith.of_le_mul_dist fun v z => hn.1.le_mul_dist ⟨v,hIδ v.2⟩ ⟨z,hIδ z.2⟩) + have hden := ae_lineDensityZero_compl (hA n).1 + have hgood : ∀ᵐ v ∂μ,v∈I ∧ (v∈A n → LineDensityZero (A n)ᶜ v) ∧ + (T n v∈A n → LineDensityZero (A n)ᶜ (T n v)) := by + filter_upwards [ae_restrict_mem measurableSet_ball,ae_restrict_of_ae hden,hqmp.ae hden] with v hv hd₁ hd₂ + exact ⟨hv,hd₁,hd₂⟩ + obtain ⟨v,hvA,hvI,hvden,hTvden⟩ := ((frequently_ae_mem_iff.mpr hp.ne').and_eventually hgood).exists + have h₁ := states_densityOne hc hw (hA n) (hB n) (hvden hvA.1) (hbden n) (hbp v (hIV hvI)) + have h₂ := states_densityOne hc hw (hA n) (hB n) (hTvden hvA.2) (hdden n) + (hdp (T n v) (hn.2.2.1 (hIδ hvI))) + have he : {z | c z∉J∪K}={z | c z=X} := by ext z; exact hlabels (c z) + rw [he] at h₁ h₂ + apply weak_density_proper c hc hw X _ h₁ h₂ + have hdist := hn.2.2.2 v (hIδ hvI) + convert hdist using 1 + congr 1 + simp only [angularSum,angleChart,Complex.ofReal_one,one_mul,w] + ring +end EuclideanFiveColor +end + +noncomputable section +open Set Filter Topology MeasureTheory +namespace EuclideanFiveColor +lemma positive_state_support_point {D : Set ℝ} (_hD : MeasurableSet D) (hp : 00,0 support_density_direction (hB n) (hs n) (hp n) + refine ⟨d,?_,hden⟩ + apply hb.congr_dist + simp only [dist_comm (b _) (d _)] + apply squeeze_zero (fun _ => dist_nonneg) (fun n => (hdist n).le) + exact tendsto_one_div_add_atTop_nhds_zero_nat +lemma strict_state_sequence_false {k : ℕ} {c : ℂ → Fin k} + (hc : Measurable c) (hw : WeakColoring k c) + (x : ℕ → ℂ) (J K : Finset (Fin k)) (X : Fin k) + (hlabels : ∀i, i∉J∪K ↔ i=X) + (A B : ℕ → Set ℝ) (D : Set ℝ) (hD : MeasurableSet D) (hp : 0 ∫ v in E, ‖(A n).indicator (fun _ => (1:ℝ)) v-D.indicator (fun _ => (1:ℝ)) v‖) + atTop (𝓝 0)) : False := by + obtain ⟨b',hb',hbden⟩ := support_density_sequence (fun n => (hB n).1) hb hbs + obtain ⟨d',hd',hdden⟩ := support_density_sequence (fun n => (hB n).1) hd hds + obtain ⟨u,hu⟩ := direction_exists hu + obtain ⟨u,rfl⟩ := QuotientAddGroup.mk_surjective u + obtain ⟨a,hab,had,hau,hpos⟩ := positive_state_support_point hD hp b₀ d₀ u + exact strict_state_sequence_local_false hc hw x J K X hlabels A B D hD hA hB + b' d' b₀ d₀ a u hb' hd' hbden hdden hu hab had hau hpos hL1 +lemma strict_state_no_unit_support {k : ℕ} {c : ℂ → Fin k} + (hc : Measurable c) (hw : WeakColoring k c) + {x : ℂ} {J K : Finset (Fin k)} {X : Fin k} + (hlabels : ∀i, i∉J∪K ↔ i=X) + {A B : Set ℝ} (hA : RealState hc x A J) (hB : RealState hc x B K) + (hp : 0 x) J K X hlabels (fun _ => A) (fun _ => B) + A hA.1 hp (fun _ => hA) (fun _ => hB) (fun _ => b) (fun _ => d) b d tendsto_const_nhds + tendsto_const_nhds (fun _ => hb) (fun _ => hd) hu + intro E _ + simp only [sub_self,norm_zero,integral_zero] + exact tendsto_const_nhds +end EuclideanFiveColor +end + +noncomputable section +open Set Filter Topology MeasureTheory +open scoped RealInnerProductSpace +namespace EuclideanFiveColor +lemma complex_unit_orthogonal {e v : ℂ} (he : ‖e‖=1) (hv : ‖v‖=1) (h : ⟪e,v⟫=0) : + e=Complex.I*v ∨ e= -Complex.I*v := by + have hr : (e*star v).re=0 := by + rw [real_inner_comm,Complex.inner] at h + exact h + have hn : ‖e*star v‖=1 := by rw [norm_mul,norm_star,he,hv,one_mul] + have hs : (e*star v).im^2=1 := by + have hh := Complex.normSq_eq_norm_sq (e*star v) + rw [hn] at hh + simp only [Complex.normSq_apply,hr,zero_mul,zero_add,one_pow] at hh + nlinarith + have him : (e*star v).im=1 ∨ (e*star v).im= -1 := by + exact sq_eq_sq_iff_eq_or_eq_neg.mp (by simpa only [one_pow] using hs) + have hmul : star v*v=1 := by + change (starRingEnd ℂ) v*v=1 + rw [Complex.conj_mul'] + simp only [hv,one_pow,Complex.ofReal_one] + rcases him with him|him + · left + have hz : e*star v=Complex.I := Complex.ext (by simpa using hr) (by simpa using him) + calc e = (e*star v)*v := by rw [mul_assoc,hmul,mul_one] + _ = Complex.I*v := congrArg (·*v) hz + · right + have hz : e*star v= -Complex.I := Complex.ext (by simpa using hr) (by simpa using him) + calc e = (e*star v)*v := by rw [mul_assoc,hmul,mul_one] + _ = -Complex.I*v := congrArg (·*v) hz +lemma ae_direction_nonorthogonal {v : ℂ} (hv : ‖v‖=1) : + ∀ᵐt∂angularMeasure,⟪direction t,v⟫≠0 := by + have hd : Function.Injective direction := fun _ _ h => + AddCircle.injective_toCircle (by positivity : (2*Real.pi:ℝ)≠0) (Subtype.ext h) + have hf : {t | ⟪direction t,v⟫=0}.Finite := by + apply ((Set.toFinite {Complex.I*v,-Complex.I*v}).preimage (f := direction) hd.injOn).subset + intro t ht + rcases complex_unit_orthogonal (direction_norm t) hv ht with ht|ht <;> simp [ht] + exact measure_eq_zero_iff_ae_notMem.mp (hf.measure_zero angularMeasure) +end EuclideanFiveColor +end + +end OAI diff --git a/lean/OAI/Geometry/PlaneColoring/Transitions.lean b/lean/OAI/Geometry/PlaneColoring/Transitions.lean new file mode 100644 index 0000000000000000000000000000000000000000..6257a624e429115ef214f8846bfb16716f47caf9 --- /dev/null +++ b/lean/OAI/Geometry/PlaneColoring/Transitions.lean @@ -0,0 +1,150 @@ +import OAI.Analysis.PlaneSpectrum.CircleOperator + +namespace OAI + +noncomputable section +open MeasureTheory MeasureTheory.Measure Filter Topology Set +namespace EuclideanFiveColor +variable {k : ℕ} (c : ℂ → Fin k) +def transitionSet (i j : Fin k) (x : ℂ) (R : ℝ) (h : ℂ) : Set ℂ := + {q | q ∈ Metric.ball x R ∧ ((c q=i ∧ c (q+h)=j) ∨ (c q=j ∧ c (q+h)=i))} +lemma transitionSet_measurable (hc : Measurable c) (i j : Fin k) (x : ℂ) (R : ℝ) (h : ℂ) : + MeasurableSet (transitionSet c i j x R h) := by + exact measurableSet_ball.inter (((measurableSet_eq_fun hc measurable_const).inter + (measurableSet_eq_fun (hc.comp (measurable_id.add_const h)) measurable_const)).union + ((measurableSet_eq_fun hc measurable_const).inter + (measurableSet_eq_fun (hc.comp (measurable_id.add_const h)) measurable_const))) +lemma transitionSet_finite (i j : Fin k) (x : ℂ) (R : ℝ) (h : ℂ) : + volume (transitionSet c i j x R h) < ⊤ := + (measure_mono (fun _ hq => Metric.ball_subset_closedBall hq.1)).trans_lt + (isCompact_closedBall x R).measure_lt_top +def transitionRatio (i j : Fin k) (x : ℂ) (R : ℝ) (h : ℂ) : ENNReal := + volume (transitionSet c i j x R h) / ENNReal.ofReal ‖h‖ +def TransitionEdge (i j : Fin k) (x : ℂ) : Prop := + i ≠ j ∧ ∀ R : ℝ, 0 ‖colorError c hc i x R h‖^2 / ‖h‖) (𝓝 0) (𝓝 0) := + circle_smoothing_L2 _ +lemma transition_mass_energy (hw : WeakColoring k c) (i j : Fin k) (x : ℂ) (R : ℝ) + {h : ℂ} (hh : ‖h‖<1) : ∀ᵐ q ∂(volume : Measure ℂ), q ∈ transitionSet c i j x R h → + (colorMass c i q+colorMass c j q)^2 ≤ + ‖colorError c hc i x R h q‖^2+‖colorError c hc j x R h q‖^2 := by + filter_upwards [colorError_ae c hc i x R hh,colorError_ae c hc j x R hh, + ae_density_actual c hc,ae_typicalSampling c hc (by norm_num : (0:ℝ)<1), + (measurePreserving_add_right volume h).quasiMeasurePreserving.ae (ae_density_actual c hc), + (measurePreserving_add_right volume h).quasiMeasurePreserving.ae + (ae_typicalSampling c hc (by norm_num : (0:ℝ)<1))] with q hi hj hq hqs hqh hqhs hT + have he_i : ‖colorError c hc i x R h q‖^2=(colorMass c i q-colorMass c i (q+h))^2 := by + rw [hi hT.1,Complex.norm_real,Real.norm_eq_abs,sq_abs] + have he_j : ‖colorError c hc j x R h q‖^2=(colorMass c j q-colorMass c j (q+h))^2 := by + rw [hj hT.1,Complex.norm_real,Real.norm_eq_abs,sq_abs] + rw [he_i,he_j] + have h0 := colorMass_own_zero c hc hw hq hqs + have h1 := colorMass_own_zero c hc hw hqh hqhs + rcases hT.2 with ⟨hqi,hqj⟩ | ⟨hqj,hqi⟩ + · rw [hqi] at h0 + rw [hqj] at h1 + rw [h0,h1] + nlinarith [sq_nonneg (colorMass c i (q+h))] + · rw [hqj] at h0 + rw [hqi] at h1 + rw [h0,h1] + nlinarith [sq_nonneg (colorMass c j (q+h))] +include hc in +lemma transition_small_mass (hw : WeakColoring k c) {i j : Fin k} {x : ℂ} + (he : TransitionEdge c i j x) {R ε : ℝ} (hR : 0 + (‖colorError c hc i x R h‖^2+‖colorError c hc j x R h‖^2)/‖h‖) (𝓝 0) (𝓝 0) := by + simp only [add_div] + simpa only [add_zero] using (colorError_smoothing c hc i x R).add (colorError_smoothing c hc j x R) + have hsmall : ∀ᶠ h in 𝓝[≠] (0:ℂ), + (‖colorError c hc i x R h‖^2+‖colorError c hc j x R h‖^2)/‖h‖<ε^2*a := + (hlim.eventually (gt_mem_nhds (by positivity))).filter_mono nhdsWithin_le_nhds + have hnorm : ∀ᶠ h in 𝓝[≠] (0:ℂ), ‖h‖<1 := + (continuous_norm.tendsto (0:ℂ)).eventually (by simpa using (gt_mem_nhds (by norm_num : (0:ℝ)<1))) + |>.filter_mono nhdsWithin_le_nhds + obtain ⟨h,hab,hsm,hhn,hne⟩ := (hfreq.and_eventually (hsmall.and (hnorm.and self_mem_nhdsWithin))).exists + have hnpos : 0<‖h‖ := norm_pos_iff.mpr hne + let E : ℂ → ℝ := fun q => ‖colorError c hc i x R h q‖^2+‖colorError c hc j x R h q‖^2 + have hEi : Integrable (fun q => ‖colorError c hc i x R h q‖^2) volume := + (memLp_two_iff_integrable_sq_norm (Lp.aestronglyMeasurable _)).mp (Lp.memLp _) + have hEj : Integrable (fun q => ‖colorError c hc j x R h q‖^2) volume := + (memLp_two_iff_integrable_sq_norm (Lp.aestronglyMeasurable _)).mp (Lp.memLp _) + have hInt : (∫ q, E q ∂volume) < ε^2*volume.real (transitionSet c i j x R h) := by + rw [show (∫ q, E q ∂volume) = ‖colorError c hc i x R h‖^2+‖colorError c hc j x R h‖^2 by + dsimp only [E] + rw [integral_add hEi hEj,← planeL2_norm_sq,← planeL2_norm_sq]] + have hs := (div_lt_iff₀ hnpos).mp hsm + have hab' := mul_lt_mul_of_pos_left hab (sq_pos_of_pos hε) + nlinarith + obtain ⟨q,hq,hqs,henergy⟩ := exists_energy_small volume (transitionSet_measurable c hc i j x R h) + (transitionSet_finite c i j x R h) (hEi.add hEj) + (Eventually.of_forall fun q => add_nonneg (sq_nonneg _) (sq_nonneg _)) + ((ae_typicalSampling c hc (by norm_num : (0:ℝ)<1)).and (transition_mass_energy c hc hw i j x R hhn)) hInt + refine ⟨q,hq.1,hqs.1,?_⟩ + have hm := hqs.2 hq + change E q<ε^2 at henergy + change (colorMass c i q+colorMass c j q)^2≤E q at hm + nlinarith +end EuclideanFiveColor +end + +end OAI diff --git a/lean/OAI/Geometry/PlaneColoring/WeakColoring.lean b/lean/OAI/Geometry/PlaneColoring/WeakColoring.lean new file mode 100644 index 0000000000000000000000000000000000000000..4b283483cf1e369d2cd0780812faa94538559d03 --- /dev/null +++ b/lean/OAI/Geometry/PlaneColoring/WeakColoring.lean @@ -0,0 +1,176 @@ +import OAI.Geometry.PlaneColoring.Coloring + +namespace OAI + +noncomputable section +open MeasureTheory Filter Topology +open scoped RealInnerProductSpace +namespace EuclideanFiveColor +abbrev PlaneL2 := Lp ℝ 2 (volume : Measure ℂ) +def shiftL2 (z : ℂ) (f : PlaneL2) : PlaneL2 := + Lp.compMeasurePreserving (fun x => x+z) (measurePreserving_add_right volume z) f +lemma shiftL2_ae (z : ℂ) (f : PlaneL2) : shiftL2 z f =ᵐ[volume] fun x => f (x+z) := + Lp.coeFn_compMeasurePreserving f _ +lemma shiftL2_continuous (f : PlaneL2) : Continuous (fun z => shiftL2 z f) := by + let g : C(ℂ,C(ℂ,ℂ)) := (ContinuousMap.mk (fun p : ℂ × ℂ => p.2+p.1) (by fun_prop)).curry + exact continuous_const.compMeasurePreservingLp g.continuous (fun z => measurePreserving_add_right volume z) (by simp) +lemma correlation_continuous (f : PlaneL2) : Continuous (fun t : ℝ => ⟪f,shiftL2 (Circle.exp t : ℂ) f⟫) := by + exact continuous_const.inner ((shiftL2_continuous f).comp (continuous_subtype_val.comp Circle.exp.continuous)) +lemma product_zero_of_inner_zero (f g : PlaneL2) (hf : ∀ᵐ x ∂volume, 0 ≤ f x) + (hg : ∀ᵐ x ∂volume, 0 ≤ g x) (h : ⟪f,g⟫ = 0) : + ∀ᵐ x ∂volume, f x*g x=0 := by + have hi : Integrable (fun x : ℂ => f x*g x) volume := by + simpa [RCLike.inner_apply,mul_comm] using (L2.integrable_inner (𝕜 := ℝ) f g) + have hn : ∀ᵐ x ∂volume, 0 ≤ f x*g x := by + filter_upwards [hf,hg] with x hx hy + exact mul_nonneg hx hy + rw [L2.inner_def] at h + apply (integral_eq_zero_iff_of_nonneg_ae hn hi).mp + simpa [RCLike.inner_apply,mul_comm] using h +/-- AE exclusions over any full-support parameter measure upgrade to every parameter. -/ +lemma all_parameters_product_zero {T : Type*} [TopologicalSpace T] [MeasurableSpace T] + (μ : Measure T) [μ.IsOpenPosMeasure] (d : T → ℂ) (hd : Continuous d) + (f : PlaneL2) (hf : ∀ᵐ x ∂volume, 0 ≤ f x) + (ho : ∀ᵐ t ∂μ, ∀ᵐ x ∂(volume : Measure ℂ), f x*f (x+d t)=0) : + ∀ t : T, ∀ᵐ x ∂(volume : Measure ℂ), f x*f (x+d t)=0 := by + have hc : Continuous (fun t : T => ⟪f,shiftL2 (d t) f⟫) := + continuous_const.inner ((shiftL2_continuous f).comp hd) + have hz : (fun t : T => ⟪f,shiftL2 (d t) f⟫) =ᵐ[μ] fun _ => 0 := by + filter_upwards [ho] with t ht + rw [L2.inner_def] + apply integral_eq_zero_of_ae + filter_upwards [shiftL2_ae (d t) f,ht] with x hx hh + simpa [RCLike.inner_apply,mul_comm,hx] using hh + have he := (hc.ae_eq_iff_eq μ continuous_const).mp hz + intro t + have hg : ∀ᵐ x ∂volume, 0 ≤ shiftL2 (d t) f x := by + filter_upwards [shiftL2_ae (d t) f, + (measurePreserving_add_right volume (d t)).quasiMeasurePreserving.ae hf] with x hx hh + simpa only [hx] using hh + have h0 := product_zero_of_inner_zero f (shiftL2 (d t) f) hf hg (congrFun he t) + filter_upwards [h0,shiftL2_ae (d t) f] with x hx hh + simpa only [hh] using hx +end EuclideanFiveColor +end + +noncomputable section +open MeasureTheory Filter Topology +namespace EuclideanFiveColor +variable {k : ℕ} (c : ℂ → Fin k) (hc : Measurable c) +def truncatedClass (i : Fin k) (n : ℕ) : Set ℂ := {z | c z=i} ∩ Metric.closedBall 0 n +include hc +lemma truncatedClass_measurable (i : Fin k) (n : ℕ) : MeasurableSet (truncatedClass c i n) := + (measurableSet_eq_fun hc measurable_const).inter measurableSet_closedBall +omit hc in +lemma truncatedClass_finite (i : Fin k) (n : ℕ) : volume (truncatedClass c i n) ≠ ⊤ := by + exact ne_top_of_le_ne_top ((isCompact_closedBall (0 : ℂ) (n : ℝ)).measure_ne_top) + (measure_mono Set.inter_subset_right) +def truncatedVector (i : Fin k) (n : ℕ) : PlaneL2 := + (memLp_indicator_const 2 (truncatedClass_measurable c hc i n) (1 : ℝ) (Or.inr (truncatedClass_finite c i n))).toLp _ +lemma truncatedVector_ae (i : Fin k) (n : ℕ) : + truncatedVector c hc i n =ᵐ[volume] (truncatedClass c i n).indicator (fun _ => (1 : ℝ)) := + MemLp.coeFn_toLp _ +lemma weak_all_directions (hweak : WeakColoring k c) : + ∀ t : Angles, ∀ᵐ z ∂(volume : Measure ℂ), c z ≠ c (z+direction t) := by + have ho : ∀ᵐ t ∂angularMeasure, ∀ᵐ z ∂(volume : Measure ℂ), c z ≠ c (z+direction t) := by + apply (Measure.ae_ae_comm ?_).mp (Measure.ae_ae_of_ae_prod hweak.2) + exact (measurableSet_eq_fun (hc.comp measurable_fst) + (hc.comp (measurable_fst.add (direction_continuous.measurable.comp measurable_snd)))).compl + have hz (i : Fin k) (n : ℕ) : ∀ t : Angles, ∀ᵐ z ∂(volume : Measure ℂ), + truncatedVector c hc i n z*truncatedVector c hc i n (z+direction t)=0 := by + apply all_parameters_product_zero angularMeasure direction direction_continuous + · filter_upwards [truncatedVector_ae c hc i n] with z hz + rw [hz] + exact Set.indicator_nonneg (fun _ _ => zero_le_one) _ + · filter_upwards [ho] with t ht + filter_upwards [ht,truncatedVector_ae c hc i n, + (measurePreserving_add_right volume (direction t)).quasiMeasurePreserving.ae (truncatedVector_ae c hc i n)] with z hne h1 h2 + rw [h1,h2] + by_cases h : z ∈ truncatedClass c i n + · have hh : z+direction t ∉ truncatedClass c i n := fun hh => hne (h.1.trans hh.1.symm) + simp [Set.indicator_of_notMem hh] + · simp [Set.indicator_of_notMem h] + intro t + have hi : ∀ᵐ z ∂(volume : Measure ℂ), ∀ i : Fin k, ∀ n : ℕ, + ((truncatedClass c i n).indicator (fun _ => (1 : ℝ)) z)* + ((truncatedClass c i n).indicator (fun _ => (1 : ℝ)) (z+direction t))=0 := by + apply ae_all_iff.mpr + intro i + apply ae_all_iff.mpr + intro n + filter_upwards [hz i n t,truncatedVector_ae c hc i n, + (measurePreserving_add_right volume (direction t)).quasiMeasurePreserving.ae (truncatedVector_ae c hc i n)] with z h0 h1 h2 + simpa only [h1,h2] using h0 + filter_upwards [hi] with z hz + intro he + obtain ⟨n,hn⟩ := exists_nat_gt (max ‖z‖ ‖z+direction t‖) + have h1 : z ∈ truncatedClass c (c z) n := ⟨rfl,by + simpa only [Metric.mem_closedBall,dist_zero_right] using (lt_of_le_of_lt (le_max_left _ _) hn).le⟩ + have h2 : z+direction t ∈ truncatedClass c (c z) n := ⟨he.symm,by + simpa only [Metric.mem_closedBall,dist_zero_right] using (lt_of_le_of_lt (le_max_right _ _) hn).le⟩ + have h0 := hz (c z) n + simp [Set.indicator_of_mem h1,Set.indicator_of_mem h2] at h0 +end EuclideanFiveColor +end + +noncomputable section +open MeasureTheory Filter Topology Set +namespace EuclideanFiveColor +def DensityOne (A : Set ℂ) (x : ℂ) : Prop := + Tendsto (fun r : ℝ => volume (A ∩ Metric.closedBall x r) / volume (Metric.closedBall x r)) + (𝓝[>] 0) (𝓝 (1 : ENNReal)) +lemma densityOne_disjoint {A B : Set ℂ} (hB : MeasurableSet B) + (hd : AEDisjoint volume A B) {x : ℂ} (hA : DensityOne A x) : ¬ DensityOne B x := by + intro hb + have hh := hA.add hb + have hle : (1 : ENNReal)+1 ≤ 1 := le_of_tendsto hh (by + filter_upwards [self_mem_nhdsWithin] with r hr + rw [← ENNReal.add_div,← measure_union₀ (hB.inter measurableSet_closedBall).nullMeasurableSet + (hd.mono inter_subset_left inter_subset_left)] + apply (ENNReal.div_le_iff (Metric.measure_closedBall_pos volume x hr).ne' + ((isCompact_closedBall x r).measure_ne_top)).mpr + simpa only [one_mul] using measure_mono (union_subset inter_subset_right inter_subset_right)) + norm_num at hle +lemma densityOne_translate {A : Set ℂ} {x u : ℂ} : + DensityOne ((fun z : ℂ => z+u) ⁻¹' A) x ↔ DensityOne A (x+u) := by + have he (r : ℝ) : (fun z : ℂ => z+u) ⁻¹' (Metric.closedBall (x+u) r) = Metric.closedBall x r := by + ext z + simp only [Set.mem_preimage,Metric.mem_closedBall,dist_eq_norm,add_sub_add_right_eq_sub] + have h1 (r : ℝ) : volume (((fun z : ℂ => z+u) ⁻¹' A) ∩ Metric.closedBall x r) = + volume (A ∩ Metric.closedBall (x+u) r) := by + rw [← he,← Set.preimage_inter,measure_preimage_add_right] + have h2 (r : ℝ) : volume (Metric.closedBall x r) = volume (Metric.closedBall (x+u) r) := by + rw [← he,measure_preimage_add_right] + simp only [DensityOne,h1,h2] +lemma direction_exists {u : ℂ} (hu : ‖u‖=1) : ∃ t, direction t=u := by + let v : Circle := ⟨u,mem_sphere_zero_iff_norm.mpr hu⟩ + obtain ⟨t,ht⟩ := Circle.exp_surjective v + exact ⟨(t : Angles),by simpa only [direction_real] using congrArg Subtype.val ht⟩ +lemma weak_density_proper {k : ℕ} (c : ℂ → Fin k) (hc : Measurable c) (hw : WeakColoring k c) + (i : Fin k) {x y : ℂ} (hxy : ‖x-y‖=1) (hx : DensityOne {z | c z=i} x) : + ¬ DensityOne {z | c z=i} y := by + let u := y-x + obtain ⟨t,ht⟩ := direction_exists (u := u) (by simpa only [u,norm_sub_rev] using hxy) + have hd : AEDisjoint volume {z | c z=i} ((fun z : ℂ => z+u) ⁻¹' {z | c z=i}) := by + apply (measure_eq_zero_iff_ae_notMem).mpr + filter_upwards [weak_all_directions c hc hw t] with z hz + rintro ⟨h1,h2⟩ + exact hz (by simpa only [ht] using h1.trans h2.symm) + have hh := densityOne_disjoint ((measurableSet_eq_fun hc measurable_const).preimage + (measurable_id.add_const u)) hd hx + simp only [id_eq] at hh + rw [densityOne_translate] at hh + simpa only [u,add_sub_cancel] using hh +lemma ae_density_actual {k : ℕ} (c : ℂ → Fin k) (hc : Measurable c) : + ∀ᵐ x ∂(volume : Measure ℂ), DensityOne {z | c z=c x} x := by + have hh : ∀ᵐ x ∂(volume : Measure ℂ), ∀ i : Fin k, + Tendsto (fun r : ℝ => volume ({z | c z=i} ∩ Metric.closedBall x r) / volume (Metric.closedBall x r)) + (𝓝[>] 0) (𝓝 (({z | c z=i} : Set ℂ).indicator (1 : ℂ → ENNReal) x)) := + ae_all_iff.mpr fun i => Besicovitch.ae_tendsto_measure_inter_div_of_measurableSet volume + (measurableSet_eq_fun hc measurable_const) + filter_upwards [hh] with x hx + simpa only [DensityOne,Set.indicator_of_mem (show x ∈ {z | c z=c x} from rfl),Pi.one_apply] using hx (c x) +end EuclideanFiveColor +end + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/CanonicalCoordinates.lean b/lean/OAI/Geometry/PolarProducts/CanonicalCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..1a4d9504e024e7a2991fd6272d920993738fbb17 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/CanonicalCoordinates.lean @@ -0,0 +1,168 @@ +import OAI.Geometry.PolarProducts.PlanarSquare + +namespace OAI + +universe u131 u132 u133 + +section +namespace CanonicalLinear +noncomputable section +open scoped InnerProductSpace +variable {κ : Type u131} [Fintype κ] [DecidableEq κ] +abbrev E (κ : Type u132) := EuclideanSpace ℝ κ + +def coordinate (j : κ) : E κ →L[ℝ] ℝ := PiLp.proj 2 (fun _ : κ => ℝ) j + +def adaptedMap (u v : E κ) (j : κ) : E κ →L[ℝ] E κ := + ContinuousLinearMap.id ℝ (E κ) - (1 / u j) • (coordinate j).smulRight u + + (innerSL ℝ v).smulRight (EuclideanSpace.single j 1) + +@[simp] theorem adaptedMap_apply (u v q : E κ) (j : κ) : + adaptedMap u v j q = q - (q j / u j) • u + (inner (𝕜 := ℝ) v q) • EuclideanSpace.single j 1 := by + simp [adaptedMap, coordinate, div_eq_mul_inv, smul_smul, mul_comm] + +theorem adaptedMap_coordinate (u v q : E κ) (j : κ) (huj : u j ≠ 0) : + adaptedMap u v j q j = inner (𝕜 := ℝ) v q := by + simp [adaptedMap_apply, PiLp.sub_apply, PiLp.add_apply, PiLp.smul_apply, div_mul_cancel₀ _ huj] + +theorem adaptedMap_u {u v : E κ} (j : κ) (huj : u j ≠ 0) + (hvu : inner (𝕜 := ℝ) v u = 1) : adaptedMap u v j u = EuclideanSpace.single j 1 := by + simp [adaptedMap_apply, div_self huj, hvu] + +theorem adaptedMap_injective {u v : E κ} (j : κ) (huj : u j ≠ 0) + (hvu : inner (𝕜 := ℝ) v u = 1) : Function.Injective (adaptedMap u v j) := by + apply LinearMap.ker_eq_bot.mp + rw [LinearMap.ker_eq_bot'] + intro q hq + change adaptedMap u v j q = 0 at hq + have hi : inner (𝕜 := ℝ) v q = 0 := by + have hh := congrArg (fun x : E κ => x j) hq + simpa only [adaptedMap_coordinate u v q j huj, PiLp.zero_apply] using hh + have he : q = (q j/u j) • u := by + simpa only [adaptedMap_apply, hi, zero_smul, add_zero, sub_eq_zero] using hq + have ht : q j/u j = 0 := by + have hh := congrArg (fun x : E κ => inner (𝕜 := ℝ) v x) he + simpa only [real_inner_smul_right, hvu, mul_one, hi] using hh.symm + simp only [ht, zero_smul] at he + exact he + +def adapted {u v : E κ} (j : κ) (huj : u j ≠ 0) + (hvu : inner (𝕜 := ℝ) v u = 1) : E κ ≃L[ℝ] E κ := + ContinuousLinearEquiv.ofBijective (adaptedMap u v j) + (LinearMap.ker_eq_bot.mpr (adaptedMap_injective j huj hvu)) + (LinearMap.range_eq_top.mpr (LinearMap.surjective_of_injective (adaptedMap_injective j huj hvu))) + +@[simp] theorem adapted_apply {u v : E κ} (j : κ) (huj : u j ≠ 0) + (hvu : inner (𝕜 := ℝ) v u = 1) (q : E κ) : + adapted j huj hvu q = adaptedMap u v j q := rfl + +theorem adapted_first {u v : E κ} (j : κ) (huj : u j ≠ 0) + (hvu : inner (𝕜 := ℝ) v u = 1) (q : E κ) : + adapted j huj hvu q j = inner (𝕜 := ℝ) v q := adaptedMap_coordinate u v q j huj + +theorem adapted_inverse_single {u v : E κ} (j : κ) (huj : u j ≠ 0) + (hvu : inner (𝕜 := ℝ) v u = 1) : + (adapted j huj hvu).symm (EuclideanSpace.single j 1) = u := by + apply (adapted j huj hvu).injective + simpa only [ContinuousLinearEquiv.apply_symm_apply, adapted_apply] using (adaptedMap_u j huj hvu).symm + +def cotangent (A : E κ ≃L[ℝ] E κ) : (E κ × E κ) →L[ℝ] (E κ × E κ) := + (A.toContinuousLinearMap.comp (ContinuousLinearMap.fst ℝ (E κ) (E κ))).prod + (A.symm.toContinuousLinearMap.adjoint.comp (ContinuousLinearMap.snd ℝ (E κ) (E κ))) + +omit [DecidableEq κ] in +@[simp] theorem cotangent_apply (A : E κ ≃L[ℝ] E κ) (x : E κ × E κ) : + cotangent A x = (A x.1, A.symm.toContinuousLinearMap.adjoint x.2) := rfl + +omit [DecidableEq κ] in +theorem cotangent_preserves (A : E κ ≃L[ℝ] E κ) (x y : E κ × E κ) : + inner (𝕜 := ℝ) (cotangent A x).1 (cotangent A y).2 - + inner (𝕜 := ℝ) (cotangent A y).1 (cotangent A x).2 = + inner (𝕜 := ℝ) x.1 y.2 - inner (𝕜 := ℝ) y.1 x.2 := by + simp only [cotangent_apply, ContinuousLinearMap.adjoint_inner_right, + ContinuousLinearEquiv.coe_coe, ContinuousLinearEquiv.symm_apply_apply] + +omit [DecidableEq κ] in +theorem cotangent_injective (A : E κ ≃L[ℝ] E κ) : Function.Injective (cotangent A) := by + intro x y hxy + apply Prod.ext + · exact A.injective (congrArg Prod.fst hxy) + · apply ext_inner_left ℝ + intro z + obtain ⟨w,rfl⟩ := A.symm.surjective z + have hh := congrArg (fun t : E κ × E κ => inner (𝕜 := ℝ) w t.2) hxy + simpa only [cotangent_apply, ContinuousLinearMap.adjoint_inner_right, + ContinuousLinearEquiv.coe_coe] using hh + +theorem cotangent_first {u v : E κ} (j : κ) (huj : u j ≠ 0) + (hvu : inner (𝕜 := ℝ) v u = 1) (x : E κ × E κ) : + (cotangent (adapted j huj hvu) x).1 j = inner (𝕜 := ℝ) v x.1 ∧ + (cotangent (adapted j huj hvu) x).2 j = inner (𝕜 := ℝ) u x.2 := by + constructor + · exact adapted_first j huj hvu x.1 + · calc + _ = inner (𝕜 := ℝ) (EuclideanSpace.single j 1) (cotangent (adapted j huj hvu) x).2 := by simp only [EuclideanSpace.inner_single_left, map_one, one_mul] + _ = _ := by + simp only [cotangent_apply, ContinuousLinearMap.adjoint_inner_right, + ContinuousLinearEquiv.coe_coe, adapted_inverse_single] + +end +end CanonicalLinear +end + +section +namespace UpperCoordinates +noncomputable section +open Set +open scoped ContDiff +variable {κ : Type u133} [Fintype κ] [DecidableEq κ] +open ComplexCoordinates CanonicalLinear + +def phaseForm (x y : R κ × R κ) : ℝ := + inner (𝕜 := ℝ) x.1 y.2 - inner (𝕜 := ℝ) y.1 x.2 + +omit [DecidableEq κ] in +theorem form_parts (v w : C κ) : PlanarCylinder.form v w = phaseForm (parts v) (parts w) := by + simp only [PlanarCylinder.form, PlanarSquare.form, phaseForm, parts_apply, PiLp.inner_apply, + re_apply, im_apply, RCLike.inner_apply', RCLike.conj_to_real, ← Finset.sum_sub_distrib] + +omit [DecidableEq κ] in +theorem form_parts_symm (x y : R κ × R κ) : + PlanarCylinder.form (parts.symm x) (parts.symm y) = phaseForm x y := by + rw [form_parts, ContinuousLinearEquiv.apply_symm_apply, ContinuousLinearEquiv.apply_symm_apply] + +def targetCoordinates (A : E κ ≃L[ℝ] E κ) : (E κ × E κ) →L[ℝ] C κ := + parts.symm.toContinuousLinearMap.comp (cotangent A) + +omit [DecidableEq κ] in +theorem targetCoordinates_preserves (A : E κ ≃L[ℝ] E κ) (x y : E κ × E κ) : + PlanarCylinder.form (targetCoordinates A x) (targetCoordinates A y) = phaseForm x y := by + change PlanarCylinder.form (parts.symm (cotangent A x)) (parts.symm (cotangent A y)) = _ + rw [form_parts_symm] + exact cotangent_preserves A x y + +omit [DecidableEq κ] in +theorem targetCoordinates_injective (A : E κ ≃L[ℝ] E κ) : + Function.Injective (targetCoordinates A) := + parts.symm.injective.comp (cotangent_injective A) + +theorem targetCoordinates_first {u v : E κ} (j : κ) (huj : u j ≠ 0) + (hvu : inner (𝕜 := ℝ) v u = 1) (x : E κ × E κ) : + (targetCoordinates (adapted j huj hvu) x j).re = inner (𝕜 := ℝ) v x.1 ∧ + (targetCoordinates (adapted j huj hvu) x j).im = inner (𝕜 := ℝ) u x.2 := by + have hh := cotangent_first j huj hvu x + have hp := parts.apply_symm_apply (cotangent (adapted j huj hvu) x) + have hre : re (parts.symm (cotangent (adapted j huj hvu) x)) = (cotangent (adapted j huj hvu) x).1 := + congrArg Prod.fst hp + have him : im (parts.symm (cotangent (adapted j huj hvu) x)) = (cotangent (adapted j huj hvu) x).2 := + congrArg Prod.snd hp + change re (parts.symm (cotangent (adapted j huj hvu) x)) j = _ ∧ + im (parts.symm (cotangent (adapted j huj hvu) x)) j = _ + rw [hre, him] + exact hh + +end +end UpperCoordinates +end + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/CanonicalCylinder.lean b/lean/OAI/Geometry/PolarProducts/CanonicalCylinder.lean new file mode 100644 index 0000000000000000000000000000000000000000..df6958f27ca1b843ec6afc30b63bf6b2609d63a8 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/CanonicalCylinder.lean @@ -0,0 +1,116 @@ +import OAI.Geometry.PolarProducts.Nonsqueezing + +namespace OAI + +universe u128 + +section +namespace ConvexPolar +open Set Filter +open scoped Topology +noncomputable section +variable {E : Type u128} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +theorem inner_lt_one_of_mem_interior {K : Set E} {p x : E} + (hp : p ∈ polar K) (hp0 : p ≠ 0) (hx : x ∈ interior K) : + inner (𝕜 := ℝ) p x < 1 := by + obtain ⟨r, hr, hball⟩ := Metric.mem_nhds_iff.mp (mem_interior_iff_mem_nhds.mp hx) + let t := r/(2*‖p‖) + have ht : 0 < t := div_pos hr (mul_pos (by norm_num) (norm_pos_iff.mpr hp0)) + have htn : t*‖p‖ = r/2 := by dsimp [t]; field_simp + have hy : x+t • p ∈ K := by + apply hball + rw [Metric.mem_ball, dist_eq_norm, add_sub_cancel_left, norm_smul, + Real.norm_eq_abs, abs_of_pos ht, htn] + exact half_lt_self hr + have hh := hp _ hy + rw [inner_add_left, real_inner_smul_left, real_inner_self_eq_norm_sq, real_inner_comm] at hh + have hpos : 0 < t*‖p‖^2 := mul_pos ht (sq_pos_of_pos (norm_pos_iff.mpr hp0)) + linarith + +theorem abs_inner_lt_one_of_mem_interior {K : Set E} + (hs : ∀ x, x ∈ K ↔ -x ∈ K) {p x : E} + (hp : p ∈ polar K) (hp0 : p ≠ 0) (hx : x ∈ interior K) : + |inner (𝕜 := ℝ) p x| < 1 := by + have hpneg : -p ∈ polar K := by + intro q hq + have hh := hp (-q) ((hs q).mp hq) + simpa only [inner_neg_left, inner_neg_right] using hh + have hpos := inner_lt_one_of_mem_interior hp hp0 hx + have hneg := inner_lt_one_of_mem_interior hpneg (neg_ne_zero.mpr hp0) hx + rw [inner_neg_left] at hneg + exact abs_lt.mpr ⟨by linarith, hpos⟩ + +theorem polar_symmetric {K : Set E} (hs : ∀ x, x ∈ K ↔ -x ∈ K) : + ∀ p, p ∈ polar K ↔ -p ∈ polar K := by + have hh : ∀ p ∈ polar K, -p ∈ polar K := by + intro p hp x hx + simpa only [inner_neg_left, inner_neg_right] using hp (-x) ((hs x).mp hx) + intro p + exact ⟨hh p, fun hp => by simpa using hh (-p) hp⟩ + +theorem exists_support_pair {K : Set E} + (hc : IsCompact K) (h0 : (0 : E) ∈ interior K) {v : E} (hv : v ≠ 0) : + ∃ q ∈ K, ∃ p ∈ polar K, inner (𝕜 := ℝ) p q = 1 := by + obtain ⟨q, hq, hmax⟩ := hc.exists_isMaxOn ⟨0, interior_subset h0⟩ + (show ContinuousOn (fun x : E => inner (𝕜 := ℝ) v x) K from by fun_prop) + obtain ⟨r, hr, hball⟩ := Metric.mem_nhds_iff.mp (mem_interior_iff_mem_nhds.mp h0) + have hx : (r/(2*‖v‖)) • v ∈ K := by + apply hball + rw [Metric.mem_ball, dist_zero_right, norm_smul, Real.norm_eq_abs, + abs_of_pos (div_pos hr (mul_pos (by norm_num) (norm_pos_iff.mpr hv)))] + have he : r/(2*‖v‖)*‖v‖ = r/2 := by field_simp + rw [he] + exact half_lt_self hr + have hspos : 0 < inner (𝕜 := ℝ) v q := by + have hh : inner (𝕜 := ℝ) v ((r/(2*‖v‖)) • v) ≤ inner (𝕜 := ℝ) v q := hmax hx + have he : inner (𝕜 := ℝ) v ((r/(2*‖v‖)) • v) = r/2*‖v‖ := by + rw [real_inner_smul_right, real_inner_self_eq_norm_sq] + field_simp + rw [he] at hh + exact (mul_pos (half_pos hr) (norm_pos_iff.mpr hv)).trans_le hh + refine ⟨q, hq, (inner (𝕜 := ℝ) v q)⁻¹ • v, ?_, ?_⟩ + · intro x hx + rw [real_inner_smul_right, show inner (𝕜 := ℝ) x v = inner (𝕜 := ℝ) v x from real_inner_comm _ _, ← div_eq_inv_mul] + exact (div_le_one hspos).mpr (hmax hx) + · rw [real_inner_smul_left, inv_mul_cancel₀ hspos.ne'] + +end +end ConvexPolar + +namespace SymmetricPolar +open Set +noncomputable section +variable {n : ℕ} + +def canonicalSquareCylinder (q₀ p₀ : Position n) : Set (Phase n) := + {z | |inner (𝕜 := ℝ) p₀ z.1| < 1 ∧ |inner (𝕜 := ℝ) q₀ z.2| < 1} + +theorem polarProduct_subset_squareCylinder {K : Set (Position n)} + (hK : IsSymmetricConvexBody K) {q₀ p₀ : Position n} + (hq : q₀ ∈ K) (hp : p₀ ∈ polar K) (hqp : inner (𝕜 := ℝ) p₀ q₀ = 1) : + polarProduct K ⊆ canonicalSquareCylinder q₀ p₀ := by + have hp0 : p₀ ≠ 0 := by intro he; simp [he] at hqp + have hq0 : q₀ ≠ 0 := by intro he; simp [he] at hqp + intro z hz + have hqp' : q₀ ∈ ConvexPolar.polar (ConvexPolar.polar K) := by + intro p hp + rw [real_inner_comm] + exact hp _ hq + exact ⟨ConvexPolar.abs_inner_lt_one_of_mem_interior hK.2.2.2 hp hp0 hz.1, + ConvexPolar.abs_inner_lt_one_of_mem_interior (ConvexPolar.polar_symmetric hK.2.2.2) hqp' hq0 hz.2⟩ + +theorem exists_squareCylinder {K : Set (Position n)} (hK : IsSymmetricConvexBody K) + (hn : 0 < n) : ∃ q₀ p₀ : Position n, inner (𝕜 := ℝ) p₀ q₀ = 1 ∧ + polarProduct K ⊆ canonicalSquareCylinder q₀ p₀ := by + let v : Position n := (EuclideanSpace.basisFun (Fin n) ℝ) ⟨0, hn⟩ + have hv : v ≠ 0 := (EuclideanSpace.basisFun (Fin n) ℝ).toBasis.ne_zero _ + obtain ⟨q₀, hq, p₀, hp, hqp⟩ := ConvexPolar.exists_support_pair hK.1 + (ConvexPolar.zero_mem_interior_of_symmetric hK.2.1 hK.2.2.1 hK.2.2.2) hv + exact ⟨q₀, p₀, hqp, polarProduct_subset_squareCylinder hK hq hp hqp⟩ + +end +end SymmetricPolar +end + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/CompleteFlow.lean b/lean/OAI/Geometry/PolarProducts/CompleteFlow.lean new file mode 100644 index 0000000000000000000000000000000000000000..668639922acce5dcdd0e6631a6a9ca28595f6392 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/CompleteFlow.lean @@ -0,0 +1,272 @@ +import OAI.Geometry.PolarProducts.LocalODE + +namespace OAI + +universe u7 u8 u9 u10 u11 u12 u13 + +section LowerBoundInline +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter Metric +open scoped Topology ContDiff +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal + +namespace SmoothODE + +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal + +variable {E : Type u7} [NormedAddCommGroup E] [NormedSpace ℝ E] + [CompleteSpace E] [ProperSpace E] + +noncomputable section + +def variation {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + (h : ℝ) (hh : ‖h‖₊ * K < 1) (x v : E) (t : ℝ) : E := + v + h • ∫ s in 0..t, + fderiv ℝ V (extend (trajectory hV h hh x) s) (extend (tangentPath hV h hh x v) s) + +theorem variation_coe {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + (hVs : ContDiff ℝ ∞ V) (h : ℝ) (hh : ‖h‖₊ * K < 1) (x v : E) (t : Time) : + variation hV h hh x v t = tangentPath hV h hh x v t := + (congrArg (fun u : C(Time, E) => u t) (tangentPath_eq hV hVs h hh x v)).symm + +omit [ProperSpace E] in +@[simp] theorem variation_zero {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + (h : ℝ) (hh : ‖h‖₊ * K < 1) (x v : E) : variation hV h hh x v 0 = v := by + simp [variation] + +omit [ProperSpace E] in +theorem continuous_variation {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + (hVs : ContDiff ℝ ∞ V) (h : ℝ) (hh : ‖h‖₊ * K < 1) (x v : E) : + Continuous (variation hV h hh x v) := by + have hc := ((hVs.continuous_fderiv (by simp)).comp + (continuous_extend (trajectory hV h hh x))).clm_apply + (continuous_extend (tangentPath hV h hh x v)) + exact continuous_const.add + ((intervalIntegral.continuous_primitive (fun a b => hc.intervalIntegrable a b) 0).const_smul h) + +theorem hasDerivAt_variation {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + (hVs : ContDiff ℝ ∞ V) (h : ℝ) (hh : ‖h‖₊ * K < 1) (x v : E) (t : Time) : + HasDerivAt (variation hV h hh x v) + (h • fderiv ℝ V (curve hV h hh x t) (variation hV h hh x v t)) (t : ℝ) := by + have hc := ((hVs.continuous_fderiv (by simp)).comp + (continuous_extend (trajectory hV h hh x))).clm_apply + (continuous_extend (tangentPath hV h hh x v)) + have hd := intervalIntegral.integral_hasDerivAt_right + (hc.intervalIntegrable 0 t) (hc.stronglyMeasurableAtFilter volume (𝓝 (t : ℝ))) + hc.continuousAt + rw [curve_coe, variation_coe hV hVs] + change HasDerivAt (fun s : ℝ => v + h • ∫ r in 0..s, + fderiv ℝ V (extend (trajectory hV h hh x) r) (extend (tangentPath hV h hh x v) r)) + _ (t : ℝ) + simpa only [Pi.smul_apply, Function.comp_apply, extend_coe] using (hd.const_smul h).const_add v + +theorem tangentPath_one {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + (hVs : ContDiff ℝ ∞ V) (h : ℝ) (hh : ‖h‖₊ * K < 1) (x v : E) : + tangentPath hV h hh x v ⟨1, by constructor <;> norm_num⟩ = fderiv ℝ (step hV h hh) x v := by + let t : Time := ⟨1, by constructor <;> norm_num⟩ + have hd := (ContinuousMap.evalCLM ℝ (M := E) t).hasFDerivAt.comp x + ((contDiff_trajectory hV hVs h hh).differentiable (by simp) x).hasFDerivAt + exact (congrArg (fun L : E →L[ℝ] E => L v) hd.fderiv).symm + +theorem variation_one {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + (hVs : ContDiff ℝ ∞ V) (h : ℝ) (hh : ‖h‖₊ * K < 1) (x v : E) : + variation hV h hh x v 1 = fderiv ℝ (step hV h hh) x v := + (variation_coe hV hVs h hh x v ⟨1, by constructor <;> norm_num⟩).trans + (tangentPath_one hV hVs h hh x v) + +end +end SmoothODE + +namespace SmoothODE + +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal + +variable {E : Type u8} [NormedAddCommGroup E] [NormedSpace ℝ E] + [CompleteSpace E] [ProperSpace E] + +noncomputable section + +theorem step_preserves_tensor {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + (hVs : ContDiff ℝ ∞ V) (h : ℝ) (hh : ‖h‖₊ * K < 1) + {B : E → E →L[ℝ] E →L[ℝ] ℝ} (hB : Differentiable ℝ B) + (hInv : ∀ z a b, fderiv ℝ B z (V z) a b + + B z (fderiv ℝ V z a) b + B z a (fderiv ℝ V z b) = 0) (x a b : E) : + B (step hV h hh x) (fderiv ℝ (step hV h hh) x a) + (fderiv ℝ (step hV h hh) x b) = B x a b := by + let F : ℝ → ℝ := fun t => B (curve hV h hh x t) + (variation hV h hh x a t) (variation hV h hh x b t) + have hc : Continuous F := + ((hB.continuous.comp (continuous_curve hV h hh x)).clm_apply + (continuous_variation hV hVs h hh x a)).clm_apply + (continuous_variation hV hVs h hh x b) + have hd : ∀ t ∈ Ico (0 : ℝ) 1, HasDerivWithinAt F 0 (Ici t) t := by + intro t ht + let T : Time := ⟨t, ht.1, ht.2.le⟩ + have hv := hasDerivAt_curve hV h hh x T + have ha := hasDerivAt_variation hV hVs h hh x a T + have hb := hasDerivAt_variation hV hVs h hh x b T + have hdb : HasDerivAt (fun s : ℝ => B (curve hV h hh x s)) + (fderiv ℝ B (curve hV h hh x t) (h • V (curve hV h hh x t))) t := + (hB (curve hV h hh x t)).hasFDerivAt.comp_hasDerivAt (l := B) + (l' := fderiv ℝ B (curve hV h hh x t)) t hv + have hdf := (hdb.clm_apply ha).clm_apply hb + have hz : + ((fderiv ℝ B (curve hV h hh x t) (h • V (curve hV h hh x t))) + (variation hV h hh x a t) + + B (curve hV h hh x t) + (h • fderiv ℝ V (curve hV h hh x t) (variation hV h hh x a t))) + (variation hV h hh x b t) + + B (curve hV h hh x t) (variation hV h hh x a t) + (h • fderiv ℝ V (curve hV h hh x t) (variation hV h hh x b t)) = 0 := by + simp only [map_smul, smul_apply, + add_apply, smul_eq_mul] + calc + _ = h * (fderiv ℝ B (curve hV h hh x t) (V (curve hV h hh x t)) + (variation hV h hh x a t) (variation hV h hh x b t) + + B (curve hV h hh x t) + (fderiv ℝ V (curve hV h hh x t) (variation hV h hh x a t)) + (variation hV h hh x b t) + + B (curve hV h hh x t) (variation hV h hh x a t) + (fderiv ℝ V (curve hV h hh x t) (variation hV h hh x b t))) := by ring + _ = 0 := by rw [hInv, mul_zero] + exact (hdf.congr_deriv hz).hasDerivWithinAt + have he := constant_of_has_deriv_right_zero hc.continuousOn hd 1 + (show 1 ∈ Icc (0 : ℝ) 1 by constructor <;> norm_num) + simpa only [F, curve_one, variation_one hV hVs, curve_zero, variation_zero] using he + +end +end SmoothODE + +namespace SmoothODE + +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal + +variable {E : Type u9} [NormedAddCommGroup E] [NormedSpace ℝ E] + [CompleteSpace E] [ProperSpace E] + +noncomputable section + +omit [CompleteSpace E] [ProperSpace E] in + +theorem contDiff_homeomorph_pow (f : E ≃ₜ E) (hf : ContDiff ℝ ∞ (f : E → E)) + (n : ℕ) : ContDiff ℝ ∞ ((f ^ n : E ≃ₜ E) : E → E) := by + induction n with + | zero => + rw [pow_zero] + change ContDiff ℝ ∞ (id : E → E) + exact contDiff_id + | succ n ih => + rw [pow_succ'] + change ContDiff ℝ ∞ ((f : E → E) ∘ (f ^ n : E ≃ₜ E)) + exact hf.comp ih + +omit [CompleteSpace E] [ProperSpace E] in + +theorem homeomorph_pow_preserves_tensor (f : E ≃ₜ E) + (hf : ContDiff ℝ ∞ (f : E → E)) + {B : E → E →L[ℝ] E →L[ℝ] ℝ} + (hB : ∀ x a b, B (f x) (fderiv ℝ (f : E → E) x a) + (fderiv ℝ (f : E → E) x b) = B x a b) (n : ℕ) (x a b : E) : + B ((f ^ n) x) (fderiv ℝ ((f ^ n : E ≃ₜ E) : E → E) x a) + (fderiv ℝ ((f ^ n : E ≃ₜ E) : E → E) x b) = B x a b := by + induction n with + | zero => + rw [pow_zero] + change B x (fderiv ℝ (id : E → E) x a) (fderiv ℝ (id : E → E) x b) = _ + simp + | succ n ih => + rw [pow_succ'] + change B (f ((f ^ n) x)) (fderiv ℝ ((f : E → E) ∘ (f ^ n : E ≃ₜ E)) x a) + (fderiv ℝ ((f : E → E) ∘ (f ^ n : E ≃ₜ E)) x b) = _ + rw [fderiv_comp x (hf.differentiable (by simp) _) + ((contDiff_homeomorph_pow f hf n).differentiable (by simp) _)] + simp only [ContinuousLinearMap.comp_apply] + rw [hB] + exact ih + +omit [ProperSpace E] in + +theorem curve_linear_component {F : Type u10} [NormedAddCommGroup F] [NormedSpace ℝ F] + {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + (h : ℝ) (hh : ‖h‖₊ * K < 1) (L : E →L[ℝ] F) (v : F) + (hL : ∀ z, L (V z) = v) (x : E) (t : Time) : + L (curve hV h hh x t) = L x + (t : ℝ) • h • v := by + let G : ℝ → F := fun s => L (curve hV h hh x s) - s • h • v + have hc : Continuous G := + (L.continuous.comp (continuous_curve hV h hh x)).sub (continuous_id.smul continuous_const) + have hd : ∀ s ∈ Ico (0 : ℝ) 1, HasDerivWithinAt G 0 (Ici s) s := by + intro s hs + have hd := L.hasFDerivAt.comp_hasDerivAt s + (hasDerivAt_curve hV h hh x ⟨s, hs.1, hs.2.le⟩) + have hlin := (hasDerivAt_id s).smul_const (h • v) + have hh' : HasDerivAt G 0 s := by + change HasDerivAt ((L ∘ curve hV h hh x) - fun s : ℝ => s • h • v) 0 s + simpa only [id_eq, map_smul, hL, one_smul, sub_self] using hd.sub hlin + exact hh'.hasDerivWithinAt + have he := constant_of_has_deriv_right_zero hc.continuousOn hd (t : ℝ) t.property + simpa only [G, curve_zero, zero_smul, sub_zero, sub_eq_iff_eq_add] using he + +omit [ProperSpace E] in +@[simp] theorem step_linear_component {F : Type u11} [NormedAddCommGroup F] [NormedSpace ℝ F] + {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + (h : ℝ) (hh : ‖h‖₊ * K < 1) (L : E →L[ℝ] F) (v : F) + (hL : ∀ z, L (V z) = v) (x : E) : + L (step hV h hh x) = L x + h • v := by + simpa only [curve_one, one_smul] using + curve_linear_component hV h hh L v hL x (⟨1, by constructor <;> norm_num⟩ : Time) + +omit [CompleteSpace E] [ProperSpace E] in + +theorem homeomorph_pow_linear_component {F : Type u12} [NormedAddCommGroup F] [NormedSpace ℝ F] + (f : E ≃ₜ E) (L : E →L[ℝ] F) (v : F) (hL : ∀ x, L (f x) = L x + v) + (n : ℕ) (x : E) : L ((f ^ n) x) = L x + n • v := by + induction n with + | zero => simp + | succ n ih => + simp only [pow_succ', Homeomorph.mul_apply, hL, ih, succ_nsmul] + abel + +theorem exists_transport {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + (hVs : ContDiff ℝ ∞ V) {B : E → E →L[ℝ] E →L[ℝ] ℝ} + (hB : Differentiable ℝ B) + (hInv : ∀ z a b, fderiv ℝ B z (V z) a b + B z (fderiv ℝ V z a) b + + B z a (fderiv ℝ V z b) = 0) + {F : Type u13} [NormedAddCommGroup F] [NormedSpace ℝ F] + (L : E →L[ℝ] F) (v : F) (hL : ∀ x, L (V x) = v) (T : ℝ) : + ∃ f : E ≃ₜ E, ContDiff ℝ ∞ (f : E → E) ∧ ContDiff ℝ ∞ (f.symm : E → E) ∧ + (∀ x a b, B (f x) (fderiv ℝ (f : E → E) x a) (fderiv ℝ (f : E → E) x b) = B x a b) ∧ + (∀ x, L (f x) = L x + T • v) := by + obtain ⟨N, hN⟩ := exists_nat_gt (max (‖T‖ * (K : ℝ)) 0) + have hN0 : (0 : ℝ) < N := lt_of_le_of_lt (le_max_right _ _) hN + have hNne : (N : ℝ) ≠ 0 := ne_of_gt hN0 + let h : ℝ := T / N + have hh : ‖h‖₊ * K < 1 := by + change ‖h‖ * (K : ℝ) < (1 : ℝ) + dsimp [h] + rw [abs_div, abs_of_pos hN0, div_mul_eq_mul_div] + exact (div_lt_one hN0).mpr ((le_max_left _ _).trans_lt hN) + let f := stepHomeomorph hV hVs h hh + have hf : ContDiff ℝ ∞ (f : E → E) := contDiff_step hV hVs h hh + have hfi : ContDiff ℝ ∞ (f.symm : E → E) := contDiff_step hV hVs (-h) (by simpa using hh) + refine ⟨f ^ N, contDiff_homeomorph_pow f hf N, ?_, ?_, ?_⟩ + · change ContDiff ℝ ∞ ((f ^ N)⁻¹ : E ≃ₜ E) + rw [← inv_pow] + exact contDiff_homeomorph_pow f⁻¹ hfi N + · exact homeomorph_pow_preserves_tensor f hf (step_preserves_tensor hV hVs h hh hB hInv) N + · intro x + have he := homeomorph_pow_linear_component f L (h • v) + (step_linear_component hV h hh L v hL) N x + have hs : (N : ℝ) * h = T := by dsimp [h]; field_simp + simpa only [nsmul_eq_mul, ← Nat.cast_smul_eq_nsmul ℝ, smul_smul, hs] using he + +end +end SmoothODE + +end LowerBoundInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/Contraction.lean b/lean/OAI/Geometry/PolarProducts/Contraction.lean new file mode 100644 index 0000000000000000000000000000000000000000..e09a0c708c76ff62d70d2f1ab13b2eb88156576d --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/Contraction.lean @@ -0,0 +1,85 @@ +import OAI.Geometry.PolarProducts.Model + +namespace OAI + +universe u1 u2 + +section LowerBoundInline + +open Set Filter Function +open scoped Topology ContDiff NNReal + +namespace SmoothContraction + +variable {E : Type u1} {F : Type u2} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + [NormedAddCommGroup F] [NormedSpace ℝ F] [CompleteSpace F] + +noncomputable section + +def fixedPoint {f : E × F → F} {L : ℝ≥0} + (hL : L < 1) (hLip : ∀ x, LipschitzWith L (fun y => f (x, y))) (x : E) : F := + ContractingWith.fixedPoint (fun y => f (x, y)) ⟨hL, hLip x⟩ + +omit [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + [NormedSpace ℝ F] in +theorem fixedPoint_eq {f : E × F → F} {L : ℝ≥0} + (hL : L < 1) (hLip : ∀ x, LipschitzWith L (fun y => f (x, y))) (x : E) : + f (x, fixedPoint hL hLip x) = fixedPoint hL hLip x := + (show ContractingWith L (fun y => f (x, y)) from ⟨hL, hLip x⟩).fixedPoint_isFixedPt + +omit [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + [NormedSpace ℝ F] in +theorem eq_fixedPoint {f : E × F → F} {L : ℝ≥0} + (hL : L < 1) (hLip : ∀ x, LipschitzWith L (fun y => f (x, y))) (x : E) {y : F} + (hy : f (x, y) = y) : y = fixedPoint hL hLip x := + (show ContractingWith L (fun y => f (x, y)) from ⟨hL, hLip x⟩).fixedPoint_unique hy + +omit [CompleteSpace E] in + +theorem partial_isInvertible {f : E × F → F} {L : ℝ≥0} + (hf : Differentiable ℝ f) (hL : L < 1) + (hLip : ∀ x, LipschitzWith L (fun y => f (x, y))) (u : E × F) : + ((fderiv ℝ (fun p : E × F => p.2 - f p) u).comp + (ContinuousLinearMap.inr ℝ E F)).IsInvertible := by + let A := (fderiv ℝ f u).comp (ContinuousLinearMap.inr ℝ E F) + have hA : HasFDerivAt (fun y => f (u.1, y)) A u.2 := + (hf u).hasFDerivAt.comp u.2 (hasFDerivAt_prodMk_right u.1 u.2) + have hnorm : ‖A‖ < 1 := by + rw [← hA.fderiv] + exact (norm_fderiv_le_of_lipschitz ℝ (hLip u.1)).trans_lt (by exact_mod_cast hL) + have heq : (fderiv ℝ (fun p : E × F => p.2 - f p) u).comp + (ContinuousLinearMap.inr ℝ E F) = 1 - A := by + change (fderiv ℝ (Prod.snd - f) u).comp _ = _ + rw [(hasFDerivAt_snd.sub (hf u).hasFDerivAt).fderiv] + ext y + simp [A] + rw [heq] + obtain ⟨v, hv⟩ := isUnit_one_sub_of_norm_lt_one hnorm + exact ⟨ContinuousLinearEquiv.ofUnit v, hv⟩ + +theorem contDiff_fixedPoint {f : E × F → F} {L : ℝ≥0} + (hf : ContDiff ℝ ∞ f) (hL : L < 1) + (hLip : ∀ x, LipschitzWith L (fun y => f (x, y))) : + ContDiff ℝ ∞ (fixedPoint hL hLip) := by + rw [contDiff_iff_contDiffAt] + intro x + let y := fixedPoint hL hLip x + let g : E × F → F := fun p => p.2 - f p + have hg : ContDiffAt ℝ ∞ g (x, y) := (contDiff_snd.sub hf).contDiffAt + have hi := partial_isInvertible (hf.differentiable (by simp)) hL hLip (x, y) + let ψ := hg.implicitFunction (by simp) hi + have hψ : ContDiffAt ℝ ∞ ψ x := hg.contDiffAt_implicitFunction (by simp) hi + have hzero : g (x, y) = 0 := sub_eq_zero.mpr (fixedPoint_eq hL hLip x).symm + have hnear : ψ =ᶠ[𝓝 x] fixedPoint hL hLip := by + filter_upwards [hg.eventually_apply_implicitFunction (by simp) hi] with x' hx' + apply eq_fixedPoint hL hLip x' + have : g (x', ψ x') = 0 := hx'.trans hzero + exact (sub_eq_zero.mp this).symm + exact hψ.congr_of_eventuallyEq hnear.symm + +end +end SmoothContraction + +end LowerBoundInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/EmbeddingInverse.lean b/lean/OAI/Geometry/PolarProducts/EmbeddingInverse.lean new file mode 100644 index 0000000000000000000000000000000000000000..df44989c6e16ab3daef19da42a5db89969d34552 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/EmbeddingInverse.lean @@ -0,0 +1,187 @@ +import OAI.Geometry.PolarProducts.HamiltonianGrowth + +namespace OAI + +universe u121 u122 + +section NonsqueezingInline + +namespace EmbeddingInverse +noncomputable section +open Set Filter +open scoped ContDiff Topology +variable {E : Type u121} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + + def localEquiv {U : Set E} (hU : IsOpen U) (f : E → E) + (hf : ContDiffOn ℝ ∞ f U) (hi : InjOn f U) + (hD : ∀ x ∈ U, (fderiv ℝ f x).IsInvertible) : OpenPartialHomeomorph E E := + OpenPartialHomeomorph.ofContinuousOpenRestrict (hi.toPartialEquiv f U) hf.continuousOn + (LocalEmbedding.isOpenEmbedding hU hf hi hD).isOpenMap hU + +@[simp] theorem localEquiv_apply {U : Set E} (hU : IsOpen U) (f : E → E) + (hf : ContDiffOn ℝ ∞ f U) (hi : InjOn f U) + (hD : ∀ x ∈ U, (fderiv ℝ f x).IsInvertible) (x : E) : + localEquiv hU f hf hi hD x = f x := rfl + +@[simp] theorem localEquiv_source {U : Set E} (hU : IsOpen U) (f : E → E) + (hf : ContDiffOn ℝ ∞ f U) (hi : InjOn f U) + (hD : ∀ x ∈ U, (fderiv ℝ f x).IsInvertible) : + (localEquiv hU f hf hi hD).source = U := rfl + +@[simp] theorem localEquiv_target {U : Set E} (hU : IsOpen U) (f : E → E) + (hf : ContDiffOn ℝ ∞ f U) (hi : InjOn f U) + (hD : ∀ x ∈ U, (fderiv ℝ f x).IsInvertible) : + (localEquiv hU f hf hi hD).target = f '' U := rfl + + theorem contDiffAt_inverse (e : OpenPartialHomeomorph E E) + (he : ContDiffOn ℝ ∞ e e.source) + (hD : ∀ x ∈ e.source, (fderiv ℝ e x).IsInvertible) + {y : E} (hy : y ∈ e.target) : ContDiffAt ℝ ∞ e.symm y := by + have hs := he.contDiffAt (e.open_source.mem_nhds (e.map_target hy)) + obtain ⟨D,hD⟩ := hD _ (e.map_target hy) + apply e.contDiffAt_symm hy (f₀' := D) _ hs + rw [hD] + exact (hs.differentiableAt (by simp)).hasFDerivAt + + def extendFunction (e : OpenPartialHomeomorph E E) (f : E → ℝ) (y : E) : ℝ := by + classical + exact if y ∈ e.target then f (e.symm y) else 0 + +omit [NormedSpace ℝ E] [CompleteSpace E] in + theorem extendFunction_apply (e : OpenPartialHomeomorph E E) (f : E → ℝ) + {x : E} (hx : x ∈ e.source) : extendFunction e f (e x) = f x := by + simp only [extendFunction, ite_eq_left (e.map_source hx), e.left_inv hx] + +omit [NormedSpace ℝ E] [CompleteSpace E] in + theorem extendFunction_zero (e : OpenPartialHomeomorph E E) (f : E → ℝ) + (S : Set E) (hz : ∀ x ∉ S, f x = 0) {y : E} (hy : y ∉ e '' S) : + extendFunction e f y = 0 := by + unfold extendFunction + split_ifs with hyt + · apply hz + intro hin + exact hy ⟨e.symm y,hin,e.right_inv hyt⟩ + · rfl + + theorem contDiff_extendFunction (e : OpenPartialHomeomorph E E) + (he : ContDiffOn ℝ ∞ e e.source) + (hD : ∀ x ∈ e.source, (fderiv ℝ e x).IsInvertible) + {f : E → ℝ} (hf : ContDiff ℝ ∞ f) {S : Set E} (hS : IsCompact S) + (hSU : S ⊆ e.source) (hz : ∀ x ∉ S, f x = 0) : + ContDiff ℝ ∞ (extendFunction e f) := by + rw [contDiff_iff_contDiffAt] + intro y + by_cases hy : y ∈ e.target + · apply (hf.contDiffAt.comp y (contDiffAt_inverse e he hD hy)).congr_of_eventuallyEq + filter_upwards [e.open_target.mem_nhds hy] with z hz + simp only [extendFunction, hz, ite_true, Function.comp_apply] + · have hT : IsClosed (e '' S) := (hS.image_of_continuousOn (e.continuousOn.mono hSU)).isClosed + have hyt : y ∈ (e '' S)ᶜ := by + rintro ⟨x,hx,rfl⟩ + exact hy (e.map_source (hSU hx)) + apply (contDiffAt_const (c := (0 : ℝ))).congr_of_eventuallyEq + filter_upwards [hT.isOpen_compl.mem_nhds hyt] with z hz' + exact extendFunction_zero e f S hz hz' + +omit [NormedSpace ℝ E] [CompleteSpace E] in + theorem extendFunction_mem_range (e : OpenPartialHomeomorph E E) (f : E → ℝ) (y : E) : + extendFunction e f y = 0 ∨ ∃ x ∈ e.source, extendFunction e f y = f x := by + by_cases hy : y ∈ e.target + · exact Or.inr ⟨e.symm y,e.map_target hy, by simp only [extendFunction,hy,ite_true]⟩ + · exact Or.inl (by simp only [extendFunction,hy,ite_false]) + +omit [NormedSpace ℝ E] [CompleteSpace E] in + theorem eventually_of_comp (e : OpenPartialHomeomorph E E) {x : E} (hx : x ∈ e.source) + {P : E → Prop} (hP : ∀ᶠ z in 𝓝 x, P (e z)) : ∀ᶠ y in 𝓝 (e x), P y := by + rw [← e.map_nhds_eq hx] + exact hP + +end +end EmbeddingInverse + +namespace ComplexSymplectic +noncomputable section +open Set Filter +open scoped ContDiff Topology +open FourierPolynomial HamiltonianODE +variable {κ : Type u122} [Fintype κ] + + def form (v w : Vector κ) : ℝ := inner (𝕜 := ℝ) (Complex.I • v) w + def Preserves (A : Vector κ →L[ℝ] Vector κ) : Prop := ∀ v w, form (A v) (A w) = form v w + + theorem form_ext {v w : Vector κ} (h : ∀ z, form v z = form w z) : v = w := by + exact smul_right_injective _ Complex.I_ne_zero (ext_inner_right ℝ h) + + theorem form_I (v w : Vector κ) : form (Complex.I • v) w = -inner (𝕜 := ℝ) v w := by + simp [form, smul_smul] + + theorem injective {A : Vector κ →L[ℝ] Vector κ} (hA : Preserves A) : Function.Injective A := by + intro v w hvw + apply form_ext + intro z + calc + form v z = form (A v) (A z) := (hA v z).symm + _ = form (A w) (A z) := by rw [hvw] + _ = form w z := hA w z + + theorem invertible {A : Vector κ →L[ℝ] Vector κ} (hA : Preserves A) : A.IsInvertible := by + have hi := injective hA + exact ⟨ContinuousLinearEquiv.ofBijective A (LinearMap.ker_eq_bot.mpr hi) + (LinearMap.range_eq_top.mpr (LinearMap.surjective_of_injective hi)), rfl⟩ + + theorem push_gradient {A : Vector κ →L[ℝ] Vector κ} (hA : Preserves A) (a b : Vector κ) + (hh : ∀ v, inner (𝕜 := ℝ) b (A v) = inner (𝕜 := ℝ) a v) : + A (Complex.I • a) = Complex.I • b := by + apply form_ext + intro w + obtain ⟨v,rfl⟩ := (LinearMap.surjective_of_injective (injective hA)) w + change form (A (Complex.I • a)) (A v) = form (Complex.I • b) (A v) + rw [hA, form_I, form_I, hh] + + theorem push_hamiltonian (e : OpenPartialHomeomorph (Vector κ) (Vector κ)) + (he : ContDiffOn ℝ ∞ e e.source) + (hω : ∀ x ∈ e.source, Preserves (fderiv ℝ e x)) + {H G : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) (hG : ContDiff ℝ ∞ G) + (hcomp : ∀ x ∈ e.source, H (e x) = G x) {x : Vector κ} (hx : x ∈ e.source) : + fderiv ℝ e x (Complex.I • gradient G x) = Complex.I • gradient H (e x) := by + apply push_gradient (hω x hx) + intro v + have hed := ((he.contDiffAt (e.open_source.mem_nhds hx)).differentiableAt (by simp)).hasFDerivAt + have hhd := ((hH.differentiable (by simp) (e x)).hasGradientAt.hasFDerivAt).comp x hed + have hgd := ((hG.differentiable (by simp) x).hasGradientAt.hasFDerivAt) + have heq : H ∘ e =ᶠ[𝓝 x] G := by + filter_upwards [e.open_source.mem_nhds hx] with z hz + exact hcomp z hz + have hh := hhd.unique (hgd.congr_of_eventuallyEq heq) + exact congrArg (fun D : Vector κ →L[ℝ] ℝ => D v) hh + + theorem inverse_curve (e : OpenPartialHomeomorph (Vector κ) (Vector κ)) + (he : ContDiffOn ℝ ∞ e e.source) + (hω : ∀ x ∈ e.source, Preserves (fderiv ℝ e x)) + {H G : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) (hG : ContDiff ℝ ∞ G) + (hcomp : ∀ x ∈ e.source, H (e x) = G x) + {x : ℝ → Vector κ} (hxt : ∀ t, x t ∈ e.target) + (hx : ∀ t, HasDerivAt x (Complex.I • gradient H (x t)) t) (t : ℝ) : + HasDerivAt (fun s => e.symm (x s)) (Complex.I • gradient G (e.symm (x t))) t := by + let y := e.symm (x t) + have hy : y ∈ e.source := e.map_target (hxt t) + obtain ⟨D,hD⟩ := invertible (hω y hy) + have hed : HasFDerivAt e D.toContinuousLinearMap y := by + rw [hD] + exact ((he.contDiffAt (e.open_source.mem_nhds hy)).differentiableAt (by simp)).hasFDerivAt + have hcd := (e.hasFDerivAt_symm (hxt t) hed).comp_hasDerivAt t (hx t) + apply hcd.congr_deriv + apply D.injective + simp only [ContinuousLinearEquiv.coe_coe, ContinuousLinearEquiv.apply_symm_apply] + have hh := push_hamiltonian e he hω hH hG hcomp hy + rw [e.right_inv (hxt t)] at hh + change Complex.I • gradient H (x t) = D.toContinuousLinearMap (Complex.I • gradient G y) + rw [hD] + exact hh.symm + +end +end ComplexSymplectic + +end NonsqueezingInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/ExteriorHamiltonian.lean b/lean/OAI/Geometry/PolarProducts/ExteriorHamiltonian.lean new file mode 100644 index 0000000000000000000000000000000000000000..274b94c160652a9be4b34bd2851e691adbcdf6d0 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/ExteriorHamiltonian.lean @@ -0,0 +1,377 @@ +import OAI.Geometry.PolarProducts.SmoothProfiles + +namespace OAI + +universe u123 u124 u125 u126 + +section NonsqueezingInline + +namespace PushedBall +noncomputable section +open Set Filter +open scoped ContDiff Topology +open FourierPolynomial HamiltonianODE SmoothProfiles EmbeddingInverse +variable {κ : Type u123} [Fintype κ] + + def domain (L : ℝ) : Set (Vector κ) := {z | ‖z‖^2 < L} + def core (L ε : ℝ) : Set (Vector κ) := Metric.closedBall 0 (Real.sqrt (L-ε)) + def radial (r L ε : ℝ) (z : Vector κ) : ℝ := ballProfile r L ε (‖z‖^2) + + theorem isOpen_domain (L : ℝ) : IsOpen (domain (κ := κ) L) := + isOpen_lt (continuous_norm.pow 2) continuous_const + + theorem core_compact (L ε : ℝ) : IsCompact (core (κ := κ) L ε) := isCompact_closedBall _ _ + + theorem mem_core_iff {L ε : ℝ} (hL : 0 ≤ L-ε) (z : Vector κ) : + z ∈ core L ε ↔ ‖z‖^2 ≤ L-ε := by + simp only [core, Metric.mem_closedBall, dist_zero_right] + exact (Real.le_sqrt (norm_nonneg z) hL) + + theorem core_subset_domain {L ε : ℝ} (hε : 0 < ε) (hL : ε ≤ L) : + core (κ := κ) L ε ⊆ domain L := by + intro z hz + have hh := (mem_core_iff (sub_nonneg.mpr hL) z).mp hz + change ‖z‖^2 < L + linarith + + theorem contDiff_radial (r L ε : ℝ) : ContDiff ℝ ∞ (radial (κ := κ) r L ε) := + (contDiff_ballProfile r L ε).comp ((contDiff_id : ContDiff ℝ ∞ (id : Vector κ → Vector κ)).norm_sq ℝ) + + theorem radial_eq_height {r L ε : ℝ} (hε : 0 < ε) (hL : ε ≤ L) + {z : Vector κ} (hz : z ∉ core L ε) : radial r L ε z = ballHeight r L ε := by + apply ballProfile_plateau r L hε + exact le_of_lt (lt_of_not_ge ((mem_core_iff (sub_nonneg.mpr hL) z).not.mp hz)) + + def pushed (e : OpenPartialHomeomorph (Vector κ) (Vector κ)) (r L ε : ℝ) (z : Vector κ) : ℝ := + extendFunction e (fun w => radial r L ε w-ballHeight r L ε) z+ballHeight r L ε + + theorem contDiff_pushed (e : OpenPartialHomeomorph (Vector κ) (Vector κ)) + (he : ContDiffOn ℝ ∞ e e.source) {L : ℝ} (hs : e.source = domain L) + (hD : ∀ x ∈ e.source, (fderiv ℝ e x).IsInvertible) + {r ε : ℝ} (hε : 0 < ε) (hL : ε ≤ L) : ContDiff ℝ ∞ (pushed e r L ε) := by + apply (contDiff_extendFunction e he hD ((contDiff_radial r L ε).sub contDiff_const) + (core_compact L ε) _ _).add contDiff_const + · rw [hs]; exact core_subset_domain hε hL + · intro z hz + rw [radial_eq_height hε hL hz, sub_self] + + theorem pushed_apply (e : OpenPartialHomeomorph (Vector κ) (Vector κ)) (r L ε : ℝ) + {x : Vector κ} (hx : x ∈ e.source) : pushed e r L ε (e x) = radial r L ε x := by + simp only [pushed, extendFunction_apply e _ hx, sub_add_cancel] + + theorem pushed_plateau (e : OpenPartialHomeomorph (Vector κ) (Vector κ)) + {r L ε : ℝ} (hε : 0 < ε) (hL : ε ≤ L) {x : Vector κ} (hx : x ∉ e '' core L ε) : + pushed e r L ε x = ballHeight r L ε := by + rw [pushed, extendFunction_zero e _ (core L ε) (fun z hz => by rw [radial_eq_height hε hL hz,sub_self]) hx, + zero_add] + + theorem pushed_bounds (e : OpenPartialHomeomorph (Vector κ) (Vector κ)) + {r L ε : ℝ} (hr : 0 ≤ r) (hε : 0 < ε) (x : Vector κ) : + 0 ≤ pushed e r L ε x ∧ pushed e r L ε x ≤ ballHeight r L ε := by + rcases extendFunction_mem_range e (fun w => radial r L ε w-ballHeight r L ε) x with hz | ⟨w,_,hw⟩ + · simp only [pushed,hz,zero_add,le_refl,and_true] + exact ballProfile_nonneg hr L hε (L-ε) + · simp only [pushed,hw,sub_add_cancel] + exact ⟨ballProfile_nonneg hr L hε _,ballProfile_le_height hr L hε _⟩ + + theorem zero_mem_domain {L : ℝ} (hL : 0 < L) : (0 : Vector κ) ∈ domain L := by + simpa only [domain, mem_ofPred_eq, norm_zero, zero_pow (by norm_num : (2 : ℕ) ≠ 0)] using hL + + theorem radial_flat {r L ε : ℝ} (hε : 0 < ε) : + ∀ᶠ z in 𝓝 (0 : Vector κ), radial r L ε z = 0 := by + have hsmall : ∀ᶠ z in 𝓝 (0 : Vector κ), ‖z‖^2 < ε := + (isOpen_domain ε).mem_nhds (zero_mem_domain hε) + filter_upwards [hsmall] with z hz + exact ballProfile_zero r L hε hz.le + + theorem pushed_flat (e : OpenPartialHomeomorph (Vector κ) (Vector κ)) + {r L ε : ℝ} (hs : e.source = domain L) (hε : 0 < ε) (hL : ε ≤ L) : + ∀ᶠ z in 𝓝 (e 0), pushed e r L ε z = 0 := by + have h0 : (0 : Vector κ) ∈ e.source := by + rw [hs]; exact zero_mem_domain (hε.trans_le hL) + apply eventually_of_comp e h0 + filter_upwards [e.open_source.mem_nhds h0,radial_flat (r := r) (L := L) hε] with z hz hflat + rw [pushed_apply e r L ε hz] + exact hflat + + theorem radial_slow {r L ε : ℝ} (hr : 0 ≤ r) (hrπ : r < Real.pi) + {x : ℝ → Vector κ} + (hx : ∀ t, HasDerivAt x (Complex.I • gradient (radial r L ε) (x t)) t) + (hp : x 1 = x 0) (t : ℝ) : x t = x 0 := + slow_radial_constant (hasDerivAt_ballProfile r L ε) (ballSlope_nonneg hr L ε) + (fun s => (ballSlope_le hr L ε s).trans_lt hrπ) hx hp t + +end +end PushedBall + +namespace ExteriorHamiltonian +noncomputable section +open Set Filter +open scoped ContDiff Topology +open FourierPolynomial DiagonalQuadratic HamiltonianODE HamiltonianGrowth SmoothProfiles +variable {κ : Type u124} [Fintype κ] + + def potential (d : κ → ℝ) (T δ : ℝ) (z : Vector κ) : ℝ := exterior δ (energy d z-T) + def full (H₀ : Vector κ → ℝ) (d : κ → ℝ) (T δ : ℝ) (z : Vector κ) : ℝ := + H₀ z+potential d T δ z + + theorem contDiff_potential (d : κ → ℝ) (T δ : ℝ) : ContDiff ℝ ∞ (potential d T δ) := + (contDiff_exterior δ).comp ((contDiff_energy d).sub contDiff_const) + + theorem contDiff_full {H₀ : Vector κ → ℝ} (hH₀ : ContDiff ℝ ∞ H₀) (d : κ → ℝ) (T δ : ℝ) : + ContDiff ℝ ∞ (full H₀ d T δ) := hH₀.add (contDiff_potential d T δ) + + theorem gradient_potential (d : κ → ℝ) (T δ : ℝ) (z : Vector κ) : + gradient (potential d T δ) z = (2*exteriorSlope δ (energy d z-T)) • diag d z := by + change gradient (fun w : Vector κ => exterior δ (energy d w-T)) z = _ + convert! gradient_comp_energy d z ((hasDerivAt_exterior δ (energy d z-T)).comp (energy d z) + ((hasDerivAt_id (energy d z)).sub_const T)) using 1 + simp only [mul_one] + + theorem gradient_sum {H G : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) (hG : ContDiff ℝ ∞ G) + (z : Vector κ) : gradient (fun w => H w+G w) z = gradient H z+gradient G z := by + apply HasGradientAt.gradient + rw [hasGradientAt_iff_hasFDerivAt] + have hh := ((hH.differentiable (by simp) z).hasGradientAt.hasFDerivAt).add + ((hG.differentiable (by simp) z).hasGradientAt.hasFDerivAt) + convert! hh using 1 + ext w + change inner (𝕜 := ℝ) (gradient H z+gradient G z) w = + inner (𝕜 := ℝ) (gradient H z) w+inner (𝕜 := ℝ) (gradient G z) w + exact inner_add_left _ _ _ + + theorem gradient_full {H₀ : Vector κ → ℝ} (hH₀ : ContDiff ℝ ∞ H₀) + (d : κ → ℝ) (T δ : ℝ) (z : Vector κ) : + gradient (full H₀ d T δ) z = gradient H₀ z+(2*exteriorSlope δ (energy d z-T)) • diag d z := by + change gradient (fun w => H₀ w+potential d T δ w) z = _ + rw [gradient_sum hH₀ (contDiff_potential d T δ), gradient_potential] + + theorem gradient_at_max {H : Vector κ → ℝ} {m : ℝ} (hm : ∀ z, H z ≤ m) + {z : Vector κ} (hz : H z = m) : gradient H z = 0 := by + have he : IsLocalMax H z := Filter.Eventually.of_forall (fun w => by rw [hz]; exact hm w) + simp only [gradient,he.fderiv_eq_zero,map_zero] + + theorem gradient_at_min {H : Vector κ → ℝ} {m : ℝ} (hm : ∀ z, m ≤ H z) + {z : Vector κ} (hz : H z = m) : gradient H z = 0 := by + have he : IsLocalMin H z := Filter.Eventually.of_forall (fun w => by rw [hz]; exact hm w) + simp only [gradient,he.fderiv_eq_zero,map_zero] + + theorem potential_zero (d : κ → ℝ) (T : ℝ) {δ : ℝ} (hδ : 0 < δ) {z : Vector κ} + (hz : energy d z ≤ T) : potential d T δ z = 0 := exterior_zero hδ (sub_nonpos.mpr hz) + + theorem potential_nonneg (d : κ → ℝ) (T : ℝ) {δ : ℝ} (hδ : 0 < δ) (z : Vector κ) : + 0 ≤ potential d T δ z := exterior_nonneg hδ _ + + theorem compact_sublevel (d : κ → ℝ) {b C : ℝ} (hb : 0 < b) (hd : ∀ j, b ≤ d j) (hC : 0 ≤ C) : + IsCompact {z : Vector κ | energy d z ≤ C} := by + apply (isCompact_closedBall (0 : Vector κ) (Real.sqrt (C/b))).of_isClosed_subset + (isClosed_le (contDiff_energy d).continuous continuous_const) + intro z hz + simp only [Metric.mem_closedBall,dist_zero_right] + apply (Real.le_sqrt (norm_nonneg z) (div_nonneg hC hb.le)).mpr + apply (le_div_iff₀ hb).mpr + have he := energy_lower d b hd z + change energy d z ≤ C at hz + nlinarith + + theorem bounded_remainder {H₀ : Vector κ → ℝ} (hH₀ : ContDiff ℝ ∞ H₀) + {m : ℝ} (hm : ∀ z, H₀ z ≤ m) {S : Set (Vector κ)} (hS : IsCompact S) + (he : ∀ z ∉ S, H₀ z = m) (d : κ → ℝ) {b T δ : ℝ} + (hb : 0 < b) (hd : ∀ j, b ≤ d j) (hδ : 0 < δ) (hT : 0 ≤ T+δ) : + ∃ B : ℝ, 0 ≤ B ∧ ∀ z, + ‖gradient (full H₀ d T δ) z-(2 : ℝ) • diag d z‖ ≤ B := by + apply bound_remainder_of_compact (contDiff_full hH₀ d T δ) d + (hS.union (compact_sublevel d hb hd hT)) + intro z hz + have hzS : z ∉ S := fun h => hz (Or.inl h) + have hzQ : T+δ < energy d z := lt_of_not_ge (fun h => hz (Or.inr h)) + rw [gradient_full hH₀, gradient_at_max hm (he z hzS), + exteriorSlope_one hδ (by linarith), mul_one, zero_add] + + theorem full_flat {H₀ : Vector κ → ℝ} (d : κ → ℝ) {T δ : ℝ} (hδ : 0 < δ) + {p : Vector κ} (hf : ∀ᶠ z in 𝓝 p, H₀ z = 0) (hp : energy d p < T) : + ∀ᶠ z in 𝓝 p, full H₀ d T δ z = 0 := by + have hq : ∀ᶠ z in 𝓝 p, energy d z < T := + (isOpen_lt (contDiff_energy d).continuous continuous_const).mem_nhds hp + filter_upwards [hf,hq] with z hz hze + simp only [full,hz,potential_zero d T hδ hze.le,add_zero] + +end +end ExteriorHamiltonian + +namespace ExteriorHamiltonian +noncomputable section +open Set Filter MeasureTheory +open scoped ContDiff Topology +open FourierPolynomial DiagonalQuadratic HamiltonianODE SmoothProfiles HamiltonianPeriodic +variable {κ : Type u125} [Fintype κ] + + theorem action_nonpos {H : Vector κ → ℝ} {x : ℝ → Vector κ} + (h : ∀ t, inner (𝕜 := ℝ) (gradient H (x t)) (x t)/2-H (x t) ≤ 0) : + actionIntegral H x ≤ 0 := by + rw [actionIntegral,intervalIntegral.integral_of_le (by norm_num : (0:ℝ) ≤ 1)] + exact integral_nonpos h + + theorem gradient_of_constant_curve {H : Vector κ → ℝ} {x : ℝ → Vector κ} + (hx : ∀ t, HasDerivAt x (Complex.I • gradient H (x t)) t) + (hc : ∀ t, x t = x 0) (t : ℝ) : gradient H (x t) = 0 := by + have he : x = fun _ => x 0 := funext hc + have hd0 : HasDerivAt x 0 t := by + convert! hasDerivAt_const t (x 0) using 1 + have hd := (hx t).unique hd0 + exact (smul_eq_zero.mp hd).resolve_left Complex.I_ne_zero + + theorem action_nonpos_of_constant {H : Vector κ → ℝ} (hH0 : ∀ z, 0 ≤ H z) + {x : ℝ → Vector κ} (hx : ∀ t, HasDerivAt x (Complex.I • gradient H (x t)) t) + (hc : ∀ t, x t = x 0) : actionIntegral H x ≤ 0 := by + apply action_nonpos + intro t + rw [gradient_of_constant_curve hx hc t,inner_zero_left,zero_div,zero_sub] + exact neg_nonpos.mpr (hH0 (x t)) + + theorem high_orbit_nonpos (j₀ : κ) {H₀ : Vector κ → ℝ} (hH₀ : ContDiff ℝ ∞ H₀) + {m : ℝ} (hm : ∀ z, H₀ z ≤ m) (hH₀0 : ∀ z, 0 ≤ H₀ z) + (d : κ → ℝ) (hd : ∀ j, 0 ≤ d j) (hda : Real.pi < d j₀) + (hdb : ∀ j, j ≠ j₀ → d j < Real.pi) (hda2 : d j₀ < 2*Real.pi) + {T δ : ℝ} (hδ : 0 < δ) (hmag : Real.pi*(T+δ) < m*d j₀) + {x : ℝ → Vector κ} + (hx : ∀ t, HasDerivAt x (Complex.I • gradient (full H₀ d T δ) (x t)) t) + (hp : x 1 = x 0) (hplateau : ∀ t, H₀ (x t) = m) : + actionIntegral (full H₀ d T δ) x ≤ 0 := by + have he (t : ℝ) : gradient (full H₀ d T δ) (x t) = + (2*exteriorSlope δ (energy d (x t)-T)) • diag d (x t) := by + rw [gradient_full hH₀,gradient_at_max hm (hplateau t),zero_add] + have hode (t : ℝ) := (hx t).congr_deriv (congrArg (fun z : Vector κ => Complex.I • z) (he t)) + have hQ (t : ℝ) := quadratic_constant d hode t 0 + let v := exteriorSlope δ (energy d (x 0)-T) + have hv : 0 ≤ v := exteriorSlope_nonneg _ _ + have hv1 : v ≤ 1 := exteriorSlope_le_one _ _ + have hode' (t : ℝ) : HasDerivAt x (Complex.I • ((2*v) • diag d (x t))) t := by + simpa only [hQ t] using hode t + rcases diagonal_either j₀ d hv hv1 hd hdb hda2 hode' hp with heq | hc + · have ha0 : 0 < d j₀ := Real.pi_pos.trans hda + have hvlt : v < 1 := by nlinarith + have hQt : energy d (x 0) < T+δ := by + by_contra hn + have hz : v = 1 := exteriorSlope_one hδ (by linarith) + linarith + have hvT : v*(T+δ) < m := by + apply (mul_lt_mul_iff_left₀ ha0).mp + calc + (v*(T+δ))*d j₀ = Real.pi*(T+δ) := by rw [← heq]; ring + _ < m*d j₀ := hmag + apply action_nonpos + intro t + rw [he t,hQ t,real_inner_smul_left,← energy_eq_inner, hQ t] + have hg := potential_nonneg d T hδ (x t) + change (2*v)*energy d (x 0)/2-(H₀ (x t)+potential d T δ (x t)) ≤ 0 + rw [hplateau t] + nlinarith [mul_le_mul_of_nonneg_left hQt.le hv] + · apply action_nonpos_of_constant _ hx hc + intro z + exact add_nonneg (hH₀0 z) (potential_nonneg d T hδ z) + + theorem zero_vector_at_plateau {H₀ : Vector κ → ℝ} (hH₀ : ContDiff ℝ ∞ H₀) + {m : ℝ} (hm : ∀ z, H₀ z ≤ m) (d : κ → ℝ) {T δ : ℝ} (hδ : 0 < δ) + {U : Set (Vector κ)} (hU : ∀ z ∈ U, energy d z ≤ T) + (he : ∀ z ∉ U, H₀ z = m) {z : Vector κ} (hz : full H₀ d T δ z = m) : + gradient (full H₀ d T δ) z = 0 := by + have hp : potential d T δ z = 0 := by + by_cases hu : z ∈ U + · exact potential_zero d T hδ (hU z hu) + · have hh := he z hu + change H₀ z+potential d T δ z=m at hz + linarith + have h0 : H₀ z = m := by simpa only [full,hp,add_zero] using hz + change gradient (fun w => H₀ w+potential d T δ w) z = 0 + rw [gradient_sum hH₀ (contDiff_potential d T δ),gradient_at_max hm h0, + gradient_at_min (potential_nonneg d T hδ) hp,add_zero] + + theorem all_orbits_nonpos (j₀ : κ) {H₀ : Vector κ → ℝ} (hH₀ : ContDiff ℝ ∞ H₀) + {m : ℝ} (hm : ∀ z, H₀ z ≤ m) (hH₀0 : ∀ z, 0 ≤ H₀ z) + (d : κ → ℝ) (hd : ∀ j, 0 ≤ d j) (hda : Real.pi < d j₀) + (hdb : ∀ j, j ≠ j₀ → d j < Real.pi) (hda2 : d j₀ < 2*Real.pi) + {T δ : ℝ} (hδ : 0 < δ) (hmag : Real.pi*(T+δ) < m*d j₀) + {U : Set (Vector κ)} (hU : ∀ z ∈ U, energy d z ≤ T) + (he : ∀ z ∉ U, H₀ z = m) + (hslow : ∀ x : ℝ → Vector κ, (∀ t, x t ∈ U) → x 1 = x 0 → + (∀ t, HasDerivAt x (Complex.I • gradient (full H₀ d T δ) (x t)) t) → ∀ t, x t = x 0) + {x : ℝ → Vector κ} + (hx : ∀ t, HasDerivAt x (Complex.I • gradient (full H₀ d T δ) (x t)) t) + (hp : x 1 = x 0) : actionIntegral (full H₀ d T δ) x ≤ 0 := by + have hH0 (z : Vector κ) : 0 ≤ full H₀ d T δ z := + add_nonneg (hH₀0 z) (potential_nonneg d T hδ z) + have hE (t : ℝ) := energy_constant (contDiff_full hH₀ d T δ) hx t 0 + rcases lt_trichotomy (full H₀ d T δ (x 0)) m with hl | heq | hh + · have hxt (t : ℝ) : x t ∈ U := by + by_contra hn + have hz := he (x t) hn + have hg := potential_nonneg d T hδ (x t) + have ht : full H₀ d T δ (x t) < m := by rw [hE t]; exact hl + change H₀ (x t)+potential d T δ (x t) < m at ht + linarith + exact action_nonpos_of_constant hH0 hx (hslow x hxt hp hx) + · apply action_nonpos_of_constant hH0 hx + intro s + apply zero_derivative_constant _ s 0 + intro t + have hz := zero_vector_at_plateau hH₀ hm d hδ hU he ((hE t).trans heq) + simpa only [hz,smul_zero] using hx t + · apply high_orbit_nonpos j₀ hH₀ hm hH₀0 d hd hda hdb hda2 hδ hmag hx hp + intro t + apply he + intro hu + have hpz := potential_zero d T hδ (hU (x t) hu) + have ht : m < full H₀ d T δ (x t) := by rw [hE t]; exact hh + simp only [full,hpz,add_zero] at ht + exact (not_lt_of_ge (hm (x t))) ht + +end +end ExteriorHamiltonian + +namespace PushedBall +noncomputable section +open Set Filter +open scoped ContDiff Topology +open FourierPolynomial DiagonalQuadratic HamiltonianODE SmoothProfiles ExteriorHamiltonian +variable {κ : Type u126} [Fintype κ] + + theorem pushed_full_comp (e : OpenPartialHomeomorph (Vector κ) (Vector κ)) + (r L ε : ℝ) (d : κ → ℝ) {T δ : ℝ} (hδ : 0 < δ) + (hQ : ∀ z ∈ e.target, energy d z ≤ T) {z : Vector κ} (hz : z ∈ e.source) : + full (pushed e r L ε) d T δ (e z) = radial r L ε z := by + rw [full,pushed_apply e r L ε hz,potential_zero d T hδ (hQ _ (e.map_source hz)),add_zero] + + theorem pushed_full_slow (e : OpenPartialHomeomorph (Vector κ) (Vector κ)) + (he : ContDiffOn ℝ ∞ e e.source) (hω : ∀ z ∈ e.source, ComplexSymplectic.Preserves (fderiv ℝ e z)) + {r L ε : ℝ} (hs : e.source = domain L) (hr : 0 ≤ r) (hrπ : r < Real.pi) + (hε : 0 < ε) (hL : ε ≤ L) (d : κ → ℝ) {T δ : ℝ} (hδ : 0 < δ) + (hQ : ∀ z ∈ e.target, energy d z ≤ T) + {x : ℝ → Vector κ} (hxt : ∀ t, x t ∈ e.target) (hp : x 1 = x 0) + (hx : ∀ t, HasDerivAt x (Complex.I • gradient (full (pushed e r L ε) d T δ) (x t)) t) + (t : ℝ) : x t = x 0 := by + have hD (z) (hz : z ∈ e.source) := ComplexSymplectic.invertible (hω z hz) + have hH := contDiff_full (contDiff_pushed e he hs hD (r := r) hε hL) d T δ + have hy (s : ℝ) := ComplexSymplectic.inverse_curve e he hω hH (contDiff_radial r L ε) + (fun z hz => pushed_full_comp e r L ε d hδ hQ hz) hxt hx s + have hp' : e.symm (x 1) = e.symm (x 0) := congrArg e.symm hp + have hc := radial_slow hr hrπ hy hp' t + have hh := congrArg e hc + simpa only [e.right_inv (hxt t),e.right_inv (hxt 0)] using hh + + theorem pushed_plateau_outside (e : OpenPartialHomeomorph (Vector κ) (Vector κ)) + {r L ε : ℝ} (hs : e.source = domain L) (hε : 0 < ε) (hL : ε ≤ L) + {z : Vector κ} (hz : z ∉ e.target) : pushed e r L ε z = ballHeight r L ε := by + apply pushed_plateau e hε hL + rintro ⟨x,hx,rfl⟩ + apply hz + apply e.map_source + rw [hs] + exact core_subset_domain hε hL hx + +end +end PushedBall + +end NonsqueezingInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/FiniteDescent.lean b/lean/OAI/Geometry/PolarProducts/FiniteDescent.lean new file mode 100644 index 0000000000000000000000000000000000000000..84ccbf67296d13cfc4debcbbaef84c0ddb1df96d --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/FiniteDescent.lean @@ -0,0 +1,329 @@ +import OAI.Geometry.PolarProducts.SmoothDegree + +namespace OAI + +universe u80 u81 u82 u83 + +section NonsqueezingInline +section +open Set Filter Function MeasureTheory +open scoped Topology ContDiff + +namespace SmoothLinking +noncomputable section +open Set Filter Function +open scoped Topology ContDiff +variable {E : Type u80} {F : Type u81} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [InnerProductSpace ℝ F] + +def conePoint (e : F) (z : E × ℝ) : E × F := (z.1, z.2 • e) + +def degreeMap (η : E × F → E × F) (e : F) (ρ : ℝ) (z : E × ℝ) : E × ℝ := + if 0 < z.2+ρ then + ((η (z.1, (z.2+ρ) • e)).1, (‖(η (z.1, (z.2+ρ) • e)).2‖^2-ρ^2)/(z.2+2*ρ)) + else z + +omit [NormedAddCommGroup E] [NormedSpace ℝ E] in +theorem degreeMap_eq_self {η : E × F → E × F} {e : F} (he : ‖e‖ = 1) + {ρ : ℝ} (hρ : 0 < ρ) {z : E × ℝ} (hz : 0 < z.2+ρ) + (hη : η (z.1, (z.2+ρ) • e) = (z.1, (z.2+ρ) • e)) : + degreeMap η e ρ z = z := by + simp only [degreeMap, ite_eq_left hz, hη, norm_smul, he, mul_one, + Real.norm_eq_abs, sq_abs] + apply Prod.ext + · rfl + change ((z.2+ρ)^2-ρ^2)/(z.2+2*ρ) = z.2 + apply (div_eq_iff (by linarith : z.2+2*ρ ≠ 0)).mpr + ring + +theorem contDiffAt_degreeMap_pos {η : E × F → E × F} (hη : ContDiff ℝ ∞ η) + (e : F) {ρ : ℝ} (hρ : 0 < ρ) {z : E × ℝ} (hz : 0 < z.2+ρ) : + ContDiffAt ℝ ∞ (degreeMap η e ρ) z := by + have hinput : ContDiff ℝ ∞ (fun w : E × ℝ => (w.1, (w.2+ρ) • e)) := + contDiff_fst.prodMk ((contDiff_snd.add contDiff_const).smul contDiff_const) + have hout := hη.comp hinput + have hn : z.2+2*ρ ≠ 0 := by linarith + have hd : ContDiffAt ℝ ∞ (fun w : E × ℝ => + ((η (w.1, (w.2+ρ) • e)).1, (‖(η (w.1, (w.2+ρ) • e)).2‖^2-ρ^2)/(w.2+2*ρ))) z := by + exact (contDiff_fst.comp hout).contDiffAt.prodMk + (((contDiff_norm_sq ℝ).comp (contDiff_snd.comp hout)).contDiffAt.sub contDiffAt_const |>.div + (contDiffAt_snd.add contDiffAt_const) hn) + apply hd.congr_of_eventuallyEq + filter_upwards [(isOpen_lt continuous_const (continuous_snd.add continuous_const)).mem_nhds hz] with w hw + change 0 < w.2+ρ at hw + simp only [degreeMap, ite_eq_left hw] + +theorem contDiff_degreeMap {η : E × F → E × F} (hη : ContDiff ℝ ∞ η) + {e : F} (he : ‖e‖ = 1) {ρ ε : ℝ} (hρ : 0 < ρ) (hε : 0 < ε) + (hfixed : ∀ (y : E) (s : ℝ), 0 < s → s < ε → η (y, s • e) = (y, s • e)) : + ContDiff ℝ ∞ (degreeMap η e ρ) := by + apply contDiff_iff_contDiffAt.mpr + intro z + by_cases hz : 0 < z.2+ρ + · exact contDiffAt_degreeMap_pos hη e hρ hz + have hz' : z.2+ρ < ε := lt_of_le_of_lt (le_of_not_gt hz) hε + apply (contDiffAt_id : ContDiffAt ℝ ∞ (id : E × ℝ → E × ℝ) z).congr_of_eventuallyEq + filter_upwards [(isOpen_lt (continuous_snd.add continuous_const) continuous_const).mem_nhds hz'] with w hw + by_cases hp : 0 < w.2+ρ + · exact degreeMap_eq_self he hρ hp (hfixed w.1 (w.2+ρ) hp hw) + · simp only [degreeMap, ite_eq_right hp, id_eq] + +omit [NormedSpace ℝ E] in +theorem norm_translate_le (z : E × ℝ) {ρ : ℝ} (hρ : 0 ≤ ρ) : + ‖z‖ ≤ ‖(z.1, z.2+ρ)‖ + ρ := by + have he : z = (z.1, z.2+ρ) - (0,ρ) := by ext <;> simp + calc + ‖z‖ = ‖(z.1, z.2+ρ) - (0,ρ)‖ := congrArg norm he + _ ≤ ‖(z.1, z.2+ρ)‖+‖((0,ρ) : E × ℝ)‖ := norm_sub_le _ _ + _ = _ := by simp [Prod.norm_def, abs_of_nonneg hρ, hρ] + +omit [NormedSpace ℝ E] in +theorem degreeMap_identity_outside {η : E × F → E × F} {e : F} (he : ‖e‖ = 1) + {ρ R : ℝ} (hρ : 0 < ρ) + (hfixed : ∀ (y : E) (s : ℝ), 0 < s → R ≤ ‖(y,s)‖ → η (y, s • e) = (y, s • e)) + (z : E × ℝ) (hz : R+ρ ≤ ‖z‖) : degreeMap η e ρ z = z := by + by_cases hp : 0 < z.2+ρ + · apply degreeMap_eq_self he hρ hp + apply hfixed _ _ hp + have hn := norm_translate_le z hρ.le + linarith + · simp only [degreeMap, ite_eq_right hp] + +theorem sphere_linking [FiniteDimensional ℝ E] + {η : E × F → E × F} (hη : ContDiff ℝ ∞ η) {e : F} (he : ‖e‖ = 1) + {ρ ε R : ℝ} (hρ : 0 < ρ) (hε : 0 < ε) (hR : ρ < R) + (hnear : ∀ (y : E) (s : ℝ), 0 < s → s < ε → η (y, s • e) = (y, s • e)) + (hfar : ∀ (y : E) (s : ℝ), 0 < s → R ≤ ‖(y,s)‖ → η (y, s • e) = (y, s • e)) : + ∃ (y : E) (s : ℝ), 0 < s ∧ ‖(y,s)‖ < R ∧ (η (y, s • e)).1 = 0 ∧ ‖(η (y, s • e)).2‖ = ρ := by + obtain ⟨z, hz⟩ := SmoothDegree.exists_zero (contDiff_degreeMap hη he hρ hε hnear) + (show 0 < R+ρ by linarith) (degreeMap_identity_outside he hρ hfar) + have hp : 0 < z.2+ρ := by + by_contra h + have heq : z = 0 := by simpa only [degreeMap, ite_eq_right h] using hz + simp only [heq, Prod.snd_zero, zero_add] at h + exact h hρ + have hfst : (η (z.1, (z.2+ρ) • e)).1 = 0 := by + simpa only [degreeMap, ite_eq_left hp, Prod.fst_zero, Prod.fst] using congrArg Prod.fst hz + have hsnd : ‖(η (z.1, (z.2+ρ) • e)).2‖ = ρ := by + have h := congrArg Prod.snd hz + simp only [degreeMap, ite_eq_left hp, Prod.snd_zero] at h + have hd : z.2+2*ρ ≠ 0 := by linarith + have hsq : ‖(η (z.1, (z.2+ρ) • e)).2‖^2 = ρ^2 := + sub_eq_zero.mp ((div_eq_zero_iff).mp h |>.resolve_right hd) + nlinarith [norm_nonneg (η (z.1, (z.2+ρ) • e)).2] + refine ⟨z.1, z.2+ρ, hp, ?_, hfst, hsnd⟩ + by_contra! hn + have hid := hfar z.1 (z.2+ρ) hp hn + rw [hid] at hfst hsnd + simp only [norm_smul, he, mul_one, Real.norm_eq_abs, + abs_of_pos hp] at hfst hsnd + rw [hfst, hsnd] at hn + have : ‖((0 : E),ρ)‖ = ρ := by simp [Prod.norm_def, abs_of_pos hρ, hρ.le] + rw [this] at hn + exact hR.not_ge hn + +end +end SmoothLinking + +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal + +namespace FlowDescent +noncomputable section +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal +variable {E : Type u82} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + + theorem curve_displacement {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + {h : ℝ} (hh : ‖h‖₊ * K < 1) (h0 : 0 ≤ h) {L : ℝ} + (hL : ∀ x, ‖V x‖ ≤ L) (x : E) {t : ℝ} (ht : t ∈ Icc (0 : ℝ) 1) : + ‖SmoothODE.curve hV h hh x t - x‖ ≤ h*L*t := by + have hb (s : ℝ) (_hs : s ∈ Icc (0 : ℝ) 1) : + ‖h • V (SmoothODE.curve hV h hh x s)‖ ≤ h*L := by + rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg h0] + exact mul_le_mul_of_nonneg_left (hL _) h0 + have hm := Convex.norm_image_sub_le_of_norm_hasDerivWithin_le + (fun s hs => (SmoothODE.hasDerivAt_curve hV h hh x ⟨s,hs⟩).hasDerivWithinAt) + hb (convex_Icc (0 : ℝ) 1) (show (0 : ℝ) ∈ Icc (0 : ℝ) 1 by simp) ht + simpa only [SmoothODE.curve_zero, sub_zero, Real.norm_eq_abs, abs_of_nonneg ht.1] using hm + + theorem curve_energy_deriv {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + {h : ℝ} (hh : ‖h‖₊ * K < 1) {Φ : E → ℝ} (hΦ : Differentiable ℝ Φ) + (x : E) {t : ℝ} (ht : t ∈ Icc (0 : ℝ) 1) : + HasDerivAt (fun s => Φ (SmoothODE.curve hV h hh x s)) + (h * fderiv ℝ Φ (SmoothODE.curve hV h hh x t) (V (SmoothODE.curve hV h hh x t))) t := by + have hd := (hΦ (SmoothODE.curve hV h hh x t)).hasFDerivAt.comp_hasDerivAt t + (SmoothODE.hasDerivAt_curve hV h hh x ⟨t,ht⟩) + simpa only [Function.comp_def, map_smul, smul_eq_mul] using hd + + theorem curve_energy_antitone {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + {h : ℝ} (hh : ‖h‖₊ * K < 1) (h0 : 0 ≤ h) {Φ : E → ℝ} (hΦ : Differentiable ℝ Φ) + (hdec : ∀ x, fderiv ℝ Φ x (V x) ≤ 0) (x : E) : + AntitoneOn (fun t => Φ (SmoothODE.curve hV h hh x t)) (Icc (0 : ℝ) 1) := by + apply antitoneOn_of_hasDerivWithinAt_nonpos (convex_Icc (0 : ℝ) 1) + (hΦ.continuous.comp (SmoothODE.continuous_curve hV h hh x)).continuousOn + (fun t ht => (curve_energy_deriv hV hh hΦ x (interior_subset ht)).hasDerivWithinAt) + intro t _ + exact mul_nonpos_of_nonneg_of_nonpos h0 (hdec _) + + theorem step_energy_le {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + {h : ℝ} (hh : ‖h‖₊ * K < 1) (h0 : 0 ≤ h) {Φ : E → ℝ} (hΦ : Differentiable ℝ Φ) + (hdec : ∀ x, fderiv ℝ Φ x (V x) ≤ 0) (x : E) : + Φ (SmoothODE.step hV h hh x) ≤ Φ x := by + simpa only [SmoothODE.curve_one, SmoothODE.curve_zero] using + (curve_energy_antitone hV hh h0 hΦ hdec x (by simp) (by simp) zero_le_one) + + theorem step_energy_drop {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + {h : ℝ} (hh : ‖h‖₊ * K < 1) (h0 : 0 ≤ h) {Φ : E → ℝ} (hΦ : Differentiable ℝ Φ) + (hdec : ∀ x, fderiv ℝ Φ x (V x) ≤ 0) {L M a b : ℝ} + (hL : ∀ x, ‖V x‖ ≤ L) + (hrate : ∀ x, ‖x‖ ≤ M → a ≤ Φ x → Φ x ≤ b → fderiv ℝ Φ x (V x) ≤ -1) + (x : E) (hx : ‖x‖+h*L ≤ M) (hxb : Φ x ≤ b) : + Φ (SmoothODE.step hV h hh x) ≤ max a (Φ x-h) := by + by_cases hxa : Φ (SmoothODE.step hV h hh x) ≤ a + · exact hxa.trans (le_max_left _ _) + have ha := le_of_lt (lt_of_not_ge hxa) + have ham := curve_energy_antitone hV hh h0 hΦ hdec x + have hb (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) : + fderiv ℝ Φ (SmoothODE.curve hV h hh x t) (V (SmoothODE.curve hV h hh x t)) ≤ -1 := by + apply hrate + · have hdn := curve_displacement hV hh h0 hL x ht + have hLn : 0 ≤ L := le_trans (norm_nonneg (V x)) (hL x) + have hn := norm_le_norm_sub_add (SmoothODE.curve hV h hh x t) x + have htime := mul_le_mul_of_nonneg_left ht.2 (mul_nonneg h0 hLn) + linarith + · exact ha.trans (by simpa only [SmoothODE.curve_one] using ham ht (by simp) ht.2) + · exact (show Φ (SmoothODE.curve hV h hh x t) ≤ Φ x from by + simpa only [SmoothODE.curve_zero] using ham (by simp) ht ht.1).trans hxb + have hm : AntitoneOn (fun t => Φ (SmoothODE.curve hV h hh x t)+h*t) (Icc (0 : ℝ) 1) := by + apply antitoneOn_of_hasDerivWithinAt_nonpos (convex_Icc (0 : ℝ) 1) + (((hΦ.continuous.comp (SmoothODE.continuous_curve hV h hh x)).add + (continuous_const.mul continuous_id)).continuousOn) + (fun t ht => ((curve_energy_deriv hV hh hΦ x (interior_subset ht)).add + ((hasDerivAt_id t).const_mul h)).hasDerivWithinAt) + intro t ht + have := mul_le_mul_of_nonneg_left (hb t (interior_subset ht)) h0 + linarith + have hend := hm (by simp) (by simp) zero_le_one + simp only [SmoothODE.curve_one, SmoothODE.curve_zero, mul_one, mul_zero, add_zero] at hend + exact (by linarith : Φ (SmoothODE.step hV h hh x) ≤ Φ x-h).trans (le_max_right _ _) + +end +end FlowDescent + +namespace FlowDescent +noncomputable section +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal +variable {E : Type u83} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + + omit [NormedSpace ℝ E] [CompleteSpace E] in + theorem iterate_norm_le {f : E → E} {D : ℝ} (hD : ∀ x, ‖f x-x‖ ≤ D) (j : ℕ) (x : E) : + ‖f^[j] x‖ ≤ ‖x‖+j*D := by + induction j with + | zero => simp + | succ j ih => + rw [Function.iterate_succ_apply'] + have hn := norm_le_norm_sub_add (f (f^[j] x)) (f^[j] x) + have hd := hD (f^[j] x) + push_cast + linarith + + omit [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] in + theorem iterate_energy_le {f : E → E} {Φ : E → ℝ} (hf : ∀ x, Φ (f x) ≤ Φ x) + (j : ℕ) (x : E) : Φ (f^[j] x) ≤ Φ x := by + induction j with + | zero => rfl + | succ j ih => + rw [Function.iterate_succ_apply'] + exact (hf (f^[j] x)).trans ih + + omit [NormedSpace ℝ E] [CompleteSpace E] in + theorem iterate_energy_drop {f : E → E} {Φ : E → ℝ} {h D M a b : ℝ} (h0 : 0 ≤ h) + (hD0 : 0 ≤ D) (hD : ∀ x, ‖f x-x‖ ≤ D) (hdec : ∀ x, Φ (f x) ≤ Φ x) + (hdrop : ∀ x, ‖x‖+D ≤ M → Φ x ≤ b → Φ (f x) ≤ max a (Φ x-h)) + (N : ℕ) (x : E) (hx : ‖x‖+N*D ≤ M) (hb : Φ x ≤ b) : + Φ (f^[N] x) ≤ max a (Φ x-N*h) := by + suffices hs : ∀ j, j ≤ N → Φ (f^[j] x) ≤ max a (Φ x-j*h) by exact hs N le_rfl + intro j + induction j with + | zero => intro _; simp + | succ j ih => + intro hj + have hij := ih (Nat.le_trans (Nat.le_succ j) hj) + have hn := iterate_norm_le hD j x + have hb' := (iterate_energy_le hdec j x).trans hb + have hjR : (j : ℝ)+1 ≤ N := by exact_mod_cast hj + have hx' : ‖f^[j] x‖+D ≤ M := by + have := mul_le_mul_of_nonneg_right hjR hD0 + nlinarith + have hd := hdrop (f^[j] x) hx' hb' + rw [Function.iterate_succ_apply'] + apply hd.trans + apply max_le (le_max_left _ _) + apply (sub_le_sub_right hij h).trans + rw [← max_sub_sub_right] + apply max_le + · exact (sub_le_self a h0).trans (le_max_left _ _) + · apply le_trans _ (le_max_right _ _) + push_cast + linarith + + omit [CompleteSpace E] in + theorem contDiff_iterate {f : E → E} (hf : ContDiff ℝ ∞ f) (j : ℕ) : + ContDiff ℝ ∞ (f^[j]) := by + induction j with + | zero => exact contDiff_id + | succ j ih => + convert! hf.comp ih using 1 + ext x + exact Function.iterate_succ_apply' f j x + + theorem exists_descent_map [ProperSpace E] {V : E → E} {K : ℝ≥0} + (hV : LipschitzWith K V) (hVs : ContDiff ℝ ∞ V) {Φ : E → ℝ} + (hΦ : Differentiable ℝ Φ) (hdec : ∀ x, fderiv ℝ Φ x (V x) ≤ 0) + {L M a b B T : ℝ} (hT : 0 < T) (hba : b-T ≤ a) + (hL : ∀ x, ‖V x‖ ≤ L) (hM : B+T*L ≤ M) + (hrate : ∀ x, ‖x‖ ≤ M → a ≤ Φ x → Φ x ≤ b → fderiv ℝ Φ x (V x) ≤ -1) : + ∃ η : E → E, ContDiff ℝ ∞ η ∧ (∀ x, Φ (η x) ≤ Φ x) ∧ + (∀ x, V x = 0 → η x = x) ∧ + ∀ x, ‖x‖ ≤ B → Φ x ≤ b → Φ (η x) ≤ a := by + obtain ⟨N, hN⟩ := exists_nat_gt (max (T*(K : ℝ)) 0) + have hN0 : (0 : ℝ) < N := (le_max_right _ _).trans_lt hN + have hNne : (N : ℝ) ≠ 0 := hN0.ne' + let h := T/N + have h0 : 0 ≤ h := (div_pos hT hN0).le + have hh : ‖h‖₊ * K < 1 := by + change ‖h‖*(K : ℝ) < (1 : ℝ) + rw [Real.norm_eq_abs, abs_of_nonneg h0] + dsimp [h] + rw [div_mul_eq_mul_div] + exact (div_lt_one hN0).mpr ((le_max_left _ _).trans_lt hN) + have hNh : (N : ℝ)*h = T := by dsimp [h]; field_simp + let f := SmoothODE.step hV h hh + have hf : ContDiff ℝ ∞ f := SmoothODE.contDiff_step hV hVs h hh + have hfd (x : E) : Φ (f x) ≤ Φ x := step_energy_le hV hh h0 hΦ hdec x + have hfD (x : E) : ‖f x-x‖ ≤ h*L := by + simpa only [SmoothODE.curve_one, mul_one] using + (curve_displacement hV hh h0 hL x (t := 1) (by simp)) + have hL0 : 0 ≤ L := (norm_nonneg (V 0)).trans (hL 0) + refine ⟨f^[N], contDiff_iterate hf N, iterate_energy_le hfd N, ?_, ?_⟩ + · intro x hx + have hfix : f x = x := by + simpa only [SmoothODE.curve_one] using + (SmoothODE.curve_of_eq_zero hV h hh x hx (by simp : (1 : ℝ) ∈ Icc (0 : ℝ) 1)) + exact Function.iterate_fixed hfix N + · intro x hx hb + have hbound : ‖x‖+(N : ℝ)*(h*L) ≤ M := by nlinarith [mul_assoc (N : ℝ) h L] + have hd := iterate_energy_drop h0 (mul_nonneg h0 hL0) hfD hfd + (fun y hy hby => step_energy_drop hV hh h0 hΦ hdec hL hrate y hy hby) N x hbound hb + rw [hNh] at hd + exact hd.trans (max_le le_rfl (by linarith)) + +end +end FlowDescent + +end +end NonsqueezingInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/FourierIntegrals.lean b/lean/OAI/Geometry/PolarProducts/FourierIntegrals.lean new file mode 100644 index 0000000000000000000000000000000000000000..1da217f97c636736243a00d4e98acf291164b9d4 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/FourierIntegrals.lean @@ -0,0 +1,269 @@ +import OAI.Geometry.PolarProducts.GradientLinking + +namespace OAI + +universe u89 u90 u91 u92 u93 u94 u95 u96 u97 u98 u99 + +section NonsqueezingInline + +namespace FourierPolynomial +noncomputable section +open MeasureTheory AddCircle Finset +open scoped ComplexConjugate + +local instance : Fact (0 < (1 : ℝ)) := ⟨zero_lt_one⟩ +abbrev Time := AddCircle (1 : ℝ) +abbrev μ : Measure Time := AddCircle.haarAddCircle + +def eval {ι : Type u89} [Fintype ι] (k : ι → ℤ) (a : ι → ℂ) (t : Time) : ℂ := + ∑ i, a i * fourier (k i) t + + theorem continuous_eval {ι : Type u90} [Fintype ι] (k : ι → ℤ) (a : ι → ℂ) : + Continuous (eval k a) := by + exact continuous_finsetSum _ (fun i _ => continuous_const.mul (fourier (k i)).continuous) + + theorem integral_fourier (k : ℤ) : + (∫ t : Time, fourier k t ∂μ) = if k = 0 then 1 else 0 := by + have h := congrFun (fourierCoeff_fourier (T := (1 : ℝ)) k) 0 + simpa only [fourierCoeff, neg_zero, fourier_zero, one_smul, Pi.single_apply, + eq_comm (a := (0 : ℤ))] using h + + theorem integrable_continuous {G : Type u91} [NormedAddCommGroup G] + {f : Time → G} (hf : Continuous f) : Integrable f μ := by + simpa only [integrableOn_univ] using hf.continuousOn.integrableOn_compact isCompact_univ + + theorem integral_conj_fourier_mul (k l : ℤ) : + (∫ t : Time, conj (fourier k t) * fourier l t ∂μ) = if k = l then 1 else 0 := by + simp_rw [← fourier_neg, ← fourier_add] + rw [integral_fourier] + simp only [neg_add_eq_zero] + + theorem integral_conj_eval_mul {ι : Type u92} {κ : Type u93} [Fintype ι] [Fintype κ] + (k : ι → ℤ) (l : κ → ℤ) (a : ι → ℂ) (b : κ → ℂ) : + (∫ t : Time, conj (eval k a t) * eval l b t ∂μ) = + ∑ i, ∑ j, if k i = l j then conj (a i) * b j else 0 := by + classical + have he (t : Time) : conj (eval k a t) * eval l b t = + ∑ i, ∑ j, conj (a i)*conj (fourier (k i) t)*(b j*fourier (l j) t) := by + change conj (∑ i, a i*fourier (k i) t) * eval l b t = _ + rw [map_sum, Finset.sum_mul] + simp only [map_mul, eval, Finset.mul_sum] + simp_rw [he] + rw [integral_finsetSum] + · apply Finset.sum_congr rfl + intro i _ + rw [integral_finsetSum] + · apply Finset.sum_congr rfl + intro j _ + simp_rw [show ∀ t : Time, conj (a i) * conj (fourier (k i) t) * + (b j * fourier (l j) t) = + (conj (a i)*b j) * (conj (fourier (k i) t)*fourier (l j) t) by intro t; ring] + rw [integral_const_mul, integral_conj_fourier_mul] + split_ifs <;> simp + · intro j _ + exact integrable_continuous ((continuous_const.mul ((fourier (k i)).continuous.star)).mul + (continuous_const.mul (fourier (l j)).continuous)) + · intro i _ + apply integrable_finsetSum + intro j _ + exact integrable_continuous ((continuous_const.mul ((fourier (k i)).continuous.star)).mul + (continuous_const.mul (fourier (l j)).continuous)) + + theorem norm_sq_re (z : ℂ) : ‖z‖^2 = (conj z*z).re := by + simp [Complex.sq_norm, Complex.normSq_apply, Complex.mul_re] + + theorem integral_norm_sq {ι : Type u94} [Fintype ι] (k : ι → ℤ) (hk : Function.Injective k) + (a : ι → ℂ) : (∫ t : Time, ‖eval k a t‖^2 ∂μ) = ∑ i, ‖a i‖^2 := by + classical + simp_rw [norm_sq_re] + have hI : Integrable (fun t : Time => conj (eval k a t) * eval k a t) μ := + integrable_continuous ((continuous_eval k a).star.mul (continuous_eval k a)) + change (∫ t : Time, RCLike.re (conj (eval k a t)*eval k a t) ∂μ) = _ + rw [integral_re hI, integral_conj_eval_mul] + simp only [hk.eq_iff] + simp + + theorem coe_integral_norm_fourth {ι : Type u95} [Fintype ι] (k : ι → ℤ) (a : ι → ℂ) : + (((∫ t : Time, ‖eval k a t‖^4 ∂μ) : ℝ) : ℂ) = + ∑ p : ι × ι, ∑ q : ι × ι, + if k p.1+k p.2 = k q.1+k q.2 then conj (a p.1*a p.2)*(a q.1*a q.2) else 0 := by + let k' : ι × ι → ℤ := fun p => k p.1+k p.2 + let a' : ι × ι → ℂ := fun p => a p.1*a p.2 + have heval (t : Time) : eval k' a' t = eval k a t * eval k a t := by + simp only [eval, k', a', Fintype.sum_prod_type, fourier_add, Finset.sum_mul, Finset.mul_sum] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + ring + have hintegrand (t : Time) : (↑(‖eval k a t‖^4) : ℂ) = + conj (eval k' a' t)*eval k' a' t := by + rw [heval, map_mul, mul_mul_mul_comm, ← Complex.normSq_eq_conj_mul_self, + ← Complex.sq_norm] + push_cast + ring + rw [← integral_complex_ofReal] + simp_rw [hintegrand] + exact integral_conj_eval_mul k' k' a' a' + +end +end FourierPolynomial + +namespace WeightedSchur +noncomputable section +open Finset + + theorem two_mul_le_weighted {w v : ℝ} (hw : 0 < w) (hv : 0 < v) (x y : ℝ) : + 2*x*y ≤ w*x^2/v + v*y^2/w := by + rw [div_add_div _ _ hv.ne' hw.ne', le_div_iff₀ (mul_pos hv hw)] + nlinarith [sq_nonneg (w*x-v*y)] + + theorem sum_le {ι : Type u96} [Fintype ι] (r : ι → ι → Prop) [DecidableRel r] + (hr : ∀ {i j}, r i j → r j i) (w : ι → ℝ) (hw : ∀ i, 0 < w i) (x : ι → ℝ) + {C : ℝ} (hrow : ∀ i, (∑ j, if r i j then 1/w j else 0) ≤ C) : + (∑ i, ∑ j, if r i j then x i*x j else 0) ≤ C * ∑ i, w i*x i^2 := by + have hp (i j : ι) : 2*(if r i j then x i*x j else 0) ≤ + (if r i j then w i*x i^2/w j else 0) + + (if r j i then w j*x j^2/w i else 0) := by + by_cases hij : r i j + · simp only [ite_eq_left hij, ite_eq_left (hr hij)] + simpa only [mul_assoc] using two_mul_le_weighted (hw i) (hw j) (x i) (x j) + · have hji : ¬r j i := fun h => hij (hr h) + simp only [ite_eq_right hij, ite_eq_right hji, mul_zero, add_zero, le_refl] + have hs := Finset.sum_le_sum (fun i (_ : i ∈ (univ : Finset ι)) => + Finset.sum_le_sum (fun j (_ : j ∈ (univ : Finset ι)) => hp i j)) + simp only [Finset.sum_add_distrib, ← Finset.mul_sum] at hs + have hcomm : (∑ i : ι, ∑ j : ι, if r j i then w j*x j^2/w i else 0) = + ∑ i : ι, ∑ j : ι, if r i j then w i*x i^2/w j else 0 := Finset.sum_comm + rw [hcomm] at hs + have hh : (∑ i : ι, ∑ j : ι, if r i j then w i*x i^2/w j else 0) ≤ + C * ∑ i, w i*x i^2 := by + calc + _ = ∑ i, w i*x i^2 * (∑ j, if r i j then 1/w j else 0) := by + apply Finset.sum_congr rfl + intro i _ + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro j _ + split_ifs <;> ring + _ ≤ ∑ i, w i*x i^2*C := Finset.sum_le_sum (fun i _ => + mul_le_mul_of_nonneg_left (hrow i) (mul_nonneg (hw i).le (sq_nonneg _))) + _ = _ := by rw [← Finset.sum_mul]; ring + linarith + + theorem reciprocal_pair_rows {ι : Type u97} [Fintype ι] (k : ι → ℕ) + (hk : Function.Injective k) (hk0 : ∀ i, 0 < k i) (p : ι × ι) : + (∑ q : ι × ι, if k p.1+k p.2 = k q.1+k q.2 then + 1 / ((k q.1 : ℝ)*(k q.2 : ℝ)) else 0) ≤ 1 := by + classical + let m := k p.1+k p.2 + have hm : 2 ≤ m := by dsimp [m]; have := hk0 p.1; have := hk0 p.2; omega + let Q := univ.filter (fun q : ι × ι => k q.1+k q.2 = m) + have hQ (q : ι × ι) : q ∈ Q ↔ k q.1+k q.2 = m := by simp [Q] + have hmaps : Set.MapsTo (fun q : ι × ι => k q.1) (↑Q : Set (ι × ι)) + (↑(Icc 1 (m-1)) : Set ℕ) := by + intro q hq + have he := (hQ q).mp hq + have h0 := hk0 q.1 + have h1 := hk0 q.2 + simp only [mem_coe, mem_Icc] + omega + have hinj : Set.InjOn (fun q : ι × ι => k q.1) (↑Q : Set (ι × ι)) := by + intro q hq z hz he + change k q.1 = k z.1 at he + have hq' := (hQ q).mp hq + have hz' := (hQ z).mp hz + apply Prod.ext (hk he) + apply hk + omega + have hc : Q.card ≤ m-1 := by + have hc' := Finset.card_le_card_of_injOn (fun q : ι × ι => k q.1) hmaps hinj + simpa only [Nat.card_Icc, Nat.add_sub_cancel] using hc' + have hd : 0 < (m : ℝ)-1 := by + have hmR : (2 : ℝ) ≤ m := by exact_mod_cast hm + linarith + have hterm (q : ι × ι) (hq : q ∈ Q) : + 1/((k q.1 : ℝ)*(k q.2 : ℝ)) ≤ 1/((m : ℝ)-1) := by + apply one_div_le_one_div_of_le hd + have h0 : 1 ≤ (k q.1 : ℝ) := by exact_mod_cast (show 1 ≤ k q.1 from hk0 q.1) + have h1 : 1 ≤ (k q.2 : ℝ) := by exact_mod_cast (show 1 ≤ k q.2 from hk0 q.2) + have he : (k q.1 : ℝ)+(k q.2 : ℝ) = m := by exact_mod_cast (hQ q).mp hq + nlinarith [mul_nonneg (sub_nonneg.mpr h0) (sub_nonneg.mpr h1)] + calc + _ = ∑ q ∈ Q, 1/((k q.1 : ℝ)*(k q.2 : ℝ)) := by + rw [Finset.sum_filter] + apply Finset.sum_congr rfl + intro q _ + simp only [m, eq_comm (a := k q.1+k q.2)] + _ ≤ ∑ _q ∈ Q, 1/((m : ℝ)-1) := Finset.sum_le_sum hterm + _ = (Q.card : ℝ)/((m : ℝ)-1) := by simp [div_eq_mul_inv] + _ ≤ 1 := by + rw [div_le_one hd] + have hcR : (Q.card : ℝ) ≤ (m-1 : ℕ) := by exact_mod_cast hc + rw [Nat.cast_sub (by omega : 1 ≤ m), Nat.cast_one] at hcR + exact hcR + +end +end WeightedSchur + +namespace FourierPolynomial +noncomputable section +open MeasureTheory AddCircle Finset +open scoped ComplexConjugate +local instance : Fact (0 < (1 : ℝ)) := ⟨zero_lt_one⟩ + + theorem integral_norm_fourth_le_pairs {ι : Type u98} [Fintype ι] (k : ι → ℤ) (a : ι → ℂ) : + (∫ t : Time, ‖eval k a t‖^4 ∂μ) ≤ + ∑ p : ι × ι, ∑ q : ι × ι, + if k p.1+k p.2 = k q.1+k q.2 then + (‖a p.1‖*‖a p.2‖)*(‖a q.1‖*‖a q.2‖) else 0 := by + classical + have hI : 0 ≤ ∫ t : Time, ‖eval k a t‖^4 ∂μ := integral_nonneg (fun _ => by positivity) + calc + _ = ‖(((∫ t : Time, ‖eval k a t‖^4 ∂μ) : ℝ) : ℂ)‖ := by + rw [Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hI] + _ = ‖∑ p : ι × ι, ∑ q : ι × ι, + if k p.1+k p.2 = k q.1+k q.2 then conj (a p.1*a p.2)*(a q.1*a q.2) else 0‖ := + congrArg norm (coe_integral_norm_fourth k a) + _ ≤ ∑ p : ι × ι, ∑ q : ι × ι, + ‖if k p.1+k p.2 = k q.1+k q.2 then conj (a p.1*a p.2)*(a q.1*a q.2) else 0‖ := + (norm_sum_le _ _).trans (Finset.sum_le_sum (fun _ _ => norm_sum_le _ _)) + _ = _ := by + apply Finset.sum_congr rfl + intro p _ + apply Finset.sum_congr rfl + intro q _ + split_ifs <;> simp only [norm_mul, Complex.norm_conj, norm_zero] + + theorem positive_L4 {ι : Type u99} [Fintype ι] (k : ι → ℕ) + (hk : Function.Injective k) (hk0 : ∀ i, 0 < k i) (a : ι → ℂ) : + (∫ t : Time, ‖eval (fun i => (k i : ℤ)) a t‖^4 ∂μ) ≤ + (∑ i, (k i : ℝ)*‖a i‖^2)^2 := by + classical + have hrows := WeightedSchur.reciprocal_pair_rows k hk hk0 + let w : ι × ι → ℝ := fun p => (k p.1 : ℝ)*(k p.2 : ℝ) + have hw (p : ι × ι) : 0 < w p := by + exact mul_pos (by exact_mod_cast hk0 p.1) (by exact_mod_cast hk0 p.2) + have hS := WeightedSchur.sum_le + (fun p q : ι × ι => k p.1+k p.2 = k q.1+k q.2) + (fun h => h.symm) w hw (fun p => ‖a p.1‖*‖a p.2‖) hrows + have hpair := integral_norm_fourth_le_pairs (fun i => (k i : ℤ)) a + simp only [← Nat.cast_add, Int.natCast_inj] at hpair + apply hpair.trans + apply (hS.trans_eq _) + simp only [one_mul, Fintype.sum_prod_type, w] + calc + _ = ∑ i, ∑ j, ((k i : ℝ)*‖a i‖^2)*((k j : ℝ)*‖a j‖^2) := by + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + ring + _ = _ := by rw [← Finset.sum_mul_sum]; ring + +end +end FourierPolynomial + +end NonsqueezingInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/FourierPaths.lean b/lean/OAI/Geometry/PolarProducts/FourierPaths.lean new file mode 100644 index 0000000000000000000000000000000000000000..b093fd77de79985855e256ac6a3e4a437b31ac93 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/FourierPaths.lean @@ -0,0 +1,328 @@ +import OAI.Geometry.PolarProducts.FourierIntegrals + +namespace OAI + +universe u100 u101 u102 u103 u104 u105 u106 u107 u108 u109 u110 u111 + +section NonsqueezingInline + +namespace FourierPolynomial +noncomputable section +open MeasureTheory AddCircle Finset +open scoped ComplexConjugate ContDiff +local instance : Fact (0 < (1 : ℝ)) := ⟨zero_lt_one⟩ + theorem real_inner_eq_complex_re {α : Type u100} [Fintype α] (a b : EuclideanSpace ℂ α) : + inner (𝕜 := ℝ) a b = RCLike.re (inner (𝕜 := ℂ) a b) := by + simp only [PiLp.inner_apply, real_inner_eq_re_inner, map_sum] + +variable {ι : Type u101} {κ : Type u102} [Fintype ι] [Fintype κ] + +abbrev Vector (κ : Type u103) := EuclideanSpace ℂ κ +abbrev Coeff (ι : Type u104) (κ : Type u105) := EuclideanSpace ℂ (ι × κ) + +def mode (a : Coeff ι κ) (i : ι) : Vector κ := + (EuclideanSpace.equiv κ ℂ).symm (fun j => a (i,j)) + +omit [Fintype ι] [Fintype κ] in +@[simp] theorem mode_apply (a : Coeff ι κ) (i : ι) (j : κ) : mode a i j = a (i,j) := rfl + +def loop (k : ι → ℤ) (a : Coeff ι κ) : C(Time, Vector κ) where + toFun t := ∑ i, fourier (k i) t • mode a i + continuous_toFun := continuous_finsetSum _ (fun i _ => + (fourier (k i)).continuous.smul continuous_const) + +@[simp] theorem loop_apply (k : ι → ℤ) (a : Coeff ι κ) (t : Time) : + loop k a t = ∑ i, fourier (k i) t • mode a i := rfl + + theorem loop_coord (k : ι → ℤ) (a : Coeff ι κ) (t : Time) (j : κ) : + loop k a t j = eval k (fun i => a (i,j)) t := by + simp [loop_apply, eval, mul_comm] + + def loopCLM (k : ι → ℤ) : Coeff ι κ →L[ℝ] C(Time, Vector κ) := + LinearMap.toContinuousLinearMap { + toFun := loop k + map_add' := by + intro a b + ext t j + simp only [ContinuousMap.add_apply, PiLp.add_apply, loop_coord, eval, + add_mul, Finset.sum_add_distrib] + map_smul' := by + intro r a + ext t j + simp only [ContinuousMap.smul_apply, PiLp.smul_apply, loop_coord, eval, + RingHom.id_apply, RCLike.real_smul_eq_coe_mul, mul_assoc, ← Finset.mul_sum] } + +@[simp] theorem loopCLM_apply (k : ι → ℤ) (a : Coeff ι κ) : loopCLM k a = loop k a := rfl + + theorem integral_loop_norm_sq (k : ι → ℤ) (hk : Function.Injective k) (a : Coeff ι κ) : + (∫ t : Time, ‖loop k a t‖^2 ∂μ) = ‖a‖^2 := by + classical + simp_rw [EuclideanSpace.norm_sq_eq, loop_coord] + rw [integral_finsetSum] + · simp_rw [integral_norm_sq k hk] + rw [Finset.sum_comm, Fintype.sum_prod_type] + · intro j _ + exact integrable_continuous ((continuous_eval k _).norm.pow 2) + + theorem integral_loop_coord_sq (k : ι → ℤ) (hk : Function.Injective k) + (a : Coeff ι κ) (j : κ) : + (∫ t : Time, ‖loop k a t j‖^2 ∂μ) = ∑ i, ‖a (i,j)‖^2 := by + simp_rw [loop_coord] + exact integral_norm_sq k hk _ + +end +end FourierPolynomial + +namespace FourierPolynomial +noncomputable section +open MeasureTheory AddCircle Finset +open scoped ComplexConjugate ContDiff +local instance : Fact (0 < (1 : ℝ)) := ⟨zero_lt_one⟩ +variable {ι : Type u106} {κ : Type u107} [Fintype ι] [Fintype κ] + + theorem vector_norm_fourth_le (z : Vector κ) : + ‖z‖^4 ≤ (Fintype.card κ : ℝ) * ∑ j, ‖z j‖^4 := by + have h := Finset.sum_mul_sq_le_sq_mul_sq (univ : Finset κ) + (fun j => ‖z j‖^2) (fun _ => (1 : ℝ)) + simp only [mul_one, one_pow, sum_const, card_univ, nsmul_eq_mul, mul_one, ← pow_mul] at h + calc + _ = (∑ j, ‖z j‖^2)^2 := by rw [← EuclideanSpace.norm_sq_eq]; ring + _ ≤ _ := by simpa only [mul_comm] using h + + theorem integral_loop_norm_fourth_le (k : ι → ℕ) + (hk : Function.Injective k) (hk0 : ∀ i, 0 < k i) (a : Coeff ι κ) : + (∫ t : Time, ‖loop (fun i => (k i : ℤ)) a t‖^4 ∂μ) ≤ + (Fintype.card κ : ℝ) * (∑ p : ι × κ, (k p.1 : ℝ)*‖a p‖^2)^2 := by + classical + let L := loop (fun i => (k i : ℤ)) a + have hcont : Continuous (fun t : Time => (Fintype.card κ : ℝ)*∑ j, ‖L t j‖^4) := + continuous_const.mul (continuous_finsetSum _ (fun j _ => + (((PiLp.continuous_apply 2 _ j).comp L.continuous).norm.pow 4))) + calc + _ ≤ ∫ t : Time, (Fintype.card κ : ℝ)*∑ j, ‖L t j‖^4 ∂μ := + integral_mono (integrable_continuous (L.continuous.norm.pow 4)) + (integrable_continuous hcont) (fun t => vector_norm_fourth_le (L t)) + _ = (Fintype.card κ : ℝ)*∑ j, ∫ t : Time, ‖L t j‖^4 ∂μ := by + rw [integral_const_mul, integral_finsetSum] + intro j _ + exact integrable_continuous (((PiLp.continuous_apply 2 _ j).comp L.continuous).norm.pow 4) + _ ≤ (Fintype.card κ : ℝ)*∑ j, (∑ i, (k i : ℝ)*‖a (i,j)‖^2)^2 := by + apply mul_le_mul_of_nonneg_left _ (Nat.cast_nonneg _) + apply Finset.sum_le_sum + intro j _ + simp only [L, loop_coord] + exact positive_L4 k hk hk0 _ + _ ≤ (Fintype.card κ : ℝ)*(∑ j, ∑ i, (k i : ℝ)*‖a (i,j)‖^2)^2 := by + apply mul_le_mul_of_nonneg_left _ (Nat.cast_nonneg _) + exact Finset.sum_sq_le_sq_sum_of_nonneg (fun j _ => + Finset.sum_nonneg (fun i _ => mul_nonneg (Nat.cast_nonneg _) (sq_nonneg _))) + _ = _ := by rw [Finset.sum_comm, Fintype.sum_prod_type] + +end +end FourierPolynomial + +namespace FourierPolynomial +noncomputable section +open MeasureTheory AddCircle Finset +open scoped ComplexConjugate ContDiff +local instance : Fact (0 < (1 : ℝ)) := ⟨zero_lt_one⟩ +variable {ι : Type u108} {κ : Type u109} [Fintype ι] [Fintype κ] + + theorem fourierCoeff_eval (k : ι → ℤ) (a : ι → ℂ) (j : ℤ) : + fourierCoeff (eval k a) j = ∑ i, if j = k i then a i else 0 := by + classical + simp only [fourierCoeff, eval, smul_eq_mul, Finset.mul_sum] + rw [integral_finsetSum] + · apply Finset.sum_congr rfl + intro i _ + have he (t : Time) : fourier (-j) t * (a i * fourier (k i) t) = + a i*(conj (fourier j t)*fourier (k i) t) := by rw [fourier_neg]; ring + simp_rw [he] + rw [integral_const_mul, integral_conj_fourier_mul] + split_ifs <;> simp only [mul_one, mul_zero] + · intro i _ + exact integrable_continuous ((fourier (-j)).continuous.mul + (continuous_const.mul (fourier (k i)).continuous)) + + def project (k : ι → ℤ) (f : C(Time, Vector κ)) : Coeff ι κ := + (EuclideanSpace.equiv (ι × κ) ℂ).symm (fun p => fourierCoeff (fun t => f t p.2) (k p.1)) + +omit [Fintype ι] [Fintype κ] in +@[simp] theorem project_apply (k : ι → ℤ) (f : C(Time, Vector κ)) (p : ι × κ) : + project k f p = fourierCoeff (fun t => f t p.2) (k p.1) := rfl + + theorem project_loop (k : ι → ℤ) (hk : Function.Injective k) (a : Coeff ι κ) : + project k (loop k a) = a := by + classical + ext p + simp only [project_apply, loop_coord, fourierCoeff_eval, hk.eq_iff] + simp + + theorem integral_fourier_mul_conj (k : ℤ) (f : C(Time, ℂ)) : + (∫ t : Time, conj (f t) * fourier k t ∂μ) = conj (fourierCoeff f k) := by + rw [fourierCoeff, ← integral_conj] + apply integral_congr_ae + filter_upwards [] with t + simp only [smul_eq_mul, map_mul, fourier_neg, starRingEnd_self_apply] + ring + + theorem integral_inner_loop (k : ι → ℤ) (f : C(Time, Vector κ)) (a : Coeff ι κ) : + (∫ t : Time, inner (𝕜 := ℝ) (f t) (loop k a t) ∂μ) = + inner (𝕜 := ℝ) (project k f) a := by + classical + have hstage (j : κ) : + (∫ t : Time, conj (f t j)*eval k (fun i => a (i,j)) t ∂μ) = + ∑ i, conj (project k f (i,j))*a (i,j) := by + simp only [eval, Finset.mul_sum] + rw [integral_finsetSum] + · apply Finset.sum_congr rfl + intro i _ + have he (t : Time) : conj (f t j) * (a (i,j) * fourier (k i) t) = + (conj (f t j) * fourier (k i) t) * a (i,j) := by ring + simp_rw [he] + rw [integral_mul_const] + exact congrArg (fun z => z*a (i,j)) + (integral_fourier_mul_conj (k i) + ⟨fun t => f t j, (PiLp.continuous_apply 2 _ j).comp f.continuous⟩) + · intro i _ + exact integrable_continuous + ((((PiLp.continuous_apply 2 _ j).comp f.continuous).star).mul + (continuous_const.mul (fourier (k i)).continuous)) + have hcomplex : (∫ t : Time, inner (𝕜 := ℂ) (f t) (loop k a t) ∂μ) = + inner (𝕜 := ℂ) (project k f) a := by + change (∫ t : Time, ∑ j, loop k a t j * conj (f t j) ∂μ) = + ∑ p : ι × κ, a p * conj (project k f p) + simp_rw [loop_coord, mul_comm (eval k _ _)] + rw [integral_finsetSum] + · simp_rw [hstage] + rw [Fintype.sum_prod_type, Finset.sum_comm] + congr 1 + ext j + apply Finset.sum_congr rfl + intro i _ + ring + · intro j _ + exact integrable_continuous + ((((PiLp.continuous_apply 2 _ j).comp f.continuous).star).mul + (continuous_eval k _)) + simp only [real_inner_eq_complex_re] + rw [integral_re (integrable_continuous + (show Continuous (fun t => inner (𝕜 := ℂ) (f t) (loop k a t)) from + f.continuous.inner (loop k a).continuous)), hcomplex] + +end +end FourierPolynomial + +namespace FourierPolynomial +noncomputable section +open MeasureTheory AddCircle Finset +open scoped ComplexConjugate ContDiff +local instance : Fact (0 < (1 : ℝ)) := ⟨zero_lt_one⟩ +variable {ι : Type u110} {κ : Type u111} [Fintype ι] [Fintype κ] + + theorem project_bessel (k : ι → ℤ) (hk : Function.Injective k) (f : C(Time, Vector κ)) : + ‖project k f‖^2 ≤ ∫ t : Time, ‖f t‖^2 ∂μ := by + let a := project k f + have hnon : 0 ≤ ∫ t : Time, ‖f t-loop k a t‖^2 ∂μ := + integral_nonneg (fun _ => sq_nonneg _) + have h1 : Integrable (fun t : Time => ‖f t‖^2) μ := + integrable_continuous (f.continuous.norm.pow 2) + have h2 : Integrable (fun t : Time => inner (𝕜 := ℝ) (f t) (loop k a t)) μ := + integrable_continuous (f.continuous.inner (loop k a).continuous) + have h3 : Integrable (fun t : Time => ‖loop k a t‖^2) μ := + integrable_continuous ((loop k a).continuous.norm.pow 2) + simp_rw [norm_sub_sq_real] at hnon + rw [integral_add, integral_sub, integral_const_mul, + integral_inner_loop, integral_loop_norm_sq k hk, real_inner_self_eq_norm_sq] at hnon + rotate_left + · exact h1 + · exact h2.const_mul 2 + · exact h1.sub (h2.const_mul 2) + · exact h3 + dsimp [a] at * + linarith + + theorem project_bounded (k : ι → ℤ) (hk : Function.Injective k) + (f : C(Time, Vector κ)) {B : ℝ} (hB : 0 ≤ B) (hf : ∀ t, ‖f t‖ ≤ B) : + ‖project k f‖ ≤ B := by + have hi : (∫ t : Time, ‖f t‖^2 ∂μ) ≤ B^2 := by + calc + _ ≤ ∫ _ : Time, B^2 ∂μ := integral_mono + (integrable_continuous (f.continuous.norm.pow 2)) (integrable_const _) (fun t => + pow_le_pow_left₀ (norm_nonneg _) (hf t) 2) + _ = _ := by simp + have h := (project_bessel k hk f).trans hi + nlinarith [norm_nonneg (project k f)] + +end +end FourierPolynomial + +namespace FourierPolynomial +noncomputable section +open MeasureTheory AddCircle Finset +open scoped ComplexConjugate ContDiff +local instance : Fact (0 < (1 : ℝ)) := ⟨zero_lt_one⟩ +variable {ι κ : Type} [Fintype ι] [Fintype κ] + + def average : C(Time, ℝ) →L[ℝ] ℝ := by + let L : C(Time, ℝ) →ₗ[ℝ] ℝ := { + toFun := fun f => ∫ t : Time, f t ∂μ + map_add' := fun f g => integral_add (integrable_continuous f.continuous) + (integrable_continuous g.continuous) + map_smul' := fun r f => by simp only [ContinuousMap.smul_apply, + integral_smul, RingHom.id_apply] } + apply L.mkContinuous 1 + intro f + change ‖∫ t : Time, f t ∂μ‖ ≤ 1*‖f‖ + simpa using norm_integral_le_of_norm_le_const (μ := μ) + (Filter.Eventually.of_forall (fun t => f.norm_coe_le_norm t)) + +@[simp] theorem average_apply (f : C(Time, ℝ)) : average f = ∫ t : Time, f t ∂μ := rfl + + def potential (k : ι → ℤ) (H : Vector κ → ℝ) (a : Coeff ι κ) : ℝ := + ∫ t : Time, H (loop k a t) ∂μ + + theorem contDiff_potential (k : ι → ℤ) {H : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) : + ContDiff ℝ ∞ (potential k H) := by + exact average.contDiff.comp ((SmoothPaths.contDiff_superpose hH).comp (loopCLM k).contDiff) + + theorem contDiff_gradient_function {H : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) : + ContDiff ℝ ∞ (gradient H) := + (InnerProductSpace.toDual ℝ _).symm.toContinuousLinearEquiv.contDiff.comp + (hH.fderiv_right (by simp)) + + def gradLoop (k : ι → ℤ) {H : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) (a : Coeff ι κ) : + C(Time, Vector κ) := + ⟨fun t => gradient H (loop k a t), (contDiff_gradient_function hH).continuous.comp + (loop k a).continuous⟩ + + theorem hasGradientAt_potential (k : ι → ℤ) {H : Vector κ → ℝ} + (hH : ContDiff ℝ ∞ H) (a : Coeff ι κ) : + HasGradientAt (potential k H) (project k (gradLoop k hH a)) a := by + have hl : HasFDerivAt (loop k) (loopCLM k) a := by + change HasFDerivAt (loopCLM k) (loopCLM k) a + exact (loopCLM (κ := κ) k).hasFDerivAt (x := a) + have hS := (SmoothPaths.hasFDerivAt_superpose + (hH.differentiable (by simp)) (hH.fderiv_right (m := ∞) (by simp)).continuous (loop k a)).comp + a hl + have hi := average.hasFDerivAt.comp a hS + rw [hasGradientAt_iff_hasFDerivAt] + change HasFDerivAt (potential k H) _ a at hi + apply hi.congr_fderiv + ext b + change (∫ t : Time, fderiv ℝ H (loop k a t) (loop k b t) ∂μ) = + inner (𝕜 := ℝ) (project k (gradLoop k hH a)) b + simp_rw [← inner_gradient_left] + exact integral_inner_loop k (gradLoop k hH a) b + + theorem gradient_potential (k : ι → ℤ) {H : Vector κ → ℝ} + (hH : ContDiff ℝ ∞ H) (a : Coeff ι κ) : + gradient (potential k H) a = project k (gradLoop k hH a) := + (hasGradientAt_potential k hH a).gradient + +end +end FourierPolynomial + +end NonsqueezingInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/GalerkinBounds.lean b/lean/OAI/Geometry/PolarProducts/GalerkinBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..dbaa5092242a6c0a684d473a07aa3e4d1e499fd0 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/GalerkinBounds.lean @@ -0,0 +1,415 @@ +import OAI.Geometry.PolarProducts.QuadraticAction + +namespace OAI + +universe u113 + +section NonsqueezingInline + +namespace FourierPolynomial +noncomputable section +open MeasureTheory AddCircle Finset +open scoped ComplexConjugate ContDiff +local instance : Fact (0 < (1 : ℝ)) := ⟨zero_lt_one⟩ +variable {ι ν κ : Type} [Fintype ι] [Fintype ν] [Fintype κ] +open DiagonalQuadratic + + def leftCoeff (a : Coeff (ι ⊕ ν) κ) : Coeff ι κ := + (EuclideanSpace.equiv (ι × κ) ℂ).symm (fun p => a (Sum.inl p.1,p.2)) + + def rightCoeff (a : Coeff (ι ⊕ ν) κ) : Coeff ν κ := + (EuclideanSpace.equiv (ν × κ) ℂ).symm (fun p => a (Sum.inr p.1,p.2)) + + def joinCoeff (a : Coeff ι κ) (b : Coeff ν κ) : Coeff (ι ⊕ ν) κ := + (EuclideanSpace.equiv ((ι ⊕ ν) × κ) ℂ).symm (fun p => Sum.elim + (fun i => a (i,p.2)) (fun j => b (j,p.2)) p.1) + +omit [Fintype ι] [Fintype ν] [Fintype κ] in +@[simp] theorem leftCoeff_apply (a : Coeff (ι ⊕ ν) κ) (p : ι × κ) : + leftCoeff a p = a (Sum.inl p.1,p.2) := rfl +omit [Fintype ι] [Fintype ν] [Fintype κ] in +@[simp] theorem rightCoeff_apply (a : Coeff (ι ⊕ ν) κ) (p : ν × κ) : + rightCoeff a p = a (Sum.inr p.1,p.2) := rfl +omit [Fintype ι] [Fintype ν] [Fintype κ] in +@[simp] theorem joinCoeff_inl (a : Coeff ι κ) (b : Coeff ν κ) (i : ι) (j : κ) : + joinCoeff a b (Sum.inl i,j) = a (i,j) := rfl +omit [Fintype ι] [Fintype ν] [Fintype κ] in +@[simp] theorem joinCoeff_inr (a : Coeff ι κ) (b : Coeff ν κ) (i : ν) (j : κ) : + joinCoeff a b (Sum.inr i,j) = b (i,j) := rfl + + theorem norm_joinCoeff_sq (a : Coeff ι κ) (b : Coeff ν κ) : + ‖joinCoeff a b‖^2 = ‖a‖^2+‖b‖^2 := by + simp only [EuclideanSpace.norm_sq_eq, Fintype.sum_prod_type, Fintype.sum_sum_type, + joinCoeff_inl, joinCoeff_inr] + + theorem energy_joinCoeff (w : (ι ⊕ ν) × κ → ℝ) (a : Coeff ι κ) (b : Coeff ν κ) : + energy w (joinCoeff a b) = energy (fun p => w (Sum.inl p.1,p.2)) a + + energy (fun p => w (Sum.inr p.1,p.2)) b := by + simp only [energy, Fintype.sum_prod_type, Fintype.sum_sum_type, + joinCoeff_inl, joinCoeff_inr] + + theorem loop_joinCoeff (k : ι → ℤ) (l : ν → ℤ) (a : Coeff ι κ) (b : Coeff ν κ) : + loop (Sum.elim k l) (joinCoeff a b) = loop k a + loop l b := by + ext t j + simp only [ContinuousMap.add_apply, PiLp.add_apply, loop_coord, eval, + Fintype.sum_sum_type, Sum.elim_inl, Sum.elim_inr, joinCoeff_inl, joinCoeff_inr] + + def splitEquiv (d : ν → ℝ) (hd : ∀ i, d i ≠ 0) : + Coeff (ι ⊕ ν) κ ≃L[ℝ] Coeff ι κ × Coeff ν κ := + LinearEquiv.toContinuousLinearEquiv { + toFun := fun a => (leftCoeff a, diag (fun p => d p.1) (rightCoeff a)) + invFun := fun p => joinCoeff p.1 (diag (fun q => (d q.1)⁻¹) p.2) + left_inv := by + intro a + ext ⟨i,j⟩ + cases i with + | inl i => rfl + | inr i => simp [hd i] + right_inv := by + intro ⟨a,b⟩ + ext p + · rfl + · simp [hd p.1] + map_add' := by + intro a b + ext p + · rfl + · simp [smul_add] + map_smul' := by + intro r a + ext p + · rfl + · simp + ring } + + theorem splitEquiv_symm (d : ν → ℝ) (hd : ∀ i, d i ≠ 0) + (a : Coeff ι κ) (b : Coeff ν κ) : + (splitEquiv d hd).symm (a,b) = joinCoeff a (diag (fun q => (d q.1)⁻¹) b) := rfl + + def positiveScale (k : ν → ℕ) (hk : ∀ i, 0 < k i) : + Coeff (ι ⊕ ν) κ ≃L[ℝ] Coeff ι κ × Coeff ν κ := + splitEquiv (fun i => Real.sqrt (k i : ℝ)) (fun i => + (Real.sqrt_pos.2 (by exact_mod_cast hk i)).ne') + + theorem energy_scaled (k : ν → ℕ) (hk : ∀ i, 0 < k i) (b : Coeff ν κ) : + energy (fun p => (k p.1 : ℝ)) + (diag (fun p => (Real.sqrt (k p.1 : ℝ))⁻¹) b) = ‖b‖^2 := by + classical + simp only [energy, EuclideanSpace.norm_sq_eq] + apply sum_congr rfl + intro p _ + have hp : 0 < (k p.1 : ℝ) := by exact_mod_cast hk p.1 + rw [diag_apply, norm_smul, Real.norm_eq_abs, abs_inv, abs_of_nonneg (Real.sqrt_nonneg _), + mul_pow, inv_pow, Real.sq_sqrt hp.le] + field_simp + +end +end FourierPolynomial + +namespace FourierPolynomial +noncomputable section +open MeasureTheory AddCircle Finset +open scoped ComplexConjugate ContDiff +local instance : Fact (0 < (1 : ℝ)) := ⟨zero_lt_one⟩ +variable {ι ν κ : Type} [Fintype ι] [Fintype ν] [Fintype κ] +open DiagonalQuadratic + + theorem action_positive_lower (k : ι → ℤ) (l : ν → ℕ) + (hl : Function.Injective l) (hl0 : ∀ i, 0 < l i) + {H : Vector κ → ℝ} (hH : Continuous H) {C : ℝ} (hC : 0 ≤ C) + (hup : ∀ z, H z ≤ C*‖z‖^4) (b : Coeff ν κ) : + Real.pi*‖b‖^2-C*(Fintype.card κ : ℝ)*‖b‖^4 ≤ + action (Sum.elim k (fun i => (l i : ℤ))) H ((positiveScale l hl0).symm (0,b)) := by + let v := diag (fun p : ν × κ => (Real.sqrt (l p.1 : ℝ))⁻¹) b + have hkin : energy (fun p : (ι ⊕ ν) × κ => + Real.pi*((Sum.elim k (fun i => (l i : ℤ)) p.1 : ℤ) : ℝ)) (joinCoeff 0 v) = Real.pi*‖b‖^2 := by + rw [energy_joinCoeff] + simp only [Sum.elim_inl, Sum.elim_inr, Int.cast_natCast] + have hz : energy (fun p : ι × κ => Real.pi*(k p.1 : ℝ)) 0 = 0 := by simp [energy] + rw [hz, zero_add, energy_mul, energy_scaled l hl0] + have hp := potential_upper_fourth l hl hl0 hH hC hup v + change _ ≤ C*(Fintype.card κ : ℝ)*(energy (fun p : ν × κ => (l p.1 : ℝ)) v)^2 at hp + rw [energy_scaled l hl0] at hp + have hlo : potential (Sum.elim k (fun i => (l i : ℤ))) H (joinCoeff 0 v) = + potential (fun i => (l i : ℤ)) H v := by + unfold potential + rw [loop_joinCoeff, loop_zero, zero_add] + change _ ≤ energy _ (joinCoeff 0 v)-potential _ H (joinCoeff 0 v) + rw [hkin, hlo] + nlinarith + + theorem cone_scaled_single [DecidableEq ν] [DecidableEq κ] + (l : ν → ℕ) (hl0 : ∀ i, 0 < l i) (i₀ : ν) (hl1 : l i₀ = 1) (j₀ : κ) + (a : Coeff ι κ) (s : ℝ) : + (positiveScale l hl0).symm (a,s • PiLp.single 2 (i₀,j₀) (1 : ℂ)) = + joinCoeff a (s • PiLp.single 2 (i₀,j₀) (1 : ℂ)) := by + apply congrArg (joinCoeff a) + ext p + simp only [diag_apply, PiLp.smul_apply, PiLp.single_apply] + split_ifs with hp + · subst p + simp [hl1] + · simp + + theorem action_cone_upper [DecidableEq ν] [DecidableEq κ] + (k : ι → ℤ) (hk0 : ∀ i, k i ≤ 0) (l : ν → ℕ) (hl0 : ∀ i, 0 < l i) + (i₀ : ν) (hl1 : l i₀ = 1) (j₀ : κ) + {H : Vector κ → ℝ} (hH : ∀ z, 0 ≤ H z) (a : Coeff ι κ) (s : ℝ) : + action (Sum.elim k (fun i => (l i : ℤ))) H + ((positiveScale l hl0).symm (a,s • PiLp.single 2 (i₀,j₀) (1 : ℂ))) ≤ Real.pi*s^2 := by + rw [cone_scaled_single l hl0 i₀ hl1 j₀] + have hn := energy_nonpos (fun p : ι × κ => Real.pi*(k p.1 : ℝ)) + (fun p => mul_nonpos_of_nonneg_of_nonpos Real.pi_pos.le (by exact_mod_cast hk0 p.1)) a + have hp := potential_nonneg (Sum.elim k (fun i => (l i : ℤ))) hH + (joinCoeff a (s • PiLp.single 2 (i₀,j₀) (1 : ℂ))) + unfold action + rw [energy_joinCoeff] + simp only [Sum.elim_inl, Sum.elim_inr, Int.cast_natCast, energy_smul, + energy_single, hl1, Nat.cast_one, norm_one, one_pow, mul_one] + nlinarith + + theorem action_cone_far [DecidableEq ν] [DecidableEq κ] + (k : ι → ℤ) (hk0 : ∀ i, k i ≤ 0) (l : ν → ℕ) (hl0 : ∀ i, 0 < l i) + (hkl : Function.Injective (Sum.elim k (fun i => (l i : ℤ)))) + (i₀ : ν) (hl1 : l i₀ = 1) (j₀ : κ) + {H : Vector κ → ℝ} (hH : Continuous H) (d : κ → ℝ) (C η : ℝ) + (hd : ∀ j, η ≤ d j) (hd0 : Real.pi+η ≤ d j₀) + (hlo : ∀ z, energy d z-C ≤ H z) (a : Coeff ι κ) (s : ℝ) : + action (Sum.elim k (fun i => (l i : ℤ))) H + ((positiveScale l hl0).symm (a,s • PiLp.single 2 (i₀,j₀) (1 : ℂ))) ≤ + C-η*(‖a‖^2+s^2) := by + rw [cone_scaled_single l hl0 i₀ hl1 j₀] + have hn := energy_nonpos (fun p : ι × κ => Real.pi*(k p.1 : ℝ)) + (fun p => mul_nonpos_of_nonneg_of_nonpos Real.pi_pos.le (by exact_mod_cast hk0 p.1)) a + have hdlo := energy_lower (fun p : ι × κ => d p.2) η (fun p => hd p.2) a + have hp := potential_lower (Sum.elim k (fun i => (l i : ℤ))) hkl hH d C hlo + (joinCoeff a (s • PiLp.single 2 (i₀,j₀) (1 : ℂ))) + unfold action + rw [energy_joinCoeff] + rw [energy_joinCoeff] at hp + simp only [Sum.elim_inl, Sum.elim_inr, Int.cast_natCast, energy_smul, + energy_single, hl1, Nat.cast_one, norm_one, one_pow, mul_one] at hp ⊢ + nlinarith [mul_nonneg (sub_nonneg.mpr hd0) (sq_nonneg s)] + +end +end FourierPolynomial + +namespace FourierPolynomial +noncomputable section +open MeasureTheory AddCircle Finset +open scoped ComplexConjugate ContDiff +local instance : Fact (0 < (1 : ℝ)) := ⟨zero_lt_one⟩ +variable {ι κ : Type} [Fintype ι] [Fintype κ] +open DiagonalQuadratic + + def velocityCoeff (k : ι → ℤ) (a : Coeff ι κ) : Coeff ι κ := + Complex.I • ((2 : ℝ) • diag (fun p => Real.pi*(k p.1 : ℝ)) a) + +omit [Fintype ι] [Fintype κ] in + theorem mode_velocityCoeff (k : ι → ℤ) (a : Coeff ι κ) (i : ι) : + mode (velocityCoeff k a) i = (2*(Real.pi : ℂ)*Complex.I*(k i : ℂ)) • mode a i := by + ext j + simp only [mode_apply, velocityCoeff, PiLp.smul_apply, diag_apply, + RCLike.real_smul_eq_coe_mul, smul_eq_mul] + simp only [map_mul, map_intCast, map_ofNat] + change Complex.I * ((2 : ℂ) * (((Real.pi : ℂ)*(k i : ℂ))*a (i,j))) = + (2*(Real.pi : ℂ)*Complex.I*(k i : ℂ))*a (i,j) + ring + + theorem hasDerivAt_loop (k : ι → ℤ) (a : Coeff ι κ) (t : ℝ) : + HasDerivAt (fun s : ℝ => loop k a (s : Time)) (loop k (velocityCoeff k a) (t : Time)) t := by + have hs := HasDerivAt.fun_sum (u := univ) (fun i _ => + (hasDerivAt_fourier (1 : ℝ) (k i) t).smul_const (mode a i)) + change HasDerivAt (fun s : ℝ => loop k a (s : Time)) _ t at hs + apply hs.congr_deriv + simp only [loop_apply, mode_velocityCoeff, smul_smul, div_one, Complex.ofReal_one] + apply sum_congr rfl + intro i _ + congr 1 + ring + + theorem norm_velocityCoeff_critical (k : ι → ℤ) {H : Vector κ → ℝ} + (hH : ContDiff ℝ ∞ H) (a : Coeff ι κ) (ha : gradient (action k H) a = 0) : + ‖velocityCoeff k a‖ = ‖project k (gradLoop k hH a)‖ := by + rw [gradient_action k hH, sub_eq_zero] at ha + simp only [velocityCoeff, ha, norm_smul, Complex.norm_I, one_mul] + + theorem norm_project_grad (k : ι → ℤ) (hk : Function.Injective k) + {H : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) (d : κ → ℝ) {B D : ℝ} + (hB : 0 ≤ B) (hD : 0 ≤ D) (hd : ∀ j, |d j| ≤ D) + (hrem : ∀ z, ‖gradient H z-(2 : ℝ) • diag d z‖ ≤ B) (a : Coeff ι κ) : + ‖project k (gradLoop k hH a)‖ ≤ B+2*D*‖a‖ := by + have hb : ‖project k (remainderLoop k hH d a)‖ ≤ B := + project_bounded k hk _ hB (fun t => by rw [remainderLoop_apply]; exact hrem _) + have he : project k (gradLoop k hH a) = project k (remainderLoop k hH d a) + + (2 : ℝ) • diag (fun p => d p.2) a := by + rw [remainderLoop, project_sub, project_loop k hk] + abel + have hn := norm_add_le (project k (remainderLoop k hH d a)) + ((2 : ℝ) • diag (fun p => d p.2) a) + rw [← he, norm_smul, Real.norm_eq_abs, abs_of_pos (by norm_num : (0:ℝ) < 2)] at hn + have hdiag := norm_diag_upper (fun p : ι × κ => d p.2) hD (fun p => hd p.2) a + nlinarith + + theorem intervalIntegral_eq_average {E : Type u113} [NormedAddCommGroup E] [NormedSpace ℝ E] + (f : Time → E) : (∫ t in (0:ℝ)..1, f (t : Time)) = ∫ t : Time, f t ∂μ := by + rw [AddCircle.integral_haarAddCircle] + simpa only [zero_add, inv_one, one_smul] using AddCircle.intervalIntegral_preimage (1 : ℝ) 0 f + + def meanAction {H : Vector κ → ℝ} (_hH : ContDiff ℝ ∞ H) (x : C(Time,Vector κ)) : ℝ := + ∫ t : Time, inner (𝕜 := ℝ) (gradient H (x t)) (x t)/2-H (x t) ∂μ + + theorem contDiff_meanAction {H : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) : + ContDiff ℝ ∞ (meanAction hH) := by + have hg : ContDiff ℝ ∞ (fun z : Vector κ => inner (𝕜 := ℝ) (gradient H z) z/2-H z) := + (((contDiff_gradient_function hH).inner ℝ contDiff_id).div_const 2).sub hH + exact average.contDiff.comp (SmoothPaths.contDiff_superpose hg) + + theorem critical_action_eq (k : ι → ℤ) {H : Vector κ → ℝ} + (hH : ContDiff ℝ ∞ H) (a : Coeff ι κ) (ha : gradient (action k H) a = 0) : + action k H a = meanAction hH (loop k a) := by + have he : (2 : ℝ) • diag (fun p : ι × κ => Real.pi*(k p.1 : ℝ)) a = project k (gradLoop k hH a) := by + simpa only [gradient_action k hH, sub_eq_zero] using ha + have hi := integral_inner_loop k (gradLoop k hH a) a + rw [← he, real_inner_smul_left, ← energy_eq_inner] at hi + have hgi : Integrable (fun t : Time => inner (𝕜 := ℝ) (gradient H (loop k a t)) (loop k a t)) μ := + integrable_continuous ((gradLoop k hH a).continuous.inner (loop k a).continuous) + have hpi : Integrable (fun t : Time => H (loop k a t)) μ := + integrable_continuous (hH.continuous.comp (loop k a).continuous) + unfold meanAction + rw [integral_sub (hgi.div_const 2) hpi, integral_div] + change action k H a = (∫ t : Time, inner (𝕜 := ℝ) (gradLoop k hH a t) (loop k a t) ∂μ)/2-potential k H a + rw [hi] + unfold action + ring + +end +end FourierPolynomial + +namespace FourierPolynomial +noncomputable section +open MeasureTheory AddCircle Finset +open scoped ComplexConjugate ContDiff +local instance : Fact (0 < (1 : ℝ)) := ⟨zero_lt_one⟩ +variable {ι ν κ : Type} [Fintype ι] [Fintype ν] [Fintype κ] +open DiagonalQuadratic + + def linkRadius (κ : Type) [Fintype κ] (M : ℝ) : ℝ := + Real.sqrt (Real.pi/(2*(M*(Fintype.card κ : ℝ)+1))) + + def linkLevel (κ : Type) [Fintype κ] (M : ℝ) : ℝ := + Real.pi/4*(linkRadius κ M)^2 + + theorem linkRadius_pos {M : ℝ} (hM : 0 ≤ M) : 0 < linkRadius κ M := by + unfold linkRadius + apply Real.sqrt_pos.2 + exact div_pos Real.pi_pos (by positivity) + + theorem linkRadius_sq {M : ℝ} (hM : 0 ≤ M) : + (linkRadius κ M)^2 = Real.pi/(2*(M*(Fintype.card κ : ℝ)+1)) := + Real.sq_sqrt (by positivity) + + theorem linkLevel_pos {M : ℝ} (hM : 0 ≤ M) : 0 < linkLevel κ M := by + unfold linkLevel + exact mul_pos (div_pos Real.pi_pos (by norm_num)) (sq_pos_of_pos (linkRadius_pos hM)) + + theorem linkLevel_bound {M : ℝ} (hM : 0 ≤ M) : + 2*linkLevel κ M ≤ Real.pi*(linkRadius κ M)^2- + M*(Fintype.card κ : ℝ)*(linkRadius κ M)^4 := by + have hden : 0 < 2*(M*(Fintype.card κ : ℝ)+1) := by positivity + have he : 2*(M*(Fintype.card κ : ℝ)+1)*(linkRadius κ M)^2 = Real.pi := by + rw [linkRadius_sq hM] + field_simp + have hr : 0 ≤ (linkRadius κ M)^2 := sq_nonneg _ + have hm : M*(Fintype.card κ : ℝ)*(linkRadius κ M)^2 ≤ Real.pi/2 := by nlinarith + have hb := mul_le_mul_of_nonneg_right hm hr + unfold linkLevel + nlinarith + + theorem exists_link_epsilon {a : ℝ} (ha : 0 < a) : + ∃ ε > 0, ∀ s : ℝ, 0 < s → s < ε → Real.pi*s^2 ≤ a/2 := by + let ε := Real.sqrt (a/(2*Real.pi)) + have hε : 0 < ε := Real.sqrt_pos.2 (div_pos ha (by positivity)) + have hεsq : ε^2 = a/(2*Real.pi) := Real.sq_sqrt (by positivity) + refine ⟨ε,hε,fun s hs hse => ?_⟩ + have hs2 : s^2 ≤ ε^2 := pow_le_pow_left₀ hs.le hse.le 2 + have hm := mul_le_mul_of_nonneg_left hs2 Real.pi_pos.le + rw [hεsq] at hm + have hid : Real.pi*(a/(2*Real.pi)) = a/2 := by field_simp + rwa [hid] at hm + + theorem exists_link_far {ρ η : ℝ} (hρ : 0 < ρ) (hη : 0 < η) (C : ℝ) : + ∃ R : ℝ, ρ < R ∧ ∀ u s : ℝ, 0 ≤ u → R ≤ max u |s| → C-η*(u^2+s^2) ≤ 0 := by + let R := max (ρ+1) (max 1 ((|C|+1)/η)) + have hR : ρ < R := lt_of_lt_of_le (by linarith) (le_max_left _ _) + have hR1 : 1 ≤ R := (le_max_left _ _).trans (le_max_right _ _) + have hRc : (|C|+1)/η ≤ R := (le_max_right _ _).trans (le_max_right _ _) + have hReq : |C|+1 ≤ η*R := by + have := (div_le_iff₀ hη).mp hRc + linarith + refine ⟨R,hR,fun u s _ hfar => ?_⟩ + have hsq : R^2 ≤ u^2+s^2 := by + rcases le_max_iff.mp hfar with hy | hss + · have := pow_le_pow_left₀ (by linarith : 0 ≤ R) hy 2 + nlinarith [sq_nonneg s] + · have := pow_le_pow_left₀ (by linarith : 0 ≤ R) hss 2 + rw [sq_abs] at this + nlinarith [sq_nonneg u] + have hh : R ≤ R^2 := by nlinarith + have hm := mul_le_mul_of_nonneg_left (hh.trans hsq) hη.le + linarith [le_abs_self C] + theorem finite_critical [DecidableEq ν] [DecidableEq κ] + (k : ι → ℤ) (hk0 : ∀ i, k i ≤ 0) (l : ν → ℕ) + (hl : Function.Injective l) (hl0 : ∀ i, 0 < l i) + (hkl : Function.Injective (Sum.elim k (fun i => (l i : ℤ)))) + (i₀ : ν) (hl1 : l i₀ = 1) (j₀ : κ) + {H : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) (hH0 : ∀ z, 0 ≤ H z) + (d₀ d : κ → ℝ) {C M η γ B : ℝ} + (hM : 0 ≤ M) (hη : 0 < η) (hγ : 0 < γ) (hB : 0 ≤ B) + (hup : ∀ z, H z ≤ M*‖z‖^4) + (hd : ∀ j, η ≤ d₀ j) (hd0 : Real.pi+η ≤ d₀ j₀) + (hlo : ∀ z, energy d₀ z-C ≤ H z) + (hgap : ∀ i j, γ ≤ |Real.pi*((Sum.elim k (fun i => (l i : ℤ)) i : ℤ) : ℝ)-d j|) + (hrem : ∀ z, ‖gradient H z-(2 : ℝ) • diag d z‖ ≤ B) : + ∃ x : Coeff (ι ⊕ ν) κ, + linkLevel κ M ≤ action (Sum.elim k (fun i => (l i : ℤ))) H x ∧ + action (Sum.elim k (fun i => (l i : ℤ))) H x ≤ max C (linkLevel κ M) ∧ + gradient (action (Sum.elim k (fun i => (l i : ℤ))) H) x = 0 := by + have ha : 0 < linkLevel κ M := linkLevel_pos hM + have hρ : 0 < linkRadius κ M := linkRadius_pos hM + obtain ⟨ε,hε,hnear⟩ := exists_link_epsilon ha + obtain ⟨R,hR,hfar⟩ := exists_link_far hρ hη C + let e : Coeff ν κ := PiLp.single 2 (i₀,j₀) (1 : ℂ) + have he : ‖e‖ = 1 := by simp [e] + apply FiniteLinking.exists_critical + (H := Coeff (ι ⊕ ν) κ) (E := Coeff ι κ) (F := Coeff ν κ) + (Φ := action (Sum.elim k (fun i => (l i : ℤ))) H) + (positiveScale l hl0) (contDiff_action (Sum.elim k (fun i => (l i : ℤ))) hH) he ha + (le_max_right _ _) hρ hε hR + · + intro z hz + have hb := action_positive_lower k l hl hl0 hH.continuous hM hup z + rw [hz] at hb + exact (linkLevel_bound hM).trans hb + · + intro y s hs hse + exact (action_cone_upper k hk0 l hl0 i₀ hl1 j₀ hH0 y s).trans (hnear s hs hse) + · + intro y s _ hys + have hs := hfar ‖y‖ s (norm_nonneg y) (by simpa only [Prod.norm_def, Real.norm_eq_abs] using hys) + exact (action_cone_far k hk0 l hl0 hkl i₀ hl1 j₀ hH.continuous d₀ C η hd hd0 hlo y s).trans + (hs.trans (by positivity)) + · + intro y s _ _ + have hnon : 0 ≤ η*(‖y‖^2+s^2) := mul_nonneg hη.le (add_nonneg (sq_nonneg _) (sq_nonneg _)) + exact (action_cone_far k hk0 l hl0 hkl i₀ hl1 j₀ hH.continuous d₀ C η hd hd0 hlo y s).trans + ((sub_le_self C hnon).trans (le_max_left _ _)) + · + exact gradient_coercive _ hkl hH d hγ hB hgap hrem + +end +end FourierPolynomial + +end NonsqueezingInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/GradientLinking.lean b/lean/OAI/Geometry/PolarProducts/GradientLinking.lean new file mode 100644 index 0000000000000000000000000000000000000000..19284b8b757e839e0941dece5a91316c2973694b --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/GradientLinking.lean @@ -0,0 +1,233 @@ +import OAI.Geometry.PolarProducts.FiniteDescent + +namespace OAI + +universe u84 u85 u86 u87 u88 + +section NonsqueezingInline +section +open Set Filter Function MeasureTheory +open scoped Topology ContDiff +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal + +namespace GradientDescent +noncomputable section +open Set Filter Function Metric +open scoped Topology ContDiff +variable {E : Type u84} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] + + theorem contDiff_gradient {Φ : E → ℝ} (hΦ : ContDiff ℝ ∞ Φ) : + ContDiff ℝ ∞ (gradient Φ) := by + exact (InnerProductSpace.toDual ℝ E).symm.toContinuousLinearEquiv.contDiff.comp + (hΦ.fderiv_right (by simp)) + + def field (Φ σ : E → ℝ) (ε : ℝ) (x : E) : E := + (-(2*σ x/(‖gradient Φ x‖^2+ε^2))) • gradient Φ x + + theorem denom_pos (Φ : E → ℝ) {ε : ℝ} (hε : 0 < ε) (x : E) : + 0 < ‖gradient Φ x‖^2+ε^2 := add_pos_of_nonneg_of_pos (sq_nonneg _) (sq_pos_of_pos hε) + + theorem contDiff_field {Φ σ : E → ℝ} (hΦ : ContDiff ℝ ∞ Φ) (hσ : ContDiff ℝ ∞ σ) + {ε : ℝ} (hε : 0 < ε) : ContDiff ℝ ∞ (field Φ σ ε) := by + have hg := contDiff_gradient hΦ + exact ((contDiff_const.mul hσ).div (((contDiff_norm_sq ℝ).comp hg).add contDiff_const) + (fun x => (denom_pos Φ hε x).ne')).neg.smul hg + + theorem field_eq_zero {Φ σ : E → ℝ} {ε : ℝ} {x : E} (hσ : σ x = 0) : + field Φ σ ε x = 0 := by simp [field, hσ] + + theorem field_rate (Φ σ : E → ℝ) (ε : ℝ) (x : E) : + fderiv ℝ Φ x (field Φ σ ε x) = -(2*σ x/(‖gradient Φ x‖^2+ε^2))*‖gradient Φ x‖^2 := by + rw [field, map_smul, smul_eq_mul, ← inner_gradient_left] + rw [real_inner_self_eq_norm_sq] + + theorem field_nonincrease (Φ : E → ℝ) {σ : E → ℝ} (hσ : ∀ x, 0 ≤ σ x) + {ε : ℝ} (hε : 0 < ε) (x : E) : fderiv ℝ Φ x (field Φ σ ε x) ≤ 0 := by + rw [field_rate] + apply mul_nonpos_of_nonpos_of_nonneg + · exact neg_nonpos.mpr (div_nonneg (mul_nonneg (by norm_num) (hσ x)) (denom_pos Φ hε x).le) + · exact sq_nonneg _ + + theorem field_decrease (Φ : E → ℝ) {σ : E → ℝ} {ε : ℝ} (hε : 0 < ε) + {x : E} (hσ : σ x = 1) (hx : ε ≤ ‖gradient Φ x‖) : + fderiv ℝ Φ x (field Φ σ ε x) ≤ -1 := by + rw [field_rate, hσ, mul_one] + have hd := denom_pos Φ hε x + have he : -(2/(‖gradient Φ x‖^2+ε^2))*‖gradient Φ x‖^2 = + -(2*‖gradient Φ x‖^2/(‖gradient Φ x‖^2+ε^2)) := by ring + rw [he, neg_le_neg_iff, le_div_iff₀ hd] + nlinarith [norm_nonneg (gradient Φ x)] + + theorem field_norm_le (Φ : E → ℝ) {σ : E → ℝ} (hσ : ∀ x, σ x ∈ Icc (0 : ℝ) 1) + {ε : ℝ} (hε : 0 < ε) (x : E) : ‖field Φ σ ε x‖ ≤ 1/ε := by + have hden := denom_pos Φ hε x + rw [field, norm_smul, Real.norm_eq_abs, abs_neg, + abs_of_nonneg (div_nonneg (mul_nonneg (by norm_num) (hσ x).1) hden.le)] + rw [div_mul_eq_mul_div, div_le_div_iff₀ hden hε] + have hs := mul_le_mul_of_nonneg_right (hσ x).2 (norm_nonneg (gradient Φ x)) + nlinarith [sq_nonneg (‖gradient Φ x‖-ε)] + + theorem field_hasCompactSupport {Φ σ : E → ℝ} (hσ : HasCompactSupport σ) (ε : ℝ) : + HasCompactSupport (field Φ σ ε) := by + apply HasCompactSupport.of_support_subset_isCompact hσ.isCompact + intro x hx + by_contra hn + apply hx + exact field_eq_zero (image_eq_zero_of_notMem_tsupport hn) + +end +end GradientDescent + +namespace GradientDescent +noncomputable section +open Set Filter Function Metric +open scoped Topology ContDiff NNReal +variable {E : Type u85} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] + + theorem exists_uniform_gradient_lower {Φ : E → ℝ} (hΦ : ContDiff ℝ ∞ Φ) + {a b : ℝ} (hnocrit : ∀ x, a ≤ Φ x → Φ x ≤ b → gradient Φ x ≠ 0) + (hcoercive : ∃ R : ℝ, ∀ x, R ≤ ‖x‖ → 1 ≤ ‖gradient Φ x‖) : + ∃ ε : ℝ, 0 < ε ∧ ∀ x, a ≤ Φ x → Φ x ≤ b → ε ≤ ‖gradient Φ x‖ := by + obtain ⟨R,hR⟩ := hcoercive + let S := closedBall (0 : E) R ∩ Φ ⁻¹' Icc a b + have hS : IsCompact S := (isCompact_closedBall (0 : E) R).inter_right + (isClosed_Icc.preimage hΦ.continuous) + by_cases hne : S.Nonempty + · obtain ⟨x,hx,hm⟩ := hS.exists_isMinOn hne (contDiff_gradient hΦ).continuous.norm.continuousOn + have hxg : 0 < ‖gradient Φ x‖ := norm_pos_iff.mpr (hnocrit x hx.2.1 hx.2.2) + refine ⟨min 1 ‖gradient Φ x‖, lt_min zero_lt_one hxg, ?_⟩ + intro y ha hb + by_cases hy : ‖y‖ ≤ R + · exact (min_le_right _ _).trans (hm ⟨by simpa using hy, ha, hb⟩) + · exact (min_le_left _ _).trans (hR y (le_of_lt (lt_of_not_ge hy))) + · refine ⟨1, zero_lt_one, ?_⟩ + intro y ha hb + apply hR + by_contra h + exact hne ⟨y, by simpa using (le_of_lt (lt_of_not_ge h)), ha, hb⟩ + + def energyCutoff (Φ : E → ℝ) (a : ℝ) (x : E) : ℝ := + Real.smoothTransition ((2*Φ x-a)/a) + + omit [FiniteDimensional ℝ E] in + theorem energyCutoff_contDiff {Φ : E → ℝ} (hΦ : ContDiff ℝ ∞ Φ) (a : ℝ) : + ContDiff ℝ ∞ (energyCutoff Φ a) := by + exact Real.smoothTransition.contDiff.comp + (((contDiff_const.mul hΦ).sub contDiff_const).div_const a) + + omit [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] in + theorem energyCutoff_mem (Φ : E → ℝ) (a : ℝ) (x : E) : + energyCutoff Φ a x ∈ Icc (0 : ℝ) 1 := + ⟨Real.smoothTransition.nonneg _, Real.smoothTransition.le_one _⟩ + + omit [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] in + theorem energyCutoff_one (Φ : E → ℝ) {a : ℝ} (ha : 0 < a) {x : E} (hx : a ≤ Φ x) : + energyCutoff Φ a x = 1 := by + apply Real.smoothTransition.one_of_one_le + rw [le_div_iff₀ ha] + linarith + + omit [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] in + theorem energyCutoff_zero (Φ : E → ℝ) {a : ℝ} (ha : 0 < a) {x : E} (hx : Φ x ≤ a/2) : + energyCutoff Φ a x = 0 := by + apply Real.smoothTransition.zero_of_nonpos + exact div_nonpos_of_nonpos_of_nonneg (by linarith) ha.le + + theorem exists_cutoff_field {Φ : E → ℝ} (hΦ : ContDiff ℝ ∞ Φ) + {a b ε M : ℝ} (ha : 0 < a) (hε : 0 < ε) (hM : 0 < M) + (hgrad : ∀ x, a ≤ Φ x → Φ x ≤ b → ε ≤ ‖gradient Φ x‖) : + ∃ (V : E → E) (K : ℝ≥0), ContDiff ℝ ∞ V ∧ LipschitzWith K V ∧ + (∀ x, ‖V x‖ ≤ 1/ε) ∧ (∀ x, fderiv ℝ Φ x (V x) ≤ 0) ∧ + (∀ x, Φ x ≤ a/2 → V x = 0) ∧ + (∀ x, ‖x‖ ≤ M → a ≤ Φ x → Φ x ≤ b → fderiv ℝ Φ x (V x) ≤ -1) := by + let χ : ContDiffBump (0 : E) := ⟨M, M+1, hM, by linarith⟩ + let σ : E → ℝ := fun x => χ x * energyCutoff Φ a x + have hσ : ContDiff ℝ ∞ σ := χ.contDiff.mul (energyCutoff_contDiff hΦ a) + have hσc : HasCompactSupport σ := χ.hasCompactSupport.mul_right + have hσm (x : E) : σ x ∈ Icc (0 : ℝ) 1 := by + refine ⟨mul_nonneg χ.nonneg (energyCutoff_mem Φ a x).1, ?_⟩ + exact (mul_le_of_le_one_left (energyCutoff_mem Φ a x).1 χ.le_one).trans + (energyCutoff_mem Φ a x).2 + let V := field Φ σ ε + have hV : ContDiff ℝ ∞ V := contDiff_field hΦ hσ hε + obtain ⟨K,hK⟩ := ContDiff.lipschitzWith_of_hasCompactSupport + (field_hasCompactSupport hσc ε) hV (by simp) + refine ⟨V,K,hV,hK,field_norm_le Φ hσm hε,field_nonincrease Φ (fun x => (hσm x).1) hε,?_,?_⟩ + · intro x hx + apply field_eq_zero + simp only [σ, energyCutoff_zero Φ ha hx, mul_zero] + · intro x hx hxa hxb + apply field_decrease Φ hε _ (hgrad x hxa hxb) + have hχ : χ x = 1 := χ.one_of_mem_closedBall (by simpa using hx) + simp only [σ, hχ, energyCutoff_one Φ ha hxa, mul_one] + +end +end GradientDescent + +namespace FiniteLinking +noncomputable section +open Set Filter Function Metric +open scoped Topology ContDiff NNReal +variable {H : Type u86} {E : Type u87} {F : Type u88} [NormedAddCommGroup H] [InnerProductSpace ℝ H] + [FiniteDimensional ℝ H] [NormedAddCommGroup E] [NormedSpace ℝ E] + [FiniteDimensional ℝ E] [NormedAddCommGroup F] [InnerProductSpace ℝ F] + + theorem exists_critical (l : H ≃L[ℝ] E × F) {Φ : H → ℝ} (hΦ : ContDiff ℝ ∞ Φ) + {e : F} (he : ‖e‖ = 1) {a b ρ ε R : ℝ} + (ha : 0 < a) (hba : a ≤ b) (hρ : 0 < ρ) (hε : 0 < ε) (hR : ρ < R) + (hpos : ∀ z : F, ‖z‖ = ρ → 2*a ≤ Φ (l.symm (0,z))) + (hnear : ∀ (y : E) (s : ℝ), 0 < s → s < ε → Φ (l.symm (y,s • e)) ≤ a/2) + (hfar : ∀ (y : E) (s : ℝ), 0 < s → R ≤ ‖(y,s)‖ → Φ (l.symm (y,s • e)) ≤ a/2) + (hupper : ∀ (y : E) (s : ℝ), 0 < s → ‖(y,s)‖ < R → Φ (l.symm (y,s • e)) ≤ b) + (hcoercive : ∃ C : ℝ, ∀ x, C ≤ ‖x‖ → 1 ≤ ‖gradient Φ x‖) : + ∃ x : H, a ≤ Φ x ∧ Φ x ≤ b ∧ gradient Φ x = 0 := by + by_contra! hn + obtain ⟨δ,hδ,hgrad⟩ := GradientDescent.exists_uniform_gradient_lower hΦ hn hcoercive + let B := ‖l.symm.toContinuousLinearMap‖ * R + let T := b-a+1 + let M := B+T*(1/δ)+1 + have hR0 : 0 < R := hρ.trans hR + have hB : 0 ≤ B := by dsimp [B]; positivity + have hT : 0 < T := by dsimp [T]; linarith + have hM : 0 < M := by + have : 0 < T*(1/δ) := mul_pos hT (one_div_pos.mpr hδ) + dsimp [M] + linarith + obtain ⟨V,K,hVs,hV,hL,hdec,hfix,hrate⟩ := + GradientDescent.exists_cutoff_field hΦ ha hδ hM hgrad + obtain ⟨η,hη,_,hηfix,hηlow⟩ := FlowDescent.exists_descent_map hV hVs + (hΦ.differentiable (by simp)) hdec hT (show b-T ≤ a by dsimp [T]; linarith) + hL (show B+T*(1/δ) ≤ M by dsimp [M]; linarith) hrate + let ψ : E × F → E × F := l ∘ η ∘ l.symm + have hψ : ContDiff ℝ ∞ ψ := l.contDiff.comp (hη.comp l.symm.contDiff) + have hψeq (y : E) (s : ℝ) (hx : Φ (l.symm (y,s • e)) ≤ a/2) : + ψ (y,s • e) = (y,s • e) := by + simp only [ψ, Function.comp_apply, hηfix _ (hfix _ hx), l.apply_symm_apply] + obtain ⟨y,s,hs,hys,hfst,hsnd⟩ := SmoothLinking.sphere_linking hψ he hρ hε hR + (fun y s hs heps => hψeq y s (hnear y s hs heps)) + (fun y s hs hnorm => hψeq y s (hfar y s hs hnorm)) + have hncone : ‖(y,s • e)‖ = ‖(y,s)‖ := by + simp only [Prod.norm_def, norm_smul, he, mul_one, Real.norm_eq_abs] + have hxB : ‖l.symm (y,s • e)‖ ≤ B := + (l.symm.toContinuousLinearMap.le_opNorm _).trans (by + rw [hncone] + exact mul_le_mul_of_nonneg_left hys.le (norm_nonneg l.symm.toContinuousLinearMap)) + have hlow := hηlow (l.symm (y,s • e)) hxB (hupper y s hs hys) + have hhigh := hpos (ψ (y,s • e)).2 hsnd + have heq : l.symm (0,(ψ (y,s • e)).2) = η (l.symm (y,s • e)) := by + rw [← hfst] + change l.symm (ψ (y,s • e)) = _ + simp only [ψ, Function.comp_apply, l.symm_apply_apply] + rw [heq] at hhigh + linarith + +end +end FiniteLinking + +end + +end NonsqueezingInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/HamiltonianGrowth.lean b/lean/OAI/Geometry/PolarProducts/HamiltonianGrowth.lean new file mode 100644 index 0000000000000000000000000000000000000000..9f2134602373f79733bc1bc9c393569499813452 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/HamiltonianGrowth.lean @@ -0,0 +1,236 @@ +import OAI.Geometry.PolarProducts.HamiltonianODE + +namespace OAI + +universe u119 u120 + +section NonsqueezingInline + +namespace HamiltonianGrowth +noncomputable section +open Set Filter +open scoped ContDiff Topology +open FourierPolynomial DiagonalQuadratic HamiltonianODE +variable {κ : Type u119} [Fintype κ] + + theorem contDiff_gradient {H : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) : + ContDiff ℝ ∞ (gradient H) := + (InnerProductSpace.toDual ℝ _).symm.toContinuousLinearEquiv.contDiff.comp + (hH.fderiv_right (by simp)) + + theorem gradient_translate {H : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) (p z : Vector κ) : + gradient (fun w => H (w+p)) z = gradient H (z+p) := by + apply HasGradientAt.gradient + rw [hasGradientAt_iff_hasFDerivAt] + have hh := ((hH.differentiable (by simp) (z+p)).hasGradientAt.hasFDerivAt).comp z + ((hasFDerivAt_id z).add_const p) + convert! hh using 1 + + theorem energy_upper (d : κ → ℝ) (D : ℝ) (hd : ∀ j, d j ≤ D) (z : Vector κ) : + energy d z ≤ D*‖z‖^2 := by + simp only [energy, EuclideanSpace.norm_sq_eq, Finset.mul_sum] + exact Finset.sum_le_sum (fun j _ => mul_le_mul_of_nonneg_right (hd j) (sq_nonneg _)) + + theorem energy_sub_uniform (d : κ → ℝ) (η : ℝ) (z : Vector κ) : + energy (fun j => d j-η) z = energy d z-η*‖z‖^2 := by + simp only [energy, sub_mul, Finset.sum_sub_distrib, EuclideanSpace.norm_sq_eq, Finset.mul_sum] + + theorem quadratic_error {H : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) (h0 : H 0 = 0) + (d : κ → ℝ) {B : ℝ} (hb : ∀ z, ‖gradient H z-(2 : ℝ) • diag d z‖ ≤ B) (z : Vector κ) : + |H z-energy d z| ≤ B*‖z‖ := by + have hr (w : Vector κ) : HasGradientAt (fun v => H v-energy d v) + (gradient H w-(2 : ℝ) • diag d w) w := by + rw [hasGradientAt_iff_hasFDerivAt] + have hh := ((hH.differentiable (by simp) w).hasGradientAt.hasFDerivAt).sub + (hasGradientAt_energy d w).hasFDerivAt + convert! hh using 1 + ext v + change inner (𝕜 := ℝ) (gradient H w-(2 : ℝ) • diag d w) v = + inner (𝕜 := ℝ) (gradient H w) v-inner (𝕜 := ℝ) ((2 : ℝ) • diag d w) v + exact inner_sub_left _ _ _ + have bound (w : Vector κ) : ‖fderiv ℝ (fun v => H v-energy d v) w‖ ≤ B := by + rw [(hr w).hasFDerivAt.fderiv] + simpa only [LinearIsometryEquiv.norm_map] using hb w + have hm := (convex_univ : Convex ℝ (univ : Set (Vector κ))).norm_image_sub_le_of_norm_fderiv_le + (fun w _ => (hr w).hasFDerivAt.differentiableAt) (fun w _ => bound w) + (mem_univ (0 : Vector κ)) (mem_univ z) + simpa [h0, energy] using hm + + theorem quartic_bound {H : Vector κ → ℝ} {A B r : ℝ} + (hA : 0 ≤ A) (hB : 0 ≤ B) (hr : 0 < r) + (hz : ∀ z, ‖z‖ < r → H z = 0) (hu : ∀ z, H z ≤ A*‖z‖^2+B*‖z‖) : + ∃ M : ℝ, 0 ≤ M ∧ ∀ z, H z ≤ M*‖z‖^4 := by + refine ⟨A/r^2+B/r^3, by positivity, ?_⟩ + intro z + by_cases hzr : ‖z‖ < r + · rw [hz z hzr]; positivity + have hnr : r ≤ ‖z‖ := le_of_not_gt hzr + have h2 : r^2*‖z‖^2 ≤ ‖z‖^4 := by + have := mul_le_mul_of_nonneg_right (pow_le_pow_left₀ hr.le hnr 2) (sq_nonneg ‖z‖) + nlinarith only [this] + have h3 : r^3*‖z‖ ≤ ‖z‖^4 := by + have := mul_le_mul_of_nonneg_right (pow_le_pow_left₀ hr.le hnr 3) (norm_nonneg z) + nlinarith only [this] + have ha : A*‖z‖^2 ≤ (A/r^2)*‖z‖^4 := by + rw [div_mul_eq_mul_div, le_div_iff₀ (pow_pos hr 2)] + nlinarith only [mul_le_mul_of_nonneg_left h2 hA] + have hb : B*‖z‖ ≤ (B/r^3)*‖z‖^4 := by + rw [div_mul_eq_mul_div, le_div_iff₀ (pow_pos hr 3)] + nlinarith only [mul_le_mul_of_nonneg_left h3 hB] + calc + H z ≤ A*‖z‖^2+B*‖z‖ := hu z + _ ≤ (A/r^2+B/r^3)*‖z‖^4 := by nlinarith only [ha,hb] + + theorem lower_bound {H : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) (h0 : H 0 = 0) + (d : κ → ℝ) {B η : ℝ} (hη : 0 < η) + (hb : ∀ z, ‖gradient H z-(2 : ℝ) • diag d z‖ ≤ B) (z : Vector κ) : + energy (fun j => d j-η) z-B^2/(4*η) ≤ H z := by + have he := (abs_le.mp (quadratic_error hH h0 d hb z)).1 + have hc : (4*η)*(B^2/(4*η)) = B^2 := by field_simp + rw [energy_sub_uniform] + nlinarith [sq_nonneg (2*η*‖z‖-B)] + + theorem bounded_remainder_translate {H : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) + (d : κ → ℝ) {B : ℝ} (hb : ∀ z, ‖gradient H z-(2 : ℝ) • diag d z‖ ≤ B) + (p z : Vector κ) : + ‖gradient (fun w => H (w+p)) z-(2 : ℝ) • diag d z‖ ≤ B+‖(2 : ℝ) • diag d p‖ := by + rw [gradient_translate hH] + have hd : diag d (z+p) = diag d z+diag d p := (diagCLM d).map_add z p + have he : gradient H (z+p)-(2 : ℝ) • diag d z = + (gradient H (z+p)-(2 : ℝ) • diag d (z+p))+(2 : ℝ) • diag d p := by + rw [hd, smul_add]; abel + rw [he] + have hh := norm_add_le (gradient H (z+p)-(2 : ℝ) • diag d (z+p)) ((2 : ℝ) • diag d p) + linarith [hb (z+p)] + + theorem bound_remainder_of_compact {H : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) + (d : κ → ℝ) {S : Set (Vector κ)} (hS : IsCompact S) + (he : ∀ z ∉ S, gradient H z = (2 : ℝ) • diag d z) : + ∃ B : ℝ, 0 ≤ B ∧ ∀ z, ‖gradient H z-(2 : ℝ) • diag d z‖ ≤ B := by + have hc : Continuous (fun z => gradient H z-(2 : ℝ) • diag d z) := + (contDiff_gradient hH).continuous.sub ((diagCLM d).continuous.const_smul (2 : ℝ)) + obtain ⟨B,hB⟩ := hS.exists_bound_of_continuousOn hc.continuousOn + refine ⟨max B 0,le_max_right _ _,?_⟩ + intro z + by_cases hz : z ∈ S + · exact (hB z hz).trans (le_max_left _ _) + · rw [he z hz, sub_self, norm_zero] + exact le_max_right _ _ + +end +end HamiltonianGrowth + +namespace HamiltonianPeriodic +noncomputable section +open MeasureTheory Set Filter +open scoped ContDiff Topology +open FourierPolynomial DiagonalQuadratic HamiltonianODE HamiltonianGrowth +variable {κ : Type u120} [Fintype κ] + + def actionIntegral (H : Vector κ → ℝ) (x : ℝ → Vector κ) : ℝ := + ∫ t in (0:ℝ)..1, inner (𝕜 := ℝ) (gradient H (x t)) (x t)/2-H (x t) + + theorem integral_gradient_pairing {H : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) + {x : ℝ → Vector κ} (hx : ∀ t, HasDerivAt x (Complex.I • gradient H (x t)) t) + (hp : x 1 = x 0) (p : Vector κ) : + (∫ t in (0:ℝ)..1, inner (𝕜 := ℝ) (gradient H (x t)) p) = 0 := by + have hc : Continuous x := continuous_iff_continuousAt.mpr (fun t => (hx t).continuousAt) + have hi : IntervalIntegrable (fun t => inner (𝕜 := ℝ) (gradient H (x t)) p) volume 0 1 := + (((contDiff_gradient hH).continuous.comp hc).inner continuous_const).intervalIntegrable 0 1 + have hd (t : ℝ) : HasDerivAt (fun s => inner (𝕜 := ℝ) (x s) (Complex.I • p)) + (inner (𝕜 := ℝ) (gradient H (x t)) p) t := by + simpa only [inner_zero_right, add_zero, zero_add, inner_I_I] using + (hx t).inner ℝ (hasDerivAt_const t (Complex.I • p)) + have he := intervalIntegral.integral_eq_sub_of_hasDerivAt (fun t _ => hd t) hi + simpa only [hp, sub_self] using he + + theorem action_translate {H : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) (p : Vector κ) + {y : ℝ → Vector κ} + (hy : ∀ t, HasDerivAt y (Complex.I • gradient (fun z => H (z+p)) (y t)) t) + (hp : y 1 = y 0) : + actionIntegral H (fun t => y t+p) = actionIntegral (fun z => H (z+p)) y := by + have hc : Continuous y := continuous_iff_continuousAt.mpr (fun t => (hy t).continuousAt) + have hxt (t : ℝ) : HasDerivAt (fun s => y s+p) (Complex.I • gradient H (y t+p)) t := by + simpa only [gradient_translate hH] using (hy t).add_const p + have hz := integral_gradient_pairing hH hxt (by simp only [hp]) p + have hg : Continuous (fun t => gradient H (y t+p)) := + (contDiff_gradient hH).continuous.comp (hc.add continuous_const) + have hi1 : IntervalIntegrable (fun t => inner (𝕜 := ℝ) (gradient H (y t+p)) (y t)/2-H (y t+p)) volume 0 1 := + (((hg.inner hc).div_const 2).sub (hH.continuous.comp (hc.add continuous_const))).intervalIntegrable _ _ + have hi2 : IntervalIntegrable (fun t => inner (𝕜 := ℝ) (gradient H (y t+p)) p/2) volume 0 1 := + ((hg.inner continuous_const).div_const 2).intervalIntegrable _ _ + unfold actionIntegral + simp_rw [gradient_translate hH] + have he (t : ℝ) : inner (𝕜 := ℝ) (gradient H (y t+p)) (y t+p)/2-H (y t+p) = + (inner (𝕜 := ℝ) (gradient H (y t+p)) (y t)/2-H (y t+p))+ + inner (𝕜 := ℝ) (gradient H (y t+p)) p/2 := by rw [inner_add_right]; ring + simp_rw [he] + rw [intervalIntegral.integral_add hi1 hi2, intervalIntegral.integral_div, hz, zero_div, add_zero] + +end +end HamiltonianPeriodic + +namespace HamiltonianPeriodic +noncomputable section +open MeasureTheory Set Filter +open scoped ContDiff Topology +open FourierPolynomial DiagonalQuadratic HamiltonianODE HamiltonianGrowth +variable {κ : Type} [Fintype κ] [DecidableEq κ] + + theorem exists_positive_flat (j₀ : κ) {H : Vector κ → ℝ} + (hH : ContDiff ℝ ∞ H) (hH0 : ∀ z, 0 ≤ H z) + (hflat : ∀ᶠ z in 𝓝 (0 : Vector κ), H z = 0) + (d : κ → ℝ) {η γ B D : ℝ} + (hη : 0 < η) (hγ : 0 < γ) (hB : 0 ≤ B) (hD : 0 ≤ D) + (hd : ∀ j, 2*η ≤ d j) (hd0 : Real.pi+2*η ≤ d j₀) (hdD : ∀ j, |d j| ≤ D) + (hgap : ∀ m : ℤ, ∀ j, γ ≤ |Real.pi*(m : ℝ)-d j|) + (hrem : ∀ z, ‖gradient H z-(2 : ℝ) • diag d z‖ ≤ B) : + ∃ x : ℝ → Vector κ, x 1 = x 0 ∧ 0 < actionIntegral H x ∧ + ∀ t : ℝ, HasDerivAt x (Complex.I • gradient H (x t)) t := by + have h0 := hflat.self_of_nhds + obtain ⟨r,hr,hzr⟩ := Metric.eventually_nhds_iff.mp hflat + have hu (z : Vector κ) : H z ≤ D*‖z‖^2+B*‖z‖ := by + have he := (abs_le.mp (quadratic_error hH h0 d hrem z)).2 + have hd' := energy_upper d D (fun j => (le_abs_self _).trans (hdD j)) z + linarith + obtain ⟨M,hM,hup⟩ := quartic_bound hD hB hr (fun z hz => hzr (by simpa only [dist_zero_right] using hz)) hu + obtain ⟨x,ha,hx⟩ := exists_positive_periodic j₀ hH hH0 (fun j => d j-η) d hM hη hγ hB hD hup + (fun j => by linarith [hd j]) (by linarith) + (lower_bound hH h0 d hη hrem) hdD hgap hrem + refine ⟨fun t => x (t : Time),?_,?_,hx⟩ + · simp only [AddCircle.coe_period, AddCircle.coe_zero] + · change 0 < ∫ t in (0:ℝ)..1, (fun s : Time => inner (𝕜 := ℝ) (gradient H (x s)) (x s)/2-H (x s)) (t : Time) + have he := intervalIntegral_eq_average (fun s : Time => inner (𝕜 := ℝ) (gradient H (x s)) (x s)/2-H (x s)) + exact he.symm ▸ ha + + theorem exists_positive_at_flat_point (j₀ : κ) {H : Vector κ → ℝ} + (hH : ContDiff ℝ ∞ H) (hH0 : ∀ z, 0 ≤ H z) (p : Vector κ) + (hflat : ∀ᶠ z in 𝓝 p, H z = 0) + (d : κ → ℝ) {η γ B D : ℝ} + (hη : 0 < η) (hγ : 0 < γ) (hB : 0 ≤ B) (hD : 0 ≤ D) + (hd : ∀ j, 2*η ≤ d j) (hd0 : Real.pi+2*η ≤ d j₀) (hdD : ∀ j, |d j| ≤ D) + (hgap : ∀ m : ℤ, ∀ j, γ ≤ |Real.pi*(m : ℝ)-d j|) + (hrem : ∀ z, ‖gradient H z-(2 : ℝ) • diag d z‖ ≤ B) : + ∃ x : ℝ → Vector κ, x 1 = x 0 ∧ 0 < actionIntegral H x ∧ + ∀ t : ℝ, HasDerivAt x (Complex.I • gradient H (x t)) t := by + have ht : ContDiff ℝ ∞ (fun z : Vector κ => H (z+p)) := hH.comp (contDiff_id.add contDiff_const) + have hz : ∀ᶠ z in 𝓝 (0 : Vector κ), H (z+p) = 0 := by + have hc : Tendsto (fun z : Vector κ => z+p) (𝓝 0) (𝓝 p) := by + have hc : Continuous (fun z : Vector κ => z+p) := continuous_id.add continuous_const + have hc0 : Tendsto (fun z : Vector κ => z+p) (𝓝 0) (𝓝 ((0 : Vector κ)+p)) := hc.continuousAt + simpa only [zero_add] using hc0 + exact hc.eventually hflat + obtain ⟨y,hp,ha,hy⟩ := exists_positive_flat j₀ ht (fun z => hH0 (z+p)) hz d hη hγ + (add_nonneg hB (norm_nonneg _)) hD hd hd0 hdD hgap (bounded_remainder_translate hH d hrem p) + refine ⟨fun t => y t+p,by simp only [hp],?_,?_⟩ + · rw [action_translate hH p hy hp] + exact ha + · intro t + simpa only [gradient_translate hH] using (hy t).add_const p + +end +end HamiltonianPeriodic + +end NonsqueezingInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/HamiltonianODE.lean b/lean/OAI/Geometry/PolarProducts/HamiltonianODE.lean new file mode 100644 index 0000000000000000000000000000000000000000..7fca9180ad13780fe7ac26918134dec02cc80c98 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/HamiltonianODE.lean @@ -0,0 +1,206 @@ +import OAI.Geometry.PolarProducts.PeriodicSolutions + +namespace OAI + +universe u116 u117 u118 + +section NonsqueezingInline + +namespace HamiltonianODE +noncomputable section +open MeasureTheory AddCircle Finset Set Filter +open scoped ComplexConjugate ContDiff Topology +local instance : Fact (0 < (1 : ℝ)) := ⟨zero_lt_one⟩ +open FourierPolynomial DiagonalQuadratic +variable {κ : Type u116} [Fintype κ] + + theorem inner_I_self (z : Vector κ) : inner (𝕜 := ℝ) z (Complex.I • z) = 0 := by + rw [real_inner_eq_complex_re, inner_smul_right, inner_self_eq_norm_sq_to_K] + simp [pow_two] + + theorem inner_I_left (z w : Vector κ) : + inner (𝕜 := ℝ) (Complex.I • z) w = -inner (𝕜 := ℝ) z (Complex.I • w) := by + simp only [real_inner_eq_complex_re, inner_smul_left, inner_smul_right] + simp [Complex.mul_re] + + theorem inner_I_I (z w : Vector κ) : + inner (𝕜 := ℝ) (Complex.I • z) (Complex.I • w) = inner (𝕜 := ℝ) z w := by + rw [inner_I_left, smul_smul] + simp + + theorem zero_derivative_constant {E : Type u117} [NormedAddCommGroup E] [NormedSpace ℝ E] + {x : ℝ → E} (hx : ∀ t, HasDerivAt x 0 t) (s t : ℝ) : x s = x t := by + exact is_const_of_deriv_eq_zero (fun t => (hx t).differentiableAt) (fun t => (hx t).deriv) s t + + theorem energy_constant {H : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) {x : ℝ → Vector κ} + (hx : ∀ t, HasDerivAt x (Complex.I • gradient H (x t)) t) (s t : ℝ) : H (x s) = H (x t) := by + apply zero_derivative_constant (x := H ∘ x) _ s t + intro u + have hh := ((hH.differentiable (by simp) (x u)).hasGradientAt.hasFDerivAt).comp_hasDerivAt u (hx u) + simpa only [InnerProductSpace.toDual_apply_apply, inner_I_self] using hh + + theorem quadratic_constant (d : κ → ℝ) {a : ℝ → ℝ} {x : ℝ → Vector κ} + (hx : ∀ t, HasDerivAt x (Complex.I • ((2*a t) • diag d (x t))) t) (s t : ℝ) : + energy d (x s) = energy d (x t) := by + apply zero_derivative_constant (x := energy d ∘ x) _ s t + intro u + have hh := (hasGradientAt_energy d (x u)).hasFDerivAt.comp_hasDerivAt u (hx u) + simpa only [InnerProductSpace.toDual_apply_apply, real_inner_smul_left, smul_comm Complex.I (2*a u), + real_inner_smul_right, inner_I_self, mul_zero] using hh + + theorem linear_solution {x : ℝ → ℂ} (v : ℂ) + (hx : ∀ t, HasDerivAt x (v*x t) t) (t : ℝ) : + x t = Complex.exp (v*(t : ℂ))*x 0 := by + have hd (s : ℝ) : HasDerivAt (fun u : ℝ => Complex.exp (-v*(u : ℂ))*x u) 0 s := by + have he := ((Complex.ofRealCLM.hasDerivAt (x := s)).const_mul (-v)).cexp + have hh := he.mul (hx s) + apply hh.congr_deriv + simp only [Complex.ofRealCLM_apply, Complex.ofReal_one, mul_one] + ring + have hc := zero_derivative_constant hd t 0 + simp only [Complex.ofReal_zero, mul_zero, Complex.exp_zero, one_mul] at hc + have he := congrArg (fun z : ℂ => Complex.exp (v*(t:ℂ))*z) hc + rw [← mul_assoc, ← Complex.exp_add] at he + have hz : v*(t:ℂ)+ -v*(t:ℂ) = 0 := by ring + simpa only [hz, Complex.exp_zero, one_mul] using he + + theorem periodic_frequency {x : ℝ → ℂ} (a : ℝ) + (hx : ∀ t, HasDerivAt x ((2*(a:ℂ)*Complex.I)*x t) t) + (hp : x 1 = x 0) (hzero : x 0 ≠ 0) : ∃ m : ℤ, a = Real.pi*m := by + have he := linear_solution (2*(a:ℂ)*Complex.I) hx 1 + rw [Complex.ofReal_one, mul_one, hp] at he + have hh : Complex.exp (2*(a:ℂ)*Complex.I) = 1 := by + apply mul_right_cancel₀ hzero + simpa only [one_mul] using he.symm + obtain ⟨m,hm⟩ := Complex.exp_eq_one_iff.mp hh + refine ⟨m,?_⟩ + have hi := congrArg Complex.im hm + simp [Complex.mul_im, Complex.mul_re] at hi + linarith + + theorem slow_linear_constant {x : ℝ → ℂ} {a : ℝ} (ha : 0 ≤ a) (haπ : a < Real.pi) + (hx : ∀ t, HasDerivAt x ((2*(a:ℂ)*Complex.I)*x t) t) + (hp : x 1 = x 0) (t : ℝ) : x t = x 0 := by + by_cases hz : x 0 = 0 + · simp only [linear_solution _ hx t, hz, mul_zero] + obtain ⟨m,hm⟩ := periodic_frequency a hx hp hz + have hm0 : 0 ≤ m := by + have : 0 ≤ (m:ℝ) := (mul_nonneg_iff_of_pos_left Real.pi_pos).mp (hm ▸ ha) + exact_mod_cast this + have hm1 : m < 1 := by + have : (m:ℝ) < 1 := (mul_lt_mul_iff_right₀ Real.pi_pos).mp (by simpa [mul_comm] using hm ▸ haπ) + exact_mod_cast this + have hmz : m = 0 := by omega + have haz : a = 0 := by simp [hm,hmz] + simp only [linear_solution _ hx t, haz, Complex.ofReal_zero, mul_zero, zero_mul, + Complex.exp_zero, one_mul] + +end +end HamiltonianODE + +namespace HamiltonianODE +noncomputable section +open Set Filter +open scoped ContDiff Topology +open FourierPolynomial DiagonalQuadratic +variable {κ : Type u118} [Fintype κ] + +omit [Fintype κ] in + theorem diag_one (z : Vector κ) : diag (fun _ => 1) z = z := by + ext j + simp + + theorem energy_one (z : Vector κ) : energy (fun _ => 1) z = ‖z‖^2 := by + simp only [energy, one_mul, EuclideanSpace.norm_sq_eq] + + theorem gradient_comp_energy (d : κ → ℝ) {f : ℝ → ℝ} {v : ℝ} (z : Vector κ) + (hf : HasDerivAt f v (energy d z)) : + gradient (fun w => f (energy d w)) z = (2*v) • diag d z := by + apply HasGradientAt.gradient + rw [hasGradientAt_iff_hasFDerivAt] + have h := hf.comp_hasFDerivAt z (hasGradientAt_energy d z).hasFDerivAt + apply h.congr_fderiv + ext w + change v * inner (𝕜 := ℝ) ((2 : ℝ) • diag d z) w = + inner (𝕜 := ℝ) ((2*v) • diag d z) w + simp only [real_inner_smul_left] + ring + + theorem coordinate_derivative (d : κ → ℝ) (v : ℝ) {x : ℝ → Vector κ} + (hx : ∀ t, HasDerivAt x (Complex.I • ((2*v) • diag d (x t))) t) (j : κ) (t : ℝ) : + HasDerivAt (fun s => x s j) ((2*((v*d j : ℝ):ℂ)*Complex.I)*x t j) t := by + have h := (((PiLp.proj (𝕜 := ℂ) 2 (fun _ : κ => ℂ) j).restrictScalars ℝ).hasFDerivAt).comp_hasDerivAt t (hx t) + apply h.congr_deriv + change Complex.I * ((2*v) • (d j • x t j)) = (2*((v*d j : ℝ):ℂ)*Complex.I)*x t j + simp only [Complex.real_smul, Complex.ofReal_mul, Complex.ofReal_ofNat] + ring + + theorem slow_diagonal_constant (d : κ → ℝ) (v : ℝ) + (hv : ∀ j, 0 ≤ v*d j) (hvπ : ∀ j, v*d j < Real.pi) + {x : ℝ → Vector κ} + (hx : ∀ t, HasDerivAt x (Complex.I • ((2*v) • diag d (x t))) t) + (hp : x 1 = x 0) (t : ℝ) : x t = x 0 := by + ext j + exact slow_linear_constant (hv j) (hvπ j) (coordinate_derivative d v hx j) + (congrArg (fun z : Vector κ => z j) hp) t + + theorem slow_radial_constant {f v : ℝ → ℝ} + (hf : ∀ s, HasDerivAt f (v s) s) + (hv : ∀ s, 0 ≤ v s) (hvπ : ∀ s, v s < Real.pi) + {x : ℝ → Vector κ} + (hx : ∀ t, HasDerivAt x (Complex.I • gradient (fun z : Vector κ => f (‖z‖^2)) (x t)) t) + (hp : x 1 = x 0) (t : ℝ) : x t = x 0 := by + have he (s : ℝ) : gradient (fun z : Vector κ => f (‖z‖^2)) (x s) = + (2*v (‖x s‖^2)) • diag (fun _ => 1) (x s) := by + simpa only [energy_one] using gradient_comp_energy (fun _ => 1) (x s) (hf (energy (fun _ => 1) (x s))) + have hode (s : ℝ) := (hx s).congr_deriv (congrArg (fun z : Vector κ => Complex.I • z) (he s)) + have hc (s : ℝ) : ‖x s‖^2 = ‖x 0‖^2 := by + simpa only [energy_one] using quadratic_constant (fun _ => 1) hode s 0 + apply slow_diagonal_constant (fun _ => 1) (v (‖x 0‖^2)) (by simpa only [mul_one] using fun _ : κ => hv (‖x 0‖^2)) + (by simpa only [mul_one] using fun _ : κ => hvπ (‖x 0‖^2)) _ hp t + intro s + simpa only [hc s] using hode s + + theorem moderate_linear_either {x : ℝ → ℂ} {a : ℝ} (ha : 0 ≤ a) (ha2π : a < 2*Real.pi) + (hx : ∀ t, HasDerivAt x ((2*(a:ℂ)*Complex.I)*x t) t) + (hp : x 1 = x 0) : a = Real.pi ∨ ∀ t, x t = x 0 := by + by_cases hz : x 0 = 0 + · exact Or.inr (fun t => by simp only [linear_solution _ hx t,hz,mul_zero]) + obtain ⟨m,hm⟩ := periodic_frequency a hx hp hz + have hm0 : 0 ≤ m := by + have : 0 ≤ (m:ℝ) := (mul_nonneg_iff_of_pos_left Real.pi_pos).mp (hm ▸ ha) + exact_mod_cast this + have hm2 : m < 2 := by + have : (m:ℝ) < 2 := by nlinarith [Real.pi_pos] + exact_mod_cast this + have he : m = 0 ∨ m = 1 := by omega + rcases he with he | he + · have haz : a = 0 := by simp [hm,he] + exact Or.inr (fun t => by simp only [linear_solution _ hx t,haz,Complex.ofReal_zero, + mul_zero,zero_mul,Complex.exp_zero,one_mul]) + · exact Or.inl (by simpa [he] using hm) + + theorem diagonal_either (j₀ : κ) (d : κ → ℝ) {v : ℝ} + (hv : 0 ≤ v) (hv1 : v ≤ 1) (hd : ∀ j, 0 ≤ d j) + (hdπ : ∀ j, j ≠ j₀ → d j < Real.pi) (hd2π : d j₀ < 2*Real.pi) + {x : ℝ → Vector κ} + (hx : ∀ t, HasDerivAt x (Complex.I • ((2*v) • diag d (x t))) t) + (hp : x 1 = x 0) : v*d j₀ = Real.pi ∨ ∀ t, x t = x 0 := by + have hvd (j : κ) : v*d j ≤ d j := by nlinarith [hd j] + rcases moderate_linear_either (mul_nonneg hv (hd j₀)) (lt_of_le_of_lt (hvd j₀) hd2π) + (coordinate_derivative d v hx j₀) (congrArg (fun z : Vector κ => z j₀) hp) with he | he + · exact Or.inl he + · right + intro t + ext j + by_cases hj : j = j₀ + · subst j; exact he t + · exact slow_linear_constant (mul_nonneg hv (hd j)) (lt_of_le_of_lt (hvd j) (hdπ j hj)) + (coordinate_derivative d v hx j) (congrArg (fun z : Vector κ => z j) hp) t + +end +end HamiltonianODE + +end NonsqueezingInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/HolomorphicBalls.lean b/lean/OAI/Geometry/PolarProducts/HolomorphicBalls.lean new file mode 100644 index 0000000000000000000000000000000000000000..8c7c010369c39314a7dfe5faf594e848f3046c32 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/HolomorphicBalls.lean @@ -0,0 +1,350 @@ +import OAI.Geometry.PolarProducts.RadialMap + +namespace OAI + +universe u41 u42 u43 u44 u45 u46 u47 u48 u49 + +section LowerBoundInline +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter Metric +open scoped Topology ContDiff +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal +open Set Filter Function +open scoped Topology ContDiff +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter +open scoped Topology ContDiff +open Set Filter Function +open scoped Topology ContDiff +open Set Filter Function +open scoped ContDiff Topology +open Set MeasureTheory +open scoped ContDiff Interval Topology +open Set +open scoped Topology ContDiff + +open Set +namespace SingularComparison +noncomputable section + +theorem exists_inner_radius {μ α R : ℝ} (hμ : 0 ≤ μ) (hμα : μ < α) + (hR : 0 < R) (M C : ℝ) : + ∃ r : ℝ, 0 < r ∧ r < R ∧ ∀ (t δ H : ℝ), 0 < t → t ≤ r^2 → 0 < δ → + H ≤ α * Real.log t + C → H + 2 ≤ μ * Real.log (t + δ) - M := by + let L := (-M - C - 2) / (α - μ) + obtain ⟨r, hr, hrsmall⟩ := exists_between (show (0 : ℝ) < min R (Real.sqrt (Real.exp L)) by + exact lt_min hR (Real.sqrt_pos.mpr (Real.exp_pos L))) + refine ⟨r, hr, hrsmall.trans_le (min_le_left _ _), ?_⟩ + intro t δ H ht htr hδ hH + have hre : r < Real.sqrt (Real.exp L) := hrsmall.trans_le (min_le_right _ _) + have hr2 : r^2 ≤ Real.exp L := by + have hs := Real.sq_sqrt (Real.exp_pos L).le + nlinarith [Real.sqrt_nonneg (Real.exp L)] + have htL : Real.log t ≤ L := by + calc + Real.log t ≤ Real.log (Real.exp L) := Real.log_le_log ht (htr.trans hr2) + _ = L := Real.log_exp L + have hlog : Real.log t ≤ Real.log (t + δ) := Real.log_le_log ht (by linarith) + have hcoef : (α - μ) * Real.log t ≤ -M - C - 2 := by + calc + _ ≤ (α - μ) * L := mul_le_mul_of_nonneg_left htL (sub_nonneg.mpr hμα.le) + _ = -M - C - 2 := by dsimp [L]; field_simp [sub_ne_zero.mpr hμα.ne'] + have hmono := mul_le_mul_of_nonneg_left hlog hμ + linarith + +theorem outer_comparison {μ R δ H L M : ℝ} (hμ : 0 ≤ μ) (hδ : 0 < δ) + (hδ1 : δ ≤ 1) (hH : L ≤ H) + (hM : μ * Real.log (R^2 + 1) - L + 2 < M) : + μ * Real.log (R^2 + δ) - M + 2 < H := by + have hp : 0 < R^2 + δ := add_pos_of_nonneg_of_pos (sq_nonneg R) hδ + have hlog := Real.log_le_log hp (show R^2 + δ ≤ R^2 + 1 by linarith) + have hh := mul_le_mul_of_nonneg_left hlog hμ + linarith + +theorem radius_bound {a μ r δ : ℝ} (ha : 0 < a) (_ham : a < μ) (hr : 0 < r) + (hδ : 0 < δ) (hδb : δ < r^2 * (μ / a - 1)) : + a < r^2 * (1 + μ / (r^2 + δ)) := by + have hd : 0 < r^2 + δ := add_pos_of_nonneg_of_pos (sq_nonneg r) hδ + have hr2 : 0 < r^2 := sq_pos_of_pos hr + have hδa : δ * a < r^2 * (μ - a) := by + calc + δ * a < (r^2 * (μ / a - 1)) * a := mul_lt_mul_of_pos_right hδb ha + _ = r^2 * (μ - a) := by field_simp + have hfrac : a < r^2 * μ / (r^2 + δ) := by + apply (lt_div_iff₀ hd).mpr + nlinarith + calc + a < r^2 * μ / (r^2 + δ) := hfrac + _ < r^2 * (1 + μ / (r^2 + δ)) := by + rw [mul_add, mul_one, mul_div_assoc] + linarith + +end +end SingularComparison + +namespace ComplexPotential + +open Set Filter RadialSymplectic +open scoped ContDiff Topology + +noncomputable section + +variable {E : Type u41} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] + +theorem exists_ball_from_logarithmic_pole (J : E →L[ℝ] E) + (hsk : ∀ a b, inner (𝕜 := ℝ) a (J b) = -inner (𝕜 := ℝ) (J a) b) + (hJ : ∀ a, ‖J a‖ = ‖a‖) (hJJ : ∀ a, J (J a) = -a) + {U : Set E} (hU : IsOpen U) (hU0 : (0 : E) ∈ U) + {τ H : E → ℝ} (hτ : ∀ x ∈ U, IsPSHAt J τ x) (hτ0 : τ 0 = 0) + (hH : ∀ x ∈ U, x ≠ 0 → IsPSHAt J H x) + (hcompact : ∀ s : ℝ, 0 < s → s < 1 → IsCompact {x | x ∈ U ∧ τ x ≤ s}) + {s₀ α C ρ : ℝ} (hs₀ : s₀ < 1) (hρ : 0 < ρ) + (htail : ∀ x ∈ U, s₀ ≤ τ x → H x = τ x) + (hpole : ∀ x ∈ U, x ≠ 0 → ‖x‖ ≤ ρ → H x ≤ α * Real.log (‖x‖^2) + C) + {a : ℝ} (ha : 0 < a) (haα : a < α) : + ∃ F : E ≃ₜ E, ContDiff ℝ ∞ (F : E → E) ∧ ContDiff ℝ ∞ (F.symm : E → E) ∧ + (∀ x : E, ‖x‖^2 < a → F x ∈ U) ∧ + ∀ x : E, ‖x‖^2 < a → ∀ v w : E, + ddc J (fun y => ‖y‖^2 + τ y) (F x) (fderiv ℝ (F : E → E) x v) + (fderiv ℝ (F : E → E) x w) = standardTensor J v w := by + obtain ⟨μ, haμ, hμα⟩ := exists_between haα + have hμ : 0 < μ := ha.trans haμ + have hn : {x : E | x ∈ U ∧ τ x < 1/2} ∈ 𝓝 (0 : E) := by + exact inter_mem (hU.mem_nhds hU0) + ((hτ 0 hU0).1.continuousAt.eventually_lt continuousAt_const (by norm_num [hτ0])) + obtain ⟨ε, hε, hεball⟩ := Metric.mem_nhds_iff.mp hn + let R := ε / 2 + have hR : 0 < R := half_pos hε + have hRball (x : E) (hx : ‖x‖ ≤ R) : x ∈ U ∧ τ x < 1/2 := by + apply hεball + rw [Metric.mem_ball, dist_zero_right] + exact hx.trans_lt (half_lt_self hε) + have hsp : IsCompact {x : E | ‖x‖ = R} := by + simpa only [Metric.sphere, dist_zero_right] using isCompact_sphere (0 : E) R + have hcont : ContinuousOn H {x : E | ‖x‖ = R} := by + intro x hx + apply ((hH x (hRball x hx.le).1 ?_).1.continuousAt).continuousWithinAt + intro hz + have : R = 0 := by simpa [hz] using hx.symm + exact hR.ne' this + obtain ⟨L, hL⟩ := hsp.bddBelow_image hcont + let M := μ * Real.log (R^2 + 1) - L + 3 + obtain ⟨r, hr, hrlt, hrdom⟩ := SingularComparison.exists_inner_radius hμ.le hμα + (lt_min hR hρ) M C + have hrR : r < R := hrlt.trans_le (min_le_left _ _) + have hrρ : r < ρ := hrlt.trans_le (min_le_right _ _) + have hδmax : 0 < min (1 : ℝ) (r^2 * (μ / a - 1)) := by + apply lt_min zero_lt_one + exact mul_pos (sq_pos_of_pos hr) (sub_pos.mpr ((one_lt_div ha).mpr haμ)) + obtain ⟨δ, hδ, hδlt⟩ := exists_between hδmax + have hδ1 : δ ≤ 1 := (hδlt.trans_le (min_le_left _ _)).le + have hδb : δ < r^2 * (μ / a - 1) := hδlt.trans_le (min_le_right _ _) + let P : E → ℝ := fun x => μ * logNormSq δ x - M + have hP (x : E) : IsPSHAt J P x := + ((isPSHAt_logNormSq J hsk hJ hJJ hδ.le + (add_pos_of_nonneg_of_pos (sq_nonneg _) hδ)).const_smul hμ.le).sub_const M + have hinner (x : E) (hx0 : x ≠ 0) (hx : ‖x‖ ≤ r) : H x + 1 ≤ P x := by + have hxu := (hRball x (hx.trans hrR.le)).1 + have hh := hrdom (‖x‖^2) δ (H x) (sq_pos_of_pos (norm_pos_iff.mpr hx0)) + ((sq_le_sq₀ (norm_nonneg _) hr.le).mpr hx) hδ + (hpole x hxu hx0 (hx.trans hrρ.le)) + change H x + 1 ≤ μ * Real.log (‖x‖^2 + δ) - M + linarith + have houter (x : E) (_hx : x ∈ U) (hnorm : ‖x‖ = R) : P x + 1 < H x := by + have hh := SingularComparison.outer_comparison hμ.le hδ hδ1 + (hL ⟨x, hnorm, rfl⟩) (show μ * Real.log (R^2 + 1) - L + 2 < M by dsimp [M]; linarith) + change μ * Real.log (‖x‖^2 + δ) - M + 1 < H x + rw [hnorm] + linarith + let T := gluedPotential R H P + have hT (x : E) (hx : x ∈ U) : IsPSHAt J T x := + isPSHAt_gluedPotential J hJJ hr hrR H P hH (fun x _ => hP x) hinner houter hx + obtain ⟨σ, hσmin, hσ1⟩ := exists_between (show max s₀ (1/2 : ℝ) < 1 from + max_lt hs₀ (by norm_num)) + have hσ0 : 0 < σ := lt_trans (by norm_num : (0 : ℝ) < 1/2) + ((le_max_right _ _).trans_lt hσmin) + let K : Set E := {x | x ∈ U ∧ τ x ≤ σ} + have hK : IsCompact K := hcompact σ hσ0 hσ1 + have heq (x : E) (hx : x ∈ U) (hxK : x ∉ K) : T x = τ x := by + have hστ : σ < τ x := lt_of_not_ge (fun h => hxK ⟨hx, h⟩) + have hnorm : R ≤ ‖x‖ := by + by_contra hh + have hhalf := (hRball x (not_le.mp hh).le).2 + linarith [(le_max_right s₀ (1/2 : ℝ)).trans_lt hσmin] + exact (gluedPotential_outer R H P hnorm).trans (htail x hx + (((le_max_left _ _).trans_lt hσmin).le.trans hστ.le)) + obtain ⟨Q, hQ, hQi, _hout, hQmap, hQpull⟩ := exists_potential_transport J hsk hJ + hU hK (fun _ hx => hx.1) hτ hT heq + let F := (radialHomeomorph (E := E) hμ hδ).symm.trans Q + have hF : ContDiff ℝ ∞ (F : E → E) := hQ.comp (contDiff_radialContraction hμ hδ) + have hFi : ContDiff ℝ ∞ (F.symm : E → E) := (contDiff_radialExpansion hμ hδ).comp hQi + have hmap (x : E) (hx : ‖x‖^2 < a) : ‖radialContraction μ δ x‖ < r := by + apply (sq_lt_sq₀ (norm_nonneg _) hr.le).mp + apply radialContraction_mapsTo hμ hδ _ hx + calc + a ≤ r^2 * (1 + μ / (r^2 + δ)) := (SingularComparison.radius_bound ha haμ hr hδ hδb).le + _ = radiusSq μ δ (r^2) := by unfold radiusSq; ring + have hUmap (x : E) (hx : ‖x‖^2 < a) : radialContraction μ δ x ∈ U := + (hRball _ ((hmap x hx).trans hrR).le).1 + refine ⟨F, hF, hFi, fun x hx => (hQmap _).mpr (hUmap x hx), ?_⟩ + intro x hx v w + change ddc J (fun y => ‖y‖^2 + τ y) (Q (radialContraction μ δ x)) + (fderiv ℝ ((Q : E → E) ∘ radialContraction μ δ) x v) + (fderiv ℝ ((Q : E → E) ∘ radialContraction μ δ) x w) = _ + rw [fderiv_comp x (hQ.differentiable (by simp) _) ((contDiff_radialContraction hμ hδ).differentiable + (by simp) x)] + simp only [ContinuousLinearMap.comp_apply] + rw [hQpull _ (hUmap x hx)] + have heT : (fun z : E => ‖z‖^2 + T z) =ᶠ[𝓝 (radialContraction μ δ x)] + fun z => modelPotential μ δ z - M := by + filter_upwards [continuous_norm.continuousAt.eventually_lt continuousAt_const (hmap x hx)] with z hz + dsimp only [T] + rw [gluedPotential_inner hrR H P hinner hz.le] + dsimp [P, logNormSq, modelPotential] + ring + rw [ddc_congr J heT, ddc_sub_const J (contDiff_modelPotential μ hδ).contDiffAt, + radialContraction_pullback J hsk hμ hδ] + +end +end ComplexPotential + +namespace TensorCalculus + +open Set Filter +open scoped Topology ContDiff + +variable {E : Type u42} {F : Type u43} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] + +noncomputable section + +local instance pullbackOneTensorGroup : NormedAddCommGroup (F →L[ℝ] ℝ) := inferInstance +local instance pullbackOneTensorSpace : NormedSpace ℝ (F →L[ℝ] ℝ) := inferInstance +local instance pullbackTwoTensorGroup : NormedAddCommGroup (F →L[ℝ] F →L[ℝ] ℝ) := inferInstance +local instance pullbackTwoTensorSpace : NormedSpace ℝ (F →L[ℝ] F →L[ℝ] ℝ) := inferInstance + +def pullbackOneForm (f : E → F) (γ : F → F →L[ℝ] ℝ) (x : E) : E →L[ℝ] ℝ := + (γ (f x)).comp (fderiv ℝ f x) + +@[simp] theorem pullbackOneForm_apply (f : E → F) (γ : F → F →L[ℝ] ℝ) (x a : E) : + pullbackOneForm f γ x a = γ (f x) (fderiv ℝ f x a) := rfl + +theorem fderiv_pullbackOneForm {f : E → F} {γ : F → F →L[ℝ] ℝ} {x : E} + (hf : DifferentiableAt ℝ f x) (hd : DifferentiableAt ℝ (fderiv ℝ f) x) + (hγ : DifferentiableAt ℝ γ (f x)) (a b : E) : + fderiv ℝ (pullbackOneForm f γ) x a b = + fderiv ℝ γ (f x) (fderiv ℝ f x a) (fderiv ℝ f x b) + + γ (f x) (fderiv ℝ (fderiv ℝ f) x a b) := by + unfold pullbackOneForm + rw [fderiv_clm_comp (c := fun y => γ (f y)) (hγ.comp x hf) hd] + rw [show fderiv ℝ (fun y => γ (f y)) x = (fderiv ℝ γ (f x)).comp (fderiv ℝ f x) by + exact fderiv_comp x hγ hf] + simp only [add_apply, ContinuousLinearMap.comp_apply, ContinuousLinearMap.flip_apply, + ContinuousLinearMap.compL_apply] + ring + +theorem exteriorD_pullbackOneForm {f : E → F} {γ : F → F →L[ℝ] ℝ} {x : E} + (hf : ContDiffAt ℝ ∞ f x) (hγ : DifferentiableAt ℝ γ (f x)) (a b : E) : + exteriorD (pullbackOneForm f γ) x a b = + exteriorD γ (f x) (fderiv ℝ f x a) (fderiv ℝ f x b) := by + have hd := (hf.fderiv_right (m := ∞) (by simp)).differentiableAt (by simp) + have hf' := hf.differentiableAt (by simp) + have hs := hf.isSymmSndFDerivAt (by + rw [minSmoothness_of_isRCLikeNormedField] + exact WithTop.coe_le_coe.mpr le_top) + simp only [exteriorD_apply, fderiv_pullbackOneForm hf' hd hγ] + rw [hs.eq a b] + ring + +end +end TensorCalculus + +namespace ComplexPotential + +open TensorCalculus Set Filter +open scoped ContDiff Topology + +variable {E : Type u44} {F : Type u45} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] + +noncomputable section + +theorem dc_comp (J : E →L[ℝ] E) (K : F →L[ℝ] F) {f : E → F} {φ : F → ℝ} {x : E} + (hf : DifferentiableAt ℝ f x) (hφ : DifferentiableAt ℝ φ (f x)) + (hCR : ∀ a, fderiv ℝ f x (J a) = K (fderiv ℝ f x a)) : + dc J (φ ∘ f) x = pullbackOneForm f (dc K φ) x := by + ext a + rw [dc_apply, fderiv_comp x hφ hf, ContinuousLinearMap.comp_apply, hCR, + pullbackOneForm_apply, dc_apply] + +theorem ddc_comp (J : E →L[ℝ] E) (K : F →L[ℝ] F) {f : E → F} {φ : F → ℝ} {x : E} + (hf : ContDiffAt ℝ ∞ f x) (hφ : ContDiffAt ℝ ∞ φ (f x)) + (hCR : ∀ᶠ y in 𝓝 x, ∀ a, fderiv ℝ f y (J a) = K (fderiv ℝ f y a)) (a b : E) : + ddc J (φ ∘ f) x a b = ddc K φ (f x) (fderiv ℝ f x a) (fderiv ℝ f x b) := by + have h1 : (1 : ℕ∞ω) ≤ ∞ := WithTop.coe_le_coe.mpr le_top + have he : dc J (φ ∘ f) =ᶠ[𝓝 x] pullbackOneForm f (dc K φ) := by + filter_upwards [(hf.of_le h1).eventually (by simp), + hf.continuousAt ((hφ.of_le h1).eventually (by simp)), hCR] with y hy hz hc + exact dc_comp J K (hy.differentiableAt one_ne_zero) + ((show ContDiffAt ℝ (1 : ℕ∞ω) φ (f y) from hz).differentiableAt one_ne_zero) hc + unfold ddc exteriorD + rw [he.fderiv_eq] + exact exteriorD_pullbackOneForm hf ((contDiffAt_dc K hφ).differentiableAt (by simp)) a b + +end +end ComplexPotential + +namespace ComplexPotential + +open Set Filter TensorCalculus +open scoped ContDiff Topology + +noncomputable section + +variable {E : Type u46} {F : Type u47} [NormedAddCommGroup E] [NormedSpace ℂ E] + [NormedAddCommGroup F] [NormedSpace ℂ F] + +def complexStructure (E : Type u48) [NormedAddCommGroup E] [NormedSpace ℂ E] : E →L[ℝ] E := + (Complex.I • ContinuousLinearMap.id ℂ E).restrictScalars ℝ + +@[simp] theorem complexStructure_apply (a : E) : complexStructure E a = Complex.I • a := rfl + +theorem complexStructure_sq (a : E) : complexStructure E (complexStructure E a) = -a := by + simp [complexStructure_apply, smul_smul] + +theorem complexStructure_norm (a : E) : ‖complexStructure E a‖ = ‖a‖ := by + simp [complexStructure_apply, norm_smul] + +theorem fderiv_commutes_complexStructure {f : E → F} {x : E} + (hf : DifferentiableAt ℂ f x) (a : E) : + fderiv ℝ f x (complexStructure E a) = complexStructure F (fderiv ℝ f x a) := by + rw [hf.fderiv_restrictScalars ℝ] + simp [complexStructure_apply] + +theorem complexStructure_skew {G : Type u49} [NormedAddCommGroup G] + [InnerProductSpace ℂ G] (a b : G) : + let : InnerProductSpace ℝ G := InnerProductSpace.complexToReal + inner (𝕜 := ℝ) a (complexStructure G b) = -inner (𝕜 := ℝ) (complexStructure G a) b := by + let : InnerProductSpace ℝ G := InnerProductSpace.complexToReal + simp [real_inner_eq_re_inner ℂ, inner_smul_right, inner_smul_left] + +theorem IsPSHAt.holomorphic_comp {f : E → F} {φ : F → ℝ} {x : E} + (hφ : IsPSHAt (complexStructure F) φ (f x)) + (hf : ContDiffAt ℝ ∞ f x) (hhol : ∀ᶠ y in 𝓝 x, DifferentiableAt ℂ f y) : + IsPSHAt (complexStructure E) (φ ∘ f) x := by + refine ⟨hφ.1.comp x hf, fun a => ?_⟩ + rw [ddc_comp (complexStructure E) (complexStructure F) hf hφ.1 + (hhol.mono (fun y hy => fderiv_commutes_complexStructure hy)), + fderiv_commutes_complexStructure hhol.self_of_nhds] + exact hφ.2 _ + +end +end ComplexPotential + +end LowerBoundInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/HorizontalIntegrals.lean b/lean/OAI/Geometry/PolarProducts/HorizontalIntegrals.lean new file mode 100644 index 0000000000000000000000000000000000000000..79335d059df52078d67bf6b6ab5ff35d0063a5d8 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/HorizontalIntegrals.lean @@ -0,0 +1,315 @@ +import OAI.Geometry.PolarProducts.LensEstimates + +namespace OAI + +universe u52 u53 u54 + +section LowerBoundInline +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter Metric +open scoped Topology ContDiff +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal +open Set Filter Function +open scoped Topology ContDiff +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter +open scoped Topology ContDiff +open Set Filter Function +open scoped Topology ContDiff +open Set Filter Function +open scoped ContDiff Topology +open Set MeasureTheory +open scoped ContDiff Interval Topology +open Set +open scoped Topology ContDiff +open Set +open Set MeasureTheory +open scoped ContDiff Interval Topology +open Set Filter Complex +open scoped Topology ContDiff + +namespace SmoothPaths +open Set Filter MeasureTheory +open scoped Topology ContDiff +noncomputable section + +universe u +variable {E F : Type u} {H : Type u52} [NormedAddCommGroup E] [NormedSpace ℝ E] [ProperSpace E] + [NormedAddCommGroup F] [NormedSpace ℝ F] + [NormedAddCommGroup H] [NormedSpace ℝ H] + +def integralPath : C(SmoothODE.Time, F) →L[ℝ] F := + (ContinuousMap.evalCLM ℝ ⟨1, by norm_num⟩).comp SmoothODE.primitiveCLM + +@[simp] theorem integralPath_apply (u : C(SmoothODE.Time, F)) : + integralPath u = ∫ t in (0 : ℝ)..1, SmoothODE.extend u t := rfl + +theorem contDiff_integralPath {f : E → F} (hf : ContDiff ℝ ∞ f) + (L : H →L[ℝ] C(SmoothODE.Time, E)) : + ContDiff ℝ ∞ (fun z => integralPath (superpose hf.continuous (L z))) := + (integralPath (F := F)).contDiff.comp ((contDiff_superpose hf).comp L.contDiff) + +end +end SmoothPaths + +namespace SmoothExtension +open Set Filter +open scoped Topology ContDiff Manifold +noncomputable section + +variable {E : Type u53} {F : Type u54} [NormedAddCommGroup E] [NormedSpace ℝ E] + [FiniteDimensional ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] + +theorem exists_global_near_closed {U K : Set E} (hU : IsOpen U) (hK : IsClosed K) + (hKU : K ⊆ U) {f : E → F} (hf : ContDiffOn ℝ ∞ f U) : + ∃ f₁ : E → F, ContDiff ℝ ∞ f₁ ∧ f₁ =ᶠ[𝓝ˢ K] f := by + obtain ⟨b, hb0, hb1, _⟩ := exists_contMDiffMap_zero_one_nhds_of_isClosed + (𝓘(ℝ, E)) hU.isClosed_compl hK + (disjoint_left.mpr (by intro x hx hxK; exact hx (hKU hxK))) (n := ⊤) + have hb : ContDiff ℝ ∞ b := contMDiff_iff_contDiff.mp b.contMDiff + refine ⟨fun x => b x • f x, ?_, ?_⟩ + · apply contDiff_iff_contDiffAt.mpr + intro x + by_cases hx : x ∈ U + · exact hb.contDiffAt.smul (hf.contDiffAt (hU.mem_nhds hx)) + · have hh : ∀ᶠ y in 𝓝 x, b y = 0 := hb0.filter_mono (nhds_le_nhdsSet hx) + apply (contDiffAt_const (c := (0 : F))).congr_of_eventuallyEq + filter_upwards [hh] with y hy + simp [hy] + · filter_upwards [hb1] with x hx + simp [hx] + +end +end SmoothExtension + +namespace PlanarLens +open Set Filter Complex MeasureTheory +open scoped Topology ContDiff +noncomputable section + +def density (k : ℕ) (z : ℂ) : ℝ := ‖g z‖^(2*k-2) * ‖deriv g z‖^2 + +def J (k : ℕ) (v t : ℝ) : ℝ := (k : ℝ)^2 * ∫ h in 0..v, density k ((h : ℂ)+(t : ℂ)*I) + +theorem density_nonneg (k : ℕ) (z : ℂ) : 0 ≤ density k z := by + unfold density; positivity + +theorem contDiffOn_density (k : ℕ) : ContDiffOn ℝ ∞ (density k) D := by + have hg : ContDiffOn ℝ ∞ g D := (analyticOnNhd_g.contDiffOn isOpen_D.uniqueDiffOn).restrict_scalars ℝ + have hd : ContDiffOn ℝ ∞ (deriv g) D := + (analyticOnNhd_g.deriv.contDiffOn isOpen_D.uniqueDiffOn).restrict_scalars ℝ + have he : density k = fun z => (‖g z‖^2)^(k-1) * ‖deriv g z‖^2 := by + funext z + simp only [density, ← pow_mul] + congr 2 + omega + rw [he] + exact ((hg.norm_sq ℂ).pow (k-1)).mul (hd.norm_sq ℂ) + +theorem continuousOn_density (k : ℕ) : ContinuousOn (density k) D := + (contDiffOn_density k).continuousOn + +theorem integrable_density {v t : ℝ} (hz : (v : ℂ)+(t : ℂ)*I ∈ D) (k : ℕ) : + IntervalIntegrable (fun h : ℝ => density k ((h : ℂ)+(t : ℂ)*I)) volume 0 v := by + apply ContinuousOn.intervalIntegrable + apply (continuousOn_density k).comp (by fun_prop) + intro h hh + exact horizontal_segment_mem_signed hz hh + +theorem hasDerivAt_J {v t : ℝ} (hz : (v : ℂ)+(t : ℂ)*I ∈ D) (k : ℕ) : + HasDerivAt (fun v => J k v t) ((k : ℝ)^2*density k ((v : ℂ)+(t : ℂ)*I)) v := by + have hc : ContinuousAt (fun h : ℝ => density k ((h : ℂ)+(t : ℂ)*I)) v := + ((continuousOn_density k).continuousAt (isOpen_D.mem_nhds hz)).comp (f := fun h : ℝ => (h : ℂ)+(t : ℂ)*I) + (show ContinuousAt (fun h : ℝ => (h : ℂ)+(t : ℂ)*I) v from by fun_prop) + have hm : StronglyMeasurableAtFilter + (fun h : ℝ => density k ((h : ℂ)+(t : ℂ)*I)) (𝓝 v) volume := by + apply ContinuousAt.stronglyMeasurableAtFilter + (isOpen_D.preimage (show Continuous (fun h : ℝ => (h : ℂ)+(t : ℂ)*I) from by fun_prop)) + (fun h hh => ((continuousOn_density k).continuousAt (isOpen_D.mem_nhds hh)).comp (f := fun a : ℝ => (a : ℂ)+(t : ℂ)*I) + (show ContinuousAt (fun a : ℝ => (a : ℂ)+(t : ℂ)*I) h from by fun_prop)) + v hz + exact (intervalIntegral.integral_hasDerivAt_right (integrable_density hz k) hm hc).const_mul _ + +@[simp] theorem J_zero (k : ℕ) (t : ℝ) : J k 0 t = 0 := by simp [J] + +theorem J_nonneg {v t : ℝ} (hv : 0 ≤ v) (k : ℕ) : 0 ≤ J k v t := by + apply mul_nonneg (sq_nonneg _) + exact intervalIntegral.integral_nonneg hv (fun _ _ => density_nonneg _ _) + +def horizontalPath : ℂ →L[ℝ] C(SmoothODE.Time, ℂ) := by + let L : ℂ →ₗ[ℝ] C(SmoothODE.Time, ℂ) := + { toFun := fun z => ⟨fun a => ((a : ℝ)*z.re : ℝ) + (z.im : ℂ)*I, by fun_prop⟩ + map_add' := by intro z w; ext a; simp; ring + map_smul' := by intro c z; ext a; simp; ring } + apply L.mkContinuous 2 + intro z + apply (ContinuousMap.norm_le _ (by positivity)).mpr + intro a + change ‖(((a : ℝ)*z.re : ℝ) : ℂ)+(z.im : ℂ)*I‖ ≤ _ + calc + _ ≤ ‖(((a : ℝ)*z.re : ℝ) : ℂ)‖ + ‖(z.im : ℂ)*I‖ := norm_add_le _ _ + _ = |(a : ℝ)| * |z.re| + |z.im| := by simp + _ ≤ |z.re| + |z.im| := by + rw [abs_of_nonneg a.2.1] + nlinarith [a.2.2, abs_nonneg z.re] + _ ≤ 2*‖z‖ := by linarith [abs_re_le_norm z, abs_im_le_norm z] + +@[simp] theorem horizontalPath_apply (z : ℂ) (a : SmoothODE.Time) : + horizontalPath z a = (((a : ℝ)*z.re : ℝ) : ℂ)+(z.im : ℂ)*I := rfl + +theorem J_affine (k : ℕ) (v t : ℝ) : + J k v t = (k : ℝ)^2*v*∫ a in (0 : ℝ)..1, density k (((a*v : ℝ) : ℂ)+(t : ℂ)*I) := by + rw [J, mul_assoc] + congr 1 + have hh := intervalIntegral.smul_integral_comp_mul_right + (fun h : ℝ => density k ((h : ℂ)+(t : ℂ)*I)) v (a := 0) (b := 1) + simpa only [smul_eq_mul, zero_mul, one_mul] using hh.symm + +theorem contDiffOn_J (k : ℕ) : ContDiffOn ℝ ∞ (fun z : ℂ => J k z.re z.im) D := by + intro z hz + let C := (fun a : ℝ => (((a*z.re : ℝ) : ℂ)+(z.im : ℂ)*I)) '' Icc (0 : ℝ) 1 + have hCc : IsCompact C := isCompact_Icc.image (by fun_prop) + have hCD : C ⊆ D := by + rintro _ ⟨a, ha, rfl⟩ + apply horizontal_segment_mem_signed (v := z.re) (t := z.im) + (by simpa only [re_add_im] using hz) + by_cases hv : 0 ≤ z.re + · rw [uIcc_of_le hv] + constructor <;> nlinarith [ha.1, ha.2] + · rw [uIcc_of_ge (le_of_not_ge hv)] + constructor <;> nlinarith [ha.1, ha.2] + obtain ⟨f, hf, he⟩ := SmoothExtension.exists_global_near_closed isOpen_D hCc.isClosed hCD + (contDiffOn_density k) + have hglob : ContDiff ℝ ∞ (fun w : ℂ => + (k : ℝ)^2*w.re*SmoothPaths.integralPath (SmoothPaths.superpose hf.continuous (horizontalPath w))) := + (contDiff_const.mul Complex.reCLM.contDiff).mul + (SmoothPaths.contDiff_integralPath hf horizontalPath) + have heq : ∀ᶠ w in 𝓝 z, ∀ a ∈ Icc (0 : ℝ) 1, + f ((((a*w.re : ℝ) : ℂ)+(w.im : ℂ)*I)) = density k ((((a*w.re : ℝ) : ℂ)+(w.im : ℂ)*I)) := by + apply isCompact_Icc.eventually_forall_of_forall_eventually + intro a ha + have hs : ∀ᶠ y in 𝓝 ((((a*z.re : ℝ) : ℂ)+(z.im : ℂ)*I)), f y = density k y := + he.filter_mono (nhds_le_nhdsSet (mem_image_of_mem _ ha)) + exact (show ContinuousAt (fun p : ℂ×ℝ => (((p.2*p.1.re : ℝ) : ℂ)+(p.1.im : ℂ)*I)) (z,a) + from by fun_prop) hs + apply ContDiffAt.contDiffWithinAt + apply hglob.contDiffAt.congr_of_eventuallyEq + filter_upwards [heq] with w hw + rw [J_affine, SmoothPaths.integralPath_apply] + congr 1 + apply intervalIntegral.integral_congr + intro a ha + rw [uIcc_of_le (by norm_num : (0 : ℝ) ≤ 1)] at ha + have hp : projIcc (0 : ℝ) 1 zero_le_one a = ⟨a, ha⟩ := by exact projIcc_of_mem zero_le_one ha + simp only [SmoothODE.extend, hp, SmoothPaths.superpose_apply, horizontalPath_apply] + exact (hw a ha).symm + +end +end PlanarLens + +namespace PlanarLens +open Set Filter Complex MeasureTheory +open scoped Topology ContDiff +noncomputable section + +def rho (t h : ℝ) : ℝ := ‖g ((h : ℂ)+(t : ℂ)*I)‖ +def rhoD (t h : ℝ) : ℝ := A (g ((h : ℂ)+(t : ℂ)*I)) / + (rho t h * ‖deriv F (g ((h : ℂ)+(t : ℂ)*I))‖^2) + +theorem rho_pos {t h : ℝ} (hz : (h : ℂ)+(t : ℂ)*I ∈ D) (hh : 0 < h) : 0 < rho t h := by + apply norm_pos_iff.mpr + intro he + have hre := re_g_pos hz (by simpa using hh) + rw [he] at hre + simp at hre + +theorem hasDerivAt_rho {t h : ℝ} (hz : (h : ℂ)+(t : ℂ)*I ∈ D) (hh : 0 < h) : + HasDerivAt (rho t) (rhoD t h) h := by + have hn := rho_pos hz hh + have hd := (horizontal_normSq_deriv hz).sqrt (ne_of_gt (sq_pos_of_pos hn)) + have he : (fun x : ℝ => Real.sqrt (‖g ((x : ℂ)+(t : ℂ)*I)‖^2)) = rho t := by + funext x; exact Real.sqrt_sq (norm_nonneg _) + rw [he] at hd + convert hd using 1 + rw [Real.sqrt_sq (norm_nonneg _)] + dsimp [rhoD, rho] + ring + +theorem rhoD_pos {t h : ℝ} (hz : (h : ℂ)+(t : ℂ)*I ∈ D) (hh : 0 < h) : 0 < rhoD t h := by + apply div_pos (A_pos (norm_g_lt hz) (re_g_pos hz (by simpa using hh))) + exact mul_pos (rho_pos hz hh) (sq_pos_of_pos (norm_pos_iff.mpr (deriv_F_ne_zero (norm_g_lt hz)))) + +theorem continuousOn_rho {t v : ℝ} (hz : (v : ℂ)+(t : ℂ)*I ∈ D) (hv : 0 ≤ v) : + ContinuousOn (rho t) (Icc 0 v) := by + apply (continuousOn_g.norm).comp (by fun_prop) + intro h hh + exact horizontal_segment_mem hz hv hh + +theorem density_radial {k : ℕ} (hk : 1 ≤ k) {t h : ℝ} + (hz : (h : ℂ)+(t : ℂ)*I ∈ D) (hh : 0 < h) : + density k ((h : ℂ)+(t : ℂ)*I) = + (rho t h)^(2*k-1) * (1/A (g ((h : ℂ)+(t : ℂ)*I))) * rhoD t h := by + have hA := ne_of_gt (A_pos (norm_g_lt hz) (re_g_pos hz (by simpa using hh))) + have hr := ne_of_gt (rho_pos hz hh) + have hF := norm_ne_zero_iff.mpr (deriv_F_ne_zero (norm_g_lt hz)) + have he : deriv g ((h : ℂ)+(t : ℂ)*I) = (deriv F (g ((h : ℂ)+(t : ℂ)*I)))⁻¹ := by + rw [← deriv_g_F (norm_g_lt hz), F_g hz] + rw [density, he, norm_inv] + rw [show 2*k-1 = (2*k-2)+1 by omega, pow_succ] + dsimp [rhoD, rho] at * + field_simp + rw [pow_succ] + +theorem deriv_F_neg {w : ℂ} (hw : ‖w‖ < 1) : deriv F (-w) = deriv F w := by + rw [(hasDerivAt_F (by simpa using hw)).deriv, (hasDerivAt_F hw).deriv] + congr 1 + apply tsum_congr + intro n + simp only [termDeriv] + rw [(show Even (2*n) from ⟨n, by omega⟩).neg_pow] + +theorem deriv_F_conj {w : ℂ} (hw : ‖w‖ < 1) : + deriv F ((starRingEnd ℂ) w) = (starRingEnd ℂ) (deriv F w) := by + have he : (fun n : ℕ => termDeriv n ((starRingEnd ℂ) w)) = + fun n : ℕ => conjCLE (termDeriv n w) := by + funext n + simp [termDeriv, map_ofNat] + rw [(hasDerivAt_F (by simpa using hw)).deriv, (hasDerivAt_F hw).deriv] + simp only [he, ← conjCLE.map_tsum] + simp [map_ofNat] + +theorem density_neg_conj {z : ℂ} (hz : z ∈ D) (k : ℕ) : + density k (-(starRingEnd ℂ) z) = density k z := by + have hd (w : ℂ) (hw : w ∈ D) : deriv g w = (deriv F (g w))⁻¹ := by + rw [← deriv_g_F (norm_g_lt hw), F_g hw] + rw [density, density, hd _ (neg_conj_mem_D hz), hd _ hz, g_neg_conj hz, + deriv_F_neg (by simpa using norm_g_lt hz), deriv_F_conj (norm_g_lt hz)] + simp + +theorem J_neg {v t : ℝ} (hz : (v : ℂ)+(t : ℂ)*I ∈ D) (k : ℕ) : + J k (-v) t = -J k v t := by + have he (h : ℝ) : -(starRingEnd ℂ) ((h : ℂ)+(t : ℂ)*I) = ((-h : ℝ) : ℂ)+(t : ℂ)*I := by + apply Complex.ext <;> simp + have hsub := intervalIntegral.integral_comp_neg + (fun h : ℝ => density k ((h : ℂ)+(t : ℂ)*I)) (a := 0) (b := v) + simp only [neg_zero] at hsub + have hi : (∫ h in (0 : ℝ)..v, density k (((-h : ℝ) : ℂ)+(t : ℂ)*I)) = + ∫ h in (0 : ℝ)..v, density k ((h : ℂ)+(t : ℂ)*I) := by + apply intervalIntegral.integral_congr + intro h hh + dsimp only + rw [← he, density_neg_conj (horizontal_segment_mem_signed hz hh)] + rw [hi, intervalIntegral.integral_symm (a := 0) (b := -v)] at hsub + rw [J, J, ← mul_neg] + congr 1 + linarith + +end +end PlanarLens + +end LowerBoundInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/LensArea.lean b/lean/OAI/Geometry/PolarProducts/LensArea.lean new file mode 100644 index 0000000000000000000000000000000000000000..9fe41839868014881996e2447e8feb1027b509a9 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/LensArea.lean @@ -0,0 +1,455 @@ +import OAI.Geometry.PolarProducts.LensMap + +namespace OAI + +section LowerBoundInline +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter Metric +open scoped Topology ContDiff +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal +open Set Filter Function +open scoped Topology ContDiff +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter +open scoped Topology ContDiff +open Set Filter Function +open scoped Topology ContDiff +open Set Filter Function +open scoped ContDiff Topology +open Set MeasureTheory +open scoped ContDiff Interval Topology +open Set +open scoped Topology ContDiff +open Set +open Set MeasureTheory +open scoped ContDiff Interval Topology +open Set Filter Complex +open scoped Topology ContDiff + +namespace PlanarLens +open Set Filter Complex +open scoped Topology ContDiff +noncomputable section + +def D : Set ℂ := F '' Metric.ball 0 1 + +def g : ℂ → ℂ := Function.invFunOn F (Metric.ball 0 1) + +theorem g_F {w : ℂ} (hw : ‖w‖ < 1) : g (F w) = w := + F_injOn.leftInvOn_invFunOn (by simpa using hw) + +theorem F_g {z : ℂ} (hz : z ∈ D) : F (g z) = z := + Function.invFunOn_eq hz + +theorem norm_g_lt {z : ℂ} (hz : z ∈ D) : ‖g z‖ < 1 := by + have h := Function.invFunOn_mem hz + simpa [g] using h + +theorem zero_mem_D : (0 : ℂ) ∈ D := ⟨0, by simp, F_zero⟩ + +@[simp] theorem g_zero : g 0 = 0 := by + simpa using g_F (by simp : ‖(0 : ℂ)‖ < 1) + +theorem g_eq_zero_iff {z : ℂ} (hz : z ∈ D) : g z = 0 ↔ z = 0 := by + constructor + · intro h + rw [← F_g hz, h, F_zero] + · rintro rfl; exact g_zero + +theorem deriv_F_ne_zero {w : ℂ} (hw : ‖w‖ < 1) : deriv F w ≠ 0 := by + intro h + have hh := deriv_F_re_pos hw + rw [h, zero_re] at hh + exact lt_irrefl _ hh + +theorem analyticOnNhd_g : AnalyticOnNhd ℂ g D := by + rintro z ⟨w, hw, rfl⟩ + have hw' : ‖w‖ < 1 := by simpa using hw + apply (analyticAt_comp_iff_of_deriv_ne_zero (analyticOnNhd_F w hw) + (deriv_F_ne_zero hw')).mp + apply analyticAt_id.congr + filter_upwards [Metric.isOpen_ball.mem_nhds hw] with v hv + exact (g_F (by simpa using hv)).symm + +theorem isOpen_D : IsOpen D := by + rcases analyticOnNhd_F.is_constant_or_isOpen (convex_ball (0 : ℂ) 1).isPreconnected with h | h + · obtain ⟨c, hc⟩ := h + have hz : (0 : ℂ) ∈ Metric.ball 0 1 := by simp + have hh : (1/2 : ℂ) ∈ Metric.ball 0 1 := by norm_num [Metric.mem_ball, norm_div] + have he := F_injOn hz hh ((hc 0 hz).trans (hc _ hh).symm) + norm_num at he + · exact h _ Subset.rfl Metric.isOpen_ball + +theorem isBounded_D : Bornology.IsBounded D := by + apply ((isCompact_closedBall (0 : ℂ) 1).image_of_continuousOn continuousOn_F_closedBall).isBounded.subset + exact image_mono Metric.ball_subset_closedBall + +theorem continuousOn_g : ContinuousOn g D := analyticOnNhd_g.continuousOn + +theorem g_injOn : InjOn g D := by + intro z hz w hw he + rw [← F_g hz, ← F_g hw, he] + +theorem deriv_g_F {w : ℂ} (hw : ‖w‖ < 1) : deriv g (F w) = (deriv F w)⁻¹ := by + have hFw : F w ∈ D := ⟨w, by simpa using hw, rfl⟩ + have hg := (analyticOnNhd_g _ hFw).differentiableAt.hasDerivAt + have hf := (hasDerivAt_F hw).differentiableAt.hasDerivAt + have hc := hg.comp w hf + have he : g ∘ F =ᶠ[𝓝 w] id := by + filter_upwards [Metric.isOpen_ball.mem_nhds (by simpa using hw : w ∈ Metric.ball 0 1)] with z hz + exact g_F (by simpa using hz) + have hid := hc.congr_of_eventuallyEq he.symm + have hm : deriv g (F w) * deriv F w = 1 := hid.unique (hasDerivAt_id w) + apply mul_right_cancel₀ (deriv_F_ne_zero hw) + rw [hm, inv_mul_cancel₀ (deriv_F_ne_zero hw)] + +theorem deriv_g_ne_zero {z : ℂ} (hz : z ∈ D) : deriv g z ≠ 0 := by + rw [← F_g hz, deriv_g_F (norm_g_lt hz)] + exact inv_ne_zero (deriv_F_ne_zero (norm_g_lt hz)) + +theorem re_g_pos {z : ℂ} (hz : z ∈ D) (hr : 0 < z.re) : 0 < (g z).re := by + by_contra h + rcases (le_of_not_gt h).eq_or_lt with he | he + · have hh := re_F_eq_zero he + rw [F_g hz] at hh + linarith + · have hh := re_F_neg (norm_g_lt hz) he + rw [F_g hz] at hh + linarith + +end +end PlanarLens + +namespace PlanarLens +open Set Filter Complex +open scoped Topology ContDiff +noncomputable section + +def T (r : ℝ) : ℝ := (F ((r : ℂ)*I)).im + +theorem F_imaginary (r : ℝ) : F ((r : ℂ)*I) = (T r : ℂ)*I := by + apply Complex.ext <;> simp [T, re_F_imaginary] + +@[simp] theorem T_zero : T 0 = 0 := by simp [T] + +@[simp] theorem T_neg (r : ℝ) : T (-r) = -T r := by simp [T] + +theorem summable_odd_sq : Summable (fun n : ℕ => 1/(2*(n : ℝ)+1)^2) := by + have h := hasSum_zeta_two.summable.comp_injective (i := fun n : ℕ => 2*n+1) + (by intro n m h; dsimp at h; omega) + simpa only [Function.comp_def, Nat.cast_add, Nat.cast_mul, Nat.cast_ofNat, Nat.cast_one] using h + +theorem tsum_odd_sq : (∑' n : ℕ, 1/(2*(n : ℝ)+1)^2) = Real.pi^2/8 := by + have he : HasSum (fun n : ℕ => 1/((2*n : ℕ) : ℝ)^2) (Real.pi^2/24) := by + have hh : HasSum (fun n : ℕ => (1/4 : ℝ) * (1/(n : ℝ)^2)) + ((1/4 : ℝ)*(Real.pi^2/6)) := hasSum_zeta_two.mul_left _ + have eqf : (fun n : ℕ => 1/((2*n : ℕ) : ℝ)^2) = + (fun n : ℕ => (1/4 : ℝ)*(1/(n : ℝ)^2)) := by + funext n + push_cast + simp only [mul_pow, div_mul_eq_div_div] + norm_num + ring + rw [eqf, show Real.pi^2/24 = (1/4 : ℝ)*(Real.pi^2/6) by ring] + exact hh + have ho : HasSum (fun n : ℕ => 1/((2*n+1 : ℕ) : ℝ)^2) + (∑' n : ℕ, 1/(2*(n : ℝ)+1)^2) := by + simpa only [Nat.cast_add, Nat.cast_mul, Nat.cast_ofNat, Nat.cast_one] using summable_odd_sq.hasSum + have h := (HasSum.even_add_odd (f := fun n : ℕ => 1/(n : ℝ)^2) he ho).unique hasSum_zeta_two + linarith + +@[simp] theorem F_I : F (I : ℂ) = (I : ℂ) := by + have he : (fun n : ℕ => term n I) = (fun n : ℕ => (I : ℂ) * ((1/(2*(n : ℝ)+1)^2 : ℝ) : ℂ)) := by + funext n + have hp : (-1 : ℂ)^n * (I : ℂ)^(2*n+1) = (I : ℂ) := by + rw [pow_succ, pow_mul, I_sq] + have h1 : (-1 : ℂ)^n * (-1)^n = 1 := by rw [← mul_pow]; simp + linear_combination I * h1 + simp only [term, hp, ofReal_div, ofReal_one, ofReal_pow, ofReal_add, ofReal_mul, + ofReal_ofNat, ofReal_natCast] + ring + rw [F, he, tsum_mul_left, ← Complex.ofReal_tsum, tsum_odd_sq] + push_cast + field_simp [Real.pi_ne_zero] + +@[simp] theorem T_one : T 1 = 1 := by simp [T] + +theorem continuousOn_T : ContinuousOn T (Icc (-1) 1) := by + have hh : ContinuousOn (fun r : ℝ => F ((r : ℂ)*I)) (Icc (-1) 1) := by + apply continuousOn_F_closedBall.comp (by fun_prop) + intro r hr + simpa [Metric.mem_closedBall, norm_mul, norm_real, Real.norm_eq_abs, abs_le] using hr + exact Complex.continuous_im.comp_continuousOn hh + +theorem hasDerivAt_T {r : ℝ} (hr : |r| < 1) : + HasDerivAt T (deriv F ((r : ℂ)*I)).re r := by + have hf := (hasDerivAt_F (w := (r : ℂ)*I) (by simpa [norm_mul] using hr)).differentiableAt.hasDerivAt + have hc := hf.comp (r : ℂ) ((hasDerivAt_id _).mul_const I) + have hm := Complex.imCLM.hasFDerivAt.comp_hasDerivAt r hc.comp_ofReal + convert hm using 1 <;> first | rfl | simp + +theorem strictMonoOn_T : StrictMonoOn T (Icc (-1) 1) := by + apply strictMonoOn_of_hasDerivWithinAt_pos (convex_Icc _ _) continuousOn_T + · intro r hr + have h : |r| < 1 := by simpa only [interior_Icc, mem_Ioo, abs_lt] using hr + exact (hasDerivAt_T h).hasDerivWithinAt + · intro r hr + have h : |r| < 1 := by simpa only [interior_Icc, mem_Ioo, abs_lt] using hr + exact deriv_F_re_pos (by simpa [norm_mul] using h) + +theorem T_pos {r : ℝ} (hr : 0 < r) (hr1 : r ≤ 1) : 0 < T r := by + have h := strictMonoOn_T (by norm_num : (0 : ℝ) ∈ Icc (-1) 1) ⟨by linarith, hr1⟩ hr + simpa using h + +theorem T_lt_one {r : ℝ} (hr : -1 ≤ r) (hr1 : r < 1) : T r < 1 := by + have h := strictMonoOn_T ⟨hr, hr1.le⟩ (by norm_num : (1 : ℝ) ∈ Icc (-1) 1) hr1 + simpa using h + +theorem exists_T_eq {t : ℝ} (ht : |t| < 1) : ∃ r ∈ Ioo (-1) 1, T r = t := by + have hh : t ∈ Icc (T (-1)) (T 1) := by simpa using + ⟨(abs_lt.mp ht).1.le, (abs_lt.mp ht).2.le⟩ + obtain ⟨r, hr, he⟩ := intermediate_value_Icc (by norm_num : (-1 : ℝ) ≤ 1) continuousOn_T hh + refine ⟨r, ⟨hr.1.lt_of_ne ?_, hr.2.lt_of_ne ?_⟩, he⟩ + · intro h + rw [← h] at he + have h' : T (-1) = -1 := by simp + rw [h'] at he + linarith [abs_lt.mp ht |>.1] + · intro h + rw [h, T_one] at he + linarith [abs_lt.mp ht |>.2] + +end +end PlanarLens + +namespace PlanarLens +open Set Filter Complex +open scoped Topology ContDiff +noncomputable section + +def A (w : ℂ) : ℝ := (w * deriv F w).re + +theorem A_pos {w : ℂ} (hw : ‖w‖ < 1) (hr : 0 < w.re) : 0 < A w := by + rw [A, re_mul_deriv_F hw] + apply mul_pos (by positivity) + apply Real.arctan_pos.mpr + apply div_pos (by linarith) + nlinarith [norm_nonneg w] + +theorem hasDerivAt_horizontal_g {v t : ℝ} (hz : (v : ℂ)+(t : ℂ)*I ∈ D) : + HasDerivAt (fun h : ℝ => g ((h : ℂ)+(t : ℂ)*I)) + (deriv g ((v : ℂ)+(t : ℂ)*I)) v := by + have hg := (analyticOnNhd_g _ hz).differentiableAt.hasDerivAt + have hc := hg.comp (v : ℂ) ((hasDerivAt_id _).add_const ((t : ℂ)*I)) + convert hc.comp_ofReal using 1 <;> first | rfl | simp only [mul_one] + +theorem horizontal_normSq_deriv {v t : ℝ} (hz : (v : ℂ)+(t : ℂ)*I ∈ D) : + HasDerivAt (fun h : ℝ => ‖g ((h : ℂ)+(t : ℂ)*I)‖^2) + (2*A (g ((v : ℂ)+(t : ℂ)*I)) / ‖deriv F (g ((v : ℂ)+(t : ℂ)*I))‖^2) v := by + have hh := (hasDerivAt_horizontal_g hz).norm_sq + have he : deriv g ((v : ℂ)+(t : ℂ)*I) = (deriv F (g ((v : ℂ)+(t : ℂ)*I)))⁻¹ := by + rw [← deriv_g_F (norm_g_lt hz), F_g hz] + rw [he] at hh + convert hh using 1 + rw [real_inner_eq_re_inner ℂ, RCLike.inner_apply] + simp only [A, Complex.sq_norm, Complex.mul_re, Complex.inv_re, Complex.inv_im, + Complex.conj_re, Complex.conj_im, RCLike.re_to_complex] + ring + +theorem horizontal_normSq_deriv_pos {v t : ℝ} (hz : (v : ℂ)+(t : ℂ)*I ∈ D) + (hv : 0 < v) : + 0 < 2*A (g ((v : ℂ)+(t : ℂ)*I)) / ‖deriv F (g ((v : ℂ)+(t : ℂ)*I))‖^2 := by + apply div_pos + · exact mul_pos (by norm_num) (A_pos (norm_g_lt hz) (re_g_pos hz (by simpa using hv))) + · exact sq_pos_of_pos (norm_pos_iff.mpr (deriv_F_ne_zero (norm_g_lt hz))) + +theorem horizontal_segment_mem {v t : ℝ} (hz : (v : ℂ)+(t : ℂ)*I ∈ D) + (_hv : 0 ≤ v) {h : ℝ} (hh : h ∈ Icc 0 v) : (h : ℂ)+(t : ℂ)*I ∈ D := by + let R := ‖g ((v : ℂ)+(t : ℂ)*I)‖ + have hR : R < 1 := norm_g_lt hz + let C := F '' Metric.closedBall (0 : ℂ) R + have hCD : C ⊆ D := by + apply image_mono + intro w hw + have hw' : ‖w‖ ≤ R := by simpa using hw + simpa using hw'.trans_lt hR + have hCc : IsCompact C := by + apply (isCompact_closedBall (0 : ℂ) R).image_of_continuousOn + exact continuousOn_F_closedBall.mono (Metric.closedBall_subset_closedBall hR.le) + have hCm {a : ℝ} : (a : ℂ)+(t : ℂ)*I ∈ C ↔ + (a : ℂ)+(t : ℂ)*I ∈ D ∧ ‖g ((a : ℂ)+(t : ℂ)*I)‖ ≤ R := by + constructor + · rintro ⟨w, hw, he⟩ + have hw' : ‖w‖ ≤ R := by simpa using hw + refine ⟨hCD ⟨w, hw, he⟩, ?_⟩ + rw [← he, g_F (hw'.trans_lt hR)] + exact hw' + · rintro ⟨ha, hr⟩ + exact ⟨g _, by simpa using hr, F_g ha⟩ + let S := Icc h v ∩ (fun a : ℝ => (a : ℂ)+(t : ℂ)*I) ⁻¹' C + have hSc : IsCompact S := isCompact_Icc.inter_right (hCc.isClosed.preimage (by fun_prop)) + have hvS : v ∈ S := ⟨⟨hh.2, le_rfl⟩, hCm.mpr ⟨hz, le_rfl⟩⟩ + obtain ⟨a, ha, hmin⟩ := hSc.exists_isMinOn ⟨v, hvS⟩ (continuous_id.continuousOn) + have haD := (hCm.mp ha.2).1 + have haR := (hCm.mp ha.2).2 + have hha : h ≤ a := ha.1.1 + by_cases he : a = h + · simpa only [he] using haD + have hha' : h < a := lt_of_le_of_ne hha (Ne.symm he) + have ha0 : 0 < a := hh.1.trans_lt hha' + have hopen : IsOpen ((fun b : ℝ => (b : ℂ)+(t : ℂ)*I) ⁻¹' D) := + isOpen_D.preimage (by fun_prop) + obtain ⟨ε, hε, hball⟩ := Metric.isOpen_iff.mp hopen a haD + let d := min (a-h) ε / 2 + have hd : 0 < d := by dsimp [d]; positivity + have hdh : d < a-h := by dsimp [d]; linarith [min_le_left (a-h) ε] + have hdε : d < ε := by dsimp [d]; linarith [min_le_right (a-h) ε] + let b := a-d + have hhb : h < b := by dsimp [b]; linarith + have hba : b < a := by dsimp [b]; linarith + have hseg : ∀ x ∈ Icc b a, (x : ℂ)+(t : ℂ)*I ∈ D := by + intro x hx + apply hball + rw [Metric.mem_ball, Real.dist_eq, abs_of_nonpos (by linarith [hx.2] : x-a ≤ 0)] + have hxb : a-d ≤ x := hx.1 + linarith + have hmono : StrictMonoOn (fun x : ℝ => ‖g ((x : ℂ)+(t : ℂ)*I)‖^2) (Icc b a) := by + apply strictMonoOn_of_hasDerivWithinAt_pos (convex_Icc b a) + (fun x hx => (horizontal_normSq_deriv (hseg x hx)).continuousAt.continuousWithinAt) + (fun x hx => (horizontal_normSq_deriv (hseg x (interior_subset hx))).hasDerivWithinAt) + intro x hx + have hx' := interior_subset hx + apply horizontal_normSq_deriv_pos (hseg x hx') + linarith [hx'.1, hh.1] + have hnorm : ‖g ((b : ℂ)+(t : ℂ)*I)‖ ≤ R := by + apply le_of_sq_le_sq _ (norm_nonneg _) + have hm := hmono ⟨le_rfl, hba.le⟩ ⟨hba.le, le_rfl⟩ hba + have hR0 : 0 ≤ R := norm_nonneg _ + nlinarith [norm_nonneg (g ((a : ℂ)+(t : ℂ)*I))] + have hbS : b ∈ S := ⟨⟨hhb.le, hba.le.trans ha.1.2⟩, + hCm.mpr ⟨hseg b ⟨le_rfl, hba.le⟩, hnorm⟩⟩ + have ham : a ≤ b := hmin hbS + exact False.elim (not_le_of_gt hba ham) + +theorem neg_conj_mem_D {z : ℂ} (hz : z ∈ D) : -(starRingEnd ℂ) z ∈ D := by + rcases hz with ⟨w, hw, rfl⟩ + refine ⟨-(starRingEnd ℂ) w, by simpa using hw, ?_⟩ + simp + +theorem g_neg_conj {z : ℂ} (hz : z ∈ D) : g (-(starRingEnd ℂ) z) = -(starRingEnd ℂ) (g z) := by + apply F_injOn (by simpa using norm_g_lt (neg_conj_mem_D hz)) + (by simpa using norm_g_lt hz) + rw [F_g (neg_conj_mem_D hz)] + simp [F_g hz] + +theorem conj_mem_D {z : ℂ} (hz : z ∈ D) : (starRingEnd ℂ) z ∈ D := by + rcases hz with ⟨w, hw, rfl⟩ + exact ⟨(starRingEnd ℂ) w, by simpa using hw, by simp⟩ + +theorem g_conj {z : ℂ} (hz : z ∈ D) : g ((starRingEnd ℂ) z) = (starRingEnd ℂ) (g z) := by + apply F_injOn (by simpa using norm_g_lt (conj_mem_D hz)) + (by simpa using norm_g_lt hz) + simp [F_g (conj_mem_D hz), F_g hz] + +theorem horizontal_segment_mem_signed {v t : ℝ} (hz : (v : ℂ)+(t : ℂ)*I ∈ D) + {h : ℝ} (hh : h ∈ uIcc 0 v) : (h : ℂ)+(t : ℂ)*I ∈ D := by + rcases le_total 0 v with hv | hv + · rw [uIcc_of_le hv] at hh + exact horizontal_segment_mem hz hv hh + · rw [uIcc_of_ge hv] at hh + have he (a : ℝ) : -((starRingEnd ℂ) ((a : ℂ)+(t : ℂ)*I)) = ((-a : ℝ) : ℂ)+(t : ℂ)*I := by + apply Complex.ext <;> simp + have hz' := neg_conj_mem_D hz + rw [he] at hz' + have hh' : -h ∈ Icc 0 (-v) := ⟨by linarith [hh.2], by linarith [hh.1]⟩ + have hhD := horizontal_segment_mem hz' (by linarith) hh' + have hneg := neg_conj_mem_D hhD + simpa only [he, neg_neg] using hneg + +theorem axis_mem_D {v t : ℝ} (hz : (v : ℂ)+(t : ℂ)*I ∈ D) : (t : ℂ)*I ∈ D := by + simpa using horizontal_segment_mem_signed hz (left_mem_uIcc (a := 0) (b := v)) + +theorem g_axis_re_zero {t : ℝ} (ht : (t : ℂ)*I ∈ D) : (g ((t : ℂ)*I)).re = 0 := by + have he : -(starRingEnd ℂ) ((t : ℂ)*I) = (t : ℂ)*I := by simp + have hh := g_neg_conj ht + rw [he] at hh + have hr := congr_arg Complex.re hh + simp only [neg_re, conj_re] at hr + linarith + +theorem axis_image {t : ℝ} (ht : (t : ℂ)*I ∈ D) : + ∃ r ∈ Ioo (-1 : ℝ) 1, g ((t : ℂ)*I) = (r : ℂ)*I ∧ T r = t := by + let r := (g ((t : ℂ)*I)).im + have he : g ((t : ℂ)*I) = (r : ℂ)*I := by + apply Complex.ext <;> simp [r, g_axis_re_zero ht] + have hr : |r| < 1 := by + have hh := norm_g_lt ht + rw [he] at hh + simpa [norm_mul] using hh + refine ⟨r, abs_lt.mp hr, he, ?_⟩ + have hh := congr_arg Complex.im (F_g ht) + rw [he] at hh + simpa [T] using hh + +theorem im_mem_Ioo {z : ℂ} (hz : z ∈ D) : z.im ∈ Ioo (-1 : ℝ) 1 := by + have hz' : (z.re : ℂ)+(z.im : ℂ)*I ∈ D := by simpa using hz + obtain ⟨r, hr, _, ht⟩ := axis_image (axis_mem_D hz') + rw [← ht] + refine ⟨?_, T_lt_one hr.1.le hr.2⟩ + have h := strictMonoOn_T (by norm_num : (-1 : ℝ) ∈ Icc (-1) 1) ⟨hr.1.le, hr.2.le⟩ hr.1 + simpa using h + +theorem imaginary_mem_D {t : ℝ} (ht : |t| < 1) : (t : ℂ)*I ∈ D := by + obtain ⟨r, hr, he⟩ := exists_T_eq ht + exact ⟨(r : ℂ)*I, by simpa [Metric.mem_ball, norm_mul, abs_lt] using hr, + by rw [F_imaginary r, he]⟩ + +theorem horizontal_radius_strictMono {v t : ℝ} (hz : (v : ℂ)+(t : ℂ)*I ∈ D) + (hv : 0 ≤ v) : StrictMonoOn (fun h : ℝ => ‖g ((h : ℂ)+(t : ℂ)*I)‖) (Icc 0 v) := by + have hm : StrictMonoOn (fun h : ℝ => ‖g ((h : ℂ)+(t : ℂ)*I)‖^2) (Icc 0 v) := by + apply strictMonoOn_of_hasDerivWithinAt_pos (convex_Icc 0 v) + (fun h hh => (horizontal_normSq_deriv (horizontal_segment_mem hz hv hh)).continuousAt.continuousWithinAt) + (fun h hh => (horizontal_normSq_deriv (horizontal_segment_mem hz hv (interior_subset hh))).hasDerivWithinAt) + intro h hh + apply horizontal_normSq_deriv_pos (horizontal_segment_mem hz hv (interior_subset hh)) + have hh' : h ∈ Ioo 0 v := by simpa only [interior_Icc] using hh + exact hh'.1 + intro a ha b hb hab + have hh := hm ha hb hab + nlinarith [norm_nonneg (g ((a : ℂ)+(t : ℂ)*I)), norm_nonneg (g ((b : ℂ)+(t : ℂ)*I))] + +theorem T_norm_g_axis {t : ℝ} (ht : (t : ℂ)*I ∈ D) : T ‖g ((t : ℂ)*I)‖ = |t| := by + obtain ⟨r, hr, he, hT⟩ := axis_image ht + rw [he] + simp only [norm_mul, norm_real, norm_I, mul_one, Real.norm_eq_abs] + rcases le_total 0 r with hr0 | hr0 + · rw [abs_of_nonneg hr0, ← hT, abs_of_nonneg] + have h := strictMonoOn_T.monotoneOn (by norm_num : (0 : ℝ) ∈ Icc (-1) 1) + ⟨hr.1.le, hr.2.le⟩ hr0 + simpa using h + · rw [abs_of_nonpos hr0, T_neg, ← hT, abs_of_nonpos] + have h := strictMonoOn_T.monotoneOn ⟨hr.1.le, hr.2.le⟩ + (by norm_num : (0 : ℝ) ∈ Icc (-1) 1) hr0 + simpa using h + +theorem vertical_gap_pos {z : ℂ} (hz : z ∈ D) (hr : 0 < z.re) : + 0 < T ‖g z‖ - |z.im| := by + have hz' : (z.re : ℂ)+(z.im : ℂ)*I ∈ D := by simpa using hz + have hnorm := horizontal_radius_strictMono hz' hr.le + (left_mem_Icc.mpr hr.le) (right_mem_Icc.mpr hr.le) hr + simp only [ofReal_zero, zero_add, re_add_im] at hnorm + rw [← T_norm_g_axis (axis_mem_D hz')] + have hh := strictMonoOn_T + ⟨by linarith [norm_nonneg (g ((z.im : ℂ)*I))], (norm_g_lt (axis_mem_D hz')).le⟩ + ⟨by linarith [norm_nonneg (g z)], (norm_g_lt hz).le⟩ hnorm + linarith + +end +end PlanarLens + +end LowerBoundInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/LensBounds.lean b/lean/OAI/Geometry/PolarProducts/LensBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..41dae90641f3946068a25be0378234b738113343 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/LensBounds.lean @@ -0,0 +1,246 @@ +import OAI.Geometry.PolarProducts.TipEstimates + +namespace OAI + +section LowerBoundInline +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter Metric +open scoped Topology ContDiff +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal +open Set Filter Function +open scoped Topology ContDiff +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter +open scoped Topology ContDiff +open Set Filter Function +open scoped Topology ContDiff +open Set Filter Function +open scoped ContDiff Topology +open Set MeasureTheory +open scoped ContDiff Interval Topology +open Set +open scoped Topology ContDiff +open Set +open Set MeasureTheory +open scoped ContDiff Interval Topology +open Set Filter Complex +open scoped Topology ContDiff +open MeasureTheory intervalIntegral Set +open scoped Real + +namespace PlanarLens +open Set Filter Complex MeasureTheory +open scoped Topology ContDiff +noncomputable section + +theorem exists_inner_bound {a : ℝ} (ha0 : 0 ≤ a) (ha1 : a < 1) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ (k : ℕ) (t v : ℝ), + (v : ℂ)+(t : ℂ)*I ∈ D → 0 ≤ v → rho t v ≤ a → + (k : ℝ)*∫ h in 0..v, density k ((h : ℂ)+(t : ℂ)*I) ≤ + C*(k : ℝ)*a^(2*k-2) := by + let Cset := F '' Metric.closedBall (0 : ℂ) a + have hCD : Cset ⊆ D := by + apply image_mono + intro w hw + have hw' : ‖w‖ ≤ a := by simpa using hw + simpa using hw'.trans_lt ha1 + have hCc : IsCompact Cset := (isCompact_closedBall (0 : ℂ) a).image_of_continuousOn + (continuousOn_F_closedBall.mono (Metric.closedBall_subset_closedBall ha1.le)) + obtain ⟨N, hN⟩ := hCc.exists_bound_of_continuousOn + (analyticOnNhd_g.deriv.continuousOn.mono hCD) + obtain ⟨B, hB0, hB⟩ := isBounded_D.exists_pos_norm_le + let M := max N 0 + have hM : 0 ≤ M := le_max_right _ _ + refine ⟨B*M^2, mul_nonneg hB0.le (sq_nonneg _), ?_⟩ + intro k t v hz hv hra + have hvB : v ≤ B := by + have hh := (abs_re_le_norm ((v : ℂ)+(t : ℂ)*I)).trans (hB _ hz) + simpa only [add_re, ofReal_re, mul_re, I_re, I_im, ofReal_im, mul_zero, zero_mul, sub_self, add_zero, abs_of_nonneg hv] using hh + have hpi : IntervalIntegrable (fun h : ℝ => a^(2*k-2)*M^2) volume 0 v := intervalIntegrable_const + have hii := integrable_density hz k + have hcmp : ∫ h in 0..v, density k ((h : ℂ)+(t : ℂ)*I) ≤ v*(a^(2*k-2)*M^2) := by + have hh : ∫ h in 0..v, density k ((h : ℂ)+(t : ℂ)*I) ≤ + ∫ h in 0..v, a^(2*k-2)*M^2 := by + apply intervalIntegral.integral_mono_on hv hii hpi + intro h hh + have hhz := horizontal_segment_mem hz hv hh + have hr : rho t h ≤ a := ((horizontal_radius_strictMono hz hv).monotoneOn hh + (right_mem_Icc.mpr hv) hh.2).trans hra + have hc : (h : ℂ)+(t : ℂ)*I ∈ Cset := + ⟨g _, by simpa [rho] using hr, F_g hhz⟩ + have hn : ‖deriv g ((h : ℂ)+(t : ℂ)*I)‖ ≤ M := (hN _ hc).trans (le_max_left _ _) + exact mul_le_mul (pow_le_pow_left₀ (norm_nonneg _) hr _) (pow_le_pow_left₀ (norm_nonneg _) hn _) + (sq_nonneg _) (pow_nonneg ha0 _) + simpa only [intervalIntegral.integral_const, sub_zero, smul_eq_mul] using hh + calc + _ ≤ (k : ℝ)*(v*(a^(2*k-2)*M^2)) := mul_le_mul_of_nonneg_left hcmp (Nat.cast_nonneg k) + _ ≤ (k : ℝ)*(B*(a^(2*k-2)*M^2)) := mul_le_mul_of_nonneg_left + (mul_le_mul_of_nonneg_right hvB (mul_nonneg (pow_nonneg ha0 _) (sq_nonneg _))) (Nat.cast_nonneg k) + _ = _ := by ring + +theorem exists_uniform_error_bound {a : ℝ} (ha : 1/2 ≤ a) (ha1 : a < 1) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ (k : ℕ), 1 ≤ k → ∀ (t v : ℝ), + (v : ℂ)+(t : ℂ)*I ∈ D → 0 ≤ v → + (k : ℝ)*∫ h in 0..v, density k ((h : ℂ)+(t : ℂ)*I) ≤ + Real.pi/4*(rho t v)^(2*k) + C*(k : ℝ)*a^(2*k-2) + + Real.pi^3/Real.sqrt (tailSlope a)*(1+Real.pi/Real.exp 1) := by + have ha0 : 0 ≤ a := by linarith + obtain ⟨C, hC, hinner⟩ := exists_inner_bound ha0 ha1 + refine ⟨C, hC, ?_⟩ + intro k hk t v hz hv + have hE : 0 ≤ Real.pi^3/Real.sqrt (tailSlope a)*(1+Real.pi/Real.exp 1) := by positivity + have hCterm : 0 ≤ C*(k : ℝ)*a^(2*k-2) := by positivity + have hR : 0 ≤ Real.pi/4*(rho t v)^(2*k) := by + exact mul_nonneg (by positivity) (pow_nonneg (norm_nonneg _) _) + by_cases hr : rho t v ≤ a + · exact (hinner k t v hz hv hr).trans (by linarith) + by_cases hl : a ≤ rho t 0 + · have hh := outer_integral_bound hk hz (le_refl 0) hv ha hl + have hn : 0 ≤ Real.pi/4*(rho t 0)^(2*k) := + mul_nonneg (by positivity) (pow_nonneg (norm_nonneg _) _) + nlinarith + have haI : a ∈ Icc (rho t 0) (rho t v) := ⟨(lt_of_not_ge hl).le, (lt_of_not_ge hr).le⟩ + obtain ⟨u, hu, heu⟩ := intermediate_value_Icc hv (continuousOn_rho hz hv) haI + have huD := horizontal_segment_mem hz hv hu + have hleft := hinner k t u huD hu.1 heu.le + have hright := outer_integral_bound hk hz hu.1 hu.2 ha heu.ge + have hIuv : IntervalIntegrable (fun h : ℝ => density k ((h : ℂ)+(t : ℂ)*I)) volume u v := by + exact (integrable_density hz k).mono_set (uIcc_subset_uIcc (by rwa [uIcc_of_le hv]) right_mem_uIcc) + have hadd := intervalIntegral.integral_add_adjacent_intervals (integrable_density huD k) hIuv + have hn : 0 ≤ Real.pi/4*(rho t u)^(2*k) := + mul_nonneg (by positivity) (pow_nonneg (norm_nonneg _) _) + rw [← hadd] + nlinarith + +end +end PlanarLens + +namespace PlanarLens +open Set Filter Complex MeasureTheory +open scoped Topology ContDiff +noncomputable section + +theorem J_div_order {k : ℕ} (hk : 1 ≤ k) {v t : ℝ} (hv : 0 ≤ v) : + |J k v t|/(k : ℝ) = (k : ℝ)*∫ h in 0..v, density k ((h : ℂ)+(t : ℂ)*I) := by + have hk0 : (k : ℝ) ≠ 0 := by exact_mod_cast (by omega : k ≠ 0) + rw [abs_of_nonneg (J_nonneg hv k), J] + field_simp + +theorem rho_neg {v t : ℝ} (hz : (v : ℂ)+(t : ℂ)*I ∈ D) : rho t (-v) = rho t v := by + have he : -(starRingEnd ℂ) ((v : ℂ)+(t : ℂ)*I) = ((-v : ℝ) : ℂ)+(t : ℂ)*I := by + apply Complex.ext <;> simp + rw [rho, rho, ← he, g_neg_conj hz] + simp + +def excess (k : ℕ) (z : ℂ) : ℝ := |J k z.re z.im|/(k : ℝ) - Real.pi/4*‖g z‖^(2*k) + +def epsilon (k : ℕ) : ℝ := max 0 (sSup (excess k '' D)) + +theorem epsilon_nonneg (k : ℕ) : 0 ≤ epsilon k := le_max_left _ _ + +theorem exists_excess_bound {a : ℝ} (ha : 1/2 ≤ a) (ha1 : a < 1) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ (k : ℕ), 1 ≤ k → ∀ z ∈ D, + excess k z ≤ C*(k : ℝ)*a^(2*k-2) + + Real.pi^3/Real.sqrt (tailSlope a)*(1+Real.pi/Real.exp 1) := by + obtain ⟨C, hC, hb⟩ := exists_uniform_error_bound ha ha1 + refine ⟨C, hC, ?_⟩ + intro k hk z hz + have hz' : (z.re : ℂ)+(z.im : ℂ)*I ∈ D := by simpa only [re_add_im] using hz + have hpos (v t : ℝ) (hv : 0 ≤ v) (hh : (v : ℂ)+(t : ℂ)*I ∈ D) : + |J k v t|/(k : ℝ) - Real.pi/4*(rho t v)^(2*k) ≤ + C*(k : ℝ)*a^(2*k-2) + Real.pi^3/Real.sqrt (tailSlope a)*(1+Real.pi/Real.exp 1) := by + rw [J_div_order hk hv] + linarith [hb k hk t v hh hv] + by_cases hv : 0 ≤ z.re + · simpa only [excess, rho, re_add_im] using hpos z.re z.im hv hz' + · have hnz : ((-z.re : ℝ) : ℂ)+(z.im : ℂ)*I ∈ D := by + convert neg_conj_mem_D hz using 1 + apply Complex.ext <;> simp + have hh := hpos (-z.re) z.im (by linarith) hnz + rw [J_neg hz', abs_neg, rho_neg hz'] at hh + simpa only [excess, rho, re_add_im] using hh + +theorem bddAbove_excess {k : ℕ} (hk : 1 ≤ k) : BddAbove (excess k '' D) := by + obtain ⟨C, _, hC⟩ := exists_excess_bound (a := 3/4) (by norm_num) (by norm_num) + refine ⟨C*(k : ℝ)*(3/4)^(2*k-2) + Real.pi^3/Real.sqrt (tailSlope (3/4))*(1+Real.pi/Real.exp 1), ?_⟩ + rintro _ ⟨z, hz, rfl⟩ + exact hC k hk z hz + +theorem excess_le_epsilon {k : ℕ} (hk : 1 ≤ k) {z : ℂ} (hz : z ∈ D) : excess k z ≤ epsilon k := + (le_csSup (bddAbove_excess hk) (mem_image_of_mem _ hz)).trans (le_max_right _ _) + +theorem epsilon_le_of_excess_le {k : ℕ} {B : ℝ} (hB : 0 ≤ B) (h : ∀ z ∈ D, excess k z ≤ B) : + epsilon k ≤ B := by + apply max_le hB + apply csSup_le ⟨excess k 0, mem_image_of_mem _ zero_mem_D⟩ + rintro _ ⟨z, hz, rfl⟩ + exact h z hz + +theorem tendsto_inner_error {a : ℝ} (ha : 0 < a) (ha1 : a < 1) (C : ℝ) : + Tendsto (fun k : ℕ => C*(k : ℝ)*a^(2*k-2)) atTop (𝓝 0) := by + have hq : |a^2| < 1 := by rw [abs_of_nonneg (sq_nonneg _)]; nlinarith + have ht := (tendsto_pow_const_mul_const_pow_of_abs_lt_one 1 hq).const_mul (C/a^2) + simp only [pow_one, mul_zero] at ht + apply ht.congr' + filter_upwards [eventually_ge_atTop (1 : ℕ)] with k hk + have hp : a^(2*k-2)*a^2 = (a^2)^k := by + rw [← pow_add, Nat.sub_add_cancel (by omega : 2 ≤ 2*k), pow_mul] + have ha2 : a^2 ≠ 0 := pow_ne_zero _ ha.ne' + apply mul_right_cancel₀ ha2 + calc + ((C/a^2)*((k : ℝ)*(a^2)^k))*a^2 = C*(k : ℝ)*(a^2)^k := by field_simp + _ = C*(k : ℝ)*(a^(2*k-2)*a^2) := by rw [hp] + _ = C*(k : ℝ)*a^(2*k-2)*a^2 := by ring + +theorem exists_small_tail (e : ℝ) (he : 0 < e) : + ∃ a ∈ Ioo (1/2 : ℝ) 1, + Real.pi^3/Real.sqrt (tailSlope a)*(1+Real.pi/Real.exp 1) < e := by + let H := Real.pi^3*(1+Real.pi/Real.exp 1) + have hH : 0 < H := by dsimp [H]; positivity + obtain ⟨a, ha, hL⟩ := exists_tail_cutoff ((H/e)^2) + have ha0 : 0 < a := by linarith [ha.1] + have hs : 0 < Real.sqrt (tailSlope a) := Real.sqrt_pos.2 (tailSlope_pos ha0 ha.2) + have hq : H/e < Real.sqrt (tailSlope a) := by + rw [← Real.sqrt_sq (div_nonneg hH.le he.le)] + exact Real.sqrt_lt_sqrt (sq_nonneg _) hL + refine ⟨a, ha, ?_⟩ + have hh : H < e * Real.sqrt (tailSlope a) := by + have := (div_lt_iff₀ he).mp hq + nlinarith + have hh' := (div_lt_iff₀ hs).mpr hh + convert hh' using 1 + first | rfl | (dsimp only [H]; ring) + +theorem tendsto_epsilon : Tendsto epsilon atTop (𝓝 0) := by + apply tendsto_order.mpr + constructor + · intro c hc + exact Filter.Eventually.of_forall (fun k => hc.trans_le (epsilon_nonneg k)) + · intro e he + obtain ⟨a, ha, htail⟩ := exists_small_tail (e/2) (by linarith) + obtain ⟨C, hC, hbound⟩ := exists_excess_bound ha.1.le ha.2 + have ha0 : 0 < a := by linarith [ha.1] + have ht := (tendsto_inner_error ha0 ha.2 C).eventually (eventually_lt_nhds (by linarith : (0 : ℝ) < e/2)) + filter_upwards [ht, eventually_ge_atTop (1 : ℕ)] with k hinner hk + have hE := epsilon_le_of_excess_le (k := k) + (B := C*(k : ℝ)*a^(2*k-2)+Real.pi^3/Real.sqrt (tailSlope a)*(1+Real.pi/Real.exp 1)) + (by positivity) (hbound k hk) + linarith + +theorem uniform_slice {k : ℕ} (hk : 1 ≤ k) {v t : ℝ} (hz : (v : ℂ)+(t : ℂ)*I ∈ D) : + |J k v t|/(k : ℝ) ≤ Real.pi/4*‖g ((v : ℂ)+(t : ℂ)*I)‖^(2*k)+epsilon k := by + have hh := excess_le_epsilon hk hz + have hre : ((v : ℂ)+(t : ℂ)*I).re = v := by simp + have him : ((v : ℂ)+(t : ℂ)*I).im = t := by simp + simp only [excess, hre, him] at hh + linarith + +end +end PlanarLens + +end LowerBoundInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/LensEstimates.lean b/lean/OAI/Geometry/PolarProducts/LensEstimates.lean new file mode 100644 index 0000000000000000000000000000000000000000..49d26b3274a8f72c4ad8dfdc84ebdede02cf1cb7 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/LensEstimates.lean @@ -0,0 +1,399 @@ +import OAI.Geometry.PolarProducts.LensArea + +namespace OAI + +section LowerBoundInline +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter Metric +open scoped Topology ContDiff +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal +open Set Filter Function +open scoped Topology ContDiff +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter +open scoped Topology ContDiff +open Set Filter Function +open scoped Topology ContDiff +open Set Filter Function +open scoped ContDiff Topology +open Set MeasureTheory +open scoped ContDiff Interval Topology +open Set +open scoped Topology ContDiff +open Set +open Set MeasureTheory +open scoped ContDiff Interval Topology +open Set Filter Complex +open scoped Topology ContDiff + +namespace PlanarLens +open Set Filter Complex MeasureTheory intervalIntegral +open scoped Topology ContDiff +noncomputable section + +theorem arctan_le_self {x : ℝ} (hx : 0 ≤ x) : Real.arctan x ≤ x := by + have hc : Continuous (fun t : ℝ => 1/(1+t^2)) := by + apply continuous_const.div (by fun_prop) + intro t; positivity + have hi := integral_mono_on (μ := volume) hx (hc.intervalIntegrable 0 x) + (intervalIntegrable_const (c := (1 : ℝ))) (fun t _ => by + apply (div_le_one (by positivity : 0 < 1+t^2)).mpr + nlinarith [sq_nonneg t]) + simpa [integral_one_div_one_add_sq] using hi + +theorem half_le_arctan {x : ℝ} (hx : 0 ≤ x) (hx1 : x ≤ 1) : x/2 ≤ Real.arctan x := by + have hc : Continuous (fun t : ℝ => 1/(1+t^2)) := by + apply continuous_const.div (by fun_prop) + intro t; positivity + have hi := integral_mono_on (μ := volume) hx (intervalIntegrable_const (c := (1/2 : ℝ))) + (hc.intervalIntegrable 0 x) (fun t ht => by + apply (le_div_iff₀ (by positivity : 0 < 1+t^2)).mpr + have h0 := ht.1 + have h1 := ht.2.trans hx1 + nlinarith) + simpa [integral_one_div_one_add_sq, div_eq_mul_inv] using hi + +theorem reciprocal_arctan {x : ℝ} (hx : 0 < x) : + 1 / Real.arctan x ≤ 2 / Real.pi + 2/x := by + have ha : 0 < Real.arctan x := Real.arctan_pos.mpr hx + rcases le_total x 1 with hx1 | hx1 + · have hh := half_le_arctan hx.le hx1 + have hdiv : 1 / Real.arctan x ≤ 2/x := by + apply (div_le_div_iff₀ ha hx).mpr + linarith + apply hdiv.trans + have hp : 0 < 2 / Real.pi := by positivity + linarith + · have hh : Real.pi / 2 - Real.arctan x ≤ 1/x := by + rw [← Real.arctan_inv_of_pos hx] + simpa only [one_div] using arctan_le_self (inv_nonneg.mpr hx.le) + have hA : Real.pi / 4 ≤ Real.arctan x := by + simpa using Real.arctan_strictMono.monotone hx1 + have hπA : 1 ≤ Real.pi * Real.arctan x := by + have hp := Real.pi_gt_three + nlinarith [mul_le_mul_of_nonneg_left hA Real.pi_pos.le] + have hfirst : (Real.pi/2-Real.arctan x) / Real.arctan x ≤ (1/x)/Real.arctan x := + div_le_div_of_nonneg_right hh ha.le + have hsecond : (2/Real.pi)*((1/x)/Real.arctan x) ≤ 2/x := by + apply (le_div_iff₀ hx).mpr + have he : (2/Real.pi)*((1/x)/Real.arctan x)*x = 2/(Real.pi*Real.arctan x) := by + field_simp + rw [he] + apply (div_le_iff₀ (mul_pos Real.pi_pos ha)).mpr + linarith + have hthird := mul_le_mul_of_nonneg_left hfirst + (by positivity : 0 ≤ 2/Real.pi) + have he : (2/Real.pi)*((Real.pi/2-Real.arctan x)/Real.arctan x) = + 1/Real.arctan x - 2/Real.pi := by field_simp + rw [he] at hthird + linarith + +def circleTop (r s : ℝ) : ℂ := (r : ℂ) * ((Real.sin s : ℂ)+(Real.cos s : ℂ)*I) + +@[simp] theorem circleTop_re (r s : ℝ) : (circleTop r s).re = r * Real.sin s := by + simp only [circleTop, mul_re, add_re, ofReal_re, ofReal_im, I_im, I_re, + mul_zero, mul_one, sub_zero, zero_mul, add_zero] + +@[simp] theorem circleTop_im (r s : ℝ) : (circleTop r s).im = r * Real.cos s := by + simp only [circleTop, mul_im, add_re, add_im, ofReal_re, ofReal_im, mul_re, I_im, I_re, + mul_zero, mul_one, zero_add, zero_mul, add_zero] + +theorem norm_circleTop (r s : ℝ) : ‖circleTop r s‖ = |r| := by + have hh : ‖circleTop r s‖^2 = r^2 := by + rw [Complex.sq_norm, normSq_apply, circleTop_re, circleTop_im] + nlinarith [Real.sin_sq_add_cos_sq s] + nlinarith [sq_abs r, norm_nonneg (circleTop r s), abs_nonneg r] + +@[simp] theorem circleTop_zero (r : ℝ) : circleTop r 0 = (r : ℂ)*I := by + simp [circleTop] + +@[simp] theorem circleTop_pi_half (r : ℝ) : circleTop r (Real.pi/2) = (r : ℂ) := by + simp [circleTop] + +theorem continuous_circleTop (r : ℝ) : Continuous (circleTop r) := by + unfold circleTop; fun_prop + +theorem hasDerivAt_F_im_circleTop {r : ℝ} (hr : |r| < 1) (s : ℝ) : + HasDerivAt (fun s => (F (circleTop r s)).im) (-A (circleTop r s)) s := by + have hnorm : ‖(r : ℂ)*(Complex.sin s+Complex.cos s*I)‖ < 1 := by + rw [← Complex.ofReal_sin, ← Complex.ofReal_cos] + change ‖circleTop r s‖ < 1 + rw [norm_circleTop] + exact hr + have hd := ((Complex.hasDerivAt_sin (s : ℂ)).add + ((Complex.hasDerivAt_cos (s : ℂ)).mul_const I)).const_mul (r : ℂ) + have hf := (hasDerivAt_F hnorm).differentiableAt.hasDerivAt + have hh := hf.comp (s : ℂ) hd + have hm := Complex.imCLM.hasFDerivAt.comp_hasDerivAt s hh.comp_ofReal + convert hm using 1 <;> try rfl + · funext x + simp only [circleTop, ofReal_sin, ofReal_cos, Function.comp_apply, Pi.add_apply, + Complex.imCLM_apply] + · simp only [Complex.imCLM_apply, A, circleTop, ← ofReal_sin, ← ofReal_cos, + mul_re, mul_im, add_re, add_im, ofReal_re, ofReal_im, I_re, I_im, + mul_zero, mul_one, add_zero, zero_add, zero_sub, neg_re, neg_im] + ring + +theorem continuous_A_circleTop {r : ℝ} (hr : |r| < 1) : + Continuous (fun s => A (circleTop r s)) := by + rw [continuous_iff_continuousAt] + intro s + have hs : circleTop r s ∈ Metric.ball (0 : ℂ) 1 := by + simpa [Metric.mem_ball, norm_circleTop] using hr + exact Complex.continuous_re.continuousAt.comp + (((continuous_circleTop r).continuousAt).mul + (((analyticOnNhd_F _ hs).deriv.continuousAt).comp (continuous_circleTop r).continuousAt)) + +theorem gap_integral {r : ℝ} (hr : |r| < 1) (s : ℝ) : + T r - (F (circleTop r s)).im = ∫ x in 0..s, A (circleTop r x) := by + have hh := integral_eq_sub_of_hasDerivAt (fun x _ => hasDerivAt_F_im_circleTop hr x) + ((continuous_A_circleTop hr).neg.intervalIntegrable 0 s) + rw [intervalIntegral.integral_neg, circleTop_zero] at hh + change -(∫ x in 0..s, A (circleTop r x)) = (F (circleTop r s)).im - T r at hh + linarith + +theorem A_circleTop_le {r s : ℝ} (hr : 0 ≤ r) (hr1 : r < 1) + (hs : 0 ≤ s) (hs1 : s ≤ Real.pi/2) : + A (circleTop r s) ≤ (8*r/(Real.pi^2*(1-r^2)))*s := by + have hrabs : |r| < 1 := by simpa only [abs_of_nonneg hr] using hr1 + have hnorm : ‖circleTop r s‖ < 1 := by simpa only [norm_circleTop] using hrabs + rw [A, re_mul_deriv_F hnorm, circleTop_re, norm_circleTop, sq_abs] + have hd : 0 < 1-r^2 := by nlinarith + have hsin : 0 ≤ Real.sin s := Real.sin_nonneg_of_mem_Icc ⟨hs, by linarith [Real.pi_pos]⟩ + have hx : 0 ≤ 2*(r*Real.sin s)/(1-r^2) := by positivity + calc + _ ≤ (4/Real.pi^2) * (2*(r*Real.sin s)/(1-r^2)) := by + exact mul_le_mul_of_nonneg_left (arctan_le_self hx) (by positivity) + _ ≤ (4/Real.pi^2) * (2*(r*s)/(1-r^2)) := by + gcongr + exact Real.sin_le hs + _ = _ := by field_simp; ring + +theorem gap_le_square {r s : ℝ} (hr : 0 ≤ r) (hr1 : r < 1) + (hs : 0 ≤ s) (hs1 : s ≤ Real.pi/2) : + T r - (F (circleTop r s)).im ≤ s^2/(1-r) := by + have hrabs : |r| < 1 := by simpa only [abs_of_nonneg hr] using hr1 + rw [gap_integral hrabs] + have hh := integral_mono_on (μ := volume) hs ((continuous_A_circleTop hrabs).intervalIntegrable 0 s) + ((show Continuous (fun x : ℝ => (8*r/(Real.pi^2*(1-r^2)))*x) from by fun_prop).intervalIntegrable 0 s) + (fun x hx => A_circleTop_le hr hr1 hx.1 (hx.2.trans hs1)) + have he : (∫ x in 0..s, (8*r/(Real.pi^2*(1-r^2)))*x) = + (4*r/(Real.pi^2*(1-r^2)))*s^2 := by + rw [intervalIntegral.integral_const_mul, integral_id] + ring + rw [he] at hh + apply hh.trans + have hd : 0 < 1-r^2 := by nlinarith + have h1 : 0 < 1-r := by linarith + have hco : 4*r/(Real.pi^2*(1-r^2)) ≤ 1/(1-r) := by + apply (div_le_div_iff₀ (mul_pos (sq_pos_of_pos Real.pi_pos) hd) h1).mpr + have hp := Real.pi_gt_three + have heq : 1-r^2 = (1-r)*(1+r) := by ring + rw [heq] + have haux : 4*r ≤ Real.pi^2*(1+r) := by + have hp4 : 0 ≤ Real.pi^2-4 := by nlinarith + nlinarith [mul_nonneg hp4 hr] + nlinarith [mul_nonneg (sub_nonneg.mpr haux) h1.le] + simpa only [one_div, div_eq_mul_inv, mul_comm, one_mul, mul_one] using mul_le_mul_of_nonneg_right hco (sq_nonneg s) + +theorem reciprocal_A_circleTop {r s : ℝ} (hr : 1/2 ≤ r) (hr1 : r < 1) + (hs : 0 < s) (hs1 : s ≤ Real.pi/2) : + 1 / A (circleTop r s) ≤ Real.pi/2 + Real.pi^3*(1-r)/s := by + have hr0 : 0 < r := by linarith + have hd : 0 < 1-r^2 := by nlinarith + have hsin : 0 < Real.sin s := Real.sin_pos_of_pos_of_lt_pi hs (by linarith [Real.pi_pos]) + have hnorm : ‖circleTop r s‖ < 1 := by simpa [norm_circleTop, abs_of_pos hr0] using hr1 + let X := 2*(r*Real.sin s)/(1-r^2) + have hX : 0 < X := by dsimp [X]; positivity + have hA : 0 < Real.arctan X := Real.arctan_pos.mpr hX + have he : 1 / A (circleTop r s) = (Real.pi^2/4) * (1/Real.arctan X) := by + rw [A, re_mul_deriv_F hnorm, circleTop_re, norm_circleTop, sq_abs] + dsimp [X] + field_simp + rw [he] + have hh := mul_le_mul_of_nonneg_left (reciprocal_arctan hX) + (by positivity : 0 ≤ Real.pi^2/4) + apply hh.trans + have hratio : (1+r)/r ≤ 4 := by + apply (div_le_iff₀ hr0).mpr + linarith + have hsinbound : (1-r)/Real.sin s ≤ (Real.pi/2)*((1-r)/s) := by + apply (div_le_iff₀ hsin).mpr + have hx := Real.mul_le_sin hs.le hs1 + have hy : s ≤ (Real.pi/2)*Real.sin s := by + have hp := mul_le_mul_of_nonneg_left hx (Real.pi_pos.le) + field_simp at hp + linarith + have hz := mul_le_mul_of_nonneg_left hy (show 0 ≤ (1-r)/s by positivity) + have heq : (1-r)/s*s = 1-r := by field_simp + rw [heq] at hz + nlinarith + calc + _ = Real.pi/2 + (Real.pi^2/4)*((1+r)/r)*((1-r)/Real.sin s) := by + dsimp [X] + field_simp + ring + _ ≤ Real.pi/2 + Real.pi^2*((1-r)/Real.sin s) := by + gcongr + nlinarith [mul_le_mul_of_nonneg_left hratio (show 0 ≤ Real.pi^2/4 by positivity)] + _ ≤ Real.pi/2 + Real.pi^2*((Real.pi/2)*((1-r)/s)) := by gcongr + _ ≤ Real.pi/2 + Real.pi^3*(1-r)/s := by + have hp : 0 ≤ Real.pi^3*(1-r)/s := by positivity + have heq : Real.pi^2*((Real.pi/2)*((1-r)/s)) = + (Real.pi^3*(1-r)/s)/2 := by ring + rw [heq] + linarith + +theorem circleTop_arg {w : ℂ} (hr : 0 < w.re) (hi : 0 ≤ w.im) : + ∃ s ∈ Ioc (0 : ℝ) (Real.pi/2), circleTop ‖w‖ s = w := by + let s := Real.pi/2-w.arg + have ha0 : 0 ≤ w.arg := Complex.arg_nonneg_iff.mpr hi + have ha1 : w.arg < Real.pi/2 := Complex.arg_lt_pi_div_two_iff.mpr (Or.inl hr) + refine ⟨s, ⟨by dsimp [s]; linarith, by dsimp [s]; linarith⟩, ?_⟩ + apply Complex.ext + · rw [circleTop_re] + dsimp [s] + rw [Real.sin_pi_div_two_sub, Complex.norm_mul_cos_arg] + · rw [circleTop_im] + dsimp [s] + rw [Real.cos_pi_div_two_sub, Complex.norm_mul_sin_arg] + +lemma div_le_sqrt_of_gap {d δ s : ℝ} (hd : 0 < d) (hδ : 0 < δ) (hs : 0 < s) + (hg : δ ≤ s^2/d) : d/s ≤ Real.sqrt (d/δ) := by + have hg' : δ*d ≤ s^2 := (le_div_iff₀ hd).mp hg + have he : (d/s)^2 ≤ d/δ := by + rw [div_pow] + apply (div_le_div_iff₀ (sq_pos_of_pos hs) hδ).mpr + nlinarith [mul_le_mul_of_nonneg_left hg' hd.le] + exact (Real.le_sqrt (by positivity) (by positivity)).mpr he + +theorem reciprocal_A_slice {w : ℂ} (hw : ‖w‖ < 1) (hr : 0 < w.re) + (hradius : 1/2 ≤ ‖w‖) : + 1 / A w ≤ Real.pi/2 + Real.pi^3 * + Real.sqrt ((1-‖w‖)/(T ‖w‖ - |(F w).im|)) := by + have hFw : F w ∈ D := ⟨w, by simpa using hw, rfl⟩ + have hdelta : 0 < T ‖w‖ - |(F w).im| := by + have hh := vertical_gap_pos hFw (re_F_pos hw hr) + simpa only [g_F hw] using hh + have upper (z : ℂ) (hz : ‖z‖ < 1) (hzr : 0 < z.re) (hzi : 0 ≤ z.im) + (hzlow : 1/2 ≤ ‖z‖) (hgap : 0 < T ‖z‖ - |(F z).im|) : + 1 / A z ≤ Real.pi/2 + Real.pi^3 * + Real.sqrt ((1-‖z‖)/(T ‖z‖ - |(F z).im|)) := by + obtain ⟨s, hs, he⟩ := circleTop_arg hzr hzi + have hh := reciprocal_A_circleTop hzlow hz hs.1 hs.2 + rw [he] at hh + apply hh.trans + have hgs := gap_le_square (norm_nonneg z) hz hs.1.le hs.2 + rw [he] at hgs + have hg : T ‖z‖ - |(F z).im| ≤ s^2/(1-‖z‖) := by + linarith [le_abs_self (F z).im] + have hb := div_le_sqrt_of_gap (sub_pos.mpr hz) hgap hs.1 hg + have hm := mul_le_mul_of_nonneg_left hb (show 0 ≤ Real.pi^3 by positivity) + have heq : Real.pi^3*((1-‖z‖)/s) = Real.pi^3*(1-‖z‖)/s := by ring + rw [heq] at hm + linarith + rcases le_total 0 w.im with hi | hi + · exact upper w hw hr hi hradius hdelta + · have hn : ‖(starRingEnd ℂ) w‖ = ‖w‖ := by simp + have ha : A ((starRingEnd ℂ) w) = A w := by + rw [A, re_mul_deriv_F (by simpa using hw), A, re_mul_deriv_F hw] + simp + have hh := upper ((starRingEnd ℂ) w) (by simpa using hw) (by simpa using hr) + (by simpa using neg_nonneg.mpr hi) (by simpa using hradius) (by simpa using hdelta) + simpa [ha] using hh + +end +end PlanarLens + +namespace PlanarLens +open Set Filter Complex +open scoped Topology ContDiff +noncomputable section + +theorem deriv_T_eq {r : ℝ} (hr : 0 < r) (hr1 : r < 1) : + deriv T r = (8 / Real.pi^2) * (Real.artanh r / r) := by + have habs : |r| < 1 := by simpa only [abs_of_pos hr] using hr1 + rw [(hasDerivAt_T habs).deriv] + have hh := congr_arg Complex.im (mul_deriv_F (w := (r : ℂ)*I) (by simpa [norm_mul] using habs)) + have hc : cayley ((r : ℂ)*I) = (((1-r)/(1+r) : ℝ) : ℂ) := by + unfold cayley + push_cast + rw [mul_assoc, I_mul_I] + ring + have hai : (Complex.arctan ((r : ℂ)*I)).im = Real.artanh r := by + rw [Complex.arctan] + change ((-I/2) * Complex.log (cayley ((r : ℂ)*I))).im = _ + rw [hc, mul_im] + have hp : 0 < (1-r)/(1+r) := by positivity + have hre : (-I/2 : ℂ).re = 0 := by norm_num [div_re] + have him : (-I/2 : ℂ).im = -1/2 := by norm_num [div_im] + rw [hre, him, zero_mul, zero_add] + rw [Complex.log_re, norm_real, Real.norm_eq_abs, abs_of_pos hp, + Real.artanh_eq_half_log ⟨by linarith, hr1.le⟩] + have hlog : Real.log ((1-r)/(1+r)) = -Real.log ((1+r)/(1-r)) := by + rw [show (1-r)/(1+r) = ((1+r)/(1-r))⁻¹ by rw [inv_div], Real.log_inv] + rw [hlog] + norm_num + simp only [mul_im, mul_re, ofReal_re, ofReal_im, I_re, I_im, mul_zero, mul_one, + zero_mul, zero_sub, add_zero, neg_zero, zero_add] at hh + rw [hai] at hh + rw [mul_comm] at hh + have hh := (eq_div_iff hr.ne').mpr hh + calc + _ = ((8 / Real.pi^2) * Real.artanh r)/r := hh + _ = _ := by ring + +theorem deriv_T_lower {a r : ℝ} (ha : 0 < a) (har : a ≤ r) (hr : r < 1) : + (8/Real.pi^2) * Real.artanh a ≤ deriv T r := by + have hr0 : 0 < r := ha.trans_le har + rw [deriv_T_eq hr0 hr] + apply mul_le_mul_of_nonneg_left _ (by positivity) + apply (Real.artanh_le_artanh (by linarith) hr har).trans + exact le_div_self (Real.artanh_nonneg hr0.le) hr0 hr.le + +theorem T_tail_gap {a r s : ℝ} (ha : 0 < a) (har : a ≤ r) (hrs : r ≤ s) + (hs : s < 1) : + (8/Real.pi^2)*Real.artanh a * (s-r) ≤ T s-T r := by + apply Convex.mul_sub_le_image_sub_of_le_deriv (convex_Icc r s) + (continuousOn_T.mono (by intro x hx; exact ⟨by linarith [hx.1], hx.2.trans hs.le⟩)) + (by intro x hx + have hxabs : |x| < 1 := by + simp only [interior_Icc, mem_Ioo] at hx + exact abs_lt.mpr ⟨by linarith, by linarith⟩ + exact (hasDerivAt_T hxabs).differentiableAt.differentiableWithinAt) + (by intro x hx + simp only [interior_Icc, mem_Ioo] at hx + exact deriv_T_lower ha (har.trans hx.1.le) (hx.2.trans hs)) + r ⟨le_rfl, hrs⟩ s ⟨hrs, le_rfl⟩ hrs + +theorem exists_tail_cutoff (M : ℝ) : ∃ a ∈ Ioo (1/2 : ℝ) 1, + M < (8/Real.pi^2)*Real.artanh a := by + let y := max (Real.artanh (1/2)) ((Real.pi^2/8)*M) + 1 + let a := Real.tanh y + have ha : a ∈ Ioo (-1 : ℝ) 1 := ⟨Real.neg_one_lt_tanh y, Real.tanh_lt_one y⟩ + have hy : Real.artanh a = y := Real.artanh_tanh y + have hhalf : (1/2 : ℝ) < a := by + apply (Real.artanh_lt_artanh_iff (by norm_num) ha).mp + rw [hy] + dsimp [y] + have := le_max_left (Real.artanh (1/2)) ((Real.pi^2/8)*M) + linarith + refine ⟨a, ⟨hhalf, ha.2⟩, ?_⟩ + rw [hy] + have hyy : (Real.pi^2/8)*M < y := by + dsimp [y] + have := le_max_right (Real.artanh (1/2)) ((Real.pi^2/8)*M) + linarith + have hm := mul_lt_mul_of_pos_left hyy (by positivity : 0 < 8/Real.pi^2) + have he : (8/Real.pi^2)*((Real.pi^2/8)*M) = M := by field_simp + rwa [he] at hm + +end +end PlanarLens + +end LowerBoundInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/LensMap.lean b/lean/OAI/Geometry/PolarProducts/LensMap.lean new file mode 100644 index 0000000000000000000000000000000000000000..66770dae6622d7ec08c082464cf49ca57443ff36 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/LensMap.lean @@ -0,0 +1,406 @@ +import OAI.Geometry.PolarProducts.LogProfile + +namespace OAI + +section LowerBoundInline +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter Metric +open scoped Topology ContDiff +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal +open Set Filter Function +open scoped Topology ContDiff +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter +open scoped Topology ContDiff +open Set Filter Function +open scoped Topology ContDiff +open Set Filter Function +open scoped ContDiff Topology +open Set MeasureTheory +open scoped ContDiff Interval Topology +open Set +open scoped Topology ContDiff +open Set +open Set MeasureTheory +open scoped ContDiff Interval Topology + +open Set Filter Complex +open scoped Topology ContDiff + +namespace PlanarLens +noncomputable section + +def term (n : ℕ) (w : ℂ) : ℂ := (-1)^n * w^(2*n+1) / (2*n+1)^2 + +def termDeriv (n : ℕ) (w : ℂ) : ℂ := (-1)^n * w^(2*n) / (2*n+1) + +def F (w : ℂ) : ℂ := (8 / (Real.pi^2) : ℝ) * ∑' n : ℕ, term n w + +theorem hasDerivAt_term (n : ℕ) (w : ℂ) : HasDerivAt (term n) (termDeriv n w) w := by + have hn : (2 * (n : ℂ) + 1) ≠ 0 := by + exact_mod_cast (show 2 * n + 1 ≠ 0 by omega) + convert (((hasDerivAt_id w).pow (2*n+1)).const_mul ((-1 : ℂ)^n)).div_const + ((2*(n : ℂ)+1)^2) using 1 <;> try rfl + simp only [termDeriv, Nat.cast_add, Nat.cast_mul, Nat.cast_ofNat, Nat.cast_one, Nat.add_sub_cancel] + field_simp [hn] + rfl + +@[simp] theorem term_zero (n : ℕ) : term n 0 = 0 := by simp [term] + +@[simp] theorem F_zero : F 0 = 0 := by simp [F] + +theorem norm_termDeriv_le {r : ℝ} (hr : 0 ≤ r) (hr1 : r ≤ 1) + {w : ℂ} (hw : ‖w‖ ≤ r) (n : ℕ) : ‖termDeriv n w‖ ≤ r^n := by + have hn : (1 : ℝ) ≤ 2 * n + 1 := by have := Nat.cast_nonneg (α := ℝ) n; linarith + calc + ‖termDeriv n w‖ = ‖w‖^(2*n) / (2*n+1) := by + simp only [termDeriv, norm_div, norm_mul, norm_pow, norm_neg, norm_one, one_pow, one_mul] + congr 1 + norm_cast + _ ≤ r^(2*n) := (div_le_self (pow_nonneg (norm_nonneg _) _) hn).trans + (pow_le_pow_left₀ (norm_nonneg _) hw _) + _ ≤ r^n := pow_le_pow_of_le_one hr hr1 (by omega) + +theorem summable_termDeriv {w : ℂ} (hw : ‖w‖ < 1) : Summable (fun n => termDeriv n w) := by + exact Summable.of_norm_bounded (summable_geometric_of_lt_one (norm_nonneg w) hw) + (norm_termDeriv_le (norm_nonneg w) hw.le le_rfl) + +theorem hasDerivAt_F {w : ℂ} (hw : ‖w‖ < 1) : + HasDerivAt F ((8 / (Real.pi^2) : ℝ) * ∑' n : ℕ, termDeriv n w) w := by + obtain ⟨r, hwr, hr1⟩ := exists_between hw + have hr : 0 < r := (norm_nonneg w).trans_lt hwr + have hh := hasDerivAt_tsum_of_isPreconnected + (summable_geometric_of_lt_one hr.le hr1) Metric.isOpen_ball + (convex_ball (0 : ℂ) r).isPreconnected + (fun n z _ => hasDerivAt_term n z) + (fun n z hz => norm_termDeriv_le hr.le hr1.le ((by simpa [Metric.mem_ball] using hz : ‖z‖ < r).le) n) + (show (0 : ℂ) ∈ Metric.ball 0 r by simpa using hr) + (show Summable (fun n => term n (0 : ℂ)) by simp) + (show w ∈ Metric.ball 0 r by simpa using hwr) + exact hh.const_mul _ + +theorem analyticOnNhd_F : AnalyticOnNhd ℂ F (Metric.ball (0 : ℂ) 1) := by + apply DifferentiableOn.analyticOnNhd _ Metric.isOpen_ball + intro w hw + exact (hasDerivAt_F (by simpa using hw)).differentiableAt.differentiableWithinAt + +theorem mul_deriv_F {w : ℂ} (hw : ‖w‖ < 1) : + w * deriv F w = (8 / (Real.pi^2) : ℝ) * Complex.arctan w := by + rw [(hasDerivAt_F hw).deriv, mul_left_comm, ← tsum_mul_left] + congr 1 + have he : (fun n : ℕ => w * termDeriv n w) = + (fun n : ℕ => (-1)^n * w^(2*n+1) / (2*n+1)) := by + funext n + dsimp [termDeriv] + rw [pow_succ] + ring + rw [he] + simpa only [Nat.cast_add, Nat.cast_mul, Nat.cast_ofNat, Nat.cast_one] using (Complex.hasSum_arctan hw).tsum_eq + +theorem norm_term_le {w : ℂ} (hw : ‖w‖ ≤ 1) (n : ℕ) : + ‖term n w‖ ≤ 1 / ((n : ℝ)+1)^2 := by + have hn : (0 : ℝ) < n + 1 := by positivity + calc + ‖term n w‖ = ‖w‖^(2*n+1) / (2*(n : ℝ)+1)^2 := by + simp only [term, norm_div, norm_mul, norm_pow, norm_neg, norm_one, one_pow, one_mul] + congr 2 + norm_cast + _ ≤ 1 / (2*(n : ℝ)+1)^2 := div_le_div_of_nonneg_right + (pow_le_one₀ (norm_nonneg _) hw) (sq_nonneg _) + _ ≤ 1 / ((n : ℝ)+1)^2 := one_div_le_one_div_of_le (sq_pos_of_pos hn) + (pow_le_pow_left₀ hn.le (by have := Nat.cast_nonneg (α := ℝ) n; linarith) 2) + +theorem summable_bound : Summable (fun n : ℕ => 1 / ((n : ℝ)+1)^2) := by + simpa only [Nat.cast_add, Nat.cast_one] using + (summable_nat_add_iff 1).2 (Real.summable_one_div_nat_pow.2 (by norm_num : 1 < 2)) + +theorem summable_term {w : ℂ} (hw : ‖w‖ ≤ 1) : Summable (fun n => term n w) := + Summable.of_norm_bounded summable_bound (norm_term_le hw) + +theorem continuousOn_F_closedBall : ContinuousOn F (Metric.closedBall 0 1) := by + apply ContinuousOn.const_mul _ _ + apply continuousOn_tsum (fun n => (by unfold term; fun_prop : Continuous (term n)).continuousOn) + summable_bound + intro n w hw + exact norm_term_le (by simpa using hw) n + +theorem F_norm_le {w : ℂ} (hw : ‖w‖ ≤ 1) : + ‖F w‖ ≤ (8 / Real.pi^2) * ∑' n : ℕ, 1 / ((n : ℝ)+1)^2 := by + have hc : 0 ≤ 8 / Real.pi^2 := by positivity + rw [F, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hc] + apply mul_le_mul_of_nonneg_left _ hc + exact (norm_tsum_le_tsum_norm (summable_term hw).norm).trans + (Summable.tsum_le_tsum (norm_term_le hw) (summable_term hw).norm summable_bound) + +@[simp] theorem F_neg (w : ℂ) : F (-w) = -F w := by + have he : (fun n : ℕ => term n (-w)) = fun n : ℕ => -term n w := by + funext n + simp only [term] + rw [(show Odd (2*n+1) by exact ⟨n, by omega⟩).neg_pow] + ring + simp only [F, he, tsum_neg, mul_neg] + +@[simp] theorem F_conj (w : ℂ) : F ((starRingEnd ℂ) w) = (starRingEnd ℂ) (F w) := by + have he : (fun n : ℕ => term n ((starRingEnd ℂ) w)) = fun n : ℕ => conjCLE (term n w) := by + funext n + simp [term, map_ofNat] + simp only [F, he, ← conjCLE.map_tsum] + simp [map_ofNat] + +def cayley (w : ℂ) : ℂ := (1 + w*I)/(1-w*I) + +theorem cayley_re (w : ℂ) : (cayley w).re = (1 - ‖w‖^2) / normSq (1-w*I) := by + rw [cayley, div_re, Complex.sq_norm] + simp only [add_re, one_re, mul_re, I_re, mul_zero, mul_im, I_im, mul_one, + zero_sub, sub_re, add_im, one_im, sub_im, add_zero, zero_add, normSq_apply] + ring + +theorem cayley_im (w : ℂ) : (cayley w).im = 2*w.re / normSq (1-w*I) := by + rw [cayley, div_im] + simp only [add_re, one_re, mul_re, I_re, mul_zero, mul_im, I_im, mul_one, + zero_sub, sub_re, add_im, one_im, sub_im, add_zero, zero_add] + ring + +theorem cayley_re_pos {w : ℂ} (hw : ‖w‖ < 1) : 0 < (cayley w).re := by + have hn : 1-w*I ≠ 0 := by + intro h + have he := congr_arg norm (sub_eq_zero.mp h) + simp only [norm_one, norm_mul, norm_I, mul_one] at he + linarith + rw [cayley_re] + exact div_pos (by nlinarith [norm_nonneg w]) (normSq_pos.mpr hn) + +theorem arctan_re_eq {w : ℂ} (hw : ‖w‖ < 1) : + (Complex.arctan w).re = (1/2 : ℝ) * Real.arctan (2*w.re/(1-‖w‖^2)) := by + have harg := abs_lt.mp (Complex.abs_arg_lt_pi_div_two_iff.mpr (Or.inl (cayley_re_pos hw))) + have ht := Real.arctan_tan harg.1 harg.2 + rw [Complex.tan_arg, cayley_re, cayley_im] at ht + have hn : normSq (1-w*I) ≠ 0 := by + apply ne_of_gt + have h := cayley_re_pos hw + rw [cayley_re] at h + exact (div_pos_iff.mp h).resolve_right (by rintro ⟨_, hneg⟩; exact (normSq_nonneg _).not_gt hneg) |>.2 + have he : (2*w.re/normSq (1-w*I)) / ((1-‖w‖^2)/normSq (1-w*I)) = + 2*w.re/(1-‖w‖^2) := by field_simp + rw [he] at ht + rw [Complex.arctan, mul_re] + have hre : (-I / 2 : ℂ).re = 0 := by norm_num [div_re] + have him : (-I / 2 : ℂ).im = -1/2 := by norm_num [div_im] + rw [hre, him, zero_mul, log_im] + change 0 - (-1/2) * (cayley w).arg = _ + rw [← ht] + ring + +theorem re_mul_deriv_F {w : ℂ} (hw : ‖w‖ < 1) : + (w * deriv F w).re = (4 / Real.pi^2) * Real.arctan (2*w.re/(1-‖w‖^2)) := by + rw [mul_deriv_F hw, re_ofReal_mul, arctan_re_eq hw] + ring + +end +end PlanarLens + +namespace PlanarLens +open Set Filter Complex +open scoped Topology ContDiff +noncomputable section + +theorem norm_one_add_mul_I_sq (w : ℂ) : ‖1+w*I‖^2 = 1-2*w.im+‖w‖^2 := by + simp only [Complex.sq_norm, normSq_apply, add_re, one_re, mul_re, I_re, I_im, + mul_zero, mul_one, zero_sub, add_im, one_im, mul_im, zero_add, add_zero] + ring + +theorem norm_one_sub_mul_I_sq (w : ℂ) : ‖1-w*I‖^2 = 1+2*w.im+‖w‖^2 := by + simp only [Complex.sq_norm, normSq_apply, sub_re, one_re, mul_re, I_re, I_im, + mul_zero, mul_one, zero_sub, sub_im, one_im, mul_im, add_zero] + ring + +theorem one_add_mul_I_ne_zero {w : ℂ} (hw : ‖w‖ < 1) : 1+w*I ≠ 0 := by + intro h + have he : w*I = -1 := eq_neg_of_add_eq_zero_right h + have hh := congr_arg norm he + simp only [norm_mul, norm_I, mul_one, norm_neg, norm_one] at hh + linarith + +theorem one_sub_mul_I_ne_zero {w : ℂ} (hw : ‖w‖ < 1) : 1-w*I ≠ 0 := by + have h := one_add_mul_I_ne_zero (w := -w) (by simpa using hw) + simpa only [neg_mul, sub_eq_add_neg] using h + +theorem arctan_im_eq (w : ℂ) : + (Complex.arctan w).im = -(1/2 : ℝ) * Real.log (‖1+w*I‖/‖1-w*I‖) := by + rw [Complex.arctan, mul_im] + have hre : (-I / 2 : ℂ).re = 0 := by norm_num [div_re] + have him : (-I / 2 : ℂ).im = -1/2 := by norm_num [div_im] + rw [hre, him, zero_mul, zero_add, log_re, norm_div] + ring + +theorem arctan_im_pos {w : ℂ} (hw : ‖w‖ < 1) (hi : 0 < w.im) : + 0 < (Complex.arctan w).im := by + have ha : 0 < ‖1+w*I‖ := norm_pos_iff.mpr (one_add_mul_I_ne_zero hw) + have hb : 0 < ‖1-w*I‖ := norm_pos_iff.mpr (one_sub_mul_I_ne_zero hw) + have hab : ‖1+w*I‖ < ‖1-w*I‖ := by + have h1 := norm_one_add_mul_I_sq w + have h2 := norm_one_sub_mul_I_sq w + nlinarith [norm_nonneg (1+w*I), norm_nonneg (1-w*I)] + rw [arctan_im_eq] + have := Real.log_neg (div_pos ha hb) ((div_lt_one hb).mpr hab) + linarith + +theorem arctan_im_neg {w : ℂ} (hw : ‖w‖ < 1) (hi : w.im < 0) : + (Complex.arctan w).im < 0 := by + have hb : 0 < ‖1-w*I‖ := norm_pos_iff.mpr (one_sub_mul_I_ne_zero hw) + have hab : ‖1-w*I‖ < ‖1+w*I‖ := by + have h1 := norm_one_add_mul_I_sq w + have h2 := norm_one_sub_mul_I_sq w + nlinarith [norm_nonneg (1+w*I), norm_nonneg (1-w*I)] + rw [arctan_im_eq] + have := Real.log_pos ((one_lt_div hb).mpr hab) + linarith + +theorem arctan_im_mul_nonneg {w : ℂ} (hw : ‖w‖ < 1) : + 0 ≤ (Complex.arctan w).im * w.im := by + rcases lt_trichotomy w.im 0 with hi | hi | hi + · exact mul_nonneg_of_nonpos_of_nonpos (arctan_im_neg hw hi).le hi.le + · simp [hi] + · exact (mul_pos (arctan_im_pos hw hi) hi).le + +theorem arctan_re_mul_nonneg {w : ℂ} (hw : ‖w‖ < 1) : + 0 ≤ (Complex.arctan w).re * w.re := by + rw [arctan_re_eq hw] + have hn : 0 < 1-‖w‖^2 := by nlinarith [norm_nonneg w] + rcases lt_trichotomy w.re 0 with hi | hi | hi + · have hr : Real.arctan (2*w.re/(1-‖w‖^2)) < 0 := + Real.arctan_lt_zero.mpr (div_neg_of_neg_of_pos (by linarith) hn) + exact mul_nonneg_of_nonpos_of_nonpos (by linarith) hi.le + · simp [hi] + · have hr : 0 < Real.arctan (2*w.re/(1-‖w‖^2)) := + Real.arctan_pos.mpr (div_pos (by linarith) hn) + positivity + +theorem arctan_div_re_pos {w : ℂ} (hw : ‖w‖ < 1) (hw0 : w ≠ 0) : + 0 < (Complex.arctan w / w).re := by + rw [div_re, ← add_div] + apply div_pos _ (Complex.normSq_pos.mpr hw0) + have hr := arctan_re_mul_nonneg hw + have hi := arctan_im_mul_nonneg hw + by_cases hre : w.re = 0 + · have him : w.im ≠ 0 := by + intro h; apply hw0; exact Complex.ext (by simpa using hre) (by simpa using h) + rcases lt_or_gt_of_ne him with him | him + · have := mul_pos_of_neg_of_neg (arctan_im_neg hw him) him + linarith + · have := mul_pos (arctan_im_pos hw him) him + linarith + · have hn : 0 < 1-‖w‖^2 := by nlinarith [norm_nonneg w] + have hp : 0 < (Complex.arctan w).re * w.re := by + rw [arctan_re_eq hw] + rcases lt_or_gt_of_ne hre with hre | hre + · have h := Real.arctan_lt_zero.mpr (div_neg_of_neg_of_pos + (by linarith : 2*w.re < 0) hn) + exact mul_pos_of_neg_of_neg (by linarith) hre + · have h := Real.arctan_pos.mpr (div_pos (by linarith : 0 < 2*w.re) hn) + positivity + linarith + +@[simp] theorem deriv_F_zero : deriv F 0 = (8 / Real.pi^2 : ℝ) := by + rw [(hasDerivAt_F (by simp : ‖(0 : ℂ)‖ < 1)).deriv] + have he : (∑' n : ℕ, termDeriv n 0) = 1 := by + rw [tsum_eq_single 0] + · simp [termDeriv] + · intro n hn + have h : 2*n ≠ 0 := by omega + simp [termDeriv, h] + rw [he, mul_one] + +theorem deriv_F_re_pos {w : ℂ} (hw : ‖w‖ < 1) : 0 < (deriv F w).re := by + by_cases hw0 : w = 0 + · rw [hw0, deriv_F_zero, ofReal_re] + positivity + · have he : deriv F w = (8 / Real.pi^2 : ℝ) * (Complex.arctan w / w) := by + apply (mul_left_cancel₀ hw0) + rw [mul_deriv_F hw] + field_simp + rw [he, re_ofReal_mul] + exact mul_pos (by positivity) (arctan_div_re_pos hw hw0) + +theorem F_injOn : InjOn F (Metric.ball 0 1) := by + intro x hx y hy hxy + by_contra hn + have hd : y-x ≠ 0 := sub_ne_zero.mpr (Ne.symm hn) + have hseg : ∀ t ∈ Icc (0 : ℝ) 1, ‖x+(t : ℂ)*(y-x)‖ < 1 := by + intro t ht + have hh := (convex_ball (0 : ℂ) 1).add_smul_sub_mem hx hy ht + simpa only [Metric.mem_ball, dist_zero_right, Complex.real_smul] using hh + let H : ℝ → ℝ := fun t => (F (x+(t : ℂ)*(y-x))/(y-x)).re + have hh : ∀ t ∈ Icc (0 : ℝ) 1, + HasDerivAt H (deriv F (x+(t : ℂ)*(y-x))).re t := by + intro t ht + have hf := (hasDerivAt_F (hseg t ht)).differentiableAt.hasDerivAt + have hc := ((hasDerivAt_id (t : ℂ)).mul_const (y-x)).const_add x + have hm := (hf.comp (t : ℂ) hc).div_const (y-x) + have he : deriv F (x+(t : ℂ)*(y-x)) * (1*(y-x)) / (y-x) = + deriv F (x+(t : ℂ)*(y-x)) := by field_simp + rw [he] at hm + exact hm.real_of_complex + have hmono : StrictMonoOn H (Icc (0 : ℝ) 1) := by + apply strictMonoOn_of_hasDerivWithinAt_pos (convex_Icc 0 1) + (fun t ht => (hh t ht).continuousAt.continuousWithinAt) + (fun t ht => (hh t (interior_subset ht)).hasDerivWithinAt) + intro t ht + exact deriv_F_re_pos (hseg t (interior_subset ht)) + have hlt := hmono (by norm_num : (0 : ℝ) ∈ Icc 0 1) + (by norm_num : (1 : ℝ) ∈ Icc 0 1) (by norm_num : (0 : ℝ) < 1) + simp only [H, ofReal_zero, zero_mul, add_zero, ofReal_one, one_mul, add_sub_cancel] at hlt + rw [hxy] at hlt + exact lt_irrefl _ hlt + +theorem re_F_imaginary (t : ℝ) : (F ((t : ℂ)*I)).re = 0 := by + have h : (starRingEnd ℂ) ((t : ℂ)*I) = -((t : ℂ)*I) := by simp + have he := F_conj ((t : ℂ)*I) + rw [h, F_neg] at he + have hre := congr_arg Complex.re he + simp only [neg_re, conj_re] at hre + linarith + +theorem re_F_pos {w : ℂ} (hw : ‖w‖ < 1) (hr : 0 < w.re) : 0 < (F w).re := by + let H : ℝ → ℝ := fun t => (F ((t : ℂ)+(w.im : ℂ)*I)).re + have hseg : ∀ t ∈ Icc 0 w.re, ‖(t : ℂ)+(w.im : ℂ)*I‖ < 1 := by + intro t ht + have he : ‖(t : ℂ)+(w.im : ℂ)*I‖^2 = t^2+w.im^2 := by + rw [Complex.sq_norm] + simp [normSq_apply, pow_two] + have hh : ‖w‖^2 = w.re^2+w.im^2 := by + rw [Complex.sq_norm] + simp [normSq_apply, pow_two] + have hn : ‖w‖^2 < 1 := by nlinarith [norm_nonneg w] + nlinarith [norm_nonneg ((t : ℂ)+(w.im : ℂ)*I), ht.1, ht.2] + have hh : ∀ t ∈ Icc 0 w.re, HasDerivAt H (deriv F ((t : ℂ)+(w.im : ℂ)*I)).re t := by + intro t ht + have hf := (hasDerivAt_F (hseg t ht)).differentiableAt.hasDerivAt + have hm := hf.comp (t : ℂ) ((hasDerivAt_id _).add_const ((w.im : ℂ)*I)) + convert hm.real_of_complex using 1 <;> first | rfl | simp + have hmono : StrictMonoOn H (Icc 0 w.re) := by + apply strictMonoOn_of_hasDerivWithinAt_pos (convex_Icc 0 w.re) + (fun t ht => (hh t ht).continuousAt.continuousWithinAt) + (fun t ht => (hh t (interior_subset ht)).hasDerivWithinAt) + exact fun t ht => deriv_F_re_pos (hseg t (interior_subset ht)) + have hlt := hmono ⟨le_rfl, hr.le⟩ ⟨hr.le, le_rfl⟩ hr + have he : (w.re : ℂ)+(w.im : ℂ)*I = w := by simp + simpa only [H, ofReal_zero, zero_add, re_F_imaginary, he] using hlt + +theorem re_F_neg {w : ℂ} (hw : ‖w‖ < 1) (hr : w.re < 0) : (F w).re < 0 := by + have h := re_F_pos (w := -w) (by simpa using hw) (by simpa using neg_pos.mpr hr) + simpa only [F_neg, neg_re, neg_pos] using h + +theorem re_F_eq_zero {w : ℂ} (hr : w.re = 0) : (F w).re = 0 := by + have he : w = (w.im : ℂ)*I := by apply Complex.ext <;> simp [hr] + rw [he, re_F_imaginary] + +end +end PlanarLens + +end LowerBoundInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/LocalODE.lean b/lean/OAI/Geometry/PolarProducts/LocalODE.lean new file mode 100644 index 0000000000000000000000000000000000000000..f087035940b94c8c5c031f0b438c56b93f97bed8 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/LocalODE.lean @@ -0,0 +1,320 @@ +import OAI.Geometry.PolarProducts.SmoothPaths + +namespace OAI + +universe u3 u4 u5 u6 + +section LowerBoundInline +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter Metric +open scoped Topology ContDiff + +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal + +namespace SmoothODE + +abbrev Time := Icc (0 : ℝ) 1 + +variable {E : Type u3} [NormedAddCommGroup E] [NormedSpace ℝ E] + +noncomputable section + +def extend (u : C(Time, E)) : ℝ → E := fun t => u (projIcc 0 1 zero_le_one t) + +omit [NormedSpace ℝ E] in +theorem continuous_extend (u : C(Time, E)) : Continuous (extend u) := + u.continuous.comp continuous_projIcc + +omit [NormedSpace ℝ E] in +@[simp] theorem extend_coe (u : C(Time, E)) (t : Time) : extend u t = u t := by + simp [extend] + +def primitive (u : C(Time, E)) : C(Time, E) := + ⟨fun t => ∫ s in 0..(t : ℝ), extend u s, + (intervalIntegral.continuous_primitive + (fun a b => (continuous_extend u).intervalIntegrable a b) 0).comp continuous_subtype_val⟩ + +@[simp] theorem primitive_apply (u : C(Time, E)) (t : Time) : + primitive u t = ∫ s in 0..(t : ℝ), extend u s := rfl + +theorem norm_primitive_le (u : C(Time, E)) : ‖primitive u‖ ≤ ‖u‖ := by + apply (ContinuousMap.norm_le _ (norm_nonneg _)).mpr + intro t + have h := intervalIntegral.norm_integral_le_of_norm_le_const + (a := (0 : ℝ)) (b := (t : ℝ)) (C := ‖u‖) + (fun s _ => u.norm_coe_le_norm (projIcc 0 1 zero_le_one s)) + change ‖∫ s in 0..(t : ℝ), extend u s‖ ≤ ‖u‖ + refine h.trans ?_ + rw [sub_zero, abs_of_nonneg t.2.1] + exact mul_le_of_le_one_right (norm_nonneg _) t.2.2 + +def primitiveCLM : C(Time, E) →L[ℝ] C(Time, E) := by + let L : C(Time, E) →ₗ[ℝ] C(Time, E) := + { toFun := primitive + map_add' := by + intro u v + ext t + change (∫ s in 0..(t : ℝ), extend u s + extend v s) = _ + exact intervalIntegral.integral_add + ((continuous_extend u).intervalIntegrable _ _) + ((continuous_extend v).intervalIntegrable _ _) + map_smul' := by + intro c u + ext t + exact intervalIntegral.integral_smul c (extend u) } + exact L.mkContinuous 1 (by + intro u + change ‖primitive u‖ ≤ 1 * ‖u‖ + simpa using norm_primitive_le u) + +@[simp] theorem primitiveCLM_apply (u : C(Time, E)) : primitiveCLM u = primitive u := rfl + +theorem primitiveCLM_norm_le : ‖primitiveCLM (E := E)‖ ≤ 1 := + ContinuousLinearMap.opNorm_le_bound _ zero_le_one fun u => by + simpa using norm_primitive_le u + +end +end SmoothODE + +namespace SmoothODE + +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal + +variable {E : Type u4} [NormedAddCommGroup E] [NormedSpace ℝ E] + [CompleteSpace E] + +noncomputable section + +def picard {V : E → E} (hV : Continuous V) (h : ℝ) (x : E) + (u : C(Time, E)) : C(Time, E) := + ContinuousMap.const Time x + h • primitive (SmoothPaths.superpose hV u) + +omit [NormedSpace ℝ E] [CompleteSpace E] in +theorem lipschitz_superpose {V : E → E} {K : ℝ≥0} + (hV : LipschitzWith K V) : + LipschitzWith K (SmoothPaths.superpose (X := Time) hV.continuous) := by + apply LipschitzWith.of_dist_le_mul + intro u v + apply (ContinuousMap.dist_le (mul_nonneg K.coe_nonneg dist_nonneg)).mpr + intro t + exact (hV.dist_le_mul (u t) (v t)).trans + (mul_le_mul_of_nonneg_left (ContinuousMap.dist_apply_le_dist (f := u) (g := v) t) K.coe_nonneg) + +omit [CompleteSpace E] in +theorem lipschitz_picard {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + (h : ℝ) (x : E) : LipschitzWith (‖h‖₊ * K) (picard hV.continuous h x) := by + have hp : LipschitzWith 1 (primitive (E := E)) := by + change LipschitzWith 1 (primitiveCLM (E := E)) + exact ContinuousLinearMap.opNorm_le_iff_lipschitz.mp primitiveCLM_norm_le + have hi := (lipschitzWith_smul h).comp (hp.comp (lipschitz_superpose hV)) + apply LipschitzWith.of_dist_le_mul + intro u v + simpa [picard] using hi.dist_le_mul u v + +omit [CompleteSpace E] in + +theorem contDiff_picard [ProperSpace E] {V : E → E} (hV : ContDiff ℝ ∞ V) (h : ℝ) : + ContDiff ℝ ∞ (fun p : E × C(Time, E) => picard hV.continuous h p.1 p.2) := by + have hc : ContDiff ℝ ∞ (fun p : E × C(Time, E) => ContinuousMap.const Time p.1) := + (ContinuousLinearMap.const ℝ Time : E →L[ℝ] C(Time, E)).contDiff.comp contDiff_fst + have hp : ContDiff ℝ ∞ (fun p : E × C(Time, E) => + primitive (SmoothPaths.superpose hV.continuous p.2)) := + primitiveCLM.contDiff.comp ((SmoothPaths.contDiff_superpose hV).comp contDiff_snd) + exact hc.add (hp.const_smul h) + +def trajectory {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + (h : ℝ) (hh : ‖h‖₊ * K < 1) (x : E) : C(Time, E) := + SmoothContraction.fixedPoint (f := fun p : E × C(Time, E) => picard hV.continuous h p.1 p.2) hh (lipschitz_picard hV h) x + +theorem trajectory_eq {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + (h : ℝ) (hh : ‖h‖₊ * K < 1) (x : E) : + picard hV.continuous h x (trajectory hV h hh x) = trajectory hV h hh x := + SmoothContraction.fixedPoint_eq (f := fun p : E × C(Time, E) => picard hV.continuous h p.1 p.2) hh (lipschitz_picard hV h) x + +theorem contDiff_trajectory [ProperSpace E] {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + (hVs : ContDiff ℝ ∞ V) (h : ℝ) (hh : ‖h‖₊ * K < 1) : + ContDiff ℝ ∞ (trajectory hV h hh) := + SmoothContraction.contDiff_fixedPoint (f := fun p : E × C(Time, E) => picard hV.continuous h p.1 p.2) (contDiff_picard hVs h) hh (lipschitz_picard hV h) + +def curve {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + (h : ℝ) (hh : ‖h‖₊ * K < 1) (x : E) (t : ℝ) : E := + x + h • ∫ s in 0..t, V (extend (trajectory hV h hh x) s) + +@[simp] theorem curve_coe {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + (h : ℝ) (hh : ‖h‖₊ * K < 1) (x : E) (t : Time) : + curve hV h hh x t = trajectory hV h hh x t := + congrArg (fun u : C(Time, E) => u t) (trajectory_eq hV h hh x) + +@[simp] theorem curve_zero {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + (h : ℝ) (hh : ‖h‖₊ * K < 1) (x : E) : curve hV h hh x 0 = x := by + simp [curve] + +theorem continuous_curve {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + (h : ℝ) (hh : ‖h‖₊ * K < 1) (x : E) : Continuous (curve hV h hh x) := by + have hc := hV.continuous.comp (continuous_extend (trajectory hV h hh x)) + exact continuous_const.add + ((intervalIntegral.continuous_primitive (fun a b => hc.intervalIntegrable a b) 0).const_smul h) + +theorem hasDerivAt_curve {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + (h : ℝ) (hh : ‖h‖₊ * K < 1) (x : E) (t : Time) : + HasDerivAt (curve hV h hh x) (h • V (curve hV h hh x t)) (t : ℝ) := by + have hc := hV.continuous.comp (continuous_extend (trajectory hV h hh x)) + have hd := intervalIntegral.integral_hasDerivAt_right + (hc.intervalIntegrable 0 t) (hc.stronglyMeasurableAtFilter volume (𝓝 (t : ℝ))) + hc.continuousAt + rw [curve_coe] + change HasDerivAt (fun s : ℝ => + x + h • ∫ r in 0..s, V (extend (trajectory hV h hh x) r)) _ (t : ℝ) + simpa only [Pi.smul_apply, Function.comp_apply, extend_coe] using + (hd.const_smul h).const_add x + +def step {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + (h : ℝ) (hh : ‖h‖₊ * K < 1) (x : E) : E := + trajectory hV h hh x ⟨1, by constructor <;> norm_num⟩ + +theorem contDiff_step [ProperSpace E] {V : E → E} {K : ℝ≥0} + (hV : LipschitzWith K V) (hVs : ContDiff ℝ ∞ V) + (h : ℝ) (hh : ‖h‖₊ * K < 1) : ContDiff ℝ ∞ (step hV h hh) := + (ContinuousMap.evalCLM ℝ (M := E) (⟨1, by constructor <;> norm_num⟩ : Time)).contDiff.comp + (contDiff_trajectory hV hVs h hh) + +@[simp] theorem curve_one {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + (h : ℝ) (hh : ‖h‖₊ * K < 1) (x : E) : curve hV h hh x 1 = step hV h hh x := + curve_coe hV h hh x ⟨1, by constructor <;> norm_num⟩ + +end +end SmoothODE + +namespace SmoothODE + +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal + +variable {E : Type u5} [NormedAddCommGroup E] [NormedSpace ℝ E] + [CompleteSpace E] + +noncomputable section + +theorem curve_unique {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + (h : ℝ) (hh : ‖h‖₊ * K < 1) (x : E) {f : ℝ → E} + (hf : ContinuousOn f (Icc 0 1)) + (hf' : ∀ t ∈ Ico (0 : ℝ) 1, HasDerivWithinAt f (h • V (f t)) (Ici t) t) + (h0 : f 0 = x) : EqOn f (curve hV h hh x) (Icc 0 1) := by + apply ODE_solution_unique_of_mem_Icc_right + (v := fun _ y => h • V y) (s := fun _ => univ) + (K := ‖h‖₊ * K) + · intro _ _ + exact ((lipschitzWith_smul h).comp hV).lipschitzOnWith + · exact hf + · exact hf' + · intro _ _; trivial + · exact (continuous_curve hV h hh x).continuousOn + · intro t ht + exact (hasDerivAt_curve hV h hh x ⟨t, ht.1, ht.2.le⟩).hasDerivWithinAt + · intro _ _; trivial + · simpa using h0 + +theorem curve_reverse {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + (h : ℝ) (hh : ‖h‖₊ * K < 1) (x : E) : + EqOn (fun t => curve hV h hh x (1 - t)) + (curve hV (-h) (by simpa using hh) (step hV h hh x)) (Icc 0 1) := by + apply curve_unique hV (-h) (by simpa using hh) (step hV h hh x) + · exact ((continuous_curve hV h hh x).comp (continuous_const.sub continuous_id)).continuousOn + · intro t ht + have hr : 1 - t ∈ Icc (0 : ℝ) 1 := ⟨by linarith [ht.2], by linarith [ht.1]⟩ + have hd := (hasDerivAt_curve hV h hh x ⟨1 - t, hr⟩).scomp t + ((hasDerivAt_id t).const_sub 1) + have he : HasDerivAt (fun t => curve hV h hh x (1 - t)) + ((-h) • V (curve hV h hh x (1 - t))) t := by + simpa only [Function.comp_def, id_eq, neg_smul, one_smul] using hd + exact he.hasDerivWithinAt + · simp + +theorem step_neg_step {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + (h : ℝ) (hh : ‖h‖₊ * K < 1) (x : E) : + step hV (-h) (by simpa using hh) (step hV h hh x) = x := by + have he := curve_reverse hV h hh x (show 1 ∈ Icc (0 : ℝ) 1 by constructor <;> norm_num) + simpa using he.symm + +def stepHomeomorph [ProperSpace E] {V : E → E} {K : ℝ≥0} + (hV : LipschitzWith K V) (hVs : ContDiff ℝ ∞ V) + (h : ℝ) (hh : ‖h‖₊ * K < 1) : E ≃ₜ E where + toFun := step hV h hh + invFun := step hV (-h) (by simpa using hh) + left_inv := step_neg_step hV h hh + right_inv x := by + simpa only [neg_neg] using step_neg_step hV (-h) (by simpa using hh) x + continuous_toFun := (contDiff_step hV hVs h hh).continuous + continuous_invFun := (contDiff_step hV hVs (-h) (by simpa using hh)).continuous + +@[simp] theorem stepHomeomorph_apply [ProperSpace E] {V : E → E} {K : ℝ≥0} + (hV : LipschitzWith K V) (hVs : ContDiff ℝ ∞ V) + (h : ℝ) (hh : ‖h‖₊ * K < 1) (x : E) : + stepHomeomorph hV hVs h hh x = step hV h hh x := rfl + +theorem curve_of_eq_zero {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + (h : ℝ) (hh : ‖h‖₊ * K < 1) (x : E) (hx : V x = 0) : + EqOn (curve hV h hh x) (fun _ => x) (Icc 0 1) := by + apply EqOn.symm + apply curve_unique hV h hh x continuousOn_const + · intro t _ + simpa only [hx, smul_zero] using (hasDerivWithinAt_const t (Ici t) x) + · rfl + +@[simp] theorem step_of_eq_zero {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + (h : ℝ) (hh : ‖h‖₊ * K < 1) (x : E) (hx : V x = 0) : + step hV h hh x = x := by + have he := curve_of_eq_zero hV h hh x hx (show 1 ∈ Icc (0 : ℝ) 1 by constructor <;> norm_num) + simpa using he + +end +end SmoothODE + +namespace SmoothODE + +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal + +variable {E : Type u6} [NormedAddCommGroup E] [NormedSpace ℝ E] + [CompleteSpace E] [ProperSpace E] + +noncomputable section + +def tangentPath {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + (h : ℝ) (hh : ‖h‖₊ * K < 1) (x v : E) : C(Time, E) := + fderiv ℝ (trajectory hV h hh) x v + +theorem tangentPath_eq {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + (hVs : ContDiff ℝ ∞ V) (h : ℝ) (hh : ‖h‖₊ * K < 1) (x v : E) : + tangentPath hV h hh x v = + ContinuousMap.const Time v + h • primitive + (SmoothPaths.applyField + (SmoothPaths.superpose (hVs.continuous_fderiv (by simp)) (trajectory hV h hh x)) + (tangentPath hV h hh x v)) := by + let Q := trajectory hV h hh + let DQ := fderiv ℝ Q x + let A := SmoothPaths.applyField + (SmoothPaths.superpose (hVs.continuous_fderiv (by simp)) (Q x)) + have hQ : HasFDerivAt Q DQ x := + (contDiff_trajectory hV hVs h hh).differentiable (by simp) x |>.hasFDerivAt + have hS := (SmoothPaths.hasFDerivAt_superpose + (hVs.differentiable (by simp)) (hVs.continuous_fderiv (by simp)) (Q x)).comp x hQ + have hP := (primitiveCLM (E := E)).hasFDerivAt.comp x hS + have hC := (ContinuousLinearMap.const ℝ Time : E →L[ℝ] C(Time, E)).hasFDerivAt (x := x) + have hD := hC.add (hP.const_smul h) + have hD' : HasFDerivAt Q + ((ContinuousLinearMap.const ℝ Time : E →L[ℝ] C(Time, E)) + + h • primitiveCLM.comp (A.comp DQ)) x := by + apply hD.congr_of_eventuallyEq + exact Filter.Eventually.of_forall (fun y => (trajectory_eq hV h hh y).symm) + exact congrArg (fun L : E →L[ℝ] C(Time, E) => L v) (hQ.unique hD') + +end +end SmoothODE + +end LowerBoundInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/LogProfile.lean b/lean/OAI/Geometry/PolarProducts/LogProfile.lean new file mode 100644 index 0000000000000000000000000000000000000000..e70eabbe8c8fe94c00a508b8828e79547555de22 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/LogProfile.lean @@ -0,0 +1,282 @@ +import OAI.Geometry.PolarProducts.HolomorphicBalls + +namespace OAI + +universe u50 u51 + +section LowerBoundInline +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter Metric +open scoped Topology ContDiff +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal +open Set Filter Function +open scoped Topology ContDiff +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter +open scoped Topology ContDiff +open Set Filter Function +open scoped Topology ContDiff +open Set Filter Function +open scoped ContDiff Topology +open Set MeasureTheory +open scoped ContDiff Interval Topology +open Set +open scoped Topology ContDiff +open Set + +open Set MeasureTheory +open scoped ContDiff Interval Topology + +namespace SmoothLogProfile +noncomputable section + +variable (b l u : ℝ) + +def cutoff (t : ℝ) : ℝ := Real.smoothTransition ((t - l) / (u - l)) + +def slope (t : ℝ) : ℝ := b + cutoff l u t * (Real.exp t - b) + +def profile (t : ℝ) : ℝ := Real.exp u + ∫ s in u..t, slope b l u s + +theorem cutoff_smooth : ContDiff ℝ ∞ (cutoff l u) := + Real.smoothTransition.contDiff.comp ((contDiff_id.sub contDiff_const).div_const _) + +theorem slope_smooth : ContDiff ℝ ∞ (slope b l u) := + contDiff_const.add ((cutoff_smooth l u).mul (Real.contDiff_exp.sub contDiff_const)) + +theorem cutoff_mem (t : ℝ) : cutoff l u t ∈ Icc (0 : ℝ) 1 := + ⟨Real.smoothTransition.nonneg _, Real.smoothTransition.le_one _⟩ + +theorem cutoff_zero (hlu : l < u) {t : ℝ} (ht : t ≤ l) : cutoff l u t = 0 := by + apply Real.smoothTransition.zero_of_nonpos + exact div_nonpos_of_nonpos_of_nonneg (sub_nonpos.mpr ht) (sub_nonneg.mpr hlu.le) + +theorem cutoff_one (hlu : l < u) {t : ℝ} (ht : u ≤ t) : cutoff l u t = 1 := by + apply Real.smoothTransition.one_of_one_le + exact (le_div_iff₀ (sub_pos.mpr hlu)).mpr (by linarith) + +theorem cutoff_monotone (hlu : l < u) : Monotone (cutoff l u) := by + intro x y hxy + exact Real.smoothTransition.monotone + (div_le_div_of_nonneg_right (sub_le_sub_right hxy l) (sub_nonneg.mpr hlu.le)) + +theorem slope_left (hlu : l < u) {t : ℝ} (ht : t ≤ l) : slope b l u t = b := by + simp [slope, cutoff_zero l u hlu ht] + +theorem slope_right (hlu : l < u) {t : ℝ} (ht : u ≤ t) : slope b l u t = Real.exp t := by + simp [slope, cutoff_one l u hlu ht] + +theorem slope_pos (hb : 0 < b) (t : ℝ) : 0 < slope b l u t := by + have hc := cutoff_mem l u t + have he := Real.exp_pos t + by_cases h : cutoff l u t = 1 + · simpa [slope, h] using he + have hp : 0 < (1 - cutoff l u t) * b := mul_pos (sub_pos.mpr (lt_of_le_of_ne hc.2 h)) hb + have hq : 0 ≤ cutoff l u t * Real.exp t := mul_nonneg hc.1 he.le + unfold slope + nlinarith + +theorem slope_monotone (hlu : l < u) (hbl : b ≤ Real.exp l) : Monotone (slope b l u) := by + intro x y hxy + by_cases hyl : y ≤ l + · rw [slope_left b l u hlu (hxy.trans hyl), slope_left b l u hlu hyl] + have hly : l ≤ y := (not_le.mp hyl).le + have hey : b ≤ Real.exp y := hbl.trans (Real.exp_le_exp.mpr hly) + by_cases hxl : x ≤ l + · rw [slope_left b l u hlu hxl] + exact le_add_of_nonneg_right (mul_nonneg (cutoff_mem l u y).1 (sub_nonneg.mpr hey)) + have hlx : l ≤ x := (not_le.mp hxl).le + have hex : b ≤ Real.exp x := hbl.trans (Real.exp_le_exp.mpr hlx) + unfold slope + apply add_le_add le_rfl + exact mul_le_mul (cutoff_monotone l u hlu hxy) + (sub_le_sub_right (Real.exp_le_exp.mpr hxy) b) (sub_nonneg.mpr hex) (cutoff_mem l u y).1 + +theorem hasDerivAt_profile (t : ℝ) : HasDerivAt (profile b l u) (slope b l u t) t := by + have hd : HasDerivAt (fun t => ∫ s in u..t, slope b l u s) (slope b l u t) t := by + apply intervalIntegral.integral_hasDerivAt_right + · exact (slope_smooth b l u).continuous.intervalIntegrable _ _ + · exact (slope_smooth b l u).continuous.stronglyMeasurableAtFilter _ _ + · exact (slope_smooth b l u).continuous.continuousAt + exact hd.const_add _ + +@[simp] theorem deriv_profile : deriv (profile b l u) = slope b l u := + funext (fun t => (hasDerivAt_profile b l u t).deriv) + +theorem profile_smooth : ContDiff ℝ ∞ (profile b l u) := by + rw [contDiff_infty_iff_deriv] + exact ⟨fun t => (hasDerivAt_profile b l u t).differentiableAt, + deriv_profile b l u ▸ slope_smooth b l u⟩ + +theorem deriv_profile_pos (hb : 0 < b) (t : ℝ) : 0 < deriv (profile b l u) t := by + rw [deriv_profile] + exact slope_pos b l u hb t + +theorem second_deriv_profile_nonneg (hlu : l < u) (hbl : b ≤ Real.exp l) (t : ℝ) : + 0 ≤ deriv (deriv (profile b l u)) t := by + rw [deriv_profile] + exact (slope_monotone b l u hlu hbl).deriv_nonneg + +theorem profile_sub (s t : ℝ) : + profile b l u t - profile b l u s = ∫ x in s..t, slope b l u x := by + have hadd := intervalIntegral.integral_add_adjacent_intervals + ((slope_smooth b l u).continuous.intervalIntegrable (μ := volume) u s) + ((slope_smooth b l u).continuous.intervalIntegrable s t) + unfold profile + linarith + +theorem profile_right (hlu : l < u) {t : ℝ} (ht : u ≤ t) : + profile b l u t = Real.exp t := by + have he : (∫ s in u..t, slope b l u s) = Real.exp t - Real.exp u := by + calc + _ = ∫ s in u..t, Real.exp s := by + apply intervalIntegral.integral_congr + intro s hs + exact slope_right b l u hlu (le_trans (by simp [ht]) hs.1) + _ = Real.exp t - Real.exp u := by simp + simp [profile, he] + +theorem profile_left (hlu : l < u) {t : ℝ} (ht : t ≤ l) : + profile b l u t = b * t + (profile b l u l - b * l) := by + have he : (∫ s in t..l, slope b l u s) = (l - t) * b := by + calc + _ = ∫ s in t..l, b := by + apply intervalIntegral.integral_congr + intro s hs + exact slope_left b l u hlu (le_trans hs.2 (by simp [ht])) + _ = (l - t) * b := by simp + have hdiff := profile_sub b l u t l + rw [he] at hdiff + nlinarith + +end +end SmoothLogProfile + +namespace ComplexPotential + +open Set Filter Asymptotics +open scoped Topology ContDiff +noncomputable section + +variable {E : Type u50} {F : Type u51} [NormedAddCommGroup E] [InnerProductSpace ℂ E] + [NormedAddCommGroup F] [InnerProductSpace ℂ F] + [FiniteDimensional ℂ E] [FiniteDimensional ℂ F] + +theorem exists_ball_from_holomorphic_zero {Ω : Set E} (hΩ : IsOpen Ω) (hΩ0 : (0 : E) ∈ Ω) + {f : E → F} (hf : AnalyticOnNhd ℂ f Ω) + (hfzero : ∀ x ∈ Ω, f x = 0 ↔ x = 0) + {k : ℕ} (hk : 1 ≤ k) (ho : f =O[𝓝 (0 : E)] (fun x : E => ‖x‖^k)) + (hcompact : ∀ s : ℝ, 0 < s → s < 1 → IsCompact {x | x ∈ Ω ∧ ‖f x‖^2 ≤ s}) + {a : ℝ} (ha : 0 < a) (hak : a < (k : ℝ)) : + let : InnerProductSpace ℝ E := InnerProductSpace.complexToReal + ∃ Q : E ≃ₜ E, ContDiff ℝ ∞ (Q : E → E) ∧ ContDiff ℝ ∞ (Q.symm : E → E) ∧ + (∀ x : E, ‖x‖^2 < a → Q x ∈ Ω ∧ ‖f (Q x)‖^2 < 1) ∧ + ∀ x : E, ‖x‖^2 < a → ∀ v w : E, + ddc (complexStructure E) (fun y => ‖y‖^2 + ‖f y‖^2) (Q x) + (fderiv ℝ (Q : E → E) x v) (fderiv ℝ (Q : E → E) x w) = + standardTensor (complexStructure E) v w := by + let : InnerProductSpace ℝ E := InnerProductSpace.complexToReal + let : InnerProductSpace ℝ F := InnerProductSpace.complexToReal + let τ : E → ℝ := fun x => ‖f x‖^2 + let U : Set E := {x | x ∈ Ω ∧ τ x < 1} + have hτsmooth (x : E) (hx : x ∈ Ω) : ContDiffAt ℝ ∞ τ x := + (contDiff_norm_sq ℝ).contDiffAt.comp x ((hf x hx).contDiffAt.restrict_scalars ℝ) + have hτcont : ContinuousOn τ Ω := fun x hx => (hτsmooth x hx).continuousAt.continuousWithinAt + have hU : IsOpen U := by + rw [isOpen_iff_mem_nhds] + intro x hx + exact inter_mem (hΩ.mem_nhds hx.1) + ((hτsmooth x hx.1).continuousAt.eventually_lt continuousAt_const hx.2) + have hf0 : f 0 = 0 := (hfzero 0 hΩ0).mpr rfl + have hτ0 : τ 0 = 0 := by simp [τ, hf0] + have hU0 : (0 : E) ∈ U := ⟨hΩ0, by rw [hτ0]; norm_num⟩ + have hτpsh (x : E) (hx : x ∈ U) : IsPSHAt (complexStructure E) τ x := by + have hn : IsPSHAt (complexStructure F) (fun z : F => ‖z‖^2) (f x) := by + refine ⟨(contDiff_norm_sq ℝ).contDiffAt, fun v => ?_⟩ + rw [ddc_norm_sq _ (complexStructure_skew), standardTensor_complex_line _ complexStructure_norm] + exact sq_nonneg _ + apply hn.holomorphic_comp ((hf x hx.1).contDiffAt.restrict_scalars ℝ) + filter_upwards [hΩ.mem_nhds hx.1] with y hy + exact (hf y hy).differentiableAt + have hpos (x : E) (hx : x ∈ U) (hx0 : x ≠ 0) : 0 < τ x := by + exact sq_pos_of_pos (norm_pos_iff.mpr (fun hh => hx0 ((hfzero x hx.1).mp hh))) + have hlogpsh (x : E) (hx : x ∈ U) (hx0 : x ≠ 0) : + IsPSHAt (complexStructure E) (Real.log ∘ τ) x := by + have hn := isPSHAt_logNormSq (complexStructure F) complexStructure_skew + complexStructure_norm complexStructure_sq (δ := 0) le_rfl + (show 0 < ‖f x‖^2 + 0 by simpa [τ] using hpos x hx hx0) + have hh := hn.holomorphic_comp ((hf x hx.1).contDiffAt.restrict_scalars ℝ) (by + filter_upwards [hΩ.mem_nhds hx.1] with y hy + exact (hf y hy).differentiableAt) + simpa only [logNormSq, add_zero, Function.comp_def, τ] using hh + have hkpos : (0 : ℝ) < k := by exact_mod_cast (Nat.zero_lt_of_lt hk) + obtain ⟨b, hab, hb1⟩ := exists_between ((div_lt_one hkpos).mpr hak) + have hb : 0 < b := (div_pos ha hkpos).trans hab + obtain ⟨l, hbl, hl0⟩ := exists_between (Real.log_neg hb hb1) + obtain ⟨u, hlu, hu0⟩ := exists_between hl0 + have hble : b ≤ Real.exp l := by + exact ((Real.log_le_iff_le_exp hb).mp hbl.le) + let H : E → ℝ := SmoothLogProfile.profile b l u ∘ Real.log ∘ τ + have hH (x : E) (hx : x ∈ U) (hx0 : x ≠ 0) : IsPSHAt (complexStructure E) H x := by + exact (hlogpsh x hx hx0).scalar_comp _ complexStructure_sq + (SmoothLogProfile.profile_smooth b l u).contDiffAt + (SmoothLogProfile.deriv_profile_pos b l u hb _).le + (SmoothLogProfile.second_deriv_profile_nonneg b l u hlu hble _) + have htail (x : E) (hx : x ∈ U) (ht : Real.exp u ≤ τ x) : H x = τ x := by + have htpos : 0 < τ x := (Real.exp_pos u).trans_le ht + have hlog : u ≤ Real.log (τ x) := by + simpa using Real.log_le_log (Real.exp_pos u) ht + change SmoothLogProfile.profile b l u (Real.log (τ x)) = τ x + rw [SmoothLogProfile.profile_right b l u hlu hlog, Real.exp_log htpos] + obtain ⟨C, hC, hCb⟩ := ho.exists_pos + have hev : ∀ᶠ x in 𝓝 (0 : E), ‖f x‖ ≤ C * ‖x‖^k ∧ τ x < Real.exp l := by + filter_upwards [hCb.bound, + (hτsmooth 0 hΩ0).continuousAt.eventually_lt continuousAt_const + (show τ 0 < Real.exp l by rw [hτ0]; exact Real.exp_pos l)] with x hx ht + exact ⟨by simpa only [Real.norm_eq_abs, abs_of_nonneg (pow_nonneg (norm_nonneg _) _)] using hx, ht⟩ + obtain ⟨ε, hε, hεprop⟩ := Metric.eventually_nhds_iff.mp hev + let ρ := ε / 2 + have hρ : 0 < ρ := half_pos hε + let C₁ := b * (2 * Real.log C) + (SmoothLogProfile.profile b l u l - b * l) + have hpole (x : E) (hx : x ∈ U) (hx0 : x ≠ 0) (hnorm : ‖x‖ ≤ ρ) : + H x ≤ (b * k) * Real.log (‖x‖^2) + C₁ := by + have hdist : dist x 0 < ε := by rw [dist_zero_right]; exact hnorm.trans_lt (half_lt_self hε) + obtain ⟨hbound, hsmall⟩ := hεprop hdist + have hxp : 0 < ‖x‖ := norm_pos_iff.mpr hx0 + have hfxp : 0 < ‖f x‖ := norm_pos_iff.mpr (fun hh => hx0 ((hfzero x hx.1).mp hh)) + have hlogl : Real.log (τ x) ≤ l := (Real.log_le_iff_le_exp (hpos x hx hx0)).mpr hsmall.le + change SmoothLogProfile.profile b l u (Real.log (τ x)) ≤ _ + rw [SmoothLogProfile.profile_left b l u hlu hlogl] + have hlg := Real.log_le_log hfxp hbound + rw [Real.log_mul hC.ne' (pow_pos hxp k).ne', Real.log_pow] at hlg + have hmul := mul_le_mul_of_nonneg_left hlg hb.le + dsimp [τ, C₁] + rw [Real.log_pow, Real.log_pow] + norm_num only [Nat.cast_ofNat] + nlinarith + apply exists_ball_from_logarithmic_pole (complexStructure E) complexStructure_skew + complexStructure_norm complexStructure_sq hU hU0 hτpsh hτ0 hH + · intro s hs hs1 + have he : {x | x ∈ U ∧ τ x ≤ s} = {x | x ∈ Ω ∧ ‖f x‖^2 ≤ s} := by + ext x + constructor + · exact fun hx => ⟨hx.1.1, hx.2⟩ + · exact fun hx => ⟨⟨hx.1, hx.2.trans_lt hs1⟩, hx.2⟩ + rw [he] + exact hcompact s hs hs1 + · exact Real.exp_lt_one_iff.mpr hu0 + · exact hρ + · exact htail + · exact hpole + · exact ha + · exact (div_lt_iff₀ hkpos).mp hab + +end +end ComplexPotential + +end LowerBoundInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/LowerBound.lean b/lean/OAI/Geometry/PolarProducts/LowerBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..824ecfb7fc08500ebbb5886d8cbab506051a3f28 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/LowerBound.lean @@ -0,0 +1,64 @@ +import OAI.Geometry.PolarProducts.PolarApproximation + +namespace OAI + +section LowerBoundInline +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter Metric +open scoped Topology ContDiff +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal +open Set Filter Function +open scoped Topology ContDiff +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter +open scoped Topology ContDiff +open Set Filter Function +open scoped Topology ContDiff +open Set Filter Function +open scoped ContDiff Topology +open Set MeasureTheory +open scoped ContDiff Interval Topology +open Set +open scoped Topology ContDiff +open Set +open Set MeasureTheory +open scoped ContDiff Interval Topology +open Set Filter Complex +open scoped Topology ContDiff +open MeasureTheory intervalIntegral Set +open scoped Real +open Set +open scoped ContDiff ENNReal + +namespace SymmetricPolar +open Set +open scoped ENNReal +noncomputable section +variable {n : ℕ} + +theorem gromovWidth_mono {U V : Set (Phase n)} (h : U ⊆ V) : + gromovWidth U ≤ gromovWidth V := by + apply sSup_le_sSup + rintro _ ⟨c, ⟨hc, he⟩, rfl⟩ + exact ⟨c, ⟨hc, he.mono_target h⟩, rfl⟩ + +theorem four_le_gromovWidth_polarProduct {K : Set (Position n)} (hK : IsSymmetricConvexBody K) : + 4 ≤ gromovWidth (polarProduct K) := by + apply ENNReal.le_of_forall_pos_nnreal_lt + intro r hr hr4 + have hrreal : (0 : ℝ) < r := by exact_mod_cast hr + have hr4real : (r : ℝ) < 4 := by + apply (ENNReal.ofReal_lt_ofReal_iff (by norm_num : (0 : ℝ) < 4)).mp + simpa using hr4 + apply le_sSup + refine ⟨(r : ℝ), ⟨hrreal, symmetric_polar_embedding hK hrreal hr4real⟩, ?_⟩ + simp + +end +end SymmetricPolar +end LowerBoundInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/Main.lean b/lean/OAI/Geometry/PolarProducts/Main.lean new file mode 100644 index 0000000000000000000000000000000000000000..1b51f466a7102e0851387484f9ed44a0c8e8ff4f --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/Main.lean @@ -0,0 +1,19 @@ +import OAI.Geometry.PolarProducts.UpperBound + +namespace OAI + +namespace SymmetricPolar + +theorem symmetric_polar_main {n : ℕ} (hn : 2 ≤ n) + (K : Set (Position n)) (hK : IsSymmetricConvexBody K) : + gromovWidth (polarProduct K) = 4 ∧ + ∀ c : ℝ, 0 < c → c < 4 → + HasSymplecticEmbedding (capacityBall n c) (polarProduct K) := by + refine ⟨le_antisymm (gromovWidth_polarProduct_le_four hK (by omega)) + (four_le_gromovWidth_polarProduct hK), ?_⟩ + intro c hc hc4 + exact symmetric_polar_embedding hK hc hc4 + +end SymmetricPolar + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/Model.lean b/lean/OAI/Geometry/PolarProducts/Model.lean new file mode 100644 index 0000000000000000000000000000000000000000..9cce72ffd69d1fc749b295f211f3298ba40a8230 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/Model.lean @@ -0,0 +1,44 @@ +import Mathlib + +namespace OAI + +section +open Set +open scoped ContDiff ENNReal + +namespace SymmetricPolar + +abbrev Position (n : ℕ) := EuclideanSpace ℝ (Fin n) +abbrev Phase (n : ℕ) := Position n × Position n + +def IsSymmetricConvexBody {n : ℕ} (K : Set (Position n)) : Prop := + IsCompact K ∧ Convex ℝ K ∧ (interior K).Nonempty ∧ + ∀ x, x ∈ K ↔ -x ∈ K + +def polar {n : ℕ} (K : Set (Position n)) : Set (Position n) := + {p | ∀ q ∈ K, inner (𝕜 := ℝ) q p ≤ 1} + +def polarProduct {n : ℕ} (K : Set (Position n)) : Set (Phase n) := + interior K ×ˢ interior (polar K) + +def capacityBall (n : ℕ) (c : ℝ) : Set (Phase n) := + {z | Real.pi * (‖z.1‖ ^ 2 + ‖z.2‖ ^ 2) < c} + +noncomputable def omega0 {n : ℕ} (v w : Phase n) : ℝ := + inner (𝕜 := ℝ) v.1 w.2 - inner (𝕜 := ℝ) w.1 v.2 + +def HasSymplecticEmbedding {n : ℕ} (U V : Set (Phase n)) : Prop := + ∃ e : Phase n → Phase n, + ContDiffOn ℝ ∞ e U ∧ + Topology.IsEmbedding (fun z : U => e z) ∧ + MapsTo e U V ∧ + ∀ z ∈ U, ∀ v w : Phase n, + omega0 (fderiv ℝ e z v) (fderiv ℝ e z w) = omega0 v w + +noncomputable def gromovWidth {n : ℕ} (U : Set (Phase n)) : ℝ≥0∞ := + sSup (ENNReal.ofReal '' {c : ℝ | 0 < c ∧ HasSymplecticEmbedding (capacityBall n c) U}) + +end SymmetricPolar +end + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/MomentumBounds.lean b/lean/OAI/Geometry/PolarProducts/MomentumBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..2646cee0ed84add3af7935c92e1ad62ddac9f6ea --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/MomentumBounds.lean @@ -0,0 +1,304 @@ +import OAI.Geometry.PolarProducts.StripEmbedding + +namespace OAI + +universe u70 u71 u72 u73 + +section LowerBoundInline +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter Metric +open scoped Topology ContDiff +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal +open Set Filter Function +open scoped Topology ContDiff +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter +open scoped Topology ContDiff +open Set Filter Function +open scoped Topology ContDiff +open Set Filter Function +open scoped ContDiff Topology +open Set MeasureTheory +open scoped ContDiff Interval Topology +open Set +open scoped Topology ContDiff +open Set +open Set MeasureTheory +open scoped ContDiff Interval Topology +open Set Filter Complex +open scoped Topology ContDiff +open MeasureTheory intervalIntegral Set +open scoped Real + +namespace PolarStrips +open Set Filter ComplexCoordinates +open scoped Topology ContDiff +noncomputable section +variable {ι : Type u70} {κ : Type u71} [Fintype ι] [Fintype κ] + +theorem position_mem_interior (b : κ → R ι) (k : ℕ) {z : C ι} + (hz : z ∈ domain (fun j => functional (b j))) : + (phase b k z).1 ∈ interior (ConvexPolar.stripBody b) := by + apply ConvexPolar.mem_interior_stripBody + intro j + change |inner (𝕜 := ℝ) (b j) (im z)| < 1 + rw [← im_functional] + exact abs_lt.mpr (PlanarLens.im_mem_Ioo (hz j)) + +theorem norm_re_le (z : C ι) : ‖re z‖ ≤ ‖z‖ := by + have hh := norm_sq_parts z + nlinarith [sq_nonneg ‖im z‖, norm_nonneg (re z), norm_nonneg z] + +theorem momentum_bound (b : κ → R ι) {k : ℕ} (hk : 1 ≤ k) {z : C ι} + (hz : z ∈ domain (fun j => functional (b j))) {y : R ι} + (hy : y ∈ ConvexPolar.stripBody b) {A B : ℝ} + (hzA : ‖z‖ ≤ A) (hyB : ‖y‖ ≤ B) : + inner (𝕜 := ℝ) y (phase b k z).2 / (k : ℝ) ≤ + A*B/(k : ℝ) + Real.pi/4*‖tuple (fun j => functional (b j)) k z‖^2 + + (Fintype.card κ : ℝ)*PlanarLens.epsilon k := by + have hkpos : (0 : ℝ) < k := by exact_mod_cast (Nat.zero_lt_of_lt hk) + have hu : inner (𝕜 := ℝ) y (-re z) ≤ A*B := by + have hh := real_inner_le_norm y (-re z) + rw [norm_neg] at hh + have hm := mul_le_mul hyB ((norm_re_le z).trans hzA) (norm_nonneg _) (le_trans (norm_nonneg _) hyB) + nlinarith + have hj (j : κ) : -(PlanarLens.primitive k (functional (b j) z)*inner (𝕜 := ℝ) y (b j)) ≤ + |PlanarLens.primitive k (functional (b j) z)| := by + have hh : |inner (𝕜 := ℝ) y (b j)| ≤ 1 := by rw [real_inner_comm]; exact hy j + calc + _ ≤ |PlanarLens.primitive k (functional (b j) z)*inner (𝕜 := ℝ) y (b j)| := neg_le_abs _ + _ = |PlanarLens.primitive k (functional (b j) z)| * |inner (𝕜 := ℝ) y (b j)| := abs_mul _ _ + _ ≤ _ := by simpa using mul_le_mul_of_nonneg_left hh (abs_nonneg (PlanarLens.primitive k (functional (b j) z))) + have hsum : inner (𝕜 := ℝ) y (phase b k z).2 ≤ A*B+∑ j, |PlanarLens.primitive k (functional (b j) z)| := by + have hh := Finset.sum_le_sum (fun j (_ : j ∈ Finset.univ) => hj j) + simp only [phase, inner_sub_right, inner_sum, real_inner_smul_right, Finset.sum_neg_distrib] at ⊢ hh + linarith + have hslice (j : κ) : |PlanarLens.primitive k (functional (b j) z)|/(k : ℝ) ≤ + Real.pi/4*‖PlanarLens.g (functional (b j) z)‖^(2*k)+PlanarLens.epsilon k := by + simpa only [PlanarLens.primitive, Complex.re_add_im] using + PlanarLens.uniform_slice hk (v := (functional (b j) z).re) (t := (functional (b j) z).im) + (by simpa only [Complex.re_add_im] using hz j) + calc + _ ≤ (A*B+∑ j, |PlanarLens.primitive k (functional (b j) z)|)/(k : ℝ) := + div_le_div_of_nonneg_right hsum hkpos.le + _ = A*B/(k : ℝ) + ∑ j, |PlanarLens.primitive k (functional (b j) z)|/(k : ℝ) := by + rw [add_div, Finset.sum_div] + _ ≤ A*B/(k : ℝ) + ∑ j, (Real.pi/4*‖PlanarLens.g (functional (b j) z)‖^(2*k)+PlanarLens.epsilon k) := + add_le_add le_rfl (Finset.sum_le_sum (fun j _ => hslice j)) + _ = _ := by rw [Finset.sum_add_distrib, ← Finset.mul_sum, ← norm_tuple_sq]; simp [add_assoc] + +theorem exists_uniform_momentum_bound (b : κ → R ι) + (hb : Function.Injective (fun x : R ι => fun j => inner (𝕜 := ℝ) (b j) x)) : + ∃ C B : ℝ, 0 ≤ C ∧ 0 ≤ B ∧ (∀ y ∈ ConvexPolar.stripBody b, ‖y‖ ≤ B) ∧ + ∀ k : ℕ, 1 ≤ k → ∀ z ∈ domain (fun j => functional (b j)), + ∀ y ∈ ConvexPolar.stripBody b, + inner (𝕜 := ℝ) y (phase b k z).2 / (k : ℝ) ≤ + C/(k : ℝ)+Real.pi/4*‖tuple (fun j => functional (b j)) k z‖^2 + + (Fintype.card κ : ℝ)*PlanarLens.epsilon k := by + obtain ⟨A, hA⟩ := (isBounded_domain _ (functional_injective b hb)).exists_norm_le + obtain ⟨B, hB⟩ := (ConvexPolar.isCompact_stripBody b hb).isBounded.exists_norm_le + have hA0 : 0 ≤ A := (norm_nonneg (0 : C ι)).trans (hA 0 (zero_mem_domain _)) + have hB0 : 0 ≤ B := (norm_nonneg (0 : R ι)).trans (hB 0 (interior_subset (ConvexPolar.zero_mem_interior_stripBody b))) + refine ⟨A*B, B, mul_nonneg hA0 hB0, hB0, hB, ?_⟩ + intro k hk z hz y hy + exact momentum_bound b hk hz hy (hA z hz) (hB y hy) + +theorem exists_scaled_image (b : κ → R ι) + (hb : Function.Injective (fun x : R ι => fun j => inner (𝕜 := ℝ) (b j) x)) + {η : ℝ} (hη : 0 < η) : + ∃ k : ℕ, 1 ≤ k ∧ ∀ z : C ι, + z ∈ domain (fun j => functional (b j)) → ‖tuple (fun j => functional (b j)) k z‖^2 < 1 → + (phase b k z).1 ∈ interior (ConvexPolar.stripBody b) ∧ + (((1+η)*Real.pi*(k : ℝ)/4)⁻¹ • (phase b k z).2) ∈ interior (ConvexPolar.polar (ConvexPolar.stripBody b)) := by + obtain ⟨C, B, _hC, hB, hbound, hmoment⟩ := exists_uniform_momentum_bound b hb + have ht : Tendsto (fun k : ℕ => C/(k : ℝ)+(Fintype.card κ : ℝ)*PlanarLens.epsilon k) atTop (𝓝 0) := by + simpa using (tendsto_const_div_atTop_nhds_zero_nat C).add (PlanarLens.tendsto_epsilon.const_mul (Fintype.card κ : ℝ)) + have hsmall := ht.eventually (eventually_lt_nhds (show (0 : ℝ) < η*Real.pi/4 by positivity)) + obtain ⟨k, hk, hksmall⟩ := (eventually_ge_atTop (1 : ℕ)).and hsmall |>.exists + have hkpos : (0 : ℝ) < k := by exact_mod_cast (Nat.zero_lt_of_lt hk) + let T := (1+η)*Real.pi/4 + have hT : 0 < T := by dsimp [T]; positivity + have hTsmall : C/(k : ℝ)+Real.pi/4+(Fintype.card κ : ℝ)*PlanarLens.epsilon k < T := by dsimp [T]; nlinarith + refine ⟨k, hk, fun z hz hτ => ⟨position_mem_interior b k hz, ?_⟩⟩ + apply ConvexPolar.mem_interior_polar_of_bound hB hbound + (r := (C/(k : ℝ)+Real.pi/4+(Fintype.card κ : ℝ)*PlanarLens.epsilon k)/T) + · exact (div_lt_one hT).mpr hTsmall + · intro y hy + have hh := hmoment k hk z hz y hy + have hp : inner (𝕜 := ℝ) y (phase b k z).2/(k : ℝ) ≤ + C/(k : ℝ)+Real.pi/4+(Fintype.card κ : ℝ)*PlanarLens.epsilon k := by + have hm := mul_le_mul_of_nonneg_left hτ.le (by positivity : (0 : ℝ) ≤ Real.pi/4) + linarith + have hd := div_le_div_of_nonneg_right hp hT.le + calc + _ = inner (𝕜 := ℝ) y (phase b k z).2/(k : ℝ)/T := by + rw [real_inner_smul_right] + dsimp only [T] + field_simp + _ ≤ _ := hd + +end +end PolarStrips + +open Set +open scoped ContDiff ENNReal + +namespace SymmetricPolar + +end SymmetricPolar + +namespace LocalEmbedding +open Set Filter +open scoped Topology ContDiff +noncomputable section +variable {E : Type u72} {F : Type u73} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + [NormedAddCommGroup F] [NormedSpace ℝ F] + +theorem open_image {U : Set E} (hU : IsOpen U) {f : E → F} + (hf : ContDiffOn ℝ ∞ f U) + (hD : ∀ x ∈ U, (fderiv ℝ f x).IsInvertible) : IsOpen (f '' U) := by + rw [isOpen_iff_mem_nhds] + rintro _ ⟨x, hx, rfl⟩ + have hs := hf.contDiffAt (hU.mem_nhds hx) + obtain ⟨e, heq⟩ := hD x hx + have he : HasFDerivAt f e.toContinuousLinearMap x := by + rw [heq] + exact (hs.differentiableAt (by simp)).hasFDerivAt + rw [← (hs.hasStrictFDerivAt' he (by simp)).map_nhds_eq_of_equiv] + change f ⁻¹' (f '' U) ∈ 𝓝 x + exact mem_of_superset (hU.mem_nhds hx) (fun y hy => mem_image_of_mem f hy) + +theorem isOpenEmbedding {U : Set E} (hU : IsOpen U) {f : E → F} + (hf : ContDiffOn ℝ ∞ f U) (hi : InjOn f U) + (hD : ∀ x ∈ U, (fderiv ℝ f x).IsInvertible) : + Topology.IsOpenEmbedding (fun x : U => f x) := by + apply Topology.IsOpenEmbedding.of_continuous_injective_isOpenMap hf.continuousOn.domRestrict + · intro x y h; exact Subtype.ext (hi x.2 y.2 h) + · intro V hV + have hUV : Subtype.val '' V ⊆ U := by rintro _ ⟨x, _, rfl⟩; exact x.2 + have huV : IsOpen (Subtype.val '' V) := hU.isOpenMap_subtype_val _ hV + have ho := open_image huV (hf.mono hUV) (fun x hx => hD x (hUV hx)) + change IsOpen ((fun x : U => f x) '' V) + rw [image_image] at ho + exact ho + +end +end LocalEmbedding + +namespace SymmetricPolar +open Set Filter +open scoped ContDiff Topology +noncomputable section +variable {n : ℕ} + +theorem isOpen_capacityBall (n : ℕ) (c : ℝ) : IsOpen (capacityBall n c) := + isOpen_lt (by fun_prop) continuous_const + +def diagScale (a b : ℝ) : Phase n →L[ℝ] Phase n := + (a • ContinuousLinearMap.fst ℝ (Position n) (Position n)).prod + (b • ContinuousLinearMap.snd ℝ (Position n) (Position n)) + +@[simp] theorem diagScale_apply (a b : ℝ) (z : Phase n) : diagScale a b z = (a • z.1, b • z.2) := rfl + +theorem diagScale_injective {a b : ℝ} (ha : a ≠ 0) (hb : b ≠ 0) : + Function.Injective (diagScale a b : Phase n → Phase n) := by + intro x y h + exact Prod.ext ((smul_right_injective _ ha) (congrArg Prod.fst h)) + ((smul_right_injective _ hb) (congrArg Prod.snd h)) + +theorem omega0_diagScale (a b : ℝ) (v w : Phase n) : + omega0 (diagScale a b v) (diagScale a b w) = (a*b)*omega0 v w := by + simp only [omega0, diagScale_apply, real_inner_smul_left, real_inner_smul_right] + ring + +theorem omega0_nondegenerate (v : Phase n) (h : ∀ w : Phase n, omega0 v w = 0) : v = 0 := by + have hh := h (-v.2, v.1) + simp only [omega0, inner_neg_left, real_inner_self_eq_norm_sq, sub_neg_eq_add] at hh + have h1 : v.1 = 0 := norm_eq_zero.mp (by nlinarith [norm_nonneg v.1, sq_nonneg ‖v.2‖]) + have h2 : v.2 = 0 := norm_eq_zero.mp (by nlinarith [norm_nonneg v.2, sq_nonneg ‖v.1‖]) + exact Prod.ext h1 h2 + +theorem isInvertible_of_preserves_omega0 (L : Phase n →L[ℝ] Phase n) + (hL : ∀ v w, omega0 (L v) (L w) = omega0 v w) : L.IsInvertible := by + have hi : Function.Injective L := by + intro v w hvw + have hz : L (v-w) = 0 := by rw [map_sub, hvw, sub_self] + apply sub_eq_zero.mp + apply omega0_nondegenerate + intro a + rw [← hL, hz] + simp [omega0] + have hs : Function.Surjective L := LinearMap.surjective_of_injective hi + exact ⟨ContinuousLinearEquiv.ofBijective L (LinearMap.ker_eq_bot.mpr hi) + (LinearMap.range_eq_top.mpr hs), rfl⟩ + +theorem hasSymplecticEmbedding_of_injOn {U V : Set (Phase n)} (hU : IsOpen U) + {e : Phase n → Phase n} (he : ContDiffOn ℝ ∞ e U) (hi : InjOn e U) + (hm : MapsTo e U V) (hω : ∀ z ∈ U, ∀ v w, + omega0 (fderiv ℝ e z v) (fderiv ℝ e z w) = omega0 v w) : + HasSymplecticEmbedding U V := by + refine ⟨e, he, ?_, hm, hω⟩ + exact (LocalEmbedding.isOpenEmbedding hU he hi (fun z hz => isInvertible_of_preserves_omega0 _ (hω z hz))).isEmbedding + +theorem HasSymplecticEmbedding.mono_target {U V W : Set (Phase n)} + (h : HasSymplecticEmbedding U V) (hVW : V ⊆ W) : HasSymplecticEmbedding U W := by + rcases h with ⟨e, he, hi, hm, hω⟩ + exact ⟨e, he, hi, hm.mono_right hVW, hω⟩ + +theorem HasSymplecticEmbedding.injOn {U : Set (Phase n)} {e : Phase n → Phase n} + (he : Topology.IsEmbedding (fun z : U => e z)) : InjOn e U := by + intro x hx y hy h + exact congrArg Subtype.val (he.injective (show e (⟨x,hx⟩ : U) = e (⟨y,hy⟩ : U) from h)) + +theorem mapsTo_scaled_ball {lam c : ℝ} (hlam : 0 < lam) : + MapsTo (diagScale (Real.sqrt lam) (Real.sqrt lam) : Phase n → Phase n) + (capacityBall n c) (capacityBall n (lam*c)) := by + intro z hz + change Real.pi*(‖Real.sqrt lam • z.1‖^2+‖Real.sqrt lam • z.2‖^2) < lam*c + have hsq : |Real.sqrt lam|^2 = lam := by rw [sq_abs, Real.sq_sqrt hlam.le] + simp only [norm_smul, Real.norm_eq_abs, mul_pow, hsq] + have hh := mul_lt_mul_of_pos_left hz hlam + nlinarith + +theorem embedding_of_scaled_ball_map {lam c a b : ℝ} (hlam : 0 < lam) (hab : a*b = lam⁻¹) + {V : Set (Phase n)} {e : Phase n → Phase n} + (he : ContDiffOn ℝ ∞ e (capacityBall n (lam*c))) + (hi : InjOn e (capacityBall n (lam*c))) + (hm : MapsTo (fun z => diagScale a b (e z)) (capacityBall n (lam*c)) V) + (hω : ∀ z ∈ capacityBall n (lam*c), ∀ v w, + omega0 (fderiv ℝ e z v) (fderiv ℝ e z w) = omega0 v w) : + HasSymplecticEmbedding (capacityBall n c) V := by + let D : Phase n →L[ℝ] Phase n := diagScale (Real.sqrt lam) (Real.sqrt lam) + let L : Phase n →L[ℝ] Phase n := diagScale a b + let F : Phase n → Phase n := fun z => L (e (D z)) + have hD : MapsTo D (capacityBall n c) (capacityBall n (lam*c)) := mapsTo_scaled_ball hlam + have hLinj : Function.Injective L := diagScale_injective (left_ne_zero_of_mul (by rw [hab]; exact inv_ne_zero hlam.ne')) + (right_ne_zero_of_mul (by rw [hab]; exact inv_ne_zero hlam.ne')) + have hDinj : Function.Injective D := diagScale_injective (Real.sqrt_pos.mpr hlam).ne' (Real.sqrt_pos.mpr hlam).ne' + have hs (z : Phase n) (hz : z ∈ capacityBall n c) : ContDiffAt ℝ ∞ e (D z) := + he.contDiffAt ((isOpen_capacityBall _ _).mem_nhds (hD hz)) + apply hasSymplecticEmbedding_of_injOn (isOpen_capacityBall n c) (e := F) + · intro z hz + exact (L.contDiff.contDiffAt.comp z ((hs z hz).comp z D.contDiff.contDiffAt)).contDiffWithinAt + · intro z hz w hw h + exact hDinj (hi (hD hz) (hD hw) (hLinj h)) + · intro z hz + exact hm (hD hz) + · intro z hz v w + have hd : HasFDerivAt F (L.comp ((fderiv ℝ e (D z)).comp D)) z := + L.hasFDerivAt.comp z (((hs z hz).differentiableAt (by simp)).hasFDerivAt.comp z D.hasFDerivAt) + rw [hd.fderiv] + change omega0 (diagScale a b (fderiv ℝ e (D z) (D v))) + (diagScale a b (fderiv ℝ e (D z) (D w))) = _ + rw [omega0_diagScale, hω _ (hD hz), hab, omega0_diagScale] + rw [← pow_two, Real.sq_sqrt hlam.le, ← mul_assoc, inv_mul_cancel₀ hlam.ne', one_mul] + +end +end SymmetricPolar + +end LowerBoundInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/MoserField.lean b/lean/OAI/Geometry/PolarProducts/MoserField.lean new file mode 100644 index 0000000000000000000000000000000000000000..01f2324cdce2fe6af91c90a82e306a91b02c65e0 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/MoserField.lean @@ -0,0 +1,299 @@ +import OAI.Geometry.PolarProducts.TensorCalculus + +namespace OAI + +universe u23 u24 + +section LowerBoundInline +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter Metric +open scoped Topology ContDiff +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal +open Set Filter Function +open scoped Topology ContDiff + +open Set Filter Function +open scoped Topology ContDiff NNReal + +namespace Moser + +variable {E : Type u23} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + +noncomputable section + +def spatialField (A : (ℝ × E) → E →L[ℝ] E →L[ℝ] ℝ) + (γ : E → E →L[ℝ] ℝ) (ρ : ℝ → ℝ) (z : ℝ × E) : E := + -(ρ z.1) • (A z).inverse (γ z.2) + +omit [CompleteSpace E] in +theorem spatialField_eq_zero_of_oneForm_eq_zero + (A : (ℝ × E) → E →L[ℝ] E →L[ℝ] ℝ) + (γ : E → E →L[ℝ] ℝ) (ρ : ℝ → ℝ) (z : ℝ × E) (hz : γ z.2 = 0) : + spatialField A γ ρ z = 0 := by simp [spatialField, hz] + +omit [CompleteSpace E] in +theorem contract_spatialField {A : (ℝ × E) → E →L[ℝ] E →L[ℝ] ℝ} + (γ : E → E →L[ℝ] ℝ) (ρ : ℝ → ℝ) (z : ℝ × E) (hA : (A z).IsInvertible) : + A z (spatialField A γ ρ z) = -(ρ z.1) • γ z.2 := by + simp only [spatialField, map_smul, hA.self_apply_inverse] + +omit [CompleteSpace E] in + +theorem oneForm_spatialField {A : (ℝ × E) → E →L[ℝ] E →L[ℝ] ℝ} + (γ : E → E →L[ℝ] ℝ) (ρ : ℝ → ℝ) (z : ℝ × E) + (hA : (A z).IsInvertible) (hsk : ∀ a b, A z a b = -A z b a) : + γ z.2 (spatialField A γ ρ z) = 0 := by + let v := (A z).inverse (γ z.2) + have he : A z v = γ z.2 := hA.self_apply_inverse _ + have hh := hsk v v + have hz : A z v v = 0 := by linarith + have hγv : γ z.2 v = 0 := by rw [← he]; exact hz + simpa [spatialField, v, map_smul, smul_eq_mul] using + congrArg (fun t : ℝ => -(ρ z.1) * t) hγv + +theorem contDiff_spatialField {A : (ℝ × E) → E →L[ℝ] E →L[ℝ] ℝ} + {γ : E → E →L[ℝ] ℝ} {ρ : ℝ → ℝ} {U : Set E} + (hA : ∀ z, z.2 ∈ U → ContDiffAt ℝ ∞ A z) + (hi : ∀ z, z.2 ∈ U → (A z).IsInvertible) + (hγ : ContDiff ℝ ∞ γ) (hρ : ContDiff ℝ ∞ ρ) (hs : tsupport γ ⊆ U) : + ContDiff ℝ ∞ (spatialField A γ ρ) := by + rw [contDiff_iff_contDiffAt] + intro z + by_cases hz : z.2 ∈ U + · have hv : ContDiffAt ℝ ∞ (fun x => (A x).inverse) z := + (hi z hz).contDiffAt_map_inverse.comp z (hA z hz) + exact ((hρ.contDiffAt.comp z contDiffAt_fst).neg).smul + (hv.clm_apply (hγ.contDiffAt.comp z contDiffAt_snd)) + · have ht : z.2 ∉ tsupport γ := fun hc => hz (hs hc) + have he : ∀ᶠ y in 𝓝 z, y.2 ∉ tsupport γ := + continuous_snd.continuousAt ((isClosed_tsupport γ).isOpen_compl.mem_nhds ht) + have heq : spatialField A γ ρ =ᶠ[𝓝 z] fun _ => 0 := he.mono (fun y hy => + spatialField_eq_zero_of_oneForm_eq_zero A γ ρ y (image_eq_zero_of_notMem_tsupport hy)) + exact contDiffAt_const.congr_of_eventuallyEq heq + +omit [CompleteSpace E] in + +theorem hasCompactSupport_spatialField + (A : (ℝ × E) → E →L[ℝ] E →L[ℝ] ℝ) + {γ : E → E →L[ℝ] ℝ} {ρ : ℝ → ℝ} + (hγ : HasCompactSupport γ) (hρ : HasCompactSupport ρ) : + HasCompactSupport (spatialField A γ ρ) := by + apply HasCompactSupport.of_support_subset_isCompact (hρ.prod hγ) + intro z hz + constructor + · by_contra ht + apply hz + simp [spatialField, image_eq_zero_of_notMem_tsupport ht] + · by_contra hx + apply hz + exact spatialField_eq_zero_of_oneForm_eq_zero A γ ρ z + (image_eq_zero_of_notMem_tsupport hx) + +theorem exists_lipschitz_spaceTimeField + {A : (ℝ × E) → E →L[ℝ] E →L[ℝ] ℝ} + {γ : E → E →L[ℝ] ℝ} {ρ : ℝ → ℝ} {U : Set E} + (hA : ∀ z, z.2 ∈ U → ContDiffAt ℝ ∞ A z) + (hi : ∀ z, z.2 ∈ U → (A z).IsInvertible) + (hγ : ContDiff ℝ ∞ γ) (hρ : ContDiff ℝ ∞ ρ) (hs : tsupport γ ⊆ U) + (hcγ : HasCompactSupport γ) (hcρ : HasCompactSupport ρ) : + ∃ K : ℝ≥0, LipschitzWith K (fun z => ((1 : ℝ), spatialField A γ ρ z)) := by + obtain ⟨K, hK⟩ := ContDiff.lipschitzWith_of_hasCompactSupport + (hasCompactSupport_spatialField A hcγ hcρ) + (contDiff_spatialField hA hi hγ hρ hs) (by simp) + exact ⟨max 0 K, (LipschitzWith.const (1 : ℝ)).prodMk hK⟩ + +end +end Moser + +namespace Moser + +open Set Filter Function TensorCalculus +open scoped Topology ContDiff + +variable {E : Type u24} [NormedAddCommGroup E] [NormedSpace ℝ E] + +noncomputable section + +local instance oneTensorGroup : NormedAddCommGroup (E →L[ℝ] ℝ) := inferInstance +local instance oneTensorSpace : NormedSpace ℝ (E →L[ℝ] ℝ) := inferInstance +local instance twoTensorGroup : NormedAddCommGroup (E →L[ℝ] E →L[ℝ] ℝ) := inferInstance +local instance twoTensorSpace : NormedSpace ℝ (E →L[ℝ] E →L[ℝ] ℝ) := inferInstance + +def extendedOneForm (γ : E → E →L[ℝ] ℝ) (β : ℝ → ℝ) (z : ℝ × E) : + (ℝ × E) →L[ℝ] ℝ := + β z.1 • (γ z.2).comp (ContinuousLinearMap.snd ℝ ℝ E) + +@[simp] theorem extendedOneForm_apply (γ : E → E →L[ℝ] ℝ) (β : ℝ → ℝ) + (z a : ℝ × E) : extendedOneForm γ β z a = β z.1 * γ z.2 a.2 := rfl + +theorem contDiff_extendedOneForm {γ : E → E →L[ℝ] ℝ} {β : ℝ → ℝ} + (hγ : ContDiff ℝ ∞ γ) (hβ : ContDiff ℝ ∞ β) : + ContDiff ℝ ∞ (extendedOneForm γ β) := by + exact (hβ.comp contDiff_fst).smul ((hγ.comp contDiff_snd).clm_comp contDiff_const) + +theorem fderiv_extendedOneForm {γ : E → E →L[ℝ] ℝ} {β : ℝ → ℝ} {z : ℝ × E} + (hγ : DifferentiableAt ℝ γ z.2) (hβ : DifferentiableAt ℝ β z.1) + (a b : ℝ × E) : + fderiv ℝ (extendedOneForm γ β) z a b = + deriv β z.1 * a.1 * γ z.2 b.2 + β z.1 * fderiv ℝ γ z.2 a.2 b.2 := by + have hα : DifferentiableAt ℝ (extendedOneForm γ β) z := + (hβ.comp z differentiableAt_fst).smul + ((hγ.comp z differentiableAt_snd).clm_comp (differentiableAt_const _)) + have he : fderiv ℝ (fun y => extendedOneForm γ β y b) z a = + fderiv ℝ (extendedOneForm γ β) z a b := by + rw [fderiv_clm_apply hα (differentiableAt_const b)]; simp + rw [← he] + simp only [extendedOneForm_apply] + have hb : DifferentiableAt ℝ (fun y : ℝ × E => β y.1) z := + hβ.comp z differentiableAt_fst + have hg : DifferentiableAt ℝ (fun y : ℝ × E => γ y.2 b.2) z := + (hγ.comp z differentiableAt_snd).clm_apply (differentiableAt_const b.2) + rw [fderiv_fun_mul hb hg] + rw [fderiv_fun_comp z hβ differentiableAt_fst] + have hg' : DifferentiableAt ℝ (fun y : ℝ × E => γ y.2) z := + hγ.comp z differentiableAt_snd + rw [fderiv_clm_apply hg' (differentiableAt_const b.2)] + rw [fderiv_fun_comp z hγ differentiableAt_snd] + simp [fderiv_eq_smul_deriv, fderiv_fst, fderiv_snd, mul_comm, add_comm] + +def spatialTensor (W : E → TwoTensor E) (γ : E → E →L[ℝ] ℝ) + (β : ℝ → ℝ) (z : ℝ × E) : TwoTensor E := + W z.2 + β z.1 • exteriorD γ z.2 + +def spaceTimeTensor (W : E → TwoTensor E) (γ : E → E →L[ℝ] ℝ) + (β : ℝ → ℝ) (z : ℝ × E) : TwoTensor (ℝ × E) := + pullLinear (ContinuousLinearMap.snd ℝ ℝ E) (W z.2) + + exteriorD (extendedOneForm γ β) z + +theorem contDiffAt_spatialTensor {W : E → TwoTensor E} {γ : E → E →L[ℝ] ℝ} + {β : ℝ → ℝ} {z : ℝ × E} (hW : ContDiffAt ℝ ∞ W z.2) + (hγ : ContDiff ℝ ∞ γ) (hβ : ContDiff ℝ ∞ β) : + ContDiffAt ℝ ∞ (spatialTensor W γ β) z := by + have hd : ContDiff ℝ ∞ (exteriorD γ) := + contDiff_exteriorD hγ + exact (hW.comp z contDiffAt_snd).add + ((hβ.contDiffAt.comp z contDiffAt_fst).smul (hd.contDiffAt.comp z contDiffAt_snd)) + +theorem contDiffAt_spaceTimeTensor {W : E → TwoTensor E} {γ : E → E →L[ℝ] ℝ} + {β : ℝ → ℝ} {z : ℝ × E} (hW : ContDiffAt ℝ ∞ W z.2) + (hγ : ContDiff ℝ ∞ γ) (hβ : ContDiff ℝ ∞ β) : + ContDiffAt ℝ ∞ (spaceTimeTensor W γ β) z := by + have hα := contDiff_extendedOneForm hγ hβ + have hd : ContDiff ℝ ∞ (exteriorD (extendedOneForm γ β)) := + contDiff_exteriorD hα + exact (contDiffAt_pullLinear (ContinuousLinearMap.snd ℝ ℝ E) + (hW.comp z contDiffAt_snd)).add hd.contDiffAt + +theorem spaceTimeTensor_apply {W : E → TwoTensor E} {γ : E → E →L[ℝ] ℝ} + {β : ℝ → ℝ} {z : ℝ × E} (hγ : DifferentiableAt ℝ γ z.2) + (hβ : DifferentiableAt ℝ β z.1) (a b : ℝ × E) : + spaceTimeTensor W γ β z a b = spatialTensor W γ β z a.2 b.2 + + deriv β z.1 * (a.1 * γ z.2 b.2 - b.1 * γ z.2 a.2) := by + simp only [spaceTimeTensor, add_apply, pullLinear_apply, + ContinuousLinearMap.coe_snd', exteriorD_apply, fderiv_extendedOneForm hγ hβ, + spatialTensor, smul_apply, smul_eq_mul] + ring + +theorem spaceTimeTensor_skew (W : E → TwoTensor E) (γ : E → E →L[ℝ] ℝ) + (β : ℝ → ℝ) {z : ℝ × E} (hW : ∀ a b, W z.2 a b = -W z.2 b a) (a b : ℝ × E) : + spaceTimeTensor W γ β z a b = -spaceTimeTensor W γ β z b a := by + simp only [spaceTimeTensor, add_apply, pullLinear_apply, + ContinuousLinearMap.coe_snd'] + rw [hW a.2 b.2, exteriorD_skew (extendedOneForm γ β) z a b] + ring + +theorem spaceTimeTensor_closed {W : E → TwoTensor E} {γ : E → E →L[ℝ] ℝ} + {β : ℝ → ℝ} {z : ℝ × E} (hW : ContDiffAt ℝ ∞ W z.2) + (hγ : ContDiff ℝ ∞ γ) (hβ : ContDiff ℝ ∞ β) + (hclosed : ∀ a b c, fderiv ℝ W z.2 a b c + + fderiv ℝ W z.2 b c a + fderiv ℝ W z.2 c a b = 0) (a b c : ℝ × E) : + fderiv ℝ (spaceTimeTensor W γ β) z a b c + + fderiv ℝ (spaceTimeTensor W γ β) z b c a + + fderiv ℝ (spaceTimeTensor W γ β) z c a b = 0 := by + have hα := contDiff_extendedOneForm hγ hβ + have hd : ContDiff ℝ ∞ (exteriorD (extendedOneForm γ β)) := + contDiff_exteriorD hα + have hp : ContDiffAt ℝ ∞ (fun y : ℝ × E => + pullLinear (ContinuousLinearMap.snd ℝ ℝ E) (W y.2)) z := + contDiffAt_pullLinear (ContinuousLinearMap.snd ℝ ℝ E) (hW.comp z contDiffAt_snd) + have he := pullLinear_closed (ContinuousLinearMap.snd ℝ ℝ E) hW hclosed a b c + have hf := exteriorD_closed (x := z) hα.contDiffAt a b c + unfold spaceTimeTensor + simp only [fderiv_fun_add (hp.differentiableAt (by simp)) + (hd.differentiable (by simp) z), add_apply] + dsimp only [ContinuousLinearMap.coe_snd'] at he + linarith + +theorem spaceTimeTensor_kernel {W : E → TwoTensor E} {γ : E → E →L[ℝ] ℝ} + {β : ℝ → ℝ} {z : ℝ × E} (hγ : DifferentiableAt ℝ γ z.2) + (hβ : DifferentiableAt ℝ β z.1) + (hi : (spatialTensor W γ β z).IsInvertible) + (hsk : ∀ a b, W z.2 a b = -W z.2 b a) : + spaceTimeTensor W γ β z (1, spatialField (spatialTensor W γ β) γ (deriv β) z) = 0 := by + have hs : ∀ a b, spatialTensor W γ β z a b = -spatialTensor W γ β z b a := by + intro a b + simp only [spatialTensor, add_apply, smul_apply, + smul_eq_mul] + rw [hsk a b, exteriorD_skew γ z.2 a b]; ring + have hc := contract_spatialField γ (deriv β) z hi + have hz := oneForm_spatialField γ (deriv β) z hi hs + apply ContinuousLinearMap.ext + intro a + rw [spaceTimeTensor_apply hγ hβ] + simp only [one_mul, hz, mul_zero, sub_zero] + have hc' := congrArg (fun L : E →L[ℝ] ℝ => L a.2) hc + simp only [smul_apply, smul_eq_mul] at hc' + simp only [zero_apply] + linarith + +end +end Moser + +open Set Filter +open scoped Topology ContDiff + +namespace Moser + +noncomputable section + +def timeCutoff : ℝ → ℝ := Real.smoothTransition + +theorem timeCutoff_smooth : ContDiff ℝ ∞ timeCutoff := Real.smoothTransition.contDiff + +theorem timeCutoff_mem (t : ℝ) : timeCutoff t ∈ Icc (0 : ℝ) 1 := + ⟨Real.smoothTransition.nonneg t, Real.smoothTransition.le_one t⟩ + +@[simp] theorem timeCutoff_zero : timeCutoff 0 = 0 := Real.smoothTransition.zero + +@[simp] theorem timeCutoff_one : timeCutoff 1 = 1 := Real.smoothTransition.one + +theorem timeCutoff_deriv_smooth : ContDiff ℝ ∞ (deriv timeCutoff) := + (show ContDiff ℝ (∞ + 1) timeCutoff by simpa using timeCutoff_smooth).deriv' + +theorem timeCutoff_deriv_hasCompactSupport : HasCompactSupport (deriv timeCutoff) := by + apply HasCompactSupport.of_support_subset_isCompact (isCompact_Icc (a := (0 : ℝ)) (b := 1)) + intro t ht + by_contra h + have hd : deriv timeCutoff t = 0 := by + rw [mem_Icc, not_and_or] at h + rcases h with h | h + · have hn : ∀ᶠ y in 𝓝 t, y < 0 := Iio_mem_nhds (lt_of_not_ge h) + have he : timeCutoff =ᶠ[𝓝 t] fun _ => 0 := + hn.mono (fun y hy => + Real.smoothTransition.zero_of_nonpos hy.le) + rw [he.deriv_eq, deriv_const] + · have hn : ∀ᶠ y in 𝓝 t, 1 < y := Ioi_mem_nhds (lt_of_not_ge h) + have he : timeCutoff =ᶠ[𝓝 t] fun _ => 1 := + hn.mono (fun y hy => + Real.smoothTransition.one_of_one_le hy.le) + rw [he.deriv_eq, deriv_const] + exact ht hd + +end +end Moser + +end LowerBoundInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/MoserFlow.lean b/lean/OAI/Geometry/PolarProducts/MoserFlow.lean new file mode 100644 index 0000000000000000000000000000000000000000..fc7401628dc006d4f8ae8ae60d2b032461d71633 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/MoserFlow.lean @@ -0,0 +1,211 @@ +import OAI.Geometry.PolarProducts.MoserField + +namespace OAI + +universe u25 u26 + +section LowerBoundInline +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter Metric +open scoped Topology ContDiff +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal +open Set Filter Function +open scoped Topology ContDiff +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter +open scoped Topology ContDiff + +open Set Filter Function +open scoped Topology ContDiff + +namespace SmoothODE + +variable {E : Type u25} [NormedAddCommGroup E] [NormedSpace ℝ E] + +noncomputable section + +def fiberHomeomorph (f : (ℝ × E) ≃ₜ (ℝ × E)) (T : ℝ) + (hTime : ∀ z, (f z).1 = z.1 + T) (t : ℝ) : E ≃ₜ E where + toFun x := (f (t, x)).2 + invFun y := (f.symm (t + T, y)).2 + left_inv x := by + have he : (t + T, (f (t, x)).2) = f (t, x) := by + ext + · exact (hTime (t, x)).symm + · rfl + change (f.symm (t + T, (f (t, x)).2)).2 = x + rw [he, f.symm_apply_apply] + right_inv y := by + have he : (f.symm (t + T, y)).1 = t := by + have h := hTime (f.symm (t + T, y)) + rw [f.apply_symm_apply] at h + dsimp at h + linarith + have he' : (t, (f.symm (t + T, y)).2) = f.symm (t + T, y) := by + ext + · exact he.symm + · rfl + change (f (t, (f.symm (t + T, y)).2)).2 = y + rw [he', f.apply_symm_apply] + continuous_toFun := continuous_snd.comp (f.continuous.comp (continuous_const.prodMk continuous_id)) + continuous_invFun := continuous_snd.comp + (f.symm.continuous.comp (continuous_const.prodMk continuous_id)) + +omit [NormedSpace ℝ E] in +@[simp] theorem fiberHomeomorph_apply (f : (ℝ × E) ≃ₜ (ℝ × E)) (T : ℝ) + (hTime : ∀ z, (f z).1 = z.1 + T) (t : ℝ) (x : E) : + fiberHomeomorph f T hTime t x = (f (t, x)).2 := rfl + +omit [NormedSpace ℝ E] in +@[simp] theorem fiberHomeomorph_symm_apply (f : (ℝ × E) ≃ₜ (ℝ × E)) (T : ℝ) + (hTime : ∀ z, (f z).1 = z.1 + T) (t : ℝ) (x : E) : + (fiberHomeomorph f T hTime t).symm x = (f.symm (t + T, x)).2 := rfl + +theorem contDiff_fiberHomeomorph (f : (ℝ × E) ≃ₜ (ℝ × E)) (T : ℝ) + (hTime : ∀ z, (f z).1 = z.1 + T) (t : ℝ) + (hf : ContDiff ℝ ∞ (f : (ℝ × E) → (ℝ × E))) : + ContDiff ℝ ∞ (fiberHomeomorph f T hTime t : E → E) := + (hf.comp (contDiff_const.prodMk contDiff_id)).snd + +theorem contDiff_fiberHomeomorph_symm (f : (ℝ × E) ≃ₜ (ℝ × E)) (T : ℝ) + (hTime : ∀ z, (f z).1 = z.1 + T) (t : ℝ) + (hf : ContDiff ℝ ∞ (f.symm : (ℝ × E) → (ℝ × E))) : + ContDiff ℝ ∞ ((fiberHomeomorph f T hTime t).symm : E → E) := + (hf.comp (contDiff_const.prodMk contDiff_id)).snd + +theorem fderiv_fiberHomeomorph (f : (ℝ × E) ≃ₜ (ℝ × E)) (T : ℝ) + (hTime : ∀ z, (f z).1 = z.1 + T) (t : ℝ) + (hf : ContDiff ℝ ∞ (f : (ℝ × E) → (ℝ × E))) (x a : E) : + fderiv ℝ (f : (ℝ × E) → (ℝ × E)) (t, x) (0, a) = + (0, fderiv ℝ (fiberHomeomorph f T hTime t : E → E) x a) := by + have hi : HasFDerivAt (fun y : E => (t, y)) (ContinuousLinearMap.inr ℝ ℝ E) x := by + have hh := (hasFDerivAt_const (𝕜 := ℝ) t x).prodMk (hasFDerivAt_id (𝕜 := ℝ) x) + have he : (0 : E →L[ℝ] ℝ).prod (ContinuousLinearMap.id ℝ E) = + ContinuousLinearMap.inr ℝ ℝ E := by + ext y <;> rfl + rw [he] at hh + exact hh + have hd := (hf.differentiable (by simp) (t, x)).hasFDerivAt.comp x hi + change HasFDerivAt (fun y : E => f (t, y)) _ x at hd + have he : (fun y : E => f (t, y)) = + fun y => (t + T, fiberHomeomorph f T hTime t y) := by + funext y + exact Prod.ext (hTime (t, y)) rfl + have hd' := (hasFDerivAt_const (𝕜 := ℝ) (t + T) x).prodMk + ((contDiff_fiberHomeomorph f T hTime t hf).differentiable (by simp) x).hasFDerivAt + have hu := congrArg (fun L : E →L[ℝ] (ℝ × E) => L a) + ((he ▸ hd).unique hd') + simpa using hu + +omit [NormedSpace ℝ E] in + +theorem fiberHomeomorph_mapsTo (f : (ℝ × E) ≃ₜ (ℝ × E)) (T : ℝ) + (hTime : ∀ z, (f z).1 = z.1 + T) (t : ℝ) {U : Set E} + (hOut : ∀ z, z.2 ∉ U → (f z).2 = z.2) : + ∀ x, fiberHomeomorph f T hTime t x ∈ U ↔ x ∈ U := by + intro x + constructor + · intro hx + by_contra hc + rw [fiberHomeomorph_apply, hOut (t, x) hc] at hx + exact hc hx + · intro hx + by_contra hc + have he : fiberHomeomorph f T hTime t (fiberHomeomorph f T hTime t x) = + fiberHomeomorph f T hTime t x := hOut _ hc + have hu := (fiberHomeomorph f T hTime t).injective he + exact hc (hu.symm ▸ hx) + +end +end SmoothODE + +namespace Moser + +open Set Filter Function TensorCalculus SmoothODE +open scoped Topology ContDiff NNReal + +variable {E : Type u26} [NormedAddCommGroup E] [NormedSpace ℝ E] + [CompleteSpace E] [ProperSpace E] + +noncomputable section + +theorem compactlySupported_deformation {U : Set E} (hU : IsOpen U) + {W : E → TwoTensor E} {γ : E → E →L[ℝ] ℝ} + (hW : ∀ x ∈ U, ContDiffAt ℝ ∞ W x) + (hsk : ∀ x ∈ U, ∀ a b, W x a b = -W x b a) + (hclosed : ∀ x ∈ U, ∀ a b c, + fderiv ℝ W x a b c + fderiv ℝ W x b c a + fderiv ℝ W x c a b = 0) + (hγ : ContDiff ℝ ∞ γ) (hcγ : HasCompactSupport γ) (hs : tsupport γ ⊆ U) + (hi : ∀ x ∈ U, ∀ s ∈ Icc (0 : ℝ) 1, (W x + s • exteriorD γ x).IsInvertible) : + ∃ F : E ≃ₜ E, ContDiff ℝ ∞ (F : E → E) ∧ ContDiff ℝ ∞ (F.symm : E → E) ∧ + (∀ x, x ∉ U → F x = x) ∧ (∀ x, F x ∈ U ↔ x ∈ U) ∧ + ∀ x ∈ U, ∀ a b, + (W (F x) + exteriorD γ (F x)) (fderiv ℝ (F : E → E) x a) + (fderiv ℝ (F : E → E) x b) = W x a b := by + let A := spatialTensor W γ timeCutoff + let Y := spatialField A γ (deriv timeCutoff) + let V : (ℝ × E) → (ℝ × E) := fun z => (1, Y z) + let B := spaceTimeTensor W γ timeCutoff + have hA : ∀ z, z.2 ∈ U → ContDiffAt ℝ ∞ A z := by + intro z hz + exact contDiffAt_spatialTensor (hW z.2 hz) hγ timeCutoff_smooth + have hAi : ∀ z, z.2 ∈ U → (A z).IsInvertible := by + intro z hz + exact hi z.2 hz _ (timeCutoff_mem z.1) + have hY : ContDiff ℝ ∞ Y := + contDiff_spatialField hA hAi hγ timeCutoff_deriv_smooth hs + have hV : ContDiff ℝ ∞ V := contDiff_const.prodMk hY + obtain ⟨K, hK⟩ := exists_lipschitz_spaceTimeField hA hAi hγ + timeCutoff_deriv_smooth hs hcγ timeCutoff_deriv_hasCompactSupport + have hOut : ∀ z, z.2 ∉ U → (V z).2 = 0 := by + intro z hz + exact spatialField_eq_zero_of_oneForm_eq_zero A γ (deriv timeCutoff) z + (image_eq_zero_of_notMem_tsupport (fun hc => hz (hs hc))) + have hB : ∀ z, z.2 ∈ U → DifferentiableAt ℝ B z := by + intro z hz + exact (contDiffAt_spaceTimeTensor (hW z.2 hz) hγ timeCutoff_smooth).differentiableAt + (by simp) + have hIv : ∀ z, z.2 ∈ U → ∀ a b, fderiv ℝ B z (V z) a b + + B z (fderiv ℝ V z a) b + B z a (fderiv ℝ V z b) = 0 := by + intro z hz a b + have hn : ∀ᶠ y in 𝓝 z, y.2 ∈ U := continuous_snd.continuousAt (hU.mem_nhds hz) + apply invariant_of_closed_kernel_at (hB z hz) (hV.differentiable (by simp) z) + (hn.mono (fun y hy => spaceTimeTensor_skew W γ timeCutoff (hsk y.2 hy))) + (spaceTimeTensor_closed (hW z.2 hz) hγ timeCutoff_smooth (hclosed z.2 hz)) + (hn.mono (fun y hy => spaceTimeTensor_kernel (hγ.differentiable (by simp) y.2) + (timeCutoff_smooth.differentiable (by simp) y.1) (hAi y hy) (hsk y.2 hy))) + obtain ⟨f, hf, hfi, htime, hout, htrans⟩ := + exists_spaceTime_transport hK hV (fun _ => rfl) hOut hB hIv 1 + let F := fiberHomeomorph f 1 htime 0 + have hF : ContDiff ℝ ∞ (F : E → E) := contDiff_fiberHomeomorph f 1 htime 0 hf + have hFi : ContDiff ℝ ∞ (F.symm : E → E) := contDiff_fiberHomeomorph_symm f 1 htime 0 hfi + refine ⟨F, hF, hFi, ?_, fiberHomeomorph_mapsTo f 1 htime 0 hout, ?_⟩ + · intro x hx + exact hout (0, x) hx + · intro x hx a b + have hh := (htrans (0, x) hx).2 (0, a) (0, b) + rw [fderiv_fiberHomeomorph f 1 htime 0 hf x a, + fderiv_fiberHomeomorph f 1 htime 0 hf x b] at hh + have he : f (0, x) = (1, F x) := by + apply Prod.ext + · simpa using htime (0, x) + · rfl + rw [he] at hh + have hb (z : ℝ × E) (a b : E) : B z (0, a) (0, b) = A z a b := by + dsimp only [B, A] + rw [spaceTimeTensor_apply (hγ.differentiable (by simp) z.2) + (timeCutoff_smooth.differentiable (by simp) z.1)] + simp + rw [hb, hb] at hh + simpa only [A, spatialTensor, timeCutoff_zero, timeCutoff_one, + one_smul, zero_smul, add_zero, add_apply, smul_apply, smul_eq_mul, zero_mul] using hh + +end +end Moser + +end LowerBoundInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/Nonsqueezing.lean b/lean/OAI/Geometry/PolarProducts/Nonsqueezing.lean new file mode 100644 index 0000000000000000000000000000000000000000..8c1f86ccb64c7128f617b8f67449d0e3fd9f61d6 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/Nonsqueezing.lean @@ -0,0 +1,161 @@ +import OAI.Geometry.PolarProducts.ExteriorHamiltonian + +namespace OAI + +universe u127 + +section NonsqueezingInline + +namespace CylinderParameters +noncomputable section +open Set Filter Finset +open scoped ContDiff Topology +open FourierPolynomial DiagonalQuadratic HamiltonianODE +variable {κ : Type u127} [Fintype κ] [DecidableEq κ] + + def weights (j₀ : κ) (a b : ℝ) (j : κ) : ℝ := if j=j₀ then a else b + + theorem energy_weights (j₀ : κ) (a b : ℝ) (z : Vector κ) : + energy (weights j₀ a b) z = (a-b)*‖z j₀‖^2+b*‖z‖^2 := by + have hh (j : κ) : weights j₀ a b j*‖z j‖^2 = + b*‖z j‖^2+(if j=j₀ then (a-b)*‖z j‖^2 else 0) := by + by_cases hj : j=j₀ <;> simp only [weights,hj,ite_true,ite_false] <;> ring + simp only [energy,hh,Finset.sum_add_distrib,Finset.sum_ite_eq',Finset.mem_univ,ite_true, + ← Finset.mul_sum,← EuclideanSpace.norm_sq_eq] + ring + + theorem energy_weights_upper (j₀ : κ) {a b R M : ℝ} (hb : 0 ≤ b) (hab : b ≤ a) + (hR : 0 ≤ R) {z : Vector κ} (hz : ‖z‖^2 ≤ M) (hz₀ : ‖z j₀‖^2 ≤ R) : + energy (weights j₀ a b) z ≤ a*R+b*M := by + rw [energy_weights] + have h1 := mul_le_mul_of_nonneg_left hz (show 0 ≤ b from hb) + have h2 := mul_le_mul_of_nonneg_left hz₀ (sub_nonneg.mpr hab) + nlinarith + + theorem gap_first {m : ℤ} : Real.pi/2 ≤ |Real.pi*(m:ℝ)-3*Real.pi/2| := by + rcases le_or_gt m 1 with hm | hm + · have hm' : (m:ℝ) ≤ 1 := by exact_mod_cast hm + apply (le_abs.mpr (Or.inr ?_)) + nlinarith [Real.pi_pos] + · have hm' : (2:ℝ) ≤ m := by exact_mod_cast (show 2 ≤ m by omega) + apply (le_abs.mpr (Or.inl ?_)) + nlinarith [Real.pi_pos] + + theorem gap_small {b : ℝ} (hb : 0 < b) (hbπ : b ≤ Real.pi/2) (m : ℤ) : + b ≤ |Real.pi*(m:ℝ)-b| := by + rcases le_or_gt m 0 with hm | hm + · have hm' : (m:ℝ) ≤ 0 := by exact_mod_cast hm + apply (le_abs.mpr (Or.inr ?_)) + nlinarith [Real.pi_pos] + · have hm' : (1:ℝ) ≤ m := by exact_mod_cast (show 1 ≤ m by omega) + apply (le_abs.mpr (Or.inl ?_)) + nlinarith [Real.pi_pos] + +omit [Fintype κ] in + theorem weights_bounds (j₀ : κ) {b : ℝ} (hb : 0 < b) (hbπ : b ≤ Real.pi/4) : + (∀ j, b ≤ weights j₀ (3*Real.pi/2) b j) ∧ + Real.pi+b ≤ weights j₀ (3*Real.pi/2) b j₀ ∧ + (∀ j, |weights j₀ (3*Real.pi/2) b j| ≤ 3*Real.pi/2) ∧ + (∀ j, j ≠ j₀ → weights j₀ (3*Real.pi/2) b j < Real.pi) ∧ + (∀ m : ℤ, ∀ j, b ≤ |Real.pi*(m:ℝ)-weights j₀ (3*Real.pi/2) b j|) := by + have hab : b ≤ 3*Real.pi/2 := by linarith [Real.pi_pos] + refine ⟨?_,?_,?_,?_,?_⟩ + · intro j; unfold weights; split_ifs + · exact hab + · exact le_rfl + · simp only [weights,ite_true]; linarith [Real.pi_pos] + · intro j; unfold weights; split_ifs + · rw [abs_of_pos (by positivity)] + · rw [abs_of_pos hb]; exact hab + · intro j hj; simp only [weights,hj,ite_false]; linarith [Real.pi_pos] + · intro m j; unfold weights; split_ifs + · exact (show b ≤ Real.pi/2 by linarith [Real.pi_pos]).trans gap_first + · exact gap_small hb (by linarith [Real.pi_pos]) m + + theorem exists_parameters (j₀ : κ) {R M m : ℝ} (hR : 0 ≤ R) (hM : 0 ≤ M) + (hRm : Real.pi*R < m) : + ∃ b T δ : ℝ, 0 < b ∧ b ≤ Real.pi/4 ∧ 0 < δ ∧ 0 < T ∧ + Real.pi*(T+δ) < m*(3*Real.pi/2) ∧ + ∀ z : Vector κ, ‖z‖^2 ≤ M → ‖z j₀‖^2 ≤ R → + energy (weights j₀ (3*Real.pi/2) b) z < T := by + let a := 3*Real.pi/2 + have ha : 0 < a := by dsimp [a]; positivity + let τ := (m-Real.pi*R)/(4*Real.pi) + have hτ : 0 < τ := div_pos (sub_pos.mpr hRm) (by positivity) + have hτeq : 4*Real.pi*τ=m-Real.pi*R := by dsimp [τ]; field_simp + let b := min (Real.pi/4) (a*τ/(M+1)) + have hb : 0 < b := lt_min (by positivity) (div_pos (mul_pos ha hτ) (by linarith)) + have hbπ : b ≤ Real.pi/4 := min_le_left _ _ + have hbb : b*(M+1) ≤ a*τ := (le_div_iff₀ (by linarith : 0 < M+1)).mp (min_le_right _ _) + have hbM : b*M < a*τ := by nlinarith + refine ⟨b,a*(R+τ),a*τ,hb,hbπ,mul_pos ha hτ,mul_pos ha (by linarith),?_,?_⟩ + · change Real.pi*(a*(R+τ)+a*τ) < m*a + have hh : Real.pi*(R+2*τ)< m := by nlinarith + nlinarith [mul_lt_mul_of_pos_left hh ha] + · intro z hz hz₀ + have hab : b ≤ a := by dsimp [a]; linarith [Real.pi_pos] + have he := energy_weights_upper j₀ hb.le hab hR hz hz₀ + change energy (weights j₀ a b) z < a*(R+τ) + nlinarith + +end +end CylinderParameters + +namespace CylinderNonsqueezing +noncomputable section +open Set Filter +open scoped ContDiff Topology +open FourierPolynomial DiagonalQuadratic HamiltonianODE SmoothProfiles HamiltonianPeriodic +open ExteriorHamiltonian PushedBall CylinderParameters +variable {κ : Type} [Fintype κ] [DecidableEq κ] + + theorem radius_le_of_embedding (j₀ : κ) {L R M : ℝ} (hL : 0 < L) (hR : 0 ≤ R) (hM : 0 ≤ M) + (e : OpenPartialHomeomorph (Vector κ) (Vector κ)) + (he : ContDiffOn ℝ ∞ e e.source) (hs : e.source = domain L) + (hω : ∀ z ∈ e.source, ComplexSymplectic.Preserves (fderiv ℝ e z)) + (hbounded : ∀ z ∈ e.target, ‖z‖^2 ≤ M) + (hcylinder : ∀ z ∈ e.target, ‖z j₀‖^2 ≤ R) : L ≤ R := by + by_contra hn + have hRL : R < L := lt_of_not_ge hn + obtain ⟨r,ε,hr,hrπ,hε,hεL,hm⟩ := exists_ball_parameters (mul_nonneg Real.pi_pos.le hR) hL + (mul_lt_mul_of_pos_left hRL Real.pi_pos) + let m := ballHeight r L ε + have hεL' : ε ≤ L := by linarith + have hRm : Real.pi*R < m := hm.trans_le (ballHeight_lower hr.le L hε hεL.le) + obtain ⟨b,T,δ,hb,hbπ,hδ,hT,hmag,hcontain⟩ := exists_parameters j₀ hR hM hRm + let d := weights j₀ (3*Real.pi/2) b + obtain ⟨hdb,hdb0,hdD,hdπ,hgap⟩ := weights_bounds j₀ hb hbπ + have hQ (z : Vector κ) (hz : z ∈ e.target) : energy d z < T := + hcontain z (hbounded z hz) (hcylinder z hz) + have hD (z) (hz : z ∈ e.source) := ComplexSymplectic.invertible (hω z hz) + let H₀ := pushed e r L ε + have hH₀ : ContDiff ℝ ∞ H₀ := contDiff_pushed e he hs hD hε hεL' + have hH₀0 (z : Vector κ) : 0 ≤ H₀ z := (pushed_bounds e hr.le hε z).1 + have hH₀m (z : Vector κ) : H₀ z ≤ m := (pushed_bounds e hr.le hε z).2 + have hS : IsCompact (e '' core L ε) := (core_compact L ε).image_of_continuousOn + (e.continuousOn.mono (by rw [hs]; exact core_subset_domain hε hεL')) + obtain ⟨B,hB,hrem⟩ := bounded_remainder hH₀ hH₀m hS + (fun z hz => pushed_plateau e hε hεL' hz) d hb hdb hδ (by linarith : 0 ≤ T+δ) + have h0 : (0 : Vector κ) ∈ e.source := by rw [hs]; exact zero_mem_domain hL + have hflat := full_flat d hδ (pushed_flat e (r := r) hs hε hεL') (hQ _ (e.map_source h0)) + have hnonneg (z : Vector κ) : 0 ≤ full H₀ d T δ z := add_nonneg (hH₀0 z) (potential_nonneg d T hδ z) + obtain ⟨x,hp,ha,hx⟩ := exists_positive_at_flat_point j₀ (contDiff_full hH₀ d T δ) hnonneg (e 0) + hflat d (div_pos hb (by norm_num : (0:ℝ) < 2)) hb hB + (by positivity : 0 ≤ 3*Real.pi/2) + (fun j => by dsimp [d]; linarith [hdb j]) + (by dsimp [d]; linarith) hdD hgap hrem + have hn := all_orbits_nonpos j₀ hH₀ hH₀m hH₀0 d (fun j => hb.le.trans (hdb j)) + (by dsimp [d,weights]; simp only [ite_true]; linarith [Real.pi_pos]) hdπ + (by dsimp [d,weights]; simp only [ite_true]; linarith [Real.pi_pos]) hδ + (by simpa only [d,weights,ite_true] using hmag) + (fun z hz => (hQ z hz).le) + (fun z hz => pushed_plateau_outside e hs hε hεL' hz) + (fun x hxt hp hx t => pushed_full_slow e he hω hs hr.le hrπ hε hεL' d hδ + (fun z hz => (hQ z hz).le) hxt hp hx t) hx hp + exact (not_lt_of_ge hn) ha + +end +end CylinderNonsqueezing +end NonsqueezingInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/PeriodicFourier.lean b/lean/OAI/Geometry/PolarProducts/PeriodicFourier.lean new file mode 100644 index 0000000000000000000000000000000000000000..ba3873584cc89fe0aa9e0b44237794433eb3ea79 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/PeriodicFourier.lean @@ -0,0 +1,301 @@ +import OAI.Geometry.PolarProducts.GalerkinBounds + +namespace OAI + +universe u114 u115 + +section NonsqueezingInline + +namespace L2Paths +noncomputable section +open Set intervalIntegral +open MeasureTheory (volume) +open scoped Topology BoundedContinuousFunction +variable {E : Type u114} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + + theorem integral_sq_le (f : ℝ → ℝ) (hf : Continuous f) {a b : ℝ} (hab : a ≤ b) : + (∫ t in a..b, f t)^2 ≤ (b-a)*(∫ t in a..b, (f t)^2) := by + rcases hab.eq_or_lt with he | hab + · subst b + simp + let avg := ∫ t in a..b, f t + let L := b-a + have hL : 0 < L := sub_pos.mpr hab + have hnon : 0 ≤ ∫ t in a..b, (L*f t-avg)^2 := + integral_nonneg_of_forall hab.le (fun _ => sq_nonneg _) + have he (t : ℝ) : (L*f t-avg)^2 = L^2*(f t)^2-(2*L*avg)*f t+avg^2 := by ring + simp_rw [he] at hnon + rw [integral_add, integral_sub, integral_const_mul, integral_const_mul, integral_const] at hnon + · simp only [smul_eq_mul] at hnon + change 0 ≤ L^2*(∫ t in a..b, (f t)^2)-(2*L*avg)*avg+L*avg^2 at hnon + change avg^2 ≤ L*(∫ t in a..b, (f t)^2) + nlinarith + · exact (hf.pow 2).intervalIntegrable _ _ |>.const_mul _ + · exact hf.intervalIntegrable _ _ |>.const_mul _ + · exact (((hf.pow 2).const_mul _).sub (hf.const_mul _)).intervalIntegrable _ _ + · exact intervalIntegrable_const + + theorem norm_sub_sq_le (x v : ℝ → E) (hv : Continuous v) + (hd : ∀ t, HasDerivAt x (v t) t) {a b : ℝ} (hab : a ≤ b) : + ‖x b-x a‖^2 ≤ (b-a)*(∫ t in a..b, ‖v t‖^2) := by + have he := integral_eq_sub_of_hasDerivAt (fun t _ => hd t) (hv.intervalIntegrable a b) + have hn : ‖x b-x a‖ ≤ ∫ t in a..b, ‖v t‖ := by + rw [← he] + exact norm_integral_le_integral_norm hab + have hi := integral_sq_le (fun t => ‖v t‖) hv.norm hab + have hs : ‖x b-x a‖^2 ≤ (∫ t in a..b, ‖v t‖)^2 := + pow_le_pow_left₀ (norm_nonneg _) hn 2 + exact hs.trans hi + + theorem norm_sub_sq_le_global (x v : ℝ → E) (hv : Continuous v) + (hd : ∀ t, HasDerivAt x (v t) t) {D : ℝ} + (hD : (∫ t in (0:ℝ)..1, ‖v t‖^2) ≤ D^2) + {a b : ℝ} (ha : a ∈ Icc (0:ℝ) 1) (hb : b ∈ Icc (0:ℝ) 1) : + ‖x b-x a‖^2 ≤ D^2*|b-a| := by + wlog hab : a ≤ b generalizing a b + · have h := this hb ha (le_of_not_ge hab) + rwa [norm_sub_rev, abs_sub_comm] at h + have hi := integral_mono_interval (μ := volume) ha.1 hab hb.2 + (Filter.Eventually.of_forall (fun t => sq_nonneg ‖v t‖)) ((hv.norm.pow 2).intervalIntegrable 0 1) + have hc := norm_sub_sq_le x v hv hd hab + have hm := mul_le_mul_of_nonneg_left (hi.trans hD) (sub_nonneg.mpr hab) + rw [abs_of_nonneg (sub_nonneg.mpr hab)] + exact hc.trans (by nlinarith) + + theorem norm_bound (x v : ℝ → E) (hv : Continuous v) + (hd : ∀ t, HasDerivAt x (v t) t) {A D : ℝ} (hA : 0 ≤ A) (hD : 0 ≤ D) + (hxm : (∫ t in (0:ℝ)..1, ‖x t‖^2) ≤ A^2) + (hvm : (∫ t in (0:ℝ)..1, ‖v t‖^2) ≤ D^2) + {t : ℝ} (ht : t ∈ Icc (0:ℝ) 1) : ‖x t‖ ≤ A+D := by + have hx : Continuous x := continuous_iff_continuousAt.mpr (fun s => (hd s).continuousAt) + have hpoint (s : ℝ) (hs : s ∈ Icc (0:ℝ) 1) : ‖x t‖ ≤ ‖x s‖+D := by + have hdiff := norm_sub_sq_le_global x v hv hd hvm hs ht + have hab : |t-s| ≤ 1 := (abs_le).mpr ⟨by linarith [ht.1,hs.2], by linarith [ht.2,hs.1]⟩ + have hmul := mul_le_mul_of_nonneg_left hab (sq_nonneg D) + have hn : ‖x t-x s‖ ≤ D := by nlinarith [norm_nonneg (x t-x s)] + have htri := norm_sub_le (x t-x s) (-x s) + rw [sub_neg_eq_add, sub_add_cancel, norm_neg] at htri + linarith + have hi : ∫ s in (0:ℝ)..1, ‖x t‖ ≤ ∫ s in (0:ℝ)..1, ‖x s‖+D := + integral_mono_on (by norm_num) intervalIntegrable_const + ((hx.norm.add continuous_const).intervalIntegrable _ _) hpoint + rw [integral_const, integral_add (hx.norm.intervalIntegrable _ _) intervalIntegrable_const, + integral_const] at hi + simp only [sub_zero, one_smul] at hi + have hcs := integral_sq_le (fun s => ‖x s‖) hx.norm (show (0:ℝ) ≤ 1 by norm_num) + simp only [sub_zero, one_mul] at hcs + have hmean : ∫ t_1 in (0:ℝ)..1, ‖x t_1‖ ≤ A := by + nlinarith [integral_nonneg_of_forall (μ := volume) (show (0:ℝ) ≤ 1 by norm_num) (fun s => norm_nonneg (x s))] + linarith + +abbrev Segment := Icc (0 : ℝ) 1 + +omit [NormedSpace ℝ E] [CompleteSpace E] in + theorem exists_subsequence [ProperSpace E] (u : ℕ → C(Segment,E)) {D R : ℝ} + (hmod : ∀ n (t s : Segment), dist (u n t) (u n s)^2 ≤ D^2*dist t s) + (hbound : ∀ n (t : Segment), ‖u n t‖ ≤ R) : + ∃ x : C(Segment,E), ∃ φ : ℕ → ℕ, StrictMono φ ∧ + Filter.Tendsto (u ∘ φ) Filter.atTop (𝓝 x) := by + let eqv := ContinuousMap.isometryEquivBoundedOfCompact Segment E + let v : ℕ → (Segment →ᵇ E) := fun n => eqv (u n) + have heq : Equicontinuous ((↑) : Set.range v → Segment → E) := by + apply UniformEquicontinuous.equicontinuous + rw [Metric.uniformEquicontinuous_iff] + intro ε hε + refine ⟨ε^2/(D^2+1), by positivity, fun t s hts f => ?_⟩ + rcases f.property with ⟨n,hn⟩ + have hm := hmod n t s + have hd : (D^2+1)*dist t s < ε^2 := by + have := (lt_div_iff₀ (by positivity : 0 < D^2+1)).mp hts + linarith + rw [← hn] + change dist (u n t) (u n s) < ε + nlinarith [(dist_nonneg : 0 ≤ dist (u n t) (u n s)), (dist_nonneg : 0 ≤ dist t s)] + have hc : IsCompact (closure (Set.range v)) := + BoundedContinuousFunction.arzela_ascoli (Metric.closedBall (0:E) R) + (isCompact_closedBall _ _) (Set.range v) + (fun f t hf => by + rcases hf with ⟨n,rfl⟩ + change dist (u n t) (0:E) ≤ R + simpa only [dist_zero_right] using hbound n t) heq + obtain ⟨x,hx,φ,hφ,ht⟩ := hc.tendsto_subseq (fun n => subset_closure (Set.mem_range_self n)) + refine ⟨eqv.symm x,φ,hφ,?_⟩ + exact eqv.symm.continuous.continuousAt.tendsto.comp ht + +local instance : Fact (0 < (1 : ℝ)) := ⟨zero_lt_one⟩ +abbrev Time := AddCircle (1 : ℝ) + +def restriction (x : C(Time,E)) : C(Segment,E) := + ⟨fun t => x (t.val : Time), x.continuous.comp (continuous_quot_mk.comp continuous_subtype_val)⟩ + +omit [NormedSpace ℝ E] [CompleteSpace E] in + theorem restriction_isometry : Isometry (restriction (E := E)) := by + rw [isometry_iff_dist_eq] + intro x y + apply le_antisymm + · apply (ContinuousMap.dist_le (dist_nonneg : 0 ≤ dist x y)).2 + intro t + exact ContinuousMap.dist_apply_le_dist (t.val : Time) + · apply (ContinuousMap.dist_le (dist_nonneg : 0 ≤ dist (restriction x) (restriction y))).2 + intro t + let r := AddCircle.equivIoc (1 : ℝ) 0 t + have hr : r.val ∈ Set.Icc (0:ℝ) 1 := ⟨r.property.1.le, by simpa using r.property.2⟩ + have h := ContinuousMap.dist_apply_le_dist (f := restriction x) (g := restriction y) ⟨r.val,hr⟩ + simpa only [restriction, ContinuousMap.coe_mk, r, AddCircle.coe_equivIoc] using h + +omit [NormedSpace ℝ E] in + theorem exists_periodic_subsequence [ProperSpace E] (u : ℕ → C(Time,E)) {D R : ℝ} + (hmod : ∀ n (t s : Segment), dist (u n (t.val : Time)) (u n (s.val : Time))^2 ≤ D^2*dist t s) + (hbound : ∀ n (t : Segment), ‖u n (t.val : Time)‖ ≤ R) : + ∃ x : C(Time,E), ∃ φ : ℕ → ℕ, StrictMono φ ∧ + Filter.Tendsto (u ∘ φ) Filter.atTop (𝓝 x) := by + obtain ⟨x,φ,hφ,ht⟩ := exists_subsequence (fun n => restriction (u n)) hmod hbound + have hc' : Cauchy (Filter.map restriction (Filter.map (u ∘ φ) Filter.atTop)) := by + rw [Filter.map_map] + exact ht.cauchySeq + have hc : CauchySeq (u ∘ φ) := + restriction_isometry.isUniformInducing.cauchy_map_iff.mp hc' + obtain ⟨y,hy⟩ := cauchySeq_tendsto_of_complete hc + exact ⟨y,φ,hφ,hy⟩ + +end +end L2Paths + +namespace PeriodicFourier +noncomputable section +open MeasureTheory AddCircle Finset Set +open scoped ComplexConjugate Topology +local instance : Fact (0 < (1 : ℝ)) := ⟨zero_lt_one⟩ +abbrev Time := AddCircle (1 : ℝ) +abbrev μ : Measure Time := AddCircle.haarAddCircle +open FourierPolynomial (integrable_continuous) + + def coefficient (n : ℤ) : C(Time,ℂ) →L[ℂ] ℂ := by + let L : C(Time,ℂ) →ₗ[ℂ] ℂ := { + toFun := fun f => fourierCoeff f n + map_add' := fun f g => congrFun (fourierCoeff.add + (integrable_continuous f.continuous) (integrable_continuous g.continuous)) n + map_smul' := fun c f => fourierCoeff.const_smul f c n } + apply L.mkContinuous 1 + intro f + change ‖∫ t : Time, fourier (-n) t • f t ∂μ‖ ≤ 1*‖f‖ + have h := norm_integral_le_of_norm_le_const (μ := μ) (C := ‖f‖) + (Filter.Eventually.of_forall (fun t : Time => show ‖fourier (-n) t • f t‖ ≤ ‖f‖ by + simpa only [norm_smul, fourier_apply, Circle.norm_coe, one_mul] using f.norm_coe_le_norm t)) + simpa using h + +@[simp] theorem coefficient_apply (n : ℤ) (f : C(Time,ℂ)) : coefficient n f = fourierCoeff f n := rfl + + theorem coefficient_ext {f g : C(Time,ℂ)} (h : ∀ n, coefficient n f = coefficient n g) : f = g := by + have hz (n : ℤ) : fourierCoeff (f-g) n = 0 := by + change coefficient n (f-g) = 0 + rw [map_sub, h, sub_self] + have hs : Summable (fourierCoeff (f-g)) := by + simpa only [funext hz] using (summable_zero : Summable (fun _ : ℤ => (0:ℂ))) + have hh := hasSum_fourier_series_of_summable hs + simp only [hz, zero_smul] at hh + have he : f-g = 0 := hh.unique hasSum_zero + exact sub_eq_zero.mp he + + theorem coefficient_const (n : ℤ) (c : ℂ) : + coefficient n (ContinuousMap.const Time c) = if n = 0 then c else 0 := by + rw [coefficient_apply, fourierCoeff] + simp only [ContinuousMap.coe_const, Function.const_apply, smul_eq_mul] + rw [integral_mul_const, FourierPolynomial.integral_fourier] + simp only [neg_eq_zero] + split_ifs <;> simp + + theorem constant_of_nonzero_coeff {f : C(Time,ℂ)} + (h : ∀ n : ℤ, n ≠ 0 → coefficient n f = 0) : + f = ContinuousMap.const Time (coefficient 0 f) := by + apply coefficient_ext + intro n + rw [coefficient_const] + by_cases hn : n = 0 + · subst n; simp + · simp [hn,h n hn] + + theorem continuous_lift {E : Type u115} [TopologicalSpace E] {f : ℝ → E} + (hf : Continuous f) (hp : Function.Periodic f 1) : Continuous hp.lift := + hf.quotient_liftOn' _ + + def primitive (v : C(Time,ℂ)) (t : ℝ) : ℂ := ∫ s in (0:ℝ)..t, v (s : Time) + + theorem hasDerivAt_primitive (v : C(Time,ℂ)) (t : ℝ) : + HasDerivAt (primitive v) (v (t : Time)) t := by + have hv : Continuous (fun s : ℝ => v (s : Time)) := v.continuous.comp continuous_quot_mk + exact intervalIntegral.integral_hasDerivAt_right (hv.intervalIntegrable _ _) hv.stronglyMeasurable.stronglyMeasurableAtFilter hv.continuousAt + + theorem periodic_primitive (v : C(Time,ℂ)) (hzero : coefficient 0 v = 0) : + Function.Periodic (primitive v) 1 := by + have hv : Continuous (fun s : ℝ => v (s : Time)) := v.continuous.comp continuous_quot_mk + have hp : Function.Periodic (fun s : ℝ => v (s : Time)) 1 := by + intro t + simp + have hi : ∫ s in (0:ℝ)..1, v (s : Time) = 0 := by + have h := hzero + rw [coefficient_apply, fourierCoeff_eq_intervalIntegral _ _ 0] at h + simpa only [one_div_one, one_smul, zero_add, neg_zero, fourier_zero] using h + intro t + unfold primitive + rw [hp.intervalIntegral_add_eq_add 0 t (fun a b => hv.intervalIntegrable a b)] + simp only [zero_add, hi, add_zero] + + def periodicPrimitive (v : C(Time,ℂ)) (hzero : coefficient 0 v = 0) : C(Time,ℂ) := + ⟨(periodic_primitive v hzero).lift, + continuous_lift (continuous_iff_continuousAt.mpr (fun t => (hasDerivAt_primitive v t).continuousAt)) _⟩ + +@[simp] theorem periodicPrimitive_coe (v : C(Time,ℂ)) (hzero : coefficient 0 v = 0) (t : ℝ) : + periodicPrimitive v hzero (t : Time) = primitive v t := rfl + + theorem coefficient_eq_on (f : C(Time,ℂ)) (n : ℤ) : + fourierCoeffOn (show (0:ℝ) < 1 by norm_num) (fun t : ℝ => f (t : Time)) n = coefficient n f := by + rw [fourierCoeffOn_eq_integral, coefficient_apply, fourierCoeff_eq_intervalIntegral _ _ 0] + simp + + theorem derivative_coefficient (v : C(Time,ℂ)) (hzero : coefficient 0 v = 0) + {n : ℤ} (hn : n ≠ 0) : + (2*(Real.pi : ℂ)*Complex.I*(n : ℂ)) * coefficient n (periodicPrimitive v hzero) = coefficient n v := by + have hp := periodic_primitive v hzero + have hi := fourierCoeffOn_of_hasDerivAt (show (0:ℝ) < 1 by norm_num) hn + (fun t _ => hasDerivAt_primitive v t) + ((v.continuous.comp continuous_quot_mk).intervalIntegrable 0 1) + have ht : primitive v 1 = primitive v 0 := by simpa using hp 0 + simp only [ht, sub_self, mul_zero, Complex.ofReal_one, Complex.ofReal_zero, sub_zero, one_mul, zero_sub] at hi + change fourierCoeffOn _ (fun t : ℝ => periodicPrimitive v hzero (t : Time)) n = + 1 / (-2 * (Real.pi : ℂ) * Complex.I * (n : ℂ)) * -fourierCoeffOn _ (fun t : ℝ => v (t : Time)) n at hi + rw [coefficient_eq_on, coefficient_eq_on] at hi + rw [hi] + have hπ : (Real.pi : ℂ) ≠ 0 := by exact_mod_cast Real.pi_ne_zero + have hn' : (n : ℂ) ≠ 0 := by exact_mod_cast hn + field_simp + + theorem hasDerivAt_of_coefficients (x v : C(Time,ℂ)) + (h : ∀ n : ℤ, coefficient n v = (2*(Real.pi : ℂ)*Complex.I*(n : ℂ))*coefficient n x) + (t : ℝ) : HasDerivAt (fun s : ℝ => x (s : Time)) (v (t : Time)) t := by + have hz : coefficient 0 v = 0 := by simpa using h 0 + let y := periodicPrimitive v hz + have hc : x-y = ContinuousMap.const Time (coefficient 0 (x-y)) := by + apply constant_of_nonzero_coeff + intro n hn + rw [map_sub] + have he := derivative_coefficient v hz hn + rw [h n] at he + have hn' : (2*(Real.pi : ℂ)*Complex.I*(n : ℂ)) ≠ 0 := by + apply mul_ne_zero (mul_ne_zero (mul_ne_zero (by norm_num) (by exact_mod_cast Real.pi_ne_zero)) Complex.I_ne_zero) + exact_mod_cast hn + have heq := (mul_left_cancel₀ hn') he + change coefficient n x-coefficient n (periodicPrimitive v hz) = 0 + exact sub_eq_zero.mpr heq.symm + have hx (s : ℝ) : x (s : Time) = primitive v s+coefficient 0 (x-y) := by + have he := congrArg (fun f : C(Time,ℂ) => f (s : Time)) hc + change x (s : Time)-primitive v s = coefficient 0 (x-y) at he + exact sub_eq_iff_eq_add'.mp he + simpa only [← hx] using (hasDerivAt_primitive v t).add_const (coefficient 0 (x-y)) + +end +end PeriodicFourier + +end NonsqueezingInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/PeriodicSolutions.lean b/lean/OAI/Geometry/PolarProducts/PeriodicSolutions.lean new file mode 100644 index 0000000000000000000000000000000000000000..1bdd05984cd926b6a5217f3178b1ee2bcbc7c8f8 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/PeriodicSolutions.lean @@ -0,0 +1,230 @@ +import OAI.Geometry.PolarProducts.PeriodicFourier + +namespace OAI + +section NonsqueezingInline + +namespace FourierPolynomial +noncomputable section +open MeasureTheory AddCircle Finset Set Filter +open scoped ComplexConjugate ContDiff Topology +local instance : Fact (0 < (1 : ℝ)) := ⟨zero_lt_one⟩ +variable {ι κ : Type} [Fintype ι] [Fintype κ] +open DiagonalQuadratic + + theorem critical_H1_bounds (k : ι → ℤ) (hk : Function.Injective k) + {H : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) (d : κ → ℝ) {γ B D : ℝ} + (hγ : 0 < γ) (hB : 0 ≤ B) (hD : 0 ≤ D) (hd : ∀ j, |d j| ≤ D) + (hgap : ∀ i j, γ ≤ |Real.pi*(k i : ℝ)-d j|) + (hrem : ∀ z, ‖gradient H z-(2 : ℝ) • diag d z‖ ≤ B) (a : Coeff ι κ) + (ha : gradient (action k H) a = 0) : + (∫ t in (0:ℝ)..1, ‖loop k a (t : Time)‖^2) ≤ (B/(2*γ))^2 ∧ + (∫ t in (0:ℝ)..1, ‖loop k (velocityCoeff k a) (t : Time)‖^2) ≤ + (B+2*D*(B/(2*γ)))^2 := by + have hn := critical_norm_bound k hk hH d hγ hB hgap hrem a ha + have hv := norm_project_grad k hk hH d hB hD hd hrem a + rw [← norm_velocityCoeff_critical k hH a ha] at hv + have hd' : 0 ≤ 2*D := mul_nonneg (by norm_num) hD + have hvel : ‖velocityCoeff k a‖ ≤ B+2*D*(B/(2*γ)) := + hv.trans (by linarith [mul_le_mul_of_nonneg_left hn hd']) + rw [intervalIntegral_eq_average (fun t : Time => ‖loop k a t‖^2), + intervalIntegral_eq_average (fun t : Time => ‖loop k (velocityCoeff k a) t‖^2), + integral_loop_norm_sq k hk, integral_loop_norm_sq k hk] + exact ⟨pow_le_pow_left₀ (norm_nonneg _) hn 2, pow_le_pow_left₀ (norm_nonneg _) hvel 2⟩ + + theorem critical_modulus (k : ι → ℤ) (hk : Function.Injective k) + {H : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) (d : κ → ℝ) {γ B D : ℝ} + (hγ : 0 < γ) (hB : 0 ≤ B) (hD : 0 ≤ D) (hd : ∀ j, |d j| ≤ D) + (hgap : ∀ i j, γ ≤ |Real.pi*(k i : ℝ)-d j|) + (hrem : ∀ z, ‖gradient H z-(2 : ℝ) • diag d z‖ ≤ B) (a : Coeff ι κ) + (ha : gradient (action k H) a = 0) (t s : L2Paths.Segment) : + dist (loop k a (t.val : Time)) (loop k a (s.val : Time))^2 ≤ + (B+2*D*(B/(2*γ)))^2*dist t s := by + have hb := (critical_H1_bounds k hk hH d hγ hB hD hd hgap hrem a ha).2 + have h := L2Paths.norm_sub_sq_le_global + (fun t : ℝ => loop k a (t : Time)) (fun t : ℝ => loop k (velocityCoeff k a) (t : Time)) + ((loop k (velocityCoeff k a)).continuous.comp continuous_quot_mk) + (hasDerivAt_loop k a) hb s.property t.property + simpa only [dist_eq_norm, Subtype.dist_eq, Real.dist_eq, Real.norm_eq_abs] using h + + theorem critical_loop_bound (k : ι → ℤ) (hk : Function.Injective k) + {H : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) (d : κ → ℝ) {γ B D : ℝ} + (hγ : 0 < γ) (hB : 0 ≤ B) (hD : 0 ≤ D) (hd : ∀ j, |d j| ≤ D) + (hgap : ∀ i j, γ ≤ |Real.pi*(k i : ℝ)-d j|) + (hrem : ∀ z, ‖gradient H z-(2 : ℝ) • diag d z‖ ≤ B) (a : Coeff ι κ) + (ha : gradient (action k H) a = 0) (t : L2Paths.Segment) : + ‖loop k a (t.val : Time)‖ ≤ B/(2*γ)+(B+2*D*(B/(2*γ))) := by + have hb := critical_H1_bounds k hk hH d hγ hB hD hd hgap hrem a ha + apply L2Paths.norm_bound + (fun t : ℝ => loop k a (t : Time)) (fun t : ℝ => loop k (velocityCoeff k a) (t : Time)) + ((loop k (velocityCoeff k a)).continuous.comp continuous_quot_mk) + (hasDerivAt_loop k a) (by positivity) (by positivity) hb.1 hb.2 t.property + + theorem critical_subsequence {α : ℕ → Type} [∀ n, Fintype (α n)] + (k : (n : ℕ) → α n → ℤ) (hk : ∀ n, Function.Injective (k n)) + {H : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) (d : κ → ℝ) {γ B D : ℝ} + (hγ : 0 < γ) (hB : 0 ≤ B) (hD : 0 ≤ D) (hd : ∀ j, |d j| ≤ D) + (hgap : ∀ n i j, γ ≤ |Real.pi*(k n i : ℝ)-d j|) + (hrem : ∀ z, ‖gradient H z-(2 : ℝ) • diag d z‖ ≤ B) + (a : (n : ℕ) → Coeff (α n) κ) (ha : ∀ n, gradient (action (k n) H) (a n) = 0) : + ∃ x : C(Time,Vector κ), ∃ φ : ℕ → ℕ, StrictMono φ ∧ + Tendsto (fun n => loop (k (φ n)) (a (φ n))) atTop (𝓝 x) := by + exact L2Paths.exists_periodic_subsequence (fun n => loop (k n) (a n)) + (fun n t s => critical_modulus (k n) (hk n) hH d hγ hB hD hd (hgap n) hrem (a n) (ha n) t s) + (fun n t => critical_loop_bound (k n) (hk n) hH d hγ hB hD hd (hgap n) hrem (a n) (ha n) t) + + def coordPath (j : κ) : C(Time,Vector κ) →L[ℂ] C(Time,ℂ) := + ContinuousLinearMap.compLeftContinuous ℂ Time (PiLp.proj 2 (fun _ : κ => ℂ) j) + +@[simp] theorem coordPath_apply (j : κ) (x : C(Time,Vector κ)) (t : Time) : coordPath j x t = x t j := rfl + + def gradPath {H : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) : C(Time,Vector κ) → C(Time,Vector κ) := + SmoothPaths.superpose (contDiff_gradient_function hH).continuous + + theorem contDiff_gradPath {H : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) : ContDiff ℝ ∞ (gradPath hH) := + SmoothPaths.contDiff_superpose (contDiff_gradient_function hH) + + theorem critical_coefficient (k : ι → ℤ) (hk : Function.Injective k) + {H : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) (a : Coeff ι κ) + (ha : gradient (action k H) a = 0) (i : ι) (j : κ) : + PeriodicFourier.coefficient (k i) (coordPath j (gradPath hH (loop k a))) = + (2*(Real.pi : ℂ)*(k i : ℂ))*PeriodicFourier.coefficient (k i) (coordPath j (loop k a)) := by + have he : (2 : ℝ) • diag (fun p : ι × κ => Real.pi*(k p.1 : ℝ)) a = project k (gradLoop k hH a) := by + simpa only [gradient_action k hH, sub_eq_zero] using ha + change project k (gradLoop k hH a) (i,j) = (2*(Real.pi : ℂ)*(k i : ℂ))*project k (loop k a) (i,j) + rw [project_loop k hk, ← he] + simp only [PiLp.smul_apply, diag_apply, RCLike.real_smul_eq_coe_mul, map_mul, map_intCast, map_ofNat] + change (2:ℂ)*((Real.pi : ℂ)*(k i : ℂ)*a (i,j)) = (2*(Real.pi : ℂ)*(k i : ℂ))*a (i,j) + ring + + theorem limit_coefficient {α : ℕ → Type} [∀ n, Fintype (α n)] + (k : (n : ℕ) → α n → ℤ) (hk : ∀ n, Function.Injective (k n)) + (hex : ∀ m : ℤ, ∀ᶠ n in atTop, m ∈ Set.range (k n)) + {H : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) + (a : (n : ℕ) → Coeff (α n) κ) (ha : ∀ n, gradient (action (k n) H) (a n) = 0) + (φ : ℕ → ℕ) (hφ : StrictMono φ) (x : C(Time,Vector κ)) + (ht : Tendsto (fun n => loop (k (φ n)) (a (φ n))) atTop (𝓝 x)) (m : ℤ) (j : κ) : + PeriodicFourier.coefficient m (coordPath j (gradPath hH x)) = + (2*(Real.pi : ℂ)*(m : ℂ))*PeriodicFourier.coefficient m (coordPath j x) := by + have hg := (contDiff_gradPath hH).continuous.continuousAt.tendsto.comp ht + have hc := (PeriodicFourier.coefficient m).continuous.comp (coordPath j).continuous + have hleft := hc.continuousAt.tendsto.comp hg + have hright := (tendsto_const_nhds (x := (2*(Real.pi : ℂ)*(m : ℂ)))).mul + (hc.continuousAt.tendsto.comp ht) + apply tendsto_nhds_unique_of_eventuallyEq hleft hright + filter_upwards [hφ.tendsto_atTop.eventually (hex m)] with n hn + rcases hn with ⟨i,rfl⟩ + exact critical_coefficient (k (φ n)) (hk (φ n)) hH (a (φ n)) (ha (φ n)) i j + + theorem hasDerivAt_of_critical_coefficients {H : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) + (x : C(Time,Vector κ)) + (h : ∀ m j, PeriodicFourier.coefficient m (coordPath j (gradPath hH x)) = + (2*(Real.pi : ℂ)*(m : ℂ))*PeriodicFourier.coefficient m (coordPath j x)) (t : ℝ) : + HasDerivAt (fun s : ℝ => x (s : Time)) (Complex.I • gradient H (x (t : Time))) t := by + have hj (j : κ) : HasDerivAt (fun s : ℝ => x (s : Time) j) + (Complex.I • gradient H (x (t : Time)) j) t := by + have hc (m : ℤ) : PeriodicFourier.coefficient m (Complex.I • coordPath j (gradPath hH x)) = + (2*(Real.pi : ℂ)*Complex.I*(m : ℂ))*PeriodicFourier.coefficient m (coordPath j x) := by + rw [map_smul, h] + simp only [smul_eq_mul] + ring + exact PeriodicFourier.hasDerivAt_of_coefficients (coordPath j x) + (Complex.I • coordPath j (gradPath hH x)) hc t + have hp := hasDerivAt_pi.mpr hj + exact (PiLp.continuousLinearEquiv 2 ℝ (fun _ : κ => ℂ)).symm.hasFDerivAt.comp_hasDerivAt t hp + + theorem positive_action_limit {α : ℕ → Type} [∀ n, Fintype (α n)] + (k : (n : ℕ) → α n → ℤ) {H : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) + (a : (n : ℕ) → Coeff (α n) κ) (ha : ∀ n, gradient (action (k n) H) (a n) = 0) + {L : ℝ} (hL : ∀ n, L ≤ action (k n) H (a n)) + (φ : ℕ → ℕ) (x : C(Time,Vector κ)) + (ht : Tendsto (fun n => loop (k (φ n)) (a (φ n))) atTop (𝓝 x)) : + L ≤ meanAction hH x := by + apply ge_of_tendsto' ((contDiff_meanAction hH).continuous.continuousAt.tendsto.comp ht) + intro n + change L ≤ meanAction hH (loop (k (φ n)) (a (φ n))) + rw [← critical_action_eq _ hH _ (ha (φ n))] + exact hL (φ n) + +end +end FourierPolynomial + +namespace HamiltonianPeriodic +noncomputable section +open MeasureTheory AddCircle Finset Set Filter +open scoped ComplexConjugate ContDiff Topology +local instance : Fact (0 < (1 : ℝ)) := ⟨zero_lt_one⟩ +open DiagonalQuadratic FourierPolynomial + + def negativeMode (N : ℕ) (i : Fin (N+1)) : ℤ := -(i.val : ℤ) + def positiveMode (N : ℕ) (i : Fin (N+1)) : ℕ := i.val+1 + def frequency (N : ℕ) : Fin (N+1) ⊕ Fin (N+1) → ℤ := + Sum.elim (negativeMode N) (fun i => (positiveMode N i : ℤ)) + + theorem negativeMode_nonpos (N : ℕ) (i : Fin (N+1)) : negativeMode N i ≤ 0 := by + simp [negativeMode] + + theorem positiveMode_pos (N : ℕ) (i : Fin (N+1)) : 0 < positiveMode N i := Nat.succ_pos _ + + theorem positiveMode_injective (N : ℕ) : Function.Injective (positiveMode N) := by + intro i j hij + apply Fin.ext + simpa [positiveMode] using hij + + theorem frequency_injective (N : ℕ) : Function.Injective (frequency N) := by + intro i j hij + cases i <;> cases j + · simp only [frequency, Sum.elim_inl, negativeMode, neg_inj, Nat.cast_inj] at hij + exact congrArg Sum.inl (Fin.ext hij) + · simp only [frequency, Sum.elim_inl, Sum.elim_inr, negativeMode, positiveMode, Nat.cast_add, Nat.cast_one] at hij + omega + · simp only [frequency, Sum.elim_inl, Sum.elim_inr, negativeMode, positiveMode, Nat.cast_add, Nat.cast_one] at hij + omega + · simp only [frequency, Sum.elim_inr, Nat.cast_inj] at hij + exact congrArg Sum.inr (positiveMode_injective N hij) + + theorem frequency_exhausts (m : ℤ) : ∀ᶠ N in atTop, m ∈ Set.range (frequency N) := by + cases m with + | ofNat m => + cases m with + | zero => + filter_upwards [] with N + exact ⟨Sum.inl ⟨0,Nat.succ_pos N⟩, by simp [frequency,negativeMode]⟩ + | succ m => + filter_upwards [eventually_ge_atTop m] with N hN + exact ⟨Sum.inr ⟨m,by omega⟩, by simp [frequency,positiveMode]⟩ + | negSucc m => + filter_upwards [eventually_ge_atTop (m+1)] with N hN + exact ⟨Sum.inl ⟨m+1,by omega⟩, by simp [frequency,negativeMode,Int.negSucc_eq]⟩ + + variable {κ : Type} [Fintype κ] [DecidableEq κ] + + theorem exists_positive_periodic + (j₀ : κ) {H : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) (hH0 : ∀ z, 0 ≤ H z) + (d₀ d : κ → ℝ) {C M η γ B D : ℝ} + (hM : 0 ≤ M) (hη : 0 < η) (hγ : 0 < γ) (hB : 0 ≤ B) (hD : 0 ≤ D) + (hup : ∀ z, H z ≤ M*‖z‖^4) + (hd : ∀ j, η ≤ d₀ j) (hd0 : Real.pi+η ≤ d₀ j₀) + (hlo : ∀ z, energy d₀ z-C ≤ H z) (hdD : ∀ j, |d j| ≤ D) + (hgap : ∀ m : ℤ, ∀ j, γ ≤ |Real.pi*(m : ℝ)-d j|) + (hrem : ∀ z, ‖gradient H z-(2 : ℝ) • diag d z‖ ≤ B) : + ∃ x : C(Time,Vector κ), 0 < meanAction hH x ∧ + ∀ t : ℝ, HasDerivAt (fun s : ℝ => x (s : Time)) + (Complex.I • gradient H (x (t : Time))) t := by + have he (N : ℕ) := finite_critical (negativeMode N) (negativeMode_nonpos N) + (positiveMode N) (positiveMode_injective N) (positiveMode_pos N) (frequency_injective N) + (⟨0,Nat.succ_pos N⟩ : Fin (N+1)) rfl j₀ hH hH0 d₀ d hM hη hγ hB hup hd hd0 hlo + (fun i j => hgap (frequency N i) j) hrem + choose a ha hupper hz using he + obtain ⟨x,φ,hφ,ht⟩ := critical_subsequence frequency frequency_injective hH d hγ hB hD hdD + (fun n i j => hgap (frequency n i) j) hrem a hz + refine ⟨x,lt_of_lt_of_le (linkLevel_pos hM) (positive_action_limit frequency hH a hz ha φ x ht),?_⟩ + exact hasDerivAt_of_critical_coefficients hH x + (limit_coefficient frequency frequency_injective frequency_exhausts hH a hz φ hφ x ht) + +end +end HamiltonianPeriodic + +end NonsqueezingInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/PlanarSquare.lean b/lean/OAI/Geometry/PolarProducts/PlanarSquare.lean new file mode 100644 index 0000000000000000000000000000000000000000..180278fc3f71194d170495a7dfd927bb3a994653 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/PlanarSquare.lean @@ -0,0 +1,234 @@ +import OAI.Geometry.PolarProducts.CanonicalCylinder + +namespace OAI + +universe u129 u130 + +section +namespace PlanarSquare +noncomputable section +open Set Filter +open scoped ContDiff Topology + +def square : Set ℂ := {z | |z.re| < 1 ∧ |z.im| < 1} +def radius (z : ℂ) : ℝ := Real.sqrt (2*(z.im+1)/Real.pi) +def angle : ℂ →L[ℝ] ℂ := Complex.reCLM.smulRight (-(Real.pi : ℂ)*Complex.I) +def rotation (z : ℂ) : ℂ := Complex.exp (angle z) +def map (z : ℂ) : ℂ := (radius z : ℂ)*rotation z + +theorem radius_pos {z : ℂ} (hz : -1 < z.im) : 0 < radius z := by + apply Real.sqrt_pos.2 + exact div_pos (by linarith) Real.pi_pos + +theorem radius_sq {z : ℂ} (hz : -1 < z.im) : radius z ^ 2 = 2*(z.im+1)/Real.pi := + Real.sq_sqrt (div_nonneg (by linarith) Real.pi_pos.le) + +@[simp] theorem angle_re (z : ℂ) : (angle z).re = 0 := by simp [angle, Complex.mul_re, Complex.mul_im] +@[simp] theorem angle_im (z : ℂ) : (angle z).im = -Real.pi*z.re := by + simp [angle, Complex.mul_re, Complex.mul_im, mul_comm] + +@[simp] theorem norm_rotation (z : ℂ) : ‖rotation z‖ = 1 := by simp [rotation, Complex.norm_exp] + +theorem norm_map_sq {z : ℂ} (hz : -1 < z.im) : ‖map z‖^2 = 2*(z.im+1)/Real.pi := by + rw [map, norm_mul, norm_rotation, mul_one, Complex.norm_real, Real.norm_eq_abs, sq_abs, radius_sq hz] + +theorem map_bound {z : ℂ} (hz : z ∈ square) : ‖map z‖^2 < 4/Real.pi := by + rw [norm_map_sq (abs_lt.mp hz.2).1] + exact (div_lt_div_iff_of_pos_right Real.pi_pos).2 (by linarith [(abs_lt.mp hz.2).2]) + +theorem map_injOn : InjOn map square := by + intro z hz w hw hzw + have him : z.im = w.im := by + have hh := congrArg (fun t : ℂ => ‖t‖^2) hzw + rw [norm_map_sq (abs_lt.mp hz.2).1, norm_map_sq (abs_lt.mp hw.2).1] at hh + have := (div_left_inj' Real.pi_ne_zero).mp hh + linarith + have hrad : radius z = radius w := by simp only [radius, him] + have hrot : rotation z = rotation w := by + change (radius z : ℂ)*rotation z = (radius w : ℂ)*rotation w at hzw + rw [← hrad] at hzw + exact mul_left_cancel₀ (Complex.ofReal_ne_zero.mpr (radius_pos (abs_lt.mp hz.2).1).ne') hzw + have hab (x : ℂ) (hx : x ∈ square) : -Real.pi < (angle x).im ∧ (angle x).im ≤ Real.pi := by + rw [angle_im] + have ht := mul_lt_mul_of_pos_left (abs_lt.mp hx.1).2 Real.pi_pos + have hb := mul_lt_mul_of_pos_left (abs_lt.mp hx.1).1 Real.pi_pos + constructor <;> linarith + have hangle := Complex.exp_inj_of_neg_pi_lt_of_le_pi (hab z hz).1 (hab z hz).2 + (hab w hw).1 (hab w hw).2 hrot + have hre : z.re = w.re := by + have hh := congrArg Complex.im hangle + simp only [angle_im] at hh + nlinarith [Real.pi_pos] + exact Complex.ext hre him + +theorem contDiffAt_map {z : ℂ} (hz : -1 < z.im) : ContDiffAt ℝ ∞ map z := by + have hrad : ContDiffAt ℝ ∞ radius z := by + apply ContDiffAt.sqrt + · exact (contDiffAt_const.mul (Complex.imCLM.contDiff.contDiffAt.add contDiffAt_const)).div_const Real.pi + · exact ne_of_gt (div_pos (by linarith) Real.pi_pos) + exact (Complex.ofRealCLM.contDiff.contDiffAt.comp z hrad).mul (angle.contDiff.contDiffAt.cexp) + +theorem hasFDerivAt_radius {z : ℂ} (hz : -1 < z.im) : + HasFDerivAt radius ((1/(Real.pi*radius z)) • Complex.imCLM) z := by + have hbase : HasFDerivAt (fun w : ℂ => 2*(w.im+1)/Real.pi) + ((2/Real.pi) • Complex.imCLM) z := by + have hf : (fun w : ℂ => 2*(w.im+1)/Real.pi) = + (fun w : ℂ => (2/Real.pi)*(Complex.imCLM w+1)) := by funext w; simp only [Complex.imCLM_apply]; ring + rw [hf] + exact (Complex.imCLM.hasFDerivAt.add_const 1).const_mul (2/Real.pi) + have hs := hbase.sqrt (ne_of_gt (div_pos (by linarith) Real.pi_pos)) + rw [smul_smul] at hs + change HasFDerivAt radius (((1/(2*radius z))*(2/Real.pi)) • Complex.imCLM) z at hs + have hcoef : (1/(2*radius z))*(2/Real.pi) = 1/(Real.pi*radius z) := by + field_simp + rwa [hcoef] at hs + +def derivative (z : ℂ) : ℂ →L[ℝ] ℂ := + (radius z : ℂ) • (rotation z • angle) + + rotation z • (Complex.ofRealCLM.comp ((1/(Real.pi*radius z)) • Complex.imCLM)) + +theorem hasFDerivAt_map {z : ℂ} (hz : -1 < z.im) : HasFDerivAt map (derivative z) z := by + exact ((Complex.ofRealCLM.hasFDerivAt.comp z (hasFDerivAt_radius hz)).mul + angle.hasFDerivAt.cexp) + +theorem derivative_apply (z v : ℂ) : + derivative z v = rotation z * (((v.im/(Real.pi*radius z) : ℝ) : ℂ) - + Complex.I * ((Real.pi*radius z*v.re : ℝ) : ℂ)) := by + simp [derivative, angle, Complex.real_smul, smul_eq_mul, div_eq_mul_inv] + ring + +def form (v w : ℂ) : ℝ := v.re*w.im - w.re*v.im + +theorem form_mul (a v w : ℂ) : form (a*v) (a*w) = ‖a‖^2*form v w := by + simp only [form, Complex.mul_re, Complex.mul_im, Complex.sq_norm, Complex.normSq_apply] + ring + +theorem derivative_preserves {z : ℂ} (hz : -1 < z.im) (v w : ℂ) : + form (derivative z v) (derivative z w) = form v w := by + simp only [derivative_apply, form_mul, norm_rotation, one_pow, one_mul] + simp only [form, Complex.sub_re, Complex.sub_im, Complex.ofReal_re, Complex.ofReal_im, + Complex.mul_re, Complex.mul_im, Complex.I_re, Complex.I_im] + have hr := (radius_pos hz).ne' + field_simp + ring + +end +end PlanarSquare +end + +section +namespace PlanarCylinder +noncomputable section +open Set Filter +open scoped ContDiff Topology +variable {κ : Type u129} [Fintype κ] [DecidableEq κ] +abbrev V (κ : Type u130) := EuclideanSpace ℂ κ + +def domain (j₀ : κ) : Set (V κ) := {z | z j₀ ∈ PlanarSquare.square} +def map (j₀ : κ) (z : V κ) : V κ := + (EuclideanSpace.equiv κ ℂ).symm (fun j => if j = j₀ then PlanarSquare.map (z j) else z j) + +omit [Fintype κ] in +@[simp] theorem map_apply (j₀ j : κ) (z : V κ) : + map j₀ z j = if j = j₀ then PlanarSquare.map (z j) else z j := rfl + +omit [Fintype κ] in +@[simp] theorem map_first (j₀ : κ) (z : V κ) : map j₀ z j₀ = PlanarSquare.map (z j₀) := by simp + +omit [Fintype κ] in +theorem map_injOn (j₀ : κ) : InjOn (map j₀) (domain j₀) := by + intro z hz w hw hzw + ext j + have hh := congrArg (fun v : V κ => v j) hzw + by_cases hj : j = j₀ + · subst j + apply PlanarSquare.map_injOn hz hw + simpa only [map_first] using hh + · simpa only [map_apply, ite_eq_right hj] using hh + +def derivative (j₀ : κ) (z : V κ) : V κ →L[ℝ] V κ := + (PiLp.continuousLinearEquiv 2 ℝ (fun _ : κ => ℂ)).symm.toContinuousLinearMap.comp + (ContinuousLinearMap.pi (fun j => if j = j₀ then + (PlanarSquare.derivative (z j)).comp (PiLp.proj 2 (fun _ : κ => ℂ) j) + else (PiLp.proj 2 (fun _ : κ => ℂ) j))) + +omit [Fintype κ] in +@[simp] theorem derivative_apply (j₀ j : κ) (z v : V κ) : + derivative j₀ z v j = if j = j₀ then PlanarSquare.derivative (z j) (v j) else v j := by + change (if j = j₀ then (PlanarSquare.derivative (z j)).comp (PiLp.proj 2 (fun _ : κ => ℂ) j) + else (PiLp.proj 2 (fun _ : κ => ℂ) j)) v = _ + split_ifs <;> rfl + +theorem hasFDerivAt_map (j₀ : κ) {z : V κ} (hz : -1 < (z j₀).im) : + HasFDerivAt (map j₀) (derivative j₀ z) z := by + apply (PiLp.hasFDerivAt_toLp (𝕜 := ℝ) 2 _).comp + apply hasFDerivAt_pi.mpr + intro j + by_cases hj : j = j₀ + · subst j + simp only [ite_true] + exact (PlanarSquare.hasFDerivAt_map hz).comp z (PiLp.hasFDerivAt_apply (𝕜 := ℝ) 2 z j₀) + · simp only [ite_eq_right hj] + exact PiLp.hasFDerivAt_apply (𝕜 := ℝ) 2 z j + +theorem contDiffAt_map (j₀ : κ) {z : V κ} (hz : -1 < (z j₀).im) : + ContDiffAt ℝ ∞ (map j₀) z := by + apply (contDiffAt_piLp 2).mpr + intro j + by_cases hj : j = j₀ + · subst j + simp only [map_first] + exact (PlanarSquare.contDiffAt_map hz).comp z + (show ContDiffAt ℝ ∞ (fun w : V κ => w j₀) z from contDiffAt_piLp_apply 2) + · simp only [map_apply, ite_eq_right hj] + exact contDiffAt_piLp_apply 2 + +def form (v w : V κ) : ℝ := ∑ j, PlanarSquare.form (v j) (w j) + +omit [DecidableEq κ] in +theorem form_eq_inner (v w : V κ) : form v w = inner (𝕜 := ℝ) (Complex.I • v) w := by + simp only [form, PiLp.inner_apply, PiLp.smul_apply, smul_eq_mul] + apply Finset.sum_congr rfl + intro j _ + rw [real_inner_eq_re_inner, RCLike.inner_apply'] + change PlanarSquare.form (v j) (w j) = ((starRingEnd ℂ) (Complex.I * v j) * w j).re + simp only [PlanarSquare.form, Complex.mul_re, Complex.mul_im, Complex.I_re, Complex.I_im, + Complex.conj_re, Complex.conj_im] + ring + +theorem derivative_preserves (j₀ : κ) {z : V κ} (hz : -1 < (z j₀).im) (v w : V κ) : + form (derivative j₀ z v) (derivative j₀ z w) = form v w := by + unfold form + apply Finset.sum_congr rfl + intro j _ + by_cases hj : j = j₀ + · subst j + simp only [derivative_apply, ite_true] + exact PlanarSquare.derivative_preserves hz _ _ + · simp only [derivative_apply, ite_eq_right hj] + +omit [Fintype κ] in +theorem first_bound (j₀ : κ) {z : V κ} (hz : z ∈ domain j₀) : + ‖map j₀ z j₀‖^2 < 4/Real.pi := by + rw [map_first] + exact PlanarSquare.map_bound hz + +theorem norm_bound (j₀ : κ) {z : V κ} (hz : z ∈ domain j₀) : + ‖map j₀ z‖^2 ≤ ‖z‖^2 + 4/Real.pi := by + rw [EuclideanSpace.norm_sq_eq, EuclideanSpace.norm_sq_eq] + calc + _ ≤ ∑ j, (‖z j‖^2 + if j = j₀ then 4/Real.pi else 0) := by + apply Finset.sum_le_sum + intro j _ + by_cases hj : j = j₀ + · subst j + simp only [ite_true] + exact (first_bound j₀ hz).le.trans (le_add_of_nonneg_left (sq_nonneg _)) + · simp [map_apply, ite_eq_right hj] + _ = _ := by simp [Finset.sum_add_distrib] + +end +end PlanarCylinder +end + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/PolarApproximation.lean b/lean/OAI/Geometry/PolarProducts/PolarApproximation.lean new file mode 100644 index 0000000000000000000000000000000000000000..3fa05f7cfd645265820ee3ee61c3032f887292ed --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/PolarApproximation.lean @@ -0,0 +1,341 @@ +import OAI.Geometry.PolarProducts.MomentumBounds + +namespace OAI + +universe u74 u75 u76 u77 + +section LowerBoundInline +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter Metric +open scoped Topology ContDiff +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal +open Set Filter Function +open scoped Topology ContDiff +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter +open scoped Topology ContDiff +open Set Filter Function +open scoped Topology ContDiff +open Set Filter Function +open scoped ContDiff Topology +open Set MeasureTheory +open scoped ContDiff Interval Topology +open Set +open scoped Topology ContDiff +open Set +open Set MeasureTheory +open scoped ContDiff Interval Topology +open Set Filter Complex +open scoped Topology ContDiff +open MeasureTheory intervalIntegral Set +open scoped Real +open Set +open scoped ContDiff ENNReal + +namespace SymmetricPolar +open Set Filter ComplexCoordinates ComplexPotential PolarStrips +open scoped Topology ContDiff +noncomputable section +variable {n : ℕ} {κ : Type u74} [Fintype κ] + +theorem exists_positive_slack {c d : ℝ} (hc : 0 < c) (hcd : c < d) : + ∃ η : ℝ, 0 < η ∧ (1+η)*c < d := by + let η := (d-c)/(2*c) + have hη : 0 < η := div_pos (sub_pos.mpr hcd) (mul_pos (by norm_num) hc) + have he : η*c = (d-c)/2 := by dsimp [η]; field_simp + exact ⟨η, hη, by nlinarith⟩ + +theorem finite_strips_embedding (b : κ → Position n) + (hb : Function.Injective (fun x : Position n => fun j => inner (𝕜 := ℝ) (b j) x)) + {c : ℝ} (hc : 0 < c) (hc4 : c < 4) : + HasSymplecticEmbedding (capacityBall n c) + (interior (ConvexPolar.stripBody b) ×ˢ interior (ConvexPolar.polar (ConvexPolar.stripBody b))) := by + let : InnerProductSpace ℝ (C (Fin n)) := InnerProductSpace.complexToReal + obtain ⟨η, hη, hηc⟩ := exists_positive_slack hc hc4 + obtain ⟨k, hk, hscaled⟩ := exists_scaled_image b hb hη + let ℓ := fun j => functional (b j) + have hℓ : Function.Injective (fun z : C (Fin n) => fun j => ℓ j z) := functional_injective b hb + have hkpos : (0 : ℝ) < k := by exact_mod_cast (Nat.zero_lt_of_lt hk) + let S := (1+η)*Real.pi*(k : ℝ)/4 + have hS : 0 < S := by dsimp [S]; positivity + let a := S*c/Real.pi + have ha : 0 < a := div_pos (mul_pos hS hc) Real.pi_pos + have hak : a < (k : ℝ) := by + apply (div_lt_iff₀ Real.pi_pos).mpr + have hh := mul_lt_mul_of_pos_right hηc (mul_pos Real.pi_pos hkpos) + dsimp [S] + nlinarith + obtain ⟨Q, hQ, _hQi, hQm, hQω⟩ := + exists_ball_from_holomorphic_zero (isOpen_domain ℓ) (zero_mem_domain ℓ) + (analyticOnNhd_tuple ℓ k) (fun x hx => tuple_zero_iff ℓ hℓ hk hx) hk (tuple_order ℓ k) + (fun s hs hs1 => compact_sublevel ℓ hℓ hk hs hs1) ha hak + let i : Phase n →L[ℝ] C (Fin n) := parts.symm.toContinuousLinearMap + have hi (z : Phase n) (hz : z ∈ capacityBall n (S*c)) : ‖i z‖^2 < a := by + apply (lt_div_iff₀ Real.pi_pos).mpr + have he : ‖i z‖^2 = ‖z.1‖^2+‖z.2‖^2 := by + have hh := norm_sq_parts (parts.symm z) + have hre : re (parts.symm z) = z.1 := congrArg Prod.fst (parts.apply_symm_apply z) + have him : im (parts.symm z) = z.2 := congrArg Prod.snd (parts.apply_symm_apply z) + simpa only [i, ContinuousLinearEquiv.coe_coe, hre, him] using hh + rw [he, mul_comm] + exact hz + let e : Phase n → Phase n := fun z => phase b k (Q (i z)) + have hs (z : Phase n) (hz : z ∈ capacityBall n (S*c)) : ContDiffAt ℝ ∞ e z := by + have hphase : ContDiffAt ℝ ∞ (phase b k) (Q (i z)) := + contDiffAt_phase b k (hQm _ (hi z hz)).1 + have hh := hphase.comp z (hQ.contDiffAt.comp z i.contDiff.contDiffAt) + simpa only [Function.comp_def, e] using hh + apply embedding_of_scaled_ball_map hS (a := 1) (b := S⁻¹) (by simp) (e := e) + · exact fun z hz => (hs z hz).contDiffWithinAt + · intro z hz w hw he + have hq : Q (i z) = Q (i w) := injOn_phase b k (hQm _ (hi z hz)).1 (hQm _ (hi w hw)).1 he + exact parts.symm.injective (Q.injective hq) + · intro z hz + have hm := hscaled (Q (i z)) (hQm _ (hi z hz)).1 (hQm _ (hi z hz)).2 + simpa only [diagScale_apply, one_smul, e, S, Set.mem_prod] using hm + · intro z hz v w + have hphase : HasFDerivAt (phase b k) (fderiv ℝ (phase b k) (Q (i z))) (Q (i z)) := + ((contDiffAt_phase b k (hQm _ (hi z hz)).1).differentiableAt (by simp)).hasFDerivAt + have hd : HasFDerivAt e ((fderiv ℝ (phase b k) (Q (i z))).comp + ((fderiv ℝ (Q : C (Fin n) → C (Fin n)) (i z)).comp i)) z := by + have hh := hphase.comp z ((hQ.differentiable (by simp) (i z)).hasFDerivAt.comp z i.hasFDerivAt) + simpa only [Function.comp_def, e] using hh + rw [hd.fderiv] + change phaseForm (fderiv ℝ (phase b k) (Q (i z)) (fderiv ℝ (Q : C (Fin n) → C (Fin n)) (i z) (i v))) + (fderiv ℝ (phase b k) (Q (i z)) (fderiv ℝ (Q : C (Fin n) → C (Fin n)) (i z) (i w))) = _ + rw [phase_pullback b k (hQm _ (hi z hz)).1, hQω _ (hi z hz), standardTensor_parts] + change phaseForm (parts (parts.symm v)) (parts (parts.symm w)) = _ + rw [parts.apply_symm_apply, parts.apply_symm_apply] + rfl + +end +end SymmetricPolar + +namespace ConvexPolar +open Set Filter +open scoped Topology +noncomputable section +variable {E : Type u75} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +theorem zero_mem_interior_of_symmetric {K : Set E} (hK : Convex ℝ K) + (hi : (interior K).Nonempty) (hs : ∀ x, x ∈ K ↔ -x ∈ K) : (0 : E) ∈ interior K := by + obtain ⟨x, hx⟩ := hi + have hn : -x ∈ interior K := by + apply mem_interior_iff_mem_nhds.mpr + have hh : K ∈ 𝓝 (-(-x)) := by simpa using mem_interior_iff_mem_nhds.mp hx + have hh' := continuous_neg.continuousAt.preimage_mem_nhds hh + have he : (fun y : E => -y) ⁻¹' K = K := by ext y; exact (hs y).symm + rwa [he] at hh' + have hm := hK.interior hx hn (by norm_num : (0 : ℝ) ≤ 1/2) (by norm_num : (0 : ℝ) ≤ 1/2) + (by norm_num : (1/2 : ℝ)+1/2 = 1) + simpa using hm + +theorem isClosed_polar (K : Set E) : IsClosed (polar K) := by + have he : polar K = ⋂ q ∈ K, {p : E | inner (𝕜 := ℝ) q p ≤ 1} := by ext p; simp [polar] + rw [he] + exact isClosed_biInter (fun q _ => isClosed_le (by fun_prop) continuous_const) + +theorem polar_abs_pairing {K : Set E} (hs : ∀ x, x ∈ K ↔ -x ∈ K) + {p : E} (hp : p ∈ polar K) {x : E} (hx : x ∈ K) : |inner (𝕜 := ℝ) p x| ≤ 1 := by + apply abs_le.mpr + have hn := hp (-x) ((hs x).mp hx) + rw [inner_neg_left, real_inner_comm] at hn + exact ⟨by linarith, by rw [real_inner_comm]; exact hp x hx⟩ + +theorem norm_smul_normalized {x : E} (hx : x ≠ 0) {r : ℝ} (hr : 0 ≤ r) : + ‖(r/‖x‖) • x‖ = r := by + rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg (div_nonneg hr (norm_nonneg _)), div_mul_cancel₀ _ (norm_ne_zero_iff.mpr hx)] + +theorem normalized_inner {x : E} (hx : x ≠ 0) (r : ℝ) : + inner (𝕜 := ℝ) ((r/‖x‖) • x) x = r*‖x‖ := by + rw [real_inner_smul_left, real_inner_self_eq_norm_sq] + field_simp + +theorem norm_le_of_mem_polar {K : Set E} {r : ℝ} (hr : 0 < r) + (hball : Metric.closedBall (0 : E) r ⊆ K) {p : E} (hp : p ∈ polar K) : ‖p‖ ≤ r⁻¹ := by + by_cases hp0 : p = 0 + · simp [hp0, hr.le] + have hq : (r/‖p‖) • p ∈ K := hball (by simpa using (norm_smul_normalized hp0 hr.le).le) + have hh := hp _ hq + rw [normalized_inner hp0] at hh + have hh' : ‖p‖ ≤ r⁻¹ * (1 : ℝ) := (le_inv_mul_iff₀ hr).mpr hh + simpa only [mul_one] using hh' + +theorem isCompact_polar [FiniteDimensional ℝ E] {K : Set E} (h0 : (0 : E) ∈ interior K) : IsCompact (polar K) := by + obtain ⟨r, hr, hball⟩ := Metric.mem_nhds_iff.mp (mem_interior_iff_mem_nhds.mp h0) + have hr2 : 0 < r/2 := half_pos hr + have hclosed : Metric.closedBall (0 : E) (r/2) ⊆ K := by + intro x hx + apply hball + exact (Metric.mem_closedBall.mp hx).trans_lt (half_lt_self hr) + apply (isCompact_closedBall (0 : E) ((r/2)⁻¹)).of_isClosed_subset (isClosed_polar K) + intro p hp + simpa using norm_le_of_mem_polar hr2 hclosed hp + +theorem mem_polar_polar_iff [FiniteDimensional ℝ E] {K : Set E} (hK : Convex ℝ K) (hc : IsClosed K) + (h0 : (0 : E) ∈ K) (x : E) : x ∈ polar (polar K) ↔ x ∈ K := by + constructor + · intro hx + by_contra hn + obtain ⟨f, u, hfu, hux⟩ := geometric_hahn_banach_closed_point hK hc hn + have hu : 0 < u := by simpa using hfu 0 h0 + let v : E := (InnerProductSpace.toDual ℝ E).symm f + have hv (y : E) : inner (𝕜 := ℝ) y v = f y := by + rw [real_inner_comm] + exact InnerProductSpace.toDual_symm_apply + have hp : u⁻¹ • v ∈ polar K := by + intro y hy + rw [real_inner_smul_right, hv, ← div_eq_inv_mul] + exact (div_le_one hu).mpr (hfu y hy).le + have hh := hx _ hp + rw [real_inner_smul_left, real_inner_comm, hv, ← div_eq_inv_mul] at hh + exact (not_le_of_gt hux) ((div_le_one hu).mp hh) + · intro hx p hp + rw [real_inner_comm] + exact hp x hx + +theorem closedBall_subset_polar_of_norm_bound {K : Set E} {B : ℝ} (hB : 0 ≤ B) + (hbound : ∀ x ∈ K, ‖x‖ ≤ B) : Metric.closedBall (0 : E) ((B+1)⁻¹) ⊆ polar K := by + intro p hp x hx + have hp' : ‖p‖ ≤ (B+1)⁻¹ := by simpa using hp + have hi := real_inner_le_norm x p + have hm := mul_le_mul (hbound x hx) hp' (norm_nonneg _) hB + have hr : 0 < B+1 := by linarith + have hb : B*(B+1)⁻¹ ≤ 1 := (div_le_one hr).mpr (by linarith) + exact hi.trans (hm.trans hb) + +end +end ConvexPolar + +namespace ConvexPolar +open Set Filter +open scoped Topology +noncomputable section +variable {E : Type u76} [NormedAddCommGroup E] [InnerProductSpace ℝ E] +variable {κ : Type u77} + +theorem pairing_le_of_net {P : Set E} {b : κ → E} {δ M : ℝ} + (hnet : ∀ p ∈ P, ∃ j, ‖p-b j‖ ≤ δ) {x : E} + (hx : ∀ j, inner (𝕜 := ℝ) (b j) x ≤ M) {p : E} (hp : p ∈ P) : + inner (𝕜 := ℝ) p x ≤ M+δ*‖x‖ := by + obtain ⟨j, hj⟩ := hnet p hp + have hh := real_inner_le_norm (p-b j) x + rw [inner_sub_left] at hh + have hm := mul_le_mul_of_nonneg_right hj (norm_nonneg x) + linarith [hx j] + +theorem net_norm_bound {P : Set E} {b : κ → E} {δ M r : ℝ} + (hr : 0 ≤ r) (hM : 0 ≤ M) (hball : Metric.closedBall (0 : E) r ⊆ P) + (hnet : ∀ p ∈ P, ∃ j, ‖p-b j‖ ≤ δ) {x : E} + (hx : ∀ j, inner (𝕜 := ℝ) (b j) x ≤ M) : (r-δ)*‖x‖ ≤ M := by + by_cases hx0 : x = 0 + · simpa [hx0] using hM + have hp : (r/‖x‖) • x ∈ P := hball (by simpa using (norm_smul_normalized hx0 hr).le) + have hh := pairing_le_of_net hnet hx hp + rw [normalized_inner hx0] at hh + nlinarith + +theorem finite_polar_approximation [FiniteDimensional ℝ E] {K : Set E} + (hc : IsCompact K) (hK : Convex ℝ K) (hi : (interior K).Nonempty) + (hs : ∀ x, x ∈ K ↔ -x ∈ K) {α : ℝ} (hα : 0 < α) : + ∃ t : Finset E, + Function.Injective (fun x : E => fun j : t => inner (𝕜 := ℝ) (j : E) x) ∧ + K ⊆ stripBody (fun j : t => (j : E)) ∧ + (∀ x ∈ stripBody (fun j : t => (j : E)), (1+α)⁻¹ • x ∈ K) ∧ + polar (stripBody (fun j : t => (j : E))) ⊆ polar K := by + classical + have h0 := zero_mem_interior_of_symmetric hK hi hs + obtain ⟨B, hB, hbound⟩ := hc.isBounded.exists_pos_norm_le + let r := (B+1)⁻¹ + have hr : 0 < r := inv_pos.mpr (by linarith) + let δ := α*r/(1+α) + have hlam : 0 < 1+α := by linarith + have hδ : 0 < δ := div_pos (mul_pos hα hr) hlam + have hrδ : 0 < r-δ := by + apply sub_pos.mpr + apply (div_lt_iff₀ hlam).mpr + nlinarith + have hδeq : δ = α*(r-δ) := by dsimp [δ]; field_simp; ring + have hball : Metric.closedBall (0 : E) r ⊆ polar K := + closedBall_subset_polar_of_norm_bound hB.le hbound + obtain ⟨t, htK, ht, hcover⟩ := (isCompact_polar h0).finite_cover_balls hδ + let b : ht.toFinset → E := fun j => j + have hb (j : ht.toFinset) : b j ∈ polar K := htK (by simpa only [b, Set.Finite.mem_toFinset] using j.2) + have hnet (p : E) (hp : p ∈ polar K) : ∃ j : ht.toFinset, ‖p-b j‖ ≤ δ := by + obtain ⟨q, hq⟩ := mem_iUnion.mp (hcover hp) + obtain ⟨hqmem, hdist⟩ := mem_iUnion.mp hq + refine ⟨⟨q, by simpa using hqmem⟩, ?_⟩ + simpa only [dist_eq_norm, b] using (Metric.mem_ball.mp hdist).le + have hKK' : K ⊆ stripBody b := by + intro x hx j + exact polar_abs_pairing hs (hb j) hx + have hspans : Function.Injective (fun x : E => fun j => inner (𝕜 := ℝ) (b j) x) := by + intro x y hxy + have hz (j) : inner (𝕜 := ℝ) (b j) (x-y) ≤ 0 := by + rw [inner_sub_right] + have hh : inner (𝕜 := ℝ) (b j) x = inner (𝕜 := ℝ) (b j) y := congrFun hxy j + rw [hh, sub_self] + have hh := net_norm_bound hr.le le_rfl hball hnet hz + have he : ‖x-y‖ = 0 := by nlinarith [norm_nonneg (x-y)] + exact sub_eq_zero.mp (norm_eq_zero.mp he) + refine ⟨ht.toFinset, hspans, hKK', ?_, polar_antitone hKK'⟩ + intro x hx + apply (mem_polar_polar_iff hK hc.isClosed (interior_subset h0) _).mp + have hx' (j) : inner (𝕜 := ℝ) (b j) x ≤ 1 := (le_abs_self _).trans (hx j) + have hh := net_norm_bound hr.le (by norm_num : (0 : ℝ) ≤ 1) hball hnet hx' + have hd : δ*‖x‖ ≤ α := by nlinarith + intro p hp + rw [real_inner_smul_right, ← div_eq_inv_mul] + apply (div_le_one hlam).mpr + have hh' := pairing_le_of_net hnet hx' hp + linarith + +end +end ConvexPolar + +namespace SymmetricPolar +open Set Filter +open scoped Topology ContDiff Pointwise +noncomputable section +variable {n : ℕ} + +theorem symmetric_polar_embedding {K : Set (Position n)} (hK : IsSymmetricConvexBody K) + {c : ℝ} (hc : 0 < c) (hc4 : c < 4) : + HasSymplecticEmbedding (capacityBall n c) (polarProduct K) := by + obtain ⟨α, hα, hαc⟩ := exists_positive_slack hc hc4 + let lam := 1+α + have hlam : 0 < lam := by dsimp [lam]; linarith + rcases hK with ⟨hcompact, hconvex, hinterior, hsymm⟩ + obtain ⟨t, htinj, hKK', hK'K, hpolar⟩ := + ConvexPolar.finite_polar_approximation hcompact hconvex hinterior hsymm hα + let b : t → Position n := fun j => j + have hsubset : ConvexPolar.stripBody b ⊆ lam • K := by + intro x hx + refine ⟨lam⁻¹ • x, hK'K x hx, ?_⟩ + change lam • (lam⁻¹ • x) = x + rw [smul_smul, mul_inv_cancel₀ hlam.ne', one_smul] + have hposition {q : Position n} (hq : q ∈ interior (ConvexPolar.stripBody b)) : + lam⁻¹ • q ∈ interior K := by + have hh := interior_mono hsubset hq + rw [interior_smul₀ hlam.ne'] at hh + obtain ⟨w, hw, rfl⟩ := hh + simpa only [smul_smul, inv_mul_cancel₀ hlam.ne', one_smul] using hw + obtain ⟨e, he, hi, hm, hω⟩ := finite_strips_embedding b htinj (mul_pos hlam hc) hαc + apply embedding_of_scaled_ball_map hlam (a := lam⁻¹) (b := 1) (by simp) he + (HasSymplecticEmbedding.injOn hi) ?_ hω + intro z hz + obtain ⟨hq, hp⟩ := hm hz + change lam⁻¹ • (e z).1 ∈ interior K ∧ (1 : ℝ) • (e z).2 ∈ interior (polar K) + refine ⟨hposition hq, ?_⟩ + change (1 : ℝ) • (e z).2 ∈ interior (ConvexPolar.polar K) + simpa only [one_smul] using interior_mono hpolar hp + +end +end SymmetricPolar + +end LowerBoundInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/PotentialDeformation.lean b/lean/OAI/Geometry/PolarProducts/PotentialDeformation.lean new file mode 100644 index 0000000000000000000000000000000000000000..a2599cf68b9ff948b4baa4c0053ae44aa20d0a2b --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/PotentialDeformation.lean @@ -0,0 +1,349 @@ +import OAI.Geometry.PolarProducts.PotentialForms + +namespace OAI + +universe u30 u31 u32 u33 u34 u35 + +section LowerBoundInline +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter Metric +open scoped Topology ContDiff +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal +open Set Filter Function +open scoped Topology ContDiff +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter +open scoped Topology ContDiff +open Set Filter Function +open scoped Topology ContDiff + +open Set Filter Function +open scoped ContDiff Topology + +namespace CompactExtension +noncomputable section + +variable {E : Type u30} {F : Type u31} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] + +def extend (U : Set E) (f : E → F) : E → F := by + classical + exact U.indicator f + +omit [NormedSpace ℝ E] [NormedSpace ℝ F] in +theorem eventuallyEq_extend {U : Set E} (hU : IsOpen U) (f : E → F) {x : E} (hx : x ∈ U) : + extend U f =ᶠ[𝓝 x] f := by + classical + filter_upwards [hU.mem_nhds hx] with y hy + exact indicator_of_mem hy f + +omit [NormedSpace ℝ E] [NormedSpace ℝ F] in +theorem tsupport_extend_subset {U C : Set E} (hC : IsClosed C) {f : E → F} + (hf : ∀ x ∈ U, x ∉ C → f x = 0) : tsupport (extend U f) ⊆ C := by + classical + apply closure_minimal _ hC + intro x hx + by_contra hn + have hh : extend U f x = 0 := by + by_cases hU : x ∈ U + · exact (indicator_of_mem hU f).trans (hf x hU hn) + · exact indicator_of_notMem hU f + exact hx hh + +theorem contDiff_extend {U C : Set E} (hU : IsOpen U) (hC : IsClosed C) (hCU : C ⊆ U) + {f : E → F} (hf : ∀ x ∈ U, ContDiffAt ℝ ∞ f x) + (hzero : ∀ x ∈ U, x ∉ C → f x = 0) : ContDiff ℝ ∞ (extend U f) := by + rw [contDiff_iff_contDiffAt] + intro x + by_cases hx : x ∈ U + · exact (hf x hx).congr_of_eventuallyEq (eventuallyEq_extend hU f hx) + · have hxc : x ∉ C := fun hc => hx (hCU hc) + apply contDiffAt_const.congr_of_eventuallyEq + filter_upwards [hC.isOpen_compl.mem_nhds hxc] with y hy + exact image_eq_zero_of_notMem_tsupport (fun ht => hy (tsupport_extend_subset hC hzero ht)) + +omit [NormedSpace ℝ E] [NormedSpace ℝ F] in +theorem hasCompactSupport_extend {U C : Set E} (hC : IsCompact C) {f : E → F} + (hzero : ∀ x ∈ U, x ∉ C → f x = 0) : HasCompactSupport (extend U f) := + hC.of_isClosed_subset (isClosed_tsupport _) (tsupport_extend_subset hC.isClosed hzero) + +end +end CompactExtension + +namespace ComplexPotential + +open TensorCalculus Set Filter Function +open scoped ContDiff Topology + +noncomputable section + +variable {E : Type u32} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] + +local instance moserOneGroup : NormedAddCommGroup (E →L[ℝ] ℝ) := inferInstance +local instance moserOneSpace : NormedSpace ℝ (E →L[ℝ] ℝ) := inferInstance +local instance moserTwoGroup : NormedAddCommGroup (TwoTensor E) := inferInstance +local instance moserTwoSpace : NormedSpace ℝ (TwoTensor E) := inferInstance + +omit [FiniteDimensional ℝ E] in +theorem tsupport_dc_subset (J : E →L[ℝ] E) (φ : E → ℝ) : + tsupport (dc J φ) ⊆ tsupport φ := + (tsupport_comp_subset (map_zero (dcOp J)) (fderiv ℝ φ)).trans (tsupport_fderiv_subset ℝ) + +omit [FiniteDimensional ℝ E] in +theorem fderiv_homeomorph_apply_symm (F : E ≃ₜ E) + (hF : ContDiff ℝ ∞ (F : E → E)) (hFi : ContDiff ℝ ∞ (F.symm : E → E)) (x a : E) : + fderiv ℝ (F : E → E) (F.symm x) (fderiv ℝ (F.symm : E → E) x a) = a := by + have he : (F : E → E) ∘ (F.symm : E → E) = id := funext F.apply_symm_apply + have hd := fderiv_comp x (hF.differentiable (by simp) (F.symm x)) + (hFi.differentiable (by simp) x) + rw [he, fderiv_id] at hd + exact (congrArg (fun L : E →L[ℝ] E => L a) hd).symm + +theorem exists_potential_transport (J : E →L[ℝ] E) + (hsk : ∀ a b, inner (𝕜 := ℝ) a (J b) = -inner (𝕜 := ℝ) (J a) b) + (hJ : ∀ a, ‖J a‖ = ‖a‖) + {U C : Set E} (hU : IsOpen U) (hC : IsCompact C) (hCU : C ⊆ U) + {τ T : E → ℝ} (hτ : ∀ x ∈ U, IsPSHAt J τ x) (hT : ∀ x ∈ U, IsPSHAt J T x) + (heq : ∀ x ∈ U, x ∉ C → T x = τ x) : + ∃ F : E ≃ₜ E, ContDiff ℝ ∞ (F : E → E) ∧ ContDiff ℝ ∞ (F.symm : E → E) ∧ + (∀ x, x ∉ U → F x = x) ∧ (∀ x, F x ∈ U ↔ x ∈ U) ∧ + ∀ x ∈ U, ∀ a b, + ddc J (fun y => ‖y‖^2 + τ y) (F x) (fderiv ℝ (F : E → E) x a) + (fderiv ℝ (F : E → E) x b) = ddc J (fun y => ‖y‖^2 + T y) x a b := by + let g := CompactExtension.extend U (fun y => T y - τ y) + have hz : ∀ x ∈ U, x ∉ C → T x - τ x = 0 := by + intro x hx hxc + rw [heq x hx hxc, sub_self] + have hg : ContDiff ℝ ∞ g := CompactExtension.contDiff_extend hU hC.isClosed hCU + (fun x hx => (hT x hx).1.sub (hτ x hx).1) hz + have hgs : tsupport g ⊆ C := CompactExtension.tsupport_extend_subset hC.isClosed hz + let γ := dc J g + let W := ddc J (fun y => ‖y‖^2 + τ y) + have hγ : ContDiff ℝ ∞ γ := contDiff_dc J hg + have hsγ : tsupport γ ⊆ C := (tsupport_dc_subset J g).trans hgs + have hcγ : HasCompactSupport γ := hC.of_isClosed_subset (isClosed_tsupport _) hsγ + have hdiff (x : E) (hx : x ∈ U) : + exteriorD γ x = ddc J T x - ddc J τ x := by + change ddc J g x = _ + rw [ddc_congr J (CompactExtension.eventuallyEq_extend hU _ hx)] + exact ddc_sub J (hT x hx).1 (hτ x hx).1 + have hnorm (x : E) (hx : x ∈ U) : W x = standardTensor J + ddc J τ x := by + dsimp [W] + rw [ddc_add J (contDiff_norm_sq ℝ).contDiffAt (hτ x hx).1, ddc_norm_sq J hsk] + have hW : ∀ x ∈ U, ContDiffAt ℝ ∞ W x := fun x hx => + contDiffAt_ddc J ((contDiff_norm_sq ℝ).contDiffAt.add (hτ x hx).1) + have hWi : ∀ x ∈ U, ∀ s ∈ Icc (0 : ℝ) 1, (W x + s • exteriorD γ x).IsInvertible := by + intro x hx s hs + apply isInvertible_of_positive_complex_line _ J + intro a ha + rw [hnorm x hx, hdiff x hx] + simp only [add_apply, smul_apply, sub_apply, smul_eq_mul, + standardTensor_complex_line J hJ] + have hn : 0 < ‖a‖^2 := sq_pos_of_pos (norm_pos_iff.mpr ha) + have h₀ := mul_nonneg (sub_nonneg.mpr hs.2) ((hτ x hx).2 a) + have h₁ := mul_nonneg hs.1 ((hT x hx).2 a) + nlinarith + obtain ⟨F, hF, hFi, hout, hmap, hpull⟩ := Moser.compactlySupported_deformation hU hW + (fun x _ a b => ddc_skew J _ x a b) + (fun x hx a b c => ddc_closed J ((contDiff_norm_sq ℝ).contDiffAt.add (hτ x hx).1) a b c) + hγ hcγ (hsγ.trans hCU) hWi + refine ⟨F.symm, hFi, hF, ?_, ?_, ?_⟩ + · intro x hx + exact (F.symm_apply_eq.mpr (hout x hx).symm) + · intro x + simpa using (hmap (F.symm x)).symm + · intro x hx a b + have hix : F.symm x ∈ U := (hmap (F.symm x)).mp (by simpa using hx) + have hh := hpull (F.symm x) hix (fderiv ℝ (F.symm : E → E) x a) + (fderiv ℝ (F.symm : E → E) x b) + rw [F.apply_symm_apply, fderiv_homeomorph_apply_symm F hF hFi, + fderiv_homeomorph_apply_symm F hF hFi, hnorm x hx, hdiff x hx] at hh + have hend : standardTensor J + ddc J τ x + (ddc J T x - ddc J τ x) = + ddc J (fun y => ‖y‖^2 + T y) x := by + rw [ddc_add J (contDiff_norm_sq ℝ).contDiffAt (hT x hx).1, ddc_norm_sq J hsk] + abel + rw [hend] at hh + exact hh.symm + +end +end ComplexPotential + +namespace ComplexPotential + +open TensorCalculus Set Filter +open scoped ContDiff Topology + +variable {E : Type u33} [NormedAddCommGroup E] [NormedSpace ℝ E] + +noncomputable section + +theorem dc_scalar_comp (J : E →L[ℝ] E) {φ : E → ℝ} {h : ℝ → ℝ} {x : E} + (hφ : DifferentiableAt ℝ φ x) (hh : DifferentiableAt ℝ h (φ x)) : + dc J (h ∘ φ) x = deriv h (φ x) • dc J φ x := by + have hd := (hh.hasDerivAt.comp_hasFDerivAt x hφ.hasFDerivAt).fderiv + ext a + rw [dc_apply, hd] + simp only [smul_apply, smul_eq_mul, dc_apply] + ring + +theorem exteriorD_smul_one {γ : E → E →L[ℝ] ℝ} {s : E → ℝ} {x : E} + (hs : DifferentiableAt ℝ s x) (hγ : DifferentiableAt ℝ γ x) (a b : E) : + exteriorD (fun y => s y • γ y) x a b = s x * exteriorD γ x a b + + fderiv ℝ s x a * γ x b - fderiv ℝ s x b * γ x a := by + simp only [exteriorD_apply, fderiv_fun_smul hs hγ, add_apply, smul_apply, + ContinuousLinearMap.smulRight_apply, smul_eq_mul] + ring + +theorem ddc_scalar_comp (J : E →L[ℝ] E) {φ : E → ℝ} {h : ℝ → ℝ} {x : E} + (hφ : ContDiffAt ℝ ∞ φ x) (hh : ContDiffAt ℝ ∞ h (φ x)) (a b : E) : + ddc J (h ∘ φ) x a b = deriv h (φ x) * ddc J φ x a b + + deriv (deriv h) (φ x) * + (fderiv ℝ φ x b * fderiv ℝ φ x (J a) - + fderiv ℝ φ x a * fderiv ℝ φ x (J b)) / 4 := by + have h1 : (1 : ℕ∞ω) ≤ ∞ := WithTop.coe_le_coe.mpr le_top + have he : dc J (h ∘ φ) =ᶠ[𝓝 x] fun y => deriv h (φ y) • dc J φ y := by + filter_upwards [(hφ.of_le h1).eventually (by simp), + hφ.continuousAt ((hh.of_le h1).eventually (by simp))] with y hy hz + exact dc_scalar_comp J (hy.differentiableAt one_ne_zero) + ((show ContDiffAt ℝ (1 : ℕ∞ω) h (φ y) from hz).differentiableAt one_ne_zero) + have hdh := (hh.derivWithin (m := ∞) (by simp)).differentiableAt (by simp) + have hs : DifferentiableAt ℝ (fun y => deriv h (φ y)) x := + hdh.comp x (hφ.differentiableAt (by simp)) + have hd : fderiv ℝ (fun y => deriv h (φ y)) x = + deriv (deriv h) (φ x) • fderiv ℝ φ x := + (hdh.hasDerivAt.comp_hasFDerivAt x (hφ.differentiableAt (by simp)).hasFDerivAt).fderiv + have heD : exteriorD (dc J (h ∘ φ)) x = + exteriorD (fun y => deriv h (φ y) • dc J φ y) x := by + unfold exteriorD + rw [he.fderiv_eq] + rw [ddc, heD, exteriorD_smul_one hs ((contDiffAt_dc J hφ).differentiableAt (by simp))] + rw [hd] + simp only [smul_apply, smul_eq_mul, dc_apply] + change _ = deriv h (φ x) * exteriorD (dc J φ) x a b + _ + ring + +theorem ddc_scalar_comp_complex_line (J : E →L[ℝ] E) (hJ : ∀ a, J (J a) = -a) + {φ : E → ℝ} {h : ℝ → ℝ} {x : E} + (hφ : ContDiffAt ℝ ∞ φ x) (hh : ContDiffAt ℝ ∞ h (φ x)) (a : E) : + ddc J (h ∘ φ) x a (J a) = deriv h (φ x) * ddc J φ x a (J a) + + deriv (deriv h) (φ x) * ((fderiv ℝ φ x a)^2 + (fderiv ℝ φ x (J a))^2) / 4 := by + rw [ddc_scalar_comp J hφ hh, hJ, map_neg] + ring + +theorem IsPSHAt.scalar_comp (J : E →L[ℝ] E) (hJ : ∀ a, J (J a) = -a) + {φ : E → ℝ} {h : ℝ → ℝ} {x : E} (hφ : IsPSHAt J φ x) + (hh : ContDiffAt ℝ ∞ h (φ x)) (hmono : 0 ≤ deriv h (φ x)) + (hconv : 0 ≤ deriv (deriv h) (φ x)) : IsPSHAt J (h ∘ φ) x := by + refine ⟨hh.comp x hφ.1, fun a => ?_⟩ + rw [ddc_scalar_comp_complex_line J hJ hφ.1 hh] + exact add_nonneg (mul_nonneg hmono (hφ.2 a)) + (div_nonneg (mul_nonneg hconv (add_nonneg (sq_nonneg _) (sq_nonneg _))) (by norm_num)) + +end +end ComplexPotential + +namespace ComplexPotential + +variable {E : Type u34} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +theorem complex_line_inner_sq_le (J : E →L[ℝ] E) + (hsk : ∀ a b, inner (𝕜 := ℝ) a (J b) = -inner (𝕜 := ℝ) (J a) b) + (hJ : ∀ a, ‖J a‖ = ‖a‖) (x a : E) : + (inner (𝕜 := ℝ) x a)^2 + (inner (𝕜 := ℝ) x (J a))^2 ≤ ‖x‖^2 * ‖a‖^2 := by + let p := inner (𝕜 := ℝ) x a + let q := inner (𝕜 := ℝ) x (J a) + have hxa : inner (𝕜 := ℝ) (J x) a = -q := by + dsimp [q] + linarith [hsk x a] + have hxj : inner (𝕜 := ℝ) x (J x) = 0 := by + linarith [hsk x x, real_inner_comm x (J x)] + have hjx : inner (𝕜 := ℝ) (J x) x = 0 := by rw [real_inner_comm, hxj] + let w := p • x - q • J x + have hw : inner (𝕜 := ℝ) w a = p^2 + q^2 := by + dsimp [w] + simp only [inner_sub_left, real_inner_smul_left, hxa] + change p * p - q * (-q) = _ + ring + have hww : inner (𝕜 := ℝ) w w = (p^2 + q^2) * ‖x‖^2 := by + dsimp [w] + simp only [inner_sub_left, inner_sub_right, real_inner_smul_left, + real_inner_smul_right, hxj, hjx] + rw [real_inner_self_eq_norm_sq, real_inner_self_eq_norm_sq, hJ] + ring + have hcs := real_inner_mul_inner_self_le w a + rw [hw, hww, real_inner_self_eq_norm_sq] at hcs + change p^2 + q^2 ≤ ‖x‖^2 * ‖a‖^2 + rcases eq_or_lt_of_le (add_nonneg (sq_nonneg p) (sq_nonneg q)) with hs | hs + · rw [← hs] + positivity + · exact (mul_le_mul_iff_right₀ hs).mp (by nlinarith [hcs]) + +end ComplexPotential + +namespace ComplexPotential + +open Set Filter +open scoped ContDiff Topology + +noncomputable section + +@[simp] theorem deriv_log_add (δ t : ℝ) : + deriv (fun s => Real.log (s + δ)) t = (t + δ)⁻¹ := by + rw [deriv_comp_add_const, Real.deriv_log] + +theorem second_deriv_log_add (δ t : ℝ) (ht : t + δ ≠ 0) : + deriv (deriv (fun s => Real.log (s + δ))) t = -1 / (t + δ)^2 := by + have he : deriv (fun s => Real.log (s + δ)) = fun t => (t + δ)⁻¹ := + funext (deriv_log_add δ) + rw [he] + exact ((hasDerivAt_id t).add_const δ |>.inv ht).deriv + +variable {E : Type u35} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +def logNormSq (δ : ℝ) (x : E) : ℝ := Real.log (‖x‖^2 + δ) + +theorem contDiffAt_logNormSq (δ : ℝ) {x : E} (hx : ‖x‖^2 + δ ≠ 0) : + ContDiffAt ℝ ∞ (logNormSq δ) x := + ((contDiff_norm_sq ℝ).contDiffAt.add contDiffAt_const).log hx + +theorem ddc_logNormSq_complex_line (J : E →L[ℝ] E) + (hsk : ∀ a b, inner (𝕜 := ℝ) a (J b) = -inner (𝕜 := ℝ) (J a) b) + (hJ : ∀ a, ‖J a‖ = ‖a‖) (hJJ : ∀ a, J (J a) = -a) + (δ : ℝ) {x : E} (hx : ‖x‖^2 + δ ≠ 0) (a : E) : + ddc J (logNormSq δ) x a (J a) = ‖a‖^2 / (‖x‖^2 + δ) - + ((inner (𝕜 := ℝ) x a)^2 + (inner (𝕜 := ℝ) x (J a))^2) / (‖x‖^2 + δ)^2 := by + have hl : ContDiffAt ℝ ∞ (fun t : ℝ => Real.log (t + δ)) (‖x‖^2) := + (contDiffAt_id.add contDiffAt_const).log hx + have he := ddc_scalar_comp_complex_line J hJJ (contDiff_norm_sq ℝ).contDiffAt hl a + rw [ddc_norm_sq J hsk, standardTensor_complex_line J hJ, + deriv_log_add, second_deriv_log_add δ _ hx, fderiv_norm_sq_apply] at he + simp only [smul_apply, innerSL_apply_apply] at he + change ddc J (logNormSq δ) x a (J a) = _ at he + rw [he] + ring + +theorem isPSHAt_logNormSq (J : E →L[ℝ] E) + (hsk : ∀ a b, inner (𝕜 := ℝ) a (J b) = -inner (𝕜 := ℝ) (J a) b) + (hJ : ∀ a, ‖J a‖ = ‖a‖) (hJJ : ∀ a, J (J a) = -a) + {δ : ℝ} (hδ : 0 ≤ δ) {x : E} (hx : 0 < ‖x‖^2 + δ) : + IsPSHAt J (logNormSq δ) x := by + refine ⟨contDiffAt_logNormSq δ hx.ne', fun a => ?_⟩ + rw [ddc_logNormSq_complex_line J hsk hJ hJJ δ hx.ne'] + have hineq := complex_line_inner_sq_le J hsk hJ x a + have hnum : (inner (𝕜 := ℝ) x a)^2 + (inner (𝕜 := ℝ) x (J a))^2 ≤ + ‖a‖^2 * (‖x‖^2 + δ) := by + nlinarith [mul_nonneg (sq_nonneg ‖a‖) hδ] + apply sub_nonneg.mpr + apply (div_le_div_iff₀ (sq_pos_of_pos hx) hx).mpr + nlinarith [mul_le_mul_of_nonneg_right hnum hx.le] + +end +end ComplexPotential + +end LowerBoundInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/PotentialForms.lean b/lean/OAI/Geometry/PolarProducts/PotentialForms.lean new file mode 100644 index 0000000000000000000000000000000000000000..c3970ca558f2f42f9ed85443094af65946c7b484 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/PotentialForms.lean @@ -0,0 +1,308 @@ +import OAI.Geometry.PolarProducts.MoserFlow + +namespace OAI + +universe u27 u28 u29 + +section LowerBoundInline +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter Metric +open scoped Topology ContDiff +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal +open Set Filter Function +open scoped Topology ContDiff +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter +open scoped Topology ContDiff +open Set Filter Function +open scoped Topology ContDiff + +namespace ComplexPotential + +open TensorCalculus Set Filter +open scoped Topology ContDiff + +variable {E : Type u27} [NormedAddCommGroup E] [NormedSpace ℝ E] + +noncomputable section + +local instance oneTensorGroup : NormedAddCommGroup (E →L[ℝ] ℝ) := inferInstance +local instance oneTensorSpace : NormedSpace ℝ (E →L[ℝ] ℝ) := inferInstance +local instance twoTensorGroup : NormedAddCommGroup (E →L[ℝ] E →L[ℝ] ℝ) := inferInstance +local instance twoTensorSpace : NormedSpace ℝ (E →L[ℝ] E →L[ℝ] ℝ) := inferInstance + +def dcOp (J : E →L[ℝ] E) : (E →L[ℝ] ℝ) →L[ℝ] E →L[ℝ] ℝ := + (-1 / 4 : ℝ) • (ContinuousLinearMap.compL ℝ E E ℝ).flip J + +def dc (J : E →L[ℝ] E) (φ : E → ℝ) (x : E) : E →L[ℝ] ℝ := + dcOp J (fderiv ℝ φ x) + +def ddc (J : E →L[ℝ] E) (φ : E → ℝ) : E → TwoTensor E := exteriorD (dc J φ) + +@[simp] theorem dcOp_apply (J : E →L[ℝ] E) (L : E →L[ℝ] ℝ) (a : E) : + dcOp J L a = -(L (J a)) / 4 := by + simp only [dcOp, smul_apply, ContinuousLinearMap.flip_apply, + ContinuousLinearMap.compL_apply, ContinuousLinearMap.comp_apply, smul_eq_mul] + ring + +@[simp] theorem dc_apply (J : E →L[ℝ] E) (φ : E → ℝ) (x a : E) : + dc J φ x a = -(fderiv ℝ φ x (J a)) / 4 := dcOp_apply J _ a + +theorem contDiffAt_dc (J : E →L[ℝ] E) {φ : E → ℝ} {x : E} + (hφ : ContDiffAt ℝ ∞ φ x) : ContDiffAt ℝ ∞ (dc J φ) x := by + change ContDiffAt ℝ ∞ (dcOp J ∘ fderiv ℝ φ) x + exact (dcOp J).contDiff.contDiffAt.comp x (hφ.fderiv_right (m := ∞) (by simp)) + +theorem contDiff_dc (J : E →L[ℝ] E) {φ : E → ℝ} + (hφ : ContDiff ℝ ∞ φ) : ContDiff ℝ ∞ (dc J φ) := by + rw [contDiff_iff_contDiffAt] + exact fun x => contDiffAt_dc J (hφ.contDiffAt (x := x)) + +theorem fderiv_dc (J : E →L[ℝ] E) {φ : E → ℝ} {x : E} + (hφ : DifferentiableAt ℝ (fderiv ℝ φ) x) (a b : E) : + fderiv ℝ (dc J φ) x a b = -(fderiv ℝ (fderiv ℝ φ) x a (J b)) / 4 := by + change fderiv ℝ (dcOp J ∘ fderiv ℝ φ) x a b = _ + rw [fderiv_comp x (dcOp J).differentiableAt hφ] + simp + +theorem ddc_apply (J : E →L[ℝ] E) {φ : E → ℝ} {x : E} + (hφ : DifferentiableAt ℝ (fderiv ℝ φ) x) (a b : E) : + ddc J φ x a b = + (fderiv ℝ (fderiv ℝ φ) x b (J a) - fderiv ℝ (fderiv ℝ φ) x a (J b)) / 4 := by + simp only [ddc, exteriorD_apply, fderiv_dc J hφ] + ring + +theorem ddc_skew (J : E →L[ℝ] E) (φ : E → ℝ) (x a b : E) : + ddc J φ x a b = -ddc J φ x b a := exteriorD_skew _ _ _ _ + +theorem contDiffAt_ddc (J : E →L[ℝ] E) {φ : E → ℝ} {x : E} + (hφ : ContDiffAt ℝ ∞ φ x) : ContDiffAt ℝ ∞ (ddc J φ) x := by + change ContDiffAt ℝ ∞ (alt ∘ fderiv ℝ (dc J φ)) x + exact (alt (E := E)).contDiff.contDiffAt.comp x + ((contDiffAt_dc J hφ).fderiv_right (m := ∞) (by simp)) + +theorem contDiff_ddc (J : E →L[ℝ] E) {φ : E → ℝ} + (hφ : ContDiff ℝ ∞ φ) : ContDiff ℝ ∞ (ddc J φ) := + contDiff_exteriorD (contDiff_dc J hφ) + +theorem ddc_closed (J : E →L[ℝ] E) {φ : E → ℝ} {x : E} + (hφ : ContDiffAt ℝ ∞ φ x) (a b c : E) : + fderiv ℝ (ddc J φ) x a b c + fderiv ℝ (ddc J φ) x b c a + + fderiv ℝ (ddc J φ) x c a b = 0 := exteriorD_closed (contDiffAt_dc J hφ) a b c + +theorem ddc_complex_line (J : E →L[ℝ] E) (hJ : ∀ a, J (J a) = -a) + {φ : E → ℝ} {x : E} (hφ : DifferentiableAt ℝ (fderiv ℝ φ) x) (a : E) : + ddc J φ x a (J a) = + (fderiv ℝ (fderiv ℝ φ) x a a + fderiv ℝ (fderiv ℝ φ) x (J a) (J a)) / 4 := by + rw [ddc_apply J hφ, hJ] + simp only [map_neg] + ring + +def IsPSHAt (J : E →L[ℝ] E) (φ : E → ℝ) (x : E) : Prop := + ContDiffAt ℝ ∞ φ x ∧ ∀ a, 0 ≤ ddc J φ x a (J a) + +theorem dc_congr (J : E →L[ℝ] E) {φ ψ : E → ℝ} {x : E} + (h : φ =ᶠ[𝓝 x] ψ) : dc J φ x = dc J ψ x := by + rw [dc, dc, h.fderiv_eq] + +theorem ddc_congr (J : E →L[ℝ] E) {φ ψ : E → ℝ} {x : E} + (h : φ =ᶠ[𝓝 x] ψ) : ddc J φ x = ddc J ψ x := by + have he : dc J φ =ᶠ[𝓝 x] dc J ψ := h.eventuallyEq_nhds.mono (fun y hy => dc_congr J hy) + simpa only [ddc, exteriorD] using congrArg alt he.fderiv_eq + +theorem dc_add (J : E →L[ℝ] E) {φ ψ : E → ℝ} {x : E} + (hφ : DifferentiableAt ℝ φ x) (hψ : DifferentiableAt ℝ ψ x) : + dc J (fun y => φ y + ψ y) x = dc J φ x + dc J ψ x := by + simp only [dc, fderiv_fun_add hφ hψ, map_add] + +theorem ddc_add (J : E →L[ℝ] E) {φ ψ : E → ℝ} {x : E} + (hφ : ContDiffAt ℝ ∞ φ x) (hψ : ContDiffAt ℝ ∞ ψ x) : + ddc J (fun y => φ y + ψ y) x = ddc J φ x + ddc J ψ x := by + have h1 : (1 : ℕ∞ω) ≤ ∞ := WithTop.coe_le_coe.mpr le_top + have he : dc J (fun y => φ y + ψ y) =ᶠ[𝓝 x] fun y => dc J φ y + dc J ψ y := by + filter_upwards [(hφ.of_le h1).eventually (by simp), + (hψ.of_le h1).eventually (by simp)] with y hy hz + exact dc_add J (hy.differentiableAt (by simp)) (hz.differentiableAt (by simp)) + unfold ddc exteriorD + rw [he.fderiv_eq, fderiv_fun_add + ((contDiffAt_dc J hφ).differentiableAt (by simp)) + ((contDiffAt_dc J hψ).differentiableAt (by simp)), map_add] + +end +end ComplexPotential + +namespace ComplexPotential + +open TensorCalculus +open scoped ContDiff Topology + +variable {E : Type u28} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +noncomputable section + +def standardTensor (J : E →L[ℝ] E) : TwoTensor E := (innerSL ℝ).comp J + +@[simp] theorem standardTensor_apply (J : E →L[ℝ] E) (a b : E) : + standardTensor J a b = inner (𝕜 := ℝ) (J a) b := rfl + +theorem dc_norm_sq (J : E →L[ℝ] E) + (hsk : ∀ a b, inner (𝕜 := ℝ) a (J b) = -inner (𝕜 := ℝ) (J a) b) (x : E) : + dc J (fun x : E => ‖x‖^2) x = (1 / 2 : ℝ) • standardTensor J x := by + ext a + rw [dc_apply, fderiv_norm_sq_apply] + simp only [smul_apply, smul_eq_mul, innerSL_apply_apply, standardTensor_apply] + rw [hsk] + ring + +theorem ddc_norm_sq (J : E →L[ℝ] E) + (hsk : ∀ a b, inner (𝕜 := ℝ) a (J b) = -inner (𝕜 := ℝ) (J a) b) (x : E) : + ddc J (fun x : E => ‖x‖^2) x = standardTensor J := by + have he : dc J (fun x : E => ‖x‖^2) = fun x => (1 / 2 : ℝ) • standardTensor J x := + funext (dc_norm_sq J hsk) + apply ContinuousLinearMap.ext + intro a + apply ContinuousLinearMap.ext + intro b + rw [ddc, he, exteriorD_apply] + have hd : fderiv ℝ (fun x => (1 / 2 : ℝ) • standardTensor J x) x = + (1 / 2 : ℝ) • standardTensor J := by + exact ((standardTensor J).hasFDerivAt.const_smul (1 / 2 : ℝ)).fderiv + rw [hd] + simp only [smul_apply, smul_eq_mul, standardTensor_apply] + have hh : inner (𝕜 := ℝ) (J b) a = -inner (𝕜 := ℝ) (J a) b := by + rw [real_inner_comm, hsk] + rw [hh] + ring + +theorem standardTensor_complex_line (J : E →L[ℝ] E) (hJ : ∀ a, ‖J a‖ = ‖a‖) (a : E) : + standardTensor J a (J a) = ‖a‖^2 := by + rw [standardTensor_apply, real_inner_self_eq_norm_sq, hJ] + +theorem isInvertible_of_positive_complex_line [FiniteDimensional ℝ E] + (B : TwoTensor E) (J : E →L[ℝ] E) (hp : ∀ a : E, a ≠ 0 → 0 < B a (J a)) : + B.IsInvertible := by + have hi : Function.Injective B := by + intro a b hab + have hz : B (a - b) = 0 := by rw [map_sub, hab, sub_self] + by_contra hn + have hpos := hp (a - b) (sub_ne_zero.mpr hn) + rw [hz, zero_apply] at hpos + exact (lt_irrefl 0) hpos + let e := (InnerProductSpace.toDual ℝ E).toContinuousLinearEquiv + let L : E →L[ℝ] E := e.symm.toContinuousLinearMap.comp B + have hL : Function.Injective L := e.symm.injective.comp hi + have hsL : Function.Surjective L := LinearMap.surjective_of_injective hL + have hs : Function.Surjective B := by + intro v + obtain ⟨x, hx⟩ := hsL (e.symm v) + refine ⟨x, ?_⟩ + exact e.symm.injective hx + exact ⟨ContinuousLinearEquiv.ofBijective B (LinearMap.ker_eq_bot.mpr hi) + (LinearMap.range_eq_top.mpr hs), rfl⟩ + +theorem isInvertible_ddc_norm_sq_add [FiniteDimensional ℝ E] + (J : E →L[ℝ] E) (hsk : ∀ a b, inner (𝕜 := ℝ) a (J b) = -inner (𝕜 := ℝ) (J a) b) + (hJ : ∀ a, ‖J a‖ = ‖a‖) {φ : E → ℝ} {x : E} (hφ : IsPSHAt J φ x) : + (ddc J (fun y => ‖y‖^2 + φ y) x).IsInvertible := by + apply isInvertible_of_positive_complex_line _ J + intro a ha + rw [ddc_add J (contDiff_norm_sq ℝ).contDiffAt hφ.1, add_apply, add_apply, + ddc_norm_sq J hsk, standardTensor_complex_line J hJ] + exact add_pos_of_pos_of_nonneg (sq_pos_of_pos (norm_pos_iff.mpr ha)) (hφ.2 a) + +end +end ComplexPotential + +namespace ComplexPotential + +open TensorCalculus Set Filter +open scoped ContDiff Topology + +variable {E : Type u29} [NormedAddCommGroup E] [NormedSpace ℝ E] + +noncomputable section + +local instance linearOneGroup : NormedAddCommGroup (E →L[ℝ] ℝ) := inferInstance +local instance linearOneSpace : NormedSpace ℝ (E →L[ℝ] ℝ) := inferInstance +local instance linearTwoGroup : NormedAddCommGroup (E →L[ℝ] E →L[ℝ] ℝ) := inferInstance +local instance linearTwoSpace : NormedSpace ℝ (E →L[ℝ] E →L[ℝ] ℝ) := inferInstance + +@[simp] theorem dc_const (J : E →L[ℝ] E) (c : ℝ) (x : E) : + dc J (fun _ => c) x = 0 := by + simp [dc] + +@[simp] theorem ddc_const (J : E →L[ℝ] E) (c : ℝ) (x : E) : + ddc J (fun _ => c) x = 0 := by + simp [ddc, exteriorD, show dc J (fun _ : E => c) = fun _ => 0 by funext y; simp] + +theorem dc_const_smul (J : E →L[ℝ] E) (c : ℝ) {φ : E → ℝ} {x : E} + (hφ : DifferentiableAt ℝ φ x) : + dc J (fun y => c * φ y) x = c • dc J φ x := by + ext a + rw [dc_apply, fderiv_const_mul hφ] + simp only [smul_apply, smul_eq_mul, dc_apply] + ring + +theorem ddc_const_smul (J : E →L[ℝ] E) (c : ℝ) {φ : E → ℝ} {x : E} + (hφ : ContDiffAt ℝ ∞ φ x) : + ddc J (fun y => c * φ y) x = c • ddc J φ x := by + have h1 : (1 : ℕ∞ω) ≤ ∞ := WithTop.coe_le_coe.mpr le_top + have he : dc J (fun y => c * φ y) =ᶠ[𝓝 x] fun y => c • dc J φ y := by + filter_upwards [(hφ.of_le h1).eventually (by simp)] with y hy + exact dc_const_smul J c (hy.differentiableAt one_ne_zero) + unfold ddc exteriorD + rw [he.fderiv_eq] + have hd : fderiv ℝ (fun y => c • dc J φ y) x = c • fderiv ℝ (dc J φ) x := + (((contDiffAt_dc J hφ).differentiableAt (by simp)).hasFDerivAt.const_smul c).fderiv + rw [hd, map_smul] + +theorem ddc_neg (J : E →L[ℝ] E) {φ : E → ℝ} {x : E} + (hφ : ContDiffAt ℝ ∞ φ x) : + ddc J (fun y => -φ y) x = -ddc J φ x := by + simpa only [neg_one_mul, neg_one_smul] using ddc_const_smul J (-1) hφ + +theorem ddc_sub (J : E →L[ℝ] E) {φ ψ : E → ℝ} {x : E} + (hφ : ContDiffAt ℝ ∞ φ x) (hψ : ContDiffAt ℝ ∞ ψ x) : + ddc J (fun y => φ y - ψ y) x = ddc J φ x - ddc J ψ x := by + simp_rw [sub_eq_add_neg] + rw [ddc_add J hφ hψ.neg, ddc_neg J hψ] + +theorem ddc_add_const (J : E →L[ℝ] E) {φ : E → ℝ} {x : E} + (hφ : ContDiffAt ℝ ∞ φ x) (c : ℝ) : + ddc J (fun y => φ y + c) x = ddc J φ x := by + rw [ddc_add J hφ contDiffAt_const, ddc_const, add_zero] + +theorem ddc_sub_const (J : E →L[ℝ] E) {φ : E → ℝ} {x : E} + (hφ : ContDiffAt ℝ ∞ φ x) (c : ℝ) : + ddc J (fun y => φ y - c) x = ddc J φ x := by + rw [ddc_sub J hφ contDiffAt_const, ddc_const, sub_zero] + +theorem IsPSHAt.add {J : E →L[ℝ] E} {φ ψ : E → ℝ} {x : E} + (hφ : IsPSHAt J φ x) (hψ : IsPSHAt J ψ x) : + IsPSHAt J (fun y => φ y + ψ y) x := by + refine ⟨hφ.1.add hψ.1, fun a => ?_⟩ + rw [ddc_add J hφ.1 hψ.1, add_apply, add_apply] + exact add_nonneg (hφ.2 a) (hψ.2 a) + +theorem IsPSHAt.const_smul {J : E →L[ℝ] E} {φ : E → ℝ} {x : E} + (hφ : IsPSHAt J φ x) {c : ℝ} (hc : 0 ≤ c) : + IsPSHAt J (fun y => c * φ y) x := by + refine ⟨contDiffAt_const.mul hφ.1, fun a => ?_⟩ + rw [ddc_const_smul J c hφ.1] + simpa only [smul_apply, smul_eq_mul] using mul_nonneg hc (hφ.2 a) + +theorem IsPSHAt.sub_const {J : E →L[ℝ] E} {φ : E → ℝ} {x : E} + (hφ : IsPSHAt J φ x) (c : ℝ) : IsPSHAt J (fun y => φ y - c) x := by + refine ⟨hφ.1.sub contDiffAt_const, fun a => ?_⟩ + rw [ddc_sub_const J hφ.1 c] + exact hφ.2 a + +end +end ComplexPotential + +end LowerBoundInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/QuadraticAction.lean b/lean/OAI/Geometry/PolarProducts/QuadraticAction.lean new file mode 100644 index 0000000000000000000000000000000000000000..8d73bb6c834f166bf721870f1dd6952beeb5b354 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/QuadraticAction.lean @@ -0,0 +1,330 @@ +import OAI.Geometry.PolarProducts.FourierPaths + +namespace OAI + +universe u112 + +section NonsqueezingInline + +namespace DiagonalQuadratic +noncomputable section +open Finset +open scoped ComplexConjugate ContDiff +variable {α : Type u112} [Fintype α] + + def diag (w : α → ℝ) (a : EuclideanSpace ℂ α) : EuclideanSpace ℂ α := + (EuclideanSpace.equiv α ℂ).symm (fun p => w p • a p) + +omit [Fintype α] in +@[simp] theorem diag_apply (w : α → ℝ) (a : EuclideanSpace ℂ α) (p : α) : + diag w a p = w p • a p := rfl + + def diagCLM (w : α → ℝ) : EuclideanSpace ℂ α →L[ℝ] EuclideanSpace ℂ α := + LinearMap.toContinuousLinearMap { + toFun := diag w + map_add' := by intros; ext; simp [smul_add] + map_smul' := by intros; ext; simp; ring } + +@[simp] theorem diagCLM_apply (w : α → ℝ) (a : EuclideanSpace ℂ α) : diagCLM w a = diag w a := rfl + + theorem real_inner_eq_sum (a b : EuclideanSpace ℂ α) : + inner (𝕜 := ℝ) a b = ∑ p, inner (𝕜 := ℝ) (a p) (b p) := by + exact PiLp.inner_apply a b + + theorem inner_diag (w : α → ℝ) (a b : EuclideanSpace ℂ α) : + inner (𝕜 := ℝ) (diag w a) b = ∑ p, w p * inner (𝕜 := ℝ) (a p) (b p) := by + rw [real_inner_eq_sum] + simp only [diag_apply, real_inner_smul_left] + + theorem self_adjoint (w : α → ℝ) (a b : EuclideanSpace ℂ α) : + inner (𝕜 := ℝ) (diag w a) b = inner (𝕜 := ℝ) a (diag w b) := by + rw [inner_diag, real_inner_eq_sum] + simp only [diag_apply, real_inner_smul_right] + + def energy (w : α → ℝ) (a : EuclideanSpace ℂ α) : ℝ := ∑ p, w p * ‖a p‖^2 + + theorem energy_eq_inner (w : α → ℝ) (a : EuclideanSpace ℂ α) : + energy w a = inner (𝕜 := ℝ) (diag w a) a := by + rw [inner_diag] + simp only [energy, real_inner_self_eq_norm_sq] + + theorem contDiff_energy (w : α → ℝ) : ContDiff ℝ ∞ (energy w) := by + simp_rw [funext (energy_eq_inner w)] + exact (diagCLM w).contDiff.inner ℝ contDiff_id + + theorem hasGradientAt_energy (w : α → ℝ) (a : EuclideanSpace ℂ α) : + HasGradientAt (energy w) ((2 : ℝ) • diag w a) a := by + rw [hasGradientAt_iff_hasFDerivAt] + have h := (diagCLM w).hasFDerivAt.inner ℝ (hasFDerivAt_id a) + simp only [diagCLM_apply] at h + change HasFDerivAt (fun x => inner (𝕜 := ℝ) (diag w x) x) _ a at h + simp_rw [← energy_eq_inner] at h + apply h.congr_fderiv + ext b + change inner (𝕜 := ℝ) (diag w a) b + inner (𝕜 := ℝ) (diag w b) a = + inner (𝕜 := ℝ) ((2 : ℝ) • diag w a) b + rw [real_inner_smul_left, self_adjoint w b a] + rw [real_inner_comm b (diag w a)] + ring + + theorem gradient_energy (w : α → ℝ) (a : EuclideanSpace ℂ α) : + gradient (energy w) a = (2 : ℝ) • diag w a := (hasGradientAt_energy w a).gradient + + theorem norm_diag_sq (w : α → ℝ) (a : EuclideanSpace ℂ α) : + ‖diag w a‖^2 = ∑ p, (w p)^2*‖a p‖^2 := by + simp only [EuclideanSpace.norm_sq_eq, diag_apply, norm_smul, mul_pow, Real.norm_eq_abs, + sq_abs] + + theorem norm_diag_lower (w : α → ℝ) {d : ℝ} (hd : 0 ≤ d) (hw : ∀ p, d ≤ |w p|) + (a : EuclideanSpace ℂ α) : d*‖a‖ ≤ ‖diag w a‖ := by + have h : (d*‖a‖)^2 ≤ ‖diag w a‖^2 := by + rw [mul_pow, norm_diag_sq, EuclideanSpace.norm_sq_eq, mul_sum] + apply sum_le_sum + intro p _ + apply mul_le_mul_of_nonneg_right _ (sq_nonneg _) + calc + d^2 ≤ |w p|^2 := pow_le_pow_left₀ hd (hw p) 2 + _ = _ := sq_abs _ + nlinarith [norm_nonneg (diag w a), mul_nonneg hd (norm_nonneg a)] + + theorem norm_diag_upper (w : α → ℝ) {d : ℝ} (hd : 0 ≤ d) (hw : ∀ p, |w p| ≤ d) + (a : EuclideanSpace ℂ α) : ‖diag w a‖ ≤ d*‖a‖ := by + have h : ‖diag w a‖^2 ≤ (d*‖a‖)^2 := by + rw [mul_pow, norm_diag_sq, EuclideanSpace.norm_sq_eq, mul_sum] + apply sum_le_sum + intro p _ + apply mul_le_mul_of_nonneg_right _ (sq_nonneg _) + calc + (w p)^2 = |w p|^2 := (sq_abs _).symm + _ ≤ _ := pow_le_pow_left₀ (abs_nonneg _) (hw p) 2 + nlinarith [norm_nonneg (diag w a), mul_nonneg hd (norm_nonneg a)] + + theorem energy_smul (w : α → ℝ) (r : ℝ) (a : EuclideanSpace ℂ α) : + energy w (r • a) = r^2*energy w a := by + simp only [energy, PiLp.smul_apply, norm_smul, Real.norm_eq_abs, mul_pow, sq_abs, + mul_sum] + apply sum_congr rfl + intro p _ + ring + + theorem energy_mul (w : α → ℝ) (r : ℝ) (a : EuclideanSpace ℂ α) : + energy (fun p => r*w p) a = r*energy w a := by + simp only [energy, mul_sum, mul_assoc] + + theorem energy_lower (w : α → ℝ) (d : ℝ) (hw : ∀ p, d ≤ w p) + (a : EuclideanSpace ℂ α) : d*‖a‖^2 ≤ energy w a := by + simp only [EuclideanSpace.norm_sq_eq, mul_sum, energy] + exact sum_le_sum (fun p _ => mul_le_mul_of_nonneg_right (hw p) (sq_nonneg _)) + + theorem energy_nonpos (w : α → ℝ) (hw : ∀ p, w p ≤ 0) + (a : EuclideanSpace ℂ α) : energy w a ≤ 0 := + sum_nonpos (fun p _ => mul_nonpos_of_nonpos_of_nonneg (hw p) (sq_nonneg _)) + + theorem energy_single [DecidableEq α] (w : α → ℝ) (p : α) (z : ℂ) : + energy w (PiLp.single 2 p z) = w p * ‖z‖^2 := by + classical + unfold energy + rw [sum_eq_single p] + · simp + · intro q _ hq + simp [hq] + · simp + +end +end DiagonalQuadratic + +namespace FourierPolynomial +noncomputable section +open MeasureTheory AddCircle Finset +open scoped ComplexConjugate ContDiff +local instance : Fact (0 < (1 : ℝ)) := ⟨zero_lt_one⟩ +variable {ι κ : Type} [Fintype ι] [Fintype κ] +open DiagonalQuadratic + + def action (k : ι → ℤ) (H : Vector κ → ℝ) (a : Coeff ι κ) : ℝ := + energy (fun p => Real.pi*(k p.1 : ℝ)) a - potential k H a + + theorem contDiff_action (k : ι → ℤ) {H : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) : + ContDiff ℝ ∞ (action k H) := + (contDiff_energy _).sub (contDiff_potential k hH) + + theorem hasGradientAt_action (k : ι → ℤ) {H : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) + (a : Coeff ι κ) : + HasGradientAt (action k H) + ((2 : ℝ) • diag (fun p => Real.pi*(k p.1 : ℝ)) a - project k (gradLoop k hH a)) a := by + have h := (hasGradientAt_energy (fun p : ι × κ => Real.pi*(k p.1 : ℝ)) a).hasFDerivAt.sub + (hasGradientAt_potential k hH a).hasFDerivAt + rw [hasGradientAt_iff_hasFDerivAt] + change HasFDerivAt (action k H) _ a at h + apply h.congr_fderiv + ext b + simp only [map_sub] + + theorem gradient_action (k : ι → ℤ) {H : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) + (a : Coeff ι κ) : gradient (action k H) a = + (2 : ℝ) • diag (fun p => Real.pi*(k p.1 : ℝ)) a - project k (gradLoop k hH a) := + (hasGradientAt_action k hH a).gradient + + theorem potential_nonneg (k : ι → ℤ) {H : Vector κ → ℝ} (hH : ∀ z, 0 ≤ H z) + (a : Coeff ι κ) : 0 ≤ potential k H a := integral_nonneg (fun _ => hH _) + + theorem integral_energy (k : ι → ℤ) (hk : Function.Injective k) (d : κ → ℝ) + (a : Coeff ι κ) : + (∫ t : Time, energy d (loop k a t) ∂μ) = energy (fun p => d p.2) a := by + classical + simp only [energy] + rw [integral_finsetSum] + · simp_rw [integral_const_mul, integral_loop_coord_sq k hk, mul_sum] + rw [Fintype.sum_prod_type, sum_comm] + · intro j _ + exact integrable_continuous (continuous_const.mul + ((((PiLp.continuous_apply 2 _ j).comp (loop k a).continuous).norm.pow 2))) + + theorem potential_lower (k : ι → ℤ) (hk : Function.Injective k) {H : Vector κ → ℝ} + (hH : Continuous H) (d : κ → ℝ) (C : ℝ) (hlo : ∀ z, energy d z-C ≤ H z) + (a : Coeff ι κ) : energy (fun p => d p.2) a-C ≤ potential k H a := by + have hi : Integrable (fun t : Time => energy d (loop k a t)) μ := + integrable_continuous ((contDiff_energy d).continuous.comp (loop k a).continuous) + calc + _ = ∫ t : Time, energy d (loop k a t)-C ∂μ := by + rw [integral_sub hi (integrable_const _), integral_energy k hk] + simp + _ ≤ _ := integral_mono (hi.sub (integrable_const _)) + (integrable_continuous (hH.comp (loop k a).continuous)) (fun t => hlo _) + + theorem potential_upper_fourth (k : ι → ℕ) (hk : Function.Injective k) + (hk0 : ∀ i, 0 < k i) {H : Vector κ → ℝ} (hH : Continuous H) + {C : ℝ} (hC : 0 ≤ C) (hup : ∀ z, H z ≤ C*‖z‖^4) (a : Coeff ι κ) : + potential (fun i => (k i : ℤ)) H a ≤ + C*(Fintype.card κ : ℝ)*(∑ p : ι × κ, (k p.1 : ℝ)*‖a p‖^2)^2 := by + calc + _ ≤ ∫ t : Time, C*‖loop (fun i => (k i : ℤ)) a t‖^4 ∂μ := + integral_mono (integrable_continuous (hH.comp (loop _ a).continuous)) + (integrable_continuous (continuous_const.mul ((loop _ a).continuous.norm.pow 4))) + (fun t => hup _) + _ = C*(∫ t : Time, ‖loop (fun i => (k i : ℤ)) a t‖^4 ∂μ) := integral_const_mul _ _ + _ ≤ _ := by simpa only [mul_assoc] using + mul_le_mul_of_nonneg_left (integral_loop_norm_fourth_le k hk hk0 a) hC + +end +end FourierPolynomial + +namespace FourierPolynomial +noncomputable section +open MeasureTheory AddCircle Finset +open scoped ComplexConjugate ContDiff +local instance : Fact (0 < (1 : ℝ)) := ⟨zero_lt_one⟩ +variable {ι κ : Type} [Fintype ι] [Fintype κ] +open DiagonalQuadratic + +omit [Fintype ι] in + theorem project_add (k : ι → ℤ) (f g : C(Time, Vector κ)) : + project k (f+g) = project k f + project k g := by + ext p + change fourierCoeff ((fun t => f t p.2)+(fun t => g t p.2)) (k p.1) = _ + have hf : Integrable (fun t : Time => f t p.2) μ := + integrable_continuous ((PiLp.continuous_apply 2 _ p.2).comp f.continuous) + have hg : Integrable (fun t : Time => g t p.2) μ := + integrable_continuous ((PiLp.continuous_apply 2 _ p.2).comp g.continuous) + rw [fourierCoeff.add hf hg] + rfl + +omit [Fintype ι] in + theorem project_sub (k : ι → ℤ) (f g : C(Time, Vector κ)) : + project k (f-g) = project k f - project k g := by + ext p + simp only [project_apply, ContinuousMap.sub_apply, PiLp.sub_apply, fourierCoeff, + smul_sub] + rw [integral_sub] + · exact integrable_continuous ((fourier (-k p.1)).continuous.smul + ((PiLp.continuous_apply 2 _ p.2).comp f.continuous)) + · exact integrable_continuous ((fourier (-k p.1)).continuous.smul + ((PiLp.continuous_apply 2 _ p.2).comp g.continuous)) + + theorem loop_diag (k : ι → ℤ) (d : κ → ℝ) (a : Coeff ι κ) (t : Time) : + loop k (diag (fun p => d p.2) a) t = diag d (loop k a t) := by + ext j + simp only [loop_coord, eval, diag_apply, RCLike.real_smul_eq_coe_mul, mul_assoc, + ← mul_sum] + + theorem loop_smul (k : ι → ℤ) (r : ℝ) (a : Coeff ι κ) : + loop k (r • a) = r • loop k a := (loopCLM k).map_smul r a + + theorem loop_zero (k : ι → ℤ) : loop k (0 : Coeff ι κ) = 0 := (loopCLM k).map_zero + +end +end FourierPolynomial + +namespace FourierPolynomial +noncomputable section +open MeasureTheory AddCircle Finset +open scoped ComplexConjugate ContDiff +local instance : Fact (0 < (1 : ℝ)) := ⟨zero_lt_one⟩ +variable {ι κ : Type} [Fintype ι] [Fintype κ] +open DiagonalQuadratic + + def remainderLoop (k : ι → ℤ) {H : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) + (d : κ → ℝ) (a : Coeff ι κ) : C(Time, Vector κ) := + gradLoop k hH a - loop k ((2 : ℝ) • diag (fun p => d p.2) a) + + theorem remainderLoop_apply (k : ι → ℤ) {H : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) + (d : κ → ℝ) (a : Coeff ι κ) (t : Time) : + remainderLoop k hH d a t = gradient H (loop k a t)-(2 : ℝ) • diag d (loop k a t) := by + simp only [remainderLoop, ContinuousMap.sub_apply, gradLoop, ContinuousMap.coe_mk, + loop_smul, ContinuousMap.smul_apply, loop_diag] + + theorem gradient_action_remainder (k : ι → ℤ) (hk : Function.Injective k) + {H : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) (d : κ → ℝ) (a : Coeff ι κ) : + gradient (action k H) a = + (2 : ℝ) • diag (fun p => Real.pi*(k p.1 : ℝ)-d p.2) a-project k (remainderLoop k hH d a) := by + rw [gradient_action k hH, remainderLoop, project_sub, project_loop k hk] + have he : diag (fun p : ι × κ => Real.pi*(k p.1 : ℝ)-d p.2) a = + diag (fun p : ι × κ => Real.pi*(k p.1 : ℝ)) a-diag (fun p : ι × κ => d p.2) a := by + ext p + simp only [diag_apply, PiLp.sub_apply, sub_smul] + rw [he, smul_sub] + abel + + theorem norm_gradient_lower (k : ι → ℤ) (hk : Function.Injective k) + {H : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) (d : κ → ℝ) {γ B : ℝ} + (hγ : 0 ≤ γ) (hB : 0 ≤ B) (hgap : ∀ i j, γ ≤ |Real.pi*(k i : ℝ)-d j|) + (hrem : ∀ z, ‖gradient H z-(2 : ℝ) • diag d z‖ ≤ B) (a : Coeff ι κ) : + 2*γ*‖a‖ ≤ ‖gradient (action k H) a‖+B := by + have hb : ‖project k (remainderLoop k hH d a)‖ ≤ B := + project_bounded k hk _ hB (fun t => by rw [remainderLoop_apply]; exact hrem _) + have hd := norm_diag_lower (fun p : ι × κ => Real.pi*(k p.1 : ℝ)-d p.2) hγ + (fun p => hgap p.1 p.2) a + have ht := norm_sub_le (gradient (action k H) a) (-project k (remainderLoop k hH d a)) + rw [sub_neg_eq_add, norm_neg] at ht + have he : gradient (action k H) a + project k (remainderLoop k hH d a) = + (2 : ℝ) • diag (fun p => Real.pi*(k p.1 : ℝ)-d p.2) a := by + rw [gradient_action_remainder k hk hH]; abel + rw [he, norm_smul, Real.norm_eq_abs, abs_of_pos (by norm_num : (0 : ℝ) < 2)] at ht + nlinarith + + theorem gradient_coercive (k : ι → ℤ) (hk : Function.Injective k) + {H : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) (d : κ → ℝ) {γ B : ℝ} + (hγ : 0 < γ) (hB : 0 ≤ B) (hgap : ∀ i j, γ ≤ |Real.pi*(k i : ℝ)-d j|) + (hrem : ∀ z, ‖gradient H z-(2 : ℝ) • diag d z‖ ≤ B) : + ∃ C : ℝ, ∀ a : Coeff ι κ, C ≤ ‖a‖ → 1 ≤ ‖gradient (action k H) a‖ := by + refine ⟨(B+1)/(2*γ), fun a ha => ?_⟩ + have h := norm_gradient_lower k hk hH d hγ.le hB hgap hrem a + have hm := (div_le_iff₀ (mul_pos (by norm_num) hγ)).mp ha + nlinarith + + theorem critical_norm_bound (k : ι → ℤ) (hk : Function.Injective k) + {H : Vector κ → ℝ} (hH : ContDiff ℝ ∞ H) (d : κ → ℝ) {γ B : ℝ} + (hγ : 0 < γ) (hB : 0 ≤ B) (hgap : ∀ i j, γ ≤ |Real.pi*(k i : ℝ)-d j|) + (hrem : ∀ z, ‖gradient H z-(2 : ℝ) • diag d z‖ ≤ B) (a : Coeff ι κ) + (ha : gradient (action k H) a = 0) : ‖a‖ ≤ B/(2*γ) := by + have h := norm_gradient_lower k hk hH d hγ.le hB hgap hrem a + rw [ha, norm_zero, zero_add] at h + rw [le_div_iff₀ (mul_pos (by norm_num) hγ)] + nlinarith + +end +end FourierPolynomial + +end NonsqueezingInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/RadialMap.lean b/lean/OAI/Geometry/PolarProducts/RadialMap.lean new file mode 100644 index 0000000000000000000000000000000000000000..62d5264a24928f7c243d43bc59e5b79de056e683 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/RadialMap.lean @@ -0,0 +1,363 @@ +import OAI.Geometry.PolarProducts.RegularizedMaximum + +namespace OAI + +universe u38 u39 u40 + +section LowerBoundInline +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter Metric +open scoped Topology ContDiff +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal +open Set Filter Function +open scoped Topology ContDiff +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter +open scoped Topology ContDiff +open Set Filter Function +open scoped Topology ContDiff +open Set Filter Function +open scoped ContDiff Topology +open Set MeasureTheory +open scoped ContDiff Interval Topology + +namespace RadialSymplectic + +open Set Filter Function TensorCalculus +open scoped Topology ContDiff + +variable {E : Type u38} [NormedAddCommGroup E] [NormedSpace ℝ E] + +noncomputable section + +local instance oneTensorGroup : NormedAddCommGroup (E →L[ℝ] ℝ) := inferInstance +local instance oneTensorSpace : NormedSpace ℝ (E →L[ℝ] ℝ) := inferInstance +local instance twoTensorGroup : NormedAddCommGroup (E →L[ℝ] E →L[ℝ] ℝ) := inferInstance +local instance twoTensorSpace : NormedSpace ℝ (E →L[ℝ] E →L[ℝ] ℝ) := inferInstance + +def radialMap (α : E → ℝ) (x : E) : E := α x • x + +def radialPrimitive (B : TwoTensor E) (α : E → ℝ) (x : E) : E →L[ℝ] ℝ := + (α x ^ 2 / 2) • B x + +theorem fderiv_radialMap {α : E → ℝ} {x : E} (hα : DifferentiableAt ℝ α x) (a : E) : + fderiv ℝ (radialMap α) x a = α x • a + (fderiv ℝ α x a) • x := by + have hh := hα.hasFDerivAt.smul (hasFDerivAt_id x) + have he := congrArg (fun L : E →L[ℝ] E => L a) hh.fderiv + change fderiv ℝ (radialMap α) x a = _ at he + simpa only [add_apply, smul_apply, ContinuousLinearMap.id_apply, + ContinuousLinearMap.smulRight_apply, id_eq] using he + +theorem fderiv_radialPrimitive (B : TwoTensor E) {α : E → ℝ} {x : E} + (hα : DifferentiableAt ℝ α x) (a b : E) : + fderiv ℝ (radialPrimitive B α) x a b = + (α x ^ 2 / 2) * B a b + α x * fderiv ℝ α x a * B x b := by + have hs : HasFDerivAt (fun y => α y ^ 2 / 2) (α x • fderiv ℝ α x) x := by + convert! (hα.hasFDerivAt.pow 2).mul_const (1 / 2 : ℝ) using 1 <;> + simp [div_eq_mul_inv, smul_smul] + have hh := hs.smul B.hasFDerivAt + have he := congrArg (fun L : E →L[ℝ] E →L[ℝ] ℝ => L a b) hh.fderiv + change fderiv ℝ (radialPrimitive B α) x a b = _ at he + simpa only [add_apply, smul_apply, ContinuousLinearMap.smulRight_apply, + smul_eq_mul, mul_assoc] using he + +theorem radial_pullback (B : TwoTensor E) (hsk : ∀ a b, B a b = -B b a) + {α : E → ℝ} {x : E} (hα : DifferentiableAt ℝ α x) (a b : E) : + B (fderiv ℝ (radialMap α) x a) (fderiv ℝ (radialMap α) x b) = + exteriorD (radialPrimitive B α) x a b := by + have hz : B x x = 0 := by have hh := hsk x x; linarith + simp only [fderiv_radialMap hα, exteriorD_apply, fderiv_radialPrimitive B hα, + map_add, map_smul, add_apply, smul_apply, smul_eq_mul, hz, mul_zero, add_zero] + rw [hsk a x, hsk b a] + ring + +end +end RadialSymplectic + +open Set +open scoped Topology ContDiff + +namespace RadialSymplectic + +noncomputable section + +def radiusSq (μ δ s : ℝ) : ℝ := s + μ * (s / (s + δ)) + +def inverseScaleSq (μ δ t : ℝ) : ℝ := + 2 * δ / (μ + δ - t + Real.sqrt ((μ + δ - t) ^ 2 + 4 * δ * t)) + +theorem radiusSq_strictMonoOn {μ δ : ℝ} (hμ : 0 ≤ μ) (hδ : 0 < δ) : + StrictMonoOn (radiusSq μ δ) (Ici 0) := by + intro s hs t ht hst + have hsδ : 0 < s + δ := add_pos_of_nonneg_of_pos hs hδ + have htδ : 0 < t + δ := add_pos_of_nonneg_of_pos ht hδ + have hf : s / (s + δ) ≤ t / (t + δ) := by + apply (div_le_div_iff₀ hsδ htδ).mpr + nlinarith + have hh := mul_le_mul_of_nonneg_left hf hμ + dsimp only [radiusSq] + linarith + +theorem radial_discriminant_pos {μ δ : ℝ} (hμ : 0 < μ) (hδ : 0 < δ) (t : ℝ) : + 0 < (μ + δ - t) ^ 2 + 4 * δ * t := by + nlinarith [sq_nonneg (t + δ - μ), mul_pos hμ hδ] + +theorem inverseScaleSq_den_pos {μ δ t : ℝ} (hμ : 0 < μ) (hδ : 0 < δ) + (_ht : 0 ≤ t) : 0 < μ + δ - t + Real.sqrt ((μ + δ - t) ^ 2 + 4 * δ * t) := by + have hsq := Real.sq_sqrt (radial_discriminant_pos hμ hδ t).le + have hr := Real.sqrt_nonneg ((μ + δ - t) ^ 2 + 4 * δ * t) + by_contra hc + have hc' : Real.sqrt ((μ + δ - t) ^ 2 + 4 * δ * t) ≤ -(μ + δ - t) := by + linarith + have htt : 0 < t := by linarith + have hmul := mul_self_le_mul_self hr hc' + nlinarith [mul_pos hδ htt] + +theorem inverseScaleSq_pos {μ δ t : ℝ} (hμ : 0 < μ) (hδ : 0 < δ) (ht : 0 ≤ t) : + 0 < inverseScaleSq μ δ t := + div_pos (mul_pos (by norm_num) hδ) (inverseScaleSq_den_pos hμ hδ ht) + +theorem inverseScaleSq_quadratic {μ δ t : ℝ} (hμ : 0 < μ) (hδ : 0 < δ) + (ht : 0 ≤ t) : + t * (inverseScaleSq μ δ t) ^ 2 + (μ + δ - t) * inverseScaleSq μ δ t - δ = 0 := by + have hD := (inverseScaleSq_den_pos hμ hδ ht).ne' + have hsq := Real.sq_sqrt (radial_discriminant_pos hμ hδ t).le + unfold inverseScaleSq + generalize Real.sqrt ((μ + δ - t) ^ 2 + 4 * δ * t) = R at hD hsq ⊢ + field_simp [hD] + nlinarith + +theorem radiusSq_inverse {μ δ t : ℝ} (hμ : 0 < μ) (hδ : 0 < δ) (ht : 0 ≤ t) : + radiusSq μ δ (inverseScaleSq μ δ t * t) = t := by + have hq := inverseScaleSq_pos hμ hδ ht + have hquad := inverseScaleSq_quadratic hμ hδ ht + have hd : 0 < inverseScaleSq μ δ t * t + δ := + add_pos_of_nonneg_of_pos (mul_nonneg hq.le ht) hδ + unfold radiusSq + field_simp [hd.ne'] + nlinarith [mul_eq_zero_of_left hquad t] + +theorem inverseScaleSq_factor {μ δ t : ℝ} (hμ : 0 < μ) (hδ : 0 < δ) (ht : 0 ≤ t) : + (1 + μ / (inverseScaleSq μ δ t * t + δ)) * inverseScaleSq μ δ t = 1 := by + have hq := inverseScaleSq_pos hμ hδ ht + have hquad := inverseScaleSq_quadratic hμ hδ ht + have hd : 0 < inverseScaleSq μ δ t * t + δ := + add_pos_of_nonneg_of_pos (mul_nonneg hq.le ht) hδ + field_simp [hd.ne'] + nlinarith + +theorem contDiffAt_inverseScaleSq {μ δ t : ℝ} (hμ : 0 < μ) (hδ : 0 < δ) (ht : 0 ≤ t) : + ContDiffAt ℝ ∞ (inverseScaleSq μ δ) t := by + have hs : ContDiffAt ℝ ∞ (fun y => Real.sqrt ((μ + δ - y) ^ 2 + 4 * δ * y)) t := + (Real.contDiffAt_sqrt (radial_discriminant_pos hμ hδ t).ne').comp t + (((contDiffAt_const.sub contDiffAt_id).pow 2).add (contDiffAt_const.mul contDiffAt_id)) + exact contDiffAt_const.div ((contDiffAt_const.sub contDiffAt_id).add hs) + (inverseScaleSq_den_pos hμ hδ ht).ne' + +end +end RadialSymplectic + +namespace RadialSymplectic + +open Set +open scoped Topology ContDiff + +variable {E : Type u39} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +noncomputable section + +def expansionScale (μ δ : ℝ) (x : E) : ℝ := Real.sqrt (1 + μ / (‖x‖ ^ 2 + δ)) +def radialExpansion (μ δ : ℝ) : E → E := radialMap (expansionScale μ δ) +def contractionScale (μ δ : ℝ) (x : E) : ℝ := + Real.sqrt (inverseScaleSq μ δ (‖x‖ ^ 2)) +def radialContraction (μ δ : ℝ) : E → E := radialMap (contractionScale μ δ) + +omit [InnerProductSpace ℝ E] in +theorem expansionScale_pos {μ δ : ℝ} (hμ : 0 < μ) (hδ : 0 < δ) (x : E) : + 0 < expansionScale μ δ x := by + unfold expansionScale + apply Real.sqrt_pos.mpr + have hd : 0 < ‖x‖ ^ 2 + δ := add_pos_of_nonneg_of_pos (sq_nonneg _) hδ + positivity + +omit [InnerProductSpace ℝ E] in +theorem expansionScale_sq {μ δ : ℝ} (hμ : 0 < μ) (hδ : 0 < δ) (x : E) : + expansionScale μ δ x ^ 2 = 1 + μ / (‖x‖ ^ 2 + δ) := by + unfold expansionScale + apply Real.sq_sqrt + have hd : 0 < ‖x‖ ^ 2 + δ := add_pos_of_nonneg_of_pos (sq_nonneg _) hδ + positivity + +theorem norm_sq_radialExpansion {μ δ : ℝ} (hμ : 0 < μ) (hδ : 0 < δ) (x : E) : + ‖radialExpansion μ δ x‖ ^ 2 = radiusSq μ δ (‖x‖ ^ 2) := by + simp only [radialExpansion, radialMap, norm_smul, Real.norm_eq_abs, mul_pow, sq_abs] + rw [expansionScale_sq hμ hδ] + unfold radiusSq + ring + +theorem radialExpansion_injective {μ δ : ℝ} (hμ : 0 < μ) (hδ : 0 < δ) : + Function.Injective (radialExpansion μ δ : E → E) := by + intro x y h + have hh := congrArg (fun z : E => ‖z‖ ^ 2) h + rw [norm_sq_radialExpansion hμ hδ, norm_sq_radialExpansion hμ hδ] at hh + have hnorm := (radiusSq_strictMonoOn hμ.le hδ).injOn (sq_nonneg ‖x‖) (sq_nonneg ‖y‖) hh + have hscale : expansionScale μ δ x = expansionScale μ δ y := by + unfold expansionScale + rw [hnorm] + dsimp only [radialExpansion, radialMap] at h + rw [hscale] at h + exact (smul_right_injective E (expansionScale_pos hμ hδ y).ne') h + +omit [InnerProductSpace ℝ E] in +theorem contractionScale_pos {μ δ : ℝ} (hμ : 0 < μ) (hδ : 0 < δ) (x : E) : + 0 < contractionScale μ δ x := + Real.sqrt_pos.mpr (inverseScaleSq_pos hμ hδ (sq_nonneg _)) + +theorem norm_sq_radialContraction {μ δ : ℝ} (hμ : 0 < μ) (hδ : 0 < δ) (x : E) : + ‖radialContraction μ δ x‖ ^ 2 = inverseScaleSq μ δ (‖x‖ ^ 2) * ‖x‖ ^ 2 := by + simp only [radialContraction, radialMap, norm_smul, Real.norm_eq_abs, mul_pow, sq_abs] + rw [contractionScale, Real.sq_sqrt (inverseScaleSq_pos hμ hδ (sq_nonneg _)).le] + +theorem expansionScale_mul_contractionScale {μ δ : ℝ} (hμ : 0 < μ) (hδ : 0 < δ) + (x : E) : expansionScale μ δ (radialContraction μ δ x) * contractionScale μ δ x = 1 := by + have hp := expansionScale_pos hμ hδ (radialContraction μ δ x) + have hq := contractionScale_pos hμ hδ x + have hsq : (expansionScale μ δ (radialContraction μ δ x) * contractionScale μ δ x)^2 = 1 := by + rw [mul_pow, expansionScale_sq hμ hδ, contractionScale, + Real.sq_sqrt (inverseScaleSq_pos hμ hδ (sq_nonneg _)).le, + norm_sq_radialContraction hμ hδ] + exact inverseScaleSq_factor hμ hδ (sq_nonneg _) + nlinarith [mul_pos hp hq] + +theorem radialExpansion_radialContraction {μ δ : ℝ} (hμ : 0 < μ) (hδ : 0 < δ) + (x : E) : radialExpansion μ δ (radialContraction μ δ x) = x := by + change expansionScale μ δ (radialContraction μ δ x) • (contractionScale μ δ x • x) = x + rw [smul_smul, expansionScale_mul_contractionScale hμ hδ, one_smul] + +theorem radialContraction_radialExpansion {μ δ : ℝ} (hμ : 0 < μ) (hδ : 0 < δ) + (x : E) : radialContraction μ δ (radialExpansion μ δ x) = x := + radialExpansion_injective hμ hδ (radialExpansion_radialContraction hμ hδ _) + +theorem contDiff_expansionScale {μ δ : ℝ} (hμ : 0 < μ) (hδ : 0 < δ) : + ContDiff ℝ ∞ (expansionScale μ δ : E → ℝ) := by + have hn : ContDiff ℝ ∞ (fun x : E => ‖x‖^2 + δ) := (contDiff_norm_sq ℝ).add contDiff_const + have hd (x : E) : ‖x‖ ^ 2 + δ ≠ 0 := (add_pos_of_nonneg_of_pos (sq_nonneg _) hδ).ne' + have hp (x : E) : 1 + μ / (‖x‖ ^ 2 + δ) ≠ 0 := by + have hpp : 0 < ‖x‖ ^ 2 + δ := add_pos_of_nonneg_of_pos (sq_nonneg _) hδ + positivity + exact (contDiff_const.add (contDiff_const.div hn hd)).sqrt hp + +theorem contDiff_contractionScale {μ δ : ℝ} (hμ : 0 < μ) (hδ : 0 < δ) : + ContDiff ℝ ∞ (contractionScale μ δ : E → ℝ) := by + rw [contDiff_iff_contDiffAt] + intro x + have hi : ContDiffAt ℝ ∞ (fun z : E => inverseScaleSq μ δ (‖z‖ ^ 2)) x := + (contDiffAt_inverseScaleSq hμ hδ (sq_nonneg ‖x‖)).comp (f := fun z : E => ‖z‖^2) x + (contDiff_norm_sq ℝ).contDiffAt + exact (Real.contDiffAt_sqrt (inverseScaleSq_pos hμ hδ (sq_nonneg ‖x‖)).ne').comp + (f := fun z : E => inverseScaleSq μ δ (‖z‖ ^ 2)) x hi + +theorem contDiff_radialExpansion {μ δ : ℝ} (hμ : 0 < μ) (hδ : 0 < δ) : + ContDiff ℝ ∞ (radialExpansion μ δ : E → E) := + (contDiff_expansionScale hμ hδ).smul contDiff_id + +theorem contDiff_radialContraction {μ δ : ℝ} (hμ : 0 < μ) (hδ : 0 < δ) : + ContDiff ℝ ∞ (radialContraction μ δ : E → E) := + (contDiff_contractionScale hμ hδ).smul contDiff_id + +def radialHomeomorph {μ δ : ℝ} (hμ : 0 < μ) (hδ : 0 < δ) : E ≃ₜ E where + toFun := radialExpansion μ δ + invFun := radialContraction μ δ + left_inv := radialContraction_radialExpansion hμ hδ + right_inv := radialExpansion_radialContraction hμ hδ + continuous_toFun := (contDiff_radialExpansion hμ hδ).continuous + continuous_invFun := (contDiff_radialContraction hμ hδ).continuous + +theorem radialContraction_mapsTo {μ δ a r : ℝ} (hμ : 0 < μ) (hδ : 0 < δ) + (hbound : a ≤ radiusSq μ δ (r^2)) : + MapsTo (radialContraction μ δ : E → E) {x | ‖x‖^2 < a} {x | ‖x‖^2 < r^2} := by + intro x hx + have hi := radiusSq_inverse hμ hδ (sq_nonneg ‖x‖) + have hh : radiusSq μ δ (‖radialContraction μ δ x‖^2) < radiusSq μ δ (r^2) := by + rw [norm_sq_radialContraction hμ hδ, hi] + exact lt_of_lt_of_le hx hbound + exact ((radiusSq_strictMonoOn hμ.le hδ).lt_iff_lt + (show ‖radialContraction μ δ x‖^2 ∈ Ici (0 : ℝ) from sq_nonneg ‖radialContraction μ δ x‖) + (show r^2 ∈ Ici (0 : ℝ) from sq_nonneg r)).mp hh + +end +end RadialSymplectic + +namespace RadialSymplectic + +open ComplexPotential TensorCalculus +open scoped ContDiff + +noncomputable section + +variable {E : Type u40} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +def modelPotential (μ δ : ℝ) (x : E) : ℝ := ‖x‖^2 + μ * Real.log (‖x‖^2 + δ) + +theorem contDiff_modelPotential (μ : ℝ) {δ : ℝ} (hδ : 0 < δ) : + ContDiff ℝ ∞ (modelPotential μ δ : E → ℝ) := + (contDiff_norm_sq ℝ).add (contDiff_const.mul + (((contDiff_norm_sq ℝ).add contDiff_const).log + (fun x => (add_pos_of_nonneg_of_pos (sq_nonneg ‖x‖) hδ).ne'))) + +theorem dc_modelPotential (J : E →L[ℝ] E) + (hsk : ∀ a b, inner (𝕜 := ℝ) a (J b) = -inner (𝕜 := ℝ) (J a) b) + {μ δ : ℝ} (hμ : 0 < μ) (hδ : 0 < δ) (x : E) : + dc J (modelPotential μ δ) x = radialPrimitive (standardTensor J) (expansionScale μ δ) x := by + let h : ℝ → ℝ := fun t => t + μ * Real.log (t + δ) + have hp : ‖x‖^2 + δ ≠ 0 := (add_pos_of_nonneg_of_pos (sq_nonneg _) hδ).ne' + have hd : HasDerivAt h (1 + μ * (‖x‖^2 + δ)⁻¹) (‖x‖^2) := by + convert (hasDerivAt_id (‖x‖^2)).add + ((((hasDerivAt_id (‖x‖^2)).add_const δ).log hp).const_mul μ) using 1 <;> first | rfl | simp [one_div] + change dc J (h ∘ (fun y : E => ‖y‖^2)) x = _ + rw [dc_scalar_comp J ((contDiff_norm_sq ℝ).differentiable (show (∞ : ℕ∞ω) ≠ 0 by simp) x) + hd.differentiableAt, hd.deriv, dc_norm_sq J hsk, smul_smul] + unfold radialPrimitive + rw [expansionScale_sq hμ hδ] + congr 1 + ring + +theorem radialExpansion_pullback (J : E →L[ℝ] E) + (hsk : ∀ a b, inner (𝕜 := ℝ) a (J b) = -inner (𝕜 := ℝ) (J a) b) + {μ δ : ℝ} (hμ : 0 < μ) (hδ : 0 < δ) (x a b : E) : + standardTensor J (fderiv ℝ (radialExpansion μ δ : E → E) x a) + (fderiv ℝ (radialExpansion μ δ : E → E) x b) = ddc J (modelPotential μ δ) x a b := by + have hsk' (a b : E) : standardTensor J a b = -standardTensor J b a := by + change inner (𝕜 := ℝ) (J a) b = -inner (𝕜 := ℝ) (J b) a + rw [← real_inner_comm (J a) b, hsk] + have he : dc J (modelPotential μ δ) = radialPrimitive (standardTensor J) (expansionScale μ δ) := + funext (dc_modelPotential J hsk hμ hδ) + rw [ddc, he] + exact radial_pullback (standardTensor J) hsk' ((contDiff_expansionScale hμ hδ).differentiable + (by simp) x) a b + +theorem radialContraction_pullback (J : E →L[ℝ] E) + (hsk : ∀ a b, inner (𝕜 := ℝ) a (J b) = -inner (𝕜 := ℝ) (J a) b) + {μ δ : ℝ} (hμ : 0 < μ) (hδ : 0 < δ) (x a b : E) : + ddc J (modelPotential μ δ) (radialContraction μ δ x) + (fderiv ℝ (radialContraction μ δ : E → E) x a) + (fderiv ℝ (radialContraction μ δ : E → E) x b) = standardTensor J a b := by + have hd (v : E) : fderiv ℝ (radialExpansion μ δ : E → E) (radialContraction μ δ x) + (fderiv ℝ (radialContraction μ δ : E → E) x v) = v := by + have he : (radialExpansion μ δ : E → E) ∘ radialContraction μ δ = id := + funext (radialExpansion_radialContraction hμ hδ) + have hh := fderiv_comp x ((contDiff_radialExpansion hμ hδ).differentiable (by simp) + (radialContraction μ δ x)) ((contDiff_radialContraction hμ hδ).differentiable (by simp) x) + rw [he, fderiv_id] at hh + exact (congrArg (fun L : E →L[ℝ] E => L v) hh).symm + rw [← radialExpansion_pullback J hsk hμ hδ, hd, hd] + +end +end RadialSymplectic + +end LowerBoundInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/RegularizedMaximum.lean b/lean/OAI/Geometry/PolarProducts/RegularizedMaximum.lean new file mode 100644 index 0000000000000000000000000000000000000000..5bd7d08731f28a967cf357bfe25d565ee7ac1978 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/RegularizedMaximum.lean @@ -0,0 +1,248 @@ +import OAI.Geometry.PolarProducts.PotentialDeformation + +namespace OAI + +universe u36 u37 + +section LowerBoundInline +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter Metric +open scoped Topology ContDiff +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal +open Set Filter Function +open scoped Topology ContDiff +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter +open scoped Topology ContDiff +open Set Filter Function +open scoped Topology ContDiff +open Set Filter Function +open scoped ContDiff Topology + +open Set MeasureTheory +open scoped ContDiff Interval Topology + +namespace SmoothPositivePart + +noncomputable section + +def primitive (t : ℝ) : ℝ := ∫ s in (0 : ℝ)..t, Real.smoothTransition s + +theorem hasDerivAt_primitive (t : ℝ) : HasDerivAt primitive (Real.smoothTransition t) t := by + apply intervalIntegral.integral_hasDerivAt_right + · exact Real.smoothTransition.continuous.intervalIntegrable _ _ + · exact ContinuousAt.stronglyMeasurableAtFilter isOpen_univ + (fun _ _ => Real.smoothTransition.continuousAt) t (mem_univ t) + · exact Real.smoothTransition.continuousAt + +@[simp] theorem deriv_primitive : deriv primitive = Real.smoothTransition := + funext (fun t => (hasDerivAt_primitive t).deriv) + +theorem primitive_smooth : ContDiff ℝ ∞ primitive := by + rw [contDiff_infty_iff_deriv] + exact ⟨fun t => (hasDerivAt_primitive t).differentiableAt, + deriv_primitive ▸ Real.smoothTransition.contDiff⟩ + +theorem primitive_of_nonpos {t : ℝ} (ht : t ≤ 0) : primitive t = 0 := by + calc + primitive t = ∫ s in (0 : ℝ)..t, (0 : ℝ) := by + apply intervalIntegral.integral_congr + intro s hs + apply Real.smoothTransition.zero_of_nonpos + exact le_trans hs.2 (max_eq_left ht).le + _ = 0 := intervalIntegral.integral_zero + +theorem primitive_one_mem : primitive 1 ∈ Icc (0 : ℝ) 1 := by + constructor + · apply intervalIntegral.integral_nonneg (by norm_num) + intro s _ + exact Real.smoothTransition.nonneg s + · calc + primitive 1 ≤ ∫ s in (0 : ℝ)..1, (1 : ℝ) := by + apply intervalIntegral.integral_mono_on (by norm_num) + · exact Real.smoothTransition.continuous.intervalIntegrable _ _ + · exact continuous_const.intervalIntegrable _ _ + · intro s _ + exact Real.smoothTransition.le_one s + _ = 1 := by simp + +theorem primitive_of_one_le {t : ℝ} (ht : 1 ≤ t) : primitive t = t + (primitive 1 - 1) := by + have he : (∫ s in (1 : ℝ)..t, Real.smoothTransition s) = t - 1 := by + calc + _ = ∫ s in (1 : ℝ)..t, (1 : ℝ) := by + apply intervalIntegral.integral_congr + intro s hs + exact Real.smoothTransition.one_of_one_le (le_trans (by simp [ht]) hs.1) + _ = t - 1 := by simp + have hadd := intervalIntegral.integral_add_adjacent_intervals + (Real.smoothTransition.continuous.intervalIntegrable (μ := volume) (0 : ℝ) 1) + (Real.smoothTransition.continuous.intervalIntegrable (1 : ℝ) t) + change primitive 1 + _ = primitive t at hadd + rw [he] at hadd + linarith + +def shift : ℝ := primitive 1 - 1 + +theorem shift_mem : shift ∈ Icc (-1 : ℝ) 0 := by + have h := primitive_one_mem + change -1 ≤ primitive 1 - 1 ∧ primitive 1 - 1 ≤ 0 + constructor <;> linarith [h.1, h.2] + +def positivePart (t : ℝ) : ℝ := primitive (t - shift) + +theorem positivePart_smooth : ContDiff ℝ ∞ positivePart := + primitive_smooth.comp (contDiff_id.sub contDiff_const) + +theorem positivePart_zero {t : ℝ} (ht : t ≤ -1) : positivePart t = 0 := by + apply primitive_of_nonpos + linarith [shift_mem.1] + +theorem positivePart_eq_self {t : ℝ} (ht : 1 ≤ t) : positivePart t = t := by + rw [positivePart, primitive_of_one_le (by linarith [shift_mem.2])] + unfold shift + ring + +theorem deriv_positivePart (t : ℝ) : deriv positivePart t = Real.smoothTransition (t - shift) := by + change deriv (fun t => primitive (t - shift)) t = _ + simpa only [mul_one, Function.comp_def, id_eq] using + ((hasDerivAt_primitive (t - shift)).comp t ((hasDerivAt_id t).sub_const shift)).deriv + +theorem deriv_positivePart_mem (t : ℝ) : deriv positivePart t ∈ Icc (0 : ℝ) 1 := by + rw [deriv_positivePart] + exact ⟨Real.smoothTransition.nonneg _, Real.smoothTransition.le_one _⟩ + +theorem second_deriv_positivePart_nonneg (t : ℝ) : 0 ≤ deriv (deriv positivePart) t := by + apply Monotone.deriv_nonneg + intro x y hxy + rw [deriv_positivePart, deriv_positivePart] + exact Real.smoothTransition.monotone (sub_le_sub_right hxy _) + +def smoothMax (h p : ℝ) : ℝ := p + positivePart (h - p) + +theorem smoothMax_left {h p : ℝ} (hp : p + 1 ≤ h) : smoothMax h p = h := by + rw [smoothMax, positivePart_eq_self (by linarith)] + ring + +theorem smoothMax_right {h p : ℝ} (hp : h + 1 ≤ p) : smoothMax h p = p := by + rw [smoothMax, positivePart_zero (by linarith), add_zero] + +end +end SmoothPositivePart + +namespace ComplexPotential + +open TensorCalculus SmoothPositivePart Set Filter +open scoped ContDiff Topology + +variable {E : Type u36} [NormedAddCommGroup E] [NormedSpace ℝ E] + +noncomputable section + +local instance maxOneGroup : NormedAddCommGroup (E →L[ℝ] ℝ) := inferInstance +local instance maxOneSpace : NormedSpace ℝ (E →L[ℝ] ℝ) := inferInstance +local instance maxTwoGroup : NormedAddCommGroup (E →L[ℝ] E →L[ℝ] ℝ) := inferInstance +local instance maxTwoSpace : NormedSpace ℝ (E →L[ℝ] E →L[ℝ] ℝ) := inferInstance + +theorem IsPSHAt.smoothMax {J : E →L[ℝ] E} (hJ : ∀ a, J (J a) = -a) + {φ ψ : E → ℝ} {x : E} (hφ : IsPSHAt J φ x) (hψ : IsPSHAt J ψ x) : + IsPSHAt J (fun y => smoothMax (φ y) (ψ y)) x := by + have hdiff := hφ.1.sub hψ.1 + have hs : ContDiffAt ℝ ∞ (positivePart ∘ fun y => φ y - ψ y) x := + positivePart_smooth.contDiffAt.comp x hdiff + refine ⟨hψ.1.add hs, fun a => ?_⟩ + change 0 ≤ ddc J (fun y => ψ y + (positivePart ∘ fun z => φ z - ψ z) y) x a (J a) + rw [ddc_add J hψ.1 hs, add_apply, add_apply, + ddc_scalar_comp_complex_line J hJ hdiff positivePart_smooth.contDiffAt, + ddc_sub J hφ.1 hψ.1, sub_apply, sub_apply] + have hβ := deriv_positivePart_mem (φ x - ψ x) + have h2 := second_deriv_positivePart_nonneg (φ x - ψ x) + have hpos : 0 ≤ (1 - deriv positivePart (φ x - ψ x)) * ddc J ψ x a (J a) + + deriv positivePart (φ x - ψ x) * ddc J φ x a (J a) := + add_nonneg (mul_nonneg (sub_nonneg.mpr hβ.2) (hψ.2 a)) + (mul_nonneg hβ.1 (hφ.2 a)) + have hquad : 0 ≤ deriv (deriv positivePart) (φ x - ψ x) * + ((fderiv ℝ (fun y => φ y - ψ y) x a)^2 + + (fderiv ℝ (fun y => φ y - ψ y) x (J a))^2) / 4 := by positivity + nlinarith + +theorem IsPSHAt.congr {J : E →L[ℝ] E} {φ ψ : E → ℝ} {x : E} + (hφ : IsPSHAt J φ x) (he : ψ =ᶠ[𝓝 x] φ) : IsPSHAt J ψ x := by + refine ⟨hφ.1.congr_of_eventuallyEq he, fun a => ?_⟩ + rw [ddc_congr J he] + exact hφ.2 a + +end +end ComplexPotential + +namespace ComplexPotential + +open SmoothPositivePart Set Filter +open scoped ContDiff Topology + +variable {E : Type u37} [NormedAddCommGroup E] [NormedSpace ℝ E] + +noncomputable section + +omit [NormedSpace ℝ E] in + +def gluedPotential (R : ℝ) (H P : E → ℝ) (x : E) : ℝ := by + classical + exact if ‖x‖ < R then if x = 0 then P x else smoothMax (H x) (P x) else H x + +omit [NormedSpace ℝ E] in +theorem gluedPotential_outer (R : ℝ) (H P : E → ℝ) {x : E} (hx : R ≤ ‖x‖) : + gluedPotential R H P x = H x := by + classical + simp [gluedPotential, not_lt.mpr hx] + +omit [NormedSpace ℝ E] in +theorem gluedPotential_inner {r R : ℝ} (hrR : r < R) (H P : E → ℝ) + (hdom : ∀ x : E, x ≠ 0 → ‖x‖ ≤ r → H x + 1 ≤ P x) {x : E} (hx : ‖x‖ ≤ r) : + gluedPotential R H P x = P x := by + classical + have hR : ‖x‖ < R := hx.trans_lt hrR + by_cases hzero : x = 0 + · rw [gluedPotential, ite_eq_left hR, ite_eq_left hzero] + · rw [gluedPotential, ite_eq_left hR, ite_eq_right hzero, smoothMax_right (hdom x hzero hx)] + +theorem isPSHAt_gluedPotential (J : E →L[ℝ] E) (hJ : ∀ a, J (J a) = -a) + {U : Set E} {r R : ℝ} (hr : 0 < r) (hrR : r < R) (H P : E → ℝ) + (hH : ∀ x ∈ U, x ≠ 0 → IsPSHAt J H x) + (hP : ∀ x ∈ U, IsPSHAt J P x) + (hinner : ∀ x : E, x ≠ 0 → ‖x‖ ≤ r → H x + 1 ≤ P x) + (houter : ∀ x ∈ U, ‖x‖ = R → P x + 1 < H x) + {x : E} (hx : x ∈ U) : IsPSHAt J (gluedPotential R H P) x := by + classical + have hRpos : 0 < R := hr.trans hrR + by_cases hzero : x = 0 + · have hn : ‖x‖ < r := by simpa [hzero] using hr + apply (hP x hx).congr + filter_upwards [continuous_norm.continuousAt.eventually_lt continuousAt_const hn] with y hy + exact gluedPotential_inner hrR H P hinner hy.le + have hHx := hH x hx hzero + have hPx := hP x hx + rcases lt_trichotomy ‖x‖ R with hn | hn | hn + · apply (hHx.smoothMax hJ hPx).congr + filter_upwards [continuous_norm.continuousAt.eventually_lt continuousAt_const hn, + eventually_ne_nhds hzero] with y hy hy0 + simp [gluedPotential, hy, hy0] + · apply hHx.congr + have hlt := houter x hx hn + filter_upwards [(hPx.1.continuousAt.add continuousAt_const).eventually_lt + hHx.1.continuousAt hlt, eventually_ne_nhds hzero] with y hy hy0 + by_cases hny : ‖y‖ < R + · simp [gluedPotential, hny, hy0, smoothMax_left hy.le] + · simp [gluedPotential, hny] + · apply hHx.congr + filter_upwards [continuousAt_const.eventually_lt continuous_norm.continuousAt hn] with y hy + exact gluedPotential_outer R H P hy.le + +end +end ComplexPotential + +end LowerBoundInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/SmoothDegree.lean b/lean/OAI/Geometry/PolarProducts/SmoothDegree.lean new file mode 100644 index 0000000000000000000000000000000000000000..30ec2683e138cb70c06209134d718790527231e1 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/SmoothDegree.lean @@ -0,0 +1,362 @@ +import OAI.Geometry.PolarProducts.LowerBound + +namespace OAI + +universe u78 u79 + +section NonsqueezingInline +section + +open Set Filter Function MeasureTheory +open scoped Topology ContDiff + +namespace SmoothDegree +noncomputable section + +abbrev Space (d : ℕ) := Fin d → ℝ + +def basis (d : ℕ) : Fin d → Space d := fun i => Pi.single i 1 + +def vol (d : ℕ) : (Space d) [⋀^Fin d]→L[ℝ] ℝ := + { Matrix.detRowAlternating with cont := continuous_id.matrix_det } + +@[simp] theorem vol_apply (d : ℕ) (v : Fin d → Space d) : vol d v = Matrix.det v := rfl + +@[simp] theorem vol_basis (d : ℕ) : vol d (basis d) = 1 := by + have he : basis d = (1 : Matrix (Fin d) (Fin d) ℝ) := by + ext i j + simp [basis, Matrix.one_apply, Pi.single_apply, eq_comm] + change Matrix.det (basis d) = 1 + rw [he, Matrix.det_one] + + theorem vol_update_basis {d : ℕ} (i : Fin d) (v : Space d) : + vol d (Function.update (basis d) i v) = v i := by + change Matrix.det (Matrix.updateRow (basis d) i v) = v i + have hv : v = ∑ j, v j • (basis d) j := by + ext k + simp [basis, Pi.single_apply] + calc + _ = Matrix.det (Matrix.updateRow (basis d) i (∑ j, v j • (basis d) j)) := + congrArg (fun w => Matrix.det (Matrix.updateRow (basis d) i w)) hv + _ = v i • Matrix.det (basis d) := Matrix.det_updateRow_sum (basis d) i v + _ = v i := by rw [show Matrix.det (basis d) = 1 from vol_basis d]; simp + + theorem contract_basis {n : ℕ} (i : Fin (n+1)) (v : Space (n+1)) : + (vol (n+1)).curryLeft v (i.removeNth (basis (n+1))) = (-1 : ℝ)^i.val * v i := by + rw [ContinuousAlternatingMap.curryLeft_apply_apply, + ← ContinuousAlternatingMap.neg_one_pow_smul_map_insertNth, + Fin.insertNth_removeNth, vol_update_basis] + simp only [zsmul_eq_mul, Int.cast_pow, Int.cast_neg, Int.cast_one] + + theorem extDeriv_contract_basis {n : ℕ} {V : Space (n+1) → Space (n+1)} + {x : Space (n+1)} {V' : Space (n+1) →L[ℝ] Space (n+1)} (hV : HasFDerivAt V V' x) : + extDeriv (fun y => (vol (n+1)).curryLeft (V y)) x (basis (n+1)) = + ∑ i, V' (basis (n+1) i) i := by + have hc : DifferentiableAt ℝ (fun y => (vol (n+1)).curryLeft (V y)) x := + (vol (n+1)).curryLeft.differentiableAt.comp x hV.differentiableAt + rw [extDeriv_apply hc] + apply Finset.sum_congr rfl + intro i hi + have he : (fun y => (vol (n+1)).curryLeft (V y) (i.removeNth (basis (n+1)))) = + fun y => (-1 : ℝ)^i.val * (V y) i := funext fun y => contract_basis i (V y) + have hd : HasFDerivAt (fun y => (-1 : ℝ)^i.val * (V y) i) + (((-1 : ℝ)^i.val) • ((ContinuousLinearMap.proj i).comp V')) x := + (((ContinuousLinearMap.proj i : Space (n+1) →L[ℝ] ℝ).hasFDerivAt).comp x hV).const_mul _ + rw [he, hd.fderiv] + simp only [smul_apply, ContinuousLinearMap.comp_apply, + ContinuousLinearMap.proj_apply, smul_eq_mul, zsmul_eq_mul, Int.cast_pow, Int.cast_neg, Int.cast_one] + rw [← mul_assoc, ← pow_add, show i.val+i.val = 2*i.val by omega, + pow_mul, neg_one_sq, one_pow, one_mul] + + theorem extDeriv_contract_eq_zero {n : ℕ} {V : Space (n+1) → Space (n+1)} + {x : Space (n+1)} (hV : DifferentiableAt ℝ V x) + (hdiv : ∑ i, fderiv ℝ V x (basis (n+1) i) i = 0) : + extDeriv (fun y => (vol (n+1)).curryLeft (V y)) x = 0 := by + apply ContinuousAlternatingMap.toAlternatingMap_injective + apply ((extDeriv (fun y => (vol (n+1)).curryLeft (V y)) x).toAlternatingMap.map_basis_eq_zero_iff + (Pi.basisFun ℝ (Fin (n+1)))).mp + have he : (Pi.basisFun ℝ (Fin (n+1)) : Fin (n+1) → Space (n+1)) = basis (n+1) := by + ext i j; simp [basis, Pi.basisFun_apply] + change extDeriv (fun y => (vol (n+1)).curryLeft (V y)) x _ = 0 + rw [he, extDeriv_contract_basis hV.hasFDerivAt, hdiv] + + def sqsum {d : ℕ} (x : Space d) : ℝ := ∑ i, x i ^ 2 + + theorem sqsum_pos {d : ℕ} {x : Space d} (hx : x ≠ 0) : 0 < sqsum x := by + obtain ⟨i, hi⟩ : ∃ i, x i ≠ 0 := by contrapose! hx; ext i; exact hx i + exact Finset.sum_pos' (fun i _ => sq_nonneg (x i)) ⟨i, Finset.mem_univ _, sq_pos_of_ne_zero hi⟩ + + def dot {d : ℕ} (x : Space d) : Space d →L[ℝ] ℝ := + ∑ i, x i • ContinuousLinearMap.proj i + + @[simp] theorem dot_apply {d : ℕ} (x v : Space d) : dot x v = ∑ i, x i * v i := by + simp [dot] + + theorem hasFDerivAt_sqsum {d : ℕ} (x : Space d) : + HasFDerivAt sqsum ((2 : ℝ) • dot x) x := by + have h := HasFDerivAt.sum (u := Finset.univ) + (fun i _ => ((ContinuousLinearMap.proj i : Space d →L[ℝ] ℝ).hasFDerivAt (x := x)).pow 2) + convert! h using 1 + · ext y + simp [sqsum] + · ext v + simp [dot, Finset.mul_sum, mul_assoc] + + def radial {d : ℕ} (x : Space d) : Space d := + (sqsum x ^ (-(d : ℝ)/2)) • x + + theorem hasFDerivAt_radial {d : ℕ} {x : Space d} (hx : x ≠ 0) : + HasFDerivAt radial + ((((-(d : ℝ)/2) * sqsum x ^ (-(d : ℝ)/2 - 1)) • ((2 : ℝ) • dot x)).smulRight x + + (sqsum x ^ (-(d : ℝ)/2)) • ContinuousLinearMap.id ℝ (Space d)) x := by + convert! ((hasFDerivAt_sqsum x).rpow_const (p := -(d : ℝ)/2) + (Or.inl (sqsum_pos hx).ne')).smul (hasFDerivAt_id x) using 1 + exact add_comm _ _ + + theorem radial_divergence {d : ℕ} {x : Space d} (hx : x ≠ 0) : + ∑ i, fderiv ℝ (@radial d) x (basis d i) i = 0 := by + rw [(hasFDerivAt_radial hx).fderiv] + have hb (i : Fin d) : dot x (basis d i) = x i := by + simp [dot_apply, basis, Pi.single_apply, eq_comm] + simp only [add_apply, Pi.add_apply, smul_apply, + ContinuousLinearMap.smulRight_apply, ContinuousLinearMap.id_apply, Pi.smul_apply, + smul_eq_mul, hb] + simp only [basis, Pi.single_eq_same, mul_one, Finset.sum_add_distrib, + Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] + have he : (∑ i : Fin d, (-(d : ℝ)/2 * sqsum x ^ (-(d : ℝ)/2-1) * (2*x i)) * x i) = + -(d : ℝ) * (sqsum x ^ (-(d : ℝ)/2-1) * sqsum x) := by + simp only [sqsum, Finset.mul_sum] + apply Finset.sum_congr rfl + intro i hi + ring + rw [he] + have hp : sqsum x ^ (-(d : ℝ)/2-1) * sqsum x = sqsum x ^ (-(d : ℝ)/2) := by + calc + _ = sqsum x ^ (-(d : ℝ)/2-1) * sqsum x ^ (1 : ℝ) := by rw [Real.rpow_one] + _ = sqsum x ^ (-(d : ℝ)/2-1+1) := (Real.rpow_add (sqsum_pos hx) _ _).symm + _ = _ := by congr 1; ring + rw [hp] + ring + + def radialForm (n : ℕ) (x : Space (n+1)) : (Space (n+1)) [⋀^Fin n]→L[ℝ] ℝ := + (vol (n+1)).curryLeft (radial x) + + theorem differentiableAt_radialForm {n : ℕ} {x : Space (n+1)} (hx : x ≠ 0) : + DifferentiableAt ℝ (radialForm n) x := + (vol (n+1)).curryLeft.differentiableAt.comp x (hasFDerivAt_radial hx).differentiableAt + + theorem closed_radialForm {n : ℕ} {x : Space (n+1)} (hx : x ≠ 0) : + extDeriv (radialForm n) x = 0 := + extDeriv_contract_eq_zero (hasFDerivAt_radial hx).differentiableAt (radial_divergence hx) + + def pullForm {n : ℕ} (f : Space (n+1) → Space (n+1)) (x : Space (n+1)) : + (Space (n+1)) [⋀^Fin n]→L[ℝ] ℝ := + (radialForm n (f x)).compContinuousLinearMap (fderiv ℝ f x) + + theorem differentiableAt_pullForm {n : ℕ} {f : Space (n+1) → Space (n+1)} + (hf : ContDiff ℝ ∞ f) {x : Space (n+1)} (hx : f x ≠ 0) : + DifferentiableAt ℝ (pullForm f) x := by + apply DifferentiableAt.continuousAlternatingMapCompContinuousLinearMap + · exact (differentiableAt_radialForm hx).comp x (hf.differentiable (by simp) x) + · exact (hf.contDiffAt.fderiv_right (m := ∞) (by simp)).differentiableAt (by simp) + + theorem closed_pullForm {n : ℕ} {f : Space (n+1) → Space (n+1)} + (hf : ContDiff ℝ ∞ f) {x : Space (n+1)} (hx : f x ≠ 0) : + extDeriv (pullForm f) x = 0 := by + change extDeriv (fun y => (radialForm n (f y)).compContinuousLinearMap (fderiv ℝ f y)) x = 0 + rw [extDeriv_pullback (differentiableAt_radialForm hx) hf.contDiffAt (by + simp only [minSmoothness_of_isRCLikeNormedField] + change ((2 : ℕ∞) : WithTop ℕ∞) ≤ ((⊤ : ℕ∞) : WithTop ℕ∞) + exact WithTop.coe_le_coe.mpr le_top), + closed_radialForm hx] + ext v + rfl + + def formVector {n : ℕ} (η : Space (n+1) → (Space (n+1)) [⋀^Fin n]→L[ℝ] ℝ) + (x : Space (n+1)) : Space (n+1) := + fun i => (-1 : ℝ)^i.val * η x (i.removeNth (basis (n+1))) + + theorem differentiableAt_formVector {n : ℕ} + {η : Space (n+1) → (Space (n+1)) [⋀^Fin n]→L[ℝ] ℝ} {x : Space (n+1)} + (hη : DifferentiableAt ℝ η x) : DifferentiableAt ℝ (formVector η) x := by + apply differentiableAt_pi.mpr + intro i + exact ((ContinuousAlternatingMap.apply ℝ _ _ (i.removeNth (basis (n+1)))).differentiableAt.comp x hη).const_mul _ + + theorem divergence_formVector {n : ℕ} + {η : Space (n+1) → (Space (n+1)) [⋀^Fin n]→L[ℝ] ℝ} {x : Space (n+1)} + (hη : DifferentiableAt ℝ η x) : + ∑ i, fderiv ℝ (formVector η) x (basis (n+1) i) i = extDeriv η x (basis (n+1)) := by + rw [extDeriv_apply hη] + apply Finset.sum_congr rfl + intro i hi + have hd := (differentiableAt_formVector hη).hasFDerivAt + have hei : fderiv ℝ (fun y => formVector η y i) x = + (ContinuousLinearMap.proj i).comp (fderiv ℝ (formVector η) x) := + ((ContinuousLinearMap.proj i : Space (n+1) →L[ℝ] ℝ).hasFDerivAt.comp x hd).fderiv + have hw : DifferentiableAt ℝ (fun y => η y (i.removeNth (basis (n+1)))) x := + (hη.hasFDerivAt.continuousAlternatingMap_apply_const _).differentiableAt + have he : fderiv ℝ (fun y => formVector η y i) x = + (-1 : ℝ)^i.val • fderiv ℝ (fun y => η y (i.removeNth (basis (n+1)))) x := + (hw.hasFDerivAt.const_mul _).fderiv + have := congrArg (fun l : Space (n+1) →L[ℝ] ℝ => l (basis (n+1) i)) (hei.symm.trans he) + simpa only [ContinuousLinearMap.comp_apply, ContinuousLinearMap.proj_apply, smul_apply, + smul_eq_mul, zsmul_eq_mul, Int.cast_pow, Int.cast_neg, Int.cast_one] using this + + theorem formVector_radialForm {n : ℕ} (x : Space (n+1)) : + formVector (radialForm n) x = radial x := by + ext i + change (-1 : ℝ)^i.val * (vol (n+1)).curryLeft (radial x) (i.removeNth (basis (n+1))) = _ + rw [contract_basis, ← mul_assoc, ← pow_add, + show i.val+i.val = 2*i.val by omega, pow_mul, neg_one_sq, one_pow, one_mul] + + theorem pullForm_eventually_id {n : ℕ} {f : Space (n+1) → Space (n+1)} {x : Space (n+1)} + (h : f =ᶠ[𝓝 x] id) : pullForm f x = radialForm n x := by + unfold pullForm + rw [h.eq_of_nhds, h.fderiv_eq, fderiv_id] + ext v + rfl + + theorem positive_integral_cube {n : ℕ} (g : Space n → ℝ) (hg : Continuous g) + (hp : ∀ x, 0 < g x) {R : ℝ} (hR : 0 < R) : + 0 < ∫ x in Icc (fun _ : Fin n => -R) (fun _ => R), g x := by + apply (setIntegral_pos_iff_support_of_nonneg_ae + (Eventually.of_forall (fun x => (hp x).le)) hg.integrableOn_Icc).mpr + have hs : Function.support g = univ := by + ext x + simp only [Function.mem_support, Set.mem_univ, iff_true] + exact (hp x).ne' + rw [hs, univ_inter, Real.volume_Icc_pi] + apply pos_iff_ne_zero.mpr + exact Finset.prod_ne_zero_iff.mpr fun _ _ => ENNReal.ofReal_ne_zero_iff.mpr (by linarith) + + theorem continuous_face {n : ℕ} {G : Space (n+1) → Space (n+1)} (hG : Continuous G) + (i : Fin (n+1)) (a : ℝ) : Continuous (fun y : Space n => G (i.insertNth a y) i) := by + exact (continuous_apply i).comp (hG.comp (continuous_const.finInsertNth i continuous_id)) + + theorem radial_front_pos {n : ℕ} (i : Fin (n+1)) (y : Space n) {S : ℝ} (hS : 0 < S) : + 0 < radial (i.insertNth S y : Space (n+1)) i := by + simp only [radial, Pi.smul_apply, smul_eq_mul, Fin.insertNth_apply_same] + refine mul_pos (Real.rpow_pos_of_pos (sqsum_pos ?_) _) hS + intro he + have he' := congrFun he i + exact hS.ne' (by simpa only [Fin.insertNth_apply_same, Pi.zero_apply] using he') + + theorem radial_back_neg {n : ℕ} (i : Fin (n+1)) (y : Space n) {S : ℝ} (hS : 0 < S) : + radial (i.insertNth (-S) y : Space (n+1)) i < 0 := by + simp only [radial, Pi.smul_apply, smul_eq_mul, Fin.insertNth_apply_same] + refine mul_neg_of_pos_of_neg (Real.rpow_pos_of_pos (sqsum_pos ?_) _) (neg_neg_of_pos hS) + intro he + have he' := congrFun he i + simp only [Fin.insertNth_apply_same, Pi.zero_apply, neg_eq_zero] at he' + exact hS.ne' he' + + theorem face_norm_bound {n : ℕ} (i : Fin (n+1)) (y : Space n) (a : ℝ) : + |a| ≤ ‖(i.insertNth a y : Space (n+1))‖ := by + simpa only [Fin.insertNth_apply_same, Real.norm_eq_abs] using + (norm_le_pi_norm (i.insertNth a y : Space (n+1)) i) + + theorem positive_flux {n : ℕ} {G : Space (n+1) → Space (n+1)} (hG : Continuous G) + {R S : ℝ} (hS : 0 < S) (hRS : R < S) + (hGrad : ∀ x, R < ‖x‖ → G x = radial x) (i : Fin (n+1)) : + 0 < (∫ y in Icc (fun _ : Fin n => -S) (fun _ => S), G (i.insertNth S y) i) - + ∫ y in Icc (fun _ : Fin n => -S) (fun _ => S), G (i.insertNth (-S) y) i := by + have hfront (y : Space n) : 0 < G (i.insertNth S y) i := by + rw [hGrad _ (lt_of_lt_of_le hRS (by simpa only [abs_of_pos hS] using face_norm_bound i y S))] + exact radial_front_pos i y hS + have hback (y : Space n) : G (i.insertNth (-S) y) i < 0 := by + rw [hGrad _ (lt_of_lt_of_le hRS (by simpa only [abs_neg, abs_of_pos hS] using face_norm_bound i y (-S)))] + exact radial_back_neg i y hS + have hp := positive_integral_cube _ (continuous_face hG i S) hfront hS + have hn := positive_integral_cube (fun y => -G (i.insertNth (-S) y) i) + (continuous_face hG i (-S)).neg (fun y => neg_pos.mpr (hback y)) hS + rw [integral_neg] at hn + linarith + + theorem divergence_obstruction {n : ℕ} {G : Space (n+1) → Space (n+1)} + (hG : Differentiable ℝ G) (hdiv : ∀ x, ∑ i, fderiv ℝ G x (basis (n+1) i) i = 0) + {R : ℝ} (hR : 0 < R) (hGrad : ∀ x, R < ‖x‖ → G x = radial x) : False := by + let S := R+1 + have hS : 0 < S := by dsimp [S]; linarith + have hstokes := integral_divergence_of_hasFDerivAt_off_countable + (fun _ : Fin (n+1) => -S) (fun _ => S) (fun _ => by linarith) + G (fderiv ℝ G) ∅ countable_empty hG.continuous.continuousOn + (fun x _ => (hG x).hasFDerivAt) + (show IntegrableOn (fun x => ∑ i, fderiv ℝ G x (basis (n+1) i) i) + (Icc (fun _ : Fin (n+1) => -S) (fun _ => S)) volume from by + simpa only [hdiv] using (integrableOn_zero : IntegrableOn (fun _ : Space (n+1) => (0 : ℝ)) + (Icc (fun _ => -S) (fun _ => S)) volume)) + change (∫ x in Icc (fun _ : Fin (n+1) => -S) (fun _ => S), + ∑ i, fderiv ℝ G x (basis (n+1) i) i) = _ at hstokes + simp only [hdiv, integral_zero] at hstokes + have hp := Finset.sum_pos (s := Finset.univ) + (fun i _ => positive_flux hG.continuous hS (show R < S by dsimp [S]; linarith) hGrad i) + Finset.univ_nonempty + exact (ne_of_gt hp) hstokes.symm + + theorem exists_zero_of_identity_outside {n : ℕ} {f : Space (n+1) → Space (n+1)} + (hf : ContDiff ℝ ∞ f) {R : ℝ} (hR : 0 < R) + (hId : ∀ x, R ≤ ‖x‖ → f x = x) : ∃ x, f x = 0 := by + by_contra hnone + push Not at hnone + let G := formVector (pullForm f) + have hGdiff : Differentiable ℝ G := fun x => + differentiableAt_formVector (differentiableAt_pullForm hf (hnone x)) + have hdiv (x : Space (n+1)) : ∑ i, fderiv ℝ G x (basis (n+1) i) i = 0 := by + rw [divergence_formVector (differentiableAt_pullForm hf (hnone x)), + closed_pullForm hf (hnone x)] + rfl + have hevent {x : Space (n+1)} (hx : R < ‖x‖) : f =ᶠ[𝓝 x] id := by + have hopen : IsOpen {y : Space (n+1) | R < ‖y‖} := isOpen_lt continuous_const continuous_norm + filter_upwards [hopen.mem_nhds hx] with y hy + exact hId y hy.le + have hGrad {x : Space (n+1)} (hx : R < ‖x‖) : G x = radial x := by + change formVector (pullForm f) x = radial x + have he := pullForm_eventually_id (hevent hx) + have hrewrite : formVector (pullForm f) x = formVector (radialForm n) x := by + ext i + simp only [formVector, he] + rw [hrewrite, formVector_radialForm] + exact divergence_obstruction hGdiff hdiv hR (fun x hx => hGrad hx) + + theorem exists_zero_space {d : ℕ} {f : Space d → Space d} + (hf : ContDiff ℝ ∞ f) {R : ℝ} (hR : 0 < R) + (hId : ∀ x, R ≤ ‖x‖ → f x = x) : ∃ x, f x = 0 := by + cases d with + | zero => exact ⟨0, Subsingleton.elim _ _⟩ + | succ n => exact exists_zero_of_identity_outside hf hR hId + + theorem exists_zero {E : Type u78} [NormedAddCommGroup E] [NormedSpace ℝ E] + [FiniteDimensional ℝ E] {f : E → E} (hf : ContDiff ℝ ∞ f) + {R : ℝ} (hR : 0 < R) (hId : ∀ x, R ≤ ‖x‖ → f x = x) : ∃ x, f x = 0 := by + let b := (Module.finBasis ℝ E).equivFunL + let C := ‖b.toContinuousLinearMap‖ + have hC : 0 ≤ C := norm_nonneg _ + let S := C*R+1 + have hS : 0 < S := by dsimp [S]; positivity + let g : Space (Module.finrank ℝ E) → Space (Module.finrank ℝ E) := fun y => b (f (b.symm y)) + have hg : ContDiff ℝ ∞ g := b.contDiff.comp (hf.comp b.symm.contDiff) + have hgId (y : Space (Module.finrank ℝ E)) (hy : S ≤ ‖y‖) : g y = y := by + have hbnd : ‖y‖ ≤ C*‖b.symm y‖ := by + simpa only [ContinuousLinearEquiv.coe_coe, b.apply_symm_apply] using + (b.toContinuousLinearMap.le_opNorm (b.symm y)) + have hn : R ≤ ‖b.symm y‖ := by dsimp [S] at hy; nlinarith + dsimp [g] + rw [hId _ hn, b.apply_symm_apply] + obtain ⟨y, hy⟩ := exists_zero_space hg hS hgId + refine ⟨b.symm y, b.injective ?_⟩ + simpa only [map_zero] using hy + + theorem exists_zero_of_compactSupport {E : Type u79} [NormedAddCommGroup E] [NormedSpace ℝ E] + [FiniteDimensional ℝ E] {f : E → E} (hf : ContDiff ℝ ∞ f) + (hc : HasCompactSupport (fun x => f x-x)) : ∃ x, f x = 0 := by + obtain ⟨R, hR, h⟩ := hc.exists_pos_le_norm + exact exists_zero hf hR (fun x hx => sub_eq_zero.mp (h x hx)) + +end +end SmoothDegree + +end +end NonsqueezingInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/SmoothFlow.lean b/lean/OAI/Geometry/PolarProducts/SmoothFlow.lean new file mode 100644 index 0000000000000000000000000000000000000000..88700988e045ce0a35e44a7caaa923fff4f8b323 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/SmoothFlow.lean @@ -0,0 +1,259 @@ +import OAI.Geometry.PolarProducts.CompleteFlow + +namespace OAI + +universe u14 u15 u16 + +section LowerBoundInline +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter Metric +open scoped Topology ContDiff +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal + +namespace SmoothODE + +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal + +variable {E : Type u14} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + +noncomputable section + +theorem curve_injective {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + (h : ℝ) (hh : ‖h‖₊ * K < 1) (t : Time) : + Function.Injective (fun x => curve hV h hh x t) := by + intro x y he + have heq : EqOn (curve hV h hh x) (curve hV h hh y) (Icc 0 t) := by + apply ODE_solution_unique_of_mem_Icc_left + (v := fun _ y => h • V y) (s := fun _ => univ) (K := ‖h‖₊ * K) + · intro _ _ + exact ((lipschitzWith_smul h).comp hV).lipschitzOnWith + · exact (continuous_curve hV h hh x).continuousOn + · intro s hs + exact (hasDerivAt_curve hV h hh x ⟨s, hs.1.le, hs.2.trans t.property.2⟩).hasDerivWithinAt + · intro _ _; trivial + · exact (continuous_curve hV h hh y).continuousOn + · intro s hs + exact (hasDerivAt_curve hV h hh y ⟨s, hs.1.le, hs.2.trans t.property.2⟩).hasDerivWithinAt + · intro _ _; trivial + · exact he + simpa only [curve_zero] using heq (show 0 ∈ Icc (0 : ℝ) t from ⟨le_rfl, t.property.1⟩) + +theorem curve_of_const_along {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + (h : ℝ) (hh : ‖h‖₊ * K < 1) (x v : E) + (hc : ∀ t : Time, V (x + (t : ℝ) • h • v) = v) : + EqOn (curve hV h hh x) (fun t => x + t • h • v) (Icc 0 1) := by + apply EqOn.symm + apply curve_unique hV h hh x + · exact (continuous_const.add (continuous_id.smul continuous_const)).continuousOn + · intro t ht + have he := hc ⟨t, ht.1, ht.2.le⟩ + have hd := ((hasDerivAt_id t).smul_const (h • v)).const_add x + simpa only [he, one_smul, id_eq] using hd.hasDerivWithinAt (s := Ici t) + · simp + +theorem curve_spaceTime_outside {V : ℝ × E → ℝ × E} {K : ℝ≥0} + (hV : LipschitzWith K V) (h : ℝ) (hh : ‖h‖₊ * K < 1) + {U : Set E} (hTime : ∀ z, (V z).1 = 1) + (hOut : ∀ z, z.2 ∉ U → (V z).2 = 0) (x : ℝ × E) (hx : x.2 ∉ U) (t : Time) : + curve hV h hh x t = (x.1 + (t : ℝ) * h, x.2) := by + have hc : ∀ s : Time, V (x + (s : ℝ) • h • (1, (0 : E))) = (1, 0) := by + intro s + apply Prod.ext + · exact hTime _ + · exact hOut _ (by simpa using hx) + have he := curve_of_const_along hV h hh x (1, (0 : E)) hc t.property + calc + curve hV h hh x t = x + (t : ℝ) • h • (1, (0 : E)) := he + _ = (x.1 + (t : ℝ) * h, x.2) := by ext <;> simp [smul_eq_mul] + +theorem curve_spaceTime_mapsTo {V : ℝ × E → ℝ × E} {K : ℝ≥0} + (hV : LipschitzWith K V) (h : ℝ) (hh : ‖h‖₊ * K < 1) + {U : Set E} (hTime : ∀ z, (V z).1 = 1) + (hOut : ∀ z, z.2 ∉ U → (V z).2 = 0) (x : ℝ × E) (hx : x.2 ∈ U) (t : Time) : + (curve hV h hh x t).2 ∈ U := by + by_contra hout + let y : ℝ × E := (x.1, (curve hV h hh x t).2) + have he : curve hV h hh y t = curve hV h hh x t := by + rw [curve_spaceTime_outside hV h hh hTime hOut y hout] + apply Prod.ext + · have he := curve_linear_component hV h hh (ContinuousLinearMap.fst ℝ ℝ E) 1 hTime x t + simpa only [ContinuousLinearMap.coe_fst', smul_eq_mul, mul_one, y] using he.symm + · rfl + have hy := curve_injective hV h hh t he + have hxy := congrArg Prod.snd hy + exact hout (hxy ▸ hx) + +end +end SmoothODE + +namespace SmoothODE + +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal + +variable {E : Type u15} [NormedAddCommGroup E] [NormedSpace ℝ E] + [CompleteSpace E] [ProperSpace E] + +noncomputable section + +theorem step_preserves_tensor_on {V : E → E} {K : ℝ≥0} (hV : LipschitzWith K V) + (hVs : ContDiff ℝ ∞ V) (h : ℝ) (hh : ‖h‖₊ * K < 1) + {B : E → E →L[ℝ] E →L[ℝ] ℝ} {U : Set E} + (hB : ∀ z ∈ U, DifferentiableAt ℝ B z) + (hInv : ∀ z ∈ U, ∀ a b, fderiv ℝ B z (V z) a b + + B z (fderiv ℝ V z a) b + B z a (fderiv ℝ V z b) = 0) (x : E) (hpath : ∀ t : Time, curve hV h hh x t ∈ U) (a b : E) : + B (step hV h hh x) (fderiv ℝ (step hV h hh) x a) + (fderiv ℝ (step hV h hh) x b) = B x a b := by + let F : ℝ → ℝ := fun t => B (curve hV h hh x t) + (variation hV h hh x a t) (variation hV h hh x b t) + have hBc : ContinuousOn B U := fun z hz => (hB z hz).continuousAt.continuousWithinAt + have hc : ContinuousOn F (Icc 0 1) := + ((hBc.comp (continuous_curve hV h hh x).continuousOn (fun t ht => hpath ⟨t, ht⟩)).clm_apply + (continuous_variation hV hVs h hh x a).continuousOn).clm_apply + (continuous_variation hV hVs h hh x b).continuousOn + have hd : ∀ t ∈ Ico (0 : ℝ) 1, HasDerivWithinAt F 0 (Ici t) t := by + intro t ht + let T : Time := ⟨t, ht.1, ht.2.le⟩ + have hv := hasDerivAt_curve hV h hh x T + have ha := hasDerivAt_variation hV hVs h hh x a T + have hb := hasDerivAt_variation hV hVs h hh x b T + have hdb : HasDerivAt (fun s : ℝ => B (curve hV h hh x s)) + (fderiv ℝ B (curve hV h hh x t) (h • V (curve hV h hh x t))) t := + (hB (curve hV h hh x t) (hpath T)).hasFDerivAt.comp_hasDerivAt (l := B) + (l' := fderiv ℝ B (curve hV h hh x t)) t hv + have hdf := (hdb.clm_apply ha).clm_apply hb + have hz : + ((fderiv ℝ B (curve hV h hh x t) (h • V (curve hV h hh x t))) + (variation hV h hh x a t) + + B (curve hV h hh x t) + (h • fderiv ℝ V (curve hV h hh x t) (variation hV h hh x a t))) + (variation hV h hh x b t) + + B (curve hV h hh x t) (variation hV h hh x a t) + (h • fderiv ℝ V (curve hV h hh x t) (variation hV h hh x b t)) = 0 := by + simp only [map_smul, smul_apply, + add_apply, smul_eq_mul] + calc + _ = h * (fderiv ℝ B (curve hV h hh x t) (V (curve hV h hh x t)) + (variation hV h hh x a t) (variation hV h hh x b t) + + B (curve hV h hh x t) + (fderiv ℝ V (curve hV h hh x t) (variation hV h hh x a t)) + (variation hV h hh x b t) + + B (curve hV h hh x t) (variation hV h hh x a t) + (fderiv ℝ V (curve hV h hh x t) (variation hV h hh x b t))) := by ring + _ = 0 := by rw [hInv _ (hpath T), mul_zero] + exact (hdf.congr_deriv hz).hasDerivWithinAt + have he := constant_of_has_deriv_right_zero hc hd 1 + (show 1 ∈ Icc (0 : ℝ) 1 by constructor <;> norm_num) + simpa only [F, curve_one, variation_one hV hVs, curve_zero, variation_zero] using he + +end +end SmoothODE + +namespace SmoothODE + +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal + +variable {E : Type u16} [NormedAddCommGroup E] [NormedSpace ℝ E] + [CompleteSpace E] [ProperSpace E] + +noncomputable section + +omit [CompleteSpace E] [ProperSpace E] in + +theorem homeomorph_pow_preserves_tensor_on (f : E ≃ₜ E) + (hf : ContDiff ℝ ∞ (f : E → E)) {U : Set E} (hU : MapsTo f U U) + {B : E → E →L[ℝ] E →L[ℝ] ℝ} + (hB : ∀ x ∈ U, ∀ a b, B (f x) (fderiv ℝ (f : E → E) x a) + (fderiv ℝ (f : E → E) x b) = B x a b) (n : ℕ) (x : E) (hx : x ∈ U) : + (f ^ n) x ∈ U ∧ ∀ a b, + B ((f ^ n) x) (fderiv ℝ ((f ^ n : E ≃ₜ E) : E → E) x a) + (fderiv ℝ ((f ^ n : E ≃ₜ E) : E → E) x b) = B x a b := by + induction n with + | zero => + refine ⟨hx, ?_⟩ + intro a b + change B x (fderiv ℝ (id : E → E) x a) (fderiv ℝ (id : E → E) x b) = _ + simp + | succ n ih => + rw [pow_succ'] + refine ⟨hU ih.1, ?_⟩ + intro a b + change B (f ((f ^ n) x)) (fderiv ℝ ((f : E → E) ∘ (f ^ n : E ≃ₜ E)) x a) + (fderiv ℝ ((f : E → E) ∘ (f ^ n : E ≃ₜ E)) x b) = _ + rw [fderiv_comp x (hf.differentiable (by simp) _) + ((contDiff_homeomorph_pow f hf n).differentiable (by simp) _)] + simp only [ContinuousLinearMap.comp_apply] + rw [hB _ ih.1] + exact ih.2 a b + +theorem exists_spaceTime_transport {V : ℝ × E → ℝ × E} {K : ℝ≥0} + (hV : LipschitzWith K V) (hVs : ContDiff ℝ ∞ V) {U : Set E} + (hTime : ∀ z, (V z).1 = 1) (hOut : ∀ z, z.2 ∉ U → (V z).2 = 0) + {B : (ℝ × E) → (ℝ × E) →L[ℝ] (ℝ × E) →L[ℝ] ℝ} + (hB : ∀ z, z.2 ∈ U → DifferentiableAt ℝ B z) + (hInv : ∀ z, z.2 ∈ U → ∀ a b, fderiv ℝ B z (V z) a b + + B z (fderiv ℝ V z a) b + B z a (fderiv ℝ V z b) = 0) (T : ℝ) : + ∃ f : (ℝ × E) ≃ₜ (ℝ × E), + ContDiff ℝ ∞ (f : (ℝ × E) → (ℝ × E)) ∧ + ContDiff ℝ ∞ (f.symm : (ℝ × E) → (ℝ × E)) ∧ + (∀ x, (f x).1 = x.1 + T) ∧ + (∀ x, x.2 ∉ U → (f x).2 = x.2) ∧ + (∀ x, x.2 ∈ U → (f x).2 ∈ U ∧ ∀ a b, + B (f x) (fderiv ℝ (f : (ℝ × E) → (ℝ × E)) x a) + (fderiv ℝ (f : (ℝ × E) → (ℝ × E)) x b) = B x a b) := by + obtain ⟨N, hN⟩ := exists_nat_gt (max (‖T‖ * (K : ℝ)) 0) + have hN0 : (0 : ℝ) < N := lt_of_le_of_lt (le_max_right _ _) hN + have hNne : (N : ℝ) ≠ 0 := ne_of_gt hN0 + let h : ℝ := T / N + have hh : ‖h‖₊ * K < 1 := by + change ‖h‖ * (K : ℝ) < (1 : ℝ) + dsimp [h] + rw [abs_div, abs_of_pos hN0, div_mul_eq_mul_div] + exact (div_lt_one hN0).mpr ((le_max_left _ _).trans_lt hN) + let f := stepHomeomorph hV hVs h hh + have hf : ContDiff ℝ ∞ (f : (ℝ × E) → (ℝ × E)) := contDiff_step hV hVs h hh + have hfi : ContDiff ℝ ∞ (f.symm : (ℝ × E) → (ℝ × E)) := + contDiff_step hV hVs (-h) (by simpa using hh) + have hm : ∀ x, x.2 ∈ U → (f x).2 ∈ U := by + intro x hx + simpa only [Prod.mk.eta, curve_one, f, stepHomeomorph_apply] using + curve_spaceTime_mapsTo hV h hh hTime hOut x hx ⟨1, by constructor <;> norm_num⟩ + have ho : ∀ x, x.2 ∉ U → (f x).2 = x.2 := by + intro x hx + have he := curve_spaceTime_outside hV h hh hTime hOut x hx ⟨1, by constructor <;> norm_num⟩ + simpa only [curve_one, f, stepHomeomorph_apply] using congrArg Prod.snd he + refine ⟨f ^ N, contDiff_homeomorph_pow f hf N, ?_, ?_, ?_, ?_⟩ + · change ContDiff ℝ ∞ ((f ^ N)⁻¹ : (ℝ × E) ≃ₜ (ℝ × E)) + rw [← inv_pow] + exact contDiff_homeomorph_pow f⁻¹ hfi N + · intro x + have hs : (N : ℝ) * h = T := by dsimp [h]; field_simp + have he := homeomorph_pow_linear_component f (ContinuousLinearMap.fst ℝ ℝ E) h + (by intro z; simpa only [smul_eq_mul, mul_one, f, stepHomeomorph_apply] using + step_linear_component hV h hh (ContinuousLinearMap.fst ℝ ℝ E) 1 hTime z) N x + simpa only [ContinuousLinearMap.coe_fst', nsmul_eq_mul, hs] using he + · intro x hx + have hi : ∀ n : ℕ, ((f ^ n) x).2 = x.2 := by + intro n + induction n with + | zero => rfl + | succ n ih => + rw [pow_succ', Homeomorph.mul_apply, ho _ (by simpa only [ih] using hx), ih] + exact hi N + · intro x hx + apply homeomorph_pow_preserves_tensor_on f hf (U := Prod.snd ⁻¹' U) + (fun _ hz => hm _ hz) (fun z hz a b => ?_) N x hx + exact step_preserves_tensor_on hV hVs h hh (U := Prod.snd ⁻¹' U) + (fun y hy => hB y hy) (fun y hy => hInv y hy) z + (fun t => curve_spaceTime_mapsTo hV h hh hTime hOut z hz t) a b + +end +end SmoothODE + +end LowerBoundInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/SmoothPaths.lean b/lean/OAI/Geometry/PolarProducts/SmoothPaths.lean new file mode 100644 index 0000000000000000000000000000000000000000..f8a1243cf8854de4a363dce8f7f5f96eaa0267b3 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/SmoothPaths.lean @@ -0,0 +1,136 @@ +import OAI.Geometry.PolarProducts.Contraction + +namespace OAI + +section LowerBoundInline +open Set Filter Function +open scoped Topology ContDiff NNReal + +open Set Filter Metric +open scoped Topology ContDiff + +namespace SmoothPaths + +universe u v + +variable {X : Type v} {E F : Type u} [TopologicalSpace X] [CompactSpace X] + [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] + +noncomputable section + +def applyField (A : C(X, E →L[ℝ] F)) : C(X, E) →L[ℝ] C(X, F) := by + let L : C(X, E) →ₗ[ℝ] C(X, F) := + { toFun := fun u => ⟨fun t => A t (u t), A.continuous.clm_apply u.continuous⟩ + map_add' := by intros; ext; simp + map_smul' := by intros; ext; simp } + apply L.mkContinuous ‖A‖ + intro u + apply (ContinuousMap.norm_le (L u) (mul_nonneg (norm_nonneg A) (norm_nonneg u))).mpr + intro t + exact ((A t).le_opNorm (u t)).trans + (mul_le_mul (A.norm_coe_le_norm t) (u.norm_coe_le_norm t) + (norm_nonneg _) (norm_nonneg _)) + +@[simp] theorem applyField_apply (A : C(X, E →L[ℝ] F)) (u : C(X, E)) (t : X) : + applyField A u t = A t (u t) := rfl + +def applyFieldCLM : C(X, E →L[ℝ] F) →L[ℝ] C(X, E) →L[ℝ] C(X, F) := by + let L : C(X, E →L[ℝ] F) →ₗ[ℝ] (C(X, E) →L[ℝ] C(X, F)) := + { toFun := fun A => applyField A + map_add' := by intros; ext; simp + map_smul' := by intros; ext; simp } + have hL : ∀ A : C(X, E →L[ℝ] F), ‖L A‖ ≤ 1 * ‖A‖ := by + intro A + rw [one_mul] + apply (applyField A).opNorm_le_bound (norm_nonneg A) + intro u + apply (ContinuousMap.norm_le (applyField A u) + (mul_nonneg (norm_nonneg A) (norm_nonneg u))).mpr + intro t + exact ((A t).le_opNorm (u t)).trans + (mul_le_mul (A.norm_coe_le_norm t) (u.norm_coe_le_norm t) + (norm_nonneg _) (norm_nonneg _)) + exact LinearMap.mkContinuous (σ := RingHom.id ℝ) + (E := C(X, E →L[ℝ] F)) (F := C(X, E) →L[ℝ] C(X, F)) L 1 hL + +@[simp] theorem applyFieldCLM_apply (A : C(X, E →L[ℝ] F)) : + applyFieldCLM A = applyField A := rfl + +def superpose {f : E → F} (hf : Continuous f) (u : C(X, E)) : C(X, F) := + ⟨fun t => f (u t), hf.comp u.continuous⟩ + +omit [CompactSpace X] [NormedSpace ℝ E] [NormedSpace ℝ F] in +@[simp] theorem superpose_apply {f : E → F} (hf : Continuous f) + (u : C(X, E)) (t : X) : superpose hf u t = f (u t) := rfl + +omit [CompactSpace X] [NormedSpace ℝ E] [NormedSpace ℝ F] in +theorem continuous_superpose {f : E → F} (hf : Continuous f) : + Continuous (superpose (X := X) hf) := + ContinuousMap.continuous_postcomp ⟨f, hf⟩ + +theorem hasFDerivAt_superpose [ProperSpace E] {f : E → F} + (hf : Differentiable ℝ f) (hf' : Continuous (fderiv ℝ f)) (u : C(X, E)) : + HasFDerivAt (superpose hf.continuous) + (applyField (superpose hf' u)) u := by + rw [hasFDerivAt_iff_isLittleO_nhds_zero, Asymptotics.isLittleO_iff] + intro ε hε + have huc : UniformContinuousOn (fderiv ℝ f) (closedBall (0 : E) (‖u‖ + 2)) := + (isCompact_closedBall (0 : E) (‖u‖ + 2)).uniformContinuousOn_of_continuous hf'.continuousOn + obtain ⟨δ, hδ, hbound⟩ := Metric.uniformContinuousOn_iff.mp huc ε hε + filter_upwards [Metric.ball_mem_nhds (0 : C(X, E)) (lt_min hδ zero_lt_one)] with h hh + have hhδ : ‖h‖ < δ := (mem_ball_zero_iff.mp hh).trans_le (min_le_left _ _) + have hh1 : ‖h‖ < 1 := (mem_ball_zero_iff.mp hh).trans_le (min_le_right _ _) + apply (ContinuousMap.norm_le _ (mul_nonneg hε.le (norm_nonneg _))).mpr + intro t + have hu : ‖u t‖ ≤ ‖u‖ := u.norm_coe_le_norm t + have hsmall : ‖h t‖ < δ := (h.norm_coe_le_norm t).trans_lt hhδ + have hsmall1 : ‖h t‖ < 1 := (h.norm_coe_le_norm t).trans_lt hh1 + have hut : u t ∈ closedBall (0 : E) (‖u‖ + 2) := by + rw [mem_closedBall_zero_iff]; linarith + have hall : ∀ y ∈ ball (u t) (min δ 1), + ‖fderiv ℝ f y - fderiv ℝ f (u t)‖ ≤ ε := by + intro y hy + have hdist : dist y (u t) < δ := hy.trans_le (min_le_left _ _) + have hdist1 : dist y (u t) < 1 := hy.trans_le (min_le_right _ _) + have hyball : y ∈ closedBall (0 : E) (‖u‖ + 2) := by + rw [mem_closedBall_zero_iff] + have hn := norm_le_norm_sub_add y (u t) + rw [← dist_eq_norm] at hn + linarith + exact le_of_lt (by simpa only [dist_eq_norm] using hbound y hyball (u t) hut hdist) + have hu0 : u t ∈ ball (u t) (min δ 1) := mem_ball_self (lt_min hδ zero_lt_one) + have huh : u t + h t ∈ ball (u t) (min δ 1) := by + simp only [mem_ball, dist_eq_norm, add_sub_cancel_left] + exact lt_min hsmall hsmall1 + have he := (convex_ball (u t) (min δ 1)).norm_image_sub_le_of_norm_fderiv_le' + (fun _ _ => hf _) hall hu0 huh + simp only [add_sub_cancel_left] at he + exact he.trans (mul_le_mul_of_nonneg_left (h.norm_coe_le_norm t) hε.le) + +theorem contDiff_superpose_nat [ProperSpace E] (n : ℕ) {f : E → F} + (hf : ContDiff ℝ n f) : ContDiff ℝ n (superpose (X := X) hf.continuous) := by + induction n generalizing F with + | zero => exact contDiff_zero.mpr (continuous_superpose hf.continuous) + | succ n ih => + have hn : (↑(n + 1) : WithTop ℕ∞) ≠ 0 := by simp + have hd : Differentiable ℝ f := hf.differentiable hn + have hcd : ContDiff ℝ n (fderiv ℝ f) := hf.fderiv_right (by simp) + have hc : ContDiff ℝ n (fun u : C(X, E) => applyField (superpose hcd.continuous u)) := + by simpa only [Function.comp_def, applyFieldCLM_apply] using + (applyFieldCLM (X := X) (E := E) (F := F)).contDiff.comp (ih hcd) + apply contDiff_succ_iff_hasFDerivAt.mpr + exact ⟨_, hc, hasFDerivAt_superpose hd hcd.continuous⟩ + +theorem contDiff_superpose [ProperSpace E] {f : E → F} + (hf : ContDiff ℝ ∞ f) : ContDiff ℝ ∞ (superpose (X := X) hf.continuous) := by + apply contDiff_infty.mpr + intro n + exact contDiff_superpose_nat n (contDiff_infty.mp hf n) + +end +end SmoothPaths + +end LowerBoundInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/SmoothProfiles.lean b/lean/OAI/Geometry/PolarProducts/SmoothProfiles.lean new file mode 100644 index 0000000000000000000000000000000000000000..d3cc4cf217a22bd572c17418fdc2c050f25a6e59 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/SmoothProfiles.lean @@ -0,0 +1,221 @@ +import OAI.Geometry.PolarProducts.EmbeddingInverse + +namespace OAI + +section NonsqueezingInline + +namespace SmoothProfiles +noncomputable section +open MeasureTheory Set Filter +open scoped ContDiff Topology + + def primitive (v : ℝ → ℝ) (s : ℝ) : ℝ := ∫ t in (0:ℝ)..s, v t + + theorem hasDerivAt_primitive {v : ℝ → ℝ} (hv : Continuous v) (s : ℝ) : + HasDerivAt (primitive v) (v s) s := + intervalIntegral.integral_hasDerivAt_right (hv.intervalIntegrable _ _) + hv.stronglyMeasurable.stronglyMeasurableAtFilter hv.continuousAt + + theorem contDiff_primitive {v : ℝ → ℝ} (hv : ContDiff ℝ ∞ v) : ContDiff ℝ ∞ (primitive v) := by + rw [contDiff_infty_iff_deriv] + exact ⟨fun x => (hasDerivAt_primitive hv.continuous x).differentiableAt, + by simpa only [(funext (fun x => (hasDerivAt_primitive hv.continuous x).deriv))] using hv⟩ + + theorem primitive_zero {v : ℝ → ℝ} (hz : ∀ t ≤ 0, v t = 0) {s : ℝ} (hs : s ≤ 0) : + primitive v s = 0 := by + rw [primitive, intervalIntegral.integral_symm] + have hi : ∫ t in s..0, v t = 0 := by + calc + _ = ∫ _t in s..0, (0 : ℝ) := intervalIntegral.integral_congr (fun t ht => + hz t (by rw [Set.uIcc_of_le hs] at ht; exact ht.2)) + _ = _ := by simp + simp only [hi, neg_zero] + + theorem primitive_nonneg {v : ℝ → ℝ} (_hv : Continuous v) + (hn : ∀ t, 0 ≤ v t) (hz : ∀ t ≤ 0, v t = 0) (s : ℝ) : 0 ≤ primitive v s := by + by_cases hs : s ≤ 0 + · simp only [primitive_zero hz hs, le_refl] + · exact intervalIntegral.integral_nonneg (by linarith) (fun t _ => hn t) + + theorem primitive_mono {v : ℝ → ℝ} (hv : Continuous v) (hn : ∀ t, 0 ≤ v t) : + Monotone (primitive v) := by + exact monotone_of_deriv_nonneg (fun t => (hasDerivAt_primitive hv t).differentiableAt) + (fun t => by simpa only [(hasDerivAt_primitive hv t).deriv] using hn t) + + def exteriorSlope (δ : ℝ) (s : ℝ) : ℝ := Real.smoothTransition (s/δ) + def exterior (δ : ℝ) : ℝ → ℝ := primitive (exteriorSlope δ) + + theorem contDiff_exteriorSlope (δ : ℝ) : ContDiff ℝ ∞ (exteriorSlope δ) := + Real.smoothTransition.contDiff.comp (contDiff_id.div_const δ) + + theorem contDiff_exterior (δ : ℝ) : ContDiff ℝ ∞ (exterior δ) := + contDiff_primitive (contDiff_exteriorSlope δ) + + theorem hasDerivAt_exterior (δ s : ℝ) : HasDerivAt (exterior δ) (exteriorSlope δ s) s := + hasDerivAt_primitive (contDiff_exteriorSlope δ).continuous s + + theorem exteriorSlope_nonneg (δ s : ℝ) : 0 ≤ exteriorSlope δ s := Real.smoothTransition.nonneg _ + theorem exteriorSlope_le_one (δ s : ℝ) : exteriorSlope δ s ≤ 1 := Real.smoothTransition.le_one _ + theorem exteriorSlope_zero {δ : ℝ} (hδ : 0 < δ) {s : ℝ} (hs : s ≤ 0) : exteriorSlope δ s = 0 := + Real.smoothTransition.zero_of_nonpos (div_nonpos_of_nonpos_of_nonneg hs hδ.le) + theorem exteriorSlope_one {δ : ℝ} (hδ : 0 < δ) {s : ℝ} (hs : δ ≤ s) : exteriorSlope δ s = 1 := + Real.smoothTransition.one_of_one_le ((one_le_div hδ).mpr hs) + + theorem exterior_zero {δ : ℝ} (hδ : 0 < δ) {s : ℝ} (hs : s ≤ 0) : exterior δ s = 0 := + primitive_zero (fun _ ht => exteriorSlope_zero hδ ht) hs + + theorem exterior_nonneg {δ : ℝ} (hδ : 0 < δ) (s : ℝ) : 0 ≤ exterior δ s := + primitive_nonneg (contDiff_exteriorSlope δ).continuous (exteriorSlope_nonneg δ) + (fun _ ht => exteriorSlope_zero hδ ht) s + + theorem exterior_affine {δ : ℝ} (hδ : 0 < δ) {s : ℝ} (hs : δ ≤ s) : + exterior δ s = s-δ+exterior δ δ := by + have hc := (contDiff_exteriorSlope δ).continuous + have hi := intervalIntegral.integral_add_adjacent_intervals (hc.intervalIntegrable (μ := volume) 0 δ) + (hc.intervalIntegrable (μ := volume) δ s) + change exterior δ δ+(∫ t in δ..s, exteriorSlope δ t) = exterior δ s at hi + have he : (∫ t in δ..s, exteriorSlope δ t) = s-δ := by + calc + _ = ∫ _t in δ..s, (1 : ℝ) := intervalIntegral.integral_congr (fun t ht => + exteriorSlope_one hδ (by rw [Set.uIcc_of_le hs] at ht; exact ht.1)) + _ = _ := by simp + rw [he] at hi + linarith + + theorem exterior_lower {δ : ℝ} (hδ : 0 < δ) (s : ℝ) : s-δ ≤ exterior δ s := by + by_cases hs : δ ≤ s + · rw [exterior_affine hδ hs]; linarith [exterior_nonneg hδ δ] + · linarith [exterior_nonneg hδ s] + + theorem exterior_upper {δ : ℝ} (hδ : 0 < δ) (s : ℝ) : exterior δ s ≤ max s 0 := by + by_cases hs : s ≤ 0 + · rw [exterior_zero hδ hs, max_eq_right hs] + · have hs0 := le_of_not_ge hs + calc + exterior δ s ≤ ∫ _t in (0:ℝ)..s, (1 : ℝ) := + intervalIntegral.integral_mono_on hs0 ((contDiff_exteriorSlope δ).continuous.intervalIntegrable _ _) + (continuous_const.intervalIntegrable _ _) (fun t _ => exteriorSlope_le_one δ t) + _ = max s 0 := by simp [max_eq_left hs0] + + theorem primitive_zero_below {v : ℝ → ℝ} {b : ℝ} (hb : 0 ≤ b) + (hz : ∀ t ≤ b, v t = 0) {s : ℝ} (hs : s ≤ b) : primitive v s = 0 := by + unfold primitive + calc + _ = ∫ _t in (0:ℝ)..s, (0 : ℝ) := intervalIntegral.integral_congr (fun t ht => + hz t (ht.2.trans (max_le hb hs))) + _ = _ := by simp + + theorem primitive_const_above {v : ℝ → ℝ} (hv : Continuous v) {b : ℝ} + (hz : ∀ t, b ≤ t → v t = 0) {s : ℝ} (hs : b ≤ s) : primitive v s = primitive v b := by + have hi := intervalIntegral.integral_add_adjacent_intervals + (hv.intervalIntegrable (μ := volume) 0 b) (hv.intervalIntegrable (μ := volume) b s) + have he : (∫ t in b..s, v t) = 0 := by + calc + _ = ∫ _t in b..s, (0 : ℝ) := intervalIntegral.integral_congr (fun t ht => + hz t (by rw [Set.uIcc_of_le hs] at ht; exact ht.1)) + _ = _ := by simp + change primitive v b+_ = primitive v s at hi + simpa only [he, add_zero] using hi.symm + + def ballSlope (r L ε s : ℝ) : ℝ := + r*Real.smoothTransition ((s-ε)/ε)*Real.smoothTransition ((L-ε-s)/ε) + def ballProfile (r L ε : ℝ) : ℝ → ℝ := primitive (ballSlope r L ε) + def ballHeight (r L ε : ℝ) : ℝ := ballProfile r L ε (L-ε) + + theorem contDiff_ballSlope (r L ε : ℝ) : ContDiff ℝ ∞ (ballSlope r L ε) := + (contDiff_const.mul (Real.smoothTransition.contDiff.comp ((contDiff_id.sub contDiff_const).div_const ε))).mul + (Real.smoothTransition.contDiff.comp ((contDiff_const.sub contDiff_id).div_const ε)) + + theorem contDiff_ballProfile (r L ε : ℝ) : ContDiff ℝ ∞ (ballProfile r L ε) := + contDiff_primitive (contDiff_ballSlope r L ε) + + theorem hasDerivAt_ballProfile (r L ε s : ℝ) : + HasDerivAt (ballProfile r L ε) (ballSlope r L ε s) s := + hasDerivAt_primitive (contDiff_ballSlope r L ε).continuous s + + theorem ballSlope_nonneg {r : ℝ} (hr : 0 ≤ r) (L ε s : ℝ) : 0 ≤ ballSlope r L ε s := + mul_nonneg (mul_nonneg hr (Real.smoothTransition.nonneg _)) (Real.smoothTransition.nonneg _) + + theorem ballSlope_le {r : ℝ} (hr : 0 ≤ r) (L ε s : ℝ) : ballSlope r L ε s ≤ r := by + have h1 := Real.smoothTransition.le_one ((s-ε)/ε) + have h2 := Real.smoothTransition.le_one ((L-ε-s)/ε) + have h0 := Real.smoothTransition.nonneg ((s-ε)/ε) + have hp := mul_le_mul_of_nonneg_left h2 (mul_nonneg hr h0) + have hq := mul_le_mul_of_nonneg_left h1 hr + dsimp [ballSlope] + nlinarith + + theorem ballSlope_zero_left (r L : ℝ) {ε : ℝ} (hε : 0 < ε) {s : ℝ} (hs : s ≤ ε) : + ballSlope r L ε s = 0 := by + unfold ballSlope + rw [Real.smoothTransition.zero_of_nonpos (div_nonpos_of_nonpos_of_nonneg (by linarith) hε.le)] + ring + + theorem ballSlope_zero_right (r L : ℝ) {ε : ℝ} (hε : 0 < ε) {s : ℝ} (hs : L-ε ≤ s) : + ballSlope r L ε s = 0 := by + unfold ballSlope + rw [show Real.smoothTransition ((L-ε-s)/ε) = 0 from + Real.smoothTransition.zero_of_nonpos (div_nonpos_of_nonpos_of_nonneg (by linarith) hε.le)] + ring + + theorem ballSlope_middle (r L : ℝ) {ε : ℝ} (hε : 0 < ε) {s : ℝ} + (hs : 2*ε ≤ s) (ht : s ≤ L-2*ε) : ballSlope r L ε s = r := by + unfold ballSlope + rw [Real.smoothTransition.one_of_one_le ((one_le_div hε).mpr (by linarith)), + Real.smoothTransition.one_of_one_le ((one_le_div hε).mpr (by linarith))] + ring + + theorem ballProfile_zero (r L : ℝ) {ε : ℝ} (hε : 0 < ε) {s : ℝ} (hs : s ≤ ε) : + ballProfile r L ε s = 0 := + primitive_zero_below hε.le (fun _ ht => ballSlope_zero_left r L hε ht) hs + + theorem ballProfile_plateau (r L : ℝ) {ε : ℝ} (hε : 0 < ε) {s : ℝ} (hs : L-ε ≤ s) : + ballProfile r L ε s = ballHeight r L ε := + primitive_const_above (contDiff_ballSlope r L ε).continuous + (fun _ ht => ballSlope_zero_right r L hε ht) hs + + theorem ballProfile_nonneg {r : ℝ} (hr : 0 ≤ r) (L : ℝ) {ε : ℝ} (hε : 0 < ε) (s : ℝ) : + 0 ≤ ballProfile r L ε s := + primitive_nonneg (contDiff_ballSlope r L ε).continuous (ballSlope_nonneg hr L ε) + (fun _ ht => ballSlope_zero_left r L hε (ht.trans hε.le)) s + + theorem ballProfile_le_height {r : ℝ} (hr : 0 ≤ r) (L : ℝ) {ε : ℝ} (hε : 0 < ε) (s : ℝ) : + ballProfile r L ε s ≤ ballHeight r L ε := by + by_cases hs : L-ε ≤ s + · rw [ballProfile_plateau r L hε hs] + · exact primitive_mono (contDiff_ballSlope r L ε).continuous (ballSlope_nonneg hr L ε) (le_of_not_ge hs) + + theorem ballHeight_lower {r : ℝ} (hr : 0 ≤ r) (L : ℝ) {ε : ℝ} (hε : 0 < ε) (hL : 4*ε ≤ L) : + r*(L-4*ε) ≤ ballHeight r L ε := by + have hm := primitive_mono (contDiff_ballSlope r L ε).continuous (ballSlope_nonneg hr L ε) + have hn := ballProfile_nonneg hr L hε (2*ε) + have hc := (contDiff_ballSlope r L ε).continuous + have hi := intervalIntegral.integral_add_adjacent_intervals + (hc.intervalIntegrable (μ := volume) 0 (2*ε)) (hc.intervalIntegrable (μ := volume) (2*ε) (L-2*ε)) + have he : (∫ t in (2*ε)..(L-2*ε), ballSlope r L ε t) = r*(L-4*ε) := by + calc + _ = ∫ _t in (2*ε)..(L-2*ε), r := intervalIntegral.integral_congr (fun t ht => by + rw [Set.uIcc_of_le (by linarith)] at ht + exact ballSlope_middle r L hε ht.1 ht.2) + _ = _ := by simp; ring + change ballProfile r L ε (2*ε)+_ = ballProfile r L ε (L-2*ε) at hi + rw [he] at hi + have hmono : ballProfile r L ε (L-2*ε) ≤ ballHeight r L ε := hm (by linarith) + linarith + + theorem exists_ball_parameters {A L : ℝ} (hA : 0 ≤ A) (hL : 0 < L) (hAL : A < Real.pi*L) : + ∃ r ε : ℝ, 0 < r ∧ r < Real.pi ∧ 0 < ε ∧ 4*ε < L ∧ A < r*(L-4*ε) := by + obtain ⟨r,hrA,hrπ⟩ := exists_between ((div_lt_iff₀ hL).mpr (by simpa [mul_comm] using hAL)) + have hr : 0 < r := lt_of_le_of_lt (div_nonneg hA hL.le) hrA + have hrl : A < r*L := (div_lt_iff₀ hL).mp hrA + let ε := (r*L-A)/(8*r) + have hε : 0 < ε := div_pos (sub_pos.mpr hrl) (by positivity) + have he : 8*r*ε = r*L-A := by dsimp [ε]; field_simp + refine ⟨r,ε,hr,hrπ,hε,?_,?_⟩ <;> nlinarith + +end +end SmoothProfiles + +end NonsqueezingInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/StripEmbedding.lean b/lean/OAI/Geometry/PolarProducts/StripEmbedding.lean new file mode 100644 index 0000000000000000000000000000000000000000..2b059d70f5928eff182ec01d9bb2a10c35beca4a --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/StripEmbedding.lean @@ -0,0 +1,326 @@ +import OAI.Geometry.PolarProducts.StripMaps + +namespace OAI + +universe u61 u62 u63 u64 u65 u66 u67 u68 u69 + +section LowerBoundInline +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter Metric +open scoped Topology ContDiff +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal +open Set Filter Function +open scoped Topology ContDiff +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter +open scoped Topology ContDiff +open Set Filter Function +open scoped Topology ContDiff +open Set Filter Function +open scoped ContDiff Topology +open Set MeasureTheory +open scoped ContDiff Interval Topology +open Set +open scoped Topology ContDiff +open Set +open Set MeasureTheory +open scoped ContDiff Interval Topology +open Set Filter Complex +open scoped Topology ContDiff +open MeasureTheory intervalIntegral Set +open scoped Real + +namespace PolarStrips +open Set ComplexCoordinates +open scoped ContDiff +noncomputable section +variable {ι : Type u61} {κ : Type u62} [Fintype ι] [Fintype κ] + +def phase (b : κ → R ι) (k : ℕ) (z : C ι) : R ι × R ι := + (im z, -re z - ∑ j, PlanarLens.primitive k (functional (b j) z) • b j) + +theorem contDiffAt_phase (b : κ → R ι) (k : ℕ) {z : C ι} + (hz : z ∈ domain (fun j => functional (b j))) : ContDiffAt ℝ ∞ (phase b k) z := by + change ContDiffAt ℝ ∞ (fun z : C ι => (ComplexCoordinates.im z, -ComplexCoordinates.re z - ∑ j, PlanarLens.primitive k (functional (b j) z) • b j)) z + refine (ComplexCoordinates.im : C ι →L[ℝ] R ι).contDiff.contDiffAt.prodMk + ((ComplexCoordinates.re : C ι →L[ℝ] R ι).contDiff.contDiffAt.neg.sub ?_) + apply ContDiffAt.sum + intro j _ + exact ((PlanarLens.contDiffAt_primitive (hz j) k).comp z + ((functional (b j)).restrictScalars ℝ).contDiff.contDiffAt).smul contDiffAt_const + +theorem momentum_monotonic (b : κ → R ι) (k : ℕ) {z w : C ι} + (hz : z ∈ domain (fun j => functional (b j))) + (hw : w ∈ domain (fun j => functional (b j))) (hx : im z = im w) : + inner (𝕜 := ℝ) ((phase b k w).2-(phase b k z).2) (re w-re z) ≤ -‖re w-re z‖^2 := by + have hj (j : κ) : 0 ≤ + (PlanarLens.primitive k (functional (b j) w)-PlanarLens.primitive k (functional (b j) z)) * + inner (𝕜 := ℝ) (b j) (re w-re z) := by + have ht : (functional (b j) z).im = (functional (b j) w).im := by rw [im_functional, im_functional, hx] + have hv : (((functional (b j) z).re : ℂ)+((functional (b j) w).im : ℂ)*Complex.I) ∈ PlanarLens.D := by + rw [← ht, Complex.re_add_im]; exact hz j + have hh := PlanarLens.J_product_nonneg (w := (functional (b j) w).re) hv (by simpa only [Complex.re_add_im] using hw j) k + simpa only [PlanarLens.primitive, ht, inner_sub_right, ← re_functional] using hh + have he : (phase b k w).2-(phase b k z).2 = -(re w-re z) - + ∑ j, (PlanarLens.primitive k (functional (b j) w)-PlanarLens.primitive k (functional (b j) z)) • b j := by + simp only [phase, sub_smul, Finset.sum_sub_distrib] + abel + rw [he, inner_sub_left, inner_neg_left, real_inner_self_eq_norm_sq] + have hsum : 0 ≤ inner (𝕜 := ℝ) + (∑ j, (PlanarLens.primitive k (functional (b j) w)-PlanarLens.primitive k (functional (b j) z)) • b j) + (re w-re z) := by + simp only [sum_inner, real_inner_smul_left] + exact Finset.sum_nonneg (fun j _ => hj j) + linarith + +theorem injOn_phase (b : κ → R ι) (k : ℕ) : + InjOn (phase b k) (domain (fun j => functional (b j))) := by + intro z hz w hw he + have hx : im z = im w := congrArg Prod.fst he + have hp : (phase b k w).2-(phase b k z).2 = 0 := sub_eq_zero.mpr (congrArg Prod.snd he).symm + have hh := momentum_monotonic b k hz hw hx + rw [hp, inner_zero_left] at hh + have hr : re w = re z := sub_eq_zero.mp (norm_eq_zero.mp (by nlinarith [norm_nonneg (re w-re z)])) + apply parts.injective + exact Prod.ext hr.symm hx + +end +end PolarStrips + +namespace ComplexPotential +open ComplexCoordinates Set Filter +open scoped Topology ContDiff +noncomputable section + +variable {E : Type u63} {F : Type u64} [NormedAddCommGroup E] [InnerProductSpace ℂ E] + [NormedAddCommGroup F] [InnerProductSpace ℂ F] [CompleteSpace F] + +theorem ddc_holomorphic_norm_sq {U : Set E} (hU : IsOpen U) {f : E → F} + (hf : AnalyticOnNhd ℂ f U) {z : E} (hz : z ∈ U) (v w : E) : + let : InnerProductSpace ℝ E := InnerProductSpace.complexToReal + let : InnerProductSpace ℝ F := InnerProductSpace.complexToReal + ddc (complexStructure E) (fun x => ‖f x‖^2) z v w = + standardTensor (complexStructure F) (fderiv ℝ f z v) (fderiv ℝ f z w) := by + let : InnerProductSpace ℝ E := InnerProductSpace.complexToReal + let : InnerProductSpace ℝ F := InnerProductSpace.complexToReal + have he := ddc_comp (complexStructure E) (complexStructure F) + ((hf z hz).contDiffAt.restrict_scalars ℝ) (contDiff_norm_sq ℝ).contDiffAt + (show ∀ᶠ x in 𝓝 z, ∀ a, fderiv ℝ f x (complexStructure E a) = complexStructure F (fderiv ℝ f x a) by + filter_upwards [hU.mem_nhds hz] with x hx + exact fderiv_commutes_complexStructure (hf x hx).differentiableAt) v w + rw [ddc_norm_sq (complexStructure F) complexStructure_skew] at he + exact he + +variable {ι : Type u65} [Fintype ι] + +def phaseForm (v w : R ι × R ι) : ℝ := + inner (𝕜 := ℝ) v.1 w.2-inner (𝕜 := ℝ) w.1 v.2 + +theorem standardTensor_parts (v w : C ι) : + let : InnerProductSpace ℝ (C ι) := InnerProductSpace.complexToReal + standardTensor (complexStructure (C ι)) v w = phaseForm (parts v) (parts w) := by + let : InnerProductSpace ℝ (C ι) := InnerProductSpace.complexToReal + dsimp only + rw [standardTensor_apply, complexStructure_apply, real_inner_parts] + simp only [re_I_smul, im_I_smul, inner_neg_left, phaseForm, parts_apply] + rw [real_inner_comm (im v) (re w)] + ring + +theorem standardTensor_coordinates (v w : C ι) : + let : InnerProductSpace ℝ (C ι) := InnerProductSpace.complexToReal + standardTensor (complexStructure (C ι)) v w = + ∑ i, ((v i).re*(w i).im-(w i).re*(v i).im) := by + dsimp only + rw [standardTensor_parts] + simp [phaseForm, EuclideanSpace.inner_eq_star_dotProduct, dotProduct, Finset.sum_sub_distrib, mul_comm] + +theorem scalar_wedge_mul (c v w : ℂ) : + (c*v).re*(c*w).im-(c*w).re*(c*v).im = + ‖c‖^2*(v.re*w.im-w.re*v.im) := by + rw [Complex.sq_norm] + simp only [Complex.mul_re, Complex.mul_im, Complex.normSq_apply] + ring + +end +end ComplexPotential + +namespace PolarStrips +open Set Filter ComplexCoordinates ComplexPotential +open scoped Topology ContDiff +noncomputable section +variable {ι : Type u66} {κ : Type u67} [Fintype ι] [Fintype κ] + +theorem fderiv_tuple_apply (ℓ : κ → C ι →L[ℂ] ℂ) (k : ℕ) {z : C ι} + (hz : z ∈ domain ℓ) (v : C ι) (j : κ) : + fderiv ℝ (tuple ℓ k) z v j = + (k : ℂ)*PlanarLens.g (ℓ j z)^(k-1)*deriv PlanarLens.g (ℓ j z)*ℓ j v := by + have ht := ((analyticOnNhd_tuple ℓ k z hz).differentiableAt.restrictScalars ℝ).hasFDerivAt + have hp := (((PiLp.proj (𝕜 := ℂ) 2 (fun _ : κ => ℂ) j).restrictScalars ℝ).hasFDerivAt.comp z ht) + have hg := ((PlanarLens.analyticOnNhd_g _ (hz j)).differentiableAt.hasDerivAt.pow k).hasFDerivAt + have hc := (hg.comp z (ℓ j).hasFDerivAt).restrictScalars ℝ + have he := hc.unique hp + have hh := congrArg (fun L : C ι →L[ℝ] ℂ => L v) he + change (ℓ j v)*((k : ℂ)*PlanarLens.g (ℓ j z)^(k-1)*deriv PlanarLens.g (ℓ j z)) = + fderiv ℝ (tuple ℓ k) z v j at hh + simpa only [mul_comm, mul_left_comm, mul_assoc] using hh.symm + +theorem norm_coefficient (k : ℕ) (w : ℂ) : + ‖(k : ℂ)*PlanarLens.g w^(k-1)*deriv PlanarLens.g w‖^2 = + (k : ℝ)^2*PlanarLens.density k w := by + simp only [norm_mul, norm_pow, Complex.norm_natCast, mul_pow, ← pow_mul, PlanarLens.density] + have he : (k-1)*2 = 2*k-2 := by omega + rw [he] + ring + +theorem fderiv_phase_apply (b : κ → R ι) (k : ℕ) {z : C ι} + (hz : z ∈ domain (fun j => functional (b j))) (v : C ι) : + fderiv ℝ (phase b k) z v = (im v, -re v - ∑ j, + fderiv ℝ (PlanarLens.primitive k) (functional (b j) z) (functional (b j) v) • b j) := by + let L : κ → C ι →L[ℝ] R ι := fun j => + ((fderiv ℝ (PlanarLens.primitive k) (functional (b j) z)).comp + ((functional (b j)).restrictScalars ℝ)).smulRight (b j) + have hj (j : κ) : HasFDerivAt (fun x : C ι => PlanarLens.primitive k (functional (b j) x) • b j) (L j) z := + (((PlanarLens.contDiffAt_primitive (hz j) k).differentiableAt (by simp)).hasFDerivAt.comp z + ((functional (b j)).restrictScalars ℝ).hasFDerivAt).smul_const (b j) + have hs : HasFDerivAt (fun x : C ι => ∑ j, PlanarLens.primitive k (functional (b j) x) • b j) + (∑ j, L j) z := by + simpa only [Finset.sum_fn] using (HasFDerivAt.sum (u := Finset.univ) (fun j _ => hj j)) + have hd : HasFDerivAt (phase b k) + ((im : C ι →L[ℝ] R ι).prod (-(re : C ι →L[ℝ] R ι)-∑ j, L j)) z := + im.hasFDerivAt.prodMk (re.hasFDerivAt.neg.sub hs) + rw [hd.fderiv] + simp only [ContinuousLinearMap.prod_apply, sub_apply, + neg_apply, sum_apply, L, + ContinuousLinearMap.smulRight_apply, ContinuousLinearMap.comp_apply] + rfl + +theorem phase_form_formula (b : κ → R ι) (k : ℕ) {z : C ι} + (hz : z ∈ domain (fun j => functional (b j))) (v w : C ι) : + phaseForm (fderiv ℝ (phase b k) z v) (fderiv ℝ (phase b k) z w) = + phaseForm (parts v) (parts w) + ∑ j, + (k : ℝ)^2*PlanarLens.density k (functional (b j) z) * + ((functional (b j) v).re*(functional (b j) w).im - + (functional (b j) w).re*(functional (b j) v).im) := by + rw [fderiv_phase_apply b k hz, fderiv_phase_apply b k hz] + have he (a : C ι) (j : κ) : inner (𝕜 := ℝ) (im a) (b j) = (functional (b j) a).im := by + rw [real_inner_comm, im_functional] + have hf : phaseForm (im v, -re v - ∑ j, + fderiv ℝ (PlanarLens.primitive k) (functional (b j) z) (functional (b j) v) • b j) + (im w, -re w - ∑ j, + fderiv ℝ (PlanarLens.primitive k) (functional (b j) z) (functional (b j) w) • b j) = + phaseForm (parts v) (parts w) + ∑ j, + (fderiv ℝ (PlanarLens.primitive k) (functional (b j) z) (functional (b j) v) * (functional (b j) w).im - + fderiv ℝ (PlanarLens.primitive k) (functional (b j) z) (functional (b j) w) * (functional (b j) v).im) := by + simp only [phaseForm, parts_apply, inner_sub_right, inner_neg_right, inner_sum, + real_inner_smul_right, he, Finset.sum_sub_distrib] + rw [real_inner_comm (im v) (re w), real_inner_comm (im w) (re v)] + ring + rw [hf] + congr 1 + apply Finset.sum_congr rfl + intro j _ + rw [PlanarLens.fderiv_primitive_apply (hz j) k (functional (b j) v), + PlanarLens.fderiv_primitive_apply (hz j) k (functional (b j) w)] + ring + +theorem phase_pullback (b : κ → R ι) (k : ℕ) {z : C ι} + (hz : z ∈ domain (fun j => functional (b j))) (v w : C ι) : + let : InnerProductSpace ℝ (C ι) := InnerProductSpace.complexToReal + phaseForm (fderiv ℝ (phase b k) z v) (fderiv ℝ (phase b k) z w) = + ddc (complexStructure (C ι)) (fun x => ‖x‖^2 + ‖tuple (fun j => functional (b j)) k x‖^2) z v w := by + let : InnerProductSpace ℝ (C ι) := InnerProductSpace.complexToReal + let : InnerProductSpace ℝ (C κ) := InnerProductSpace.complexToReal + let ℓ := fun j => functional (b j) + have hτ : ContDiffAt ℝ ∞ (fun x => ‖tuple ℓ k x‖^2) z := + ((analyticOnNhd_tuple ℓ k z hz).contDiffAt.restrict_scalars ℝ).norm_sq ℂ + dsimp only + rw [ddc_add _ (contDiff_norm_sq ℝ).contDiffAt hτ, + add_apply, add_apply, + ddc_norm_sq _ complexStructure_skew, + ddc_holomorphic_norm_sq (isOpen_domain ℓ) (analyticOnNhd_tuple ℓ k) hz, + standardTensor_parts v w, + standardTensor_coordinates (fderiv ℝ (tuple ℓ k) z v) (fderiv ℝ (tuple ℓ k) z w), + phase_form_formula b k hz] + congr 1 + apply Finset.sum_congr rfl + intro j _ + rw [fderiv_tuple_apply ℓ k hz v j, fderiv_tuple_apply ℓ k hz w j, scalar_wedge_mul, norm_coefficient] + +end +end PolarStrips + +namespace ConvexPolar +open Set Filter +open scoped Topology +noncomputable section +variable {E : Type u68} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +def polar (K : Set E) : Set E := {p | ∀ q ∈ K, inner (𝕜 := ℝ) q p ≤ 1} + +theorem polar_antitone {K L : Set E} (h : K ⊆ L) : polar L ⊆ polar K := + fun _ hp q hq => hp q (h hq) + +theorem mem_interior_polar_of_bound {K : Set E} {p : E} {B r : ℝ} + (hB : 0 ≤ B) (hbound : ∀ q ∈ K, ‖q‖ ≤ B) (hr : r < 1) + (hp : ∀ q ∈ K, inner (𝕜 := ℝ) q p ≤ r) : p ∈ interior (polar K) := by + let δ := (1-r)/(B+1) + have hδ : 0 < δ := div_pos (by linarith) (by linarith) + apply mem_interior_iff_mem_nhds.mpr + apply mem_of_superset (Metric.ball_mem_nhds p hδ) + intro w hw q hq + have hw' : ‖w-p‖ < δ := by simpa only [Metric.mem_ball, dist_eq_norm] using hw + have hinner := real_inner_le_norm q (w-p) + have hbq := hbound q hq + have hmul : ‖q‖*‖w-p‖ ≤ (B+1)*δ := by + calc + ‖q‖*‖w-p‖ ≤ B*δ := mul_le_mul hbq hw'.le (norm_nonneg _) hB + _ ≤ (B+1)*δ := mul_le_mul_of_nonneg_right (by linarith) hδ.le + have hδeq : (B+1)*δ = 1-r := by dsimp [δ]; field_simp + rw [inner_sub_right] at hinner + linarith [hp q hq] + +variable {κ : Type u69} + +def stripBody (b : κ → E) : Set E := {x | ∀ j, |inner (𝕜 := ℝ) (b j) x| ≤ 1} + +variable [Fintype κ] + +theorem mem_interior_stripBody (b : κ → E) {x : E} + (hx : ∀ j, |inner (𝕜 := ℝ) (b j) x| < 1) : x ∈ interior (stripBody b) := by + let U : Set E := {y | ∀ j, |inner (𝕜 := ℝ) (b j) y| < 1} + have hopen : IsOpen U := by + have he : U = ⋂ j, {y | |inner (𝕜 := ℝ) (b j) y| < 1} := by ext y; simp [U] + rw [he] + apply isOpen_iInter_of_finite + intro j + exact isOpen_lt (by fun_prop) continuous_const + exact mem_interior_iff_mem_nhds.mpr + (mem_of_superset (hopen.mem_nhds hx) (fun y hy j => (hy j).le)) + +theorem zero_mem_interior_stripBody (b : κ → E) : (0 : E) ∈ interior (stripBody b) := + mem_interior_stripBody b (by intro j; simp) + +variable [FiniteDimensional ℝ E] + +omit [Fintype κ] in +theorem isCompact_stripBody (b : κ → E) + (hb : Function.Injective (fun x : E => fun j => inner (𝕜 := ℝ) (b j) x)) : + IsCompact (stripBody b) := by + let L : E →L[ℝ] (κ → ℝ) := ContinuousLinearMap.pi (fun j => innerSL ℝ (b j)) + have hL : Topology.IsClosedEmbedding L := + LinearMap.isClosedEmbedding_of_injective (LinearMap.ker_eq_bot.mpr hb) + have hc := hL.isCompact_preimage (isCompact_pi_infinite (fun _ : κ => isCompact_Icc (a := (-1 : ℝ)) (b := 1))) + convert hc using 1 + ext x + simp only [stripBody, mem_ofPred_eq, mem_preimage, ContinuousLinearMap.pi_apply, innerSL_apply_apply, + mem_Icc, ← abs_le, L] + +end +end ConvexPolar + +end LowerBoundInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/StripMaps.lean b/lean/OAI/Geometry/PolarProducts/StripMaps.lean new file mode 100644 index 0000000000000000000000000000000000000000..38fed6a5084ef8b0272515b1d60a85a71fcdbfba --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/StripMaps.lean @@ -0,0 +1,325 @@ +import OAI.Geometry.PolarProducts.LensBounds + +namespace OAI + +universe u55 u56 u57 u58 u59 u60 + +section LowerBoundInline +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter Metric +open scoped Topology ContDiff +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal +open Set Filter Function +open scoped Topology ContDiff +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter +open scoped Topology ContDiff +open Set Filter Function +open scoped Topology ContDiff +open Set Filter Function +open scoped ContDiff Topology +open Set MeasureTheory +open scoped ContDiff Interval Topology +open Set +open scoped Topology ContDiff +open Set +open Set MeasureTheory +open scoped ContDiff Interval Topology +open Set Filter Complex +open scoped Topology ContDiff +open MeasureTheory intervalIntegral Set +open scoped Real + +namespace PolarStrips +open Set Filter Asymptotics +open scoped Topology ContDiff +noncomputable section + +variable {E : Type u55} [NormedAddCommGroup E] [NormedSpace ℂ E] +variable {ι : Type u56} [Fintype ι] + +def domain (ℓ : ι → E →L[ℂ] ℂ) : Set E := {z | ∀ j, ℓ j z ∈ PlanarLens.D} + +def tuple (ℓ : ι → E →L[ℂ] ℂ) (k : ℕ) (z : E) : EuclideanSpace ℂ ι := + (EuclideanSpace.equiv ι ℂ).symm (fun j => PlanarLens.g (ℓ j z)^k) + +omit [Fintype ι] in +@[simp] theorem tuple_apply (ℓ : ι → E →L[ℂ] ℂ) (k : ℕ) (z : E) (j : ι) : + tuple ℓ k z j = PlanarLens.g (ℓ j z)^k := rfl + +theorem norm_tuple_sq (ℓ : ι → E →L[ℂ] ℂ) (k : ℕ) (z : E) : + ‖tuple ℓ k z‖^2 = ∑ j, ‖PlanarLens.g (ℓ j z)‖^(2*k) := by + rw [EuclideanSpace.norm_sq_eq] + apply Finset.sum_congr rfl + intro j _ + change ‖PlanarLens.g (ℓ j z)^k‖^2 = _ + rw [norm_pow, ← pow_mul, Nat.mul_comm k 2] + +theorem isOpen_domain (ℓ : ι → E →L[ℂ] ℂ) : IsOpen (domain ℓ) := by + have he : domain ℓ = ⋂ j, (ℓ j) ⁻¹' PlanarLens.D := by ext z; simp [domain] + rw [he] + exact isOpen_iInter_of_finite (fun j => PlanarLens.isOpen_D.preimage (ℓ j).continuous) + +omit [Fintype ι] in +theorem zero_mem_domain (ℓ : ι → E →L[ℂ] ℂ) : (0 : E) ∈ domain ℓ := by + intro j + simpa using PlanarLens.zero_mem_D + +theorem analyticOnNhd_tuple (ℓ : ι → E →L[ℂ] ℂ) (k : ℕ) : + AnalyticOnNhd ℂ (tuple ℓ k) (domain ℓ) := by + intro z hz + apply ((EuclideanSpace.equiv ι ℂ).symm.toContinuousLinearMap.analyticAt _).comp + exact AnalyticAt.pi (fun j => ((PlanarLens.analyticOnNhd_g _ (hz j)).comp ((ℓ j).analyticAt z)).pow k) + +omit [Fintype ι] in +theorem tuple_zero_iff (ℓ : ι → E →L[ℂ] ℂ) + (hℓ : Function.Injective (fun z => fun j => ℓ j z)) {k : ℕ} (hk : 1 ≤ k) + {z : E} (hz : z ∈ domain ℓ) : tuple ℓ k z = 0 ↔ z = 0 := by + constructor + · intro hf + apply hℓ + funext j + have hj := congrArg (fun w : EuclideanSpace ℂ ι => w j) hf + have hg : PlanarLens.g (ℓ j z) = 0 := (pow_eq_zero_iff (by omega : k ≠ 0)).mp (by simpa using hj) + simpa using (PlanarLens.g_eq_zero_iff (hz j)).mp hg + · rintro rfl + ext j + simp only [tuple_apply, map_zero, PlanarLens.g_zero, zero_pow (by omega : k ≠ 0)] + rfl + +theorem tuple_order (ℓ : ι → E →L[ℂ] ℂ) (k : ℕ) : + tuple ℓ k =O[𝓝 (0 : E)] (fun z : E => ‖z‖^k) := by + have hc (j : ι) : (fun z => PlanarLens.g (ℓ j z)) =O[𝓝 (0 : E)] (fun z : E => ‖z‖) := by + have ha : AnalyticAt ℂ (fun z => PlanarLens.g (ℓ j z)) (0 : E) := + (PlanarLens.analyticOnNhd_g _ (by simpa using PlanarLens.zero_mem_D)).comp ((ℓ j).analyticAt 0) + have hh := ha.differentiableAt.isBigO_sub.norm_right + simpa only [map_zero, PlanarLens.g_zero, sub_zero] using hh + have hp : (fun z j => PlanarLens.g (ℓ j z)^k) =O[𝓝 (0 : E)] (fun z : E => ‖z‖^k) := + isBigO_pi.mpr (fun j => (hc j).pow k) + exact ((EuclideanSpace.equiv ι ℂ).symm.toContinuousLinearMap.isBigO_comp + (fun z j => PlanarLens.g (ℓ j z)^k) _).trans hp + +variable [FiniteDimensional ℂ E] + +omit [Fintype ι] in + +theorem isBounded_domain (ℓ : ι → E →L[ℂ] ℂ) + (hℓ : Function.Injective (fun z => fun j => ℓ j z)) : Bornology.IsBounded (domain ℓ) := by + let L : E →L[ℂ] (ι → ℂ) := ContinuousLinearMap.pi ℓ + have hL : Topology.IsClosedEmbedding L := + LinearMap.isClosedEmbedding_of_injective (LinearMap.ker_eq_bot.mpr hℓ) + let C := PlanarLens.F '' Metric.closedBall (0 : ℂ) 1 + have hC : IsCompact C := (isCompact_closedBall (0 : ℂ) 1).image_of_continuousOn + PlanarLens.continuousOn_F_closedBall + have hc : IsCompact (L ⁻¹' {f : ι → ℂ | ∀ j, f j ∈ C}) := + hL.isCompact_preimage (isCompact_pi_infinite (fun _ => hC)) + apply hc.isBounded.subset + intro z hz j + exact image_mono Metric.ball_subset_closedBall (hz j) + +omit [Fintype ι] in + +theorem compact_inner_preimage (ℓ : ι → E →L[ℂ] ℂ) + (hℓ : Function.Injective (fun z => fun j => ℓ j z)) {r : ℝ} (hr : r < 1) : + IsCompact {z : E | ∀ j, ℓ j z ∈ PlanarLens.F '' Metric.closedBall (0 : ℂ) r} := by + let L : E →L[ℂ] (ι → ℂ) := ContinuousLinearMap.pi ℓ + have hL : Topology.IsClosedEmbedding L := + LinearMap.isClosedEmbedding_of_injective (LinearMap.ker_eq_bot.mpr hℓ) + have hC : IsCompact (PlanarLens.F '' Metric.closedBall (0 : ℂ) r) := + (isCompact_closedBall (0 : ℂ) r).image_of_continuousOn + (PlanarLens.continuousOn_F_closedBall.mono (Metric.closedBall_subset_closedBall hr.le)) + have hc := hL.isCompact_preimage (isCompact_pi_infinite (fun _ : ι => hC)) + exact hc + +theorem compact_sublevel (ℓ : ι → E →L[ℂ] ℂ) + (hℓ : Function.Injective (fun z => fun j => ℓ j z)) {k : ℕ} (hk : 1 ≤ k) + {s : ℝ} (hs : 0 < s) (hs1 : s < 1) : + IsCompact {z : E | z ∈ domain ℓ ∧ ‖tuple ℓ k z‖^2 ≤ s} := by + have hk0 : 2*k ≠ 0 := by omega + have hval : (s+1)/2 ∈ Icc ((0 : ℝ)^(2*k)) ((1 : ℝ)^(2*k)) := by + simp only [zero_pow hk0, one_pow] + constructor <;> linarith + obtain ⟨r, hr, hre⟩ := intermediate_value_Icc (by norm_num : (0 : ℝ) ≤ 1) + (f := fun r : ℝ => r^(2*k)) (by fun_prop) hval + dsimp only at hre + have hr0 : 0 ≤ r := hr.1 + have hr1 : r < 1 := by + by_contra hn + have her : r = 1 := le_antisymm hr.2 (le_of_not_gt hn) + rw [her, one_pow] at hre + linarith + let C := {z : E | ∀ j, ℓ j z ∈ PlanarLens.F '' Metric.closedBall (0 : ℂ) r} + have hC : IsCompact C := compact_inner_preimage ℓ hℓ hr1 + have hCD : C ⊆ domain ℓ := by + intro z hz j + rcases hz j with ⟨w, hw, he⟩ + refine ⟨w, ?_, he⟩ + have hw' : ‖w‖ ≤ r := by simpa using hw + simpa using hw'.trans_lt hr1 + have hsub : ∀ z ∈ domain ℓ, ‖tuple ℓ k z‖^2 ≤ s → z ∈ C := by + intro z hz hzs j + have hcoord : ‖PlanarLens.g (ℓ j z)‖^(2*k) ≤ ‖tuple ℓ k z‖^2 := by + have hh := pow_le_pow_left₀ (norm_nonneg _) (PiLp.norm_apply_le (tuple ℓ k z) j) 2 + simpa only [tuple_apply, norm_pow, ← pow_mul, Nat.mul_comm k 2] using hh + have hp : ‖PlanarLens.g (ℓ j z)‖^(2*k) ≤ r^(2*k) := by linarith + have hn : ‖PlanarLens.g (ℓ j z)‖ ≤ r := (pow_le_pow_iff_left₀ (norm_nonneg _) hr0 hk0).mp hp + exact ⟨PlanarLens.g (ℓ j z), by simpa using hn, PlanarLens.F_g (hz j)⟩ + let : CompactSpace C := isCompact_iff_compactSpace.mp hC + have hcont : Continuous (fun z : C => ‖tuple ℓ k z‖^2) := + ((analyticOnNhd_tuple ℓ k).continuousOn.mono hCD).domRestrict.norm.pow 2 + have hclosed : IsClosed {z : C | ‖tuple ℓ k z‖^2 ≤ s} := isClosed_le hcont continuous_const + have hc := hclosed.isCompact.image continuous_subtype_val + convert hc using 1 + ext z + constructor + · intro hz + exact ⟨⟨z, hsub z hz.1 hz.2⟩, hz.2, rfl⟩ + · rintro ⟨z, hz, rfl⟩ + exact ⟨hCD z.2, hz⟩ + +end +end PolarStrips + +namespace ComplexCoordinates +open scoped ComplexConjugate ContDiff +noncomputable section +variable {ι : Type u57} [Fintype ι] +abbrev R (ι : Type u58) := EuclideanSpace ℝ ι +abbrev C (ι : Type u59) := EuclideanSpace ℂ ι + +def re : C ι →L[ℝ] R ι := + LinearMap.toContinuousLinearMap { + toFun := fun z => (EuclideanSpace.equiv ι ℝ).symm (fun i => (z i).re) + map_add' := by intro x y; ext i; simp + map_smul' := by intro a x; ext i; simp } + +def im : C ι →L[ℝ] R ι := + LinearMap.toContinuousLinearMap { + toFun := fun z => (EuclideanSpace.equiv ι ℝ).symm (fun i => (z i).im) + map_add' := by intro x y; ext i; simp + map_smul' := by intro a x; ext i; simp } + +@[simp] theorem re_apply (z : C ι) (i : ι) : re z i = (z i).re := rfl +@[simp] theorem im_apply (z : C ι) (i : ι) : im z i = (z i).im := rfl + +def parts : C ι ≃L[ℝ] R ι × R ι := + LinearEquiv.toContinuousLinearEquiv { + toFun := fun z => (re z, im z) + invFun := fun p => (EuclideanSpace.equiv ι ℂ).symm (fun i => (p.1 i : ℂ)+(p.2 i : ℂ)*Complex.I) + left_inv := by intro z; ext i; simp [Complex.re_add_im] + right_inv := by intro p; ext i <;> simp + map_add' := by intros; simp + map_smul' := by intros; simp } + +@[simp] theorem parts_apply (z : C ι) : parts z = (re z, im z) := rfl +@[simp] theorem parts_symm_apply (x y : R ι) (i : ι) : + parts.symm (x,y) i = (x i : ℂ)+(y i : ℂ)*Complex.I := rfl + +def functional (b : R ι) : C ι →L[ℂ] ℂ := + LinearMap.toContinuousLinearMap { + toFun := fun z => ∑ i, (b i : ℂ)*z i + map_add' := by intro x y; simp [mul_add, Finset.sum_add_distrib] + map_smul' := by intro a x; simp [mul_left_comm, Finset.mul_sum] } + +@[simp] theorem functional_apply (b : R ι) (z : C ι) : functional b z = ∑ i, (b i : ℂ)*z i := rfl + +theorem re_functional (b : R ι) (z : C ι) : + (functional b z).re = inner (𝕜 := ℝ) b (re z) := by + simp [functional_apply, EuclideanSpace.inner_eq_star_dotProduct, dotProduct, mul_comm] + +theorem im_functional (b : R ι) (z : C ι) : + (functional b z).im = inner (𝕜 := ℝ) b (im z) := by + simp [functional_apply, EuclideanSpace.inner_eq_star_dotProduct, dotProduct, mul_comm] + +theorem norm_sq_parts (z : C ι) : ‖z‖^2 = ‖re z‖^2+‖im z‖^2 := by + simp only [EuclideanSpace.norm_sq_eq, re_apply, im_apply, Real.norm_eq_abs, sq_abs, + Complex.sq_norm, Complex.normSq_apply, ← pow_two, Finset.sum_add_distrib] + +theorem real_inner_parts (z w : C ι) : + let : InnerProductSpace ℝ (C ι) := InnerProductSpace.complexToReal + inner (𝕜 := ℝ) z w = inner (𝕜 := ℝ) (re z) (re w)+inner (𝕜 := ℝ) (im z) (im w) := by + let : InnerProductSpace ℝ (C ι) := InnerProductSpace.complexToReal + simp [real_inner_eq_re_inner, EuclideanSpace.inner_eq_star_dotProduct, dotProduct, + Finset.sum_add_distrib] + +@[simp] theorem re_I_smul (z : C ι) : re (Complex.I • z) = -im z := by + ext i; simp [Complex.mul_re] +@[simp] theorem im_I_smul (z : C ι) : im (Complex.I • z) = re z := by + ext i; simp [Complex.mul_im] + +theorem functional_injective {κ : Type u60} (b : κ → R ι) + (hb : Function.Injective (fun x : R ι => fun j => inner (𝕜 := ℝ) (b j) x)) : + Function.Injective (fun z : C ι => fun j => functional (b j) z) := by + intro z w h + apply parts.injective + apply Prod.ext + · apply hb + funext j + have hh := congrArg Complex.re (congrFun h j) + simpa only [re_functional, parts_apply] using hh + · apply hb + funext j + have hh := congrArg Complex.im (congrFun h j) + simpa only [im_functional, parts_apply] using hh + +end +end ComplexCoordinates + +namespace PlanarLens +open Set Filter Complex MeasureTheory +open scoped Topology ContDiff +noncomputable section + +def primitive (k : ℕ) (z : ℂ) : ℝ := J k z.re z.im + +theorem contDiffAt_primitive {z : ℂ} (hz : z ∈ D) (k : ℕ) : + ContDiffAt ℝ ∞ (primitive k) z := + (contDiffOn_J k).contDiffAt (isOpen_D.mem_nhds hz) + +theorem J_mono {v w t : ℝ} (hv : (v : ℂ)+(t : ℂ)*I ∈ D) + (hw : (w : ℂ)+(t : ℂ)*I ∈ D) (hvw : v ≤ w) (k : ℕ) : J k v t ≤ J k w t := by + have hi := (integrable_density hv k).symm.trans (integrable_density hw k) + have he := intervalIntegral.integral_add_adjacent_intervals (integrable_density hv k) hi + have hp : 0 ≤ ∫ h in v..w, density k ((h : ℂ)+(t : ℂ)*I) := + intervalIntegral.integral_nonneg hvw (fun _ _ => density_nonneg _ _) + unfold J + apply mul_le_mul_of_nonneg_left _ (sq_nonneg _) + linarith + +theorem J_product_nonneg {v w t : ℝ} (hv : (v : ℂ)+(t : ℂ)*I ∈ D) + (hw : (w : ℂ)+(t : ℂ)*I ∈ D) (k : ℕ) : + 0 ≤ (J k w t-J k v t)*(w-v) := by + rcases le_total v w with h | h + · exact mul_nonneg (sub_nonneg.mpr (J_mono hv hw h k)) (sub_nonneg.mpr h) + · exact mul_nonneg_of_nonpos_of_nonpos (sub_nonpos.mpr (J_mono hw hv h k)) (sub_nonpos.mpr h) + +theorem fderiv_primitive_one {z : ℂ} (hz : z ∈ D) (k : ℕ) : + fderiv ℝ (primitive k) z 1 = (k : ℝ)^2*density k z := by + have hp := (contDiffAt_primitive hz k).differentiableAt (by simp) + have hd : HasDerivAt (fun v : ℝ => (v : ℂ)+(z.im : ℂ)*I) 1 z.re := + by simpa using ((hasDerivAt_id (z.re : ℂ)).comp_ofReal.add_const ((z.im : ℂ)*I)) + have hp' : HasFDerivAt (primitive k) (fderiv ℝ (primitive k) z) ((z.re : ℂ)+(z.im : ℂ)*I) := by + simpa only [Complex.re_add_im] using hp.hasFDerivAt + have hh := hp'.comp_hasDerivAt z.re hd + have hj := hasDerivAt_J (v := z.re) (t := z.im) (by simpa only [Complex.re_add_im] using hz) k + have hh' : HasDerivAt (fun v => J k v z.im) (fderiv ℝ (primitive k) z 1) z.re := by + simpa [primitive, Function.comp_def] using hh + simpa only [Complex.re_add_im] using hh'.unique hj + +theorem fderiv_primitive_apply {z : ℂ} (hz : z ∈ D) (k : ℕ) (h : ℂ) : + fderiv ℝ (primitive k) z h = + (k : ℝ)^2*density k z * h.re + fderiv ℝ (primitive k) z I * h.im := by + have he : h = h.re • (1 : ℂ)+h.im • I := by apply Complex.ext <;> simp + calc + fderiv ℝ (primitive k) z h = fderiv ℝ (primitive k) z (h.re • (1 : ℂ)+h.im • I) := congrArg _ he + _ = _ := by simp only [map_add, map_smul, smul_eq_mul, fderiv_primitive_one hz k]; ring + +end +end PlanarLens + +end LowerBoundInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/TensorCalculus.lean b/lean/OAI/Geometry/PolarProducts/TensorCalculus.lean new file mode 100644 index 0000000000000000000000000000000000000000..4d4064314d3df02875a0f2e761fa35425a4897f3 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/TensorCalculus.lean @@ -0,0 +1,225 @@ +import OAI.Geometry.PolarProducts.SmoothFlow + +namespace OAI + +universe u17 u18 u19 u20 u21 u22 + +section LowerBoundInline +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter Metric +open scoped Topology ContDiff +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal + +open Set Filter Function +open scoped Topology ContDiff + +namespace TensorCalculus + +variable {E : Type u17} [NormedAddCommGroup E] [NormedSpace ℝ E] + +noncomputable section + +local instance oneTensorGroup : NormedAddCommGroup (E →L[ℝ] ℝ) := inferInstance +local instance oneTensorSpace : NormedSpace ℝ (E →L[ℝ] ℝ) := inferInstance +local instance twoTensorGroup : NormedAddCommGroup (E →L[ℝ] E →L[ℝ] ℝ) := inferInstance +local instance twoTensorSpace : NormedSpace ℝ (E →L[ℝ] E →L[ℝ] ℝ) := inferInstance + +abbrev TwoTensor (E : Type u18) [NormedAddCommGroup E] [NormedSpace ℝ E] := + E →L[ℝ] E →L[ℝ] ℝ + +def evalTensor (a b : E) : TwoTensor E →L[ℝ] ℝ := + (ContinuousLinearMap.apply ℝ ℝ b).comp + (ContinuousLinearMap.apply ℝ (E →L[ℝ] ℝ) a) + +@[simp] theorem evalTensor_apply (a b : E) (B : TwoTensor E) : + evalTensor a b B = B a b := rfl + +theorem fderiv_evalTensor {D : Type u19} [NormedAddCommGroup D] [NormedSpace ℝ D] + {B : D → TwoTensor E} {x : D} (hB : DifferentiableAt ℝ B x) + (d : D) (a b : E) : fderiv ℝ (fun y => B y a b) x d = fderiv ℝ B x d a b := by + rw [fderiv_clm_apply (hB.clm_apply (differentiableAt_const a)) + (differentiableAt_const b)] + rw [fderiv_clm_apply hB (differentiableAt_const a)] + simp + +theorem fderiv_skew {B : E → TwoTensor E} (hB : Differentiable ℝ B) + (hsk : ∀ x a b, B x a b = -B x b a) (x d a b : E) : + fderiv ℝ B x d a b = -fderiv ℝ B x d b a := by + have he : (fun y => B y a b) = fun y => -B y b a := funext (fun y => hsk y a b) + have he' := congrArg (fun f : E → ℝ => fderiv ℝ f x d) he + rw [fderiv_fun_neg] at he' + simpa only [fderiv_evalTensor (hB x), neg_apply] using he' + +theorem derivative_kernel {B : E → TwoTensor E} {V : E → E} + (hB : Differentiable ℝ B) (hV : Differentiable ℝ V) + (hker : ∀ x, B x (V x) = 0) (x a b : E) : + B x (fderiv ℝ V x a) b + fderiv ℝ B x a (V x) b = 0 := by + have hd : HasFDerivAt (fun y => B y (V y)) + ((B x).comp (fderiv ℝ V x) + (fderiv ℝ B x).flip (V x)) x := + (hB x).hasFDerivAt.clm_apply (hV x).hasFDerivAt + have hz : HasFDerivAt (fun y => B y (V y)) 0 x := + (hasFDerivAt_const (𝕜 := ℝ) (0 : E →L[ℝ] ℝ) x).congr_of_eventuallyEq + (Filter.Eventually.of_forall hker) + have he := congrArg (fun L : E →L[ℝ] E →L[ℝ] ℝ => L a b) (hd.unique hz) + simpa using he + +theorem invariant_of_closed_kernel {B : E → TwoTensor E} {V : E → E} + (hB : Differentiable ℝ B) (hV : Differentiable ℝ V) + (hsk : ∀ x a b, B x a b = -B x b a) + (hclosed : ∀ x a b c, fderiv ℝ B x a b c + + fderiv ℝ B x b c a + fderiv ℝ B x c a b = 0) + (hker : ∀ x, B x (V x) = 0) (x a b : E) : + fderiv ℝ B x (V x) a b + B x (fderiv ℝ V x a) b + + B x a (fderiv ℝ V x b) = 0 := by + have h1 := derivative_kernel hB hV hker x a b + have h2 := derivative_kernel hB hV hker x b a + have h3 := hclosed x (V x) a b + have h4 := fderiv_skew hB hsk x a b (V x) + have h5 := hsk x a (fderiv ℝ V x b) + linarith + +theorem fderiv_skew_at {B : E → TwoTensor E} {x : E} (hB : DifferentiableAt ℝ B x) + (hsk : ∀ᶠ y in 𝓝 x, ∀ a b, B y a b = -B y b a) (d a b : E) : + fderiv ℝ B x d a b = -fderiv ℝ B x d b a := by + have he : (fun y => B y a b) =ᶠ[𝓝 x] (fun y => -B y b a) := + hsk.mono (fun y hy => hy a b) + have he' := congrArg (fun L : E →L[ℝ] ℝ => L d) he.fderiv_eq + rw [fderiv_fun_neg] at he' + simpa only [fderiv_evalTensor hB, neg_apply] using he' + +theorem derivative_kernel_at {B : E → TwoTensor E} {V : E → E} {x : E} + (hB : DifferentiableAt ℝ B x) (hV : DifferentiableAt ℝ V x) + (hker : ∀ᶠ y in 𝓝 x, B y (V y) = 0) (a b : E) : + B x (fderiv ℝ V x a) b + fderiv ℝ B x a (V x) b = 0 := by + have hd : HasFDerivAt (fun y => B y (V y)) + ((B x).comp (fderiv ℝ V x) + (fderiv ℝ B x).flip (V x)) x := + hB.hasFDerivAt.clm_apply hV.hasFDerivAt + have hz : HasFDerivAt (fun y => B y (V y)) 0 x := + (hasFDerivAt_const (𝕜 := ℝ) (0 : E →L[ℝ] ℝ) x).congr_of_eventuallyEq hker + have he := congrArg (fun L : E →L[ℝ] E →L[ℝ] ℝ => L a b) (hd.unique hz) + simpa using he + +theorem invariant_of_closed_kernel_at {B : E → TwoTensor E} {V : E → E} {x : E} + (hB : DifferentiableAt ℝ B x) (hV : DifferentiableAt ℝ V x) + (hsk : ∀ᶠ y in 𝓝 x, ∀ a b, B y a b = -B y b a) + (hclosed : ∀ a b c, fderiv ℝ B x a b c + + fderiv ℝ B x b c a + fderiv ℝ B x c a b = 0) + (hker : ∀ᶠ y in 𝓝 x, B y (V y) = 0) (a b : E) : + fderiv ℝ B x (V x) a b + B x (fderiv ℝ V x a) b + + B x a (fderiv ℝ V x b) = 0 := by + have h1 := derivative_kernel_at hB hV hker a b + have h2 := derivative_kernel_at hB hV hker b a + have h3 := hclosed (V x) a b + have h4 := fderiv_skew_at hB hsk a b (V x) + have h5 := (hsk.self_of_nhds) a (fderiv ℝ V x b) + linarith + +def alt : (E →L[ℝ] E →L[ℝ] ℝ) →L[ℝ] (E →L[ℝ] E →L[ℝ] ℝ) := + ContinuousLinearMap.id ℝ (E →L[ℝ] E →L[ℝ] ℝ) - + (ContinuousLinearMap.flipₗᵢ ℝ E E ℝ).toLinearIsometry.toContinuousLinearMap + +@[simp] theorem alt_apply (B : TwoTensor E) (a b : E) : + alt B a b = B a b - B b a := rfl + +def exteriorD (γ : E → E →L[ℝ] ℝ) (x : E) : TwoTensor E := + alt (fderiv ℝ γ x) + +@[simp] theorem exteriorD_apply (γ : E → E →L[ℝ] ℝ) (x a b : E) : + exteriorD γ x a b = fderiv ℝ γ x a b - fderiv ℝ γ x b a := rfl + +theorem exteriorD_skew (γ : E → E →L[ℝ] ℝ) (x a b : E) : + exteriorD γ x a b = -exteriorD γ x b a := by + simp only [exteriorD_apply]; ring + +theorem fderiv_exteriorD {γ : E → E →L[ℝ] ℝ} {x : E} + (hγ : DifferentiableAt ℝ (fderiv ℝ γ) x) (d a b : E) : + fderiv ℝ (exteriorD γ) x d a b = + fderiv ℝ (fderiv ℝ γ) x d a b - fderiv ℝ (fderiv ℝ γ) x d b a := by + change fderiv ℝ (alt ∘ fderiv ℝ γ) x d a b = _ + rw [fderiv_comp x (ContinuousLinearMap.differentiableAt (alt (E := E))) hγ] + simp + +theorem contDiff_exteriorD {γ : E → E →L[ℝ] ℝ} + (hγ : ContDiff ℝ ∞ γ) : ContDiff ℝ ∞ (exteriorD γ) := by + change ContDiff ℝ ∞ ((alt (E := E)) ∘ fderiv ℝ γ) + exact (alt (E := E)).contDiff.comp (hγ.fderiv_right (m := ∞) (by simp)) + +theorem exteriorD_closed {γ : E → E →L[ℝ] ℝ} {x : E} + (hγ : ContDiffAt ℝ ∞ γ x) (a b c : E) : + fderiv ℝ (exteriorD γ) x a b c + fderiv ℝ (exteriorD γ) x b c a + + fderiv ℝ (exteriorD γ) x c a b = 0 := by + have hd : DifferentiableAt ℝ (fderiv ℝ γ) x := + (hγ.fderiv_right (by simp : (∞ : ℕ∞ω) + 1 ≤ ∞)).differentiableAt (by simp) + have hs := hγ.isSymmSndFDerivAt (by + rw [minSmoothness_of_isRCLikeNormedField] + change ((2 : ℕ∞) : WithTop ℕ∞) ≤ (⊤ : ℕ∞) + exact WithTop.coe_le_coe.mpr le_top) + simp only [fderiv_exteriorD hd] + have h1 := congrArg (fun L : E →L[ℝ] ℝ => L c) (hs.eq a b) + have h2 := congrArg (fun L : E →L[ℝ] ℝ => L a) (hs.eq b c) + have h3 := congrArg (fun L : E →L[ℝ] ℝ => L b) (hs.eq c a) + linarith + +end +end TensorCalculus + +namespace TensorCalculus + +open Set Filter Function +open scoped Topology ContDiff + +variable {E : Type u20} {F : Type u21} {D : Type u22} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] + [NormedAddCommGroup D] [NormedSpace ℝ D] + +noncomputable section + +def pullLinear (L : F →L[ℝ] E) (B : TwoTensor E) : TwoTensor F := + B.bilinearComp L L + +@[simp] theorem pullLinear_apply (L : F →L[ℝ] E) (B : TwoTensor E) (a b : F) : + pullLinear L B a b = B (L a) (L b) := rfl + +theorem contDiffAt_pullLinear (L : F →L[ℝ] E) {B : D → TwoTensor E} {z : D} + (hB : ContDiffAt ℝ ∞ B z) : + ContDiffAt ℝ ∞ (fun x => pullLinear L (B x)) z := by + let P : (E →L[ℝ] ℝ) →L[ℝ] (F →L[ℝ] ℝ) := + (ContinuousLinearMap.compL ℝ F E ℝ).flip L + change ContDiffAt ℝ ∞ (fun x => P.comp ((B x).comp L)) z + exact contDiffAt_const.clm_comp (hB.clm_comp contDiffAt_const) + +theorem fderiv_pullLinear_eval (L : F →L[ℝ] E) {B : D → TwoTensor E} {z : D} + (hB : DifferentiableAt ℝ B z) + (hP : DifferentiableAt ℝ (fun x => pullLinear L (B x)) z) (d : D) (a b : F) : + fderiv ℝ (fun x => pullLinear L (B x)) z d a b = + fderiv ℝ B z d (L a) (L b) := by + rw [← fderiv_evalTensor hP, ← fderiv_evalTensor hB] + rfl + +theorem pullLinear_closed (L : F →L[ℝ] E) {B : E → TwoTensor E} {z : F} + (hB : ContDiffAt ℝ ∞ B (L z)) + (hclosed : ∀ a b c, fderiv ℝ B (L z) a b c + + fderiv ℝ B (L z) b c a + fderiv ℝ B (L z) c a b = 0) (a b c : F) : + fderiv ℝ (fun x => pullLinear L (B (L x))) z a b c + + fderiv ℝ (fun x => pullLinear L (B (L x))) z b c a + + fderiv ℝ (fun x => pullLinear L (B (L x))) z c a b = 0 := by + have hs : ContDiffAt ℝ ∞ (fun x => B (L x)) z := hB.comp z L.contDiff.contDiffAt + have ht := contDiffAt_pullLinear L hs + have he (d u v : F) : + fderiv ℝ (fun x => pullLinear L (B (L x))) z d u v = + fderiv ℝ B (L z) (L d) (L u) (L v) := by + rw [fderiv_pullLinear_eval L (hs.differentiableAt (by simp)) + (ht.differentiableAt (by simp))] + rw [fderiv_fun_comp z (hB.differentiableAt (by simp)) L.differentiableAt] + simp + simp only [he] + exact hclosed (L a) (L b) (L c) + +end +end TensorCalculus + +end LowerBoundInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/TipEstimates.lean b/lean/OAI/Geometry/PolarProducts/TipEstimates.lean new file mode 100644 index 0000000000000000000000000000000000000000..acb5bb2ae47e546a0d36702361582b0800cbc813 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/TipEstimates.lean @@ -0,0 +1,400 @@ +import OAI.Geometry.PolarProducts.HorizontalIntegrals + +namespace OAI + +section LowerBoundInline +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter Metric +open scoped Topology ContDiff +open Set Filter Function MeasureTheory Metric +open scoped Topology ContDiff NNReal +open Set Filter Function +open scoped Topology ContDiff +open Set Filter Function +open scoped Topology ContDiff NNReal +open Set Filter +open scoped Topology ContDiff +open Set Filter Function +open scoped Topology ContDiff +open Set Filter Function +open scoped ContDiff Topology +open Set MeasureTheory +open scoped ContDiff Interval Topology +open Set +open scoped Topology ContDiff +open Set +open Set MeasureTheory +open scoped ContDiff Interval Topology +open Set Filter Complex +open scoped Topology ContDiff + +open MeasureTheory intervalIntegral Set +open scoped Real + +namespace SymmetricPolar +noncomputable section + +def endpointKernel (H y : ℝ) : ℝ := Real.sqrt (y / (H - y)) + +lemma endpointKernel_eq_rpow {H y : ℝ} (hy : 0 ≤ y) (hyH : y ≤ H) : + endpointKernel H y = y ^ (1 / 2 : ℝ) * (H - y) ^ (-(1 / 2 : ℝ)) := by + rw [endpointKernel, Real.sqrt_div hy, Real.sqrt_eq_rpow, Real.sqrt_eq_rpow, + Real.rpow_neg (sub_nonneg.mpr hyH), div_eq_mul_inv] + +lemma intervalIntegrable_endpointKernel {H : ℝ} (hH : 0 ≤ H) : + IntervalIntegrable (endpointKernel H) volume 0 H := by + have hi : IntervalIntegrable (fun y : ℝ => (H - y) ^ (-(1 / 2 : ℝ))) volume 0 H := by + simpa using ((intervalIntegral.intervalIntegrable_rpow' (a := 0) (b := H) + (by norm_num : (-1 : ℝ) < -(1 / 2 : ℝ))).comp_sub_left H).symm + have hm := hi.continuousOn_mul Real.continuous_sqrt.continuousOn + apply IntervalIntegrable.congr (f := fun y => Real.sqrt y * (H - y) ^ (-(1 / 2 : ℝ))) _ hm + intro y hy + rw [uIoc_of_le hH] at hy + dsimp only + rw [endpointKernel_eq_rpow hy.1.le hy.2, Real.sqrt_eq_rpow] + +private lemma beta_three_halves_one_half : + Complex.betaIntegral (3 / 2) (1 / 2) = (Real.pi : ℂ) / 2 := by + rw [Complex.betaIntegral_eq_Gamma_mul_div _ _ (by norm_num) (by norm_num)] + have hG : Complex.Gamma (2 : ℂ) = 1 := by + norm_num [show (2 : ℂ) = 1 + 1 by norm_num, Complex.Gamma_add_one] + have hreflect := Complex.Gamma_mul_Gamma_one_sub (1 / 2) + norm_num at hreflect + rw [show (Real.pi : ℂ) * (1 / 2) = (Real.pi : ℂ) / 2 by ring, + Complex.sin_pi_div_two, div_one] at hreflect + rw [show (3 / 2 : ℂ) + 1 / 2 = 2 by norm_num, hG, div_one, + show (3 / 2 : ℂ) = 1 / 2 + 1 by norm_num, + Complex.Gamma_add_one _ (by norm_num)] + rw [mul_assoc, hreflect] + ring + +lemma integral_endpointKernel {H : ℝ} (hH : 0 < H) : + (∫ y in 0..H, endpointKernel H y) = Real.pi * H / 2 := by + apply Complex.ofReal_injective + rw [← intervalIntegral.integral_ofReal] + have h := Complex.betaIntegral_scaled (3 / 2) (1 / 2) hH + norm_num only at h + rw [beta_three_halves_one_half] at h + have hc : (∫ y in 0..H, (endpointKernel H y : ℂ)) = + ∫ y in 0..H, (y : ℂ) ^ ((3 / 2 : ℂ) - 1) * + ((H : ℂ) - y) ^ ((1 / 2 : ℂ) - 1) := by + apply intervalIntegral.integral_congr + intro y hy + rw [uIcc_of_le hH.le] at hy + dsimp only + rw [endpointKernel_eq_rpow hy.1 hy.2, Complex.ofReal_mul, + Complex.ofReal_cpow hy.1, Complex.ofReal_cpow (sub_nonneg.mpr hy.2), + Complex.ofReal_sub] + norm_num + rw [hc] + norm_num only + rw [h] + norm_num + ring + +lemma endpointKernel_le_one {H y : ℝ} (hH : 0 < H) (_hy : 0 ≤ y) + (hyH : y ≤ H / 2) : endpointKernel H y ≤ 1 := by + apply Real.sqrt_le_one.mpr + exact (div_le_one (by linarith : 0 < H - y)).mpr (by linarith) + +lemma intervalIntegrable_dampedEndpointKernel {H : ℝ} (hH : 0 ≤ H) : + IntervalIntegrable (fun y => Real.exp (-y) * endpointKernel H y) volume 0 H := + (intervalIntegrable_endpointKernel hH).continuousOn_mul (by fun_prop) + +lemma integral_dampedEndpointKernel_le {H : ℝ} (hH : 0 < H) : + (∫ y in 0..H, Real.exp (-y) * endpointKernel H y) ≤ + 1 + Real.pi / Real.exp 1 := by + have hhalf : 0 ≤ H / 2 := by positivity + have hhalfH : H / 2 ≤ H := by linarith + have hsfirst : uIcc 0 (H / 2) ⊆ uIcc 0 H := by + simpa only [uIcc_of_le hhalf, uIcc_of_le hH.le] using + Icc_subset_Icc le_rfl hhalfH + have hslast : uIcc (H / 2) H ⊆ uIcc 0 H := by + simpa only [uIcc_of_le hhalfH, uIcc_of_le hH.le] using + Icc_subset_Icc hhalf le_rfl + have hk := intervalIntegrable_endpointKernel hH.le + have hf := intervalIntegrable_dampedEndpointKernel hH.le + have hfirst : (∫ y in 0..H / 2, Real.exp (-y) * endpointKernel H y) ≤ 1 := by + calc + _ ≤ ∫ y in 0..H / 2, Real.exp (-y) := by + apply intervalIntegral.integral_mono_on hhalf (hf.mono_set hsfirst) + ((by fun_prop : Continuous (fun y : ℝ => Real.exp (-y))).intervalIntegrable _ _) + intro y hy + exact mul_le_of_le_one_right (Real.exp_pos _).le + (endpointKernel_le_one hH hy.1 hy.2) + _ ≤ 1 := by + rw [intervalIntegral.integral_comp_neg, integral_exp] + simp only [neg_zero, Real.exp_zero] + linarith [Real.exp_pos (-(H / 2))] + have hlast : (∫ y in H / 2..H, Real.exp (-y) * endpointKernel H y) ≤ + Real.exp (-(H / 2)) * (Real.pi * H / 2) := by + calc + _ ≤ ∫ y in H / 2..H, Real.exp (-(H / 2)) * endpointKernel H y := by + apply intervalIntegral.integral_mono_on hhalfH (hf.mono_set hslast) + ((hk.mono_set hslast).const_mul _) + intro y hy + exact mul_le_mul_of_nonneg_right (Real.exp_le_exp.mpr (neg_le_neg hy.1)) + (Real.sqrt_nonneg _) + _ = Real.exp (-(H / 2)) * ∫ y in H / 2..H, endpointKernel H y := + intervalIntegral.integral_const_mul _ _ + _ ≤ Real.exp (-(H / 2)) * ∫ y in 0..H, endpointKernel H y := by + apply mul_le_mul_of_nonneg_left _ (Real.exp_pos _).le + apply intervalIntegral.integral_mono_interval hhalf hhalfH le_rfl _ hk + exact Filter.Eventually.of_forall (fun y => Real.sqrt_nonneg _) + _ = _ := by rw [integral_endpointKernel hH] + have hexp : (H / 2) * Real.exp (-(H / 2)) ≤ 1 / Real.exp 1 := by + calc + _ ≤ Real.exp (H / 2 - 1) * Real.exp (-(H / 2)) := by + apply mul_le_mul_of_nonneg_right _ (Real.exp_pos _).le + linarith [Real.add_one_le_exp (H / 2 - 1)] + _ = Real.exp (-1) := by rw [← Real.exp_add]; congr 1; ring + _ = _ := by rw [Real.exp_neg, one_div] + rw [← intervalIntegral.integral_add_adjacent_intervals + (hf.mono_set hsfirst) (hf.mono_set hslast)] + have hp := mul_le_mul_of_nonneg_left hexp Real.pi_pos.le + have hp' : Real.exp (-(H / 2)) * (Real.pi * H / 2) ≤ Real.pi / Real.exp 1 := by + calc + _ = Real.pi * (H / 2 * Real.exp (-(H / 2))) := by ring + _ ≤ Real.pi * (1 / Real.exp 1) := hp + _ = _ := by ring + exact add_le_add hfirst (hlast.trans hp') + +def movingEndpointIntegral (k : ℕ) (a : ℝ) : ℝ := + (k : ℝ) * ∫ r in a..1, + r ^ (2 * k - 1) * Real.sqrt ((1 - r) / (r - a)) + +lemma movingEndpointIntegral_eq {k : ℕ} (hk : 0 < k) (a : ℝ) : + movingEndpointIntegral k a = ∫ y in 0..(k : ℝ) * (1 - a), + (1 - y / k) ^ (2 * k - 1) * endpointKernel ((k : ℝ) * (1 - a)) y := by + have hk0 : (k : ℝ) ≠ 0 := by exact_mod_cast hk.ne' + let f : ℝ → ℝ := fun y => + (1 - y / k) ^ (2 * k - 1) * endpointKernel ((k : ℝ) * (1 - a)) y + have hsub (r : ℝ) : f ((k : ℝ) - k * r) = + r ^ (2 * k - 1) * Real.sqrt ((1 - r) / (r - a)) := by + dsimp [f, endpointKernel] + have hbase : 1 - ((k : ℝ) - k * r) / k = r := by field_simp; ring + rw [hbase] + congr 2 + rw [show (k : ℝ) - k * r = k * (1 - r) by ring, + show (k : ℝ) * (1 - a) - k * (1 - r) = k * (r - a) by ring, + mul_div_mul_left _ _ hk0] + calc + _ = (k : ℝ) • ∫ r in a..1, f ((k : ℝ) - k * r) := by + simp only [movingEndpointIntegral, smul_eq_mul, hsub] + _ = ∫ y in (k : ℝ) - k * 1..(k : ℝ) - k * a, f y := + intervalIntegral.smul_integral_comp_sub_mul f _ _ + _ = _ := by + rw [show (k : ℝ) - k * 1 = 0 by ring, + show (k : ℝ) - k * a = k * (1 - a) by ring] + +lemma movingEndpointIntegral_le {k : ℕ} (hk : 1 ≤ k) {a : ℝ} + (ha : 0 ≤ a) (ha1 : a < 1) : + movingEndpointIntegral k a ≤ 1 + Real.pi / Real.exp 1 := by + have hkR : (0 : ℝ) < k := by exact_mod_cast (by omega : 0 < k) + have hH : 0 < (k : ℝ) * (1 - a) := mul_pos hkR (sub_pos.mpr ha1) + rw [movingEndpointIntegral_eq (by omega : 0 < k) a] + apply le_trans _ (integral_dampedEndpointKernel_le hH) + apply intervalIntegral.integral_mono_on hH.le + ((intervalIntegrable_endpointKernel hH.le).continuousOn_mul (by fun_prop)) + (intervalIntegrable_dampedEndpointKernel hH.le) + intro y hy + apply mul_le_mul_of_nonneg_right _ (Real.sqrt_nonneg _) + have hyk : y ≤ (k : ℝ) := by nlinarith [mul_nonneg hkR.le ha, hy.2] + have hb0 : 0 ≤ 1 - y / (k : ℝ) := sub_nonneg.mpr ((div_le_one hkR).mpr hyk) + have hb1 : 1 - y / (k : ℝ) ≤ 1 := sub_le_self _ (div_nonneg hy.1 hkR.le) + exact (pow_le_pow_of_le_one hb0 hb1 (by omega : k ≤ 2 * k - 1)).trans + (Real.one_sub_div_pow_le_exp_neg hyk) + +lemma movingEndpointIntegral_le_linear {k : ℕ} (hk : 1 ≤ k) {a : ℝ} + (ha : 0 ≤ a) (ha1 : a < 1) : + movingEndpointIntegral k a ≤ Real.pi * ((k : ℝ) * (1 - a)) / 2 := by + have hkR : (0 : ℝ) < k := by exact_mod_cast (by omega : 0 < k) + have hH : 0 < (k : ℝ) * (1 - a) := mul_pos hkR (sub_pos.mpr ha1) + rw [movingEndpointIntegral_eq (by omega : 0 < k) a, + ← integral_endpointKernel hH] + apply intervalIntegral.integral_mono_on hH.le + ((intervalIntegrable_endpointKernel hH.le).continuousOn_mul (by fun_prop)) + (intervalIntegrable_endpointKernel hH.le) + intro y hy + apply mul_le_of_le_one_left (Real.sqrt_nonneg _) + have hyk : y ≤ (k : ℝ) := by nlinarith [mul_nonneg hkR.le ha, hy.2] + have hb0 : 0 ≤ 1 - y / (k : ℝ) := sub_nonneg.mpr ((div_le_one hkR).mpr hyk) + have hb1 : 1 - y / (k : ℝ) ≤ 1 := sub_le_self _ (div_nonneg hy.1 hkR.le) + exact pow_le_one₀ hb0 hb1 + +end +end SymmetricPolar + +namespace PlanarLens +open Set Filter Complex MeasureTheory +open scoped Topology ContDiff +noncomputable section + +def tailSlope (a : ℝ) : ℝ := 8/Real.pi^2 * Real.artanh a + +theorem tailSlope_pos {a : ℝ} (ha : 0 < a) (ha1 : a < 1) : 0 < tailSlope a := by + apply mul_pos (by positivity) + exact Real.artanh_pos ⟨ha, ha1⟩ + +theorem T_rho_ge_abs {t v u : ℝ} (hz : (v : ℂ)+(t : ℂ)*I ∈ D) + (hv : 0 ≤ v) (hu : u ∈ Icc 0 v) : |t| ≤ T (rho t u) := by + have hmono := (horizontal_radius_strictMono hz hv).monotoneOn + have h0 := horizontal_segment_mem hz hv (left_mem_Icc.mpr hv) + have hU := horizontal_segment_mem hz hv hu + have hle := hmono (left_mem_Icc.mpr hv) hu hu.1 + have hT := strictMonoOn_T.monotoneOn + (show rho t 0 ∈ Icc (-1) 1 from ⟨(le_trans (by norm_num) (norm_nonneg _)), (norm_g_lt h0).le⟩) + (show rho t u ∈ Icc (-1) 1 from ⟨le_trans (by norm_num) (norm_nonneg _), (norm_g_lt hU).le⟩) hle + have he : T (rho t 0) = |t| := by simpa [rho] using T_norm_g_axis (axis_mem_D hz) + rwa [he] at hT + +theorem reciprocal_A_tail {w : ℂ} (hw : ‖w‖ < 1) (hwr : 0 < w.re) + {a b : ℝ} (ha : 1/2 ≤ a) (hab : a ≤ b) (hbw : b < ‖w‖) + (ht : |(F w).im| ≤ T b) : + 1/A w ≤ Real.pi/2 + Real.pi^3 / Real.sqrt (tailSlope a) * + Real.sqrt ((1-‖w‖)/(‖w‖-b)) := by + have ha0 : 0 < a := by linarith + have ha1 : a < 1 := hab.trans_lt (hbw.trans hw) + have hL := tailSlope_pos ha0 ha1 + have hgap := T_tail_gap ha0 hab hbw.le hw + have hnum : 0 ≤ 1-‖w‖ := by linarith + have hden : 0 < tailSlope a * (‖w‖-b) := mul_pos hL (sub_pos.mpr hbw) + have hgap' : tailSlope a * (‖w‖-b) ≤ T ‖w‖ - |(F w).im| := by + dsimp [tailSlope] at * + linarith + apply (reciprocal_A_slice hw hwr (ha.trans (hab.trans hbw.le))).trans + apply add_le_add_right + calc + Real.pi^3 * Real.sqrt ((1-‖w‖)/(T ‖w‖ - |(F w).im|)) + ≤ Real.pi^3 * Real.sqrt ((1-‖w‖)/(tailSlope a*(‖w‖-b))) := by + apply mul_le_mul_of_nonneg_left _ (by positivity) + apply Real.sqrt_le_sqrt + exact div_le_div_of_nonneg_left hnum hden hgap' + _ = Real.pi^3 / Real.sqrt (tailSlope a) * Real.sqrt ((1-‖w‖)/(‖w‖-b)) := by + rw [show (1-‖w‖)/(tailSlope a*(‖w‖-b)) = ((1-‖w‖)/(‖w‖-b))/(tailSlope a) by rw [div_div, mul_comm (‖w‖-b)], + Real.sqrt_div (div_nonneg hnum (sub_nonneg.mpr hbw.le))] + ring + +theorem integrable_radialError {b : ℝ} (hb : b ≤ 1) (k : ℕ) : + IntervalIntegrable (fun r : ℝ => r^(2*k-1)*Real.sqrt ((1-r)/(r-b))) volume b 1 := by + have h := (SymmetricPolar.intervalIntegrable_endpointKernel (sub_nonneg.mpr hb)).comp_sub_left 1 + have he : (fun r : ℝ => SymmetricPolar.endpointKernel (1-b) (1-r)) = + fun r : ℝ => Real.sqrt ((1-r)/(r-b)) := by + funext r + dsimp [SymmetricPolar.endpointKernel] + congr 2 + ring + rw [he] at h + have hh : IntervalIntegrable (fun r : ℝ => Real.sqrt ((1-r)/(r-b))) volume b 1 := by + convert h.symm using 1 <;> ring + exact hh.continuousOn_mul (by fun_prop) + +theorem integral_radialLeading {k : ℕ} (hk : 1 ≤ k) (b R : ℝ) : + (k : ℝ) * ∫ r in b..R, r^(2*k-1)*(Real.pi/2) = + Real.pi/4 * (R^(2*k)-b^(2*k)) := by + have hk0 : (k : ℝ) ≠ 0 := by exact_mod_cast (by omega : k ≠ 0) + have hd (r : ℝ) : HasDerivAt (fun r : ℝ => r^(2*k)/(2*k)) (r^(2*k-1)) r := by + convert ((hasDerivAt_id r).pow (2*k)).div_const ((2:ℝ)*k) using 1 <;> + first | rfl | (simp only [Nat.cast_mul, Nat.cast_ofNat, id_eq, mul_one]; field_simp [hk0]) + have hi := intervalIntegral.integral_eq_sub_of_hasDerivAt + (fun r (_ : r ∈ uIcc b R) => hd r) + (show IntervalIntegrable (fun r : ℝ => r^(2*k-1)) volume b R from (by fun_prop : Continuous _).intervalIntegrable _ _) + rw [intervalIntegral.integral_mul_const, hi] + field_simp + ring + +theorem outer_integral_bound {k : ℕ} (hk : 1 ≤ k) {t v u a : ℝ} + (hz : (v : ℂ)+(t : ℂ)*I ∈ D) (hu : 0 ≤ u) (huv : u ≤ v) + (ha : 1/2 ≤ a) (hau : a ≤ rho t u) : + (k : ℝ)*∫ h in u..v, density k ((h : ℂ)+(t : ℂ)*I) ≤ + Real.pi/4*((rho t v)^(2*k)-(rho t u)^(2*k)) + + Real.pi^3/Real.sqrt (tailSlope a)*(1+Real.pi/Real.exp 1) := by + have hv : 0 ≤ v := hu.trans huv + have huI : u ∈ Icc 0 v := ⟨hu, huv⟩ + have huD := horizontal_segment_mem hz hv huI + have hb0 : 0 ≤ rho t u := norm_nonneg _ + have hb1 : rho t u < 1 := norm_g_lt huD + have hR1 : rho t v < 1 := norm_g_lt hz + have hrho := horizontal_radius_strictMono hz hv + have hbR : rho t u ≤ rho t v := hrho.monotoneOn huI (right_mem_Icc.mpr hv) huv + have ha1 : a < 1 := hau.trans_lt hb1 + have hL : 0 < tailSlope a := tailSlope_pos (by linarith) ha1 + have hc : 0 ≤ Real.pi^3/Real.sqrt (tailSlope a) := by positivity + let P : ℝ → ℝ := fun r => r^(2*k-1)*(Real.pi/2) + + (Real.pi^3/Real.sqrt (tailSlope a))*(r^(2*k-1)*Real.sqrt ((1-r)/(r-rho t u))) + have hradE := integrable_radialError hb1.le k + have hradE' : IntervalIntegrable + (fun r : ℝ => r^(2*k-1)*Real.sqrt ((1-r)/(r-rho t u))) volume (rho t u) (rho t v) := + hradE.mono_set (uIcc_subset_uIcc (left_mem_uIcc) (by + rw [uIcc_of_le hb1.le]; exact ⟨hbR, hR1.le⟩)) + have hP : IntervalIntegrable P volume (rho t u) (rho t v) := + ((by fun_prop : Continuous (fun r : ℝ => r^(2*k-1)*(Real.pi/2))).intervalIntegrable _ _).add + (hradE'.const_mul _) + have hcont : ContinuousOn (rho t) (uIcc u v) := by + rw [uIcc_of_le huv] + exact (continuousOn_rho hz hv).mono (fun _ hx => ⟨hu.trans hx.1, hx.2⟩) + have hder : ∀ h ∈ Ioo (min u v) (max u v), HasDerivAt (rho t) (rhoD t h) h := by + rw [min_eq_left huv, max_eq_right huv] + intro h hh + exact hasDerivAt_rho (horizontal_segment_mem hz hv ⟨hu.trans hh.1.le, hh.2.le⟩) + (hu.trans_lt hh.1) + have hpos : ∀ h ∈ Ioo (min u v) (max u v), 0 ≤ rhoD t h := by + rw [min_eq_left huv, max_eq_right huv] + intro h hh + exact (rhoD_pos (horizontal_segment_mem hz hv ⟨hu.trans hh.1.le, hh.2.le⟩) + (hu.trans_lt hh.1)).le + have hPc : IntervalIntegrable (fun h => P (rho t h)*rhoD t h) volume u v := + (intervalIntegral.integrable_comp_mul_deriv_iff_of_deriv_nonneg hcont hder hpos).mpr hP + have hdens : IntervalIntegrable (fun h : ℝ => density k ((h : ℂ)+(t : ℂ)*I)) volume u v := by + apply ContinuousOn.intervalIntegrable + apply (continuousOn_density k).comp (by fun_prop) + intro h hh + rw [uIcc_of_le huv] at hh + exact horizontal_segment_mem hz hv ⟨hu.trans hh.1, hh.2⟩ + have hcmp : ∫ h in u..v, density k ((h : ℂ)+(t : ℂ)*I) ≤ ∫ r in rho t u..rho t v, P r := by + rw [← intervalIntegral.integral_comp_mul_deriv_of_deriv_nonneg hcont hder hpos (g := P)] + apply intervalIntegral.integral_mono_ae_restrict huv hdens hPc + change ∀ᵐ (h : ℝ) ∂volume.restrict (Icc u v), density k ((h : ℂ)+(t : ℂ)*I) ≤ P (rho t h)*rhoD t h + rw [ae_restrict_iff' measurableSet_Icc] + filter_upwards [volume.ae_ne u] with h hne hh + have hhu : u < h := lt_of_le_of_ne hh.1 (Ne.symm hne) + have hh0 : 0 < h := hu.trans_lt hhu + have hhz := horizontal_segment_mem hz hv ⟨hh0.le, hh.2⟩ + have hbr : rho t u < rho t h := hrho huI ⟨hh0.le, hh.2⟩ hhu + have hA := reciprocal_A_tail (norm_g_lt hhz) (re_g_pos hhz (by simpa using hh0)) + ha hau hbr (by simpa only [F_g hhz, add_im, ofReal_im, mul_im, ofReal_re, I_im, + I_re, mul_one, mul_zero, add_zero, zero_add] using T_rho_ge_abs hz hv huI) + rw [density_radial hk hhz hh0] + have hmul := mul_le_mul_of_nonneg_right + (mul_le_mul_of_nonneg_left hA (pow_nonneg (norm_nonneg (g ((h : ℂ)+(t : ℂ)*I))) (2*k-1))) (rhoD_pos hhz hh0).le + convert hmul using 1 <;> + first | rfl | (dsimp only [P, rho]; ring) + have hlead := integral_radialLeading hk (rho t u) (rho t v) + have herr : (k : ℝ)*∫ r in rho t u..rho t v, + r^(2*k-1)*Real.sqrt ((1-r)/(r-rho t u)) ≤ 1+Real.pi/Real.exp 1 := by + apply le_trans _ (SymmetricPolar.movingEndpointIntegral_le hk hb0 hb1) + apply mul_le_mul_of_nonneg_left _ (Nat.cast_nonneg k) + apply intervalIntegral.integral_mono_interval le_rfl hbR hR1.le _ hradE + change ∀ᵐ (r : ℝ) ∂volume.restrict (Ioc (rho t u) 1), 0 ≤ r^(2*k-1)*Real.sqrt ((1-r)/(r-rho t u)) + rw [ae_restrict_iff' measurableSet_Ioc] + exact Filter.Eventually.of_forall (fun r hr => mul_nonneg + (pow_nonneg (hb0.trans hr.1.le) _) (Real.sqrt_nonneg _)) + have hh := mul_le_mul_of_nonneg_left hcmp (Nat.cast_nonneg k) + dsimp [P] at hh + rw [intervalIntegral.integral_add + ((by fun_prop : Continuous (fun r : ℝ => r^(2*k-1)*(Real.pi/2))).intervalIntegrable _ _) + (hradE'.const_mul _), intervalIntegral.integral_const_mul, mul_add, hlead] at hh + apply hh.trans + apply add_le_add_right + calc + _ = (Real.pi^3/Real.sqrt (tailSlope a))*((k : ℝ)*∫ r in rho t u..rho t v, + r^(2*k-1)*Real.sqrt ((1-r)/(r-rho t u))) := by ring + _ ≤ _ := mul_le_mul_of_nonneg_left herr hc + +end +end PlanarLens + +end LowerBoundInline + +end OAI diff --git a/lean/OAI/Geometry/PolarProducts/UpperBound.lean b/lean/OAI/Geometry/PolarProducts/UpperBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..280f3145286b0f4449c88a9ce6fd4420bfe33075 --- /dev/null +++ b/lean/OAI/Geometry/PolarProducts/UpperBound.lean @@ -0,0 +1,121 @@ +import OAI.Geometry.PolarProducts.CanonicalCoordinates + +namespace OAI + +section +namespace CylinderNonsqueezing +noncomputable section +open Set +open scoped ContDiff +open FourierPolynomial +variable {κ : Type} [Fintype κ] [DecidableEq κ] + +theorem radius_le_of_map (j₀ : κ) {L R M : ℝ} (hL : 0 < L) (hR : 0 ≤ R) (hM : 0 ≤ M) + (f : Vector κ → Vector κ) (hf : ContDiffOn ℝ ∞ f (PushedBall.domain L)) + (hi : InjOn f (PushedBall.domain L)) + (hω : ∀ z ∈ PushedBall.domain L, ComplexSymplectic.Preserves (fderiv ℝ f z)) + (hbounded : ∀ z ∈ PushedBall.domain L, ‖f z‖^2 ≤ M) + (hcylinder : ∀ z ∈ PushedBall.domain L, ‖f z j₀‖^2 ≤ R) : L ≤ R := by + let hU := PushedBall.isOpen_domain (κ := κ) L + have hD (z) (hz : z ∈ PushedBall.domain L) := ComplexSymplectic.invertible (hω z hz) + let e := EmbeddingInverse.localEquiv hU f hf hi hD + exact radius_le_of_embedding j₀ hL hR hM e hf rfl hω + (by rintro _ ⟨z,hz,rfl⟩; exact hbounded z hz) + (by rintro _ ⟨z,hz,rfl⟩; exact hcylinder z hz) + +end +end CylinderNonsqueezing +end + +section +namespace SymmetricPolar +noncomputable section +open Set Filter +open scoped ContDiff Topology ENNReal +open ComplexCoordinates UpperCoordinates +variable {n : ℕ} + +theorem capacity_le_four_of_embedding {K : Set (Position n)} (hK : IsSymmetricConvexBody K) + (hn : 0 < n) {c : ℝ} (hc : 0 < c) + (hemb : HasSymplecticEmbedding (capacityBall n c) (polarProduct K)) : c ≤ 4 := by + obtain ⟨u,v,hvu,hcyl⟩ := exists_squareCylinder hK hn + have hu : u ≠ 0 := by intro h; simp [h] at hvu + obtain ⟨j,huj⟩ : ∃ j : Fin n, u j ≠ 0 := by + by_contra h + apply hu + ext j + exact not_not.mp ((not_exists.mp h) j) + let A := CanonicalLinear.adapted j huj hvu + let T := targetCoordinates A + obtain ⟨e,he,hei,heK,heω⟩ := hemb + let f : C (Fin n) → C (Fin n) := fun z => PlanarCylinder.map j (T (e (parts z))) + have hball {z : C (Fin n)} (hz : z ∈ PushedBall.domain (c/Real.pi)) : + parts z ∈ capacityBall n c := by + change Real.pi*(‖re z‖^2+‖im z‖^2) < c + rw [← norm_sq_parts] + exact (lt_div_iff₀ Real.pi_pos).mp hz |> fun h => by simpa [mul_comm] using h + have hfirst (z : C (Fin n)) (hz : z ∈ PushedBall.domain (c/Real.pi)) : + T (e (parts z)) ∈ PlanarCylinder.domain j := by + have hh := hcyl (heK (hball hz)) + have hi := targetCoordinates_first j huj hvu (e (parts z)) + change |(T (e (parts z)) j).re| < 1 ∧ |(T (e (parts z)) j).im| < 1 + rw [hi.1, hi.2] + exact hh + have hsm (z : C (Fin n)) (hz : z ∈ PushedBall.domain (c/Real.pi)) : ContDiffAt ℝ ∞ f z := by + have hez := he.contDiffAt ((isOpen_lt (by fun_prop) continuous_const).mem_nhds (hball hz)) + have hP : ContDiffAt ℝ ∞ (parts : C (Fin n) → Phase n) z := + (parts (ι := Fin n)).contDiff.contDiffAt + have hT : ContDiffAt ℝ ∞ (fun w => T (e (parts w))) z := + T.contDiff.contDiffAt.comp z (hez.comp z hP) + have hout := (PlanarCylinder.contDiffAt_map j (abs_lt.mp (hfirst z hz).2).1).comp z hT + exact hout + have hfi : InjOn f (PushedBall.domain (c/Real.pi)) := by + intro z hz w hw hzw + apply parts.injective + apply HasSymplecticEmbedding.injOn hei (hball hz) (hball hw) + apply targetCoordinates_injective A + exact PlanarCylinder.map_injOn j (hfirst z hz) (hfirst w hw) hzw + have hfω (z : C (Fin n)) (hz : z ∈ PushedBall.domain (c/Real.pi)) : + ComplexSymplectic.Preserves (fderiv ℝ f z) := by + have hez := he.contDiffAt ((isOpen_lt (by fun_prop) continuous_const).mem_nhds (hball hz)) + have hed := (hez.differentiableAt (by simp)).hasFDerivAt + have hd := (PlanarCylinder.hasFDerivAt_map j (abs_lt.mp (hfirst z hz).2).1).comp z + (T.hasFDerivAt.comp z (hed.comp z (parts (ι := Fin n)).hasFDerivAt)) + have hfd : fderiv ℝ f z = (PlanarCylinder.derivative j (T (e (parts z)))).comp + (T.comp ((fderiv ℝ e (parts z)).comp parts.toContinuousLinearMap)) := hd.fderiv + intro a b + change inner (𝕜 := ℝ) (Complex.I • fderiv ℝ f z a) (fderiv ℝ f z b) = + inner (𝕜 := ℝ) (Complex.I • a) b + rw [← PlanarCylinder.form_eq_inner, ← PlanarCylinder.form_eq_inner, hfd] + simp only [ContinuousLinearMap.comp_apply, ContinuousLinearEquiv.coe_coe] + rw [PlanarCylinder.derivative_preserves j (abs_lt.mp (hfirst z hz).2).1, + targetCoordinates_preserves, form_parts] + exact heω _ (hball hz) (parts a) (parts b) + have hpK : IsCompact (polar K) := ConvexPolar.isCompact_polar + (ConvexPolar.zero_mem_interior_of_symmetric hK.2.1 hK.2.2.1 hK.2.2.2) + obtain ⟨B,hB,hTB⟩ := ((hK.1.prod hpK).image T.continuous).isBounded.exists_pos_norm_le + have hbnd (z : C (Fin n)) (hz : z ∈ PushedBall.domain (c/Real.pi)) : + ‖f z‖^2 ≤ B^2 + 4/Real.pi := by + have hh := heK (hball hz) + have hT := hTB _ ⟨e (parts z), ⟨interior_subset hh.1,interior_subset hh.2⟩, rfl⟩ + have hsq := (sq_le_sq₀ (norm_nonneg _) hB.le).mpr hT + have hnorm := PlanarCylinder.norm_bound j (hfirst z hz) + change ‖PlanarCylinder.map j (T (e (parts z)))‖^2 ≤ _ + linarith + have hle := CylinderNonsqueezing.radius_le_of_map j (div_pos hc Real.pi_pos) + (by positivity : (0:ℝ) ≤ 4/Real.pi) (by positivity : (0:ℝ) ≤ B^2+4/Real.pi) + f (fun z hz => (hsm z hz).contDiffWithinAt) hfi hfω hbnd + (fun z hz => (PlanarCylinder.first_bound j (hfirst z hz)).le) + exact (div_le_div_iff_of_pos_right Real.pi_pos).mp hle + +theorem gromovWidth_polarProduct_le_four {K : Set (Position n)} + (hK : IsSymmetricConvexBody K) (hn : 0 < n) : gromovWidth (polarProduct K) ≤ 4 := by + apply sSup_le + rintro _ ⟨c,⟨hc,he⟩,rfl⟩ + exact (ENNReal.ofReal_le_ofReal (capacity_le_four_of_embedding hK hn hc he)).trans_eq (by norm_num) + +end +end SymmetricPolar +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/ABPIntegralBound.lean b/lean/OAI/Geometry/PrescribedPotential/ABPIntegralBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..4a4279ccde3b9e3960fda9cb7800ad7fb470cc6e --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/ABPIntegralBound.lean @@ -0,0 +1,88 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalSobolev +import OAI.Geometry.PrescribedPotential.LocalPotentialABP + +namespace OAI + +/-! A B P Integral Bound. -/ + +section + + + +noncomputable section +open Set Metric Filter Topology MeasureTheory Matrix +open scoped ContDiff InnerProductSpace +namespace PotentialABP +variable {d : ℕ} +local notation "E" => EuclideanSpace ℂ (Fin d) +local instance abpIntegralRealIP (d : ℕ) : InnerProductSpace ℝ (EuclideanSpace ℂ (Fin d)) := + InnerProductSpace.rclikeToReal ℂ (EuclideanSpace ℂ (Fin d)) +local notation "e" => EuclideanSpace.equiv (Fin d) ℂ + +theorem abp_integral_minimum_bound + (μ : Measure E) [μ.IsAddHaarMeasure] + {f : (Fin d → ℂ) → ℝ} (hf : ContDiff ℝ ∞ f) + (G : E → Matrix (Fin d) (Fin d) ℂ) + {c : E} {r δ K B : ℝ} (hr : 0 < r) (hδ : 0 < δ) (hK : 0 < K) + (hmin : ∀ x ∈ closedBall c r, f (e c) ≤ f (e x)) + (hG : ∀ x ∈ closedBall c r, (G x).IsHermitian) + (hGδ : ∀ x ∈ closedBall c r, ∀ v : E, + δ*‖v‖^2 ≤ inner ℝ ((G x).toEuclideanLin v) v) + (hdet : ∀ x ∈ closedBall c r, + |(G x + PotentialKaehler.potentialMatrix f (e x)).det.re| ≤ K) + {U : Set E} (hU : MeasurableSet U) (hsub : closedBall c r ⊆ U) + (hn : ∀ x ∈ U, f (e x) ≤ 0) + (hi : IntegrableOn (fun x => -f (e x)) U μ) + (hB : (∫ x in U, -f (e x) ∂μ) ≤ B) : + -f (e c) ≤ δ*r^2/2 + B*((4:ℝ)^(2*d)*K^2) / + μ.real (closedBall (0:E) (δ*r/2)) := by + let S : Set E := {x | x ∈ closedBall c r ∧ f (e x) ≤ f (e c)+δ*r^2/2} + let C : ℝ := (4:ℝ)^(2*d)*K^2 + let V : ℝ := μ.real (closedBall (0:E) (δ*r/2)) + have hC : 0 < C := by positivity + have hV : 0 < V := ENNReal.toReal_pos + (measure_closedBall_pos μ _ (by positivity)).ne' + (isCompact_closedBall _ _).measure_lt_top.ne + have hSc : IsClosed S := isClosed_closedBall.inter + (isClosed_le (hf.continuous.comp (EuclideanSpace.equiv (Fin d) ℂ).continuous) continuous_const) + have hSsub : S ⊆ U := fun x hx => hsub hx.1 + have hSi : IntegrableOn (fun x => -f (e x)) S μ := hi.mono_set hSsub + have hSfin : μ S ≠ ⊤ := + ((measure_mono (show S ⊆ closedBall c r from fun _ hx => hx.1)).trans_lt + (isCompact_closedBall _ _).measure_lt_top).ne + have hABP := local_potential_sublevel_volume μ hf G hr hδ hK.le hmin hG hGδ hdet + have hABPr : V ≤ C * μ.real S := by + have hne : ENNReal.ofReal C * μ S ≠ ⊤ := ENNReal.mul_ne_top ENNReal.ofReal_ne_top hSfin + have hh := ENNReal.toReal_mono hne hABP + simpa only [V,C,S,measureReal_def,ENNReal.toReal_mul,ENNReal.toReal_ofReal hC.le] using hh + have hBn : 0 ≤ B := (setIntegral_nonneg hU (fun x hx => neg_nonneg.mpr (hn x hx))).trans hB + have hIS : (-f (e c)-δ*r^2/2)*μ.real S ≤ B := by + have hc : IntegrableOn (fun _ : E => -f (e c)-δ*r^2/2) S μ := + integrableOn_const hSfin + have hm := setIntegral_mono_on hc hSi hSc.measurableSet (fun x (hx : x ∈ S) => by + have hh := hx.2 + linarith) + have hm' := setIntegral_mono_set hi + (by + filter_upwards [ae_restrict_mem hU] with x hx + exact neg_nonneg.mpr (hn x hx)) + (Filter.Eventually.of_forall hSsub) + have hh := hm.trans (hm'.trans hB) + simpa only [setIntegral_const, smul_eq_mul, mul_comm] using hh + by_cases hm : 0 ≤ -f (e c)-δ*r^2/2 + · have hmul := mul_le_mul_of_nonneg_left hABPr hm + have hmul' := mul_le_mul_of_nonneg_left hIS hC.le + have hh : (-f (e c)-δ*r^2/2)*V ≤ B*C := by nlinarith + have hd := (le_div_iff₀ hV).mpr hh + change -f (e c) ≤ δ*r^2/2 + B*C/V + linarith + · have hdiv : 0 ≤ B*C/V := div_nonneg (mul_nonneg hBn hC.le) hV.le + change -f (e c) ≤ δ*r^2/2 + B*C/V + linarith +end PotentialABP + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/AffineFamilyJets.lean b/lean/OAI/Geometry/PrescribedPotential/AffineFamilyJets.lean new file mode 100644 index 0000000000000000000000000000000000000000..10f670d04e81f1f631794de2c1a9d684266247c3 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/AffineFamilyJets.lean @@ -0,0 +1,45 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.QuasilinearJetBasics + +namespace OAI + +/-! Affine Family Jets. -/ + +section + +noncomputable section +open Set Filter Topology Finset +open scoped ContDiff +namespace HigherJet +variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] +lemma affine_family_jets {U : Set E} (hU : IsOpen U) {f g : E → F} + (hf : ContDiffOn ℝ ∞ f U) (hg : ContDiffOn ℝ ∞ g U) + (m : ℕ) {K : Set E} (hK : IsCompact K) (hKU : K ⊆ U) : + ∃ C : ℝ, ∀ j, j ≤ m → ∀ t ∈ Icc (0:ℝ) 1, ∀ x ∈ K, + ‖iteratedFDeriv ℝ j (fun y => (1-t) • f y-t • g y) x‖ ≤ C := by + obtain ⟨A,hA,hfa⟩ := compact_coefficient_jets hK (fun x hx => hf.contDiffAt (hU.mem_nhds (hKU hx))) m + obtain ⟨B,hB,hgb⟩ := compact_coefficient_jets hK (fun x hx => hg.contDiffAt (hU.mem_nhds (hKU hx))) m + refine ⟨A+B,fun j hj t ht x hx => ?_⟩ + have hf' := hf.contDiffAt (hU.mem_nhds (hKU hx)) + have hg' := hg.contDiffAt (hU.mem_nhds (hKU hx)) + have hn : (j:ℕ∞ω) ≤ ∞ := WithTop.coe_le_coe.mpr le_top + have he : iteratedFDeriv ℝ j ((1-t) • f-t • g) x = + (1-t) • iteratedFDeriv ℝ j f x-t • iteratedFDeriv ℝ j g x := by + calc + _ = iteratedFDeriv ℝ j ((1-t) • f) x-iteratedFDeriv ℝ j (t • g) x := + iteratedFDeriv_sub_apply ((hf'.const_smul (1-t)).of_le hn) ((hg'.const_smul t).of_le hn) + _ = _ := by rw [iteratedFDeriv_const_smul_apply (hf'.of_le hn),iteratedFDeriv_const_smul_apply (hg'.of_le hn)] + change ‖iteratedFDeriv ℝ j ((1-t) • f-t • g) x‖ ≤ _ + rw [he] + apply (norm_sub_le _ _).trans + simp only [norm_smul,Real.norm_eq_abs,abs_of_nonneg ht.1,abs_of_nonneg (sub_nonneg.mpr ht.2)] + have ha := mul_le_mul_of_nonneg_left (hfa j hj x hx) (sub_nonneg.mpr ht.2) + have hb := mul_le_mul_of_nonneg_left (hgb j hj x hx) ht.1 + nlinarith [ht.1,ht.2] +end HigherJet + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/AnalyticSupport.lean b/lean/OAI/Geometry/PrescribedPotential/AnalyticSupport.lean new file mode 100644 index 0000000000000000000000000000000000000000..03d609943d0516e7070bea438ecf28de40950416 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/AnalyticSupport.lean @@ -0,0 +1,2523 @@ +import Mathlib + +namespace OAI + +/-! Analytic Support. -/ + +section + + + +noncomputable section +open Set MeasureTheory Filter Complex +open scoped Topology + +namespace ProjectiveKaehler + + + +def compactIntegral {K : Type*} [TopologicalSpace K] [CompactSpace K] + [MeasurableSpace K] [OpensMeasurableSpace K] (μ : Measure K) [IsFiniteMeasure μ] : + C(K, ℂ) →L[ℂ] ℂ := + LinearMap.mkContinuous + { toFun := fun f => ∫ x, f x ∂μ + map_add' := by + intro f g + exact integral_add + (f.continuous.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace f)) + (g.continuous.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace g)) + map_smul' := by + intro c f + exact integral_smul c f } + (μ.real univ) (by + intro f + change ‖∫ x, f x ∂μ‖ ≤ μ.real univ * ‖f‖ + rw [mul_comm] + exact norm_integral_le_of_norm_le_const + (μ := μ) (ae_of_all _ fun x => f.norm_coe_le_norm x)) + +abbrev Angle := Icc (0 : ℝ) (2 * Real.pi) + +def angleMeasure : Measure Angle := Measure.comap Subtype.val volume + +instance : IsFiniteMeasure angleMeasure := by + refine ⟨?_⟩ + rw [angleMeasure, Measure.comap_apply Subtype.val Subtype.val_injective + (fun s hs => (MeasurableEmbedding.subtype_coe measurableSet_Icc).measurableSet_image.mpr hs) + volume MeasurableSet.univ] + simpa only [Set.image_univ, Subtype.range_coe_subtype, ofPred_mem_eq] using + (measure_Icc_lt_top (μ := volume) (a := (0 : ℝ)) (b := 2 * Real.pi)) + +abbrev Boundary (n : ℕ) := Fin n → Angle + +def boundaryCons (n : ℕ) : C(Angle × Boundary n, Boundary (n + 1)) where + toFun p := Fin.cons p.1 p.2 + continuous_toFun := by + apply continuous_pi + intro i + refine Fin.cases ?_ (fun j => ?_) i + · simpa using continuous_fst + · exact (continuous_apply j).comp continuous_snd + + + +def integrateFirst {K : Type*} [TopologicalSpace K] [CompactSpace K] + (L : C(K, ℂ) →L[ℂ] ℂ) : C(Angle × K, ℂ) →L[ℂ] ℂ := + LinearMap.mkContinuous + { toFun := fun f => ∫ t, L (f.curry t) ∂angleMeasure + map_add' := by + intro f g + change (∫ t, L ((f + g).curry t) ∂angleMeasure) = _ + have h : ∀ t, (f + g).curry t = f.curry t + g.curry t := fun _ => by + ext; rfl + simp_rw [h, map_add] + apply integral_add + · exact (L.continuous.comp f.curry.continuous).integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _) + · exact (L.continuous.comp g.curry.continuous).integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _) + map_smul' := by + intro c f + have h : ∀ t, (c • f).curry t = c • f.curry t := fun _ => by + ext; rfl + simp_rw [h, map_smul] + exact integral_smul c _ } + (‖L‖ * angleMeasure.real univ) (by + intro f + calc + ‖∫ t, L (f.curry t) ∂angleMeasure‖ ≤ + (‖L‖ * ‖f‖) * angleMeasure.real univ := + norm_integral_le_of_norm_le_const (ae_of_all _ fun t => + (L.le_opNorm _).trans (mul_le_mul_of_nonneg_left + (((f.curry t).norm_le (norm_nonneg f)).mpr + (fun y => f.norm_coe_le_norm (t, y))) (norm_nonneg L))) + _ = (‖L‖ * angleMeasure.real univ) * ‖f‖ := by ring) + + +def boundaryIntegral : (n : ℕ) → C(Boundary n, ℂ) →L[ℂ] ℂ + | 0 => ContinuousMap.evalCLM ℂ (fun i => Fin.elim0 i) + | n + 1 => (integrateFirst (boundaryIntegral n)).comp + (ContinuousMap.compCLM ℂ ℂ (boundaryCons n)) + +@[simp] theorem boundaryIntegral_zero (f : C(Boundary 0, ℂ)) : + boundaryIntegral 0 f = f (fun i => Fin.elim0 i) := rfl + +@[simp] theorem boundaryIntegral_succ (n : ℕ) (f : C(Boundary (n + 1), ℂ)) : + boundaryIntegral (n + 1) f = + ∫ t, boundaryIntegral n ((f.comp (boundaryCons n)).curry t) ∂angleMeasure := rfl + + +def boundaryPoint {n : ℕ} (c : Fin n → ℂ) (R : ℝ) : C(Boundary n, Fin n → ℂ) where + toFun t i := circleMap (c i) R (t i).val + continuous_toFun := by + apply continuous_pi + intro i + exact (continuous_circleMap _ _).comp (continuous_subtype_val.comp (continuous_apply i)) + + + +def denominator {n : ℕ} (c : Fin n → ℂ) (R : ℝ) (i : Fin n) + (z : Fin n → ℂ) : C(Boundary n, ℂ) := + ⟨fun t => circleMap (c i) R (t i).val - z i, by + exact ((continuous_circleMap _ _).comp + (continuous_subtype_val.comp (continuous_apply i))).sub continuous_const⟩ + +lemma analyticAt_denominator {n : ℕ} (c : Fin n → ℂ) (R : ℝ) (i : Fin n) + (z : Fin n → ℂ) : AnalyticAt ℂ (denominator c R i) z := by + have h : denominator c R i = fun w => denominator c R i 0 - + (ContinuousLinearMap.const ℂ (Boundary n)) (w i) := by + funext w + ext t + simp [denominator] + rw [h] + have hi : AnalyticAt ℂ (fun w : Fin n → ℂ => w i) z := + (ContinuousLinearMap.proj i : (Fin n → ℂ) →L[ℂ] ℂ).analyticAt z + exact analyticAt_const.sub + (AnalyticAt.comp (f := fun w : Fin n → ℂ => w i) + ((ContinuousLinearMap.const ℂ (Boundary n)).analyticAt (z i)) hi) + +lemma isUnit_denominator {n : ℕ} {c z : Fin n → ℂ} {R : ℝ} (hR : 0 < R) + (hz : z ∈ Metric.ball c R) (i : Fin n) : IsUnit (denominator c R i z) := by + apply (ContinuousMap.isUnit_iff_forall_ne_zero _).mpr + intro t he + rw [ball_pi c hR] at hz + have hi : z i ∈ Metric.ball (c i) R := hz i (Set.mem_univ i) + have hs := circleMap_mem_sphere (c i) hR.le (t i).val + have he' : circleMap (c i) R (t i).val = z i := sub_eq_zero.mp he + rw [he'] at hs + exact (ne_of_lt hi) hs + +lemma analyticAt_inverseDenominator {n : ℕ} {c z : Fin n → ℂ} {R : ℝ} + (hR : 0 < R) (hz : z ∈ Metric.ball c R) (i : Fin n) : + AnalyticAt ℂ (fun w => Ring.inverse (denominator c R i w)) z := by + have h : AnalyticAt ℂ Ring.inverse (denominator c R i z) := by + simpa only [IsUnit.unit_spec] using + (analyticAt_inverse (𝕜 := ℂ) (isUnit_denominator hR hz i).unit) + exact h.comp (analyticAt_denominator c R i z) + +lemma inverseDenominator_apply {n : ℕ} {c z : Fin n → ℂ} {R : ℝ} + (hR : 0 < R) (hz : z ∈ Metric.ball c R) (i : Fin n) (t : Boundary n) : + Ring.inverse (denominator c R i z) t = (circleMap (c i) R (t i).val - z i)⁻¹ := by + have h := congrArg (fun F : C(Boundary n, ℂ) => F t) + (Ring.mul_inverse_cancel (denominator c R i z) (isUnit_denominator hR hz i)) + change (circleMap (c i) R (t i).val - z i) * _ = 1 at h + exact eq_inv_of_mul_eq_one_right h + +lemma boundaryPoint_mem_closedBall {n : ℕ} (c : Fin n → ℂ) {R : ℝ} (hR : 0 ≤ R) + (t : Boundary n) : boundaryPoint c R t ∈ Metric.closedBall c R := by + rw [closedBall_pi c hR] + intro i _ + exact circleMap_mem_closedBall (c i) hR (t i).val + +def boundaryValue {n : ℕ} {c : Fin n → ℂ} {R : ℝ} (hR : 0 ≤ R) + {f : (Fin n → ℂ) → ℂ} (hf : ContinuousOn f (Metric.closedBall c R)) : + C(Boundary n, ℂ) := + ⟨fun t => f (boundaryPoint c R t), + hf.comp_continuous (boundaryPoint c R).continuous (boundaryPoint_mem_closedBall c hR)⟩ + +def boundarySpeed {n : ℕ} (R : ℝ) : C(Boundary n, ℂ) := + ∏ i : Fin n, ⟨fun t => circleMap 0 R (t i).val * I, by + exact ((continuous_circleMap 0 R).comp + (continuous_subtype_val.comp (continuous_apply i))).mul continuous_const⟩ + +def cauchyTransform {n : ℕ} (c : Fin n → ℂ) (R : ℝ) (F : C(Boundary n, ℂ)) + (z : Fin n → ℂ) : ℂ := + boundaryIntegral n (boundarySpeed R * (∏ i, Ring.inverse (denominator c R i z)) * F) + +lemma analyticAt_cauchyTransform {n : ℕ} {c z : Fin n → ℂ} {R : ℝ} + (hR : 0 < R) (hz : z ∈ Metric.ball c R) (F : C(Boundary n, ℂ)) : + AnalyticAt ℂ (cauchyTransform c R F) z := by + have hp : AnalyticAt ℂ (fun w => ∏ i, Ring.inverse (denominator c R i w)) z := + Finset.analyticAt_fun_prod Finset.univ (fun i _ => analyticAt_inverseDenominator hR hz i) + have h : AnalyticAt ℂ (fun w => boundarySpeed R * + (∏ i, Ring.inverse (denominator c R i w)) * F) z := + (analyticAt_const.mul hp).mul analyticAt_const + exact AnalyticAt.comp (f := fun w => boundarySpeed R * + (∏ i, Ring.inverse (denominator c R i w)) * F) + ((boundaryIntegral n).analyticAt _) h + +abbrev circleKernel (c : ℂ) (R : ℝ) (z : ℂ) (t : ℝ) : ℂ := + (circleMap 0 R t * I) * (circleMap c R t - z)⁻¹ + +lemma cauchyIntegrand_apply {n : ℕ} {c z : Fin n → ℂ} {R : ℝ} + (hR : 0 < R) (hz : z ∈ Metric.ball c R) (F : C(Boundary n, ℂ)) (t : Boundary n) : + (boundarySpeed (n := n) R * (∏ i, Ring.inverse (denominator c R i z)) * F) t = + (∏ i, circleKernel (c i) R (z i) (t i).val) * F t := by + simp only [ContinuousMap.mul_apply, boundarySpeed, ContinuousMap.prod_apply, + ContinuousMap.coe_mk, inverseDenominator_apply hR hz] + rw [← Finset.prod_mul_distrib] + +lemma circleCauchy {c z : ℂ} {R : ℝ} {f : ℂ → ℂ} + (hf : DifferentiableOn ℂ f (Metric.closedBall c R)) (hz : z ∈ Metric.ball c R) : + (∫ t : Angle, circleKernel c R z t.val * f (circleMap c R t.val) ∂angleMeasure) = + (2 * Real.pi * I) * f z := by + have h := hf.circleIntegral_sub_inv_smul hz + rw [circleIntegral_def_Icc] at h + rw [angleMeasure, integral_subtype_comap (s := Angle) measurableSet_Icc + (fun t => circleKernel c R z t * f (circleMap c R t))] + simpa only [deriv_circleMap, smul_eq_mul, mul_assoc] using h + +lemma differentiable_cons_left {n : ℕ} (y : Fin n → ℂ) : + Differentiable ℂ (fun a : ℂ => (Fin.cons a y : Fin (n + 1) → ℂ)) := by + apply differentiable_pi.mpr + intro i + refine Fin.cases ?_ (fun j => ?_) i + · simp + · simp + +lemma differentiable_cons_right {n : ℕ} (a : ℂ) : + Differentiable ℂ (fun y : Fin n → ℂ => (Fin.cons a y : Fin (n + 1) → ℂ)) := by + apply differentiable_pi.mpr + intro i + refine Fin.cases ?_ (fun j => ?_) i + · simp + · exact (ContinuousLinearMap.proj j : (Fin n → ℂ) →L[ℂ] ℂ).differentiable + +lemma cons_mem_closedBall {n : ℕ} {c : Fin (n + 1) → ℂ} {R : ℝ} + (hR : 0 ≤ R) {a : ℂ} {y : Fin n → ℂ} + (ha : a ∈ Metric.closedBall (c 0) R) + (hy : y ∈ Metric.closedBall (Fin.tail c) R) : + Fin.cons a y ∈ Metric.closedBall c R := by + rw [closedBall_pi c hR] + rw [closedBall_pi (Fin.tail c) hR] at hy + intro i _ + refine Fin.cases ?_ (fun j => ?_) i + · exact ha + · exact hy j (Set.mem_univ j) + +lemma tail_mem_ball {n : ℕ} {c z : Fin (n + 1) → ℂ} {R : ℝ} + (hR : 0 < R) (hz : z ∈ Metric.ball c R) : + Fin.tail z ∈ Metric.ball (Fin.tail c) R := by + rw [ball_pi c hR] at hz + rw [ball_pi (Fin.tail c) hR] + exact fun i _ => hz i.succ (Set.mem_univ _) + +lemma boundaryPoint_cons {n : ℕ} (c : Fin (n + 1) → ℂ) (R : ℝ) + (a : Angle) (t : Boundary n) : + boundaryPoint c R (Fin.cons a t) = + Fin.cons (circleMap (c 0) R a.val) (boundaryPoint (Fin.tail c) R t) := by + ext i + refine Fin.cases ?_ (fun j => ?_) i <;> rfl + + + +lemma boundaryIntegral_cauchy (n : ℕ) {c z : Fin n → ℂ} {R : ℝ} + {f : (Fin n → ℂ) → ℂ} (hR : 0 < R) + (hf : DifferentiableOn ℂ f (Metric.closedBall c R)) (hz : z ∈ Metric.ball c R) + (F : C(Boundary n, ℂ)) + (hF : ∀ t, F t = (∏ i, circleKernel (c i) R (z i) (t i).val) * + f (boundaryPoint c R t)) : + boundaryIntegral n F = (2 * Real.pi * I) ^ n * f z := by + induction n with + | zero => + rw [boundaryIntegral_zero, hF] + simp only [Finset.univ_eq_empty, Finset.prod_empty, one_mul, pow_zero] + congr 1 + exact Subsingleton.elim _ _ + | succ n ih => + have hz0 : z 0 ∈ Metric.ball (c 0) R := by + rw [ball_pi c hR] at hz + exact hz 0 (Set.mem_univ _) + have hzt := tail_mem_ball hR hz + rw [boundaryIntegral_succ] + have inner : ∀ a : Angle, + boundaryIntegral n ((F.comp (boundaryCons n)).curry a) = + (2 * Real.pi * I) ^ n * + (circleKernel (c 0) R (z 0) a.val * + f (Fin.cons (circleMap (c 0) R a.val) (Fin.tail z))) := by + intro a + apply ih (c := Fin.tail c) (z := Fin.tail z) + (f := fun y => circleKernel (c 0) R (z 0) a.val * + f (Fin.cons (circleMap (c 0) R a.val) y)) + · exact (hf.comp (differentiable_cons_right _).differentiableOn + (fun y hy => cons_mem_closedBall hR.le + (circleMap_mem_closedBall (c 0) hR.le a.val) hy)).const_mul _ + · exact hzt + · intro t + change F (Fin.cons a t) = _ + rw [hF, Fin.prod_univ_succ, boundaryPoint_cons] + simp only [Fin.cons_zero, Fin.cons_succ, Fin.tail] + ring + simp_rw [inner] + rw [integral_const_mul] + have hslice : DifferentiableOn ℂ (fun a => f (Fin.cons a (Fin.tail z))) + (Metric.closedBall (c 0) R) := + hf.comp (differentiable_cons_left _).differentiableOn + (fun a ha => cons_mem_closedBall hR.le ha (Metric.ball_subset_closedBall hzt)) + rw [circleCauchy hslice hz0, Fin.cons_self_tail, pow_succ] + ring + +lemma cauchyTransform_eq {n : ℕ} {c z : Fin n → ℂ} {R : ℝ} + {f : (Fin n → ℂ) → ℂ} (hR : 0 < R) + (hf : DifferentiableOn ℂ f (Metric.closedBall c R)) (hz : z ∈ Metric.ball c R) : + cauchyTransform c R (boundaryValue hR.le hf.continuousOn) z = + (2 * Real.pi * I) ^ n * f z := by + apply boundaryIntegral_cauchy n hR hf hz + intro t + exact cauchyIntegrand_apply hR hz _ t + +lemma analyticAt_of_differentiableOn_closedBall {n : ℕ} {c z : Fin n → ℂ} {R : ℝ} + {f : (Fin n → ℂ) → ℂ} (hR : 0 < R) + (hf : DifferentiableOn ℂ f (Metric.closedBall c R)) (hz : z ∈ Metric.ball c R) : + AnalyticAt ℂ f z := by + have h : AnalyticAt ℂ (fun w => ((2 * Real.pi * I) ^ n)⁻¹ * + cauchyTransform c R (boundaryValue hR.le hf.continuousOn) w) z := + analyticAt_const.mul (analyticAt_cauchyTransform hR hz _) + apply h.congr + filter_upwards [Metric.isOpen_ball.mem_nhds hz] with w hw + rw [cauchyTransform_eq hR hf hw] + rw [← mul_assoc, inv_mul_cancel₀ (pow_ne_zero n Complex.two_pi_I_ne_zero), one_mul] + + + +theorem analyticOnNhd_of_differentiableOn {n : ℕ} {s : Set (Fin n → ℂ)} + {f : (Fin n → ℂ) → ℂ} (hs : IsOpen s) (hf : DifferentiableOn ℂ f s) : + AnalyticOnNhd ℂ f s := by + intro z hz + obtain ⟨R, hR, hsub⟩ := Metric.nhds_basis_closedBall.mem_iff.mp (hs.mem_nhds hz) + exact analyticAt_of_differentiableOn_closedBall hR (hf.mono hsub) + (Metric.mem_ball_self hR) + + +theorem analyticOnNhd_pi_of_differentiableOn {n m : ℕ} {s : Set (Fin n → ℂ)} + {f : (Fin n → ℂ) → (Fin m → ℂ)} (hs : IsOpen s) (hf : DifferentiableOn ℂ f s) : + AnalyticOnNhd ℂ f s := by + intro z hz + apply analyticAt_pi_iff.mpr + intro i + have hi : DifferentiableOn ℂ (fun w => f w i) s := + (ContinuousLinearMap.proj i : (Fin m → ℂ) →L[ℂ] ℂ).differentiable.comp_differentiableOn hf + exact analyticOnNhd_of_differentiableOn hs hi z hz + +theorem contDiffOn_real_pi_of_differentiableOn {n m : ℕ} {s : Set (Fin n → ℂ)} + {f : (Fin n → ℂ) → (Fin m → ℂ)} (hs : IsOpen s) (hf : DifferentiableOn ℂ f s) : + ContDiffOn ℝ ⊤ f s := by + intro z hz + exact ((analyticOnNhd_pi_of_differentiableOn hs hf z hz).contDiffAt.restrict_scalars ℝ).contDiffWithinAt + +end ProjectiveKaehler + + + +noncomputable section +open Matrix +open scoped ComplexOrder Matrix.Norms.Elementwise + +namespace ProjectiveKaehler + +variable {m n : ℕ} + + +def mass (x : Fin m → ℂ) : ℂ := star x ⬝ᵥ x + +lemma mass_ne_zero {x : Fin m → ℂ} (hx : x ≠ 0) : mass x ≠ 0 := by + simpa only [mass, ne_eq, dotProduct_star_self_eq_zero] using hx + +lemma mass_pos {x : Fin m → ℂ} (hx : x ≠ 0) : 0 < mass x := + lt_of_le_of_ne (dotProduct_star_self_nonneg x) (Ne.symm (mass_ne_zero hx)) + +@[simp] lemma star_mass (x : Fin m → ℂ) : star (mass x) = mass x := by + exact (Matrix.star_dotProduct x x).symm + + +def horizontal (x : Fin m → ℂ) : Matrix (Fin m) (Fin m) ℂ := + 1 - (mass x)⁻¹ • vecMulVec x (star x) + +lemma horizontal_mulVec (x u : Fin m → ℂ) : + horizontal x *ᵥ u = u - ((mass x)⁻¹ * (star x ⬝ᵥ u)) • x := by + simp [horizontal, sub_mulVec, smul_mulVec, vecMulVec_mulVec, smul_smul] + +lemma horizontal_mulVec_eq_zero_iff (x u : Fin m → ℂ) : + horizontal x *ᵥ u = 0 ↔ u = ((mass x)⁻¹ * (star x ⬝ᵥ u)) • x := by + rw [horizontal_mulVec, sub_eq_zero] + +lemma horizontal_self {x : Fin m → ℂ} (hx : x ≠ 0) : horizontal x *ᵥ x = 0 := by + rw [horizontal_mulVec] + change x - ((mass x)⁻¹ * mass x) • x = 0 + rw [inv_mul_cancel₀ (mass_ne_zero hx), one_smul, sub_self] + +lemma horizontal_eq_conjTranspose (x : Fin m → ℂ) : (horizontal x)ᴴ = horizontal x := by + simp [horizontal, conjTranspose_sub, conjTranspose_smul, conjTranspose_vecMulVec] + +lemma horizontal_idempotent {x : Fin m → ℂ} (hx : x ≠ 0) : + horizontal x * horizontal x = horizontal x := by + have hu : ∀ u, horizontal x *ᵥ (horizontal x *ᵥ u) = horizontal x *ᵥ u := by + intro u + have h := congrArg (horizontal x).mulVec (horizontal_mulVec x u) + simpa only [mulVec_sub, mulVec_smul, horizontal_self hx, smul_zero, sub_zero] using h + apply Matrix.ext_of_mulVec_single + intro j + simpa only [mulVec_mulVec] using hu (Pi.single j 1) + + + +def fsMatrix (x : Fin m → ℂ) (D : Matrix (Fin m) (Fin n) ℂ) : + Matrix (Fin n) (Fin n) ℂ := + (mass x)⁻¹ • ((horizontal x * D)ᴴ * (horizontal x * D)) + +lemma fsMatrix_posDef {x : Fin m → ℂ} {D : Matrix (Fin m) (Fin n) ℂ} + (hx : x ≠ 0) (hD : Function.Injective (horizontal x * D).mulVec) : + (fsMatrix x D).PosDef := by + exact (Matrix.PosDef.conjTranspose_mul_self _ hD).smul (inv_pos.mpr (mass_pos hx)) + +lemma fsMatrix_eq {x : Fin m → ℂ} (hx : x ≠ 0) (D : Matrix (Fin m) (Fin n) ℂ) : + fsMatrix x D = (mass x)⁻¹ • (Dᴴ * horizontal x * D) := by + unfold fsMatrix + congr 1 + rw [conjTranspose_mul, horizontal_eq_conjTranspose, Matrix.mul_assoc, + ← Matrix.mul_assoc (horizontal x) (horizontal x) D, horizontal_idempotent hx, + ← Matrix.mul_assoc] + +@[simp] lemma mass_smul (a : ℂ) (x : Fin m → ℂ) : + mass (a • x) = (star a * a) * mass x := by + simp only [mass, star_smul, smul_dotProduct, dotProduct_smul, smul_eq_mul] + ring + +lemma horizontal_smul {a : ℂ} (ha : a ≠ 0) {x : Fin m → ℂ} (_hx : x ≠ 0) : + horizontal (a • x) = horizontal x := by + unfold horizontal + rw [mass_smul, star_smul, smul_vecMulVec, vecMulVec_smul, smul_smul, smul_smul] + congr 2 + have hs : star a ≠ 0 := star_ne_zero.mpr ha + field_simp + +lemma horizontal_gauge {x : Fin m → ℂ} (hx : x ≠ 0) (a : ℂ) + (D : Matrix (Fin m) (Fin n) ℂ) (r : Fin n → ℂ) : + horizontal x * (a • D + vecMulVec x r) = a • (horizontal x * D) := by + rw [Matrix.mul_add, Matrix.mul_smul, mul_vecMulVec, horizontal_self hx] + simp + + + +lemma fsMatrix_gauge {a : ℂ} (ha : a ≠ 0) {x : Fin m → ℂ} (hx : x ≠ 0) + (D : Matrix (Fin m) (Fin n) ℂ) (r : Fin n → ℂ) : + fsMatrix (a • x) (a • D + vecMulVec x r) = fsMatrix x D := by + simp only [fsMatrix, mass_smul, horizontal_smul ha hx, horizontal_gauge hx, + conjTranspose_smul, Matrix.smul_mul, Matrix.mul_smul, smul_smul] + congr 1 + have hs : star a ≠ 0 := star_ne_zero.mpr ha + field_simp + +lemma fsMatrix_comp {k : ℕ} (x : Fin m → ℂ) (D : Matrix (Fin m) (Fin n) ℂ) + (L : Matrix (Fin n) (Fin k) ℂ) : + fsMatrix x (D * L) = Lᴴ * fsMatrix x D * L := by + simp only [fsMatrix, ← Matrix.mul_assoc (horizontal x) D L, conjTranspose_mul, + Matrix.mul_smul, Matrix.smul_mul] + congr 1 + simp only [Matrix.mul_assoc] + +lemma fsMatrix_pair {x : Fin m → ℂ} (hx : x ≠ 0) (D : Matrix (Fin m) (Fin n) ℂ) + (u v : Fin n → ℂ) : + star u ⬝ᵥ (fsMatrix x D *ᵥ v) = + (mass x)⁻¹ * (star (D *ᵥ u) ⬝ᵥ (D *ᵥ v)) - (mass x)⁻¹ ^ 2 * + ((star (D *ᵥ u) ⬝ᵥ x) * (star x ⬝ᵥ (D *ᵥ v))) := by + rw [fsMatrix_eq hx D, smul_mulVec, dotProduct_smul, smul_eq_mul] + rw [← mulVec_mulVec, ← mulVec_mulVec, dotProduct_mulVec, ← star_mulVec] + rw [horizontal_mulVec, dotProduct_sub, dotProduct_smul, smul_eq_mul] + ring + + +def jacobianMatrix (f : (Fin n → ℂ) → (Fin m → ℂ)) (z : Fin n → ℂ) : + Matrix (Fin m) (Fin n) ℂ := LinearMap.toMatrix' (fderiv ℂ f z).toLinearMap + +@[simp] lemma jacobianMatrix_mulVec (f : (Fin n → ℂ) → (Fin m → ℂ)) + (z v : Fin n → ℂ) : jacobianMatrix f z *ᵥ v = fderiv ℂ f z v := + LinearMap.toMatrix'_mulVec _ _ + +lemma normalized_derivative {f : (Fin n → ℂ) → (Fin m → ℂ)} {z : Fin n → ℂ} + (hf : DifferentiableAt ℂ f z) {a : Fin m} (ha : f z a ≠ 0) + (v : Fin n → ℂ) (b : Fin m) : + fderiv ℂ (fun w j => f w j / f w a) z v b = + (fderiv ℂ f z v b * f z a - f z b * fderiv ℂ f z v a) / (f z a)^2 := by + have hd (i : Fin m) : HasFDerivAt (fun w => f w i) + ((ContinuousLinearMap.proj i).comp (fderiv ℂ f z)) z := + (ContinuousLinearMap.proj i : (Fin m → ℂ) →L[ℂ] ℂ).hasFDerivAt.comp z hf.hasFDerivAt + have hdiv (i : Fin m) := (hd i).mul ((hasDerivAt_inv ha).comp_hasFDerivAt z (hd a)) + simp only [Pi.mul_def, Function.comp_def] at hdiv + simp only [div_eq_mul_inv] + rw [fderiv_pi (fun i => (hdiv i).differentiableAt)] + change fderiv ℂ (fun w => f w b * (f w a)⁻¹) z v = _ + rw [(hdiv b).fderiv] + simp only [_root_.add_apply, _root_.smul_apply, + ContinuousLinearMap.comp_apply, ContinuousLinearMap.proj_apply, + smul_eq_mul] + field_simp + ring + + + +lemma fsMatrix_posDef_of_immersion {f : (Fin n → ℂ) → (Fin m → ℂ)} {z : Fin n → ℂ} + (hf : DifferentiableAt ℂ f z) (hx : f z ≠ 0) + (hImm : ∃ a, f z a ≠ 0 ∧ + Function.Injective (fderiv ℂ (fun w b => f w b / f w a) z)) : + (fsMatrix (f z) (jacobianMatrix f z)).PosDef := by + apply fsMatrix_posDef hx + obtain ⟨a, ha, hImm⟩ := hImm + have hk : ∀ v, (horizontal (f z) * jacobianMatrix f z) *ᵥ v = 0 → v = 0 := by + intro v hv + rw [← mulVec_mulVec, jacobianMatrix_mulVec, horizontal_mulVec_eq_zero_iff] at hv + have hn : fderiv ℂ (fun w b => f w b / f w a) z v = 0 := by + ext b + rw [normalized_derivative hf ha, hv] + simp only [Pi.smul_apply, smul_eq_mul, Pi.zero_apply] + ring + apply hImm + simpa only [map_zero] using hn + intro u v huv + apply sub_eq_zero.mp + apply hk + rw [mulVec_sub, huv, sub_self] + +end ProjectiveKaehler + +namespace Anticanonical + +abbrev Coordinates (d : ℕ) := Fin d → ℂ + + +def coordinateOverlap {X : Type*} [TopologicalSpace X] {d : ℕ} + (e e' : OpenPartialHomeomorph X (Coordinates d)) : Set (Coordinates d) := + e.target ∩ e.symm ⁻¹' e'.source + + + +structure ComplexAtlas (d : ℕ) (X : Type*) [TopologicalSpace X] where + count : ℕ + chart : Fin count → OpenPartialHomeomorph X (Coordinates d) + covers : ∀ x : X, ∃ i, x ∈ (chart i).source + holomorphic : ∀ i j, DifferentiableOn ℂ ((chart j) ∘ (chart i).symm) + (coordinateOverlap (chart i) (chart j)) + +namespace ComplexAtlas + +variable {d : ℕ} {X : Type*} [TopologicalSpace X] (A : ComplexAtlas d X) + + +def transition (i j : Fin A.count) : Coordinates d → Coordinates d := + A.chart j ∘ (A.chart i).symm + + + +def jacobian (i j : Fin A.count) (x : X) : ℂ := + Matrix.det (LinearMap.toMatrix' + (fderiv ℂ (A.transition i j) (A.chart i x)).toLinearMap) + + + +structure ProjectiveEmbedding where + ambientDimension : ℕ + map : X → Projectivization ℂ (Fin (ambientDimension + 1) → ℂ) + injective : Function.Injective map + lift : Fin A.count → Coordinates d → (Fin (ambientDimension + 1) → ℂ) + holomorphic_lift : ∀ i, DifferentiableOn ℂ (lift i) (A.chart i).target + lift_ne_zero : ∀ i z, z ∈ (A.chart i).target → lift i z ≠ 0 + represents : ∀ i z (hz : z ∈ (A.chart i).target), + map ((A.chart i).symm z) = Projectivization.mk ℂ (lift i z) (lift_ne_zero i z hz) + immersion : ∀ i z, z ∈ (A.chart i).target → + ∃ a : Fin (ambientDimension + 1), lift i z a ≠ 0 ∧ + Function.Injective (fderiv ℂ (fun w b ↦ lift i w b / lift i w a) z) + +end ComplexAtlas +end Anticanonical +namespace Anticanonical.ComplexAtlas + +open Filter Topology + +variable {d : ℕ} {X : Type*} [TopologicalSpace X] (A : ComplexAtlas d X) + +lemma isOpen_coordinateOverlap (i j : Fin A.count) : + IsOpen (coordinateOverlap (A.chart i) (A.chart j)) := + ((A.chart i).symm.trans (A.chart j)).open_source + +lemma coordinate_mem_overlap (i j : Fin A.count) {x : X} + (hi : x ∈ (A.chart i).source) (hj : x ∈ (A.chart j).source) : + A.chart i x ∈ coordinateOverlap (A.chart i) (A.chart j) := by + refine ⟨(A.chart i).mapsTo hi, ?_⟩ + change (A.chart i).symm (A.chart i x) ∈ (A.chart j).source + simpa only [(A.chart i).left_inv hi] using hj + +lemma transition_at (i j : Fin A.count) {x : X} (hi : x ∈ (A.chart i).source) : + A.transition i j (A.chart i x) = A.chart j x := by + simp only [transition, Function.comp_apply, (A.chart i).left_inv hi] + +lemma differentiableAt_transition (i j : Fin A.count) {x : X} + (hi : x ∈ (A.chart i).source) (hj : x ∈ (A.chart j).source) : + DifferentiableAt ℂ (A.transition i j) (A.chart i x) := + (A.holomorphic i j).differentiableAt + ((A.isOpen_coordinateOverlap i j).mem_nhds (A.coordinate_mem_overlap i j hi hj)) + +end Anticanonical.ComplexAtlas +namespace Anticanonical.ComplexAtlas + +open Matrix +open scoped ComplexOrder Matrix.Norms.Elementwise + +variable {d : ℕ} {X : Type*} [TopologicalSpace X] (A : ComplexAtlas d X) + +def derivativeMatrix (i j : Fin A.count) (x : X) : Matrix (Fin d) (Fin d) ℂ := + LinearMap.toMatrix' (fderiv ℂ (A.transition i j) (A.chart i x)).toLinearMap + + + +def fundamentalForm (g : Matrix (Fin d) (Fin d) ℂ) + (u v : Coordinates d) : ℝ := + (star u ⬝ᵥ (g *ᵥ v)).im + + + +structure KaehlerMetric where + matrix : Fin A.count → Coordinates d → Matrix (Fin d) (Fin d) ℂ + smooth : ∀ i, ContDiffOn ℝ ⊤ (matrix i) (A.chart i).target + positive : ∀ i z, z ∈ (A.chart i).target → (matrix i z).PosDef + compatibility : ∀ i j x, x ∈ (A.chart i).source → x ∈ (A.chart j).source → + matrix i (A.chart i x) = + (A.derivativeMatrix i j x)ᴴ * matrix j (A.chart j x) * A.derivativeMatrix i j x + closed : ∀ i z, z ∈ (A.chart i).target → ∀ u v w : Coordinates d, + fderiv ℝ (fun y ↦ fundamentalForm (matrix i y) v w) z u + + fderiv ℝ (fun y ↦ fundamentalForm (matrix i y) w u) z v + + fderiv ℝ (fun y ↦ fundamentalForm (matrix i y) u v) z w = 0 + +end Anticanonical.ComplexAtlas + +namespace ProjectiveKaehler +open Set Matrix +open scoped ComplexOrder Matrix.Norms.Elementwise + +variable {d m n k : ℕ} {s : Set (Fin d → ℂ)} + +lemma smooth_conj {f : (Fin d → ℂ) → ℂ} (hf : ContDiffOn ℝ ⊤ f s) : + ContDiffOn ℝ ⊤ (fun z => star (f z)) s := + Complex.conjCLE.contDiff.comp_contDiffOn hf + +lemma smooth_mass {f : (Fin d → ℂ) → (Fin m → ℂ)} (hf : ContDiffOn ℝ ⊤ f s) : + ContDiffOn ℝ ⊤ (fun z => mass (f z)) s := by + change ContDiffOn ℝ ⊤ (fun z => ∑ i, star (f z i) * f z i) s + apply ContDiffOn.sum + intro i _ + exact (smooth_conj (contDiffOn_pi.mp hf i)).mul (contDiffOn_pi.mp hf i) + +lemma smooth_horizontal {f : (Fin d → ℂ) → (Fin m → ℂ)} + (hf : ContDiffOn ℝ ⊤ f s) (hne : ∀ z ∈ s, f z ≠ 0) : + ContDiffOn ℝ ⊤ (fun z => horizontal (f z)) s := by + have hi := (smooth_mass hf).inv fun z hz => mass_ne_zero (hne z hz) + apply contDiffOn_pi.mpr + intro i + apply contDiffOn_pi.mpr + intro j + exact contDiffOn_const.sub (hi.mul ((contDiffOn_pi.mp hf i).mul + (smooth_conj (contDiffOn_pi.mp hf j)))) + +lemma smooth_matrix_mul {F : (Fin d → ℂ) → Matrix (Fin m) (Fin n) ℂ} + {G : (Fin d → ℂ) → Matrix (Fin n) (Fin k) ℂ} + (hF : ContDiffOn ℝ ⊤ F s) (hG : ContDiffOn ℝ ⊤ G s) : + ContDiffOn ℝ ⊤ (fun z => F z * G z) s := by + apply contDiffOn_pi.mpr + intro i + apply contDiffOn_pi.mpr + intro j + change ContDiffOn ℝ ⊤ (fun z => ∑ l, F z i l * G z l j) s + apply ContDiffOn.sum + intro l _ + exact (contDiffOn_pi.mp (contDiffOn_pi.mp hF i) l).mul + (contDiffOn_pi.mp (contDiffOn_pi.mp hG l) j) + +lemma smooth_conjTranspose {F : (Fin d → ℂ) → Matrix (Fin m) (Fin n) ℂ} + (hF : ContDiffOn ℝ ⊤ F s) : ContDiffOn ℝ ⊤ (fun z => (F z)ᴴ) s := by + apply contDiffOn_pi.mpr + intro i + apply contDiffOn_pi.mpr + intro j + exact smooth_conj (contDiffOn_pi.mp (contDiffOn_pi.mp hF j) i) + +lemma smooth_fsMatrix {f : (Fin d → ℂ) → (Fin m → ℂ)} + {D : (Fin d → ℂ) → Matrix (Fin m) (Fin n) ℂ} + (hf : ContDiffOn ℝ ⊤ f s) (hD : ContDiffOn ℝ ⊤ D s) (hne : ∀ z ∈ s, f z ≠ 0) : + ContDiffOn ℝ ⊤ (fun z => fsMatrix (f z) (D z)) s := by + have hQ := smooth_matrix_mul (smooth_horizontal hf hne) hD + exact ((smooth_mass hf).inv (fun z hz => mass_ne_zero (hne z hz))).smul + (smooth_matrix_mul (smooth_conjTranspose hQ) hQ) + +lemma smooth_jacobianMatrix {f : (Fin d → ℂ) → (Fin m → ℂ)} + (hs : IsOpen s) (hf : DifferentiableOn ℂ f s) : + ContDiffOn ℝ ⊤ (jacobianMatrix f) s := by + have hd : ContDiffOn ℂ ⊤ (fderiv ℂ f) s := + (analyticOnNhd_pi_of_differentiableOn hs hf).fderiv.contDiffOn hs.uniqueDiffOn + apply contDiffOn_pi.mpr + intro i + apply contDiffOn_pi.mpr + intro j + have hc : ContDiffOn ℂ ⊤ (fun z => fderiv ℂ f z (Pi.single j 1)) s := + hd.clm_apply contDiffOn_const + exact (contDiffOn_pi.mp hc i).restrict_scalars ℝ + +end ProjectiveKaehler + +namespace Anticanonical.ComplexAtlas +open ProjectiveKaehler +open scoped ComplexOrder Matrix.Norms.Elementwise +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + + +def ProjectiveEmbedding.backgroundMatrix (P : A.ProjectiveEmbedding) (i : Fin A.count) + (z : Coordinates d) : Matrix (Fin d) (Fin d) ℂ := + fsMatrix (P.lift i z) (jacobianMatrix (P.lift i) z) + +lemma ProjectiveEmbedding.backgroundMatrix_smooth (P : A.ProjectiveEmbedding) (i : Fin A.count) : + ContDiffOn ℝ ⊤ (P.backgroundMatrix i) (A.chart i).target := by + exact smooth_fsMatrix + (contDiffOn_real_pi_of_differentiableOn (A.chart i).open_target (P.holomorphic_lift i)) + (smooth_jacobianMatrix (A.chart i).open_target (P.holomorphic_lift i)) + (P.lift_ne_zero i) + +lemma ProjectiveEmbedding.backgroundMatrix_positive (P : A.ProjectiveEmbedding) + (i : Fin A.count) {z : Coordinates d} (hz : z ∈ (A.chart i).target) : + (P.backgroundMatrix i z).PosDef := by + exact fsMatrix_posDef_of_immersion + ((P.holomorphic_lift i).differentiableAt ((A.chart i).open_target.mem_nhds hz)) + (P.lift_ne_zero i z hz) (P.immersion i z hz) + +end Anticanonical.ComplexAtlas + +namespace ProjectiveKaehler +open Filter Topology Matrix +variable {m n k : ℕ} + +lemma jacobianMatrix_comp {f : (Fin n → ℂ) → (Fin m → ℂ)} + {g : (Fin k → ℂ) → (Fin n → ℂ)} {z : Fin k → ℂ} + (hf : DifferentiableAt ℂ f (g z)) (hg : DifferentiableAt ℂ g z) : + jacobianMatrix (f ∘ g) z = jacobianMatrix f (g z) * jacobianMatrix g z := by + unfold jacobianMatrix + rw [fderiv_comp z hf hg] + exact LinearMap.toMatrix'_comp _ _ + +lemma jacobianMatrix_smul {f : (Fin n → ℂ) → (Fin m → ℂ)} + {c : (Fin n → ℂ) → ℂ} {z : Fin n → ℂ} + (hc : DifferentiableAt ℂ c z) (hf : DifferentiableAt ℂ f z) : + jacobianMatrix (fun w => c w • f w) z = c z • jacobianMatrix f z + + vecMulVec (f z) (fun j => fderiv ℂ c z (Pi.single j 1)) := by + change LinearMap.toMatrix' (fderiv ℂ (c • f) z).toLinearMap = _ + rw [fderiv_smul hc hf] + ext i j + simp [LinearMap.toMatrix'_apply, jacobianMatrix, vecMulVec, mul_comm] + + + +lemma fsMatrix_eq_of_eventually_proportional + {f g : (Fin n → ℂ) → (Fin m → ℂ)} {z : Fin n → ℂ} + (hf : DifferentiableAt ℂ f z) (hg : DifferentiableAt ℂ g z) + (hfn : f z ≠ 0) (hgn : g z ≠ 0) + (hp : ∀ᶠ w in 𝓝 z, ∃ c : ℂ, c • g w = f w) : + fsMatrix (f z) (jacobianMatrix f z) = fsMatrix (g z) (jacobianMatrix g z) := by + classical + obtain ⟨a, ha⟩ : ∃ a, g z a ≠ 0 := by + by_contra h + push Not at h + exact hgn (funext h) + let c : (Fin n → ℂ) → ℂ := fun w => f w a / g w a + have hd : DifferentiableAt ℂ c z := by + simpa only [c, div_eq_mul_inv, Pi.mul_def, Pi.inv_def] using + (differentiableAt_pi.mp hf a).mul ((differentiableAt_pi.mp hg a).inv ha) + have he : f =ᶠ[𝓝 z] (fun w => c w • g w) := by + filter_upwards [hp, (differentiableAt_pi.mp hg a).continuousAt.eventually_ne ha] with w hw hwa + obtain ⟨b, hb⟩ := hw + have hwa' : f w a = b * g w a := by + simpa only [Pi.smul_apply, smul_eq_mul] using (congrFun hb a).symm + have hc : c w = b := by simp [c, hwa', hwa] + rw [hc, hb] + have hc : c z ≠ 0 := by + intro h + apply hfn + simpa only [h, zero_smul] using he.self_of_nhds + have hJ : jacobianMatrix f z = jacobianMatrix (fun w => c w • g w) z := by + unfold jacobianMatrix + rw [he.fderiv_eq] + rw [he.self_of_nhds, hJ, jacobianMatrix_smul hd hg] + exact fsMatrix_gauge hc hgn _ _ + +end ProjectiveKaehler + +namespace Anticanonical.ComplexAtlas +open ProjectiveKaehler Filter Topology Matrix +open scoped ComplexOrder Matrix.Norms.Elementwise +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +lemma ProjectiveEmbedding.backgroundMatrix_compatibility (P : A.ProjectiveEmbedding) + (i j : Fin A.count) (x : X) (hi : x ∈ (A.chart i).source) + (hj : x ∈ (A.chart j).source) : + P.backgroundMatrix i (A.chart i x) = + (A.derivativeMatrix i j x)ᴴ * P.backgroundMatrix j (A.chart j x) * + A.derivativeMatrix i j x := by + let z := A.chart i x + have hzi : z ∈ (A.chart i).target := (A.chart i).mapsTo hi + have hzj : A.transition i j z ∈ (A.chart j).target := by + rw [A.transition_at i j hi] + exact (A.chart j).mapsTo hj + have hdi := (P.holomorphic_lift i).differentiableAt ((A.chart i).open_target.mem_nhds hzi) + have hdj := (P.holomorphic_lift j).differentiableAt ((A.chart j).open_target.mem_nhds hzj) + have hdt := A.differentiableAt_transition i j hi hj + have he := fsMatrix_eq_of_eventually_proportional hdi (hdj.comp z hdt) + (P.lift_ne_zero i z hzi) (P.lift_ne_zero j _ hzj) ?_ + · change fsMatrix (P.lift i z) (jacobianMatrix (P.lift i) z) = _ + rw [he, jacobianMatrix_comp hdj hdt, fsMatrix_comp] + simp only [Function.comp_apply, A.transition_at i j hi, derivativeMatrix, + jacobianMatrix, backgroundMatrix, z] + · filter_upwards [(A.isOpen_coordinateOverlap i j).mem_nhds + (A.coordinate_mem_overlap i j hi hj)] with w hw + have hwj : A.transition i j w ∈ (A.chart j).target := (A.chart j).mapsTo hw.2 + have heq : (A.chart j).symm (A.transition i j w) = (A.chart i).symm w := + (A.chart j).left_inv hw.2 + have hproj : Projectivization.mk ℂ (P.lift i w) (P.lift_ne_zero i w hw.1) = + Projectivization.mk ℂ (P.lift j (A.transition i j w)) (P.lift_ne_zero j _ hwj) := by + rw [← P.represents i w hw.1, ← P.represents j _ hwj, heq] + obtain ⟨c, hc⟩ := (Projectivization.mk_eq_mk_iff ℂ _ _ _ _).mp hproj + exact ⟨(c : ℂ), hc⟩ + +end Anticanonical.ComplexAtlas + + + +noncomputable section +namespace ProjectiveKaehler.Closedness +open Matrix Filter Topology +open scoped ComplexOrder Matrix.Norms.Elementwise + +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] +variable {m : ℕ} + +def pair (x y : Fin m → ℂ) : ℂ := star x ⬝ᵥ y + +@[simp] lemma star_pair (x y : Fin m → ℂ) : star (pair x y) = pair y x := by + simp [pair, dotProduct, star_sum, star_mul, mul_comm] + +lemma pair_self_ne_zero {x : Fin m → ℂ} (hx : x ≠ 0) : pair x x ≠ 0 := by + simpa only [pair, ne_eq, dotProduct_star_self_eq_zero] using hx + +lemma smooth_pair {f g : E → (Fin m → ℂ)} {z : E} + (hf : ContDiffAt ℝ ⊤ f z) (hg : ContDiffAt ℝ ⊤ g z) : + ContDiffAt ℝ ⊤ (fun y => pair (f y) (g y)) z := by + unfold pair dotProduct + apply ContDiffAt.sum + intro i _ + exact (Complex.conjCLE.contDiff.contDiffAt.comp z (contDiffAt_pi.mp hf i)).mul + (contDiffAt_pi.mp hg i) + +lemma fderiv_pair_apply {f g : E → (Fin m → ℂ)} {z : E} + (hf : DifferentiableAt ℝ f z) (hg : DifferentiableAt ℝ g z) (u : E) : + fderiv ℝ (fun y => pair (f y) (g y)) z u = + pair (fderiv ℝ f z u) (g z) + pair (f z) (fderiv ℝ g z u) := by + have h (i : Fin m) := (differentiableAt_pi.mp hf i).hasFDerivAt.star.mul + (differentiableAt_pi.mp hg i).hasFDerivAt + have hs := HasFDerivAt.fun_sum (u := Finset.univ) (fun i _ => h i) + simp only [Pi.mul_def] at hs + change fderiv ℝ (fun y => ∑ i, star (f y i) * g y i) z u = _ + rw [hs.fderiv] + simp only [_root_.sum_apply, Finset.sum_add_distrib, _root_.add_apply, + _root_.smul_apply, ContinuousLinearMap.comp_apply, smul_eq_mul] + simp only [fderiv_apply hf, fderiv_apply hg] + simp only [ContinuousLinearMap.comp_apply, ContinuousLinearMap.proj_apply] + change (∑ i, star (f z i) * fderiv ℝ g z u i) + + (∑ i, g z i * star (fderiv ℝ f z u i)) = _ + simp only [pair, dotProduct, Pi.star_apply] + rw [add_comm] + congr 1 + apply Finset.sum_congr rfl + intro i _ + exact mul_comm _ _ + +lemma fderiv_eval_derivative {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] + {f : E → F} {z : E} (hf : ContDiffAt ℝ ⊤ f z) (u v : E) : + fderiv ℝ (fun y => fderiv ℝ f y v) z u = fderiv ℝ (fderiv ℝ f) z u v := by + rw [fderiv_clm_apply ((hf.fderiv_right (m := ⊤) (by simp)).differentiableAt (by simp)) + (differentiableAt_const v)] + simp + +lemma second_derivative_symmetric {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] + {f : E → F} {z : E} (hf : ContDiffAt ℝ ⊤ f z) (u v : E) : + fderiv ℝ (fun y => fderiv ℝ f y v) z u = + fderiv ℝ (fun y => fderiv ℝ f y u) z v := by + rw [fderiv_eval_derivative hf, fderiv_eval_derivative hf] + exact hf.isSymmSndFDerivAt (by simp) u v + + +def beta (f : E → (Fin m → ℂ)) (w y : E) : ℝ := + ((pair (f y) (f y))⁻¹ * pair (f y) (fderiv ℝ f y w)).im + +lemma smooth_beta {f : E → (Fin m → ℂ)} {z : E} (hf : ContDiffAt ℝ ⊤ f z) + (hne : f z ≠ 0) (w : E) : ContDiffAt ℝ ⊤ (beta f w) z := by + have hd := (hf.fderiv_right (m := ⊤) (by simp)).clm_apply (contDiffAt_const (c := w)) + exact Complex.imCLM.contDiff.contDiffAt.comp z + (((smooth_pair hf hf).inv (pair_self_ne_zero hne)).mul (smooth_pair hf hd)) + +lemma fderiv_inv_complex_apply {q : E → ℂ} {z : E} + (hq : DifferentiableAt ℝ q z) (hn : q z ≠ 0) (u : E) : + fderiv ℝ (fun y => (q y)⁻¹) z u = -(q z)⁻¹ ^ 2 * fderiv ℝ q z u := by + have h := ((hasDerivAt_inv hn).hasFDerivAt.restrictScalars ℝ).comp z hq.hasFDerivAt + simp only [Function.comp_def] at h + rw [h.fderiv] + simp [ContinuousLinearMap.comp_apply, inv_pow, mul_comm] + +lemma fderiv_im_apply {q : E → ℂ} {z : E} + (hq : DifferentiableAt ℝ q z) (u : E) : + fderiv ℝ (fun y => (q y).im) z u = (fderiv ℝ q z u).im := by + have h := Complex.imCLM.hasFDerivAt.comp z hq.hasFDerivAt + exact congrArg (fun l : E →L[ℝ] ℝ => l u) h.fderiv + +lemma fderiv_beta {f : E → (Fin m → ℂ)} {z : E} (hf : ContDiffAt ℝ ⊤ f z) + (hne : f z ≠ 0) (u w : E) : + fderiv ℝ (beta f w) z u = + (-(pair (f z) (f z))⁻¹ ^ 2 * + (pair (fderiv ℝ f z u) (f z) + pair (f z) (fderiv ℝ f z u)) * + pair (f z) (fderiv ℝ f z w) + + (pair (f z) (f z))⁻¹ * + (pair (fderiv ℝ f z u) (fderiv ℝ f z w) + + pair (f z) (fderiv ℝ (fderiv ℝ f) z u w))).im := by + have hD : ContDiffAt ℝ ⊤ (fun y => fderiv ℝ f y w) z := + (hf.fderiv_right (by simp)).clm_apply contDiffAt_const + have hQ := (smooth_pair hf hf).differentiableAt (by simp) + have hR := (smooth_pair hf hD).differentiableAt (by simp) + have hI := hQ.inv (pair_self_ne_zero hne) + unfold beta + have hP : DifferentiableAt ℝ (fun y => (pair (f y) (f y))⁻¹ * + pair (f y) (fderiv ℝ f y w)) z := by + simpa only [Pi.mul_def, Pi.inv_def] using hI.mul hR + rw [fderiv_im_apply hP] + have hM := fderiv_mul hI hR + simp only [Pi.mul_def, Pi.inv_def] at hM + rw [hM] + simp only [_root_.add_apply, _root_.smul_apply, smul_eq_mul] + rw [fderiv_inv_complex_apply hQ (pair_self_ne_zero hne)] + rw [fderiv_pair_apply (hf.differentiableAt (by simp)) (hf.differentiableAt (by simp)), + fderiv_pair_apply (hf.differentiableAt (by simp)) (hD.differentiableAt (by simp)), + fderiv_eval_derivative hf] + congr 1 + ring + +lemma anti_beta_algebra (r a b c t : ℂ) (hr : star r = r) : + (-r ^ 2 * (star a + a) * b + r * (c + t)).im - + (-r ^ 2 * (star b + b) * a + r * (star c + t)).im = + 2 * (r * c - r ^ 2 * (star a * b)).im := by + rw [← Complex.sub_im] + have h : (-r ^ 2 * (star a + a) * b + r * (c + t)) - + (-r ^ 2 * (star b + b) * a + r * (star c + t)) = + (r * c - r ^ 2 * (star a * b)) - star (r * c - r ^ 2 * (star a * b)) := by + simp only [star_sub, star_mul, star_pow, star_star, hr] + ring + rw [h] + simp only [Complex.sub_im, Complex.star_def, Complex.conj_im] + ring + + + +def omega (f : E → (Fin m → ℂ)) (v w y : E) : ℝ := + ((pair (f y) (f y))⁻¹ * pair (fderiv ℝ f y v) (fderiv ℝ f y w) - + (pair (f y) (f y))⁻¹ ^ 2 * + (pair (fderiv ℝ f y v) (f y) * pair (f y) (fderiv ℝ f y w))).im + +lemma beta_antisym {f : E → (Fin m → ℂ)} {z : E} (hf : ContDiffAt ℝ ⊤ f z) + (hne : f z ≠ 0) (v w : E) : + fderiv ℝ (beta f w) z v - fderiv ℝ (beta f v) z w = 2 * omega f v w z := by + rw [fderiv_beta hf hne, fderiv_beta hf hne, + (hf.isSymmSndFDerivAt (by simp) w v)] + unfold omega + rw [← star_pair (f z) (fderiv ℝ f z v), + ← star_pair (f z) (fderiv ℝ f z w), + ← star_pair (fderiv ℝ f z v) (fderiv ℝ f z w)] + apply anti_beta_algebra + simp + +lemma cyclic_antisym_derivative {b : E → E → ℝ} {z : E} + (hb : ∀ v, ContDiffAt ℝ ⊤ (b v) z) (u v w : E) : + fderiv ℝ (fun y => fderiv ℝ (b w) y v - fderiv ℝ (b v) y w) z u + + fderiv ℝ (fun y => fderiv ℝ (b u) y w - fderiv ℝ (b w) y u) z v + + fderiv ℝ (fun y => fderiv ℝ (b v) y u - fderiv ℝ (b u) y v) z w = 0 := by + have hd (a c : E) : DifferentiableAt ℝ (fun y => fderiv ℝ (b a) y c) z := + (((hb a).fderiv_right (m := ⊤) (by simp)).clm_apply contDiffAt_const).differentiableAt + (by simp) + simp only [fderiv_fun_sub (hd _ _) (hd _ _), _root_.sub_apply] + rw [second_derivative_symmetric (hb w) u v, second_derivative_symmetric (hb v) u w, + second_derivative_symmetric (hb u) v w] + ring + +lemma smooth_omega {f : E → (Fin m → ℂ)} {z : E} (hf : ContDiffAt ℝ ⊤ f z) + (hne : f z ≠ 0) (v w : E) : ContDiffAt ℝ ⊤ (omega f v w) z := by + have hD (a : E) : ContDiffAt ℝ ⊤ (fun y => fderiv ℝ f y a) z := + (hf.fderiv_right (by simp)).clm_apply contDiffAt_const + have hI := (smooth_pair hf hf).inv (pair_self_ne_zero hne) + exact Complex.imCLM.contDiff.contDiffAt.comp z + ((hI.mul (smooth_pair (hD v) (hD w))).sub + ((hI.pow 2).mul ((smooth_pair (hD v) hf).mul (smooth_pair hf (hD w))))) + + + +lemma omega_closed {f : E → (Fin m → ℂ)} {U : Set E} (hU : IsOpen U) + (hf : ContDiffOn ℝ ⊤ f U) (hne : ∀ y ∈ U, f y ≠ 0) + {z : E} (hz : z ∈ U) (u v w : E) : + fderiv ℝ (omega f v w) z u + fderiv ℝ (omega f w u) z v + + fderiv ℝ (omega f u v) z w = 0 := by + have hfc := hf.contDiffAt (hU.mem_nhds hz) + have hbc (a : E) := smooth_beta hfc (hne z hz) a + have he (a b c : E) : + fderiv ℝ (fun y => fderiv ℝ (beta f b) y a - fderiv ℝ (beta f a) y b) z c = + 2 * fderiv ℝ (omega f a b) z c := by + have heq : (fun y => fderiv ℝ (beta f b) y a - fderiv ℝ (beta f a) y b) + =ᶠ[𝓝 z] (fun y => 2 * omega f a b y) := by + filter_upwards [hU.mem_nhds hz] with y hy + exact beta_antisym (hf.contDiffAt (hU.mem_nhds hy)) (hne y hy) a b + rw [heq.fderiv_eq, fderiv_const_mul + ((smooth_omega hfc (hne z hz) a b).differentiableAt (by simp))] + rfl + have hc := cyclic_antisym_derivative hbc u v w + rw [he, he, he] at hc + linarith + +end ProjectiveKaehler.Closedness + +namespace ProjectiveKaehler +open Anticanonical.ComplexAtlas Matrix +variable {m n : ℕ} + +lemma fundamentalForm_fs_eq_omega {f : (Fin n → ℂ) → (Fin m → ℂ)} + {z : Fin n → ℂ} (hf : DifferentiableAt ℂ f z) (hne : f z ≠ 0) (v w : Fin n → ℂ) : + fundamentalForm (fsMatrix (f z) (jacobianMatrix f z)) v w = + Closedness.omega f v w z := by + have hd (a : Fin n → ℂ) : fderiv ℝ f z a = fderiv ℂ f z a := by + rw [(hf.hasFDerivAt.restrictScalars ℝ).fderiv] + rfl + unfold fundamentalForm + rw [fsMatrix_pair hne] + simp only [jacobianMatrix_mulVec, Closedness.omega, Closedness.pair, mass, hd] + +end ProjectiveKaehler + +namespace Anticanonical.ComplexAtlas +open ProjectiveKaehler Filter Topology Matrix +open scoped ComplexOrder Matrix.Norms.Elementwise +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +lemma ProjectiveEmbedding.backgroundMatrix_closed (P : A.ProjectiveEmbedding) + (i : Fin A.count) {z : Coordinates d} (hz : z ∈ (A.chart i).target) + (u v w : Coordinates d) : + fderiv ℝ (fun y => fundamentalForm (P.backgroundMatrix i y) v w) z u + + fderiv ℝ (fun y => fundamentalForm (P.backgroundMatrix i y) w u) z v + + fderiv ℝ (fun y => fundamentalForm (P.backgroundMatrix i y) u v) z w = 0 := by + have hs := contDiffOn_real_pi_of_differentiableOn (A.chart i).open_target + (P.holomorphic_lift i) + have he (a b : Coordinates d) : + (fun y => fundamentalForm (P.backgroundMatrix i y) a b) + =ᶠ[𝓝 z] Closedness.omega (P.lift i) a b := by + filter_upwards [(A.chart i).open_target.mem_nhds hz] with y hy + exact fundamentalForm_fs_eq_omega + ((P.holomorphic_lift i).differentiableAt ((A.chart i).open_target.mem_nhds hy)) + (P.lift_ne_zero i y hy) a b + rw [(he v w).fderiv_eq, (he w u).fderiv_eq, (he u v).fderiv_eq] + exact Closedness.omega_closed (A.chart i).open_target hs (P.lift_ne_zero i) hz u v w + + + +def ProjectiveEmbedding.backgroundKaehlerMetric (P : A.ProjectiveEmbedding) : A.KaehlerMetric where + matrix := P.backgroundMatrix + smooth := P.backgroundMatrix_smooth + positive := fun i _ hz => P.backgroundMatrix_positive i hz + compatibility := P.backgroundMatrix_compatibility + closed := fun i _ hz => P.backgroundMatrix_closed i hz + +theorem ProjectiveEmbedding.nonemptyKaehlerMetric (P : A.ProjectiveEmbedding) : + Nonempty A.KaehlerMetric := ⟨P.backgroundKaehlerMetric⟩ + +end Anticanonical.ComplexAtlas + + + +namespace Anticanonical.SourceSmooth +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +open Matrix +variable {d : ℕ} {X : Type*} [TopologicalSpace X] + + + +def levi (φ : Coordinates d → ℝ) (z v : Coordinates d) : ℝ := + (fderiv ℝ (fderiv ℝ φ) z v) v + + (fderiv ℝ (fderiv ℝ φ) z (Complex.I • v)) (Complex.I • v) + + +structure SemipositiveAnticanonicalMetric (A : ComplexAtlas d X) where + weight : Fin A.count → Coordinates d → ℝ + smooth : ∀ i, ContDiffOn ℝ ∞ (weight i) (A.chart i).target + compatibility : ∀ i j x, x ∈ (A.chart i).source → x ∈ (A.chart j).source → + weight j (A.chart j x) = + weight i (A.chart i x) + Real.log (‖A.jacobian i j x‖ ^ 2) + semipositive : ∀ i z, z ∈ (A.chart i).target → + ∀ v : Coordinates d, 0 ≤ levi (weight i) z v + + +structure KaehlerMetric (A : ComplexAtlas d X) where + matrix : Fin A.count → Coordinates d → Matrix (Fin d) (Fin d) ℂ + smooth : ∀ i, ContDiffOn ℝ ∞ (matrix i) (A.chart i).target + positive : ∀ i z, z ∈ (A.chart i).target → (matrix i z).PosDef + compatibility : ∀ i j x, x ∈ (A.chart i).source → x ∈ (A.chart j).source → + matrix i (A.chart i x) = + (A.derivativeMatrix i j x)ᴴ * matrix j (A.chart j x) * A.derivativeMatrix i j x + closed : ∀ i z, z ∈ (A.chart i).target → ∀ u v w : Coordinates d, + fderiv ℝ (fun y ↦ ComplexAtlas.fundamentalForm (matrix i y) v w) z u + + fderiv ℝ (fun y ↦ ComplexAtlas.fundamentalForm (matrix i y) w u) z v + + fderiv ℝ (fun y ↦ ComplexAtlas.fundamentalForm (matrix i y) u v) z w = 0 + +namespace KaehlerMetric +variable {A : ComplexAtlas d X} +def volumeCoefficient (g : KaehlerMetric A) (i : Fin A.count) (z : Coordinates d) : ℝ := + (g.matrix i z).det.re + +def ricciPotential (g : KaehlerMetric A) (i : Fin A.count) (z : Coordinates d) : ℝ := + -Real.log (g.volumeCoefficient i z) + +def ricciQuadratic (g : KaehlerMetric A) (i : Fin A.count) (z v : Coordinates d) : ℝ := + levi (g.ricciPotential i) z v +end KaehlerMetric + + + +def PrescribedRicci : Prop := + ∀ (d : ℕ) (X : Type) [TopologicalSpace X] [T2Space X] + [CompactSpace X] [ConnectedSpace X] (A : ComplexAtlas d X), + Nonempty A.ProjectiveEmbedding → + ∀ h : SemipositiveAnticanonicalMetric A, + ∃ g : KaehlerMetric A, ∀ i z, z ∈ (A.chart i).target → + ∀ v : Coordinates d, g.ricciQuadratic i z v = levi (h.weight i) z v + +end Anticanonical.SourceSmooth + +namespace Anticanonical.SourceSmooth +open scoped ContDiff +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + + + +def projectiveBackground (P : A.ProjectiveEmbedding) : KaehlerMetric A where + matrix := P.backgroundMatrix + smooth := fun i => (P.backgroundMatrix_smooth i).of_le (by simp) + positive := fun i _ hz => P.backgroundMatrix_positive i hz + compatibility := P.backgroundMatrix_compatibility + closed := fun i _ hz => P.backgroundMatrix_closed i hz + +end Anticanonical.SourceSmooth + + + +noncomputable section +namespace PotentialKaehler +open Matrix +open scoped Matrix.Norms.Elementwise ComplexOrder ContDiff + +variable {n : ℕ} +abbrev V (n : ℕ) := Fin n → ℂ +abbrev RealBilinear (n : ℕ) := V n →L[ℝ] V n →L[ℝ] ℝ + + + +def hermitianPart (B : RealBilinear n) (u v : V n) : ℂ := + ⟨(B u v + B (Complex.I • u) (Complex.I • v)) / 4, + (B (Complex.I • u) v - B u (Complex.I • v)) / 4⟩ + +lemma complex_smul_decompose (a : ℂ) (v : V n) : + a • v = a.re • v + a.im • (Complex.I • v) := by + ext i + change a * v i = a.re • v i + a.im • (Complex.I * v i) + rw [Complex.real_smul, Complex.real_smul, ← mul_assoc, ← add_mul, Complex.re_add_im] + +lemma hermitianPart_add_left (B : RealBilinear n) (u u' v : V n) : + hermitianPart B (u + u') v = hermitianPart B u v + hermitianPart B u' v := by + apply Complex.ext <;> simp [hermitianPart, smul_add, map_add] <;> ring + +lemma hermitianPart_add_right (B : RealBilinear n) (u v v' : V n) : + hermitianPart B u (v + v') = hermitianPart B u v + hermitianPart B u v' := by + apply Complex.ext <;> simp [hermitianPart, smul_add, map_add] <;> ring + +lemma hermitianPart_real_smul_left (B : RealBilinear n) (a : ℝ) (u v : V n) : + hermitianPart B (a • u) v = a • hermitianPart B u v := by + apply Complex.ext <;> simp [hermitianPart, smul_comm Complex.I a, map_smul, smul_eq_mul] <;> ring + +lemma hermitianPart_real_smul_right (B : RealBilinear n) (a : ℝ) (u v : V n) : + hermitianPart B u (a • v) = a • hermitianPart B u v := by + apply Complex.ext <;> simp [hermitianPart, smul_comm Complex.I a, map_smul, smul_eq_mul] <;> ring + +lemma hermitianPart_I_left (B : RealBilinear n) (u v : V n) : + hermitianPart B (Complex.I • u) v = -Complex.I * hermitianPart B u v := by + apply Complex.ext <;> simp [hermitianPart, smul_smul, Complex.I_mul_I, map_neg] <;> ring + +lemma hermitianPart_I_right (B : RealBilinear n) (u v : V n) : + hermitianPart B u (Complex.I • v) = Complex.I * hermitianPart B u v := by + apply Complex.ext <;> simp [hermitianPart, smul_smul, Complex.I_mul_I, map_neg] <;> ring + +lemma hermitianPart_smul_left (B : RealBilinear n) (a : ℂ) (u v : V n) : + hermitianPart B (a • u) v = star a * hermitianPart B u v := by + rw [complex_smul_decompose, hermitianPart_add_left, + hermitianPart_real_smul_left, hermitianPart_real_smul_left, hermitianPart_I_left] + apply Complex.ext <;> simp [Complex.mul_re, Complex.mul_im] + +lemma hermitianPart_smul_right (B : RealBilinear n) (a : ℂ) (u v : V n) : + hermitianPart B u (a • v) = a * hermitianPart B u v := by + rw [complex_smul_decompose, hermitianPart_add_right, + hermitianPart_real_smul_right, hermitianPart_real_smul_right, hermitianPart_I_right] + apply Complex.ext <;> simp [Complex.mul_re, Complex.mul_im] + ring + + +def hermitianPartForm (B : RealBilinear n) : V n →ₗ⋆[ℂ] V n →ₗ[ℂ] ℂ where + toFun u := + { toFun := hermitianPart B u + map_add' := hermitianPart_add_right B u + map_smul' := fun a v => hermitianPart_smul_right B a u v } + map_add' u u' := by + apply LinearMap.ext + intro v + exact hermitianPart_add_left B u u' v + map_smul' a u := by + apply LinearMap.ext + intro v + exact hermitianPart_smul_left B a u v + +lemma hermitianPart_star (B : RealBilinear n) (hB : ∀ u v, B u v = B v u) (u v : V n) : + star (hermitianPart B u v) = hermitianPart B v u := by + apply Complex.ext <;> simp [hermitianPart, hB u v, hB (Complex.I • u) (Complex.I • v), + hB (Complex.I • u) v, hB u (Complex.I • v)] + ring + +def hermitianPartMatrix (B : RealBilinear n) : Matrix (Fin n) (Fin n) ℂ := + LinearMap.toMatrix₂ (Pi.basisFun ℂ (Fin n)) (Pi.basisFun ℂ (Fin n)) (hermitianPartForm B) + +lemma hermitianPartMatrix_apply (B : RealBilinear n) (i j : Fin n) : + hermitianPartMatrix B i j = hermitianPart B (Pi.single i 1) (Pi.single j 1) := by + simp [hermitianPartMatrix, LinearMap.toMatrix₂_apply, hermitianPartForm] + +lemma hermitianPartMatrix_pair (B : RealBilinear n) (u v : V n) : + star u ⬝ᵥ (hermitianPartMatrix B *ᵥ v) = hermitianPart B u v := by + simpa [hermitianPartMatrix, hermitianPartForm] using + (star_dotProduct_toMatrix₂_mulVec (B := hermitianPartForm B) (Pi.basisFun ℂ (Fin n)) u v) + +lemma hermitianPartMatrix_hermitian (B : RealBilinear n) (hB : ∀ u v, B u v = B v u) : + (hermitianPartMatrix B).IsHermitian := by + apply (LinearMap.isSymm_iff_isHermitian_toMatrix (Pi.basisFun ℂ (Fin n))).mp + exact ⟨hermitianPart_star B hB⟩ + + +def potentialMatrix (φ : V n → ℝ) (z : V n) : Matrix (Fin n) (Fin n) ℂ := + hermitianPartMatrix (fderiv ℝ (fderiv ℝ φ) z) + +lemma potentialMatrix_hermitian {φ : V n → ℝ} {z : V n} + (hφ : ContDiffAt ℝ ∞ φ z) : (potentialMatrix φ z).IsHermitian := by + apply hermitianPartMatrix_hermitian + exact hφ.isSymmSndFDerivAt (by simp only [minSmoothness_of_isRCLikeNormedField]; change ((2 : ℕ∞) : WithTop ℕ∞) ≤ ((⊤ : ℕ∞) : WithTop ℕ∞); exact WithTop.coe_le_coe.mpr le_top) + +lemma smooth_hermitianPart {B : V n → RealBilinear n} {z : V n} + (hB : ContDiffAt ℝ ∞ B z) (u v : V n) : + ContDiffAt ℝ ∞ (fun y => hermitianPart (B y) u v) z := by + have hs (a b : V n) : ContDiffAt ℝ ∞ (fun y => B y a b) z := + (hB.clm_apply contDiffAt_const).clm_apply contDiffAt_const + have hr := ((hs u v).add (hs (Complex.I • u) (Complex.I • v))).div_const 4 + have hi := ((hs (Complex.I • u) v).sub (hs u (Complex.I • v))).div_const 4 + simpa only [hermitianPart, Complex.mk_eq_add_mul_I, Function.comp_def, Complex.ofRealCLM_apply] using + (Complex.ofRealCLM.contDiff.contDiffAt.comp z hr).add + ((Complex.ofRealCLM.contDiff.contDiffAt.comp z hi).mul (contDiffAt_const (c := Complex.I))) + +lemma potentialMatrix_smooth {φ : V n → ℝ} {z : V n} + (hφ : ContDiffAt ℝ ∞ φ z) : ContDiffAt ℝ ∞ (potentialMatrix φ) z := by + apply contDiffAt_pi.mpr + intro i + apply contDiffAt_pi.mpr + intro j + simpa only [potentialMatrix, hermitianPartMatrix_apply] using + smooth_hermitianPart ((hφ.fderiv_right (m := ∞) (by simp)).fderiv_right (m := ∞) (by simp)) + (Pi.single i 1) (Pi.single j 1) + +section Derivatives +variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] + +lemma fderiv_eval_derivative {f : E → F} {z : E} (hf : ContDiffAt ℝ ∞ f z) (u v : E) : + fderiv ℝ (fun y => fderiv ℝ f y v) z u = fderiv ℝ (fderiv ℝ f) z u v := by + rw [fderiv_clm_apply ((hf.fderiv_right (m := ∞) (by simp)).differentiableAt (by simp)) + (differentiableAt_const v)] + simp + +lemma second_derivative_symmetric {f : E → F} {z : E} + (hf : ContDiffAt ℝ ∞ f z) (u v : E) : + fderiv ℝ (fun y => fderiv ℝ f y v) z u = + fderiv ℝ (fun y => fderiv ℝ f y u) z v := by + rw [fderiv_eval_derivative hf, fderiv_eval_derivative hf] + exact hf.isSymmSndFDerivAt (by simp only [minSmoothness_of_isRCLikeNormedField]; change ((2 : ℕ∞) : WithTop ℕ∞) ≤ ((⊤ : ℕ∞) : WithTop ℕ∞); exact WithTop.coe_le_coe.mpr le_top) u v + +lemma cyclic_antisym_derivative {b : E → E → ℝ} {z : E} + (hb : ∀ v, ContDiffAt ℝ ∞ (b v) z) (u v w : E) : + fderiv ℝ (fun y => fderiv ℝ (b w) y v - fderiv ℝ (b v) y w) z u + + fderiv ℝ (fun y => fderiv ℝ (b u) y w - fderiv ℝ (b w) y u) z v + + fderiv ℝ (fun y => fderiv ℝ (b v) y u - fderiv ℝ (b u) y v) z w = 0 := by + have hd (a c : E) : DifferentiableAt ℝ (fun y => fderiv ℝ (b a) y c) z := + (((hb a).fderiv_right (m := ∞) (by simp)).clm_apply contDiffAt_const).differentiableAt + (by simp) + simp only [fderiv_fun_sub (hd _ _) (hd _ _), _root_.sub_apply] + rw [second_derivative_symmetric (hb w) u v, second_derivative_symmetric (hb v) u w, + second_derivative_symmetric (hb u) v w] + ring +end Derivatives + + +def potentialPrimitive (φ : V n → ℝ) (v z : V n) : ℝ := + -(fderiv ℝ φ z (Complex.I • v)) / 4 + +def potentialForm (φ : V n → ℝ) (u v z : V n) : ℝ := + (star u ⬝ᵥ (potentialMatrix φ z *ᵥ v)).im + +lemma potentialPrimitive_smooth {φ : V n → ℝ} {z : V n} + (hφ : ContDiffAt ℝ ∞ φ z) (v : V n) : + ContDiffAt ℝ ∞ (potentialPrimitive φ v) z := + (((hφ.fderiv_right (by simp)).clm_apply contDiffAt_const).neg).div_const 4 + +lemma potentialPrimitive_derivative {φ : V n → ℝ} {z : V n} + (hφ : ContDiffAt ℝ ∞ φ z) (u v : V n) : + fderiv ℝ (potentialPrimitive φ v) z u = + -(fderiv ℝ (fderiv ℝ φ) z u (Complex.I • v)) / 4 := by + have hd := ((hφ.fderiv_right (m := ∞) (by simp)).clm_apply + (contDiffAt_const (c := Complex.I • v))).differentiableAt (by simp) + unfold potentialPrimitive + simp only [div_eq_mul_inv] + have hm := fderiv_mul_const (hd.neg) (4 : ℝ)⁻¹ + simp only [Pi.neg_apply] at hm + rw [hm] + rw [fderiv_neg] + simp only [_root_.smul_apply, _root_.neg_apply, smul_eq_mul, + fderiv_eval_derivative hφ] + ring + +lemma potentialPrimitive_antisym {φ : V n → ℝ} {z : V n} + (hφ : ContDiffAt ℝ ∞ φ z) (u v : V n) : + fderiv ℝ (potentialPrimitive φ v) z u - + fderiv ℝ (potentialPrimitive φ u) z v = potentialForm φ u v z := by + rw [potentialPrimitive_derivative hφ, potentialPrimitive_derivative hφ] + simp only [potentialForm, potentialMatrix, hermitianPartMatrix_pair, hermitianPart] + rw [hφ.isSymmSndFDerivAt (by simp only [minSmoothness_of_isRCLikeNormedField]; change ((2 : ℕ∞) : WithTop ℕ∞) ≤ ((⊤ : ℕ∞) : WithTop ℕ∞); exact WithTop.coe_le_coe.mpr le_top) v (Complex.I • u)] + ring + +lemma potentialMatrix_closed {φ : V n → ℝ} {U : Set (V n)} + (hU : IsOpen U) (hφ : ContDiffOn ℝ ∞ φ U) {z : V n} (hz : z ∈ U) + (u v w : V n) : + fderiv ℝ (potentialForm φ v w) z u + fderiv ℝ (potentialForm φ w u) z v + + fderiv ℝ (potentialForm φ u v) z w = 0 := by + have he (a b : V n) : + (fun y => fderiv ℝ (potentialPrimitive φ b) y a - + fderiv ℝ (potentialPrimitive φ a) y b) =ᶠ[nhds z] potentialForm φ a b := by + filter_upwards [hU.mem_nhds hz] with y hy + exact potentialPrimitive_antisym (hφ.contDiffAt (hU.mem_nhds hy)) a b + have hc := cyclic_antisym_derivative + (fun a => potentialPrimitive_smooth (hφ.contDiffAt (hU.mem_nhds hz)) a) u v w + rwa [(he _ _).fderiv_eq, (he _ _).fderiv_eq, (he _ _).fderiv_eq] at hc + +section ChainRule +variable {E F G : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] [NormedAddCommGroup G] [NormedSpace ℝ G] + +omit [NormedSpace ℝ E] [NormedSpace ℝ F] in +lemma eventually_differentiableAt {𝕜 : Type*} [NontriviallyNormedField 𝕜] + [NormedSpace 𝕜 E] [NormedSpace 𝕜 F] {f : E → F} {z : E} + (hf : ContDiffAt 𝕜 ∞ f z) : + ∀ᶠ y in nhds z, DifferentiableAt 𝕜 f y := by + have h1 : ContDiffAt 𝕜 1 f z := (contDiffAt_infty.mp hf) 1 + exact (h1.eventually (by simp)).mono fun y hy => hy.differentiableAt (by simp) + +lemma second_derivative_comp {f : E → F} {g : F → G} {z : E} + (hf : ContDiffAt ℝ ∞ f z) (hg : ContDiffAt ℝ ∞ g (f z)) (u v : E) : + fderiv ℝ (fderiv ℝ (g ∘ f)) z u v = + fderiv ℝ (fderiv ℝ g) (f z) (fderiv ℝ f z u) (fderiv ℝ f z v) + + fderiv ℝ g (f z) (fderiv ℝ (fderiv ℝ f) z u v) := by + have hfd := hf.differentiableAt (by simp) + have hgd := hg.differentiableAt (by simp) + have hDf := (hf.fderiv_right (m := ∞) (by simp)).differentiableAt (by simp) + have hDg := (hg.fderiv_right (m := ∞) (by simp)).differentiableAt (by simp) + have he : fderiv ℝ (g ∘ f) =ᶠ[nhds z] fun y => + (fderiv ℝ g (f y)).comp (fderiv ℝ f y) := by + filter_upwards [eventually_differentiableAt hf, + hf.continuousAt.tendsto.eventually (eventually_differentiableAt hg)] with y hy hy' + exact fderiv_comp y hy' hy + rw [he.fderiv_eq] + have hm := fderiv_clm_comp (hDg.comp z hfd) hDf + simp only [Function.comp_def] at hm + rw [hm] + have hc := fderiv_comp z hDg hfd + simp only [Function.comp_def] at hc + rw [hc] + simp only [_root_.add_apply, ContinuousLinearMap.comp_apply, + ContinuousLinearMap.compL_apply, ContinuousLinearMap.flip_apply] + exact add_comm _ _ +end ChainRule + +lemma fderiv_complex_smul {m : ℕ} {f : V n → V m} {z : V n} + (hf : DifferentiableAt ℂ f z) (a : ℂ) (v : V n) : + fderiv ℝ f z (a • v) = a • fderiv ℝ f z v := by + rw [hf.fderiv_restrictScalars (𝕜 := ℝ)] + exact map_smul (fderiv ℂ f z) a v + +lemma second_derivative_complex_smul_right {m : ℕ} {f : V n → V m} {z : V n} + (hf : ContDiffAt ℂ ∞ f z) (a : ℂ) (u v : V n) : + fderiv ℝ (fderiv ℝ f) z u (a • v) = + a • fderiv ℝ (fderiv ℝ f) z u v := by + have hr := hf.restrict_scalars ℝ + have hd := ((hr.fderiv_right (m := ∞) (by simp)).clm_apply + (contDiffAt_const (c := v))).differentiableAt (by simp) + have he : (fun y => fderiv ℝ f y (a • v)) =ᶠ[nhds z] + (fun y => a • fderiv ℝ f y v) := by + filter_upwards [eventually_differentiableAt hf] with y hy + exact fderiv_complex_smul hy a v + have he' := congrArg (fun l : V n →L[ℝ] V m => l u) he.fderiv_eq + rw [fderiv_eval_derivative hr] at he' + have hs : fderiv ℝ (fun y => a • fderiv ℝ f y v) z = + a • fderiv ℝ (fun y => fderiv ℝ f y v) z := fderiv_const_smul hd a + rw [hs] at he' + simpa only [_root_.smul_apply, fderiv_eval_derivative hr] using he' + +lemma second_derivative_complex_smul_left {m : ℕ} {f : V n → V m} {z : V n} + (hf : ContDiffAt ℂ ∞ f z) (a : ℂ) (u v : V n) : + fderiv ℝ (fderiv ℝ f) z (a • u) v = + a • fderiv ℝ (fderiv ℝ f) z u v := by + have hs := (hf.restrict_scalars ℝ).isSymmSndFDerivAt + (by simp only [minSmoothness_of_isRCLikeNormedField] + change ((2 : ℕ∞) : WithTop ℕ∞) ≤ ((⊤ : ℕ∞) : WithTop ℕ∞) + exact WithTop.coe_le_coe.mpr le_top) + rw [hs (a • u) v, second_derivative_complex_smul_right hf, hs v u] + + + +lemma hermitianPart_comp {m : ℕ} {f : V n → V m} {φ : V m → ℝ} {z : V n} + (hf : ContDiffAt ℂ ∞ f z) (hφ : ContDiffAt ℝ ∞ φ (f z)) (u v : V n) : + hermitianPart (fderiv ℝ (fderiv ℝ (φ ∘ f)) z) u v = + hermitianPart (fderiv ℝ (fderiv ℝ φ) (f z)) + (fderiv ℝ f z u) (fderiv ℝ f z v) := by + have hr := hf.restrict_scalars ℝ + have hd := hf.differentiableAt (by simp) + apply Complex.ext <;> + simp only [hermitianPart, second_derivative_comp hr hφ, + fderiv_complex_smul hd, second_derivative_complex_smul_left hf, + second_derivative_complex_smul_right hf, smul_smul, Complex.I_mul_I, + neg_smul, one_smul, map_neg] <;> ring + +lemma matrix_pair_pullback {m : ℕ} (H : Matrix (Fin m) (Fin m) ℂ) + (D : Matrix (Fin m) (Fin n) ℂ) (u v : V n) : + star u ⬝ᵥ ((Dᴴ * H * D) *ᵥ v) = star (D *ᵥ u) ⬝ᵥ (H *ᵥ (D *ᵥ v)) := by + rw [← mulVec_mulVec, ← mulVec_mulVec, dotProduct_mulVec, ← star_mulVec] + +lemma matrix_eq_of_pair (H K : Matrix (Fin n) (Fin n) ℂ) + (h : ∀ u v : V n, star u ⬝ᵥ (H *ᵥ v) = star u ⬝ᵥ (K *ᵥ v)) : H = K := by + ext i j + simpa using h (Pi.single i 1) (Pi.single j 1) + +lemma potentialMatrix_congr {φ ψ : V n → ℝ} {z : V n} + (he : φ =ᶠ[nhds z] ψ) : potentialMatrix φ z = potentialMatrix ψ z := by + unfold potentialMatrix + rw [(he.fderiv (𝕜 := ℝ)).fderiv_eq] + +lemma potentialMatrix_comp {m : ℕ} {f : V n → V m} {φ : V m → ℝ} {z : V n} + (hf : ContDiffAt ℂ ∞ f z) (hφ : ContDiffAt ℝ ∞ φ (f z)) : + potentialMatrix (φ ∘ f) z = + (LinearMap.toMatrix' (fderiv ℂ f z).toLinearMap)ᴴ * + potentialMatrix φ (f z) * LinearMap.toMatrix' (fderiv ℂ f z).toLinearMap := by + apply matrix_eq_of_pair + intro u v + rw [matrix_pair_pullback] + simp only [potentialMatrix, hermitianPartMatrix_pair, LinearMap.toMatrix'_mulVec] + have he := hermitianPart_comp hf hφ u v + rw [(hf.differentiableAt (by simp)).fderiv_restrictScalars (𝕜 := ℝ)] at he + exact he + +end PotentialKaehler + +namespace Anticanonical.SourceSmooth +open Matrix Filter +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + + +structure SmoothRealFunction (A : ComplexAtlas d X) where + value : X → ℝ + smooth : ∀ i, ContDiffOn ℝ ∞ (value ∘ (A.chart i).symm) (A.chart i).target + +namespace SmoothRealFunction + +def localExpression (φ : SmoothRealFunction A) (i : Fin A.count) : Coordinates d → ℝ := + φ.value ∘ (A.chart i).symm + + +def hessian (φ : SmoothRealFunction A) (i : Fin A.count) (z : Coordinates d) : + Matrix (Fin d) (Fin d) ℂ := PotentialKaehler.potentialMatrix (φ.localExpression i) z + +lemma hessian_smooth (φ : SmoothRealFunction A) (i : Fin A.count) : + ContDiffOn ℝ ∞ (φ.hessian i) (A.chart i).target := by + intro z hz + exact (PotentialKaehler.potentialMatrix_smooth + ((φ.smooth i).contDiffAt ((A.chart i).open_target.mem_nhds hz))).contDiffWithinAt + +lemma hessian_hermitian (φ : SmoothRealFunction A) (i : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart i).target) : (φ.hessian i z).IsHermitian := + PotentialKaehler.potentialMatrix_hermitian + ((φ.smooth i).contDiffAt ((A.chart i).open_target.mem_nhds hz)) + +lemma hessian_compatibility (φ : SmoothRealFunction A) (i j : Fin A.count) {x : X} + (hi : x ∈ (A.chart i).source) (hj : x ∈ (A.chart j).source) : + φ.hessian i (A.chart i x) = + (A.derivativeMatrix i j x)ᴴ * φ.hessian j (A.chart j x) * A.derivativeMatrix i j x := by + have hz := A.coordinate_mem_overlap i j hi hj + have ho := A.isOpen_coordinateOverlap i j + have hf : ContDiffAt ℂ ∞ (A.transition i j) (A.chart i x) := + (ProjectiveKaehler.analyticOnNhd_pi_of_differentiableOn ho (A.holomorphic i j) _ hz).contDiffAt + have hφ : ContDiffAt ℝ ∞ (φ.localExpression j) (A.transition i j (A.chart i x)) := by + rw [A.transition_at i j hi] + exact (φ.smooth j).contDiffAt ((A.chart j).open_target.mem_nhds ((A.chart j).mapsTo hj)) + have he : φ.localExpression i =ᶠ[nhds (A.chart i x)] + φ.localExpression j ∘ A.transition i j := by + filter_upwards [ho.mem_nhds hz] with y hy + dsimp only [localExpression, ComplexAtlas.transition, Function.comp_apply] + rw [(A.chart j).left_inv hy.2] + unfold hessian + rw [PotentialKaehler.potentialMatrix_congr he, + PotentialKaehler.potentialMatrix_comp hf hφ, A.transition_at i j hi] + rfl + +lemma hessian_closed (φ : SmoothRealFunction A) (i : Fin A.count) {z : Coordinates d} + (hz : z ∈ (A.chart i).target) (u v w : Coordinates d) : + fderiv ℝ (fun y => ComplexAtlas.fundamentalForm (φ.hessian i y) v w) z u + + fderiv ℝ (fun y => ComplexAtlas.fundamentalForm (φ.hessian i y) w u) z v + + fderiv ℝ (fun y => ComplexAtlas.fundamentalForm (φ.hessian i y) u v) z w = 0 := + PotentialKaehler.potentialMatrix_closed (A.chart i).open_target (φ.smooth i) hz u v w + +end SmoothRealFunction + +lemma fundamentalForm_add (H K : Matrix (Fin d) (Fin d) ℂ) (u v : Coordinates d) : + ComplexAtlas.fundamentalForm (H + K) u v = + ComplexAtlas.fundamentalForm H u v + ComplexAtlas.fundamentalForm K u v := by + simp [ComplexAtlas.fundamentalForm, add_mulVec, dotProduct_add] + +lemma fundamentalForm_smooth {g : Coordinates d → Matrix (Fin d) (Fin d) ℂ} + {z : Coordinates d} (hg : ContDiffAt ℝ ∞ g z) (u v : Coordinates d) : + ContDiffAt ℝ ∞ (fun y => ComplexAtlas.fundamentalForm (g y) u v) z := by + apply Complex.imCLM.contDiff.contDiffAt.comp z + apply ContDiffAt.sum + intro i _ + apply contDiffAt_const.mul + change ContDiffAt ℝ ∞ (fun y => ∑ j, g y i j * v j) z + apply ContDiffAt.sum + intro j _ + exact (contDiffAt_pi.mp (contDiffAt_pi.mp hg i) j).mul contDiffAt_const + +namespace KaehlerMetric + + + +def PositivePotential (g : KaehlerMetric A) (φ : SmoothRealFunction A) : Prop := + ∀ i z, z ∈ (A.chart i).target → (g.matrix i z + φ.hessian i z).PosDef + + + +def deform (g : KaehlerMetric A) (φ : SmoothRealFunction A) (hp : g.PositivePotential φ) : + KaehlerMetric A where + matrix i z := g.matrix i z + φ.hessian i z + smooth i := (g.smooth i).add (φ.hessian_smooth i) + positive := hp + compatibility i j x hi hj := by + rw [g.compatibility i j x hi hj, φ.hessian_compatibility i j hi hj] + simp only [mul_add, add_mul] + closed i z hz u v w := by + have hg := (g.smooth i).contDiffAt ((A.chart i).open_target.mem_nhds hz) + have hφ := (φ.hessian_smooth i).contDiffAt ((A.chart i).open_target.mem_nhds hz) + simp only [fundamentalForm_add] + simp only [fderiv_fun_add + ((fundamentalForm_smooth hg _ _).differentiableAt (by simp)) + ((fundamentalForm_smooth hφ _ _).differentiableAt (by simp)), _root_.add_apply] + have h1 := g.closed i z hz u v w + have h2 := φ.hessian_closed i hz u v w + linarith + +end KaehlerMetric +end Anticanonical.SourceSmooth + + + +open Matrix Polynomial +open scoped Matrix.Norms.Elementwise +noncomputable section +namespace MongeAmpere +variable {n : Type*} [Fintype n] [DecidableEq n] + +lemma hasDerivAt_det_one_add_smul (M : Matrix n n ℂ) : + HasDerivAt (fun t : ℂ => (1 + t • M).det) M.trace 0 := by + have hp := (Matrix.det (1 + (Polynomial.X : ℂ[X]) • M.map Polynomial.C)).hasDerivAt (0 : ℂ) + rw [Matrix.derivative_det_one_add_X_smul] at hp + simpa [eval_det, ← Matrix.smul_eq_mul_diagonal] using hp + +lemma hasDerivAt_det_add_smul (H K : Matrix n n ℂ) (hH : IsUnit H.det) : + HasDerivAt (fun t : ℂ => (H + t • K).det) + (H.det * (H⁻¹ * K).trace) 0 := by + have hd := (hasDerivAt_det_one_add_smul (H⁻¹ * K)).const_mul H.det + apply hd.congr_of_eventuallyEq + filter_upwards [] with t + rw [← Matrix.det_mul] + congr 1 + simp [Matrix.mul_add, ← Matrix.mul_assoc, + Matrix.mul_nonsing_inv _ hH] + +open scoped ComplexOrder + + + +lemma hasDerivAt_logdet_add_smul (H K : Matrix n n ℂ) (hH : H.PosDef) : + HasDerivAt (fun t : ℝ => Real.log ((H + (t : ℂ) • K).det.re)) + (H⁻¹ * K).trace.re 0 := by + have hd := (hasDerivAt_det_add_smul H K (isUnit_iff_ne_zero.mpr (ne_of_gt hH.det_pos))).real_of_complex + have hp := Complex.pos_iff.mp hH.det_pos + have hne : (H + ((0 : ℝ) : ℂ) • K).det.re ≠ 0 := by + simpa using ne_of_gt hp.1 + have hl := hd.log hne + simpa [Complex.mul_re, hp.2.symm, hp.1.ne', mul_div_cancel_left₀] using hl + + + +lemma linearized_symbol_pos (H : Matrix n n ℂ) (hH : H.PosDef) + (v : n → ℂ) (hv : v ≠ 0) : + 0 < (H⁻¹ * Matrix.vecMulVec v (star v)).trace.re := by + rw [Matrix.mul_vecMulVec, Matrix.trace_vecMulVec, dotProduct_comm] + exact hH.inv.re_dotProduct_pos hv + +end MongeAmpere + +namespace Anticanonical.SourceSmooth +open Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +namespace SmoothRealFunction + +def constant (c : ℝ) : SmoothRealFunction A where + value _ := c + smooth _ := contDiffOn_const + +def realSMul (c : ℝ) (φ : SmoothRealFunction A) : SmoothRealFunction A where + value x := c * φ.value x + smooth i := contDiffOn_const.mul (φ.smooth i) + +lemma hessian_constant (c : ℝ) (i : Fin A.count) (z : Coordinates d) : + (constant (A := A) c).hessian i z = 0 := by + ext a b + apply Complex.ext <;> simp [hessian, localExpression, constant, Function.comp_def, PotentialKaehler.potentialMatrix, + PotentialKaehler.hermitianPartMatrix_apply, PotentialKaehler.hermitianPart] + +lemma hessian_realSMul (c : ℝ) (φ : SmoothRealFunction A) + (i : Fin A.count) (z : Coordinates d) : + (φ.realSMul c).hessian i z = (c : ℂ) • φ.hessian i z := by + unfold hessian PotentialKaehler.potentialMatrix + have he : (φ.realSMul c).localExpression i = c • φ.localExpression i := rfl + rw [he, fderiv_const_smul_field (𝕜 := ℝ) (f := φ.localExpression i) c] + rw [fderiv_const_smul_field (𝕜 := ℝ) (f := fderiv ℝ (φ.localExpression i)) c] + ext a b + simp only [PotentialKaehler.hermitianPartMatrix_apply, Matrix.smul_apply] + apply Complex.ext <;> + simp [PotentialKaehler.hermitianPart, Pi.smul_apply, smul_eq_mul, + Complex.mul_re, Complex.mul_im] <;> ring + +end SmoothRealFunction + +namespace KaehlerMetric + + + +def linearizedMongeAmpere (g : KaehlerMetric A) (ψ : SmoothRealFunction A) + (i : Fin A.count) (z : Coordinates d) : ℝ := + ((g.matrix i z)⁻¹ * ψ.hessian i z).trace.re + + +theorem mongeAmpere_directional_derivative (g : KaehlerMetric A) + (ψ : SmoothRealFunction A) (i : Fin A.count) {z : Coordinates d} + (hz : z ∈ (A.chart i).target) : + HasDerivAt (fun t : ℝ => + Real.log ((g.matrix i z + (ψ.realSMul t).hessian i z).det.re) - + Real.log (g.volumeCoefficient i z)) (g.linearizedMongeAmpere ψ i z) 0 := by + simp only [SmoothRealFunction.hessian_realSMul] + exact (MongeAmpere.hasDerivAt_logdet_add_smul _ _ (g.positive i z hz)).sub_const _ + +lemma linearizedMongeAmpere_constant (g : KaehlerMetric A) (c : ℝ) : + g.linearizedMongeAmpere (SmoothRealFunction.constant c) = 0 := by + funext i z + simp [linearizedMongeAmpere, SmoothRealFunction.hessian_constant] + + + +theorem linearizedMongeAmpere_not_injective [Nonempty X] (g : KaehlerMetric A) : + ¬ Function.Injective g.linearizedMongeAmpere := by + intro h + have hc : SmoothRealFunction.constant (A := A) 0 = SmoothRealFunction.constant 1 := + h (by rw [linearizedMongeAmpere_constant, linearizedMongeAmpere_constant]) + let x : X := Classical.choice inferInstance + have he := congrArg (fun φ : SmoothRealFunction A => φ.value x) hc + simp [SmoothRealFunction.constant] at he + +end KaehlerMetric +end Anticanonical.SourceSmooth + +namespace EllipticKernel +open Filter Set +open scoped ContDiff + +lemma second_deriv_nonpos_at_localMax {f : ℝ → ℝ} {x : ℝ} + (hmax : IsLocalMax f x) (hc : ContinuousAt f x) : deriv (deriv f) x ≤ 0 := by + by_contra h + have hpos : 0 < deriv (deriv f) x := lt_of_not_ge h + have hmin := isLocalMin_of_deriv_deriv_pos hpos hmax.deriv_eq_zero hc + have he : f =ᶠ[nhds x] fun _ => f x := by + filter_upwards [hmax, hmin] with y hy hy' + exact le_antisymm hy hy' + have hd : deriv f =ᶠ[nhds x] fun _ => 0 := by + simpa using he.deriv + have hdd : deriv (deriv f) x = 0 := by + simpa using hd.deriv_eq + exact (ne_of_gt hpos) hdd + +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + +lemma second_fderiv_nonpos_at_localMax {f : E → ℝ} {x : E} + (hf : ContDiffAt ℝ ∞ f x) (hmax : IsLocalMax f x) (v : E) : + fderiv ℝ (fderiv ℝ f) x v v ≤ 0 := by + let r : ℝ → E := fun t => x + t • v + have hr : ContDiff ℝ ∞ r := contDiff_const.add (contDiff_id.smul contDiff_const) + have hr0 : r 0 = x := by simp [r] + have hfr : ContDiffAt ℝ ∞ (f ∘ r) 0 := (show ContDiffAt ℝ ∞ f (r 0) by simpa only [hr0] using hf).comp 0 hr.contDiffAt + have hmr : IsLocalMax (f ∘ r) 0 := + (hr0.symm ▸ hmax).comp_continuous hr.continuous.continuousAt + have hle := second_deriv_nonpos_at_localMax hmr hfr.continuousAt + have hd2 : deriv (deriv (f ∘ r)) 0 = fderiv ℝ (fderiv ℝ (f ∘ r)) 0 1 1 := + PotentialKaehler.fderiv_eval_derivative hfr 1 1 + rw [hd2, PotentialKaehler.second_derivative_comp hr.contDiffAt + (by simpa only [hr0] using hf) 1 1] at hle + have hDr : fderiv ℝ r = fun _ => ContinuousLinearMap.smulRight (ContinuousLinearMap.id ℝ ℝ) v := by + funext t + simpa [r] using + ((hasFDerivAt_id t).smul_const v).const_add x |>.fderiv + rw [hDr] at hle + simpa [hr0] using hle + +end EllipticKernel + +namespace EllipticKernel +open Matrix +open scoped MatrixOrder ComplexOrder Matrix.Norms.Elementwise ContDiff + +lemma trace_mul_nonneg {n : Type*} [Fintype n] [DecidableEq n] + {A B : Matrix n n ℂ} (hA : A.PosSemidef) (hB : B.PosSemidef) : + 0 ≤ (A * B).trace.re := by + let S := CFC.sqrt A + have hS : S.PosSemidef := (CFC.sqrt_nonneg A).posSemidef + have hsquare : S * S = A := by simpa [S, pow_two] using CFC.sq_sqrt A hA.nonneg + have htr := Complex.nonneg_iff.mp (hB.mul_mul_conjTranspose_same S).trace_nonneg + have heq : (S * B * Sᴴ).trace = (A * B).trace := by + rw [hS.isHermitian.eq, Matrix.trace_mul_cycle, hsquare] + rw [heq] at htr + exact htr.1 + +lemma negative_potentialMatrix_posSemidef_at_localMax {n : ℕ} + {f : PotentialKaehler.V n → ℝ} {x : PotentialKaehler.V n} + (hf : ContDiffAt ℝ ∞ f x) (hmax : IsLocalMax f x) : + (-PotentialKaehler.potentialMatrix f x).PosSemidef := by + refine Matrix.posSemidef_iff_dotProduct_mulVec.mpr + ⟨(PotentialKaehler.potentialMatrix_hermitian hf).neg, ?_⟩ + intro v + rw [neg_mulVec, dotProduct_neg] + rw [PotentialKaehler.potentialMatrix, + PotentialKaehler.hermitianPartMatrix_pair] + apply Complex.nonneg_iff.mpr + constructor + · simp only [Complex.neg_re, PotentialKaehler.hermitianPart] + have h1 := second_fderiv_nonpos_at_localMax hf hmax v + have h2 := second_fderiv_nonpos_at_localMax hf hmax (Complex.I • v) + linarith + · simp only [Complex.neg_im, PotentialKaehler.hermitianPart] + have hs := hf.isSymmSndFDerivAt (by + simp only [minSmoothness_of_isRCLikeNormedField] + change ((2 : ℕ∞) : WithTop ℕ∞) ≤ ((⊤ : ℕ∞) : WithTop ℕ∞) + exact WithTop.coe_le_coe.mpr le_top) (Complex.I • v) v + rw [hs] + ring + +lemma trace_potentialMatrix_nonpos_at_localMax {n : ℕ} + {f : PotentialKaehler.V n → ℝ} {x : PotentialKaehler.V n} + (hf : ContDiffAt ℝ ∞ f x) (hmax : IsLocalMax f x) + (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) : + (H⁻¹ * PotentialKaehler.potentialMatrix f x).trace.re ≤ 0 := by + have ht := trace_mul_nonneg hH.inv.posSemidef + (negative_potentialMatrix_posSemidef_at_localMax hf hmax) + simpa using ht + +end EllipticKernel + + + +noncomputable section +open Filter Set +open scoped ContDiff +namespace EllipticKernel +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] +abbrev Bilin (E : Type*) [NormedAddCommGroup E] [NormedSpace ℝ E] := + E →L[ℝ] E →L[ℝ] ℝ +abbrev SecondOrder (E : Type*) [NormedAddCommGroup E] [NormedSpace ℝ E] := + Bilin E →L[ℝ] ℝ + +local instance barrierBilinNormedAddCommGroup : NormedAddCommGroup (Bilin E) := inferInstance +local instance barrierBilinNormedSpace : NormedSpace ℝ (Bilin E) := inferInstance + +def realInner : Bilin E := innerSL ℝ (E := E) + +lemma realInner_apply (u v : E) : realInner u v = inner ℝ u v := by + exact innerSL_apply_apply ℝ u v + +def rankOne (v : E) : Bilin E := (realInner v).smulRight (realInner v) +def barrier (α : ℝ) (y : E) (z : E) : ℝ := Real.exp (-α * ‖z-y‖^2) + +lemma barrier_smooth (α : ℝ) (y : E) : ContDiff ℝ ∞ (barrier α y) := + (contDiff_const.mul ((contDiff_id.sub contDiff_const).norm_sq ℝ)).exp + +lemma barrier_hasFDerivAt (α : ℝ) (y z : E) : + HasFDerivAt (barrier α y) + ((Real.exp (-α * ‖z-y‖^2) * (-2*α)) • realInner (z-y)) z := by + have h := ((((hasFDerivAt_id z).sub_const y).norm_sq).const_mul (-α)).exp + change HasFDerivAt (fun x => Real.exp (-α * ‖x-y‖^2)) _ z + convert! h using 1 + ext v + simp only [_root_.smul_apply, realInner_apply, ContinuousLinearMap.comp_apply, + ContinuousLinearMap.id_apply, id_eq, innerSL_apply_apply, smul_eq_mul] + ring + +lemma barrier_fderiv (α : ℝ) (y : E) : + fderiv ℝ (barrier α y) = fun z => + (Real.exp (-α * ‖z-y‖^2) * (-2*α)) • realInner (z-y) := by + funext z + exact (barrier_hasFDerivAt α y z).fderiv + +lemma barrier_hessian (α : ℝ) (y z : E) : + fderiv ℝ (fderiv ℝ (barrier α y)) z = + Real.exp (-α * ‖z-y‖^2) • + ((4*α^2) • rankOne (z-y) - (2*α) • (realInner (E := E))) := by + rw [barrier_fderiv] + have h₁ := (barrier_hasFDerivAt α y z).mul_const (-2*α) + have h₂ := (realInner (E := E)).hasFDerivAt.comp z ((hasFDerivAt_id z).sub_const y) + have hh := h₁.smul h₂ + have he := hh.fderiv + simp only [Function.comp_def, id_eq] at he + change fderiv ℝ (fun z => (barrier α y z * (-2*α)) • realInner (z-y)) z = _ + convert! he using 1 + ext u v + simp [rankOne, barrier, realInner, ContinuousLinearMap.smulRight_apply] + ring +end EllipticKernel + +namespace EllipticKernel +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +local instance rankOneBilinNormedAddCommGroup : NormedAddCommGroup (Bilin E) := inferInstance +local instance rankOneBilinNormedSpace : NormedSpace ℝ (Bilin E) := inferInstance + +lemma continuous_rankOne : Continuous (rankOne (E := E)) := by + unfold rankOne + exact ((ContinuousLinearMap.smulRightL ℝ E (E →L[ℝ] ℝ)).continuous.comp + (realInner (E := E)).continuous).clm_apply (realInner (E := E)).continuous + + + +lemma exists_positive_barrier {s : Set E} (hs : IsCompact s) + (ℒ : E → SecondOrder E) (hℒ : ContinuousOn ℒ s) (y : E) + (hpos : ∀ z ∈ s, 0 < ℒ z (rankOne (z-y))) : + ∃ α : ℝ, 0 < α ∧ ∀ z ∈ s, + 0 < ℒ z (fderiv ℝ (fderiv ℝ (barrier α y)) z) := by + by_cases hne : s.Nonempty + · let a : E → ℝ := fun z => ℒ z (rankOne (z-y)) + let b : E → ℝ := fun z => ℒ z (realInner (E := E)) + have ha : ContinuousOn a s := + hℒ.clm_apply (continuous_rankOne.comp (continuous_id.sub continuous_const)).continuousOn + have hb : ContinuousOn b s := hℒ.clm_apply continuousOn_const + have hq : ContinuousOn (fun z => b z / (2*a z)) s := + hb.div (continuousOn_const.mul ha) (fun z hz => mul_ne_zero (by norm_num) (ne_of_gt (hpos z hz))) + obtain ⟨z₀, hz₀, hmax⟩ := hs.exists_isMaxOn hne hq + let α := max (b z₀ / (2*a z₀)) 0 + 1 + have hα : 0 < α := by dsimp [α]; positivity + refine ⟨α, hα, ?_⟩ + intro z hz + have haq : b z / (2*a z) < α := lt_of_le_of_lt (hmax hz) + (by dsimp [α]; linarith [le_max_left (b z₀ / (2*a z₀)) 0]) + have haz : 0 < a z := hpos z hz + have hba : b z < 2*α*a z := by + have := (div_lt_iff₀ (by positivity : 0 < 2*a z)).mp haq + nlinarith + rw [barrier_hessian] + simp only [map_smul, map_sub, smul_eq_mul] + change 0 < Real.exp (-α*‖z-y‖^2) * (4*α^2 * a z - 2*α * b z) + apply mul_pos (Real.exp_pos _) + nlinarith [mul_pos hα (sub_pos.mpr hba)] + · exact ⟨1, by norm_num, fun z hz => False.elim (hne ⟨z, hz⟩)⟩ + +end EllipticKernel + +namespace EllipticKernel +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + +lemma hessian_add {f g : E → ℝ} {z : E} + (hf : ContDiffAt ℝ ∞ f z) (hg : ContDiffAt ℝ ∞ g z) : + fderiv ℝ (fderiv ℝ (f+g)) z = + fderiv ℝ (fderiv ℝ f) z + fderiv ℝ (fderiv ℝ g) z := by + have ef : ∀ᶠ x in nhds z, DifferentiableAt ℝ f x := + (((contDiffAt_infty.mp hf) 1).eventually (by simp)).mono + (fun _ h => h.differentiableAt (by simp)) + have eg : ∀ᶠ x in nhds z, DifferentiableAt ℝ g x := + (((contDiffAt_infty.mp hg) 1).eventually (by simp)).mono + (fun _ h => h.differentiableAt (by simp)) + have he : fderiv ℝ (f+g) =ᶠ[nhds z] (fderiv ℝ f + fderiv ℝ g) := by + filter_upwards [ef, eg] with x hx hx' + exact fderiv_add hx hx' + rw [he.fderiv_eq] + exact fderiv_add ((hf.fderiv_right (m := ∞) (by simp)).differentiableAt (by simp)) + ((hg.fderiv_right (m := ∞) (by simp)).differentiableAt (by simp)) + +lemma hessian_add_smul_sub_const {f g : E → ℝ} {z : E} + (hf : ContDiffAt ℝ ∞ f z) (hg : ContDiffAt ℝ ∞ g z) (ε c : ℝ) : + fderiv ℝ (fderiv ℝ (fun z => f z + ε * (g z-c))) z = + fderiv ℝ (fderiv ℝ f) z + ε • fderiv ℝ (fderiv ℝ g) z := by + change fderiv ℝ (fderiv ℝ (f + ε • (fun z => g z-c))) z = _ + rw [hessian_add hf (show ContDiffAt ℝ ∞ (ε • (fun z => g z-c)) z from + (hg.sub contDiffAt_const).const_smul ε)] + rw [fderiv_const_smul_field (𝕜 := ℝ) (f := fun z => g z-c) ε] + rw [fderiv_const_smul_field (𝕜 := ℝ) (f := fderiv ℝ (fun z => g z-c)) ε] + have he : fderiv ℝ (fun z => g z-c) = fderiv ℝ g := by + funext x; exact fderiv_sub_const c + rw [he] + rfl + +end EllipticKernel + + +noncomputable section +open Set Filter Metric +namespace EllipticKernel +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [ProperSpace E] + +omit [NormedSpace ℝ E] in +lemma annulus_le_of_no_localMax {u : E → ℝ} {y : E} {r M : ℝ} + (hu : ContinuousOn u (closedBall y r \ ball y (r/2))) + (hinner : ∀ z, dist z y = r/2 → u z ≤ M) + (houter : ∀ z, dist z y = r → u z ≤ M) + (hmax : ∀ z, r/2 < dist z y → dist z y < r → ¬IsLocalMax u z) : + ∀ z ∈ closedBall y r \ ball y (r/2), u z ≤ M := by + intro z hz + have hc : IsCompact (closedBall y r \ ball y (r/2)) := + (isCompact_closedBall y r).diff isOpen_ball + obtain ⟨p, hp, hpm⟩ := hc.exists_isMaxOn ⟨z, hz⟩ hu + have hp₁ : dist p y ≤ r := hp.1 + have hp₂ : r/2 ≤ dist p y := le_of_not_gt hp.2 + have hbound : u p ≤ M := by + by_cases hlow : dist p y = r/2 + · exact hinner p hlow + by_cases hhigh : dist p y = r + · exact houter p hhigh + have hlow' : r/2 < dist p y := lt_of_le_of_ne hp₂ (Ne.symm hlow) + have hhigh' : dist p y < r := lt_of_le_of_ne hp₁ hhigh + have hn : closedBall y r \ ball y (r/2) ∈ nhds p := by + have h₁ : {q : E | dist q y < r} ∈ nhds p := + (isOpen_lt (continuous_id.dist continuous_const) continuous_const).mem_nhds hhigh' + have h₂ : {q : E | r/2 < dist q y} ∈ nhds p := + (isOpen_lt continuous_const (continuous_id.dist continuous_const)).mem_nhds hlow' + filter_upwards [h₁, h₂] with q hq₁ hq₂ + exact ⟨le_of_lt hq₁, not_lt_of_gt hq₂⟩ + exact False.elim (hmax p hlow' hhigh' (hpm.isLocalMax hn)) + exact le_trans (hpm hz) hbound + +end EllipticKernel + +namespace EllipticKernel +open Set Metric Filter +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [ProperSpace E] + + + +omit [NormedSpace ℝ E] in +lemma tangent_ball {f : E → ℝ} {U : Set E} {x y : E} {δ M : ℝ} + (hδ : 0 < δ) (hU : closedBall x δ ⊆ U) (hf : ContinuousOn f U) + (hle : ∀ z ∈ U, f z ≤ M) (hx : f x = M) + (hy : y ∈ ball x (δ/4)) (hyf : f y < M) : + ∃ r : ℝ, 0 < r ∧ closedBall y r ⊆ U ∧ + (∀ z ∈ ball y r, f z < M) ∧ + ∃ p : E, dist p y = r ∧ f p = M := by + let S := closedBall x (δ/2) ∩ f ⁻¹' {M} + have hhalf : closedBall x (δ/2) ⊆ U := + subset_trans (closedBall_subset_closedBall (by linarith)) hU + have hSclosed : IsClosed S := + (hf.mono hhalf).preimage_isClosed_of_isClosed isClosed_closedBall isClosed_singleton + have hScompact : IsCompact S := (isCompact_closedBall x (δ/2)).of_isClosed_subset + hSclosed inter_subset_left + have hxS : x ∈ S := ⟨by simp only [mem_closedBall, dist_self]; linarith, hx⟩ + obtain ⟨p, hp, hmin⟩ := hScompact.exists_isMinOn ⟨x, hxS⟩ + (continuous_id.dist continuous_const).continuousOn + let r := dist p y + have hrle : r ≤ dist x y := hmin hxS + have hye : dist y x < δ/4 := hy + have hrsmall : r < δ/4 := lt_of_le_of_lt hrle (by simpa [dist_comm] using hye) + have hpval : f p = M := hp.2 + have hpy : p ≠ y := by intro h; rw [h] at hpval; linarith + have hr : 0 < r := dist_pos.mpr hpy + have hsub : closedBall y r ⊆ closedBall x (δ/2) := by + intro z hz + have hz' : dist z y ≤ r := hz + have htri := dist_triangle z y x + show dist z x ≤ δ/2 + linarith + refine ⟨r, hr, subset_trans hsub hhalf, ?_, p, rfl, hpval⟩ + intro z hz + have hzhalf := hsub (ball_subset_closedBall hz) + have hzU := hhalf hzhalf + refine lt_of_le_of_ne (hle z hzU) ?_ + intro heq + have hzS : z ∈ S := ⟨hzhalf, heq⟩ + have hzd : r ≤ dist z y := hmin hzS + exact (not_lt_of_ge hzd) hz + +end EllipticKernel + +namespace EllipticKernel +open Set Filter Metric +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [ProperSpace E] +local instance tangentMaxBilinNormedAddCommGroup : NormedAddCommGroup (Bilin E) := inferInstance +local instance tangentMaxBilinNormedSpace : NormedSpace ℝ (Bilin E) := inferInstance + + + +lemma no_tangent_max {f : E → ℝ} {U : Set E} (hU : IsOpen U) + (hf : ContDiffOn ℝ ∞ f U) (ℒ : E → SecondOrder E) (hℒ : ContinuousOn ℒ U) + (hell : ∀ z ∈ U, ∀ v : E, v ≠ 0 → 0 < ℒ z (rankOne v)) + (htest : ∀ z ∈ U, ∀ u : E → ℝ, ContDiffAt ℝ ∞ u z → IsLocalMax u z → + ℒ z (fderiv ℝ (fderiv ℝ u) z) ≤ 0) + (hharm : ∀ z ∈ U, ℒ z (fderiv ℝ (fderiv ℝ f) z) = 0) + {M r : ℝ} {y p : E} (hle : ∀ z ∈ U, f z ≤ M) + (hr : 0 < r) (hball : closedBall y r ⊆ U) + (hstrict : ∀ z ∈ ball y r, f z < M) + (hp : dist p y = r) (hfp : f p = M) : False := by + let K := closedBall y r \ ball y (r/2) + have hK : IsCompact K := (isCompact_closedBall y r).diff isOpen_ball + have hKU : K ⊆ U := fun _ hz => hball hz.1 + obtain ⟨α, hα, hbar⟩ := exists_positive_barrier hK ℒ (hℒ.mono hKU) y (by + intro z hz + apply hell z (hKU hz) + intro he + have hzy : z = y := sub_eq_zero.mp he + have hh : ¬dist z y < r/2 := hz.2 + rw [hzy, dist_self] at hh + linarith) + have hhalf : closedBall y (r/2) ⊆ ball y r := closedBall_subset_ball (by linarith) + obtain ⟨q, hq, hqm⟩ := (isCompact_closedBall y (r/2)).exists_isMaxOn + ⟨y, by simp only [mem_closedBall, dist_self]; linarith⟩ + (hf.continuousOn.mono (subset_trans hhalf (subset_trans ball_subset_closedBall hball))) + have hqf : f q < M := hstrict q (hhalf hq) + let ε := M - f q + have hε : 0 < ε := sub_pos.mpr hqf + let c := Real.exp (-α*r^2) + let u : E → ℝ := fun z => f z + ε*(barrier α y z-c) + have hus : ContDiffOn ℝ ∞ u U := + hf.add (contDiffOn_const.mul ((barrier_smooth α y).contDiffOn.sub contDiffOn_const)) + have hble : ∀ z : E, barrier α y z-c ≤ 1 := by + intro z + have he : barrier α y z ≤ 1 := Real.exp_le_one_iff.mpr + (mul_nonpos_of_nonpos_of_nonneg (by linarith) (sq_nonneg _)) + have hc : 0 < c := Real.exp_pos _ + linarith + have houter : ∀ z : E, dist z y = r → u z ≤ M := by + intro z hz + have hzU := hball (show z ∈ closedBall y r from le_of_eq hz) + have hb : barrier α y z = c := by simp [barrier, ← dist_eq_norm, hz, c] + simpa [u, hb] using hle z hzU + have hinner : ∀ z : E, dist z y = r/2 → u z ≤ M := by + intro z hz + have hfz : f z ≤ f q := hqm (show z ∈ closedBall y (r/2) from le_of_eq hz) + have hh := mul_le_mul_of_nonneg_left (hble z) hε.le + dsimp [u, ε] at * + linarith + have hno : ∀ z, r/2 < dist z y → dist z y < r → ¬IsLocalMax u z := by + intro z hz₁ hz₂ hm + have hzK : z ∈ K := ⟨le_of_lt hz₂, not_lt_of_gt hz₁⟩ + have hzU := hKU hzK + have hleu := htest z hzU u (hus.contDiffAt (hU.mem_nhds hzU)) hm + have he : fderiv ℝ (fderiv ℝ u) z = + fderiv ℝ (fderiv ℝ f) z + ε • fderiv ℝ (fderiv ℝ (barrier α y)) z := + hessian_add_smul_sub_const (hf.contDiffAt (hU.mem_nhds hzU)) + (barrier_smooth α y).contDiffAt ε c + rw [he, map_add, map_smul, hharm z hzU, zero_add, smul_eq_mul] at hleu + exact (not_lt_of_ge hleu) (mul_pos hε (hbar z hzK)) + have huK : ∀ z ∈ K, u z ≤ M := annulus_le_of_no_localMax + (hus.continuousOn.mono hKU) hinner houter hno + have hpU := hball (show p ∈ closedBall y r from le_of_eq hp) + have hbp : barrier α y p = c := by simp [barrier, ← dist_eq_norm, hp, c] + have hup : u p = M := by simp [u, hbp, hfp] + have humax : IsLocalMax u p := by + have hn : {z : E | r/2 < dist z y} ∈ nhds p := + (isOpen_lt continuous_const (continuous_id.dist continuous_const)).mem_nhds + (by change r/2 < dist p y; rw [hp]; linarith) + filter_upwards [hU.mem_nhds hpU, hn] with z hzU hz + rw [hup] + by_cases hd : dist z y ≤ r + · exact huK z ⟨hd, not_lt_of_gt hz⟩ + have hd' : r ≤ dist z y := le_of_lt (lt_of_not_ge hd) + have hsq : r^2 ≤ ‖z-y‖^2 := by rw [← dist_eq_norm]; nlinarith [dist_nonneg (x := z) (y := y)] + have hb : barrier α y z ≤ c := Real.exp_le_exp.mpr (by nlinarith) + have hfz := hle z hzU + have hh : ε * (barrier α y z-c) ≤ 0 := mul_nonpos_of_nonneg_of_nonpos hε.le (sub_nonpos.mpr hb) + dsimp [u] + linarith + have hfmax : IsLocalMax f p := by + filter_upwards [hU.mem_nhds hpU] with z hz + simpa [hfp] using hle z hz + have hdu := (hf.contDiffAt (hU.mem_nhds hpU)).differentiableAt (by simp) |>.hasFDerivAt + have hdb := ((barrier_hasFDerivAt α y p).sub_const c).const_mul ε + have he := (hdu.add hdb).fderiv + change fderiv ℝ u p = _ at he + rw [humax.fderiv_eq_zero, hfmax.fderiv_eq_zero] at he + have hv := congrArg (fun L : E →L[ℝ] ℝ => L (p-y)) he + have hn : ‖p-y‖^2 > 0 := by rw [← dist_eq_norm, hp]; positivity + have hneg : ε * (Real.exp (-α*‖p-y‖^2) * (-2*α)) * ‖p-y‖^2 < 0 := by + exact mul_neg_of_neg_of_pos (mul_neg_of_pos_of_neg hε + (mul_neg_of_pos_of_neg (Real.exp_pos _) (by linarith))) hn + have hv' : 0 = ε * (Real.exp (-α*‖p-y‖^2) * (-2*α)) * ‖p-y‖^2 := by + simpa only [_root_.smul_apply, _root_.zero_apply, zero_add, _root_.add_apply, realInner_apply, + real_inner_self_eq_norm_sq, smul_eq_mul, mul_assoc] using hv + linarith + +end EllipticKernel + +namespace EllipticKernel +open Set Filter Metric +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [ProperSpace E] +local instance harmonicMaxBilinNormedAddCommGroup : NormedAddCommGroup (Bilin E) := inferInstance +local instance harmonicMaxBilinNormedSpace : NormedSpace ℝ (Bilin E) := inferInstance + +theorem harmonic_eventually_eq_of_max {f : E → ℝ} {U : Set E} (hU : IsOpen U) + (hf : ContDiffOn ℝ ∞ f U) (ℒ : E → SecondOrder E) (hℒ : ContinuousOn ℒ U) + (hell : ∀ z ∈ U, ∀ v : E, v ≠ 0 → 0 < ℒ z (rankOne v)) + (htest : ∀ z ∈ U, ∀ u : E → ℝ, ContDiffAt ℝ ∞ u z → IsLocalMax u z → + ℒ z (fderiv ℝ (fderiv ℝ u) z) ≤ 0) + (hharm : ∀ z ∈ U, ℒ z (fderiv ℝ (fderiv ℝ f) z) = 0) + {x : E} {M : ℝ} (hx : x ∈ U) (hfx : f x = M) (hle : ∀ z ∈ U, f z ≤ M) : + f =ᶠ[nhds x] fun _ => M := by + obtain ⟨a, ha, hball⟩ := Metric.mem_nhds_iff.mp (hU.mem_nhds hx) + let δ := a/2 + have hδ : 0 < δ := half_pos ha + have hδU : closedBall x δ ⊆ U := + subset_trans (closedBall_subset_ball (by dsimp [δ]; linarith)) hball + filter_upwards [ball_mem_nhds x (show 0 < δ/4 by positivity)] with y hy + by_contra hyf + have hyU : y ∈ U := hδU (mem_closedBall.mpr (by + have h := mem_ball.mp hy + linarith)) + have hlt : f y < M := lt_of_le_of_ne (hle y hyU) hyf + obtain ⟨r, hr, hrU, hstrict, p, hp, hfp⟩ := + tangent_ball hδ hδU hf.continuousOn hle hfx hy hlt + exact no_tangent_max hU hf ℒ hℒ hell htest hharm hle hr hrU hstrict hp hfp + +end EllipticKernel + +namespace EllipticKernel +open Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +abbrev EC (n : ℕ) := EuclideanSpace ℂ (Fin n) +variable {n : ℕ} +local instance coordinateBilinNormedAddCommGroup : NormedAddCommGroup (Bilin (EC n)) := inferInstance +local instance coordinateBilinNormedSpace : NormedSpace ℝ (Bilin (EC n)) := inferInstance + + + +def coordinateEquiv (n : ℕ) : EC n ≃L[ℝ] PotentialKaehler.V n := + PiLp.continuousLinearEquiv 2 ℝ (fun _ : Fin n => ℂ) + +lemma coordinateEquiv_apply (z : EC n) : coordinateEquiv n z = WithLp.ofLp z := rfl +lemma coordinateEquiv_symm_apply (z : PotentialKaehler.V n) : + (coordinateEquiv n).symm z = WithLp.toLp 2 z := rfl + +def pullBilin (B : Bilin (EC n)) : PotentialKaehler.RealBilinear n := + ((B.comp (coordinateEquiv n).symm.toContinuousLinearMap).flip.comp + (coordinateEquiv n).symm.toContinuousLinearMap).flip + +lemma pullBilin_apply (B : Bilin (EC n)) (u v : PotentialKaehler.V n) : + pullBilin B u v = B ((coordinateEquiv n).symm u) ((coordinateEquiv n).symm v) := rfl + +lemma pullBilin_add (B C : Bilin (EC n)) : pullBilin (B+C) = pullBilin B + pullBilin C := by + ext u v + simp only [pullBilin_apply, _root_.add_apply] + +lemma pullBilin_smul (c : ℝ) (B : Bilin (EC n)) : pullBilin (c • B) = c • pullBilin B := by + ext u v + simp only [pullBilin_apply, _root_.smul_apply] + +lemma hermitianPartMatrix_add (B C : PotentialKaehler.RealBilinear n) : + PotentialKaehler.hermitianPartMatrix (B+C) = + PotentialKaehler.hermitianPartMatrix B + PotentialKaehler.hermitianPartMatrix C := by + ext i j + apply Complex.ext <;> + simp [PotentialKaehler.hermitianPartMatrix_apply, PotentialKaehler.hermitianPart] + <;> ring + +lemma hermitianPartMatrix_smul (c : ℝ) (B : PotentialKaehler.RealBilinear n) : + PotentialKaehler.hermitianPartMatrix (c • B) = c • PotentialKaehler.hermitianPartMatrix B := by + ext i j + apply Complex.ext <;> + simp [PotentialKaehler.hermitianPartMatrix_apply, PotentialKaehler.hermitianPart] + <;> ring + +def traceBilinLinear (H : Matrix (Fin n) (Fin n) ℂ) : Bilin (EC n) →ₗ[ℝ] ℝ where + toFun B := (H⁻¹ * PotentialKaehler.hermitianPartMatrix (pullBilin B)).trace.re + map_add' B C := by rw [pullBilin_add, hermitianPartMatrix_add, mul_add, trace_add, Complex.add_re] + map_smul' c B := by rw [pullBilin_smul, hermitianPartMatrix_smul, Matrix.mul_smul, trace_smul]; simp + +def traceBilin (H : Matrix (Fin n) (Fin n) ℂ) : SecondOrder (EC n) := + (traceBilinLinear H).toContinuousLinearMap + +lemma traceBilin_apply (H : Matrix (Fin n) (Fin n) ℂ) (B : Bilin (EC n)) : + traceBilin H B = (H⁻¹ * PotentialKaehler.hermitianPartMatrix (pullBilin B)).trace.re := rfl + +lemma traceBilin_continuousOn {U : Set (EC n)} + (H : EC n → Matrix (Fin n) (Fin n) ℂ) (hH : ContinuousOn H U) + (hpos : ∀ z ∈ U, (H z).PosDef) : ContinuousOn (fun z => traceBilin (H z)) U := by + apply continuousOn_clm_apply.mpr + intro B + change ContinuousOn (fun z => ((H z)⁻¹ * PotentialKaehler.hermitianPartMatrix (pullBilin B)).trace.re) U + have hi : ContinuousOn (fun z => (H z)⁻¹) U := by + intro z hz + apply (continuousAt_matrix_inv (H z) ?_).comp_continuousWithinAt (hH z hz) + obtain ⟨u, hu⟩ := isUnit_iff_ne_zero.mpr (ne_of_gt (hpos z hz).det_pos) + rw [← hu] + exact NormedRing.inverse_continuousAt u + apply Complex.continuous_re.comp_continuousOn + unfold Matrix.trace + apply continuousOn_finsetSum + intro i hi' + exact continuousOn_pi.mp (continuousOn_pi.mp (hi.mul continuousOn_const) i) i + +lemma pullBilin_hessian {u : EC n → ℝ} {z : EC n} (hu : ContDiffAt ℝ ∞ u z) : + pullBilin (fderiv ℝ (fderiv ℝ u) z) = + fderiv ℝ (fderiv ℝ (u ∘ (coordinateEquiv n).symm)) (coordinateEquiv n z) := by + let s := (coordinateEquiv n).symm + have hu' : ContDiffAt ℝ ∞ u (s (coordinateEquiv n z)) := by simpa [s] using hu + have hd : fderiv ℝ s = fun _ => s.toContinuousLinearMap := by + funext w; exact s.hasFDerivAt.fderiv + ext a b + rw [PotentialKaehler.second_derivative_comp s.contDiff.contDiffAt hu' a b, hd] + simp [pullBilin_apply, s] + +lemma traceBilin_localMax (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + {u : EC n → ℝ} {z : EC n} (hu : ContDiffAt ℝ ∞ u z) (hmax : IsLocalMax u z) : + traceBilin H (fderiv ℝ (fderiv ℝ u) z) ≤ 0 := by + rw [traceBilin_apply, pullBilin_hessian hu] + let s := (coordinateEquiv n).symm + have hu' : ContDiffAt ℝ ∞ u (s (coordinateEquiv n z)) := by simpa [s] using hu + have hm' : IsLocalMax u (s (coordinateEquiv n z)) := by simpa [s] using hmax + exact trace_potentialMatrix_nonpos_at_localMax + (hu'.comp _ s.contDiff.contDiffAt) (hm'.comp_continuous s.continuous.continuousAt) H hH + +end EllipticKernel + +namespace EllipticKernel +open Matrix +open scoped ComplexOrder Matrix.Norms.Elementwise ContDiff +variable {n : ℕ} + +lemma realInner_coordinate_single (v : EC n) (i : Fin n) (c : ℂ) : + realInner v ((coordinateEquiv n).symm (Pi.single i c)) = (c * star (v i)).re := by + rw [realInner_apply, coordinateEquiv_symm_apply, PiLp.inner_apply] + simp [Pi.single_apply, apply_ite Complex.re, Complex.inner] + +lemma pull_rankOne (v : EC n) : + PotentialKaehler.hermitianPartMatrix (pullBilin (rankOne v)) = + (1/4 : ℝ) • Matrix.vecMulVec (coordinateEquiv n v) (star (coordinateEquiv n v)) := by + ext i j + apply Complex.ext <;> + simp [PotentialKaehler.hermitianPartMatrix_apply, PotentialKaehler.hermitianPart, + pullBilin_apply, rankOne, ContinuousLinearMap.smulRight_apply, + realInner_coordinate_single, ← Pi.single_smul, coordinateEquiv_apply, + Complex.mul_re, Complex.mul_im, Matrix.vecMulVec_apply] <;> ring + +lemma traceBilin_symbol (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (v : EC n) (hv : v ≠ 0) : 0 < traceBilin H (rankOne v) := by + have hve : coordinateEquiv n v ≠ 0 := by + intro h + apply hv + exact (coordinateEquiv n).injective (by simpa using h) + have hp := MongeAmpere.linearized_symbol_pos H hH (coordinateEquiv n v) hve + rw [traceBilin_apply, pull_rankOne, Matrix.mul_smul, trace_smul] + simpa only [Complex.smul_re, smul_eq_mul] using mul_pos (by norm_num : (0 : ℝ) < 1/4) hp + +end EllipticKernel + +namespace Anticanonical.SourceSmooth +open EllipticKernel Set Filter +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +lemma SmoothRealFunction.continuous (φ : SmoothRealFunction A) : Continuous φ.value := by + apply continuous_iff_continuousAt.mpr + intro x + obtain ⟨i, hi⟩ := A.covers x + have hci : ContinuousAt (φ.localExpression i) (A.chart i x) := + ((φ.smooth i).contDiffAt ((A.chart i).open_target.mem_nhds ((A.chart i).map_source hi))).continuousAt + apply (hci.comp ((A.chart i).continuousAt hi)).congr_of_eventuallyEq + filter_upwards [(A.chart i).eventually_left_inverse hi] with y hy + simp [SmoothRealFunction.localExpression, hy] + +lemma SmoothRealFunction.euclidean_smooth (φ : SmoothRealFunction A) (i : Fin A.count) : + ContDiffOn ℝ ∞ (φ.localExpression i ∘ coordinateEquiv d) + ((coordinateEquiv d) ⁻¹' (A.chart i).target) := + (φ.smooth i).comp (coordinateEquiv d).contDiff.contDiffOn (fun _ h => h) + +lemma KaehlerMetric.traceBilin_localExpression (g : KaehlerMetric A) (φ : SmoothRealFunction A) + (i : Fin A.count) {z : EC d} (hz : coordinateEquiv d z ∈ (A.chart i).target) : + traceBilin (g.matrix i (coordinateEquiv d z)) + (fderiv ℝ (fderiv ℝ (φ.localExpression i ∘ coordinateEquiv d)) z) = + g.linearizedMongeAmpere φ i (coordinateEquiv d z) := by + have hu := (φ.euclidean_smooth i).contDiffAt + (((A.chart i).open_target.preimage (coordinateEquiv d).continuous).mem_nhds hz) + have he : (φ.localExpression i ∘ coordinateEquiv d) ∘ (coordinateEquiv d).symm = + φ.localExpression i := by + funext w + simp + rw [traceBilin_apply, pullBilin_hessian hu, he] + rfl + + + +lemma KaehlerMetric.harmonic_eventually_constant (g : KaehlerMetric A) + (φ : SmoothRealFunction A) + (hφ : ∀ (i : Fin A.count) (z : Coordinates d), z ∈ (A.chart i).target → + g.linearizedMongeAmpere φ i z = 0) + {x : X} {M : ℝ} (hx : φ.value x = M) (hmax : ∀ y : X, φ.value y ≤ M) : + φ.value =ᶠ[nhds x] fun _ => M := by + obtain ⟨i, hi⟩ := A.covers x + let e := coordinateEquiv d + let U := e ⁻¹' (A.chart i).target + let u := φ.localExpression i ∘ e + let H := fun z => g.matrix i (e z) + have hU : IsOpen U := (A.chart i).open_target.preimage e.continuous + have hu : ContDiffOn ℝ ∞ u U := φ.euclidean_smooth i + have hH : ContinuousOn H U := + (g.smooth i).continuousOn.comp e.continuous.continuousOn (fun _ h => h) + have hp : ∀ z ∈ U, (H z).PosDef := fun z hz => g.positive i (e z) hz + have hh : ∀ z ∈ U, traceBilin (H z) (fderiv ℝ (fderiv ℝ u) z) = 0 := by + intro z hz + exact (g.traceBilin_localExpression φ i hz).trans (hφ i (e z) hz) + have hz : e.symm (A.chart i x) ∈ U := by + simpa [U] using (A.chart i).map_source hi + have hux : u (e.symm (A.chart i x)) = M := by + simpa [u, SmoothRealFunction.localExpression, (A.chart i).left_inv hi] using hx + have heq := harmonic_eventually_eq_of_max hU hu (fun z => traceBilin (H z)) + (traceBilin_continuousOn H hH hp) + (fun z hz v hv => traceBilin_symbol (H z) (hp z hz) v hv) + (fun z hz u hu hm => traceBilin_localMax (H z) (hp z hz) hu hm) + hh hz hux (fun z _ => hmax ((A.chart i).symm (e z))) + have ht : Tendsto (fun y => e.symm (A.chart i y)) (nhds x) + (nhds (e.symm (A.chart i x))) := + e.symm.continuous.continuousAt.comp ((A.chart i).continuousAt hi) + filter_upwards [ht.eventually heq, (A.chart i).eventually_left_inverse hi] with y hy hiy + simpa [u, SmoothRealFunction.localExpression, hiy] using hy + + + +theorem linearizedMongeAmpere_kernel (d : ℕ) (X : Type*) [TopologicalSpace X] + [T2Space X] [CompactSpace X] [ConnectedSpace X] (A : ComplexAtlas d X) + (g : KaehlerMetric A) (φ : SmoothRealFunction A) + (hφ : ∀ (i : Fin A.count) (z : Coordinates d), z ∈ (A.chart i).target → + g.linearizedMongeAmpere φ i z = 0) : + ∃ c : ℝ, ∀ x : X, φ.value x = c := by + obtain ⟨x, _, hx⟩ := isCompact_univ.exists_isMaxOn Set.univ_nonempty φ.continuous.continuousOn + have hmax : ∀ y, φ.value y ≤ φ.value x := fun y => hx (mem_univ y) + let S := {y : X | φ.value y = φ.value x} + have hs : IsClosed S := isClosed_eq φ.continuous continuous_const + have ho : IsOpen S := by + rw [isOpen_iff_mem_nhds] + intro y hy + exact g.harmonic_eventually_constant φ hφ hy hmax + have hall : S = univ := (show IsClopen S from ⟨hs, ho⟩).eq_univ ⟨x, rfl⟩ + exact ⟨φ.value x, fun y => show y ∈ S from hall ▸ mem_univ y⟩ + +end Anticanonical.SourceSmooth + +namespace Anticanonical.SourceSmooth +open Set Filter +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +namespace SmoothRealFunction + +def normalizeAt (φ : SmoothRealFunction A) (x₀ : X) : SmoothRealFunction A where + value x := φ.value x - φ.value x₀ + smooth i := (φ.smooth i).sub contDiffOn_const + +@[simp] lemma normalizeAt_value (φ : SmoothRealFunction A) (x₀ : X) : + (φ.normalizeAt x₀).value x₀ = 0 := sub_self _ + +lemma hessian_normalizeAt (φ : SmoothRealFunction A) (x₀ : X) : + (φ.normalizeAt x₀).hessian = φ.hessian := by + funext i z + have he : (φ.normalizeAt x₀).localExpression i = + fun w => φ.localExpression i w - φ.value x₀ := rfl + have hd : fderiv ℝ (fun w => φ.localExpression i w - φ.value x₀) = + fderiv ℝ (φ.localExpression i) := by + funext w; exact fderiv_sub_const _ + simp only [hessian, he, PotentialKaehler.potentialMatrix, hd] +end SmoothRealFunction + +namespace KaehlerMetric +lemma linearizedMongeAmpere_realSMul (g : KaehlerMetric A) + (φ : SmoothRealFunction A) (c : ℝ) (i : Fin A.count) (z : Coordinates d) : + g.linearizedMongeAmpere (φ.realSMul c) i z = c * g.linearizedMongeAmpere φ i z := by + simp only [linearizedMongeAmpere, SmoothRealFunction.hessian_realSMul, + Matrix.mul_smul, Matrix.trace_smul, smul_eq_mul, Complex.re_ofReal_mul] + +lemma linearizedMongeAmpere_normalizeAt (g : KaehlerMetric A) + (φ : SmoothRealFunction A) (x₀ : X) : + g.linearizedMongeAmpere (φ.normalizeAt x₀) = g.linearizedMongeAmpere φ := by + funext i z + unfold linearizedMongeAmpere + rw [SmoothRealFunction.hessian_normalizeAt] + +lemma linearized_nonpos_at_globalMax (g : KaehlerMetric A) + (φ : SmoothRealFunction A) {x : X} (hx : ∀ y : X, φ.value y ≤ φ.value x) + (i : Fin A.count) (hi : x ∈ (A.chart i).source) : + g.linearizedMongeAmpere φ i (A.chart i x) ≤ 0 := by + have hs := (φ.smooth i).contDiffAt + ((A.chart i).open_target.mem_nhds ((A.chart i).map_source hi)) + have hm : IsLocalMax (φ.localExpression i) (A.chart i x) := by + apply Filter.Eventually.of_forall + intro z + simpa [SmoothRealFunction.localExpression, (A.chart i).left_inv hi] using + hx ((A.chart i).symm z) + exact EllipticKernel.trace_potentialMatrix_nonpos_at_localMax hs hm _ + (g.positive i _ ((A.chart i).map_source hi)) + + + +theorem no_positive_constant_rhs [CompactSpace X] [Nonempty X] + (g : KaehlerMetric A) (φ : SmoothRealFunction A) {c : ℝ} (hc : 0 < c) : + ¬ (∀ i z, z ∈ (A.chart i).target → g.linearizedMongeAmpere φ i z = c) := by + intro h + obtain ⟨x, _, hx⟩ := isCompact_univ.exists_isMaxOn univ_nonempty φ.continuous.continuousOn + obtain ⟨i, hi⟩ := A.covers x + have hn := g.linearized_nonpos_at_globalMax φ (fun y => hx (mem_univ y)) i hi + rw [h i _ ((A.chart i).map_source hi)] at hn + exact not_le_of_gt hc hn + + + +lemma constant_rhs_eq_zero [CompactSpace X] [Nonempty X] + (g : KaehlerMetric A) (φ : SmoothRealFunction A) {c : ℝ} + (hc : ∀ i z, z ∈ (A.chart i).target → g.linearizedMongeAmpere φ i z = c) : c = 0 := by + have hn : c ≤ 0 := le_of_not_gt (fun h => g.no_positive_constant_rhs φ h hc) + have hp : 0 ≤ c := by + by_contra h + have hc' : 0 < -c := by linarith + apply g.no_positive_constant_rhs (φ.realSMul (-1)) hc' + intro i z hz + rw [linearizedMongeAmpere_realSMul, hc i z hz] + ring + exact le_antisymm hn hp + + + +theorem normalized_augmented_kernel [T2Space X] [CompactSpace X] [ConnectedSpace X] + (g : KaehlerMetric A) (φ : SmoothRealFunction A) (x₀ : X) (c : ℝ) + (hx : φ.value x₀ = 0) + (he : ∀ i z, z ∈ (A.chart i).target → g.linearizedMongeAmpere φ i z + c = 0) : + c = 0 ∧ ∀ x, φ.value x = 0 := by + have hc : -c = 0 := g.constant_rhs_eq_zero φ (by + intro i z hz + linarith [he i z hz]) + have hc₀ : c = 0 := neg_eq_zero.mp hc + obtain ⟨k, hk⟩ := linearizedMongeAmpere_kernel d X A g φ (by + intro i z hz + simpa [hc₀] using he i z hz) + refine ⟨hc₀, fun x => ?_⟩ + rw [hk x, ← hk x₀, hx] +end KaehlerMetric + + + +def HasNormalizedPoissonSolution {d : ℕ} {X : Type*} [TopologicalSpace X] + {A : ComplexAtlas d X} (g : KaehlerMetric A) (x₀ : X) + (f : SmoothRealFunction A) : Prop := + ∃ (φ : SmoothRealFunction A) (c : ℝ), φ.value x₀ = 0 ∧ + ∀ i z, z ∈ (A.chart i).target → + g.linearizedMongeAmpere φ i z + c = f.localExpression i z + +end Anticanonical.SourceSmooth + +end +end +end +end +end +end +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/AtlasLocalization.lean b/lean/OAI/Geometry/PrescribedPotential/AtlasLocalization.lean new file mode 100644 index 0000000000000000000000000000000000000000..b258131f11abf817e868a504e4f18e41e5b66a90 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/AtlasLocalization.lean @@ -0,0 +1,89 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.AnalyticSupport + +namespace OAI + +/-! Atlas Localization. -/ + +section + + + +noncomputable section +open Set Filter Topology Manifold IsManifold +open scoped ContDiff + +namespace Anticanonical.ComplexAtlas +variable {d : ℕ} {X : Type*} [TopologicalSpace X] (A : ComplexAtlas d X) + + +@[instance_reducible] def chartedSpace : ChartedSpace (Coordinates d) X where + atlas := Set.range A.chart + chartAt x := A.chart (A.covers x).choose + mem_chart_source x := (A.covers x).choose_spec + chart_mem_atlas point := ⟨(A.covers point).choose, rfl⟩ + +lemma real_smooth_transition (i j : Fin A.count) : + ContDiffOn ℝ ∞ (A.transition i j) (coordinateOverlap (A.chart i) (A.chart j)) := by + intro z hz + exact ((ProjectiveKaehler.analyticOnNhd_pi_of_differentiableOn + (A.isOpen_coordinateOverlap i j) (A.holomorphic i j) z hz).contDiffAt.restrict_scalars ℝ).contDiffWithinAt + + +theorem isManifold : letI := A.chartedSpace; IsManifold 𝓘(ℝ, Coordinates d) ∞ X := by + let := A.chartedSpace + apply isManifold_of_contDiffOn + rintro e e' ⟨i, rfl⟩ ⟨j, rfl⟩ + simpa only [modelWithCornersSelf_coe, modelWithCornersSelf_coe_symm, + Function.id_comp, Function.comp_id, Set.preimage_id, Set.range_id, Set.inter_univ, OpenPartialHomeomorph.coe_trans, + OpenPartialHomeomorph.trans_source, OpenPartialHomeomorph.symm_source, + transition, coordinateOverlap] using + A.real_smooth_transition i j + + + +theorem contMDiff_iff (f : X → ℝ) : letI := A.chartedSpace; + ContMDiff 𝓘(ℝ, Coordinates d) 𝓘(ℝ) ∞ f ↔ + ∀ i, ContDiffOn ℝ ∞ (f ∘ (A.chart i).symm) (A.chart i).target := by + let := A.chartedSpace + let := A.isManifold + constructor + · intro hf i + have he : A.chart i ∈ maximalAtlas 𝓘(ℝ, Coordinates d) ∞ X := + (contDiffGroupoid ∞ 𝓘(ℝ, Coordinates d)).subset_maximalAtlas ⟨i, rfl⟩ + exact (hf.comp_contMDiffOn (contMDiffOn_symm_of_mem_maximalAtlas he)).contDiffOn + · intro hf x + rw [contMDiffAt_iff_source] + have hchart : chartAt (Coordinates d) x = A.chart (A.covers x).choose := rfl + have hx := (A.chart (A.covers x).choose).mapsTo (A.covers x).choose_spec + have hh := ((hf (A.covers x).choose).contDiffAt + ((A.chart (A.covers x).choose).open_target.mem_nhds hx)).contMDiffAt + simpa only [extChartAt_coe_symm, extChartAt_coe, hchart, modelWithCornersSelf_coe, + modelWithCornersSelf_coe_symm, Function.comp_id, Function.id_comp, + Set.range_id, contMDiffWithinAt_univ, chartAt, chartedSpace] using hh + + + +theorem exists_smooth_partition [T2Space X] [CompactSpace X] : + ∃ ρ : Fin A.count → SourceSmooth.SmoothRealFunction A, + (∀ i x, 0 ≤ (ρ i).value x) ∧ + (∀ x, ∑ i, (ρ i).value x = 1) ∧ + (∀ i, tsupport (ρ i).value ⊆ (A.chart i).source) := by + let := A.chartedSpace + let := A.isManifold + obtain ⟨ρ, hρ⟩ := SmoothPartitionOfUnity.exists_isSubordinate + 𝓘(ℝ, Coordinates d) (s := (Set.univ : Set X)) isClosed_univ + (fun i => (A.chart i).source) (fun i => (A.chart i).open_source) + (by intro x _; obtain ⟨i, hi⟩ := A.covers x; exact Set.mem_iUnion.mpr ⟨i, hi⟩) + refine ⟨fun i => ⟨ρ i, (A.contMDiff_iff (ρ i)).mp (ρ i).contMDiff⟩, ?_, ?_, ?_⟩ + · exact fun i x => ρ.nonneg i x + · intro x + simpa only [finsum_eq_sum_of_fintype] using ρ.sum_eq_one (Set.mem_univ x) + · exact hρ + +end Anticanonical.ComplexAtlas + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/AugmentedVolume.lean b/lean/OAI/Geometry/PrescribedPotential/AugmentedVolume.lean new file mode 100644 index 0000000000000000000000000000000000000000..e771ab9224baac8904c2d36ed824a6dd6fbafea2 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/AugmentedVolume.lean @@ -0,0 +1,91 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.KaehlerClosedDerivatives +import OAI.Geometry.PrescribedPotential.PatchCutoffs +import OAI.Geometry.PrescribedPotential.RealVolume +import OAI.Geometry.PrescribedPotential.RealPoisson +import OAI.Geometry.PrescribedPotential.RealPoissonEquivalence + +namespace OAI + +/-! Augmented Volume. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical +namespace ExponentialAugment +variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] +lemma derivative (V : E → F) (L : E →L[ℝ] F) (C : ℝ →L[ℝ] F) (e : E →L[ℝ] ℝ) + (hv : HasStrictFDerivAt V L 0) (h0 : V 0 = C 1) : + HasStrictFDerivAt (fun z : E × ℝ => (Real.exp (-z.2) • V z.1, e z.1)) + (((L ∘L ContinuousLinearMap.fst ℝ E ℝ) - (C ∘L ContinuousLinearMap.snd ℝ E ℝ)).prod + (e ∘L ContinuousLinearMap.fst ℝ E ℝ)) 0 := by + let π₁ := ContinuousLinearMap.fst ℝ E ℝ + let π₂ := ContinuousLinearMap.snd ℝ E ℝ + have hv' : HasStrictFDerivAt (fun z : E × ℝ => V z.1) (L ∘L π₁) 0 := + hv.comp 0 π₁.hasStrictFDerivAt + have he : HasStrictFDerivAt (fun z : E × ℝ => Real.exp (-z.2)) (-π₂) 0 := by + simpa [π₂] using ((-π₂).hasStrictFDerivAt (x := (0 : E × ℝ))).exp + have hh := he.smul hv' + have hn := (e ∘L π₁).hasStrictFDerivAt (x := (0 : E × ℝ)) + have hj := hh.prodMk hn + have hlin : (Real.exp (-(0 : E × ℝ).2) • (L ∘L π₁) + + (-π₂).smulRight (V (0 : E × ℝ).1)).prod (e ∘L π₁) = + ((L ∘L π₁) - (C ∘L π₂)).prod (e ∘L π₁) := by + apply ContinuousLinearMap.ext + intro z + apply Prod.ext + · change Real.exp (-0) • L z.1 + (-z.2) • V 0 = L z.1 - C z.2 + rw [neg_zero, Real.exp_zero, one_smul, h0, ← map_smul] + simp [sub_eq_add_neg] + · rfl + rw [hlin] at hj + exact hj +end ExponentialAugment + +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +local instance augmentedVolumeNormedAddCommGroup (s : ℝ) : + NormedAddCommGroup (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedAddCommGroup +local instance augmentedVolumeNormedSpace (s : ℝ) : NormedSpace ℝ (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedSpace +local instance augmentedVolumeIsTopologicalAddGroup (s : ℝ) : + IsTopologicalAddGroup (D.localizers.RealSobolev s) := + Submodule.isTopologicalAddGroup _ +local instance augmentedVolumeContinuousSMul (s : ℝ) : + ContinuousSMul ℝ (D.localizers.RealSobolev s) := + SMulMemClass.continuousSMul _ + +def augmentedVolume (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (x₀ : X) + (z : D.localizers.RealSobolev ((k : ℝ)+2) × ℝ) : + D.localizers.RealSobolev (k : ℝ) × ℝ := + (Real.exp (-z.2) • D.realVolume k hk z.1, D.realEvaluation ((k : ℝ)+2) x₀ z.1) + +lemma augmentedVolume_zero (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (x₀ : X) : + D.augmentedVolume k hk x₀ 0 = (D.realConstants (k : ℝ) 1, 0) := by + simp [augmentedVolume, D.realVolume_zero] + +lemma augmentedVolume_hasStrictFDerivAt_zero (k : ℕ) + (hk : Module.finrank ℝ (EC d) < k) (x₀ : X) : + HasStrictFDerivAt (D.augmentedVolume k hk x₀) (D.realAugmentedL k x₀) 0 := by + exact ExponentialAugment.derivative (D.realVolume k hk) (D.realLOrder k) + (D.realConstants (k : ℝ)) (D.realEvaluation ((k : ℝ)+2) x₀) + (D.realVolume_hasStrictFDerivAt_zero k hk) (D.realVolume_zero k hk) + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/BallSubmean.lean b/lean/OAI/Geometry/PrescribedPotential/BallSubmean.lean new file mode 100644 index 0000000000000000000000000000000000000000..389c444cd103d465e802066a92467c5955978e36 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/BallSubmean.lean @@ -0,0 +1,135 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CircleRadialCalculus +import OAI.Geometry.PrescribedPotential.KaehlerClosedDerivatives + +namespace OAI + +/-! Ball Submean. -/ + +section + + + +noncomputable section +open Set Filter Topology Metric MeasureTheory +open scoped ContDiff InnerProductSpace +namespace PotentialABP + +section Affine +variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] + +lemma hessian_affine_comp {f : F → ℝ} (hf : ContDiff ℝ ∞ f) + (L : E →L[ℝ] F) (c : F) (z u v : E) : + fderiv ℝ (fderiv ℝ (fun y => f (c + L y))) z u v = + fderiv ℝ (fderiv ℝ f) (c + L z) (L u) (L v) := by + have hd : fderiv ℝ (fun y => c + L y) = fun _ => L := by + funext y + exact (L.hasFDerivAt.const_add c).fderiv + have hc : ContDiff ℝ ∞ (fun y => c + L y) := contDiff_const.add L.contDiff + change fderiv ℝ (fderiv ℝ (f ∘ (fun y => c + L y))) z u v = _ + rw [PotentialKaehler.second_derivative_comp hc.contDiffAt hf.contDiffAt, hd] + simp + +end Affine + +section ComplexHilbert +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] + [FiniteDimensional ℂ E] [MeasurableSpace E] [BorelSpace E] +local instance ballSubmeanRealInnerProductSpace : InnerProductSpace ℝ E := + InnerProductSpace.rclikeToReal ℂ E + +private def unitScalarIso (a : ℂ) (ha : ‖a‖ = 1) : E ≃ₗᵢ[ℝ] E where + toLinearEquiv := (LinearEquiv.smulOfNeZero ℂ E a (by + intro h; simp [h] at ha)).restrictScalars ℝ + norm_map' x := by simp [LinearEquiv.smulOfNeZero_apply, norm_smul, ha] + +lemma ball_integral_unit_smul (f : E → ℝ) (r : ℝ) (a : ℂ) (ha : ‖a‖ = 1) : + ∫ x in ball (0:E) r, f (a • x) = ∫ x in ball (0:E) r, f x := by + let e : E ≃ₗᵢ[ℝ] E := unitScalarIso a ha + have hb : e ⁻¹' ball (0:E) r = ball (0:E) r := by + ext x + simp only [mem_preimage, mem_ball, dist_zero_right, e.norm_map] + have hm := e.measurePreserving.restrict_preimage (s := ball (0:E) r) isOpen_ball.measurableSet + rw [hb] at hm + exact hm.integral_comp e.toHomeomorph.measurableEmbedding f + +lemma ball_integral_translate (f : E → ℝ) (c : E) (r : ℝ) : + ∫ x in ball (0:E) r, f (c+x) = ∫ x in ball c r, f x := by + have hb : (fun x : E => c+x) ⁻¹' ball c r = ball (0:E) r := by + ext x + simp [mem_ball, dist_eq_norm] + have hm := (measurePreserving_add_left (volume : Measure E) c).restrict_preimage + (s := ball c r) isOpen_ball.measurableSet + rw [hb] at hm + exact hm.integral_comp (Homeomorph.addLeft c).measurableEmbedding f + +omit [FiniteDimensional ℂ E] [MeasurableSpace E] [BorelSpace E] in +lemma complexLine_hessian {f : E → ℝ} (hf : ContDiff ℝ ∞ f) + (c v : E) (z a b : ℂ) : + fderiv ℝ (fderiv ℝ (fun w : ℂ => f (c + w • v))) z a b = + fderiv ℝ (fderiv ℝ f) (c + z • v) (a • v) (b • v) := by + let L : ℂ →L[ℝ] E := ((ContinuousLinearMap.id ℂ ℂ).smulRight v).restrictScalars ℝ + exact hessian_affine_comp hf L c z a b + + + +theorem smooth_ball_submean {f : E → ℝ} (hf : ContDiff ℝ ∞ f) + (c : E) {R : ℝ} (hR : 0 ≤ R) + (hlevi : ∀ x ∈ closedBall c R, ∀ v : E, + 0 ≤ fderiv ℝ (fderiv ℝ f) x v v + + fderiv ℝ (fderiv ℝ f) x (Complex.I • v) (Complex.I • v)) : + (volume.real (ball (0:E) R)) * f c ≤ ∫ x in ball c R, f x := by + let F : ℝ → E → ℝ := fun θ v => f (c + circleMap 0 1 θ • v) + have hF : Continuous (Function.uncurry F) := hf.continuous.comp + (continuous_const.add (((continuous_circleMap 0 1).comp continuous_fst).smul continuous_snd)) + have hi : Integrable (Function.uncurry F) + ((volume.restrict (uIoc 0 (2*Real.pi))).prod + (volume.restrict (ball (0:E) R))) := by + rw [Measure.prod_restrict] + apply (hF.continuousOn.integrableOn_compact + (isCompact_uIcc.prod (isCompact_closedBall (0:E) R))).mono_set + exact prod_mono uIoc_subset_uIcc ball_subset_closedBall + have hv (v : E) (hv : v ∈ ball (0:E) R) : + 2*Real.pi*f c ≤ ∫ θ in 0..2*Real.pi, F θ v := by + have hc : ContDiff ℝ ∞ (fun z : ℂ => f (c + z • v)) := + hf.comp (contDiff_const.add (contDiff_id.smul contDiff_const)) + have h := smooth_circle_submean hc 0 (by norm_num : (0:ℝ) ≤ 1) ?_ + · simp only [zero_smul, add_zero] at h + unfold Real.circleAverage at h + simp only [smul_eq_mul] at h + exact (le_inv_mul_iff₀ (by positivity : 0 < 2*Real.pi)).mp h + · intro z hz + rw [complexLine_hessian hf, complexLine_hessian hf, one_smul] + apply hlevi + have hz' : ‖z‖ ≤ 1 := by simpa [mem_closedBall] using hz + have hv' : ‖v‖ ≤ R := (by simpa [mem_ball] using hv : ‖v‖ < R).le + simp only [mem_closedBall, dist_eq_norm, add_sub_cancel_left, norm_smul] + exact (mul_le_mul_of_nonneg_left hv' (norm_nonneg z)).trans + (mul_le_of_le_one_left hR hz') + have hmean : (2*Real.pi) * (volume.real (ball (0:E) R) * f c) ≤ + ∫ v in ball (0:E) R, ∫ θ in 0..2*Real.pi, F θ v := by + have hi' : IntegrableOn (fun v => ∫ θ in 0..2*Real.pi, F θ v) (ball (0:E) R) := by + simpa only [intervalIntegral.integral_of_le (by positivity : (0:ℝ) ≤ 2*Real.pi), + uIoc_of_le (by positivity : (0:ℝ) ≤ 2*Real.pi), Function.uncurry_def, + IntegrableOn] using hi.integral_prod_right + have hiC : IntegrableOn (fun _ : E => 2*Real.pi*f c) (ball (0:E) R) := + (continuous_const.continuousOn.integrableOn_compact (isCompact_closedBall (0:E) R)).mono_set + ball_subset_closedBall + have hm := setIntegral_mono_on hiC hi' isOpen_ball.measurableSet hv + simpa only [setIntegral_const, smul_eq_mul, mul_left_comm] using hm + rw [← intervalIntegral_integral_swap hi] at hmean + have he (θ : ℝ) : (∫ v in ball (0:E) R, F θ v) = ∫ x in ball c R, f x := by + exact (ball_integral_unit_smul (fun x => f (c+x)) R (circleMap 0 1 θ) + (by simp)).trans (ball_integral_translate f c R) + simp_rw [he] at hmean + simp only [intervalIntegral.integral_const, sub_zero, smul_eq_mul] at hmean + nlinarith [Real.pi_pos] + +end ComplexHilbert +end PotentialABP + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/BernsteinEnergyInterior.lean b/lean/OAI/Geometry/PrescribedPotential/BernsteinEnergyInterior.lean new file mode 100644 index 0000000000000000000000000000000000000000..d49c44696506d2ad744b7df0dab260b1b4fbb552 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/BernsteinEnergyInterior.lean @@ -0,0 +1,123 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.BernsteinHigherRescue +import OAI.Geometry.PrescribedPotential.BernsteinLocalC2 +import OAI.Geometry.PrescribedPotential.RealCutoffBounds + +namespace OAI + +/-! Bernstein Energy Interior. -/ + +section + + +noncomputable section +open Set Filter Topology +open scoped ContDiff +namespace HigherJet +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + {ι : Type*} [Fintype ι] + +lemma quartic_energy_interior {K U : Set E} (hK : IsCompact K) (hU : IsOpen U) (hKU : K ⊆ U) + {χ : E → ℝ} (hχ : ContDiff ℝ ∞ χ) (hχval : ∀ x ∈ K, 0 ≤ χ x ∧ χ x ≤ 1) + (hχint : ∀ x ∈ K, χ x ≠ 0 → x ∈ interior K) + {A R B : ℝ} (hA : 1 ≤ A) (hR : 1 ≤ R) (hB : 0 ≤ B) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ S T : E → ℝ, ContDiffOn ℝ ∞ S U → ContDiffOn ℝ ∞ T U → + ∀ v : E → ι → E, (∀ x ∈ K, ∀ i, ‖v x i‖ ≤ B) → + (∀ x ∈ K, 0 ≤ S x ∧ S x ≤ R ∧ 0 ≤ T x) → + (∀ x ∈ K, ∃ D : ℝ, 0 ≤ D ∧ T x ≤ A*D ∧ D ≤ A*T x ∧ + D-R ≤ frameLaplace (v x) S x ∧ + -R*(1+T x*Real.sqrt (T x)) ≤ frameLaplace (v x) T x ∧ + ‖frameGradient (v x) S x‖^2 ≤ 4*S x*D) → + ∀ z ∈ K, χ z=1 → T z ≤ C := by + classical + obtain ⟨C0,hC0,hcut⟩ := cutoff_uniform_frames (ι := ι) hK χ hχ hB + let C1 := 1+C0+R+A*R+4*A^3*R + have hA0 : 0 ≤ A := by linarith + have hR0 : 0 ≤ R := by linarith + have hC1 : 1 ≤ C1 := by dsimp [C1]; nlinarith [mul_nonneg hA0 hR0, show 0 ≤ 4*A^3*R by positivity] + have hc0 : C0 ≤ C1 := by dsimp [C1]; nlinarith [mul_nonneg hA0 hR0, show 0 ≤ 4*A^3*R by positivity] + have hr1 : R ≤ C1 := by dsimp [C1]; nlinarith [mul_nonneg hA0 hR0, show 0 ≤ 4*A^3*R by positivity] + have har : A*R ≤ C1 := by dsimp [C1]; nlinarith [mul_nonneg hA0 hR0, show 0 ≤ 4*A^3*R by positivity] + have hgradC : 4*A^3*R ≤ C1 := by dsimp [C1]; nlinarith [mul_nonneg hA0 hR0, show 0 ≤ 4*A^3*R by positivity] + let C := (8*C1+1+A*R)*(2*quarticConstant C1 (8*C1+1+A*R)+2)^2 + refine ⟨C,by dsimp [C]; positivity,?_⟩ + intro S T hS hT v hv hvalues hineq z hz hz1 + apply quartic_cutoff_uniform hK hU hKU (contDiffOn_const.mul hS) hT (hχ.pow 2).contDiffOn + hC1 (mul_nonneg hA0 hR0) (S := fun y => A*S y) (η := fun y => (χ y)^2) ?_ ?_ v ?_ z hz (by rw [hz1]; norm_num) + · intro x hx + obtain ⟨hs,hsR,ht⟩ := hvalues x hx + obtain ⟨hχ0,hχ1⟩ := hχval x hx + exact ⟨mul_nonneg hA0 hs,mul_le_mul_of_nonneg_left hsR hA0,ht,sq_nonneg _,by nlinarith⟩ + · intro x hx hn + exact hχint x hx (fun he => hn (by rw [he]; ring)) + · intro x hx _ + obtain ⟨D,hD,htD,hDt,hLS,hLT,hGS⟩ := hineq x hx + obtain ⟨hs,hsR,ht⟩ := hvalues x hx + obtain ⟨hLχ,hGχ⟩ := hcut x hx (v x) (hv x hx) + refine ⟨?_,?_,(neg_le_neg hc0).trans hLχ,hGχ.trans (mul_le_mul_of_nonneg_right hc0 (sq_nonneg _)),?_⟩ + · rw [frameLaplace_const_mul hU hS (hKU hx)] + have hh := mul_le_mul_of_nonneg_left hLS hA0 + nlinarith only [hh,htD,har] + · have hh := mul_le_mul_of_nonneg_right hr1 (show 0 ≤ 1+T x*Real.sqrt (T x) by positivity) + nlinarith only [hh,hLT] + · rw [frameGradient_const_mul ((hS.contDiffAt (hU.mem_nhds (hKU hx))).differentiableAt (by simp)),norm_smul,Real.norm_eq_abs,mul_pow,sq_abs] + calc + _ ≤ A^2*(4*S x*D) := mul_le_mul_of_nonneg_left hGS (sq_nonneg A) + _ ≤ A^2*(4*R*(A*T x)) := mul_le_mul_of_nonneg_left + (mul_le_mul (mul_le_mul_of_nonneg_left hsR (by norm_num)) hDt hD (by positivity)) (sq_nonneg A) + _ = (4*A^3*R)*T x := by ring + _ ≤ C1*T x := mul_le_mul_of_nonneg_right hgradC ht + +lemma linear_energy_interior {K U : Set E} (hK : IsCompact K) (hU : IsOpen U) (hKU : K ⊆ U) + {χ : E → ℝ} (hχ : ContDiff ℝ ∞ χ) (hχval : ∀ x ∈ K, 0 ≤ χ x ∧ χ x ≤ 1) + (hχint : ∀ x ∈ K, χ x ≠ 0 → x ∈ interior K) + {A R B : ℝ} (hA : 1 ≤ A) (hR : 1 ≤ R) (hB : 0 ≤ B) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ S T : E → ℝ, ContDiffOn ℝ ∞ S U → ContDiffOn ℝ ∞ T U → + ∀ v : E → ι → E, (∀ x ∈ K, ∀ i, ‖v x i‖ ≤ B) → + (∀ x ∈ K, 0 ≤ S x ∧ S x ≤ R ∧ 0 ≤ T x) → + (∀ x ∈ K, ∃ D Q : ℝ, 0 ≤ D ∧ 0 ≤ Q ∧ T x ≤ A*D ∧ + D-R ≤ frameLaplace (v x) S x ∧ + Q-R*(1+T x) ≤ frameLaplace (v x) T x ∧ + ‖frameGradient (v x) T x‖^2 ≤ 4*T x*Q) → + ∀ z ∈ K, χ z=1 → T z ≤ C := by + classical + obtain ⟨C0,hC0,hcut⟩ := cutoff_uniform_frames (ι := ι) hK χ hχ hB + let C1 := 1+C0+R+A*R + have hA0 : 0 ≤ A := by linarith + have hR0 : 0 ≤ R := by linarith + have hC1 : 0 ≤ C1 := by dsimp [C1]; nlinarith [mul_nonneg hA0 hR0, show 0 ≤ 4*A^3*R by positivity] + have hc0 : C0 ≤ C1 := by dsimp [C1]; nlinarith [mul_nonneg hA0 hR0, show 0 ≤ 4*A^3*R by positivity] + have hr1 : R ≤ C1 := by dsimp [C1]; nlinarith [mul_nonneg hA0 hR0, show 0 ≤ 4*A^3*R by positivity] + have har : A*R ≤ C1 := by dsimp [C1]; nlinarith [mul_nonneg hA0 hR0, show 0 ≤ 4*A^3*R by positivity] + let C := 2*C1*(1+(12*C1+1)/1)+((12*C1+1)/1)*(A*R) + refine ⟨C,by dsimp [C]; positivity,?_⟩ + intro S T hS hT v hv hvalues hineq + choose D Q hD hQ htD hLS hLT hGT using hineq + let Q' : E → ℝ := fun x => if hx : x ∈ K then Q x hx else 0 + intro z hz hz1 + apply linear_cutoff_uniform hK hU hKU (contDiffOn_const.mul hS) hT (hχ.pow 2).contDiffOn + hC1 (mul_nonneg hA0 hR0) (show (0:ℝ)<1 by norm_num) + (S := fun y => A*S y) (η := fun y => (χ y)^2) ?_ ?_ v Q' ?_ z hz (by rw [hz1]; norm_num) + · intro x hx + obtain ⟨hs,hsR,ht⟩ := hvalues x hx + obtain ⟨hχ0,hχ1⟩ := hχval x hx + exact ⟨mul_nonneg hA0 hs,mul_le_mul_of_nonneg_left hsR hA0,ht,sq_nonneg _,by nlinarith⟩ + · intro x hx hn + exact hχint x hx (fun he => hn (by rw [he]; ring)) + · intro x hx _ + have hqx : Q' x=Q x hx := dite_eq_left hx + rw [hqx] + obtain ⟨hLχ,hGχ⟩ := hcut x hx (v x) (hv x hx) + refine ⟨hQ x hx,?_,?_,(neg_le_neg hc0).trans hLχ,hGχ.trans (mul_le_mul_of_nonneg_right hc0 (sq_nonneg _)),hGT x hx⟩ + · rw [frameLaplace_const_mul hU hS (hKU hx)] + have hh := mul_le_mul_of_nonneg_left (hLS x hx) hA0 + have ht := htD x hx + nlinarith only [hh,ht,har] + · have hh := mul_le_mul_of_nonneg_right hr1 (show 0 ≤ 1+T x by linarith [(hvalues x hx).2.2]) + linarith only [hLT x hx,hh] +end HigherJet + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/BernsteinHigherRescue.lean b/lean/OAI/Geometry/PrescribedPotential/BernsteinHigherRescue.lean new file mode 100644 index 0000000000000000000000000000000000000000..8c0ea06245e48c1d327476fc3c67de6a2d4672a5 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/BernsteinHigherRescue.lean @@ -0,0 +1,91 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CalabiCutoffAlgebra +import OAI.Geometry.PrescribedPotential.RealFrameScalar + +namespace OAI + +/-! Bernstein Higher Rescue. -/ + +section + + +noncomputable section +open Set Filter Topology +open scoped ContDiff +namespace HigherJet +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + {ι : Type*} [Fintype ι] + +lemma frameLaplace_const_mul {U : Set E} (hU : IsOpen U) {f : E → ℝ} + (hf : ContDiffOn ℝ ∞ f U) {x : E} (hx : x ∈ U) (v : ι → E) (c : ℝ) : + frameLaplace v (fun y => c*f y) x = c*frameLaplace v f x := by + rw [frameLaplace_mul hU contDiffOn_const hf hx,frameLaplace_const,frameGradient_const] + simp + +lemma linear_cutoff_uniform {K U : Set E} (hK : IsCompact K) (hU : IsOpen U) (hKU : K ⊆ U) + {S T η : E → ℝ} (hS : ContDiffOn ℝ ∞ S U) (hT : ContDiffOn ℝ ∞ T U) + (hη : ContDiffOn ℝ ∞ η U) {C R δ : ℝ} (hC : 0 ≤ C) (_hR : 0 ≤ R) (hδ : 0 < δ) + (hvalues : ∀ x ∈ K, 0 ≤ S x ∧ S x ≤ R ∧ 0 ≤ T x ∧ 0 ≤ η x ∧ η x ≤ 1) + (hinterior : ∀ x ∈ K, η x ≠ 0 → x ∈ interior K) + (v : E → ι → E) (Q : E → ℝ) + (hineq : ∀ x ∈ K, η x ≠ 0 → + 0 ≤ Q x ∧ δ*T x-C ≤ frameLaplace (v x) S x ∧ + Q x-C*(1+T x) ≤ frameLaplace (v x) T x ∧ + -C ≤ frameLaplace (v x) η x ∧ + ‖frameGradient (v x) η x‖^2 ≤ C*η x ∧ + ‖frameGradient (v x) T x‖^2 ≤ 4*T x*Q x) : + ∀ z ∈ K, η z = 1 → T z ≤ 2*C*(1+(12*C+1)/δ)+((12*C+1)/δ)*R := by + let A := (12*C+1)/δ + have hA : 0 ≤ A := div_nonneg (by positivity) hδ.le + let W : E → ℝ := fun x => η x*T x+A*S x + have hW : ContDiffOn ℝ ∞ W U := (hη.mul hT).add (contDiffOn_const.mul hS) + intro z hz hηz + obtain ⟨x,hx,hmax⟩ := hK.exists_isMaxOn ⟨z,hz⟩ (hW.continuousOn.mono hKU) + obtain ⟨hSx,hSRx,hTx,hηx,hη1x⟩ := hvalues x hx + have hL : T z ≤ W x := by + have h := hmax hz + change η z*T z+A*S z ≤ W x at h + rw [hηz,one_mul] at h + exact (le_add_of_nonneg_right (mul_nonneg hA (hvalues z hz).1)).trans h + have hB : W x ≤ 2*C*(1+A)+A*R := by + by_cases hn : η x=0 + · dsimp only [W] + rw [hn,zero_mul,zero_add] + exact (mul_le_mul_of_nonneg_left hSRx hA).trans (le_add_of_nonneg_left (by positivity)) + have hm : IsLocalMax W x := by + filter_upwards [mem_interior_iff_mem_nhds.mp (hinterior x hx hn)] with y hy + exact hmax hy + have hmaxL := frameLaplace_nonpos_of_localMax (hW.contDiffAt (hU.mem_nhds (hKU hx))) hm (v x) + change frameLaplace (v x) (fun y => η y*T y+A*S y) x ≤ 0 at hmaxL + rw [frameLaplace_add hU (hη.mul hT) (contDiffOn_const.mul hS) (hKU hx), + frameLaplace_mul hU hη hT (hKU hx),frameLaplace_const_mul hU hS (hKU hx)] at hmaxL + obtain ⟨hQ,hLS,hLT,hLη,hGη,hGT⟩ := hineq x hx hn + have hcauchy : (inner ℝ (frameGradient (v x) η x) (frameGradient (v x) T x))^2 ≤ + ‖frameGradient (v x) η x‖^2*‖frameGradient (v x) T x‖^2 := by + simpa only [sq_abs,mul_pow] using + (sq_le_sq₀ (abs_nonneg (inner ℝ (frameGradient (v x) η x) (frameGradient (v x) T x))) + (mul_nonneg (norm_nonneg _) (norm_nonneg _))).mpr + (abs_real_inner_le_norm (frameGradient (v x) η x) (frameGradient (v x) T x)) + have hcross : (2*inner ℝ (frameGradient (v x) η x) (frameGradient (v x) T x))^2 ≤ + 8*(2*C)*η x*T x*Q x := by + have h := mul_le_mul hGη hGT (sq_nonneg _) (mul_nonneg hC hηx) + nlinarith only [hcauchy,h] + have hh : T x ≤ 2*C*(1+A) := by + have hls : Q x-(2*C)*(1+T x) ≤ frameLaplace (v x) T x := by + have : 0 ≤ C*(1+T x) := by positivity + linarith only [hLT,this] + have hlt : δ*T x-2*C ≤ frameLaplace (v x) S x := by linarith only [hLS,hC] + have hle : -(2*C) ≤ frameLaplace (v x) η x := by linarith only [hLη,hC] + have ha : (6*(2*C)+1)/δ = A := by dsimp [A]; congr 1; ring + simpa only [ha] using CalabiEstimate.cutoff_max_bound hTx hQ hηx hη1x + (show 0 ≤ 2*C by positivity) hδ hls hlt hle hcross (by simpa only [ha] using hmaxL) + dsimp only [W] + exact add_le_add ((mul_le_mul_of_nonneg_right hη1x hTx).trans (by simpa using hh)) + (mul_le_mul_of_nonneg_left hSRx hA) + exact hL.trans hB +end HigherJet + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/BernsteinLocalC2.lean b/lean/OAI/Geometry/PrescribedPotential/BernsteinLocalC2.lean new file mode 100644 index 0000000000000000000000000000000000000000..1378d4e98623e0473cfcc8c6a5f9d6ce84fa192a --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/BernsteinLocalC2.lean @@ -0,0 +1,91 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.BernsteinProductMaximum +import OAI.Geometry.PrescribedPotential.BernsteinQuarticAlgebra + +namespace OAI + +/-! Bernstein Local C2. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff +namespace HigherJet +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + {ι : Type*} [Fintype ι] + +def quarticConstant (C B : ℝ) : ℝ := B*C+C+3*B*C+4*C^2+1 + +lemma quartic_cutoff_uniform {K U : Set E} (hK : IsCompact K) (hU : IsOpen U) (hKU : K ⊆ U) + {S T η : E → ℝ} (hS : ContDiffOn ℝ ∞ S U) (hT : ContDiffOn ℝ ∞ T U) + (hη : ContDiffOn ℝ ∞ η U) {C R : ℝ} (hC : 1 ≤ C) (hR : 0 ≤ R) + (hvalues : ∀ x ∈ K, 0 ≤ S x ∧ S x ≤ R ∧ 0 ≤ T x ∧ 0 ≤ η x ∧ η x ≤ 1) + (hinterior : ∀ x ∈ K, η x ≠ 0 → x ∈ interior K) + (v : E → ι → E) + (hineq : ∀ x ∈ K, η x ≠ 0 → + T x-C ≤ frameLaplace (v x) S x ∧ + -C*(1+T x*Real.sqrt (T x)) ≤ frameLaplace (v x) T x ∧ + -C ≤ frameLaplace (v x) η x ∧ + ‖frameGradient (v x) η x‖^2 ≤ C*η x ∧ + ‖frameGradient (v x) S x‖^2 ≤ C*T x) : + ∀ z ∈ K, η z = 1 → + T z ≤ (8*C+1+R)*(2*quarticConstant C (8*C+1+R)+2)^2 := by + let A := 8*C+1 + let B := A+R + let D := quarticConstant C B + have hA : 1 ≤ A := by dsimp [A]; linarith + have hB : 0 ≤ B := by dsimp [B]; linarith + have hD : 1 ≤ D := by + have h : 0 ≤ B*C+C+3*B*C+4*C^2 := by positivity + dsimp [D,quarticConstant]; linarith + let W : E → ℝ := fun x => η x*(A+S x)*T x + have hW : ContDiffOn ℝ ∞ W U := (hη.mul (contDiffOn_const.add hS)).mul hT + intro z hz hηz + obtain ⟨x,hx,hmax⟩ := hK.exists_isMaxOn ⟨z,hz⟩ (hW.continuousOn.mono hKU) + obtain ⟨hSx,hSRx,hTx,hηx,hη1x⟩ := hvalues x hx + obtain ⟨hSz,_,hTz,_,_⟩ := hvalues z hz + have hL : A*T z ≤ W x := by + have hh := hmax hz + change η z*(A+S z)*T z ≤ W x at hh + rw [hηz,one_mul] at hh + nlinarith only [hh,mul_nonneg hSz hTz] + have hAB : A+S x ≤ B := by dsimp [B]; linarith + have hax : 0 < A+S x := by linarith + by_cases hn : η x=0 + · have he : W x=0 := by dsimp [W]; rw [hn]; ring + rw [he] at hL + have : T z ≤ 0 := by nlinarith only [hL,hA,hTz] + exact this.trans (mul_nonneg (by dsimp [A,B] at hB; exact hB) (sq_nonneg _)) + have hηpos : 0 < η x := lt_of_le_of_ne hηx (Ne.symm hn) + have hm : IsLocalMax W x := by + filter_upwards [mem_interior_iff_mem_nhds.mp (hinterior x hx hn)] with y hy + exact hmax hy + have hnum := quartic_test_at_max hU hη hS hT (hKU hx) (v x) A hn (ne_of_gt hax) hm + obtain ⟨hLS,hLT,hLη,hGη,hGS⟩ := hineq x hx hn + have hcross : (inner ℝ (frameGradient (v x) η x) (frameGradient (v x) S x))^2 ≤ + ‖frameGradient (v x) η x‖^2*‖frameGradient (v x) S x‖^2 := by + simpa only [sq_abs,mul_pow] using + (sq_le_sq₀ (abs_nonneg (inner ℝ (frameGradient (v x) η x) (frameGradient (v x) S x))) + (mul_nonneg (norm_nonneg _) (norm_nonneg _))).mpr + (abs_real_inner_le_norm (frameGradient (v x) η x) (frameGradient (v x) S x)) + have hb := BernsteinEstimate.quartic_max_reduction hηpos hη1x hTx + (Real.sqrt_nonneg _) (Real.sq_sqrt hTx) hC (by dsimp only [A]; linarith only [hSx]) hAB + hLS hLT hLη (sq_nonneg _) (sq_nonneg _) hGη hGS hcross hnum + have hbound : η x*T x ≤ (2*D+2)^2 := + BernsteinEstimate.weighted_quartic_bound hηx hη1x hTx hD hb + have hWB : W x ≤ B*(2*D+2)^2 := by + calc + _ = (A+S x)*(η x*T x) := by dsimp [W]; ring + _ ≤ B*(2*D+2)^2 := mul_le_mul hAB hbound (mul_nonneg hηx hTx) hB + change T z ≤ B*(2*D+2)^2 + have hAT : T z ≤ A*T z := le_mul_of_one_le_left hTz hA + exact hAT.trans (hL.trans hWB) +end HigherJet + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/BernsteinProductMaximum.lean b/lean/OAI/Geometry/PrescribedPotential/BernsteinProductMaximum.lean new file mode 100644 index 0000000000000000000000000000000000000000..98f379d8be3de8275e74cb5870f08d72466d1a8f --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/BernsteinProductMaximum.lean @@ -0,0 +1,78 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.RealFrameScalar +import OAI.Geometry.PrescribedPotential.WirtingerCalculus + +namespace OAI + +/-! Bernstein Product Maximum. -/ + +section + + +noncomputable section +open Set Filter Topology Finset +open scoped ContDiff +namespace BernsteinEstimate +variable {V : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] + +lemma product_gradient_cross_identity {η a T : ℝ} (hη : η ≠ 0) (ha : a ≠ 0) + (X Y Z : V) (h : (a*T) • X+(η*T) • Y+(η*a) • Z=0) : + 2*η*inner ℝ Y Z+2*a*inner ℝ X Z+2*T*inner ℝ X Y = + -2*η*T/a*‖Y‖^2-2*a*T/η*‖X‖^2-2*T*inner ℝ X Y := by + have hx := congrArg (fun W => inner ℝ X W) h + have hy := congrArg (fun W => inner ℝ Y W) h + simp only [inner_add_right,inner_smul_right,inner_zero_right,real_inner_self_eq_norm_sq] at hx hy + rw [real_inner_comm X Y] at hy + have hx' := congrArg (fun r : ℝ => 2*a*r) hx + have hy' := congrArg (fun r : ℝ => 2*η*r) hy + field_simp + nlinarith only [hx',hy'] +end BernsteinEstimate + +namespace HigherJet +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + {ι : Type*} [Fintype ι] + +lemma quartic_test_at_max {U : Set E} (hU : IsOpen U) {η S T : E → ℝ} + (hηs : ContDiffOn ℝ ∞ η U) (hSs : ContDiffOn ℝ ∞ S U) (hTs : ContDiffOn ℝ ∞ T U) + {x : E} (hx : x ∈ U) (v : ι → E) (A : ℝ) + (hηx : η x ≠ 0) (hax : A+S x ≠ 0) + (hmax : IsLocalMax (fun y => η y*(A+S y)*T y) x) : + η x*(A+S x)*frameLaplace v T x+η x*T x*frameLaplace v S x+ + (A+S x)*T x*frameLaplace v η x - + 2*η x*T x/(A+S x)*‖frameGradient v S x‖^2 - + 2*(A+S x)*T x/η x*‖frameGradient v η x‖^2 - + 2*T x*inner ℝ (frameGradient v η x) (frameGradient v S x) ≤ 0 := by + let a : E → ℝ := fun y => A+S y + have has : ContDiffOn ℝ ∞ a U := contDiffOn_const.add hSs + have hηa := (hηs.contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp) + have hSa := (hSs.contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp) + have hTa := (hTs.contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp) + have haa := (has.contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp) + have hg : frameGradient v a x = frameGradient v S x := by + rw [show a = fun y => A+S y from rfl,frameGradient_add (differentiableAt_const A) hSa,frameGradient_const,zero_add] + have hl : frameLaplace v a x = frameLaplace v S x := by + rw [show a = fun y => A+S y from rfl,frameLaplace_add hU contDiffOn_const hSs hx,frameLaplace_const,zero_add] + have hgrad := frameGradient_eq_zero_of_localMax hmax v + have hm := frameLaplace_nonpos_of_localMax + (((hηs.mul has).mul hTs).contDiffAt (hU.mem_nhds hx)) hmax v + change frameGradient v (fun y => (η y*a y)*T y) x = 0 at hgrad + rw [frameGradient_mul (f := fun y => η y*a y) (hηa.mul haa) hTa, + frameGradient_mul hηa haa,hg,smul_add,smul_smul,smul_smul] at hgrad + have hcross := BernsteinEstimate.product_gradient_cross_identity (T := T x) hηx hax + (frameGradient v η x) (frameGradient v S x) (frameGradient v T x) + (by simpa only [mul_comm,mul_left_comm,mul_assoc,a] using hgrad) + change frameLaplace v (fun y => (η y*a y)*T y) x ≤ 0 at hm + rw [frameLaplace_mul hU (f := fun y => η y*a y) (hηs.mul has) hTs hx, + frameLaplace_mul hU hηs has hx,frameGradient_mul hηa haa,hg,hl, + inner_add_left,inner_smul_left,inner_smul_left] at hm + dsimp only [a] at hm + simp only [starRingEnd_apply,star_trivial] at hm + simp only [neg_mul,neg_div] at hcross + nlinarith only [hm,hcross] +end HigherJet + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/BernsteinQuarticAlgebra.lean b/lean/OAI/Geometry/PrescribedPotential/BernsteinQuarticAlgebra.lean new file mode 100644 index 0000000000000000000000000000000000000000..e9d9fc213e26a610077f1134760f52d5e1339538 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/BernsteinQuarticAlgebra.lean @@ -0,0 +1,94 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CalabiCutoffAlgebra + +namespace OAI + +/-! Bernstein Quartic Algebra. -/ + +section + + +namespace BernsteinEstimate + +lemma quadratic_root_bound {u C : ℝ} (hu : 0 ≤ u) (hC : 1 ≤ C) + (h : u^2/2 ≤ C*u+2*C) : u^2 ≤ (2*C+2)^2 := by + have hle : u ≤ 2*C+2 := by + by_contra hn + have hh : 2*C+2 < u := lt_of_not_ge hn + nlinarith [mul_pos (by linarith : 0 < u-(2*C+2)) (by linarith : 0 < u+2)] + exact pow_le_pow_left₀ hu hle 2 + +lemma weighted_quartic_bound {η T C : ℝ} (hη : 0 ≤ η) (hη1 : η ≤ 1) + (hT : 0 ≤ T) (hC : 1 ≤ C) + (h : η*T^2/2 ≤ C*η*T*Real.sqrt T+C*T+C) : + η*T ≤ (2*C+2)^2 := by + by_cases ht : T ≤ 1 + · have he := mul_le_mul hη1 ht hT (by norm_num : (0:ℝ) ≤ 1) + nlinarith + have ht' : 0 < T := by linarith + have h1 : η*T/2 ≤ C*η*Real.sqrt T+2*C := by + have hc : C ≤ C*T := le_mul_of_one_le_right (by linarith) (le_of_not_ge ht) + have hh : T*(η*T/2) ≤ T*(C*η*Real.sqrt T+2*C) := by nlinarith only [h,hc] + exact (mul_le_mul_iff_right₀ ht').mp hh + let u := Real.sqrt (η*T) + have hu : 0 ≤ u := Real.sqrt_nonneg _ + have hu2 : u^2 = η*T := Real.sq_sqrt (mul_nonneg hη hT) + have hs : η*Real.sqrt T ≤ u := by + apply (sq_le_sq₀ (mul_nonneg hη (Real.sqrt_nonneg _)) hu).mp + rw [mul_pow,Real.sq_sqrt hT,hu2] + exact mul_le_mul_of_nonneg_right (by nlinarith only [hη,hη1] : η^2 ≤ η) hT + have h2 : u^2/2 ≤ C*u+2*C := by + have hmul := mul_le_mul_of_nonneg_left hs (by linarith : 0 ≤ C) + nlinarith only [h1,hmul,hu2] + rw [← hu2] + exact quadratic_root_bound hu hC h2 + + + +lemma quartic_max_reduction {η T r a B C LS LT Lη xs ys z : ℝ} + (hη : 0 < η) (hη1 : η ≤ 1) (hT : 0 ≤ T) (hr : 0 ≤ r) (_hr2 : r^2=T) + (hC : 1 ≤ C) (ha : 8*C+1 ≤ a) (haB : a ≤ B) + (hLS : T-C ≤ LS) (hLT : -C*(1+T*r) ≤ LT) (hLη : -C ≤ Lη) + (_hxs : 0 ≤ xs) (hys : 0 ≤ ys) (hxsB : xs ≤ C*η) (hysB : ys ≤ C*T) + (hz : z^2 ≤ xs*ys) + (hmax : η*a*LT+η*T*LS+a*T*Lη-2*η*T/a*ys-2*a*T/η*xs-2*T*z ≤ 0) : + η*T^2/2 ≤ (B*C+C+3*B*C+4*C^2+1)*η*T*r + + (B*C+C+3*B*C+4*C^2+1)*T + (B*C+C+3*B*C+4*C^2+1) := by + have hC0 : 0 ≤ C := by linarith + have ha0 : 0 < a := by linarith + have hB0 : 0 ≤ B := by linarith + have hyterm : 2*η*T/a*ys ≤ η*T^2/4 := by + rw [div_mul_eq_mul_div] + apply (div_le_iff₀ ha0).mpr + have hh := mul_le_mul_of_nonneg_left hysB (by positivity : 0 ≤ 2*η*T) + have haa : 8*C ≤ a := by linarith + have hhh := mul_le_mul_of_nonneg_right haa (by positivity : 0 ≤ η*T^2) + nlinarith only [hh,hhh] + have hxterm : 2*a*T/η*xs ≤ 2*B*C*T := by + calc + _ ≤ 2*a*T/η*(C*η) := mul_le_mul_of_nonneg_left hxsB (by positivity) + _ = 2*a*C*T := by field_simp + _ ≤ 2*B*C*T := by nlinarith only [mul_le_mul_of_nonneg_right haB (mul_nonneg hC0 hT)] + have hzz : (-2*T*z)^2 ≤ 8*(C^2*T)*(η*T^2/2) := by + have hh := hz.trans (mul_le_mul hxsB hysB hys (mul_nonneg hC0 hη.le)) + have hh' := mul_le_mul_of_nonneg_left hh (by positivity : 0 ≤ 4*T^2) + nlinarith only [hh'] + have hcross := CalabiEstimate.cross_absorb (by positivity : 0 ≤ C^2*T) + (by positivity : 0 ≤ η*T^2/2) hzz + have h1 := mul_le_mul_of_nonneg_left hLT (by positivity : 0 ≤ η*a) + have h2 := mul_le_mul_of_nonneg_left hLS (by positivity : 0 ≤ η*T) + have h3 := mul_le_mul_of_nonneg_left hLη (by positivity : 0 ≤ a*T) + have hab0 := mul_le_mul_of_nonneg_right haB (by positivity : 0 ≤ η*C) + have hab1 := mul_le_mul_of_nonneg_right haB (by positivity : 0 ≤ η*C*T*r) + have hab2 := mul_le_mul_of_nonneg_right haB (by positivity : 0 ≤ C*T) + have heet := mul_le_mul_of_nonneg_right hη1 (by positivity : 0 ≤ C*T) + have heec := mul_le_mul_of_nonneg_right hη1 (by positivity : 0 ≤ B*C) + have herr0 : 0 ≤ (C+3*B*C+4*C^2+1)*η*T*r := by positivity + have herr1 : 0 ≤ (B*C+1)*T := by positivity + have herr2 : 0 ≤ C+3*B*C+4*C^2+1 := by positivity + nlinarith only [hmax,h1,h2,h3,hyterm,hxterm,hcross,hab0,hab1,hab2,heet,heec,herr0,herr1,herr2] +end BernsteinEstimate + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/BootstrapCalculus.lean b/lean/OAI/Geometry/PrescribedPotential/BootstrapCalculus.lean new file mode 100644 index 0000000000000000000000000000000000000000..708a543093f11843f97c4c9d28de847172cf817e --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/BootstrapCalculus.lean @@ -0,0 +1,62 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CircleRadialCalculus +import OAI.Geometry.PrescribedPotential.KaehlerClosedDerivatives + +namespace OAI + +/-! Bootstrap Calculus. -/ + +section + + +noncomputable section +namespace FixedBootstrapCalculus +variable {E F G H : Type*} + [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] + [NormedAddCommGroup G] [NormedSpace ℝ G] + [NormedAddCommGroup H] [NormedSpace ℝ H] + +lemma derivative_compatibility (B : E → E →L[ℝ] F) (C : G → G →L[ℝ] H) + (L : E →L[ℝ] G) (M : F →L[ℝ] H) + (hB : Differentiable ℝ B) (hC : Differentiable ℝ C) + (he : ∀ y v, C (L y) (L v) = M (B y v)) (u w v : E) : + fderiv ℝ C (L u) (L w) (L v) = M (fderiv ℝ B u w v) := by + have hL := ((hC (L u)).hasFDerivAt.comp u L.hasFDerivAt).clm_apply + (hasFDerivAt_const (L v) u) + have hR := M.hasFDerivAt.comp u + ((hB u).hasFDerivAt.clm_apply (hasFDerivAt_const v u)) + have he' : (fun y => C (L y) (L v)) = (fun y => M (B y v)) := funext (fun y => he y v) + simp only [Function.comp_def] at hL hR + rw [he'] at hL + have hh := congrArg (fun T : E →L[ℝ] H => T w) (hL.unique hR) + simpa only [add_apply, ContinuousLinearMap.comp_apply, + zero_apply, map_zero, zero_add, ContinuousLinearMap.flip_apply] using hh + +lemma differentiated_commutator (B : E → E →L[ℝ] F) + (L P : G →L[ℝ] E) (Q M : H →L[ℝ] F) (V N : G → H) + (hB : Differentiable ℝ B) (hV : Differentiable ℝ V) (hN : Differentiable ℝ N) + (he : ∀ y, B (L y) (P y) = Q (V y) + M (N y)) (u w : G) : + B (L u) (P w) + fderiv ℝ B (L u) (L w) (P u) = + Q (fderiv ℝ V u w) + M (fderiv ℝ N u w) := by + have hL := ((hB (L u)).hasFDerivAt.comp u L.hasFDerivAt).clm_apply P.hasFDerivAt + have hR := (Q.hasFDerivAt.comp u (hV u).hasFDerivAt).add + (M.hasFDerivAt.comp u (hN u).hasFDerivAt) + have he' : (fun y => B (L y) (P y)) = (fun y => Q (V y) + M (N y)) := funext he + simp only [Function.comp_def] at hL hR + rw [he'] at hL + have hh := congrArg (fun T : G →L[ℝ] F => T w) (hL.unique hR) + simpa only [add_apply, ContinuousLinearMap.comp_apply, + ContinuousLinearMap.flip_apply] using hh +lemma lowered_remainder (M : H →L[ℝ] F) (a b c : F) (r e : H) + (h : a + b = c + M r) (hb : b = M e) : a = c + M (r-e) := by + rw [hb] at h + rw [map_sub] + exact (eq_sub_iff_add_eq.mpr h).trans (by abel) + +end FixedBootstrapCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/BoundedBilinearCompletion.lean b/lean/OAI/Geometry/PrescribedPotential/BoundedBilinearCompletion.lean new file mode 100644 index 0000000000000000000000000000000000000000..a8beafc44358647e08840506bbf1da98e57996ef --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/BoundedBilinearCompletion.lean @@ -0,0 +1,62 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CircleRadialCalculus +import OAI.Geometry.PrescribedPotential.GlobalExtension +import OAI.Geometry.PrescribedPotential.KaehlerClosedDerivatives + +namespace OAI + +/-! Bounded Bilinear Completion. -/ + +section + + + +noncomputable section +namespace BoundedBilinearCompletion +variable {V H : Type*} [AddCommGroup V] [Module ℝ V] + [NormedAddCommGroup H] [NormedSpace ℝ H] [CompleteSpace H] + (e : V →ₗ[ℝ] H) (he : DenseRange e) (B : V →ₗ[ℝ] V →ₗ[ℝ] V) + {C : ℝ} (hC : 0 ≤ C) (hB : ∀ u v, ‖e (B u v)‖ ≤ C*(‖e u‖*‖e v‖)) + +def right (u : V) : H →L[ℝ] H := (e.comp (B u)).extendOfNorm e + +include he hB in +lemma right_eq (u v : V) : right e B u (e v) = e (B u v) := + LinearMap.extendOfNorm_eq he ⟨C*‖e u‖, fun v => by simpa only [mul_assoc, LinearMap.comp_apply] using hB u v⟩ v + +include he hC hB in +lemma right_bound (u : V) : ‖right e B u‖ ≤ C*‖e u‖ := + LinearMap.opNorm_extendOfNorm_le he (mul_nonneg hC (norm_nonneg _)) + (fun v => by simpa only [mul_assoc, LinearMap.comp_apply] using hB u v) + +def rightLinear : V →ₗ[ℝ] (H →L[ℝ] H) where + toFun := right e B + map_add' u v := by + apply DFunLike.coe_injective + apply he.equalizer (by fun_prop) (by fun_prop) + funext w + simp only [Function.comp_apply, add_apply, right_eq e he B hB, + map_add, LinearMap.add_apply] + map_smul' c u := by + apply DFunLike.coe_injective + apply he.equalizer (by fun_prop) (by fun_prop) + funext w + simp only [Function.comp_apply, smul_apply, right_eq e he B hB, + map_smul, LinearMap.smul_apply, RingHom.id_apply] + +def extend : H →L[ℝ] H →L[ℝ] H := (rightLinear e he B hB).extendOfNorm e + +include hC in +lemma extend_eq (u v : V) : extend e he B hB (e u) (e v) = e (B u v) := by + rw [extend, LinearMap.extendOfNorm_eq he ⟨C, fun u => right_bound e he B hC hB u⟩] + exact right_eq e he B hB u v + +include hC in +lemma extend_bound : ‖extend e he B hB‖ ≤ C := + LinearMap.opNorm_extendOfNorm_le he hC (fun u => right_bound e he B hC hB u) +end BoundedBilinearCompletion + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/BoundedNormalFrames.lean b/lean/OAI/Geometry/PrescribedPotential/BoundedNormalFrames.lean new file mode 100644 index 0000000000000000000000000000000000000000..300f3673f6cd40750f80812ac98d6c12f077ad56 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/BoundedNormalFrames.lean @@ -0,0 +1,108 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.FrameCompactBounds + +namespace OAI + +/-! Bounded Normal Frames. -/ + +section + +noncomputable section +open Set Metric Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +variable {n : ℕ} + +lemma frameGram_compact_lower {X : Type*} [TopologicalSpace X] + {L : Set X} (hL : IsCompact L) (G : X → Matrix (Fin n) (Fin n) ℂ) + (hG : ContinuousOn G L) (hp : ∀ x ∈ L, (G x).PosDef) : + ∃ δ : ℝ, 0 < δ ∧ ∀ x ∈ L, ∀ B, δ*‖B‖^2 ≤ frameGram (G x) B := by + apply compact_homogeneous_positive hL (fun x B => frameGram (G x) B) + · apply continuousOn_trace_re + exact ((continuousOn_matrix_star continuous_snd.continuousOn).mul + (hG.comp continuous_fst.continuousOn (fun _ h => h.1))).mul continuous_snd.continuousOn + · exact fun x hx B hB => frameGram_pos (hp x hx) hB + · exact fun x _ r B => frameGram_smul (G x) B r + +lemma unnormalize_matrix {C D M : Matrix (Fin n) (Fin n) ℂ} + (hCD : C*D = 1) (hM : Cᴴ*M*C = 1) : M = Dᴴ*D := by + calc + M = (C*D)ᴴ*M*(C*D) := by rw [hCD]; simp + _ = Dᴴ*(Cᴴ*M*C)*D := by simp only [Matrix.conjTranspose_mul,mul_assoc] + _ = Dᴴ*D := by rw [hM,mul_one] + +lemma normalizing_frame_gram_le {C G M : Matrix (Fin n) (Fin n) ℂ} + {R : ℝ} (h : ((R:ℂ) • M-G).PosSemidef) (hNorm : Cᴴ*M*C = 1) : + frameGram G C ≤ R*n := by + have hh := (Complex.nonneg_iff.mp (h.conjTranspose_mul_mul_same C).trace_nonneg).1 + rw [mul_sub,sub_mul,Matrix.mul_smul,Matrix.smul_mul,hNorm,Matrix.trace_sub,Matrix.trace_smul] at hh + simpa only [Complex.sub_re,smul_eq_mul,Complex.mul_re,Complex.ofReal_re,Complex.ofReal_im, + zero_mul,sub_zero,Matrix.trace_one,Fintype.card_fin,Complex.natCast_re,sub_nonneg,frameGram] using hh + +lemma metric_trace_le {G M : Matrix (Fin n) (Fin n) ℂ} {K : ℝ} + (h : ((K:ℂ) • G-M).PosSemidef) : M.trace.re ≤ K*G.trace.re := by + have hh := (Complex.nonneg_iff.mp h.trace_nonneg).1 + rw [Matrix.trace_sub,Matrix.trace_smul] at hh + simpa only [Complex.sub_re,smul_eq_mul,Complex.mul_re,Complex.ofReal_re,Complex.ofReal_im, + zero_mul,sub_zero,sub_nonneg] using hh + +lemma compact_normalizing_frames {X : Type*} [TopologicalSpace X] + {L : Set X} (hL : IsCompact L) (G : X → Matrix (Fin n) (Fin n) ℂ) + (hG : ContinuousOn G L) (hp : ∀ x ∈ L, (G x).PosDef) + {R K : ℝ} (hR : 0 ≤ R) (hK : 0 ≤ K) : + ∃ B : ℝ, 0 ≤ B ∧ ∀ x ∈ L, ∀ M C D : Matrix (Fin n) (Fin n) ℂ, + ((R:ℂ) • M-G x).PosSemidef → ((K:ℂ) • G x-M).PosSemidef → + C*D = 1 → Cᴴ*M*C = 1 → ‖C‖ ≤ B ∧ ‖D‖ ≤ B := by + obtain ⟨a,ha,hGa⟩ := frameGram_compact_lower hL G hG hp + obtain ⟨b,hb,hIb⟩ := frameGram_compact_lower (n := n) + (X := Unit) (L := univ) isCompact_univ (fun _ => 1) continuousOn_const (fun _ _ => Matrix.PosDef.one) + obtain ⟨T,hT⟩ := hL.exists_bound_of_continuousOn (continuousOn_trace_re hG) + let Tc := max T 0 + let B := max (R*n/a+1) (K*Tc/b+1) + have htc : 0 ≤ Tc := le_max_right _ _ + refine ⟨B,?_,?_⟩ + · exact (by dsimp [B]; exact (by positivity : 0 ≤ R*n/a+1).trans (le_max_left _ _)) + intro x hx M C D hlow hupp hCD hNorm + have htr : (G x).trace.re ≤ Tc := by + exact (le_abs_self _).trans ((hT x hx).trans (le_max_left _ _)) + have hc := (hGa x hx C).trans (normalizing_frame_gram_le hlow hNorm) + have hc2 : ‖C‖^2 ≤ R*n/a := (le_div_iff₀ ha).mpr (by simpa only [mul_comm] using hc) + have hc1 : ‖C‖ ≤ R*n/a+1 := by nlinarith [sq_nonneg (‖C‖-1)] + have hd := hIb () (mem_univ _) D + have hDgram : frameGram 1 D = M.trace.re := by + rw [unnormalize_matrix hCD hNorm] + simp only [frameGram,mul_one] + rw [hDgram] at hd + have hd2 : ‖D‖^2 ≤ K*Tc/b := (le_div_iff₀ hb).mpr (by + have hm := (metric_trace_le hupp).trans (mul_le_mul_of_nonneg_left htr hK) + exact (by simpa only [mul_comm] using hd.trans hm)) + have hd1 : ‖D‖ ≤ K*Tc/b+1 := by nlinarith [sq_nonneg (‖D‖-1)] + exact ⟨hc1.trans (le_max_left _ _),hd1.trans (le_max_right _ _)⟩ + +def boundedFramePairs (B : ℝ) : Set (Matrix (Fin n) (Fin n) ℂ × Matrix (Fin n) (Fin n) ℂ) := + {p | ‖p.1‖ ≤ B ∧ ‖p.2‖ ≤ B ∧ p.1*p.2 = 1 ∧ p.2*p.1 = 1} + +lemma boundedFramePairs_compact (B : ℝ) : IsCompact (boundedFramePairs (n := n) B) := by + have he : boundedFramePairs (n := n) B = + (closedBall (0:Matrix (Fin n) (Fin n) ℂ) B ×ˢ closedBall 0 B) ∩ + {p | p.1*p.2 = 1 ∧ p.2*p.1 = 1} := by + ext p + simp only [boundedFramePairs,mem_ofPred_eq,mem_inter_iff,mem_prod,mem_closedBall,dist_zero_right] + tauto + rw [he] + apply (isCompact_closedBall _ _ |>.prod (isCompact_closedBall _ _)).inter_right + have hc : Continuous (fun p : Matrix (Fin n) (Fin n) ℂ × Matrix (Fin n) (Fin n) ℂ => p.1*p.2) := + continuous_fst.matrix_mul continuous_snd + have hd : Continuous (fun p : Matrix (Fin n) (Fin n) ℂ × Matrix (Fin n) (Fin n) ℂ => p.2*p.1) := + continuous_snd.matrix_mul continuous_fst + exact (isClosed_eq hc continuous_const).inter (isClosed_eq hd continuous_const) + +lemma boundedFramePairs_units {B : ℝ} {p : Matrix (Fin n) (Fin n) ℂ × Matrix (Fin n) (Fin n) ℂ} + (hp : p ∈ boundedFramePairs B) : IsUnit p.1 ∧ IsUnit p.2 := by + exact ⟨⟨⟨p.1,p.2,hp.2.2.1,hp.2.2.2⟩,rfl⟩,⟨⟨p.2,p.1,hp.2.2.2,hp.2.2.1⟩,rfl⟩⟩ +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/BoundedPathContinuation.lean b/lean/OAI/Geometry/PrescribedPotential/BoundedPathContinuation.lean new file mode 100644 index 0000000000000000000000000000000000000000..3a53d7a6a45c83d2b29418925f68c223cda98cc7 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/BoundedPathContinuation.lean @@ -0,0 +1,87 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.NormalizedPathCompactness +import OAI.Geometry.PrescribedPotential.SmoothPathOpenness + +namespace OAI + +/-! Bounded Path Continuation. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + + + +def PathSobolevBounds (h : SemipositiveAnticanonicalMetric A) (x₀ : X) : Prop := + ∀ k : ℕ, ∃ C : ℝ, ∀ (t b : ℝ) (φ : SmoothRealFunction A), + t ∈ Icc 0 1 → φ.value x₀ = 0 → SolvesVolumePath g h t φ b → + ‖D.localizers.embed (((2*k : ℕ) : ℝ)+2) (Smooth.ofReal φ)‖ ≤ C + +omit [ConnectedSpace X] in +lemma smoothVolumePathTimes_relatively_closed (h : SemipositiveAnticanonicalMetric A) + (x₀ : X) (hbound : D.PathSobolevBounds h x₀) : + IsClosed ((Subtype.val : Icc (0:ℝ) 1 → ℝ) ⁻¹' SmoothVolumePathTimes g h x₀) := by + apply IsSeqClosed.isClosed + intro t tLim ht htLim + choose φ b hn hs using ht + have hB : ∀ k : ℕ, ∃ C : ℝ, ∀ n : ℕ, + ‖D.localizers.embed (((2*k : ℕ) : ℝ)+2) (RealSmooth.ofReal (φ n)).val‖ ≤ C := by + intro k + obtain ⟨C,hC⟩ := hbound k + exact ⟨C,fun n => hC (t n).val (b n) (φ n) (t n).property (hn n) (hs n)⟩ + have ht' : Tendsto (fun n => (t n).val) atTop (𝓝 tLim.val) := + (continuous_subtype_val.tendsto tLim).comp htLim + obtain ⟨fLim,bLim,r,hr,hb,hf,hnLim,hsLim⟩ := D.normalized_path_sequence_compact h x₀ + (fun n => (t n).val) b tLim.val ht' (fun n => (t n).property) + (fun n => RealSmooth.ofReal (φ n)) (by simpa only [RealSmooth.source_ofReal] using hn) + (by simpa only [RealSmooth.source_ofReal] using hs) hB + exact ⟨fLim.source,bLim,hnLim,hsLim⟩ + + + +theorem smoothVolumePathTimes_full_of_bounds (h : SemipositiveAnticanonicalMetric A) + (x₀ : X) (hbound : D.PathSobolevBounds h x₀) : + Icc 0 1 ⊆ SmoothVolumePathTimes g h x₀ := by + let S : Set (Icc (0:ℝ) 1) := Subtype.val ⁻¹' SmoothVolumePathTimes g h x₀ + have hc : IsClopen S := ⟨D.smoothVolumePathTimes_relatively_closed h x₀ hbound, + (smoothVolumePathTimes_isOpen g h x₀).preimage continuous_subtype_val⟩ + have hn : S.Nonempty := ⟨⟨0,by constructor <;> norm_num⟩, + smoothVolumePathTimes_zero g h x₀⟩ + have he := hc.eq_univ hn + intro t ht + have hh : (⟨t,ht⟩ : Icc (0:ℝ) 1) ∈ S := by rw [he]; trivial + exact hh + +end GluingData +end GlobalElliptic + +namespace Anticanonical.SourceSmooth +open GlobalElliptic +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] + + + +theorem prescribedPotential_of_path_bounds (P : A.ProjectiveEmbedding) + (h : SemipositiveAnticanonicalMetric A) (D : GluingData (projectiveBackground P) ι) + (x₀ : X) (hbound : D.PathSobolevBounds h x₀) : HasPrescribedVolumePotential P h := by + obtain ⟨φ,b,_,hs⟩ := D.smoothVolumePathTimes_full_of_bounds h x₀ hbound + (by constructor <;> norm_num : (1:ℝ) ∈ Icc 0 1) + exact volumePath_one P h φ b hs + +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/BoundedPoisson.lean b/lean/OAI/Geometry/PrescribedPotential/BoundedPoisson.lean new file mode 100644 index 0000000000000000000000000000000000000000..49f9695d183790f140e1850edf4474f65539f26b --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/BoundedPoisson.lean @@ -0,0 +1,148 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.ConstantProjection +import OAI.Geometry.PrescribedPotential.PatchCutoffs +import OAI.Geometry.PrescribedPotential.NormalizedPoisson + +namespace OAI + +/-! Bounded Poisson. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical +namespace GlobalElliptic +namespace LinearNormalization +variable {H : Type*} [NormedAddCommGroup H] [NormedSpace ℝ H] + +def coefficient (C : ℂ →L[ℝ] H) (hC : Function.Injective C) (P : H →L[ℝ] H) + (hP : ∀ u, P u ∈ (C : ℂ →ₗ[ℝ] H).range) : H →L[ℝ] ℂ := by + let S := (C : ℂ →ₗ[ℝ] H).range + letI : FiniteDimensional ℝ S := LinearMap.finiteDimensional_range _ + let e : ℂ ≃ₗ[ℝ] S := LinearEquiv.ofInjective (C : ℂ →ₗ[ℝ] H) hC + let l : S →L[ℝ] ℂ := LinearMap.toContinuousLinearMap e.symm.toLinearMap + exact l ∘L P.codRestrict S hP + +lemma coefficient_spec (C : ℂ →L[ℝ] H) (hC : Function.Injective C) (P : H →L[ℝ] H) + (hP : ∀ u, P u ∈ (C : ℂ →ₗ[ℝ] H).range) (u : H) : + C (coefficient C hC P hP u) = P u := + LinearEquiv.ofInjective_symm_apply (C : ℂ →ₗ[ℝ] H) (h := hC) ⟨P u, hP u⟩ + +end LinearNormalization +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace Localizers +variable (D : Localizers A ι) + +def constantsOrder (s : ℝ) : ℂ →L[ℝ] D.Sobolev s := + LinearMap.toContinuousLinearMap ((D.embed s).comp Smooth.constLinear) + +omit [ConnectedSpace X] in +@[simp] lemma constantsOrder_apply (s : ℝ) (c : ℂ) : + D.constantsOrder s c = D.embed s (Smooth.const c) := rfl + +lemma constants_injective : Function.Injective D.constants := by + intro c e h + have hh := D.embed_injective 0 h + let x : X := Classical.arbitrary X + exact congrArg (fun u : Smooth A => u x) hh + +variable {D} + + +def ConstantProjection.coefficient (P : D.ConstantProjection) : D.Sobolev 0 →L[ℝ] ℂ := + LinearNormalization.coefficient D.constants D.constants_injective P.proj (by + intro u + obtain ⟨c, hc⟩ := P.value u + exact ⟨c, hc.symm⟩) + +lemma ConstantProjection.coefficient_spec (P : D.ConstantProjection) (u : D.Sobolev 0) : + D.constants (P.coefficient u) = P.proj u := + LinearNormalization.coefficient_spec _ _ _ _ u + +lemma ConstantProjection.coefficient_constants (P : D.ConstantProjection) (c : ℂ) : + P.coefficient (D.constants c) = c := by + apply D.constants_injective + rw [P.coefficient_spec] + exact P.fixed c + +end Localizers +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +lemma fredholm_injective (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) : + Function.Injective (1 - D.fredholmOperator m hm he P : + D.localizers.Sobolev 0 →L[ℝ] D.localizers.Sobolev 0) := by + intro u v huv + have hz : (1 - D.fredholmOperator m hm he P) (u-v) = 0 := by + rw [map_sub, huv, sub_self] + have hh : D.fredholmOperator m hm he P (u-v) = u-v := by + exact (sub_eq_zero.mp hz).symm + exact sub_eq_zero.mp (D.fredholm_kernel m hm he P (u-v) hh) + +def fredholmEquiv (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) : + D.localizers.Sobolev 0 ≃L[ℝ] D.localizers.Sobolev 0 := + ContinuousLinearEquiv.ofBijective (1 - D.fredholmOperator m hm he P) + (LinearMap.ker_eq_bot.mpr (D.fredholm_injective m hm he P)) + (LinearMap.range_eq_top.mpr (D.fredholm_surjective m hm he P)) + +@[simp] lemma fredholmEquiv_apply (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) (u : D.localizers.Sobolev 0) : + D.fredholmEquiv m hm he P u = + u - ((m^2 : ℝ) • D.resolventZero m hm he u - P.proj u) := rfl + +def poissonInput (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) : D.localizers.Sobolev 0 →L[ℝ] D.localizers.Sobolev 0 := + - (D.fredholmEquiv m hm he P).symm.toContinuousLinearMap + +lemma poissonInput_equation (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) (f : D.localizers.Sobolev 0) : + D.poissonInput m hm he P f = -f - P.proj (D.poissonInput m hm he P f) + + (m^2 : ℝ) • D.resolventZero m hm he (D.poissonInput m hm he P f) := by + have h : D.fredholmEquiv m hm he P (D.poissonInput m hm he P f) = -f := by + change D.fredholmEquiv m hm he P (- (D.fredholmEquiv m hm he P).symm f) = -f + rw [map_neg, ContinuousLinearEquiv.apply_symm_apply] + rw [D.fredholmEquiv_apply] at h + calc + _ = -f + ((m^2 : ℝ) • D.resolventZero m hm he (D.poissonInput m hm he P f) - + P.proj (D.poissonInput m hm he P f)) := sub_eq_iff_eq_add.mp h + _ = _ := by abel + +def poissonRaw (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) : D.localizers.Sobolev 0 →L[ℝ] D.localizers.Sobolev 2 := + D.completedResolvent m hm he ∘L D.poissonInput m hm he P + +def poissonResidue (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) : D.localizers.Sobolev 0 →L[ℝ] ℂ := + P.coefficient ∘L D.poissonInput m hm he P + +lemma poissonRaw_equation (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) (f : D.localizers.Sobolev 0) : + D.completedL (D.poissonRaw m hm he P f) = f + D.localizers.constants (D.poissonResidue m hm he P f) := by + have h := D.completedResolvent_equation m hm he (D.poissonInput m hm he P f) + have hw := D.poissonInput_equation m hm he P f + change (m^2 : ℝ) • D.resolventZero m hm he (D.poissonInput m hm he P f) - + D.completedL (D.poissonRaw m hm he P f) = D.poissonInput m hm he P f at h + change _ = f + D.localizers.constants (P.coefficient (D.poissonInput m hm he P f)) + rw [P.coefficient_spec] + have hh := h.trans hw + apply sub_right_inj.mp + calc + (m^2 : ℝ) • D.resolventZero m hm he (D.poissonInput m hm he P f) - + D.completedL (D.poissonRaw m hm he P f) = _ := hh + _ = (m^2 : ℝ) • D.resolventZero m hm he (D.poissonInput m hm he P f) - + (f + P.proj (D.poissonInput m hm he P f)) := by abel + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CalabiBochner.lean b/lean/OAI/Geometry/PrescribedPotential/CalabiBochner.lean new file mode 100644 index 0000000000000000000000000000000000000000..ac0e96132d6e7ade24637dc8737b94c441836b61 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CalabiBochner.lean @@ -0,0 +1,163 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CalabiCovariant +import OAI.Geometry.PrescribedPotential.CalabiPairCalculus + +namespace OAI + +/-! Calabi Bochner. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +variable {n : ℕ} + +lemma tensorPairAt_sum_left {α : Type*} (s : Finset α) + (P M : Matrix (Fin n) (Fin n) ℂ) (T : α → ConnectionTensor n) (U : ConnectionTensor n) : + tensorPairAt P M (fun i => ∑ a ∈ s, T a i) U = ∑ a ∈ s, tensorPairAt P M (T a) U := by + simp only [tensorPairAt,Matrix.sum_mul,Matrix.trace_sum,Finset.mul_sum] + calc + _ = ∑ i, ∑ a ∈ s, ∑ j, P i j*(T a i*P*(U j)ᴴ*M).trace := by + apply Finset.sum_congr rfl + intro i _ + rw [Finset.sum_comm] + _ = _ := Finset.sum_comm + +lemma tensorPairAt_sum_right {α : Type*} (s : Finset α) + (P M : Matrix (Fin n) (Fin n) ℂ) (T : ConnectionTensor n) (U : α → ConnectionTensor n) : + tensorPairAt P M T (fun i => ∑ a ∈ s, U a i) = ∑ a ∈ s, tensorPairAt P M T (U a) := by + simp only [tensorPairAt,Matrix.conjTranspose_sum,Matrix.sum_mul, + Matrix.trace_sum,Finset.mul_sum] + calc + _ = ∑ i, ∑ a ∈ s, ∑ j, P i j*(T i*P*(U a j)ᴴ*M).trace := by + apply Finset.sum_congr rfl + intro i _ + rw [Finset.sum_comm] + _ = _ := Finset.sum_comm + +namespace LocalKaehlerField +variable (K : LocalKaehlerField n) + +lemma covHol_bar_commute {T : Fin n → V n → Matrix (Fin n) (Fin n) ℂ} + (hT : ∀ i, ContDiffOn ℝ ∞ (T i) K.domain) {z : V n} (hz : z ∈ K.domain) (k i : Fin n) : + K.covHol (fun j => mderiv Complex.I (e k) (T j)) k i z = + mderiv Complex.I (e k) (K.covHol T k i) z - K.curvature k k z*T i z + + T i z*K.curvature k k z + ∑ q, K.curvature k k z q i • T q z := by + have hn := K.isOpen.mem_nhds hz + have ht (j) := (hT j).contDiffAt hn + have hg := K.connection_smooth k |>.contDiffAt hn + have hs := ContDiffAt.sum (fun q (_ : q ∈ (Finset.univ : Finset (Fin n))) => + matrix_smooth_smul (entry_smooth hg q i) (ht q)) + unfold covHol + rw [mderiv_sub (((mderiv_smooth (ht i) _ _).add (matrix_smooth_mul hg (ht i))).sub + (matrix_smooth_mul (ht i) hg)) hs, + mderiv_sub ((mderiv_smooth (ht i) _ _).add (matrix_smooth_mul hg (ht i))) + (matrix_smooth_mul (ht i) hg), + mderiv_add (mderiv_smooth (ht i) _ _) (matrix_smooth_mul hg (ht i)), + mderiv_mul hg (ht i),mderiv_mul (ht i) hg, + mderiv_sum Finset.univ (fun q _ => matrix_smooth_smul (entry_smooth hg q i) (ht q))] + simp only [mderiv_smul (entry_smooth hg _ i) (ht _),Finset.sum_add_distrib, + mderiv_comm (ht i) Complex.I (-Complex.I) (e k) (e k)] + change _ = _ - (K.curvature k k z*T i z) + _ + _ + unfold curvature + have he : (∑ q, wderiv Complex.I (e k) (fun y => K.connection k y q i) z • T q z) = + ∑ q, mderiv Complex.I (e k) (K.connection k) z q i • T q z := rfl + rw [he] + abel + +lemma calabi_curvature_divergence_at_one {z : V n} (hz : z ∈ K.domain) + (hM : K.matrix z = 1) (i : Fin n) : + (∑ k, K.covHol (K.curvature k) k i z) = + mderiv (-Complex.I) (e i) K.ricciHessian z - K.ricciHessian z*K.connection i z := by + have he (k : Fin n) : K.covHol (K.curvature k) k i z = + mderiv Complex.I (e k) (K.covHol K.connection k i) z - K.curvature k k z*K.connection i z + + K.connection i z*K.curvature k k z + ∑ q, K.curvature k k z q i • K.connection q z := + K.covHol_bar_commute (T := K.connection) K.connection_smooth hz k i + simp_rw [he] + simp only [Finset.sum_add_distrib,Finset.sum_sub_distrib,← Matrix.sum_mul,← Matrix.mul_sum] + rw [K.calabi_connection_laplacian_at_one hz hM i,K.curvature_contraction_at_one hz hM] + have hs : (∑ k, ∑ q, K.curvature k k z q i • K.connection q z) = + ∑ q, K.ricciHessian z q i • K.connection q z := by + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro q _ + rw [← Finset.sum_smul] + congr 1 + simpa only [Matrix.sum_apply] using congrArg + (fun A : Matrix (Fin n) (Fin n) ℂ => A q i) (K.curvature_contraction_at_one hz hM) + rw [hs] + abel + +def calabiNorm (z : V n) : ℝ := (K.tensorPair K.connection K.connection z).re + +lemma calabiNorm_smooth : ContDiffOn ℝ ∞ K.calabiNorm K.domain := + Complex.reCLM.contDiff.comp_contDiffOn (K.tensorPair_smoothOn K.connection_smooth K.connection_smooth) + +lemma calabiNorm_complex {z : V n} (hz : z ∈ K.domain) : + (K.calabiNorm z : ℂ) = K.tensorPair K.connection K.connection z := by + apply Complex.ext + · rfl + · exact (tensorPairAt_self_real (K.positive z hz).isHermitian.inv + (K.positive z hz).isHermitian _).symm + +lemma calabiNorm_second {z : V n} (hz : z ∈ K.domain) (k : Fin n) : + dzbar (e k) (dz (e k) (fun y => (K.calabiNorm y : ℂ))) z = + K.tensorPair (fun i => mderiv Complex.I (e k) (K.covHol K.connection k i)) K.connection z + + K.tensorPair (K.covHol K.connection k) (K.covHol K.connection k) z + + K.tensorPair (K.curvature k) (K.curvature k) z + + K.tensorPair K.connection (K.covHol (K.curvature k) k) z := by + have hn := K.isOpen.mem_nhds hz + have hc : (fun y => (K.calabiNorm y : ℂ)) =ᶠ[𝓝 z] K.tensorPair K.connection K.connection := by + filter_upwards [hn] with y hy using K.calabiNorm_complex hy + have hd : dz (e k) (fun y => (K.calabiNorm y : ℂ)) =ᶠ[𝓝 z] + (fun y => K.tensorPair (K.covHol K.connection k) K.connection y + + K.tensorPair K.connection (K.curvature k) y) := by + filter_upwards [hn] with y hy + have he : (fun y => (K.calabiNorm y : ℂ)) =ᶠ[𝓝 y] K.tensorPair K.connection K.connection := by + filter_upwards [K.isOpen.mem_nhds hy] with x hx using K.calabiNorm_complex hx + change wderiv (-Complex.I) (e k) _ y = _ + rw [wderiv_congr he] + exact K.tensorPair_hol K.connection_smooth K.connection_smooth hy k + change wderiv Complex.I (e k) _ z = _ + rw [wderiv_congr hd,wderiv_add + ((K.tensorPair_smoothOn (T := K.covHol K.connection k) (U := K.connection) + (K.covHol_smooth (T := K.connection) K.connection_smooth k) K.connection_smooth).contDiffAt hn + |>.differentiableAt (by simp)) + ((K.tensorPair_smoothOn (T := K.connection) (U := K.curvature k) K.connection_smooth (K.curvature_smooth k)).contDiffAt hn + |>.differentiableAt (by simp))] + change dzbar (e k) _ z + dzbar (e k) _ z = _ + rw [K.tensorPair_bar (T := K.covHol K.connection k) (U := K.connection) + (K.covHol_smooth (T := K.connection) K.connection_smooth k) K.connection_smooth hz, + K.tensorPair_bar (T := K.connection) (U := K.curvature k) K.connection_smooth (K.curvature_smooth k) hz] + exact (add_assoc _ _ _).symm + +lemma calabi_bochner_at_one {z : V n} (hz : z ∈ K.domain) (hM : K.matrix z = 1) : + (PotentialKaehler.potentialMatrix K.calabiNorm z).trace = + (∑ k, tensorPairAt 1 1 (fun i => K.covHol K.connection k i z) + (fun i => K.covHol K.connection k i z)) + + (∑ k, tensorPairAt 1 1 (fun i => K.curvature k i z) (fun i => K.curvature k i z)) + + tensorPairAt 1 1 (fun i => mderiv (-Complex.I) (e i) K.ricciHessian z - + K.connection i z*K.ricciHessian z - ∑ q, K.ricciHessian z q i • K.connection q z) + (fun i => K.connection i z) + + tensorPairAt 1 1 (fun i => K.connection i z) + (fun i => mderiv (-Complex.I) (e i) K.ricciHessian z - K.ricciHessian z*K.connection i z) := by + change (∑ k, PotentialKaehler.potentialMatrix K.calabiNorm z k k) = _ + simp_rw [potentialMatrix_eq_dzbar_dz (K.calabiNorm_smooth.contDiffAt (K.isOpen.mem_nhds hz))] + change (∑ k, dzbar (e k) (dz (e k) (fun y => (K.calabiNorm y : ℂ))) z) = _ + simp_rw [K.calabiNorm_second hz] + simp only [tensorPair,hM,inv_one,Finset.sum_add_distrib] + rw [← tensorPairAt_sum_left,← tensorPairAt_sum_right] + simp_rw [K.calabi_connection_laplacian_at_one hz hM,K.calabi_curvature_divergence_at_one hz hM] + abel + +end LocalKaehlerField +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CalabiConnection.lean b/lean/OAI/Geometry/PrescribedPotential/CalabiConnection.lean new file mode 100644 index 0000000000000000000000000000000000000000..69fcc4333f4510018a66e22f8a182c0e48650cfb --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CalabiConnection.lean @@ -0,0 +1,107 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.KaehlerSecondDerivatives + +namespace OAI + +/-! Calabi Connection. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus + +structure LocalKaehlerField (n : ℕ) where + domain : Set (V n) + isOpen : IsOpen domain + matrix : V n → Matrix (Fin n) (Fin n) ℂ + smooth : ContDiffOn ℝ ∞ matrix domain + positive : ∀ z ∈ domain, (matrix z).PosDef + closed : ∀ y ∈ domain, ∀ u v w : V n, + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (matrix q) v w) y u + + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (matrix q) w u) y v + + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (matrix q) u v) y w = 0 + +namespace LocalKaehlerField +variable {n : ℕ} (K : LocalKaehlerField n) + +def connection (j : Fin n) (z : V n) : Matrix (Fin n) (Fin n) ℂ := + (K.matrix z)⁻¹ * mderiv (-Complex.I) (e j) K.matrix z + +def curvature (i j : Fin n) : V n → Matrix (Fin n) (Fin n) ℂ := + mderiv Complex.I (e i) (K.connection j) + +def logDet : V n → ℝ := fun y => Real.log (K.matrix y).det.re + +def ricciHessian (z : V n) : Matrix (Fin n) (Fin n) ℂ := + PotentialKaehler.potentialMatrix K.logDet z + +lemma inverse_smooth : ContDiffOn ℝ ∞ (fun y => (K.matrix y)⁻¹) K.domain := + MatrixSmoothGeneral.inverse K.smooth (fun y hy => ne_of_gt (K.positive y hy).det_pos) + +lemma connection_smooth (j : Fin n) : ContDiffOn ℝ ∞ (K.connection j) K.domain := by + apply K.isOpen.contDiffOn_iff.mpr + intro z hz + exact matrix_smooth_mul (K.inverse_smooth.contDiffAt (K.isOpen.mem_nhds hz)) + (mderiv_smooth (K.smooth.contDiffAt (K.isOpen.mem_nhds hz)) _ _) + +lemma logDet_smooth : ContDiffOn ℝ ∞ K.logDet K.domain := by + apply K.isOpen.contDiffOn_iff.mpr + intro z hz + exact (Complex.reCLM.contDiff.contDiffAt.comp z + (determinant_smooth.contDiffAt.comp z (K.smooth.contDiffAt (K.isOpen.mem_nhds hz)))).log + (ne_of_gt (Complex.pos_iff.mp (K.positive z hz).det_pos).1) + +lemma connection_symmetric {z : V n} (hz : z ∈ K.domain) (i j k : Fin n) : + K.connection i z k j = K.connection j z k i := by + unfold connection + simp only [Matrix.mul_apply] + apply Finset.sum_congr rfl + intro a _ + congr 1 + exact closed_dz_symmetry K.isOpen K.smooth (fun y hy => (K.positive y hy).isHermitian) + K.closed hz a j i + +lemma curvature_formula {z : V n} (hz : z ∈ K.domain) (i j : Fin n) : + K.curvature i j z = (K.matrix z)⁻¹ * + (mderiv Complex.I (e i) (mderiv (-Complex.I) (e j) K.matrix) z - + mderiv Complex.I (e i) K.matrix z * (K.matrix z)⁻¹ * + mderiv (-Complex.I) (e j) K.matrix z) := by + have hs := K.smooth.contDiffAt (K.isOpen.mem_nhds hz) + unfold curvature connection + rw [mderiv_mul (K.inverse_smooth.contDiffAt (K.isOpen.mem_nhds hz)) + (mderiv_smooth hs _ _), mderiv_inverse K.isOpen K.smooth + (fun y hy => ne_of_gt (K.positive y hy).det_pos) hz] + noncomm_ring + +lemma ricciHessian_trace {z : V n} (hz : z ∈ K.domain) (i j : Fin n) : + K.ricciHessian z i j = (K.curvature i j z).trace := by + rw [ricciHessian,potentialMatrix_eq_dzbar_dz (K.logDet_smooth.contDiffAt (K.isOpen.mem_nhds hz))] + change dzbar (e i) (dz (e j) (fun y => (K.logDet y:ℂ))) z = _ + have he : dz (e j) (fun y => (K.logDet y:ℂ)) =ᶠ[𝓝 z] + (fun y => (K.connection j y).trace) := by + filter_upwards [K.isOpen.mem_nhds hz] with y hy + exact wderiv_logdet K.isOpen K.smooth K.positive hy _ _ + rw [show dzbar (e i) (dz (e j) (fun y => (K.logDet y:ℂ))) z = + dzbar (e i) (fun y => (K.connection j y).trace) z from wderiv_congr he _ _] + exact mderiv_trace (K.connection_smooth j |>.contDiffAt (K.isOpen.mem_nhds hz)) _ _ + +lemma curvature_contraction_at_one {z : V n} (hz : z ∈ K.domain) + (hM : K.matrix z = 1) : ∑ k, K.curvature k k z = K.ricciHessian z := by + have hc := ricci_cancellation_at_one K.isOpen K.smooth K.positive K.closed hz hM + have he : (∑ k, K.curvature k k z) = + (∑ k, mderiv Complex.I (e k) (mderiv (-Complex.I) (e k) K.matrix) z) - + ∑ k, mderiv Complex.I (e k) K.matrix z*mderiv (-Complex.I) (e k) K.matrix z := by + simp only [K.curvature_formula hz, hM,inv_one,one_mul,mul_one,Finset.sum_sub_distrib] + rw [he,hc,add_sub_cancel_right] + rfl +end LocalKaehlerField +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CalabiCoordinateBound.lean b/lean/OAI/Geometry/PrescribedPotential/CalabiCoordinateBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..05c97bba67acb7c7e650ccf5ebcf2ac60030d554 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CalabiCoordinateBound.lean @@ -0,0 +1,160 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CalabiCoordinateCoercivity +import OAI.Geometry.PrescribedPotential.CircleRadialCalculus +import OAI.Geometry.PrescribedPotential.HolomorphicDirection +import OAI.Geometry.PrescribedPotential.TracePositivity + +namespace OAI + +/-! Calabi Coordinate Bound. -/ + +section + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +variable {n : ℕ} + +lemma matrix_mul_elementwise_bound (M N : Matrix (Fin n) (Fin n) ℂ) : + ‖M*N‖ ≤ n*‖M‖*‖N‖ := by + apply (Matrix.norm_le_iff (by positivity)).mpr + intro i j + rw [Matrix.mul_apply] + calc + _ ≤ ∑ k, ‖M i k*N k j‖ := norm_sum_le _ _ + _ ≤ ∑ _k : Fin n, ‖M‖*‖N‖ := by + apply Finset.sum_le_sum + intro k _ + rw [norm_mul] + exact mul_le_mul (Matrix.norm_entry_le_entrywise_sup_norm M) + (Matrix.norm_entry_le_entrywise_sup_norm N) (norm_nonneg _) (norm_nonneg _) + _ = _ := by simp [mul_assoc] + +lemma hol_matrix_stencil_bound (v : V n) (T : ConnectionTensor n) : + ‖∑ i, v i • T i‖ ≤ n*‖v‖*‖T‖ := by + calc + _ ≤ ∑ i, ‖v i • T i‖ := norm_sum_le _ _ + _ ≤ ∑ _i : Fin n, ‖v‖*‖T‖ := by + apply Finset.sum_le_sum + intro i _ + rw [norm_smul] + exact mul_le_mul (norm_le_pi_norm v i) (norm_le_pi_norm T i) (norm_nonneg _) (norm_nonneg _) + _ = _ := by simp [mul_assoc] + +namespace LocalKaehlerField +variable (K : LocalKaehlerField n) +lemma holDerivative_connection {z : V n} (hz : z ∈ K.domain) (i : Fin n) : + mderiv (-Complex.I) (e i) K.matrix z = K.matrix z*K.connection i z := by + rw [connection,← mul_assoc,Matrix.mul_nonsing_inv _ + (isUnit_iff_ne_zero.mpr (ne_of_gt (K.positive z hz).det_pos)),one_mul] + +lemma fderiv_eq_hol_add_star {z : V n} (hz : z ∈ K.domain) (v : V n) : + fderiv ℝ K.matrix z v = mderiv (-Complex.I) v K.matrix z + + (mderiv (-Complex.I) v K.matrix z)ᴴ := by + rw [← mderiv_bar_eq_conjTranspose K.isOpen K.smooth + (fun y hy => (K.positive y hy).isHermitian) hz v] + have hd := (K.smooth.contDiffAt (K.isOpen.mem_nhds hz)).differentiableAt (by simp) + ext i j + have he : fderiv ℝ K.matrix z v i j = fderiv ℝ (fun y => K.matrix y i j) z v := by + change fderiv ℝ (fun y a b => K.matrix y a b) z v i j = _ + rw [fderiv_pi (fun a => differentiableAt_pi.mp hd a)] + simp only [ContinuousLinearMap.pi_apply] + rw [fderiv_pi (fun b => differentiableAt_pi.mp (differentiableAt_pi.mp hd i) b)] + rfl + rw [he] + change _ = wderiv (-Complex.I) v (fun y => K.matrix y i j) z + + wderiv Complex.I v (fun y => K.matrix y i j) z + unfold wderiv + ring + +lemma matrix_fderiv_bound {z : V n} (hz : z ∈ K.domain) : + ‖fderiv ℝ (fun y i j => K.matrix y i j) z‖ ≤ 2*n^2*‖K.matrix z‖*‖fun i => K.connection i z‖ := by + apply ContinuousLinearMap.opNorm_le_bound _ (by positivity) + intro v + have he : fderiv ℝ (fun y i j => K.matrix y i j) z v = + (fun i j => (mderiv (-Complex.I) v K.matrix z + + (mderiv (-Complex.I) v K.matrix z)ᴴ) i j) := K.fderiv_eq_hol_add_star hz v + rw [he] + change ‖mderiv (-Complex.I) v K.matrix z + (mderiv (-Complex.I) v K.matrix z)ᴴ‖ ≤ _ + have ht : mderiv (-Complex.I) v K.matrix z = + K.matrix z*(∑ i, v i • K.connection i z) := by + rw [mderiv_hol_coordinates,Matrix.mul_sum] + apply Finset.sum_congr rfl + intro i _ + rw [K.holDerivative_connection hz,Matrix.mul_smul] + have hb := (matrix_mul_elementwise_bound (K.matrix z) (∑ i, v i • K.connection i z)).trans + (mul_le_mul_of_nonneg_left (hol_matrix_stencil_bound v (fun i => K.connection i z)) (by positivity)) + rw [← ht] at hb + calc + _ ≤ ‖mderiv (-Complex.I) v K.matrix z‖ + ‖(mderiv (-Complex.I) v K.matrix z)ᴴ‖ := norm_add_le _ _ + _ ≤ 2*(n*‖K.matrix z‖*(n*‖v‖*‖fun i => K.connection i z‖)) := by + rw [Matrix.norm_conjTranspose] + linarith + _ = _ := by ring +end LocalKaehlerField + + + +theorem calabi_coordinate_connection_uniform {X : Type*} [TopologicalSpace X] + {L : Set X} (hL : IsCompact L) (G : X → Matrix (Fin n) (Fin n) ℂ) + (hG : ContinuousOn G L) (hp : ∀ x ∈ L, (G x).PosDef) + {R H C : ℝ} (hR : 0 ≤ R) (hH : 0 ≤ H) (hC : 0 ≤ C) : + ∃ B : ℝ, 0 ≤ B ∧ ∀ x ∈ L, ∀ (K : LocalKaehlerField n) z, z ∈ K.domain → + ((R:ℂ) • K.matrix z-G x).PosSemidef → ((H:ℂ) • G x-K.matrix z).PosSemidef → + K.calabiNorm z ≤ C → ‖K.matrix z‖ ≤ B ∧ ‖fun i => K.connection i z‖ ≤ B := by + obtain ⟨b,hb,hframe⟩ := compact_normalizing_frames hL G hG hp hR hH + obtain ⟨δ,hδ,hcoercive⟩ := boundedFrame_tensor_coercivity (n := n) b + let M := (n:ℝ)*b^2 + let T := C/δ+1 + let B := max M T + have hM : 0 ≤ M := by dsimp [M]; positivity + have hT : 0 ≤ T := by dsimp [T]; positivity + refine ⟨B,hM.trans (le_max_left _ _),?_⟩ + intro x hx K z hz hlow hupp hcal + obtain ⟨F,hF,hN⟩ := whitening (K.matrix z) (K.positive z hz) + have hFI : F*F⁻¹=1 := Matrix.mul_nonsing_inv _ ((Matrix.isUnit_iff_isUnit_det _).mp hF) + have hIF : F⁻¹*F=1 := Matrix.nonsing_inv_mul _ ((Matrix.isUnit_iff_isUnit_det _).mp hF) + obtain ⟨hf,hfi⟩ := hframe x hx (K.matrix z) F F⁻¹ hlow hupp hFI hN + have hpair : (F,F⁻¹) ∈ boundedFramePairs b := ⟨hf,hfi,hFI,hIF⟩ + have hcoer : ∀ U : ConnectionTensor n, δ*‖U‖^2 ≤ tensorSquare (tensorTransport F F⁻¹ U) := + hcoercive (F,F⁻¹) hpair + have hc : δ*‖fun i => K.connection i z‖^2 ≤ C := + (connection_norm_bound_of_frame (K := K) (z := z) (C := F) (D := F⁻¹) + (δ := δ) hz hFI hIF hN hδ hcoer).trans hcal + have hconn : ‖fun i => K.connection i z‖ ≤ T := by + have hsq : ‖fun i => K.connection i z‖^2 ≤ C/δ := + (le_div_iff₀ hδ).mpr (by simpa only [mul_comm] using hc) + dsimp [T] + nlinarith only [hsq, sq_nonneg (‖fun i => K.connection i z‖-1)] + have hm : ‖K.matrix z‖ ≤ M := by + rw [unnormalize_matrix hFI hN] + have hh := matrix_mul_elementwise_bound (F⁻¹)ᴴ F⁻¹ + rw [Matrix.norm_conjTranspose] at hh + have hs := (sq_le_sq₀ (norm_nonneg _) hb).mpr hfi + dsimp [M] + nlinarith only [hh,hs,Nat.cast_nonneg (α := ℝ) n] + exact ⟨hm.trans (le_max_left _ _),hconn.trans (le_max_right _ _)⟩ + +theorem calabi_coordinate_C1_uniform {X : Type*} [TopologicalSpace X] + {L : Set X} (hL : IsCompact L) (G : X → Matrix (Fin n) (Fin n) ℂ) + (hG : ContinuousOn G L) (hp : ∀ x ∈ L, (G x).PosDef) + {R H C : ℝ} (hR : 0 ≤ R) (hH : 0 ≤ H) (hC : 0 ≤ C) : + ∃ B : ℝ, 0 ≤ B ∧ ∀ x ∈ L, ∀ (K : LocalKaehlerField n) z, z ∈ K.domain → + ((R:ℂ) • K.matrix z-G x).PosSemidef → ((H:ℂ) • G x-K.matrix z).PosSemidef → + K.calabiNorm z ≤ C → ‖K.matrix z‖ ≤ B ∧ + ‖fderiv ℝ (fun y i j => K.matrix y i j) z‖ ≤ B := by + obtain ⟨B,hB,hbound⟩ := calabi_coordinate_connection_uniform hL G hG hp hR hH hC + refine ⟨max B (2*n^2*B*B),hB.trans (le_max_left _ _),?_⟩ + intro x hx K z hz hl hu hs + obtain ⟨hm,hc⟩ := hbound x hx K z hz hl hu hs + refine ⟨hm.trans (le_max_left _ _),?_⟩ + exact (K.matrix_fderiv_bound hz).trans ((mul_le_mul + (mul_le_mul_of_nonneg_left hm (by positivity)) hc (norm_nonneg _) (by positivity)).trans + (le_max_right _ _)) +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CalabiCoordinateCoercivity.lean b/lean/OAI/Geometry/PrescribedPotential/CalabiCoordinateCoercivity.lean new file mode 100644 index 0000000000000000000000000000000000000000..0b925404e6c0597f9b4ccf81703310017af31915 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CalabiCoordinateCoercivity.lean @@ -0,0 +1,118 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.BoundedNormalFrames +import OAI.Geometry.PrescribedPotential.CalabiBochner +import OAI.Geometry.PrescribedPotential.CalabiConnection +import OAI.Geometry.PrescribedPotential.CalabiFrameAlgebra +import OAI.Geometry.PrescribedPotential.CalabiNormAlgebra + +namespace OAI + +/-! Calabi Coordinate Coercivity. -/ + +section + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +variable {n : ℕ} + +def tensorTransport (C D : Matrix (Fin n) (Fin n) ℂ) (T : ConnectionTensor n) : ConnectionTensor n := + fun i => D*(∑ p, C p i • T p)*C + +lemma tensorTransport_smul (C D : Matrix (Fin n) (Fin n) ℂ) (r : ℝ) (T : ConnectionTensor n) : + tensorTransport C D (r • T) = r • tensorTransport C D T := by + funext i + simp only [tensorTransport,Pi.smul_apply,smul_comm (_:ℂ) r,← Finset.smul_sum, + Matrix.mul_smul,Matrix.smul_mul] + +lemma tensorTransport_zero (C D : Matrix (Fin n) (Fin n) ℂ) : + tensorTransport C D (0 : ConnectionTensor n) = 0 := by + funext i + simp [tensorTransport] + +lemma tensorTransport_undo {C D : Matrix (Fin n) (Fin n) ℂ} + (hCD : C*D=1) (_hDC : D*C=1) (T : ConnectionTensor n) : + tensorTransport D C (tensorTransport C D T) = T := by + funext i + unfold tensorTransport + have he : (∑ p, D p i • (D*(∑ q, C q p • T q)*C)) = + D*(∑ q, (C*D) q i • T q)*C := by + calc + _ = ∑ p, D*(∑ q, (D p i*C q p) • T q)*C := by + apply Finset.sum_congr rfl + intro p _ + simp only [← smul_smul,← Finset.smul_sum,Matrix.mul_smul,Matrix.smul_mul] + _ = D*(∑ p, ∑ q, (D p i*C q p) • T q)*C := by + rw [Matrix.mul_sum,Matrix.sum_mul] + _ = _ := by + congr 2 + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro q _ + simp only [Matrix.mul_apply,Finset.sum_smul] + apply Finset.sum_congr rfl + intro p _ + rw [mul_comm] + + rw [he,hCD] + simp only [Matrix.one_apply,ite_smul,one_smul,zero_smul,Finset.sum_ite_eq',Finset.mem_univ,ite_true] + simp only [mul_assoc,hCD,mul_one] + rw [← mul_assoc,hCD,one_mul] + +lemma continuous_tensorTransport : Continuous + (fun q : (Matrix (Fin n) (Fin n) ℂ × Matrix (Fin n) (Fin n) ℂ) × ConnectionTensor n => + tensorTransport q.1.1 q.1.2 q.2) := by + apply continuous_pi + intro i + let P := (Matrix (Fin n) (Fin n) ℂ × Matrix (Fin n) (Fin n) ℂ) × ConnectionTensor n + have hC : Continuous (fun q : P => q.1.1) := continuous_fst.comp continuous_fst + have hD : Continuous (fun q : P => q.1.2) := continuous_snd.comp continuous_fst + have hT (p : Fin n) : Continuous (fun q : P => q.2 p) := (continuous_apply p).comp continuous_snd + have hc (p : Fin n) : Continuous (fun q : P => q.1.1 p i) := + (continuous_apply i).comp ((continuous_apply p).comp hC) + exact (hD.matrix_mul (continuous_finsetSum _ (fun p _ => (hc p).smul (hT p)))).matrix_mul hC + +lemma boundedFrame_tensor_coercivity (B : ℝ) : + ∃ δ : ℝ, 0 < δ ∧ ∀ p ∈ boundedFramePairs (n := n) B, ∀ T : ConnectionTensor n, + δ*‖T‖^2 ≤ tensorSquare (tensorTransport p.1 p.2 T) := by + apply compact_homogeneous_positive (boundedFramePairs_compact B) + (fun p T => tensorSquare (tensorTransport p.1 p.2 T)) + · exact (continuous_tensorSquare.comp continuous_tensorTransport).continuousOn + · intro p hp T hT + apply tensorSquare_pos + intro he + apply hT + rw [← tensorTransport_undo hp.2.2.1 hp.2.2.2 T,he,tensorTransport_zero] + · intro p _ r T + rw [tensorTransport_smul,tensorSquare_smul] + +lemma connection_norm_bound_of_frame {K : LocalKaehlerField n} {z : V n} + (_hz : z ∈ K.domain) {C D : Matrix (Fin n) (Fin n) ℂ} + (hCD : C*D=1) (hDC : D*C=1) (hN : Cᴴ*K.matrix z*C=1) + {δ : ℝ} (_hδ : 0 < δ) + (hc : ∀ T : ConnectionTensor n, δ*‖T‖^2 ≤ tensorSquare (tensorTransport C D T)) : + δ*‖fun i => K.connection i z‖^2 ≤ K.calabiNorm z := by + have hC : IsUnit C := ⟨⟨C,D,hCD,hDC⟩,rfl⟩ + have hi : C⁻¹=D := Matrix.inv_eq_right_inv hCD + have hI : C⁻¹*(K.matrix z)⁻¹*(Cᴴ)⁻¹=1 := by + rw [← Matrix.mul_inv_rev,← Matrix.mul_inv_rev,← mul_assoc,hN,inv_one] + have he := tensorPairAt_changeBasis C (K.matrix z)⁻¹ (K.matrix z) hC + (fun i => K.connection i z) (fun i => K.connection i z) + rw [hI,hN] at he + have ht : pullConnectionTensor C (fun i => K.connection i z) = + tensorTransport C D (fun i => K.connection i z) := by + unfold pullConnectionTensor tensorTransport + rw [hi] + rw [ht] at he + have hs : tensorSquare (tensorTransport C D (fun i => K.connection i z)) = K.calabiNorm z := by + change (tensorPairAt 1 1 _ _).re = _ + exact congrArg Complex.re he + rw [← hs] + exact hc _ +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CalabiCovariant.lean b/lean/OAI/Geometry/PrescribedPotential/CalabiCovariant.lean new file mode 100644 index 0000000000000000000000000000000000000000..3189aeebb2465cc9c0de857a236bd979b45db80c --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CalabiCovariant.lean @@ -0,0 +1,156 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CalabiConnection +import OAI.Geometry.PrescribedPotential.CalabiRicciContraction +import OAI.Geometry.PrescribedPotential.MatrixTensorCalculus + +namespace OAI + +/-! Calabi Covariant. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus.LocalKaehlerField +variable {n : ℕ} (K : LocalKaehlerField n) + +lemma curvature_smooth (i j : Fin n) : ContDiffOn ℝ ∞ (K.curvature i j) K.domain := by + apply K.isOpen.contDiffOn_iff.mpr + intro z hz + exact mderiv_smooth (K.connection_smooth j |>.contDiffAt (K.isOpen.mem_nhds hz)) _ _ + +lemma ricciHessian_smooth : ContDiffOn ℝ ∞ K.ricciHessian K.domain := by + apply K.isOpen.contDiffOn_iff.mpr + intro z hz + exact PotentialKaehler.potentialMatrix_smooth (K.logDet_smooth.contDiffAt (K.isOpen.mem_nhds hz)) + +def covHol (T : Fin n → V n → Matrix (Fin n) (Fin n) ℂ) (k i : Fin n) (z : V n) : + Matrix (Fin n) (Fin n) ℂ := + mderiv (-Complex.I) (e k) (T i) z + K.connection k z*T i z - T i z*K.connection k z - + ∑ q, (K.connection k z q i) • T q z + +lemma covHol_smooth {T : Fin n → V n → Matrix (Fin n) (Fin n) ℂ} + (hT : ∀ i, ContDiffOn ℝ ∞ (T i) K.domain) (k i : Fin n) : + ContDiffOn ℝ ∞ (K.covHol T k i) K.domain := by + apply K.isOpen.contDiffOn_iff.mpr + intro z hz + have hΓ := K.connection_smooth k |>.contDiffAt (K.isOpen.mem_nhds hz) + have ht (j) := (hT j).contDiffAt (K.isOpen.mem_nhds hz) + exact (((mderiv_smooth (ht i) _ _).add (matrix_smooth_mul hΓ (ht i))).sub + (matrix_smooth_mul (ht i) hΓ)).sub + (ContDiffAt.sum (fun q _ => matrix_smooth_smul (entry_smooth hΓ q i) (ht q))) + +lemma covHol_connection_swap {z : V n} (hz : z ∈ K.domain) (k i : Fin n) : + K.covHol K.connection k i z = mderiv (-Complex.I) (e i) (K.connection k) z - + ∑ q, (K.connection k z q i) • K.connection q z := by + have he := K.connection_hol_flat hz k i + unfold covHol + rw [sub_eq_iff_eq_add] at he + rw [he] + abel + +lemma derivative_curvature_contraction_at_one {z : V n} (hz : z ∈ K.domain) + (hM : K.matrix z = 1) (i : Fin n) : + (∑ k, mderiv (-Complex.I) (e i) (K.curvature k k) z) = + mderiv (-Complex.I) (e i) (fun y => (K.matrix y)⁻¹*K.ricciHessian y) z + + ∑ p, ∑ q, (K.connection i z p q) • K.curvature q p z := by + have hnh := K.isOpen.mem_nhds hz + have hI := K.inverse_smooth.contDiffAt hnh + have hV (p q) := K.curvature_smooth p q |>.contDiffAt hnh + have hC := K.connection_smooth i |>.contDiffAt hnh + have he : (fun y => ∑ p, ∑ q, ((K.matrix y)⁻¹ p q) • K.curvature q p y) =ᶠ[𝓝 z] + (fun y => (K.matrix y)⁻¹*K.ricciHessian y) := by + filter_upwards [hnh] with y hy + exact K.curvature_contraction hy + have hh := mderiv_congr he (-Complex.I) (e i) + have hd : mderiv (-Complex.I) (e i) (fun y => (K.matrix y)⁻¹) z = -K.connection i z := by + rw [mderiv_inverse K.isOpen K.smooth (fun y hy => ne_of_gt (K.positive y hy).det_pos) hz, + connection,hM] + simp only [inv_one,neg_mul,one_mul,mul_one] + have hf (p q) : mderiv (-Complex.I) (e i) + (fun y => ((K.matrix y)⁻¹ p q) • K.curvature q p y) z = + -(K.connection i z p q) • K.curvature q p z + + ((1 : Matrix (Fin n) (Fin n) ℂ) p q) • mderiv (-Complex.I) (e i) (K.curvature q p) z := by + rw [mderiv_smul (entry_smooth hI p q) (hV q p)] + change mderiv (-Complex.I) (e i) (fun y => (K.matrix y)⁻¹) z p q • _ + _ = _ + rw [hd,hM,inv_one] + rfl + rw [mderiv_sum Finset.univ (fun p _ => ContDiffAt.sum (fun q _ => + matrix_smooth_smul (entry_smooth hI p q) (hV q p)))] at hh + simp only [mderiv_sum Finset.univ (fun q _ => matrix_smooth_smul (entry_smooth hI _ q) (hV q _)),hf, + Finset.sum_add_distrib,neg_smul,Finset.sum_neg_distrib] at hh + have hone : (∑ p, ∑ q, ((1 : Matrix (Fin n) (Fin n) ℂ) p q) • + mderiv (-Complex.I) (e i) (K.curvature q p) z) = + ∑ k, mderiv (-Complex.I) (e i) (K.curvature k k) z := by + simp [Matrix.one_apply] + rw [hone] at hh + have hh' := congrArg (fun A => A + ∑ p, ∑ q, (K.connection i z p q) • K.curvature q p z) hh + convert hh' using 1 + abel + +lemma bar_covHol_connection {z : V n} (hz : z ∈ K.domain) (k i : Fin n) : + mderiv Complex.I (e k) (K.covHol K.connection k i) z = + mderiv (-Complex.I) (e i) (K.curvature k k) z - + ∑ q, ((K.curvature k k z q i) • K.connection q z + + (K.connection k z q i) • K.curvature k q z) := by + have hnh := K.isOpen.mem_nhds hz + have hG (j) := K.connection_smooth j |>.contDiffAt hnh + have he : (K.covHol K.connection k i) =ᶠ[𝓝 z] + (fun y => mderiv (-Complex.I) (e i) (K.connection k) y - + ∑ q, (K.connection k y q i) • K.connection q y) := by + filter_upwards [hnh] with y hy + exact K.covHol_connection_swap hy k i + rw [mderiv_congr he, mderiv_sub (mderiv_smooth (hG k) _ _) + (ContDiffAt.sum (fun q _ => matrix_smooth_smul (entry_smooth (hG k) q i) (hG q))), + mderiv_comm (hG k) Complex.I (-Complex.I) (e k) (e i), + mderiv_sum Finset.univ (fun q _ => matrix_smooth_smul (entry_smooth (hG k) q i) (hG q))] + congr 1 + apply Finset.sum_congr rfl + intro q _ + exact mderiv_smul (entry_smooth (hG k) q i) (hG q) _ _ + + + +lemma calabi_connection_laplacian_at_one {z : V n} (hz : z ∈ K.domain) + (hM : K.matrix z = 1) (i : Fin n) : + (∑ k, mderiv Complex.I (e k) (K.covHol K.connection k i) z) = + mderiv (-Complex.I) (e i) K.ricciHessian z - + K.connection i z * K.ricciHessian z - + ∑ q, (K.ricciHessian z q i) • K.connection q z := by + have hc := K.curvature_contraction_at_one hz hM + have h1 : (∑ k, ∑ q, (K.curvature k k z q i) • K.connection q z) = + ∑ q, (K.ricciHessian z q i) • K.connection q z := by + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro q _ + rw [← Finset.sum_smul] + congr 1 + simpa only [Matrix.sum_apply] using congrArg (fun A : Matrix (Fin n) (Fin n) ℂ => A q i) hc + have h2 : (∑ k, ∑ q, (K.connection k z q i) • K.curvature k q z) = + ∑ p, ∑ q, (K.connection i z p q) • K.curvature q p z := by + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro q _ + apply Finset.sum_congr rfl + intro k _ + rw [K.connection_symmetric hz] + have h3 : mderiv (-Complex.I) (e i) (fun y => (K.matrix y)⁻¹*K.ricciHessian y) z = + mderiv (-Complex.I) (e i) K.ricciHessian z - K.connection i z*K.ricciHessian z := by + rw [mderiv_mul (K.inverse_smooth.contDiffAt (K.isOpen.mem_nhds hz)) + (K.ricciHessian_smooth.contDiffAt (K.isOpen.mem_nhds hz)), + mderiv_inverse K.isOpen K.smooth (fun y hy => ne_of_gt (K.positive y hy).det_pos) hz, + connection,hM] + simp only [inv_one,neg_mul,one_mul,mul_one] + abel + simp only [K.bar_covHol_connection hz, Finset.sum_sub_distrib, Finset.sum_add_distrib] + rw [h1,h2,K.derivative_curvature_contraction_at_one hz hM,h3] + abel +end KaehlerCalculus.LocalKaehlerField + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CalabiCutoffAlgebra.lean b/lean/OAI/Geometry/PrescribedPotential/CalabiCutoffAlgebra.lean new file mode 100644 index 0000000000000000000000000000000000000000..24c948d902dece76d443d36437c5260d7e91f99f --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CalabiCutoffAlgebra.lean @@ -0,0 +1,47 @@ +import Mathlib + +namespace OAI + +/-! Calabi Cutoff Algebra. -/ + +section + + + +namespace CalabiEstimate +lemma cross_absorb {x y r : ℝ} (hx : 0 ≤ x) (hy : 0 ≤ y) + (hr : r^2 ≤ 8*x*y) : -(y/2+4*x) ≤ r := by + have hab : |r| ≤ y/2+4*x := by + apply (sq_le_sq₀ (abs_nonneg _) (by positivity)).mp + rw [sq_abs] + nlinarith [sq_nonneg (y/2-4*x)] + exact (neg_le_neg hab).trans (neg_abs_le r) + +lemma cutoff_max_bound {S Q η C δ LS LT Lη cross : ℝ} + (hS : 0 ≤ S) (hQ : 0 ≤ Q) (hη : 0 ≤ η) (hη1 : η ≤ 1) + (hC : 0 ≤ C) (hδ : 0 < δ) + (hLS : Q-C*(1+S) ≤ LS) (hLT : δ*S-C ≤ LT) + (hLη : -C ≤ Lη) (hcross : cross^2 ≤ 8*C*η*S*Q) + (hmax : η*LS+S*Lη+cross+((6*C+1)/δ)*LT ≤ 0) : + S ≤ C*(1+(6*C+1)/δ) := by + let A := (6*C+1)/δ + have hA : 0 ≤ A := div_nonneg (by positivity) hδ.le + have hAd : A*δ = 6*C+1 := by dsimp [A]; field_simp + have hx : -(η*Q/2+4*(C*S)) ≤ cross := by + apply cross_absorb (mul_nonneg hC hS) (mul_nonneg hη hQ) + nlinarith [hcross] + have h1 := mul_le_mul_of_nonneg_left hLS hη + have h2 := mul_le_mul_of_nonneg_left hLη hS + have h3 := mul_le_mul_of_nonneg_left hLT hA + have h4 := mul_le_mul_of_nonneg_right hη1 (mul_nonneg hC (by linarith : 0 ≤ 1+S)) + have h5 := mul_nonneg hη hQ + have he : A*(δ*S-C) = (6*C+1)*S-A*C := by rw [mul_sub,← mul_assoc,hAd] + rw [he] at h3 + change η*LS+S*Lη+cross+A*LT ≤ 0 at hmax + change S ≤ C*(1+A) + nlinarith +end CalabiEstimate + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CalabiCutoffFrames.lean b/lean/OAI/Geometry/PrescribedPotential/CalabiCutoffFrames.lean new file mode 100644 index 0000000000000000000000000000000000000000..bf06d697bdde1c66725cc38364875826fe39730d --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CalabiCutoffFrames.lean @@ -0,0 +1,128 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.FrameCompactBounds +import OAI.Geometry.PrescribedPotential.GlobalSobolev +import OAI.Geometry.PrescribedPotential.HolomorphicDirection +import OAI.Geometry.PrescribedPotential.ScalarFrameCalculus +import OAI.Geometry.PrescribedPotential.ScalarProductLaplacian + +namespace OAI + +/-! Calabi Cutoff Frames. -/ + +section + +noncomputable section +open Set Metric Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +variable {n : ℕ} + +lemma holGradientSquare_sq {f : V n → ℝ} {z : V n} (hf : ContDiffAt ℝ ∞ f z) : + holGradientSquare (fun y => (f y)^2) z = 4*(f z)^2*holGradientSquare f z := by + have hfc : ContDiffAt ℝ ∞ (fun y => (f y:ℂ)) z := Complex.ofRealCLM.contDiff.contDiffAt.comp z hf + have hd (k : Fin n) : dz (e k) (fun y => ((f y)^2:ℂ)) z = (2*(f z:ℂ))*dz (e k) (fun y => (f y:ℂ)) z := by + simp only [pow_two] + change wderiv (-Complex.I) (e k) (fun y => (f y:ℂ)*(f y:ℂ)) z = _ + rw [wderiv_mul (hfc.differentiableAt (by simp)) (hfc.differentiableAt (by simp))] + change dz (e k) _ z*(f z:ℂ)+(f z:ℂ)*dz (e k) _ z = _ + ring + rw [holGradientSquare_eq,holGradientSquare_eq,Finset.mul_sum] + apply Finset.sum_congr rfl + intro k _ + have hco : (fun y => (((f y)^2:ℝ):ℂ)) = (fun y => (f y:ℂ)^2) := by funext y; simp + rw [hco,hd,norm_mul,norm_mul,Complex.norm_ofNat,Complex.norm_real,Real.norm_eq_abs,mul_pow,mul_pow,sq_abs] + ring + +def frameGradientSquare (f : V n → ℝ) (z : V n) (C : Matrix (Fin n) (Fin n) ℂ) : ℝ := + ∑ k, ‖∑ p, C p k*dz (e p) (fun y => (f y:ℂ)) z‖^2 + +lemma frameGradientSquare_continuous {f : V n → ℝ} (hf : ContDiff ℝ ∞ f) : + Continuous (fun q : V n × Matrix (Fin n) (Fin n) ℂ => frameGradientSquare f q.1 q.2) := by + have hfc : ContDiff ℝ ∞ (fun y => (f y:ℂ)) := Complex.ofRealCLM.contDiff.comp hf + unfold frameGradientSquare + apply continuous_finsetSum + intro k _ + apply Continuous.pow + apply Continuous.norm + apply continuous_finsetSum + intro p _ + exact ((continuous_apply_apply p k).comp continuous_snd).mul + ((contDiff_iff_contDiffAt.mpr (fun z => wderiv_smooth hfc.contDiffAt _ _)).continuous.comp continuous_fst) + +lemma holGradientSquare_linear (B : V n →L[ℂ] V n) {f : V n → ℝ} {w : V n} + (hf : ContDiffAt ℝ ∞ f (B w)) : + holGradientSquare (fun y => f (B y)) w = frameGradientSquare f (B w) (frameMatrix B) := by + have hfc : ContDiffAt ℝ ∞ (fun y => (f y:ℂ)) (B w) := Complex.ofRealCLM.contDiff.contDiffAt.comp (B w) hf + rw [holGradientSquare_eq] + unfold frameGradientSquare + apply Finset.sum_congr rfl + intro k _ + congr 2 + change wderiv (-Complex.I) (e k) (fun y => (f (B y):ℂ)) w = _ + rw [wderiv_comp_linear B (hfc.differentiableAt (by simp))] + change dz (B (e k)) (fun y => (f y:ℂ)) (B w) = _ + rw [dz_direction_coordinates] + rfl + +lemma frameGradientSquare_bounded {L : Set (V n)} (hL : IsCompact L) {f : V n → ℝ} + (hf : ContDiff ℝ ∞ f) (B : ℝ) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ z ∈ L, ∀ b : Matrix (Fin n) (Fin n) ℂ, ‖b‖ ≤ B → frameGradientSquare f z b ≤ C := by + obtain ⟨C,hC⟩ := (hL.prod (isCompact_closedBall (0:Matrix (Fin n) (Fin n) ℂ) B)).exists_bound_of_continuousOn + (frameGradientSquare_continuous hf).continuousOn + refine ⟨max C 0,le_max_right _ _,?_⟩ + intro z hz b hb + have hp : (z,b) ∈ L ×ˢ closedBall (0:Matrix (Fin n) (Fin n) ℂ) B := + ⟨hz,by simpa only [mem_closedBall,dist_zero_right] using hb⟩ + have hh := hC (z,b) hp + change ‖frameGradientSquare f z b‖ ≤ C at hh + rw [Real.norm_eq_abs] at hh + exact (le_abs_self _).trans (hh.trans (le_max_left _ _)) + +lemma frameHessianTrace_continuous {f : V n → ℝ} (hf : ContDiff ℝ ∞ f) : + Continuous (fun q : V n × Matrix (Fin n) (Fin n) ℂ => + (q.2ᴴ*PotentialKaehler.potentialMatrix f q.1*q.2).trace.re) := by + have hH : Continuous (PotentialKaehler.potentialMatrix f) := + (contDiff_iff_contDiffAt.mpr (fun z => PotentialKaehler.potentialMatrix_smooth hf.contDiffAt)).continuous + exact continuousOn_univ.mp (continuousOn_trace_re + (((continuousOn_matrix_star continuous_snd.continuousOn).mul (hH.comp continuous_fst).continuousOn).mul continuous_snd.continuousOn)) + +lemma frameHessianTrace_bounded {L : Set (V n)} (hL : IsCompact L) {f : V n → ℝ} + (hf : ContDiff ℝ ∞ f) (B : ℝ) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ z ∈ L, ∀ b : Matrix (Fin n) (Fin n) ℂ, ‖b‖ ≤ B → + -C ≤ (bᴴ*PotentialKaehler.potentialMatrix f z*b).trace.re := by + obtain ⟨C,hC⟩ := (hL.prod (isCompact_closedBall (0:Matrix (Fin n) (Fin n) ℂ) B)).exists_bound_of_continuousOn + (frameHessianTrace_continuous hf).continuousOn + refine ⟨max C 0,le_max_right _ _,?_⟩ + intro z hz b hb + have hp : (z,b) ∈ L ×ˢ closedBall (0:Matrix (Fin n) (Fin n) ℂ) B := + ⟨hz,by simpa only [mem_closedBall,dist_zero_right] using hb⟩ + have hh := hC (z,b) hp + change ‖(bᴴ*PotentialKaehler.potentialMatrix f z*b).trace.re‖ ≤ C at hh + rw [Real.norm_eq_abs] at hh + exact (neg_le_neg (hh.trans (le_max_left _ _))).trans (neg_abs_le _) + +lemma cutoff_frame_bounds {L : Set (V n)} (hL : IsCompact L) (χ : V n → ℝ) + (hχ : ContDiff ℝ ∞ χ) (B : ℝ) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ (b : V n →L[ℂ] V n) (w : V n), b w ∈ L → ‖frameMatrix b‖ ≤ B → + -C ≤ (PotentialKaehler.potentialMatrix (fun y => (χ (b y))^2) w).trace.re ∧ + holGradientSquare (fun y => (χ (b y))^2) w ≤ C*(χ (b w))^2 := by + obtain ⟨C1,hC1,h1⟩ := frameHessianTrace_bounded hL (hχ.pow 2) B + obtain ⟨C2,hC2,h2⟩ := frameGradientSquare_bounded hL hχ B + let C := max C1 (4*C2) + refine ⟨C,hC1.trans (le_max_left _ _),?_⟩ + intro b w hw hb + constructor + · rw [potentialMatrix_linear b (hχ.contDiffAt.pow 2)] + exact (neg_le_neg (le_max_left C1 (4*C2))).trans (h1 _ hw _ hb) + · have hs : ContDiffAt ℝ ∞ (fun y => χ (b y)) w := hχ.contDiffAt.comp w (b.restrictScalars ℝ).contDiff.contDiffAt + rw [holGradientSquare_sq hs,holGradientSquare_linear b hχ.contDiffAt] + have hh := h2 (b w) hw (frameMatrix b) hb + have hC : 4*C2 ≤ C := le_max_right _ _ + have hmul := mul_le_mul_of_nonneg_right (by linarith : 4*frameGradientSquare χ (b w) (frameMatrix b) ≤ C) (sq_nonneg (χ (b w))) + nlinarith +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CalabiCutoffPoint.lean b/lean/OAI/Geometry/PrescribedPotential/CalabiCutoffPoint.lean new file mode 100644 index 0000000000000000000000000000000000000000..852b492e37aa8f9f635cb8fcb3af121a55c963a2 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CalabiCutoffPoint.lean @@ -0,0 +1,66 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CalabiCutoffAlgebra +import OAI.Geometry.PrescribedPotential.CalabiPointInequalities +import OAI.Geometry.PrescribedPotential.CalabiRescue +import OAI.Geometry.PrescribedPotential.CalabiResidualBound +import OAI.Geometry.PrescribedPotential.PotentialLinearCalculus +import OAI.Geometry.PrescribedPotential.ScalarProductLaplacian + +namespace OAI + +/-! Calabi Cutoff Point. -/ + +section + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus.LocalKaehlerField +variable {n : ℕ} (K : LocalKaehlerField n) + +lemma calabi_cutoff_max_at_one {z : V n} (hz : z ∈ K.domain) (hM : K.matrix z = 1) + (D : Matrix (Fin n) (Fin n) ℂ) {η : V n → ℝ} (hηs : ContDiffAt ℝ ∞ η z) + {C δ : ℝ} (hC : 0 ≤ C) (hδ : 0 < δ) (hη : 0 ≤ η z) (hη1 : η z ≤ 1) + (hηlap : -C ≤ (PotentialKaehler.potentialMatrix η z).trace.re) + (hηgrad : holGradientSquare η z ≤ C*η z) + (hRes : -C*(1+K.calabiNorm z) ≤ calabiResidual (K.ricciHessian z) + (fun i => mderiv (-Complex.I) (e i) K.ricciHessian z) (fun i => K.connection i z)) + (hRic : -C ≤ (Dᴴ*K.ricciHessian z*D).trace.re) + (hRescue : δ*K.calabiNorm z ≤ rescueSquare D (fun i => K.connection i z)) + (hmax : IsLocalMax (fun y => η y*K.calabiNorm y+((6*C+1)/δ)*K.weightedTrace D y) z) : + K.calabiNorm z ≤ C*(1+(6*C+1)/δ) := by + have hn := K.isOpen.mem_nhds hz + have hSs := K.calabiNorm_smooth.contDiffAt hn + have hTs := (K.weightedTrace_smooth D).contDiffAt hn + have hS : 0 ≤ K.calabiNorm z := by rw [K.calabiNorm_at_one hM]; exact tensorSquare_nonneg _ + have hQ := K.calabiGood_nonneg z + have hgrad : holGradientSquare K.calabiNorm z ≤ 2*K.calabiNorm z*K.calabiGood z := by + rw [holGradientSquare_eq] + exact K.calabi_gradient_sum_at_one hz hM + have hcross : (gradientCross η K.calabiNorm z)^2 ≤ 8*C*η z*K.calabiNorm z*K.calabiGood z := by + have hh := gradientCross_sq η K.calabiNorm z + have ha := mul_le_mul hηgrad hgrad (sq_nonneg ‖holGradient K.calabiNorm z‖) + (mul_nonneg hC hη) + dsimp only [holGradientSquare] at ha hh + nlinarith + have hLS : K.calabiGood z-C*(1+K.calabiNorm z) ≤ + (PotentialKaehler.potentialMatrix K.calabiNorm z).trace.re := by + rw [K.calabi_bochner_real_at_one hz hM] + linarith + have hLT : δ*K.calabiNorm z-C ≤ + (PotentialKaehler.potentialMatrix (K.weightedTrace D) z).trace.re := by + rw [K.weightedTrace_laplacian_at_one D hz hM] + linarith + have ht := EllipticKernel.trace_potentialMatrix_nonpos_at_localMax + ((hηs.mul hSs).add (contDiffAt_const.mul hTs)) hmax (1 : Matrix (Fin n) (Fin n) ℂ) Matrix.PosDef.one + rw [inv_one,one_mul,potentialMatrix_affine (hηs.mul hSs) hTs,Matrix.trace_add,Matrix.trace_smul, + Complex.add_re] at ht + simp only [smul_eq_mul,Complex.mul_re,Complex.ofReal_re,Complex.ofReal_im,zero_mul,sub_zero] at ht + rw [potentialMatrix_trace_mul hηs hSs] at ht + exact CalabiEstimate.cutoff_max_bound hS hQ hη hη1 hC hδ hLS hLT hηlap hcross ht +end KaehlerCalculus.LocalKaehlerField + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CalabiFrameAlgebra.lean b/lean/OAI/Geometry/PrescribedPotential/CalabiFrameAlgebra.lean new file mode 100644 index 0000000000000000000000000000000000000000..4542ba6e596a528865f237b5624f8208d79e28f3 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CalabiFrameAlgebra.lean @@ -0,0 +1,89 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CalabiTensorAlgebra + +namespace OAI + +/-! Calabi Frame Algebra. -/ + +section + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +variable {n : ℕ} + +def pullConnectionTensor (C : Matrix (Fin n) (Fin n) ℂ) (T : ConnectionTensor n) : ConnectionTensor n := + fun i => C⁻¹*(∑ p, C p i • T p)*C + +lemma tensor_trace_changeBasis (C P M T U : Matrix (Fin n) (Fin n) ℂ) (hC : IsUnit C) : + ((C⁻¹*T*C)*(C⁻¹*P*(Cᴴ)⁻¹)*(C⁻¹*U*C)ᴴ*(Cᴴ*M*C)).trace = (T*P*Uᴴ*M).trace := by + have hc : C*C⁻¹=1 := Matrix.mul_nonsing_inv _ (Matrix.isUnit_iff_isUnit_det _ |>.mp hC) + have hd : (Cᴴ)⁻¹*Cᴴ=1 := by + rw [← Matrix.conjTranspose_nonsing_inv,← Matrix.conjTranspose_mul,hc,Matrix.conjTranspose_one] + simp only [Matrix.conjTranspose_mul,Matrix.conjTranspose_nonsing_inv,Matrix.mul_assoc] + rw [← Matrix.mul_assoc C C⁻¹,hc,Matrix.one_mul, + ← Matrix.mul_assoc (Cᴴ)⁻¹ Cᴴ,hd,Matrix.one_mul, + ← Matrix.mul_assoc (Cᴴ)⁻¹ Cᴴ,hd,Matrix.one_mul] + calc + _ = ((C⁻¹*(T*P*Uᴴ*M))*C).trace := by simp only [mul_assoc] + _ = ((C*C⁻¹)*(T*P*Uᴴ*M)).trace := Matrix.trace_mul_cycle _ _ _ + _ = _ := by simp only [hc,one_mul,mul_assoc] + +lemma tensor_pair_mixed (P M Q C : Matrix (Fin n) (Fin n) ℂ) (T U : ConnectionTensor n) : + (∑ i, ∑ j, Q i j * ((∑ p, C p i • T p)*P*(∑ q, C q j • U q)ᴴ*M).trace) = + ∑ p, ∑ q, (C*Q*Cᴴ) p q*(T p*P*(U q)ᴴ*M).trace := by + have he (i j) : ((∑ p, C p i • T p)*P*(∑ q, C q j • U q)ᴴ*M).trace = + ∑ p, ∑ q, C p i * star (C q j) * (T p*P*(U q)ᴴ*M).trace := by + simp only [Matrix.sum_mul,Matrix.conjTranspose_sum,Matrix.trace_sum, + Matrix.smul_mul,Matrix.mul_smul,Matrix.conjTranspose_smul,Matrix.trace_smul, + smul_eq_mul,Finset.mul_sum] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro p _ + apply Finset.sum_congr rfl + intro q _ + ring + simp_rw [he] + simp only [Matrix.mul_apply,Matrix.conjTranspose_apply,Finset.mul_sum,Finset.sum_mul] + calc + _ = ∑ p, ∑ q, ∑ i, ∑ j, + Q i j * (C p i * star (C q j) * (T p*P*(U q)ᴴ*M).trace) := by + conv_lhs => arg 2; ext i; rw [Finset.sum_comm]; arg 2; ext p; rw [Finset.sum_comm] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro p _ + rw [Finset.sum_comm] + _ = _ := by + apply Finset.sum_congr rfl + intro p _ + apply Finset.sum_congr rfl + intro q _ + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro j _ + apply Finset.sum_congr rfl + intro i _ + ring + +lemma tensorPairAt_changeBasis (C P M : Matrix (Fin n) (Fin n) ℂ) (hC : IsUnit C) + (T U : ConnectionTensor n) : + tensorPairAt (C⁻¹*P*(Cᴴ)⁻¹) (Cᴴ*M*C) (pullConnectionTensor C T) (pullConnectionTensor C U) = + tensorPairAt P M T U := by + unfold tensorPairAt pullConnectionTensor + simp_rw [tensor_trace_changeBasis C P M _ _ hC] + rw [tensor_pair_mixed] + have hc : C*C⁻¹=1 := Matrix.mul_nonsing_inv _ (Matrix.isUnit_iff_isUnit_det _ |>.mp hC) + have hd : (Cᴴ)⁻¹*Cᴴ=1 := by + rw [← Matrix.conjTranspose_nonsing_inv,← Matrix.conjTranspose_mul,hc,Matrix.conjTranspose_one] + have he : C*(C⁻¹*P*(Cᴴ)⁻¹)*Cᴴ = P := by + simp only [mul_assoc] + rw [← mul_assoc C C⁻¹,hc,one_mul] + simp only [hd,mul_one] + simp only [he] +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CalabiFrameCalculus.lean b/lean/OAI/Geometry/PrescribedPotential/CalabiFrameCalculus.lean new file mode 100644 index 0000000000000000000000000000000000000000..be7a926f457e4ce3d97f8cb03a1f9f1fc42b498f --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CalabiFrameCalculus.lean @@ -0,0 +1,75 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CalabiBochner +import OAI.Geometry.PrescribedPotential.CalabiFrameAlgebra +import OAI.Geometry.PrescribedPotential.HolomorphicDirection +import OAI.Geometry.PrescribedPotential.MatrixFrameNormalization +import OAI.Geometry.PrescribedPotential.ScalarFrameCalculus + +namespace OAI + +/-! Calabi Frame Calculus. -/ + +section + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus.LocalKaehlerField +variable {n : ℕ} (K : LocalKaehlerField n) + +def pull (B : V n →L[ℂ] V n) (hB : IsUnit (frameMatrix B)) : LocalKaehlerField n where + domain := B ⁻¹' K.domain + isOpen := K.isOpen.preimage B.continuous + matrix := pullMetric B K.matrix + smooth := pullMetric_smooth K.isOpen B K.smooth + positive := pullMetric_positive B hB K.positive + closed := pullMetric_closed K.isOpen B K.smooth K.closed + +lemma pull_connection (B : V n →L[ℂ] V n) (hB : IsUnit (frameMatrix B)) + {w : V n} (hw : B w ∈ K.domain) (i : Fin n) : + (K.pull B hB).connection i w = pullConnectionTensor (frameMatrix B) (fun p => K.connection p (B w)) i := by + let C := frameMatrix B + have hc : C*C⁻¹ = 1 := Matrix.mul_nonsing_inv _ (Matrix.isUnit_iff_isUnit_det _ |>.mp hB) + have hd : (Cᴴ)⁻¹*Cᴴ = 1 := by + rw [← Matrix.conjTranspose_nonsing_inv,← Matrix.conjTranspose_mul,hc,Matrix.conjTranspose_one] + change (pullMetric B K.matrix w)⁻¹*mderiv (-Complex.I) (e i) (pullMetric B K.matrix) w = _ + rw [mderiv_pullMetric B (K.smooth.contDiffAt (K.isOpen.mem_nhds hw))] + unfold pullMetric + change (Cᴴ*K.matrix (B w)*C)⁻¹*(Cᴴ*mderiv (-Complex.I) (B (e i)) K.matrix (B w)*C) = _ + simp only [Matrix.mul_inv_rev,mul_assoc] + rw [← mul_assoc (Cᴴ)⁻¹ Cᴴ,hd,one_mul,mderiv_hol_coordinates] + have he (p) : B (e i) p = C p i := rfl + simp only [he,pullConnectionTensor,connection,Matrix.mul_sum,Matrix.mul_smul,Matrix.sum_mul,Matrix.smul_mul,mul_assoc,C] + +lemma pull_calabiNorm (B : V n →L[ℂ] V n) (hB : IsUnit (frameMatrix B)) + {w : V n} (hw : B w ∈ K.domain) : + (K.pull B hB).calabiNorm w = K.calabiNorm (B w) := by + unfold calabiNorm tensorPair + simp_rw [K.pull_connection B hB hw] + change (tensorPairAt (pullMetric B K.matrix w)⁻¹ (pullMetric B K.matrix w) _ _).re = _ + unfold pullMetric + simp only [Matrix.mul_inv_rev] + exact congrArg Complex.re (by + simpa only [mul_assoc] using tensorPairAt_changeBasis (frameMatrix B) (K.matrix (B w))⁻¹ + (K.matrix (B w)) hB (fun p => K.connection p (B w)) (fun p => K.connection p (B w))) + +lemma pull_ricciHessian (B : V n →L[ℂ] V n) (hB : IsUnit (frameMatrix B)) + {w : V n} (hw : B w ∈ K.domain) : + (K.pull B hB).ricciHessian w = pullMetric B K.ricciHessian w := + potentialMatrix_logdet_pullMetric K.isOpen B hB K.smooth K.positive hw + +lemma pull_ricciHessian_hol (B : V n →L[ℂ] V n) (hB : IsUnit (frameMatrix B)) + {w : V n} (hw : B w ∈ K.domain) (i : Fin n) : + mderiv (-Complex.I) (e i) (K.pull B hB).ricciHessian w = + (frameMatrix B)ᴴ * mderiv (-Complex.I) (B (e i)) K.ricciHessian (B w) * frameMatrix B := by + have he : (K.pull B hB).ricciHessian =ᶠ[𝓝 w] pullMetric B K.ricciHessian := by + filter_upwards [B.continuous.continuousAt.preimage_mem_nhds (K.isOpen.mem_nhds hw)] with y hy + exact K.pull_ricciHessian B hB hy + rw [mderiv_congr he] + exact mderiv_pullMetric B (K.ricciHessian_smooth.contDiffAt (K.isOpen.mem_nhds hw)) _ _ +end KaehlerCalculus.LocalKaehlerField + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CalabiFrameScalars.lean b/lean/OAI/Geometry/PrescribedPotential/CalabiFrameScalars.lean new file mode 100644 index 0000000000000000000000000000000000000000..14967aff36de9477581ae9a1aea08ad2072abf18 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CalabiFrameScalars.lean @@ -0,0 +1,65 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CalabiFrameCalculus +import OAI.Geometry.PrescribedPotential.CalabiPointInequalities +import OAI.Geometry.PrescribedPotential.CalabiRicciFrames +import OAI.Geometry.PrescribedPotential.HolomorphicDirection +import OAI.Geometry.PrescribedPotential.MatrixFrameNormalization + +namespace OAI + +/-! Calabi Frame Scalars. -/ + +section + +noncomputable section +open Set Metric Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus.LocalKaehlerField +variable {n : ℕ} (K : LocalKaehlerField n) + +lemma calabiNorm_nonneg {z : V n} (hz : z ∈ K.domain) : 0 ≤ K.calabiNorm z := by + obtain ⟨B,w,hB,hw,hM⟩ := normalized_frame K.matrix z (K.positive z hz) + have hwU : B w ∈ K.domain := hw ▸ hz + have h := K.pull_calabiNorm B hB hwU + rw [hw] at h + rw [← h,(K.pull B hB).calabiNorm_at_one hM] + exact tensorSquare_nonneg _ + +lemma pull_weightedTrace_undo (B : V n →L[ℂ] V n) (hB : IsUnit (frameMatrix B)) + (D : Matrix (Fin n) (Fin n) ℂ) (hCD : frameMatrix B*D = 1) (w : V n) : + (K.pull B hB).weightedTrace D w = (K.matrix (B w)).trace.re := by + change (Dᴴ*((frameMatrix B)ᴴ*K.matrix (B w)*frameMatrix B)*D).trace.re = _ + have he : Dᴴ*((frameMatrix B)ᴴ*K.matrix (B w)*frameMatrix B)*D = + (frameMatrix B*D)ᴴ*K.matrix (B w)*(frameMatrix B*D) := by + simp only [Matrix.conjTranspose_mul,mul_assoc] + rw [he,hCD,Matrix.conjTranspose_one,one_mul,mul_one] + +lemma pull_ricciHessian_jet (B : V n →L[ℂ] V n) (hB : IsUnit (frameMatrix B)) + {w : V n} (hw : B w ∈ K.domain) : + (fun i => mderiv (-Complex.I) (e i) (K.pull B hB).ricciHessian w) = + frameRicciJet (fun i => mderiv (-Complex.I) (e i) K.ricciHessian (B w)) (frameMatrix B) := by + funext i + rw [K.pull_ricciHessian_hol B hB hw,mderiv_hol_coordinates] + rfl + +lemma pull_cutoff_max (B : V n →L[ℂ] V n) (hB : IsUnit (frameMatrix B)) + {z w : V n} (hz : z ∈ K.domain) (hw : B w = z) + (D : Matrix (Fin n) (Fin n) ℂ) (hCD : frameMatrix B*D = 1) + (χ : V n → ℝ) (a : ℝ) + (hmax : IsLocalMax (fun y => (χ y)^2*K.calabiNorm y+a*(K.matrix y).trace.re) z) : + IsLocalMax (fun y => (χ (B y))^2*(K.pull B hB).calabiNorm y+a*(K.pull B hB).weightedTrace D y) w := by + have ht : Tendsto B (𝓝 w) (𝓝 z) := hw ▸ B.continuous.continuousAt + have hnormw := K.pull_calabiNorm B hB (show B w ∈ K.domain by rw [hw]; exact hz) + have htracew := K.pull_weightedTrace_undo B hB D hCD w + change ∀ᶠ y in 𝓝 w, _ ≤ _ + dsimp only + rw [hnormw,htracew,hw] + filter_upwards [ht.eventually hmax,ht.eventually (K.isOpen.mem_nhds hz)] with y hy hym + rw [K.pull_calabiNorm B hB hym,K.pull_weightedTrace_undo B hB D hCD] + exact hy +end KaehlerCalculus.LocalKaehlerField + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CalabiLocalUniform.lean b/lean/OAI/Geometry/PrescribedPotential/CalabiLocalUniform.lean new file mode 100644 index 0000000000000000000000000000000000000000..56fe6f45e1a1173d2ee1d86c5e52d9f9ce288e61 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CalabiLocalUniform.lean @@ -0,0 +1,153 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CalabiCutoffFrames +import OAI.Geometry.PrescribedPotential.CalabiCutoffPoint +import OAI.Geometry.PrescribedPotential.CalabiFrameScalars +import OAI.Geometry.PrescribedPotential.CalabiPointInequalities +import OAI.Geometry.PrescribedPotential.CalabiRicciFrames +import OAI.Geometry.PrescribedPotential.MatrixFrameNormalization + +namespace OAI + +/-! Calabi Local Uniform. -/ + +section + + + +noncomputable section +open Set Metric Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +variable {n : ℕ} + +lemma calabi_cutoff_max_uniform {Y : Type*} [TopologicalSpace Y] + {P : Set Y} {L : Set (V n)} (G : V n → Matrix (Fin n) (Fin n) ℂ) + (H : Y × V n → Matrix (Fin n) (Fin n) ℂ) (J : Y × V n → ConnectionTensor n) + (χ : V n → ℝ) (hχ : ContDiff ℝ ∞ χ) + {R K B C δ : ℝ} (hC : 0 ≤ C) (hδ : 0 < δ) + (hframe : ∀ z ∈ L, ∀ M C D : Matrix (Fin n) (Fin n) ℂ, + ((R:ℂ) • M-G z).PosSemidef → ((K:ℂ) • G z-M).PosSemidef → + C*D = 1 → Cᴴ*M*C = 1 → ‖C‖ ≤ B ∧ ‖D‖ ≤ B) + (hcut : ∀ (b : V n →L[ℂ] V n) w, b w ∈ L → ‖frameMatrix b‖ ≤ B → + -C ≤ (PotentialKaehler.potentialMatrix (fun y => (χ (b y))^2) w).trace.re ∧ + holGradientSquare (fun y => (χ (b y))^2) w ≤ C*(χ (b w))^2) + (hric : ∀ x ∈ P ×ˢ L, ∀ p ∈ boundedFramePairs (n := n) B, ∀ T : ConnectionTensor n, + -C*(1+tensorSquare T) ≤ calabiResidual (p.1ᴴ*H x*p.1) (frameRicciJet (J x) p.1) T ∧ + -C ≤ (p.2ᴴ*(p.1ᴴ*H x*p.1)*p.2).trace.re ∧ + δ*tensorSquare T ≤ rescueSquare p.2 T) + (M : LocalKaehlerField n) {t : Y} (ht : t ∈ P) {z : V n} (hz : z ∈ L) + (hzM : z ∈ M.domain) + (hell : ((R:ℂ) • M.matrix z-G z).PosSemidef ∧ ((K:ℂ) • G z-M.matrix z).PosSemidef) + (hH : M.ricciHessian z = H (t,z)) + (hJ : (fun i => mderiv (-Complex.I) (e i) M.ricciHessian z) = J (t,z)) + (hχ0 : 0 ≤ χ z) (hχ1 : χ z ≤ 1) + (hmax : IsLocalMax (fun y => (χ y)^2*M.calabiNorm y+((6*C+1)/δ)*(M.matrix y).trace.re) z) : + M.calabiNorm z ≤ C*(1+(6*C+1)/δ) := by + obtain ⟨b,w,hb,hw,hnorm⟩ := normalized_frame M.matrix z (M.positive z hzM) + let D := (frameMatrix b)⁻¹ + have hCD : frameMatrix b*D = 1 := Matrix.mul_nonsing_inv _ (Matrix.isUnit_iff_isUnit_det _ |>.mp hb) + have hDC : D*frameMatrix b = 1 := Matrix.nonsing_inv_mul _ (Matrix.isUnit_iff_isUnit_det _ |>.mp hb) + have hnorm' : (frameMatrix b)ᴴ*M.matrix z*frameMatrix b = 1 := by + simpa only [pullMetric,hw] using hnorm + obtain ⟨hbc,hdc⟩ := hframe z hz (M.matrix z) (frameMatrix b) D hell.1 hell.2 hCD hnorm' + have hp : (frameMatrix b,D) ∈ boundedFramePairs B := ⟨hbc,hdc,hCD,hDC⟩ + have hwM : b w ∈ M.domain := hw ▸ hzM + have hwL : b w ∈ L := hw ▸ hz + have hS := M.pull_calabiNorm b hb hwM + have hS' : tensorSquare (fun i => (M.pull b hb).connection i w) = M.calabiNorm z := by + rw [← (M.pull b hb).calabiNorm_at_one hnorm,hS,hw] + obtain ⟨hr1,hr2,hr3⟩ := hric (t,z) ⟨ht,hz⟩ (frameMatrix b,D) hp (fun i => (M.pull b hb).connection i w) + have hh : (M.pull b hb).ricciHessian w = (frameMatrix b)ᴴ*H (t,z)*frameMatrix b := by + rw [M.pull_ricciHessian b hb hwM] + simp only [pullMetric,hw,hH] + have hj : (fun i => mderiv (-Complex.I) (e i) (M.pull b hb).ricciHessian w) = frameRicciJet (J (t,z)) (frameMatrix b) := by + rw [M.pull_ricciHessian_jet b hb hwM,hw,hJ] + obtain ⟨hc1,hc2⟩ := hcut b w hwL hbc + have hχs : ContDiffAt ℝ ∞ (fun y => (χ (b y))^2) w := + (hχ.contDiffAt.comp w (b.restrictScalars ℝ).contDiff.contDiffAt).pow 2 + have hχb1 : (χ (b w))^2 ≤ 1 := by rw [hw]; nlinarith + have hnormM : (M.pull b hb).matrix w = 1 := hnorm + have hhmax := M.pull_cutoff_max b hb hzM hw D hCD χ ((6*C+1)/δ) hmax + have hbound := (M.pull b hb).calabi_cutoff_max_at_one hwM hnormM D hχs hC hδ + (sq_nonneg _) hχb1 hc1 hc2 + (by rw [hh,hj,(M.pull b hb).calabiNorm_at_one hnormM]; exact hr1) + (by rw [hh]; exact hr2) + (by rw [(M.pull b hb).calabiNorm_at_one hnormM]; exact hr3) hhmax + rwa [hS,hw] at hbound + + + +theorem calabi_interior_uniform {Y : Type*} [TopologicalSpace Y] + {P : Set Y} (hP : IsCompact P) {L : Set (V n)} (hL : IsCompact L) + (G : V n → Matrix (Fin n) (Fin n) ℂ) + (hG : ContinuousOn G L) (hGp : ∀ z ∈ L, (G z).PosDef) + (H : Y × V n → Matrix (Fin n) (Fin n) ℂ) (J : Y × V n → ConnectionTensor n) + (hH : ContinuousOn H (P ×ˢ L)) (hJ : ContinuousOn J (P ×ˢ L)) + (χ : V n → ℝ) (hχ : ContDiff ℝ ∞ χ) + (hχ0 : ∀ z ∈ L, 0 ≤ χ z) (hχ1 : ∀ z ∈ L, χ z ≤ 1) + (hχint : ∀ z ∈ L, χ z ≠ 0 → z ∈ interior L) + {R K : ℝ} (hR : 0 ≤ R) (hK : 0 ≤ K) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ (M : LocalKaehlerField n) (t : Y), + t ∈ P → L ⊆ M.domain → + (∀ z ∈ L, ((R:ℂ) • M.matrix z-G z).PosSemidef ∧ ((K:ℂ) • G z-M.matrix z).PosSemidef) → + (∀ z ∈ L, M.ricciHessian z = H (t,z)) → + (∀ z ∈ L, (fun i => mderiv (-Complex.I) (e i) M.ricciHessian z) = J (t,z)) → + ∀ z ∈ L, χ z = 1 → M.calabiNorm z ≤ C := by + obtain ⟨B,hB,hframe⟩ := compact_normalizing_frames hL G hG hGp hR hK + obtain ⟨C1,δ,hC1,hδ,hric⟩ := calabi_frame_uniform (hP.prod hL) H J hH hJ B + obtain ⟨C2,hC2,hcut⟩ := cutoff_frame_bounds hL χ hχ B + obtain ⟨Tb,hTb⟩ := hL.exists_bound_of_continuousOn (continuousOn_trace_re hG) + let C := max C1 C2 + let T := K*max Tb 0 + let a := (6*C+1)/δ + have hC : 0 ≤ C := hC1.trans (le_max_left _ _) + have hT : 0 ≤ T := mul_nonneg hK (le_max_right _ _) + have ha : 0 ≤ a := div_nonneg (by positivity) hδ.le + refine ⟨C*(1+a)+a*T,by positivity,?_⟩ + intro M t ht hdom hell hRic hJet z hz hχz + have htr (y) (hy : y ∈ L) : (M.matrix y).trace.re ≤ T := by + exact (metric_trace_le (hell y hy).2).trans (mul_le_mul_of_nonneg_left + ((le_abs_self _).trans ((hTb y hy).trans (le_max_left _ _))) hK) + let F : V n → ℝ := fun y => (χ y)^2*M.calabiNorm y+a*(M.matrix y).trace.re + have hFc : ContinuousOn F L := + ((hχ.continuous.continuousOn.pow 2).mul (M.calabiNorm_smooth.continuousOn.mono hdom)).add + (continuousOn_const.mul (continuousOn_trace_re (M.smooth.continuousOn.mono hdom))) + obtain ⟨y,hy,hmax⟩ := hL.exists_isMaxOn ⟨z,hz⟩ hFc + have hFz : M.calabiNorm z ≤ F z := by + dsimp only [F] + rw [hχz,one_pow,one_mul] + have ht0 := (Complex.nonneg_iff.mp (M.positive z (hdom hz)).posSemidef.trace_nonneg).1 + exact le_add_of_nonneg_right (mul_nonneg ha ht0) + have hFzy := hmax hz + have hFbound : F y ≤ C*(1+a)+a*T := by + by_cases hzero : χ y = 0 + · dsimp only [F] + rw [hzero,zero_pow (by decide),zero_mul,zero_add] + exact (mul_le_mul_of_nonneg_left (htr y hy) ha).trans (le_add_of_nonneg_left (mul_nonneg hC (by positivity))) + have hlocal : IsLocalMax F y := by + filter_upwards [mem_interior_iff_mem_nhds.mp (hχint y hy hzero)] with v hv + exact hmax hv + have hcut' (b : V n →L[ℂ] V n) w (hw : b w ∈ L) (hb : ‖frameMatrix b‖ ≤ B) := hcut b w hw hb + have hs : M.calabiNorm y ≤ C*(1+a) := by + apply calabi_cutoff_max_uniform G H J χ hχ hC hδ hframe + (fun b w hw hb => ⟨(neg_le_neg (le_max_right C1 C2)).trans (hcut' b w hw hb).1, + (hcut' b w hw hb).2.trans (mul_le_mul_of_nonneg_right (le_max_right C1 C2) (sq_nonneg _))⟩) + (fun x hx p hp U => ?_) M ht hy (hdom hy) (hell y hy) (hRic y hy) (hJet y hy) + (hχ0 y hy) (hχ1 y hy) hlocal + obtain ⟨h1,h2,h3⟩ := hric x hx p hp U + refine ⟨?_,(neg_le_neg (le_max_left C1 C2)).trans h2,h3⟩ + have he : -C*(1+tensorSquare U) ≤ -C1*(1+tensorSquare U) := by + simpa only [neg_mul] using (neg_le_neg (mul_le_mul_of_nonneg_right + (le_max_left C1 C2) (add_nonneg zero_le_one (tensorSquare_nonneg U)))) + exact he.trans h1 + have hs0 := M.calabiNorm_nonneg (hdom hy) + have hc : (χ y)^2 ≤ 1 := by nlinarith [hχ0 y hy,hχ1 y hy] + have hh := (mul_le_mul_of_nonneg_right hc hs0).trans (by simpa using hs) + exact add_le_add hh (mul_le_mul_of_nonneg_left (htr y hy) ha) + exact hFz.trans (hFzy.trans hFbound) +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CalabiNormAlgebra.lean b/lean/OAI/Geometry/PrescribedPotential/CalabiNormAlgebra.lean new file mode 100644 index 0000000000000000000000000000000000000000..79223259b70af0159338342aeedfd4bbe7c8eb29 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CalabiNormAlgebra.lean @@ -0,0 +1,91 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CalabiTensorAlgebra + +namespace OAI + +/-! Calabi Norm Algebra. -/ + +section + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +variable {n : ℕ} + +def tensorVector (T : ConnectionTensor n) : EuclideanSpace ℂ (Fin n × Fin n × Fin n) := + WithLp.toLp 2 (fun p => T p.1 p.2.1 p.2.2) + +def tensorSquare (T : ConnectionTensor n) : ℝ := (tensorPairAt 1 1 T T).re + +lemma tensorPairAt_one_inner (T U : ConnectionTensor n) : + tensorPairAt 1 1 T U = inner ℂ (tensorVector U) (tensorVector T) := by + rw [tensorPairAt_one] + simp only [tensorVector,PiLp.inner_apply,Fintype.sum_prod_type, + Matrix.trace,Matrix.diag_apply,Matrix.mul_apply,Matrix.conjTranspose_apply, + RCLike.inner_apply] + rfl + +lemma tensorSquare_norm (T : ConnectionTensor n) : tensorSquare T = ‖tensorVector T‖^2 := by + rw [tensorSquare,tensorPairAt_one_inner] + exact (norm_sq_eq_re_inner (𝕜 := ℂ) (tensorVector T)).symm + +lemma tensorSquare_nonneg (T : ConnectionTensor n) : 0 ≤ tensorSquare T := by + rw [tensorSquare_norm] + positivity + +lemma tensorSquare_pos {T : ConnectionTensor n} (hT : T ≠ 0) : 0 < tensorSquare T := by + rw [tensorSquare_norm] + apply sq_pos_of_pos + apply norm_pos_iff.mpr + intro he + apply hT + funext i + ext a b + exact congrArg (fun v : EuclideanSpace ℂ (Fin n × Fin n × Fin n) => v (i,a,b)) he + +lemma tensorPairAt_cauchy (T U : ConnectionTensor n) : + ‖tensorPairAt 1 1 T U‖^2 ≤ tensorSquare T*tensorSquare U := by + rw [tensorPairAt_one_inner,tensorSquare_norm,tensorSquare_norm] + have hh := norm_inner_le_norm (𝕜 := ℂ) (tensorVector U) (tensorVector T) + have hs := sq_le_sq₀ (norm_nonneg _) (mul_nonneg (norm_nonneg _) (norm_nonneg _)) |>.mpr hh + simpa only [mul_pow,mul_comm] using hs + +lemma tensorSquare_smul (r : ℝ) (T : ConnectionTensor n) : + tensorSquare (r • T) = r^2*tensorSquare T := by + have he : tensorVector (r • T) = r • tensorVector T := rfl + rw [tensorSquare_norm,he,norm_smul,mul_pow,Real.norm_eq_abs,sq_abs,tensorSquare_norm] + +lemma continuous_tensorSquare : Continuous (tensorSquare (n := n)) := by + rw [show tensorSquare (n := n) = fun T => ‖tensorVector T‖^2 from funext tensorSquare_norm] + apply Continuous.pow + apply Continuous.norm + exact (PiLp.continuous_toLp 2 _).comp (continuous_pi (fun p => + (continuous_apply p.2.2).comp ((continuous_apply p.2.1).comp (continuous_apply p.1)))) + +lemma continuous_tensorVector : Continuous (tensorVector (n := n)) := by + exact (PiLp.continuous_toLp 2 _).comp (continuous_pi (fun p => + (continuous_apply p.2.2).comp ((continuous_apply p.2.1).comp (continuous_apply p.1)))) + +lemma tensorPairAt_one_continuous : Continuous + (fun q : ConnectionTensor n × ConnectionTensor n => tensorPairAt 1 1 q.1 q.2) := by + simp_rw [tensorPairAt_one_inner] + exact Continuous.inner (𝕜 := ℂ) (continuous_tensorVector.comp continuous_snd) + (continuous_tensorVector.comp continuous_fst) + +lemma tensorPairAt_one_smul (r s : ℝ) (T U : ConnectionTensor n) : + tensorPairAt 1 1 (r • T) (s • U) = ((r*s : ℝ) : ℂ)*tensorPairAt 1 1 T U := by + simp only [tensorPairAt_one,Pi.smul_apply] + change (∑ i, (((r:ℂ) • T i)*((s:ℂ) • U i)ᴴ).trace) = _ + simp only [Matrix.conjTranspose_smul,Complex.star_def,Complex.conj_ofReal, + smul_mul_assoc,mul_smul_comm,smul_smul,Matrix.trace_smul,smul_eq_mul, + ← Complex.ofReal_mul,← Finset.mul_sum] + rw [mul_comm s r] + +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CalabiPairCalculus.lean b/lean/OAI/Geometry/PrescribedPotential/CalabiPairCalculus.lean new file mode 100644 index 0000000000000000000000000000000000000000..2afe6f50d3e5872ca75811b9450d34389fcd559d --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CalabiPairCalculus.lean @@ -0,0 +1,128 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CalabiConnection +import OAI.Geometry.PrescribedPotential.CalabiCovariant +import OAI.Geometry.PrescribedPotential.CalabiTensorAlgebra +import OAI.Geometry.PrescribedPotential.MatrixTensorCalculus + +namespace OAI + +/-! Calabi Pair Calculus. -/ + +section + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +variable {n : ℕ} + +lemma calabi_pair_matrix_trace_smooth {M : V n → Matrix (Fin n) (Fin n) ℂ} {z : V n} + (hM : ContDiffAt ℝ ∞ M z) : ContDiffAt ℝ ∞ (fun y => (M y).trace) z := + ContDiffAt.sum (fun i _ => entry_smooth hM i i) + +lemma tensorPair_smooth {P M : V n → Matrix (Fin n) (Fin n) ℂ} + {T U : Fin n → V n → Matrix (Fin n) (Fin n) ℂ} {z : V n} + (hP : ContDiffAt ℝ ∞ P z) (hM : ContDiffAt ℝ ∞ M z) + (hT : ∀ i, ContDiffAt ℝ ∞ (T i) z) (hU : ∀ i, ContDiffAt ℝ ∞ (U i) z) : + ContDiffAt ℝ ∞ (fun y => tensorPairAt (P y) (M y) (fun i => T i y) (fun i => U i y)) z := by + exact ContDiffAt.sum (fun i _ => ContDiffAt.sum (fun j _ => + (entry_smooth hP i j).mul (calabi_pair_matrix_trace_smooth (matrix_smooth_mul + (matrix_smooth_mul (matrix_smooth_mul (hT i) hP) (matrix_smooth_conjTranspose (hU j))) hM)))) + +namespace LocalKaehlerField +variable (K : LocalKaehlerField n) + +def tensorPair (T U : Fin n → V n → Matrix (Fin n) (Fin n) ℂ) (z : V n) : ℂ := + tensorPairAt (K.matrix z)⁻¹ (K.matrix z) (fun i => T i z) (fun i => U i z) + +lemma tensorPair_smoothOn {T U : Fin n → V n → Matrix (Fin n) (Fin n) ℂ} + (hT : ∀ i, ContDiffOn ℝ ∞ (T i) K.domain) (hU : ∀ i, ContDiffOn ℝ ∞ (U i) K.domain) : + ContDiffOn ℝ ∞ (K.tensorPair T U) K.domain := by + apply K.isOpen.contDiffOn_iff.mpr + intro z hz + exact tensorPair_smooth (K.inverse_smooth.contDiffAt (K.isOpen.mem_nhds hz)) + (K.smooth.contDiffAt (K.isOpen.mem_nhds hz)) + (fun i => (hT i).contDiffAt (K.isOpen.mem_nhds hz)) + (fun i => (hU i).contDiffAt (K.isOpen.mem_nhds hz)) + +lemma matrix_hol {z : V n} (hz : z ∈ K.domain) (k : Fin n) : + mderiv (-Complex.I) (e k) K.matrix z = K.matrix z*K.connection k z := by + rw [connection,← mul_assoc,Matrix.mul_nonsing_inv _ + (isUnit_iff_ne_zero.mpr (ne_of_gt (K.positive z hz).det_pos)),one_mul] + +lemma inverse_hol {z : V n} (hz : z ∈ K.domain) (k : Fin n) : + mderiv (-Complex.I) (e k) (fun y => (K.matrix y)⁻¹) z = + -K.connection k z*(K.matrix z)⁻¹ := by + rw [mderiv_inverse K.isOpen K.smooth (fun y hy => ne_of_gt (K.positive y hy).det_pos) hz] + simp only [connection,neg_mul] + +lemma tensorPair_hol {T U : Fin n → V n → Matrix (Fin n) (Fin n) ℂ} + (hT : ∀ i, ContDiffOn ℝ ∞ (T i) K.domain) (hU : ∀ i, ContDiffOn ℝ ∞ (U i) K.domain) + {z : V n} (hz : z ∈ K.domain) (k : Fin n) : + dz (e k) (K.tensorPair T U) z = + K.tensorPair (K.covHol T k) U z + + K.tensorPair T (fun j => mderiv Complex.I (e k) (U j)) z := by + have hn := K.isOpen.mem_nhds hz + have hP := K.inverse_smooth.contDiffAt hn + have hM := K.smooth.contDiffAt hn + have ht (i) := (hT i).contDiffAt hn + have hu (i) := (hU i).contDiffAt hn + have hQ (i j) := matrix_smooth_mul (matrix_smooth_mul + (matrix_smooth_mul (ht i) hP) (matrix_smooth_conjTranspose (hu j))) hM + have he (i j) : wderiv (-Complex.I) (e k) + (fun y => ((K.matrix y)⁻¹ i j) * (T i y*(K.matrix y)⁻¹*(U j y)ᴴ*K.matrix y).trace) z = + (-(K.connection k z*(K.matrix z)⁻¹) i j * + (T i z*(K.matrix z)⁻¹*(U j z)ᴴ*K.matrix z).trace + + (K.matrix z)⁻¹ i j * + (mderiv (-Complex.I) (e k) (T i) z*(K.matrix z)⁻¹*(U j z)ᴴ*K.matrix z - + T i z*K.connection k z*(K.matrix z)⁻¹*(U j z)ᴴ*K.matrix z + + T i z*(K.matrix z)⁻¹*(mderiv Complex.I (e k) (U j) z)ᴴ*K.matrix z + + T i z*(K.matrix z)⁻¹*(U j z)ᴴ*K.matrix z*K.connection k z).trace) := by + rw [wderiv_mul ((entry_smooth hP i j).differentiableAt (by simp)) + ((calabi_pair_matrix_trace_smooth (hQ i j)).differentiableAt (by simp)),mderiv_trace (hQ i j)] + change mderiv (-Complex.I) (e k) (fun y => (K.matrix y)⁻¹) z i j * _ + _ = _ + rw [K.inverse_hol hz] + simp only [neg_mul,Matrix.neg_apply] + congr 1 + congr 1 + congr 1 + rw [mderiv_mul (matrix_smooth_mul (matrix_smooth_mul (ht i) hP) + (matrix_smooth_conjTranspose (hu j))) hM, + mderiv_mul (matrix_smooth_mul (ht i) hP) (matrix_smooth_conjTranspose (hu j)), + mderiv_mul (ht i) hP,mderiv_conjTranspose (hu j),K.inverse_hol hz,K.matrix_hol hz] + noncomm_ring + change wderiv (-Complex.I) (e k) (fun y => ∑ i, ∑ j, + ((K.matrix y)⁻¹ i j)*(T i y*(K.matrix y)⁻¹*(U j y)ᴴ*K.matrix y).trace) z = _ + rw [wderiv_sum Finset.univ (fun i _ => (ContDiffAt.sum (fun j _ => + (entry_smooth hP i j).mul (calabi_pair_matrix_trace_smooth (hQ i j)))).differentiableAt (by simp))] + simp only [wderiv_sum Finset.univ (fun j _ => ((entry_smooth hP _ j).mul + (calabi_pair_matrix_trace_smooth (hQ _ j))).differentiableAt (by simp)),he] + exact covariant_pair_algebra (K.matrix z)⁻¹ (K.matrix z) (K.connection k z) + (fun i => T i z) (fun i => U i z) (fun i => mderiv (-Complex.I) (e k) (T i) z) + (fun i => mderiv Complex.I (e k) (U i) z) + +lemma tensorPair_bar {T U : Fin n → V n → Matrix (Fin n) (Fin n) ℂ} + (hT : ∀ i, ContDiffOn ℝ ∞ (T i) K.domain) (hU : ∀ i, ContDiffOn ℝ ∞ (U i) K.domain) + {z : V n} (hz : z ∈ K.domain) (k : Fin n) : + dzbar (e k) (K.tensorPair T U) z = + K.tensorPair (fun i => mderiv Complex.I (e k) (T i)) U z + + K.tensorPair T (K.covHol U k) z := by + have hc {T U : Fin n → V n → Matrix (Fin n) (Fin n) ℂ} {y : V n} (hy : y ∈ K.domain) : + star (K.tensorPair T U y) = K.tensorPair U T y := + tensorPairAt_conj (K.positive y hy).isHermitian.inv (K.positive y hy).isHermitian _ _ + have he : K.tensorPair T U =ᶠ[𝓝 z] (fun y => star (K.tensorPair U T y)) := by + filter_upwards [K.isOpen.mem_nhds hz] with y hy using (hc hy).symm + change wderiv Complex.I (e k) (K.tensorPair T U) z = _ + rw [wderiv_congr he] + change dzbar (e k) (fun y => star (K.tensorPair U T y)) z = _ + rw [dzbar_conj (((K.tensorPair_smoothOn hU hT).contDiffAt + (K.isOpen.mem_nhds hz)).differentiableAt (by simp)),K.tensorPair_hol hU hT hz] + rw [star_add,hc hz,hc hz,add_comm] +end LocalKaehlerField +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CalabiPointInequalities.lean b/lean/OAI/Geometry/PrescribedPotential/CalabiPointInequalities.lean new file mode 100644 index 0000000000000000000000000000000000000000..8f136c4cf49f0d8bf485754827963f91a3c2585d --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CalabiPointInequalities.lean @@ -0,0 +1,79 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CalabiBochner +import OAI.Geometry.PrescribedPotential.CalabiResidualBound + +namespace OAI + +/-! Calabi Point Inequalities. -/ + +section + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus.LocalKaehlerField +variable {n : ℕ} (K : LocalKaehlerField n) + +def calabiGood (z : V n) : ℝ := + (∑ k, tensorSquare (fun i => K.covHol K.connection k i z)) + + ∑ k, tensorSquare (fun i => K.curvature k i z) + +lemma calabiGood_nonneg (z : V n) : 0 ≤ K.calabiGood z := + add_nonneg (Finset.sum_nonneg (fun _ _ => tensorSquare_nonneg _)) + (Finset.sum_nonneg (fun _ _ => tensorSquare_nonneg _)) + +lemma calabiNorm_at_one {z : V n} (hM : K.matrix z = 1) : + K.calabiNorm z = tensorSquare (fun i => K.connection i z) := by + simp only [calabiNorm,tensorPair,hM,inv_one,tensorSquare] + +lemma calabi_bochner_real_at_one {z : V n} (hz : z ∈ K.domain) (hM : K.matrix z = 1) : + (PotentialKaehler.potentialMatrix K.calabiNorm z).trace.re = K.calabiGood z + + calabiResidual (K.ricciHessian z) (fun i => mderiv (-Complex.I) (e i) K.ricciHessian z) + (fun i => K.connection i z) := by + rw [K.calabi_bochner_at_one hz hM] + have he : (fun i => mderiv (-Complex.I) (e i) K.ricciHessian z - + K.connection i z*K.ricciHessian z - ∑ q, K.ricciHessian z q i • K.connection q z) = + (fun i => mderiv (-Complex.I) (e i) K.ricciHessian z) - + ricciRight (K.ricciHessian z) (fun i => K.connection i z) := by + funext i + exact (sub_add_eq_sub_sub _ _ _).symm + rw [he] + simp only [Complex.add_re,Complex.re_sum,calabiGood,tensorSquare,calabiResidual,Complex.add_re] + exact add_assoc _ _ _ + +lemma calabi_gradient_at_one {z : V n} (hz : z ∈ K.domain) (hM : K.matrix z = 1) (k : Fin n) : + ‖dz (e k) (fun y => (K.calabiNorm y : ℂ)) z‖^2 ≤ 2*K.calabiNorm z * + (tensorSquare (fun i => K.covHol K.connection k i z)+tensorSquare (fun i => K.curvature k i z)) := by + have he : (fun y => (K.calabiNorm y : ℂ)) =ᶠ[𝓝 z] K.tensorPair K.connection K.connection := by + filter_upwards [K.isOpen.mem_nhds hz] with y hy using K.calabiNorm_complex hy + have hd : dz (e k) (fun y => (K.calabiNorm y : ℂ)) z = + tensorPairAt 1 1 (fun i => K.covHol K.connection k i z) (fun i => K.connection i z) + + tensorPairAt 1 1 (fun i => K.connection i z) (fun i => K.curvature k i z) := by + change wderiv (-Complex.I) (e k) _ z = _ + rw [wderiv_congr he] + change dz (e k) (K.tensorPair K.connection K.connection) z = _ + rw [K.tensorPair_hol (T := K.connection) (U := K.connection) K.connection_smooth K.connection_smooth hz] + simp only [tensorPair,hM,inv_one] + rfl + rw [hd,K.calabiNorm_at_one hM] + have h1 := tensorPairAt_cauchy (fun i => K.covHol K.connection k i z) (fun i => K.connection i z) + have h2 := tensorPairAt_cauchy (fun i => K.connection i z) (fun i => K.curvature k i z) + have hh := norm_add_le + (tensorPairAt 1 1 (fun i => K.covHol K.connection k i z) (fun i => K.connection i z)) + (tensorPairAt 1 1 (fun i => K.connection i z) (fun i => K.curvature k i z)) + have hs := sq_le_sq₀ (norm_nonneg _) (add_nonneg (norm_nonneg _) (norm_nonneg _)) |>.mpr hh + nlinarith [sq_nonneg (‖tensorPairAt 1 1 (fun i => K.covHol K.connection k i z) (fun i => K.connection i z)‖- + ‖tensorPairAt 1 1 (fun i => K.connection i z) (fun i => K.curvature k i z)‖)] + +lemma calabi_gradient_sum_at_one {z : V n} (hz : z ∈ K.domain) (hM : K.matrix z = 1) : + (∑ k, ‖dz (e k) (fun y => (K.calabiNorm y : ℂ)) z‖^2) ≤ 2*K.calabiNorm z*K.calabiGood z := by + calc + _ ≤ ∑ k, 2*K.calabiNorm z*(tensorSquare (fun i => K.covHol K.connection k i z)+ + tensorSquare (fun i => K.curvature k i z)) := Finset.sum_le_sum (fun k _ => K.calabi_gradient_at_one hz hM k) + _ = _ := by rw [← Finset.mul_sum,Finset.sum_add_distrib]; rfl +end KaehlerCalculus.LocalKaehlerField + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CalabiRescue.lean b/lean/OAI/Geometry/PrescribedPotential/CalabiRescue.lean new file mode 100644 index 0000000000000000000000000000000000000000..f04047418b401019308cfd5e2ad3eee9896d6ef4 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CalabiRescue.lean @@ -0,0 +1,138 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CalabiConnection +import OAI.Geometry.PrescribedPotential.CalabiNormAlgebra +import OAI.Geometry.PrescribedPotential.FrameCompactBounds +import OAI.Geometry.PrescribedPotential.LinearFrameCalculus + +namespace OAI + +/-! Calabi Rescue. -/ + +section + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +variable {n : ℕ} + +def rescueSquare (D : Matrix (Fin n) (Fin n) ℂ) (T : ConnectionTensor n) : ℝ := + ∑ k, frameGram 1 (T k*D) + +lemma rescueSquare_pos {D : Matrix (Fin n) (Fin n) ℂ} (hD : IsUnit D) + {T : ConnectionTensor n} (hT : T ≠ 0) : 0 < rescueSquare D T := by + obtain ⟨k,hk⟩ : ∃ k, T k ≠ 0 := by + by_contra h + apply hT + funext k + exact not_not.mp (fun hk => h ⟨k,hk⟩) + have hkd : T k*D ≠ 0 := by + intro he + apply hk + exact hD.mul_right_cancel (by simpa using he) + unfold rescueSquare + apply Finset.sum_pos' + · intro i _ + simpa only [frameGram,mul_one] using (Complex.nonneg_iff.mp (Matrix.posSemidef_conjTranspose_mul_self (T i*D)).trace_nonneg).1 + · exact ⟨k,Finset.mem_univ _,frameGram_pos Matrix.PosDef.one hkd⟩ + +lemma rescueSquare_smul (D : Matrix (Fin n) (Fin n) ℂ) (T : ConnectionTensor n) (r : ℝ) : + rescueSquare D (r • T) = r^2*rescueSquare D T := by + simp only [rescueSquare,Pi.smul_apply,Matrix.smul_mul] + change (∑ k, frameGram 1 (r • (T k*D))) = _ + simp_rw [frameGram_smul] + rw [Finset.mul_sum] + +lemma rescueSquare_continuous : Continuous (fun p : Matrix (Fin n) (Fin n) ℂ × ConnectionTensor n => + rescueSquare p.1 p.2) := by + unfold rescueSquare + apply continuous_finsetSum + intro k _ + have hc : Continuous (fun p : Matrix (Fin n) (Fin n) ℂ × ConnectionTensor n => p.2 k*p.1) := + ((continuous_apply k).comp continuous_snd).mul continuous_fst + apply continuousOn_univ.mp + exact continuousOn_trace_re (((continuousOn_matrix_star hc.continuousOn).mul + (continuous_const (y := (1 : Matrix (Fin n) (Fin n) ℂ))).continuousOn).mul hc.continuousOn) + +lemma rescueSquare_compact_lower {X : Type*} [TopologicalSpace X] {L : Set X} (hL : IsCompact L) + (D : X → Matrix (Fin n) (Fin n) ℂ) (hD : ContinuousOn D L) (hu : ∀ x ∈ L, IsUnit (D x)) : + ∃ δ : ℝ, 0 < δ ∧ ∀ x ∈ L, ∀ T, δ*tensorSquare T ≤ rescueSquare (D x) T := by + obtain ⟨a,ha,hbound⟩ := compact_homogeneous_positive hL (fun x T => rescueSquare (D x) T) + ((rescueSquare_continuous.comp_continuousOn (f := fun p : X × ConnectionTensor n => (D p.1,p.2)) + ((hD.comp continuous_fst.continuousOn (fun _ h => h.1)).prodMk continuous_snd.continuousOn))) + (fun x hx T hn => rescueSquare_pos (hu x hx) hn) (fun x _ r T => rescueSquare_smul (D x) T r) + obtain ⟨B,hB,hSq⟩ := compact_homogeneous_bound (K := (univ : Set Unit)) isCompact_univ 2 (by decide) + (fun (_ : Unit) (T : ConnectionTensor n) => tensorSquare T) + (continuous_tensorSquare.comp continuous_snd).continuousOn (fun _ _ r T => tensorSquare_smul r T) + have hBp : 0 < B+1 := by linarith + refine ⟨a/(B+1),div_pos ha hBp,?_⟩ + intro x hx T + have hS : tensorSquare T ≤ (B+1)*‖T‖^2 := by + have hh := (le_abs_self (tensorSquare T)).trans (hSq () (mem_univ _) T) + nlinarith [sq_nonneg ‖T‖] + have hh := mul_le_mul_of_nonneg_left hS (div_nonneg ha.le hBp.le) + have he : a/(B+1)*((B+1)*‖T‖^2) = a*‖T‖^2 := by field_simp + exact (he ▸ hh).trans (hbound x hx T) + +namespace LocalKaehlerField +variable (K : LocalKaehlerField n) + +def weightedTrace (D : Matrix (Fin n) (Fin n) ℂ) (z : V n) : ℝ := (Dᴴ*K.matrix z*D).trace.re + +lemma weightedTrace_smooth (D : Matrix (Fin n) (Fin n) ℂ) : + ContDiffOn ℝ ∞ (K.weightedTrace D) K.domain := by + apply K.isOpen.contDiffOn_iff.mpr + intro z hz + have hs := matrix_smooth_mul (matrix_smooth_mul (contDiffAt_const (c := Dᴴ)) + (K.smooth.contDiffAt (K.isOpen.mem_nhds hz))) (contDiffAt_const (c := D)) + exact Complex.reCLM.contDiff.contDiffAt.comp z (ContDiffAt.sum + (fun i (_ : i ∈ (Finset.univ : Finset (Fin n))) => entry_smooth hs i i)) + +lemma weightedTrace_complex (D : Matrix (Fin n) (Fin n) ℂ) {z : V n} (hz : z ∈ K.domain) : + (K.weightedTrace D z : ℂ) = (Dᴴ*K.matrix z*D).trace := by + apply Complex.ext + · rfl + · exact (Complex.nonneg_iff.mp ((K.positive z hz).posSemidef.conjTranspose_mul_mul_same D).trace_nonneg).2 + +lemma weightedTrace_laplacian_at_one (D : Matrix (Fin n) (Fin n) ℂ) + {z : V n} (hz : z ∈ K.domain) (hM : K.matrix z = 1) : + (PotentialKaehler.potentialMatrix (K.weightedTrace D) z).trace.re = + (Dᴴ*K.ricciHessian z*D).trace.re + rescueSquare D (fun k => K.connection k z) := by + have hn := K.isOpen.mem_nhds hz + have hs := K.smooth.contDiffAt hn + have ht := K.weightedTrace_smooth D |>.contDiffAt hn + have he : (fun y => (K.weightedTrace D y:ℂ)) =ᶠ[𝓝 z] (fun y => (Dᴴ*K.matrix y*D).trace) := by + filter_upwards [hn] with y hy using K.weightedTrace_complex D hy + have hd (k : Fin n) : dz (e k) (fun y => (K.weightedTrace D y:ℂ)) =ᶠ[𝓝 z] + (fun y => (Dᴴ*mderiv (-Complex.I) (e k) K.matrix y*D).trace) := by + filter_upwards [hn] with y hy + have hey : (fun y => (K.weightedTrace D y:ℂ)) =ᶠ[𝓝 y] (fun y => (Dᴴ*K.matrix y*D).trace) := by + filter_upwards [K.isOpen.mem_nhds hy] with x hx using K.weightedTrace_complex D hx + change wderiv (-Complex.I) _ _ _ = _ + rw [wderiv_congr hey,mderiv_trace (matrix_smooth_mul (matrix_smooth_mul contDiffAt_const + (K.smooth.contDiffAt (K.isOpen.mem_nhds hy))) contDiffAt_const), + mderiv_congruence (K.smooth.contDiffAt (K.isOpen.mem_nhds hy))] + have hdd (k : Fin n) : (PotentialKaehler.potentialMatrix (K.weightedTrace D) z) k k = + (Dᴴ*mderiv Complex.I (e k) (mderiv (-Complex.I) (e k) K.matrix) z*D).trace := by + rw [potentialMatrix_eq_dzbar_dz ht] + change wderiv Complex.I (e k) (dz (e k) (fun y => (K.weightedTrace D y:ℂ))) z = _ + rw [wderiv_congr (hd k),mderiv_trace (matrix_smooth_mul (matrix_smooth_mul contDiffAt_const + (mderiv_smooth hs _ _)) contDiffAt_const),mderiv_congruence (mderiv_smooth hs _ _)] + have hc := ricci_cancellation_at_one K.isOpen K.smooth K.positive K.closed hz hM + change (∑ k, (PotentialKaehler.potentialMatrix (K.weightedTrace D) z) k k).re = _ + simp_rw [hdd] + rw [← Matrix.trace_sum,← Matrix.sum_mul,← Matrix.mul_sum,hc,mul_add,add_mul, + Matrix.trace_add,Complex.add_re] + congr 1 + simp only [Matrix.mul_sum,Matrix.sum_mul,Matrix.trace_sum,Complex.re_sum,rescueSquare,frameGram, + connection,hM,inv_one,one_mul,Matrix.conjTranspose_mul,mul_assoc] + apply Finset.sum_congr rfl + intro k _ + rw [mderiv_bar_eq_conjTranspose K.isOpen K.smooth (fun y hy => (K.positive y hy).isHermitian) hz] +end LocalKaehlerField +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CalabiResidualBound.lean b/lean/OAI/Geometry/PrescribedPotential/CalabiResidualBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..ee8e64cbae76c3d166e1ac11c6c112a02b2efe0d --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CalabiResidualBound.lean @@ -0,0 +1,144 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CalabiNormAlgebra +import OAI.Geometry.PrescribedPotential.CompactHomogeneousBounds + +namespace OAI + +/-! Calabi Residual Bound. -/ + +section + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +variable {n : ℕ} + +def ricciRight (H : Matrix (Fin n) (Fin n) ℂ) (T : ConnectionTensor n) : ConnectionTensor n := + fun i => T i*H + ∑ q, H q i • T q + +def ricciLeft (H : Matrix (Fin n) (Fin n) ℂ) (T : ConnectionTensor n) : ConnectionTensor n := + fun i => H*T i + +def calabiResidual (H : Matrix (Fin n) (Fin n) ℂ) (D T : ConnectionTensor n) : ℝ := + (tensorPairAt 1 1 (D-ricciRight H T) T + tensorPairAt 1 1 T (D-ricciLeft H T)).re + +lemma continuous_ricciRight : Continuous + (fun q : Matrix (Fin n) (Fin n) ℂ × ConnectionTensor n => ricciRight q.1 q.2) := by + apply continuous_pi + intro i + apply Continuous.add + · exact ((continuous_apply i).comp continuous_snd).mul continuous_fst + · apply continuous_finsetSum + intro q _ + exact ((continuous_apply_apply q i).comp continuous_fst).smul + ((continuous_apply q).comp continuous_snd) + +lemma continuous_ricciLeft : Continuous + (fun q : Matrix (Fin n) (Fin n) ℂ × ConnectionTensor n => ricciLeft q.1 q.2) := by + exact continuous_pi (fun i => continuous_fst.mul ((continuous_apply i).comp continuous_snd)) + +lemma ricciRight_smul (H : Matrix (Fin n) (Fin n) ℂ) (r : ℝ) (T : ConnectionTensor n) : + ricciRight H (r • T) = r • ricciRight H T := by + funext i + simp only [ricciRight,Pi.smul_apply,smul_mul_assoc,smul_add,Finset.smul_sum] + congr 1 + apply Finset.sum_congr rfl + intro q _ + exact smul_comm _ _ _ + +lemma ricciLeft_smul (H : Matrix (Fin n) (Fin n) ℂ) (r : ℝ) (T : ConnectionTensor n) : + ricciLeft H (r • T) = r • ricciLeft H T := by + funext i + change H*(r • T i) = r • (H*T i) + exact mul_smul_comm _ _ _ + +lemma calabiResidual_homogeneous (H : Matrix (Fin n) (Fin n) ℂ) + (D T : ConnectionTensor n) (r : ℝ) : + calabiResidual H (r • D) (r • T) = r^2*calabiResidual H D T := by + unfold calabiResidual + rw [ricciRight_smul,ricciLeft_smul,← smul_sub,← smul_sub,tensorPairAt_one_smul,tensorPairAt_one_smul] + simp only [← mul_add,Complex.mul_re,Complex.ofReal_re,Complex.ofReal_im,zero_mul,sub_zero] + ring + +lemma continuous_calabiResidual : Continuous + (fun p : (Matrix (Fin n) (Fin n) ℂ × ConnectionTensor n) × ConnectionTensor n => + calabiResidual p.1.1 p.1.2 p.2) := by + have hH := continuous_fst.comp (continuous_fst (X := Matrix (Fin n) (Fin n) ℂ × ConnectionTensor n) + (Y := ConnectionTensor n)) + have hD := continuous_snd.comp (continuous_fst (X := Matrix (Fin n) (Fin n) ℂ × ConnectionTensor n) + (Y := ConnectionTensor n)) + have hT := continuous_snd (X := Matrix (Fin n) (Fin n) ℂ × ConnectionTensor n) (Y := ConnectionTensor n) + have hR : Continuous (fun p : (Matrix (Fin n) (Fin n) ℂ × ConnectionTensor n) × ConnectionTensor n => + ricciRight p.1.1 p.2) := continuous_ricciRight.comp (f := fun p : (Matrix (Fin n) (Fin n) ℂ × ConnectionTensor n) × ConnectionTensor n => (p.1.1,p.2)) (hH.prodMk hT) + have hL : Continuous (fun p : (Matrix (Fin n) (Fin n) ℂ × ConnectionTensor n) × ConnectionTensor n => + ricciLeft p.1.1 p.2) := continuous_ricciLeft.comp (f := fun p : (Matrix (Fin n) (Fin n) ℂ × ConnectionTensor n) × ConnectionTensor n => (p.1.1,p.2)) (hH.prodMk hT) + have hA : Continuous (fun p : (Matrix (Fin n) (Fin n) ℂ × ConnectionTensor n) × ConnectionTensor n => + tensorPairAt 1 1 (p.1.2-ricciRight p.1.1 p.2) p.2) := + tensorPairAt_one_continuous.comp (f := fun p : (Matrix (Fin n) (Fin n) ℂ × ConnectionTensor n) × ConnectionTensor n => (p.1.2-ricciRight p.1.1 p.2,p.2)) + ((hD.sub hR).prodMk hT) + have hB : Continuous (fun p : (Matrix (Fin n) (Fin n) ℂ × ConnectionTensor n) × ConnectionTensor n => + tensorPairAt 1 1 p.2 (p.1.2-ricciLeft p.1.1 p.2)) := + tensorPairAt_one_continuous.comp (f := fun p : (Matrix (Fin n) (Fin n) ℂ × ConnectionTensor n) × ConnectionTensor n => (p.2,p.1.2-ricciLeft p.1.1 p.2)) + (hT.prodMk (hD.sub hL)) + exact Complex.continuous_re.comp (f := fun p : (Matrix (Fin n) (Fin n) ℂ × ConnectionTensor n) × ConnectionTensor n => + tensorPairAt 1 1 (p.1.2-ricciRight p.1.1 p.2) p.2 + + tensorPairAt 1 1 p.2 (p.1.2-ricciLeft p.1.1 p.2)) (hA.add hB) + +lemma tensorSquare_controls_norm : ∃ δ : ℝ, 0 < δ ∧ ∀ T : ConnectionTensor n, δ*‖T‖^2 ≤ tensorSquare T := by + obtain ⟨δ,hδ,h⟩ := compact_homogeneous_positive (K := (univ : Set Unit)) isCompact_univ + (fun (_ : Unit) (T : ConnectionTensor n) => tensorSquare T) + (continuous_tensorSquare.comp continuous_snd).continuousOn + (fun _ _ _ hT => tensorSquare_pos hT) (fun _ _ r T => tensorSquare_smul r T) + exact ⟨δ,hδ,fun T => h () (mem_univ _) T⟩ + +lemma calabiResidual_compact_bound {X : Type*} [TopologicalSpace X] {L : Set X} (hL : IsCompact L) + (H : X → Matrix (Fin n) (Fin n) ℂ) (D : X → ConnectionTensor n) + (hH : ContinuousOn H L) (hD : ContinuousOn D L) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ x ∈ L, ∀ T : ConnectionTensor n, + |calabiResidual (H x) (D x) T| ≤ C*(1+tensorSquare T) := by + let E := ℝ × ConnectionTensor n + let F : X → E → ℝ := fun x v => calabiResidual (H x) (v.1 • D x) v.2 + have hc : ContinuousOn (fun q : X × E => F q.1 q.2) (L ×ˢ Metric.closedBall 0 1) := by + have hx := continuous_fst.continuousOn (s := L ×ˢ Metric.closedBall (0:E) 1) + have h1 := (continuous_fst.comp continuous_snd).continuousOn + (s := L ×ˢ Metric.closedBall (0:E) 1) + have h2 := (continuous_snd.comp continuous_snd).continuousOn + (s := L ×ˢ Metric.closedBall (0:E) 1) + exact continuous_calabiResidual.comp_continuousOn + (f := fun q : X × E => ((H q.1,q.2.1 • D q.1),q.2.2)) + (((hH.comp hx (fun _ h => h.1)).prodMk (h1.smul (hD.comp hx (fun _ h => h.1)))).prodMk h2) + have hh (x : X) (_ : x ∈ L) (r : ℝ) (v : E) : F x (r • v) = r^2*F x v := by + change calabiResidual (H x) ((r*v.1) • D x) (r • v.2) = _ + rw [mul_smul,calabiResidual_homogeneous] + obtain ⟨B,hB,hbound⟩ := compact_homogeneous_bound hL 2 (by decide) F hc hh + obtain ⟨δ,hδ,hnorm⟩ := tensorSquare_controls_norm (n := n) + refine ⟨B*(1+δ⁻¹),mul_nonneg hB (by positivity),?_⟩ + intro x hx T + have hb := hbound x hx (1,T) + change |calabiResidual (H x) ((1:ℝ) • D x) T| ≤ B*‖((1:ℝ),T)‖^2 at hb + rw [one_smul] at hb + have hp : ‖((1:ℝ),T)‖^2 ≤ 1+‖T‖^2 := by + rw [Prod.norm_def,Real.norm_eq_abs,abs_one] + rcases le_total 1 ‖T‖ with ht | ht + · rw [max_eq_right ht] + linarith + · rw [max_eq_left ht] + nlinarith [sq_nonneg ‖T‖] + have ht : ‖T‖^2 ≤ δ⁻¹*tensorSquare T := by + have hh := mul_le_mul_of_nonneg_left (hnorm T) (inv_nonneg.mpr hδ.le) + simpa only [← mul_assoc,inv_mul_cancel₀ hδ.ne',one_mul] using hh + have hs := tensorSquare_nonneg T + have hh : B*(1+‖T‖^2) ≤ B*(1+δ⁻¹)*(1+tensorSquare T) := by + have hh : 1+‖T‖^2 ≤ (1+δ⁻¹)*(1+tensorSquare T) := by + have hd : 0 ≤ δ⁻¹ := inv_nonneg.mpr hδ.le + nlinarith + simpa only [mul_assoc] using mul_le_mul_of_nonneg_left hh hB + exact hb.trans ((mul_le_mul_of_nonneg_left hp hB).trans hh) +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CalabiRicciContraction.lean b/lean/OAI/Geometry/PrescribedPotential/CalabiRicciContraction.lean new file mode 100644 index 0000000000000000000000000000000000000000..3f1faa64b424e5942abb6f58505d2f76caa59ccc --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CalabiRicciContraction.lean @@ -0,0 +1,94 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CalabiConnection + +namespace OAI + +/-! Calabi Ricci Contraction. -/ + +section + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus.LocalKaehlerField +variable {n : ℕ} (K : LocalKaehlerField n) + +lemma lower_curvature_formula {z : V n} (hz : z ∈ K.domain) (i j : Fin n) : + K.matrix z * K.curvature i j z = + mderiv Complex.I (e i) (mderiv (-Complex.I) (e j) K.matrix) z - + mderiv Complex.I (e i) K.matrix z * (K.matrix z)⁻¹ * + mderiv (-Complex.I) (e j) K.matrix z := by + rw [K.curvature_formula hz,← mul_assoc,Matrix.mul_nonsing_inv _ + (isUnit_iff_ne_zero.mpr (ne_of_gt (K.positive z hz).det_pos)),one_mul] + +lemma lower_curvature_symmetry {z : V n} (hz : z ∈ K.domain) (i j a b : Fin n) : + (K.matrix z * K.curvature i j z) a b = (K.matrix z * K.curvature a b z) i j := by + rw [K.lower_curvature_formula hz,K.lower_curvature_formula hz] + simp only [Matrix.sub_apply] + congr 1 + · exact closed_mixed_symmetry K.isOpen K.smooth + (fun y hy => (K.positive y hy).isHermitian) K.closed hz a b i j + · simp only [Matrix.mul_apply,Finset.sum_mul] + apply Finset.sum_congr rfl + intro k _ + apply Finset.sum_congr rfl + intro l _ + change (dzbar (e i) (fun y => K.matrix y a l) z * (K.matrix z)⁻¹ l k) * + dz (e j) (fun y => K.matrix y k b) z = + (dzbar (e a) (fun y => K.matrix y i l) z * (K.matrix z)⁻¹ l k) * + dz (e b) (fun y => K.matrix y k j) z + rw [closed_dzbar_symmetry K.isOpen K.smooth + (fun y hy => (K.positive y hy).isHermitian) K.closed hz a l i, + closed_dz_symmetry K.isOpen K.smooth + (fun y hy => (K.positive y hy).isHermitian) K.closed hz k b j] + +lemma ricciHessian_contraction {z : V n} (hz : z ∈ K.domain) : + K.ricciHessian z = ∑ p, ∑ q, ((K.matrix z)⁻¹ p q) • + (K.matrix z * K.curvature q p z) := by + have hi : (K.matrix z)⁻¹*K.matrix z = 1 := Matrix.nonsing_inv_mul _ + (isUnit_iff_ne_zero.mpr (ne_of_gt (K.positive z hz).det_pos)) + ext a b + rw [K.ricciHessian_trace hz] + have he : K.curvature a b z = (K.matrix z)⁻¹*(K.matrix z*K.curvature a b z) := by + rw [← mul_assoc,hi,one_mul] + conv_lhs => rw [he] + simp only [Matrix.trace,Matrix.diag_apply,Matrix.mul_apply,Matrix.sum_apply, + Matrix.smul_apply,smul_eq_mul] + apply Finset.sum_congr rfl + intro p _ + apply Finset.sum_congr rfl + intro q _ + congr 1 + exact K.lower_curvature_symmetry hz a b q p + +lemma curvature_contraction {z : V n} (hz : z ∈ K.domain) : + (∑ p, ∑ q, ((K.matrix z)⁻¹ p q) • K.curvature q p z) = + (K.matrix z)⁻¹ * K.ricciHessian z := by + rw [K.ricciHessian_contraction hz] + simp only [Matrix.mul_sum,Matrix.mul_smul,← Matrix.mul_assoc, + Matrix.nonsing_inv_mul _ (isUnit_iff_ne_zero.mpr (ne_of_gt (K.positive z hz).det_pos)),one_mul] + +lemma connection_hol_derivative {z : V n} (hz : z ∈ K.domain) (i j : Fin n) : + mderiv (-Complex.I) (e i) (K.connection j) z = + (K.matrix z)⁻¹ * mderiv (-Complex.I) (e i) (mderiv (-Complex.I) (e j) K.matrix) z - + K.connection i z * K.connection j z := by + have hs := K.smooth.contDiffAt (K.isOpen.mem_nhds hz) + unfold connection + rw [mderiv_mul (K.inverse_smooth.contDiffAt (K.isOpen.mem_nhds hz)) + (mderiv_smooth hs _ _), mderiv_inverse K.isOpen K.smooth + (fun y hy => ne_of_gt (K.positive y hy).det_pos) hz] + noncomm_ring + +lemma connection_hol_flat {z : V n} (hz : z ∈ K.domain) (i j : Fin n) : + mderiv (-Complex.I) (e i) (K.connection j) z - + mderiv (-Complex.I) (e j) (K.connection i) z = + K.connection j z*K.connection i z-K.connection i z*K.connection j z := by + rw [K.connection_hol_derivative hz,K.connection_hol_derivative hz, + mderiv_comm (K.smooth.contDiffAt (K.isOpen.mem_nhds hz)) (-Complex.I) (-Complex.I) (e i) (e j)] + abel +end KaehlerCalculus.LocalKaehlerField + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CalabiRicciFrames.lean b/lean/OAI/Geometry/PrescribedPotential/CalabiRicciFrames.lean new file mode 100644 index 0000000000000000000000000000000000000000..7ce7b1c3756327a3c998cf7d4c4ef3a6459ada24 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CalabiRicciFrames.lean @@ -0,0 +1,94 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.BoundedNormalFrames +import OAI.Geometry.PrescribedPotential.CalabiRescue +import OAI.Geometry.PrescribedPotential.CalabiResidualBound + +namespace OAI + +/-! Calabi Ricci Frames. -/ + +section + +noncomputable section +open Set Metric Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +variable {n : ℕ} + +def frameRicciJet (J : ConnectionTensor n) (C : Matrix (Fin n) (Fin n) ℂ) : ConnectionTensor n := + fun i => Cᴴ*(∑ p, C p i • J p)*C + +lemma frameRicciJet_continuous : Continuous + (fun q : ConnectionTensor n × Matrix (Fin n) (Fin n) ℂ => frameRicciJet q.1 q.2) := by + apply continuous_pi + intro i + apply Continuous.matrix_mul _ continuous_snd + apply Continuous.matrix_mul (continuousOn_univ.mp (continuousOn_matrix_star continuous_snd.continuousOn)) + apply continuous_finsetSum + intro p _ + exact ((continuous_apply_apply p i).comp continuous_snd).smul ((continuous_apply p).comp continuous_fst) + +lemma frameRicci_continuousOn {X : Type*} [TopologicalSpace X] {L : Set X} + (H : X → Matrix (Fin n) (Fin n) ℂ) (hH : ContinuousOn H L) (B : ℝ) : + ContinuousOn (fun q : X × (Matrix (Fin n) (Fin n) ℂ × Matrix (Fin n) (Fin n) ℂ) => + q.2.1ᴴ*H q.1*q.2.1) (L ×ˢ boundedFramePairs B) := by + have hc : Continuous (fun q : X × (Matrix (Fin n) (Fin n) ℂ × Matrix (Fin n) (Fin n) ℂ) => q.2.1) := + continuous_fst.comp continuous_snd + exact ((continuousOn_matrix_star hc.continuousOn).mul + (hH.comp continuous_fst.continuousOn (fun _ h => h.1))).mul hc.continuousOn + +lemma frameRicciJet_continuousOn {X : Type*} [TopologicalSpace X] {L : Set X} + (J : X → ConnectionTensor n) (hJ : ContinuousOn J L) (B : ℝ) : + ContinuousOn (fun q : X × (Matrix (Fin n) (Fin n) ℂ × Matrix (Fin n) (Fin n) ℂ) => + frameRicciJet (J q.1) q.2.1) (L ×ˢ boundedFramePairs B) := by + apply frameRicciJet_continuous.comp_continuousOn + (f := fun q : X × (Matrix (Fin n) (Fin n) ℂ × Matrix (Fin n) (Fin n) ℂ) => (J q.1,q.2.1)) + exact (hJ.comp continuous_fst.continuousOn (fun _ h => h.1)).prodMk + (continuous_fst.comp continuous_snd).continuousOn + +lemma frameRicciTrace_continuousOn {X : Type*} [TopologicalSpace X] {L : Set X} + (H : X → Matrix (Fin n) (Fin n) ℂ) (hH : ContinuousOn H L) (B : ℝ) : + ContinuousOn (fun q : X × (Matrix (Fin n) (Fin n) ℂ × Matrix (Fin n) (Fin n) ℂ) => + (q.2.2ᴴ*(q.2.1ᴴ*H q.1*q.2.1)*q.2.2).trace.re) (L ×ˢ boundedFramePairs B) := by + have hc : Continuous (fun q : X × (Matrix (Fin n) (Fin n) ℂ × Matrix (Fin n) (Fin n) ℂ) => q.2.2) := + continuous_snd.comp continuous_snd + exact continuousOn_trace_re (((continuousOn_matrix_star hc.continuousOn).mul + (frameRicci_continuousOn H hH B)).mul hc.continuousOn) + +lemma calabi_frame_uniform {X : Type*} [TopologicalSpace X] {L : Set X} (hL : IsCompact L) + (H : X → Matrix (Fin n) (Fin n) ℂ) (J : X → ConnectionTensor n) + (hH : ContinuousOn H L) (hJ : ContinuousOn J L) (B : ℝ) : + ∃ C δ : ℝ, 0 ≤ C ∧ 0 < δ ∧ ∀ x ∈ L, + ∀ p ∈ boundedFramePairs (n := n) B, ∀ T : ConnectionTensor n, + -C*(1+tensorSquare T) ≤ calabiResidual (p.1ᴴ*H x*p.1) (frameRicciJet (J x) p.1) T ∧ + -C ≤ (p.2ᴴ*(p.1ᴴ*H x*p.1)*p.2).trace.re ∧ + δ*tensorSquare T ≤ rescueSquare p.2 T := by + let E := Matrix (Fin n) (Fin n) ℂ × Matrix (Fin n) (Fin n) ℂ + let Q := L ×ˢ boundedFramePairs (n := n) B + have hQ : IsCompact Q := hL.prod (boundedFramePairs_compact B) + let H' : X × E → Matrix (Fin n) (Fin n) ℂ := fun q => q.2.1ᴴ*H q.1*q.2.1 + let J' : X × E → ConnectionTensor n := fun q => frameRicciJet (J q.1) q.2.1 + have hh : ContinuousOn H' Q := frameRicci_continuousOn H hH B + have hj : ContinuousOn J' Q := frameRicciJet_continuousOn J hJ B + obtain ⟨C1,hC1p,hres⟩ := calabiResidual_compact_bound hQ H' J' hh hj + have ht : ContinuousOn (fun q : X × E => (q.2.2ᴴ*H' q*q.2.2).trace.re) Q := + frameRicciTrace_continuousOn H hH B + obtain ⟨C2,htrace⟩ := hQ.exists_bound_of_continuousOn ht + obtain ⟨δ,hδ,hresc⟩ := rescueSquare_compact_lower (boundedFramePairs_compact (n := n) B) + Prod.snd continuous_snd.continuousOn (fun p hp => (boundedFramePairs_units hp).2) + let C := max C1 C2 + refine ⟨C,δ,hC1p.trans (le_max_left _ _),hδ,?_⟩ + intro x hx p hp T + have hq : (x,p) ∈ Q := ⟨hx,hp⟩ + refine ⟨?_,?_,hresc p hp T⟩ + · have hh := hres (x,p) hq T + have hr := (neg_le_neg hh).trans (neg_abs_le (calabiResidual (H' (x,p)) (J' (x,p)) T)) + have he := (neg_le_neg (mul_le_mul_of_nonneg_right (le_max_left C1 C2) (add_nonneg zero_le_one (tensorSquare_nonneg T)))).trans hr + simpa only [neg_mul,C,H',J'] using he + · exact (neg_le_neg ((htrace (x,p) hq).trans (le_max_right C1 C2))).trans (neg_abs_le _) +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CalabiTensorAlgebra.lean b/lean/OAI/Geometry/PrescribedPotential/CalabiTensorAlgebra.lean new file mode 100644 index 0000000000000000000000000000000000000000..fa262023057192cf7546d4be37b957e97da81b10 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CalabiTensorAlgebra.lean @@ -0,0 +1,100 @@ +import Mathlib + +namespace OAI + +/-! Calabi Tensor Algebra. -/ + +section + + + +noncomputable section +open Matrix +open scoped ComplexOrder MatrixOrder +namespace KaehlerCalculus +variable {n : ℕ} +abbrev ConnectionTensor (n : ℕ) := Fin n → Matrix (Fin n) (Fin n) ℂ + +def tensorPairAt (P M : Matrix (Fin n) (Fin n) ℂ) (T U : ConnectionTensor n) : ℂ := + ∑ i, ∑ j, P i j * (T i*P*(U j)ᴴ*M).trace + +lemma tensorPairAt_one (T U : ConnectionTensor n) : tensorPairAt 1 1 T U = + ∑ i, (T i*(U i)ᴴ).trace := by + simp [tensorPairAt,Matrix.one_apply] + +lemma tensorPairAt_add_left (P M : Matrix (Fin n) (Fin n) ℂ) (T U W : ConnectionTensor n) : + tensorPairAt P M (fun i => T i+U i) W = tensorPairAt P M T W+tensorPairAt P M U W := by + simp only [tensorPairAt,add_mul,Matrix.trace_add,mul_add,Finset.sum_add_distrib] + +lemma tensorPairAt_sub_left (P M : Matrix (Fin n) (Fin n) ℂ) (T U W : ConnectionTensor n) : + tensorPairAt P M (fun i => T i-U i) W = tensorPairAt P M T W-tensorPairAt P M U W := by + simp only [tensorPairAt,sub_mul,Matrix.trace_sub,mul_sub,Finset.sum_sub_distrib] + +lemma tensorPairAt_conj {P M : Matrix (Fin n) (Fin n) ℂ} (hP : P.IsHermitian) + (hM : M.IsHermitian) (T U : ConnectionTensor n) : + star (tensorPairAt P M T U) = tensorPairAt P M U T := by + simp only [tensorPairAt,star_sum,star_mul,← Matrix.trace_conjTranspose, + Matrix.conjTranspose_mul,Matrix.conjTranspose_conjTranspose,hM.eq,hP.eq] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + rw [← hP.apply i j] + have hc : (M*(U i*(P*(T j)ᴴ))).trace = (U i*P*(T j)ᴴ*M).trace := by + simpa only [mul_assoc] using Matrix.trace_mul_comm M (U i*P*(T j)ᴴ) + rw [hc] + ring + +lemma tensorPairAt_self_real {P M : Matrix (Fin n) (Fin n) ℂ} (hP : P.IsHermitian) + (hM : M.IsHermitian) (T : ConnectionTensor n) : + (tensorPairAt P M T T).im = 0 := by + have he := congrArg Complex.im (tensorPairAt_conj hP hM T T) + simp only [Complex.star_def,Complex.conj_im] at he + linarith + +lemma matrix_contraction_reindex (P C : Matrix (Fin n) (Fin n) ℂ) + (Q : Fin n → Fin n → ℂ) : + (∑ i, ∑ j, (C*P) i j*Q i j) = ∑ i, ∑ j, P i j * ∑ q, C q i*Q q j := by + simp only [Matrix.mul_apply,Finset.sum_mul,Finset.mul_sum] + calc + (∑ i, ∑ j, ∑ q, C i q*P q j*Q i j) = + ∑ q, ∑ j, ∑ i, C i q*P q j*Q i j := by + trans ∑ i, ∑ q, ∑ j, C i q*P q j*Q i j + · apply Finset.sum_congr rfl + intro i _ + rw [Finset.sum_comm] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro q _ + rw [Finset.sum_comm] + _ = _ := by + apply Finset.sum_congr rfl + intro q _ + apply Finset.sum_congr rfl + intro j _ + apply Finset.sum_congr rfl + intro i _ + ring + +lemma covariant_pair_algebra (P M C : Matrix (Fin n) (Fin n) ℂ) + (T U A B : ConnectionTensor n) : + (∑ i, ∑ j, (-(C*P) i j*(T i*P*(U j)ᴴ*M).trace+ + P i j*(A i*P*(U j)ᴴ*M-T i*C*P*(U j)ᴴ*M+ + T i*P*(B j)ᴴ*M+T i*P*(U j)ᴴ*M*C).trace)) = + tensorPairAt P M (fun i => A i+C*T i-T i*C-∑ q, C q i • T q) U + + tensorPairAt P M T B := by + have hc (i j) : (C*T i*P*(U j)ᴴ*M).trace = (T i*P*(U j)ᴴ*M*C).trace := by + simpa only [mul_assoc] using Matrix.trace_mul_comm C (T i*P*(U j)ᴴ*M) + simp only [tensorPairAt,sub_mul,add_mul,Matrix.sum_mul,Matrix.smul_mul, + Matrix.trace_add,Matrix.trace_sub,Matrix.trace_sum,Matrix.trace_smul,smul_eq_mul, + hc,mul_add,mul_sub,Finset.sum_add_distrib,Finset.sum_sub_distrib, + neg_mul,Finset.sum_neg_distrib] + rw [matrix_contraction_reindex P C (fun i j => (T i*P*(U j)ᴴ*M).trace)] + ring +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/ChartParametrix.lean b/lean/OAI/Geometry/PrescribedPotential/ChartParametrix.lean new file mode 100644 index 0000000000000000000000000000000000000000..555d9717fdd3e380e479e2cad1e7bfe13ba5d43f --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/ChartParametrix.lean @@ -0,0 +1,135 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.MetricLocalization + +namespace OAI + +/-! Chart Parametrix. -/ + +section + + + +noncomputable section +open Filter Set Topology MeasureTheory TemperedDistribution LineDeriv +open scoped SchwartzMap BoundedContinuousFunction ComplexOrder MatrixOrder Matrix.Norms.Elementwise ContDiff + +namespace MetricLocalization +open EllipticKernel FrozenPoisson SobolevChart +variable {n : ℕ} + +abbrev BasisIndex (n : ℕ) := Fin (Module.finrank ℝ (EC n)) + +def chartDifferential (c : BasisIndex n → BasisIndex n → EC n →ᵇ ℂ) : + 𝓢'(EC n, ℂ) →L[ℂ] 𝓢'(EC n, ℂ) := + ∑ k, ∑ l, smulLeftCLM ℂ (c k l) ∘L + lineDerivOpCLM ℂ 𝓢'(EC n, ℂ) (stdOrthonormalBasis ℝ (EC n) k) ∘L + lineDerivOpCLM ℂ 𝓢'(EC n, ℂ) (stdOrthonormalBasis ℝ (EC n) l) + +def extendedCoefficient (H : Matrix (Fin n) (Fin n) ℂ) + (a : BasisIndex n → BasisIndex n → EC n →ᵇ ℂ) + (k l : BasisIndex n) : EC n →ᵇ ℂ := + BoundedContinuousFunction.const _ + (traceBilin H (rankTwo (stdOrthonormalBasis ℝ (EC n) k) + (stdOrthonormalBasis ℝ (EC n) l)) : ℂ) + a k l + +lemma extendedCoefficient_temperate (H : Matrix (Fin n) (Fin n) ℂ) + (a : BasisIndex n → BasisIndex n → EC n →ᵇ ℂ) + (ha : ∀ k l, (a k l : EC n → ℂ).HasTemperateGrowth) (k l : BasisIndex n) : + (extendedCoefficient H a k l : EC n → ℂ).HasTemperateGrowth := by + change ((fun _ : EC n => (traceBilin H (rankTwo + (stdOrthonormalBasis ℝ (EC n) k) (stdOrthonormalBasis ℝ (EC n) l)) : ℂ)) + + (a k l : EC n → ℂ)).HasTemperateGrowth + apply Function.HasTemperateGrowth.add + · fun_prop + · exact ha k l + +lemma chartDifferential_extension (H : Matrix (Fin n) (Fin n) ℂ) + (a : BasisIndex n → BasisIndex n → EC n →ᵇ ℂ) + (ha : ∀ k l, (a k l : EC n → ℂ).HasTemperateGrowth) (u : L2 (EC n)) : + chartDifferential (extendedCoefficient H a) (realize 2 u) = + frozenDifferential H (realize 2 u) + + (perturbation (stdOrthonormalBasis ℝ (EC n)) a u : 𝓢'(EC n, ℂ)) := by + rw [perturbation_distribution _ a ha] + simp only [chartDifferential, frozenDifferential, differentialWithBasis, + _root_.sum_apply, ContinuousLinearMap.comp_apply, + _root_.smul_apply, ← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro k _ + apply Finset.sum_congr rfl + intro l _ + change smulLeftCLM ℂ ((fun _ : EC n => (traceBilin H (rankTwo + (stdOrthonormalBasis ℝ (EC n) k) (stdOrthonormalBasis ℝ (EC n) l)) : ℂ)) + + (a k l : EC n → ℂ)) _ = _ + rw [smulLeftCLM_add (by fun_prop) (ha k l)] + simp + + + +theorem chart_parametrix {U : Set (EC n)} (hU : IsOpen U) + (H : EC n → Matrix (Fin n) (Fin n) ℂ) (hH : ContDiffOn ℝ ∞ H U) + (hh : ∀ y ∈ U, (H y).PosDef) {x : EC n} (hx : x ∈ U) : + ∃ (V : Set (EC n)) (c : BasisIndex n → BasisIndex n → EC n →ᵇ ℂ) + (R : L2 (EC n) →L[ℂ] L2 (EC n)) (C : ℝ), + IsOpen V ∧ x ∈ V ∧ V ⊆ U ∧ 0 < C ∧ + (∀ k l, (c k l : EC n → ℂ).HasTemperateGrowth) ∧ + (∀ y ∈ V, ∀ k l, + c k l y = (traceBilin (H y) (rankTwo + (stdOrthonormalBasis ℝ (EC n) k) (stdOrthonormalBasis ℝ (EC n) l)) : ℂ)) ∧ + (∀ f, realize 2 (R f) - chartDifferential c (realize 2 (R f)) = (f : 𝓢'(EC n, ℂ))) ∧ + (∀ f, ‖R f‖ ≤ C * ‖f‖) ∧ + (∀ (u f : L2 (EC n)), realize 2 u - chartDifferential c (realize 2 u) = (f : 𝓢'(EC n, ℂ)) → + u = R f) := by + let b := stdOrthonormalBasis ℝ (EC n) + obtain ⟨a, hat, _, has, hag⟩ := local_coefficient_extension hU H hH hh hx b + obtain ⟨V, hV, hVo, hxV⟩ := mem_nhds_iff.mp (inter_mem (hU.mem_nhds hx) hag) + let R := localResolvent (H x) (hh x hx) b a has + let C := ellipticBound (H x) (hh x hx) / + (1 - perturbationBound b a * ellipticBound (H x) (hh x hx)) + have hC : 0 < C := div_pos (ellipticBound_pos _ _) (sub_pos.mpr has) + refine ⟨V, extendedCoefficient (H x) a, R, C, hVo, hxV, + fun y hy => (hV hy).1, hC, extendedCoefficient_temperate _ _ hat, ?_, ?_, ?_, ?_⟩ + · intro y hy k l + change (_ : ℂ) + a k l y = _ + rw [(hV hy).2 k l] + simp [b] + · intro f + rw [chartDifferential_extension _ _ hat, ← sub_sub] + exact localResolvent_equation _ _ _ _ has f + · intro f + exact localResolvent_bound _ _ _ _ has f + · intro u f hu + rw [chartDifferential_extension _ _ hat, ← sub_sub] at hu + exact perturbed_unique _ _ _ _ has u _ f hu (localResolvent_equation _ _ _ _ has f) + +end MetricLocalization + +namespace Anticanonical.SourceSmooth +open EllipticKernel MetricLocalization SobolevChart FrozenPoisson +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + + + +theorem KaehlerMetric.chart_parametrix (g : KaehlerMetric A) + (i : Fin A.count) {x : EC d} (hx : coordinateEquiv d x ∈ (A.chart i).target) : + ∃ (V : Set (EC d)) (c : BasisIndex d → BasisIndex d → EC d →ᵇ ℂ) + (R : L2 (EC d) →L[ℂ] L2 (EC d)) (C : ℝ), + IsOpen V ∧ x ∈ V ∧ V ⊆ (coordinateEquiv d) ⁻¹' (A.chart i).target ∧ 0 < C ∧ + (∀ k l, (c k l : EC d → ℂ).HasTemperateGrowth) ∧ + (∀ y ∈ V, ∀ k l, + c k l y = (traceBilin (g.matrix i (coordinateEquiv d y)) (rankTwo + (stdOrthonormalBasis ℝ (EC d) k) (stdOrthonormalBasis ℝ (EC d) l)) : ℂ)) ∧ + (∀ f, realize 2 (R f) - chartDifferential c (realize 2 (R f)) = (f : 𝓢'(EC d, ℂ))) ∧ + (∀ f, ‖R f‖ ≤ C * ‖f‖) ∧ + (∀ (u f : L2 (EC d)), realize 2 u - chartDifferential c (realize 2 u) = (f : 𝓢'(EC d, ℂ)) → + u = R f) := by + exact MetricLocalization.chart_parametrix + ((A.chart i).open_target.preimage (coordinateEquiv d).continuous) + _ ((g.smooth i).comp (coordinateEquiv d).contDiff.contDiffOn (fun _ h => h)) + (fun y hy => g.positive i _ hy) hx + +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/ChartTransport.lean b/lean/OAI/Geometry/PrescribedPotential/ChartTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..3246f8ad7845d0430070e4014f5b68ee877d6c31 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/ChartTransport.lean @@ -0,0 +1,158 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.LocalRegularity +import OAI.Geometry.PrescribedPotential.LocalizedPullback + +namespace OAI + +/-! Chart Transport. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory LineDeriv +open scoped ContDiff SchwartzMap Classical BoundedContinuousFunction + +namespace GlobalElliptic +open SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + + +structure ChartCutoff (U : Set E) where + val : 𝓢(E, ℂ) + compact : HasCompactSupport (val : E → ℂ) + support_sub : tsupport (val : E → ℂ) ⊆ U + +instance {U : Set E} : CoeFun (ChartCutoff U) (fun _ => E → ℂ) := ⟨fun κ => κ.val⟩ + +namespace ChartCutoff +variable {U : Set E} (κ : ChartCutoff U) + +lemma product_smooth {h : E → ℂ} (hU : IsOpen U) (hh : ContDiffOn ℝ ∞ h U) : + ContDiff ℝ ∞ (fun x => κ x * h x) := by + rw [contDiff_iff_contDiffAt] + intro x + by_cases hx : x ∈ U + · exact (κ.val.smooth ⊤).contDiffAt.mul (hh.contDiffAt (hU.mem_nhds hx)) + · have ht : x ∉ tsupport (κ : E → ℂ) := fun ht => hx (κ.support_sub ht) + apply (contDiffAt_const (c := (0 : ℂ))).congr_of_eventuallyEq + filter_upwards [notMem_tsupport_iff_eventuallyEq.mp ht] with y hy + simp [hy] + +lemma product_compact (h : E → ℂ) : HasCompactSupport (fun x => κ x * h x) := by + apply HasCompactSupport.of_support_subset_isCompact κ.compact + intro x hx + exact subset_tsupport _ (left_ne_zero_of_mul hx) + +def product {h : E → ℂ} (hU : IsOpen U) (hh : ContDiffOn ℝ ∞ h U) : 𝓢(E, ℂ) := + (κ.product_compact h).toSchwartzMap (κ.product_smooth hU hh) + +@[simp] lemma product_apply {h : E → ℂ} (hU : IsOpen U) (hh : ContDiffOn ℝ ∞ h U) (x : E) : + κ.product hU hh x = κ x * h x := rfl + +lemma product_tsupport {h : E → ℂ} (hU : IsOpen U) (hh : ContDiffOn ℝ ∞ h U) : + tsupport (κ.product hU hh : E → ℂ) ⊆ tsupport (κ : E → ℂ) := by + apply closure_mono + exact fun x hx => left_ne_zero_of_mul hx + + +def mulOn {h : E → ℂ} (hU : IsOpen U) (hh : ContDiffOn ℝ ∞ h U) : ChartCutoff U where + val := κ.product hU hh + compact := κ.product_compact h + support_sub := (κ.product_tsupport hU hh).trans κ.support_sub + +lemma deriv_tsupport (v : E) : + tsupport (⇑(∂_{v} κ.val : 𝓢(E, ℂ))) ⊆ tsupport (κ : E → ℂ) := by + intro x hx + by_contra hn + have hh := notMem_tsupport_iff_eventuallyEq.mp hn + have hd : (fun y => (∂_{v} κ.val : 𝓢(E, ℂ)) y) =ᶠ[𝓝 x] 0 := by + filter_upwards [hh.eventually_nhds] with y hy + simp only [SchwartzMap.lineDerivOp_apply_eq_fderiv] + have hy' : (κ : E → ℂ) =ᶠ[𝓝 y] 0 := hy + rw [hy'.fderiv_eq] + simp + exact (notMem_tsupport_iff_eventuallyEq.mpr hd) hx + +def deriv (v : E) : ChartCutoff U where + val := ∂_{v} κ.val + compact := (κ.compact.of_isClosed_subset (isClosed_tsupport _) (κ.deriv_tsupport v)) + support_sub := (κ.deriv_tsupport v).trans κ.support_sub + +end ChartCutoff + +variable (e : OpenPartialHomeomorph E E) (he : ContDiffOn ℝ ∞ e e.source) + + +def chartTransport (κ : ChartCutoff e.source) : 𝓢(E, ℂ) →ₗ[ℝ] 𝓢(E, ℂ) where + toFun f := κ.product e.open_source ((f.smooth ⊤).comp_contDiffOn he) + map_add' f h := by + ext x + simp [mul_add] + map_smul' c f := by + ext x + simp [mul_left_comm] + +@[simp] lemma chartTransport_apply (κ : ChartCutoff e.source) (f : 𝓢(E, ℂ)) (x : E) : + chartTransport e he κ f x = κ x * f (e x) := rfl + + +variable [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +theorem chartTransport_l2_bound (hs : ContDiffOn ℝ ∞ e.symm e.target) + (κ : ChartCutoff e.source) : ∃ C : ℝ, 0 ≤ C ∧ ∀ f : 𝓢(E, ℂ), + ‖schwartzCoord 0 (chartTransport e he κ f)‖ ≤ C * ‖schwartzCoord 0 f‖ := by + let K := tsupport (κ : E → ℂ) + obtain ⟨C, hC, hmeas, hmap⟩ := chart_map_restrict_bound e he hs κ.compact κ.support_sub + let B : L2 E →L[ℝ] L2 E := + (Lp.extendZero (μ := (volume : Measure E)) (p := 2) (F := ℂ) (isClosed_tsupport _).measurableSet).toContinuousLinearMap ∘L + Lp.pullbackBounded (K.indicator e) hmeas ENNReal.ofReal_ne_top hmap + let T : L2 E →L[ℝ] L2 E := (multiply κ.val.toBoundedContinuousFunction).restrictScalars ℝ ∘L B + refine ⟨‖T‖, norm_nonneg _, fun f => ?_⟩ + have hc (u : 𝓢(E, ℂ)) : schwartzCoord 0 u = u.toLp 2 volume := by + apply realize_injective 0 + simpa [realize] using realize_schwartzCoord 0 u + rw [hc, hc] + have heq : T (f.toLp 2 volume) = (chartTransport e he κ f).toLp 2 volume := by + apply Lp.ext + have hb := Lp.coeFn_pullbackBounded (K.indicator e) hmeas ENNReal.ofReal_ne_top hmap + (f.toLp 2 volume) + have hz := Lp.coeFn_extendZero (μ := (volume : Measure E)) + (isClosed_tsupport (κ : E → ℂ)).measurableSet + (Lp.pullbackBounded (K.indicator e) hmeas ENNReal.ofReal_ne_top hmap (f.toLp 2 volume)) + have hf := (f.memLp 2 volume).coeFn_toLp + have hfc := (ae_of_ae_map hmeas.aemeasurable + (ae_mono hmap (Measure.ae_smul_measure hf _))) + have ht := (chartTransport e he κ f).coeFn_toLp (p := 2) (μ := volume) + have hm : (fun x => multiply κ.val.toBoundedContinuousFunction (B (f.toLp 2 volume)) x) =ᵐ[volume] + fun x => κ x * B (f.toLp 2 volume) x := by + filter_upwards [(ContinuousLinearMap.mul ℂ ℂ).coeFn_holder (r := 2) + (κ.val.toBoundedContinuousFunction.memLp_top.toLp κ.val.toBoundedContinuousFunction : Lp ℂ ⊤ volume) + (B (f.toLp 2 volume)), + (κ.val.toBoundedContinuousFunction.memLp_top (μ := volume)).coeFn_toLp] with x h₁ h₂ + exact h₁.trans (by simp only [ContinuousLinearMap.mul_apply', h₂]; rfl) + filter_upwards [hm, hz, (ae_restrict_iff' (isClosed_tsupport _).measurableSet).mp hb, + (ae_restrict_iff' (isClosed_tsupport _).measurableSet).mp hfc, ht] + with x h₁ h₂ h₃ h₄ h₅ + change multiply κ.val.toBoundedContinuousFunction (B (f.toLp 2 volume)) x = _ + rw [h₁, h₅] + change B (f.toLp 2 volume) x = _ at h₂ + rw [h₂] + by_cases hx : x ∈ K + · rw [indicator_of_mem hx, h₃ hx] + have hh := h₄ hx + change (f.toLp 2 volume) (K.indicator e x) = f (K.indicator e x) at hh + rw [hh, indicator_of_mem hx] + rfl + · have hk : κ x = 0 := image_eq_zero_of_notMem_tsupport hx + simp [chartTransport_apply, hk] + rw [← heq] + exact T.le_opNorm _ + +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/ChartTransportHigher.lean b/lean/OAI/Geometry/PrescribedPotential/ChartTransportHigher.lean new file mode 100644 index 0000000000000000000000000000000000000000..2758a807d188a4ca4677739e2e2153b4e6693a15 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/ChartTransportHigher.lean @@ -0,0 +1,127 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.ChartTransport +import OAI.Geometry.PrescribedPotential.CoreBounds + +namespace OAI + +/-! Chart Transport Higher. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory LineDeriv TemperedDistribution +open scoped ContDiff SchwartzMap Classical Laplacian + +namespace GlobalElliptic +open SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] +variable (e : OpenPartialHomeomorph E E) (he : ContDiffOn ℝ ∞ e e.source) + +include he in +lemma transportCoefficient_smooth (v : E) (j : Fin (Module.finrank ℝ E)) : + ContDiffOn ℝ ∞ (fun x => ((stdOrthonormalBasis ℝ E).repr (fderiv ℝ e x v) j : ℂ)) e.source := by + apply Complex.ofRealCLM.contDiff.comp_contDiffOn + apply ((EuclideanSpace.proj j).contDiff.comp (stdOrthonormalBasis ℝ E).repr.contDiff).comp_contDiffOn + exact (he.fderiv_of_isOpen e.open_source (by simp)).clm_apply contDiffOn_const + +def transportCoefficient (κ : ChartCutoff e.source) (v : E) (j : Fin (Module.finrank ℝ E)) : + ChartCutoff e.source := κ.mulOn e.open_source (transportCoefficient_smooth e he v j) + +@[simp] lemma transportCoefficient_apply (κ : ChartCutoff e.source) (v : E) + (j : Fin (Module.finrank ℝ E)) (x : E) : + transportCoefficient e he κ v j x = + κ x * ((stdOrthonormalBasis ℝ E).repr (fderiv ℝ e x v) j : ℂ) := rfl + +omit [FiniteDimensional ℝ E] in +lemma chartTransport_tsupport (κ : ChartCutoff e.source) (f : 𝓢(E, ℂ)) : + tsupport (chartTransport e he κ f : E → ℂ) ⊆ tsupport (κ : E → ℂ) := + κ.product_tsupport e.open_source ((f.smooth ⊤).comp_contDiffOn he) + + + +lemma chartTransport_deriv (κ : ChartCutoff e.source) (v : E) (f : 𝓢(E, ℂ)) : + ∂_{v} (chartTransport e he κ f) = chartTransport e he (κ.deriv v) f + + ∑ j, chartTransport e he (transportCoefficient e he κ v j) + (∂_{stdOrthonormalBasis ℝ E j} f) := by + ext x + by_cases hx : x ∈ e.source + · have hed := (he.contDiffAt (e.open_source.mem_nhds hx)).differentiableAt (by simp) + have hfd := f.differentiableAt.comp x hed + simp only [SchwartzMap.lineDerivOp_apply_eq_fderiv, chartTransport_apply, + _root_.add_apply, _root_.sum_apply, transportCoefficient_apply] + change fderiv ℝ (fun y => κ y * f (e y)) x v = + fderiv ℝ κ.val x v * f (e x) + _ + have hm := fderiv_fun_mul κ.val.differentiableAt hfd + have hc := fderiv_comp x f.differentiableAt hed + dsimp only [Function.comp_def] at hm hc + rw [hm, hc] + simp only [_root_.add_apply, _root_.smul_apply, + ContinuousLinearMap.comp_apply, smul_eq_mul] + have hb := congrArg (fun z => fderiv ℝ f (e x) z) + ((stdOrthonormalBasis ℝ E).sum_repr (fderiv ℝ e x v)) + simp only [map_sum, map_smul, Complex.real_smul] at hb + rw [← hb, Finset.mul_sum] + ring_nf + · have hk : x ∉ tsupport (κ : E → ℂ) := fun ht => hx (κ.support_sub ht) + have ht : x ∉ tsupport (chartTransport e he κ f : E → ℂ) := + fun ht => hk (chartTransport_tsupport e he κ f ht) + have hder : (∂_{v} (chartTransport e he κ f) : 𝓢(E, ℂ)) x = 0 := by + rw [SchwartzMap.lineDerivOp_apply_eq_fderiv, + (notMem_tsupport_iff_eventuallyEq.mp ht).fderiv_eq] + simp + have hk' : κ.deriv v x = 0 := image_eq_zero_of_notMem_tsupport + (fun h => hk (κ.deriv_tsupport v h)) + simp only [_root_.add_apply, _root_.sum_apply, chartTransport_apply, + transportCoefficient_apply, hder, image_eq_zero_of_notMem_tsupport hk, hk', zero_mul, + Finset.sum_const_zero, add_zero] + +variable [MeasurableSpace E] [BorelSpace E] + +lemma word_deriv_comm (ws : List E) (v : E) (f : 𝓢(E, ℂ)) : + schwartzWord ws (∂_{v} f) = ∂_{v} (schwartzWord ws f) := by + induction ws with + | nil => rfl + | cons w ws ih => + change ∂_{w} (schwartzWord ws (∂_{v} f)) = ∂_{v} (∂_{w} (schwartzWord ws f)) + rw [ih, schwartz_deriv_comm] + +include he in +lemma chartTransport_word_bound (hs : ContDiffOn ℝ ∞ e.symm e.target) (ws : List E) + (κ : ChartCutoff e.source) {s : ℝ} (hws : (ws.length : ℝ) ≤ s) : + CoreBound s 0 (fun f => schwartzWord ws (chartTransport e he κ f)) := by + induction ws generalizing κ s with + | nil => + have hzero : CoreBound 0 0 (chartTransport e he κ) := chartTransport_l2_bound e he hs κ + exact hzero.comp (CoreBound.id (by simpa using hws)) + | cons w ws ih => + have hw : (ws.length : ℝ) + 1 ≤ s := by simpa only [List.length_cons, Nat.cast_add, Nat.cast_one] using hws + have hfirst := ih (κ.deriv w) (s := s) (by linarith) + have hrest (j : Fin (Module.finrank ℝ E)) := + (ih (transportCoefficient e he κ w j) (s := s - 1) (by linarith)).comp + (coreBound_deriv (stdOrthonormalBasis ℝ E j) (s := s) (t := s - 1) le_rfl) + have hh := hfirst.add (CoreBound.sum Finset.univ _ (fun j _ => hrest j)) + convert hh using 1 + funext f + change ∂_{w} (schwartzWord ws (chartTransport e he κ f)) = _ + rw [← word_deriv_comm, chartTransport_deriv, map_add, map_sum] + rfl + + + +theorem chartTransport_even_bound (hs : ContDiffOn ℝ ∞ e.symm e.target) + (κ : ChartCutoff e.source) (k : ℕ) : + CoreBound (2 * (k : ℝ)) (2 * (k : ℝ)) (chartTransport e he κ) := by + apply coreBound_of_words k + intro ws hw + apply chartTransport_word_bound e he hs ws κ + exact_mod_cast hw + +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/ChernLuFrameInequality.lean b/lean/OAI/Geometry/PrescribedPotential/ChernLuFrameInequality.lean new file mode 100644 index 0000000000000000000000000000000000000000..acc2af1c6898cff2f31242e1a496203af6c169f2 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/ChernLuFrameInequality.lean @@ -0,0 +1,56 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.FrameCompactBounds +import OAI.Geometry.PrescribedPotential.FrameSecondCalculus +import OAI.Geometry.PrescribedPotential.MatrixFrameNormalization +import OAI.Geometry.PrescribedPotential.ScalarFrameCalculus + +namespace OAI + +/-! Chern Lu Frame Inequality. -/ + +section + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +variable {n : ℕ} + +lemma inverseTrace_log_inequality_frame [Nonempty (Fin n)] + {U : Set (V n)} (hU : IsOpen U) + (B : V n →L[ℂ] V n) (hB : IsUnit (frameMatrix B)) + {M G : V n → Matrix (Fin n) (Fin n) ℂ} (hM : ContDiffOn ℝ ∞ M U) + (hp : ∀ y ∈ U, (M y).PosDef) + (hclosed : ∀ y ∈ U, ∀ u v w : V n, + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (M q) v w) y u + + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (M q) w u) y v + + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (M q) u v) y w = 0) + (hG : ContDiffOn ℝ ∞ G U) (hGp : ∀ y ∈ U, (G y).PosDef) + {w : V n} (hw : B w ∈ U) (hM1 : pullMetric B M w = 1) : + frameResidual (PotentialKaehler.potentialMatrix (fun y => Real.log (M y).det.re) (B w)) + (G (B w)) (curvatureDiagonal G (B w)) (frameMatrix B) ≤ + inverseTrace M G (B w) * + (PotentialKaehler.potentialMatrix (fun y => Real.log (inverseTrace M G (B y))) w).trace.re := by + have hi := inverseTrace_log_inequality_at_one (hU.preimage B.continuous) + (pullMetric_smooth hU B hM) (pullMetric_positive B hB hp) + (pullMetric_closed hU B hM hclosed) (pullMetric_smooth hU B hG) (pullMetric_positive B hB hGp) hw hM1 + rw [potentialMatrix_logdet_pullMetric hU B hB hM hp hw] at hi + simp_rw [curvatureDiagonal_pullMetric hU B hB hG hw] at hi + have hs : inverseTrace (pullMetric B M) (pullMetric B G) = fun y => inverseTrace M G (B y) := + funext (fun y => inverseTrace_pullMetric B hB M G y) + rw [hs] at hi + simpa only [frameResidual,pullMetric,frameMatrix_mulVec] using hi + +lemma inverseTrace_eq_frameGram (B : V n →L[ℂ] V n) (hB : IsUnit (frameMatrix B)) + (M G : V n → Matrix (Fin n) (Fin n) ℂ) (w : V n) (hM1 : pullMetric B M w = 1) : + inverseTrace M G (B w) = frameGram (G (B w)) (frameMatrix B) := by + rw [← inverseTrace_pullMetric B hB M G w] + unfold inverseTrace + rw [hM1,inv_one,one_mul] + rfl +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/ChernLuIdentity.lean b/lean/OAI/Geometry/PrescribedPotential/ChernLuIdentity.lean new file mode 100644 index 0000000000000000000000000000000000000000..3d2d015bf84f3a1d513d9be7721642e07d627b40 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/ChernLuIdentity.lean @@ -0,0 +1,77 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.InverseTraceCalculus +import OAI.Geometry.PrescribedPotential.KaehlerSecondDerivatives + +namespace OAI + +/-! Chern Lu Identity. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +variable {n : ℕ} + +lemma sum_ricci_cancellation (A B C Y Z W : Fin n → Matrix (Fin n) (Fin n) ℂ) + (G H : Matrix (Fin n) (Fin n) ℂ) + (hc : ∑ k, C k = H + ∑ k, B k*A k) : + ∑ k, ((B k*A k+A k*B k-C k)*G-A k*Z k-B k*Y k+W k) = + -(H*G) + ∑ k, (A k*B k*G-A k*Z k-B k*Y k+W k) := by + simp only [add_mul,sub_mul,Finset.sum_add_distrib,Finset.sum_sub_distrib, + ← Matrix.sum_mul] + rw [hc] + noncomm_ring + +lemma inverse_trace_ricci_identity_at_one {U : Set (V n)} (hU : IsOpen U) + {M G : V n → Matrix (Fin n) (Fin n) ℂ} + (hM : ContDiffOn ℝ ∞ M U) (hp : ∀ y ∈ U, (M y).PosDef) + (hclosed : ∀ y ∈ U, ∀ u v w : V n, + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (M q) v w) y u + + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (M q) w u) y v + + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (M q) u v) y w = 0) + (hG : ContDiffOn ℝ ∞ G U) (hGh : ∀ y ∈ U, (G y).IsHermitian) + {z : V n} (hz : z ∈ U) (hMz : M z = 1) : + ∑ k, dzbar (e k) (dz (e k) (fun y => ((M y)⁻¹*G y).trace)) z = + -(PotentialKaehler.potentialMatrix (fun y => Real.log (M y).det.re) z*G z).trace + + ∑ k, (mderiv (-Complex.I) (e k) M z*(mderiv (-Complex.I) (e k) M z)ᴴ*G z - + mderiv (-Complex.I) (e k) M z*(mderiv (-Complex.I) (e k) G z)ᴴ - + (mderiv (-Complex.I) (e k) M z)ᴴ*mderiv (-Complex.I) (e k) G z + + mderiv Complex.I (e k) (mderiv (-Complex.I) (e k) G) z).trace := by + let A := fun k => mderiv (-Complex.I) (e k) M z + let B := fun k => mderiv Complex.I (e k) M z + let C := fun k => mderiv Complex.I (e k) (mderiv (-Complex.I) (e k) M) z + let Y := fun k => mderiv (-Complex.I) (e k) G z + let Z := fun k => mderiv Complex.I (e k) G z + let W := fun k => mderiv Complex.I (e k) (mderiv (-Complex.I) (e k) G) z + let H := PotentialKaehler.potentialMatrix (fun y => Real.log (M y).det.re) z + have hc : ∑ k, C k = H + ∑ k, B k*A k := + ricci_cancellation_at_one hU hM hp hclosed hz hMz + have hn : ∀ y ∈ U, (M y).det ≠ 0 := fun y hy => ne_of_gt (hp y hy).det_pos + have hsG := hG.contDiffAt (hU.mem_nhds hz) + have hfirst : (∑ k, dzbar (e k) (dz (e k) (fun y => ((M y)⁻¹*G y).trace)) z) = + ∑ k, ((B k*A k+A k*B k-C k)*G z-A k*Z k-B k*Y k+W k).trace := by + apply Finset.sum_congr rfl + intro k _ + exact second_wderiv_inverse_trace_at_one hU hM hn hz hMz hsG + (-Complex.I) Complex.I (e k) (e k) + have hsecond := congrArg Matrix.trace (sum_ricci_cancellation A B C Y Z W (G z) H hc) + rw [Matrix.trace_add,Matrix.trace_neg,Matrix.trace_sum,Matrix.trace_sum] at hsecond + have hlast : (∑ k, (A k*B k*G z-A k*Z k-B k*Y k+W k).trace) = + ∑ k, (A k*(A k)ᴴ*G z-A k*(Y k)ᴴ-(A k)ᴴ*Y k+W k).trace := by + apply Finset.sum_congr rfl + intro k _ + have hb : B k = (A k)ᴴ := mderiv_bar_eq_conjTranspose hU hM + (fun y hy => (hp y hy).isHermitian) hz (e k) + have hz' : Z k = (Y k)ᴴ := mderiv_bar_eq_conjTranspose hU hG hGh hz (e k) + rw [hb,hz'] + exact hfirst.trans (hsecond.trans (congrArg (fun q => -(H*G z).trace+q) hlast)) +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/ChernLuLocalInequality.lean b/lean/OAI/Geometry/PrescribedPotential/ChernLuLocalInequality.lean new file mode 100644 index 0000000000000000000000000000000000000000..69e733d1f0d0e43862d7a0b77e92fd83c8bacf25 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/ChernLuLocalInequality.lean @@ -0,0 +1,103 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.InverseTraceFunction +import OAI.Geometry.PrescribedPotential.LogHessianCalculus +import OAI.Geometry.PrescribedPotential.MatrixTraceInequalities + +namespace OAI + +/-! Chern Lu Local Inequality. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +variable {n : ℕ} + +def curvatureDiagonal (G : V n → Matrix (Fin n) (Fin n) ℂ) (z v : V n) := + mderiv Complex.I v (mderiv (-Complex.I) v G) z - + (mderiv (-Complex.I) v G z)ᴴ*(G z)⁻¹*mderiv (-Complex.I) v G z + +lemma trace_gradient_sum_bound (G : Matrix (Fin n) (Fin n) ℂ) (hG : G.PosDef) + (X Y W : Fin n → Matrix (Fin n) (Fin n) ℂ) : + ∑ k, ‖(Y k-X k*G).trace‖^2 ≤ G.trace.re * + ((∑ k, (X k*(X k)ᴴ*G-X k*(Y k)ᴴ-(X k)ᴴ*Y k+W k).trace.re) - + ∑ k, (W k-(Y k)ᴴ*G⁻¹*Y k).trace.re) := by + have h := Finset.sum_le_sum (s := Finset.univ) + (fun k _ => trace_gradient_square_bound hG (X k) (Y k)) + rw [← Finset.mul_sum] at h + have he : ((∑ k, (X k*(X k)ᴴ*G-X k*(Y k)ᴴ-(X k)ᴴ*Y k+W k).trace.re) - + ∑ k, (W k-(Y k)ᴴ*G⁻¹*Y k).trace.re) = + ∑ k, ((X k*(X k)ᴴ*G).trace.re-(X k*(Y k)ᴴ).trace.re- + ((X k)ᴴ*Y k).trace.re+((Y k)ᴴ*G⁻¹*Y k).trace.re) := by + rw [← Finset.sum_sub_distrib] + apply Finset.sum_congr rfl + intro k _ + simp only [Matrix.trace_add,Matrix.trace_sub,Complex.add_re,Complex.sub_re] + ring + rw [he] + exact h + +lemma log_hessian_trace {U : Set (V n)} (hU : IsOpen U) + {f : V n → ℝ} (hf : ContDiffOn ℝ ∞ f U) (hp : ∀ y ∈ U, f y ≠ 0) + {z : V n} (hz : z ∈ U) : + (PotentialKaehler.potentialMatrix (fun y => Real.log (f y)) z).trace.re = + (f z)⁻¹*(PotentialKaehler.potentialMatrix f z).trace.re - + (f z)^(-2 : ℤ)*(∑ k, ‖dz (e k) (fun y => (f y : ℂ)) z‖^2) := by + simp only [Matrix.trace,Matrix.diag_apply,Complex.re_sum] + simp_rw [log_hessian_diagonal hU hf hp hz] + rw [Finset.sum_sub_distrib,← Finset.mul_sum,← Finset.mul_sum] + +lemma scalar_log_cancellation {s d l r q c a : ℝ} (hs : 0 < s) + (hl : l = s⁻¹*d - s^(-2 : ℤ)*a) (hd : d = -r+q) + (ha : a ≤ s*(q-c)) : -r+c ≤ s*l := by + have he : s^2*l = s*d-a := by + rw [hl] + simp only [_root_.zpow_neg,zpow_ofNat] + field_simp + have hh : s*(-r+c) ≤ s^2*l := by rw [he,hd]; nlinarith + have hf : s^2*l = s*(s*l) := by ring + rw [hf] at hh + exact (mul_le_mul_iff_right₀ hs).mp hh + +lemma inverseTrace_log_inequality_at_one [Nonempty (Fin n)] + {U : Set (V n)} (hU : IsOpen U) + {M G : V n → Matrix (Fin n) (Fin n) ℂ} (hM : ContDiffOn ℝ ∞ M U) + (hp : ∀ y ∈ U, (M y).PosDef) + (hclosed : ∀ y ∈ U, ∀ u v w : V n, + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (M q) v w) y u + + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (M q) w u) y v + + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (M q) u v) y w = 0) + (hG : ContDiffOn ℝ ∞ G U) (hGp : ∀ y ∈ U, (G y).PosDef) + {z : V n} (hz : z ∈ U) (hMz : M z = 1) : + -(PotentialKaehler.potentialMatrix (fun y => Real.log (M y).det.re) z*G z).trace.re + + ∑ k, (curvatureDiagonal G z (e k)).trace.re ≤ + inverseTrace M G z * + (PotentialKaehler.potentialMatrix (fun y => Real.log (inverseTrace M G y)) z).trace.re := by + let X := fun k => mderiv (-Complex.I) (e k) M z + let Y := fun k => mderiv (-Complex.I) (e k) G z + let W := fun k => mderiv Complex.I (e k) (mderiv (-Complex.I) (e k) G) z + have hGh : ∀ y ∈ U, (G y).IsHermitian := fun y hy => (hGp y hy).isHermitian + have hpos : ∀ y ∈ U, 0 < inverseTrace M G y := fun y hy => inverseTrace_pos (hp y hy) (hGp y hy) + have hl := log_hessian_trace hU (inverseTrace_smooth hU hM hp hG) + (fun y hy => ne_of_gt (hpos y hy)) hz + have hd := inverseTrace_second_at_one hU hM hp hclosed hG hGh hz hMz + have hg := trace_gradient_sum_bound (G z) (hGp z hz) X Y W + have hs : inverseTrace M G z = (G z).trace.re := by simp [inverseTrace,hMz] + have he : (∑ k, ‖dz (e k) (fun y => (inverseTrace M G y : ℂ)) z‖^2) = + ∑ k, ‖(Y k-X k*G z).trace‖^2 := by + apply Finset.sum_congr rfl + intro k _ + rw [inverseTrace_dz_at_one hU hM hp hG hGh hz hMz] + rw [he] at hl + rw [← hs] at hg + exact scalar_log_cancellation (hpos z hz) hl hd hg +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/ChernLuMaximum.lean b/lean/OAI/Geometry/PrescribedPotential/ChernLuMaximum.lean new file mode 100644 index 0000000000000000000000000000000000000000..41c3aeaad39b059cfd4d9633715bff6f0b576f13 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/ChernLuMaximum.lean @@ -0,0 +1,102 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.ChernLuFrameInequality +import OAI.Geometry.PrescribedPotential.PotentialLinearCalculus + +namespace OAI + +/-! Chern Lu Maximum. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +variable {n : ℕ} + +lemma pullMetric_potential_relation (B : V n →L[ℂ] V n) + (M G : V n → Matrix (Fin n) (Fin n) ℂ) (f : V n → ℝ) (w : V n) + (hf : ContDiffAt ℝ ∞ f (B w)) + (he : M (B w) = G (B w)+PotentialKaehler.potentialMatrix f (B w)) : + pullMetric B M w = pullMetric B G w+PotentialKaehler.potentialMatrix (fun y => f (B y)) w := by + rw [potentialMatrix_linear B hf] + unfold pullMetric + rw [he,mul_add,add_mul] + +lemma trace_potential_in_frame (B : V n →L[ℂ] V n) (hB : IsUnit (frameMatrix B)) + (M G : V n → Matrix (Fin n) (Fin n) ℂ) (f : V n → ℝ) (w : V n) + (hf : ContDiffAt ℝ ∞ f (B w)) + (he : M (B w) = G (B w)+PotentialKaehler.potentialMatrix f (B w)) + (hM1 : pullMetric B M w = 1) : + (PotentialKaehler.potentialMatrix (fun y => f (B y)) w).trace.re = + (n:ℝ)-inverseTrace M G (B w) := by + have hh := congrArg (fun H : Matrix (Fin n) (Fin n) ℂ => H.trace.re) + (pullMetric_potential_relation B M G f w hf he) + rw [hM1,Matrix.trace_one,Matrix.trace_add,Complex.add_re] at hh + have hs := inverseTrace_eq_frameGram B hB M G w hM1 + change inverseTrace M G (B w) = (pullMetric B G w).trace.re at hs + simp only [Fintype.card_fin,Complex.natCast_re] at hh + linarith + +lemma scalar_trace_maximum {C S L D : ℝ} (hp : 0 < S) + (hr : -C*S^2 ≤ S*L) (hm : L-(C+1)*(D-S) ≤ 0) : S ≤ (C+1)*D := by + have he : S*(S-(C+1)*D) ≤ 0 := by nlinarith + by_contra h + have hmul := mul_pos hp (sub_pos.mpr (lt_of_not_ge h)) + linarith + +lemma inverseTrace_at_localMax_bound [Nonempty (Fin n)] + {U : Set (V n)} (hU : IsOpen U) + {M G : V n → Matrix (Fin n) (Fin n) ℂ} (hM : ContDiffOn ℝ ∞ M U) + (hp : ∀ y ∈ U, (M y).PosDef) + (hclosed : ∀ y ∈ U, ∀ u v w : V n, + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (M q) v w) y u + + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (M q) w u) y v + + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (M q) u v) y w = 0) + (hG : ContDiffOn ℝ ∞ G U) (hGp : ∀ y ∈ U, (G y).PosDef) + {f : V n → ℝ} (hf : ContDiffOn ℝ ∞ f U) + {z : V n} (hz : z ∈ U) + (he : M z = G z+PotentialKaehler.potentialMatrix f z) + (C : ℝ) (hbound : ∀ B : Matrix (Fin n) (Fin n) ℂ, + -C*(frameGram (G z) B)^2 ≤ frameResidual + (PotentialKaehler.potentialMatrix (fun y => Real.log (M y).det.re) z) + (G z) (curvatureDiagonal G z) B) + (hmax : IsLocalMax (fun y => Real.log (inverseTrace M G y)-(C+1)*f y) z) : + inverseTrace M G z ≤ (C+1)*n := by + obtain ⟨B,w,hB,hw,hM1⟩ := normalized_frame M z (hp z hz) + have hwU : B w ∈ U := hw ▸ hz + have hfs := hf.contDiffAt (hU.mem_nhds hz) + have hSpos : 0 < inverseTrace M G z := inverseTrace_pos (hp z hz) (hGp z hz) + have hSs := (inverseTrace_smooth hU hM hp hG).contDiffAt (hU.mem_nhds hz) + have hlog := hSs.log (ne_of_gt hSpos) + have hbℝ := (B.restrictScalars ℝ).contDiff.contDiffAt (x := w) (n := ∞) + have hfc : ContDiffAt ℝ ∞ (fun y => f (B y)) w := by + exact (hw ▸ hfs).comp w hbℝ + have hlc : ContDiffAt ℝ ∞ (fun y => Real.log (inverseTrace M G (B y))) w := by + exact (hw ▸ hlog).comp w hbℝ + have hmaxc : IsLocalMax (fun y => Real.log (inverseTrace M G (B y))-(C+1)*f (B y)) w := by + have ht : Tendsto B (𝓝 w) (𝓝 z) := hw ▸ B.continuous.continuousAt + change ∀ᶠ y in 𝓝 w, Real.log (inverseTrace M G (B y))-(C+1)*f (B y) ≤ + Real.log (inverseTrace M G (B w))-(C+1)*f (B w) + rw [hw] + exact ht.eventually hmax + have ht := EllipticKernel.trace_potentialMatrix_nonpos_at_localMax + (hlc.sub (contDiffAt_const.mul hfc)) hmaxc (1 : Matrix (Fin n) (Fin n) ℂ) Matrix.PosDef.one + rw [inv_one,one_mul,potentialMatrix_trace_sub_smul hlc hfc] at ht + have hphi := trace_potential_in_frame B hB M G f w (hw ▸ hfs) (hw ▸ he) hM1 + rw [hphi,hw] at ht + have hi := inverseTrace_log_inequality_frame hU B hB hM hp hclosed hG hGp hwU hM1 + rw [hw] at hi + have hb := hbound (frameMatrix B) + have hgram := inverseTrace_eq_frameGram B hB M G w hM1 + rw [hw] at hgram + rw [← hgram] at hb + exact scalar_trace_maximum hSpos (hb.trans hi) ht +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CircleRadialCalculus.lean b/lean/OAI/Geometry/PrescribedPotential/CircleRadialCalculus.lean new file mode 100644 index 0000000000000000000000000000000000000000..2979e2f25711e929cfeccd32b831188b361093d9 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CircleRadialCalculus.lean @@ -0,0 +1,199 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CircleSubmeanCalculus + +namespace OAI + +/-! Circle Radial Calculus. -/ + +section + + + +noncomputable section +open Set Filter Topology Metric MeasureTheory +open scoped ContDiff +namespace PotentialABP + +private def v (θ : ℝ) : ℂ := circleMap 0 1 θ +private def w (θ : ℝ) : ℂ := v θ * Complex.I + +private lemma dv (θ : ℝ) : HasDerivAt v (w θ) θ := hasDerivAt_circleMap 0 1 θ +private lemma dw (θ : ℝ) : HasDerivAt w (-v θ) θ := by + convert (dv θ).mul_const Complex.I using 1 <;> first | rfl | simp [w, mul_assoc] + +private lemma cv : Continuous v := continuous_circleMap 0 1 +private lemma cw : Continuous w := cv.mul continuous_const + + +def circleIntegralReal (f : ℂ → ℝ) (c : ℂ) (r : ℝ) : ℝ := + ∫ θ in 0..2*Real.pi, f (c + r • v θ) +def radialIntegral (f : ℂ → ℝ) (c : ℂ) (r : ℝ) : ℝ := + ∫ θ in 0..2*Real.pi, fderiv ℝ f (c + r • v θ) (v θ) +def secondRadialIntegral (f : ℂ → ℝ) (c : ℂ) (r : ℝ) : ℝ := + ∫ θ in 0..2*Real.pi, fderiv ℝ (fderiv ℝ f) (c + r • v θ) (v θ) (v θ) +def angularHessianIntegral (f : ℂ → ℝ) (c : ℂ) (r : ℝ) : ℝ := + ∫ θ in 0..2*Real.pi, fderiv ℝ (fderiv ℝ f) (c + r • v θ) (w θ) (w θ) + +lemma circleIntegralReal_eq_circleAverage (f : ℂ → ℝ) (c : ℂ) (r : ℝ) : + circleIntegralReal f c r = 2*Real.pi * Real.circleAverage f c r := by + unfold circleIntegralReal Real.circleAverage + simp only [smul_eq_mul, ← mul_assoc, mul_inv_cancel₀ (by positivity : (2:ℝ)*Real.pi ≠ 0), one_mul] + congr 1 + funext θ + congr 1 + simp [v, circleMap, Complex.real_smul] + +lemma circleIntegralReal_hasDerivAt {f : ℂ → ℝ} (hf : ContDiff ℝ ∞ f) (c : ℂ) (r : ℝ) : + HasDerivAt (circleIntegralReal f c) (radialIntegral f c r) r := by + refine hasDerivAt_intervalIntegral_continuous + (F := fun s θ => f (c + s • v θ)) + (F' := fun s θ => fderiv ℝ f (c + s • v θ) (v θ)) ?_ ?_ ?_ 0 (2*Real.pi) r + · exact hf.continuous.comp (continuous_const.add (continuous_fst.smul (cv.comp continuous_snd))) + · exact ((hf.continuous_fderiv (by simp)).comp + (continuous_const.add (continuous_fst.smul (cv.comp continuous_snd)))).clm_apply (cv.comp continuous_snd) + · intro s θ + simpa only [one_smul, Function.comp_def, id_eq] using + (hf.differentiable (by simp) _).hasFDerivAt.comp_hasDerivAt s + (((hasDerivAt_id s).smul_const (v θ)).const_add c) + +lemma radialIntegral_hasDerivAt {f : ℂ → ℝ} (hf : ContDiff ℝ ∞ f) (c : ℂ) (r : ℝ) : + HasDerivAt (radialIntegral f c) (secondRadialIntegral f c r) r := by + have hdf := hf.fderiv_right (m := ∞) (by simp) + refine hasDerivAt_intervalIntegral_continuous + (F := fun s θ => fderiv ℝ f (c + s • v θ) (v θ)) + (F' := fun s θ => fderiv ℝ (fderiv ℝ f) (c + s • v θ) (v θ) (v θ)) + ?_ ?_ ?_ 0 (2*Real.pi) r + · exact (hdf.continuous.comp + (continuous_const.add (continuous_fst.smul (cv.comp continuous_snd)))).clm_apply (cv.comp continuous_snd) + · exact (((hdf.continuous_fderiv (by simp)).comp + (continuous_const.add (continuous_fst.smul (cv.comp continuous_snd)))).clm_apply + (cv.comp continuous_snd)).clm_apply (cv.comp continuous_snd) + · intro s θ + have h := ((hdf.differentiable (by simp) _).hasFDerivAt.comp_hasDerivAt s + (((hasDerivAt_id s).smul_const (v θ)).const_add c)).clm_apply (hasDerivAt_const s (v θ)) + simpa only [one_smul, Function.comp_def, id_eq, map_zero, add_zero] using h + +lemma radialIntegral_eq_radius_angular {f : ℂ → ℝ} (hf : ContDiff ℝ ∞ f) (c : ℂ) (r : ℝ) : + radialIntegral f c r = r * angularHessianIntegral f c r := by + have hdf := hf.fderiv_right (m := ∞) (by simp) + let T : ℝ → ℝ := fun θ => fderiv ℝ f (c + r • v θ) (w θ) + let T' : ℝ → ℝ := fun θ => r * fderiv ℝ (fderiv ℝ f) (c + r • v θ) (w θ) (w θ) + - fderiv ℝ f (c + r • v θ) (v θ) + have ht (θ : ℝ) : HasDerivAt T (T' θ) θ := by + have h := ((hdf.differentiable (by simp) _).hasFDerivAt.comp_hasDerivAt θ + (((dv θ).const_smul r).const_add c)).clm_apply (dw θ) + simpa only [T, T', Function.comp_def, map_smul, map_neg, smul_eq_mul, sub_eq_add_neg, Pi.smul_apply, smul_apply] using h + have hct : Continuous T' := by + apply Continuous.sub + · exact continuous_const.mul (((hdf.continuous_fderiv (by simp)).comp + (continuous_const.add (cv.const_smul r))).clm_apply cw |>.clm_apply cw) + · exact (hdf.continuous.comp (continuous_const.add (cv.const_smul r))).clm_apply cv + have he := intervalIntegral.integral_eq_sub_of_hasDerivAt + (fun θ _ => ht θ) (hct.intervalIntegrable 0 (2*Real.pi)) + have hp : T (2*Real.pi) = T 0 := by + have hv : v (2*Real.pi) = v 0 := by + simpa only [v, zero_add] using periodic_circleMap 0 1 0 + simp only [T, w, hv] + rw [hp, sub_self] at he + have hc1 : Continuous (fun θ => fderiv ℝ (fderiv ℝ f) (c + r • v θ) (w θ) (w θ)) := + (((hdf.continuous_fderiv (by simp)).comp + (continuous_const.add (cv.const_smul r))).clm_apply cw).clm_apply cw + have hc2 : Continuous (fun θ => fderiv ℝ f (c + r • v θ) (v θ)) := + (hdf.continuous.comp (continuous_const.add (cv.const_smul r))).clm_apply cv + dsimp only [T'] at he + have hi1 : IntervalIntegrable (fun θ => r * fderiv ℝ (fderiv ℝ f) + (c + r • v θ) (w θ) (w θ)) volume 0 (2*Real.pi) := + (continuous_const.mul hc1).intervalIntegrable _ _ + rw [intervalIntegral.integral_sub hi1 (hc2.intervalIntegrable _ _), + intervalIntegral.integral_const_mul] at he + exact (sub_eq_zero.mp he).symm + +lemma radialIntegral_continuous {f : ℂ → ℝ} (hf : ContDiff ℝ ∞ f) (c : ℂ) : + Continuous (radialIntegral f c) := + continuous_iff_continuousAt.mpr (fun r => (radialIntegral_hasDerivAt hf c r).continuousAt) +lemma circleIntegralReal_continuous {f : ℂ → ℝ} (hf : ContDiff ℝ ∞ f) (c : ℂ) : + Continuous (circleIntegralReal f c) := + continuous_iff_continuousAt.mpr (fun r => (circleIntegralReal_hasDerivAt hf c r).continuousAt) + +private lemma hessian_circle_pair (B : ℂ →L[ℝ] ℂ →L[ℝ] ℝ) (θ : ℝ) : + B (v θ) (v θ) + B (w θ) (w θ) = B 1 1 + B Complex.I Complex.I := by + have hv : v θ = Real.cos θ • (1:ℂ) + Real.sin θ • Complex.I := by + apply Complex.ext <;> simp [v, circleMap_zero_re, circleMap_zero_im, -Complex.ofReal_cos, -Complex.ofReal_sin] + have hw : w θ = (-Real.sin θ) • (1:ℂ) + Real.cos θ • Complex.I := by + apply Complex.ext <;> simp [w, v, circleMap_zero_re, circleMap_zero_im, Complex.mul_re, Complex.mul_im, -Complex.ofReal_cos, -Complex.ofReal_sin] + rw [hv, hw] + calc + _ = (Real.sin θ ^ 2 + Real.cos θ ^ 2) * (B 1 1 + B Complex.I Complex.I) := by + simp only [map_add, map_smul, add_apply, + smul_apply, smul_eq_mul] + ring + _ = _ := by rw [Real.sin_sq_add_cos_sq, one_mul] + + + +theorem smooth_circle_submean {f : ℂ → ℝ} (hf : ContDiff ℝ ∞ f) + (c : ℂ) {R : ℝ} (hR : 0 ≤ R) + (htrace : ∀ z ∈ closedBall c R, + 0 ≤ fderiv ℝ (fderiv ℝ f) z 1 1 + + fderiv ℝ (fderiv ℝ f) z Complex.I Complex.I) : + f c ≤ Real.circleAverage f c R := by + have hdf := hf.fderiv_right (m := ∞) (by simp) + have hpos (r : ℝ) (hr : r ∈ Icc 0 R) : + 0 ≤ secondRadialIntegral f c r + angularHessianIntegral f c r := by + have hc1 : Continuous (fun θ => fderiv ℝ (fderiv ℝ f) (c + r • v θ) (v θ) (v θ)) := + (((hdf.continuous_fderiv (by simp)).comp + (continuous_const.add (cv.const_smul r))).clm_apply cv).clm_apply cv + have hc2 : Continuous (fun θ => fderiv ℝ (fderiv ℝ f) (c + r • v θ) (w θ) (w θ)) := + (((hdf.continuous_fderiv (by simp)).comp + (continuous_const.add (cv.const_smul r))).clm_apply cw).clm_apply cw + dsimp only [secondRadialIntegral, angularHessianIntegral] + rw [← intervalIntegral.integral_add (hc1.intervalIntegrable _ _) (hc2.intervalIntegrable _ _)] + apply intervalIntegral.integral_nonneg_of_forall (by positivity) + intro θ + rw [hessian_circle_pair] + apply htrace + simp only [mem_closedBall, dist_eq_norm, add_sub_cancel_left, norm_smul, + v, norm_circleMap_zero, abs_one, mul_one, Real.norm_eq_abs, abs_of_nonneg hr.1] + exact hr.2 + let J : ℝ → ℝ := fun r => r * radialIntegral f c r + have hdJ (r : ℝ) : HasDerivAt J + (radialIntegral f c r + r * secondRadialIntegral f c r) r := by + have hh := (hasDerivAt_id r).mul (radialIntegral_hasDerivAt hf c r) + change HasDerivAt (fun s => s * radialIntegral f c s) _ r at hh + simpa only [J, id_eq, one_mul] using hh + have hmJ : MonotoneOn J (Icc 0 R) := by + apply monotoneOn_of_hasDerivWithinAt_nonneg (convex_Icc 0 R) + ((continuous_id.mul (radialIntegral_continuous hf c)).continuousOn) + (fun r _ => (hdJ r).hasDerivWithinAt) + intro r hr + have hr' := interior_subset hr + rw [radialIntegral_eq_radius_angular hf, ← mul_add] + exact mul_nonneg hr'.1 (by simpa only [add_comm] using hpos r hr') + have hmF : MonotoneOn (circleIntegralReal f c) (Icc 0 R) := by + apply monotoneOn_of_hasDerivWithinAt_nonneg (convex_Icc 0 R) + (circleIntegralReal_continuous hf c).continuousOn + (fun r _ => (circleIntegralReal_hasDerivAt hf c r).hasDerivWithinAt) + intro r hr + have hr' : r ∈ Ioo 0 R := by simpa only [interior_Icc] using hr + have hj := hmJ ⟨le_rfl,hR⟩ ⟨hr'.1.le,hr'.2.le⟩ hr'.1.le + simp only [J, zero_mul] at hj + nlinarith [hr'.1] + have he := hmF ⟨le_rfl,hR⟩ ⟨hR,le_rfl⟩ hR + have hF0 : circleIntegralReal f c 0 = 2*Real.pi*f c := by + simp [circleIntegralReal] + have hFR : Real.circleAverage f c R = (2*Real.pi)⁻¹ * circleIntegralReal f c R := by + unfold Real.circleAverage circleIntegralReal + congr 2 + funext θ + congr 1 + simp [v, circleMap, Complex.real_smul] + rw [hF0] at he + rw [hFR] + exact (le_inv_mul_iff₀ (by positivity : 0 < 2*Real.pi)).mpr (by simpa only [mul_comm] using he) + +end PotentialABP + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CircleSubmeanCalculus.lean b/lean/OAI/Geometry/PrescribedPotential/CircleSubmeanCalculus.lean new file mode 100644 index 0000000000000000000000000000000000000000..954022613a8df086b46b91edb7f0e29ca5fba652 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CircleSubmeanCalculus.lean @@ -0,0 +1,41 @@ +import Mathlib + +namespace OAI + +/-! Circle Submean Calculus. -/ + +section + + + +noncomputable section +open Set Filter Topology Metric MeasureTheory +namespace PotentialABP + +lemma hasDerivAt_intervalIntegral_continuous + {F F' : ℝ → ℝ → ℝ} + (hF : Continuous (Function.uncurry F)) + (hF' : Continuous (Function.uncurry F')) + (hderiv : ∀ r θ, HasDerivAt (fun s => F s θ) (F' r θ) r) + (a b r : ℝ) : + HasDerivAt (fun s => ∫ θ in a..b, F s θ) (∫ θ in a..b, F' r θ) r := by + obtain ⟨C, hC⟩ := ((isCompact_closedBall r 1).prod isCompact_uIcc).bddAbove_image + hF'.norm.continuousOn + apply (intervalIntegral.hasDerivAt_integral_of_dominated_loc_of_deriv_le + (bound := fun _ => C) (s := ball r 1) (ball_mem_nhds r (by norm_num)) ?_ ?_ ?_ ?_ ?_ ?_).2 + · filter_upwards [] with s + exact (hF.comp (continuous_const.prodMk continuous_id)).aestronglyMeasurable + · exact (hF.comp (continuous_const.prodMk continuous_id)).intervalIntegrable a b + · exact (hF'.comp (continuous_const.prodMk continuous_id)).aestronglyMeasurable + · filter_upwards [] with θ hθ s hs + exact hC ⟨(s,θ), ⟨ball_subset_closedBall hs, uIoc_subset_uIcc hθ⟩, rfl⟩ + · exact intervalIntegrable_const + · filter_upwards [] with θ _ s _ + exact hderiv s θ + +end PotentialABP + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/ClosedRangeSmooth.lean b/lean/OAI/Geometry/PrescribedPotential/ClosedRangeSmooth.lean new file mode 100644 index 0000000000000000000000000000000000000000..aca5911d4598638cdb38077ce58282abca73558f --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/ClosedRangeSmooth.lean @@ -0,0 +1,103 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.AugmentedVolume +import OAI.Geometry.PrescribedPotential.RealNonlinearDerivative + +namespace OAI + +/-! Closed Range Smooth. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical +namespace ClosedRangeSmooth +universe u +variable {E F G : Type u} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] + [NormedAddCommGroup G] [NormedSpace ℝ G] + +lemma isometry_derivative_iff (e : F →ₗᵢ[ℝ] G) (f : E → F) (L : E →L[ℝ] F) (x : E) : + HasFDerivAt f L x ↔ HasFDerivAt (fun y => e (f y)) (e.toContinuousLinearMap ∘L L) x := by + simp only [hasFDerivAt_iff_isLittleO] + conv_lhs => rw [← Asymptotics.isLittleO_norm_left] + conv_rhs => rw [← Asymptotics.isLittleO_norm_left] + simp only [ContinuousLinearMap.comp_apply, LinearIsometry.coe_toContinuousLinearMap, + ← map_sub, e.norm_map] + +lemma lift_derivative [CompleteSpace F] (e : F →ₗᵢ[ℝ] G) (f : E → F) + {x : E} {J : E →L[ℝ] G} (hJ : HasFDerivAt (fun y => e (f y)) J x) : + ∃ L : E →L[ℝ] F, HasFDerivAt f L x ∧ e.toContinuousLinearMap ∘L L = J := by + let S := e.range + have hS : IsClosed (S : Set G) := e.isometry.isClosedEmbedding.isClosed_range + let r : E → S := fun y => e.equivRange (f y) + have hmem : ∀ v, J v ∈ S := + ClosedDerivative.derivative_mem S hS r hJ + let L := e.equivRange.symm.toContinuousLinearEquiv.toContinuousLinearMap ∘L J.codRestrict S hmem + have hcomp : e.toContinuousLinearMap ∘L L = J := by + ext v + change e (e.equivRange.symm ⟨J v,hmem v⟩) = J v + exact congrArg Subtype.val (e.equivRange.apply_symm_apply ⟨J v,hmem v⟩) + refine ⟨L,(isometry_derivative_iff e f L x).mpr ?_,hcomp⟩ + rwa [hcomp] + + + +lemma contDiff_of_isometry (n : ℕ) [CompleteSpace F] (e : F →ₗᵢ[ℝ] G) (f : E → F) + (hf : ContDiff ℝ n (fun y => e (f y))) : ContDiff ℝ n f := by + induction n generalizing F G with + | zero => + rw [Nat.cast_zero, contDiff_zero] at hf ⊢ + exact e.isEmbedding.continuous_iff.mpr hf + | succ n ih => + rw [Nat.cast_succ, contDiff_succ_iff_hasFDerivAt] at hf ⊢ + obtain ⟨J,hJ,hd⟩ := hf + choose L hL he using fun x => lift_derivative e f (hd x) + refine ⟨L,?_,hL⟩ + let ep : (E →L[ℝ] F) →ₗᵢ[ℝ] (E →L[ℝ] G) := e.postcomp + apply ih ep L + convert hJ using 1 + funext x + exact he x + +lemma contDiff_infty_of_isometry [CompleteSpace F] (e : F →ₗᵢ[ℝ] G) (f : E → F) + (hf : ContDiff ℝ ∞ (fun y => e (f y))) : ContDiff ℝ ∞ f := by + apply contDiff_infty.mpr + intro n + exact contDiff_of_isometry n e f (contDiff_infty.mp hf n) +end ClosedRangeSmooth + +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) +local instance closedRangeNormedGroup (s : ℝ) : NormedAddCommGroup (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedAddCommGroup +local instance closedRangeNormedSpace (s : ℝ) : NormedSpace ℝ (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedSpace +local instance closedRangeTopologicalGroup (s : ℝ) : IsTopologicalAddGroup (D.localizers.RealSobolev s) := + Submodule.isTopologicalAddGroup _ +local instance closedRangeContinuousSMul (s : ℝ) : ContinuousSMul ℝ (D.localizers.RealSobolev s) := + SMulMemClass.continuousSMul _ + +lemma realVolume_contDiff (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) : + ContDiff ℝ ∞ (D.realVolume k hk) := + ClosedRangeSmooth.contDiff_infty_of_isometry + (D.localizers.realCompletion (k : ℝ)).subtypeₗᵢ _ (D.realVolume_ambient_contDiff k hk) + +lemma augmentedVolume_contDiff (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (x₀ : X) : + ContDiff ℝ ∞ (D.augmentedVolume k hk x₀) := by + apply ContDiff.prodMk + · exact (contDiff_snd.neg.exp).smul ((D.realVolume_contDiff k hk).comp contDiff_fst) + · exact (D.realEvaluation ((k : ℝ)+2) x₀).contDiff.comp contDiff_fst +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CommutatorSupport.lean b/lean/OAI/Geometry/PrescribedPotential/CommutatorSupport.lean new file mode 100644 index 0000000000000000000000000000000000000000..4e465fbe53a72f65e017c19a804dc388069195df --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CommutatorSupport.lean @@ -0,0 +1,142 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.FrozenEllipticJets +import OAI.Geometry.PrescribedPotential.NonlinearHessianCommutator +import OAI.Geometry.PrescribedPotential.NonlinearRemainderStrong +import OAI.Geometry.PrescribedPotential.RealSobolev +import OAI.Geometry.PrescribedPotential.RegularityCoordinates + +namespace OAI + +/-! Commutator Support. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix LineDeriv +open scoped ContDiff SchwartzMap Classical Matrix.Norms.Elementwise +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] + +lemma hessianLocalizedError_zero {κ : 𝓢(EC d, ℂ)} (v : EC d) (f : 𝓢(EC d, ℂ)) + {y : EC d} (hy : y ∉ tsupport (κ : EC d → ℂ)) (i j : Fin d) : + hessianLocalizedError κ v i j f y = 0 := by + have hz := notMem_tsupport_iff_eventuallyEq.mp hy + have he : (SchwartzMap.smulLeftCLM ℂ κ (∂_{v} f) : EC d → ℂ) =ᶠ[𝓝 y] + (0 : 𝓢(EC d, ℂ)) := by + filter_upwards [hz] with z hzz + rw [SchwartzMap.smulLeftCLM_apply_apply κ.hasTemperateGrowth] + change κ z * _ = 0 + simp only [hzz,Pi.zero_apply,zero_mul] + have hh := congrArg (fun u : 𝓢(EC d, ℂ) => u y) (hessianLocalizedError_identity κ f v i j) + rw [hessianEntrySchwartz_congr he,map_zero,_root_.zero_apply] at hh + simp only [_root_.add_apply] at hh + rw [SchwartzMap.smulLeftCLM_apply_apply κ.hasTemperateGrowth] at hh + change 0 = κ y * _ + hessianLocalizedError κ v i j f y at hh + simp only [hz.eq_of_nhds,Pi.zero_apply,zero_mul,zero_add] at hh + exact hh.symm + +omit [T2Space X] [CompactSpace X] in +lemma source_hessian_zero_of_local {φ : SmoothRealFunction A} {x : X} + (he : φ.value =ᶠ[𝓝 x] (fun _ => 0)) (q : Fin A.count) + (hx : x ∈ (A.chart q).source) : φ.hessian q (A.chart q x) = 0 := by + have ht := (A.chart q).mapsTo hx + have hc : Tendsto (A.chart q).symm (𝓝 (A.chart q x)) (𝓝 x) := by + simpa only [(A.chart q).left_inv hx] using + ((A.chart q).symm.continuousAt ht).tendsto + have hh : φ.localExpression q =ᶠ[𝓝 (A.chart q x)] (fun _ => 0) := he.comp_tendsto hc + have h2 := (hh.fderiv (𝕜 := ℝ)).fderiv_eq (𝕜 := ℝ) + change PotentialKaehler.hermitianPartMatrix (fderiv ℝ (fderiv ℝ (φ.localExpression q)) + (A.chart q x)) = 0 + rw [h2] + ext i j + simp [PotentialKaehler.hermitianPartMatrix_apply,PotentialKaehler.hermitianPart] + rfl + +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +def derivativeSupport (p : ι) : Set X := + (A.euclideanChart (D.patch p).index).symm '' tsupport (D.cutoff p : EC d → ℂ) + +lemma localizedDerivative_tsupport (p : ι) (v : EC d) (f : Smooth A) : + tsupport (D.localizedDerivative p v f : X → ℂ) ⊆ D.derivativeSupport p := by + rw [D.localizedDerivative_regularity] + exact (globalize_tsupport _ _ _).trans (image_mono (D.cutoff p).realPart_support) + +omit [T2Space X] [CompactSpace X] in +lemma derivativeSupport_source {p : ι} {x : X} (hx : x ∈ D.derivativeSupport p) : + x ∈ (A.euclideanChart (D.patch p).index).source ∧ + A.euclideanChart (D.patch p).index x ∈ tsupport (D.cutoff p : EC d → ℂ) := by + obtain ⟨y,hy,rfl⟩ := hx + have ht := (D.cutoff p).support_sub hy + exact ⟨(A.euclideanChart (D.patch p).index).symm.mapsTo ht, + by rwa [(A.euclideanChart (D.patch p).index).right_inv ht]⟩ + +omit [T2Space X] [CompactSpace X] in +lemma outsideDerivativeSupport_coord {p : ι} {x : X} (hx : x ∉ D.derivativeSupport p) + (hs : x ∈ (A.euclideanChart (D.patch p).index).source) : + A.euclideanChart (D.patch p).index x ∉ tsupport (D.cutoff p : EC d → ℂ) := by + intro hh + exact hx ⟨_,hh,(A.euclideanChart (D.patch p).index).left_inv hs⟩ + +lemma localizedDerivative_zero {p : ι} {x : X} (hx : x ∉ D.derivativeSupport p) + (v : EC d) (f : Smooth A) : D.localizedDerivative p v f x = 0 := + image_eq_zero_of_notMem_tsupport (fun hh => hx (D.localizedDerivative_tsupport p v f hh)) + +lemma regularityError_zero {p : ι} {x : X} (hx : x ∉ D.derivativeSupport p) + (v : EC d) (f : Smooth A) (i j : Fin d) : D.regularityError p v i j f x = 0 := by + change globalize (D.patch p).index (D.regularityCutoff p) _ x = 0 + rw [globalize_apply] + split_ifs with hs + · have hh := D.outsideDerivativeSupport_coord hx hs + have hz := hessianLocalizedError_zero v + (localize A (D.patch p).index (cutoffGlobal (D.patch p).index (D.regularityOuter p)) + (cutoffGlobal_support _ _) f) + (fun hh' => hh ((D.cutoff p).realPart_support hh')) i j + exact mul_eq_zero_of_right _ hz + · rfl + +lemma nonlinearRemainder_zero {p : ι} {x : X} (hx : x ∉ D.derivativeSupport p) + (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (v : EC d) (f : Smooth A) : + D.localizers.strong (k : ℝ) + (D.nonlinearRemainder k hk p v (D.localizers.embed ((k : ℝ)+2) f)) x = 0 := by + rw [D.nonlinearRemainder_strong_embed] + have hm : (fun (i j : Fin d) => D.regularityError p v i j f x - + D.localizedDerivative p v (D.regularityMetric p i j) x) = 0 := by + ext i j + rw [D.regularityError_zero hx,D.localizedDerivative_zero hx,sub_self] + rfl + let M : Matrix (Fin d) (Fin d) ℂ := fun i j => + D.regularityMetric p i j x + D.regularityHessian p i j f x + change D.regularityInverseDet p x * NonlinearHessian.detDifferential M _ - + D.localizedDerivative p v (D.regularityInverseDet p) x * M.det = 0 + rw [hm] + change D.regularityInverseDet p x * NonlinearHessian.detDifferential M (0 : Matrix (Fin d) (Fin d) ℂ) - + D.localizedDerivative p v (D.regularityInverseDet p) x * M.det = 0 + rw [(NonlinearHessian.detDifferential M).map_zero,D.localizedDerivative_zero hx, + mul_zero,zero_mul,sub_self] + +lemma localizedDerivative_source_hessian_zero {p : ι} {x : X} + (hx : x ∉ D.derivativeSupport p) (v : EC d) (φ : SmoothRealFunction A) + (q : Fin A.count) (hq : x ∈ (A.chart q).source) : + ((D.realLocalizedDerivative p v (RealSmooth.ofReal φ)).source).hessian q (A.chart q x) = 0 := by + apply source_hessian_zero_of_local _ q hq + have hn : x ∉ tsupport (D.localizedDerivative p v (Smooth.ofReal φ) : X → ℂ) := + fun hh => hx (D.localizedDerivative_tsupport p v (Smooth.ofReal φ) hh) + have he := notMem_tsupport_iff_eventuallyEq.mp hn + filter_upwards [he] with y hy + change (D.localizedDerivative p v (Smooth.ofReal φ) y).re = 0 + rw [hy] + rfl + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CompactAlternative.lean b/lean/OAI/Geometry/PrescribedPotential/CompactAlternative.lean new file mode 100644 index 0000000000000000000000000000000000000000..38ca07817450bca69bc11637b291d97cb1d317f2 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CompactAlternative.lean @@ -0,0 +1,34 @@ +import Mathlib + +namespace OAI + +/-! Compact Alternative. -/ + +section + + +noncomputable section +namespace GlobalElliptic +variable {H : Type*} [NormedAddCommGroup H] [NormedSpace ℝ H] [CompleteSpace H] + +lemma compact_one_sub_surjective (T : H →L[ℝ] H) (hT : IsCompactOperator T) + (hker : ∀ u : H, T u = u → u = 0) : + Function.Surjective (1 - T : H →L[ℝ] H) := by + have hn : ¬ Module.End.HasEigenvalue (T : Module.End ℝ H) 1 := by + intro hev + obtain ⟨u, hu⟩ := hev.exists_hasEigenvector + apply hu.2 + apply hker u + have heq : T u = (1 : ℝ) • u := Module.End.HasEigenvector.apply_eq_smul hu + exact heq.trans (one_smul ℝ u) + have hr := (hT.hasEigenvalue_or_mem_resolventSet (by norm_num : (1 : ℝ) ≠ 0)).resolve_left hn + rw [spectrum.mem_resolventSet_iff] at hr + have hu : IsUnit (1 - T : H →L[ℝ] H) := by simpa only [map_one] using hr + exact (ContinuousLinearMap.isUnit_iff_bijective.mp hu).2 + +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CompactCoefficientBootstrap.lean b/lean/OAI/Geometry/PrescribedPotential/CompactCoefficientBootstrap.lean new file mode 100644 index 0000000000000000000000000000000000000000..6fd2187e4bd697e5099cab65f158595adc870f95 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CompactCoefficientBootstrap.lean @@ -0,0 +1,70 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.QuasilinearFamilyBootstrap + +namespace OAI + +/-! Compact Coefficient Bootstrap. -/ + +section + +noncomputable section +open Set Filter Topology Finset Module +open scoped ContDiff +namespace HigherJet +variable {E F G : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [NormedAddCommGroup F] [InnerProductSpace ℝ F] + [NormedAddCommGroup G] [NormedSpace ℝ G] + [FiniteDimensional ℝ E] [FiniteDimensional ℝ F] + {ι α : Type*} [Fintype ι] +local instance compactHessianNorm : NormedAddCommGroup (E →L[ℝ] E →L[ℝ] F) := inferInstance +local instance compactHessianSpace : NormedSpace ℝ (E →L[ℝ] E →L[ℝ] F) := inferInstance +lemma quasilinear_compact_coefficient_bootstrap (B : G →L[ℝ] (E →L[ℝ] E →L[ℝ] F) →L[ℝ] F) + {U : Set E} (hU : IsOpen U) (e : OrthonormalBasis ι ℝ E) + (u r : α → E → F) (a : F → G) (b : F × (E →L[ℝ] F) → F) + (τ : α → E → E ≃L[ℝ] E) + (hu : ∀ s, ContDiffOn ℝ ∞ (u s) U) (hr : ∀ s, ContDiffOn ℝ ∞ (r s) U) + (ha : ∀ s y, y ∈ U → ContDiffAt ℝ ∞ a (u s y)) + (hb : ∀ s y, y ∈ U → ContDiffAt ℝ ∞ b (firstJet (u s) y)) + (heq : ∀ s y, y ∈ U → B (a (u s y)) (hessian (u s) y) = r s y+b (firstJet (u s) y)) + (hframe : ∀ s x, x ∈ U → ∀ H : E →L[ℝ] E →L[ℝ] F, + B (a (u s x)) H = ∑ i, H (τ s x (e i)) (τ s x (e i))) + (hframes : ∀ K, IsCompact K → K ⊆ U → ∃ C : ℝ, 0 ≤ C ∧ ∀ s x, x ∈ K → + ‖(τ s x).toContinuousLinearMap‖ ≤ C ∧ ‖(τ s x).symm.toContinuousLinearMap‖ ≤ C) + (hcompact : ∀ K, IsCompact K → K ⊆ U → ∃ P : Set (F × (E →L[ℝ] F)), IsCompact P ∧ + (∀ s x, x ∈ K → firstJet (u s) x ∈ P) ∧ + (∀ p ∈ P, ContDiffAt ℝ ∞ a p.1 ∧ ContDiffAt ℝ ∞ b p)) + (hrbounds : ∀ m K, IsCompact K → K ⊆ U → ∃ C : ℝ, ∀ j, j ≤ m → ∀ s x, x ∈ K → + ‖iteratedFDeriv ℝ j (r s) x‖ ≤ C) : + ∀ m, 1 ≤ m → ∀ K, IsCompact K → K ⊆ U → + ∃ C : ℝ, 0 ≤ C ∧ ∀ s x, x ∈ K → ‖iteratedFDeriv ℝ m (u s) x‖ ≤ C := by + apply quasilinear_family_bootstrap B hU e u r a b τ hu hr ha hb heq hframe hframes + intro m K hK hKU + obtain ⟨P,hP,hmem,hsm⟩ := hcompact K hK hKU + obtain ⟨A,hA,ha'⟩ := compact_coefficient_jets (hP.image continuous_fst) + (fun y hy => by obtain ⟨p,hp,rfl⟩ := hy; exact (hsm p hp).1) m + obtain ⟨Q,hQ,hb'⟩ := compact_coefficient_jets hP (fun y hy => (hsm y hy).2) m + obtain ⟨J,hJ⟩ := hP.exists_bound_of_continuousOn (continuous_snd.continuousOn : ContinuousOn (fun p : F × (E →L[ℝ] F) => p.2) P) + obtain ⟨R,hR⟩ := hrbounds m K hK hKU + let T : ℝ := ∑ j ∈ range (m+1), (Fintype.card (OrderedFinpartition j) : ℝ) + have hT : 0 ≤ T := Finset.sum_nonneg (fun _ _ => Nat.cast_nonneg _) + let C := 1+‖B‖+A+Q+max J 0+max R 0+T + have hC : 1 ≤ C := by dsimp [C]; linarith [norm_nonneg B,le_max_right J 0,le_max_right R 0] + have hcB : ‖B‖ ≤ C := by dsimp [C]; linarith [le_max_right J 0,le_max_right R 0] + have hcA : A ≤ C := by dsimp [C]; linarith [norm_nonneg B,le_max_right J 0,le_max_right R 0] + have hcQ : Q ≤ C := by dsimp [C]; linarith [norm_nonneg B,le_max_right J 0,le_max_right R 0] + have hcJ : J ≤ C := by dsimp [C]; linarith [norm_nonneg B,le_max_left J 0,le_max_right R 0] + have hcR : R ≤ C := by dsimp [C]; linarith [norm_nonneg B,le_max_right J 0,le_max_left R 0] + have hcT : T ≤ C := by dsimp [C]; linarith [norm_nonneg B,le_max_right J 0,le_max_right R 0] + refine ⟨C,hC,hcB,fun j hj => ?_,fun s x hx => ?_⟩ + · exact (Finset.single_le_sum (fun i _ => Nat.cast_nonneg (α := ℝ) (Fintype.card (OrderedFinpartition i))) + (mem_range.mpr (by omega))).trans hcT + · have hp := hmem s x hx + refine ⟨?_,fun j hj => (ha' j hj _ ⟨firstJet (u s) x,hp,rfl⟩).trans hcA, + fun j hj => (hb' j hj _ hp).trans hcQ,fun j hj => (hR j hj s x hx).trans hcR⟩ + simpa only [norm_iteratedFDeriv_one,firstJet] using (hJ _ hp).trans hcJ +end HigherJet + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CompactHomogeneousBounds.lean b/lean/OAI/Geometry/PrescribedPotential/CompactHomogeneousBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..f4101f6192cdcfb2a5eddd74e78b1830391696dc --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CompactHomogeneousBounds.lean @@ -0,0 +1,83 @@ +import Mathlib + +namespace OAI + +/-! Compact Homogeneous Bounds. -/ + +section + + + +noncomputable section +open Set Metric +namespace KaehlerCalculus +variable {X E : Type*} [TopologicalSpace X] + [NormedAddCommGroup E] [NormedSpace ℝ E] [ProperSpace E] + +lemma compact_homogeneous_bound {K : Set X} (hK : IsCompact K) + (p : ℕ) (hp : 0 < p) (F : X → E → ℝ) + (hF : ContinuousOn (fun q : X × E => F q.1 q.2) (K ×ˢ closedBall 0 1)) + (hhom : ∀ x ∈ K, ∀ r : ℝ, ∀ v, F x (r • v) = r^p*F x v) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ x ∈ K, ∀ v, |F x v| ≤ C*‖v‖^p := by + obtain ⟨C,hC⟩ := (hK.prod (isCompact_closedBall (0:E) 1)).exists_bound_of_continuousOn hF + refine ⟨max C 0,le_max_right _ _,?_⟩ + intro x hx v + by_cases hv : v = 0 + · subst v + have hh := hhom x hx 0 (0:E) + simp only [zero_smul,zero_pow (Nat.ne_of_gt hp),zero_mul] at hh + simp [hh,zero_pow (Nat.ne_of_gt hp)] + have hn : 0 < ‖v‖ := norm_pos_iff.mpr hv + have hw : ‖(‖v‖⁻¹ : ℝ) • v‖ = 1 := by + rw [norm_smul,Real.norm_eq_abs,abs_of_pos (inv_pos.mpr hn),inv_mul_cancel₀ hn.ne'] + have hb := hC (x,(‖v‖⁻¹ : ℝ) • v) ⟨hx,by simpa [mem_closedBall,dist_zero_right] using hw.le⟩ + change ‖F x ((‖v‖⁻¹:ℝ) • v)‖ ≤ C at hb + rw [hhom x hx,Real.norm_eq_abs,abs_mul,abs_of_nonneg (pow_nonneg (le_of_lt (inv_pos.mpr hn)) _)] at hb + have hh := mul_le_mul_of_nonneg_left (hb.trans (le_max_left C 0)) (pow_nonneg (norm_nonneg v) p) + have he : ‖v‖^p*((‖v‖⁻¹)^p*|F x v|) = |F x v| := by + rw [← mul_assoc,← mul_pow,mul_inv_cancel₀ hn.ne',one_pow,one_mul] + rw [he] at hh + simpa only [mul_comm] using hh + +lemma compact_homogeneous_positive {K : Set X} (hK : IsCompact K) + (F : X → E → ℝ) + (hF : ContinuousOn (fun q : X × E => F q.1 q.2) (K ×ˢ sphere 0 1)) + (hpos : ∀ x ∈ K, ∀ v ≠ 0, 0 < F x v) + (hhom : ∀ x ∈ K, ∀ r : ℝ, ∀ v, F x (r • v) = r^2*F x v) : + ∃ δ : ℝ, 0 < δ ∧ ∀ x ∈ K, ∀ v, δ*‖v‖^2 ≤ F x v := by + let L := K ×ˢ sphere (0:E) 1 + have hLc : IsCompact L := hK.prod (isCompact_sphere _ _) + have hp : ∀ q ∈ L, 0 < F q.1 q.2 := by + rintro ⟨x,v⟩ ⟨hx,hv⟩ + apply hpos x hx v + intro hv0 + simp [hv0] at hv + have hδ : ∃ δ : ℝ, 0 < δ ∧ ∀ q ∈ L, δ ≤ F q.1 q.2 := by + by_cases hn : L.Nonempty + · obtain ⟨q,hq,hmin⟩ := hLc.exists_isMinOn hn hF + exact ⟨_,hp q hq,fun y hy => hmin hy⟩ + · exact ⟨1,by norm_num,fun q hq => (hn ⟨q,hq⟩).elim⟩ + obtain ⟨δ,hδ,hb⟩ := hδ + refine ⟨δ,hδ,?_⟩ + intro x hx v + by_cases hv : v = 0 + · subst v + have hh := hhom x hx 0 (0:E) + simp only [zero_smul,zero_pow (by decide : 2 ≠ 0),zero_mul] at hh + simp [hh] + have hn : 0 < ‖v‖ := norm_pos_iff.mpr hv + have hw : ‖(‖v‖⁻¹ : ℝ) • v‖ = 1 := by + rw [norm_smul,Real.norm_eq_abs,abs_of_pos (inv_pos.mpr hn),inv_mul_cancel₀ hn.ne'] + have h := hb (x,(‖v‖⁻¹:ℝ) • v) ⟨hx,by simpa [mem_sphere,dist_zero_right] using hw⟩ + rw [hhom x hx] at h + have hh := mul_le_mul_of_nonneg_left h (sq_nonneg ‖v‖) + have he : ‖v‖^2*((‖v‖⁻¹)^2*F x v) = F x v := by + rw [← mul_assoc,← mul_pow,mul_inv_cancel₀ hn.ne',one_pow,one_mul] + rw [he] at hh + simpa only [mul_comm] using hh +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CompactIntegralPropagation.lean b/lean/OAI/Geometry/PrescribedPotential/CompactIntegralPropagation.lean new file mode 100644 index 0000000000000000000000000000000000000000..8e6023add0bd3ccb462b90965ebd69a87ce5fab9 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CompactIntegralPropagation.lean @@ -0,0 +1,104 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.WirtingerCalculus + +namespace OAI + +/-! Compact Integral Propagation. -/ + +section + + + +noncomputable section +open Set MeasureTheory +namespace PotentialABP +variable {X I : Type*} [TopologicalSpace X] [ConnectedSpace X] + [MeasurableSpace X] [Fintype I] + + + +omit [TopologicalSpace X] [ConnectedSpace X] in +lemma exists_le_total_div (μ : Measure X) [IsFiniteMeasure μ] + {u : X → ℝ} (hu : Integrable u μ) (hn : ∀ x, 0 ≤ u x) + {s : Set X} (hs : 0 < μ.real s) {B : ℝ} (hB : ∫ x, u x ∂μ ≤ B) : + ∃ x ∈ s, u x ≤ B / μ.real s := by + have hs0 : μ s ≠ 0 := by + intro h; simp [measureReal_def, h] at hs + obtain ⟨x, hx, hv⟩ := exists_le_setAverage hs0 (measure_ne_top μ s) hu.integrableOn + refine ⟨x, hx, hv.trans ?_⟩ + rw [setAverage_eq, smul_eq_mul, ← div_eq_inv_mul] + apply div_le_div_of_nonneg_right _ hs.le + exact (setIntegral_le_integral hu (Filter.Eventually.of_forall hn)).trans hB + + + +theorem finite_cover_integral_bound + (U : I → Set X) (hopen : ∀ i, IsOpen (U i)) + (hne : ∀ i, (U i).Nonempty) (hcover : ∀ x, ∃ i, x ∈ U i) + (μ : I → Measure X) [∀ i, IsFiniteMeasure (μ i)] + (hover : ∀ i j, (U i ∩ U j).Nonempty → 0 < (μ i).real (U j)) + (F : (X → ℝ) → Prop) + (hn : ∀ u, F u → ∀ x, 0 ≤ u x) + (hint : ∀ u, F u → ∀ i, Integrable u (μ i)) + (C : I → ℝ) (hC : ∀ i, 0 ≤ C i) + (hlocal : ∀ u, F u → ∀ i y, y ∈ U i → + (∫ x, u x ∂μ i) ≤ C i * (u y + 1)) : + ∃ B : ℝ, ∀ u, F u → (∃ x, u x = 0) → ∀ i, + (∫ x, u x ∂μ i) ≤ B := by + classical + have hstart (s : I) : ∀ j, ∃ B : ℝ, ∀ u, F u → + (∃ x ∈ U s, u x = 0) → (∫ x, u x ∂μ j) ≤ B := by + let Good : I → Prop := fun j => ∃ B : ℝ, ∀ u, F u → + (∃ x ∈ U s, u x = 0) → (∫ x, u x ∂μ j) ≤ B + have hGs : Good s := by + refine ⟨C s, ?_⟩ + rintro u hu ⟨x, hx, hz⟩ + simpa [hz] using hlocal u hu s x hx + have hstep {i j : I} (hi : Good i) (hij : (U i ∩ U j).Nonempty) : Good j := by + obtain ⟨B, hB⟩ := hi + refine ⟨C j * (B / (μ i).real (U j) + 1), ?_⟩ + intro u hu hz + obtain ⟨y, hy, hyB⟩ := exists_le_total_div (μ i) (hint u hu i) + (hn u hu) (hover i j hij) (hB u hu hz) + exact (hlocal u hu j y hy).trans + (mul_le_mul_of_nonneg_left (by linarith : u y + 1 ≤ B / (μ i).real (U j) + 1) (hC j)) + let V : Set X := ⋃ i, ⋃ (_ : Good i), U i + have hVo : IsOpen V := isOpen_iUnion fun i => isOpen_iUnion fun _ => hopen i + have hVc : IsClosed V := by + have he : Vᶜ = ⋃ i, ⋃ (_ : ¬ Good i), U i := by + ext x + simp only [V, mem_compl_iff, mem_iUnion] + constructor + · intro hx + obtain ⟨i, hi⟩ := hcover x + exact ⟨i, fun hg => hx ⟨i, hg, hi⟩, hi⟩ + · rintro ⟨i, hgi, hxi⟩ ⟨j, hgj, hxj⟩ + exact hgi (hstep hgj ⟨x, hxj, hxi⟩) + apply isOpen_compl_iff.mp + rw [he] + exact isOpen_iUnion fun i => isOpen_iUnion fun _ => hopen i + have hV : V = univ := (show IsClopen V from ⟨hVc, hVo⟩).eq_univ (by + obtain ⟨x, hx⟩ := hne s + exact ⟨x, mem_iUnion.mpr ⟨s, mem_iUnion.mpr ⟨hGs, hx⟩⟩⟩) + intro j + obtain ⟨x, hx⟩ := hne j + have hxV : x ∈ V := by rw [hV]; trivial + obtain ⟨i, hgi, hxi⟩ := (by simpa only [V, mem_iUnion] using hxV : + ∃ i, ∃ _ : Good i, x ∈ U i) + exact hstep hgi ⟨x, hxi, hx⟩ + choose B hB using hstart + refine ⟨∑ s, ∑ j, max (B s j) 0, ?_⟩ + intro u hu hz i + obtain ⟨x, hx⟩ := hz + obtain ⟨s, hs⟩ := hcover x + apply (hB s i u hu ⟨x, hs, hx⟩).trans + apply (le_max_left _ _).trans + apply (Finset.single_le_sum (fun j _ => le_max_right _ _) (Finset.mem_univ i)).trans + exact Finset.single_le_sum (fun s _ => Finset.sum_nonneg fun j _ => le_max_right _ _) + (Finset.mem_univ s) +end PotentialABP + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CompactSmoothCutoff.lean b/lean/OAI/Geometry/PrescribedPotential/CompactSmoothCutoff.lean new file mode 100644 index 0000000000000000000000000000000000000000..3b773a8a0d13c72fa7f9f2e16ffe1cfff03bef47 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CompactSmoothCutoff.lean @@ -0,0 +1,52 @@ +import Mathlib + +namespace OAI + +/-! Compact Smooth Cutoff. -/ + +section + +noncomputable section +open Set Filter Topology Function +open scoped ContDiff +namespace HigherJet +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] + +lemma compact_smooth_cutoff {K U : Set E} (hK : IsCompact K) (hU : IsOpen U) (hKU : K ⊆ U) : + ∃ L : Set E, ∃ χ : E → ℝ, IsCompact L ∧ L ⊆ U ∧ K ⊆ L ∧ ContDiff ℝ ∞ χ ∧ + (∀ x, 0 ≤ χ x ∧ χ x ≤ 1) ∧ (∀ x ∈ K, χ x=1) ∧ + (∀ x ∈ L, χ x≠0 → x ∈ interior L) := by + classical + obtain ⟨L,hL,hKL,hLU⟩ := exists_compact_between hK hU hKU + obtain ⟨f,hfs,hfd,hfv⟩ := isOpen_interior.exists_contDiff_support_eq (n := ⊤) (s := interior L) + obtain ⟨g,hgs,hgd,hgv⟩ := hK.isClosed.isOpen_compl.exists_contDiff_support_eq (n := ⊤) + have hfp (x : E) : 0 ≤ f x := (hfv ⟨x,rfl⟩).1 + have hgp (x : E) : 0 ≤ g x := (hgv ⟨x,rfl⟩).1 + have hd (x : E) : 0 < f x+g x := by + by_cases hx : x ∈ K + · have hf : f x ≠ 0 := by rw [← mem_support,hfs]; exact hKL hx + have hp := lt_of_le_of_ne (hfp x) (Ne.symm hf) + linarith [hgp x] + · have hg : g x ≠ 0 := by rw [← mem_support,hgs]; exact hx + have hp := lt_of_le_of_ne (hgp x) (Ne.symm hg) + linarith [hfp x] + refine ⟨L,fun x => f x/(f x+g x),hL,hLU,hKL.trans interior_subset, + hfd.div (hfd.add hgd) (fun x => ne_of_gt (hd x)),?_,?_,?_⟩ + · intro x + exact ⟨div_nonneg (hfp x) (hd x).le,(div_le_one (hd x)).mpr (by linarith [hgp x])⟩ + · intro x hx + have hg : g x=0 := by + by_contra hn + have hh : x ∈ Kᶜ := by rw [← hgs]; exact hn + exact hh hx + change f x/(f x+g x)=1 + rw [hg,add_zero,div_self (ne_of_gt (by linarith [hd x]))] + · intro x _ hn + rw [← hfs] + exact fun he => hn (by change f x/(f x+g x)=0; rw [he,zero_div]) +end HigherJet + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CompletedProduct.lean b/lean/OAI/Geometry/PrescribedPotential/CompletedProduct.lean new file mode 100644 index 0000000000000000000000000000000000000000..6efe7e32ac2a0aa4f3fbdd5592e739d993715f92 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CompletedProduct.lean @@ -0,0 +1,84 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.BoundedBilinearCompletion +import OAI.Geometry.PrescribedPotential.GlobalProduct +import OAI.Geometry.PrescribedPotential.GlobalStrongEmbedding +import OAI.Geometry.PrescribedPotential.PatchCutoffs + +namespace OAI + +/-! Completed Product. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical BoundedContinuousFunction +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] + +def Smooth.mulBilinear : Smooth A →ₗ[ℝ] Smooth A →ₗ[ℝ] Smooth A where + toFun f := + { toFun := f.mul + map_add' h l := by ext x; change f x*(h x+l x) = _; exact mul_add _ _ _ + map_smul' c h := by ext x; change f x*(c • h x) = c • (f x*h x); simp [mul_left_comm] } + map_add' f h := by ext l x; change (f x+h x)*l x = _; exact add_mul _ _ _ + map_smul' c f := by ext h x; change (c • f x)*h x = c • (f x*h x); simp [mul_assoc] + +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + + +def product (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) : + D.localizers.Sobolev (k : ℝ) →L[ℝ] + D.localizers.Sobolev (k : ℝ) →L[ℝ] D.localizers.Sobolev (k : ℝ) := + BoundedBilinearCompletion.extend (D.localizers.embed (k : ℝ)) + (D.localizers.embed_dense (k : ℝ)) Smooth.mulBilinear + (D.smooth_product_bound k hk).choose_spec.2 + +lemma product_embed (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (f h : Smooth A) : + D.product k hk (D.localizers.embed (k : ℝ) f) (D.localizers.embed (k : ℝ) h) = + D.localizers.embed (k : ℝ) (f.mul h) := + BoundedBilinearCompletion.extend_eq _ _ _ (D.smooth_product_bound k hk).choose_spec.1 + (D.smooth_product_bound k hk).choose_spec.2 f h + +lemma product_strong (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (u v : D.localizers.Sobolev (k : ℝ)) : + D.localizers.strong (k : ℝ) (D.product k hk u v) = + D.localizers.strong (k : ℝ) u * D.localizers.strong (k : ℝ) v := by + have hs : (Module.finrank ℝ (EC d) : ℝ) < 2*(k : ℝ) := by + have hh : (Module.finrank ℝ (EC d) : ℝ) < (k : ℝ) := by exact_mod_cast hk + linarith [Nat.cast_nonneg (α := ℝ) k] + have hf (f : Smooth A) : ∀ v, + D.localizers.strong (k : ℝ) (D.product k hk (D.localizers.embed (k : ℝ) f) v) = + D.localizers.strong (k : ℝ) (D.localizers.embed (k : ℝ) f)*D.localizers.strong (k : ℝ) v := by + apply congr_fun + apply (D.localizers.embed_dense (k : ℝ)).equalizer (by fun_prop) (by fun_prop) + funext h + dsimp only [Function.comp_apply] + rw [D.product_embed, D.localizers.strong_embed _ hs, D.localizers.strong_embed _ hs, + D.localizers.strong_embed _ hs] + rfl + have he : (fun u => D.localizers.strong (k : ℝ) (D.product k hk u v)) = + (fun u => D.localizers.strong (k : ℝ) u*D.localizers.strong (k : ℝ) v) := by + apply (D.localizers.embed_dense (k : ℝ)).equalizer (by fun_prop) (by fun_prop) + funext f + exact hf f v + exact congr_fun he u + + + +lemma product_contDiff (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) : + ContDiff ℝ ∞ (fun z : D.localizers.Sobolev (k : ℝ) × D.localizers.Sobolev (k : ℝ) => + D.product k hk z.1 z.2) := + ((D.product k hk).contDiff.comp contDiff_fst).clm_apply contDiff_snd +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CompletedRealification.lean b/lean/OAI/Geometry/PrescribedPotential/CompletedRealification.lean new file mode 100644 index 0000000000000000000000000000000000000000..7cb7e1954866c4f3bf25b7479632703cc8701a45 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CompletedRealification.lean @@ -0,0 +1,100 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalConjugation + +namespace OAI + +/-! Completed Realification. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) +local instance realifyNG (s : ℝ) : NormedAddCommGroup (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedAddCommGroup +local instance realifyNS (s : ℝ) : NormedSpace ℝ (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedSpace +local instance realifyTG (s : ℝ) : IsTopologicalAddGroup (D.localizers.RealSobolev s) := + Submodule.isTopologicalAddGroup _ +local instance realifyCS (s : ℝ) : ContinuousSMul ℝ (D.localizers.RealSobolev s) := + SMulMemClass.continuousSMul _ + +def completedRealify (k : ℕ) : D.localizers.Sobolev (k : ℝ) →L[ℝ] D.localizers.Sobolev (k : ℝ) := + D.localizers.extendCore (k : ℝ) (k : ℝ) Smooth.realify + +lemma completedRealify_embed (k : ℕ) (f : Smooth A) : + D.completedRealify k (D.localizers.embed (k : ℝ) f) = D.localizers.embed (k : ℝ) (Smooth.realify f) := + D.localizers.extendCore_embed (D.realify_integer_bound k) f + +lemma completedRealify_mem (k : ℕ) (u : D.localizers.Sobolev (k : ℝ)) : + D.completedRealify k u ∈ D.localizers.realCompletion (k : ℝ) := by + have hf (f : Smooth A) : D.completedRealify k (D.localizers.embed (k : ℝ) f) ∈ + D.localizers.realCompletion (k : ℝ) := by + rw [D.completedRealify_embed] + exact (D.localizers.realEmbed (k : ℝ) ⟨Smooth.realify f,Smooth.realify_real f⟩).property + exact (D.localizers.embed_dense (k : ℝ)).induction_on u + ((Submodule.isClosed_topologicalClosure _).preimage (D.completedRealify k).continuous) hf + +def realProjection (k : ℕ) : D.localizers.Sobolev (k : ℝ) →L[ℝ] D.localizers.RealSobolev (k : ℝ) := + (D.completedRealify k).codRestrict _ (D.completedRealify_mem k) + +lemma completedRealify_of_real (k : ℕ) (u : D.localizers.RealSobolev (k : ℝ)) : + D.completedRealify k u.val = u.val := by + have he : (fun u : D.localizers.RealSobolev (k : ℝ) => D.completedRealify k u.val) = + (fun u => u.val) := by + apply (D.localizers.realEmbed_dense (k : ℝ)).equalizer (by fun_prop) continuous_subtype_val + funext f + dsimp only [Function.comp_apply] + rw [Localizers.realEmbed_val,D.completedRealify_embed,Smooth.realify_eq_of_real] + exact congr_fun he u + +lemma realProjection_of_real (k : ℕ) (u : D.localizers.RealSobolev (k : ℝ)) : + D.realProjection k u.val = u := Subtype.ext (D.completedRealify_of_real k u) + +lemma completedRealify_lower (k l : ℕ) (hlk : l ≤ k) (u : D.localizers.Sobolev (k : ℝ)) : + D.localizers.lower (k : ℝ) (l : ℝ) (D.completedRealify k u) = + D.completedRealify l (D.localizers.lower (k : ℝ) (l : ℝ) u) := by + have hkl : (l : ℝ) ≤ (k : ℝ) := by exact_mod_cast hlk + have he : D.localizers.lower (k : ℝ) (l : ℝ) ∘ D.completedRealify k = + D.completedRealify l ∘ D.localizers.lower (k : ℝ) (l : ℝ) := by + apply (D.localizers.embed_dense (k : ℝ)).equalizer (by fun_prop) (by fun_prop) + funext f + dsimp only [Function.comp_apply] + rw [D.completedRealify_embed,D.localizers.lower_embed hkl, + D.localizers.lower_embed hkl,D.completedRealify_embed] + exact congr_fun he u + + + +lemma mem_real_of_lower (k l : ℕ) (hlk : l ≤ k) (u : D.localizers.Sobolev (k : ℝ)) + (hu : D.localizers.lower (k : ℝ) (l : ℝ) u ∈ D.localizers.realCompletion (l : ℝ)) : + u ∈ D.localizers.realCompletion (k : ℝ) := by + have he : D.completedRealify k u = u := by + apply D.localizers.lower_injective (by exact_mod_cast hlk : (l : ℝ) ≤ (k : ℝ)) + rw [D.completedRealify_lower k l hlk] + exact D.completedRealify_of_real l ⟨_,hu⟩ + rw [← he] + exact D.completedRealify_mem k u + +lemma mem_real_of_lower_eq (k l : ℕ) (s : ℝ) (hs : s = (l : ℝ)) + (hlk : l ≤ k) (u : D.localizers.Sobolev (k : ℝ)) + (hu : D.localizers.lower (k : ℝ) s u ∈ D.localizers.realCompletion s) : + u ∈ D.localizers.realCompletion (k : ℝ) := by + subst s + exact D.mem_real_of_lower k l hlk u hu + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CompletedResolvent.lean b/lean/OAI/Geometry/PrescribedPotential/CompletedResolvent.lean new file mode 100644 index 0000000000000000000000000000000000000000..d712b4c7d81f0aa5f6719a43043c9df5e79ff095 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CompletedResolvent.lean @@ -0,0 +1,164 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.ComplexOperator +import OAI.Geometry.PrescribedPotential.GlobalBounds +import OAI.Geometry.PrescribedPotential.GlobalError +import OAI.Geometry.PrescribedPotential.PatchCutoffs + +namespace OAI + +/-! Completed Resolvent. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory +open scoped SchwartzMap ContDiff Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace Localizers +variable (D : Localizers A ι) + + + +lemma extendCore_compat {s t a b : ℝ} (has : a ≤ s) (hbt : b ≤ t) + (T : Smooth A →ₗ[ℝ] Smooth A) (hT : D.BoundedCore s t T) + (hB : D.BoundedCore a b T) (u : D.Sobolev s) : + D.lower t b (D.extendCore s t T u) = + D.extendCore a b T (D.lower s a u) := by + have hS : D.BoundedCore s b T := hT.target_mono hbt + rw [D.lower_extendCore hbt T hT hS, D.extendCore_lower has T hB hS] + + +def AllRegular (u : D.Sobolev 0) : Prop := + ∀ k : ℕ, ∃ v : D.Sobolev (k : ℝ), D.lower (k : ℝ) 0 v = u + +lemma allRegular_embed (f : Smooth A) : D.AllRegular (D.embed 0 f) := by + intro k + exact ⟨D.embed (k : ℝ) f, D.lower_embed (Nat.cast_nonneg _) f⟩ + +lemma allRegular_of_gain (T : Smooth A →ₗ[ℝ] Smooth A) + (h0 : D.BoundedCore 0 0 T) + (hgain : ∀ k : ℕ, D.BoundedCore (k : ℝ) ((k : ℝ) + 1) T) + (f : Smooth A) (u : D.Sobolev 0) + (hu : u = D.embed 0 f + D.extendCore 0 0 T u) : D.AllRegular u := by + intro k + induction k with + | zero => + rw [Nat.cast_zero] + exact ⟨u, by rw [D.lower_self]; rfl⟩ + | succ k ih => + rw [Nat.cast_add, Nat.cast_one] + obtain ⟨v, hv⟩ := ih + have h := D.extendCore_compat (Nat.cast_nonneg k) + (by positivity : (0 : ℝ) ≤ (k : ℝ) + 1) T (hgain k) h0 v + refine ⟨D.embed (k + 1 : ℝ) f + D.extendCore (k : ℝ) (k + 1 : ℝ) T v, ?_⟩ + rw [map_add, D.lower_embed (by positivity), h, hv, ← hu] + +end Localizers +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + + +def completedL : D.localizers.Sobolev 2 →L[ℝ] D.localizers.Sobolev 0 := + D.localizers.extendCore 2 0 (complexL g) + +def shiftedOperator (m : ℝ) : D.localizers.Sobolev 2 →L[ℝ] D.localizers.Sobolev 0 := + (m^2 : ℝ) • D.localizers.lower 2 0 - D.completedL + +def completedParametrix (m : ℝ) (hm : 1 ≤ m) : + D.localizers.Sobolev 0 →L[ℝ] D.localizers.Sobolev 2 := + D.localizers.extendCore 0 2 (D.parametrix m hm) + +def completedError (m : ℝ) (hm : 1 ≤ m) : + D.localizers.Sobolev 0 →L[ℝ] D.localizers.Sobolev 0 := + D.localizers.extendCore 0 0 (D.error m hm) + +lemma completedParametrix_bound (m : ℝ) (hm : 1 ≤ m) : + D.localizers.BoundedCore 0 2 (D.parametrix m hm) := by + have hb := D.parametrix_bound m hm 0 + rw [Nat.cast_zero, zero_add] at hb + exact hb + +lemma completedParametrix_equation (m : ℝ) (hm : 1 ≤ m) (u : D.localizers.Sobolev 0) : + D.shiftedOperator m (D.completedParametrix m hm u) = u - D.completedError m hm u := by + have he : D.shiftedOperator m ∘ D.completedParametrix m hm = + fun u => u - D.completedError m hm u := by + apply (D.localizers.embed_dense 0).equalizer (by fun_prop) (by fun_prop) + funext f + simp only [Function.comp_apply, shiftedOperator, completedParametrix, completedL, + completedError, _root_.sub_apply, _root_.smul_apply, + D.localizers.extendCore_embed (D.completedParametrix_bound m hm), + D.localizers.extendCore_embed D.complexL_bound, + D.localizers.extendCore_embed (D.error_bound_zero m hm), + D.localizers.lower_embed (by norm_num : (0 : ℝ) ≤ 2)] + rw [← map_smul, ← map_sub, D.parametrix_equation, map_sub] + exact congr_fun he u + +lemma exists_completedError_small : + ∃ m : ℝ, ∃ hm : 1 ≤ m, ‖D.completedError m hm‖ < 1 := by + obtain ⟨m, hm, q, hq, hq1, hb⟩ := D.exists_contractive_shift + exact ⟨m, hm, (D.localizers.extendCore_norm hq hb).trans_lt hq1⟩ + + + +def errorInverse (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) : + D.localizers.Sobolev 0 →L[ℝ] D.localizers.Sobolev 0 := + ↑((Units.oneSub (D.completedError m hm) he)⁻¹) + +lemma errorInverse_equation (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (f : D.localizers.Sobolev 0) : + D.errorInverse m hm he f - D.completedError m hm (D.errorInverse m hm he f) = f := by + let U := Units.oneSub (D.completedError m hm) he + change ((↑U : D.localizers.Sobolev 0 →L[ℝ] D.localizers.Sobolev 0) * ↑U⁻¹) f = f + rw [Units.mul_inv, _root_.one_apply_eq_self] + +def completedResolvent (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) : + D.localizers.Sobolev 0 →L[ℝ] D.localizers.Sobolev 2 := + D.completedParametrix m hm ∘L D.errorInverse m hm he + +theorem completedResolvent_equation (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (f : D.localizers.Sobolev 0) : + D.shiftedOperator m (D.completedResolvent m hm he f) = f := by + rw [completedResolvent, ContinuousLinearMap.comp_apply, D.completedParametrix_equation, + D.errorInverse_equation] + +lemma errorInverse_regular (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (f : Smooth A) : D.localizers.AllRegular (D.errorInverse m hm he (D.localizers.embed 0 f)) := by + apply D.localizers.allRegular_of_gain (D.error m hm) (D.error_bound_zero m hm) + (D.error_bound_integer m hm) f + exact sub_eq_iff_eq_add.mp (D.errorInverse_equation m hm he _) + +lemma parametrix_regular (m : ℝ) (hm : 1 ≤ m) (u : D.localizers.Sobolev 0) + (hu : D.localizers.AllRegular u) : + D.localizers.AllRegular (D.localizers.lower 2 0 (D.completedParametrix m hm u)) := by + intro k + obtain ⟨v, hv⟩ := hu k + have hb := D.parametrix_bound m hm k + refine ⟨D.localizers.lower ((k : ℝ) + 2) (k : ℝ) + (D.localizers.extendCore (k : ℝ) ((k : ℝ) + 2) (D.parametrix m hm) v), ?_⟩ + rw [← ContinuousLinearMap.comp_apply, + D.localizers.lower_comp (by linarith : (k : ℝ) ≤ (k : ℝ) + 2) (Nat.cast_nonneg k)] + rw [D.localizers.extendCore_compat (Nat.cast_nonneg k) + (by positivity : (0 : ℝ) ≤ (k : ℝ) + 2) _ hb + ((D.completedParametrix_bound m hm).target_mono (by norm_num : (0 : ℝ) ≤ 2)), hv] + exact (D.localizers.lower_extendCore (by norm_num : (0 : ℝ) ≤ 2) _ + (D.completedParametrix_bound m hm) + ((D.completedParametrix_bound m hm).target_mono (by norm_num : (0 : ℝ) ≤ 2)) u).symm + +theorem completedResolvent_regular (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (f : Smooth A) : + D.localizers.AllRegular (D.localizers.lower 2 0 + (D.completedResolvent m hm he (D.localizers.embed 0 f))) := + D.parametrix_regular m hm _ (D.errorInverse_regular m hm he f) + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CompletedVolume.lean b/lean/OAI/Geometry/PrescribedPotential/CompletedVolume.lean new file mode 100644 index 0000000000000000000000000000000000000000..c9e0b0d1227861beeea78db192c3cb650aa30e52 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CompletedVolume.lean @@ -0,0 +1,99 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalHessian +import OAI.Geometry.PrescribedPotential.GlobalMetricEntries +import OAI.Geometry.PrescribedPotential.PatchCutoffs +import OAI.Geometry.PrescribedPotential.PotentialDensity +import OAI.Geometry.PrescribedPotential.RealSobolev +import OAI.Geometry.PrescribedPotential.SobolevDeterminant + +namespace OAI + +/-! Completed Volume. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff Classical BoundedContinuousFunction +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +def completedVolume (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (u : D.localizers.Sobolev ((k : ℝ)+2)) : D.localizers.Sobolev (k : ℝ) := + ∑ p, D.product k hk (D.localizers.embed (k : ℝ) (D.determinantWeight p)) + (D.determinant k hk d (fun i j => D.localizers.embed (k : ℝ) (D.metricEntry p i j) + + D.completedHessian k p i j u)) + +lemma completedVolume_contDiff (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) : + ContDiff ℝ ∞ (D.completedVolume k hk) := by + apply ContDiff.sum + intro p _ + exact (D.product k hk (D.localizers.embed (k : ℝ) (D.determinantWeight p))).contDiff.comp + (D.determinant_contDiff k hk d _ (fun i j => contDiff_const.add (D.completedHessian k p i j).contDiff)) + +lemma completedVolume_embed (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (φ : SmoothRealFunction A) : + D.completedVolume k hk (D.localizers.embed ((k : ℝ)+2) (Smooth.ofReal φ)) = + D.localizers.embed (k : ℝ) (Smooth.ofReal (g.potentialDensity φ)) := by + have hs : (Module.finrank ℝ (EC d) : ℝ) < 2*(k : ℝ) := by + have hh : (Module.finrank ℝ (EC d) : ℝ) < (k : ℝ) := by exact_mod_cast hk + linarith [Nat.cast_nonneg (α := ℝ) k] + apply D.localizers.strong_injective (k : ℝ) hs + ext x + simp only [completedVolume, map_sum, BoundedContinuousFunction.sum_apply] + rw [D.localizers.strong_embed _ hs] + have hterm (p : ι) : D.localizers.strong (k : ℝ) + (D.product k hk (D.localizers.embed (k : ℝ) (D.determinantWeight p)) + (D.determinant k hk d (fun i j => D.localizers.embed (k : ℝ) (D.metricEntry p i j) + + D.completedHessian k p i j (D.localizers.embed ((k : ℝ)+2) (Smooth.ofReal φ))))) x = + D.localizers.weight p x * ((g.potentialDensity φ).value x : ℂ) := by + rw [D.product_strong, BoundedContinuousFunction.mul_apply, D.localizers.strong_embed _ hs] + change D.determinantWeight p x * _ = _ + by_cases hz : D.localizers.weight p x = 0 + · rw [D.determinantWeight_zero p hz, hz, zero_mul, zero_mul] + · have hx : x ∈ tsupport (D.localizers.weight p : X → ℂ) := subset_tsupport _ hz + rw [D.determinantWeight_apply p hx] + erw [D.determinant_strong] + have hm : (fun i j => D.localizers.strong (k : ℝ) + (D.localizers.embed (k : ℝ) (D.metricEntry p i j) + + D.completedHessian k p i j (D.localizers.embed ((k : ℝ)+2) (Smooth.ofReal φ))) x) = + g.matrix (D.patch p).index (A.chart (D.patch p).index x) + + φ.hessian (D.patch p).index (A.chart (D.patch p).index x) := by + ext i j + rw [D.completedHessian_embed, map_add, BoundedContinuousFunction.add_apply, + D.localizers.strong_embed _ hs, D.localizers.strong_embed _ hs] + change D.metricEntry p i j x + D.localizedHessian p i j (Smooth.ofReal φ) x = _ + rw [D.metricEntry_apply p i j hx, D.localizedHessian_source p i j φ hx] + rfl + rw [hm, g.potentialDensity_complex φ (D.patch p).index (by simpa using D.patch_source p hx)] + unfold KaehlerMetric.volumePolynomial + ring + simp_rw [hterm] + rw [← Finset.sum_mul, D.localizers.sum_one, one_mul] + rfl + +lemma completedVolume_real (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) : + ∀ u ∈ D.localizers.realCompletion ((k : ℝ)+2), + D.completedVolume k hk u ∈ D.localizers.realCompletion (k : ℝ) := by + apply ClosedCore.maps_closure_range (D.localizers.realCoreMap ((k : ℝ)+2)) + (D.localizers.realCoreMap (k : ℝ)) (D.completedVolume k hk) + (D.completedVolume_contDiff k hk).continuous + intro f + refine ⟨RealSmooth.ofReal (g.potentialDensity f.source), ?_⟩ + change D.completedVolume k hk (D.localizers.embed ((k : ℝ)+2) f.val) = _ + rw [← f.ofReal_source, D.completedVolume_embed] + rfl + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/ComplexContactDeterminant.lean b/lean/OAI/Geometry/PrescribedPotential/ComplexContactDeterminant.lean new file mode 100644 index 0000000000000000000000000000000000000000..c354a6e5457af75161c3a99aee7e6010148da2f3 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/ComplexContactDeterminant.lean @@ -0,0 +1,66 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GradientJacobian + +namespace OAI + +/-! Complex Contact Determinant. -/ + +section + + + +noncomputable section +open Matrix Set Filter Topology +open scoped InnerProductSpace ContDiff ComplexOrder +namespace PotentialABP +variable {d : ℕ} +local notation "E" => EuclideanSpace ℂ (Fin d) +local instance complexContactDeterminantRealInnerProductSpace (d : ℕ) : + InnerProductSpace ℝ (EuclideanSpace ℂ (Fin d)) := + InnerProductSpace.rclikeToReal ℂ (EuclideanSpace ℂ (Fin d)) + +lemma real_det_hermitian (H : Matrix (Fin d) (Fin d) ℂ) (hH : H.IsHermitian) : + (H.toEuclideanLin.restrictScalars ℝ).det = H.det.re ^ 2 := by + rw [LinearMap.det_restrictScalars] + have hm : H.toEuclideanLin.det = H.det := LinearMap.det_toLpLin 2 H + rw [hm, Algebra.norm_complex_eq] + have him : H.det.im = 0 := by + have he : star H.det = H.det := by + rw [← Matrix.det_conjTranspose, hH] + exact (Complex.conj_eq_iff_im).mp he + simp [Complex.normSq_apply, him, pow_two] + + + +lemma gradient_det_le_hermitian {u : E → ℝ} (hu : ContDiff ℝ ∞ u) {x : E} + (hB : ∀ v, 0 ≤ fderiv ℝ (fderiv ℝ u) x v v) + (H : Matrix (Fin d) (Fin d) ℂ) (hH : H.IsHermitian) + (hdom : ∀ v : E, fderiv ℝ (fderiv ℝ u) x v v ≤ + 4 * inner ℝ (H.toEuclideanLin v) v) : + |(fderiv ℝ (gradient u) x).det| ≤ (4:ℝ)^(2*d) * H.det.re^2 := by + let L := (fderiv ℝ (gradient u) x).toLinearMap + let M : E →ₗ[ℝ] E := (4:ℝ) • H.toEuclideanLin.restrictScalars ℝ + have hL : L.IsPositive := gradient_hessian_positive hu hB + have hM : (M-L).IsPositive := by + refine ⟨?_,?_⟩ + · exact (LinearMap.IsSymmetric.smul (by simp) + (Matrix.isSymmetric_toEuclideanLin_iff.mpr hH).restrictScalars).sub hL.1 + · intro v + change 0 ≤ inner ℝ ((4:ℝ) • H.toEuclideanLin v - fderiv ℝ (gradient u) x v) v + rw [inner_sub_left, real_inner_smul_left, inner_fderiv_gradient hu] + exact sub_nonneg.mpr (hdom v) + have hn := positive_det_nonneg hL + have hm := positive_det_mono hL hM + change |L.det| ≤ _ + rw [abs_of_nonneg hn] + convert hm using 1 + dsimp only [M] + rw [LinearMap.det_smul, real_det_hermitian H hH, + finrank_real_of_complex, finrank_euclideanSpace, Fintype.card_fin] + +end PotentialABP + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/ComplexHessian.lean b/lean/OAI/Geometry/PrescribedPotential/ComplexHessian.lean new file mode 100644 index 0000000000000000000000000000000000000000..e79c6c8e931ae711a30c46a5a9f881c87bdb1ab9 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/ComplexHessian.lean @@ -0,0 +1,108 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CoreBounds + +namespace OAI + +/-! Complex Hessian. -/ + +section + + + +noncomputable section +open Set Filter Topology MeasureTheory LineDeriv +open scoped ContDiff SchwartzMap Classical +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +lemma schwartzCoord_smul (s : ℝ) (c : ℂ) (f : 𝓢(E, ℂ)) : + schwartzCoord s (c • f) = c • schwartzCoord s f := by + apply realize_injective s + rw [map_smul, realize_schwartzCoord, realize_schwartzCoord] + exact (SchwartzMap.toTemperedDistributionCLM E ℂ volume).map_smul c f + +lemma CoreBound.smul {s t : ℝ} {T : 𝓢(E, ℂ) → 𝓢(E, ℂ)} + (hT : CoreBound s t T) (c : ℂ) : CoreBound s t (fun f => c • T f) := by + obtain ⟨C,hC,h⟩ := hT + refine ⟨‖c‖*C,mul_nonneg (norm_nonneg _) hC,fun f => ?_⟩ + rw [schwartzCoord_smul, norm_smul, mul_assoc] + exact mul_le_mul_of_nonneg_left (h f) (norm_nonneg c) + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma complex_smooth_second_deriv (f : 𝓢(E, ℂ)) (v w x : E) : + (∂_{v} (∂_{w} f)) x = fderiv ℝ (fderiv ℝ f) x v w := by + simp only [SchwartzMap.lineDerivOp_apply_eq_fderiv] + change fderiv ℝ (fun y => fderiv ℝ f y w) x v = _ + exact PotentialKaehler.fderiv_eval_derivative f.smooth'.contDiffAt v w + +end SobolevChart +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart + +lemma second_postcomp_general {E F G : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] [NormedAddCommGroup G] [NormedSpace ℝ G] + {f : E → F} {x : E} (hf : ContDiffAt ℝ ∞ f x) (p : F →L[ℝ] G) (v w : E) : + fderiv ℝ (fderiv ℝ (p ∘ f)) x v w = p (fderiv ℝ (fderiv ℝ f) x v w) := by + have hN : ∀ᶠ y in 𝓝 x, DifferentiableAt ℝ f y := by + filter_upwards [(hf.of_le (by simp : (1 : ℕ∞ω) ≤ ∞)).eventually (by simp)] with y hy + exact hy.differentiableAt (by simp) + have he : fderiv ℝ (p ∘ f) =ᶠ[𝓝 x] (fun y => p.comp (fderiv ℝ f y)) := by + filter_upwards [hN] with y hy + exact (p.hasFDerivAt.comp y hy.hasFDerivAt).fderiv + rw [he.fderiv_eq, fderiv_clm_comp (differentiableAt_const p) + ((hf.fderiv_right (m := ∞) (by simp)).differentiableAt (by simp))] + simp + +variable {d : ℕ} +def hessianDirection (i : Fin d) : EC d := (coordinateEquiv d).symm (Pi.single i 1) +def hessianIDirection (i : Fin d) : EC d := (coordinateEquiv d).symm (Complex.I • Pi.single i 1) + +def hessianEntrySchwartz (i j : Fin d) : 𝓢(EC d, ℂ) →L[ℂ] 𝓢(EC d, ℂ) := + (1/4 : ℂ) • + ((lineDerivOpCLM ℂ 𝓢(EC d, ℂ) (hessianDirection i) ∘L + lineDerivOpCLM ℂ 𝓢(EC d, ℂ) (hessianDirection j)) + + (lineDerivOpCLM ℂ 𝓢(EC d, ℂ) (hessianIDirection i) ∘L + lineDerivOpCLM ℂ 𝓢(EC d, ℂ) (hessianIDirection j)) + + Complex.I • ((lineDerivOpCLM ℂ 𝓢(EC d, ℂ) (hessianIDirection i) ∘L + lineDerivOpCLM ℂ 𝓢(EC d, ℂ) (hessianDirection j)) + + (-1 : ℂ) • (lineDerivOpCLM ℂ 𝓢(EC d, ℂ) (hessianDirection i) ∘L + lineDerivOpCLM ℂ 𝓢(EC d, ℂ) (hessianIDirection j)))) + +lemma hessianEntrySchwartz_apply (i j : Fin d) (f : 𝓢(EC d, ℂ)) (x : EC d) : + hessianEntrySchwartz i j f x = (1/4 : ℂ) * + (fderiv ℝ (fderiv ℝ f) x (hessianDirection i) (hessianDirection j) + + fderiv ℝ (fderiv ℝ f) x (hessianIDirection i) (hessianIDirection j) + + Complex.I * (fderiv ℝ (fderiv ℝ f) x (hessianIDirection i) (hessianDirection j) - + fderiv ℝ (fderiv ℝ f) x (hessianDirection i) (hessianIDirection j))) := by + simp only [hessianEntrySchwartz, smul_apply, add_apply, + ContinuousLinearMap.comp_apply, lineDerivOpCLM_apply, + smul_eq_mul, complex_smooth_second_deriv] + ring + +lemma hessianEntrySchwartz_bound (s : ℝ) (i j : Fin d) : + CoreBound (s+2) s (hessianEntrySchwartz i j) := by + have hb (v w : EC d) : CoreBound (s+2) s (fun f : 𝓢(EC d, ℂ) => ∂_{v} (∂_{w} f)) := + (coreBound_deriv v (s := s+1) (t := s) (by linarith)).comp + (coreBound_deriv w (s := s+2) (t := s+1) (by linarith)) + exact ((hb _ _).add (hb _ _) |>.add (((hb _ _).add ((hb _ _).smul (-1))).smul Complex.I)).smul (1/4) + +lemma hessianEntrySchwartz_real {u : EC d → ℝ} {x : EC d} (hu : ContDiffAt ℝ ∞ u x) + (f : 𝓢(EC d, ℂ)) (he : (f : EC d → ℂ) =ᶠ[𝓝 x] Complex.ofRealCLM ∘ u) (i j : Fin d) : + hessianEntrySchwartz i j f x = + PotentialKaehler.hermitianPartMatrix (pullBilin (fderiv ℝ (fderiv ℝ u) x)) i j := by + rw [hessianEntrySchwartz_apply] + have he2 : fderiv ℝ (fderiv ℝ f) x = fderiv ℝ (fderiv ℝ (Complex.ofRealCLM ∘ u)) x := + (he.fderiv (𝕜 := ℝ)).fderiv_eq + rw [he2] + simp only [second_postcomp_general hu, Complex.ofRealCLM_apply, + PotentialKaehler.hermitianPartMatrix_apply, PotentialKaehler.hermitianPart, + pullBilin_apply, hessianDirection, hessianIDirection] + apply Complex.ext <;> simp [Complex.mul_re, Complex.mul_im] <;> ring + +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/ComplexKernel.lean b/lean/OAI/Geometry/PrescribedPotential/ComplexKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..ecf5fe786fa2f3e57a73a2bfc1b518356aa568af --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/ComplexKernel.lean @@ -0,0 +1,67 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.ComplexOperator + +namespace OAI + +/-! Complex Kernel. -/ + +section + + + +noncomputable section +namespace GlobalElliptic +open Anticanonical SourceSmooth +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +lemma complexL_re (g : KaehlerMetric A) (f : Smooth A) (x : X) : + (complexL g f x).re = (g.laplacian (f.part Complex.reCLM)).value x := by + change (((g.laplacian (f.part Complex.reCLM)).value x : ℂ) + + Complex.I * ((g.laplacian (f.part Complex.imCLM)).value x : ℂ)).re = _ + simp + +lemma complexL_im (g : KaehlerMetric A) (f : Smooth A) (x : X) : + (complexL g f x).im = (g.laplacian (f.part Complex.imCLM)).value x := by + change (((g.laplacian (f.part Complex.reCLM)).value x : ℂ) + + Complex.I * ((g.laplacian (f.part Complex.imCLM)).value x : ℂ)).im = _ + simp + +lemma complexL_constant_rhs_zero [CompactSpace X] [Nonempty X] + (g : KaehlerMetric A) (f : Smooth A) {c : ℂ} + (hf : complexL g f = Smooth.const c) : c = 0 := by + have hr : c.re = 0 := g.constant_rhs_eq_zero (f.part Complex.reCLM) (by + intro i z hz + rw [← g.laplacian_localExpression _ i hz] + change (g.laplacian (f.part Complex.reCLM)).value ((A.chart i).symm z) = _ + rw [← complexL_re, hf] + rfl) + have hi : c.im = 0 := g.constant_rhs_eq_zero (f.part Complex.imCLM) (by + intro i z hz + rw [← g.laplacian_localExpression _ i hz] + change (g.laplacian (f.part Complex.imCLM)).value ((A.chart i).symm z) = _ + rw [← complexL_im, hf] + rfl) + exact Complex.ext hr hi + +lemma complexL_kernel [T2Space X] [CompactSpace X] [ConnectedSpace X] + (g : KaehlerMetric A) (f : Smooth A) (hf : complexL g f = 0) : + ∃ c : ℂ, f = Smooth.const c := by + obtain ⟨r, hr⟩ := linearizedMongeAmpere_kernel d X A g (f.part Complex.reCLM) (by + intro i z hz + rw [← g.laplacian_localExpression _ i hz] + change (g.laplacian (f.part Complex.reCLM)).value ((A.chart i).symm z) = _ + rw [← complexL_re, hf, Smooth.zero_apply, Complex.zero_re]) + obtain ⟨s, hs⟩ := linearizedMongeAmpere_kernel d X A g (f.part Complex.imCLM) (by + intro i z hz + rw [← g.laplacian_localExpression _ i hz] + change (g.laplacian (f.part Complex.imCLM)).value ((A.chart i).symm z) = _ + rw [← complexL_im, hf, Smooth.zero_apply, Complex.zero_im]) + refine ⟨⟨r, s⟩, Smooth.ext (fun x => ?_)⟩ + exact Complex.ext (hr x) (hs x) + +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/ComplexOperator.lean b/lean/OAI/Geometry/PrescribedPotential/ComplexOperator.lean new file mode 100644 index 0000000000000000000000000000000000000000..d9581e4d2b5ecdd585929b421c48f3b4f130f0d9 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/ComplexOperator.lean @@ -0,0 +1,203 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalPartition +import OAI.Geometry.PrescribedPotential.GlobalOperator + +namespace OAI + +/-! Complex Operator. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical + +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel FrozenPoisson +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + +lemma second_postcomp {f : E → ℂ} {x : E} (hf : ContDiffAt ℝ ∞ f x) + (p : ℂ →L[ℝ] ℝ) (v w : E) : + fderiv ℝ (fderiv ℝ (p ∘ f)) x v w = p (fderiv ℝ (fderiv ℝ f) x v w) := by + have hN : ∀ᶠ y in 𝓝 x, DifferentiableAt ℝ f y := by + filter_upwards [(hf.of_le (by simp : (1 : ℕ∞ω) ≤ ∞)).eventually (by simp)] with y hy + exact hy.differentiableAt (by simp) + have he : fderiv ℝ (p ∘ f) =ᶠ[𝓝 x] (fun y => p.comp (fderiv ℝ f y)) := by + filter_upwards [hN] with y hy + exact (p.hasFDerivAt.comp y hy.hasFDerivAt).fderiv + rw [he.fderiv_eq, fderiv_clm_comp (differentiableAt_const p) + ((hf.fderiv_right (m := ∞) (by simp)).differentiableAt (by simp))] + simp + +lemma second_add {f h : E → ℂ} {x : E} (hf : ContDiffAt ℝ ∞ f x) + (hh : ContDiffAt ℝ ∞ h x) : + fderiv ℝ (fderiv ℝ (fun y => f y + h y)) x = + fderiv ℝ (fderiv ℝ f) x + fderiv ℝ (fderiv ℝ h) x := by + have hN (u : E → ℂ) (hu : ContDiffAt ℝ ∞ u x) : + ∀ᶠ y in 𝓝 x, DifferentiableAt ℝ u y := by + filter_upwards [(hu.of_le (by simp : (1 : ℕ∞ω) ≤ ∞)).eventually (by simp)] with y hy + exact hy.differentiableAt (by simp) + have he : fderiv ℝ (fun y => f y + h y) =ᶠ[𝓝 x] + (fun y => fderiv ℝ f y + fderiv ℝ h y) := by + filter_upwards [hN f hf, hN h hh] with y hy hz + exact fderiv_add hy hz + rw [he.fderiv_eq] + exact fderiv_add ((hf.fderiv_right (m := ∞) (by simp)).differentiableAt (by simp)) + ((hh.fderiv_right (m := ∞) (by simp)).differentiableAt (by simp)) + +lemma second_real_smul {f : E → ℂ} {x : E} (hf : ContDiffAt ℝ ∞ f x) (c : ℝ) : + fderiv ℝ (fderiv ℝ (fun y => c • f y)) x = + c • fderiv ℝ (fderiv ℝ f) x := by + have hN : ∀ᶠ y in 𝓝 x, DifferentiableAt ℝ f y := by + filter_upwards [(hf.of_le (by simp : (1 : ℕ∞ω) ≤ ∞)).eventually (by simp)] with y hy + exact hy.differentiableAt (by simp) + have he : fderiv ℝ (fun y => c • f y) =ᶠ[𝓝 x] + (fun y => c • fderiv ℝ f y) := by + filter_upwards [hN] with y hy + exact fderiv_const_smul hy c + rw [he.fderiv_eq] + exact fderiv_const_smul ((hf.fderiv_right (m := ∞) (by simp)).differentiableAt (by simp)) c + +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + + +def Smooth.part (f : Smooth A) (p : ℂ →L[ℝ] ℝ) : SmoothRealFunction A where + value x := p (f x) + smooth i := by + have hh := p.contDiff.comp_contDiffOn (f.smooth i) + have hc := hh.comp (coordinateEquiv d).symm.contDiff.contDiffOn (by + intro z hz + simpa only [ComplexAtlas.euclideanChart_target, mem_preimage, + ContinuousLinearEquiv.apply_symm_apply] using hz) + convert hc using 1 + ext z + simp only [Function.comp_apply, ComplexAtlas.euclideanChart_symm_apply, + ContinuousLinearEquiv.apply_symm_apply] + +@[simp] lemma Smooth.part_value (f : Smooth A) (p : ℂ →L[ℝ] ℝ) (x : X) : + (f.part p).value x = p (f x) := rfl + + +def complexLValue (g : KaehlerMetric A) (f : Smooth A) : Smooth A := + Smooth.ofReal (g.laplacian (f.part Complex.reCLM)) + + Smooth.mul (Smooth.const Complex.I) (Smooth.ofReal (g.laplacian (f.part Complex.imCLM))) + + +def localL (g : KaehlerMetric A) (i : Fin A.count) (f : EC d → ℂ) (y : EC d) : ℂ := + ∑ k, ∑ l, (traceBilin (g.matrix i (coordinateEquiv d y)) + (rankTwo (stdOrthonormalBasis ℝ (EC d) k) (stdOrthonormalBasis ℝ (EC d) l)) : ℂ) * + fderiv ℝ (fderiv ℝ f) y (stdOrthonormalBasis ℝ (EC d) k) (stdOrthonormalBasis ℝ (EC d) l) + +lemma part_laplacian (g : KaehlerMetric A) (f : Smooth A) + (p : ℂ →L[ℝ] ℝ) (i : Fin A.count) {x : X} (hx : x ∈ (A.euclideanChart i).source) : + (g.laplacian (f.part p)).value x = + ∑ k, ∑ l, traceBilin (g.matrix i (coordinateEquiv d (A.euclideanChart i x))) + (rankTwo (stdOrthonormalBasis ℝ (EC d) k) (stdOrthonormalBasis ℝ (EC d) l)) * + p (fderiv ℝ (fderiv ℝ (f ∘ (A.euclideanChart i).symm)) + (A.euclideanChart i x) (stdOrthonormalBasis ℝ (EC d) k) (stdOrthonormalBasis ℝ (EC d) l)) := by + have hxc : x ∈ (A.chart i).source := by simpa using hx + change g.laplacianValue (f.part p) x = _ + rw [g.laplacianValue_local (f.part p) i hxc] + have hy : coordinateEquiv d (A.euclideanChart i x) ∈ (A.chart i).target := by + simpa only [ComplexAtlas.euclideanChart_apply, ContinuousLinearEquiv.apply_symm_apply] + using (A.chart i).mapsTo hxc + have ht := g.traceBilin_localExpression (f.part p) i hy + rw [ComplexAtlas.euclideanChart_apply, ContinuousLinearEquiv.apply_symm_apply] at ht + rw [← ht] + rw [bilin_expansion (stdOrthonormalBasis ℝ (EC d)) + (fderiv ℝ (fderiv ℝ ((f.part p).localExpression i ∘ coordinateEquiv d)) + ((coordinateEquiv d).symm (A.chart i x))) ] + simp only [map_sum, map_smul, smul_eq_mul] + apply Finset.sum_congr rfl + intro k _ + apply Finset.sum_congr rfl + intro l _ + rw [mul_comm] + congr 1 + exact second_postcomp ((f.smooth i).contDiffAt + ((A.euclideanChart i).open_target.mem_nhds ((A.euclideanChart i).mapsTo hx))) p _ _ + +lemma complexLValue_local (g : KaehlerMetric A) (f : Smooth A) + (i : Fin A.count) {x : X} (hx : x ∈ (A.euclideanChart i).source) : + complexLValue g f x = localL g i (f ∘ (A.euclideanChart i).symm) (A.euclideanChart i x) := by + change ((g.laplacian (f.part Complex.reCLM)).value x : ℂ) + + Complex.I * ((g.laplacian (f.part Complex.imCLM)).value x : ℂ) = _ + rw [part_laplacian g f Complex.reCLM i hx, part_laplacian g f Complex.imCLM i hx] + simp only [localL, Complex.ofReal_sum, Complex.ofReal_mul, Finset.mul_sum, ← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro k _ + apply Finset.sum_congr rfl + intro l _ + simp only [Complex.reCLM_apply, Complex.imCLM_apply] + rw [mul_left_comm Complex.I, ← mul_add, mul_comm Complex.I, Complex.re_add_im] + +lemma localL_congr (g : KaehlerMetric A) (i : Fin A.count) + {f h : EC d → ℂ} {x : EC d} (he : f =ᶠ[𝓝 x] h) : + localL g i f x = localL g i h x := by + simp only [localL, he.fderiv.fderiv_eq] + +lemma complexLValue_add (g : KaehlerMetric A) (f h : Smooth A) : + complexLValue g (f + h) = complexLValue g f + complexLValue g h := by + apply Smooth.ext + intro x + obtain ⟨i, hi⟩ := A.covers x + have hx : x ∈ (A.euclideanChart i).source := by simpa using hi + simp only [Smooth.add_apply, complexLValue_local g _ i hx, localL] + have hf := (f.smooth i).contDiffAt ((A.euclideanChart i).open_target.mem_nhds + ((A.euclideanChart i).mapsTo hx)) + have hh := (h.smooth i).contDiffAt ((A.euclideanChart i).open_target.mem_nhds + ((A.euclideanChart i).mapsTo hx)) + rw [show ((f + h : Smooth A) ∘ (A.euclideanChart i).symm) = + (fun y => (f ∘ (A.euclideanChart i).symm) y + (h ∘ (A.euclideanChart i).symm) y) from rfl, + second_add hf hh] + simp only [add_apply, mul_add, Finset.sum_add_distrib] + +lemma complexLValue_smul (g : KaehlerMetric A) (c : ℝ) (f : Smooth A) : + complexLValue g (c • f) = c • complexLValue g f := by + apply Smooth.ext + intro x + obtain ⟨i, hi⟩ := A.covers x + have hx : x ∈ (A.euclideanChart i).source := by simpa using hi + simp only [Smooth.smul_apply, complexLValue_local g _ i hx, localL] + have hf := (f.smooth i).contDiffAt ((A.euclideanChart i).open_target.mem_nhds + ((A.euclideanChart i).mapsTo hx)) + rw [show ((c • f : Smooth A) ∘ (A.euclideanChart i).symm) = + (fun y => c • (f ∘ (A.euclideanChart i).symm) y) from rfl, + second_real_smul hf c] + simp only [smul_apply, mul_smul_comm, Finset.smul_sum] + + +def complexL (g : KaehlerMetric A) : Smooth A →ₗ[ℝ] Smooth A where + toFun := complexLValue g + map_add' := complexLValue_add g + map_smul' := complexLValue_smul g + +lemma complexL_tsupport (g : KaehlerMetric A) (f : Smooth A) : + tsupport (complexL g f : X → ℂ) ⊆ tsupport (f : X → ℂ) := by + apply closure_minimal _ (isClosed_tsupport _) + intro x hx + by_contra hn + obtain ⟨i, hi⟩ := A.covers x + let e := A.euclideanChart i + have he : x ∈ e.source := by simpa [e] using hi + have hzero : f =ᶠ[𝓝 x] (fun _ => (0 : ℂ)) := + Filter.eventuallyEq_iff_exists_mem.mpr + ⟨(tsupport (f : X → ℂ))ᶜ, (isClosed_tsupport _).isOpen_compl.mem_nhds hn, + fun y hy => image_eq_zero_of_notMem_tsupport hy⟩ + have hz : (f ∘ e.symm) =ᶠ[𝓝 (e x)] (fun _ => 0) := by + have hc := (e.symm.continuousAt (e.mapsTo he)).tendsto + rw [e.left_inv he] at hc + exact hc.eventually hzero + have hv := complexLValue_local g f i he + change complexLValue g f x ≠ 0 at hx + rw [hv, localL_congr g i hz] at hx + exact hx (by simp [localL]) + +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/ConstantProjection.lean b/lean/OAI/Geometry/PrescribedPotential/ConstantProjection.lean new file mode 100644 index 0000000000000000000000000000000000000000..3e501ea68b71e52944fce58b748c9328b1c13f84 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/ConstantProjection.lean @@ -0,0 +1,62 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalPartition + +namespace OAI + +/-! Constant Projection. -/ + +section + + + +noncomputable section +open Set Filter Topology MeasureTheory +open scoped SchwartzMap ContDiff Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] + {A : ComplexAtlas d X} + +def Smooth.constLinear : ℂ →ₗ[ℝ] Smooth A where + toFun := Smooth.const + map_add' := by intro c e; rfl + map_smul' := by intro c e; rfl + +namespace Localizers +variable [T2Space X] [CompactSpace X] {ι : Type*} [Fintype ι] (D : Localizers A ι) + +def constants : ℂ →L[ℝ] D.Sobolev 0 := + LinearMap.toContinuousLinearMap ((D.embed 0).comp Smooth.constLinear) + +@[simp] lemma constants_apply (c : ℂ) : + D.constants c = D.embed 0 (Smooth.const c) := rfl + + +structure ConstantProjection where + proj : D.Sobolev 0 →L[ℝ] D.Sobolev 0 + compact : IsCompactOperator proj + value : ∀ u, ∃ c : ℂ, proj u = D.embed 0 (Smooth.const c) + fixed : ∀ c : ℂ, proj (D.embed 0 (Smooth.const c)) = D.embed 0 (Smooth.const c) + +theorem constantProjection_exists : Nonempty D.ConstantProjection := by + let S := (D.constants : ℂ →ₗ[ℝ] D.Sobolev 0).range + let : FiniteDimensional ℝ S := LinearMap.finiteDimensional_range _ + obtain ⟨r, hr⟩ := Submodule.ClosedComplemented.of_finiteDimensional S + let P := S.subtypeL ∘L r + refine ⟨⟨P, ?_, ?_, ?_⟩⟩ + · exact ((isCompactOperator_id (E := S)).comp_clm r).clm_comp S.subtypeL + · intro u + obtain ⟨c, hc⟩ := (r u).property + exact ⟨c, hc.symm⟩ + · intro c + have hc : D.embed 0 (Smooth.const c) ∈ S := ⟨c, rfl⟩ + have h := congrArg Subtype.val (hr ⟨D.embed 0 (Smooth.const c), hc⟩) + exact h + +end Localizers +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/ContactSetABP.lean b/lean/OAI/Geometry/PrescribedPotential/ContactSetABP.lean new file mode 100644 index 0000000000000000000000000000000000000000..a3062905a58d97053300d76f77e10ef5c8f57ba8 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/ContactSetABP.lean @@ -0,0 +1,186 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.AnalyticSupport +import OAI.Geometry.PrescribedPotential.CircleRadialCalculus + +namespace OAI + +/-! Contact Set A B P. -/ + +section + + + +noncomputable section +open Set Filter Topology Metric MeasureTheory +open scoped ContDiff InnerProductSpace +namespace PotentialABP +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] + + +def contacts (u : E → ℝ) (c : E) (r a : ℝ) : Set E := + {x | x ∈ closedBall c r ∧ ‖gradient u x‖ ≤ a ∧ + ∀ y ∈ closedBall c r, u x + inner ℝ (gradient u x) (y-x) ≤ u y} + +lemma gradient_continuous {u : E → ℝ} (hu : ContDiff ℝ ∞ u) : + Continuous (gradient u) := by + exact (InnerProductSpace.toDual ℝ E).symm.continuous.comp + (hu.continuous_fderiv (by simp)) + +lemma contacts_isClosed {u : E → ℝ} (hu : ContDiff ℝ ∞ u) (c : E) (r a : ℝ) : + IsClosed (contacts u c r a) := by + have hg := gradient_continuous hu + change IsClosed (closedBall c r ∩ ({x | ‖gradient u x‖ ≤ a} ∩ + {x | ∀ y ∈ closedBall c r, u x + inner ℝ (gradient u x) (y-x) ≤ u y})) + apply isClosed_closedBall.inter + apply IsClosed.inter (isClosed_le hg.norm continuous_const) + simp only [ofPred_forall] + apply isClosed_iInter + intro y + apply isClosed_iInter + intro _ + exact isClosed_le (hu.continuous.add (hg.inner (continuous_const.sub continuous_id))) + continuous_const + +lemma contacts_sublevel {u : E → ℝ} {c : E} {r a : ℝ} (hr : 0 ≤ r) (ha : 0 ≤ a) + {x : E} (hx : x ∈ contacts u c r a) : u x ≤ u c + a*r := by + have h := hx.2.2 c (mem_closedBall_self hr) + have hinner : - (a*r) ≤ inner ℝ (gradient u x) (c-x) := by + have hnorm : ‖c-x‖ ≤ r := by simpa [dist_eq_norm, norm_sub_rev] using hx.1 + have hb := abs_real_inner_le_norm (gradient u x) (c-x) + have hc := mul_le_mul hx.2.1 hnorm (norm_nonneg _) ha + exact le_trans (neg_le_neg hc) ((abs_le.mp hb).1) + linarith + +lemma contacts_interior {u : E → ℝ} {c : E} {r a b : ℝ} + (hr : 0 < r) (ha : 0 ≤ a) (hgap : a*r < b) + (hboundary : ∀ x, dist x c = r → u c + b ≤ u x) : + contacts u c r a ⊆ ball c r := by + intro x hx + have hs := contacts_sublevel hr.le ha hx + have hd : dist x c ≤ r := hx.1 + apply lt_of_le_of_ne hd + intro he + linarith [hboundary x he] + +lemma tilted_minimum_gradient {u : E → ℝ} (hu : ContDiff ℝ ∞ u) + {c : E} {r : ℝ} {x p : E} (hx : x ∈ ball c r) + (hm : IsMinOn (fun y => u y - inner ℝ p (y-c)) (closedBall c r) x) : + gradient u x = p := by + have hloc : IsLocalMin (fun y => u y - inner ℝ p (y-c)) x := by + filter_upwards [isOpen_ball.mem_nhds hx] with y hy + exact hm (ball_subset_closedBall hy) + have hp : HasFDerivAt (fun y : E => inner ℝ p (y-c)) + (InnerProductSpace.toDual ℝ E p) x := by + simpa only [ContinuousLinearMap.comp_id, Function.comp_def, id_eq, InnerProductSpace.toDual_apply_apply] using + (InnerProductSpace.toDual ℝ E p).hasFDerivAt.comp x + ((hasFDerivAt_id x).sub_const c) + have hd := ((hu.differentiable (by simp) x).hasFDerivAt.sub hp).fderiv + change fderiv ℝ (fun y => u y - inner ℝ p (y-c)) x = _ at hd + rw [hloc.fderiv_eq_zero] at hd + apply (InnerProductSpace.toDual ℝ E).injective + rw [toDual_gradient] + exact sub_eq_zero.mp hd.symm + + + +lemma gradient_image_contacts {u : E → ℝ} (hu : ContDiff ℝ ∞ u) + {c : E} {r a b : ℝ} (hr : 0 < r) (ha : 0 ≤ a) (hgap : a*r < b) + (hboundary : ∀ x, dist x c = r → u c + b ≤ u x) : + closedBall (0:E) a ⊆ gradient u '' contacts u c r a := by + intro p hp + have hp' : ‖p‖ ≤ a := by simpa using hp + have hcont : Continuous (fun y => u y - inner ℝ p (y-c)) := + hu.continuous.sub (continuous_const.inner (continuous_id.sub continuous_const)) + obtain ⟨x,hx,hm⟩ := (isCompact_closedBall c r).exists_isMinOn + ⟨c,mem_closedBall_self hr.le⟩ + hcont.continuousOn + have hmin : u x - inner ℝ p (x-c) ≤ u c - inner ℝ p (c-c) := + hm (mem_closedBall_self hr.le) + have hupper : u x ≤ u c + a*r := by + have hh := (real_inner_le_norm p (x-c)).trans + (mul_le_mul hp' (by simpa [dist_eq_norm] using hx) (norm_nonneg _) ha) + simp only [sub_self, inner_zero_right, sub_zero] at hmin + linarith + have hxi : x ∈ ball c r := by + change dist x c < r + apply lt_of_le_of_ne (show dist x c ≤ r from hx) + intro he + linarith [hboundary x he] + have hg := tilted_minimum_gradient hu hxi hm + refine ⟨x,⟨hx,by simpa [hg] using hp',?_⟩,hg⟩ + intro y hy + have he : u x - inner ℝ p (x-c) ≤ u y - inner ℝ p (y-c) := hm hy + rw [hg] + have hi : inner ℝ p (y-x) = inner ℝ p (y-c) - inner ℝ p (x-c) := by + rw [← inner_sub_right] + congr 1 + abel + rw [hi] + linarith + +lemma gradient_contDiff {u : E → ℝ} (hu : ContDiff ℝ ∞ u) : + ContDiff ℝ ∞ (gradient u) := by + exact (InnerProductSpace.toDual ℝ E).symm.contDiff.comp + (hu.fderiv_right (by simp)) + + + +lemma contact_measure_estimate [MeasurableSpace E] [BorelSpace E] + (μ : Measure E) [μ.IsAddHaarMeasure] + {u : E → ℝ} (hu : ContDiff ℝ ∞ u) {c : E} {r a b C : ℝ} + (hr : 0 < r) (ha : 0 ≤ a) (hgap : a*r < b) + (hboundary : ∀ x, dist x c = r → u c + b ≤ u x) + (hdet : ∀ x ∈ contacts u c r a, + |(fderiv ℝ (gradient u) x).det| ≤ C) : + μ (closedBall (0:E) a) ≤ ENNReal.ofReal C * μ (contacts u c r a) := by + have hs := (contacts_isClosed hu c r a).measurableSet + calc + μ (closedBall (0:E) a) ≤ μ (gradient u '' contacts u c r a) := + measure_mono (gradient_image_contacts hu hr ha hgap hboundary) + _ ≤ ∫⁻ x in contacts u c r a, ENNReal.ofReal |(fderiv ℝ (gradient u) x).det| ∂μ := + addHaar_image_le_lintegral_abs_det_fderiv μ hs + (fun x _ => ((gradient_contDiff hu).differentiable (by simp) x).hasFDerivAt.hasFDerivWithinAt) + _ ≤ ∫⁻ _ in contacts u c r a, ENNReal.ofReal C ∂μ := + setLIntegral_mono' hs (fun x hx => ENNReal.ofReal_le_ofReal (hdet x hx)) + _ = ENNReal.ofReal C * μ (contacts u c r a) := by simp + + +lemma contacts_hessian_nonneg {u : E → ℝ} (hu : ContDiff ℝ ∞ u) + {c : E} {r a : ℝ} {x : E} (hx : x ∈ contacts u c r a) + (hxi : x ∈ ball c r) (v : E) : + 0 ≤ fderiv ℝ (fderiv ℝ u) x v v := by + let p := gradient u x + let l : E → ℝ := fun y => u x + inner ℝ p (y-x) + have hl : HasFDerivAt l (InnerProductSpace.toDual ℝ E p) x := by + simpa [l, ContinuousLinearMap.comp_id, Function.comp_def, id_eq, + InnerProductSpace.toDual_apply_apply] using + ((InnerProductSpace.toDual ℝ E p).hasFDerivAt.comp x + ((hasFDerivAt_id x).sub_const x)).const_add (u x) + have hld (y : E) : fderiv ℝ l y = InnerProductSpace.toDual ℝ E p := by + simpa [l, ContinuousLinearMap.comp_id, Function.comp_def, id_eq, + InnerProductSpace.toDual_apply_apply] using + ((InnerProductSpace.toDual ℝ E p).hasFDerivAt.comp y + ((hasFDerivAt_id y).sub_const x)).const_add (u x) |>.fderiv + have hlc : ContDiff ℝ ∞ l := contDiff_const.add + (ContDiff.inner ℝ contDiff_const (contDiff_id.sub contDiff_const)) + have hmax : IsLocalMax (fun y => l y - u y) x := by + filter_upwards [isOpen_ball.mem_nhds hxi] with y hy + have hh := hx.2.2 y (ball_subset_closedBall hy) + simpa [l, p] using (sub_nonpos.mpr hh) + have hs := EllipticKernel.second_fderiv_nonpos_at_localMax + (hlc.sub hu).contDiffAt hmax v + have he : fderiv ℝ (fun y => l y - u y) = + fun y => InnerProductSpace.toDual ℝ E p - fderiv ℝ u y := by + funext y + change fderiv ℝ (l - u) y = _ + rw [fderiv_sub (hlc.differentiable (by simp) y) (hu.differentiable (by simp) y), hld] + rw [he, fderiv_const_sub] at hs + simpa using hs + +end PotentialABP + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CoordinateBalls.lean b/lean/OAI/Geometry/PrescribedPotential/CoordinateBalls.lean new file mode 100644 index 0000000000000000000000000000000000000000..d4b98dab6de55eb91142e26c12d8f29af741b6de --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CoordinateBalls.lean @@ -0,0 +1,124 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.KaehlerClosedDerivatives +import OAI.Geometry.PrescribedPotential.ParametrixAtlas + +namespace OAI + +/-! Coordinate Balls. -/ + +section + + + +noncomputable section +open Set Metric Filter Topology MeasureTheory +open scoped ContDiff +namespace Anticanonical.SourceSmooth +open EllipticKernel +local instance coordinateBallRealIP (d : ℕ) : InnerProductSpace ℝ (EC d) := + InnerProductSpace.rclikeToReal ℂ (EC d) +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +structure CoordinateBall (A : ComplexAtlas d X) where + index : Fin A.count + center : EC d + radius : ℝ + radius_pos : 0 < radius + closure_sub : closedBall center (4*radius) ⊆ (A.euclideanChart index).target + +namespace CoordinateBall +variable (p : CoordinateBall A) +def source : Set X := (A.euclideanChart p.index).source ∩ + (A.euclideanChart p.index) ⁻¹' ball p.center p.radius + +lemma ball_sub : ball p.center p.radius ⊆ (A.euclideanChart p.index).target := by + apply subset_trans _ p.closure_sub + exact (ball_subset_closedBall.trans (closedBall_subset_closedBall (by linarith [p.radius_pos]))) + +lemma isOpen_source : IsOpen p.source := + (A.euclideanChart p.index).isOpen_inter_preimage isOpen_ball + +lemma source_nonempty : p.source.Nonempty := by + have hc : p.center ∈ (A.euclideanChart p.index).target := + p.ball_sub (mem_ball_self p.radius_pos) + refine ⟨(A.euclideanChart p.index).symm p.center, + (A.euclideanChart p.index).symm.mapsTo hc, ?_⟩ + change A.euclideanChart p.index ((A.euclideanChart p.index).symm p.center) ∈ ball p.center p.radius + rw [(A.euclideanChart p.index).right_inv hc] + exact mem_ball_self p.radius_pos + +lemma exists_at (x : X) : ∃ p : CoordinateBall A, x ∈ p.source := by + obtain ⟨i, hi⟩ := A.covers x + let e := A.euclideanChart i + have hxe : x ∈ e.source := by simpa [e] using hi + have hxt : e x ∈ e.target := e.mapsTo hxe + obtain ⟨r, hr, hsub⟩ := Metric.nhds_basis_closedBall.mem_iff.mp (e.open_target.mem_nhds hxt) + refine ⟨⟨i, e x, r/4, by positivity, ?_⟩, hxe, ?_⟩ + · convert hsub using 1; ring_nf + · exact mem_ball_self (by positivity) + +theorem finite_cover [CompactSpace X] : + ∃ S : Finset (CoordinateBall A), ∀ x, ∃ p ∈ S, x ∈ p.source := by + classical + obtain ⟨S, hS⟩ := isCompact_univ.elim_finite_subcover + (fun p : CoordinateBall A => p.source) (fun p => p.isOpen_source) (by + intro x _ + obtain ⟨p, hp⟩ := exists_at (A := A) x + exact mem_iUnion.mpr ⟨p, hp⟩) + refine ⟨S, fun x => ?_⟩ + obtain ⟨q, hq, hxq⟩ := mem_iUnion₂.mp (hS (mem_univ x)) + exact ⟨q, hq, hxq⟩ + +section Measure +variable [MeasurableSpace X] [BorelSpace X] + +def measure : Measure X := + Measure.map (A.euclideanChart p.index).symm (volume.restrict (ball p.center p.radius)) + +instance : IsFiniteMeasure p.measure := by + have : IsFiniteMeasure (volume.restrict (ball p.center p.radius)) := + isFiniteMeasure_restrict.mpr isBounded_ball.measure_lt_top.ne + unfold measure + infer_instance + +lemma symm_aemeasurable : AEMeasurable (A.euclideanChart p.index).symm + (volume.restrict (ball p.center p.radius)) := + ((A.euclideanChart p.index).continuousOn_symm.mono p.ball_sub).aemeasurable + isOpen_ball.measurableSet + +lemma integral_measure (f : X → ℝ) (hf : Continuous f) : + (∫ x, f x ∂p.measure) = + ∫ z in ball p.center p.radius, f ((A.euclideanChart p.index).symm z) := by + exact integral_map p.symm_aemeasurable hf.aestronglyMeasurable + +lemma measure_open_pos {U : Set X} (hU : IsOpen U) (hnear : (p.source ∩ U).Nonempty) : + 0 < p.measure.real U := by + have he : ((A.euclideanChart p.index).symm ⁻¹' U) ∩ ball p.center p.radius = + ball p.center p.radius ∩ + ((A.euclideanChart p.index).target ∩ (A.euclideanChart p.index).symm ⁻¹' U) := by + ext z + simp only [mem_inter_iff, mem_preimage] + constructor + · rintro ⟨hu, hz⟩; exact ⟨hz, p.ball_sub hz, hu⟩ + · rintro ⟨hz, _, hu⟩; exact ⟨hu, hz⟩ + have ho : IsOpen (((A.euclideanChart p.index).symm ⁻¹' U) ∩ ball p.center p.radius) := by + rw [he] + exact isOpen_ball.inter ((A.euclideanChart p.index).symm.isOpen_inter_preimage hU) + have hn : (((A.euclideanChart p.index).symm ⁻¹' U) ∩ ball p.center p.radius).Nonempty := by + obtain ⟨x, hx, hxu⟩ := hnear + refine ⟨A.euclideanChart p.index x, ?_, hx.2⟩ + simpa only [mem_preimage, (A.euclideanChart p.index).left_inv hx.1] using hxu + have hm : 0 < p.measure U := by + change 0 < Measure.map _ _ U + rw [Measure.map_apply_of_aemeasurable p.symm_aemeasurable hU.measurableSet, + Measure.restrict_apply' isOpen_ball.measurableSet] + exact ho.measure_pos volume hn + exact ENNReal.toReal_pos hm.ne' (measure_ne_top p.measure U) +end Measure +end CoordinateBall +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CoordinateEllipticity.lean b/lean/OAI/Geometry/PrescribedPotential/CoordinateEllipticity.lean new file mode 100644 index 0000000000000000000000000000000000000000..1a73ebf79d95a7e939898da305eedabc1709cf5d --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CoordinateEllipticity.lean @@ -0,0 +1,125 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CircleRadialCalculus +import OAI.Geometry.PrescribedPotential.CoordinateBalls + +namespace OAI + +/-! Coordinate Ellipticity. -/ + +section + + + +noncomputable section +open Set Metric Filter Topology MeasureTheory Matrix +open scoped ContDiff InnerProductSpace ComplexOrder Matrix.Norms.Elementwise +namespace PotentialABP +variable {d : ℕ} +local notation "E" => EuclideanSpace ℂ (Fin d) +local instance ellipticityRealIP (d : ℕ) : InnerProductSpace ℝ (EuclideanSpace ℂ (Fin d)) := + InnerProductSpace.rclikeToReal ℂ (EuclideanSpace ℂ (Fin d)) + +lemma matrix_quadratic_pos {H : Matrix (Fin d) (Fin d) ℂ} (hH : H.PosDef) + {v : E} (hv : v ≠ 0) : 0 < inner ℝ (H.toEuclideanLin v) v := by + rw [real_inner_comm, real_inner_eq_re_inner (𝕜 := ℂ), EuclideanSpace.inner_eq_star_dotProduct] + rw [dotProduct_comm] + apply hH.re_dotProduct_pos + intro h + apply hv + exact (EuclideanSpace.equiv (Fin d) ℂ).injective (by simpa using h) + + + +lemma compact_matrix_lower_bound {K : Set E} (hK : IsCompact K) + {G : E → Matrix (Fin d) (Fin d) ℂ} + (hcont : ContinuousOn (fun x => (Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin d)) (G x)) K) + (hpos : ∀ x ∈ K, (G x).PosDef) : + ∃ δ : ℝ, 0 < δ ∧ ∀ x ∈ K, ∀ v : E, + δ*‖v‖^2 ≤ inner ℝ ((G x).toEuclideanLin v) v := by + let Q : E × E → ℝ := fun z => inner ℝ ((G z.1).toEuclideanLin z.2) z.2 + let L := K ×ˢ sphere (0:E) 1 + have hLc : IsCompact L := hK.prod (isCompact_sphere _ _) + have hQc : ContinuousOn Q L := by + have hc := hcont.comp continuous_fst.continuousOn (show MapsTo Prod.fst L K from fun z hz => hz.1) + exact (hc.clm_apply continuous_snd.continuousOn).inner continuous_snd.continuousOn + have hp : ∀ z ∈ L, 0 < Q z := by + rintro ⟨x,v⟩ ⟨hx,hv⟩ + apply matrix_quadratic_pos (hpos x hx) + intro hv0 + change v = 0 at hv0 + have hw : ‖v‖ = 1 := by simpa [mem_sphere, dist_zero_right] using hv + rw [hv0, norm_zero] at hw + norm_num at hw + have hδ : ∃ δ : ℝ, 0 < δ ∧ ∀ z ∈ L, δ ≤ Q z := by + by_cases hn : L.Nonempty + · obtain ⟨z, hz, hzmin⟩ := hLc.exists_isMinOn hn hQc + exact ⟨Q z, hp z hz, fun y hy => hzmin hy⟩ + · exact ⟨1, by norm_num, fun z hz => (hn ⟨z,hz⟩).elim⟩ + obtain ⟨δ,hδ,hbound⟩ := hδ + refine ⟨δ,hδ,?_⟩ + intro x hx v + by_cases hv : v = 0 + · simp [hv] + have hn : 0 < ‖v‖ := norm_pos_iff.mpr hv + have hw : ‖(‖v‖⁻¹ : ℝ) • v‖ = 1 := by + rw [norm_smul, Real.norm_eq_abs, abs_of_pos (inv_pos.mpr hn), inv_mul_cancel₀ hn.ne'] + have hb := hbound (x,(‖v‖⁻¹ : ℝ) • v) ⟨hx, by simpa [mem_sphere, dist_zero_right] using hw⟩ + have he : Q (x,(‖v‖⁻¹ : ℝ) • v) = ‖v‖⁻¹*‖v‖⁻¹ * inner ℝ ((G x).toEuclideanLin v) v := by + dsimp only [Q] + have hmap : (G x).toEuclideanLin ((‖v‖⁻¹ : ℝ) • v) = + (‖v‖⁻¹ : ℝ) • (G x).toEuclideanLin v := + ((G x).toEuclideanLin.restrictScalars ℝ).map_smul _ _ + rw [hmap, real_inner_smul_left, real_inner_smul_right] + ring + rw [he] at hb + have hh := mul_le_mul_of_nonneg_left hb (sq_nonneg ‖v‖) + have hc : ‖v‖^2 * (‖v‖⁻¹ * ‖v‖⁻¹ * inner ℝ ((G x).toEuclideanLin v) v) = + inner ℝ ((G x).toEuclideanLin v) v := by field_simp + rw [hc] at hh + nlinarith +end PotentialABP + +namespace Anticanonical.SourceSmooth +open EllipticKernel PotentialABP +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +local instance coordinateEllipticityRealIP (d : ℕ) : InnerProductSpace ℝ (EC d) := + InnerProductSpace.rclikeToReal ℂ (EC d) +namespace CoordinateBall +variable (p : CoordinateBall A) + +lemma metric_continuousOn (g : KaehlerMetric A) : + ContinuousOn (fun z : EC d => + (Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin d)) (g.matrix p.index (coordinateEquiv d z))) + (closedBall p.center (3*p.radius)) := by + apply (Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin d)).toAlgEquiv.toLinearMap.continuous_of_finiteDimensional.comp_continuousOn + have hs : ContinuousOn (fun z : EC d => g.matrix p.index (coordinateEquiv d z)) + (A.euclideanChart p.index).target := by + apply continuousOn_pi.mpr + intro i + apply continuousOn_pi.mpr + intro j + have hij := (contDiffOn_pi.mp (contDiffOn_pi.mp (g.smooth p.index) i) j).continuousOn + rw [ComplexAtlas.euclideanChart_target] + convert hij.comp (coordinateEquiv d).continuous.continuousOn + (show Set.MapsTo (coordinateEquiv d) + ((coordinateEquiv d) ⁻¹' (A.chart p.index).target) (A.chart p.index).target from + fun _ hz => hz) using 1 + rfl + exact hs.mono (fun z hz => p.closure_sub + (closedBall_subset_closedBall (by linarith [p.radius_pos]) hz)) + +lemma metric_lower_bound (g : KaehlerMetric A) : ∃ δ : ℝ, 0 < δ ∧ + ∀ z ∈ closedBall p.center (3*p.radius), ∀ v : EC d, + δ*‖v‖^2 ≤ inner ℝ ((g.matrix p.index (coordinateEquiv d z)).toEuclideanLin v) v := by + apply compact_matrix_lower_bound (isCompact_closedBall _ _) (p.metric_continuousOn g) + intro z hz + apply g.positive + have ht := p.closure_sub (closedBall_subset_closedBall (by linarith [p.radius_pos]) hz) + simpa only [ComplexAtlas.euclideanChart_target, mem_preimage] using ht +end CoordinateBall +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CoordinateExtension.lean b/lean/OAI/Geometry/PrescribedPotential/CoordinateExtension.lean new file mode 100644 index 0000000000000000000000000000000000000000..b96871911eea8f8b9c2204ddf4730debf7d6ef56 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CoordinateExtension.lean @@ -0,0 +1,54 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CoordinateBalls +import OAI.Geometry.PrescribedPotential.CoordinatePotential + +namespace OAI + +/-! Coordinate Extension. -/ + +section + + + +noncomputable section +open Set Metric Filter Topology +open scoped ContDiff +namespace Anticanonical.SourceSmooth +open EllipticKernel +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +namespace CoordinateBall +variable (p : CoordinateBall A) + +def coordExtension (φ : SmoothRealFunction A) : Coordinates d → ℝ := + p.extension φ ∘ (coordinateEquiv d).symm + +lemma coordExtension_smooth (φ : SmoothRealFunction A) : + ContDiff ℝ ∞ (p.coordExtension φ) := by + exact (p.extension_smooth φ).comp + ((coordinateEquiv d).symm.toContinuousLinearMap.restrictScalars ℝ).contDiff + +lemma coordExtension_apply (φ : SmoothRealFunction A) (z : EC d) : + p.coordExtension φ (coordinateEquiv d z) = p.extension φ z := by + simp only [coordExtension, Function.comp_apply, ContinuousLinearEquiv.symm_apply_apply] + +lemma coordExtension_eventuallyEq (φ : SmoothRealFunction A) {z : EC d} + (hz : z ∈ closedBall p.center (3*p.radius)) : + p.coordExtension φ =ᶠ[𝓝 (coordinateEquiv d z)] φ.localExpression p.index := by + have he := (p.extension_eventuallyEq φ hz).comp_tendsto + ((coordinateEquiv d).symm.continuousAt.tendsto) + simpa only [coordExtension, SmoothRealFunction.localExpression, Function.comp_def, + ComplexAtlas.euclideanChart_symm_apply, ContinuousLinearEquiv.apply_symm_apply, + ContinuousLinearEquiv.symm_apply_apply, coordinateEquiv, PiLp.coe_continuousLinearEquiv, PiLp.coe_symm_continuousLinearEquiv, WithLp.ofLp_toLp] using he + +lemma coordExtension_hessian (φ : SmoothRealFunction A) {z : EC d} + (hz : z ∈ closedBall p.center (3*p.radius)) : + PotentialKaehler.potentialMatrix (p.coordExtension φ) (coordinateEquiv d z) = + φ.hessian p.index (coordinateEquiv d z) := + PotentialKaehler.potentialMatrix_congr (p.coordExtension_eventuallyEq φ hz) +end CoordinateBall +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CoordinateInnerCover.lean b/lean/OAI/Geometry/PrescribedPotential/CoordinateInnerCover.lean new file mode 100644 index 0000000000000000000000000000000000000000..c68523cfd515a2ec2162af74a0d7a44e5c0833a9 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CoordinateInnerCover.lean @@ -0,0 +1,66 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CoordinateBalls + +namespace OAI + +/-! Coordinate Inner Cover. -/ + +section + + + +noncomputable section +open Set Metric Filter Topology +namespace Anticanonical.SourceSmooth +open EllipticKernel +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +namespace CoordinateBall +variable (p : CoordinateBall A) + +def half : CoordinateBall A where + index := p.index + center := p.center + radius := p.radius/2 + radius_pos := by have hp := p.radius_pos; positivity + closure_sub := (closedBall_subset_closedBall (by linarith [p.radius_pos])).trans p.closure_sub + +lemma half_source_sub : p.half.source ⊆ p.source := by + rintro x ⟨hx,hb⟩ + exact ⟨hx, ball_subset_ball (by change p.radius/2 ≤ p.radius; linarith [p.radius_pos]) hb⟩ + +lemma centered_small_closedBall_subset {c : EC d} (hc : c ∈ ball p.center (p.radius/2)) : + closedBall c (p.radius/2) ⊆ ball p.center p.radius := by + intro z hz + have hc' : dist c p.center < p.radius/2 := hc + have hz' : dist z c ≤ p.radius/2 := hz + change dist z p.center < p.radius + linarith [dist_triangle z c p.center] + +lemma half_exists_at (x : X) : ∃ p : CoordinateBall A, x ∈ p.half.source := by + obtain ⟨i,hi⟩ := A.covers x + let e := A.euclideanChart i + have hs : x ∈ e.source := by simpa [e] using hi + obtain ⟨r,hr,hsub⟩ := Metric.nhds_basis_closedBall.mem_iff.mp + (e.open_target.mem_nhds (e.mapsTo hs)) + refine ⟨⟨i,e x,r/4,by positivity,?_⟩,hs,?_⟩ + · convert hsub using 1; ring_nf + · exact mem_ball_self (by change 0 < r/4/2; positivity) + +theorem finite_inner_cover [CompactSpace X] : + ∃ S : Finset (CoordinateBall A), ∀ x, ∃ p ∈ S, x ∈ p.half.source := by + classical + obtain ⟨S,hS⟩ := isCompact_univ.elim_finite_subcover + (fun p : CoordinateBall A => p.half.source) (fun p => p.half.isOpen_source) (by + intro x _ + obtain ⟨p,hp⟩ := half_exists_at (A := A) x + exact mem_iUnion.mpr ⟨p,hp⟩) + refine ⟨S, fun x => ?_⟩ + obtain ⟨p,hp,hx⟩ := mem_iUnion₂.mp (hS (mem_univ x)) + exact ⟨p,hp,hx⟩ +end CoordinateBall +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CoordinateMinimumBound.lean b/lean/OAI/Geometry/PrescribedPotential/CoordinateMinimumBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..f89aff0808475ad43be1addd3389c46a98a8f69f --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CoordinateMinimumBound.lean @@ -0,0 +1,88 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.ABPIntegralBound +import OAI.Geometry.PrescribedPotential.CoordinateBalls +import OAI.Geometry.PrescribedPotential.CoordinateEllipticity +import OAI.Geometry.PrescribedPotential.CoordinateExtension +import OAI.Geometry.PrescribedPotential.CoordinateInnerCover + +namespace OAI + +/-! Coordinate Minimum Bound. -/ + +section + + + +noncomputable section +open Set Metric Filter Topology MeasureTheory Matrix +open scoped ContDiff InnerProductSpace ComplexOrder +namespace Anticanonical.SourceSmooth +open EllipticKernel PotentialABP +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +local instance coordinateMinimumRealIP (d : ℕ) : InnerProductSpace ℝ (EC d) := + InnerProductSpace.rclikeToReal ℂ (EC d) +namespace CoordinateBall +variable [MeasurableSpace X] [BorelSpace X] (p : CoordinateBall A) + +lemma minimum_bound (g : KaehlerMetric A) (B : ℝ) {K : ℝ} (hK : 0 < K) : + ∃ C : ℝ, ∀ φ : SmoothRealFunction A, + (∀ x, φ.value x ≤ 0) → (∫ x, -φ.value x ∂p.measure) ≤ B → + (∀ z ∈ closedBall p.center (3*p.radius), + |(g.matrix p.index (coordinateEquiv d z) + φ.hessian p.index (coordinateEquiv d z)).det.re| ≤ K) → + ∀ x ∈ p.half.source, (∀ y, φ.value x ≤ φ.value y) → -φ.value x ≤ C := by + obtain ⟨δ,hδ,hδb⟩ := p.metric_lower_bound g + let r := p.radius/2 + have hr : 0 < r := by dsimp only [r]; exact half_pos p.radius_pos + let C := δ*r^2/2+B*((4:ℝ)^(2*d)*K^2)/volume.real (closedBall (0:EC d) (δ*r/2)) + refine ⟨C, ?_⟩ + intro φ hn hB hdet x hx hmin + let c := A.euclideanChart p.index x + have hcb : c ∈ ball p.center (p.radius/2) := hx.2 + have hsub := p.centered_small_closedBall_subset hcb + have hball : ball p.center p.radius ⊆ closedBall p.center (3*p.radius) := + ball_subset_closedBall.trans (closedBall_subset_closedBall (by linarith [p.radius_pos])) + have hsub3 : closedBall c r ⊆ closedBall p.center (3*p.radius) := hsub.trans hball + have he (z) (hz : z ∈ closedBall p.center (3*p.radius)) : + p.coordExtension φ ((EuclideanSpace.equiv (Fin d) ℂ) z) = + φ.value ((A.euclideanChart p.index).symm z) := by + change p.coordExtension φ (coordinateEquiv d z) = _ + rw [p.coordExtension_apply, p.extension_eq φ hz] + have hec : p.coordExtension φ ((EuclideanSpace.equiv (Fin d) ℂ) c) = φ.value x := by + rw [he c (hsub3 (mem_closedBall_self hr.le)), (A.euclideanChart p.index).left_inv hx.1] + have hi : IntegrableOn + (fun z : EC d => -p.coordExtension φ ((EuclideanSpace.equiv (Fin d) ℂ) z)) + (ball p.center p.radius) volume := by + exact (((p.coordExtension_smooth φ).continuous.comp + (EuclideanSpace.equiv (Fin d) ℂ).continuous).neg.continuousOn.integrableOn_compact + (isCompact_closedBall p.center p.radius)).mono_set ball_subset_closedBall + have hBi : (∫ z in ball p.center p.radius, + -p.coordExtension φ ((EuclideanSpace.equiv (Fin d) ℂ) z)) ≤ B := by + rw [p.integral_measure (fun x => -φ.value x) φ.continuous.neg] at hB + apply (setIntegral_congr_fun isOpen_ball.measurableSet (fun z hz => ?_)).trans_le hB + rw [he z (hball hz)] + have hh := abp_integral_minimum_bound volume (p.coordExtension_smooth φ) + (fun z => g.matrix p.index (coordinateEquiv d z)) hr hδ hK + (by intro z hz; rw [hec, he z (hsub3 hz)]; exact hmin _) + (by + intro z hz + apply (g.positive _ _ ?_).isHermitian + have ht := p.closure_sub (closedBall_subset_closedBall (by linarith [p.radius_pos]) (hsub3 hz)) + simpa only [ComplexAtlas.euclideanChart_target, mem_preimage] using ht) + (fun z hz v => hδb z (hsub3 hz) v) + (by + intro z hz + change |(g.matrix p.index (coordinateEquiv d z) + + PotentialKaehler.potentialMatrix (p.coordExtension φ) (coordinateEquiv d z)).det.re| ≤ K + rw [p.coordExtension_hessian φ (hsub3 hz)] + exact hdet z (hsub3 hz)) + isOpen_ball.measurableSet hsub + (by intro z hz; rw [he z (hball hz)]; exact hn _) hi hBi + rw [hec] at hh + exact hh +end CoordinateBall +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CoordinatePotential.lean b/lean/OAI/Geometry/PrescribedPotential/CoordinatePotential.lean new file mode 100644 index 0000000000000000000000000000000000000000..a7e1696ebdfca764a8415d024d3c7e88540214e1 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CoordinatePotential.lean @@ -0,0 +1,158 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CircleRadialCalculus +import OAI.Geometry.PrescribedPotential.CoordinateBalls + +namespace OAI + +/-! Coordinate Potential. -/ + +section + + + +noncomputable section +open Set Metric Filter Topology MeasureTheory Matrix +open scoped ContDiff InnerProductSpace ComplexOrder Matrix.Norms.Elementwise +namespace PotentialABP +variable {d : ℕ} +local notation "E" => EuclideanSpace ℂ (Fin d) +local instance coordinatePotentialRealIP (d : ℕ) : InnerProductSpace ℝ (EuclideanSpace ℂ (Fin d)) := + InnerProductSpace.rclikeToReal ℂ (EuclideanSpace ℂ (Fin d)) +local notation "e" => EuclideanSpace.equiv (Fin d) ℂ + +lemma hessian_coord_comp_at {f : (Fin d → ℂ) → ℝ} {x : E} + (hf : ContDiffAt ℝ ∞ f (e x)) (v w : E) : + fderiv ℝ (fderiv ℝ (f ∘ e)) x v w = + fderiv ℝ (fderiv ℝ f) (e x) (e v) (e w) := by + let er := (EuclideanSpace.equiv (Fin d) ℂ).toContinuousLinearMap.restrictScalars ℝ + have her : ContDiff ℝ ∞ e := er.contDiff + have hd : fderiv ℝ e = fun _ => (er : E →L[ℝ] (Fin d → ℂ)) := by + funext y + exact er.hasFDerivAt.fderiv + rw [PotentialKaehler.second_derivative_comp her.contDiffAt hf v w, hd] + simp + rfl + +lemma levi_coord_pair_at {f : (Fin d → ℂ) → ℝ} {x : E} + (hf : ContDiffAt ℝ ∞ f (e x)) (v : E) : + fderiv ℝ (fderiv ℝ (f ∘ e)) x v v + + fderiv ℝ (fderiv ℝ (f ∘ e)) x (Complex.I • v) (Complex.I • v) = + 4 * inner ℝ ((PotentialKaehler.potentialMatrix f (e x)).toEuclideanLin v) v := by + rw [hessian_coord_comp_at hf, hessian_coord_comp_at hf] + rw [real_inner_comm, real_inner_eq_re_inner (𝕜 := ℂ), EuclideanSpace.inner_eq_star_dotProduct] + rw [dotProduct_comm] + change _ = 4 * (star (e v) ⬝ᵥ ((PotentialKaehler.potentialMatrix f (e x)) *ᵥ (e v))).re + rw [PotentialKaehler.potentialMatrix, PotentialKaehler.hermitianPartMatrix_pair] + simp only [map_smul, PotentialKaehler.hermitianPart] + ring + +lemma matrix_quadratic_le (H : Matrix (Fin d) (Fin d) ℂ) (v : E) : + inner ℝ (H.toEuclideanLin v) v ≤ ‖(Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin d)) H‖ * ‖v‖^2 := by + apply (real_inner_le_norm _ _).trans + have h := ((Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin d)) H).le_opNorm v + change ‖H.toEuclideanLin v‖ ≤ ‖(Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin d)) H‖ * ‖v‖ at h + nlinarith [mul_le_mul_of_nonneg_right h (norm_nonneg v)] + +lemma matrix_quadratic_nonneg {H : Matrix (Fin d) (Fin d) ℂ} (hH : H.PosSemidef) (v : E) : + 0 ≤ inner ℝ (H.toEuclideanLin v) v := by + rw [real_inner_eq_re_inner (𝕜 := ℂ)] + exact (Matrix.isPositive_toEuclideanLin_iff.mpr hH).re_inner_nonneg_left v +end PotentialABP + +namespace Anticanonical.SourceSmooth +open EllipticKernel PotentialABP +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +local instance sourceCoordinateRealIP (d : ℕ) : InnerProductSpace ℝ (EC d) := + InnerProductSpace.rclikeToReal ℂ (EC d) +namespace CoordinateBall +variable (p : CoordinateBall A) + +def bump : ContDiffBump p.center where + rIn := 7*p.radius/2 + rOut := 4*p.radius + rIn_pos := by linarith [p.radius_pos] + rIn_lt_rOut := by linarith [p.radius_pos] + +def extension (φ : SmoothRealFunction A) : EC d → ℝ := + fun z => p.bump z * φ.value ((A.euclideanChart p.index).symm z) + +lemma extension_smooth (φ : SmoothRealFunction A) : ContDiff ℝ ∞ (p.extension φ) := by + apply MetricLocalization.smooth_bump_smul p.bump + intro z hz + have hz' : z ∈ (A.euclideanChart p.index).target := p.closure_sub + (by simpa only [bump, ContDiffBump.tsupport_eq] using hz) + exact (φ.euclidean_smooth p.index).contDiffAt + (by simpa only [ComplexAtlas.euclideanChart_target] using + (A.euclideanChart p.index).open_target.mem_nhds hz') + +lemma extension_eventuallyEq (φ : SmoothRealFunction A) {z : EC d} + (hz : z ∈ closedBall p.center (3*p.radius)) : + p.extension φ =ᶠ[𝓝 z] (φ.value ∘ (A.euclideanChart p.index).symm) := by + have hz' : z ∈ ball p.center (7*p.radius/2) := by + have hd : dist z p.center ≤ 3*p.radius := hz + change dist z p.center < 7*p.radius/2 + linarith [p.radius_pos] + filter_upwards [isOpen_ball.mem_nhds hz'] with y hy + have hone : p.bump y = 1 := p.bump.one_of_mem_closedBall + (show dist y p.center ≤ 7*p.radius/2 from (show dist y p.center < 7*p.radius/2 from hy).le) + simp [extension, hone] + +lemma extension_eq (φ : SmoothRealFunction A) {z : EC d} + (hz : z ∈ closedBall p.center (3*p.radius)) : + p.extension φ z = φ.value ((A.euclideanChart p.index).symm z) := + (p.extension_eventuallyEq φ hz).eq_of_nhds + +lemma metric_bound (g : KaehlerMetric A) : ∃ C : ℝ, 0 ≤ C ∧ + ∀ z ∈ closedBall p.center (3*p.radius), ∀ v : EC d, + inner ℝ ((g.matrix p.index (coordinateEquiv d z)).toEuclideanLin v) v ≤ C*‖v‖^2 := by + have hc : ContinuousOn (fun z : EC d => + (Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin d)) (g.matrix p.index (coordinateEquiv d z))) + (closedBall p.center (3*p.radius)) := by + apply (Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin d)).toAlgEquiv.toLinearMap.continuous_of_finiteDimensional.comp_continuousOn + have hs : ContinuousOn (fun z : EC d => g.matrix p.index (coordinateEquiv d z)) + (A.euclideanChart p.index).target := by + apply continuousOn_pi.mpr + intro i + apply continuousOn_pi.mpr + intro j + have hij := (contDiffOn_pi.mp (contDiffOn_pi.mp (g.smooth p.index) i) j).continuousOn + rw [ComplexAtlas.euclideanChart_target] + convert hij.comp (coordinateEquiv d).continuous.continuousOn + (show Set.MapsTo (coordinateEquiv d) + ((coordinateEquiv d) ⁻¹' (A.chart p.index).target) (A.chart p.index).target from + fun _ hz => hz) using 1; rfl + exact hs.mono (fun z hz => p.closure_sub + (closedBall_subset_closedBall (by linarith [p.radius_pos]) hz)) + obtain ⟨C, hC⟩ := (isCompact_closedBall p.center (3*p.radius)).exists_bound_of_continuousOn hc + refine ⟨max C 0, le_max_right _ _, fun z hz v => ?_⟩ + exact (matrix_quadratic_le _ v).trans + (mul_le_mul_of_nonneg_right ((hC z hz).trans (le_max_left _ _)) (sq_nonneg _)) + +lemma extension_levi_lower (g : KaehlerMetric A) (φ : SmoothRealFunction A) + (hφ : g.PositivePotential φ) {C : ℝ} + (hC : ∀ z ∈ closedBall p.center (3*p.radius), ∀ v : EC d, + inner ℝ ((g.matrix p.index (coordinateEquiv d z)).toEuclideanLin v) v ≤ C*‖v‖^2) + {z : EC d} (hz : z ∈ closedBall p.center (3*p.radius)) (v : EC d) : + -(4*C*‖v‖^2) ≤ fderiv ℝ (fderiv ℝ (p.extension φ)) z v v + + fderiv ℝ (fderiv ℝ (p.extension φ)) z (Complex.I • v) (Complex.I • v) := by + have hzt : z ∈ (A.euclideanChart p.index).target := + p.closure_sub (closedBall_subset_closedBall (by linarith [p.radius_pos]) hz) + have hzt' : coordinateEquiv d z ∈ (A.chart p.index).target := by simpa only [ComplexAtlas.euclideanChart_target, mem_preimage] using hzt + have he := ((p.extension_eventuallyEq φ hz).fderiv (𝕜 := ℝ)).fderiv_eq (𝕜 := ℝ) + rw [he] + have hl := levi_coord_pair_at ((φ.smooth p.index).contDiffAt + ((A.chart p.index).open_target.mem_nhds hzt')) v + have hn := matrix_quadratic_nonneg (hφ p.index _ hzt').posSemidef v + rw [map_add, LinearMap.add_apply, inner_add_left] at hn + change fderiv ℝ (fderiv ℝ (φ.value ∘ (A.euclideanChart p.index).symm)) z v v + + fderiv ℝ (fderiv ℝ (φ.value ∘ (A.euclideanChart p.index).symm)) z (Complex.I • v) (Complex.I • v) = + 4*inner ℝ ((φ.hessian p.index (coordinateEquiv d z)).toEuclideanLin v) v at hl + rw [hl] + linarith [hC z hz v] +end CoordinateBall +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CoreBounds.lean b/lean/OAI/Geometry/PrescribedPotential/CoreBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..55016a0c7e34d16524081d6bc81ba59490d76deb --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CoreBounds.lean @@ -0,0 +1,161 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.LocalRegularity + +namespace OAI + +/-! Core Bounds. -/ + +section + + + +noncomputable section +open Filter Topology MeasureTheory LineDeriv TemperedDistribution +open scoped ContDiff SchwartzMap Classical Laplacian + +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + + +def CoreBound (s t : ℝ) (T : 𝓢(E, ℂ) → 𝓢(E, ℂ)) : Prop := + ∃ C : ℝ, 0 ≤ C ∧ ∀ f, ‖schwartzCoord t (T f)‖ ≤ C * ‖schwartzCoord s f‖ + +lemma CoreBound.comp {s t r : ℝ} {S T : 𝓢(E, ℂ) → 𝓢(E, ℂ)} + (hS : CoreBound t r S) (hT : CoreBound s t T) : CoreBound s r (S ∘ T) := by + obtain ⟨C, hC, hc⟩ := hS + obtain ⟨D, hD, hd⟩ := hT + refine ⟨C * D, mul_nonneg hC hD, fun f => ?_⟩ + exact (hc (T f)).trans (by simpa [mul_assoc] using mul_le_mul_of_nonneg_left (hd f) hC) + +lemma CoreBound.add {s t : ℝ} {S T : 𝓢(E, ℂ) → 𝓢(E, ℂ)} + (hS : CoreBound s t S) (hT : CoreBound s t T) : + CoreBound s t (fun f => S f + T f) := by + obtain ⟨C, hC, hc⟩ := hS + obtain ⟨D, hD, hd⟩ := hT + refine ⟨C + D, add_nonneg hC hD, fun f => ?_⟩ + rw [schwartzCoord_add, add_mul] + exact (norm_add_le _ _).trans (add_le_add (hc f) (hd f)) + +lemma CoreBound.sum {ι : Type*} {s t : ℝ} (I : Finset ι) + (T : ι → 𝓢(E, ℂ) → 𝓢(E, ℂ)) (hh : ∀ i ∈ I, CoreBound s t (T i)) : + CoreBound s t (fun f => ∑ i ∈ I, T i f) := by + choose C hC h using fun i : I => hh i i.property + refine ⟨∑ i : I, C i, Finset.sum_nonneg (fun i _ => hC i), fun f => ?_⟩ + rw [schwartzCoord_sum] + calc + _ ≤ ∑ i ∈ I, ‖schwartzCoord t (T i f)‖ := norm_sum_le _ _ + _ = ∑ i : I, ‖schwartzCoord t (T i f)‖ := (Finset.sum_coe_sort I _).symm + _ ≤ ∑ i : I, C i * ‖schwartzCoord s f‖ := Finset.sum_le_sum (fun i _ => h i f) + _ = _ := (Finset.sum_mul ..).symm + +lemma CoreBound.id {s t : ℝ} (hst : t ≤ s) : CoreBound (E := E) s t id := by + let B := liftOperator (E := E) s t (ContinuousLinearMap.id ℂ _) (fun _ hu => hu.mono hst) + refine ⟨‖B‖, norm_nonneg _, fun f => ?_⟩ + have hb : B (schwartzCoord s f) = schwartzCoord t f := by + apply realize_injective t + exact (realize_liftOperator s t _ _ _).trans (by simp only [realize_schwartzCoord, ContinuousLinearMap.id_apply]) + rw [Function.id_def, ← hb] + exact B.le_opNorm _ + +lemma coreBound_deriv {s t : ℝ} (v : E) (hst : t ≤ s - 1) : + CoreBound s t (fun f : 𝓢(E, ℂ) => ∂_{v} f) := by + let B := liftOperator s t (lineDerivOpCLM ℂ 𝓢'(E, ℂ) v) + (fun _ hu => hu.lineDerivOp.mono hst) + refine ⟨‖B‖, norm_nonneg _, fun f => ?_⟩ + have hb : B (schwartzCoord s f) = schwartzCoord t (∂_{v} f) := by + apply realize_injective t + exact (realize_liftOperator s t _ _ _).trans (by + rw [realize_schwartzCoord, realize_schwartzCoord] + exact lineDerivOp_toTemperedDistributionCLM_eq f v) + rw [← hb] + exact B.le_opNorm _ + +lemma coreBound_word (ws : List E) {s t : ℝ} (hst : t ≤ s - ws.length) : + CoreBound s t (schwartzWord ws) := by + induction ws generalizing t with + | nil => exact CoreBound.id (by simpa using hst) + | cons v ws ih => + have hw : CoreBound s (t + 1) (schwartzWord ws) := ih (by simp only [List.length_cons, Nat.cast_add, Nat.cast_one] at hst; linarith) + exact (coreBound_deriv v (s := t + 1) (t := t) (by linarith)).comp hw + +lemma schwartzCoord_distribution (s : ℝ) (f : 𝓢(E, ℂ)) : + (schwartzCoord s f : 𝓢'(E, ℂ)) = besselPotential E ℂ s (f : 𝓢'(E, ℂ)) := by + rw [← realize_schwartzCoord s f, bessel_realize] + +lemma schwartzCoord_raise_two (s : ℝ) (f : 𝓢(E, ℂ)) : + schwartzCoord (s + 2) f = schwartzCoord s f - (((2 * Real.pi)^2 : ℝ) : ℂ)⁻¹ • + ∑ j, schwartzCoord s (∂_{stdOrthonormalBasis ℝ E j} (∂_{stdOrthonormalBasis ℝ E j} f)) := by + apply l2_injective + simp only [Lp.toTemperedDistributionCLM_apply, map_sub, map_smul, map_sum, + schwartzCoord_distribution] + rw [add_comm s 2, ← besselPotential_besselPotential_apply 2 s, + bessel_two_laplacian, map_sub, map_smul] + congr 2 + rw [TemperedDistribution.laplacian_eq_sum (stdOrthonormalBasis ℝ E), map_sum] + apply Finset.sum_congr rfl + intro j _ + rw [← lineDerivOp_toTemperedDistributionCLM_eq, + ← lineDerivOp_toTemperedDistributionCLM_eq] + +lemma schwartzCoord_raise_two_norm (s : ℝ) (f : 𝓢(E, ℂ)) : + ‖schwartzCoord (s + 2) f‖ ≤ ‖schwartzCoord s f‖ + + ‖(((2 * Real.pi)^2 : ℝ) : ℂ)⁻¹‖ * ∑ j, ‖schwartzCoord s + (∂_{stdOrthonormalBasis ℝ E j} (∂_{stdOrthonormalBasis ℝ E j} f))‖ := by + let u := schwartzCoord s f + let D (j : Fin (Module.finrank ℝ E)) := schwartzCoord s + (∂_{stdOrthonormalBasis ℝ E j} (∂_{stdOrthonormalBasis ℝ E j} f)) + let c : ℂ := (((2 * Real.pi)^2 : ℝ) : ℂ)⁻¹ + rw [schwartzCoord_raise_two] + change ‖u - c • ∑ j, D j‖ ≤ ‖u‖ + ‖c‖ * ∑ j, ‖D j‖ + have hs := norm_smul c (∑ j, D j) + calc + _ ≤ ‖u‖ + ‖c • ∑ j, D j‖ := norm_sub_le _ _ + _ = ‖u‖ + ‖c‖ * ‖∑ j, D j‖ := congrArg (fun z : ℝ => ‖u‖ + z) hs + _ ≤ _ := add_le_add_right (mul_le_mul_of_nonneg_left (norm_sum_le _ _) (norm_nonneg c)) _ + +lemma coreBound_raise_two {s t : ℝ} (T : 𝓢(E, ℂ) → 𝓢(E, ℂ)) + (hT : CoreBound s t T) + (hD : ∀ j, CoreBound s t (fun f => ∂_{stdOrthonormalBasis ℝ E j} + (∂_{stdOrthonormalBasis ℝ E j} (T f)))) : CoreBound s (t + 2) T := by + obtain ⟨C, hC, hc⟩ := hT + choose D hD0 hdb using hD + let c : ℝ := ‖(((2 * Real.pi)^2 : ℝ) : ℂ)⁻¹‖ + have hc0 : 0 ≤ c := norm_nonneg _ + refine ⟨C + c * ∑ j, D j, add_nonneg hC (mul_nonneg hc0 (Finset.sum_nonneg (fun j _ => hD0 j))), fun f => ?_⟩ + apply (schwartzCoord_raise_two_norm t (T f)).trans + have hd := Finset.sum_le_sum (s := Finset.univ) (fun j _ => hdb j f) + have hsum := add_le_add (hc f) (mul_le_mul_of_nonneg_left hd hc0) + convert hsum using 1; rw [← Finset.sum_mul]; ring + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma schwartzWord_append (vs ws : List E) (f : 𝓢(E, ℂ)) : + schwartzWord (vs ++ ws) f = schwartzWord vs (schwartzWord ws f) := by + induction vs with + | nil => rfl + | cons v vs ih => simpa only [List.cons_append, schwartzWord, ContinuousLinearMap.comp_apply] using congrArg (lineDerivOpCLM ℂ 𝓢(E, ℂ) v) ih + + + +lemma coreBound_of_words (k : ℕ) {s : ℝ} (T : 𝓢(E, ℂ) → 𝓢(E, ℂ)) + (h : ∀ ws : List E, ws.length ≤ 2 * k → CoreBound s 0 (fun f => schwartzWord ws (T f))) : + CoreBound s (2 * (k : ℝ)) T := by + induction k generalizing T with + | zero => simpa [schwartzWord] using h [] (by simp) + | succ k ih => + have ht := ih T (fun ws hw => h ws (by omega)) + have hd (j : Fin (Module.finrank ℝ E)) := ih + (fun f => ∂_{stdOrthonormalBasis ℝ E j} (∂_{stdOrthonormalBasis ℝ E j} (T f))) + (fun ws hw => by + have hh := h (ws ++ [stdOrthonormalBasis ℝ E j, stdOrthonormalBasis ℝ E j]) + (by simp only [List.length_append, List.length_cons, List.length_nil] ; omega) + simpa only [schwartzWord_append, schwartzWord, ContinuousLinearMap.comp_apply, + ContinuousLinearMap.id_apply, lineDerivOpCLM_apply] using hh) + convert coreBound_raise_two T ht hd using 1; push_cast; ring + +end SobolevChart + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/CutoffHigher.lean b/lean/OAI/Geometry/PrescribedPotential/CutoffHigher.lean new file mode 100644 index 0000000000000000000000000000000000000000..e876ce5b5bb569e4409167b0f97deeabd14d5c7e --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/CutoffHigher.lean @@ -0,0 +1,174 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.IntegerBounds +import OAI.Geometry.PrescribedPotential.PatchDifferential + +namespace OAI + +/-! Cutoff Higher. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory TemperedDistribution LineDeriv +open scoped SchwartzMap ContDiff Classical BoundedContinuousFunction + +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +lemma schwartzCoord_product_zero (κ f : 𝓢(E, ℂ)) : + schwartzCoord 0 (SchwartzMap.smulLeftCLM ℂ κ f) = + multiply κ.toBoundedContinuousFunction (schwartzCoord 0 f) := by + apply l2_injective + simp only [Lp.toTemperedDistributionCLM_apply] + rw [schwartzCoord_distribution, schwartz_temperate_product_distribution κ.hasTemperateGrowth, + besselPotential_zero, ContinuousLinearMap.id_apply, + multiply_distribution _ κ.hasTemperateGrowth, schwartzCoord_distribution, + besselPotential_zero, ContinuousLinearMap.id_apply] + rfl + +lemma coreBound_coefficient_zero (c : E →ᵇ ℂ) + (hc : (c : E → ℂ).HasTemperateGrowth) : + CoreBound 0 0 (SchwartzMap.smulLeftCLM ℂ c) := by + refine ⟨‖c‖, norm_nonneg _, fun f => ?_⟩ + have he : schwartzCoord 0 (SchwartzMap.smulLeftCLM ℂ c f) = + multiply c (schwartzCoord 0 f) := by + apply l2_injective + simp only [Lp.toTemperedDistributionCLM_apply] + rw [schwartzCoord_distribution, schwartz_temperate_product_distribution hc, + besselPotential_zero, ContinuousLinearMap.id_apply, + multiply_distribution c hc, schwartzCoord_distribution, + besselPotential_zero, ContinuousLinearMap.id_apply] + rw [he] + exact multiply_norm_le _ _ + +lemma coreBound_product_zero (κ : 𝓢(E, ℂ)) : + CoreBound 0 0 (SchwartzMap.smulLeftCLM ℂ κ) := by + refine ⟨‖κ.toBoundedContinuousFunction‖, norm_nonneg _, fun f => ?_⟩ + rw [schwartzCoord_product_zero] + exact multiply_norm_le _ _ + +lemma coreBound_product_word (ws : List E) (κ : 𝓢(E, ℂ)) {s : ℝ} + (hws : (ws.length : ℝ) ≤ s) : + CoreBound s 0 (fun f => schwartzWord ws (SchwartzMap.smulLeftCLM ℂ κ f)) := by + induction ws generalizing κ s with + | nil => exact (coreBound_product_zero κ).comp (CoreBound.id (by simpa using hws)) + | cons w ws ih => + have hw : (ws.length : ℝ) + 1 ≤ s := by + simpa only [List.length_cons, Nat.cast_add, Nat.cast_one] using hws + have hfirst := ih (∂_{w} κ) (s := s) (by linarith) + have hrest := (ih κ (s := s - 1) (by linarith)).comp + (coreBound_deriv w (s := s) (t := s - 1) le_rfl) + convert hfirst.add hrest using 1 + funext f + change ∂_{w} (schwartzWord ws (SchwartzMap.smulLeftCLM ℂ κ f)) = _ + rw [← GlobalElliptic.word_deriv_comm, schwartz_deriv_product, map_add] + rfl + +lemma coreBound_product_integer (κ : 𝓢(E, ℂ)) (k : ℕ) : + CoreBound (k : ℝ) (k : ℝ) (SchwartzMap.smulLeftCLM ℂ κ) := by + have hh := coreBound_of_words_integer k (s := (k : ℝ)) (t := 0) + (SchwartzMap.smulLeftCLM ℂ κ) + (fun ws hw => coreBound_product_word ws κ (by exact_mod_cast hw)) + simpa only [zero_add] using hh + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma schwartz_second_product (v w : E) (κ f : 𝓢(E, ℂ)) : + ∂_{v} (∂_{w} (SchwartzMap.smulLeftCLM ℂ κ f)) = + SchwartzMap.smulLeftCLM ℂ κ (∂_{v} (∂_{w} f)) + + (SchwartzMap.smulLeftCLM ℂ (∂_{v} κ : 𝓢(E, ℂ)) (∂_{w} f) + + SchwartzMap.smulLeftCLM ℂ (∂_{w} κ : 𝓢(E, ℂ)) (∂_{v} f) + + SchwartzMap.smulLeftCLM ℂ (∂_{v} (∂_{w} κ) : 𝓢(E, ℂ)) f) := by + rw [schwartz_deriv_product, lineDerivOp_add, schwartz_deriv_product, schwartz_deriv_product] + abel + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma schwartz_product_assoc {c : E → ℂ} (hc : c.HasTemperateGrowth) (κ f : 𝓢(E, ℂ)) : + SchwartzMap.smulLeftCLM ℂ c (SchwartzMap.smulLeftCLM ℂ κ f) = + SchwartzMap.smulLeftCLM ℂ (SchwartzMap.smulLeftCLM ℂ c κ : 𝓢(E, ℂ)) f := by + ext x + simp only [SchwartzMap.smulLeftCLM_apply_apply hc, + SchwartzMap.smulLeftCLM_apply_apply κ.hasTemperateGrowth, + SchwartzMap.smulLeftCLM_apply_apply (SchwartzMap.smulLeftCLM ℂ c κ).hasTemperateGrowth, + smul_eq_mul, mul_assoc] + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma schwartz_product_comm {c : E → ℂ} (hc : c.HasTemperateGrowth) (κ f : 𝓢(E, ℂ)) : + SchwartzMap.smulLeftCLM ℂ c (SchwartzMap.smulLeftCLM ℂ κ f) = + SchwartzMap.smulLeftCLM ℂ κ (SchwartzMap.smulLeftCLM ℂ c f) := by + ext x + simp only [SchwartzMap.smulLeftCLM_apply_apply hc, + SchwartzMap.smulLeftCLM_apply_apply κ.hasTemperateGrowth, smul_eq_mul] + ring +end SobolevChart + +namespace MetricLocalization +open EllipticKernel SobolevChart +variable {n : ℕ} + +lemma schwartzDifferential_bound + (c : BasisIndex n → BasisIndex n → EC n →ᵇ ℂ) + (hc : ∀ i j, (c i j : EC n → ℂ).HasTemperateGrowth) : + CoreBound 2 0 (schwartzDifferential c) := by + change CoreBound 2 0 (fun f => schwartzDifferential c f) + simp only [schwartzDifferential, _root_.sum_apply, + ContinuousLinearMap.comp_apply, lineDerivOpCLM_apply] + apply CoreBound.sum Finset.univ + intro i _ + apply CoreBound.sum Finset.univ + intro j _ + exact (coreBound_coefficient_zero (c i j) (hc i j)).comp + ((coreBound_deriv _ (s := 1) (t := 0) (by norm_num)).comp + (coreBound_deriv _ (s := 2) (t := 1) (by norm_num))) + +lemma schwartzCutoffError_firstOrder + (c : BasisIndex n → BasisIndex n → EC n →ᵇ ℂ) + (hc : ∀ i j, (c i j : EC n → ℂ).HasTemperateGrowth) (κ f : 𝓢(EC n, ℂ)) : + schwartzCutoffError c κ f = ∑ i, ∑ j, + (SchwartzMap.smulLeftCLM ℂ + (SchwartzMap.smulLeftCLM ℂ (c i j) (∂_{stdOrthonormalBasis ℝ (EC n) i} κ) : 𝓢(EC n, ℂ)) + (∂_{stdOrthonormalBasis ℝ (EC n) j} f) + + SchwartzMap.smulLeftCLM ℂ + (SchwartzMap.smulLeftCLM ℂ (c i j) (∂_{stdOrthonormalBasis ℝ (EC n) j} κ) : 𝓢(EC n, ℂ)) + (∂_{stdOrthonormalBasis ℝ (EC n) i} f) + + SchwartzMap.smulLeftCLM ℂ + (SchwartzMap.smulLeftCLM ℂ (c i j) + (∂_{stdOrthonormalBasis ℝ (EC n) i} (∂_{stdOrthonormalBasis ℝ (EC n) j} κ)) : 𝓢(EC n, ℂ)) f) := by + simp only [schwartzCutoffError, schwartzDifferential, _root_.sub_apply, + _root_.sum_apply, ContinuousLinearMap.comp_apply, lineDerivOpCLM_apply, + map_sum, ← Finset.sum_sub_distrib] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + rw [schwartz_second_product] + simp only [map_add, schwartz_product_comm (hc i j) κ, + schwartz_product_assoc (hc i j)] + abel + + +theorem schwartzCutoffError_bound_integer + (c : BasisIndex n → BasisIndex n → EC n →ᵇ ℂ) + (hc : ∀ i j, (c i j : EC n → ℂ).HasTemperateGrowth) (κ : 𝓢(EC n, ℂ)) (k : ℕ) : + CoreBound ((k : ℝ) + 1) (k : ℝ) (schwartzCutoffError c κ) := by + change CoreBound ((k : ℝ) + 1) (k : ℝ) (fun f => schwartzCutoffError c κ f) + simp_rw [schwartzCutoffError_firstOrder c hc κ] + apply CoreBound.sum Finset.univ + intro i _ + apply CoreBound.sum Finset.univ + intro j _ + apply CoreBound.add + · apply CoreBound.add + · exact (coreBound_product_integer _ k).comp + (coreBound_deriv _ (s := (k : ℝ) + 1) (t := (k : ℝ)) (by linarith)) + · exact (coreBound_product_integer _ k).comp + (coreBound_deriv _ (s := (k : ℝ) + 1) (t := (k : ℝ)) (by linarith)) + · exact (coreBound_product_integer _ k).comp (CoreBound.id (by linarith)) +end MetricLocalization + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/DerivativeEllipticGain.lean b/lean/OAI/Geometry/PrescribedPotential/DerivativeEllipticGain.lean new file mode 100644 index 0000000000000000000000000000000000000000..2415d45ff9ec3a8c7d54461150aed31c1c2efb44 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/DerivativeEllipticGain.lean @@ -0,0 +1,101 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.NonlinearScale +import OAI.Geometry.PrescribedPotential.WeakNonlinearCommutator +import OAI.Geometry.PrescribedPotential.TwoScaleRegularity + +namespace OAI + +/-! Derivative Elliptic Gain. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) +local instance (s : ℝ) : NormedAddCommGroup (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedAddCommGroup +local instance (s : ℝ) : NormedSpace ℝ (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedSpace +local instance (s : ℝ) : IsTopologicalAddGroup (D.localizers.RealSobolev s) := + Submodule.isTopologicalAddGroup _ +local instance (s : ℝ) : ContinuousSMul ℝ (D.localizers.RealSobolev s) := + SMulMemClass.continuousSMul _ + +omit [ConnectedSpace X] in +lemma nonlinear_commutator_solution (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (p : ι) (v : EC d) (u : D.localizers.RealSobolev (((k+1 : ℕ) : ℝ)+2)) + (F : RealSmooth A) + (hF : D.realVolume (k+1) (by omega) u = D.localizers.realEmbed ((k+1 : ℕ) : ℝ) F) : + D.realVolumeDerivative k hk + (D.localizers.realLower (((k+1 : ℕ) : ℝ)+2) ((k : ℝ)+2) (by push_cast; linarith) u) + (D.potentialDerivative k p v u) = + D.localizers.realLower ((k+1 : ℕ) : ℝ) (k : ℝ) (by push_cast; linarith) + (D.localizers.realEmbed ((k+1 : ℕ) : ℝ) (D.realLocalizedDerivative p v F) + + D.realNonlinearRemainder (k+1) (by omega) p v u) := by + have hh := D.nonlinear_commutator_weak k hk p v u + rw [hF,D.densityDerivative_embed] at hh + rw [hh] + rw [map_add,Localizers.realLower_embed] + +omit [ConnectedSpace X] in +lemma linearizedVolume_apply_zero_scalar (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (x₀ : X) (u w : D.localizers.RealSobolev ((k : ℝ)+2)) : + D.linearizedVolume k hk x₀ u (w,0) = + (D.realVolumeDerivative k hk u w, D.realEvaluation ((k : ℝ)+2) x₀ w) := by + rw [D.linearizedVolume_apply] + simp only [map_zero,sub_zero] + + + +theorem nonlinear_first_derivative_gain (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (x₀ : X) : + ∀ᶠ u in 𝓝 (0 : D.localizers.RealSobolev (((k+1 : ℕ) : ℝ)+2)), + ∀ (F : RealSmooth A), + D.realVolume (k+1) (by omega) u = D.localizers.realEmbed ((k+1 : ℕ) : ℝ) F → + ∀ (p : ι) (v : EC d), + ∃ w : D.localizers.RealSobolev (((k+1 : ℕ) : ℝ)+2), + D.localizers.realLower (((k+1 : ℕ) : ℝ)+2) ((k : ℝ)+2) + (by push_cast; linarith) w = D.potentialDerivative k p v u := by + let : NormedAddCommGroup (D.localizers.RealSobolev (((k+1 : ℕ) : ℝ)+2)) := inferInstance + let : NormedSpace ℝ (D.localizers.RealSobolev (((k+1 : ℕ) : ℝ)+2)) := inferInstance + let : NormedAddCommGroup (D.localizers.RealSobolev ((k : ℝ)+2)) := inferInstance + let : NormedSpace ℝ (D.localizers.RealSobolev ((k : ℝ)+2)) := inferInstance + let : NormedAddCommGroup (D.localizers.RealSobolev ((k+1 : ℕ) : ℝ)) := inferInstance + let : NormedSpace ℝ (D.localizers.RealSobolev ((k+1 : ℕ) : ℝ)) := inferInstance + let : NormedAddCommGroup (D.localizers.RealSobolev (k : ℝ)) := inferInstance + let : NormedSpace ℝ (D.localizers.RealSobolev (k : ℝ)) := inferInstance + filter_upwards [D.linearizedVolume_local_gain (k+1) k (by omega) hk (by omega) x₀] + with u hu + intro F hF p v + let w : D.localizers.RealSobolev ((k : ℝ)+2) × ℝ := (D.potentialDerivative k p v u,0) + let f : D.localizers.RealSobolev ((k+1 : ℕ) : ℝ) × ℝ := + (D.localizers.realEmbed ((k+1 : ℕ) : ℝ) (D.realLocalizedDerivative p v F) + + D.realNonlinearRemainder (k+1) (by omega) p v u, + D.realEvaluation ((k : ℝ)+2) x₀ (D.potentialDerivative k p v u)) + have he : D.linearizedVolume k hk x₀ + (D.localizers.realLower (((k+1 : ℕ) : ℝ)+2) ((k : ℝ)+2) (by push_cast; linarith) u) w = + D.pairLower ((k+1 : ℕ) : ℝ) (k : ℝ) (by push_cast; linarith) f := by + change D.linearizedVolume k hk x₀ _ (D.potentialDerivative k p v u,0) = _ + rw [D.linearizedVolume_apply_zero_scalar,D.pairLower_apply] + apply Prod.ext + · exact D.nonlinear_commutator_solution k hk p v u F hF + · rfl + obtain ⟨z,hz,_⟩ := hu w f he + refine ⟨z.1,?_⟩ + exact congrArg Prod.fst hz + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/DerivativeLocalization.lean b/lean/OAI/Geometry/PrescribedPotential/DerivativeLocalization.lean new file mode 100644 index 0000000000000000000000000000000000000000..36a197a60d81bc7e6952dfe4272214f11a762ac7 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/DerivativeLocalization.lean @@ -0,0 +1,138 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.LocalizedDerivations + +namespace OAI + +/-! Derivative Localization. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory TemperedDistribution LineDeriv +open scoped ContDiff SchwartzMap Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] + +lemma localize_tsupport_image (q : Fin A.count) (ρ : Smooth A) + (hρ : tsupport (ρ : X → ℂ) ⊆ (A.euclideanChart q).source) (f : Smooth A) : + tsupport (localize A q ρ hρ f : EC d → ℂ) ⊆ + (A.euclideanChart q) '' tsupport (ρ : X → ℂ) := by + apply closure_minimal (localizeFun_support A q ρ f) + exact ((isClosed_tsupport _).isCompact.image_of_continuousOn + ((A.euclideanChart q).continuousOn.mono hρ)).isClosed + +lemma schwartz_derivative_zero_of_not_tsupport (f : 𝓢(EC d,ℂ)) (v : EC d) {y : EC d} + (hy : y ∉ tsupport (f : EC d → ℂ)) : (∂_{v} f : 𝓢(EC d,ℂ)) y = 0 := by + rw [SchwartzMap.lineDerivOp_apply_eq_fderiv, + (notMem_tsupport_iff_eventuallyEq.mp hy).fderiv_eq] + simp + +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +lemma localizedDerivative_zero_off_function (p : ι) (v : EC d) (f : Smooth A) {x : X} + (hx : x ∉ tsupport (f : X → ℂ)) : D.localizedDerivative p v f x = 0 := by + rw [D.localizedDerivative_apply] + split_ifs with hs + · have ht := (A.euclideanChart (D.patch p).index).mapsTo hs + have hc : Tendsto (A.euclideanChart (D.patch p).index).symm + (𝓝 (A.euclideanChart (D.patch p).index x)) (𝓝 x) := by + simpa only [(A.euclideanChart (D.patch p).index).left_inv hs] using + ((A.euclideanChart (D.patch p).index).symm.continuousAt ht).tendsto + have hh := (notMem_tsupport_iff_eventuallyEq.mp hx).comp_tendsto hc + rw [hh.fderiv_eq] + simp + · rfl + +lemma localizedDerivative_function_tsupport (p : ι) (v : EC d) (f : Smooth A) : + tsupport (D.localizedDerivative p v f : X → ℂ) ⊆ tsupport (f : X → ℂ) := by + apply closure_minimal _ (isClosed_tsupport _) + intro x hx + by_contra hh + exact hx (D.localizedDerivative_zero_off_function p v f hh) + +lemma derivativeWeight_support (p : ι) (v : EC d) : + tsupport (D.localizedDerivative p v (D.localizers.weight p) : X → ℂ) ⊆ + (A.euclideanChart (D.patch p).index).source := by + exact (D.localizedDerivative_function_tsupport p v _).trans + (by rw [← D.index_eq]; exact D.localizers.support_sub p) + +lemma forcing_derivative (p : ι) (v : EC d) (f : Smooth A) : + (∂_{v} (D.forcing p f) : 𝓢(EC d,ℂ)) = + localize A (D.patch p).index (D.localizedDerivative p v (D.localizers.weight p)) + (D.derivativeWeight_support p v) f + D.forcing p (D.localizedDerivative p v f) := by + let q := (D.patch p).index + let e := A.euclideanChart q + let ρ := D.localizers.weight p + have hρ : tsupport (ρ : X → ℂ) ⊆ e.source := by + change tsupport (D.localizers.weight p : X → ℂ) ⊆ + (A.euclideanChart (D.patch p).index).source + rw [← D.index_eq] + exact D.localizers.support_sub p + have heq (h : Smooth A) : D.forcing p h = localize A q ρ hρ h := by + unfold forcing + simp only [D.index_eq] + rfl + ext y + by_cases hy : y ∈ e '' tsupport (ρ : X → ℂ) + · obtain ⟨x,hx,rfl⟩ := hy + have hs := hρ hx + have ht := e.mapsTo hs + have hf : (D.forcing p f : EC d → ℂ) =ᶠ[𝓝 (e x)] + (fun y => ρ (e.symm y) * f (e.symm y)) := by + filter_upwards [e.open_target.mem_nhds ht] with z hz + rw [heq,localize_apply,localizeFun_apply A ρ f hz] + have hdρ := ((ρ.smooth q).contDiffAt (e.open_target.mem_nhds ht)).differentiableAt (by simp) + have hdf := ((f.smooth q).contDiffAt (e.open_target.mem_nhds ht)).differentiableAt (by simp) + change DifferentiableAt ℝ (fun y => ρ (e.symm y)) (e x) at hdρ + change DifferentiableAt ℝ (fun y => f (e.symm y)) (e x) at hdf + have hloc (σ : Smooth A) + (hσ : tsupport (σ : X → ℂ) ⊆ e.source) (fh : Smooth A) : + localize A q σ hσ fh (e x) = σ x * fh x := by + rw [localize_apply,localizeFun_apply A σ fh ht,e.left_inv hs] + rw [SchwartzMap.lineDerivOp_apply_eq_fderiv,hf.fderiv_eq, + fderiv_fun_mul hdρ hdf] + change ρ (e.symm (e x)) * fderiv ℝ (fun y => f (e.symm y)) (e x) v + + f (e.symm (e x)) * fderiv ℝ (fun y => ρ (e.symm y)) (e x) v = + localize A q (D.localizedDerivative p v ρ) (D.derivativeWeight_support p v) f (e x) + + D.forcing p (D.localizedDerivative p v f) (e x) + rw [hloc,heq,hloc,e.left_inv hs,D.localizedDerivative_apply, + D.localizedDerivative_apply] + have hs' : x ∈ (A.euclideanChart (D.patch p).index).source := hs + simp only [ite_eq_left hs'] + change _ = (D.cutoff p).realPart (e x) * + fderiv ℝ (fun y => ρ (e.symm y)) (e x) v * f x + + ρ x * ((D.cutoff p).realPart (e x) * fderiv ℝ (fun y => f (e.symm y)) (e x) v) + rw [ChartCutoff.realPart_apply,D.cutoff_one p x hx] + simp only [Complex.one_re,Complex.ofReal_one,one_mul] + ring + · have hz : y ∉ tsupport (D.forcing p f : EC d → ℂ) := by + rw [heq] + exact fun hh => hy (localize_tsupport_image q ρ hρ f hh) + rw [schwartz_derivative_zero_of_not_tsupport _ v hz] + have hz₁ : localize A q (D.localizedDerivative p v ρ) (D.derivativeWeight_support p v) f y = 0 := by + apply image_eq_zero_of_notMem_tsupport + intro hh + apply hy + obtain ⟨x,hx,hxy⟩ := localize_tsupport_image q (D.localizedDerivative p v ρ) + (D.derivativeWeight_support p v) f hh + exact ⟨x,D.localizedDerivative_function_tsupport p v ρ hx,hxy⟩ + have hz₂ : D.forcing p (D.localizedDerivative p v f) y = 0 := by + rw [heq] + apply image_eq_zero_of_notMem_tsupport + exact fun hh => hy (localize_tsupport_image q ρ hρ _ hh) + change 0 = localize A q (D.localizedDerivative p v ρ) (D.derivativeWeight_support p v) f y + + D.forcing p (D.localizedDerivative p v f) y + rw [hz₁,hz₂,add_zero] + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/DeterminantOrder.lean b/lean/OAI/Geometry/PrescribedPotential/DeterminantOrder.lean new file mode 100644 index 0000000000000000000000000000000000000000..ef6b6c0b90cd6dd280bdd00152051d01335a9c3f --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/DeterminantOrder.lean @@ -0,0 +1,62 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.AnalyticSupport + +namespace OAI + +/-! Determinant Order. -/ + +section + + + +noncomputable section +open Matrix Filter Set +open scoped ComplexOrder MatrixOrder Classical +namespace MongeAmpere +variable {n : Type*} [Fintype n] [DecidableEq n] + +lemma hasDerivAt_det_real_shift (A B : Matrix n n ℂ) (t : ℝ) + (ht : (A + (t : ℂ) • B).PosDef) : + HasDerivAt (fun s : ℝ => (A + (s : ℂ) • B).det.re) + ((A + (t : ℂ) • B).det * ((A + (t : ℂ) • B)⁻¹ * B).trace).re t := by + have hd := (hasDerivAt_det_add_smul (A + (t : ℂ) • B) B + (isUnit_iff_ne_zero.mpr ht.det_pos.ne')).real_of_complex + have hc := hd.comp_of_eq t ((hasDerivAt_id t).sub_const t) (by simp) + simp only [mul_one] at hc + apply hc.congr_of_eventuallyEq + filter_upwards [] with s + dsimp only [Function.comp_apply, id_eq] + simp only [Complex.ofReal_sub, sub_smul] + congr 2 + abel + +lemma det_re_add_posSemidef (A B : Matrix n n ℂ) (hA : A.PosDef) (hB : B.PosSemidef) : + A.det.re ≤ (A+B).det.re := by + let f : ℝ → ℝ := fun t => (A + (t : ℂ) • B).det.re + have hp (t : ℝ) (ht : 0 ≤ t) : (A + (t : ℂ) • B).PosDef := + hA.add_posSemidef (hB.smul (Complex.nonneg_iff.mpr ⟨ht,rfl⟩)) + have hd (t : ℝ) (ht : 0 ≤ t) := hasDerivAt_det_real_shift A B t (hp t ht) + have hm : MonotoneOn f (Icc 0 1) := by + apply monotoneOn_of_deriv_nonneg (convex_Icc 0 1) + · intro t ht + exact (hd t ht.1).continuousAt.continuousWithinAt + · intro t ht + exact (hd t (interior_subset ht).1).differentiableAt.differentiableWithinAt + · intro t ht + rw [(hd t (interior_subset ht).1).deriv] + have hdet := Complex.pos_iff.mp (hp t (interior_subset ht).1).det_pos + rw [Complex.mul_re, hdet.2.symm, zero_mul, sub_zero] + exact mul_nonneg hdet.1.le (EllipticKernel.trace_mul_nonneg + (hp t (interior_subset ht).1).inv.posSemidef hB) + simpa [f] using hm (show (0 : ℝ) ∈ Icc 0 1 by constructor <;> norm_num) + (show (1 : ℝ) ∈ Icc 0 1 by constructor <;> norm_num) (by norm_num) + +lemma det_re_mono {A B : Matrix n n ℂ} (hA : A.PosDef) (hBA : (B-A).PosSemidef) : + A.det.re ≤ B.det.re := by + simpa using det_re_add_posSemidef A (B-A) hA hBA +end MongeAmpere + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/DirectionalJetEnergy.lean b/lean/OAI/Geometry/PrescribedPotential/DirectionalJetEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..8eac68b88ab0d8b2fdf1a41fed6d1dcf5387ca17 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/DirectionalJetEnergy.lean @@ -0,0 +1,73 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.JetNormEquivalence +import OAI.Geometry.PrescribedPotential.RealJetEnergy + +namespace OAI + +/-! Directional Jet Energy. -/ + +section + + +noncomputable section +open Set Filter Topology Finset Module +open scoped ContDiff +namespace HigherJet +variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [InnerProductSpace ℝ F] + {ι : Type*} [Fintype ι] + +def jetFamily (e : ι → E) (m : ℕ) (u : E → F) (σ : Fin m → ι) : E → F := + word (List.ofFn (fun i => e (σ i))) u + +def jetEnergy (e : ι → E) (m : ℕ) (u : E → F) : E → ℝ := + familyEnergy (jetFamily e m u) + +omit [Fintype ι] in +lemma jetFamily_smoothOn {U : Set E} (hU : IsOpen U) {u : E → F} + (hu : ContDiffOn ℝ ∞ u U) (e : ι → E) (m : ℕ) (σ : Fin m → ι) : + ContDiffOn ℝ ∞ (jetFamily e m u σ) U := word_smoothOn hU hu _ + +lemma jetEnergy_smoothOn {U : Set E} (hU : IsOpen U) {u : E → F} + (hu : ContDiffOn ℝ ∞ u U) (e : ι → E) (m : ℕ) : + ContDiffOn ℝ ∞ (jetEnergy e m u) U := familyEnergy_smoothOn (jetFamily_smoothOn hU hu e m) + +lemma jetEnergy_nonneg (e : ι → E) (m : ℕ) (u : E → F) (x : E) : + 0 ≤ jetEnergy e m u x := Finset.sum_nonneg (fun _ _ => sq_nonneg _) + +lemma jetArray_energy {U : Set E} (hU : IsOpen U) {u : E → F} + (hu : ContDiffOn ℝ ∞ u U) (e : ι → E) (m : ℕ) {x : E} (hx : x ∈ U) : + ‖jetArray e m (iteratedFDeriv ℝ m u x)‖^2 = jetEnergy e m u x := by + rw [PiLp.norm_sq_eq_of_L2] + apply Finset.sum_congr rfl + intro σ _ + congr 1 + exact congrArg norm (word_ofFn_eq hU hu m (fun i => e (σ i)) hx).symm + +lemma norm_iteratedFDeriv_le_jetEnergy [FiniteDimensional ℝ E] [FiniteDimensional ℝ F] + (e : Basis ι ℝ E) (m : ℕ) : + ∃ C : ℝ, 0 < C ∧ ∀ (U : Set E), IsOpen U → ∀ u : E → F, ContDiffOn ℝ ∞ u U → + ∀ x ∈ U, ‖iteratedFDeriv ℝ m u x‖ ≤ C*Real.sqrt (jetEnergy e m u x) := by + obtain ⟨C,hC,hb⟩ := jetArray_norm_control (F := F) e m + refine ⟨C,hC,fun U hU u hu x hx => ?_⟩ + have he : Real.sqrt (jetEnergy e m u x) = ‖jetArray e m (iteratedFDeriv ℝ m u x)‖ := by + rw [← jetArray_energy hU hu e m hx,Real.sqrt_sq (norm_nonneg _)] + rw [he] + exact hb _ + +lemma family_laplace_norm_bound {κ : Type*} [Fintype κ] + {v : ι → E} {f : κ → E → F} {x : E} {C : ℝ} (hC : 0 ≤ C) + (hb : ∀ j, ‖frameLaplace v (f j) x‖ ≤ C) : + Real.sqrt (∑ j, ‖frameLaplace v (f j) x‖^2) ≤ (Fintype.card κ+1)*C := by + apply (Real.sqrt_le_iff).mpr + refine ⟨by positivity,?_⟩ + calc + _ ≤ ∑ _j : κ, C^2 := Finset.sum_le_sum (fun j _ => pow_le_pow_left₀ (norm_nonneg _) (hb j) 2) + _ = (Fintype.card κ : ℝ)*C^2 := by simp + _ ≤ _ := by nlinarith [mul_nonneg (sq_nonneg C) (sq_nonneg (Fintype.card κ : ℝ))] +end HigherJet + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/EncodedMetricEquation.lean b/lean/OAI/Geometry/PrescribedPotential/EncodedMetricEquation.lean new file mode 100644 index 0000000000000000000000000000000000000000..b128ed3026802235d6e272d6469d031f6869d7a5 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/EncodedMetricEquation.lean @@ -0,0 +1,77 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CalabiConnection +import OAI.Geometry.PrescribedPotential.MetricQuasilinearEquation +import OAI.Geometry.PrescribedPotential.PrincipalComponents +import OAI.Geometry.PrescribedPotential.QuasilinearJetBasics + +namespace OAI + +/-! Encoded Metric Equation. -/ + +section + +noncomputable section +open Set Filter Topology Matrix Finset +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace MetricSystem +open EllipticKernel FrozenPoisson HigherJet KaehlerCalculus +variable {n : ℕ} +local instance equationRealHMIP : InnerProductSpace ℝ (HM n) := InnerProductSpace.rclikeToReal ℂ (HM n) +local instance equationRealECIP : InnerProductSpace ℝ (EC n) := InnerProductSpace.rclikeToReal ℂ (EC n) + +lemma encoded_W {M : V n → Mat n} {z : V n} (hM : ContDiffAt ℝ ∞ M z) + (a : ℂ) (v : V n) : + W a v (fderiv ℝ (fun x => encode n (M (coordinateEquiv n x))) ((coordinateEquiv n).symm z)) = + mderiv a v M z := by + have hd := ((encode n).hasFDerivAt.comp ((coordinateEquiv n).symm z) + (((by simpa only [ContinuousLinearEquiv.apply_symm_apply] using hM : + ContDiffAt ℝ ∞ M (coordinateEquiv n ((coordinateEquiv n).symm z))).differentiableAt (by simp)).hasFDerivAt.comp + ((coordinateEquiv n).symm z) (coordinateEquiv n).hasFDerivAt)) + have hd' := hd.fderiv + simp only [Function.comp_def] at hd' + have hw := congrArg (W a v) hd' + calc + _ = _ := hw + _ = _ := by + rw [mderiv_eq hM] + simp only [W,ContinuousLinearMap.comp_apply,ContinuousLinearEquiv.coe_coe, + ContinuousLinearEquiv.apply_symm_apply] + change (1/2:ℂ) • ((encode n).symm (encode n ((fderiv ℝ M z) v))+a • (encode n).symm (encode n ((fderiv ℝ M z) (Complex.I • v)))) = _ + rw [ContinuousLinearEquiv.symm_apply_apply,ContinuousLinearEquiv.symm_apply_apply] + +lemma encoded_quadratic {M : V n → Mat n} {z : V n} (hM : ContDiffAt ℝ ∞ M z) : + quadraticCoefficient (encode n (M z), fderiv ℝ (fun y => encode n (M (coordinateEquiv n y))) ((coordinateEquiv n).symm z)) = + encode n (∑ i, ∑ j, (M z)⁻¹ i j • (mderiv Complex.I (e j) M z*(M z)⁻¹*mderiv (-Complex.I) (e i) M z)) := by + unfold quadraticCoefficient + simp only [inverseCoefficient,ContinuousLinearEquiv.symm_apply_apply] + apply congrArg (encode n) + apply sum_congr rfl + intro i _ + apply sum_congr rfl + intro j _ + rw [encoded_W hM,encoded_W hM] + +local instance equationHessianNorm : NormedAddCommGroup (EC n →L[ℝ] EC n →L[ℝ] HM n) := inferInstance +local instance equationHessianSpace : NormedSpace ℝ (EC n →L[ℝ] EC n →L[ℝ] HM n) := inferInstance + +lemma encoded_metric_equation {ι : Type*} [Fintype ι] (basis : OrthonormalBasis ι ℝ (EC n)) + (K : LocalKaehlerField n) {x : EC n} (hx : coordinateEquiv n x ∈ K.domain) : + principalBilinear basis (inverseCoefficient (encode n (K.matrix (coordinateEquiv n x)))) + (hessian (fun y => encode n (K.matrix (coordinateEquiv n y))) x) = + encode n (K.ricciHessian (coordinateEquiv n x))+ + quadraticCoefficient (firstJet (fun y => encode n (K.matrix (coordinateEquiv n y))) x) := by + have hK := K.smooth.contDiffAt (K.isOpen.mem_nhds hx) + have he := encoded_principal basis hK (K.positive _ hx) + simp only [ContinuousLinearEquiv.symm_apply_apply] at he + have hQ := encoded_quadratic hK + simp only [ContinuousLinearEquiv.symm_apply_apply] at hQ + change principalBilinear basis (K.matrix (coordinateEquiv n x))⁻¹ + (fderiv ℝ (fderiv ℝ (fun y => encode n (K.matrix (coordinateEquiv n y)))) x) = _ + rw [he,K.metric_quasilinear_equation hx,map_add] + exact congrArg (fun y => encode n (K.ricciHessian (coordinateEquiv n x))+y) hQ.symm +end MetricSystem + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/EvenRellich.lean b/lean/OAI/Geometry/PrescribedPotential/EvenRellich.lean new file mode 100644 index 0000000000000000000000000000000000000000..76d17fa7fc4353e98ef28cf2775cad08735781f8 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/EvenRellich.lean @@ -0,0 +1,104 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CompletedResolvent +import OAI.Geometry.PrescribedPotential.GlobalRellich +import OAI.Geometry.PrescribedPotential.HigherMetricOperator +import OAI.Geometry.PrescribedPotential.HigherResolvent +import OAI.Geometry.PrescribedPotential.QuantitativeResolvent + +namespace OAI + +/-! Even Rellich. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +def shiftedOrder (m : ℝ) (k : ℕ) : + D.localizers.Sobolev ((k : ℝ)+2) →L[ℝ] D.localizers.Sobolev (k : ℝ) := + (m^2 : ℝ) • D.localizers.lower ((k : ℝ)+2) (k : ℝ) - D.completedLOrder k + +lemma shiftedOrder_embed (m : ℝ) (k : ℕ) (f : Smooth A) : + D.shiftedOrder m k (D.localizers.embed ((k : ℝ)+2) f) = + D.localizers.embed (k : ℝ) ((m^2 : ℝ) • f - complexL g f) := by + simp only [shiftedOrder,sub_apply,smul_apply, + D.localizers.lower_embed (by linarith : (k : ℝ) ≤ (k : ℝ)+2), + D.completedLOrder_embed, map_sub, map_smul] + +lemma shiftedOrder_lower (m : ℝ) (k : ℕ) (u : D.localizers.Sobolev ((k : ℝ)+2)) : + D.localizers.lower (k : ℝ) 0 (D.shiftedOrder m k u) = + D.shiftedOperator m (D.localizers.lower ((k : ℝ)+2) 2 u) := by + simp only [shiftedOrder,shiftedOperator,sub_apply, + smul_apply,map_sub,map_smul,D.completedLOrder_lower] + rw [D.localizers.lower_lower (by linarith : (k : ℝ) ≤ (k : ℝ)+2) (Nat.cast_nonneg k), + D.localizers.lower_lower (by linarith [Nat.cast_nonneg (α := ℝ) k] : + (2 : ℝ) ≤ (k : ℝ)+2) (by norm_num : (0 : ℝ) ≤ 2)] + +lemma resolventOrder_left (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (k : ℕ) (R : D.localizers.Sobolev (k : ℝ) →L[ℝ] D.localizers.Sobolev ((k : ℝ)+2)) + (hR : ∀ f, D.localizers.lower ((k : ℝ)+2) 2 (R f) = + D.completedResolvent m hm he (D.localizers.lower (k : ℝ) 0 f)) + (u : D.localizers.Sobolev ((k : ℝ)+2)) : R (D.shiftedOrder m k u) = u := by + apply D.localizers.lower_injective (by linarith [Nat.cast_nonneg (α := ℝ) k] : + (2 : ℝ) ≤ (k : ℝ)+2) + rw [hR,D.shiftedOrder_lower,D.completedResolvent_left] + +lemma lower_resolvent_factor (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (k j : ℕ) (hjk : (j : ℝ) = (k : ℝ)+2) + (R : D.localizers.Sobolev (k : ℝ) →L[ℝ] D.localizers.Sobolev ((k : ℝ)+2)) + (hR : ∀ f, D.localizers.lower ((k : ℝ)+2) 2 (R f) = + D.completedResolvent m hm he (D.localizers.lower (k : ℝ) 0 f)) : + D.localizers.lower ((j : ℝ)+2) (j : ℝ) = + (D.localizers.lower ((k : ℝ)+2) (j : ℝ) ∘L R) ∘L + D.localizers.lower ((k : ℝ)+2) (k : ℝ) ∘L + (D.localizers.lower (j : ℝ) ((k : ℝ)+2) ∘L D.shiftedOrder m j) := by + apply DFunLike.coe_injective + apply (D.localizers.embed_dense ((j : ℝ)+2)).equalizer (by fun_prop) (by fun_prop) + funext f + simp only [ContinuousLinearMap.coe_comp,Function.comp_apply,D.shiftedOrder_embed, + D.localizers.lower_embed (by linarith only [hjk] : (j : ℝ) ≤ (j : ℝ)+2), + D.localizers.lower_embed (by linarith only [hjk] : (k : ℝ)+2 ≤ (j : ℝ)), + D.localizers.lower_embed (by linarith : (k : ℝ) ≤ (k : ℝ)+2)] + rw [← D.shiftedOrder_embed m k,D.resolventOrder_left m hm he k R hR] + exact (D.localizers.lower_embed (by linarith only [hjk] : (j : ℝ) ≤ (k : ℝ)+2) f).symm + +lemma lower_compact_step (k j : ℕ) (hjk : (j : ℝ) = (k : ℝ)+2) + (hK : IsCompactOperator (D.localizers.lower ((k : ℝ)+2) (k : ℝ))) : + IsCompactOperator (D.localizers.lower ((j : ℝ)+2) (j : ℝ)) := by + obtain ⟨m,hm,he⟩ := D.exists_completedError_small + obtain ⟨R,hR⟩ := D.completedResolvent_order m hm he k + rw [D.lower_resolvent_factor m hm he k j hjk R hR] + exact (hK.comp_clm (D.localizers.lower (j : ℝ) ((k : ℝ)+2) ∘L D.shiftedOrder m j)).clm_comp + (D.localizers.lower ((k : ℝ)+2) (j : ℝ) ∘L R) + + + +def CompactLower (s t : ℝ) : Prop := IsCompactOperator (D.localizers.lower s t) + + +theorem lower_even_compact (n : ℕ) : + IsCompactOperator (D.localizers.lower (((2*n : ℕ) : ℝ)+2) ((2*n : ℕ) : ℝ)) := by + change D.CompactLower (((2*n : ℕ) : ℝ)+2) ((2*n : ℕ) : ℝ) + induction n with + | zero => + simp only [mul_zero,Nat.cast_zero,zero_add] + exact D.lower_compact + | succ n ih => + exact D.lower_compact_step (2*n) (2*(n+1)) (by push_cast; ring) ih + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/FamilyBernsteinBootstrap.lean b/lean/OAI/Geometry/PrescribedPotential/FamilyBernsteinBootstrap.lean new file mode 100644 index 0000000000000000000000000000000000000000..7880aa8f3635c19e4412257cefab9c01145cb4b0 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/FamilyBernsteinBootstrap.lean @@ -0,0 +1,109 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.BernsteinEnergyInterior +import OAI.Geometry.PrescribedPotential.CompactSmoothCutoff + +namespace OAI + +/-! Family Bernstein Bootstrap. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff +namespace HigherJet +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] + {ι α : Type*} [Fintype ι] + +def EnergyBound (S : ℕ → α → E → ℝ) (m : ℕ) (K : Set E) : Prop := + ∃ C : ℝ, 0 ≤ C ∧ ∀ a x, x ∈ K → S m a x ≤ C + +lemma family_bernstein_bootstrap {U : Set E} (hU : IsOpen U) + (S D : ℕ → α → E → ℝ) (v : α → E → ι → E) + (hsmooth : ∀ m a, ContDiffOn ℝ ∞ (S m a) U) + (hpos : ∀ m a x, x ∈ U → 0 ≤ S m a x ∧ 0 ≤ D m a x) + (hgrad : ∀ m a x, x ∈ U → ‖frameGradient (v a x) (S m a) x‖^2 ≤ 4*S m a x*D m a x) + (hframes : ∀ K, IsCompact K → K ⊆ U → ∃ B : ℝ, 0 ≤ B ∧ ∀ a x, x ∈ K → ∀ i, ‖v a x i‖ ≤ B) + (hcoerce : ∀ m, 1 ≤ m → ∀ K, IsCompact K → K ⊆ U → ∃ A : ℝ, 1 ≤ A ∧ + ∀ a x, x ∈ K → S (m+1) a x ≤ A*D m a x ∧ D m a x ≤ A*S (m+1) a x) + (hfirst : ∀ K, IsCompact K → K ⊆ U → EnergyBound S 1 K) + (hbounded : ∀ m, 1 ≤ m → ∀ K, IsCompact K → K ⊆ U → + (∀ j, 1 ≤ j → j ≤ m → EnergyBound S j K) → + ∃ R : ℝ, 0 ≤ R ∧ ∀ a x, x ∈ K → D m a x-R ≤ frameLaplace (v a x) (S m a) x) + (hcubic : ∀ K, IsCompact K → K ⊆ U → ∃ R : ℝ, 0 ≤ R ∧ ∀ a x, x ∈ K → + -R*(1+S 2 a x*Real.sqrt (S 2 a x)) ≤ frameLaplace (v a x) (S 2 a) x) + (hlinear : ∀ m, 3 ≤ m → ∀ K, IsCompact K → K ⊆ U → + (∀ j, 1 ≤ j → j < m → EnergyBound S j K) → + ∃ R : ℝ, 0 ≤ R ∧ ∀ a x, x ∈ K → + D m a x-R*(1+S m a x) ≤ frameLaplace (v a x) (S m a) x) : + ∀ m, 1 ≤ m → ∀ K, IsCompact K → K ⊆ U → EnergyBound S m K := by + intro m + induction m using Nat.strong_induction_on with + | h m ih => + intro hm K hK hKU + by_cases hm1 : m=1 + · subst m + exact hfirst K hK hKU + obtain ⟨L,χ,hL,hLU,hKL,hχ,hχval,hχone,hχint⟩ := compact_smooth_cutoff hK hU hKU + obtain ⟨B,hB,hv⟩ := hframes L hL hLU + have hχvals : ∀ x ∈ L, 0 ≤ χ x ∧ χ x ≤ 1 := fun x _ => hχval x + by_cases hm2 : m=2 + · subst m + obtain ⟨A,hA,hctrl⟩ := hcoerce 1 le_rfl L hL hLU + obtain ⟨R0,hR0,hSb⟩ := hfirst L hL hLU + obtain ⟨R1,hR1,hLS⟩ := hbounded 1 le_rfl L hL hLU (fun j hj hj1 => by + have he : j=1 := by omega + subst j + exact hfirst L hL hLU) + obtain ⟨R2,hR2,hLT⟩ := hcubic L hL hLU + let R := 1+R0+R1+R2 + have hR : 1 ≤ R := by dsimp [R]; linarith + have hr0 : R0 ≤ R := by dsimp [R]; linarith + have hr1 : R1 ≤ R := by dsimp [R]; linarith + have hr2 : R2 ≤ R := by dsimp [R]; linarith + obtain ⟨C,hC,hbound⟩ := quartic_energy_interior (ι := ι) hL hU hLU hχ hχvals hχint hA hR hB + refine ⟨C,hC,fun a z hz => hbound (S 1 a) (S 2 a) (hsmooth 1 a) (hsmooth 2 a) (v a) + (fun x hx => hv a x hx) ?_ ?_ z (hKL hz) (hχone z hz)⟩ + · intro x hx + exact ⟨(hpos 1 a x (hLU hx)).1,(hSb a x hx).trans hr0,(hpos 2 a x (hLU hx)).1⟩ + · intro x hx + have hc := hctrl a x hx + refine ⟨D 1 a x,(hpos 1 a x (hLU hx)).2,hc.1,hc.2,?_,?_,hgrad 1 a x (hLU hx)⟩ + · linarith only [hLS a x hx,hr1] + · have hq := mul_le_mul_of_nonneg_right hr2 + (show 0 ≤ 1+S 2 a x*Real.sqrt (S 2 a x) by have := (hpos 2 a x (hLU hx)).1; positivity) + nlinarith only [hq,hLT a x hx] + · have hm3 : 3 ≤ m := by omega + have hiL : ∀ j, 1 ≤ j → j < m → EnergyBound S j L := fun j hj hjm => ih j hjm hj L hL hLU + have hpred : 1 ≤ m-1 := by omega + have he : m-1+1=m := by omega + obtain ⟨A,hA,hctrl⟩ := hcoerce (m-1) hpred L hL hLU + obtain ⟨R0,hR0,hSb⟩ := hiL (m-1) hpred (by omega) + obtain ⟨R1,hR1,hLS⟩ := hbounded (m-1) hpred L hL hLU + (fun j hj hjm => hiL j hj (by omega)) + obtain ⟨R2,hR2,hLT⟩ := hlinear m hm3 L hL hLU hiL + let R := 1+R0+R1+R2 + have hR : 1 ≤ R := by dsimp [R]; linarith + have hr0 : R0 ≤ R := by dsimp [R]; linarith + have hr1 : R1 ≤ R := by dsimp [R]; linarith + have hr2 : R2 ≤ R := by dsimp [R]; linarith + obtain ⟨C,hC,hbound⟩ := linear_energy_interior (ι := ι) hL hU hLU hχ hχvals hχint hA hR hB + refine ⟨C,hC,fun a z hz => hbound (S (m-1) a) (S m a) (hsmooth (m-1) a) (hsmooth m a) (v a) + (fun x hx => hv a x hx) ?_ ?_ z (hKL hz) (hχone z hz)⟩ + · intro x hx + exact ⟨(hpos (m-1) a x (hLU hx)).1,(hSb a x hx).trans hr0,(hpos m a x (hLU hx)).1⟩ + · intro x hx + have hc := (hctrl a x hx).1 + rw [he] at hc + refine ⟨D (m-1) a x,D m a x,(hpos (m-1) a x (hLU hx)).2,(hpos m a x (hLU hx)).2,hc,?_,?_,hgrad m a x (hLU hx)⟩ + · linarith only [hLS a x hx,hr1] + · have hq := mul_le_mul_of_nonneg_right hr2 (show 0 ≤ 1+S m a x by linarith [(hpos m a x (hLU hx)).1]) + linarith only [hq,hLT a x hx] +end HigherJet + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/FiniteSobolevEmbedding.lean b/lean/OAI/Geometry/PrescribedPotential/FiniteSobolevEmbedding.lean new file mode 100644 index 0000000000000000000000000000000000000000..976b1fcd19b5a3355370638af48dcf2b4cbb9f78 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/FiniteSobolevEmbedding.lean @@ -0,0 +1,90 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CircleRadialCalculus +import OAI.Geometry.PrescribedPotential.StrongSobolevEmbedding + +namespace OAI + +/-! Finite Sobolev Embedding. -/ + +section + + + +noncomputable section +open Set Filter Topology MeasureTheory FourierTransform TemperedDistribution +open scoped SchwartzMap BoundedContinuousFunction ContDiff +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +lemma fourier_moment_of_bessel {u : 𝓢'(E, ℂ)} + {v : Lp ℂ 1 (volume : Measure E)} (hv : 𝓕 u = (v : 𝓢'(E,ℂ))) (n : ℕ) + (w : Lp ℂ 1 (volume : Measure E)) + (hw' : smulLeftCLM ℂ (fun x : E => (((1 + ‖x‖ ^ 2) ^ n : ℝ) : ℂ)) + (𝓕 u) = (w : 𝓢'(E, ℂ))) : Integrable (fun x => ‖x‖^n * ‖v x‖) := by + let b := inverseWeight (E := E) n + have hb := b.memLp_top (μ := volume) + have he : (hb.toLp b : Lp ℂ ⊤ volume) • w = v := by + apply (LinearMap.ker_eq_bot.mp (Lp.ker_toTemperedDistributionCLM_eq_bot + (F := ℂ) (E := E) (μ := volume) (p := 1))) + change (((hb.toLp b : Lp ℂ ⊤ volume) • w : Lp ℂ 1 volume) : 𝓢'(E, ℂ)) = (v : 𝓢'(E, ℂ)) + rw [Lp.toTemperedDistribution_smul_eq (inverseWeight_temperate n) hb, + ← hw', smulLeftCLM_smulLeftCLM_apply (by fun_prop) (inverseWeight_temperate n)] + have hc : (fun x : E => (((1 + ‖x‖ ^ 2) ^ n : ℝ) : ℂ)) * (b : E → ℂ) = fun _ => 1 := by + ext x + exact weight_cancel n x + rw [hc, smulLeftCLM_const, one_smul, hv] + have he' : ∀ᵐ x, ((1 + ‖x‖ ^ 2) ^ n : ℝ) * ‖v x‖ = ‖w x‖ := by + have hh := Lp.coeFn_lpSMul (r := 1) (hb.toLp b : Lp ℂ ⊤ volume) w + rw [he] at hh + filter_upwards [hh, hb.coeFn_toLp] with x hx hb' + have hx' : (((1 + ‖x‖ ^ 2) ^ n : ℝ) : ℂ) * v x = w x := by + rw [hx, Pi.smul_apply', hb', smul_eq_mul, ← mul_assoc, weight_cancel, one_mul] + simpa only [norm_mul, Complex.norm_real, Real.norm_eq_abs, + abs_of_nonneg (show 0 ≤ (1 + ‖x‖ ^ 2) ^ n by positivity)] using congrArg norm hx' + apply (L1.integrable_coeFn w).norm.mono' + (((continuous_norm.pow n).aestronglyMeasurable).mul (Lp.aestronglyMeasurable v).norm) + filter_upwards [he'] with x hx + change ‖‖x‖ ^ n * ‖v x‖‖ ≤ ‖w x‖ + rw [Real.norm_of_nonneg (mul_nonneg (pow_nonneg (norm_nonneg x) n) (norm_nonneg (v x))), ← hx] + apply mul_le_mul_of_nonneg_right _ (norm_nonneg _) + apply pow_le_pow_left₀ (norm_nonneg _) + nlinarith [sq_nonneg (‖x‖ - 1 / 2)] + +lemma finite_fourier_moments {s : ℝ} {u : 𝓢'(E,ℂ)} (hu : MemSobolev s 2 u) + (N : ℕ) (hs : (Module.finrank ℝ E : ℝ) < 2*(s - 2*N)) : + ∃ v : Lp ℂ 1 (volume : Measure E), 𝓕 u = (v : 𝓢'(E,ℂ)) ∧ + ∀ n : ℕ, n ≤ N → Integrable (fun x => ‖x‖^n * ‖v x‖) := by + obtain ⟨v,hv⟩ := hu.fourier_memL1 (by linarith [Nat.cast_nonneg (α := ℝ) N]) + refine ⟨v,hv,fun n hn => ?_⟩ + have hm : MemSobolev (s - 2*n) 2 (besselPotential E ℂ (2*n) u) := by + rw [memSobolev_besselPotential_iff] + simpa only [add_sub_cancel] using hu + obtain ⟨w,hw⟩ := hm.fourier_memL1 (by + have hh : (n : ℝ) ≤ N := by exact_mod_cast hn + linarith) + apply fourier_moment_of_bessel hv n w + rw [fourier_besselPotential_eq_smulLeftCLM_fourier_apply] at hw + simpa only [mul_div_cancel_left₀ (n : ℝ) (by norm_num : (2 : ℝ) ≠ 0), + Real.rpow_natCast] using hw + +lemma strongEmbedding_contDiff (s : ℝ) (hs : (Module.finrank ℝ E : ℝ) < 2*s) + (N : ℕ) (hN : (Module.finrank ℝ E : ℝ) < 2*(s - 2*N)) (u : L2 E) : + ContDiff ℝ N (strongEmbedding s hs u : E → ℂ) := by + obtain ⟨v,hv,hm⟩ := finite_fourier_moments (realize_memSobolev s u) N hN + have he : strongEmbedding s hs u = Real.Lp.fourierTransformInv v := by + apply boundedDistribution_injective + rw [strongEmbedding_distribution, boundedDistributionCLM_apply, + fourierInv_L1_distribution, ← hv, fourierInv_fourier_eq] + rw [he] + change ContDiff ℝ N (fun x : E => 𝓕 (v : E → ℂ) (-x)) + have hf : ContDiff ℝ N (𝓕 (v : E → ℂ)) := Real.contDiff_fourier (N := N) (by + intro n hn + exact hm n (by exact_mod_cast hn)) + exact hf.comp contDiff_neg +end SobolevChart + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/FixedScaleBootstrap.lean b/lean/OAI/Geometry/PrescribedPotential/FixedScaleBootstrap.lean new file mode 100644 index 0000000000000000000000000000000000000000..0165e409f2614be06941bbb11f87defd1c8aa780 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/FixedScaleBootstrap.lean @@ -0,0 +1,255 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.NonlinearSobolevGain +import OAI.Geometry.PrescribedPotential.LinearizedCommutator + +namespace OAI + +/-! Fixed Scale Bootstrap. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) +local instance fixedBootNG (s : ℝ) : NormedAddCommGroup (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedAddCommGroup +local instance fixedBootNS (s : ℝ) : NormedSpace ℝ (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedSpace +local instance fixedBootTG (s : ℝ) : IsTopologicalAddGroup (D.localizers.RealSobolev s) := + Submodule.isTopologicalAddGroup _ +local instance fixedBootCS (s : ℝ) : ContinuousSMul ℝ (D.localizers.RealSobolev s) := + SMulMemClass.continuousSMul _ + + + +def LinearizedGain (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (u : D.localizers.RealSobolev (((k+1 : ℕ) : ℝ)+2)) : Prop := + ∀ (w : D.localizers.RealSobolev ((k : ℝ)+2)) + (f : D.localizers.RealSobolev ((k+1 : ℕ) : ℝ)), + D.realVolumeDerivative k hk + (D.localizers.realLower (((k+1 : ℕ) : ℝ)+2) ((k : ℝ)+2) (by push_cast; linarith) u) w = + D.localizers.realLower ((k+1 : ℕ) : ℝ) (k : ℝ) (by push_cast; linarith) f → + ∃ z : D.localizers.RealSobolev (((k+1 : ℕ) : ℝ)+2), + D.localizers.realLower (((k+1 : ℕ) : ℝ)+2) ((k : ℝ)+2) (by push_cast; linarith) z = w + + +lemma linearizedGain_nhds (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (x₀ : X) : + ∀ᶠ u in 𝓝 (0 : D.localizers.RealSobolev (((k+1 : ℕ) : ℝ)+2)), + D.LinearizedGain k hk u := by + filter_upwards [D.linearizedVolume_local_gain (k+1) k (by omega) hk (by omega) x₀] + with u hu + intro w f hf + have he : D.linearizedVolume k hk x₀ + (D.localizers.realLower (((k+1 : ℕ) : ℝ)+2) ((k : ℝ)+2) (by push_cast; linarith) u) + (w,0) = D.pairLower ((k+1 : ℕ) : ℝ) (k : ℝ) (by push_cast; linarith) + (f,D.realEvaluation ((k : ℝ)+2) x₀ w) := by + rw [D.linearizedVolume_apply_zero_scalar,D.pairLower_apply] + exact Prod.ext hf rfl + obtain ⟨z,hz,_⟩ := hu (w,0) (f,D.realEvaluation ((k : ℝ)+2) x₀ w) he + exact ⟨z.1,congrArg Prod.fst hz⟩ + + +omit [ConnectedSpace X] in +lemma linearized_derivative_equation (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (p : ι) (v : EC d) (u : D.localizers.RealSobolev (((k+2 : ℕ) : ℝ)+2)) + (w : D.localizers.RealSobolev (((k+1 : ℕ) : ℝ)+2)) + (f : D.localizers.RealSobolev ((k+2 : ℕ) : ℝ)) + (hf : D.realVolumeDerivative (k+1) (by omega) + (D.localizers.realLower (((k+2 : ℕ) : ℝ)+2) (((k+1 : ℕ) : ℝ)+2) + (by push_cast; linarith) u) w = + D.localizers.realLower ((k+2 : ℕ) : ℝ) ((k+1 : ℕ) : ℝ) (by push_cast; linarith) f) : + let u₁ := D.localizers.realLower (((k+2 : ℕ) : ℝ)+2) (((k+1 : ℕ) : ℝ)+2) + (by push_cast; linarith) u + D.realVolumeDerivative k hk + (D.localizers.realLower (((k+1 : ℕ) : ℝ)+2) ((k : ℝ)+2) (by push_cast; linarith) u₁) + (D.potentialDerivative k p v w) = + D.localizers.realLower ((k+1 : ℕ) : ℝ) (k : ℝ) (by push_cast; linarith) + (D.densityDerivative (k+1) p v f + + (D.realRemainderDerivative (k+1) (by omega) p v u₁ w - + D.realVolumeSecond (k+1) (by omega) u₁ w + (D.potentialDerivative (k+1) p v u))) := by + let : NormedAddCommGroup (D.localizers.RealSobolev ((k+1 : ℕ) : ℝ)) := inferInstance + let : NormedSpace ℝ (D.localizers.RealSobolev ((k+1 : ℕ) : ℝ)) := inferInstance + let : NormedAddCommGroup (D.localizers.RealSobolev (k : ℝ)) := inferInstance + let : NormedSpace ℝ (D.localizers.RealSobolev (k : ℝ)) := inferInstance + have hh := D.linearized_commutator_weak k hk p v u w + dsimp only at hh ⊢ + rw [hf, D.densityDerivative_lower (k+1) k (by omega)] at hh + simpa only [map_add] using hh + + + +omit [ConnectedSpace X] in +lemma linearizedGain_succ (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (u : D.localizers.RealSobolev (((k+2 : ℕ) : ℝ)+2)) + (hG : D.LinearizedGain k hk + (D.localizers.realLower (((k+2 : ℕ) : ℝ)+2) (((k+1 : ℕ) : ℝ)+2) + (by push_cast; linarith) u)) : + D.LinearizedGain (k+1) (by omega) u := by + intro w f hf + let u₁ := D.localizers.realLower (((k+2 : ℕ) : ℝ)+2) (((k+1 : ℕ) : ℝ)+2) + (by push_cast; linarith) u + have hDer (p : ι) (v : EC d) : ∃ z : D.localizers.RealSobolev (((k+1 : ℕ) : ℝ)+2), + D.localizers.realLower (((k+1 : ℕ) : ℝ)+2) ((k : ℝ)+2) + (by push_cast; linarith) z = D.potentialDerivative k p v w := by + exact hG _ _ (D.linearized_derivative_equation k hk p v u w f hf) + obtain ⟨z,hz⟩ := D.derivative_lifts_gain k w hDer + refine ⟨D.localizers.realLower ((k+4 : ℕ) : ℝ) (((k+1+1 : ℕ) : ℝ)+2) + (by push_cast; linarith) z, ?_⟩ + rw [Localizers.realLower_lower] + exact hz + + +omit [ConnectedSpace X] in +lemma nonlinear_gain_of_linearizedGain (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (u : D.localizers.RealSobolev (((k+1 : ℕ) : ℝ)+2)) + (hG : D.LinearizedGain k hk u) (F : RealSmooth A) + (hF : D.realVolume (k+1) (by omega) u = D.localizers.realEmbed ((k+1 : ℕ) : ℝ) F) : + ∃ z : D.localizers.RealSobolev (((k+2 : ℕ) : ℝ)+2), + D.localizers.realLower (((k+2 : ℕ) : ℝ)+2) (((k+1 : ℕ) : ℝ)+2) + (by push_cast; linarith) z = u := by + have hDer (p : ι) (v : EC d) : ∃ z : D.localizers.RealSobolev (((k+1 : ℕ) : ℝ)+2), + D.localizers.realLower (((k+1 : ℕ) : ℝ)+2) ((k : ℝ)+2) + (by push_cast; linarith) z = D.potentialDerivative k p v u := by + apply hG (D.potentialDerivative k p v u) + (D.localizers.realEmbed ((k+1 : ℕ) : ℝ) (D.realLocalizedDerivative p v F) + + D.realNonlinearRemainder (k+1) (by omega) p v u) + exact D.nonlinear_commutator_solution k hk p v u F hF + obtain ⟨z,hz⟩ := D.derivative_lifts_gain k u hDer + refine ⟨D.localizers.realLower ((k+4 : ℕ) : ℝ) (((k+2 : ℕ) : ℝ)+2) + (by push_cast; linarith) z, ?_⟩ + rw [Localizers.realLower_lower] + exact hz + + +omit [ConnectedSpace X] in +lemma realVolume_lift_solution (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (u : D.localizers.RealSobolev ((k : ℝ)+2)) + (v : D.localizers.RealSobolev (((k+1 : ℕ) : ℝ)+2)) + (hv : D.localizers.realLower (((k+1 : ℕ) : ℝ)+2) ((k : ℝ)+2) (by push_cast; linarith) v = u) + (F : RealSmooth A) (hF : D.realVolume k hk u = D.localizers.realEmbed (k : ℝ) F) : + D.realVolume (k+1) (by omega) v = D.localizers.realEmbed ((k+1 : ℕ) : ℝ) F := by + apply D.localizers.realLower_injective + (by push_cast; linarith : (k : ℝ) ≤ ((k+1 : ℕ) : ℝ)) + exact (D.realVolume_lower (k+1) k (by omega) hk (by omega) v).symm.trans + ((congrArg (D.realVolume k hk) hv).trans + (hF.trans (D.localizers.realLower_embed (by push_cast; linarith only) F).symm)) + + + +omit [ConnectedSpace X] in +lemma nonlinear_all_order_lift (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (u : D.localizers.RealSobolev (((k+1 : ℕ) : ℝ)+2)) + (hG : D.LinearizedGain k hk u) (F : RealSmooth A) + (hF : D.realVolume (k+1) (by omega) u = D.localizers.realEmbed ((k+1 : ℕ) : ℝ) F) + (l : ℕ) (hl : k ≤ l) : + ∃ z : D.localizers.RealSobolev (((l+1 : ℕ) : ℝ)+2), + D.localizers.realLower (((l+1 : ℕ) : ℝ)+2) (((k+1 : ℕ) : ℝ)+2) + (by exact_mod_cast Nat.add_le_add_right (Nat.add_le_add_right hl 1) 2) z = u ∧ + D.LinearizedGain l (by omega) z ∧ + D.realVolume (l+1) (by omega) z = D.localizers.realEmbed ((l+1 : ℕ) : ℝ) F := by + induction l, hl using Nat.le_induction with + | base => + refine ⟨u,?_,hG,hF⟩ + apply Subtype.ext + exact congrArg (fun T : D.localizers.Sobolev (((k+1 : ℕ) : ℝ)+2) →L[ℝ] + D.localizers.Sobolev (((k+1 : ℕ) : ℝ)+2) => T u.val) (D.localizers.lower_self _) + | succ l hl ih => + obtain ⟨z,hz,hGz,hFz⟩ := ih + obtain ⟨v,hv⟩ := D.nonlinear_gain_of_linearizedGain l (by omega) z hGz F hFz + refine ⟨v,?_,?_,?_⟩ + · calc + D.localizers.realLower (((l+1+1 : ℕ) : ℝ)+2) (((k+1 : ℕ) : ℝ)+2) _ v = + D.localizers.realLower (((l+1 : ℕ) : ℝ)+2) (((k+1 : ℕ) : ℝ)+2) _ + (D.localizers.realLower (((l+2 : ℕ) : ℝ)+2) (((l+1 : ℕ) : ℝ)+2) _ v) := + (D.localizers.realLower_lower _ _ v).symm + _ = u := by rw [hv,hz] + · apply D.linearizedGain_succ l (by omega) v + rwa [hv] + · exact D.realVolume_lift_solution (l+1) (by omega) z v hv F hFz + +omit [ConnectedSpace X] in +lemma allRegular_of_real_lifts (k : ℕ) + (u : D.localizers.RealSobolev (((k+1 : ℕ) : ℝ)+2)) + (hL : ∀ m : ℕ, ∃ z : D.localizers.RealSobolev (((k+m+1 : ℕ) : ℝ)+2), + D.localizers.realLower (((k+m+1 : ℕ) : ℝ)+2) (((k+1 : ℕ) : ℝ)+2) + (by push_cast; linarith only [Nat.cast_nonneg (α := ℝ) m]) z = u) : + D.localizers.AllRegular + (D.localizers.realLower (((k+1 : ℕ) : ℝ)+2) 0 (by positivity) u).val := by + intro m + obtain ⟨z,hz⟩ := hL m + refine ⟨D.localizers.lower (((k+m+1 : ℕ) : ℝ)+2) (m : ℝ) z.val,?_⟩ + have hm : (m : ℝ) ≤ ((k+m+1 : ℕ) : ℝ)+2 := by + push_cast + linarith only [Nat.cast_nonneg (α := ℝ) k] + have hh := congrArg + (D.localizers.realLower (((k+1 : ℕ) : ℝ)+2) 0 (by positivity)) hz + have hh' := (D.localizers.realLower_lower _ _ z).symm.trans hh + exact (D.localizers.lower_lower hm (Nat.cast_nonneg m) z.val).trans + (congrArg Subtype.val hh') + +omit [ConnectedSpace X] in +lemma real_smooth_of_allRegular (s : ℝ) (hs : 0 ≤ s) + (hStrong : (Module.finrank ℝ (EC d) : ℝ) < 2*s) + (u : D.localizers.RealSobolev s) + (hreg : D.localizers.AllRegular (D.localizers.realLower s 0 hs u).val) : + ∃ φ : RealSmooth A, D.localizers.realEmbed s φ = u := by + obtain ⟨f,hf⟩ := D.allRegular_smooth hreg + have he : D.localizers.embed s f = u.val := by + apply D.localizers.lower_injective hs + exact (D.localizers.lower_embed hs f).trans hf + have hr (x : X) : (f x).im = 0 := by + have hh := D.localizers.real_strong hStrong u x + rw [← he,D.localizers.strong_embed s hStrong f] at hh + exact hh + exact ⟨⟨f,hr⟩,Subtype.ext he⟩ + + + +omit [ConnectedSpace X] in +lemma nonlinear_smooth_of_linearizedGain (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (u : D.localizers.RealSobolev (((k+1 : ℕ) : ℝ)+2)) + (hG : D.LinearizedGain k hk u) (F : RealSmooth A) + (hF : D.realVolume (k+1) (by omega) u = D.localizers.realEmbed ((k+1 : ℕ) : ℝ) F) : + ∃ φ : RealSmooth A, D.localizers.realEmbed (((k+1 : ℕ) : ℝ)+2) φ = u := by + have hStrong : (Module.finrank ℝ (EC d) : ℝ) < 2 * (((k+1 : ℕ) : ℝ)+2) := by + have hk' : (Module.finrank ℝ (EC d) : ℝ) < (k : ℝ) := by exact_mod_cast hk + push_cast + linarith only [hk',Nat.cast_nonneg (α := ℝ) k] + apply D.real_smooth_of_allRegular _ (by positivity) hStrong u + apply D.allRegular_of_real_lifts k u + intro m + obtain ⟨z,hz,_,_⟩ := D.nonlinear_all_order_lift k hk u hG F hF (k+m) (by omega) + exact ⟨z,hz⟩ + + + +def FixedSpatialSmoothness (s : ℕ) (hs : Module.finrank ℝ (EC d) < s) : Prop := + ∀ᶠ u in 𝓝 (0 : D.localizers.RealSobolev (((s+1 : ℕ) : ℝ)+2)), + ∀ F : RealSmooth A, + D.realVolume (s+1) (by omega) u = D.localizers.realEmbed ((s+1 : ℕ) : ℝ) F → + ∃ φ : RealSmooth A, D.localizers.realEmbed (((s+1 : ℕ) : ℝ)+2) φ = u + + + +theorem fixed_spatial_smoothness (s : ℕ) (hs : Module.finrank ℝ (EC d) < s) (x₀ : X) : + D.FixedSpatialSmoothness s hs := by + filter_upwards [D.linearizedGain_nhds s hs x₀] with u hu + intro F hF + exact D.nonlinear_smooth_of_linearizedGain s hs u hu F hF + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/FourierKernel.lean b/lean/OAI/Geometry/PrescribedPotential/FourierKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..0c5b6350a9a9f46aeaa4a55dab630524c0782875 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/FourierKernel.lean @@ -0,0 +1,94 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.SobolevParametrix + +namespace OAI + +/-! Fourier Kernel. -/ + +section + + +noncomputable section +open MeasureTheory Set Filter Topology FourierTransform +open scoped BoundedContinuousFunction SchwartzMap Classical Real ComplexInnerProductSpace +namespace EllipticCompact +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] +open SobolevChart + +lemma phase_sub_bound (a b : ℝ) : + ‖((Real.fourierChar a : Circle) : ℂ) - (Real.fourierChar b : Circle)‖ ≤ 2 * Real.pi * ‖a - b‖ := by + have he : ((Real.fourierChar a : Circle) : ℂ) - (Real.fourierChar b : Circle) = + (((Real.fourierChar (a-b) : Circle) : ℂ) - 1) * (Real.fourierChar b : Circle) := by + rw [sub_mul, one_mul, ← Circle.coe_mul, ← AddChar.map_add_eq_mul] + rw [sub_add_cancel] + rw [he, norm_mul, Circle.norm_coe, mul_one, Real.fourierChar_apply] + have hb := Real.norm_exp_I_mul_ofReal_sub_one_le (x := 2 * Real.pi * (a-b)) + rw [mul_comm (Complex.I)] at hb + exact hb.trans (by simp only [norm_mul, Real.norm_eq_abs, abs_of_pos Real.pi_pos]; norm_num) + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma phase_inner_sub_bound (x z y : E) : + ‖((Real.fourierChar (inner ℝ y x) : Circle) : ℂ) - + (Real.fourierChar (inner ℝ y z) : Circle)‖ ≤ 2 * Real.pi * ‖y‖ * ‖x-z‖ := by + apply (phase_sub_bound _ _).trans + rw [← inner_sub_right] + calc + _ ≤ (2 * Real.pi) * (‖y‖ * ‖x-z‖) := + mul_le_mul_of_nonneg_left (norm_inner_le_norm y (x-z)) + (mul_nonneg (by norm_num) Real.pi_pos.le) + _ = _ := by ring + +def kernelSectionFun (χ : 𝓢(E, ℂ)) (x y : E) : ℂ := + star (((Real.fourierChar (inner ℝ y x) : Circle) : ℂ) * χ y) + +lemma kernelSection_memLp (χ : 𝓢(E, ℂ)) (x : E) : + MemLp (kernelSectionFun χ x) 2 (volume : Measure E) := by + apply (χ.memLp (p := 2) (μ := volume)).mono + (show Continuous (kernelSectionFun χ x) by + unfold kernelSectionFun + exact ((continuous_subtype_val.comp (Real.continuous_fourierChar.comp + (continuous_id.inner continuous_const))).mul χ.continuous).star + ).aestronglyMeasurable + filter_upwards [] with y + simp only [kernelSectionFun, norm_star, norm_mul, Circle.norm_coe, one_mul, le_refl] + +def kernelSection (χ : 𝓢(E, ℂ)) (x : E) : L2 E := + (kernelSection_memLp χ x).toLp (kernelSectionFun χ x) + +lemma kernelSection_ae (χ : 𝓢(E, ℂ)) (x : E) : + kernelSection χ x =ᵐ[volume] kernelSectionFun χ x := + (kernelSection_memLp χ x).coeFn_toLp + +lemma kernelSection_continuous (χ : 𝓢(E, ℂ)) (hχ : HasCompactSupport χ) : + Continuous (kernelSection χ) := by + obtain ⟨R, hR, hbound⟩ := hχ.isBounded.exists_pos_norm_le + have hb (x z : E) : ‖kernelSection χ x - kernelSection χ z‖ ≤ + (2 * Real.pi * R * ‖χ.toLp 2‖) * ‖x-z‖ := by + calc + ‖kernelSection χ x - kernelSection χ z‖ ≤ + (2 * Real.pi * R * ‖x-z‖) * ‖χ.toLp 2‖ := by + apply Lp.norm_le_mul_norm_of_ae_le_mul + filter_upwards [Lp.coeFn_sub (kernelSection χ x) (kernelSection χ z), + kernelSection_ae χ x, kernelSection_ae χ z, χ.coeFn_toLp 2 volume] with y hs hx hz hχy + rw [hs, Pi.sub_apply, hx, hz, hχy] + simp only [kernelSectionFun, ← star_sub, ← sub_mul, norm_star, norm_mul] + by_cases hy : χ y = 0 + · simp [hy] + · apply mul_le_mul_of_nonneg_right _ (norm_nonneg _) + exact (phase_inner_sub_bound x z y).trans + (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left + (hbound y (subset_tsupport _ hy)) (by positivity)) (norm_nonneg _)) + _ = _ := by ring + apply LipschitzWith.continuous (K := ⟨2 * Real.pi * R * ‖χ.toLp 2‖, by positivity⟩) + apply LipschitzWith.of_dist_le_mul + intro x z + rw [dist_eq_norm, dist_eq_norm] + exact hb x z + +end EllipticCompact + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/FrameCompactBounds.lean b/lean/OAI/Geometry/PrescribedPotential/FrameCompactBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..767b2ede601536a37a4717f12e34b48072caddd6 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/FrameCompactBounds.lean @@ -0,0 +1,132 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CompactHomogeneousBounds +import OAI.Geometry.PrescribedPotential.WirtingerCalculus +import OAI.Geometry.PrescribedPotential.KaehlerClosedDerivatives + +namespace OAI + +/-! Frame Compact Bounds. -/ + +section + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder MatrixOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +variable {n : ℕ} + +def frameGram (G B : Matrix (Fin n) (Fin n) ℂ) : ℝ := (Bᴴ*G*B).trace.re + +def frameResidual (A G : Matrix (Fin n) (Fin n) ℂ) + (R : V n → Matrix (Fin n) (Fin n) ℂ) (B : Matrix (Fin n) (Fin n) ℂ) : ℝ := + -(Bᴴ*A*B*(Bᴴ*G*B)).trace.re + ∑ k, (Bᴴ*R (B*ᵥe k)*B).trace.re + +lemma frameGram_pos {G B : Matrix (Fin n) (Fin n) ℂ} (hG : G.PosDef) (hB : B ≠ 0) : + 0 < frameGram G B := by + obtain ⟨Q,hQ,rfl⟩ := CStarAlgebra.isStrictlyPositive_iff_eq_star_mul_self.mp hG.isStrictlyPositive + have hn : Q*B ≠ 0 := by + intro he + apply hB + exact hQ.mul_left_cancel (by simpa using he) + have he : Bᴴ*(Qᴴ*Q)*B = (Q*B)ᴴ*(Q*B) := by + simp only [Matrix.conjTranspose_mul,Matrix.mul_assoc] + change 0 < (Bᴴ*(Qᴴ*Q)*B).trace.re + rw [he] + have hp := (Matrix.posSemidef_conjTranspose_mul_self (Q*B)).trace_nonneg + have hne : ((Q*B)ᴴ*(Q*B)).trace ≠ 0 := by + intro he0 + exact hn ((Matrix.trace_conjTranspose_mul_self_eq_zero_iff (A := Q*B)).mp he0) + exact (Complex.pos_iff.mp (lt_of_le_of_ne hp (Ne.symm hne))).1 + +lemma frameGram_smul (G B : Matrix (Fin n) (Fin n) ℂ) (r : ℝ) : + frameGram G (r • B) = r^2*frameGram G B := by + change frameGram G ((r:ℂ) • B) = _ + unfold frameGram + simp only [Matrix.conjTranspose_smul,Complex.star_def,Complex.conj_ofReal, + smul_mul_assoc,mul_smul_comm,smul_smul,Matrix.trace_smul,smul_eq_mul,← Complex.ofReal_mul, + Complex.mul_re,Complex.ofReal_re,Complex.ofReal_im,zero_mul,sub_zero] + ring + +lemma frameResidual_smul (A G : Matrix (Fin n) (Fin n) ℂ) + (R : V n → Matrix (Fin n) (Fin n) ℂ) + (hR : ∀ r : ℝ, ∀ v, R (r • v) = (r:ℂ)^2 • R v) + (B : Matrix (Fin n) (Fin n) ℂ) (r : ℝ) : + frameResidual A G R (r • B) = r^4*frameResidual A G R B := by + unfold frameResidual + simp only [Matrix.smul_mulVec,hR] + change -(((r:ℂ) • B)ᴴ*A*((r:ℂ) • B)*(((r:ℂ) • B)ᴴ*G*((r:ℂ) • B))).trace.re + + (∑ k, (((r:ℂ) • B)ᴴ*((r:ℂ)^2 • R (B*ᵥe k))*((r:ℂ) • B)).trace.re) = _ + simp only [Matrix.conjTranspose_smul,Complex.star_def,Complex.conj_ofReal, + smul_mul_assoc,mul_smul_comm,smul_smul,Matrix.trace_smul,smul_eq_mul] + simp only [← Complex.ofReal_pow,← Complex.ofReal_mul,Complex.mul_re, + Complex.ofReal_re,Complex.ofReal_im,zero_mul,sub_zero] + rw [← Finset.mul_sum] + ring + +lemma continuousOn_trace_re {X : Type*} [TopologicalSpace X] {K : Set X} + {F : X → Matrix (Fin n) (Fin n) ℂ} (hF : ContinuousOn F K) : + ContinuousOn (fun x => (F x).trace.re) K := by + simp only [Matrix.trace,Matrix.diag_apply,Complex.re_sum] + exact continuousOn_finsetSum _ (fun k _ => + Complex.continuous_re.comp_continuousOn (continuousOn_pi.mp (continuousOn_pi.mp hF k) k)) + +lemma continuousOn_matrix_star {X : Type*} [TopologicalSpace X] {K : Set X} + {F : X → Matrix (Fin n) (Fin n) ℂ} (hF : ContinuousOn F K) : + ContinuousOn (fun x => (F x)ᴴ) K := by + exact continuousOn_pi.mpr (fun i => continuousOn_pi.mpr (fun j => + (continuousOn_pi.mp (continuousOn_pi.mp hF j) i).star)) + +lemma compact_frame_bound {X : Type*} [TopologicalSpace X] {K : Set X} (hK : IsCompact K) + (A G : X → Matrix (Fin n) (Fin n) ℂ) (R : X → V n → Matrix (Fin n) (Fin n) ℂ) + (hA : ContinuousOn A K) (hG : ContinuousOn G K) (hp : ∀ x ∈ K, (G x).PosDef) + (hR : ContinuousOn (fun q : X × V n => R q.1 q.2) (K ×ˢ univ)) + (hRh : ∀ x ∈ K, ∀ r : ℝ, ∀ v, R x (r • v) = (r:ℂ)^2 • R x v) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ x ∈ K, ∀ B, + -C*(frameGram (G x) B)^2 ≤ frameResidual (A x) (G x) (R x) B := by + let E := Matrix (Fin n) (Fin n) ℂ + have hcgram : ContinuousOn (fun q : X × E => frameGram (G q.1) q.2) (K ×ˢ univ) := by + apply continuousOn_trace_re + exact ((continuousOn_matrix_star continuous_snd.continuousOn).mul + (hG.comp continuous_fst.continuousOn (fun _ h => h.1))).mul continuous_snd.continuousOn + have hcres : ContinuousOn (fun q : X × E => frameResidual (A q.1) (G q.1) (R q.1) q.2) (K ×ˢ univ) := by + have hb := continuous_snd.continuousOn (s := K ×ˢ (univ : Set E)) + have hbs := continuousOn_matrix_star hb + have ha := hA.comp continuous_fst.continuousOn (s := K ×ˢ (univ : Set E)) (fun _ h => h.1) + have hg := hG.comp continuous_fst.continuousOn (s := K ×ˢ (univ : Set E)) (fun _ h => h.1) + apply ContinuousOn.add + · exact (continuousOn_trace_re (((hbs.mul ha).mul hb).mul ((hbs.mul hg).mul hb))).neg + · apply continuousOn_finsetSum + intro k _ + apply continuousOn_trace_re + apply ContinuousOn.mul (ContinuousOn.mul hbs _) hb + apply hR.comp (f := fun q : X × E => (q.1,q.2*ᵥe k)) + · exact continuous_fst.continuousOn.prodMk + (continuous_snd.matrix_mulVec continuous_const).continuousOn + · intro q hq + exact ⟨hq.1,mem_univ _⟩ + obtain ⟨δ,hδ,hgram⟩ := compact_homogeneous_positive hK (fun x B => frameGram (G x) B) + (hcgram.mono (fun _ h => ⟨h.1,mem_univ _⟩)) + (fun x hx B hB => frameGram_pos (hp x hx) hB) (fun x _ r B => frameGram_smul (G x) B r) + obtain ⟨C,hC,hres⟩ := compact_homogeneous_bound hK 4 (by norm_num) + (fun x B => frameResidual (A x) (G x) (R x) B) + (hcres.mono (fun _ h => ⟨h.1,mem_univ _⟩)) + (fun x hx r B => frameResidual_smul _ _ _ (hRh x hx) B r) + refine ⟨C/δ^2,div_nonneg hC (sq_nonneg δ),?_⟩ + intro x hx B + have hg := hgram x hx B + have hr := neg_abs_le (frameResidual (A x) (G x) (R x) B) |>.trans' (neg_le_neg (hres x hx B)) + have hq : 0 ≤ frameGram (G x) B := (mul_nonneg hδ.le (sq_nonneg _)).trans hg + have hh : δ^2*‖B‖^4 ≤ (frameGram (G x) B)^2 := by + have hh := sq_le_sq₀ (mul_nonneg hδ.le (sq_nonneg ‖B‖)) hq |>.mpr hg + simpa only [mul_pow,← pow_mul] using hh + have hmul := mul_le_mul_of_nonneg_left hh (div_nonneg hC (sq_nonneg δ)) + have he : C/δ^2*(δ^2*‖B‖^4) = C*‖B‖^4 := by field_simp + rw [he] at hmul + linarith +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/FrameSecondCalculus.lean b/lean/OAI/Geometry/PrescribedPotential/FrameSecondCalculus.lean new file mode 100644 index 0000000000000000000000000000000000000000..02ed8393520b3561b1b611724718b7908de7697c --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/FrameSecondCalculus.lean @@ -0,0 +1,58 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.ChernLuLocalInequality +import OAI.Geometry.PrescribedPotential.LinearFrameCalculus + +namespace OAI + +/-! Frame Second Calculus. -/ + +section + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +variable {n : ℕ} + +lemma mderiv_pullMetric_second {U : Set (V n)} (hU : IsOpen U) + (B : V n →L[ℂ] V n) {M : V n → Matrix (Fin n) (Fin n) ℂ} + (hM : ContDiffOn ℝ ∞ M U) {z : V n} (hz : B z ∈ U) + (a b : ℂ) (u v : V n) : + mderiv a u (mderiv b v (pullMetric B M)) z = + (frameMatrix B)ᴴ*mderiv a (B u) (mderiv b (B v) M) (B z)*frameMatrix B := by + have he : mderiv b v (pullMetric B M) =ᶠ[𝓝 z] pullMetric B (mderiv b (B v) M) := by + filter_upwards [B.continuous.continuousAt.preimage_mem_nhds (hU.mem_nhds hz)] with y hy + exact mderiv_pullMetric B (hM.contDiffAt (hU.mem_nhds hy)) b v + rw [mderiv_congr he,mderiv_pullMetric B (mderiv_smooth (hM.contDiffAt (hU.mem_nhds hz)) b (B v))] + +lemma congruence_inverse_cancel (B G Y : Matrix (Fin n) (Fin n) ℂ) + (hB : IsUnit B) : + (Bᴴ*Y*B)ᴴ*(Bᴴ*G*B)⁻¹*(Bᴴ*Y*B) = Bᴴ*(Yᴴ*G⁻¹*Y)*B := by + have hb := (Matrix.isUnit_iff_isUnit_det B).mp hB + simp only [Matrix.conjTranspose_mul,Matrix.conjTranspose_conjTranspose, + Matrix.mul_inv_rev,← Matrix.conjTranspose_nonsing_inv] + have hc : B*B⁻¹ = 1 := Matrix.mul_nonsing_inv _ hb + have hd : (B⁻¹)ᴴ*Bᴴ = 1 := by rw [← Matrix.conjTranspose_mul,hc,Matrix.conjTranspose_one] + simp only [Matrix.mul_assoc] + rw [← Matrix.mul_assoc B B⁻¹,hc,Matrix.one_mul] + rw [← Matrix.mul_assoc (B⁻¹)ᴴ Bᴴ,hd,Matrix.one_mul] + +lemma curvatureDiagonal_pullMetric {U : Set (V n)} (hU : IsOpen U) + (B : V n →L[ℂ] V n) (hB : IsUnit (frameMatrix B)) + {M : V n → Matrix (Fin n) (Fin n) ℂ} + (hM : ContDiffOn ℝ ∞ M U) {z : V n} (hz : B z ∈ U) (v : V n) : + curvatureDiagonal (pullMetric B M) z v = + (frameMatrix B)ᴴ*curvatureDiagonal M (B z) (B v)*frameMatrix B := by + unfold curvatureDiagonal + rw [mderiv_pullMetric_second hU B hM hz, + mderiv_pullMetric B (hM.contDiffAt (hU.mem_nhds hz))] + unfold pullMetric + rw [congruence_inverse_cancel _ _ _ hB] + simp only [mul_sub,sub_mul] +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/FredholmKernel.lean b/lean/OAI/Geometry/PrescribedPotential/FredholmKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..989bdb3907728401b3f5d489c0859df8d8cf3ab3 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/FredholmKernel.lean @@ -0,0 +1,70 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.ComplexKernel +import OAI.Geometry.PrescribedPotential.PatchCutoffs +import OAI.Geometry.PrescribedPotential.ConstantProjection +import OAI.Geometry.PrescribedPotential.FredholmRegularity +import OAI.Geometry.PrescribedPotential.GlobalSmooth + +namespace OAI + +/-! Fredholm Kernel. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory +open scoped SchwartzMap ContDiff Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +def fredholmOperator (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) : D.localizers.Sobolev 0 →L[ℝ] D.localizers.Sobolev 0 := + (m^2 : ℝ) • D.resolventZero m hm he - P.proj + +lemma fredholm_kernel (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) (w : D.localizers.Sobolev 0) + (hw : D.fredholmOperator m hm he P w = w) : w = 0 := by + obtain ⟨c, hc⟩ := P.value w + have hw' : w = D.localizers.embed 0 (-Smooth.const c) + + (m^2 : ℝ) • D.resolventZero m hm he w := by + change (m^2 : ℝ) • D.resolventZero m hm he w - P.proj w = w at hw + rw [hc] at hw + rw [map_neg] + calc + w = (m^2 : ℝ) • D.resolventZero m hm he w - + D.localizers.embed 0 (Smooth.const c) := hw.symm + _ = _ := by abel + obtain ⟨u, hu⟩ := D.allRegular_smooth (D.resolvent_feedback_regular m hm he w _ hw') + have hs := D.smooth_shifted_equation m hm he w u hu + have hL : complexL g u = Smooth.const c := by + apply D.localizers.embed_injective 0 + have h := hs.trans hw' + rw [map_sub, map_smul, map_neg, ← hu] at h + apply sub_right_inj.mp + calc + (m^2 : ℝ) • D.localizers.embed 0 u - D.localizers.embed 0 (complexL g u) = + -D.localizers.embed 0 (Smooth.const c) + (m^2 : ℝ) • D.localizers.embed 0 u := h + _ = (m^2 : ℝ) • D.localizers.embed 0 u - D.localizers.embed 0 (Smooth.const c) := by abel + have hc0 := complexL_constant_rhs_zero g u hL + have hL0 : complexL g u = 0 := by rw [hL, hc0]; rfl + obtain ⟨a, ha⟩ := complexL_kernel g u hL0 + have hwc : w = D.localizers.embed 0 (Smooth.const ((m^2 : ℝ) • a)) := by + rw [hL0, sub_zero, ha] at hs + exact hs.symm + have hpw : P.proj w = w := by rw [hwc, P.fixed] + rw [← hpw, hc, hc0] + exact map_zero (D.localizers.embed 0) + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/FredholmRegularity.lean b/lean/OAI/Geometry/PrescribedPotential/FredholmRegularity.lean new file mode 100644 index 0000000000000000000000000000000000000000..b3c4496c8f5d420e8b153fdfa8868784ff2a8802 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/FredholmRegularity.lean @@ -0,0 +1,135 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CompletedResolvent +import OAI.Geometry.PrescribedPotential.GlobalCompletion + +namespace OAI + +/-! Fredholm Regularity. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory +open scoped SchwartzMap ContDiff Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace Localizers +variable {D : Localizers A ι} + +lemma BoundedCore.add {s t : ℝ} {S T : Smooth A →ₗ[ℝ] Smooth A} + (hS : D.BoundedCore s t S) (hT : D.BoundedCore s t T) : + D.BoundedCore s t (S+T) := by + obtain ⟨B, hB, hb⟩ := hS + obtain ⟨C, hC, hc⟩ := hT + refine ⟨B+C, add_nonneg hB hC, fun f => ?_⟩ + simp only [LinearMap.add_apply, map_add] + exact (norm_add_le _ _).trans (by simpa only [add_mul] using add_le_add (hb f) (hc f)) + +lemma BoundedCore.smul {s t : ℝ} {T : Smooth A →ₗ[ℝ] Smooth A} + (hT : D.BoundedCore s t T) (c : ℝ) : D.BoundedCore s t (c • T) := by + obtain ⟨C, hC, hc⟩ := hT + refine ⟨‖c‖*C, mul_nonneg (norm_nonneg _) hC, fun f => ?_⟩ + simp only [LinearMap.smul_apply, map_smul, norm_smul, mul_assoc] + exact mul_le_mul_of_nonneg_left (hc f) (norm_nonneg c) + +lemma extendCore_add {s t : ℝ} {S T : Smooth A →ₗ[ℝ] Smooth A} + (hS : D.BoundedCore s t S) (hT : D.BoundedCore s t T) : + D.extendCore s t (S+T) = D.extendCore s t S + D.extendCore s t T := by + apply DFunLike.coe_injective + apply (D.embed_dense s).equalizer (by fun_prop) (by fun_prop) + funext f + simp only [Function.comp_apply, _root_.add_apply, D.extendCore_embed hS, + D.extendCore_embed hT, D.extendCore_embed (hS.add hT), LinearMap.add_apply, map_add] + +lemma extendCore_smul {s t : ℝ} {T : Smooth A →ₗ[ℝ] Smooth A} + (hT : D.BoundedCore s t T) (c : ℝ) : + D.extendCore s t (c • T) = c • D.extendCore s t T := by + apply DFunLike.coe_injective + apply (D.embed_dense s).equalizer (by fun_prop) (by fun_prop) + funext f + simp only [Function.comp_apply, _root_.smul_apply, D.extendCore_embed hT, + D.extendCore_embed (hT.smul c), LinearMap.smul_apply, map_smul] + +end Localizers +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +def resolventZero (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) : + D.localizers.Sobolev 0 →L[ℝ] D.localizers.Sobolev 0 := + D.localizers.lower 2 0 ∘L D.completedResolvent m hm he + +def feedbackCore (m : ℝ) (hm : 1 ≤ m) : Smooth A →ₗ[ℝ] Smooth A := + D.error m hm + (m^2 : ℝ) • D.parametrix m hm + +lemma feedbackCore_bound (m : ℝ) (hm : 1 ≤ m) (k : ℕ) : + D.localizers.BoundedCore (k : ℝ) ((k : ℝ)+1) (D.feedbackCore m hm) := by + have hQ : D.localizers.BoundedCore (k : ℝ) ((k : ℝ)+2) (D.parametrix m hm) := + D.parametrix_bound m hm k + exact (D.error_bound_integer m hm k).add ((hQ.target_mono (by linarith)).smul (m^2)) + +lemma feedbackCore_bound_zero (m : ℝ) (hm : 1 ≤ m) : + D.localizers.BoundedCore 0 0 (D.feedbackCore m hm) := by + have hb := D.feedbackCore_bound m hm 0 + rw [Nat.cast_zero, zero_add] at hb + exact hb.target_mono (by norm_num) + +lemma completed_feedback (m : ℝ) (hm : 1 ≤ m) (v : D.localizers.Sobolev 0) : + D.localizers.extendCore 0 0 (D.feedbackCore m hm) v = + D.completedError m hm v + (m^2 : ℝ) • + D.localizers.lower 2 0 (D.completedParametrix m hm v) := by + have hQ := (D.completedParametrix_bound m hm).target_mono (by norm_num : (0:ℝ) ≤ 2) + rw [feedbackCore, Localizers.extendCore_add (D.error_bound_zero m hm) (hQ.smul (m^2)), + Localizers.extendCore_smul hQ] + simp only [_root_.add_apply, _root_.smul_apply] + change _ = (D.localizers.extendCore 0 0 (D.error m hm)) v + (m^2 : ℝ) • + D.localizers.lower 2 0 (D.localizers.extendCore 0 2 (D.parametrix m hm) v) + rw [D.localizers.lower_extendCore (by norm_num : (0:ℝ) ≤ 2) _ + (D.completedParametrix_bound m hm) hQ v] + + + +theorem resolvent_feedback_regular (m : ℝ) (hm : 1 ≤ m) + (he : ‖D.completedError m hm‖ < 1) (w : D.localizers.Sobolev 0) + (f : Smooth A) (hw : w = D.localizers.embed 0 f + (m^2 : ℝ) • D.resolventZero m hm he w) : + D.localizers.AllRegular (D.resolventZero m hm he w) := by + let v := D.errorInverse m hm he w + have hv : v - D.completedError m hm v = + D.localizers.embed 0 f + (m^2 : ℝ) • + D.localizers.lower 2 0 (D.completedParametrix m hm v) := + (D.errorInverse_equation m hm he w).trans hw + have hvreg : D.localizers.AllRegular v := by + apply D.localizers.allRegular_of_gain (D.feedbackCore m hm) + (D.feedbackCore_bound_zero m hm) (D.feedbackCore_bound m hm) f + rw [D.completed_feedback] + calc + v = D.localizers.embed 0 f + (m^2 : ℝ) • + D.localizers.lower 2 0 (D.completedParametrix m hm v) + + D.completedError m hm v := sub_eq_iff_eq_add.mp hv + _ = _ := by abel + exact D.parametrix_regular m hm v hvreg + +lemma smooth_shifted_equation (m : ℝ) (hm : 1 ≤ m) + (he : ‖D.completedError m hm‖ < 1) (w : D.localizers.Sobolev 0) + (u : Smooth A) (hu : D.localizers.embed 0 u = D.resolventZero m hm he w) : + D.localizers.embed 0 ((m^2 : ℝ) • u - complexL g u) = w := by + have h2 : D.localizers.embed 2 u = D.completedResolvent m hm he w := by + apply D.localizers.lower_injective (by norm_num : (0 : ℝ) ≤ 2) + rw [D.localizers.lower_embed (by norm_num : (0 : ℝ) ≤ 2)] + exact hu + have h := D.completedResolvent_equation m hm he w + rw [← h2] at h + simpa only [shiftedOperator, completedL, _root_.sub_apply, + _root_.smul_apply, D.localizers.lower_embed (by norm_num : (0 : ℝ) ≤ 2), + D.localizers.extendCore_embed D.complexL_bound, map_sub, map_smul] using h + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/FrequencyApprox.lean b/lean/OAI/Geometry/PrescribedPotential/FrequencyApprox.lean new file mode 100644 index 0000000000000000000000000000000000000000..f3f12d04e3a99caeb026f5aef650d1e7810c8e14 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/FrequencyApprox.lean @@ -0,0 +1,163 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.SobolevEmbedding +import OAI.Geometry.PrescribedPotential.TruncatedRellich + +namespace OAI + +/-! Frequency Approx. -/ + +section + + + +noncomputable section +open MeasureTheory Set Filter Topology FourierTransform +open scoped BoundedContinuousFunction SchwartzMap Classical ContDiff +namespace EllipticCompact +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] +open SobolevChart + +omit [FiniteDimensional ℝ E] in +lemma inverseWeight_one_apply (x : E) : + inverseWeight 1 x = ((((1 + ‖x‖ ^ 2 : ℝ)⁻¹) : ℝ) : ℂ) := by + change (((1 + ‖x‖ ^ 2) ^ (-((1 : ℕ) : ℝ)) : ℝ) : ℂ) = _ + rw [Nat.cast_one, Real.rpow_neg_one] + +omit [FiniteDimensional ℝ E] in +lemma inverseWeight_one_norm (x : E) : + ‖inverseWeight 1 x‖ = 1 / (1 + ‖x‖ ^ 2) := by + rw [inverseWeight_one_apply, Complex.norm_real, Real.norm_eq_abs, + abs_of_pos (inv_pos.mpr (by positivity)), one_div] + +def frequencyBump (n : ℕ) : ContDiffBump (0 : E) where + rIn := (n : ℝ) + 1 + rOut := (n : ℝ) + 2 + rIn_pos := by positivity + rIn_lt_rOut := by linarith + +lemma frequencyCutoff_support (n : ℕ) : + HasCompactSupport (fun x : E => (frequencyBump (E := E) n x : ℂ) * inverseWeight 1 x) := by + have hb : HasCompactSupport (fun x : E => (frequencyBump (E := E) n x : ℂ)) := + (frequencyBump (E := E) n).hasCompactSupport.comp_left (g := Complex.ofReal) Complex.ofReal_zero + exact hb.mul_right + +def frequencyCutoff (n : ℕ) : 𝓢(E, ℂ) := (frequencyCutoff_support (E := E) n).toSchwartzMap + ((Complex.ofRealCLM.contDiff.comp (frequencyBump (E := E) n).contDiff).mul (inverseWeight_temperate 1).1) + +lemma frequencyCutoff_apply (n : ℕ) (x : E) : + frequencyCutoff (E := E) n x = (frequencyBump (E := E) n x : ℂ) * inverseWeight 1 x := rfl + +lemma frequencyCutoff_compact (n : ℕ) : HasCompactSupport (frequencyCutoff (E := E) n) := + frequencyCutoff_support n + +lemma frequencyCutoff_bound (n : ℕ) : + ‖(frequencyCutoff (E := E) n).toBoundedContinuousFunction - inverseWeight 1‖ ≤ + 1 / ((n : ℝ) + 1) := by + apply (BoundedContinuousFunction.norm_le (by positivity : 0 ≤ 1 / ((n : ℝ) + 1))).mpr + intro x + change ‖frequencyCutoff (E := E) n x - inverseWeight 1 x‖ ≤ _ + rw [frequencyCutoff_apply] + by_cases hx : ‖x‖ ≤ (n : ℝ) + 1 + · have hx' : x ∈ Metric.closedBall (0 : E) (frequencyBump (E := E) n).rIn := by + simpa only [Metric.mem_closedBall, dist_zero_right, frequencyBump] using hx + rw [(frequencyBump (E := E) n).one_of_mem_closedBall hx', Complex.ofReal_one, one_mul, + sub_self, norm_zero] + positivity + · have hR : 0 < (n : ℝ) + 1 := by positivity + have hx' : (n : ℝ) + 1 ≤ ‖x‖ := le_of_lt (lt_of_not_ge hx) + have hden : (n : ℝ) + 1 ≤ 1 + ‖x‖ ^ 2 := by + have hn0 : (0 : ℝ) ≤ n := Nat.cast_nonneg n + nlinarith [norm_nonneg x] + have hb' : ‖(frequencyBump (E := E) n x : ℂ) - 1‖ ≤ 1 := by + rw [← Complex.ofReal_one, ← Complex.ofReal_sub, Complex.norm_real, Real.norm_eq_abs] + exact abs_le.mpr ⟨by linarith [(frequencyBump (E := E) n).nonneg' x], + by linarith [(frequencyBump (E := E) n).le_one (x := x)]⟩ + calc + _ = ‖((frequencyBump (E := E) n x : ℂ) - 1) * inverseWeight 1 x‖ := by congr 1; ring + _ = ‖(frequencyBump (E := E) n x : ℂ) - 1‖ * ‖inverseWeight 1 x‖ := norm_mul _ _ + _ ≤ 1 * ‖inverseWeight 1 x‖ := mul_le_mul_of_nonneg_right hb' (norm_nonneg _) + _ ≤ 1 / ((n : ℝ) + 1) := by + rw [one_mul, inverseWeight_one_norm] + exact one_div_le_one_div_of_le hR hden + +lemma inverseWeight_schwartz_approx {ε : ℝ} (hε : 0 < ε) : + ∃ χ : 𝓢(E, ℂ), HasCompactSupport χ ∧ + ‖χ.toBoundedContinuousFunction - inverseWeight 1‖ < ε := by + obtain ⟨n, hn⟩ := exists_nat_one_div_lt hε + exact ⟨frequencyCutoff n, frequencyCutoff_compact n, (frequencyCutoff_bound n).trans_lt hn⟩ + +variable [MeasurableSpace E] [BorelSpace E] + +lemma multiply_sub (g h : E →ᵇ ℂ) : multiply (g-h) = multiply g - multiply h := by + ext1 u + apply Lp.ext + filter_upwards [multiply_ae (g-h) u, multiply_ae g u, multiply_ae h u, + Lp.coeFn_sub (multiply g u) (multiply h u)] with x h₁ h₂ h₃ h₄ + change (multiply (g-h) u : E → ℂ) x = ((multiply g u - multiply h u : L2 E) : E → ℂ) x + rw [h₁, h₄, Pi.sub_apply, h₂, h₃] + simp only [BoundedContinuousFunction.sub_apply, sub_mul] + +lemma multiplier_sub (g h : E →ᵇ ℂ) : multiplier (g-h) = multiplier g - multiplier h := by + ext1 u + simp only [multiplier, ContinuousLinearMap.comp_apply, multiply_sub, + sub_apply, map_sub] + +lemma localized_multiplier_diff_bound (κ g h : E →ᵇ ℂ) : + ‖multiply κ ∘L multiplier g - multiply κ ∘L multiplier h‖ ≤ ‖κ‖ * ‖g-h‖ := by + apply ContinuousLinearMap.opNorm_le_bound _ (by positivity) + intro u + simp only [sub_apply, ContinuousLinearMap.comp_apply] + rw [← map_sub] + have he : multiplier g u - multiplier h u = multiplier (g-h) u := by + rw [multiplier_sub, sub_apply] + rw [he] + calc + ‖multiply κ (multiplier (g-h) u)‖ ≤ ‖κ‖ * ‖multiplier (g-h) u‖ := multiply_norm_le _ _ + _ ≤ ‖κ‖ * (‖g-h‖ * ‖u‖) := mul_le_mul_of_nonneg_left (multiplier_norm_le _ _) (norm_nonneg _) + _ = _ := by ring + +lemma compact_localized_frequency (κ χ : 𝓢(E, ℂ)) + (hκ : HasCompactSupport κ) (hχ : HasCompactSupport χ) : + IsCompactOperator (multiply κ.toBoundedContinuousFunction ∘L + multiplier χ.toBoundedContinuousFunction) := by + have h := (compact_truncated κ χ hκ hχ).comp_clm (fourierCLM ℂ (L2 E)) + simpa only [multiplier, ContinuousLinearMap.coe_comp, Function.comp_assoc] using h + +lemma localized_frequency_distance (κ χ : 𝓢(E, ℂ)) {ε : ℝ} + (happ : ‖χ.toBoundedContinuousFunction - inverseWeight 1‖ < + ε / (‖κ.toBoundedContinuousFunction‖ + 1)) : + dist (multiply κ.toBoundedContinuousFunction ∘L multiplier (inverseWeight 1)) + (multiply κ.toBoundedContinuousFunction ∘L multiplier χ.toBoundedContinuousFunction) < ε := by + have hB : 0 < ‖κ.toBoundedContinuousFunction‖ + 1 := by positivity + rw [dist_comm, dist_eq_norm] + calc + _ ≤ ‖κ.toBoundedContinuousFunction‖ * ‖χ.toBoundedContinuousFunction - inverseWeight 1‖ := + localized_multiplier_diff_bound _ _ _ + _ ≤ (‖κ.toBoundedContinuousFunction‖ + 1) * ‖χ.toBoundedContinuousFunction - inverseWeight 1‖ := + mul_le_mul_of_nonneg_right (by linarith) (norm_nonneg _) + _ < (‖κ.toBoundedContinuousFunction‖ + 1) * (ε / (‖κ.toBoundedContinuousFunction‖ + 1)) := + mul_lt_mul_of_pos_left happ hB + _ = ε := mul_div_cancel₀ _ (ne_of_gt hB) + + +theorem localized_bessel_compact (κ : 𝓢(E, ℂ)) (hκ : HasCompactSupport κ) : + IsCompactOperator (multiply κ.toBoundedContinuousFunction ∘L multiplier (inverseWeight 1)) := by + have hc : IsClosed {T : L2 E →L[ℂ] L2 E | IsCompactOperator T} := + isClosed_setOfPred_isCompactOperator + change (multiply κ.toBoundedContinuousFunction ∘L multiplier (inverseWeight 1)) ∈ + {T : L2 E →L[ℂ] L2 E | IsCompactOperator T} + rw [← hc.closure_eq] + apply Metric.mem_closure_iff.mpr + intro ε hε + have hB : 0 < ‖κ.toBoundedContinuousFunction‖ + 1 := by positivity + obtain ⟨χ, hχ, happ⟩ := inverseWeight_schwartz_approx (E := E) (div_pos hε hB) + exact ⟨multiply κ.toBoundedContinuousFunction ∘L multiplier χ.toBoundedContinuousFunction, + compact_localized_frequency κ χ hκ hχ, localized_frequency_distance κ χ happ⟩ + +end EllipticCompact + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/FrozenEllipticJets.lean b/lean/OAI/Geometry/PrescribedPotential/FrozenEllipticJets.lean new file mode 100644 index 0000000000000000000000000000000000000000..96cfdb3bace21cb0225b07971c3b138126400d2b --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/FrozenEllipticJets.lean @@ -0,0 +1,85 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.RealJetEnergy + +namespace OAI + +/-! Frozen Elliptic Jets. -/ + +section + + + +noncomputable section +open Set Filter Topology Finset +open scoped ContDiff +namespace HigherJet +variable {E F G : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [InnerProductSpace ℝ F] + [NormedAddCommGroup G] [NormedSpace ℝ G] + {ι : Type*} [Fintype ι] + +def hessian (u : E → F) : E → E →L[ℝ] E →L[ℝ] F := fderiv ℝ (fderiv ℝ u) + +lemma hessian_smoothOn {U : Set E} (hU : IsOpen U) {u : E → F} + (hu : ContDiffOn ℝ ∞ u U) : ContDiffOn ℝ ∞ (hessian u) U := + (hu.fderiv_of_isOpen hU (m := ∞) (by simp)).fderiv_of_isOpen hU (m := ∞) (by simp) + +lemma word_sum {U : Set E} (hU : IsOpen U) (u : ι → E → F) + (hu : ∀ i, ContDiffOn ℝ ∞ (u i) U) (ws : List E) {x : E} (hx : x ∈ U) : + word ws (fun y => ∑ i, u i y) x = ∑ i, word ws (u i) x := by + induction ws generalizing x with + | nil => rfl + | cons w ws ih => + change dir w (word ws (fun y => ∑ i, u i y)) x = _ + rw [dir_congr (by filter_upwards [hU.mem_nhds hx] with y hy using ih hy)] + exact dir_sum _ (fun i => ((word_smoothOn hU (hu i) ws).contDiffAt + (hU.mem_nhds hx)).differentiableAt (by simp)) w + +lemma word_sub {U : Set E} (hU : IsOpen U) {f g : E → F} + (hf : ContDiffOn ℝ ∞ f U) (hg : ContDiffOn ℝ ∞ g U) + (ws : List E) {x : E} (hx : x ∈ U) : + word ws (fun y => f y-g y) x = word ws f x-word ws g x := by + induction ws generalizing x with + | nil => rfl + | cons w ws ih => + change dir w (word ws (fun y => f y-g y)) x = _ + rw [dir_congr (by filter_upwards [hU.mem_nhds hx] with y hy using ih hy)] + exact congrArg (fun T : E →L[ℝ] F => T w) + ((((word_smoothOn hU hf ws).contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp)).hasFDerivAt.sub + (((word_smoothOn hU hg ws).contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp)).hasFDerivAt).fderiv + +lemma frameLaplace_word {U : Set E} (hU : IsOpen U) {u : E → F} + (hu : ContDiffOn ℝ ∞ u U) (v : ι → E) (ws : List E) {x : E} (hx : x ∈ U) : + frameLaplace v (word ws u) x = word ws (frameLaplace v u) x := by + rw [show frameLaplace v u = fun y => ∑ i, dir (v i) (dir (v i) u) y from rfl, + word_sum hU _ (fun i => dir_smoothOn hU (dir_smoothOn hU hu _) _) ws hx] + apply Finset.sum_congr rfl + intro i _ + exact (word_dir_dir_comm hU hu _ _ ws hx).symm + +lemma frozen_equation_word (B : G →L[ℝ] (E →L[ℝ] E →L[ℝ] F) →L[ℝ] F) + {U : Set E} (hU : IsOpen U) {u r : E → F} {a : E → G} + (hu : ContDiffOn ℝ ∞ u U) (hr : ContDiffOn ℝ ∞ r U) + (ha : ContDiffOn ℝ ∞ a U) (heq : ∀ y ∈ U, B (a y) (hessian u y) = r y) + {x : E} (hx : x ∈ U) (v : ι → E) + (hframe : ∀ H : E →L[ℝ] E →L[ℝ] F, B (a x) H = ∑ i, H (v i) (v i)) + (ws : List E) : + frameLaplace v (word ws u) x = word ws r x- + word ws (fun y => B (a y-a x) (hessian u y)) x := by + have hg : frameLaplace v u =ᶠ[𝓝 x] + (fun y => r y-B (a y-a x) (hessian u y)) := by + filter_upwards [hU.mem_nhds hx] with y hy + rw [← heq y hy,map_sub,sub_apply,sub_sub_cancel] + rw [hframe] + apply Finset.sum_congr rfl + intro i _ + exact dir_dir (hu.contDiffAt (hU.mem_nhds hy)) _ _ + rw [frameLaplace_word hU hu v ws hx,word_congr hg] + exact word_sub hU hr ((B.contDiff.comp_contDiffOn (ha.sub contDiffOn_const)).clm_apply (hessian_smoothOn hU hu)) ws hx + +end HigherJet + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/FrozenPoisson.lean b/lean/OAI/Geometry/PrescribedPotential/FrozenPoisson.lean new file mode 100644 index 0000000000000000000000000000000000000000..fc7862940e3be03d9a10ef8cead499999e6bbad6 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/FrozenPoisson.lean @@ -0,0 +1,428 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.AnalyticSupport + +namespace OAI + +/-! Frozen Poisson. -/ + +section + + + +noncomputable section +open Matrix +open scoped ComplexOrder MatrixOrder SchwartzMap Real + +namespace FrozenPoisson +open EllipticKernel +variable {n : ℕ} + + +lemma posDef_factor (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) : + ∃ B : Matrix (Fin n) (Fin n) ℂ, IsUnit B ∧ H = star B * B := by + obtain ⟨B, hB⟩ := CStarAlgebra.nonneg_iff_eq_star_mul_self.mp hH.posSemidef.nonneg + refine ⟨B, ?_, hB⟩ + rw [Matrix.isUnit_iff_isUnit_det] + apply isUnit_iff_ne_zero.mpr + intro hb + have he := congrArg Matrix.det hB + rw [Matrix.det_mul, hb, mul_zero] at he + exact ne_of_gt hH.det_pos he + + + +def symbol (H : Matrix (Fin n) (Fin n) ℂ) (ξ : EC n) : ℝ := + (2 * Real.pi)^2 * traceBilin H (rankOne ξ) + +lemma trace_rankOne_factor (H B : Matrix (Fin n) (Fin n) ℂ) + (hB : H⁻¹ = star B * B) (ξ : EC n) : + traceBilin H (rankOne ξ) = (1/4 : ℝ) * ‖Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n) B ξ‖^2 := by + rw [traceBilin_apply, pull_rankOne, Matrix.mul_smul, Matrix.trace_smul] + simp only [Complex.smul_re, smul_eq_mul] + congr 1 + rw [Matrix.mul_vecMulVec, Matrix.trace_vecMulVec, dotProduct_comm, hB, + ← Matrix.mulVec_mulVec, Matrix.dotProduct_mulVec] + change (star (coordinateEquiv n ξ) ᵥ* Bᴴ ⬝ᵥ B *ᵥ coordinateEquiv n ξ).re = _ + rw [← Matrix.star_mulVec, dotProduct_comm] + have he := EuclideanSpace.inner_eq_star_dotProduct + (Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n) B ξ) (Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n) B ξ) + rw [Matrix.ofLp_toEuclideanCLM] at he + rw [coordinateEquiv_apply, ← he] + rw [inner_self_eq_norm_sq_to_K] + norm_cast + +lemma symbol_eq_norm_sq (H B : Matrix (Fin n) (Fin n) ℂ) + (hB : H⁻¹ = star B * B) (ξ : EC n) : + symbol H ξ = ‖Real.pi • Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n) B ξ‖^2 := by + rw [symbol, trace_rankOne_factor H B hB, norm_smul, Real.norm_eq_abs, + abs_of_pos Real.pi_pos] + ring + + +def factorMap (B : Matrix (Fin n) (Fin n) ℂ) : EC n →L[ℝ] EC n := + Real.pi • (Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n) B).restrictScalars ℝ + +lemma factorMap_injective (B : Matrix (Fin n) (Fin n) ℂ) (hB : IsUnit B) : + Function.Injective (factorMap B) := by + intro x y h + have he : Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n) B x = + Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n) B y := by + have hh := congrArg (fun w : EC n => (Real.pi⁻¹ : ℝ) • w) h + simpa [factorMap, smul_smul, Real.pi_ne_zero] using hh + apply WithLp.ofLp_injective + apply Matrix.mulVec_injective_iff_isUnit.mpr hB + exact congrArg WithLp.ofLp he + +lemma symbol_eq_factorMap (H B : Matrix (Fin n) (Fin n) ℂ) + (hB : H⁻¹ = star B * B) : symbol H = fun ξ => ‖factorMap B ξ‖^2 := + funext (symbol_eq_norm_sq H B hB) + +lemma symbol_nonneg (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) (ξ : EC n) : + 0 ≤ symbol H ξ := by + obtain ⟨B, _, hB⟩ := posDef_factor H⁻¹ hH.inv + rw [symbol_eq_factorMap H B hB] + positivity + +lemma symbol_temperate (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) : + (symbol H).HasTemperateGrowth := by + obtain ⟨B, _, hB⟩ := posDef_factor H⁻¹ hH.inv + rw [symbol_eq_factorMap H B hB] + exact (Function.hasTemperateGrowth_norm_sq _).comp (factorMap B).hasTemperateGrowth + + + +def inverseSymbol (H : Matrix (Fin n) (Fin n) ℂ) (ξ : EC n) : ℂ := + ((1 + symbol H ξ)⁻¹ : ℝ) + +lemma inverseSymbol_temperate (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) : + (inverseSymbol H).HasTemperateGrowth := by + obtain ⟨B, _, hB⟩ := posDef_factor H⁻¹ hH.inv + have he : inverseSymbol H = Complex.ofReal ∘ + ((fun ξ : EC n => (1 + ‖ξ‖^2)^(-1 : ℝ)) ∘ factorMap B) := by + funext ξ + simp only [Function.comp_apply, Real.rpow_neg_one, inverseSymbol, + symbol_eq_factorMap H B hB] + rw [he] + exact Complex.hasTemperateGrowth_ofReal.comp + ((Function.hasTemperateGrowth_one_add_norm_sq_rpow _ (-1)).comp + (factorMap B).hasTemperateGrowth) + + + +lemma inverseSymbol_weighted_bounded (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) : + ∃ C, ∀ ξ : EC n, ‖(1 + ‖ξ‖^2 : ℝ) * inverseSymbol H ξ‖ ≤ C := by + obtain ⟨B, hBu, hB⟩ := posDef_factor H⁻¹ hH.inv + obtain ⟨K, _, hK⟩ := (factorMap B).toLinearMap.injective_iff_antilipschitz.mp + (factorMap_injective B hBu) + refine ⟨1 + (K : ℝ)^2, fun ξ => ?_⟩ + have hle := hK.le_mul_norm (map_zero (factorMap B)) ξ + have hsq := pow_le_pow_left₀ (norm_nonneg ξ) hle 2 + change ‖ξ‖^2 ≤ ((K : ℝ) * ‖factorMap B ξ‖)^2 at hsq + rw [mul_pow] at hsq + simp only [inverseSymbol, symbol_eq_factorMap H B hB, ← Complex.ofReal_mul, + Complex.norm_real, Real.norm_eq_abs] + rw [abs_of_nonneg (by positivity), mul_inv_le_iff₀ (by positivity)] + nlinarith [sq_nonneg (K : ℝ), sq_nonneg ‖factorMap B ξ‖] + +open TemperedDistribution + + +def shifted (H : Matrix (Fin n) (Fin n) ℂ) : + 𝓢'(EC n, ℂ) →L[ℂ] 𝓢'(EC n, ℂ) := + fourierMultiplierCLM ℂ (fun ξ => ((1 + symbol H ξ : ℝ) : ℂ)) + + +def resolvent (H : Matrix (Fin n) (Fin n) ℂ) : + 𝓢'(EC n, ℂ) →L[ℂ] 𝓢'(EC n, ℂ) := + fourierMultiplierCLM ℂ (inverseSymbol H) + +lemma forward_temperate (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) : + (fun ξ => ((1 + symbol H ξ : ℝ) : ℂ)).HasTemperateGrowth := + Complex.hasTemperateGrowth_ofReal.comp + ((Function.HasTemperateGrowth.const 1).add (symbol_temperate H hH)) + +lemma shifted_resolvent (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (u : 𝓢'(EC n, ℂ)) : shifted H (resolvent H u) = u := by + rw [shifted, resolvent, + fourierMultiplierCLM_fourierMultiplierCLM_apply (inverseSymbol_temperate H hH) + (forward_temperate H hH)] + have he : inverseSymbol H * (fun ξ => ((1 + symbol H ξ : ℝ) : ℂ)) = + fun _ => (1 : ℂ) := by + funext ξ + simp only [Pi.mul_apply, inverseSymbol, ← Complex.ofReal_mul] + rw [inv_mul_cancel₀ (by linarith [symbol_nonneg H hH ξ]), Complex.ofReal_one] + rw [he, fourierMultiplierCLM_const] + simp + +lemma resolvent_shifted (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (u : 𝓢'(EC n, ℂ)) : resolvent H (shifted H u) = u := by + rw [shifted, resolvent, + fourierMultiplierCLM_fourierMultiplierCLM_apply (forward_temperate H hH) + (inverseSymbol_temperate H hH), mul_comm] + have he : inverseSymbol H * (fun ξ => ((1 + symbol H ξ : ℝ) : ℂ)) = + fun _ => (1 : ℂ) := by + funext ξ + simp only [Pi.mul_apply, inverseSymbol, ← Complex.ofReal_mul] + rw [inv_mul_cancel₀ (by linarith [symbol_nonneg H hH ξ]), Complex.ofReal_one] + rw [he, fourierMultiplierCLM_const] + simp + + +theorem resolvent_memSobolev (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + {s : ℝ} {u : 𝓢'(EC n, ℂ)} (hu : MemSobolev s 2 u) : + MemSobolev (s + 2) 2 (resolvent H u) := by + rw [add_comm s 2, ← memSobolev_besselPotential_iff] + have he : besselPotential (EC n) ℂ 2 (resolvent H u) = + fourierMultiplierCLM ℂ (fun ξ => (1 + ‖ξ‖^2 : ℝ) * inverseSymbol H ξ) u := by + rw [besselPotential, resolvent, + fourierMultiplierCLM_fourierMultiplierCLM_apply (inverseSymbol_temperate H hH) + (by fun_prop)] + congr 2 + ext ξ + simp [mul_comm] + rw [he] + apply hu.fourierMultiplierCLM_of_bounded _ (inverseSymbol_weighted_bounded H hH) + have hi := inverseSymbol_temperate H hH + fun_prop + + + +theorem frozen_sobolev_resolvent (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + {s : ℝ} (f : 𝓢'(EC n, ℂ)) (hf : MemSobolev s 2 f) : + ∃! u : 𝓢'(EC n, ℂ), shifted H u = f ∧ MemSobolev (s + 2) 2 u := by + refine ⟨resolvent H f, ⟨shifted_resolvent H hH f, resolvent_memSobolev H hH hf⟩, ?_⟩ + intro u hu + rw [← hu.1, resolvent_shifted H hH] + + +open LineDeriv + +section BilinearExpansion +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] +variable {ι : Type*} [Fintype ι] + +def rankTwo (v w : E) : Bilin E := (realInner v).smulRight (realInner w) + +lemma bilin_expansion (b : OrthonormalBasis ι ℝ E) (B : Bilin E) : + B = ∑ i, ∑ j, B (b i) (b j) • rankTwo (b i) (b j) := by + ext x y + conv_lhs => rw [← b.sum_repr' x, ← b.sum_repr' y] + simp only [map_sum, map_smul, _root_.sum_apply, + _root_.smul_apply, smul_eq_mul, rankTwo, + ContinuousLinearMap.smulRight_apply, realInner_apply, Finset.mul_sum] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + ring + +lemma second_symbol_expansion (b : OrthonormalBasis ι ℝ E) (L : SecondOrder E) (ξ : E) : + L (rankOne ξ) = ∑ i, ∑ j, + L (rankTwo (b i) (b j)) * inner ℝ ξ (b i) * inner ℝ ξ (b j) := by + rw [bilin_expansion b (rankOne ξ)] + simp only [map_sum, map_smul, rankOne, ContinuousLinearMap.smulRight_apply, + _root_.smul_apply, realInner_apply, smul_eq_mul] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + ring +end BilinearExpansion + +section Differential +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +lemma second_deriv_multiplier (v w : E) (u : 𝓢'(E, ℂ)) : + ∂_{v} (∂_{w} u) = fourierMultiplierCLM ℂ + (fun ξ => (-(2 * Real.pi)^2 : ℂ) * (inner ℝ ξ v : ℂ) * (inner ℝ ξ w : ℂ)) u := by + rw [lineDeriv_eq_fourierMultiplierCLM, lineDeriv_eq_fourierMultiplierCLM, + ContinuousLinearMap.map_smul, + fourierMultiplierCLM_fourierMultiplierCLM_apply (by fun_prop) (by fun_prop), + smul_smul] + have hg : ((fun ξ => (inner ℝ ξ w : ℂ)) * (fun ξ => (inner ℝ ξ v : ℂ))).HasTemperateGrowth := by + fun_prop + rw [← _root_.smul_apply, ← fourierMultiplierCLM_smul hg] + congr 2 + ext ξ + simp only [Pi.mul_apply, Pi.smul_apply, smul_eq_mul] + have hi := Complex.I_sq + calc + _ = ((2 * Real.pi : ℂ)^2 * Complex.I^2) * + (inner ℝ ξ w : ℂ) * (inner ℝ ξ v : ℂ) := by ring + _ = _ := by rw [hi]; ring + +lemma multiplier_sub {g₁ g₂ : E → ℂ} + (h₁ : g₁.HasTemperateGrowth) (h₂ : g₂.HasTemperateGrowth) (u : 𝓢'(E, ℂ)) : + fourierMultiplierCLM ℂ (g₁ - g₂) u = + fourierMultiplierCLM ℂ g₁ u - fourierMultiplierCLM ℂ g₂ u := by + simp only [fourierMultiplierCLM_apply] + rw [smulLeftCLM_sub h₁ h₂, _root_.sub_apply] + simp only [sub_eq_add_neg, FourierTransform.fourierInv_add, FourierTransform.fourierInv_neg] + +end Differential + +section DifferentialExpansion +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] +variable {ι : Type*} [Fintype ι] + + + +def differentialWithBasis (b : OrthonormalBasis ι ℝ E) (L : SecondOrder E) : + 𝓢'(E, ℂ) →L[ℂ] 𝓢'(E, ℂ) := + ∑ i, ∑ j, (L (rankTwo (b i) (b j)) : ℂ) • + (lineDerivOpCLM ℂ 𝓢'(E, ℂ) (b i) ∘L lineDerivOpCLM ℂ 𝓢'(E, ℂ) (b j)) + +lemma differentialWithBasis_fourier (b : OrthonormalBasis ι ℝ E) + (L : SecondOrder E) (u : 𝓢'(E, ℂ)) : + differentialWithBasis b L u = fourierMultiplierCLM ℂ + (fun ξ => (-(2 * Real.pi)^2 : ℂ) * (L (rankOne ξ) : ℂ)) u := by + let a : ι → ι → E → ℂ := fun i j ξ => (L (rankTwo (b i) (b j)) : ℂ) * + ((-(2 * Real.pi)^2 : ℂ) * (inner ℝ ξ (b i) : ℂ) * (inner ℝ ξ (b j) : ℂ)) + have ha i j : (a i j).HasTemperateGrowth := by dsimp [a]; fun_prop + have ht i j : (L (rankTwo (b i) (b j)) : ℂ) • ∂_{b i} (∂_{b j} u) = + fourierMultiplierCLM ℂ (a i j) u := by + rw [second_deriv_multiplier, ← _root_.smul_apply, + ← fourierMultiplierCLM_smul (by fun_prop)] + rfl + have hm : fourierMultiplierCLM ℂ (fun ξ => ∑ i, ∑ j, a i j ξ) = + ∑ i, ∑ j, fourierMultiplierCLM ℂ (a i j) := by + rw [fourierMultiplierCLM_sum ℂ (by intro i _; fun_prop)] + apply Finset.sum_congr rfl + intro i _ + exact fourierMultiplierCLM_sum ℂ (fun j _ => ha i j) + simp only [differentialWithBasis, _root_.sum_apply, _root_.smul_apply, + ContinuousLinearMap.comp_apply, lineDerivOpCLM_apply, ht] + have hsum : (∑ i, ∑ j, fourierMultiplierCLM ℂ (a i j)) u = + ∑ i, ∑ j, fourierMultiplierCLM ℂ (a i j) u := by + simp only [_root_.sum_apply] + rw [← hsum, ← hm] + congr 2 + ext ξ + rw [second_symbol_expansion b L ξ] + simp only [Complex.ofReal_sum, Complex.ofReal_mul, Finset.mul_sum] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + dsimp [a] + ring + +end DifferentialExpansion + + +def frozenDifferential (H : Matrix (Fin n) (Fin n) ℂ) : + 𝓢'(EC n, ℂ) →L[ℂ] 𝓢'(EC n, ℂ) := + differentialWithBasis (stdOrthonormalBasis ℝ (EC n)) (traceBilin H) + +lemma frozenDifferential_fourier (H : Matrix (Fin n) (Fin n) ℂ) (u : 𝓢'(EC n, ℂ)) : + frozenDifferential H u = fourierMultiplierCLM ℂ (fun ξ => (-symbol H ξ : ℝ)) u := by + rw [frozenDifferential, differentialWithBasis_fourier] + congr 2 + ext ξ + simp only [symbol, Complex.ofReal_neg, Complex.ofReal_mul, Complex.ofReal_pow, + Complex.ofReal_ofNat, neg_mul] + +lemma shifted_eq_identity_sub (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (u : 𝓢'(EC n, ℂ)) : shifted H u = u - frozenDifferential H u := by + rw [frozenDifferential_fourier] + have hn : (fun ξ => ((-symbol H ξ : ℝ) : ℂ)).HasTemperateGrowth := + Complex.hasTemperateGrowth_ofReal.comp (symbol_temperate H hH).neg + have he := multiplier_sub (Function.HasTemperateGrowth.const (1 : ℂ)) hn u + simpa only [Pi.sub_def, Complex.ofReal_neg, sub_neg_eq_add, shifted, + Complex.ofReal_add, Complex.ofReal_one, fourierMultiplierCLM_const, + _root_.smul_apply, ContinuousLinearMap.id_apply, one_smul] using he + + + +theorem frozen_differential_sobolev_resolvent + (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + {s : ℝ} (f : 𝓢'(EC n, ℂ)) (hf : MemSobolev s 2 f) : + ∃! u : 𝓢'(EC n, ℂ), u - frozenDifferential H u = f ∧ MemSobolev (s + 2) 2 u := by + simpa only [← shifted_eq_identity_sub H hH] using frozen_sobolev_resolvent H hH f hf + +section SmoothComparison +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] +variable {ι : Type*} [Fintype ι] + + +def smoothDifferentialWithBasis (b : OrthonormalBasis ι ℝ E) (L : SecondOrder E) : + 𝓢(E, ℝ) →L[ℝ] 𝓢(E, ℝ) := + ∑ i, ∑ j, L (rankTwo (b i) (b j)) • + (lineDerivOpCLM ℝ 𝓢(E, ℝ) (b i) ∘L lineDerivOpCLM ℝ 𝓢(E, ℝ) (b j)) + +lemma smooth_second_deriv (f : 𝓢(E, ℝ)) (v w x : E) : + (∂_{v} (∂_{w} f)) x = fderiv ℝ (fderiv ℝ f) x v w := by + simp only [SchwartzMap.lineDerivOp_apply_eq_fderiv] + change fderiv ℝ (fun y => fderiv ℝ f y w) x v = _ + exact PotentialKaehler.fderiv_eval_derivative f.smooth'.contDiffAt v w + +lemma smoothDifferentialWithBasis_apply (b : OrthonormalBasis ι ℝ E) + (L : SecondOrder E) (f : 𝓢(E, ℝ)) (x : E) : + smoothDifferentialWithBasis b L f x = L (fderiv ℝ (fderiv ℝ f) x) := by + rw [bilin_expansion b (fderiv ℝ (fderiv ℝ f) x)] + simp only [smoothDifferentialWithBasis, _root_.sum_apply, _root_.smul_apply, + ContinuousLinearMap.comp_apply, lineDerivOpCLM_apply, smooth_second_deriv, map_sum, map_smul, smul_eq_mul] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + ring + +def complexify : 𝓢(E, ℝ) →L[ℝ] 𝓢(E, ℂ) := + SchwartzMap.postcompCLM Complex.ofRealCLM + +lemma complexify_deriv (f : 𝓢(E, ℝ)) (v : E) : + complexify (∂_{v} f) = ∂_{v} (complexify f) := by + ext x + change Complex.ofReal (fderiv ℝ f x v) = + fderiv ℝ (Complex.ofRealCLM ∘ f) x v + rw [(Complex.ofRealCLM.hasFDerivAt.comp x (f.hasFDerivAt x)).fderiv] + rfl + +variable [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +lemma weak_complexify_deriv (f : 𝓢(E, ℝ)) (v : E) : + (complexify (∂_{v} f) : 𝓢'(E, ℂ)) = ∂_{v} (complexify f : 𝓢'(E, ℂ)) := by + rw [complexify_deriv] + exact (TemperedDistribution.lineDerivOp_toTemperedDistributionCLM_eq _ v).symm + +lemma differentialWithBasis_real (b : OrthonormalBasis ι ℝ E) + (L : SecondOrder E) (f : 𝓢(E, ℝ)) : + differentialWithBasis b L (complexify f : 𝓢'(E, ℂ)) = + (complexify (smoothDifferentialWithBasis b L f) : 𝓢'(E, ℂ)) := by + simp only [differentialWithBasis, smoothDifferentialWithBasis, + _root_.sum_apply, _root_.smul_apply, ContinuousLinearMap.comp_apply, + lineDerivOpCLM_apply, map_sum, map_smul] + simp only [ContinuousLinearMap.map_smul_of_tower] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + rw [weak_complexify_deriv, weak_complexify_deriv] + apply ContinuousLinearMap.ext + intro h + exact Complex.coe_smul _ _ + +end SmoothComparison + + + +lemma frozenDifferential_real_trace (H : Matrix (Fin n) (Fin n) ℂ) (f : 𝓢(EC n, ℝ)) : + ∃ l : 𝓢(EC n, ℝ), + (∀ x, l x = traceBilin H (fderiv ℝ (fderiv ℝ f) x)) ∧ + frozenDifferential H (SchwartzMap.toTemperedDistributionCLM (EC n) ℂ + MeasureTheory.volume (complexify f)) = + SchwartzMap.toTemperedDistributionCLM (EC n) ℂ MeasureTheory.volume (complexify l) := by + refine ⟨smoothDifferentialWithBasis (stdOrthonormalBasis ℝ (EC n)) (traceBilin H) f, ?_, ?_⟩ + · exact fun x => smoothDifferentialWithBasis_apply _ _ _ x + · exact differentialWithBasis_real _ _ _ + +end FrozenPoisson + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/GlobalBounds.lean b/lean/OAI/Geometry/PrescribedPotential/GlobalBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..cdeacd46aa99afb1f4e20cfe956fe46a0dd43dc5 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/GlobalBounds.lean @@ -0,0 +1,119 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CutoffHigher +import OAI.Geometry.PrescribedPotential.GlobalCompletion +import OAI.Geometry.PrescribedPotential.GlobalError +import OAI.Geometry.PrescribedPotential.GlobalParametrixEquation + +namespace OAI + +/-! Global Bounds. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory TemperedDistribution LineDeriv +open scoped SchwartzMap ContDiff Classical BoundedContinuousFunction ComplexOrder MatrixOrder +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart MetricLocalization +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace Localizers +variable {D : Localizers A ι} + +lemma BoundedCore.comp {s t r : ℝ} {S T : Smooth A →ₗ[ℝ] Smooth A} + (hS : D.BoundedCore t r S) (hT : D.BoundedCore s t T) : + D.BoundedCore s r (S.comp T) := by + obtain ⟨C, hC, hc⟩ := hS + obtain ⟨B, hB, hb⟩ := hT + refine ⟨C * B, mul_nonneg hC hB, fun f => ?_⟩ + exact (hc (T f)).trans (by simpa only [mul_assoc] using mul_le_mul_of_nonneg_left (hb f) hC) + +lemma BoundedCore.source_mono {s t r : ℝ} {T : Smooth A →ₗ[ℝ] Smooth A} + (hT : D.BoundedCore s t T) (hrs : s ≤ r) : D.BoundedCore r t T := by + simpa only [LinearMap.comp_id] using hT.comp (D.boundedCore_lower hrs) + +lemma BoundedCore.target_mono {s t r : ℝ} {T : Smooth A →ₗ[ℝ] Smooth A} + (hT : D.BoundedCore s t T) (hrt : r ≤ t) : D.BoundedCore s r T := by + simpa only [LinearMap.id_comp] using (D.boundedCore_lower hrt).comp hT +end Localizers + +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +lemma error_bound_zero (m : ℝ) (hm : 1 ≤ m) : + D.localizers.BoundedCore 0 0 (D.error m hm) := by + obtain ⟨C, hC, hc⟩ := D.error_bound + exact ⟨C / m, div_nonneg hC (le_trans (by norm_num) hm), hc m hm⟩ + +lemma error_piece_bound_integer (m : ℝ) (hm : 1 ≤ m) (k : ℕ) (p : ι) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ f : Smooth A, + ‖D.localizers.embed ((k : ℝ) + 1) (globalize (D.patch p).index (D.outerCutoff p) + ((D.patch p).cutoffError (D.cutoff p).val + ((D.patch p).localInverse m hm (D.forcing p f))))‖ ≤ + C * ‖D.localizers.embed (k : ℝ) f‖ := by + obtain ⟨B, hB, hb⟩ := globalize_integer_bound D.localizers (D.patch p).index (D.outerCutoff p) (k + 1) + have he : CoreBound ((k : ℝ) + 2) ((k : ℝ) + 1) + ((D.patch p).cutoffError (D.cutoff p).val) := by + convert schwartzCutoffError_bound_integer (D.patch p).coefficients + (D.patch p).coefficients_temperate (D.cutoff p).val (k + 1) using 1 <;> push_cast <;> first | rfl | ring + obtain ⟨C, hC, hc⟩ := he.comp ((D.patch p).localInverse_bound m hm k) + refine ⟨B * C, mul_nonneg hB hC, fun f => ?_⟩ + have hh := hb ((D.patch p).cutoffError (D.cutoff p).val + ((D.patch p).localInverse m hm (D.forcing p f))) + rw [Nat.cast_add, Nat.cast_one] at hh + apply hh.trans + have hr := (hc (D.forcing p f)).trans + (mul_le_mul_of_nonneg_left (D.forcing_bound p (k : ℝ) f) hC) + simpa only [mul_assoc, Function.comp_apply, ParametrixPatch.differential] using mul_le_mul_of_nonneg_left hr hB + + +theorem error_bound_integer (m : ℝ) (hm : 1 ≤ m) (k : ℕ) : + D.localizers.BoundedCore (k : ℝ) ((k : ℝ) + 1) (D.error m hm) := by + choose C hC hc using D.error_piece_bound_integer m hm k + refine ⟨∑ p, C p, Finset.sum_nonneg (fun p _ => hC p), fun f => ?_⟩ + rw [error_apply, map_sum, Finset.sum_mul] + exact (norm_sum_le _ _).trans (Finset.sum_le_sum (fun p _ => hc p f)) + +lemma complexL_reconstruction (f : Smooth A) : + complexL g f = ∑ p, globalize (D.patch p).index (D.outerCutoff p) + ((D.patch p).differential (SchwartzMap.smulLeftCLM ℂ (D.cutoff p).val (D.forcing p f))) := by + conv_lhs => rw [← D.forcing_reconstruction f, map_sum] + apply Finset.sum_congr rfl + intro p _ + exact complexL_globalize (D.patch p) (D.cutoff p) (D.outerCutoff p) + (D.cutoff_support p) (D.outerCutoff_one p) _ + +lemma complexL_piece_bound (p : ι) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ f : Smooth A, + ‖D.localizers.embed 0 (globalize (D.patch p).index (D.outerCutoff p) + ((D.patch p).differential (SchwartzMap.smulLeftCLM ℂ (D.cutoff p).val (D.forcing p f))))‖ ≤ + C * ‖D.localizers.embed 2 f‖ := by + obtain ⟨B, hB, hb⟩ := globalize_integer_bound D.localizers (D.patch p).index (D.outerCutoff p) 0 + have hk : CoreBound 2 2 (SchwartzMap.smulLeftCLM ℂ (D.cutoff p).val) := + coreBound_product_integer (D.cutoff p).val 2 + obtain ⟨C, hC, hc⟩ := (schwartzDifferential_bound (D.patch p).coefficients + (D.patch p).coefficients_temperate).comp hk + refine ⟨B * C, mul_nonneg hB hC, fun f => ?_⟩ + have hh := hb ((D.patch p).differential (SchwartzMap.smulLeftCLM ℂ (D.cutoff p).val (D.forcing p f))) + rw [Nat.cast_zero] at hh + apply hh.trans + have hr := (hc (D.forcing p f)).trans + (mul_le_mul_of_nonneg_left (D.forcing_bound p 2 f) hC) + simpa only [mul_assoc, Function.comp_apply, ParametrixPatch.differential] using mul_le_mul_of_nonneg_left hr hB + + +theorem complexL_bound : D.localizers.BoundedCore 2 0 (complexL g) := by + choose C hC hc using D.complexL_piece_bound + refine ⟨∑ p, C p, Finset.sum_nonneg (fun p _ => hC p), fun f => ?_⟩ + rw [D.complexL_reconstruction, map_sum, Finset.sum_mul] + exact (norm_sum_le _ _).trans (Finset.sum_le_sum (fun p _ => hc p f)) + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/GlobalCompletion.lean b/lean/OAI/Geometry/PrescribedPotential/GlobalCompletion.lean new file mode 100644 index 0000000000000000000000000000000000000000..b2f86fd6fca71e125226e948fa0e1bee3ffff6e8 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/GlobalCompletion.lean @@ -0,0 +1,126 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CoreBounds +import OAI.Geometry.PrescribedPotential.GlobalPartition + +namespace OAI + +/-! Global Completion. -/ + +section + + + +noncomputable section +open Set Filter Topology MeasureTheory +open scoped SchwartzMap ContDiff Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace Localizers +variable (D : Localizers A ι) + +def BoundedCore (s t : ℝ) (T : Smooth A →ₗ[ℝ] Smooth A) : Prop := + ∃ C : ℝ, 0 ≤ C ∧ ∀ f, ‖D.embed t (T f)‖ ≤ C * ‖D.embed s f‖ + +def extendCore (s t : ℝ) (T : Smooth A →ₗ[ℝ] Smooth A) : + D.Sobolev s →L[ℝ] D.Sobolev t := + ((D.embed t).comp T).extendOfNorm (D.embed s) + +lemma extendCore_embed {s t : ℝ} {T : Smooth A →ₗ[ℝ] Smooth A} + (hT : D.BoundedCore s t T) (f : Smooth A) : + D.extendCore s t T (D.embed s f) = D.embed t (T f) := + LinearMap.extendOfNorm_eq (D.embed_dense s) (by + obtain ⟨C, _, h⟩ := hT + exact ⟨C, h⟩) f + +lemma extendCore_norm {s t : ℝ} {T : Smooth A →ₗ[ℝ] Smooth A} + {C : ℝ} (hC : 0 ≤ C) (hT : ∀ f, ‖D.embed t (T f)‖ ≤ C * ‖D.embed s f‖) : + ‖D.extendCore s t T‖ ≤ C := by + apply ContinuousLinearMap.opNorm_le_bound _ hC + exact LinearMap.norm_extendOfNorm_apply_le (D.embed_dense s) C hT + +lemma boundedCore_lower {s t : ℝ} (hst : t ≤ s) : + D.BoundedCore s t (LinearMap.id : Smooth A →ₗ[ℝ] Smooth A) := by + obtain ⟨C, hC, hc⟩ := CoreBound.id (E := EC d) hst + refine ⟨C, hC, fun f => ?_⟩ + change ‖D.coordinates t f‖ ≤ C * ‖D.coordinates s f‖ + apply (pi_norm_le_iff_of_nonneg (mul_nonneg hC (norm_nonneg _))).mpr + intro p + exact (hc (localize A (D.index p) (D.weight p) (D.support_sub p) f)).trans + (mul_le_mul_of_nonneg_left (norm_le_pi_norm (D.coordinates s f) p) hC) + +def lower (s t : ℝ) : D.Sobolev s →L[ℝ] D.Sobolev t := + D.extendCore s t LinearMap.id + +lemma lower_embed {s t : ℝ} (hst : t ≤ s) (f : Smooth A) : + D.lower s t (D.embed s f) = D.embed t f := + D.extendCore_embed (D.boundedCore_lower hst) f + +lemma lower_self (s : ℝ) : D.lower s s = ContinuousLinearMap.id ℝ _ := by + apply DFunLike.coe_injective + apply (D.embed_dense s).equalizer (D.lower s s).continuous continuous_id + funext f + exact D.lower_embed le_rfl f + +lemma lower_comp {s t r : ℝ} (hst : t ≤ s) (htr : r ≤ t) : + (D.lower t r).comp (D.lower s t) = D.lower s r := by + apply DFunLike.coe_injective + apply (D.embed_dense s).equalizer (by fun_prop) (by fun_prop) + funext f + simp only [Function.comp_apply, ContinuousLinearMap.comp_apply, + D.lower_embed hst, D.lower_embed htr, D.lower_embed (htr.trans hst)] + + +def distribution (s : ℝ) (p : ι) : D.Sobolev s →L[ℝ] 𝓢'(EC d, ℂ) := + (realize s).restrictScalars ℝ ∘L (ContinuousLinearMap.proj p) ∘L (D.closedSpace s).subtypeL + +lemma distribution_apply (s : ℝ) (p : ι) (u : D.Sobolev s) : + D.distribution s p u = realize s (u.val p) := rfl + +lemma distribution_embed (s : ℝ) (p : ι) (f : Smooth A) : + D.distribution s p (D.embed s f) = + SchwartzMap.toTemperedDistributionCLM (EC d) ℂ volume + (localize A (D.index p) (D.weight p) (D.support_sub p) f) := + realize_schwartzCoord s _ + +lemma distribution_lower {s t : ℝ} (hst : t ≤ s) (p : ι) (u : D.Sobolev s) : + D.distribution t p (D.lower s t u) = D.distribution s p u := by + have he : (D.distribution t p) ∘ D.lower s t = D.distribution s p := by + apply (D.embed_dense s).equalizer (by fun_prop) (by fun_prop) + funext f + simp only [Function.comp_apply, D.lower_embed hst, distribution_embed] + exact congr_fun he u + +lemma lower_injective {s t : ℝ} (hst : t ≤ s) : Function.Injective (D.lower s t) := by + intro u v huv + apply Subtype.ext + funext p + apply realize_injective s + change D.distribution s p u = D.distribution s p v + rw [← D.distribution_lower hst p u, ← D.distribution_lower hst p v, huv] + +lemma lower_extendCore {s t r : ℝ} (htr : r ≤ t) (T : Smooth A →ₗ[ℝ] Smooth A) + (hT : D.BoundedCore s t T) (hR : D.BoundedCore s r T) (u : D.Sobolev s) : + D.lower t r (D.extendCore s t T u) = D.extendCore s r T u := by + have he : (D.lower t r) ∘ D.extendCore s t T = D.extendCore s r T := by + apply (D.embed_dense s).equalizer (by fun_prop) (by fun_prop) + funext f + simp only [Function.comp_apply, D.extendCore_embed hT, D.extendCore_embed hR, D.lower_embed htr] + exact congr_fun he u + +lemma extendCore_lower {s t r : ℝ} (hst : t ≤ s) (T : Smooth A →ₗ[ℝ] Smooth A) + (hT : D.BoundedCore t r T) (hS : D.BoundedCore s r T) (u : D.Sobolev s) : + D.extendCore t r T (D.lower s t u) = D.extendCore s r T u := by + have he : (D.extendCore t r T) ∘ D.lower s t = D.extendCore s r T := by + apply (D.embed_dense s).equalizer (by fun_prop) (by fun_prop) + funext f + simp only [Function.comp_apply, D.lower_embed hst, D.extendCore_embed hT, D.extendCore_embed hS] + exact congr_fun he u +end Localizers +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/GlobalConjugation.lean b/lean/OAI/Geometry/PrescribedPotential/GlobalConjugation.lean new file mode 100644 index 0000000000000000000000000000000000000000..69f071afd8cccb349783a7050cd3d913f5549b50 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/GlobalConjugation.lean @@ -0,0 +1,115 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalCompletion +import OAI.Geometry.PrescribedPotential.GlobalParametrix +import OAI.Geometry.PrescribedPotential.RealSobolev +import OAI.Geometry.PrescribedPotential.SchwartzConjugation + +namespace OAI + +/-! Global Conjugation. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory LineDeriv +open scoped ContDiff SchwartzMap Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +namespace ChartCutoff +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] {U : Set E} +def conjugate (κ : ChartCutoff U) : ChartCutoff U where + val := schwartzConj κ.val + compact := by + apply HasCompactSupport.of_support_subset_isCompact κ.compact + intro x hx + exact subset_tsupport _ (fun h => hx (by simp only [schwartzConj_apply,h,star_zero])) + support_sub := by + apply Subset.trans _ κ.support_sub + apply closure_mono + intro x hx h + exact hx (by simp only [schwartzConj_apply,h,star_zero]) +@[simp] lemma conjugate_apply (κ : ChartCutoff U) (x : E) : κ.conjugate x = star (κ x) := rfl +end ChartCutoff +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +namespace Smooth + +def conjugate : Smooth A →ₗ[ℝ] Smooth A where + toFun f := ⟨fun x => star (f x),fun i => Complex.conjCLE.toContinuousLinearMap.contDiff.comp_contDiffOn (f.smooth i)⟩ + map_add' f h := by ext x; exact star_add _ _ + map_smul' c f := by ext x; exact map_smul Complex.conjCLE.toContinuousLinearMap c (f x) +@[simp] lemma conjugate_apply (f : Smooth A) (x : X) : conjugate f x = star (f x) := rfl + +def realify : Smooth A →ₗ[ℝ] Smooth A := (1/2 : ℝ) • (LinearMap.id + conjugate) +lemma realify_apply (f : Smooth A) (x : X) : realify f x = ((f x).re : ℂ) := by + change (1/2 : ℝ) • (f x + star (f x)) = _ + apply Complex.ext <;> simp + ring +lemma realify_real (f : Smooth A) : realify f ∈ realSmoothSpace A := by + intro x + rw [realify_apply] + rfl +lemma realify_eq_of_real (f : RealSmooth A) : realify f.val = f.val := by + ext x + rw [realify_apply] + exact Complex.ext rfl (f.property x).symm +end Smooth +variable [T2Space X] {ι : Type*} [Fintype ι] +lemma conjugate_globalize (i : Fin A.count) (κ : ChartCutoff (A.euclideanChart i).target) + (f : 𝓢(EC d,ℂ)) : + Smooth.conjugate (globalize i κ f) = globalize i κ.conjugate (schwartzConj f) := by + ext x + rw [Smooth.conjugate_apply,globalize_apply,globalize_apply] + split_ifs <;> simp only [ChartCutoff.conjugate_apply,schwartzConj_apply,star_mul',star_zero] +namespace GluingData +variable [CompactSpace X] {g : KaehlerMetric A} (D : GluingData g ι) + +lemma conjugate_integer_bound (k : ℕ) : D.localizers.BoundedCore (k : ℝ) (k : ℝ) Smooth.conjugate := by + have hb (p : ι) := globalize_integer_bound D.localizers (D.patch p).index (D.cutoff p).conjugate k + choose B hB hb using hb + obtain ⟨C,hC,hc⟩ := schwartzConj_integer_bound (E := EC d) k + refine ⟨∑ p, B p*C,Finset.sum_nonneg (fun p _ => mul_nonneg (hB p) hC),fun f => ?_⟩ + have he : Smooth.conjugate f = ∑ p, globalize (D.patch p).index (D.cutoff p).conjugate + (schwartzConj (D.forcing p f)) := by + conv_lhs => rw [← D.forcing_reconstruction f] + rw [map_sum] + apply Finset.sum_congr rfl + intro p _ + exact conjugate_globalize _ _ _ + rw [he,map_sum,Finset.sum_mul] + apply (norm_sum_le _ _).trans + apply Finset.sum_le_sum + intro p _ + exact (hb p _).trans ((mul_le_mul_of_nonneg_left (hc _) (hB p)).trans (by + simpa only [mul_assoc] using mul_le_mul_of_nonneg_left (D.forcing_bound p (k : ℝ) f) + (mul_nonneg (hB p) hC))) + +lemma embed_realify (k : ℕ) (f : Smooth A) : + D.localizers.embed (k : ℝ) (Smooth.realify f) = + (1/2 : ℝ) • (D.localizers.embed (k : ℝ) f + D.localizers.embed (k : ℝ) (Smooth.conjugate f)) := by + change D.localizers.embed (k : ℝ) ((1/2 : ℝ) • (f + Smooth.conjugate f)) = _ + rw [map_smul,map_add] + +lemma half_add_norm_le {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + (u v : E) (C : ℝ) (hC : ‖v‖ ≤ C*‖u‖) : + ‖(1/2 : ℝ) • (u+v)‖ ≤ ((1/2 : ℝ)*(1+C))*‖u‖ := by + rw [norm_smul] + norm_num only [norm_div,norm_one,Real.norm_ofNat] + calc + _ ≤ (1/2 : ℝ)*(‖u‖+‖v‖) := mul_le_mul_of_nonneg_left (norm_add_le _ _) (by norm_num) + _ ≤ (1/2 : ℝ)*(‖u‖+C*‖u‖) := mul_le_mul_of_nonneg_left (add_le_add le_rfl hC) (by norm_num) + _ = _ := by ring + +lemma realify_integer_bound (k : ℕ) : D.localizers.BoundedCore (k : ℝ) (k : ℝ) Smooth.realify := by + obtain ⟨C,hC,hb⟩ := D.conjugate_integer_bound k + refine ⟨(1/2 : ℝ)*(1+C),mul_nonneg (by norm_num) (by linarith),fun f => ?_⟩ + rw [D.embed_realify] + exact half_add_norm_le _ _ C (hb f) +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/GlobalError.lean b/lean/OAI/Geometry/PrescribedPotential/GlobalError.lean new file mode 100644 index 0000000000000000000000000000000000000000..680f4da0733a9df40896e4762c79f971a652e94b --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/GlobalError.lean @@ -0,0 +1,70 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalParametrixEquation + +namespace OAI + +/-! Global Error. -/ + +section + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory +open scoped SchwartzMap ContDiff Classical ComplexOrder MatrixOrder +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart MetricLocalization +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +lemma error_piece_bound (p : ι) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ m (hm : 1 ≤ m) (f : Smooth A), + ‖D.localizers.embed 0 (globalize (D.patch p).index (D.outerCutoff p) + ((D.patch p).cutoffError (D.cutoff p).val + ((D.patch p).localInverse m hm (D.forcing p f))))‖ ≤ + C / m * ‖D.localizers.embed 0 f‖ := by + obtain ⟨B, hB, hb⟩ := globalize_integer_bound D.localizers (D.patch p).index (D.outerCutoff p) 0 + let c := cutoffErrorConstant (D.patch p).matrix (D.patch p).positive + (coefficientBCF (D.patch p).coefficient) (D.cutoff p).val + refine ⟨B * |c|, mul_nonneg hB (abs_nonneg _), fun m hm f => ?_⟩ + have hm0 : 0 ≤ m := le_trans (by norm_num) hm + have hb' := hb ((D.patch p).cutoffError (D.cutoff p).val + ((D.patch p).localInverse m hm (D.forcing p f))) + rw [Nat.cast_zero] at hb' + apply hb'.trans + calc + _ ≤ B * (c / m * ‖schwartzCoord 0 (D.forcing p f)‖) := + mul_le_mul_of_nonneg_left ((D.patch p).cutoffError_bound m hm (D.cutoff p).val (D.forcing p f)) hB + _ ≤ B * (|c| / m * ‖D.localizers.embed 0 f‖) := by + apply mul_le_mul_of_nonneg_left _ hB + exact mul_le_mul (div_le_div_of_nonneg_right (le_abs_self _) hm0) + (D.forcing_bound p 0 f) (norm_nonneg _) (div_nonneg (abs_nonneg _) hm0) + _ = _ := by ring + + +theorem error_bound : + ∃ C : ℝ, 0 ≤ C ∧ ∀ m (hm : 1 ≤ m) (f : Smooth A), + ‖D.localizers.embed 0 (D.error m hm f)‖ ≤ C / m * ‖D.localizers.embed 0 f‖ := by + choose C hC hc using D.error_piece_bound + refine ⟨∑ p, C p, Finset.sum_nonneg (fun p _ => hC p), fun m hm f => ?_⟩ + rw [error_apply, map_sum, Finset.sum_div, Finset.sum_mul] + exact (norm_sum_le _ _).trans (Finset.sum_le_sum (fun p _ => hc p m hm f)) + + + +theorem exists_contractive_shift : + ∃ m : ℝ, ∃ hm : 1 ≤ m, ∃ q : ℝ, 0 ≤ q ∧ q < 1 ∧ + ∀ f : Smooth A, ‖D.localizers.embed 0 (D.error m hm f)‖ ≤ q * ‖D.localizers.embed 0 f‖ := by + obtain ⟨C, hC, hc⟩ := D.error_bound + have hm : 1 ≤ C + 1 := by linarith + refine ⟨C + 1, hm, C / (C + 1), div_nonneg hC (by linarith), ?_, hc _ hm⟩ + exact (div_lt_one (by linarith : 0 < C + 1)).mpr (by linarith) + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/GlobalExtension.lean b/lean/OAI/Geometry/PrescribedPotential/GlobalExtension.lean new file mode 100644 index 0000000000000000000000000000000000000000..12ef970ce3e636c72ff5f34c75350b1d03c551a0 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/GlobalExtension.lean @@ -0,0 +1,124 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.ChartTransport +import OAI.Geometry.PrescribedPotential.GlobalSobolev + +namespace OAI + +/-! Global Extension. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory +open scoped ContDiff SchwartzMap Classical + +namespace GlobalElliptic +open Anticanonical EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] + {A : ComplexAtlas d X} + + +def extendFun (i : Fin A.count) (f : EC d → ℂ) (x : X) : ℂ := + if x ∈ (A.euclideanChart i).source then f (A.euclideanChart i x) else 0 + +lemma extendFun_apply {i : Fin A.count} (f : EC d → ℂ) {x : X} + (hx : x ∈ (A.euclideanChart i).source) : + extendFun (A := A) i f x = f (A.euclideanChart i x) := ite_eq_left hx + +lemma extendFun_support (i : Fin A.count) (f : EC d → ℂ) : + Function.support (extendFun (A := A) i f) ⊆ + (A.euclideanChart i).symm '' tsupport f := by + intro x hx + have hn : extendFun (A := A) i f x ≠ 0 := hx + by_cases hi : x ∈ (A.euclideanChart i).source + · rw [extendFun_apply f hi] at hn + exact ⟨A.euclideanChart i x, subset_tsupport f hn, (A.euclideanChart i).left_inv hi⟩ + · exact (hn (ite_eq_right hi)).elim + +variable [T2Space X] + +lemma extendFun_smooth (i : Fin A.count) (f : EC d → ℂ) + (hf : ContDiff ℝ ∞ f) (hc : HasCompactSupport f) + (hs : tsupport f ⊆ (A.euclideanChart i).target) : + ∀ j, ContDiffOn ℝ ∞ (extendFun (A := A) i f ∘ (A.euclideanChart j).symm) + (A.euclideanChart j).target := by + intro j y hy + let e := A.euclideanChart i + let q := A.euclideanChart j + let K := e.symm '' tsupport f + have hK : IsCompact K := hc.image_of_continuousOn (e.symm.continuousOn.mono hs) + have hKi : K ⊆ e.source := by rintro x ⟨z, hz, rfl⟩; exact e.symm.mapsTo (hs hz) + by_cases hi : q.symm y ∈ e.source + · let t := q.symm.trans e + have ht : y ∈ t.source := ⟨hy, hi⟩ + have hsm := (hf.contDiffAt (x := t y)).comp y + ((A.euclidean_transition_smooth j i).contDiffAt (t.open_source.mem_nhds ht)) + apply (hsm.congr_of_eventuallyEq ?_).contDiffWithinAt + filter_upwards [t.open_source.mem_nhds ht] with z hz + exact ite_eq_left hz.2 + · have hnot : q.symm y ∉ K := fun hk => hi (hKi hk) + have hn := (q.symm.continuousAt hy) (hK.isClosed.isOpen_compl.mem_nhds hnot) + apply ((contDiffAt_const (c := (0 : ℂ))).congr_of_eventuallyEq ?_).contDiffWithinAt + filter_upwards [hn] with z hz + exact Function.notMem_support.mp (fun hp => hz (extendFun_support i f hp)) + + +def extend (i : Fin A.count) (f : EC d → ℂ) (hf : ContDiff ℝ ∞ f) + (hc : HasCompactSupport f) (hs : tsupport f ⊆ (A.euclideanChart i).target) : Smooth A := + ⟨extendFun i f, extendFun_smooth i f hf hc hs⟩ + +lemma extend_tsupport (i : Fin A.count) (f : EC d → ℂ) (hf : ContDiff ℝ ∞ f) + (hc : HasCompactSupport f) (hs : tsupport f ⊆ (A.euclideanChart i).target) : + tsupport (extend i f hf hc hs : X → ℂ) ⊆ (A.euclideanChart i).symm '' tsupport f := by + apply closure_minimal (extendFun_support i f) + exact (hc.image_of_continuousOn ((A.euclideanChart i).symm.continuousOn.mono hs)).isClosed + + +def globalize (i : Fin A.count) (κ : ChartCutoff (A.euclideanChart i).target) : + 𝓢(EC d, ℂ) →ₗ[ℝ] Smooth A where + toFun f := extend i (fun y => κ y * f y) + ((κ.val.smooth ⊤).mul (f.smooth ⊤)) (κ.product_compact f) + ((κ.product_tsupport (A.euclideanChart i).open_target (f.smooth ⊤).contDiffOn).trans κ.support_sub) + map_add' f h := by + apply Smooth.ext + intro x + change extendFun i (fun y => κ y * (f + h) y) x = + extendFun i (fun y => κ y * f y) x + extendFun i (fun y => κ y * h y) x + by_cases hx : x ∈ (A.euclideanChart i).source + · simp only [extendFun, ite_eq_left hx, add_apply] + exact mul_add _ _ _ + · simp only [extendFun, ite_eq_right hx, add_zero] + map_smul' c f := by + apply Smooth.ext + intro x + change extendFun i (fun y => κ y * (c • f) y) x = + c • extendFun i (fun y => κ y * f y) x + by_cases hx : x ∈ (A.euclideanChart i).source + · simp only [extendFun, ite_eq_left hx, smul_apply, + Complex.real_smul] + ring + · simp only [extendFun, ite_eq_right hx, smul_zero] + +@[simp] lemma globalize_apply (i : Fin A.count) (κ : ChartCutoff (A.euclideanChart i).target) + (f : 𝓢(EC d, ℂ)) (x : X) : + globalize i κ f x = if x ∈ (A.euclideanChart i).source then + κ (A.euclideanChart i x) * f (A.euclideanChart i x) else 0 := rfl + +lemma globalize_tsupport (i : Fin A.count) (κ : ChartCutoff (A.euclideanChart i).target) + (f : 𝓢(EC d, ℂ)) : + tsupport (globalize i κ f : X → ℂ) ⊆ + (A.euclideanChart i).symm '' tsupport (κ : EC d → ℂ) := by + exact (extend_tsupport i (fun y => κ y * f y) + ((κ.val.smooth ⊤).mul (f.smooth ⊤)) (κ.product_compact f) + ((κ.product_tsupport (A.euclideanChart i).open_target (f.smooth ⊤).contDiffOn).trans + κ.support_sub)).trans (image_mono + (κ.product_tsupport (A.euclideanChart i).open_target (f.smooth ⊤).contDiffOn)) + +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/GlobalFiniteEmbedding.lean b/lean/OAI/Geometry/PrescribedPotential/GlobalFiniteEmbedding.lean new file mode 100644 index 0000000000000000000000000000000000000000..42e3297d2ffe3c26d1cc598fbfe6d70d0dabab96 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/GlobalFiniteEmbedding.lean @@ -0,0 +1,69 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.FiniteSobolevEmbedding +import OAI.Geometry.PrescribedPotential.GlobalPartition +import OAI.Geometry.PrescribedPotential.GlobalStrongEmbedding +import OAI.Geometry.PrescribedPotential.KaehlerClosedDerivatives + +namespace OAI + +/-! Global Finite Embedding. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical +namespace GlobalElliptic +open Anticanonical EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace Localizers +variable (D : Localizers A ι) + +omit [T2Space X] [CompactSpace X] in +lemma exists_weight_ne_zero (x : X) : ∃ p, D.weight p x ≠ 0 := by + by_contra! hn + have h := D.sum_one x + simp only [hn, Finset.sum_const_zero] at h + exact zero_ne_one h + +lemma strong_contDiffOn (s : ℝ) (hs : (Module.finrank ℝ (EC d) : ℝ) < 2*s) + (N : ℕ) (hN : (Module.finrank ℝ (EC d) : ℝ) < 2*(s - 2*N)) + (u : D.Sobolev s) (i : Fin A.count) : + ContDiffOn ℝ N ((D.strong s u) ∘ (A.euclideanChart i).symm) + (A.euclideanChart i).target := by + intro z hz + let q := A.euclideanChart i + let x := q.symm z + obtain ⟨p,hp⟩ := D.exists_weight_ne_zero x + let e := A.euclideanChart (D.index p) + have hx : x ∈ e.source := D.support_sub p (subset_tsupport _ hp) + let t := q.symm.trans e + have ht : z ∈ t.source := ⟨hz,hx⟩ + have hf := (strongEmbedding_contDiff s hs N hN (u.val p)).contDiffAt (x := t z) + have htrans := ((A.euclidean_transition_smooth i (D.index p)).contDiffAt + (t.open_source.mem_nhds ht)).of_le (show (N : ℕ∞ω) ≤ ∞ from ENat.natCast_le_of_coe_top_le_withTop le_rfl N) + have hw := ((D.weight p).smooth i).contDiffAt (q.open_target.mem_nhds hz) + have hn : (D.weight p ∘ q.symm) z ≠ 0 := hp + have hsm := (hf.comp z htrans).mul ((hw.of_le (show (N : ℕ∞ω) ≤ ∞ from ENat.natCast_le_of_coe_top_le_withTop le_rfl N)).inv hn) + apply (hsm.congr_of_eventuallyEq ?_).contDiffWithinAt + have hne : ∀ᶠ y in 𝓝 z, (D.weight p ∘ q.symm) y ≠ 0 := + hw.continuousAt.eventually_ne hn + filter_upwards [t.open_source.mem_nhds ht, hne] with y hy hny + change D.strong s u (q.symm y) = strongEmbedding s hs (u.val p) (e (q.symm y)) / + D.weight p (q.symm y) + rw [D.strong_localized s hs] + have hyv : q.symm y ∈ e.source := hy.2 + change D.strong s u (q.symm y) = (if e (q.symm y) ∈ e.target then + D.weight p (e.symm (e (q.symm y))) * D.strong s u (e.symm (e (q.symm y))) else 0) / _ + rw [ite_eq_left (e.mapsTo hyv), e.left_inv hyv] + exact (mul_div_cancel_left₀ _ hny).symm +end Localizers +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/GlobalHessian.lean b/lean/OAI/Geometry/PrescribedPotential/GlobalHessian.lean new file mode 100644 index 0000000000000000000000000000000000000000..3070bd00bcbfa14ddf3aa57e31a33256f78d748d --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/GlobalHessian.lean @@ -0,0 +1,124 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CircleRadialCalculus +import OAI.Geometry.PrescribedPotential.ComplexHessian +import OAI.Geometry.PrescribedPotential.GlobalCompletion +import OAI.Geometry.PrescribedPotential.GlobalParametrix +import OAI.Geometry.PrescribedPotential.GlobalProduct +import OAI.Geometry.PrescribedPotential.KaehlerClosedDerivatives + +namespace OAI + +/-! Global Hessian. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory +open scoped ContDiff SchwartzMap Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] + +omit [CompactSpace X] in +lemma cutoffGlobal_support (i : Fin A.count) (κ : ChartCutoff (A.euclideanChart i).target) : + tsupport (cutoffGlobal i κ : X → ℂ) ⊆ (A.euclideanChart i).source := by + intro x hx + obtain ⟨y,hy,rfl⟩ := cutoffGlobal_tsupport i κ hx + exact (A.euclideanChart i).symm.mapsTo (κ.support_sub hy) + +lemma localize_cutoff_eventually (i : Fin A.count) + (κ η : ChartCutoff (A.euclideanChart i).target) + (hη : ∀ y ∈ tsupport (κ : EC d → ℂ), η y = 1) + (f : Smooth A) {y : EC d} (hy : y ∈ (A.euclideanChart i).target) (hκ : κ y ≠ 0) : + (localize A i (cutoffGlobal i η) (cutoffGlobal_support i η) f : EC d → ℂ) + =ᶠ[𝓝 y] f ∘ (A.euclideanChart i).symm := by + have hn : ∀ᶠ z in 𝓝 y, κ z ≠ 0 := + (isOpen_ne_fun κ.val.continuous continuous_const).mem_nhds hκ + filter_upwards [(A.euclideanChart i).open_target.mem_nhds hy, hn] with z hz hnz + rw [localize_apply, localizeFun_apply A _ _ hz] + have hs : (A.euclideanChart i).symm z ∈ (A.euclideanChart i).source := + (A.euclideanChart i).symm.mapsTo hz + change (if (A.euclideanChart i).symm z ∈ (A.euclideanChart i).source then + η (A.euclideanChart i ((A.euclideanChart i).symm z)) else 0) * f ((A.euclideanChart i).symm z) = _ + rw [ite_eq_left hs, (A.euclideanChart i).right_inv hz, hη z (subset_tsupport _ hnz), one_mul] + rfl + +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +def localizedHessian (p : ι) (i j : Fin d) : Smooth A →ₗ[ℝ] Smooth A := + (globalize (D.patch p).index (D.cutoff p)).comp + (((hessianEntrySchwartz i j).restrictScalars ℝ).toLinearMap.comp + (localizeLinear A (D.patch p).index (cutoffGlobal (D.patch p).index (D.outerCutoff p)) + (cutoffGlobal_support _ _))) + +lemma localizedHessian_bound (k : ℕ) (p : ι) (i j : Fin d) : + D.localizers.BoundedCore ((k : ℝ)+2) (k : ℝ) (D.localizedHessian p i j) := by + let q := (D.patch p).index + let ρ := cutoffGlobal q (D.outerCutoff p) + let hp := cutoffGlobal_support q (D.outerCutoff p) + obtain ⟨B,hB,hb⟩ := globalize_integer_bound D.localizers q (D.cutoff p) k + obtain ⟨C,hC,hc⟩ := hessianEntrySchwartz_bound (k : ℝ) i j + obtain ⟨E,hE,he⟩ := D.localization_integer_bound q ρ hp (k+2) + rw [Nat.cast_add, Nat.cast_ofNat] at he + refine ⟨B*(C*E),mul_nonneg hB (mul_nonneg hC hE),fun f => ?_⟩ + let v := localize A q ρ hp f + change ‖D.localizers.embed (k : ℝ) (globalize q (D.cutoff p) (hessianEntrySchwartz i j v))‖ ≤ _ + calc + _ ≤ B*‖schwartzCoord (k : ℝ) (hessianEntrySchwartz i j v)‖ := hb _ + _ ≤ B*(C*‖schwartzCoord ((k : ℝ)+2) v‖) := mul_le_mul_of_nonneg_left (hc v) hB + _ ≤ B*(C*(E*‖D.localizers.embed ((k : ℝ)+2) f‖)) := + mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left (he f) hC) hB + _ = _ := by ring + +lemma localizedHessian_source (p : ι) (i j : Fin d) (φ : SmoothRealFunction A) + {x : X} (hx : x ∈ tsupport (D.localizers.weight p : X → ℂ)) : + D.localizedHessian p i j (Smooth.ofReal φ) x = + φ.hessian (D.patch p).index (A.chart (D.patch p).index x) i j := by + let q := (D.patch p).index + let e := A.euclideanChart q + have hs : x ∈ e.source := by + have hh := D.localizers.support_sub p hx + rwa [D.index_eq] at hh + have ht : e x ∈ e.target := e.mapsTo hs + have hc : D.cutoff p (e x) = 1 := D.cutoff_one p x hx + have he := localize_cutoff_eventually q (D.cutoff p) (D.outerCutoff p) + (D.outerCutoff_one p) (Smooth.ofReal φ) ht (by rw [hc]; exact one_ne_zero) + let u : EC d → ℝ := φ.localExpression q ∘ coordinateEquiv d + have hu : ContDiffAt ℝ ∞ u (e x) := (φ.euclidean_smooth q).contDiffAt (by simpa only [e, ComplexAtlas.euclideanChart_target] using e.open_target.mem_nhds ht) + have hre : (fun y => Smooth.ofReal φ (e.symm y)) = Complex.ofRealCLM ∘ u := rfl + change globalize q (D.cutoff p) (hessianEntrySchwartz i j + (localize A q (cutoffGlobal q (D.outerCutoff p)) (cutoffGlobal_support _ _) (Smooth.ofReal φ))) x = _ + rw [globalize_apply, ite_eq_left hs, hc, one_mul, + hessianEntrySchwartz_real hu _ (he.trans (Filter.Eventually.of_forall (congr_fun hre))) i j, + pullBilin_hessian hu] + have hcomp : u ∘ (coordinateEquiv d).symm = φ.localExpression q := by + funext z; simp [u] + rw [hcomp] + change PotentialKaehler.hermitianPartMatrix + (fderiv ℝ (fderiv ℝ (φ.localExpression q)) (coordinateEquiv d (e x))) i j = _ + have heq : coordinateEquiv d (e x) = A.chart q x := by + change coordinateEquiv d ((coordinateEquiv d).symm (A.chart q x)) = _ + exact (coordinateEquiv d).apply_symm_apply _ + rw [heq] + rfl + +def completedHessian (k : ℕ) (p : ι) (i j : Fin d) : + D.localizers.Sobolev ((k : ℝ)+2) →L[ℝ] D.localizers.Sobolev (k : ℝ) := + D.localizers.extendCore ((k : ℝ)+2) (k : ℝ) (D.localizedHessian p i j) + +lemma completedHessian_embed (k : ℕ) (p : ι) (i j : Fin d) (f : Smooth A) : + D.completedHessian k p i j (D.localizers.embed ((k : ℝ)+2) f) = + D.localizers.embed (k : ℝ) (D.localizedHessian p i j f) := + D.localizers.extendCore_embed (D.localizedHessian_bound k p i j) f + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/GlobalMetricEntries.lean b/lean/OAI/Geometry/PrescribedPotential/GlobalMetricEntries.lean new file mode 100644 index 0000000000000000000000000000000000000000..2f866aff2ce29ad6b4a916192db2c47cf3eb0f49 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/GlobalMetricEntries.lean @@ -0,0 +1,107 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalTransport +import OAI.Geometry.PrescribedPotential.PatchCutoffs + +namespace OAI + +/-! Global Metric Entries. -/ + +section + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff SchwartzMap Classical ComplexOrder Matrix.Norms.Elementwise +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] + +def chartFunction (q : Fin A.count) (κ : ChartCutoff (A.euclideanChart q).target) + (f : EC d → ℂ) (hf : ContDiffOn ℝ ∞ f (A.euclideanChart q).target) : Smooth A := + cutoffGlobal q (κ.mulOn (A.euclideanChart q).open_target hf) + +lemma chartFunction_apply (q : Fin A.count) (κ : ChartCutoff (A.euclideanChart q).target) + (f : EC d → ℂ) (hf : ContDiffOn ℝ ∞ f (A.euclideanChart q).target) + {x : X} (hx : x ∈ (A.euclideanChart q).source) : + chartFunction q κ f hf x = κ (A.euclideanChart q x) * f (A.euclideanChart q x) := by + change (if x ∈ (A.euclideanChart q).source then _ else 0) = _ + rw [ite_eq_left hx] + rfl + +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +omit [T2Space X] in +lemma metric_euclidean_smooth (g : KaehlerMetric A) (q : Fin A.count) : + ContDiffOn ℝ ∞ (fun y : EC d => g.matrix q (coordinateEquiv d y)) + (A.euclideanChart q).target := by + rw [ComplexAtlas.euclideanChart_target] + exact (g.smooth q).comp (coordinateEquiv d).contDiff.contDiffOn (fun _ h => h) + +omit [T2Space X] in +lemma inverseDet_euclidean_smooth (g : KaehlerMetric A) (q : Fin A.count) : + ContDiffOn ℝ ∞ (fun y : EC d => (g.matrix q (coordinateEquiv d y)).det⁻¹) + (A.euclideanChart q).target := by + have hd : ContDiffOn ℝ ∞ (fun y : EC d => (g.matrix q (coordinateEquiv d y)).det) + (A.euclideanChart q).target := by + simp only [Matrix.det_apply'] + apply ContDiffOn.sum + intro σ _ + apply contDiffOn_const.mul + apply contDiffOn_prod + intro j _ + exact contDiffOn_pi.mp (contDiffOn_pi.mp (metric_euclidean_smooth g q) (σ j)) j + apply hd.inv + intro y hy + exact ne_of_gt (g.positive q (coordinateEquiv d y) (by simpa using hy)).det_pos + +def metricEntry (p : ι) (i j : Fin d) : Smooth A := + chartFunction (D.patch p).index (D.cutoff p) + (fun y => g.matrix (D.patch p).index (coordinateEquiv d y) i j) + (contDiffOn_pi.mp (contDiffOn_pi.mp (metric_euclidean_smooth g (D.patch p).index) i) j) + +def inverseDet (p : ι) : Smooth A := + chartFunction (D.patch p).index (D.cutoff p) + (fun y => (g.matrix (D.patch p).index (coordinateEquiv d y)).det⁻¹) + (inverseDet_euclidean_smooth g (D.patch p).index) + +def determinantWeight (p : ι) : Smooth A := (D.localizers.weight p).mul (D.inverseDet p) + +omit [T2Space X] in +lemma patch_source (p : ι) {x : X} (hx : x ∈ tsupport (D.localizers.weight p : X → ℂ)) : + x ∈ (A.euclideanChart (D.patch p).index).source := by + have hh := D.localizers.support_sub p hx + rwa [D.index_eq] at hh + +lemma metricEntry_apply (p : ι) (i j : Fin d) {x : X} + (hx : x ∈ tsupport (D.localizers.weight p : X → ℂ)) : + D.metricEntry p i j x = g.matrix (D.patch p).index (A.chart (D.patch p).index x) i j := by + rw [metricEntry, chartFunction_apply _ _ _ _ (D.patch_source p hx), D.cutoff_one p x hx, one_mul, + ComplexAtlas.euclideanChart_apply, ContinuousLinearEquiv.apply_symm_apply] + +lemma inverseDet_apply (p : ι) {x : X} + (hx : x ∈ tsupport (D.localizers.weight p : X → ℂ)) : + D.inverseDet p x = (g.matrix (D.patch p).index (A.chart (D.patch p).index x)).det⁻¹ := by + rw [inverseDet, chartFunction_apply _ _ _ _ (D.patch_source p hx), D.cutoff_one p x hx, one_mul, + ComplexAtlas.euclideanChart_apply, ContinuousLinearEquiv.apply_symm_apply] + +lemma determinantWeight_apply (p : ι) {x : X} + (hx : x ∈ tsupport (D.localizers.weight p : X → ℂ)) : + D.determinantWeight p x = D.localizers.weight p x * + (g.matrix (D.patch p).index (A.chart (D.patch p).index x)).det⁻¹ := by + change D.localizers.weight p x * D.inverseDet p x = _ + rw [D.inverseDet_apply p hx] + +lemma determinantWeight_zero (p : ι) {x : X} (hx : D.localizers.weight p x = 0) : + D.determinantWeight p x = 0 := by + change D.localizers.weight p x * _ = 0 + rw [hx, zero_mul] + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/GlobalNonlinearCommutator.lean b/lean/OAI/Geometry/PrescribedPotential/GlobalNonlinearCommutator.lean new file mode 100644 index 0000000000000000000000000000000000000000..b3ebefc85cdd763e3a1a65ef49af0bb2f7234268 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/GlobalNonlinearCommutator.lean @@ -0,0 +1,63 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CommutatorSupport +import OAI.Geometry.PrescribedPotential.NonlinearCoreCommutator +import OAI.Geometry.PrescribedPotential.PatchCutoffs +import OAI.Geometry.PrescribedPotential.RealSobolev + +namespace OAI + +/-! Global Nonlinear Commutator. -/ + +section + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff Classical Matrix.Norms.Elementwise +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +lemma nonlinear_commutator_core_strong (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (p : ι) (v : EC d) (φ : SmoothRealFunction A) (x : X) : + D.localizers.strong (k : ℝ) + (fderiv ℝ (D.completedVolume k hk) (D.localizers.embed ((k : ℝ)+2) (Smooth.ofReal φ)) + (D.localizers.embed ((k : ℝ)+2) (D.localizedDerivative p v (Smooth.ofReal φ)))) x = + D.localizedDerivative p v (Smooth.ofReal (g.potentialDensity φ)) x + + D.localizers.strong (k : ℝ) + (D.nonlinearRemainder k hk p v (D.localizers.embed ((k : ℝ)+2) (Smooth.ofReal φ))) x := by + by_cases hx : x ∈ D.derivativeSupport p + · obtain ⟨hs,hκ⟩ := D.derivativeSupport_source hx + exact D.nonlinear_commutator_on_support k hk p v φ hs hκ + · obtain ⟨q,hq⟩ := A.covers x + let ψ := (D.realLocalizedDerivative p v (RealSmooth.ofReal φ)).source + have hψ : Smooth.ofReal ψ = D.localizedDerivative p v (Smooth.ofReal φ) := + RealSmooth.ofReal_source _ + rw [← hψ,D.completedVolumeDerivative_source k hk φ ψ q hq, + D.localizedDerivative_source_hessian_zero hx v φ q hq, + map_zero,mul_zero,D.localizedDerivative_zero hx,D.nonlinearRemainder_zero hx,add_zero] + +lemma nonlinear_commutator_core (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (p : ι) (v : EC d) (φ : SmoothRealFunction A) : + fderiv ℝ (D.completedVolume k hk) (D.localizers.embed ((k : ℝ)+2) (Smooth.ofReal φ)) + (D.localizers.embed ((k : ℝ)+2) (D.localizedDerivative p v (Smooth.ofReal φ))) = + D.localizers.embed (k : ℝ) (D.localizedDerivative p v (Smooth.ofReal (g.potentialDensity φ))) + + D.nonlinearRemainder k hk p v (D.localizers.embed ((k : ℝ)+2) (Smooth.ofReal φ)) := by + have hs : (Module.finrank ℝ (EC d) : ℝ) < 2*(k : ℝ) := by + have hh : (Module.finrank ℝ (EC d) : ℝ) < (k : ℝ) := by exact_mod_cast hk + linarith [Nat.cast_nonneg (α := ℝ) k] + apply D.localizers.strong_injective (k : ℝ) hs + ext x + rw [map_add,D.localizers.strong_embed _ hs] + exact D.nonlinear_commutator_core_strong k hk p v φ x + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/GlobalOperator.lean b/lean/OAI/Geometry/PrescribedPotential/GlobalOperator.lean new file mode 100644 index 0000000000000000000000000000000000000000..88749435afdda51721f4131decaaeae2c3afd053 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/GlobalOperator.lean @@ -0,0 +1,134 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.AnalyticSupport + +namespace OAI + +/-! Global Operator. -/ + +section + + + +noncomputable section +open Matrix Filter Topology +open scoped ContDiff ComplexOrder MatrixOrder Matrix.Norms.Elementwise + +namespace MatrixSmoothGeneral +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {n : ℕ} + +lemma determinant {U : Set E} {H : E → Matrix (Fin n) (Fin n) ℂ} + (hH : ContDiffOn ℝ ∞ H U) : ContDiffOn ℝ ∞ (fun z => (H z).det) U := by + classical + simp_rw [Matrix.det_apply'] + apply ContDiffOn.sum + intro σ _ + apply contDiffOn_const.mul + apply contDiffOn_prod + intro i _ + exact contDiffOn_pi.mp (contDiffOn_pi.mp hH (σ i)) i + +lemma adjugate {U : Set E} {H : E → Matrix (Fin n) (Fin n) ℂ} + (hH : ContDiffOn ℝ ∞ H U) : ContDiffOn ℝ ∞ (fun z => (H z).adjugate) U := by + classical + apply contDiffOn_pi.mpr + intro i + apply contDiffOn_pi.mpr + intro j + simp_rw [Matrix.adjugate_apply] + apply determinant + apply contDiffOn_pi.mpr + intro k + apply contDiffOn_pi.mpr + intro l + by_cases hk : k = j + · subst k + simp only [Matrix.updateRow_self] + exact contDiffOn_const + · simp only [Matrix.updateRow_ne hk] + exact contDiffOn_pi.mp (contDiffOn_pi.mp hH k) l + +lemma inverse {U : Set E} {H : E → Matrix (Fin n) (Fin n) ℂ} + (hH : ContDiffOn ℝ ∞ H U) (hh : ∀ x ∈ U, (H x).det ≠ 0) : + ContDiffOn ℝ ∞ (fun z => (H z)⁻¹) U := by + simp_rw [Matrix.inv_def, Ring.inverse_eq_inv'] + exact ((determinant hH).inv hh).smul (adjugate hH) +end MatrixSmoothGeneral + +namespace Anticanonical.SourceSmooth.KaehlerMetric +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +lemma transition_det_isUnit (g : KaehlerMetric A) (i j : Fin A.count) {x : X} + (hi : x ∈ (A.chart i).source) (hj : x ∈ (A.chart j).source) : + IsUnit (A.derivativeMatrix i j x).det := by + apply isUnit_iff_ne_zero.mpr + intro h + have he := congrArg Matrix.det (g.compatibility i j x hi hj) + rw [Matrix.det_mul, h, mul_zero] at he + exact ne_of_gt (g.positive i (A.chart i x) ((A.chart i).mapsTo hi)).det_pos he + +lemma linearizedMongeAmpere_compatibility (g : KaehlerMetric A) (φ : SmoothRealFunction A) + (i j : Fin A.count) {x : X} + (hi : x ∈ (A.chart i).source) (hj : x ∈ (A.chart j).source) : + g.linearizedMongeAmpere φ i (A.chart i x) = + g.linearizedMongeAmpere φ j (A.chart j x) := by + let D := A.derivativeMatrix i j x + have hD : IsUnit D.det := g.transition_det_isUnit i j hi hj + have hs : IsUnit Dᴴ.det := by rw [det_conjTranspose]; exact hD.star + unfold linearizedMongeAmpere + rw [g.compatibility i j x hi hj, φ.hessian_compatibility i j hi hj] + change (((Dᴴ * g.matrix j (A.chart j x) * D)⁻¹ * + (Dᴴ * φ.hessian j (A.chart j x) * D)).trace).re = _ + have he : (Dᴴ * g.matrix j (A.chart j x) * D)⁻¹ * + (Dᴴ * φ.hessian j (A.chart j x) * D) = + D⁻¹ * (g.matrix j (A.chart j x))⁻¹ * φ.hessian j (A.chart j x) * D := by + rw [Matrix.mul_inv_rev, Matrix.mul_inv_rev] + simp only [mul_assoc, nonsing_inv_mul_cancel_left Dᴴ _ hs] + rw [he, Matrix.mul_assoc D⁻¹ _ _, trace_mul_cycle, mul_nonsing_inv D hD, one_mul] + + + +def laplacianValue (g : KaehlerMetric A) (φ : SmoothRealFunction A) (x : X) : ℝ := + g.linearizedMongeAmpere φ (A.covers x).choose (A.chart (A.covers x).choose x) + +lemma laplacianValue_local (g : KaehlerMetric A) (φ : SmoothRealFunction A) + (i : Fin A.count) {x : X} (hx : x ∈ (A.chart i).source) : + g.laplacianValue φ x = g.linearizedMongeAmpere φ i (A.chart i x) := + g.linearizedMongeAmpere_compatibility φ _ i (A.covers x).choose_spec hx + +lemma linearizedMongeAmpere_smooth (g : KaehlerMetric A) (φ : SmoothRealFunction A) + (i : Fin A.count) : ContDiffOn ℝ ∞ (g.linearizedMongeAmpere φ i) (A.chart i).target := by + apply Complex.reCLM.contDiff.comp_contDiffOn + simp only [Matrix.trace, Matrix.diag_apply] + apply ContDiffOn.sum + intro j _ + simp only [Matrix.mul_apply] + apply ContDiffOn.sum + intro k _ + apply ContDiffOn.mul + · exact contDiffOn_pi.mp (contDiffOn_pi.mp + (MatrixSmoothGeneral.inverse (g.smooth i) + (fun z hz => ne_of_gt (g.positive i z hz).det_pos)) j) k + · exact contDiffOn_pi.mp (contDiffOn_pi.mp (φ.hessian_smooth i) k) j + + + +def laplacian (g : KaehlerMetric A) (φ : SmoothRealFunction A) : SmoothRealFunction A where + value := g.laplacianValue φ + smooth i := by + apply (g.linearizedMongeAmpere_smooth φ i).congr + intro z hz + dsimp only [Function.comp_apply] + rw [g.laplacianValue_local φ i ((A.chart i).mapsTo_symm hz), (A.chart i).right_inv hz] + +lemma laplacian_localExpression (g : KaehlerMetric A) (φ : SmoothRealFunction A) + (i : Fin A.count) {z : Coordinates d} (hz : z ∈ (A.chart i).target) : + (g.laplacian φ).localExpression i z = g.linearizedMongeAmpere φ i z := by + change g.laplacianValue φ ((A.chart i).symm z) = _ + rw [g.laplacianValue_local φ i ((A.chart i).mapsTo_symm hz), (A.chart i).right_inv hz] + +end Anticanonical.SourceSmooth.KaehlerMetric + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/GlobalParametrix.lean b/lean/OAI/Geometry/PrescribedPotential/GlobalParametrix.lean new file mode 100644 index 0000000000000000000000000000000000000000..0881e55903332739a5899e0f39c070d351d97d80 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/GlobalParametrix.lean @@ -0,0 +1,145 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalTransport +import OAI.Geometry.PrescribedPotential.IntegerBounds +import OAI.Geometry.PrescribedPotential.PatchCutoffs + +namespace OAI + +/-! Global Parametrix. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory +open scoped SchwartzMap ContDiff Classical ComplexOrder MatrixOrder + +namespace Anticanonical.SourceSmooth.ParametrixPatch +open EllipticKernel SobolevChart FrozenPoisson ParameterRegularity +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + {g : KaehlerMetric A} + +abbrev matrix (p : ParametrixPatch g) := g.matrix p.index (coordinateEquiv d p.center) +lemma positive (p : ParametrixPatch g) : p.matrix.PosDef := + g.positive p.index _ (by simpa using p.mem_target) + + + +def localInverse (p : ParametrixPatch g) (m : ℝ) (hm : 1 ≤ m) : + 𝓢(EC d, ℂ) →ₗ[ℝ] 𝓢(EC d, ℂ) := + (schwartzLocal p.matrix p.positive m hm (stdOrthonormalBasis ℝ (EC d)) + p.coefficient p.small).restrictScalars ℝ + +lemma localInverse_bound (p : ParametrixPatch g) (m : ℝ) (hm : 1 ≤ m) (k : ℕ) : + CoreBound (k : ℝ) ((k : ℝ) + 2) (p.localInverse m hm) := + schwartzLocal_integer_bound p.matrix p.positive m hm (stdOrthonormalBasis ℝ (EC d)) + p.coefficient p.small k +end Anticanonical.SourceSmooth.ParametrixPatch + +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] + +theorem globalize_integer_bound (D : Localizers A ι) + (i : Fin A.count) (κ : ChartCutoff (A.euclideanChart i).target) (k : ℕ) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ f : 𝓢(EC d, ℂ), + ‖D.embed (k : ℝ) (globalize i κ f)‖ ≤ C * ‖schwartzCoord (k : ℝ) f‖ := by + have hB (j : ι) : CoreBound (k : ℝ) (k : ℝ) + (fun f => localize A (D.index j) (D.weight j) (D.support_sub j) (globalize i κ f)) := by + simp_rw [localize_globalize] + exact chartTransport_integer_bound _ (A.euclidean_transition_smooth (D.index j) i) + (A.euclidean_transition_smooth i (D.index j)) _ k + choose C hC h using hB + refine ⟨∑ j, C j, Finset.sum_nonneg (fun j _ => hC j), fun f => ?_⟩ + change ‖D.coordinates (k : ℝ) (globalize i κ f)‖ ≤ _ + apply (pi_norm_le_iff_of_nonneg (mul_nonneg (Finset.sum_nonneg (fun j _ => hC j)) (norm_nonneg _))).mpr + intro j + exact (h j f).trans (mul_le_mul_of_nonneg_right + (Finset.single_le_sum (fun j _ => hC j) (Finset.mem_univ j)) (norm_nonneg _)) + +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +def forcing (p : ι) : Smooth A →ₗ[ℝ] 𝓢(EC d, ℂ) := + localizeLinear A (D.localizers.index p) (D.localizers.weight p) (D.localizers.support_sub p) + +lemma forcing_bound (p : ι) (s : ℝ) (f : Smooth A) : + ‖schwartzCoord s (D.forcing p f)‖ ≤ ‖D.localizers.embed s f‖ := + norm_le_pi_norm (D.localizers.coordinates s f) p + + +def parametrix (m : ℝ) (hm : 1 ≤ m) : Smooth A →ₗ[ℝ] Smooth A := + ∑ p, (globalize (D.patch p).index (D.cutoff p)).comp + (((D.patch p).localInverse m hm).comp (D.forcing p)) + +lemma parametrix_apply (m : ℝ) (hm : 1 ≤ m) (f : Smooth A) : + D.parametrix m hm f = ∑ p, globalize (D.patch p).index (D.cutoff p) + ((D.patch p).localInverse m hm (D.forcing p f)) := by + simp only [parametrix, LinearMap.sum_apply, LinearMap.comp_apply] + +lemma parametrix_piece_bound (m : ℝ) (hm : 1 ≤ m) (k : ℕ) (p : ι) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ f : Smooth A, + ‖D.localizers.embed ((k : ℝ) + 2) (globalize (D.patch p).index (D.cutoff p) + ((D.patch p).localInverse m hm (D.forcing p f)))‖ ≤ + C * ‖D.localizers.embed (k : ℝ) f‖ := by + obtain ⟨B, hB, hb⟩ := globalize_integer_bound D.localizers (D.patch p).index (D.cutoff p) (k + 2) + obtain ⟨C, hC, hc⟩ := (D.patch p).localInverse_bound m hm k + refine ⟨B * C, mul_nonneg hB hC, fun f => ?_⟩ + have hh := hb ((D.patch p).localInverse m hm (D.forcing p f)) + rw [Nat.cast_add, Nat.cast_ofNat] at hh + apply hh.trans + have hr := (hc (D.forcing p f)).trans + (mul_le_mul_of_nonneg_left (D.forcing_bound p (k : ℝ) f) hC) + simpa only [mul_assoc] using mul_le_mul_of_nonneg_left hr hB + + +lemma parametrix_bound (m : ℝ) (hm : 1 ≤ m) (k : ℕ) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ f : Smooth A, + ‖D.localizers.embed ((k : ℝ) + 2) (D.parametrix m hm f)‖ ≤ + C * ‖D.localizers.embed (k : ℝ) f‖ := by + choose C hC hc using D.parametrix_piece_bound m hm k + refine ⟨∑ p, C p, Finset.sum_nonneg (fun p _ => hC p), fun f => ?_⟩ + rw [parametrix_apply, map_sum, Finset.sum_mul] + apply (norm_sum_le _ _).trans + exact Finset.sum_le_sum (fun p _ => hc p f) + + + +lemma forcing_reconstruction (f : Smooth A) : + (∑ p, globalize (D.patch p).index (D.cutoff p) (D.forcing p f)) = f := by + apply Smooth.ext + intro x + have he (p : ι) : globalize (D.patch p).index (D.cutoff p) (D.forcing p f) x = + D.localizers.weight p x * f x := by + by_cases hx : x ∈ tsupport (D.localizers.weight p : X → ℂ) + · have hp := (D.support_patch p hx).1 + rw [globalize_apply, ite_eq_left hp, D.cutoff_one p x hx, one_mul] + change localizeFun A (D.localizers.index p) (D.localizers.weight p) f + (A.euclideanChart (D.patch p).index x) = _ + rw [D.index_eq, localizeFun_apply A _ _ ((A.euclideanChart (D.patch p).index).mapsTo hp), + (A.euclideanChart (D.patch p).index).left_inv hp] + · have hz := image_eq_zero_of_notMem_tsupport hx + rw [hz, zero_mul, globalize_apply] + split_ifs with hp + · change D.cutoff p _ * (localizeFun A (D.localizers.index p) (D.localizers.weight p) f _) = 0 + rw [D.index_eq, localizeFun_apply A _ _ ((A.euclideanChart (D.patch p).index).mapsTo hp), + (A.euclideanChart (D.patch p).index).left_inv hp, hz, zero_mul, mul_zero] + · rfl + change (∑ p, (globalize (D.patch p).index (D.cutoff p) (D.forcing p f) : Smooth A)) x = _ + have hev (S : Finset ι) (F : ι → Smooth A) : (∑ p ∈ S, F p) x = ∑ p ∈ S, F p x := by + induction S using Finset.induction_on with + | empty => simp + | @insert p S hp ih => simp only [Finset.sum_insert hp, Smooth.add_apply, ih] + rw [hev] + simp_rw [he] + rw [← Finset.sum_mul, D.localizers.sum_one, one_mul] + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/GlobalParametrixEquation.lean b/lean/OAI/Geometry/PrescribedPotential/GlobalParametrixEquation.lean new file mode 100644 index 0000000000000000000000000000000000000000..b6c699fbbe8e63d022467e524fc92ff4c550df4d --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/GlobalParametrixEquation.lean @@ -0,0 +1,140 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalParametrix +import OAI.Geometry.PrescribedPotential.PatchDifferential + +namespace OAI + +/-! Global Parametrix Equation. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory TemperedDistribution LineDeriv +open scoped SchwartzMap ContDiff Classical ComplexOrder MatrixOrder + +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart MetricLocalization +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] + {A : ComplexAtlas d X} + +lemma globalize_local (i : Fin A.count) + (κ : ChartCutoff (A.euclideanChart i).target) (u : 𝓢(EC d, ℂ)) + {y : EC d} (hy : y ∈ (A.euclideanChart i).target) : + (globalize i κ u ∘ (A.euclideanChart i).symm) =ᶠ[𝓝 y] + (SchwartzMap.smulLeftCLM ℂ κ.val u : EC d → ℂ) := by + filter_upwards [(A.euclideanChart i).open_target.mem_nhds hy] with z hz + have hs : (A.euclideanChart i).symm z ∈ (A.euclideanChart i).source := + (A.euclideanChart i).map_target hz + simp only [Function.comp_apply, globalize_apply, ite_eq_left hs, + (A.euclideanChart i).right_inv hz, + SchwartzMap.smulLeftCLM_apply_apply κ.val.hasTemperateGrowth, smul_eq_mul] + +lemma globalize_absorb (i : Fin A.count) + (κ η : ChartCutoff (A.euclideanChart i).target) + (hη : ∀ y ∈ tsupport (κ : EC d → ℂ), η y = 1) (u : 𝓢(EC d, ℂ)) : + globalize i η (SchwartzMap.smulLeftCLM ℂ κ.val u) = globalize i κ u := by + apply Smooth.ext + intro x + simp only [globalize_apply, SchwartzMap.smulLeftCLM_apply_apply κ.val.hasTemperateGrowth, + smul_eq_mul] + split_ifs with hx + · by_cases hy : A.euclideanChart i x ∈ tsupport (κ : EC d → ℂ) + · rw [hη _ hy, one_mul] + · rw [image_eq_zero_of_notMem_tsupport hy, zero_mul, mul_zero] + · rfl + +lemma complexL_globalize {g : KaehlerMetric A} (p : ParametrixPatch g) + (κ η : ChartCutoff (A.euclideanChart p.index).target) + (hκ : tsupport (κ : EC d → ℂ) ⊆ p.domain) + (hη : ∀ y ∈ tsupport (κ : EC d → ℂ), η y = 1) (u : 𝓢(EC d, ℂ)) : + complexL g (globalize p.index κ u) = + globalize p.index η (p.differential (SchwartzMap.smulLeftCLM ℂ κ.val u)) := by + apply Smooth.ext + intro x + let e := A.euclideanChart p.index + have hDs : tsupport (p.differential (SchwartzMap.smulLeftCLM ℂ κ.val u) : EC d → ℂ) ⊆ + tsupport (κ : EC d → ℂ) := + (schwartzDifferential_tsupport _ _).trans + ((SchwartzMap.tsupport_smulLeftCLM_subset _ _).trans inter_subset_right) + by_cases hx : x ∈ e.symm '' tsupport (κ : EC d → ℂ) + · obtain ⟨y, hy, rfl⟩ := hx + have hys := κ.support_sub hy + have hsrc : e.symm y ∈ (A.euclideanChart p.index).source := e.map_target hys + change complexLValue g _ _ = _ + rw [complexLValue_local g _ p.index hsrc] + change localL g p.index _ (e (e.symm y)) = _ + rw [e.right_inv hys, + localL_congr g p.index (globalize_local p.index κ u hys), + ← p.differential_local _ (hκ hy), globalize_apply, ite_eq_left hsrc, e.right_inv hys, + hη y hy, one_mul] + · have hv : complexL g (globalize p.index κ u) x = 0 := + image_eq_zero_of_notMem_tsupport (fun ht => hx + (globalize_tsupport p.index κ u (complexL_tsupport g _ ht))) + rw [hv, globalize_apply] + split_ifs with hi + · have hn : e x ∉ tsupport (κ : EC d → ℂ) := fun hy => hx ⟨e x, hy, e.left_inv hi⟩ + rw [image_eq_zero_of_notMem_tsupport (fun ht => hn (hDs ht)), mul_zero] + · rfl + +omit [T2Space X] in +lemma local_shift_cutoff_equation {g : KaehlerMetric A} (p : ParametrixPatch g) + (m : ℝ) (hm : 1 ≤ m) (κ f : 𝓢(EC d, ℂ)) : + (m^2 : ℝ) • SchwartzMap.smulLeftCLM ℂ κ (p.localInverse m hm f) - + p.differential (SchwartzMap.smulLeftCLM ℂ κ (p.localInverse m hm f)) = + SchwartzMap.smulLeftCLM ℂ κ f - p.cutoffError κ (p.localInverse m hm f) := by + have he := congrArg (SchwartzMap.smulLeftCLM ℂ κ) (p.localInverse_equation m hm f) + simp only [map_sub, map_smul] at he + rw [← he] + simp only [ParametrixPatch.cutoffError, schwartzCutoffError, + _root_.sub_apply, ContinuousLinearMap.comp_apply] + rw [← Complex.ofReal_pow, Complex.coe_smul] + simp only [ParametrixPatch.differential] + abel + +lemma global_shift_piece_equation {g : KaehlerMetric A} (p : ParametrixPatch g) + (κ η : ChartCutoff (A.euclideanChart p.index).target) + (hκ : tsupport (κ : EC d → ℂ) ⊆ p.domain) + (hη : ∀ y ∈ tsupport (κ : EC d → ℂ), η y = 1) + (m : ℝ) (hm : 1 ≤ m) (f : 𝓢(EC d, ℂ)) : + (m^2 : ℝ) • globalize p.index κ (p.localInverse m hm f) - + complexL g (globalize p.index κ (p.localInverse m hm f)) = + globalize p.index κ f - globalize p.index η (p.cutoffError κ.val (p.localInverse m hm f)) := by + have hh := congrArg (globalize p.index η) (local_shift_cutoff_equation p m hm κ.val f) + simp only [map_sub, map_smul, globalize_absorb p.index κ η hη] at hh + rw [complexL_globalize p κ η hκ hη] + exact hh + +variable [CompactSpace X] {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +def error (m : ℝ) (hm : 1 ≤ m) : Smooth A →ₗ[ℝ] Smooth A := + ∑ p, (globalize (D.patch p).index (D.outerCutoff p)).comp + ((((D.patch p).cutoffError (D.cutoff p).val).restrictScalars ℝ).toLinearMap.comp + (((D.patch p).localInverse m hm).comp (D.forcing p))) + +lemma error_apply (m : ℝ) (hm : 1 ≤ m) (f : Smooth A) : + D.error m hm f = ∑ p, globalize (D.patch p).index (D.outerCutoff p) + ((D.patch p).cutoffError (D.cutoff p).val ((D.patch p).localInverse m hm (D.forcing p f))) := by + simp only [error, LinearMap.sum_apply, LinearMap.comp_apply, + ContinuousLinearMap.coe_coe] + rfl + + +theorem parametrix_equation (m : ℝ) (hm : 1 ≤ m) (f : Smooth A) : + (m^2 : ℝ) • D.parametrix m hm f - complexL g (D.parametrix m hm f) = + f - D.error m hm f := by + rw [parametrix_apply, map_sum, Finset.smul_sum, ← Finset.sum_sub_distrib] + simp_rw [global_shift_piece_equation (D.patch _) (D.cutoff _) (D.outerCutoff _) + (D.cutoff_support _) (D.outerCutoff_one _) m hm] + rw [Finset.sum_sub_distrib, forcing_reconstruction, error_apply] + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/GlobalPartition.lean b/lean/OAI/Geometry/PrescribedPotential/GlobalPartition.lean new file mode 100644 index 0000000000000000000000000000000000000000..41ae08308201329e76a140e7526751fe6a0714cb --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/GlobalPartition.lean @@ -0,0 +1,154 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalSobolev +import OAI.Geometry.PrescribedPotential.ParametrixAtlas + +namespace OAI + +/-! Global Partition. -/ + +section + +noncomputable section +open Set Filter Topology MeasureTheory Manifold IsManifold +open scoped ContDiff SchwartzMap Classical + +namespace GlobalElliptic +open Anticanonical EllipticKernel SobolevChart SourceSmooth +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + + +def Smooth.ofReal (f : SmoothRealFunction A) : Smooth A := + ⟨fun x => (f.value x : ℂ), fun i => by + apply Complex.ofRealCLM.contDiff.comp_contDiffOn + exact (f.smooth i).comp (coordinateEquiv d).contDiff.contDiffOn + (fun y hy => by simpa using hy)⟩ + +@[simp] lemma Smooth.ofReal_apply (f : SmoothRealFunction A) (x : X) : + Smooth.ofReal f x = (f.value x : ℂ) := rfl + +lemma Smooth.ofReal_tsupport (f : SmoothRealFunction A) : + tsupport (Smooth.ofReal f : X → ℂ) = tsupport f.value := by + apply congrArg closure + ext x + simp [Function.mem_support] + + + +structure Localizers (A : ComplexAtlas d X) (ι : Type*) [Fintype ι] where + index : ι → Fin A.count + weight : ι → Smooth A + support_sub : ∀ i, tsupport (weight i : X → ℂ) ⊆ (A.euclideanChart (index i)).source + sum_one : ∀ x, ∑ i, weight i x = 1 + +namespace Localizers +variable {ι : Type*} [Fintype ι] (D : Localizers A ι) + + +def coordinates [T2Space X] [CompactSpace X] (s : ℝ) : + Smooth A →ₗ[ℝ] (ι → L2 (EC d)) where + toFun f i := schwartzCoord s (localize A (D.index i) (D.weight i) (D.support_sub i) f) + map_add' f h := by + funext i + change schwartzCoord s (localizeLinear A (D.index i) (D.weight i) (D.support_sub i) (f + h)) = _ + rw [map_add, schwartzCoord_add] + rfl + map_smul' c f := by + funext i + apply realize_injective s + change realize s (schwartzCoord s (localizeLinear A (D.index i) (D.weight i) (D.support_sub i) (c • f))) = + realize s (c • schwartzCoord s (localizeLinear A (D.index i) (D.weight i) (D.support_sub i) f)) + rw [map_smul, realize_schwartzCoord] + change SchwartzMap.toTemperedDistributionCLM _ _ volume (c • localizeLinear A (D.index i) (D.weight i) (D.support_sub i) f) = _ + rw [ContinuousLinearMap.map_smul_of_tower, ContinuousLinearMap.map_smul_of_tower, realize_schwartzCoord] + +lemma coordinates_injective [T2Space X] [CompactSpace X] (s : ℝ) : + Function.Injective (D.coordinates s) := by + intro f h heq + apply Smooth.ext + intro x + have hi (i : ι) : D.weight i x * f x = D.weight i x * h x := by + have ht := congrArg (fun v : ι → L2 (EC d) => realize s (v i)) heq + dsimp only [coordinates, LinearMap.coe_mk, AddHom.coe_mk] at ht + rw [realize_schwartzCoord, realize_schwartzCoord] at ht + have he := schwartz_distribution_injective ht + by_cases hx : x ∈ (A.euclideanChart (D.index i)).source + · have htx := (A.euclideanChart (D.index i)).mapsTo hx + have hh := congrArg (fun u : 𝓢(EC d, ℂ) => u (A.euclideanChart (D.index i) x)) he + simpa only [localize_apply, localizeFun_apply A _ _ htx, + (A.euclideanChart (D.index i)).left_inv hx] using hh + · have hz : D.weight i x = 0 := image_eq_zero_of_notMem_tsupport + (fun ht => hx (D.support_sub i ht)) + simp [hz] + have hsum := Finset.sum_congr (s₁ := Finset.univ) rfl (fun i _ => hi i) + simpa only [← Finset.sum_mul, D.sum_one, one_mul] using hsum + + + +def closedSpace [T2Space X] [CompactSpace X] (s : ℝ) : + Submodule ℝ (ι → L2 (EC d)) := (LinearMap.range (D.coordinates s)).topologicalClosure + +abbrev Sobolev [T2Space X] [CompactSpace X] (s : ℝ) := ↥(D.closedSpace s) + +instance [T2Space X] [CompactSpace X] (s : ℝ) : CompleteSpace (D.Sobolev s) := + (LinearMap.range (D.coordinates s)).isClosed_topologicalClosure.completeSpace_coe + + +def embed [T2Space X] [CompactSpace X] (s : ℝ) : Smooth A →ₗ[ℝ] D.Sobolev s := + (D.coordinates s).codRestrict (D.closedSpace s) + (fun f => Submodule.le_topologicalClosure _ (LinearMap.mem_range_self _ f)) + +lemma embed_injective [T2Space X] [CompactSpace X] (s : ℝ) : + Function.Injective (D.embed s) := by + intro f h hh + exact D.coordinates_injective s (congrArg Subtype.val hh) + +lemma embed_dense [T2Space X] [CompactSpace X] (s : ℝ) : DenseRange (D.embed s) := by + change Dense (Set.range (D.embed s)) + rw [Subtype.dense_iff, ← Set.range_comp] + change closure (Set.range (D.coordinates s)) ⊆ closure (Set.range (D.coordinates s)) + exact subset_rfl + +end Localizers + + + +theorem exists_patch_localizers [T2Space X] [CompactSpace X] (g : KaehlerMetric A) : + ∃ (S : Finset (ParametrixPatch g)) (D : Localizers A S), + (∀ p : S, D.index p = p.val.index) ∧ + (∀ p : S, tsupport (D.weight p : X → ℂ) ⊆ p.val.source) := by + obtain ⟨S, hS⟩ := ParametrixPatch.finite_cover g + let := A.chartedSpace + let := A.isManifold + obtain ⟨ρ, hρ⟩ := SmoothPartitionOfUnity.exists_isSubordinate + 𝓘(ℝ, Coordinates d) (s := (Set.univ : Set X)) isClosed_univ + (fun p : S => p.val.source) (fun p => p.val.isOpen_source) (by + intro x _ + obtain ⟨p, hp, hx⟩ := hS x + exact mem_iUnion.mpr ⟨⟨p, hp⟩, hx⟩) + let f (p : S) : SmoothRealFunction A := + ⟨ρ p, (A.contMDiff_iff (ρ p)).mp (ρ p).contMDiff⟩ + let D : Localizers A S := + { index := fun p => p.val.index + weight := fun p => Smooth.ofReal (f p) + support_sub := by + intro p + rw [Smooth.ofReal_tsupport] + exact (hρ p).trans (fun x hx => hx.1) + sum_one := by + intro x + change (∑ p : S, ((ρ p x : ℝ) : ℂ)) = 1 + rw [← Complex.ofReal_sum] + exact_mod_cast (show ∑ p : S, ρ p x = 1 by + simpa only [finsum_eq_sum_of_fintype] using ρ.sum_eq_one (mem_univ x)) } + refine ⟨S, D, fun _ => rfl, ?_⟩ + intro p + change tsupport (Smooth.ofReal (f p) : X → ℂ) ⊆ _ + rw [Smooth.ofReal_tsupport] + exact hρ p + +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/GlobalProduct.lean b/lean/OAI/Geometry/PrescribedPotential/GlobalProduct.lean new file mode 100644 index 0000000000000000000000000000000000000000..d4014bda2d41e845d7bdce71ce3446337de311f6 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/GlobalProduct.lean @@ -0,0 +1,115 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalTransport +import OAI.Geometry.PrescribedPotential.PatchCutoffs +import OAI.Geometry.PrescribedPotential.SobolevProduct + +namespace OAI + +/-! Global Product. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory +open scoped SchwartzMap ContDiff Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +lemma localization_integer_bound (i : Fin A.count) (ρ : Smooth A) + (hρ : tsupport (ρ : X → ℂ) ⊆ (A.euclideanChart i).source) (k : ℕ) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ f : Smooth A, + ‖schwartzCoord (k : ℝ) (localize A i ρ hρ f)‖ ≤ C*‖D.localizers.embed (k : ℝ) f‖ := by + have hb (p : ι) : CoreBound (k : ℝ) (k : ℝ) (fun v => + localize A i ρ hρ (globalize (D.patch p).index (D.cutoff p) v)) := by + simp_rw [localize_globalize] + exact chartTransport_integer_bound _ (A.euclidean_transition_smooth i (D.patch p).index) + (A.euclidean_transition_smooth (D.patch p).index i) _ k + choose C hC hc using hb + refine ⟨∑ p, C p, Finset.sum_nonneg (fun p _ => hC p), fun f => ?_⟩ + have he : localize A i ρ hρ f = ∑ p, localize A i ρ hρ + (globalize (D.patch p).index (D.cutoff p) (D.forcing p f)) := by + change localizeLinear A i ρ hρ f = _ + conv_lhs => rw [← D.forcing_reconstruction f] + rw [map_sum] + rfl + rw [he, schwartzCoord_sum, Finset.sum_mul] + apply (norm_sum_le _ _).trans + apply Finset.sum_le_sum + intro p _ + exact (hc p (D.forcing p f)).trans + (mul_le_mul_of_nonneg_left (D.forcing_bound p (k : ℝ) f) (hC p)) + +def outerWeight (p : ι) : Smooth A := cutoffGlobal (D.patch p).index (D.cutoff p) + +omit [CompactSpace X] in +lemma outerWeight_support (p : ι) : + tsupport (D.outerWeight p : X → ℂ) ⊆ (A.euclideanChart (D.patch p).index).source := by + intro x hx + obtain ⟨y,hy,rfl⟩ := cutoffGlobal_tsupport (D.patch p).index (D.cutoff p) hx + exact (A.euclideanChart (D.patch p).index).symm.mapsTo ((D.cutoff p).support_sub hy) + +lemma product_localization (p : ι) (f h : Smooth A) : + D.forcing p (f.mul h) = SchwartzMap.smulLeftCLM ℂ (D.forcing p f) + (localize A (D.patch p).index (D.outerWeight p) (D.outerWeight_support p) h) := by + ext y + rw [SchwartzMap.smulLeftCLM_apply_apply (D.forcing p f).hasTemperateGrowth] + change localizeFun A (D.localizers.index p) (D.localizers.weight p) (f.mul h) y = + localizeFun A (D.localizers.index p) (D.localizers.weight p) f y * + localizeFun A (D.patch p).index (D.outerWeight p) h y + rw [D.index_eq] + by_cases hy : y ∈ (A.euclideanChart (D.patch p).index).target + · rw [localizeFun_apply A _ _ hy, localizeFun_apply A _ _ hy, localizeFun_apply A _ _ hy] + by_cases hx : (A.euclideanChart (D.patch p).index).symm y ∈ + tsupport (D.localizers.weight p : X → ℂ) + · have hw : D.outerWeight p ((A.euclideanChart (D.patch p).index).symm y) = 1 := by + change (if (A.euclideanChart (D.patch p).index).symm y ∈ + (A.euclideanChart (D.patch p).index).source then _ else 0) = 1 + have hys : (A.euclideanChart (D.patch p).index).symm y ∈ + (A.euclideanChart (D.patch p).index).source := + (A.euclideanChart (D.patch p).index).symm.mapsTo hy + rw [ite_eq_left hys] + exact D.cutoff_one p _ hx + rw [hw, one_mul] + exact (mul_assoc _ _ _).symm + · rw [image_eq_zero_of_notMem_tsupport hx] + simp + · simp only [localizeFun, ite_eq_right hy, zero_mul] + +theorem smooth_product_bound (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ f h : Smooth A, + ‖D.localizers.embed (k : ℝ) (f.mul h)‖ ≤ + C*(‖D.localizers.embed (k : ℝ) f‖*‖D.localizers.embed (k : ℝ) h‖) := by + obtain ⟨B,hB,hb⟩ := schwartz_sobolev_product_bound (E := EC d) k hk + have hh (p : ι) := D.localization_integer_bound (D.patch p).index (D.outerWeight p) + (D.outerWeight_support p) k + choose C hC hc using hh + refine ⟨B*∑ p, C p, mul_nonneg hB (Finset.sum_nonneg (fun p _ => hC p)), fun f h => ?_⟩ + change ‖D.localizers.coordinates (k : ℝ) (f.mul h)‖ ≤ _ + apply (pi_norm_le_iff_of_nonneg (mul_nonneg (mul_nonneg hB + (Finset.sum_nonneg (fun p _ => hC p))) (mul_nonneg (norm_nonneg _) (norm_nonneg _)))).mpr + intro p + change ‖schwartzCoord (k : ℝ) (D.forcing p (f.mul h))‖ ≤ _ + rw [D.product_localization] + apply (hb (D.forcing p f) (localize A (D.patch p).index (D.outerWeight p) + (D.outerWeight_support p) h)).trans + calc + _ ≤ B*(‖D.localizers.embed (k : ℝ) f‖*(C p*‖D.localizers.embed (k : ℝ) h‖)) := + mul_le_mul_of_nonneg_left (mul_le_mul (D.forcing_bound p (k : ℝ) f) (hc p h) + (norm_nonneg _) (norm_nonneg _)) hB + _ ≤ B*(‖D.localizers.embed (k : ℝ) f‖*((∑ q, C q)*‖D.localizers.embed (k : ℝ) h‖)) := by + gcongr + exact Finset.single_le_sum (fun q _ => hC q) (Finset.mem_univ p) + _ = _ := by ring +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/GlobalRellich.lean b/lean/OAI/Geometry/PrescribedPotential/GlobalRellich.lean new file mode 100644 index 0000000000000000000000000000000000000000..2166eeb3e613737a94eb964ec533d0a76642cdf0 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/GlobalRellich.lean @@ -0,0 +1,102 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.FrequencyApprox +import OAI.Geometry.PrescribedPotential.GlobalSmooth +import OAI.Geometry.PrescribedPotential.PatchCutoffs + +namespace OAI + +/-! Global Rellich. -/ + +section + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory FourierTransform TemperedDistribution +open scoped SchwartzMap ContDiff Classical BoundedContinuousFunction +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +lemma realize_zero (u : L2 E) : realize 0 u = (u : 𝓢'(E, ℂ)) := by + simp only [realize, neg_zero, ContinuousLinearMap.comp_apply, + besselPotential_zero, ContinuousLinearMap.id_apply, Lp.toTemperedDistributionCLM_apply] + +lemma bessel_lower_two (u : L2 E) : + (multiplier (inverseWeight 1) u : 𝓢'(E, ℂ)) = realize 2 u := by + rw [multiplier_distribution _ (inverseWeight_temperate 1)] + simp only [realize, ContinuousLinearMap.comp_apply, Lp.toTemperedDistributionCLM_apply] + rw [besselPotential] + have heq : (inverseWeight (E := E) 1 : E → ℂ) = + (fun x : E => (((1+‖x‖^2)^(-(2:ℝ)/2) : ℝ) : ℂ)) := by + funext x + change (((1+‖x‖^2)^(-((1:ℕ):ℝ)) : ℝ) : ℂ) = _ + norm_num + rw [heq] + +end SobolevChart +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +lemma cutoff_coordinate (p : ι) (u : D.localizers.Sobolev 0) : + multiply (D.cutoff p).val.toBoundedContinuousFunction (u.val p) = u.val p := by + apply l2_injective + simp only [Lp.toTemperedDistributionCLM_apply] + rw [multiply_distribution _ (D.cutoff p).val.hasTemperateGrowth] + have hd : D.localizers.distribution 0 p u = (u.val p : 𝓢'(EC d, ℂ)) := realize_zero _ + rw [← hd] + exact D.cutoff_distribution p u + +lemma lower_coordinate (p : ι) (u : D.localizers.Sobolev 2) : + (D.localizers.lower 2 0 u).val p = multiplier (inverseWeight 1) (u.val p) := by + apply l2_injective + simp only [Lp.toTemperedDistributionCLM_apply] + rw [bessel_lower_two] + rw [← realize_zero] + exact D.localizers.distribution_lower (by norm_num : (0 : ℝ) ≤ 2) p u + + + +theorem lower_compact : IsCompactOperator (D.localizers.lower 2 0) := by + let T (p : ι) : D.localizers.Sobolev 2 →L[ℝ] D.localizers.Sobolev 0 := + D.localizers.globalizeL2 (D.patch p).index (D.cutoff p) ∘L + (multiply (D.cutoff p).val.toBoundedContinuousFunction ∘L + multiplier (inverseWeight 1)).restrictScalars ℝ ∘L + (ContinuousLinearMap.proj p) ∘L (D.localizers.closedSpace 2).subtypeL + have hT (p : ι) : IsCompactOperator (T p) := by + have ht := ((EllipticCompact.localized_bessel_compact (D.cutoff p).val (D.cutoff p).compact).comp_clm + ((ContinuousLinearMap.proj p) ∘L (D.localizers.closedSpace 2).subtypeL)).clm_comp + (D.localizers.globalizeL2 (D.patch p).index (D.cutoff p)) + simpa only [T, ContinuousLinearMap.coe_comp, ContinuousLinearMap.coe_restrictScalars', + Function.comp_assoc] using ht + have he : D.localizers.lower 2 0 = ∑ p, T p := by + ext1 u + rw [← D.reconstruct_eq (D.localizers.lower 2 0 u), D.reconstruct_apply] + simp only [sum_apply] + apply Finset.sum_congr rfl + intro p _ + change D.localizers.globalizeL2 (D.patch p).index (D.cutoff p) + ((D.localizers.lower 2 0 u).val p) = + D.localizers.globalizeL2 (D.patch p).index (D.cutoff p) + (multiply (D.cutoff p).val.toBoundedContinuousFunction + (multiplier (inverseWeight 1) (u.val p))) + rw [← D.lower_coordinate p u, D.cutoff_coordinate] + rw [he] + classical + have hh (S : Finset ι) : IsCompactOperator (∑ p ∈ S, T p : D.localizers.Sobolev 2 →L[ℝ] D.localizers.Sobolev 0) := by + induction S using Finset.induction_on with + | empty => simpa using (isCompactOperator_zero : IsCompactOperator (0 : D.localizers.Sobolev 2 →L[ℝ] D.localizers.Sobolev 0)) + | @insert p S hp ih => + simpa only [Finset.sum_insert hp, FunLike.coe_add] using (hT p).add ih + exact hh Finset.univ + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/GlobalSmooth.lean b/lean/OAI/Geometry/PrescribedPotential/GlobalSmooth.lean new file mode 100644 index 0000000000000000000000000000000000000000..1db71c4988f8796fbbbad3353ab87fac56eef2a5 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/GlobalSmooth.lean @@ -0,0 +1,164 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CompletedResolvent +import OAI.Geometry.PrescribedPotential.GlobalParametrix +import OAI.Geometry.PrescribedPotential.PatchDifferential + +namespace OAI + +/-! Global Smooth. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory TemperedDistribution +open scoped SchwartzMap ContDiff Classical BoundedContinuousFunction +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +lemma schwartzCoord_order_zero (f : 𝓢(E, ℂ)) : + schwartzCoord 0 f = SchwartzMap.toLpCLM ℝ ℂ 2 volume f := by + apply l2_injective + simp only [Lp.toTemperedDistributionCLM_apply] + rw [schwartzCoord_distribution, besselPotential_zero, ContinuousLinearMap.id_apply] + exact (Lp.toTemperedDistribution_toLp_eq f).symm + +end SobolevChart +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace Localizers +variable (D : Localizers A ι) + +lemma allRegular_distribution {u : D.Sobolev 0} (hu : D.AllRegular u) (p : ι) : + ∀ k : ℕ, MemSobolev (2 * (k : ℝ)) 2 (D.distribution 0 p u) := by + intro k + obtain ⟨v, hv⟩ := hu (2 * k) + have h : MemSobolev ((2 * k : ℕ) : ℝ) 2 (D.distribution 0 p u) := by + rw [← hv, D.distribution_lower (Nat.cast_nonneg _)] + exact realize_memSobolev _ _ + simpa only [Nat.cast_mul, Nat.cast_ofNat] using h + + + +def globalizeL2 (i : Fin A.count) (κ : ChartCutoff (A.euclideanChart i).target) : + L2 (EC d) →L[ℝ] D.Sobolev 0 := + ((D.embed 0).comp (globalize i κ)).extendOfNorm + (SchwartzMap.toLpCLM ℝ ℂ 2 volume).toLinearMap + +lemma globalizeL2_schwartz (i : Fin A.count) (κ : ChartCutoff (A.euclideanChart i).target) + (f : 𝓢(EC d, ℂ)) : + D.globalizeL2 i κ (schwartzCoord 0 f) = D.embed 0 (globalize i κ f) := by + rw [schwartzCoord_order_zero] + have hb := globalize_integer_bound D i κ 0 + rw [Nat.cast_zero] at hb + obtain ⟨C, hC, h⟩ := hb + have hn : ∀ f : 𝓢(EC d, ℂ), + ‖D.embed 0 (globalize i κ f)‖ ≤ C * ‖SchwartzMap.toLpCLM ℝ ℂ 2 volume f‖ := by + intro f + rw [← schwartzCoord_order_zero] + exact h f + exact LinearMap.extendOfNorm_eq (SchwartzMap.denseRange_toLpCLM (by norm_num)) ⟨C, hn⟩ f + +end Localizers +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +lemma cutoff_forcing (p : ι) (f : Smooth A) : + SchwartzMap.smulLeftCLM ℂ (D.cutoff p).val (D.forcing p f) = D.forcing p f := by + ext y + rw [SchwartzMap.smulLeftCLM_apply_apply (D.cutoff p).val.hasTemperateGrowth, smul_eq_mul] + by_cases hy : D.forcing p f y = 0 + · rw [hy, mul_zero] + · have hs := localizeFun_support A (D.localizers.index p) (D.localizers.weight p) f hy + obtain ⟨x, hx, he⟩ := hs + rw [D.index_eq] at he + rw [← he, D.cutoff_one p x hx, one_mul] + +lemma cutoff_distribution (p : ι) (u : D.localizers.Sobolev 0) : + smulLeftCLM ℂ (D.cutoff p).val (D.localizers.distribution 0 p u) = + D.localizers.distribution 0 p u := by + have he : smulLeftCLM ℂ (D.cutoff p).val ∘ D.localizers.distribution 0 p = + D.localizers.distribution 0 p := by + apply (D.localizers.embed_dense 0).equalizer (by fun_prop) (by fun_prop) + funext f + simp only [Function.comp_apply, D.localizers.distribution_embed] + change smulLeftCLM ℂ (D.cutoff p).val (SchwartzMap.toTemperedDistributionCLM (EC d) ℂ volume (D.forcing p f)) = _ + rw [← schwartz_temperate_product_distribution (D.cutoff p).val.hasTemperateGrowth, + D.cutoff_forcing] + rfl + exact congr_fun he u + + + +lemma allRegular_coordinate {u : D.localizers.Sobolev 0} (hu : D.localizers.AllRegular u) (p : ι) : + ∃ f : 𝓢(EC d, ℂ), schwartzCoord 0 f = u.val p := by + obtain ⟨F, hF, he⟩ := all_even_smooth_representative (D.localizers.allRegular_distribution hu p) + let f := SchwartzMap.smulLeftCLM ℂ F (D.cutoff p).val + have hf : SchwartzMap.toTemperedDistributionCLM (EC d) ℂ volume f = + D.localizers.distribution 0 p u := by + rw [schwartz_mul_temperate_distribution _ hF, temperateDistribution_bounded, he, + D.cutoff_distribution] + refine ⟨f, ?_⟩ + apply realize_injective 0 + rw [realize_schwartzCoord, hf] + rfl + +def reconstruct : D.localizers.Sobolev 0 →L[ℝ] D.localizers.Sobolev 0 := + ∑ p, (D.localizers.globalizeL2 (D.patch p).index (D.cutoff p)) ∘L + (ContinuousLinearMap.proj p) ∘L (D.localizers.closedSpace 0).subtypeL + +lemma reconstruct_apply (u : D.localizers.Sobolev 0) : + D.reconstruct u = ∑ p, D.localizers.globalizeL2 (D.patch p).index (D.cutoff p) (u.val p) := by + simp only [reconstruct, _root_.sum_apply, ContinuousLinearMap.comp_apply, + ContinuousLinearMap.proj_apply, Submodule.subtypeL_apply] + +lemma reconstruct_eq (u : D.localizers.Sobolev 0) : D.reconstruct u = u := by + have he : D.reconstruct = ContinuousLinearMap.id ℝ _ := by + apply DFunLike.coe_injective + apply (D.localizers.embed_dense 0).equalizer (by fun_prop) continuous_id + funext f + change D.reconstruct (D.localizers.embed 0 f) = D.localizers.embed 0 f + rw [D.reconstruct_apply] + change (∑ p, D.localizers.globalizeL2 (D.patch p).index (D.cutoff p) + (schwartzCoord 0 (D.forcing p f))) = D.localizers.embed 0 f + simp_rw [D.localizers.globalizeL2_schwartz] + rw [← map_sum, D.forcing_reconstruction] + rw [he, ContinuousLinearMap.id_apply] + + + +theorem allRegular_smooth {u : D.localizers.Sobolev 0} (hu : D.localizers.AllRegular u) : + ∃ f : Smooth A, D.localizers.embed 0 f = u := by + choose f hf using D.allRegular_coordinate hu + refine ⟨∑ p, globalize (D.patch p).index (D.cutoff p) (f p), ?_⟩ + rw [map_sum, ← D.reconstruct_eq u, D.reconstruct_apply] + apply Finset.sum_congr rfl + intro p _ + rw [← hf p, D.localizers.globalizeL2_schwartz] + + + +theorem exists_smooth_shifted (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (f : Smooth A) : ∃ u : Smooth A, (m^2 : ℝ) • u - complexL g u = f := by + obtain ⟨u, hu⟩ := D.allRegular_smooth (D.completedResolvent_regular m hm he f) + have h2 : D.localizers.embed 2 u = D.completedResolvent m hm he (D.localizers.embed 0 f) := by + apply D.localizers.lower_injective (by norm_num : (0 : ℝ) ≤ 2) + rw [D.localizers.lower_embed (by norm_num : (0 : ℝ) ≤ 2), hu] + refine ⟨u, D.localizers.embed_injective 0 ?_⟩ + have h := D.completedResolvent_equation m hm he (D.localizers.embed 0 f) + rw [← h2] at h + simpa only [shiftedOperator, completedL, _root_.sub_apply, + _root_.smul_apply, D.localizers.lower_embed (by norm_num : (0 : ℝ) ≤ 2), + D.localizers.extendCore_embed D.complexL_bound, map_sub, map_smul] using h + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/GlobalSobolev.lean b/lean/OAI/Geometry/PrescribedPotential/GlobalSobolev.lean new file mode 100644 index 0000000000000000000000000000000000000000..c97e51ac8a85b8be785111a7bed3570a2e3dcf37 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/GlobalSobolev.lean @@ -0,0 +1,139 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.LocalizedCompact +import OAI.Geometry.PrescribedPotential.ParametrixAtlas + +namespace OAI + +/-! Global Sobolev. -/ + +section + + + +noncomputable section +open Set Filter Topology MeasureTheory Manifold IsManifold +open scoped ContDiff SchwartzMap BoundedContinuousFunction Classical + +namespace GlobalElliptic +open Anticanonical EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] (A : ComplexAtlas d X) + + +def smoothSpace : Submodule ℝ (X → ℂ) where + carrier := {f | ∀ i, ContDiffOn ℝ ∞ (f ∘ (A.euclideanChart i).symm) + (A.euclideanChart i).target} + zero_mem' := by intro i; exact contDiffOn_const + add_mem' := by intro f h hf hh i; exact (hf i).add (hh i) + smul_mem' := by intro c f hf i; exact contDiffOn_const.smul (hf i) + +abbrev Smooth := ↥(smoothSpace A) + +instance : FunLike (Smooth A) X ℂ where + coe := Subtype.val + coe_injective := Subtype.val_injective + +namespace Smooth +variable {A} + +@[simp] lemma add_apply (f h : Smooth A) (x : X) : (f + h) x = f x + h x := rfl +@[simp] lemma smul_apply (c : ℝ) (f : Smooth A) (x : X) : (c • f) x = c • f x := rfl +@[simp] lemma zero_apply (x : X) : (0 : Smooth A) x = 0 := rfl + +lemma smooth (f : Smooth A) (i : Fin A.count) : + ContDiffOn ℝ ∞ (f ∘ (A.euclideanChart i).symm) (A.euclideanChart i).target := f.property i + +lemma continuous (f : Smooth A) : Continuous (f : X → ℂ) := by + rw [continuous_iff_continuousAt] + intro x + obtain ⟨i, hi⟩ := A.covers x + let e := A.euclideanChart i + have hx : x ∈ e.source := by simpa [e] using hi + have he := e.continuousAt hx + have hf := ((f.smooth i).continuousOn.continuousAt (e.open_target.mem_nhds (e.mapsTo hx))).comp he + apply hf.congr + filter_upwards [e.open_source.mem_nhds hx] with y hy + exact congrArg f (e.left_inv hy) + +@[ext] lemma ext {f h : Smooth A} (H : ∀ x, f x = h x) : f = h := Subtype.ext (funext H) + +def const (c : ℂ) : Smooth A := ⟨fun _ => c, fun _ => contDiffOn_const⟩ + + +def mul (f h : Smooth A) : Smooth A := ⟨fun x => f x * h x, fun i => (f.smooth i).mul (h.smooth i)⟩ + +end Smooth + + +def localizeFun (i : Fin A.count) (ρ f : Smooth A) (y : EC d) : ℂ := + if y ∈ (A.euclideanChart i).target then + ρ ((A.euclideanChart i).symm y) * f ((A.euclideanChart i).symm y) else 0 + +lemma localizeFun_apply {i : Fin A.count} (ρ f : Smooth A) {y : EC d} + (hy : y ∈ (A.euclideanChart i).target) : + localizeFun A i ρ f y = ρ ((A.euclideanChart i).symm y) * + f ((A.euclideanChart i).symm y) := ite_eq_left hy + +lemma localizeFun_support (i : Fin A.count) (ρ f : Smooth A) : + Function.support (localizeFun A i ρ f) ⊆ (A.euclideanChart i) '' tsupport (ρ : X → ℂ) := by + intro y hy + have hn : localizeFun A i ρ f y ≠ 0 := hy + by_cases ht : y ∈ (A.euclideanChart i).target + · rw [localizeFun_apply A ρ f ht] at hn + exact ⟨(A.euclideanChart i).symm y, + subset_tsupport _ (left_ne_zero_of_mul hn), (A.euclideanChart i).right_inv ht⟩ + · exact (hn (ite_eq_right ht)).elim + +lemma localizeFun_smooth_compact [T2Space X] [CompactSpace X] + (i : Fin A.count) (ρ f : Smooth A) + (hρ : tsupport (ρ : X → ℂ) ⊆ (A.euclideanChart i).source) : + ContDiff ℝ ∞ (localizeFun A i ρ f) ∧ HasCompactSupport (localizeFun A i ρ f) := by + let e := A.euclideanChart i + let K := e '' tsupport (ρ : X → ℂ) + have hK : IsCompact K := (isClosed_tsupport _).isCompact.image_of_continuousOn + (e.continuousOn.mono hρ) + have hs : Function.support (localizeFun A i ρ f) ⊆ K := localizeFun_support A i ρ f + constructor + · rw [contDiff_iff_contDiffAt] + intro y + by_cases hy : y ∈ e.target + · have hc := ((ρ.smooth i).mul (f.smooth i)).contDiffAt (e.open_target.mem_nhds hy) + apply hc.congr_of_eventuallyEq + filter_upwards [e.open_target.mem_nhds hy] with z hz + exact localizeFun_apply A ρ f hz + · have hyK : y ∉ K := by + rintro ⟨x, hx, rfl⟩ + exact hy (e.mapsTo (hρ hx)) + apply (contDiffAt_const (c := (0 : ℂ))).congr_of_eventuallyEq + filter_upwards [hK.isClosed.isOpen_compl.mem_nhds hyK] with z hz + exact Function.notMem_support.mp (fun h => hz (hs h)) + · exact HasCompactSupport.of_support_subset_isCompact hK hs + + +def localize [T2Space X] [CompactSpace X] (i : Fin A.count) (ρ : Smooth A) + (hρ : tsupport (ρ : X → ℂ) ⊆ (A.euclideanChart i).source) (f : Smooth A) : 𝓢(EC d, ℂ) := + (localizeFun_smooth_compact A i ρ f hρ).2.toSchwartzMap + (localizeFun_smooth_compact A i ρ f hρ).1 + +@[simp] lemma localize_apply [T2Space X] [CompactSpace X] (i : Fin A.count) (ρ : Smooth A) + (hρ : tsupport (ρ : X → ℂ) ⊆ (A.euclideanChart i).source) (f : Smooth A) (y : EC d) : + localize A i ρ hρ f y = localizeFun A i ρ f y := rfl + + +def localizeLinear [T2Space X] [CompactSpace X] (i : Fin A.count) (ρ : Smooth A) + (hρ : tsupport (ρ : X → ℂ) ⊆ (A.euclideanChart i).source) : Smooth A →ₗ[ℝ] 𝓢(EC d, ℂ) where + toFun := localize A i ρ hρ + map_add' f h := by + ext y + simp only [localize_apply, localizeFun, add_apply] + split_ifs <;> simp [mul_add] + map_smul' c f := by + ext y + simp only [localize_apply, localizeFun, smul_apply] + split_ifs <;> simp [mul_left_comm] + +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/GlobalStrongEmbedding.lean b/lean/OAI/Geometry/PrescribedPotential/GlobalStrongEmbedding.lean new file mode 100644 index 0000000000000000000000000000000000000000..f71815d7ea5c8efbd495cf6c0bd1d97fcad269e1 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/GlobalStrongEmbedding.lean @@ -0,0 +1,108 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CircleRadialCalculus +import OAI.Geometry.PrescribedPotential.SobolevProduct + +namespace OAI + +/-! Global Strong Embedding. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory +open scoped SchwartzMap ContDiff Classical BoundedContinuousFunction +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] + +def Smooth.bounded (f : Smooth A) : X →ᵇ ℂ := + BoundedContinuousFunction.mkOfCompact ⟨f, f.continuous⟩ + +def Smooth.boundedLinear : Smooth A →ₗ[ℝ] (X →ᵇ ℂ) where + toFun := Smooth.bounded + map_add' _ _ := rfl + map_smul' _ _ := rfl + +namespace Localizers +variable (D : Localizers A ι) + +lemma smooth_bounded_estimate (s : ℝ) (hs : (Module.finrank ℝ (EC d) : ℝ) < 2*s) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ f : Smooth A, ‖f.bounded‖ ≤ C*‖D.embed s f‖ := by + let B := ‖strongEmbedding (E := EC d) s hs‖ + refine ⟨(Fintype.card ι : ℝ)*B, mul_nonneg (Nat.cast_nonneg _) (norm_nonneg _), fun f => ?_⟩ + apply (BoundedContinuousFunction.norm_le (mul_nonneg + (mul_nonneg (Nat.cast_nonneg _) (norm_nonneg _)) (norm_nonneg _))).mpr + intro x + change ‖f x‖ ≤ _ + have he : f x = ∑ p : ι, D.weight p x*f x := by rw [← Finset.sum_mul, D.sum_one, one_mul] + rw [he] + apply (norm_sum_le _ _).trans + calc + _ ≤ ∑ p : ι, B*‖D.embed s f‖ := by + apply Finset.sum_le_sum + intro p _ + by_cases hx : x ∈ tsupport (D.weight p : X → ℂ) + · have hxs := D.support_sub p hx + have hp := strongEmbedding_norm s hs + (schwartzCoord s (localize A (D.index p) (D.weight p) (D.support_sub p) f)) + (A.euclideanChart (D.index p) x) + rw [strongEmbedding_schwartz] at hp + change ‖localizeFun A (D.index p) (D.weight p) f (A.euclideanChart (D.index p) x)‖ ≤ _ at hp + rw [localizeFun_apply A _ _ ((A.euclideanChart (D.index p)).mapsTo hxs), + (A.euclideanChart (D.index p)).left_inv hxs] at hp + exact hp.trans (mul_le_mul_of_nonneg_left + (norm_le_pi_norm (D.coordinates s f) p) (norm_nonneg _)) + · rw [image_eq_zero_of_notMem_tsupport hx, zero_mul, norm_zero] + positivity + _ = _ := by simp only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul]; ring + +def strong (s : ℝ) : D.Sobolev s →L[ℝ] (X →ᵇ ℂ) := + Smooth.boundedLinear.extendOfNorm (D.embed s) + +lemma strong_embed (s : ℝ) (hs : (Module.finrank ℝ (EC d) : ℝ) < 2*s) (f : Smooth A) : + D.strong s (D.embed s f) = f.bounded := by + obtain ⟨C,_,hc⟩ := D.smooth_bounded_estimate s hs + exact LinearMap.extendOfNorm_eq (D.embed_dense s) ⟨C,hc⟩ f + +lemma strong_localized (s : ℝ) (hs : (Module.finrank ℝ (EC d) : ℝ) < 2*s) + (u : D.Sobolev s) (p : ι) (y : EC d) : + strongEmbedding s hs (u.val p) y = if y ∈ (A.euclideanChart (D.index p)).target then + D.weight p ((A.euclideanChart (D.index p)).symm y) * + D.strong s u ((A.euclideanChart (D.index p)).symm y) else 0 := by + have he : (fun u : D.Sobolev s => strongEmbedding s hs (u.val p) y) = + (fun u : D.Sobolev s => if y ∈ (A.euclideanChart (D.index p)).target then + D.weight p ((A.euclideanChart (D.index p)).symm y)* + D.strong s u ((A.euclideanChart (D.index p)).symm y) else 0) := by + apply (D.embed_dense s).equalizer + · exact ((BoundedContinuousFunction.lipschitz_eval_const y).continuous.comp + ((strongEmbedding s hs).continuous.comp ((continuous_apply p).comp continuous_subtype_val))) + · split_ifs <;> fun_prop + funext f + dsimp only [Function.comp_apply] + rw [D.strong_embed s hs] + change strongEmbedding s hs (schwartzCoord s (localize A (D.index p) + (D.weight p) (D.support_sub p) f)) y = _ + rw [strongEmbedding_schwartz] + rfl + exact congr_fun he u + +lemma strong_injective (s : ℝ) (hs : (Module.finrank ℝ (EC d) : ℝ) < 2*s) : + Function.Injective (D.strong s) := by + intro u v huv + apply Subtype.ext + funext p + apply realize_injective s + rw [← strongEmbedding_distribution s hs, ← strongEmbedding_distribution s hs] + congr 1 + ext y + rw [D.strong_localized s hs, D.strong_localized s hs, huv] +end Localizers +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/GlobalTransport.lean b/lean/OAI/Geometry/PrescribedPotential/GlobalTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..9b72c9c68a54e143822e87eb5d10e642f55673d1 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/GlobalTransport.lean @@ -0,0 +1,109 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.ChartTransportHigher +import OAI.Geometry.PrescribedPotential.GlobalExtension +import OAI.Geometry.PrescribedPotential.GlobalPartition + +namespace OAI + +/-! Global Transport. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory +open scoped ContDiff SchwartzMap Classical + +namespace GlobalElliptic +open Anticanonical EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} + +lemma localize_tsupport (i : Fin A.count) (ρ f : Smooth A) + (hρ : tsupport (ρ : X → ℂ) ⊆ (A.euclideanChart i).source) : + tsupport (localize A i ρ hρ f : EC d → ℂ) ⊆ + (A.euclideanChart i) '' (tsupport (ρ : X → ℂ) ∩ tsupport (f : X → ℂ)) := by + let e := A.euclideanChart i + have hK : IsCompact (tsupport (ρ : X → ℂ) ∩ tsupport (f : X → ℂ)) := + (isClosed_tsupport _).isCompact.inter_right (isClosed_tsupport _) + apply closure_minimal _ (hK.image_of_continuousOn (e.continuousOn.mono + (fun x hx => hρ hx.1))).isClosed + intro y hy + have hn : localize A i ρ hρ f y ≠ 0 := hy + by_cases ht : y ∈ e.target + · rw [localize_apply, localizeFun_apply A ρ f ht] at hn + exact ⟨e.symm y, ⟨subset_tsupport _ (left_ne_zero_of_mul hn), + subset_tsupport _ (right_ne_zero_of_mul hn)⟩, e.right_inv ht⟩ + · exact (hn (ite_eq_right ht)).elim + +def cutoffGlobal (i : Fin A.count) (κ : ChartCutoff (A.euclideanChart i).target) : Smooth A := + extend i κ.val (κ.val.smooth ⊤) κ.compact κ.support_sub + +omit [CompactSpace X] in +lemma cutoffGlobal_tsupport (i : Fin A.count) (κ : ChartCutoff (A.euclideanChart i).target) : + tsupport (cutoffGlobal i κ : X → ℂ) ⊆ + (A.euclideanChart i).symm '' tsupport (κ : EC d → ℂ) := + extend_tsupport i κ.val (κ.val.smooth ⊤) κ.compact κ.support_sub + + +def overlapCutoff (i j : Fin A.count) (κ : ChartCutoff (A.euclideanChart i).target) + (ρ : Smooth A) (hρ : tsupport (ρ : X → ℂ) ⊆ (A.euclideanChart j).source) : + ChartCutoff ((A.euclideanChart j).symm.trans (A.euclideanChart i)).source where + val := localize A j ρ hρ (cutoffGlobal i κ) + compact := (localizeFun_smooth_compact A j ρ _ hρ).2 + support_sub := by + intro y hy + obtain ⟨x, ⟨hxρ, hxf⟩, rfl⟩ := localize_tsupport j ρ _ hρ hy + have hxj := hρ hxρ + have hxi : x ∈ (A.euclideanChart i).source := by + obtain ⟨z, hz, rfl⟩ := cutoffGlobal_tsupport i κ hxf + exact (A.euclideanChart i).symm.mapsTo (κ.support_sub hz) + refine ⟨(A.euclideanChart j).mapsTo hxj, ?_⟩ + simpa only [OpenPartialHomeomorph.symm_symm, mem_preimage, + (A.euclideanChart j).left_inv hxj] using hxi + +@[simp] lemma overlapCutoff_apply (i j : Fin A.count) + (κ : ChartCutoff (A.euclideanChart i).target) (ρ : Smooth A) + (hρ : tsupport (ρ : X → ℂ) ⊆ (A.euclideanChart j).source) (y : EC d) : + overlapCutoff i j κ ρ hρ y = if y ∈ (A.euclideanChart j).target then + ρ ((A.euclideanChart j).symm y) * + (if (A.euclideanChart j).symm y ∈ (A.euclideanChart i).source then + κ (A.euclideanChart i ((A.euclideanChart j).symm y)) else 0) else 0 := rfl + +lemma localize_globalize (i j : Fin A.count) (κ : ChartCutoff (A.euclideanChart i).target) + (ρ : Smooth A) (hρ : tsupport (ρ : X → ℂ) ⊆ (A.euclideanChart j).source) + (f : 𝓢(EC d, ℂ)) : + localize A j ρ hρ (globalize i κ f) = + chartTransport ((A.euclideanChart j).symm.trans (A.euclideanChart i)) + (A.euclidean_transition_smooth j i) (overlapCutoff i j κ ρ hρ) f := by + ext y + simp only [localize_apply, localizeFun, globalize_apply, chartTransport_apply, + overlapCutoff_apply, OpenPartialHomeomorph.trans_apply] + split_ifs <;> simp_all only [mul_zero, zero_mul, mul_assoc] + + + +theorem globalize_even_bound {ι : Type*} [Fintype ι] (D : Localizers A ι) + (i : Fin A.count) (κ : ChartCutoff (A.euclideanChart i).target) (k : ℕ) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ f : 𝓢(EC d, ℂ), + ‖D.embed (2 * (k : ℝ)) (globalize i κ f)‖ ≤ C * ‖schwartzCoord (2 * (k : ℝ)) f‖ := by + have hB (j : ι) : CoreBound (2 * (k : ℝ)) (2 * (k : ℝ)) + (fun f => localize A (D.index j) (D.weight j) (D.support_sub j) (globalize i κ f)) := by + simp_rw [localize_globalize] + exact chartTransport_even_bound _ (A.euclidean_transition_smooth (D.index j) i) + (A.euclidean_transition_smooth i (D.index j)) _ k + choose C hC h using hB + refine ⟨∑ j, C j, Finset.sum_nonneg (fun j _ => hC j), fun f => ?_⟩ + change ‖D.coordinates (2 * (k : ℝ)) (globalize i κ f)‖ ≤ _ + apply (pi_norm_le_iff_of_nonneg (mul_nonneg (Finset.sum_nonneg (fun j _ => hC j)) (norm_nonneg _))).mpr + intro j + exact (h j f).trans (mul_le_mul_of_nonneg_right + (Finset.single_le_sum (fun j _ => hC j) (Finset.mem_univ j)) (norm_nonneg _)) + +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/GradientJacobian.lean b/lean/OAI/Geometry/PrescribedPotential/GradientJacobian.lean new file mode 100644 index 0000000000000000000000000000000000000000..d27b629baef3bf6bf5a4674f6aafe217423fc089 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/GradientJacobian.lean @@ -0,0 +1,68 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CircleRadialCalculus +import OAI.Geometry.PrescribedPotential.RealDeterminantOrder + +namespace OAI + +/-! Gradient Jacobian. -/ + +section + + + +noncomputable section +open Matrix Set Filter Topology +open scoped InnerProductSpace ContDiff +namespace PotentialABP +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] + +lemma positive_det_nonneg {L : E →ₗ[ℝ] E} (hL : L.IsPositive) : 0 ≤ L.det := by + let b := stdOrthonormalBasis ℝ E + rw [← LinearMap.det_toMatrix b.toBasis] + exact ((LinearMap.posSemidef_toMatrix_iff b).mpr hL).det_nonneg + +lemma positive_det_mono {L M : E →ₗ[ℝ] E} + (hL : L.IsPositive) (hML : (M-L).IsPositive) : L.det ≤ M.det := by + let b := stdOrthonormalBasis ℝ E + rw [← LinearMap.det_toMatrix b.toBasis L, ← LinearMap.det_toMatrix b.toBasis M] + apply real_det_mono ((LinearMap.posSemidef_toMatrix_iff b).mpr hL) + rw [← map_sub] + exact (LinearMap.posSemidef_toMatrix_iff b).mpr hML + +lemma inner_fderiv_gradient {u : E → ℝ} (hu : ContDiff ℝ ∞ u) (x v w : E) : + inner ℝ (fderiv ℝ (gradient u) x v) w = fderiv ℝ (fderiv ℝ u) x v w := by + have hd := (InnerProductSpace.toDual ℝ E).symm.hasFDerivAt.comp x + ((hu.fderiv_right (m := ∞) (by simp)).differentiable (by simp) x).hasFDerivAt + have he := hd.fderiv + change fderiv ℝ (gradient u) x = _ at he + rw [he] + change inner ℝ ((InnerProductSpace.toDual ℝ E).symm (fderiv ℝ (fderiv ℝ u) x v)) w = _ + rw [← InnerProductSpace.toDual_apply_apply] + simp + +lemma gradient_hessian_symmetric {u : E → ℝ} (hu : ContDiff ℝ ∞ u) (x : E) : + (fderiv ℝ (gradient u) x).toLinearMap.IsSymmetric := by + intro v w + change inner ℝ (fderiv ℝ (gradient u) x v) w = inner ℝ v (fderiv ℝ (gradient u) x w) + rw [inner_fderiv_gradient hu, real_inner_comm, inner_fderiv_gradient hu] + exact hu.contDiffAt.isSymmSndFDerivAt (by + simp only [minSmoothness_of_isRCLikeNormedField] + change ((2 : ℕ∞) : WithTop ℕ∞) ≤ ((⊤ : ℕ∞) : WithTop ℕ∞) + exact WithTop.coe_le_coe.mpr le_top) v w + +lemma gradient_hessian_positive {u : E → ℝ} (hu : ContDiff ℝ ∞ u) {x : E} + (hB : ∀ v, 0 ≤ fderiv ℝ (fderiv ℝ u) x v v) : + (fderiv ℝ (gradient u) x).toLinearMap.IsPositive := by + refine ⟨gradient_hessian_symmetric hu x, ?_⟩ + intro v + change 0 ≤ inner ℝ (fderiv ℝ (gradient u) x v) v + rw [inner_fderiv_gradient hu] + exact hB v + +end PotentialABP + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/HessianCommutator.lean b/lean/OAI/Geometry/PrescribedPotential/HessianCommutator.lean new file mode 100644 index 0000000000000000000000000000000000000000..ff895326134aeef1c924bbddf5582019e8056316 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/HessianCommutator.lean @@ -0,0 +1,83 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CircleRadialCalculus +import OAI.Geometry.PrescribedPotential.ComplexHessian +import OAI.Geometry.PrescribedPotential.CutoffHigher + +namespace OAI + +/-! Hessian Commutator. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory LineDeriv +open scoped ContDiff SchwartzMap Classical +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +def secondLocalizedError (κ : 𝓢(E, ℂ)) (v a b : E) : + 𝓢(E, ℂ) →L[ℂ] 𝓢(E, ℂ) := + SchwartzMap.smulLeftCLM ℂ (∂_{a} κ : 𝓢(E, ℂ)) ∘L + (lineDerivOpCLM ℂ 𝓢(E, ℂ) b ∘L lineDerivOpCLM ℂ 𝓢(E, ℂ) v) + + SchwartzMap.smulLeftCLM ℂ (∂_{b} κ : 𝓢(E, ℂ)) ∘L + (lineDerivOpCLM ℂ 𝓢(E, ℂ) a ∘L lineDerivOpCLM ℂ 𝓢(E, ℂ) v) + + SchwartzMap.smulLeftCLM ℂ (∂_{a} (∂_{b} κ) : 𝓢(E, ℂ)) ∘L + lineDerivOpCLM ℂ 𝓢(E, ℂ) v + +lemma secondLocalizedError_identity (κ f : 𝓢(E, ℂ)) (v a b : E) : + ∂_{a} (∂_{b} (SchwartzMap.smulLeftCLM ℂ κ (∂_{v} f))) = + SchwartzMap.smulLeftCLM ℂ κ (∂_{v} (∂_{a} (∂_{b} f))) + + secondLocalizedError κ v a b f := by + rw [schwartz_second_product] + have hd : ∂_{a} (∂_{b} (∂_{v} f)) = ∂_{v} (∂_{a} (∂_{b} f)) := by + rw [schwartz_deriv_comm b v, schwartz_deriv_comm a v] + rw [hd] + rfl + +lemma secondLocalizedError_bound (κ : 𝓢(E, ℂ)) (v a b : E) (k : ℕ) : + CoreBound ((k : ℝ)+2) (k : ℝ) (secondLocalizedError κ v a b) := by + have hd (w : E) : CoreBound ((k : ℝ)+2) (k : ℝ) + (fun f : 𝓢(E, ℂ) => ∂_{w} (∂_{v} f)) := + (coreBound_deriv w (s := (k : ℝ)+1) (t := (k : ℝ)) (by linarith)).comp + (coreBound_deriv v (s := (k : ℝ)+2) (t := (k : ℝ)+1) (by linarith)) + exact ((coreBound_product_integer (∂_{a} κ) k).comp (hd b)).add + ((coreBound_product_integer (∂_{b} κ) k).comp (hd a)) |>.add + ((coreBound_product_integer (∂_{a} (∂_{b} κ)) k).comp + (coreBound_deriv v (s := (k : ℝ)+2) (t := (k : ℝ)) (by linarith))) +end SobolevChart + +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} + +def hessianLocalizedError (κ : 𝓢(EC d, ℂ)) (v : EC d) (i j : Fin d) : + 𝓢(EC d, ℂ) →L[ℂ] 𝓢(EC d, ℂ) := + (1/4 : ℂ) • (secondLocalizedError κ v (hessianDirection i) (hessianDirection j) + + secondLocalizedError κ v (hessianIDirection i) (hessianIDirection j) + + Complex.I • (secondLocalizedError κ v (hessianIDirection i) (hessianDirection j) + + (-1 : ℂ) • secondLocalizedError κ v (hessianDirection i) (hessianIDirection j))) + +lemma hessianLocalizedError_identity (κ f : 𝓢(EC d, ℂ)) (v : EC d) (i j : Fin d) : + hessianEntrySchwartz i j (SchwartzMap.smulLeftCLM ℂ κ (∂_{v} f)) = + SchwartzMap.smulLeftCLM ℂ κ (∂_{v} (hessianEntrySchwartz i j f)) + + hessianLocalizedError κ v i j f := by + simp only [hessianEntrySchwartz, hessianLocalizedError, smul_apply, + add_apply, ContinuousLinearMap.comp_apply, lineDerivOpCLM_apply, + secondLocalizedError_identity, lineDerivOp_add, lineDerivOp_smul, map_smul, map_add] + module + +lemma hessianLocalizedError_bound (κ : 𝓢(EC d, ℂ)) (v : EC d) (i j : Fin d) (k : ℕ) : + CoreBound ((k : ℝ)+2) (k : ℝ) (hessianLocalizedError κ v i j) := by + exact ((secondLocalizedError_bound κ v _ _ k).add + (secondLocalizedError_bound κ v _ _ k) |>.add + (((secondLocalizedError_bound κ v _ _ k).add + ((secondLocalizedError_bound κ v _ _ k).smul (-1))).smul Complex.I)).smul (1/4) +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/HigherDirectionalJets.lean b/lean/OAI/Geometry/PrescribedPotential/HigherDirectionalJets.lean new file mode 100644 index 0000000000000000000000000000000000000000..18a5b29bacd502665c5d390bf17a1355c8607d8a --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/HigherDirectionalJets.lean @@ -0,0 +1,105 @@ +import Mathlib + +namespace OAI + +/-! Higher Directional Jets. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff +namespace HigherJet +variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] + +def dir (v : E) (f : E → F) (x : E) : F := fderiv ℝ f x v + +def word : List E → (E → F) → E → F + | [], f => f + | v::ws, f => dir v (word ws f) + +lemma dir_smoothAt {f : E → F} {x : E} (hf : ContDiffAt ℝ ∞ f x) (v : E) : + ContDiffAt ℝ ∞ (dir v f) x := + (hf.fderiv_right (m := ∞) (by simp)).clm_apply contDiffAt_const + +lemma dir_smoothOn {U : Set E} (hU : IsOpen U) {f : E → F} + (hf : ContDiffOn ℝ ∞ f U) (v : E) : ContDiffOn ℝ ∞ (dir v f) U := + (hf.fderiv_of_isOpen hU (m := ∞) (by simp)).clm_apply contDiffOn_const + +lemma word_smoothOn {U : Set E} (hU : IsOpen U) {f : E → F} + (hf : ContDiffOn ℝ ∞ f U) (ws : List E) : ContDiffOn ℝ ∞ (word ws f) U := by + induction ws with + | nil => exact hf + | cons v ws ih => exact dir_smoothOn hU ih v + +lemma dir_congr {f g : E → F} {x : E} (h : f =ᶠ[𝓝 x] g) (v : E) : + dir v f x = dir v g x := congrArg (fun T : E →L[ℝ] F => T v) h.fderiv_eq + +lemma word_congr {f g : E → F} {x : E} (h : f =ᶠ[𝓝 x] g) (ws : List E) : + word ws f x = word ws g x := by + induction ws generalizing x with + | nil => exact h.self_of_nhds + | cons v ws ih => + exact dir_congr (h.eventually_nhds.mono (fun y hy => ih hy)) v + +lemma dir_dir {f : E → F} {x : E} (hf : ContDiffAt ℝ ∞ f x) (u v : E) : + dir u (dir v f) x = fderiv ℝ (fderiv ℝ f) x u v := by + have hd := (hf.fderiv_right (m := ∞) (by simp)).differentiableAt (by simp) + exact congrArg (fun T : E →L[ℝ] F => T u) + ((ContinuousLinearMap.apply ℝ F v).hasFDerivAt.comp x hd.hasFDerivAt).fderiv + +lemma dir_comm {f : E → F} {x : E} (hf : ContDiffAt ℝ ∞ f x) (u v : E) : + dir u (dir v f) x = dir v (dir u f) x := by + rw [dir_dir hf,dir_dir hf] + exact hf.isSymmSndFDerivAt (by + simp only [minSmoothness_of_isRCLikeNormedField] + exact WithTop.coe_le_coe.mpr le_top) u v + +lemma dir_word_comm {U : Set E} (hU : IsOpen U) {f : E → F} + (hf : ContDiffOn ℝ ∞ f U) (v : E) (ws : List E) {x : E} (hx : x ∈ U) : + dir v (word ws f) x = word ws (dir v f) x := by + induction ws generalizing x with + | nil => rfl + | cons w ws ih => + change dir v (dir w (word ws f)) x = dir w (word ws (dir v f)) x + rw [dir_comm ((word_smoothOn hU hf ws).contDiffAt (hU.mem_nhds hx))] + exact dir_congr (by filter_upwards [hU.mem_nhds hx] with y hy using ih hy) w + +lemma word_dir_dir_comm {U : Set E} (hU : IsOpen U) {f : E → F} + (hf : ContDiffOn ℝ ∞ f U) (v w : E) (ws : List E) {x : E} (hx : x ∈ U) : + word ws (dir v (dir w f)) x = dir v (dir w (word ws f)) x := by + rw [← dir_word_comm hU (dir_smoothOn hU hf w) v ws hx] + exact dir_congr (by + filter_upwards [hU.mem_nhds hx] with y hy + exact (dir_word_comm hU hf w ws hy).symm) v + +lemma word_ofFn_eq {U : Set E} (hU : IsOpen U) {f : E → F} + (hf : ContDiffOn ℝ ∞ f U) (m : ℕ) (v : Fin m → E) {x : E} (hx : x ∈ U) : + word (List.ofFn v) f x = iteratedFDeriv ℝ m f x v := by + induction m generalizing x with + | zero => rfl + | succ m ih => + rw [List.ofFn_succ] + change dir (v 0) (word (List.ofFn (fun i => v i.succ)) f) x = _ + have he : word (List.ofFn (fun i => v i.succ)) f =ᶠ[𝓝 x] + (fun y => iteratedFDeriv ℝ m f y (fun i => v i.succ)) := by + filter_upwards [hU.mem_nhds hx] with y hy using ih _ hy + rw [dir_congr he] + exact (DifferentiableAt.iteratedFDeriv_succ_apply_left' + (((hf.contDiffAt (hU.mem_nhds hx)).iteratedFDeriv_right + (m := ∞) (i := m) (by exact WithTop.coe_le_coe.mpr le_top)).differentiableAt (by simp))).symm + +lemma norm_word_ofFn_le {U : Set E} (hU : IsOpen U) {f : E → F} + (hf : ContDiffOn ℝ ∞ f U) (m : ℕ) (v : Fin m → E) {x : E} (hx : x ∈ U) : + ‖word (List.ofFn v) f x‖ ≤ ‖iteratedFDeriv ℝ m f x‖*∏ i, ‖v i‖ := by + rw [word_ofFn_eq hU hf m v hx] + exact (iteratedFDeriv ℝ m f x).le_opNorm v +end HigherJet + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/HigherJetCommutator.lean b/lean/OAI/Geometry/PrescribedPotential/HigherJetCommutator.lean new file mode 100644 index 0000000000000000000000000000000000000000..f3c59f54460972522676af0904eaea0c43bbf3e6 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/HigherJetCommutator.lean @@ -0,0 +1,87 @@ +import Mathlib + +namespace OAI + +/-! Higher Jet Commutator. -/ + +section + + + +noncomputable section +open Set Finset +open scoped ContDiff +namespace HigherJet +variable {E F G H : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] + [NormedAddCommGroup G] [NormedSpace ℝ G] + [NormedAddCommGroup H] [NormedSpace ℝ H] + +lemma bilinear_derivative_bound_on (B : F →L[ℝ] G →L[ℝ] H) + {U : Set E} (hU : IsOpen U) {f : E → F} {g : E → G} + (hf : ContDiffOn ℝ ∞ f U) (hg : ContDiffOn ℝ ∞ g U) + {x : E} (hx : x ∈ U) (m : ℕ) : + ‖iteratedFDeriv ℝ m (fun y => B (f y) (g y)) x‖ ≤ + ‖B‖*∑ i ∈ range (m+1), (m.choose i : ℝ)*‖iteratedFDeriv ℝ i f x‖* + ‖iteratedFDeriv ℝ (m-i) g x‖ := by + have hb := B.norm_iteratedFDerivWithin_le_of_bilinear hf hg hU.uniqueDiffOn hx + (show (m:ℕ∞ω) ≤ ∞ from WithTop.coe_le_coe.mpr le_top) + simpa only [iteratedFDerivWithin_of_isOpen _ hU hx] using hb + +lemma frozen_derivative_norm {f : E → F} {x : E} (hf : ContDiffAt ℝ ∞ f x) (m : ℕ) : + ‖iteratedFDeriv ℝ m (fun y => f y-f x) x‖ = + if m=0 then 0 else ‖iteratedFDeriv ℝ m f x‖ := by + by_cases hm : m=0 + · subst m + simp + · rw [ite_eq_right hm] + change ‖iteratedFDeriv ℝ m (f - fun _ => f x) x‖ = _ + rw [iteratedFDeriv_sub_apply (g := fun _ => f x) + (hf.of_le (show (m:ℕ∞ω) ≤ ∞ from WithTop.coe_le_coe.mpr le_top)) contDiffAt_const, + iteratedFDeriv_const_of_ne hm,Pi.zero_apply,sub_zero] + +lemma frozen_product_jet_bound (B : F →L[ℝ] G →L[ℝ] H) + {U : Set E} (hU : IsOpen U) {a : E → F} {v : E → G} + (ha : ContDiffOn ℝ ∞ a U) (hv : ContDiffOn ℝ ∞ v U) + {x : E} (hx : x ∈ U) (m : ℕ) : + ‖iteratedFDeriv ℝ m (fun y => B (a y-a x) (v y)) x‖ ≤ + ‖B‖*∑ i ∈ range (m+1), (m.choose i : ℝ)* + (if i=0 then 0 else ‖iteratedFDeriv ℝ i a x‖)* + ‖iteratedFDeriv ℝ (m-i) v x‖ := by + have hb := bilinear_derivative_bound_on B hU (f := fun y => a y-a x) (ha.sub contDiffOn_const) hv hx m + simpa only [frozen_derivative_norm (ha.contDiffAt (hU.mem_nhds hx))] using hb + + + +lemma frozen_product_tame_bound (B : F →L[ℝ] G →L[ℝ] H) + {U : Set E} (hU : IsOpen U) {a : E → F} {v : E → G} + (ha : ContDiffOn ℝ ∞ a U) (hv : ContDiffOn ℝ ∞ v U) + {x : E} (hx : x ∈ U) (m : ℕ) {C T : ℝ} (hC : 0 ≤ C) (hT : 0 ≤ T) + (hproducts : ∀ i, 0 < i → i ≤ m → + ‖iteratedFDeriv ℝ i a x‖*‖iteratedFDeriv ℝ (m-i) v x‖ ≤ C*T) : + ‖iteratedFDeriv ℝ m (fun y => B (a y-a x) (v y)) x‖ ≤ + ‖B‖*(2:ℝ)^m*C*T := by + apply (frozen_product_jet_bound B hU ha hv hx m).trans + have hb : (∑ i ∈ range (m+1), (m.choose i : ℝ)* + (if i=0 then 0 else ‖iteratedFDeriv ℝ i a x‖)* + ‖iteratedFDeriv ℝ (m-i) v x‖) ≤ + ∑ i ∈ range (m+1), (m.choose i : ℝ)*(C*T) := by + apply Finset.sum_le_sum + intro i hi + by_cases hi0 : i=0 + · simp only [hi0,ite_true,mul_zero,zero_mul] + positivity + · rw [ite_eq_right hi0,mul_assoc] + exact mul_le_mul_of_nonneg_left (hproducts i (Nat.pos_of_ne_zero hi0) + (Nat.le_of_lt_succ (mem_range.mp hi))) (Nat.cast_nonneg _) + have he : (∑ i ∈ range (m+1), (m.choose i : ℝ)*(C*T)) = 2^m*(C*T) := by + rw [← Finset.sum_mul] + congr 1 + exact_mod_cast Nat.sum_range_choose m + exact (mul_le_mul_of_nonneg_left (hb.trans_eq he) (norm_nonneg B)).trans_eq (by ring) +end HigherJet + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/HigherJetComposition.lean b/lean/OAI/Geometry/PrescribedPotential/HigherJetComposition.lean new file mode 100644 index 0000000000000000000000000000000000000000..96368b6f86ff8dc20cc4e755699edbc6ddeebd3a --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/HigherJetComposition.lean @@ -0,0 +1,100 @@ +import Mathlib + +namespace OAI + +/-! Higher Jet Composition. -/ + +section + + + +noncomputable section +open Finset +open scoped ContDiff +namespace HigherJet + +lemma prod_one_exception {ι : Type*} [Fintype ι] [DecidableEq ι] + (f : ι → ℝ) {B T : ℝ} (hB : 1 ≤ B) (hT : 1 ≤ T) + (hf : ∀ i, 0 ≤ f i) (hb : ∀ i, f i ≤ T ∨ f i ≤ B) + (hunique : ∀ i j, B < f i → B < f j → i = j) : + ∏ i, f i ≤ B^(Fintype.card ι)*T := by + by_cases he : ∃ i, B < f i + · obtain ⟨j,hj⟩ := he + have h_bound (i : ι) : f i ≤ B*(if i=j then T else 1) := by + by_cases hij : i=j + · subst i + simp only [ite_true] + obtain hi | hi := hb j + · exact hi.trans (le_mul_of_one_le_left (by linarith) hB) + · exact hi.trans (le_mul_of_one_le_right (by linarith) hT) + · rw [ite_eq_right hij,mul_one] + exact le_of_not_gt (fun hi => hij (hunique i j hi hj)) + exact (Finset.prod_le_prod₀ (fun index _ => hf index) (fun index _ => h_bound index)).trans_eq + (by rw [Finset.prod_mul_distrib]; simp) + · have hh (i) : f i ≤ B := le_of_not_gt (fun hi => he ⟨i,hi⟩) + exact (Finset.prod_le_prod₀ (fun index _ => hf index) (fun index _ => hh index)).trans + (by simpa using le_mul_of_one_le_right (pow_nonneg (by linarith : 0 ≤ B) _) hT) + +lemma OrderedFinpartition.large_part_unique {m r : ℕ} + (c : OrderedFinpartition m) (hr : m < 2*r) (i j : Fin c.length) + (hi : r ≤ c.partSize i) (hj : r ≤ c.partSize j) : i=j := by + by_contra hij + have hsum : ∑ k, c.partSize k = m := by + simpa using c.sum_sigma_eq_sum (fun _ => (1 : ℕ)) + have htwo : c.partSize i+c.partSize j ≤ ∑ k, c.partSize k := by + simpa [hij] using (Finset.sum_le_sum_of_subset_of_nonneg + (show ({i,j} : Finset (Fin c.length)) ⊆ univ from subset_univ _) + (fun _ _ _ => Nat.zero_le _) : ∑ k ∈ ({i,j} : Finset (Fin c.length)), c.partSize k ≤ + ∑ k, c.partSize k) + omega + +lemma OrderedFinpartition.prod_jet_bound {m r : ℕ} + (c : OrderedFinpartition m) (hr : m < 2*r) + (a : ℕ → ℝ) {B T : ℝ} (hB : 1 ≤ B) (hT : 1 ≤ T) + (ha : ∀ j, 0 ≤ a j) (hlow : ∀ j, 0 < j → j < r → a j ≤ B) + (hhigh : ∀ j, r ≤ j → j ≤ m → a j ≤ T) : + ∏ i, a (c.partSize i) ≤ B^m*T := by + have hb (i : Fin c.length) : a (c.partSize i) ≤ T ∨ a (c.partSize i) ≤ B := by + by_cases hi : c.partSize i < r + · exact Or.inr (hlow _ (c.partSize_pos i) hi) + · exact Or.inl (hhigh _ (le_of_not_gt hi) (c.partSize_le i)) + have hu (i j : Fin c.length) (hi : B < a (c.partSize i)) (hj : B < a (c.partSize j)) : i=j := by + have hi' : r ≤ c.partSize i := le_of_not_gt (fun hh => (not_lt_of_ge (hlow _ (c.partSize_pos i) hh)) hi) + have hj' : r ≤ c.partSize j := le_of_not_gt (fun hh => (not_lt_of_ge (hlow _ (c.partSize_pos j) hh)) hj) + exact OrderedFinpartition.large_part_unique c hr i j hi' hj' + exact (prod_one_exception (fun i => a (c.partSize i)) hB hT + (fun _ => ha _) hb hu).trans (mul_le_mul_of_nonneg_right + (pow_le_pow_right₀ hB (by simpa using c.length_le)) (by linarith)) + +variable {E F G : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] + [NormedAddCommGroup G] [NormedSpace ℝ G] + + + +lemma composition_top_jet_bound {f : E → F} {g : F → G} {x : E} + (hf : ContDiffAt ℝ ∞ f x) (hg : ContDiffAt ℝ ∞ g (f x)) + {m r : ℕ} (hr : m < 2*r) {B T C : ℝ} (hB : 1 ≤ B) (hT : 1 ≤ T) (hC : 0 ≤ C) + (hlow : ∀ j, 0 < j → j < r → ‖iteratedFDeriv ℝ j f x‖ ≤ B) + (hhigh : ∀ j, r ≤ j → j ≤ m → ‖iteratedFDeriv ℝ j f x‖ ≤ T) + (hgjet : ∀ j, j ≤ m → ‖iteratedFDeriv ℝ j g (f x)‖ ≤ C) : + ‖iteratedFDeriv ℝ m (g ∘ f) x‖ ≤ + (Fintype.card (OrderedFinpartition m) : ℝ)*C*B^m*T := by + rw [iteratedFDeriv_comp (i := m) hg hf (by exact WithTop.coe_le_coe.mpr le_top),FormalMultilinearSeries.taylorComp] + calc + _ ≤ ∑ c : OrderedFinpartition m, ‖c.compAlongOrderedFinpartition + (iteratedFDeriv ℝ c.length g (f x)) (fun i => iteratedFDeriv ℝ (c.partSize i) f x)‖ := norm_sum_le _ _ + _ ≤ ∑ _c : OrderedFinpartition m, C*(B^m*T) := by + apply Finset.sum_le_sum + intro c _ + exact c.norm_compAlongOrderedFinpartition_le _ _ |>.trans + (mul_le_mul (hgjet _ c.length_le) + (OrderedFinpartition.prod_jet_bound c hr _ hB hT (fun _ => norm_nonneg _) hlow hhigh) + (Finset.prod_nonneg (fun _ _ => norm_nonneg _)) hC) + _ = _ := by simp [mul_assoc] +end HigherJet + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/HigherMetricOperator.lean b/lean/OAI/Geometry/PrescribedPotential/HigherMetricOperator.lean new file mode 100644 index 0000000000000000000000000000000000000000..2dd2081143b7c6fe14882a27474c1c97cd88fe34 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/HigherMetricOperator.lean @@ -0,0 +1,97 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CompletedResolvent +import OAI.Geometry.PrescribedPotential.CutoffHigher +import OAI.Geometry.PrescribedPotential.GlobalParametrix + +namespace OAI + +/-! Higher Metric Operator. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory TemperedDistribution LineDeriv +open scoped SchwartzMap ContDiff Classical BoundedContinuousFunction +namespace MetricLocalization +open EllipticKernel SobolevChart +variable {n : ℕ} + +lemma differential_cutoff_bound_integer + (c : BasisIndex n → BasisIndex n → EC n →ᵇ ℂ) + (hc : ∀ i j, (c i j : EC n → ℂ).HasTemperateGrowth) (κ : 𝓢(EC n, ℂ)) (k : ℕ) : + CoreBound ((k : ℝ)+2) (k : ℝ) (fun f => + schwartzDifferential c (SchwartzMap.smulLeftCLM ℂ κ f)) := by + have hd (i j : BasisIndex n) : CoreBound ((k : ℝ)+2) (k : ℝ) (fun f => + SchwartzMap.smulLeftCLM ℂ (c i j) (∂_{stdOrthonormalBasis ℝ (EC n) i} + (∂_{stdOrthonormalBasis ℝ (EC n) j} (SchwartzMap.smulLeftCLM ℂ κ f)))) := by + simp_rw [schwartz_second_product, map_add, schwartz_product_assoc (hc i j)] + apply CoreBound.add + · exact (coreBound_product_integer _ k).comp + ((coreBound_deriv _ (s := (k : ℝ)+1) (t := (k : ℝ)) (by linarith)).comp + (coreBound_deriv _ (s := (k : ℝ)+2) (t := (k : ℝ)+1) (by linarith))) + · apply CoreBound.add + · apply CoreBound.add + · exact (coreBound_product_integer _ k).comp + (coreBound_deriv _ (s := (k : ℝ)+2) (t := (k : ℝ)) (by linarith)) + · exact (coreBound_product_integer _ k).comp + (coreBound_deriv _ (s := (k : ℝ)+2) (t := (k : ℝ)) (by linarith)) + · exact (coreBound_product_integer _ k).comp (CoreBound.id (by linarith)) + change CoreBound ((k : ℝ)+2) (k : ℝ) (fun f => schwartzDifferential c (SchwartzMap.smulLeftCLM ℂ κ f)) + simp only [schwartzDifferential, sum_apply, + ContinuousLinearMap.comp_apply, lineDerivOpCLM_apply] + exact CoreBound.sum Finset.univ _ (fun i _ => CoreBound.sum Finset.univ _ (fun j _ => hd i j)) +end MetricLocalization + +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart MetricLocalization +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +lemma complexL_piece_bound_integer (k : ℕ) (p : ι) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ f : Smooth A, + ‖D.localizers.embed (k : ℝ) (globalize (D.patch p).index (D.outerCutoff p) + ((D.patch p).differential (SchwartzMap.smulLeftCLM ℂ (D.cutoff p).val (D.forcing p f))))‖ ≤ + C*‖D.localizers.embed ((k : ℝ)+2) f‖ := by + obtain ⟨B,hB,hb⟩ := globalize_integer_bound D.localizers (D.patch p).index (D.outerCutoff p) k + obtain ⟨C,hC,hc⟩ := differential_cutoff_bound_integer (D.patch p).coefficients + (D.patch p).coefficients_temperate (D.cutoff p).val k + refine ⟨B*C,mul_nonneg hB hC,fun f => ?_⟩ + apply (hb ((D.patch p).differential (SchwartzMap.smulLeftCLM ℂ (D.cutoff p).val (D.forcing p f)))).trans + have hr := (hc (D.forcing p f)).trans + (mul_le_mul_of_nonneg_left (D.forcing_bound p ((k : ℝ)+2) f) hC) + simpa only [mul_assoc, ParametrixPatch.differential] using mul_le_mul_of_nonneg_left hr hB + +lemma complexL_bound_integer (k : ℕ) : + D.localizers.BoundedCore ((k : ℝ)+2) (k : ℝ) (complexL g) := by + choose C hC hc using D.complexL_piece_bound_integer k + refine ⟨∑ p,C p,Finset.sum_nonneg (fun p _ => hC p),fun f => ?_⟩ + rw [D.complexL_reconstruction, map_sum, Finset.sum_mul] + exact (norm_sum_le _ _).trans (Finset.sum_le_sum (fun p _ => hc p f)) + +def completedLOrder (k : ℕ) : D.localizers.Sobolev ((k : ℝ)+2) →L[ℝ] D.localizers.Sobolev (k : ℝ) := + D.localizers.extendCore ((k : ℝ)+2) (k : ℝ) (complexL g) + +lemma completedLOrder_embed (k : ℕ) (f : Smooth A) : + D.completedLOrder k (D.localizers.embed ((k : ℝ)+2) f) = D.localizers.embed (k : ℝ) (complexL g f) := + D.localizers.extendCore_embed (D.complexL_bound_integer k) f + +lemma completedLOrder_lower (k : ℕ) (u : D.localizers.Sobolev ((k : ℝ)+2)) : + D.localizers.lower (k : ℝ) 0 (D.completedLOrder k u) = + D.completedL (D.localizers.lower ((k : ℝ)+2) 2 u) := by + have hk : (0 : ℝ) ≤ k := Nat.cast_nonneg k + change D.localizers.lower (k : ℝ) 0 (D.localizers.extendCore _ _ _ u) = _ + rw [D.localizers.lower_extendCore hk _ (D.complexL_bound_integer k) + ((D.complexL_bound_integer k).target_mono hk)] + exact (D.localizers.extendCore_lower (by linarith) (complexL g) D.complexL_bound + ((D.complexL_bound_integer k).target_mono hk) u).symm +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/HigherPoisson.lean b/lean/OAI/Geometry/PrescribedPotential/HigherPoisson.lean new file mode 100644 index 0000000000000000000000000000000000000000..68a85d4351f2378f3bee7c7a6337aed1b912a96d --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/HigherPoisson.lean @@ -0,0 +1,131 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.BoundedPoisson +import OAI.Geometry.PrescribedPotential.HigherResolvent +import OAI.Geometry.PrescribedPotential.PatchCutoffs + +namespace OAI + +/-! Higher Poisson. -/ + +section + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical +namespace LinearNormalization +variable {U V W : Type*} + [NormedAddCommGroup U] [NormedSpace ℝ U] + [NormedAddCommGroup V] [NormedSpace ℝ V] + [NormedAddCommGroup W] [NormedSpace ℝ W] +lemma feedback_lift (q : V →L[ℝ] U) (p : W →L[ℝ] V) (r : W →L[ℝ] U) + (T : U →L[ℝ] U) (S : V →L[ℝ] V) (C : U →L[ℝ] U) (K : W →L[ℝ] W) + (R : U →L[ℝ] U) (R' : V →L[ℝ] W) (a : ℝ) + (hp : ∀ x, q (p x) = r x) (hS : ∀ x, q (S x) = T (q x)) + (hK : ∀ x, r (K x) = C (r x)) (hR : ∀ x, r (R' x) = R (q x)) + (hT : ∀ x, T x = -x - C x + a • R (T x)) (x : W) : + r (-x - K x + a • R' (S (p x))) = T (r x) := by + rw [map_add, map_sub, map_neg, map_smul, hK, hR, hS, hp] + exact (hT _).symm +end LinearNormalization + +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +omit [ConnectedSpace X] in +lemma resolventGain_order (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) (k : ℕ) : + ∃ R : D.localizers.Sobolev (k : ℝ) →L[ℝ] D.localizers.Sobolev ((k : ℝ)+1), + ∀ f, D.localizers.lower ((k : ℝ)+1) 0 (R f) = + D.resolventZero m hm he (D.localizers.lower (k : ℝ) 0 f) := by + obtain ⟨R,hR⟩ := D.completedResolvent_order m hm he k + refine ⟨D.localizers.lower ((k : ℝ)+2) ((k : ℝ)+1) ∘L R, fun f => ?_⟩ + simp only [ContinuousLinearMap.comp_apply] + rw [D.localizers.lower_lower (by linarith : (k : ℝ)+1 ≤ (k : ℝ)+2) (by positivity : (0:ℝ) ≤ (k : ℝ)+1)] + rw [← D.localizers.lower_lower (by linarith [Nat.cast_nonneg (α := ℝ) k] : (2:ℝ) ≤ (k : ℝ)+2) + (by norm_num : (0:ℝ) ≤ 2), hR] + rfl + +def poissonCorrectionOrder (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) (s : ℝ) : + D.localizers.Sobolev s →L[ℝ] D.localizers.Sobolev s := + D.localizers.constantsOrder s ∘L D.poissonResidue m hm he P ∘L D.localizers.lower s 0 + +lemma poissonCorrectionOrder_lower (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) {s : ℝ} (hs : 0 ≤ s) (f : D.localizers.Sobolev s) : + D.localizers.lower s 0 (D.poissonCorrectionOrder m hm he P s f) = + P.proj (D.poissonInput m hm he P (D.localizers.lower s 0 f)) := by + change D.localizers.lower s 0 (D.localizers.embed s (Smooth.const + (P.coefficient (D.poissonInput m hm he P (D.localizers.lower s 0 f))))) = _ + rw [D.localizers.lower_embed hs] + exact P.coefficient_spec _ + +lemma poissonInput_step (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) (k : ℕ) + (W : D.localizers.Sobolev (k : ℝ) →L[ℝ] D.localizers.Sobolev (k : ℝ)) + (hW : ∀ f, D.localizers.lower (k : ℝ) 0 (W f) = + D.poissonInput m hm he P (D.localizers.lower (k : ℝ) 0 f)) : + ∃ V : D.localizers.Sobolev ((k : ℝ)+1) →L[ℝ] D.localizers.Sobolev ((k : ℝ)+1), + ∀ f, D.localizers.lower ((k : ℝ)+1) 0 (V f) = + D.poissonInput m hm he P (D.localizers.lower ((k : ℝ)+1) 0 f) := by + obtain ⟨R,hR⟩ := D.resolventGain_order m hm he k + let W' : D.localizers.Sobolev ((k : ℝ)+1) →L[ℝ] D.localizers.Sobolev ((k : ℝ)+1) := + -ContinuousLinearMap.id ℝ _ - + D.poissonCorrectionOrder m hm he P ((k : ℝ)+1) + + (m^2 : ℝ) • (R ∘L W ∘L D.localizers.lower ((k : ℝ)+1) (k : ℝ)) + refine ⟨W', fun f => ?_⟩ + change D.localizers.lower ((k : ℝ)+1) 0 + (-f - D.poissonCorrectionOrder m hm he P ((k : ℝ)+1) f + + (m^2 : ℝ) • R (W (D.localizers.lower ((k : ℝ)+1) (k : ℝ) f))) = _ + apply LinearNormalization.feedback_lift + (D.localizers.lower (k : ℝ) 0) (D.localizers.lower ((k : ℝ)+1) (k : ℝ)) + (D.localizers.lower ((k : ℝ)+1) 0) (D.poissonInput m hm he P) W + (P.proj ∘L D.poissonInput m hm he P) + (D.poissonCorrectionOrder m hm he P ((k : ℝ)+1)) + (D.resolventZero m hm he) R (m^2) + · exact fun f => D.localizers.lower_lower (by linarith : (k : ℝ) ≤ (k : ℝ)+1) + (Nat.cast_nonneg k) f + · exact hW + · exact D.poissonCorrectionOrder_lower m hm he P (by positivity : (0:ℝ) ≤ (k : ℝ)+1) + · exact hR + · exact D.poissonInput_equation m hm he P + + + +theorem poissonInput_order (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) (k : ℕ) : + ∃ W : D.localizers.Sobolev (k : ℝ) →L[ℝ] D.localizers.Sobolev (k : ℝ), + ∀ f, D.localizers.lower (k : ℝ) 0 (W f) = + D.poissonInput m hm he P (D.localizers.lower (k : ℝ) 0 f) := by + induction k with + | zero => + rw [Nat.cast_zero] + refine ⟨D.poissonInput m hm he P, fun f => ?_⟩ + simp only [D.localizers.lower_self, ContinuousLinearMap.id_apply] + | succ k ih => + rw [Nat.cast_succ] + obtain ⟨W,hW⟩ := ih + exact D.poissonInput_step m hm he P k W hW + +theorem poissonRaw_order (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) (k : ℕ) : + ∃ R : D.localizers.Sobolev (k : ℝ) →L[ℝ] D.localizers.Sobolev ((k : ℝ)+2), + ∀ f, D.localizers.lower ((k : ℝ)+2) 2 (R f) = + D.poissonRaw m hm he P (D.localizers.lower (k : ℝ) 0 f) := by + obtain ⟨W,hW⟩ := D.poissonInput_order m hm he P k + obtain ⟨R,hR⟩ := D.completedResolvent_order m hm he k + refine ⟨R ∘L W, fun f => ?_⟩ + simp only [ContinuousLinearMap.comp_apply] + rw [hR, hW] + rfl + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/HigherResolvent.lean b/lean/OAI/Geometry/PrescribedPotential/HigherResolvent.lean new file mode 100644 index 0000000000000000000000000000000000000000..717e39fd133cacae2616a1a5b87109ff32a9c2a8 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/HigherResolvent.lean @@ -0,0 +1,77 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CompletedResolvent +import OAI.Geometry.PrescribedPotential.PatchCutoffs + +namespace OAI + +/-! Higher Resolvent. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace Localizers +variable (D : Localizers A ι) + +lemma lower_lower {s t r : ℝ} (hst : t ≤ s) (htr : r ≤ t) (u : D.Sobolev s) : + D.lower t r (D.lower s t u) = D.lower s r u := + congrArg (fun L : D.Sobolev s →L[ℝ] D.Sobolev r => L u) (D.lower_comp hst htr) + +end Localizers +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + + + +theorem errorInverse_order (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (k : ℕ) : ∃ R : D.localizers.Sobolev (k : ℝ) →L[ℝ] D.localizers.Sobolev (k : ℝ), + ∀ f, D.localizers.lower (k : ℝ) 0 (R f) = + D.errorInverse m hm he (D.localizers.lower (k : ℝ) 0 f) := by + induction k with + | zero => + rw [Nat.cast_zero] + refine ⟨D.errorInverse m hm he, fun f => ?_⟩ + simp only [D.localizers.lower_self, ContinuousLinearMap.id_apply] + | succ k ih => + rw [Nat.cast_succ] + obtain ⟨R, hR⟩ := ih + let U := D.localizers.extendCore (k : ℝ) ((k : ℝ)+1) (D.error m hm) + let R' : D.localizers.Sobolev ((k : ℝ)+1) →L[ℝ] D.localizers.Sobolev ((k : ℝ)+1) := + ContinuousLinearMap.id ℝ _ + U ∘L R ∘L D.localizers.lower ((k : ℝ)+1) (k : ℝ) + refine ⟨R', fun f => ?_⟩ + change D.localizers.lower ((k : ℝ)+1) 0 + (f + U (R (D.localizers.lower ((k : ℝ)+1) (k : ℝ) f))) = _ + rw [map_add, D.localizers.extendCore_compat (Nat.cast_nonneg k) (by positivity : (0:ℝ) ≤ (k : ℝ)+1) + (D.error m hm) (D.error_bound_integer m hm k) (D.error_bound_zero m hm), hR, + D.localizers.lower_lower (by linarith : (k : ℝ) ≤ (k : ℝ)+1) (Nat.cast_nonneg k)] + have h := D.errorInverse_equation m hm he (D.localizers.lower ((k : ℝ)+1) 0 f) + change _ = D.errorInverse m hm he (D.localizers.lower ((k : ℝ)+1) 0 f) + exact (sub_eq_iff_eq_add.mp h).symm + + +theorem completedResolvent_order (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (k : ℕ) : ∃ R : D.localizers.Sobolev (k : ℝ) →L[ℝ] D.localizers.Sobolev ((k : ℝ)+2), + ∀ f, D.localizers.lower ((k : ℝ)+2) 2 (R f) = + D.completedResolvent m hm he (D.localizers.lower (k : ℝ) 0 f) := by + obtain ⟨R, hR⟩ := D.errorInverse_order m hm he k + refine ⟨D.localizers.extendCore (k : ℝ) ((k : ℝ)+2) (D.parametrix m hm) ∘L R, fun f => ?_⟩ + simp only [ContinuousLinearMap.comp_apply] + rw [D.localizers.extendCore_compat (Nat.cast_nonneg k) + (by linarith [Nat.cast_nonneg (α := ℝ) k] : (2:ℝ) ≤ (k : ℝ)+2) + (D.parametrix m hm) (D.parametrix_bound m hm k) (D.completedParametrix_bound m hm), hR] + rfl + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/HolomorphicDirection.lean b/lean/OAI/Geometry/PrescribedPotential/HolomorphicDirection.lean new file mode 100644 index 0000000000000000000000000000000000000000..1f89c7f8e3a3866b9f8755c5aa7c33c90b660688 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/HolomorphicDirection.lean @@ -0,0 +1,67 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.KaehlerClosedDerivatives +import OAI.Geometry.PrescribedPotential.MatrixWirtinger + +namespace OAI + +/-! Holomorphic Direction. -/ + +section + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +variable {n : ℕ} + +lemma wderiv_direction_sum {α : Type*} (s : Finset α) (a : ℂ) (v : α → V n) + (f : V n → ℂ) (z : V n) : + wderiv a (∑ i ∈ s, v i) f z = ∑ i ∈ s, wderiv a (v i) f z := by + simp only [wderiv,Finset.smul_sum,map_sum,Finset.mul_sum] + rw [← Finset.sum_div,Finset.sum_add_distrib] + +lemma dz_direction_smul (c : ℂ) (v : V n) (f : V n → ℂ) (z : V n) : + dz (c • v) f z = c*dz v f z := by + have he : c • v = c.re • v + c.im • (Complex.I • v) := by + ext j + change c*v j = (c.re:ℂ)*v j+(c.im:ℂ)*(Complex.I*v j) + conv_lhs => rw [← Complex.re_add_im c] + ring + have hi : Complex.I • (c • v) = -c.im • v + c.re • (Complex.I • v) := by + ext j + change Complex.I*(c*v j) = ((-c.im:ℝ):ℂ)*v j+(c.re:ℂ)*(Complex.I*v j) + conv_lhs => rw [← Complex.re_add_im c] + simp only [Complex.ofReal_neg] + ring_nf + simp only [Complex.I_sq] + ring + unfold dz wderiv + rw [hi,he] + simp only [map_add,map_smul,Complex.real_smul,Complex.ofReal_neg] + conv_rhs => arg 1; rw [← Complex.re_add_im c] + ring_nf + simp only [Complex.I_sq] + ring + +lemma dz_direction_coordinates (v : V n) (f : V n → ℂ) (z : V n) : + dz v f z = ∑ i, v i*dz (e i) f z := by + have he : v = ∑ i, v i • e i := by ext j; simp [e,Pi.single_apply] + calc + _ = dz (∑ i, v i • e i) f z := congrArg (fun u => dz u f z) he + _ = _ := by + unfold dz + rw [wderiv_direction_sum] + apply Finset.sum_congr rfl + intro i _ + exact dz_direction_smul (v i) (e i) f z + +lemma mderiv_hol_coordinates (v : V n) (M : V n → Matrix (Fin n) (Fin n) ℂ) (z : V n) : + mderiv (-Complex.I) v M z = ∑ i, v i • mderiv (-Complex.I) (e i) M z := by + ext a b + simpa only [Matrix.sum_apply,Matrix.smul_apply,smul_eq_mul,mderiv,dz] using dz_direction_coordinates v (fun y => M y a b) z +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/IntegerBounds.lean b/lean/OAI/Geometry/PrescribedPotential/IntegerBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..2f0a633958acd11c8f46ef067b7775aaaced6e6c --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/IntegerBounds.lean @@ -0,0 +1,146 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.ChartTransportHigher +import OAI.Geometry.PrescribedPotential.ParameterCoreBounds + +namespace OAI + +/-! Integer Bounds. -/ + +section + + + +noncomputable section +open Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory TemperedDistribution LineDeriv +open scoped SchwartzMap ContDiff Classical Laplacian + +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +def raiseZero (s : ℝ) : L2 E →L[ℂ] L2 E := + liftOperator s (s + 1) (besselPotential E ℂ (-2)) (fun u hu => by + rw [memSobolev_besselPotential_iff] + exact hu.mono (by linarith)) + +def raiseDeriv (s : ℝ) (v : E) : L2 E →L[ℂ] L2 E := + liftOperator s (s + 1) ((besselPotential E ℂ (-2)).comp (lineDerivOpCLM ℂ 𝓢'(E, ℂ) v)) + (fun u hu => by + change MemSobolev (s + 1) 2 (besselPotential E ℂ (-2) (∂_{v} u)) + rw [memSobolev_besselPotential_iff] + exact hu.lineDerivOp.mono (by linarith)) + +lemma realize_raiseZero (s : ℝ) (u : L2 E) : + realize (s + 1) (raiseZero s u) = besselPotential E ℂ (-2) (realize s u) := + realize_liftOperator _ _ _ _ _ + +lemma realize_raiseDeriv (s : ℝ) (v : E) (u : L2 E) : + realize (s + 1) (raiseDeriv s v u) = besselPotential E ℂ (-2) (∂_{v} (realize s u)) := + realize_liftOperator _ _ _ _ _ + +lemma schwartzCoord_raise_one (s : ℝ) (f : 𝓢(E, ℂ)) : + schwartzCoord (s + 1) f = raiseZero s (schwartzCoord s f) - + (((2 * Real.pi)^2 : ℝ) : ℂ)⁻¹ • ∑ j, + raiseDeriv s (stdOrthonormalBasis ℝ E j) + (schwartzCoord s (∂_{stdOrthonormalBasis ℝ E j} f)) := by + apply realize_injective (s + 1) + simp only [map_sub, map_smul, map_sum, realize_raiseZero, realize_raiseDeriv, + realize_schwartzCoord] + have he := congrArg (besselPotential E ℂ (-2)) (bessel_two_laplacian (f : 𝓢'(E, ℂ))) + rw [besselPotential_besselPotential_apply] at he + norm_num only [neg_add_cancel, besselPotential_zero, ContinuousLinearMap.id_apply] at he + rw [map_sub, map_smul, TemperedDistribution.laplacian_eq_sum (stdOrthonormalBasis ℝ E), map_sum] at he + rw [he] + congr 2 + apply Finset.sum_congr rfl + intro j _ + rw [← lineDerivOp_toTemperedDistributionCLM_eq] + +lemma coreBound_raise_one {s t : ℝ} (T : 𝓢(E, ℂ) → 𝓢(E, ℂ)) + (hT : CoreBound s t T) + (hD : ∀ j, CoreBound s t (fun f => ∂_{stdOrthonormalBasis ℝ E j} (T f))) : + CoreBound s (t + 1) T := by + obtain ⟨C, hC, hc⟩ := hT + choose D hD0 hdb using hD + let c : ℝ := ‖(((2 * Real.pi)^2 : ℝ) : ℂ)⁻¹‖ + refine ⟨‖raiseZero (E := E) t‖ * C + c * ∑ j, ‖raiseDeriv t (stdOrthonormalBasis ℝ E j)‖ * D j, + add_nonneg (mul_nonneg (norm_nonneg _) hC) + (mul_nonneg (norm_nonneg _) (Finset.sum_nonneg (fun j _ => mul_nonneg (norm_nonneg _) (hD0 j)))), fun f => ?_⟩ + rw [schwartzCoord_raise_one] + calc + _ ≤ ‖raiseZero t (schwartzCoord t (T f))‖ + + c * ‖∑ j, raiseDeriv t (stdOrthonormalBasis ℝ E j) + (schwartzCoord t (∂_{stdOrthonormalBasis ℝ E j} (T f)))‖ := by + simpa only [norm_smul] using norm_sub_le + (raiseZero t (schwartzCoord t (T f))) + ((((2 * Real.pi)^2 : ℝ) : ℂ)⁻¹ • ∑ j, raiseDeriv t (stdOrthonormalBasis ℝ E j) + (schwartzCoord t (∂_{stdOrthonormalBasis ℝ E j} (T f)))) + _ ≤ (‖raiseZero (E := E) t‖ * C) * ‖schwartzCoord s f‖ + + c * ∑ j, (‖raiseDeriv t (stdOrthonormalBasis ℝ E j)‖ * D j) * ‖schwartzCoord s f‖ := by + apply add_le_add + · exact ((raiseZero t).le_opNorm _).trans (by + simpa only [mul_assoc] using + (mul_le_mul_of_nonneg_left (hc f) (norm_nonneg (raiseZero (E := E) t)))) + · apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) + apply (norm_sum_le _ _).trans + apply Finset.sum_le_sum + intro j _ + exact ((raiseDeriv t (stdOrthonormalBasis ℝ E j)).le_opNorm _).trans (by + simpa only [mul_assoc] using mul_le_mul_of_nonneg_left (hdb j f) + (norm_nonneg (raiseDeriv t (stdOrthonormalBasis ℝ E j)))) + _ = _ := by rw [← Finset.sum_mul]; ring + +lemma coreBound_of_words_integer (k : ℕ) {s t : ℝ} (T : 𝓢(E, ℂ) → 𝓢(E, ℂ)) + (h : ∀ ws : List E, ws.length ≤ k → CoreBound s t (fun f => schwartzWord ws (T f))) : + CoreBound s (t + k) T := by + induction k generalizing T with + | zero => simpa [schwartzWord] using h [] (by simp) + | succ k ih => + have ht := ih T (fun ws hw => h ws (by omega)) + have hd (j : Fin (Module.finrank ℝ E)) := ih + (fun f => ∂_{stdOrthonormalBasis ℝ E j} (T f)) + (fun ws hw => by + have hh := h (ws ++ [stdOrthonormalBasis ℝ E j]) + (by simp only [List.length_append, List.length_cons, List.length_nil]; omega) + simpa only [schwartzWord_append, schwartzWord, ContinuousLinearMap.comp_apply, + ContinuousLinearMap.id_apply, lineDerivOpCLM_apply] using hh) + convert coreBound_raise_one T ht hd using 1; push_cast; ring + +end SobolevChart + +namespace GlobalElliptic +open SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + + + +theorem chartTransport_integer_bound (e : OpenPartialHomeomorph E E) + (he : ContDiffOn ℝ ∞ e e.source) (hs : ContDiffOn ℝ ∞ e.symm e.target) + (κ : ChartCutoff e.source) (k : ℕ) : + CoreBound (k : ℝ) (k : ℝ) (chartTransport e he κ) := by + have hh := coreBound_of_words_integer k (s := (k : ℝ)) (t := 0) (chartTransport e he κ) + (fun ws hw => chartTransport_word_bound e he hs ws κ (by exact_mod_cast hw)) + simpa only [zero_add] using hh +end GlobalElliptic + +namespace FrozenPoisson.ParameterRegularity +open SobolevChart EllipticKernel +open scoped ComplexOrder MatrixOrder +variable {n : ℕ} {ι : Type*} [Fintype ι] + +theorem schwartzLocal_integer_bound (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (t : ℝ) (ht : 1 ≤ t) (v : ι → EC n) (a : SmoothCoefficients ι (EC n)) + (hsmall : perturbationBound v (coefficientBCF a) * ellipticBound H hH < 1) (k : ℕ) : + CoreBound (k : ℝ) ((k : ℝ) + 2) (schwartzLocal H hH t ht v a hsmall) := by + rw [add_comm] + apply coreBound_of_words_integer k + intro ws hw + apply schwartzLocal_word_bound H hH t ht v a hsmall ws + exact_mod_cast hw +end FrozenPoisson.ParameterRegularity + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/InverseTraceCalculus.lean b/lean/OAI/Geometry/PrescribedPotential/InverseTraceCalculus.lean new file mode 100644 index 0000000000000000000000000000000000000000..3d0d899df24ea99ccaec13c48ad1c70395558063 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/InverseTraceCalculus.lean @@ -0,0 +1,83 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.MatrixWirtinger + +namespace OAI + +/-! Inverse Trace Calculus. -/ + +section + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +variable {n : ℕ} + +lemma second_mderiv_inverse_at_one {U : Set (V n)} (hU : IsOpen U) + {M : V n → Matrix (Fin n) (Fin n) ℂ} (hM : ContDiffOn ℝ ∞ M U) + (hn : ∀ y ∈ U, (M y).det ≠ 0) {z : V n} (hz : z ∈ U) (hMz : M z = 1) + (a b : ℂ) (u v : V n) : + mderiv b u (mderiv a v (fun y => (M y)⁻¹)) z = + mderiv b u M z*mderiv a v M z + mderiv a v M z*mderiv b u M z - + mderiv b u (mderiv a v M) z := by + have hs := hM.contDiffAt (hU.mem_nhds hz) + have hi := (MatrixSmoothGeneral.inverse hM hn).contDiffAt (hU.mem_nhds hz) + have hd := mderiv_smooth hs a v + have he : mderiv a v (fun y => (M y)⁻¹) =ᶠ[𝓝 z] + (fun y => -(M y)⁻¹*mderiv a v M y*(M y)⁻¹) := by + filter_upwards [hU.mem_nhds hz] with y hy + exact mderiv_inverse hU hM hn hy a v + rw [mderiv_congr he,mderiv_mul (matrix_smooth_mul hi.neg hd) hi, + mderiv_mul hi.neg hd,mderiv_neg hi,mderiv_inverse hU hM hn hz,hMz] + simp only [inv_one,neg_mul,one_mul,mul_one,neg_neg] + noncomm_ring + +lemma second_mderiv_mul {M N : V n → Matrix (Fin n) (Fin n) ℂ} {z : V n} + (hM : ContDiffAt ℝ ∞ M z) (hN : ContDiffAt ℝ ∞ N z) + (a b : ℂ) (u v : V n) : + mderiv b u (mderiv a v (fun y => M y*N y)) z = + mderiv b u (mderiv a v M) z*N z + mderiv a v M z*mderiv b u N z + + mderiv b u M z*mderiv a v N z + M z*mderiv b u (mderiv a v N) z := by + have he : mderiv a v (fun y => M y*N y) =ᶠ[𝓝 z] + (fun y => mderiv a v M y*N y+M y*mderiv a v N y) := by + filter_upwards [(hM.of_le (show (1 : WithTop ℕ∞) ≤ ∞ by simp)).eventually (by decide), + (hN.of_le (show (1 : WithTop ℕ∞) ≤ ∞ by simp)).eventually (by decide)] with y hyM hyN + exact mderiv_mul_differentiable (hyM.differentiableAt (by simp)) + (hyN.differentiableAt (by simp)) a v + rw [mderiv_congr he,mderiv_add (matrix_smooth_mul (mderiv_smooth hM a v) hN) + (matrix_smooth_mul hM (mderiv_smooth hN a v)), + mderiv_mul (mderiv_smooth hM a v) hN,mderiv_mul hM (mderiv_smooth hN a v)] + abel + +lemma second_wderiv_trace {M : V n → Matrix (Fin n) (Fin n) ℂ} {z : V n} + (hM : ContDiffAt ℝ ∞ M z) (a b : ℂ) (u v : V n) : + wderiv b u (wderiv a v (fun y => (M y).trace)) z = + (mderiv b u (mderiv a v M) z).trace := by + have he : wderiv a v (fun y => (M y).trace) =ᶠ[𝓝 z] + (fun y => (mderiv a v M y).trace) := by + filter_upwards [(hM.of_le (show (1 : WithTop ℕ∞) ≤ ∞ by simp)).eventually (by decide)] with y hy + exact mderiv_trace_differentiable (hy.differentiableAt (by simp)) a v + rw [wderiv_congr he,mderiv_trace (mderiv_smooth hM a v)] + +lemma second_wderiv_inverse_trace_at_one {U : Set (V n)} (hU : IsOpen U) + {M G : V n → Matrix (Fin n) (Fin n) ℂ} (hM : ContDiffOn ℝ ∞ M U) + (hn : ∀ y ∈ U, (M y).det ≠ 0) {z : V n} (hz : z ∈ U) (hMz : M z = 1) + (hG : ContDiffAt ℝ ∞ G z) (a b : ℂ) (u v : V n) : + wderiv b u (wderiv a v (fun y => ((M y)⁻¹*G y).trace)) z = + ((mderiv b u M z*mderiv a v M z + mderiv a v M z*mderiv b u M z - + mderiv b u (mderiv a v M) z)*G z - + mderiv a v M z*mderiv b u G z - mderiv b u M z*mderiv a v G z + + mderiv b u (mderiv a v G) z).trace := by + have hi := (MatrixSmoothGeneral.inverse hM hn).contDiffAt (hU.mem_nhds hz) + rw [second_wderiv_trace (matrix_smooth_mul hi hG),second_mderiv_mul hi hG, + second_mderiv_inverse_at_one hU hM hn hz hMz, + mderiv_inverse hU hM hn hz,mderiv_inverse hU hM hn hz,hMz] + congr 1 + simp only [inv_one,neg_mul,one_mul,mul_one] + noncomm_ring +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/InverseTraceFunction.lean b/lean/OAI/Geometry/PrescribedPotential/InverseTraceFunction.lean new file mode 100644 index 0000000000000000000000000000000000000000..91cf49c685ee6331fee5e545a8182fe49400d49a --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/InverseTraceFunction.lean @@ -0,0 +1,102 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.ChernLuIdentity +import OAI.Geometry.PrescribedPotential.TracePositivity + +namespace OAI + +/-! Inverse Trace Function. -/ + +section + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +variable {n : ℕ} + +def inverseTrace (M G : V n → Matrix (Fin n) (Fin n) ℂ) (z : V n) : ℝ := + ((M z)⁻¹*G z).trace.re + +lemma matrix_trace_smooth {M : V n → Matrix (Fin n) (Fin n) ℂ} {z : V n} + (hM : ContDiffAt ℝ ∞ M z) : ContDiffAt ℝ ∞ (fun y => (M y).trace) z := + ContDiffAt.sum (fun k _ => entry_smooth hM k k) + +lemma inverseTrace_smooth {U : Set (V n)} (hU : IsOpen U) + {M G : V n → Matrix (Fin n) (Fin n) ℂ} (hM : ContDiffOn ℝ ∞ M U) + (hp : ∀ y ∈ U, (M y).PosDef) (hG : ContDiffOn ℝ ∞ G U) : + ContDiffOn ℝ ∞ (inverseTrace M G) U := by + intro z hz + apply ContDiffAt.contDiffWithinAt + apply Complex.reCLM.contDiff.contDiffAt.comp z + exact matrix_trace_smooth (matrix_smooth_mul + ((MatrixSmoothGeneral.inverse hM (fun y hy => ne_of_gt (hp y hy).det_pos)).contDiffAt (hU.mem_nhds hz)) + (hG.contDiffAt (hU.mem_nhds hz))) + +lemma inverseTrace_real {M G : V n → Matrix (Fin n) (Fin n) ℂ} {z : V n} + (hM : (M z).PosDef) (hG : (G z).IsHermitian) : + (inverseTrace M G z : ℂ) = ((M z)⁻¹*G z).trace := + trace_mul_real hM.inv.isHermitian hG + +lemma inverseTrace_pos [Nonempty (Fin n)] {M G : V n → Matrix (Fin n) (Fin n) ℂ} + {z : V n} (hM : (M z).PosDef) (hG : (G z).PosDef) : + 0 < inverseTrace M G z := trace_mul_pos hM.inv hG + +lemma second_wderiv_congr {f g : V n → ℂ} {z : V n} (he : f =ᶠ[𝓝 z] g) + (a b : ℂ) (u v : V n) : + wderiv b u (wderiv a v f) z = wderiv b u (wderiv a v g) z := by + exact wderiv_congr (he.eventually_nhds.mono (fun _ h => wderiv_congr h a v)) b u + +lemma inverseTrace_dz_at_one {U : Set (V n)} (hU : IsOpen U) + {M G : V n → Matrix (Fin n) (Fin n) ℂ} (hM : ContDiffOn ℝ ∞ M U) + (hp : ∀ y ∈ U, (M y).PosDef) (hG : ContDiffOn ℝ ∞ G U) + (hGh : ∀ y ∈ U, (G y).IsHermitian) {z : V n} (hz : z ∈ U) (hMz : M z = 1) + (v : V n) : dz v (fun y => (inverseTrace M G y : ℂ)) z = + (mderiv (-Complex.I) v G z-mderiv (-Complex.I) v M z*G z).trace := by + have he : (fun y => (inverseTrace M G y : ℂ)) =ᶠ[𝓝 z] + (fun y => ((M y)⁻¹*G y).trace) := by + filter_upwards [hU.mem_nhds hz] with y hy + exact inverseTrace_real (hp y hy) (hGh y hy) + have hi := (MatrixSmoothGeneral.inverse hM (fun y hy => ne_of_gt (hp y hy).det_pos)).contDiffAt (hU.mem_nhds hz) + have hg := hG.contDiffAt (hU.mem_nhds hz) + change wderiv (-Complex.I) v _ z = _ + rw [wderiv_congr he,mderiv_trace (matrix_smooth_mul hi hg),mderiv_mul hi hg, + mderiv_inverse hU hM (fun y hy => ne_of_gt (hp y hy).det_pos) hz,hMz] + simp only [inv_one,neg_mul,one_mul,mul_one] + congr 1 + abel + +lemma inverseTrace_second_at_one {U : Set (V n)} (hU : IsOpen U) + {M G : V n → Matrix (Fin n) (Fin n) ℂ} (hM : ContDiffOn ℝ ∞ M U) + (hp : ∀ y ∈ U, (M y).PosDef) + (hclosed : ∀ y ∈ U, ∀ u v w : V n, + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (M q) v w) y u + + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (M q) w u) y v + + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (M q) u v) y w = 0) + (hG : ContDiffOn ℝ ∞ G U) (hGh : ∀ y ∈ U, (G y).IsHermitian) + {z : V n} (hz : z ∈ U) (hMz : M z = 1) : + (PotentialKaehler.potentialMatrix (inverseTrace M G) z).trace.re = + -(PotentialKaehler.potentialMatrix (fun y => Real.log (M y).det.re) z*G z).trace.re + + ∑ k, (mderiv (-Complex.I) (e k) M z*(mderiv (-Complex.I) (e k) M z)ᴴ*G z - + mderiv (-Complex.I) (e k) M z*(mderiv (-Complex.I) (e k) G z)ᴴ - + (mderiv (-Complex.I) (e k) M z)ᴴ*mderiv (-Complex.I) (e k) G z + + mderiv Complex.I (e k) (mderiv (-Complex.I) (e k) G) z).trace.re := by + have he : (fun y => (inverseTrace M G y : ℂ)) =ᶠ[𝓝 z] + (fun y => ((M y)⁻¹*G y).trace) := by + filter_upwards [hU.mem_nhds hz] with y hy + exact inverseTrace_real (hp y hy) (hGh y hy) + have hs := (inverseTrace_smooth hU hM hp hG).contDiffAt (hU.mem_nhds hz) + have htr : (PotentialKaehler.potentialMatrix (inverseTrace M G) z).trace = + ∑ k, dzbar (e k) (dz (e k) (fun y => ((M y)⁻¹*G y).trace)) z := by + apply Finset.sum_congr rfl + intro k _ + change PotentialKaehler.potentialMatrix (inverseTrace M G) z k k = _ + rw [potentialMatrix_eq_dzbar_dz hs] + exact second_wderiv_congr he _ _ _ _ + rw [htr,inverse_trace_ricci_identity_at_one hU hM hp hclosed hG hGh hz hMz] + simp only [Complex.add_re,Complex.neg_re,Complex.re_sum] +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/JetDissipation.lean b/lean/OAI/Geometry/PrescribedPotential/JetDissipation.lean new file mode 100644 index 0000000000000000000000000000000000000000..a1561355ca42d8c3a463cd1dbd9e7aa6b5a7d925 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/JetDissipation.lean @@ -0,0 +1,98 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.DirectionalJetEnergy + +namespace OAI + +/-! Jet Dissipation. -/ + +section + + +noncomputable section +open Set Filter Topology Finset Module +open scoped ContDiff +namespace HigherJet +variable {E F : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [NormedAddCommGroup F] [InnerProductSpace ℝ F] + {ι : Type*} [Fintype ι] + +omit [Fintype ι] in +lemma jetFamily_cons (e : ι → E) (m : ℕ) (u : E → F) (i : ι) (σ : Fin m → ι) : + jetFamily e (m+1) u (Fin.cons i σ) = dir (e i) (jetFamily e m u σ) := by + simp only [jetFamily,List.ofFn_succ,Fin.cons_zero,Fin.cons_succ,word] + +lemma jetEnergy_succ (e : ι → E) (m : ℕ) (u : E → F) (x : E) : + jetEnergy e (m+1) u x = familyDissipation e (jetFamily e m u) x := by + unfold jetEnergy familyEnergy familyDissipation frameGradientSq + rw [← Equiv.sum_comp (Fin.consEquiv (fun _ : Fin (m+1) => ι)) + (fun σ => ‖jetFamily e (m+1) u σ x‖^2)] + simp only [Fintype.sum_prod_type] + change (∑ i : ι, ∑ σ : Fin m → ι, ‖jetFamily e (m+1) u (Fin.cons i σ) x‖^2) = _ + simp only [jetFamily_cons] + exact Finset.sum_comm + +variable [FiniteDimensional ℝ E] [FiniteDimensional ℝ F] +def linearArray (e : ι → E) : (E →L[ℝ] F) →ₗ[ℝ] PiLp 2 (fun _ : ι => F) where + toFun T := WithLp.toLp 2 (fun i => T (e i)) + map_add' T R := by ext i; rfl + map_smul' c T := by ext i; rfl + +omit [Fintype ι] [FiniteDimensional ℝ E] [FiniteDimensional ℝ F] in +lemma linearArray_injective (e : Basis ι ℝ E) : + Function.Injective (linearArray (F := F) e) := by + intro T R h + apply ContinuousLinearMap.coe_injective + exact e.ext (fun i => congrArg (fun a : PiLp 2 (fun _ : ι => F) => a i) h) + +lemma linearArray_norm_control (e : Basis ι ℝ E) : + ∃ C : ℝ, 0 < C ∧ ∀ T : E →L[ℝ] F, ‖T‖ ≤ C*‖linearArray e T‖ := by + obtain ⟨C,hC,hb⟩ := (linearArray (F := F) e).injective_iff_antilipschitz.mp (linearArray_injective e) + refine ⟨C,by exact_mod_cast hC,fun T => ?_⟩ + simpa only [map_zero,dist_zero_right] using hb.le_mul_dist T 0 + +lemma linear_frame_coercivity (e : OrthonormalBasis ι ℝ E) : + ∃ C : ℝ, 0 < C ∧ ∀ (T : E →L[ℝ] F) (τ : E ≃L[ℝ] E) (B : ℝ), + 0 ≤ B → ‖τ.symm.toContinuousLinearMap‖ ≤ B → + ∑ i, ‖T (e i)‖^2 ≤ C*B^2*(∑ i, ‖T (τ (e i))‖^2) := by + obtain ⟨A,hA,hb⟩ := linearArray_norm_control (F := F) e.toBasis + refine ⟨(Fintype.card ι+1)*A^2,by positivity,fun T τ B hB hτ => ?_⟩ + have he : (T.comp τ.toContinuousLinearMap).comp τ.symm.toContinuousLinearMap = T := by ext x; simp + have ht : ‖T‖ ≤ A*‖linearArray e (T.comp τ.toContinuousLinearMap)‖*B := by + calc + _ = ‖(T.comp τ.toContinuousLinearMap).comp τ.symm.toContinuousLinearMap‖ := congrArg norm he.symm + _ ≤ ‖T.comp τ.toContinuousLinearMap‖*‖τ.symm.toContinuousLinearMap‖ := ContinuousLinearMap.opNorm_comp_le _ _ + _ ≤ (A*‖linearArray e (T.comp τ.toContinuousLinearMap)‖)*B := + mul_le_mul (hb _) hτ (norm_nonneg _) (by positivity) + have hs : ‖T‖^2 ≤ A^2*B^2*(∑ i, ‖T (τ (e i))‖^2) := by + have h := pow_le_pow_left₀ (norm_nonneg T) ht 2 + rw [mul_pow,mul_pow,PiLp.norm_sq_eq_of_L2] at h + simpa only [linearArray,LinearMap.coe_mk,AddHom.coe_mk,PiLp.toLp_apply, + ContinuousLinearMap.comp_apply,ContinuousLinearEquiv.coe_coe,mul_assoc,mul_left_comm,mul_comm] using h + calc + _ ≤ ∑ _i : ι, ‖T‖^2 := by + apply Finset.sum_le_sum + intro i _ + exact pow_le_pow_left₀ (norm_nonneg _) (by simpa only [e.norm_eq_one,mul_one] using T.le_opNorm (e i)) 2 + _ = (Fintype.card ι : ℝ)*‖T‖^2 := by simp + _ ≤ (Fintype.card ι+1)*(A^2*B^2*(∑ i, ‖T (τ (e i))‖^2)) := by + have h1 := mul_le_mul_of_nonneg_left hs (by positivity : 0 ≤ (Fintype.card ι : ℝ)) + have h2 : 0 ≤ A^2*B^2*(∑ i, ‖T (τ (e i))‖^2) := by positivity + nlinarith only [h1,h2] + _ = _ := by ring + +lemma jetEnergy_frame_coercivity (e : OrthonormalBasis ι ℝ E) : + ∃ C : ℝ, 0 < C ∧ ∀ (m : ℕ) (u : E → F) (x : E) (τ : E ≃L[ℝ] E) (B : ℝ), + 0 ≤ B → ‖τ.symm.toContinuousLinearMap‖ ≤ B → + jetEnergy e (m+1) u x ≤ C*B^2*familyDissipation (fun i => τ (e i)) (jetFamily e m u) x := by + obtain ⟨C,hC,hb⟩ := linear_frame_coercivity (F := F) e + refine ⟨C,hC,fun m u x τ B hB hτ => ?_⟩ + rw [jetEnergy_succ] + unfold familyDissipation frameGradientSq dir + rw [Finset.mul_sum] + exact Finset.sum_le_sum (fun σ _ => hb (fderiv ℝ (jetFamily e m u σ) x) τ B hB hτ) +end HigherJet + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/JetEnergyCoercivity.lean b/lean/OAI/Geometry/PrescribedPotential/JetEnergyCoercivity.lean new file mode 100644 index 0000000000000000000000000000000000000000..6ff80e0e7a00ca0706c8035946dd333cbd0ad7fd --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/JetEnergyCoercivity.lean @@ -0,0 +1,85 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.RealJetEnergy + +namespace OAI + +/-! Jet Energy Coercivity. -/ + +section + + +noncomputable section +open Set Filter Topology Finset +open scoped ContDiff +namespace HigherJet +variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [InnerProductSpace ℝ F] + {ι κ : Type*} [Fintype ι] [Fintype κ] + +lemma family_inner_lower (f g : κ → F) : + -Real.sqrt (∑ j, ‖f j‖^2)*Real.sqrt (∑ j, ‖g j‖^2) ≤ ∑ j, inner ℝ (f j) (g j) := by + let a : PiLp 2 (fun _ : κ => F) := WithLp.toLp 2 f + let b : PiLp 2 (fun _ : κ => F) := WithLp.toLp 2 g + have ha : Real.sqrt (∑ j, ‖f j‖^2) = ‖a‖ := by + have he : ‖a‖^2 = ∑ j, ‖f j‖^2 := by rw [PiLp.norm_sq_eq_of_L2] + rw [← he,Real.sqrt_sq (norm_nonneg _)] + have hb : Real.sqrt (∑ j, ‖g j‖^2) = ‖b‖ := by + have he : ‖b‖^2 = ∑ j, ‖g j‖^2 := by rw [PiLp.norm_sq_eq_of_L2] + rw [← he,Real.sqrt_sq (norm_nonneg _)] + rw [ha,hb] + simpa only [neg_mul,PiLp.inner_apply,a,b,PiLp.toLp_apply] using + (neg_le_neg (abs_real_inner_le_norm a b)).trans (neg_abs_le (inner ℝ a b)) + +lemma familyEnergy_laplace_lower {U : Set E} (hU : IsOpen U) {f : κ → E → F} + (hf : ∀ j, ContDiffOn ℝ ∞ (f j) U) {x : E} (hx : x ∈ U) (v : ι → E) : + 2*familyDissipation v f x - 2*Real.sqrt (familyEnergy f x)* + Real.sqrt (∑ j, ‖frameLaplace v (f j) x‖^2) ≤ frameLaplace v (familyEnergy f) x := by + rw [familyEnergy_laplace hU hf hx] + have hb := family_inner_lower (fun j => f j x) (fun j => frameLaplace v (f j) x) + change -Real.sqrt (familyEnergy f x)*_ ≤ _ at hb + linarith only [hb] +end HigherJet + +namespace BernsteinEstimate +lemma energy_first_numeric {r d B C L : ℝ} (hr : 0 ≤ r) (hd : 0 ≤ d) + (hC : 0 ≤ C) (hrC : r ≤ C) (hB : B ≤ C*(1+d)) + (hL : 2*d^2-2*r*B ≤ L) : + d^2-(2*C^2+C^4) ≤ L := by + have h1 := mul_le_mul_of_nonneg_left hB (by positivity : 0 ≤ 2*r) + have h2 := mul_le_mul_of_nonneg_right hrC (by positivity : 0 ≤ 2*C*(1+d)) + nlinarith only [hL,h1,h2,sq_nonneg (d-C^2)] + +lemma energy_cubic_numeric {r d B C L : ℝ} (hr : 0 ≤ r) (_hd : 0 ≤ d) + (hC : 0 ≤ C) (hB : B ≤ C*(1+r^2+d)) + (hL : 2*d^2-2*r*B ≤ L) : + d^2-(4*C+2*C^2)*(1+r^3) ≤ L := by + have hrb : r ≤ 1+r^3 := by + by_cases h : r ≤ 1 + · nlinarith [pow_nonneg hr 3] + · have h' : 1 ≤ r := le_of_not_ge h + have hh := pow_le_pow_left₀ (by norm_num : (0:ℝ) ≤ 1) h' 2 + nlinarith [mul_nonneg hr (by linarith : 0 ≤ r^2-1)] + have hr2b : r^2 ≤ 1+r^3 := by + by_cases h : r ≤ 1 + · nlinarith [pow_nonneg hr 3] + · nlinarith [mul_nonneg (sq_nonneg r) (by linarith : 0 ≤ r-1)] + have h1 := mul_le_mul_of_nonneg_left hB (by positivity : 0 ≤ 2*r) + have h2 := mul_le_mul_of_nonneg_left hrb (by positivity : 0 ≤ 2*C) + have h3 := mul_le_mul_of_nonneg_left hr2b (sq_nonneg C) + have h4 : 0 ≤ 2*C+C^2*(1+r^3) := by positivity + nlinarith only [hL,h1,h2,h3,h4,sq_nonneg (d-C*r)] + +lemma energy_linear_numeric {r d B C L : ℝ} (hr : 0 ≤ r) (_hd : 0 ≤ d) + (hC : 0 ≤ C) (hB : B ≤ C*(1+r+d)) + (hL : 2*d^2-2*r*B ≤ L) : + d^2-(4*C+C^2)*(1+r^2) ≤ L := by + have h1 := mul_le_mul_of_nonneg_left hB (by positivity : 0 ≤ 2*r) + have h2 := mul_le_mul_of_nonneg_left (sq_nonneg (r-1)) hC + have h3 : 0 ≤ 3*C+C^2+C*r^2 := by positivity + nlinarith only [hL,h1,h2,h3,sq_nonneg (d-C*r)] +end BernsteinEstimate + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/JetEnergyEstimates.lean b/lean/OAI/Geometry/PrescribedPotential/JetEnergyEstimates.lean new file mode 100644 index 0000000000000000000000000000000000000000..c636a93bbfd152c6bb847f07a3d3f2f94cfd3ae0 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/JetEnergyEstimates.lean @@ -0,0 +1,77 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.JetEnergyUniform + +namespace OAI + +/-! Jet Energy Estimates. -/ + +section + + + +noncomputable section +open Set Filter Topology Finset Module +open scoped ContDiff +namespace HigherJet +variable {E F : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [NormedAddCommGroup F] [InnerProductSpace ℝ F] + {ι : Type*} [Fintype ι] + +lemma energy_first_of_residual {U : Set E} (hU : IsOpen U) {u : E → F} + (hu : ContDiffOn ℝ ∞ u U) (e : ι → E) {x : E} (hx : x ∈ U) (v : ι → E) + {A R : ℝ} (hA : 1 ≤ A) (hR : 0 ≤ R) + (hS : Real.sqrt (jetEnergy e 1 u x) ≤ A) + (hN : ‖iteratedFDeriv ℝ 2 u x‖ ≤ A*Real.sqrt (familyDissipation v (jetFamily e 1 u) x)) + (hr : ∀ σ, ‖frameLaplace v (jetFamily e 1 u σ) x‖ ≤ R*(1+‖iteratedFDeriv ℝ 2 u x‖)) : + familyDissipation v (jetFamily e 1 u) x - + (2*(A+(Fintype.card (Fin 1 → ι)+1)*R*A)^2+(A+(Fintype.card (Fin 1 → ι)+1)*R*A)^4) ≤ + frameLaplace v (jetEnergy e 1 u) x := by + apply BernsteinEstimate.first_energy_scaled (W := Real.sqrt (∑ σ, ‖frameLaplace v (jetFamily e 1 u σ) x‖^2)) (jetEnergy_nonneg _ _ _ _) + (familyDissipation_nonneg _ _ _) hA (show 0 ≤ (Fintype.card (Fin 1 → ι)+1)*R by positivity) hS + · exact (family_laplace_norm_bound (show 0 ≤ R*(1+‖iteratedFDeriv ℝ 2 u x‖) by positivity) hr).trans + (by simpa only [mul_assoc] using mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left + (add_le_add (le_refl 1) hN) hR) (show 0 ≤ (Fintype.card (Fin 1 → ι)+1 : ℝ) by positivity)) + · exact familyEnergy_laplace_lower hU (jetFamily_smoothOn hU hu e 1) hx v + +lemma energy_second_of_residual {U : Set E} (hU : IsOpen U) {u : E → F} + (hu : ContDiffOn ℝ ∞ u U) (e : ι → E) {x : E} (hx : x ∈ U) (v : ι → E) + {A R : ℝ} (hA : 1 ≤ A) (hR : 0 ≤ R) + (hN : ‖iteratedFDeriv ℝ 2 u x‖ ≤ A*Real.sqrt (jetEnergy e 2 u x)) + (hD : ‖iteratedFDeriv ℝ 3 u x‖ ≤ A*Real.sqrt (familyDissipation v (jetFamily e 2 u) x)) + (hr : ∀ σ, ‖frameLaplace v (jetFamily e 2 u σ) x‖ ≤ + R*(1+‖iteratedFDeriv ℝ 2 u x‖^2+‖iteratedFDeriv ℝ 3 u x‖)) : + familyDissipation v (jetFamily e 2 u) x - + (4*((Fintype.card (Fin 2 → ι)+1)*R*A^2)+2*((Fintype.card (Fin 2 → ι)+1)*R*A^2)^2)* + (1+jetEnergy e 2 u x*Real.sqrt (jetEnergy e 2 u x)) ≤ + frameLaplace v (jetEnergy e 2 u) x := by + apply BernsteinEstimate.cubic_energy_scaled (W := Real.sqrt (∑ σ, ‖frameLaplace v (jetFamily e 2 u σ) x‖^2)) (jetEnergy_nonneg _ _ _ _) + (familyDissipation_nonneg _ _ _) hA (show 0 ≤ (Fintype.card (Fin 2 → ι)+1)*R by positivity) + · have hn2 := pow_le_pow_left₀ (norm_nonneg _) hN 2 + rw [mul_pow,Real.sq_sqrt (jetEnergy_nonneg _ _ _ _)] at hn2 + exact (family_laplace_norm_bound (show 0 ≤ R*(1+‖iteratedFDeriv ℝ 2 u x‖^2+‖iteratedFDeriv ℝ 3 u x‖) by positivity) hr).trans + (by simpa only [mul_assoc] using mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left + (add_le_add (add_le_add (le_refl 1) hn2) hD) hR) (show 0 ≤ (Fintype.card (Fin 2 → ι)+1 : ℝ) by positivity)) + · exact familyEnergy_laplace_lower hU (jetFamily_smoothOn hU hu e 2) hx v + +lemma energy_high_of_residual {U : Set E} (hU : IsOpen U) {u : E → F} + (hu : ContDiffOn ℝ ∞ u U) (e : ι → E) (m : ℕ) {x : E} (hx : x ∈ U) (v : ι → E) + {A R : ℝ} (hA : 1 ≤ A) (hR : 0 ≤ R) + (hN : ‖iteratedFDeriv ℝ m u x‖ ≤ A*Real.sqrt (jetEnergy e m u x)) + (hD : ‖iteratedFDeriv ℝ (m+1) u x‖ ≤ A*Real.sqrt (familyDissipation v (jetFamily e m u) x)) + (hr : ∀ σ, ‖frameLaplace v (jetFamily e m u σ) x‖ ≤ + R*(1+‖iteratedFDeriv ℝ m u x‖+‖iteratedFDeriv ℝ (m+1) u x‖)) : + familyDissipation v (jetFamily e m u) x - + (4*((Fintype.card (Fin m → ι)+1)*R*A)+((Fintype.card (Fin m → ι)+1)*R*A)^2)* + (1+jetEnergy e m u x) ≤ frameLaplace v (jetEnergy e m u) x := by + apply BernsteinEstimate.linear_energy_scaled (W := Real.sqrt (∑ σ, ‖frameLaplace v (jetFamily e m u σ) x‖^2)) (jetEnergy_nonneg _ _ _ _) + (familyDissipation_nonneg _ _ _) hA (show 0 ≤ (Fintype.card (Fin m → ι)+1)*R by positivity) + · exact (family_laplace_norm_bound (show 0 ≤ R*(1+‖iteratedFDeriv ℝ m u x‖+‖iteratedFDeriv ℝ (m+1) u x‖) by positivity) hr).trans + (by simpa only [mul_assoc] using mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left + (add_le_add (add_le_add (le_refl 1) hN) hD) hR) (show 0 ≤ (Fintype.card (Fin m → ι)+1 : ℝ) by positivity)) + · exact familyEnergy_laplace_lower hU (jetFamily_smoothOn hU hu e m) hx v +end HigherJet + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/JetEnergyUniform.lean b/lean/OAI/Geometry/PrescribedPotential/JetEnergyUniform.lean new file mode 100644 index 0000000000000000000000000000000000000000..a170b9fc3d2f3d3f12054c1480295eac0cc8e4fe --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/JetEnergyUniform.lean @@ -0,0 +1,118 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.JetDissipation +import OAI.Geometry.PrescribedPotential.JetEnergyCoercivity +import OAI.Geometry.PrescribedPotential.RealFrameScalar + +namespace OAI + +/-! Jet Energy Uniform. -/ + +section + + + +noncomputable section +open Set Filter Topology Finset Module +open scoped ContDiff +namespace HigherJet +variable {E F : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [NormedAddCommGroup F] [InnerProductSpace ℝ F] + {ι : Type*} [Fintype ι] + +lemma jetEnergy_le_norm {U : Set E} (hU : IsOpen U) {u : E → F} + (hu : ContDiffOn ℝ ∞ u U) (e : OrthonormalBasis ι ℝ E) (m : ℕ) {x : E} (hx : x ∈ U) : + jetEnergy e m u x ≤ (Fintype.card (Fin m → ι) : ℝ)*‖iteratedFDeriv ℝ m u x‖^2 := by + calc + _ ≤ ∑ _σ : Fin m → ι, ‖iteratedFDeriv ℝ m u x‖^2 := by + apply Finset.sum_le_sum + intro σ _ + apply pow_le_pow_left₀ (norm_nonneg _) + simpa only [jetFamily,e.norm_eq_one,Finset.prod_const_one,mul_one] using norm_word_ofFn_le hU hu m (fun i => e (σ i)) hx + _ = _ := by simp + +lemma jetEnergy_gradient_bound {U : Set E} (hU : IsOpen U) {u : E → F} + (hu : ContDiffOn ℝ ∞ u U) (e : ι → E) (m : ℕ) {x : E} (hx : x ∈ U) (v : ι → E) : + ‖frameGradient v (jetEnergy e m u) x‖^2 ≤ + 4*jetEnergy e m u x*familyDissipation v (jetFamily e m u) x := by + rw [norm_frameGradient_sq] + exact familyEnergy_gradient_bound hU (jetFamily_smoothOn hU hu e m) hx v + +lemma familyDissipation_nonneg (v : ι → E) {κ : Type*} [Fintype κ] (f : κ → E → F) (x : E) : + 0 ≤ familyDissipation v f x := sum_nonneg (fun _ _ => sum_nonneg (fun _ _ => sq_nonneg _)) + +variable [FiniteDimensional ℝ E] [FiniteDimensional ℝ F] +lemma jetEnergy_frame_upper (e : OrthonormalBasis ι ℝ E) : + ∃ C : ℝ, 0 < C ∧ ∀ (m : ℕ) (u : E → F) (x : E) (τ : E ≃L[ℝ] E) (B : ℝ), + 0 ≤ B → ‖τ.toContinuousLinearMap‖ ≤ B → + familyDissipation (fun i => τ (e i)) (jetFamily e m u) x ≤ C*B^2*jetEnergy e (m+1) u x := by + obtain ⟨A,hA,hb⟩ := linearArray_norm_control (F := F) e.toBasis + refine ⟨(Fintype.card ι+1)*A^2,by positivity,fun m u x τ B hB hτ => ?_⟩ + rw [jetEnergy_succ] + unfold familyDissipation frameGradientSq dir + rw [Finset.mul_sum] + apply sum_le_sum + intro σ _ + let T := fderiv ℝ (jetFamily e m u σ) x + have ht : ‖T‖^2 ≤ A^2*(∑ i, ‖T (e i)‖^2) := by + have hh := pow_le_pow_left₀ (norm_nonneg T) (hb T) 2 + rw [mul_pow,PiLp.norm_sq_eq_of_L2] at hh + exact hh + calc + _ ≤ ∑ _i : ι, (‖T‖*B)^2 := by + apply sum_le_sum + intro i _ + apply pow_le_pow_left₀ (norm_nonneg _) + exact (T.le_opNorm _).trans (mul_le_mul_of_nonneg_left + ((τ.toContinuousLinearMap.le_opNorm (e i)).trans (by simpa only [e.norm_eq_one,mul_one] using hτ)) (norm_nonneg _)) + _ = (Fintype.card ι : ℝ)*(‖T‖*B)^2 := by simp + _ ≤ ((Fintype.card ι : ℝ)+1)*A^2*B^2*(∑ i, ‖T (e i)‖^2) := by + have h1 := mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_right ht (sq_nonneg B)) (show 0 ≤ (Fintype.card ι : ℝ) by positivity) + have h2 : 0 ≤ A^2*B^2*(∑ i, ‖T (e i)‖^2) := by positivity + nlinarith only [h1,h2] + +end HigherJet +namespace BernsteinEstimate +lemma first_energy_scaled {S D A R W L : ℝ} (_hS : 0 ≤ S) (hD : 0 ≤ D) + (hA : 1 ≤ A) (hR : 0 ≤ R) (hSbound : Real.sqrt S ≤ A) + (hW : W ≤ R*(1+A*Real.sqrt D)) (hL : 2*D-2*Real.sqrt S*W ≤ L) : + D-(2*(A+R*A)^2+(A+R*A)^4) ≤ L := by + have hc : 0 ≤ A+R*A := by positivity + have hr : R*(1+A*Real.sqrt D) ≤ (A+R*A)*(1+Real.sqrt D) := by + nlinarith only [hA,mul_nonneg hR (by linarith : 0 ≤ A-1),mul_nonneg (show 0 ≤ A by linarith) (Real.sqrt_nonneg D)] + have hh := energy_first_numeric (Real.sqrt_nonneg S) (Real.sqrt_nonneg D) hc + (hSbound.trans (le_add_of_nonneg_right (mul_nonneg hR (by linarith)))) (hW.trans hr) + (by simpa only [Real.sq_sqrt hD] using hL) + simpa only [Real.sq_sqrt hD] using hh + +lemma cubic_energy_scaled {S D A R W L : ℝ} (hS : 0 ≤ S) (hD : 0 ≤ D) + (hA : 1 ≤ A) (hR : 0 ≤ R) + (hW : W ≤ R*(1+A^2*S+A*Real.sqrt D)) (hL : 2*D-2*Real.sqrt S*W ≤ L) : + D-(4*(R*A^2)+2*(R*A^2)^2)*(1+S*Real.sqrt S) ≤ L := by + have hA0 : 0 ≤ A := by linarith + have hAA : A ≤ A^2 := by nlinarith + have hW' : W ≤ R*A^2*(1+(Real.sqrt S)^2+Real.sqrt D) := by + rw [Real.sq_sqrt hS] + have hh : 1+A^2*S+A*Real.sqrt D ≤ A^2*(1+S+Real.sqrt D) := by + nlinarith only [hAA,hA,mul_nonneg (by linarith : 0 ≤ A^2-A) (Real.sqrt_nonneg D)] + exact hW.trans ((mul_le_mul_of_nonneg_left hh hR).trans_eq (by ring)) + have hh := energy_cubic_numeric (Real.sqrt_nonneg S) (Real.sqrt_nonneg D) + (show 0 ≤ R*A^2 by positivity) hW' (by simpa only [Real.sq_sqrt hD] using hL) + have he : (Real.sqrt S)^3 = S*Real.sqrt S := by rw [pow_succ,Real.sq_sqrt hS] + simpa only [Real.sq_sqrt hD,he] using hh + +lemma linear_energy_scaled {S D A R W L : ℝ} (hS : 0 ≤ S) (hD : 0 ≤ D) + (hA : 1 ≤ A) (hR : 0 ≤ R) + (hW : W ≤ R*(1+A*Real.sqrt S+A*Real.sqrt D)) (hL : 2*D-2*Real.sqrt S*W ≤ L) : + D-(4*(R*A)+(R*A)^2)*(1+S) ≤ L := by + have hW' : W ≤ R*A*(1+Real.sqrt S+Real.sqrt D) := by + apply hW.trans + nlinarith only [mul_nonneg hR (by linarith : 0 ≤ A-1)] + have hh := energy_linear_numeric (Real.sqrt_nonneg S) (Real.sqrt_nonneg D) + (show 0 ≤ R*A by positivity) hW' (by simpa only [Real.sq_sqrt hD] using hL) + simpa only [Real.sq_sqrt hD,Real.sq_sqrt hS] using hh +end BernsteinEstimate + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/JetNormEquivalence.lean b/lean/OAI/Geometry/PrescribedPotential/JetNormEquivalence.lean new file mode 100644 index 0000000000000000000000000000000000000000..dc1d89e0c44ea38c4ba1316b9e696cc224e317c1 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/JetNormEquivalence.lean @@ -0,0 +1,52 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.KaehlerClosedDerivatives + +namespace OAI + +/-! Jet Norm Equivalence. -/ + +section + + + +noncomputable section +open Set Filter Topology Finset Module +open scoped ContDiff +namespace HigherJet +variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [InnerProductSpace ℝ F] + [FiniteDimensional ℝ E] [FiniteDimensional ℝ F] + {ι : Type*} [Fintype ι] + +def jetArray (e : ι → E) (m : ℕ) : + ContinuousMultilinearMap ℝ (fun _ : Fin m => E) F →ₗ[ℝ] + PiLp 2 (fun _ : Fin m → ι => F) where + toFun T := WithLp.toLp 2 (fun σ => T (fun i => e (σ i))) + map_add' T R := by ext σ; rfl + map_smul' c T := by ext σ; rfl + +omit [FiniteDimensional ℝ E] [FiniteDimensional ℝ F] [Fintype ι] in +lemma jetArray_injective (e : Basis ι ℝ E) (m : ℕ) : + Function.Injective (jetArray (F := F) e m) := by + intro T R h + have he : T.toMultilinearMap = R.toMultilinearMap := Module.Basis.ext_multilinear (fun _ => e) + (fun σ => congrArg (fun V : PiLp 2 (fun _ : Fin m → ι => F) => V σ) h) + ext v + exact congrArg (fun L => L v) he + +omit [FiniteDimensional ℝ E] in +lemma jetArray_norm_control (e : Basis ι ℝ E) (m : ℕ) : + ∃ C : ℝ, 0 < C ∧ ∀ T : ContinuousMultilinearMap ℝ (fun _ : Fin m => E) F, + ‖T‖ ≤ C*‖jetArray e m T‖ := by + let : FiniteDimensional ℝ (ContinuousMultilinearMap ℝ (fun _ : Fin m => E) F) := + FiniteDimensional.of_injective (jetArray (F := F) e m) (jetArray_injective e m) + obtain ⟨C,hC,hb⟩ := (jetArray (F := F) e m).injective_iff_antilipschitz.mp (jetArray_injective e m) + refine ⟨C,by exact_mod_cast hC,fun T => ?_⟩ + simpa only [map_zero,dist_zero_right] using hb.le_mul_dist T 0 + +end HigherJet + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/KaehlerClosedDerivatives.lean b/lean/OAI/Geometry/PrescribedPotential/KaehlerClosedDerivatives.lean new file mode 100644 index 0000000000000000000000000000000000000000..5d7835ac94e0fbd623ba83b4f36d8ca02000aa1f --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/KaehlerClosedDerivatives.lean @@ -0,0 +1,94 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.WirtingerCalculus + +namespace OAI + +/-! Kaehler Closed Derivatives. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +open Anticanonical +variable {n : ℕ} +def e (i : Fin n) : V n := Pi.single i 1 + +lemma fundamental_e (M : Matrix (Fin n) (Fin n) ℂ) (i j : Fin n) : + ComplexAtlas.fundamentalForm M (e i) (e j) = (M i j).im := by + simp [ComplexAtlas.fundamentalForm,e] +lemma fundamental_Ie (M : Matrix (Fin n) (Fin n) ℂ) (i j : Fin n) : + ComplexAtlas.fundamentalForm M (Complex.I • e i) (e j) = -(M i j).re := by + simp [ComplexAtlas.fundamentalForm,e,star_smul,smul_dotProduct] +lemma fundamental_eI (M : Matrix (Fin n) (Fin n) ℂ) (i j : Fin n) : + ComplexAtlas.fundamentalForm M (e i) (Complex.I • e j) = (M i j).re := by + simp [ComplexAtlas.fundamentalForm,e,Matrix.mulVec_smul,dotProduct_smul] +lemma fundamental_IeI (M : Matrix (Fin n) (Fin n) ℂ) (i j : Fin n) : + ComplexAtlas.fundamentalForm M (Complex.I • e i) (Complex.I • e j) = (M i j).im := by + simp [ComplexAtlas.fundamentalForm,e,Matrix.mulVec_smul,star_smul, + smul_dotProduct,dotProduct_smul] + +lemma fderiv_re {f : V n → ℂ} {z : V n} (hf : DifferentiableAt ℝ f z) (v : V n) : + fderiv ℝ (fun y => (f y).re) z v = (fderiv ℝ f z v).re := by + exact congrArg (fun T : V n →L[ℝ] ℝ => T v) + ((Complex.reCLM.hasFDerivAt.comp z hf.hasFDerivAt).fderiv) +lemma fderiv_im {f : V n → ℂ} {z : V n} (hf : DifferentiableAt ℝ f z) (v : V n) : + fderiv ℝ (fun y => (f y).im) z v = (fderiv ℝ f z v).im := by + exact congrArg (fun T : V n →L[ℝ] ℝ => T v) + ((Complex.imCLM.hasFDerivAt.comp z hf.hasFDerivAt).fderiv) + +lemma closed_dz_symmetry {U : Set (V n)} (hU : IsOpen U) + {M : V n → Matrix (Fin n) (Fin n) ℂ} + (hM : ContDiffOn ℝ ∞ M U) (hh : ∀ y ∈ U, (M y).IsHermitian) + (hclosed : ∀ y ∈ U, ∀ u v w : V n, + fderiv ℝ (fun q => ComplexAtlas.fundamentalForm (M q) v w) y u + + fderiv ℝ (fun q => ComplexAtlas.fundamentalForm (M q) w u) y v + + fderiv ℝ (fun q => ComplexAtlas.fundamentalForm (M q) u v) y w = 0) + {z : V n} (hz : z ∈ U) (i j k : Fin n) : + dz (e k) (fun y => M y i j) z = dz (e j) (fun y => M y i k) z := by + have hd (a b : Fin n) : DifferentiableAt ℝ (fun y => M y a b) z := + ((contDiffOn_pi.mp (contDiffOn_pi.mp hM a) b).contDiffAt + (hU.mem_nhds hz)).differentiableAt (by simp) + have hre (a b : Fin n) : (fun y => (M y a b).re) =ᶠ[𝓝 z] (fun y => (M y b a).re) := by + filter_upwards [hU.mem_nhds hz] with y hy + simpa only [Complex.star_def,Complex.conj_re] using congrArg Complex.re ((hh y hy).apply b a) + have him (a b : Fin n) : (fun y => (M y a b).im) =ᶠ[𝓝 z] (fun y => -(M y b a).im) := by + filter_upwards [hU.mem_nhds hz] with y hy + have he := congrArg Complex.im ((hh y hy).apply a b) + simpa only [Complex.star_def,Complex.conj_im] using he.symm + have hRe (a b : Fin n) (v : V n) : + (fderiv ℝ (fun y => M y a b) z v).re = (fderiv ℝ (fun y => M y b a) z v).re := by + rw [← fderiv_re (hd a b), (hre a b).fderiv_eq, fderiv_re (hd b a)] + have hIm (a b : Fin n) (v : V n) : + (fderiv ℝ (fun y => M y a b) z v).im = -(fderiv ℝ (fun y => M y b a) z v).im := by + rw [← fderiv_im (hd a b), (him a b).fderiv_eq, fderiv_fun_neg, + _root_.neg_apply, fderiv_im (hd b a)] + have h1 := hclosed z hz (Complex.I • e k) (e i) (e j) + have h2 := hclosed z hz (Complex.I • e j) (e i) (e k) + have h3 := hclosed z hz (e k) (e i) (e j) + have h4 := hclosed z hz (Complex.I • e k) (e i) (Complex.I • e j) + simp only [fundamental_e,fundamental_Ie,fundamental_eI,fundamental_IeI] at h1 h2 h3 h4 + have hneg (a b : Fin n) : DifferentiableAt ℝ (fun y => (M y a b).re) z := + Complex.reCLM.differentiableAt.comp z (hd a b) + simp only [fderiv_fun_neg,_root_.neg_apply,fderiv_re (hd _ _),fderiv_im (hd _ _)] at h1 h2 h3 h4 + have h5 := hRe j k (e i) + have h6 := hRe k i (e j) + have h7 := hRe j i (e k) + have h8 := hRe k i (Complex.I • e j) + have h9 := hIm k i (e j) + apply Complex.ext + · simp only [dz,wderiv,Complex.div_ofNat_re,Complex.add_re,neg_mul, + Complex.neg_re,Complex.I_mul_re] + linarith + · simp only [dz,wderiv,Complex.div_ofNat_im,Complex.add_im,neg_mul, + Complex.neg_im,Complex.I_mul_im] + linarith +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/KaehlerSecondDerivatives.lean b/lean/OAI/Geometry/PrescribedPotential/KaehlerSecondDerivatives.lean new file mode 100644 index 0000000000000000000000000000000000000000..214a3be7b6f59f21b1b1169c0ada45b526548477 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/KaehlerSecondDerivatives.lean @@ -0,0 +1,99 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.MatrixLogDet +import OAI.Geometry.PrescribedPotential.WirtingerConjugate + +namespace OAI + +/-! Kaehler Second Derivatives. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +variable {n : ℕ} + +lemma closed_mixed_symmetry {U : Set (V n)} (hU : IsOpen U) + {M : V n → Matrix (Fin n) (Fin n) ℂ} + (hM : ContDiffOn ℝ ∞ M U) (hh : ∀ y ∈ U, (M y).IsHermitian) + (hclosed : ∀ y ∈ U, ∀ u v w : V n, + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (M q) v w) y u + + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (M q) w u) y v + + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (M q) u v) y w = 0) + {z : V n} (hz : z ∈ U) (i j k l : Fin n) : + dzbar (e k) (dz (e l) (fun y => M y i j)) z = + dzbar (e i) (dz (e j) (fun y => M y k l)) z := by + have hs := hM.contDiffAt (hU.mem_nhds hz) + have he1 : dz (e l) (fun y => M y i j) =ᶠ[𝓝 z] dz (e j) (fun y => M y i l) := by + filter_upwards [hU.mem_nhds hz] with y hy + exact closed_dz_symmetry hU hM hh hclosed hy i j l + rw [show dzbar (e k) (dz (e l) (fun y => M y i j)) z = + dzbar (e k) (dz (e j) (fun y => M y i l)) z from wderiv_congr he1 _ _] + rw [show dzbar (e k) (dz (e j) (fun y => M y i l)) z = + dz (e j) (dzbar (e k) (fun y => M y i l)) z from wderiv_comm (entry_smooth hs i l) _ _ _ _] + have he2 : dzbar (e k) (fun y => M y i l) =ᶠ[𝓝 z] dzbar (e i) (fun y => M y k l) := by + filter_upwards [hU.mem_nhds hz] with y hy + exact closed_dzbar_symmetry hU hM hh hclosed hy i l k + rw [show dz (e j) (dzbar (e k) (fun y => M y i l)) z = + dz (e j) (dzbar (e i) (fun y => M y k l)) z from wderiv_congr he2 _ _] + exact wderiv_comm (entry_smooth hs k l) _ _ _ _ + +lemma closed_derivative_quadratic {U : Set (V n)} (hU : IsOpen U) + {M : V n → Matrix (Fin n) (Fin n) ℂ} + (hM : ContDiffOn ℝ ∞ M U) (hh : ∀ y ∈ U, (M y).IsHermitian) + (hclosed : ∀ y ∈ U, ∀ u v w : V n, + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (M q) v w) y u + + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (M q) w u) y v + + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (M q) u v) y w = 0) + {z : V n} (hz : z ∈ U) (i j : Fin n) : + ∑ k, (mderiv Complex.I (e k) M z*mderiv (-Complex.I) (e k) M z) i j = + (mderiv Complex.I (e i) M z*mderiv (-Complex.I) (e j) M z).trace := by + classical + simp only [Matrix.mul_apply,Matrix.trace,Matrix.diag_apply,mderiv] + apply Finset.sum_congr rfl + intro k _ + apply Finset.sum_congr rfl + intro l _ + change dzbar (e k) (fun y => M y i l) z * dz (e k) (fun y => M y l j) z = + dzbar (e i) (fun y => M y k l) z * dz (e j) (fun y => M y l k) z + rw [closed_dzbar_symmetry hU hM hh hclosed hz i l k, + closed_dz_symmetry hU hM hh hclosed hz l j k] + +lemma ricci_cancellation_at_one {U : Set (V n)} (hU : IsOpen U) + {M : V n → Matrix (Fin n) (Fin n) ℂ} + (hM : ContDiffOn ℝ ∞ M U) (hp : ∀ y ∈ U, (M y).PosDef) + (hclosed : ∀ y ∈ U, ∀ u v w : V n, + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (M q) v w) y u + + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (M q) w u) y v + + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (M q) u v) y w = 0) + {z : V n} (hz : z ∈ U) (hMz : M z = 1) : + (∑ k, mderiv Complex.I (e k) (mderiv (-Complex.I) (e k) M) z) = + PotentialKaehler.potentialMatrix (fun y => Real.log (M y).det.re) z + + ∑ k, mderiv Complex.I (e k) M z*mderiv (-Complex.I) (e k) M z := by + have hh : ∀ y ∈ U, (M y).IsHermitian := fun y hy => (hp y hy).isHermitian + ext i j + simp only [Matrix.sum_apply,Matrix.add_apply] + rw [closed_derivative_quadratic hU hM hh hclosed hz i j] + have hs := hM.contDiffAt (hU.mem_nhds hz) + have hl : ContDiffAt ℝ ∞ (fun y => Real.log (M y).det.re) z := + (Complex.reCLM.contDiff.contDiffAt.comp z (determinant_smooth.contDiffAt.comp z hs)).log + (ne_of_gt (Complex.pos_iff.mp (hp z hz).det_pos).1) + rw [potentialMatrix_eq_dzbar_dz hl] + have he := second_wderiv_logdet_at_one hU hM hp hz hMz (-Complex.I) Complex.I (e i) (e j) + change dzbar (e i) (dz (e j) (fun y => (Real.log (M y).det.re : ℂ))) z = _ at he + change ∑ k, dzbar (e k) (dz (e k) (fun y => M y i j)) z = + dzbar (e i) (dz (e j) (fun y => (Real.log (M y).det.re : ℂ))) z + _ + rw [he,sub_add_cancel] + unfold Matrix.trace + apply Finset.sum_congr rfl + intro k _ + exact closed_mixed_symmetry hU hM hh hclosed hz i j k k +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/KernelCompact.lean b/lean/OAI/Geometry/PrescribedPotential/KernelCompact.lean new file mode 100644 index 0000000000000000000000000000000000000000..746377e23a63844ccd7fad37088cfeec14431f58 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/KernelCompact.lean @@ -0,0 +1,68 @@ +import Mathlib + +namespace OAI + +/-! Kernel Compact. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped BoundedContinuousFunction +namespace EllipticCompact +variable {K H : Type*} [TopologicalSpace K] [CompactSpace K] + [NormedAddCommGroup H] [NormedSpace ℂ H] + +def kernelOperator (g : K →ᵇ (H →L[ℂ] ℂ)) : H →L[ℂ] (K →ᵇ ℂ) := + LinearMap.mkContinuous + { toFun := fun u => BoundedContinuousFunction.mkOfCompact + ⟨fun x => g x u, by fun_prop⟩ + map_add' := by intro u v; ext x; exact map_add (g x) u v + map_smul' := by intro c u; ext x; exact map_smul (g x) c u } + ‖g‖ (fun u => by + change ‖BoundedContinuousFunction.mkOfCompact ⟨fun x => g x u, _⟩‖ ≤ ‖g‖ * ‖u‖ + apply (BoundedContinuousFunction.norm_le (mul_nonneg (norm_nonneg g) (norm_nonneg u))).mpr + intro x + exact ((g x).le_opNorm u).trans (mul_le_mul_of_nonneg_right (g.norm_coe_le_norm x) (norm_nonneg _))) + +lemma kernelOperator_apply (g : K →ᵇ (H →L[ℂ] ℂ)) (u : H) (x : K) : + kernelOperator g u x = g x u := rfl + + + +theorem kernelOperator_compact (g : K →ᵇ (H →L[ℂ] ℂ)) : + IsCompactOperator (kernelOperator g) := by + let S := kernelOperator g '' Metric.closedBall (0 : H) 1 + have heq : Equicontinuous ((↑) : S → K → ℂ) := by + intro x + apply Metric.equicontinuousAt_of_continuity_modulus + (b := fun y => ‖g x - g y‖) + · have h : ContinuousAt (fun y => ‖g x - g y‖) x := by fun_prop + simpa using h.tendsto + · filter_upwards [] with y F + obtain ⟨u, hu, hF⟩ := F.property + have hn : ‖u‖ ≤ 1 := by simpa only [Metric.mem_closedBall, dist_zero_right] using hu + change dist (F.val x) (F.val y) ≤ _ + rw [← hF, kernelOperator_apply, kernelOperator_apply, dist_eq_norm, + ← sub_apply] + exact ((g x - g y).le_opNorm u).trans (by simpa only [mul_one] using + (mul_le_mul_of_nonneg_left hn (norm_nonneg (g x - g y)))) + have hc : IsCompact (closure S) := BoundedContinuousFunction.arzela_ascoli + (Metric.closedBall (0 : ℂ) ‖g‖) (isCompact_closedBall _ _) S (by + intro F x hF + obtain ⟨u, hu, rfl⟩ := hF + have hn : ‖u‖ ≤ 1 := by simpa only [Metric.mem_closedBall, dist_zero_right] using hu + rw [Metric.mem_closedBall, dist_zero_right, kernelOperator_apply] + exact ((g x).le_opNorm u).trans ((mul_le_mul_of_nonneg_right (g.norm_coe_le_norm x) (norm_nonneg _)).trans + (by simpa only [mul_one] using mul_le_mul_of_nonneg_left hn (norm_nonneg g)))) heq + apply (isCompactOperator_iff_exists_mem_nhds_image_subset_compact _).mpr + exact ⟨Metric.closedBall 0 1, Metric.closedBall_mem_nhds _ (by norm_num), closure S, hc, + subset_closure⟩ +end EllipticCompact + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/LinearFrameCalculus.lean b/lean/OAI/Geometry/PrescribedPotential/LinearFrameCalculus.lean new file mode 100644 index 0000000000000000000000000000000000000000..afe766a83714ab221b6dbfadc6cc59ccd93f5061 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/LinearFrameCalculus.lean @@ -0,0 +1,98 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.MatrixWirtinger + +namespace OAI + +/-! Linear Frame Calculus. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +variable {n : ℕ} + +def frameMatrix (B : V n →L[ℂ] V n) : Matrix (Fin n) (Fin n) ℂ := + LinearMap.toMatrix' B.toLinearMap + +def pullMetric (B : V n →L[ℂ] V n) (M : V n → Matrix (Fin n) (Fin n) ℂ) + (y : V n) : Matrix (Fin n) (Fin n) ℂ := (frameMatrix B)ᴴ*M (B y)*frameMatrix B + +lemma frameMatrix_mulVec (B : V n →L[ℂ] V n) (v : V n) : frameMatrix B*ᵥv = B v := + LinearMap.toMatrix'_mulVec B.toLinearMap v + +lemma pullMetric_smooth {U : Set (V n)} (hU : IsOpen U) + (B : V n →L[ℂ] V n) {M : V n → Matrix (Fin n) (Fin n) ℂ} + (hM : ContDiffOn ℝ ∞ M U) : ContDiffOn ℝ ∞ (pullMetric B M) (B ⁻¹' U) := by + intro y hy + have hm := (hM.contDiffAt (hU.mem_nhds hy)).comp y (B.restrictScalars ℝ).contDiff.contDiffAt + exact (matrix_smooth_mul (matrix_smooth_mul contDiffAt_const hm) contDiffAt_const).contDiffWithinAt + +lemma wderiv_comp_linear (B : V n →L[ℂ] V n) {f : V n → ℂ} {z : V n} + (hf : DifferentiableAt ℝ f (B z)) (a : ℂ) (v : V n) : + wderiv a v (fun y => f (B y)) z = wderiv a (B v) f (B z) := by + have he := fderiv_fun_comp z hf (B.restrictScalars ℝ).differentiableAt + have hb : fderiv ℝ (fun y => B y) z = B.restrictScalars ℝ := (B.restrictScalars ℝ).fderiv + rw [hb] at he + simp only [wderiv,he,ContinuousLinearMap.comp_apply] + change (fderiv ℝ f (B z) (B v) + a*fderiv ℝ f (B z) (B (Complex.I • v)))/2 = _ + rw [map_smul] + +lemma mderiv_comp_linear (B : V n →L[ℂ] V n) {M : V n → Matrix (Fin n) (Fin n) ℂ} + {z : V n} (hM : ContDiffAt ℝ ∞ M (B z)) (a : ℂ) (v : V n) : + mderiv a v (fun y => M (B y)) z = mderiv a (B v) M (B z) := by + ext i j + exact wderiv_comp_linear B ((entry_smooth hM i j).differentiableAt (by simp)) a v + +lemma mderiv_congruence {M : V n → Matrix (Fin n) (Fin n) ℂ} {z : V n} + (hM : ContDiffAt ℝ ∞ M z) (C D : Matrix (Fin n) (Fin n) ℂ) (a : ℂ) (v : V n) : + mderiv a v (fun y => C*M y*D) z = C*mderiv a v M z*D := by + rw [mderiv_mul (matrix_smooth_mul contDiffAt_const hM) contDiffAt_const, + mderiv_mul contDiffAt_const hM,mderiv_const,mderiv_const] + simp only [zero_mul,mul_zero,zero_add,add_zero] + +lemma mderiv_pullMetric (B : V n →L[ℂ] V n) {M : V n → Matrix (Fin n) (Fin n) ℂ} + {z : V n} (hM : ContDiffAt ℝ ∞ M (B z)) (a : ℂ) (v : V n) : + mderiv a v (pullMetric B M) z = + (frameMatrix B)ᴴ*mderiv a (B v) M (B z)*frameMatrix B := by + unfold pullMetric + rw [mderiv_congruence (show ContDiffAt ℝ ∞ (fun y => M (B y)) z from + hM.comp z (B.restrictScalars ℝ).contDiff.contDiffAt), + mderiv_comp_linear B hM] + +lemma fundamental_pullMetric (B : V n →L[ℂ] V n) + (M : V n → Matrix (Fin n) (Fin n) ℂ) (z u v : V n) : + Anticanonical.ComplexAtlas.fundamentalForm (pullMetric B M z) u v = + Anticanonical.ComplexAtlas.fundamentalForm (M (B z)) (B u) (B v) := by + unfold Anticanonical.ComplexAtlas.fundamentalForm pullMetric + rw [PotentialKaehler.matrix_pair_pullback,frameMatrix_mulVec,frameMatrix_mulVec] + +lemma pullMetric_closed {U : Set (V n)} (hU : IsOpen U) + (B : V n →L[ℂ] V n) {M : V n → Matrix (Fin n) (Fin n) ℂ} + (hM : ContDiffOn ℝ ∞ M U) + (hclosed : ∀ y ∈ U, ∀ u v w : V n, + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (M q) v w) y u + + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (M q) w u) y v + + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (M q) u v) y w = 0) : + ∀ y ∈ B ⁻¹' U, ∀ u v w : V n, + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (pullMetric B M q) v w) y u + + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (pullMetric B M q) w u) y v + + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (pullMetric B M q) u v) y w = 0 := by + intro y hy u v w + simp only [fundamental_pullMetric] + have hd (a b : V n) := (Anticanonical.SourceSmooth.fundamentalForm_smooth + (hM.contDiffAt (hU.mem_nhds hy)) a b).differentiableAt (by simp) + have hb : fderiv ℝ (fun y => B y) y = B.restrictScalars ℝ := (B.restrictScalars ℝ).fderiv + simp only [fderiv_fun_comp y (hd _ _) (B.restrictScalars ℝ).differentiableAt, + hb,ContinuousLinearMap.comp_apply] + exact hclosed (B y) hy (B u) (B v) (B w) + +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/LinearizedCommutator.lean b/lean/OAI/Geometry/PrescribedPotential/LinearizedCommutator.lean new file mode 100644 index 0000000000000000000000000000000000000000..4203359bba3728c03a5a724c3e6f1e481e7b4116 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/LinearizedCommutator.lean @@ -0,0 +1,208 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.BootstrapCalculus +import OAI.Geometry.PrescribedPotential.ClosedRangeSmooth +import OAI.Geometry.PrescribedPotential.RealMapSmooth +import OAI.Geometry.PrescribedPotential.WeakNonlinearCommutator + +namespace OAI + +/-! Linearized Commutator. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) +local instance linComNG (s : ℝ) : NormedAddCommGroup (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedAddCommGroup +local instance linComNS (s : ℝ) : NormedSpace ℝ (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedSpace +local instance linComTG (s : ℝ) : IsTopologicalAddGroup (D.localizers.RealSobolev s) := + Submodule.isTopologicalAddGroup _ +local instance linComCS (s : ℝ) : ContinuousSMul ℝ (D.localizers.RealSobolev s) := + SMulMemClass.continuousSMul _ + +lemma realVolumeDerivative_eq_fderiv (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) : + D.realVolumeDerivative k hk = fderiv ℝ (D.realVolume k hk) := by + funext u + exact (D.realVolume_hasStrictFDerivAt k hk u).hasFDerivAt.fderiv.symm + +lemma realVolumeDerivative_contDiff (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) : + ContDiff ℝ ∞ (D.realVolumeDerivative k hk) := by + rw [D.realVolumeDerivative_eq_fderiv k hk] + exact (D.realVolume_contDiff k hk).fderiv_right (m := ∞) (by simp) + +def realVolumeSecond (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (u w v : D.localizers.RealSobolev ((k : ℝ)+2)) : D.localizers.RealSobolev (k : ℝ) := by + letI : NormedAddCommGroup (D.localizers.RealSobolev ((k : ℝ)+2)) := inferInstance + letI : NormedSpace ℝ (D.localizers.RealSobolev ((k : ℝ)+2)) := inferInstance + letI : NormedAddCommGroup (D.localizers.RealSobolev (k : ℝ)) := inferInstance + letI : NormedSpace ℝ (D.localizers.RealSobolev (k : ℝ)) := inferInstance + exact fderiv ℝ (D.realVolumeDerivative k hk) u w v + +def realRemainderDerivative (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (p : ι) (v : EC d) (u : D.localizers.RealSobolev ((k : ℝ)+2)) : + D.localizers.RealSobolev ((k : ℝ)+2) →L[ℝ] D.localizers.RealSobolev (k : ℝ) := + fderiv ℝ (D.realNonlinearRemainder k hk p v) u + +lemma realVolumeSecond_lower (k l : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (hl : Module.finrank ℝ (EC d) < l) (hlk : l ≤ k) + (u w v : D.localizers.RealSobolev ((k : ℝ)+2)) : + D.realVolumeSecond l hl + (D.localizers.realLower ((k : ℝ)+2) ((l : ℝ)+2) + (by exact_mod_cast Nat.add_le_add_right hlk 2) u) + (D.localizers.realLower ((k : ℝ)+2) ((l : ℝ)+2) + (by exact_mod_cast Nat.add_le_add_right hlk 2) w) + (D.localizers.realLower ((k : ℝ)+2) ((l : ℝ)+2) + (by exact_mod_cast Nat.add_le_add_right hlk 2) v) = + D.localizers.realLower (k : ℝ) (l : ℝ) (by exact_mod_cast hlk) + (D.realVolumeSecond k hk u w v) := by + let : NormedAddCommGroup (D.localizers.RealSobolev ((k : ℝ)+2)) := inferInstance + let : NormedSpace ℝ (D.localizers.RealSobolev ((k : ℝ)+2)) := inferInstance + let : NormedAddCommGroup (D.localizers.RealSobolev ((l : ℝ)+2)) := inferInstance + let : NormedSpace ℝ (D.localizers.RealSobolev ((l : ℝ)+2)) := inferInstance + let : NormedAddCommGroup (D.localizers.RealSobolev (k : ℝ)) := inferInstance + let : NormedSpace ℝ (D.localizers.RealSobolev (k : ℝ)) := inferInstance + let : NormedAddCommGroup (D.localizers.RealSobolev (l : ℝ)) := inferInstance + let : NormedSpace ℝ (D.localizers.RealSobolev (l : ℝ)) := inferInstance + let L := D.localizers.realLower ((k : ℝ)+2) ((l : ℝ)+2) + (by exact_mod_cast Nat.add_le_add_right hlk 2) + let M := D.localizers.realLower (k : ℝ) (l : ℝ) (by exact_mod_cast hlk) + have he : ∀ y z, D.realVolumeDerivative l hl (L y) (L z) = + M (D.realVolumeDerivative k hk y z) := by + intro y z + exact DFunLike.congr_fun (D.realVolumeDerivative_lower k l hk hl hlk y) z + have hB := (D.realVolumeDerivative_contDiff k hk).differentiable (by simp) + have hC := (D.realVolumeDerivative_contDiff l hl).differentiable (by simp) + exact FixedBootstrapCalculus.derivative_compatibility + (D.realVolumeDerivative k hk) (D.realVolumeDerivative l hl) L M hB hC he u w v + +lemma potentialDerivative_lower (k l : ℕ) (hlk : l ≤ k) (p : ι) (v : EC d) + (u : D.localizers.RealSobolev (((k+1 : ℕ) : ℝ)+2)) : + D.potentialDerivative l p v + (D.localizers.realLower (((k+1 : ℕ) : ℝ)+2) (((l+1 : ℕ) : ℝ)+2) + (by exact_mod_cast Nat.add_le_add_right (Nat.add_le_add_right hlk 1) 2) u) = + D.localizers.realLower ((k : ℝ)+2) ((l : ℝ)+2) + (by exact_mod_cast Nat.add_le_add_right hlk 2) (D.potentialDerivative k p v u) := by + have he : (fun u => D.potentialDerivative l p v + (D.localizers.realLower (((k+1 : ℕ) : ℝ)+2) (((l+1 : ℕ) : ℝ)+2) + (by exact_mod_cast Nat.add_le_add_right (Nat.add_le_add_right hlk 1) 2) u)) = + (fun u => D.localizers.realLower ((k : ℝ)+2) ((l : ℝ)+2) + (by exact_mod_cast Nat.add_le_add_right hlk 2) (D.potentialDerivative k p v u)) := by + apply (D.localizers.realEmbed_dense (((k+1 : ℕ) : ℝ)+2)).equalizer + (by fun_prop) (by fun_prop) + funext f + simp only [Function.comp_apply, Localizers.realLower_embed, potentialDerivative_embed] + exact congr_fun he u + +lemma densityDerivative_lower (k l : ℕ) (hlk : l ≤ k) (p : ι) (v : EC d) + (u : D.localizers.RealSobolev ((k+1 : ℕ) : ℝ)) : + D.densityDerivative l p v + (D.localizers.realLower ((k+1 : ℕ) : ℝ) ((l+1 : ℕ) : ℝ) + (by exact_mod_cast Nat.add_le_add_right hlk 1) u) = + D.localizers.realLower (k : ℝ) (l : ℝ) (by exact_mod_cast hlk) + (D.densityDerivative k p v u) := by + have he : (fun u => D.densityDerivative l p v + (D.localizers.realLower ((k+1 : ℕ) : ℝ) ((l+1 : ℕ) : ℝ) + (by exact_mod_cast Nat.add_le_add_right hlk 1) u)) = + (fun u => D.localizers.realLower (k : ℝ) (l : ℝ) (by exact_mod_cast hlk) + (D.densityDerivative k p v u)) := by + apply (D.localizers.realEmbed_dense ((k+1 : ℕ) : ℝ)).equalizer + (by fun_prop) (by fun_prop) + funext f + simp only [Function.comp_apply, Localizers.realLower_embed, densityDerivative_embed] + exact congr_fun he u + + +lemma nonlinear_commutator_linearization (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (p : ι) (v : EC d) (u w : D.localizers.RealSobolev (((k+1 : ℕ) : ℝ)+2)) : + D.realVolumeDerivative k hk + (D.localizers.realLower (((k+1 : ℕ) : ℝ)+2) ((k : ℝ)+2) (by push_cast; linarith) u) + (D.potentialDerivative k p v w) + + D.realVolumeSecond k hk + (D.localizers.realLower (((k+1 : ℕ) : ℝ)+2) ((k : ℝ)+2) (by push_cast; linarith) u) + (D.localizers.realLower (((k+1 : ℕ) : ℝ)+2) ((k : ℝ)+2) (by push_cast; linarith) w) + (D.potentialDerivative k p v u) = + D.densityDerivative k p v (D.realVolumeDerivative (k+1) (by omega) u w) + + D.localizers.realLower ((k+1 : ℕ) : ℝ) (k : ℝ) (by push_cast; linarith) + (D.realRemainderDerivative (k+1) (by omega) p v u w) := by + let : NormedAddCommGroup (D.localizers.RealSobolev (((k+1 : ℕ) : ℝ)+2)) := inferInstance + let : NormedSpace ℝ (D.localizers.RealSobolev (((k+1 : ℕ) : ℝ)+2)) := inferInstance + let : NormedAddCommGroup (D.localizers.RealSobolev ((k : ℝ)+2)) := inferInstance + let : NormedSpace ℝ (D.localizers.RealSobolev ((k : ℝ)+2)) := inferInstance + let : NormedAddCommGroup (D.localizers.RealSobolev ((k+1 : ℕ) : ℝ)) := inferInstance + let : NormedSpace ℝ (D.localizers.RealSobolev ((k+1 : ℕ) : ℝ)) := inferInstance + let : NormedAddCommGroup (D.localizers.RealSobolev (k : ℝ)) := inferInstance + let : NormedSpace ℝ (D.localizers.RealSobolev (k : ℝ)) := inferInstance + let : NormedAddCommGroup (D.localizers.RealSobolev ((k : ℝ)+2) →L[ℝ] + D.localizers.RealSobolev (k : ℝ)) := inferInstance + let : NormedSpace ℝ (D.localizers.RealSobolev ((k : ℝ)+2) →L[ℝ] + D.localizers.RealSobolev (k : ℝ)) := inferInstance + have hF : fderiv ℝ (D.realVolume (k+1) (by omega)) u = + D.realVolumeDerivative (k+1) (by omega) u := + (D.realVolume_hasStrictFDerivAt (k+1) (by omega) u).hasFDerivAt.fderiv + have hh := FixedBootstrapCalculus.differentiated_commutator + (D.realVolumeDerivative k hk) + (D.localizers.realLower (((k+1 : ℕ) : ℝ)+2) ((k : ℝ)+2) (by push_cast; linarith)) + (D.potentialDerivative k p v) (D.densityDerivative k p v) + (D.localizers.realLower ((k+1 : ℕ) : ℝ) (k : ℝ) (by push_cast; linarith)) + (D.realVolume (k+1) (by omega)) (D.realNonlinearRemainder (k+1) (by omega) p v) + ((D.realVolumeDerivative_contDiff k hk).differentiable (by simp)) + ((D.realVolume_contDiff (k+1) (by omega)).differentiable (by simp)) + ((D.realNonlinearRemainder_contDiff (k+1) (by omega) p v).differentiable (by simp)) + (D.nonlinear_commutator_weak k hk p v) u w + rw [hF] at hh + exact hh + +lemma secondPotential_lower (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (p : ι) (v : EC d) (u : D.localizers.RealSobolev (((k+2 : ℕ) : ℝ)+2)) + (w : D.localizers.RealSobolev (((k+1 : ℕ) : ℝ)+2)) : + let u₁ := D.localizers.realLower (((k+2 : ℕ) : ℝ)+2) (((k+1 : ℕ) : ℝ)+2) (by push_cast; linarith) u + let L := D.localizers.realLower (((k+1 : ℕ) : ℝ)+2) ((k : ℝ)+2) (by push_cast; linarith) + D.realVolumeSecond k hk (L u₁) (L w) (D.potentialDerivative k p v u₁) = + D.localizers.realLower ((k+1 : ℕ) : ℝ) (k : ℝ) (by push_cast; linarith) + (D.realVolumeSecond (k+1) (by omega) u₁ w (D.potentialDerivative (k+1) p v u)) := by + dsimp only + let u₁ := D.localizers.realLower (((k+2 : ℕ) : ℝ)+2) (((k+1 : ℕ) : ℝ)+2) (by push_cast; linarith) u + let L := D.localizers.realLower (((k+1 : ℕ) : ℝ)+2) ((k : ℝ)+2) (by push_cast; linarith) + have hd := D.potentialDerivative_lower (k+1) k (by omega) p v u + have ht := congrArg (D.realVolumeSecond k hk (L u₁) (L w)) hd + exact ht.trans (D.realVolumeSecond_lower (k+1) k (by omega) hk (by omega) + u₁ w (D.potentialDerivative (k+1) p v u)) + + + +lemma linearized_commutator_weak (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (p : ι) (v : EC d) (u : D.localizers.RealSobolev (((k+2 : ℕ) : ℝ)+2)) + (w : D.localizers.RealSobolev (((k+1 : ℕ) : ℝ)+2)) : + let u₁ := D.localizers.realLower (((k+2 : ℕ) : ℝ)+2) (((k+1 : ℕ) : ℝ)+2) (by push_cast; linarith) u + D.realVolumeDerivative k hk + (D.localizers.realLower (((k+1 : ℕ) : ℝ)+2) ((k : ℝ)+2) (by push_cast; linarith) u₁) + (D.potentialDerivative k p v w) = + D.densityDerivative k p v (D.realVolumeDerivative (k+1) (by omega) u₁ w) + + D.localizers.realLower ((k+1 : ℕ) : ℝ) (k : ℝ) (by push_cast; linarith) + (D.realRemainderDerivative (k+1) (by omega) p v u₁ w - + D.realVolumeSecond (k+1) (by omega) u₁ w + (D.potentialDerivative (k+1) p v u)) := by + dsimp only + let u₁ := D.localizers.realLower (((k+2 : ℕ) : ℝ)+2) (((k+1 : ℕ) : ℝ)+2) (by push_cast; linarith) u + exact FixedBootstrapCalculus.lowered_remainder + (D.localizers.realLower ((k+1 : ℕ) : ℝ) (k : ℝ) (by push_cast; linarith)) _ _ _ _ _ + (D.nonlinear_commutator_linearization k hk p v u₁ w) + (D.secondPotential_lower k hk p v u w) + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/LiteralWeakHessian.lean b/lean/OAI/Geometry/PrescribedPotential/LiteralWeakHessian.lean new file mode 100644 index 0000000000000000000000000000000000000000..1c05a2dc090c5781fd20fed82e0de81003345b59 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/LiteralWeakHessian.lean @@ -0,0 +1,203 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalHessian +import OAI.Geometry.PrescribedPotential.GlobalStrongEmbedding +import OAI.Geometry.PrescribedPotential.StrongDerivatives + +namespace OAI + +/-! Literal Weak Hessian. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory LineDeriv +open scoped ContDiff SchwartzMap Classical BoundedContinuousFunction +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +def schwartzCoordLinear (s : ℝ) : 𝓢(E,ℂ) →ₗ[ℝ] L2 E where + toFun := schwartzCoord s + map_add' := schwartzCoord_add s + map_smul' c f := by + change schwartzCoord s (c • f) = c • schwartzCoord s f + rw [RCLike.real_smul_eq_coe_smul (K := ℂ), schwartzCoord_smul, + RCLike.real_smul_eq_coe_smul (K := ℂ)] + +end SobolevChart +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] + + +def literalComplexHessian (f : EC d → ℂ) (x : EC d) (i j : Fin d) : ℂ := + (1/4 : ℂ) * (fderiv ℝ (fderiv ℝ f) x (hessianDirection i) (hessianDirection j) + + fderiv ℝ (fderiv ℝ f) x (hessianIDirection i) (hessianIDirection j) + + Complex.I * (fderiv ℝ (fderiv ℝ f) x (hessianIDirection i) (hessianDirection j) - + fderiv ℝ (fderiv ℝ f) x (hessianDirection i) (hessianIDirection j))) + +lemma literalComplexHessian_schwartz (f : 𝓢(EC d,ℂ)) (x : EC d) (i j : Fin d) : + literalComplexHessian f x i j = hessianEntrySchwartz i j f x := + (hessianEntrySchwartz_apply i j f x).symm + +lemma literalComplexHessian_congr {f h : EC d → ℂ} {x : EC d} + (he : f =ᶠ[𝓝 x] h) (i j : Fin d) : + literalComplexHessian f x i j = literalComplexHessian h x i j := by + unfold literalComplexHessian + rw [(he.fderiv (𝕜 := ℝ)).fderiv_eq] + +lemma literalComplexHessian_strong_continuous (s : ℝ) + (hs : (Module.finrank ℝ (EC d) : ℝ) < 2*s) + (hN : (Module.finrank ℝ (EC d) : ℝ) < 2*(s-4)) (x : EC d) (i j : Fin d) : + Continuous (fun u : L2 (EC d) => literalComplexHessian (strongEmbedding s hs u) x i j) := by + have h1 : (Module.finrank ℝ (EC d) : ℝ) < 2*(s-1) := by linarith + have h2 : (Module.finrank ℝ (EC d) : ℝ) < 2*((s-1)-1) := by linarith + simp only [literalComplexHessian, strong_second_fderiv s hs h1 h2 hN] + fun_prop + +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +def completedLocalize (s : ℝ) (i : Fin A.count) (ρ : Smooth A) + (hρ : tsupport (ρ : X → ℂ) ⊆ (A.euclideanChart i).source) : + D.localizers.Sobolev s →L[ℝ] L2 (EC d) := + ((schwartzCoordLinear s).comp (localizeLinear A i ρ hρ)).extendOfNorm (D.localizers.embed s) + +lemma completedLocalize_embed (k : ℕ) (i : Fin A.count) (ρ : Smooth A) + (hρ : tsupport (ρ : X → ℂ) ⊆ (A.euclideanChart i).source) (f : Smooth A) : + D.completedLocalize (k : ℝ) i ρ hρ (D.localizers.embed (k : ℝ) f) = + schwartzCoord (k : ℝ) (localize A i ρ hρ f) := by + obtain ⟨C,_,hC⟩ := D.localization_integer_bound i ρ hρ k + exact LinearMap.extendOfNorm_eq (D.localizers.embed_dense (k : ℝ)) ⟨C,hC⟩ f + +lemma completedLocalize_plus_two_embed (k : ℕ) (i : Fin A.count) (ρ : Smooth A) + (hρ : tsupport (ρ : X → ℂ) ⊆ (A.euclideanChart i).source) (f : Smooth A) : + D.completedLocalize ((k : ℝ)+2) i ρ hρ (D.localizers.embed ((k : ℝ)+2) f) = + schwartzCoord ((k : ℝ)+2) (localize A i ρ hρ f) := by + obtain ⟨C,_,hC⟩ := D.localization_integer_bound i ρ hρ (k+2) + rw [Nat.cast_add, Nat.cast_ofNat] at hC + exact LinearMap.extendOfNorm_eq (D.localizers.embed_dense ((k : ℝ)+2)) ⟨C,hC⟩ f + +lemma completedLocalize_strong (k : ℕ) + (hs : (Module.finrank ℝ (EC d) : ℝ) < 2*(k : ℝ)) + (i : Fin A.count) (ρ : Smooth A) + (hρ : tsupport (ρ : X → ℂ) ⊆ (A.euclideanChart i).source) + (u : D.localizers.Sobolev (k : ℝ)) (y : EC d) : + strongEmbedding (k : ℝ) hs (D.completedLocalize (k : ℝ) i ρ hρ u) y = + if y ∈ (A.euclideanChart i).target then + ρ ((A.euclideanChart i).symm y) * D.localizers.strong (k : ℝ) u ((A.euclideanChart i).symm y) + else 0 := by + have he : (fun u : D.localizers.Sobolev (k : ℝ) => + strongEmbedding (k : ℝ) hs (D.completedLocalize (k : ℝ) i ρ hρ u) y) = + (fun u => if y ∈ (A.euclideanChart i).target then + ρ ((A.euclideanChart i).symm y) * D.localizers.strong (k : ℝ) u ((A.euclideanChart i).symm y) + else 0) := by + apply (D.localizers.embed_dense (k : ℝ)).equalizer + · fun_prop + · split_ifs <;> fun_prop + funext f + dsimp only [Function.comp_apply] + rw [D.completedLocalize_embed, strongEmbedding_schwartz, D.localizers.strong_embed _ hs] + rfl + exact congr_fun he u + +lemma completedLocalize_plus_two_strong (k : ℕ) + (hs : (Module.finrank ℝ (EC d) : ℝ) < 2*((k : ℝ)+2)) + (i : Fin A.count) (ρ : Smooth A) + (hρ : tsupport (ρ : X → ℂ) ⊆ (A.euclideanChart i).source) + (u : D.localizers.Sobolev ((k : ℝ)+2)) (y : EC d) : + strongEmbedding ((k : ℝ)+2) hs (D.completedLocalize ((k : ℝ)+2) i ρ hρ u) y = + if y ∈ (A.euclideanChart i).target then + ρ ((A.euclideanChart i).symm y) * D.localizers.strong ((k : ℝ)+2) u ((A.euclideanChart i).symm y) + else 0 := by + have he : (fun u : D.localizers.Sobolev ((k : ℝ)+2) => + strongEmbedding ((k : ℝ)+2) hs (D.completedLocalize ((k : ℝ)+2) i ρ hρ u) y) = + (fun u => if y ∈ (A.euclideanChart i).target then + ρ ((A.euclideanChart i).symm y) * D.localizers.strong ((k : ℝ)+2) u ((A.euclideanChart i).symm y) + else 0) := by + apply (D.localizers.embed_dense ((k : ℝ)+2)).equalizer + · fun_prop + · split_ifs <;> fun_prop + funext f + dsimp only [Function.comp_apply] + rw [D.completedLocalize_plus_two_embed, strongEmbedding_schwartz, + D.localizers.strong_embed _ hs] + rfl + exact congr_fun he u + +lemma completedHessian_strong_localize (k : ℕ) + (hk : (Module.finrank ℝ (EC d) : ℝ) < 2*(k : ℝ)) + (hs : (Module.finrank ℝ (EC d) : ℝ) < 2*((k : ℝ)+2)) + (hN : (Module.finrank ℝ (EC d) : ℝ) < 2*((k : ℝ)+2-4)) + (u : D.localizers.Sobolev ((k : ℝ)+2)) (p : ι) (i j : Fin d) + {x : X} (hx : x ∈ (A.euclideanChart (D.patch p).index).source) : + D.localizers.strong (k : ℝ) (D.completedHessian k p i j u) x = + D.cutoff p (A.euclideanChart (D.patch p).index x) * + literalComplexHessian (strongEmbedding ((k : ℝ)+2) hs + (D.completedLocalize ((k : ℝ)+2) (D.patch p).index + (cutoffGlobal (D.patch p).index (D.outerCutoff p)) (cutoffGlobal_support _ _) u)) + (A.euclideanChart (D.patch p).index x) i j := by + have he : (fun u : D.localizers.Sobolev ((k : ℝ)+2) => + D.localizers.strong (k : ℝ) (D.completedHessian k p i j u) x) = + (fun u => D.cutoff p (A.euclideanChart (D.patch p).index x) * + literalComplexHessian (strongEmbedding ((k : ℝ)+2) hs + (D.completedLocalize ((k : ℝ)+2) (D.patch p).index + (cutoffGlobal (D.patch p).index (D.outerCutoff p)) (cutoffGlobal_support _ _) u)) + (A.euclideanChart (D.patch p).index x) i j) := by + apply (D.localizers.embed_dense ((k : ℝ)+2)).equalizer + · fun_prop + · exact continuous_const.mul ((literalComplexHessian_strong_continuous _ hs hN _ i j).comp + (D.completedLocalize ((k : ℝ)+2) _ _ _).continuous) + funext f + dsimp only [Function.comp_apply] + rw [D.completedHessian_embed, D.localizers.strong_embed _ hk, + D.completedLocalize_plus_two_embed, strongEmbedding_schwartz] + change globalize (D.patch p).index (D.cutoff p) _ x = + D.cutoff p (A.euclideanChart (D.patch p).index x) * + literalComplexHessian (localize A (D.patch p).index + (cutoffGlobal (D.patch p).index (D.outerCutoff p)) (cutoffGlobal_support _ _) f) + (A.euclideanChart (D.patch p).index x) i j + rw [literalComplexHessian_schwartz, globalize_apply, ite_eq_left hx] + rfl + exact congr_fun he u + +lemma completedHessian_literal (k : ℕ) + (hk : (Module.finrank ℝ (EC d) : ℝ) < 2*(k : ℝ)) + (hs : (Module.finrank ℝ (EC d) : ℝ) < 2*((k : ℝ)+2)) + (hN : (Module.finrank ℝ (EC d) : ℝ) < 2*((k : ℝ)+2-4)) + (u : D.localizers.Sobolev ((k : ℝ)+2)) (p : ι) (i j : Fin d) + {x : X} (hx : x ∈ tsupport (D.localizers.weight p : X → ℂ)) : + D.localizers.strong (k : ℝ) (D.completedHessian k p i j u) x = + literalComplexHessian ((D.localizers.strong ((k : ℝ)+2) u) ∘ + (A.euclideanChart (D.patch p).index).symm) + (A.euclideanChart (D.patch p).index x) i j := by + let q := (D.patch p).index + let e := A.euclideanChart q + have hx' : x ∈ e.source := by + have hh := D.localizers.support_sub p hx + rwa [D.index_eq] at hh + have hcut := D.cutoff_one p x hx + rw [D.completedHessian_strong_localize k hk hs hN u p i j hx', hcut, one_mul] + apply literalComplexHessian_congr + have ht : e x ∈ e.target := e.mapsTo hx' + have hn : ∀ᶠ y in 𝓝 (e x), D.cutoff p y ≠ 0 := + (isOpen_ne_fun (D.cutoff p).val.continuous continuous_const).mem_nhds + (by change D.cutoff p (e x) ≠ 0; rw [hcut]; exact one_ne_zero) + filter_upwards [e.open_target.mem_nhds ht, hn] with y hy hny + rw [D.completedLocalize_plus_two_strong, ite_eq_left hy] + change (if e.symm y ∈ e.source then D.outerCutoff p (e (e.symm y)) else 0) * + D.localizers.strong ((k : ℝ)+2) u (e.symm y) = _ + rw [ite_eq_left (e.mapsTo_symm hy), e.right_inv hy, + D.outerCutoff_one p y (subset_tsupport _ hny), one_mul] + rfl + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/LocalPotentialABP.lean b/lean/OAI/Geometry/PrescribedPotential/LocalPotentialABP.lean new file mode 100644 index 0000000000000000000000000000000000000000..1ad91248352905fa973a6c0876354fb89c8b9bbe --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/LocalPotentialABP.lean @@ -0,0 +1,117 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.ComplexContactDeterminant +import OAI.Geometry.PrescribedPotential.ContactSetABP +import OAI.Geometry.PrescribedPotential.QuadraticContact + +namespace OAI + +/-! Local Potential A B P. -/ + +section + + + +noncomputable section +open Matrix Set Filter Topology Metric MeasureTheory +open scoped InnerProductSpace ContDiff +namespace PotentialABP +variable {d : ℕ} +local notation "E" => EuclideanSpace ℂ (Fin d) +local instance localPotentialABPRealInnerProductSpace (d : ℕ) : + InnerProductSpace ℝ (EuclideanSpace ℂ (Fin d)) := + InnerProductSpace.rclikeToReal ℂ (EuclideanSpace ℂ (Fin d)) +local notation "e" => EuclideanSpace.equiv (Fin d) ℂ + +lemma quadratic_levi_pair {f : (Fin d → ℂ) → ℝ} (hf : ContDiff ℝ ∞ f) + (c x v : E) (δ : ℝ) : + let u : E → ℝ := fun y => f (e y) + δ*‖y-c‖^2 + fderiv ℝ (fderiv ℝ u) x v v + + fderiv ℝ (fderiv ℝ u) x (Complex.I • v) (Complex.I • v) = + 4 * inner ℝ ((PotentialKaehler.potentialMatrix f (e x)).toEuclideanLin v) v + + 4*δ*‖v‖^2 := by + let er := (EuclideanSpace.equiv (Fin d) ℂ).toContinuousLinearMap.restrictScalars ℝ + have he : ContDiff ℝ ∞ (f ∘ e) := hf.comp er.contDiff + change ContDiff ℝ ∞ (fun y : E => f (e y)) at he + dsimp only + rw [quadratic_add_hessian he, quadratic_add_hessian he] + have hi : inner ℝ (Complex.I • v) (Complex.I • v) = ‖v‖^2 := by + simp [norm_smul] + rw [real_inner_self_eq_norm_sq, hi] + have hp := levi_coord_pair hf x v + dsimp only [Function.comp_def] at hp + linarith + +lemma quadratic_contact_det {f : (Fin d → ℂ) → ℝ} (hf : ContDiff ℝ ∞ f) + (c x : E) (δ : ℝ) (G : Matrix (Fin d) (Fin d) ℂ) (hG : G.IsHermitian) + (hGδ : ∀ v : E, δ * ‖v‖^2 ≤ inner ℝ (G.toEuclideanLin v) v) + (hB : ∀ v : E, 0 ≤ fderiv ℝ (fderiv ℝ + (fun y : E => f (e y) + δ*‖y-c‖^2)) x v v) : + |(fderiv ℝ (gradient (fun y : E => f (e y) + δ*‖y-c‖^2)) x).det| ≤ + (4:ℝ)^(2*d) * (G + PotentialKaehler.potentialMatrix f (e x)).det.re^2 := by + let er := (EuclideanSpace.equiv (Fin d) ℂ).toContinuousLinearMap.restrictScalars ℝ + have hu : ContDiff ℝ ∞ (fun y : E => f (e y) + δ*‖y-c‖^2) := + (hf.comp er.contDiff).add (contDiff_const.mul + ((contDiff_id.sub contDiff_const).norm_sq ℝ)) + apply gradient_det_le_hermitian hu hB _ + (hG.add (PotentialKaehler.potentialMatrix_hermitian hf.contDiffAt)) + intro v + have hp := quadratic_levi_pair hf c x v δ + have hb := hB (Complex.I • v) + have hg := hGδ v + rw [map_add, LinearMap.add_apply, inner_add_left] + linarith + + + +theorem local_potential_sublevel_volume + (μ : Measure E) [μ.IsAddHaarMeasure] + {f : (Fin d → ℂ) → ℝ} (hf : ContDiff ℝ ∞ f) + (G : E → Matrix (Fin d) (Fin d) ℂ) + {c : E} {r δ K : ℝ} (hr : 0 < r) (hδ : 0 < δ) (hK : 0 ≤ K) + (hmin : ∀ x ∈ closedBall c r, f (e c) ≤ f (e x)) + (hG : ∀ x ∈ closedBall c r, (G x).IsHermitian) + (hGδ : ∀ x ∈ closedBall c r, ∀ v : E, + δ*‖v‖^2 ≤ inner ℝ ((G x).toEuclideanLin v) v) + (hdet : ∀ x ∈ closedBall c r, + |(G x + PotentialKaehler.potentialMatrix f (e x)).det.re| ≤ K) : + μ (closedBall (0:E) (δ*r/2)) ≤ ENNReal.ofReal ((4:ℝ)^(2*d)*K^2) * + μ {x | x ∈ closedBall c r ∧ f (e x) ≤ f (e c) + δ*r^2/2} := by + let u : E → ℝ := fun y => f (e y) + δ*‖y-c‖^2 + let er := (EuclideanSpace.equiv (Fin d) ℂ).toContinuousLinearMap.restrictScalars ℝ + have hu : ContDiff ℝ ∞ u := (hf.comp er.contDiff).add + (contDiff_const.mul ((contDiff_id.sub contDiff_const).norm_sq ℝ)) + have ha : 0 ≤ δ*r/2 := by positivity + have hgap : δ*r/2*r < δ*r^2 := by nlinarith [mul_pos hδ (sq_pos_of_pos hr)] + have hboundary : ∀ x, dist x c = r → u c + δ*r^2 ≤ u x := by + intro x hx + have hm := hmin x (by change dist x c ≤ r; exact hx.le) + simp only [u, ← dist_eq_norm, hx, dist_self, zero_pow (by decide : 2 ≠ 0), + mul_zero, add_zero] + linarith + have hi := contacts_interior hr ha hgap hboundary + have hlocal : μ (closedBall (0:E) (δ*r/2)) ≤ + ENNReal.ofReal ((4:ℝ)^(2*d)*K^2) * μ (contacts u c r (δ*r/2)) := by + apply contact_measure_estimate μ hu hr ha hgap hboundary + intro x hx + have hd := quadratic_contact_det hf c x δ (G x) (hG x hx.1) + (hGδ x hx.1) (contacts_hessian_nonneg hu hx (hi hx)) + apply hd.trans + apply mul_le_mul_of_nonneg_left _ (by positivity) + simpa only [sq_abs] using (sq_le_sq₀ (abs_nonneg _) hK).mpr (hdet x hx.1) + apply hlocal.trans + apply mul_le_mul_of_nonneg_left _ zero_le + apply measure_mono + intro x hx + refine ⟨hx.1, ?_⟩ + have hs := contacts_sublevel hr.le ha hx + have hn : 0 ≤ δ*‖x-c‖^2 := by positivity + simp only [u, sub_self, norm_zero, zero_pow (by decide : 2 ≠ 0), mul_zero, + add_zero] at hs + nlinarith + +end PotentialABP + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/LocalRegularity.lean b/lean/OAI/Geometry/PrescribedPotential/LocalRegularity.lean new file mode 100644 index 0000000000000000000000000000000000000000..6d7b769c477e00508396812e0702d752b9cd416f --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/LocalRegularity.lean @@ -0,0 +1,539 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.SobolevLocalization +import OAI.Geometry.PrescribedPotential.VariablePoisson + +namespace OAI + +/-! Local Regularity. -/ + +section + + + +noncomputable section +open Filter Topology MeasureTheory FourierTransform TemperedDistribution LineDeriv +open scoped SchwartzMap BoundedContinuousFunction ContDiff Real ComplexOrder MatrixOrder + +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +lemma schwartz_distribution_injective : + Function.Injective (SchwartzMap.toTemperedDistributionCLM E ℂ volume) := by + intro f g h + apply SchwartzMap.injective_toLp 2 volume + apply l2_injective + simpa only [Lp.toTemperedDistributionCLM_apply, + Lp.toTemperedDistribution_toLp_eq] using h + + +def schwartzCoord (s : ℝ) (f : 𝓢(E, ℂ)) : L2 E := + ((memSobolev_iff_realize s (f : 𝓢'(E, ℂ))).mp f.memSobolev).choose + +lemma realize_schwartzCoord (s : ℝ) (f : 𝓢(E, ℂ)) : + realize s (schwartzCoord s f) = (f : 𝓢'(E, ℂ)) := + ((memSobolev_iff_realize s (f : 𝓢'(E, ℂ))).mp f.memSobolev).choose_spec + +lemma schwartzCoord_add (s : ℝ) (f g : 𝓢(E, ℂ)) : + schwartzCoord s (f + g) = schwartzCoord s f + schwartzCoord s g := by + apply realize_injective s + simp only [map_add, realize_schwartzCoord] + +lemma schwartzCoord_sum {ι : Type*} (s : ℝ) (S : Finset ι) (f : ι → 𝓢(E, ℂ)) : + schwartzCoord s (∑ i ∈ S, f i) = ∑ i ∈ S, schwartzCoord s (f i) := by + apply realize_injective s + simp only [map_sum, realize_schwartzCoord] + + +lemma weak_deriv_comm (v w : E) (u : 𝓢'(E, ℂ)) : + ∂_{v} (∂_{w} u) = ∂_{w} (∂_{v} u) := by + rw [FrozenPoisson.second_deriv_multiplier, FrozenPoisson.second_deriv_multiplier] + congr 2 + ext x + ring + +lemma schwartz_deriv_comm (v w : E) (u : 𝓢(E, ℂ)) : + ∂_{v} (∂_{w} u) = ∂_{w} (∂_{v} u) := by + apply schwartz_distribution_injective + change ((∂_{v} (∂_{w} u) : 𝓢(E, ℂ)) : 𝓢'(E, ℂ)) = _ + rw [← lineDerivOp_toTemperedDistributionCLM_eq, + ← lineDerivOp_toTemperedDistributionCLM_eq, + ← lineDerivOp_toTemperedDistributionCLM_eq, + ← lineDerivOp_toTemperedDistributionCLM_eq] + exact weak_deriv_comm v w (u : 𝓢'(E, ℂ)) + + +lemma summable_of_contracting_recurrence {a b : ℕ → ℝ} {q : ℝ} + (ha : ∀ n, 0 ≤ a n) (hb : ∀ n, 0 ≤ b n) (hq : q < 1) + (hs : Summable b) (hrecur : ∀ n, a (n+1) ≤ q * a n + b n) : + Summable a := by + apply summable_of_sum_range_le ha (c := (a 0 + ∑' n, b n) / (1 - q)) + intro N + have hr := Finset.sum_le_sum (s := Finset.range N) (fun n _ => hrecur n) + rw [Finset.sum_add_distrib, ← Finset.mul_sum] at hr + have he : (∑ n ∈ Finset.range N, a (n+1)) = + (∑ n ∈ Finset.range N, a n) + a N - a 0 := by + have h := Finset.sum_range_succ' a N + rw [Finset.sum_range_succ] at h + linarith + rw [he] at hr + have hbnd : (∑ n ∈ Finset.range N, b n) ≤ ∑' n, b n := + hs.sum_le_tsum (Finset.range N) (fun _ _ => hb _) + rw [le_div_iff₀ (sub_pos.mpr hq)] + nlinarith [ha N] + +end SobolevChart + +namespace FrozenPoisson +open SobolevChart EllipticKernel +variable {n : ℕ} + +def schwartzResolvent (H : Matrix (Fin n) (Fin n) ℂ) : + 𝓢(EC n, ℂ) →L[ℂ] 𝓢(EC n, ℂ) := + SchwartzMap.fourierMultiplierCLM ℂ (inverseSymbol H) + +lemma schwartzResolvent_distribution (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (f : 𝓢(EC n, ℂ)) : + SchwartzMap.toTemperedDistributionCLM (EC n) ℂ volume (schwartzResolvent H f) = + resolvent H (SchwartzMap.toTemperedDistributionCLM (EC n) ℂ volume f) := + (fourierMultiplierCLM_toTemperedDistributionCLM_eq (inverseSymbol_temperate H hH) f).symm + +lemma schwartzCoord_resolvent (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (s : ℝ) (f : 𝓢(EC n, ℂ)) : + schwartzCoord (s + 2) (schwartzResolvent H f) = + hilbertResolvent H hH (schwartzCoord s f) := by + apply realize_injective (s + 2) + rw [realize_schwartzCoord, hilbertResolvent_realize, realize_schwartzCoord] + exact schwartzResolvent_distribution H hH f + +lemma weak_deriv_resolvent (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (v : EC n) (u : 𝓢'(EC n, ℂ)) : + ∂_{v} (resolvent H u) = resolvent H (∂_{v} u) := by + simp only [lineDeriv_eq_fourierMultiplierCLM, resolvent, map_smul] + rw [fourierMultiplierCLM_fourierMultiplierCLM_apply + (inverseSymbol_temperate H hH) (by fun_prop), + fourierMultiplierCLM_fourierMultiplierCLM_apply (by fun_prop) + (inverseSymbol_temperate H hH)] + simp only [mul_comm] + +lemma schwartz_deriv_resolvent (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (v : EC n) (f : 𝓢(EC n, ℂ)) : + ∂_{v} (schwartzResolvent H f) = schwartzResolvent H (∂_{v} f) := by + apply schwartz_distribution_injective + rw [← lineDerivOp_toTemperedDistributionCLM_eq, schwartzResolvent_distribution H hH, + schwartzResolvent_distribution H hH, ← lineDerivOp_toTemperedDistributionCLM_eq] + exact weak_deriv_resolvent H hH v (SchwartzMap.toTemperedDistributionCLM (EC n) ℂ volume f) + +end FrozenPoisson + +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +lemma schwartz_product_distribution (a f : 𝓢(E, ℂ)) : + ((SchwartzMap.smulLeftCLM ℂ a f : 𝓢(E, ℂ)) : 𝓢'(E, ℂ)) = + smulLeftCLM ℂ a (f : 𝓢'(E, ℂ)) := by + ext φ + simp only [SchwartzMap.toTemperedDistributionCLM_apply_apply, + smulLeftCLM_apply_apply] + apply integral_congr_ae + filter_upwards [] with x + simp only [SchwartzMap.smulLeftCLM_apply_apply a.hasTemperateGrowth, smul_eq_mul] + ring + + +def schwartzWord : List E → (𝓢(E, ℂ) →L[ℂ] 𝓢(E, ℂ)) + | [] => ContinuousLinearMap.id ℂ _ + | v :: vs => lineDerivOpCLM ℂ 𝓢(E, ℂ) v ∘L schwartzWord vs + +def weakWord : List E → (𝓢'(E, ℂ) →L[ℂ] 𝓢'(E, ℂ)) + | [] => ContinuousLinearMap.id ℂ _ + | v :: vs => lineDerivOpCLM ℂ 𝓢'(E, ℂ) v ∘L weakWord vs + +lemma word_distribution (vs : List E) (f : 𝓢(E, ℂ)) : + ((schwartzWord vs f : 𝓢(E, ℂ)) : 𝓢'(E, ℂ)) = weakWord vs (f : 𝓢'(E, ℂ)) := by + induction vs with + | nil => rfl + | cons v vs ih => + change ((∂_{v} (schwartzWord vs f) : 𝓢(E, ℂ)) : 𝓢'(E, ℂ)) = _ + rw [← lineDerivOp_toTemperedDistributionCLM_eq, ih] + rfl + +variable {ι : Type*} [Fintype ι] +abbrev SmoothCoefficients (ι : Type*) (E : Type*) [NormedAddCommGroup E] [NormedSpace ℝ E] := + ι → ι → 𝓢(E, ℂ) + +def coefficientBCF (a : SmoothCoefficients ι E) (i j : ι) : E →ᵇ ℂ := + (a i j).toBoundedContinuousFunction + +def coefficientDeriv (w : E) (a : SmoothCoefficients ι E) : SmoothCoefficients ι E := + fun i j => ∂_{w} (a i j) + +def smoothPerturbation (v : ι → E) (a : SmoothCoefficients ι E) : + 𝓢(E, ℂ) →L[ℂ] 𝓢(E, ℂ) := + ∑ i, ∑ j, SchwartzMap.smulLeftCLM ℂ (a i j) ∘L + lineDerivOpCLM ℂ 𝓢(E, ℂ) (v i) ∘L lineDerivOpCLM ℂ 𝓢(E, ℂ) (v j) + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma smoothPerturbation_apply (v : ι → E) (a : SmoothCoefficients ι E) (f : 𝓢(E, ℂ)) : + smoothPerturbation v a f = + ∑ i, ∑ j, SchwartzMap.smulLeftCLM ℂ (a i j) (∂_{v i} (∂_{v j} f)) := by + simp only [smoothPerturbation, _root_.sum_apply, + ContinuousLinearMap.comp_apply, lineDerivOpCLM_apply] + +lemma smoothPerturbation_distribution (v : ι → E) (a : SmoothCoefficients ι E) + (f : 𝓢(E, ℂ)) : + ((smoothPerturbation v a f : 𝓢(E, ℂ)) : 𝓢'(E, ℂ)) = + (perturbation v (coefficientBCF a) (schwartzCoord 2 f) : 𝓢'(E, ℂ)) := by + rw [perturbation_distribution v _ (fun i j => (a i j).hasTemperateGrowth), + realize_schwartzCoord, smoothPerturbation_apply] + change SchwartzMap.toTemperedDistributionCLM E ℂ volume _ = _ + simp only [map_sum] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + rw [schwartz_product_distribution, ← lineDerivOp_toTemperedDistributionCLM_eq, + ← lineDerivOp_toTemperedDistributionCLM_eq] + rfl + +lemma schwartzCoord_perturbation (v : ι → E) (a : SmoothCoefficients ι E) + (f : 𝓢(E, ℂ)) : + schwartzCoord 0 (smoothPerturbation v a f) = + perturbation v (coefficientBCF a) (schwartzCoord 2 f) := by + apply realize_injective 0 + rw [realize_schwartzCoord] + simpa [realize] using smoothPerturbation_distribution v a f + +lemma smoothPerturbation_bound (v : ι → E) (a : SmoothCoefficients ι E) + (f : 𝓢(E, ℂ)) : + ‖schwartzCoord 0 (smoothPerturbation v a f)‖ ≤ + perturbationBound v (coefficientBCF a) * ‖schwartzCoord 2 f‖ := by + rw [schwartzCoord_perturbation] + exact perturbation_bound _ _ _ + +lemma schwartz_deriv_perturbation (w : E) (v : ι → E) (a : SmoothCoefficients ι E) + (f : 𝓢(E, ℂ)) : + ∂_{w} (smoothPerturbation v a f) = + smoothPerturbation v a (∂_{w} f) + smoothPerturbation v (coefficientDeriv w a) f := by + simp only [smoothPerturbation_apply, lineDerivOp_sum, schwartz_deriv_product, + Finset.sum_add_distrib] + rw [add_comm] + congr 1 + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + congr 1 + rw [schwartz_deriv_comm w (v i), schwartz_deriv_comm w (v j)] + +end SobolevChart + +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] +variable {ι : Type*} [Fintype ι] + + + +def commutatorTerms : List E → SmoothCoefficients ι E → + List (SmoothCoefficients ι E × List E) + | [], _ => [] + | w :: ws, a => (coefficientDeriv w a, ws) :: + ((commutatorTerms ws a).map (fun t => (coefficientDeriv w t.1, t.2)) ++ + (commutatorTerms ws a).map (fun t => (t.1, w :: t.2))) + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] [Fintype ι] in +lemma commutatorTerms_order (ws : List E) (a : SmoothCoefficients ι E) + (t : SmoothCoefficients ι E × List E) (ht : t ∈ commutatorTerms ws a) : + t.2.length < ws.length := by + induction ws generalizing t with + | nil => simp [commutatorTerms] at ht + | cons w ws ih => + simp only [commutatorTerms, List.mem_cons, List.mem_append, List.mem_map] at ht + rcases ht with rfl | ⟨b, hb, rfl⟩ | ⟨b, hb, rfl⟩ + · simp + · exact (ih b hb).trans (Nat.lt_succ_self _) + · exact Nat.succ_lt_succ (ih b hb) + +lemma list_sum_add {α M : Type*} [AddCommMonoid M] (ts : List α) (f g : α → M) : + (ts.map (fun t => f t + g t)).sum = (ts.map f).sum + (ts.map g).sum := by + induction ts with + | nil => simp + | cons t ts ih => simp only [List.map_cons, List.sum_cons, ih]; abel + +lemma schwartz_word_perturbation (ws : List E) (v : ι → E) + (a : SmoothCoefficients ι E) (f : 𝓢(E, ℂ)) : + schwartzWord ws (smoothPerturbation v a f) = + smoothPerturbation v a (schwartzWord ws f) + + ((commutatorTerms ws a).map + (fun t => smoothPerturbation v t.1 (schwartzWord t.2 f))).sum := by + induction ws with + | nil => simp [schwartzWord, commutatorTerms] + | cons w ws ih => + change ∂_{w} (schwartzWord ws (smoothPerturbation v a f)) = _ + rw [ih, lineDerivOp_add, schwartz_deriv_perturbation] + have hs : ∂_{w} (((commutatorTerms ws a).map + (fun t => smoothPerturbation v t.1 (schwartzWord t.2 f))).sum) = + ((commutatorTerms ws a).map + (fun t => ∂_{w} (smoothPerturbation v t.1 (schwartzWord t.2 f)))).sum := by + exact (List.sum_map_hom _ _ (lineDerivOpCLM ℂ 𝓢(E, ℂ) w)).symm + rw [hs] + simp only [schwartz_deriv_perturbation, list_sum_add, commutatorTerms, + List.map_cons, List.sum_cons, List.map_append, List.sum_append, List.map_map, + Function.comp_def, schwartzWord, ContinuousLinearMap.comp_apply, lineDerivOpCLM_apply] + abel + +end SobolevChart + +namespace FrozenPoisson +open SobolevChart EllipticKernel +variable {n : ℕ} {ι : Type*} [Fintype ι] + +lemma schwartz_word_resolvent (ws : List (EC n)) (H : Matrix (Fin n) (Fin n) ℂ) + (hH : H.PosDef) (f : 𝓢(EC n, ℂ)) : + schwartzWord ws (schwartzResolvent H f) = schwartzResolvent H (schwartzWord ws f) := by + induction ws with + | nil => rfl + | cons w ws ih => + change ∂_{w} (schwartzWord ws (schwartzResolvent H f)) = _ + rw [ih, schwartz_deriv_resolvent H hH] + rfl + + +def schwartzNeumann (H : Matrix (Fin n) (Fin n) ℂ) (v : ι → EC n) + (a : SmoothCoefficients ι (EC n)) : 𝓢(EC n, ℂ) →L[ℂ] 𝓢(EC n, ℂ) := + schwartzResolvent H ∘L smoothPerturbation v a + +lemma schwartzResolvent_bound (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (f : 𝓢(EC n, ℂ)) : + ‖schwartzCoord 2 (schwartzResolvent H f)‖ ≤ + ellipticBound H hH * ‖schwartzCoord 0 f‖ := by + have hc := schwartzCoord_resolvent H hH 0 f + norm_num at hc + rw [hc] + exact hilbertResolvent_bound H hH _ + +lemma schwartzNeumann_bound (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (v : ι → EC n) (a : SmoothCoefficients ι (EC n)) (f : 𝓢(EC n, ℂ)) : + ‖schwartzCoord 2 (schwartzNeumann H v a f)‖ ≤ + (ellipticBound H hH * perturbationBound v (coefficientBCF a)) * + ‖schwartzCoord 2 f‖ := by + calc + _ ≤ ellipticBound H hH * ‖schwartzCoord 0 (smoothPerturbation v a f)‖ := + schwartzResolvent_bound H hH _ + _ ≤ ellipticBound H hH * (perturbationBound v (coefficientBCF a) * + ‖schwartzCoord 2 f‖) := + mul_le_mul_of_nonneg_left (smoothPerturbation_bound v a f) (ellipticBound_pos H hH).le + _ = _ := by ring + +lemma schwartz_word_neumann (ws : List (EC n)) (H : Matrix (Fin n) (Fin n) ℂ) + (hH : H.PosDef) (v : ι → EC n) (a : SmoothCoefficients ι (EC n)) (f : 𝓢(EC n, ℂ)) : + schwartzWord ws (schwartzNeumann H v a f) = + schwartzNeumann H v a (schwartzWord ws f) + + ((commutatorTerms ws a).map + (fun t => schwartzNeumann H v t.1 (schwartzWord t.2 f))).sum := by + change schwartzWord ws (schwartzResolvent H (smoothPerturbation v a f)) = _ + rw [schwartz_word_resolvent ws H hH, schwartz_word_perturbation, map_add, map_list_sum] + simp only [List.map_map, Function.comp_def] + rfl + +end FrozenPoisson + +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +lemma schwartzCoord_zero (s : ℝ) : schwartzCoord s (0 : 𝓢(E, ℂ)) = 0 := by + apply realize_injective s + simp only [map_zero, realize_schwartzCoord] + +lemma schwartzCoord_list_sum (s : ℝ) (ts : List 𝓢(E, ℂ)) : + schwartzCoord s ts.sum = (ts.map (schwartzCoord s)).sum := by + induction ts with + | nil => simp [schwartzCoord_zero] + | cons t ts ih => simp only [List.sum_cons, schwartzCoord_add, ih, List.map_cons] + +lemma summable_norm_schwartzCoord_list {α : Type*} (s : ℝ) (ts : List α) + (f : α → ℕ → 𝓢(E, ℂ)) + (hf : ∀ t ∈ ts, Summable (fun n => ‖schwartzCoord s (f t n)‖)) : + Summable (fun n => ‖schwartzCoord s ((ts.map (fun t => f t n)).sum)‖) := by + induction ts with + | nil => simp [schwartzCoord_zero] + | cons t ts ih => + have ht := hf t (List.mem_cons_self ..) + have hts := ih (fun t ht => hf t (List.mem_cons_of_mem _ ht)) + apply Summable.of_nonneg_of_le (fun _ => norm_nonneg _) _ (ht.add hts) + intro n + simpa only [List.map_cons, List.sum_cons, schwartzCoord_add] using + norm_add_le (schwartzCoord s (f t n)) + (schwartzCoord s ((ts.map (fun t => f t n)).sum)) + +end SobolevChart + +namespace FrozenPoisson +open SobolevChart EllipticKernel +variable {n : ℕ} {ι : Type*} [Fintype ι] + +def schwartzIterate (H : Matrix (Fin n) (Fin n) ℂ) (v : ι → EC n) + (a : SmoothCoefficients ι (EC n)) (f : 𝓢(EC n, ℂ)) (N : ℕ) : 𝓢(EC n, ℂ) := + (schwartzNeumann H v a)^[N] f + +lemma schwartzIterate_succ (H : Matrix (Fin n) (Fin n) ℂ) (v : ι → EC n) + (a : SmoothCoefficients ι (EC n)) (f : 𝓢(EC n, ℂ)) (N : ℕ) : + schwartzIterate H v a f (N+1) = schwartzNeumann H v a (schwartzIterate H v a f N) := + Function.iterate_succ_apply' _ _ _ + +lemma summable_norm_neumann_of (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (v : ι → EC n) (a : SmoothCoefficients ι (EC n)) (f : ℕ → 𝓢(EC n, ℂ)) + (hf : Summable (fun m => ‖schwartzCoord 2 (f m)‖)) : + Summable (fun m => ‖schwartzCoord 2 (schwartzNeumann H v a (f m))‖) := by + apply Summable.of_nonneg_of_le (fun _ => norm_nonneg _) + (fun m => schwartzNeumann_bound H hH v a (f m)) + exact hf.mul_left _ + + + +theorem neumann_summable_word (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (v : ι → EC n) (a : SmoothCoefficients ι (EC n)) + (hsmall : perturbationBound v (coefficientBCF a) * ellipticBound H hH < 1) + (f : 𝓢(EC n, ℂ)) (ws : List (EC n)) : + Summable (fun m => ‖schwartzCoord 2 (schwartzWord ws (schwartzIterate H v a f m))‖) := by + induction hlen : ws.length using Nat.strong_induction_on generalizing ws with + | h k ih => + let err : ℕ → 𝓢(EC n, ℂ) := fun m => ((commutatorTerms ws a).map + (fun t => schwartzNeumann H v t.1 (schwartzWord t.2 (schwartzIterate H v a f m)))).sum + have hs : Summable (fun m => ‖schwartzCoord 2 (err m)‖) := by + apply summable_norm_schwartzCoord_list + intro t ht + apply summable_norm_neumann_of H hH + exact ih t.2.length (hlen ▸ commutatorTerms_order ws a t ht) t.2 rfl + apply summable_of_contracting_recurrence (fun _ => norm_nonneg _) + (fun _ => norm_nonneg _) (q := ellipticBound H hH * perturbationBound v (coefficientBCF a)) + (by simpa only [mul_comm] using hsmall) hs + intro m + rw [schwartzIterate_succ, schwartz_word_neumann ws H hH, schwartzCoord_add] + exact (norm_add_le _ _).trans (add_le_add + (schwartzNeumann_bound H hH v a _) le_rfl) + +end FrozenPoisson + +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +lemma memSobolev_word_of_summable (f : ℕ → 𝓢(E, ℂ)) (ws : List E) + (hf : Summable (fun m => ‖schwartzCoord 2 (f m)‖)) + (hw : Summable (fun m => ‖schwartzCoord 2 (schwartzWord ws (f m))‖)) : + MemSobolev 2 2 (weakWord ws (realize 2 (∑' m, schwartzCoord 2 (f m)))) := by + have h₁ := (hf.of_norm.hasSum.mapL (realize (E := E) 2)).mapL (weakWord ws) + have h₂ := hw.of_norm.hasSum.mapL (realize (E := E) 2) + simp only [realize_schwartzCoord, word_distribution] at h₁ h₂ + rw [h₁.unique h₂] + exact realize_memSobolev _ _ + +lemma memSobolev_even_of_words (u : 𝓢'(E, ℂ)) + (hu : ∀ ws : List E, MemSobolev 2 2 (weakWord ws u)) (k : ℕ) : + ∀ ws : List E, MemSobolev (2 * (k : ℝ)) 2 (weakWord ws u) := by + induction k with + | zero => + intro ws + exact (hu ws).mono (by norm_num) + | succ k ih => + intro ws + have hs : 2 * ((k + 1 : ℕ) : ℝ) = 2 * (k : ℝ) + 2 := by push_cast; ring + rw [hs] + apply memSobolev_of_second_basis (ih ws) + intro j + exact ih (stdOrthonormalBasis ℝ E j :: stdOrthonormalBasis ℝ E j :: ws) + +end SobolevChart + +namespace FrozenPoisson +open SobolevChart EllipticKernel +variable {n : ℕ} {ι : Type*} [Fintype ι] + + +def neumannSum (H : Matrix (Fin n) (Fin n) ℂ) (v : ι → EC n) + (a : SmoothCoefficients ι (EC n)) (f : 𝓢(EC n, ℂ)) : L2 (EC n) := + ∑' m, schwartzCoord 2 (schwartzIterate H v a f m) + +lemma schwartzCoord_neumann (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (v : ι → EC n) (a : SmoothCoefficients ι (EC n)) (f : 𝓢(EC n, ℂ)) : + schwartzCoord 2 (schwartzNeumann H v a f) = + hilbertResolvent H hH (perturbation v (coefficientBCF a) (schwartzCoord 2 f)) := by + have he := schwartzCoord_resolvent H hH 0 (smoothPerturbation v a f) + norm_num at he + rw [schwartzCoord_perturbation] at he + exact he + +lemma neumannSum_fixed (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (v : ι → EC n) (a : SmoothCoefficients ι (EC n)) + (hsmall : perturbationBound v (coefficientBCF a) * ellipticBound H hH < 1) + (f : 𝓢(EC n, ℂ)) : + neumannSum H v a f = schwartzCoord 2 f + + hilbertResolvent H hH (perturbation v (coefficientBCF a) (neumannSum H v a f)) := by + have hs := (neumann_summable_word H hH v a hsmall f []).of_norm + change Summable (fun m => schwartzCoord 2 (schwartzIterate H v a f m)) at hs + let T := hilbertResolvent H hH ∘L perturbation v (coefficientBCF a) + have hmap := T.map_tsum hs + simp only [T, ContinuousLinearMap.comp_apply, ← schwartzCoord_neumann, + ← schwartzIterate_succ] at hmap + change (∑' m, schwartzCoord 2 (schwartzIterate H v a f m)) = _ + rw [hs.tsum_eq_zero_add] + change schwartzCoord 2 f + _ = schwartzCoord 2 f + _ + exact congrArg (schwartzCoord 2 f + ·) hmap.symm + +lemma equation_of_fixed (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (v : ι → EC n) (a : ι → ι → EC n →ᵇ ℂ) (u f : L2 (EC n)) + (hu : u = hilbertResolvent H hH (f + perturbation v a u)) : + realize 2 u - frozenDifferential H (realize 2 u) - + (perturbation v a u : 𝓢'(EC n, ℂ)) = (f : 𝓢'(EC n, ℂ)) := by + have hr : realize 2 u = resolvent H (realize 0 (f + perturbation v a u)) := by + conv_lhs => rw [hu] + simpa only [zero_add] using hilbertResolvent_realize H hH 0 (f + perturbation v a u) + rw [← shifted_eq_identity_sub H hH, hr, shifted_resolvent H hH] + simp only [realize, neg_zero, besselPotential_zero, ContinuousLinearMap.coe_comp, + Function.comp_apply, ContinuousLinearMap.id_apply, Lp.toTemperedDistributionCLM_apply] + change Lp.toTemperedDistributionCLM ℂ volume 2 (f + perturbation v a u) - + Lp.toTemperedDistributionCLM ℂ volume 2 (perturbation v a u) = + Lp.toTemperedDistributionCLM ℂ volume 2 f + simp only [map_add, add_sub_cancel_right] + +lemma neumannSum_eq_localResolvent (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (v : ι → EC n) (a : SmoothCoefficients ι (EC n)) + (hsmall : perturbationBound v (coefficientBCF a) * ellipticBound H hH < 1) + (f : 𝓢(EC n, ℂ)) : + neumannSum H v a (schwartzResolvent H f) = + localResolvent H hH v (coefficientBCF a) hsmall (schwartzCoord 0 f) := by + apply perturbed_unique H hH v (coefficientBCF a) hsmall + _ _ (schwartzCoord 0 f) + · apply equation_of_fixed H hH + rw [map_add] + have hr := schwartzCoord_resolvent H hH 0 f + norm_num at hr + rw [← hr] + exact neumannSum_fixed H hH v a hsmall (schwartzResolvent H f) + · exact localResolvent_equation H hH v (coefficientBCF a) hsmall _ + + + +theorem localResolvent_schwartz_memSobolev (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (v : ι → EC n) (a : SmoothCoefficients ι (EC n)) + (hsmall : perturbationBound v (coefficientBCF a) * ellipticBound H hH < 1) + (f : 𝓢(EC n, ℂ)) (k : ℕ) : + MemSobolev (2 * (k : ℝ)) 2 + (realize 2 (localResolvent H hH v (coefficientBCF a) hsmall (schwartzCoord 0 f))) := by + rw [← neumannSum_eq_localResolvent H hH v a hsmall f] + apply memSobolev_even_of_words _ _ k [] + intro ws + exact memSobolev_word_of_summable (schwartzIterate H v a (schwartzResolvent H f)) ws + (neumann_summable_word H hH v a hsmall (schwartzResolvent H f) []) + (neumann_summable_word H hH v a hsmall (schwartzResolvent H f) ws) + +end FrozenPoisson + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/LocalizedCompact.lean b/lean/OAI/Geometry/PrescribedPotential/LocalizedCompact.lean new file mode 100644 index 0000000000000000000000000000000000000000..049f54b91379e1ae5fe1734ea5878c4b19135d58 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/LocalizedCompact.lean @@ -0,0 +1,108 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.SobolevParametrix + +namespace OAI + +/-! Localized Compact. -/ + +section + + + +noncomputable section +open MeasureTheory Set Filter Topology FourierTransform +open scoped BoundedContinuousFunction SchwartzMap Classical +namespace EllipticCompact +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] +open SobolevChart + +def localizedFun (κ : 𝓢(E, ℂ)) (s : Set E) (F : s →ᵇ ℂ) (x : E) : ℂ := + if hx : x ∈ s then κ x * F ⟨x, hx⟩ else 0 + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma localizedFun_bound (κ : 𝓢(E, ℂ)) (s : Set E) (F : s →ᵇ ℂ) (x : E) : + ‖localizedFun κ s F x‖ ≤ ‖F‖ * ‖κ x‖ := by + unfold localizedFun + split_ifs with hx + · rw [norm_mul, mul_comm] + exact mul_le_mul_of_nonneg_right (F.norm_coe_le_norm ⟨x,hx⟩) (norm_nonneg _) + · simp only [norm_zero] + positivity + +lemma localizedFun_memLp (κ : 𝓢(E, ℂ)) (s : Set E) (hs : MeasurableSet s) (F : s →ᵇ ℂ) : + MemLp (localizedFun κ s F) 2 (volume : Measure E) := by + have hm : StronglyMeasurable (localizedFun κ s F) := + (show Continuous (fun x : s => κ x * F x) by fun_prop).stronglyMeasurable.dite + stronglyMeasurable_const hs + apply ((κ.memLp (p := 2) (μ := volume)).const_mul (‖F‖ : ℂ)).mono hm.aestronglyMeasurable + filter_upwards [] with x + simpa only [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_norm] using localizedFun_bound κ s F x + +def localizedLp (κ : 𝓢(E, ℂ)) (s : Set E) (hs : MeasurableSet s) (F : s →ᵇ ℂ) : + L2 E := (localizedFun_memLp κ s hs F).toLp (localizedFun κ s F) + +lemma localizedLp_ae (κ : 𝓢(E, ℂ)) (s : Set E) (hs : MeasurableSet s) (F : s →ᵇ ℂ) : + localizedLp κ s hs F =ᵐ[volume] localizedFun κ s F := + (localizedFun_memLp κ s hs F).coeFn_toLp + +lemma localizedLp_norm (κ : 𝓢(E, ℂ)) (s : Set E) (hs : MeasurableSet s) (F : s →ᵇ ℂ) : + ‖localizedLp κ s hs F‖ ≤ ‖SchwartzMap.toLpCLM ℂ ℂ 2 volume κ‖ * ‖F‖ := by + rw [mul_comm] + apply Lp.norm_le_mul_norm_of_ae_le_mul + filter_upwards [localizedLp_ae κ s hs F, + κ.coeFn_toLp 2 volume] with x hF hκ + change ‖(localizedLp κ s hs F : E → ℂ) x‖ ≤ ‖F‖ * ‖(κ.toLp 2 : L2 E) x‖ + rw [show (localizedLp κ s hs F : E → ℂ) x = localizedFun κ s F x from hF, hκ] + exact localizedFun_bound κ s F x + +def localizeLinear (κ : 𝓢(E, ℂ)) (s : Set E) (hs : MeasurableSet s) : + (s →ᵇ ℂ) →ₗ[ℂ] L2 E where + toFun := localizedLp κ s hs + map_add' := by + intro F G + apply Lp.ext + filter_upwards [localizedLp_ae κ s hs (F+G), + localizedLp_ae κ s hs F, + localizedLp_ae κ s hs G, + Lp.coeFn_add (localizedLp κ s hs F) (localizedLp κ s hs G)] with x h hF hG ha + rw [h, ha, Pi.add_apply, hF, hG] + simp only [localizedFun] + split_ifs <;> simp [mul_add] + map_smul' := by + intro c F + apply Lp.ext + filter_upwards [localizedLp_ae κ s hs (c • F), + localizedLp_ae κ s hs F, + Lp.coeFn_smul c (localizedLp κ s hs F)] with x h hF ha + simp only [RingHom.id_apply] + rw [h, ha, Pi.smul_apply, hF] + simp only [localizedFun] + split_ifs <;> simp [smul_eq_mul, mul_left_comm] + +def localizeL2 (κ : 𝓢(E, ℂ)) (s : Set E) (hs : MeasurableSet s) : + (s →ᵇ ℂ) →L[ℂ] L2 E := + (localizeLinear κ s hs).mkContinuous ‖SchwartzMap.toLpCLM ℂ ℂ 2 volume κ‖ + (localizedLp_norm κ s hs) + +lemma localizeL2_ae (κ : 𝓢(E, ℂ)) (s : Set E) (hs : MeasurableSet s) (F : s →ᵇ ℂ) : + localizeL2 κ s hs F =ᵐ[volume] localizedFun κ s F := + localizedLp_ae κ s hs F + +lemma localizeL2_restrict (κ : 𝓢(E, ℂ)) (s : Set E) (hs : MeasurableSet s) + (hκ : Function.support κ ⊆ s) (F : E →ᵇ ℂ) : + localizeL2 κ s hs (F.compContinuous ⟨Subtype.val, continuous_subtype_val⟩) =ᵐ[volume] + fun x => κ x * F x := by + filter_upwards [localizeL2_ae κ s hs (F.compContinuous ⟨Subtype.val, continuous_subtype_val⟩)] with x hx + rw [hx, localizedFun] + split_ifs with h + · rfl + · have hk : κ x = 0 := not_not.mp (mt (fun hne : κ x ≠ 0 => hκ hne) h) + rw [hk, zero_mul] + +end EllipticCompact + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/LocalizedDerivations.lean b/lean/OAI/Geometry/PrescribedPotential/LocalizedDerivations.lean new file mode 100644 index 0000000000000000000000000000000000000000..ce602b83ecade1350d74bd8e0982a0916a363c1d --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/LocalizedDerivations.lean @@ -0,0 +1,150 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalHessian + +namespace OAI + +/-! Localized Derivations. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory LineDeriv +open scoped ContDiff SchwartzMap Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart + +namespace ChartCutoff +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + {U : Set E} + +def realPart (κ : ChartCutoff U) : ChartCutoff U where + val := SchwartzMap.postcompCLM (Complex.ofRealCLM.comp Complex.reCLM) κ.val + compact := by + apply HasCompactSupport.of_support_subset_isCompact κ.compact + intro x hx + apply subset_tsupport (κ : E → ℂ) + intro h + exact hx (by change ((κ x).re : ℂ) = 0; simp [h]) + support_sub := by + apply Subset.trans _ κ.support_sub + apply closure_mono + intro x hx h + exact hx (by change ((κ x).re : ℂ) = 0; simp [h]) + +@[simp] lemma realPart_apply (κ : ChartCutoff U) (x : E) : κ.realPart x = ((κ x).re : ℂ) := rfl + +lemma realPart_support (κ : ChartCutoff U) : + tsupport (κ.realPart : E → ℂ) ⊆ tsupport (κ : E → ℂ) := by + apply closure_mono + intro x hx h + exact hx (by simp [h]) +end ChartCutoff + +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +def localizedDerivative (p : ι) (v : EC d) : Smooth A →ₗ[ℝ] Smooth A := + (globalize (D.patch p).index (D.cutoff p).realPart).comp + (((lineDerivOpCLM ℂ 𝓢(EC d, ℂ) v).restrictScalars ℝ).toLinearMap.comp + (localizeLinear A (D.patch p).index (cutoffGlobal (D.patch p).index (D.outerCutoff p)) + (cutoffGlobal_support _ _))) + +lemma localizedDerivative_bound (k : ℕ) (p : ι) (v : EC d) : + D.localizers.BoundedCore ((k : ℝ)+1) (k : ℝ) (D.localizedDerivative p v) := by + let q := (D.patch p).index + let ρ := cutoffGlobal q (D.outerCutoff p) + let hp := cutoffGlobal_support q (D.outerCutoff p) + obtain ⟨B,hB,hb⟩ := globalize_integer_bound D.localizers q (D.cutoff p).realPart k + obtain ⟨C,hC,hc⟩ := coreBound_deriv (s := (k : ℝ)+1) (t := (k : ℝ)) v (by linarith) + obtain ⟨E,hE,he⟩ := D.localization_integer_bound q ρ hp (k+1) + rw [Nat.cast_add, Nat.cast_one] at he + refine ⟨B*(C*E),mul_nonneg hB (mul_nonneg hC hE),fun f => ?_⟩ + let w := localize A q ρ hp f + change ‖D.localizers.embed (k : ℝ) (globalize q (D.cutoff p).realPart (∂_{v} w))‖ ≤ _ + calc + _ ≤ B*‖schwartzCoord (k : ℝ) (∂_{v} w)‖ := hb _ + _ ≤ B*(C*‖schwartzCoord ((k : ℝ)+1) w‖) := mul_le_mul_of_nonneg_left (hc w) hB + _ ≤ B*(C*(E*‖D.localizers.embed ((k : ℝ)+1) f‖)) := + mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left (he f) hC) hB + _ = _ := by ring + +lemma localizedDerivative_apply (p : ι) (v : EC d) (f : Smooth A) (x : X) : + D.localizedDerivative p v f x = + if x ∈ (A.euclideanChart (D.patch p).index).source then + (D.cutoff p).realPart (A.euclideanChart (D.patch p).index x) * + fderiv ℝ (f ∘ (A.euclideanChart (D.patch p).index).symm) + (A.euclideanChart (D.patch p).index x) v else 0 := by + let q := (D.patch p).index + let e := A.euclideanChart q + change globalize q (D.cutoff p).realPart + (∂_{v} (localize A q (cutoffGlobal q (D.outerCutoff p)) (cutoffGlobal_support _ _) f)) x = _ + rw [globalize_apply] + dsimp only [q] + by_cases hx : x ∈ e.source + all_goals dsimp only [e, q] at hx + · simp only [ite_eq_left hx] + by_cases hκ : (D.cutoff p).realPart (e x) = 0 + · rw [hκ,zero_mul,zero_mul] + · rw [SchwartzMap.lineDerivOp_apply_eq_fderiv] + have hh := localize_cutoff_eventually q (D.cutoff p).realPart (D.outerCutoff p) + (fun y hy => D.outerCutoff_one p y ((D.cutoff p).realPart_support hy)) + f (e.mapsTo hx) hκ + rw [hh.fderiv_eq] + · simp only [ite_eq_right hx] + +lemma localizedDerivative_mul (p : ι) (v : EC d) (f h : Smooth A) : + D.localizedDerivative p v (f.mul h) = + (D.localizedDerivative p v f).mul h + f.mul (D.localizedDerivative p v h) := by + apply Smooth.ext + intro x + rw [Smooth.add_apply] + change D.localizedDerivative p v (f.mul h) x = + D.localizedDerivative p v f x * h x + f x * D.localizedDerivative p v h x + rw [D.localizedDerivative_apply, D.localizedDerivative_apply, D.localizedDerivative_apply] + let e := A.euclideanChart (D.patch p).index + by_cases hx : x ∈ e.source + all_goals dsimp only [e] at hx + · simp only [ite_eq_left hx] + have hf := (f.smooth (D.patch p).index).contDiffAt (e.open_target.mem_nhds (e.mapsTo hx)) + have hh := (h.smooth (D.patch p).index).contDiffAt (e.open_target.mem_nhds (e.mapsTo hx)) + have he : ((f.mul h) ∘ e.symm) = (fun y => f (e.symm y) * h (e.symm y)) := rfl + have hd := fderiv_fun_mul (hf.differentiableAt (by simp)) (hh.differentiableAt (by simp)) + dsimp only [e, Function.comp_apply] at hd + rw [he] + dsimp only [e] + rw [hd] + simp only [add_apply, smul_apply, + smul_eq_mul, (A.euclideanChart (D.patch p).index).left_inv hx] + ring + · simp only [ite_eq_right hx, zero_mul, mul_zero, add_zero] + +lemma localizedDerivative_const (p : ι) (v : EC d) (c : ℂ) : + D.localizedDerivative p v (Smooth.const c) = 0 := by + apply Smooth.ext + intro x + rw [D.localizedDerivative_apply] + have he : ((Smooth.const c : Smooth A) ∘ (A.euclideanChart (D.patch p).index).symm) = + (fun _ : EC d => c) := rfl + rw [he, fderiv_const_apply] + split_ifs <;> simp only [zero_apply, mul_zero, Smooth.zero_apply] + +def completedDerivative (k : ℕ) (p : ι) (v : EC d) : + D.localizers.Sobolev ((k : ℝ)+1) →L[ℝ] D.localizers.Sobolev (k : ℝ) := + D.localizers.extendCore ((k : ℝ)+1) (k : ℝ) (D.localizedDerivative p v) + +lemma completedDerivative_embed (k : ℕ) (p : ι) (v : EC d) (f : Smooth A) : + D.completedDerivative k p v (D.localizers.embed ((k : ℝ)+1) f) = + D.localizers.embed (k : ℝ) (D.localizedDerivative p v f) := + D.localizers.extendCore_embed (D.localizedDerivative_bound k p v) f + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/LocalizedPullback.lean b/lean/OAI/Geometry/PrescribedPotential/LocalizedPullback.lean new file mode 100644 index 0000000000000000000000000000000000000000..814d6981ae824426328a179250b0e40ca7f19a5e --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/LocalizedPullback.lean @@ -0,0 +1,192 @@ +import Mathlib + +namespace OAI + +/-! Localized Pullback. -/ + +section + + + +noncomputable section +open Set MeasureTheory Topology Filter +open scoped ENNReal ContDiff + +namespace GlobalElliptic +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +lemma map_restrict_le_of_jacobian_lower (f : E → E) (hf : Measurable f) + (f' : E → E →L[ℝ] E) {K : Set E} (hK : MeasurableSet K) + (hder : ∀ x ∈ K, HasFDerivWithinAt f (f' x) K x) (hinj : InjOn f K) + {δ : ℝ} (hδ : 0 < δ) (hlower : ∀ x ∈ K, δ ≤ |(f' x).det|) : + Measure.map f (volume.restrict K) ≤ ENNReal.ofReal δ⁻¹ • (volume : Measure E) := by + have hineq : (volume.restrict K).withDensity (fun _ : E => (1 : ℝ≥0∞)) ≤ + (volume.restrict K).withDensity + (fun x => ENNReal.ofReal δ⁻¹ * ENNReal.ofReal |(f' x).det|) := by + apply withDensity_mono + filter_upwards [self_mem_ae_restrict hK] with x hx + rw [← ENNReal.ofReal_mul (by positivity)] + rw [← ENNReal.ofReal_one] + apply ENNReal.ofReal_le_ofReal + exact (show (1:ℝ) ≤ δ⁻¹ * |(f' x).det| by + rw [← div_eq_inv_mul, le_div_iff₀ hδ] + simpa using hlower x hx) + rw [withDensity_const, one_smul] at hineq + change volume.restrict K ≤ (volume.restrict K).withDensity + (ENNReal.ofReal δ⁻¹ • (fun x => ENNReal.ofReal |(f' x).det|)) at hineq + rw [withDensity_smul' _ _ ENNReal.ofReal_ne_top] at hineq + have hmap := Measure.map_mono hineq hf + rw [Measure.map_smul _ hf.aemeasurable, + map_withDensity_abs_det_fderiv_eq_addHaar volume hK.nullMeasurableSet hder hinj] at hmap + apply hmap.trans + gcongr + exact Measure.restrict_le_self + + + +theorem exists_map_restrict_bound (f : E → E) (f' : E → E →L[ℝ] E) + {K : Set E} (hK : IsCompact K) (hf : ContinuousOn f K) + (hder : ∀ x ∈ K, HasFDerivWithinAt f (f' x) K x) (hinj : InjOn f K) + (hcont : ContinuousOn (fun x => |(f' x).det|) K) + (hnonzero : ∀ x ∈ K, (f' x).det ≠ 0) : + ∃ C : ℝ, 0 ≤ C ∧ + Measurable (K.indicator f) ∧ + Measure.map (K.indicator f) (volume.restrict K) ≤ ENNReal.ofReal C • (volume : Measure E) := by + classical + have hmeas : Measurable (K.indicator f) := by + exact hf.measurable_piecewise continuous_zero.continuousOn hK.isClosed.measurableSet + by_cases hne : K.Nonempty + · obtain ⟨x, hx, hxmin⟩ := hK.exists_isMinOn hne hcont + let δ := |(f' x).det| + have hδ : 0 < δ := abs_pos.mpr (hnonzero x hx) + refine ⟨δ⁻¹, (inv_pos.mpr hδ).le, hmeas, ?_⟩ + apply map_restrict_le_of_jacobian_lower _ hmeas f' hK.isClosed.measurableSet + (fun y hy => (hder y hy).congr (fun z hz => indicator_of_mem hz f) + (indicator_of_mem hy f)) + (hinj.congr (fun y hy => (indicator_of_mem hy f).symm)) hδ + intro y hy + exact hxmin hy + · have he : K = ∅ := not_nonempty_iff_eq_empty.mp hne + subst K + exact ⟨0, le_rfl, hmeas, by simp⟩ + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma chart_fderiv_det_ne_zero (e : OpenPartialHomeomorph E E) + (he : ContDiffOn ℝ ∞ e e.source) (hs : ContDiffOn ℝ ∞ e.symm e.target) + {x : E} (hx : x ∈ e.source) : (fderiv ℝ e x).det ≠ 0 := by + have h₁ := ((he.contDiffAt (e.open_source.mem_nhds hx)).differentiableAt (by simp)).hasFDerivAt + have h₂ := ((hs.contDiffAt (e.open_target.mem_nhds (e.mapsTo hx))).differentiableAt (by simp)).hasFDerivAt + have hcomp := h₂.comp x h₁ + have hi : (fun y => e.symm (e y)) =ᶠ[nhds x] id := by + filter_upwards [e.open_source.mem_nhds hx] with y hy using e.left_inv hy + have heq : (fderiv ℝ e.symm (e x)).comp (fderiv ℝ e x) = ContinuousLinearMap.id ℝ E := + (hcomp.congr_of_eventuallyEq hi.symm).unique (hasFDerivAt_id x) + have hdet := congrArg ContinuousLinearMap.det heq + change LinearMap.det ((fderiv ℝ e.symm (e x)).toLinearMap.comp (fderiv ℝ e x).toLinearMap) = + LinearMap.det (LinearMap.id) at hdet + rw [LinearMap.det_comp, LinearMap.det_id] at hdet + intro hz + change (fderiv ℝ e.symm (e x)).det * (fderiv ℝ e x).det = 1 at hdet + rw [hz, mul_zero] at hdet + exact zero_ne_one hdet + + + +theorem chart_map_restrict_bound (e : OpenPartialHomeomorph E E) + (he : ContDiffOn ℝ ∞ e e.source) (hs : ContDiffOn ℝ ∞ e.symm e.target) + {K : Set E} (hK : IsCompact K) (hKe : K ⊆ e.source) : + ∃ C : ℝ, 0 ≤ C ∧ Measurable (K.indicator e) ∧ + Measure.map (K.indicator e) (volume.restrict K) ≤ ENNReal.ofReal C • (volume : Measure E) := by + apply exists_map_restrict_bound e (fderiv ℝ e) hK (e.continuousOn.mono hKe) + (fun x hx => (((he.contDiffAt (e.open_source.mem_nhds (hKe hx))).differentiableAt + (by simp)).hasFDerivAt).hasFDerivWithinAt) (e.injOn.mono hKe) + · exact (ContinuousLinearMap.continuous_det.comp_continuousOn + (he.continuousOn_fderiv_of_isOpen e.open_source (by simp))).abs.mono hKe + · exact fun x hx => chart_fderiv_det_ne_zero e he hs (hKe hx) + +end GlobalElliptic + +namespace MeasureTheory.Lp +open scoped _root_.MeasureTheory _root_.MeasureTheory.Lp +variable {α β F : Type*} [MeasurableSpace α] [MeasurableSpace β] + [NormedAddCommGroup F] [NormedSpace ℝ F] + {μ : _root_.MeasureTheory.Measure α} {ν : _root_.MeasureTheory.Measure β} {p : ℝ≥0∞} [Fact (1 ≤ p)] + +def extendZeroFun {K : Set α} (hK : MeasurableSet K) (u : _root_.MeasureTheory.Lp F p (μ.restrict K)) : + _root_.MeasureTheory.Lp F p μ := + ((_root_.MeasureTheory.memLp_indicator_iff_restrict hK).mpr (_root_.MeasureTheory.Lp.memLp u)).toLp (K.indicator u) + +omit [NormedSpace ℝ F] [Fact (1 ≤ p)] in +lemma coeFn_extendZeroFun {K : Set α} (hK : MeasurableSet K) (u : _root_.MeasureTheory.Lp F p (μ.restrict K)) : + extendZeroFun hK u =ᵐ[μ] K.indicator u := _root_.MeasureTheory.MemLp.coeFn_toLp _ + +omit [NormedSpace ℝ F] [Fact (1 ≤ p)] in +lemma extendZeroFun_add {K : Set α} (hK : MeasurableSet K) (u v : _root_.MeasureTheory.Lp F p (μ.restrict K)) : + extendZeroFun hK (u + v) = extendZeroFun hK u + extendZeroFun hK v := by + apply _root_.MeasureTheory.Lp.ext + filter_upwards [coeFn_extendZeroFun hK (u + v), coeFn_extendZeroFun hK u, + coeFn_extendZeroFun hK v, _root_.MeasureTheory.Lp.coeFn_add (extendZeroFun hK u) (extendZeroFun hK v), + (_root_.MeasureTheory.ae_restrict_iff' hK).mp (_root_.MeasureTheory.Lp.coeFn_add u v)] with x h₁ h₂ h₃ h₄ h₅ + rw [h₁, h₄, Pi.add_apply, h₂, h₃] + by_cases hx : x ∈ K + · simp only [indicator_of_mem hx, h₅ hx, Pi.add_apply] + · simp only [indicator_of_notMem hx, add_zero] + +omit [Fact (1 ≤ p)] in +lemma extendZeroFun_smul {K : Set α} (hK : MeasurableSet K) (c : ℝ) + (u : _root_.MeasureTheory.Lp F p (μ.restrict K)) : extendZeroFun hK (c • u) = c • extendZeroFun hK u := by + apply _root_.MeasureTheory.Lp.ext + filter_upwards [coeFn_extendZeroFun hK (c • u), coeFn_extendZeroFun hK u, + _root_.MeasureTheory.Lp.coeFn_smul c (extendZeroFun hK u), + (_root_.MeasureTheory.ae_restrict_iff' hK).mp (_root_.MeasureTheory.Lp.coeFn_smul c u)] with x h₁ h₂ h₃ h₄ + rw [h₁, h₃, Pi.smul_apply, h₂] + by_cases hx : x ∈ K + · simp only [indicator_of_mem hx, h₄ hx, Pi.smul_apply] + · simp only [indicator_of_notMem hx, smul_zero] + +omit [NormedSpace ℝ F] [Fact (1 ≤ p)] in +lemma norm_extendZeroFun {K : Set α} (hK : MeasurableSet K) (u : _root_.MeasureTheory.Lp F p (μ.restrict K)) : + ‖extendZeroFun hK u‖ = ‖u‖ := by + rw [extendZeroFun, _root_.MeasureTheory.Lp.norm_toLp, _root_.MeasureTheory.eLpNorm_indicator_eq_eLpNorm_restrict hK, _root_.MeasureTheory.Lp.norm_def] + + +def extendZero {K : Set α} (hK : MeasurableSet K) : + _root_.MeasureTheory.Lp F p (μ.restrict K) →ₗᵢ[ℝ] _root_.MeasureTheory.Lp F p μ where + toFun := extendZeroFun hK + map_add' := extendZeroFun_add hK + map_smul' := extendZeroFun_smul hK + norm_map' := norm_extendZeroFun hK + +lemma coeFn_extendZero {K : Set α} (hK : MeasurableSet K) (u : _root_.MeasureTheory.Lp F p (μ.restrict K)) : + extendZero hK u =ᵐ[μ] K.indicator u := coeFn_extendZeroFun hK u + + +def pullbackBounded (f : α → β) (hf : Measurable f) {C : ℝ≥0∞} + (hC : C ≠ ⊤) (h : _root_.MeasureTheory.Measure.map f μ ≤ C • ν) : _root_.MeasureTheory.Lp F p ν →L[ℝ] _root_.MeasureTheory.Lp F p μ := + (_root_.MeasureTheory.Lp.compMeasurePreservingₗᵢ ℝ f ⟨hf, rfl⟩).toContinuousLinearMap ∘L + _root_.MeasureTheory.Lp.LpToLpOfMeasureLeSMul hC h + +lemma coeFn_pullbackBounded (f : α → β) (hf : Measurable f) {C : ℝ≥0∞} + (hC : C ≠ ⊤) (h : _root_.MeasureTheory.Measure.map f μ ≤ C • ν) (u : _root_.MeasureTheory.Lp F p ν) : + pullbackBounded f hf hC h u =ᵐ[μ] (fun x => u (f x)) := by + change _root_.MeasureTheory.Lp.compMeasurePreserving f ⟨hf, rfl⟩ (_root_.MeasureTheory.Lp.LpToLpOfMeasureLeSMul hC h u) =ᵐ[μ] _ + apply (_root_.MeasureTheory.Lp.coeFn_compMeasurePreserving _ ⟨hf, rfl⟩).trans + exact _root_.MeasureTheory.ae_of_ae_map hf.aemeasurable (_root_.MeasureTheory.Lp.coeFn_LpToLpOfMeasureLeSMul hC h u) + +lemma pullbackBounded_norm_le (f : α → β) (hf : Measurable f) {C : ℝ≥0∞} + (hC : C ≠ ⊤) (h : _root_.MeasureTheory.Measure.map f μ ≤ C • ν) (u : _root_.MeasureTheory.Lp F p ν) : + ‖pullbackBounded f hf hC h u‖ ≤ C.toReal ^ (1 / p).toReal * ‖u‖ := by + change ‖_root_.MeasureTheory.Lp.compMeasurePreservingₗᵢ ℝ f ⟨hf, rfl⟩ (_root_.MeasureTheory.Lp.LpToLpOfMeasureLeSMul hC h u)‖ ≤ _ + rw [LinearIsometry.norm_map] + have hb : ‖(_root_.MeasureTheory.Lp.LpToLpOfMeasureLeSMul hC h : _root_.MeasureTheory.Lp F p ν →L[ℝ] _root_.MeasureTheory.Lp F p (_root_.MeasureTheory.Measure.map f μ))‖ ≤ + C.toReal ^ (1 / p).toReal := _root_.MeasureTheory.Lp.norm_LpToLpOfMeasureLeSMul_le hC h + apply ((_root_.MeasureTheory.Lp.LpToLpOfMeasureLeSMul hC h).le_opNorm u).trans + exact mul_le_mul_of_nonneg_right hb (norm_nonneg u) + +end MeasureTheory.Lp + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/LogHessianCalculus.lean b/lean/OAI/Geometry/PrescribedPotential/LogHessianCalculus.lean new file mode 100644 index 0000000000000000000000000000000000000000..9f1c6cff3a536afc0582ca9545d2aee2a1406915 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/LogHessianCalculus.lean @@ -0,0 +1,78 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.KaehlerClosedDerivatives +import OAI.Geometry.PrescribedPotential.MatrixLogDet + +namespace OAI + +/-! Log Hessian Calculus. -/ + +section + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +variable {n : ℕ} + +lemma wderiv_inv {f : V n → ℂ} {z : V n} + (hf : DifferentiableAt ℝ f z) (hn : f z ≠ 0) (a : ℂ) (v : V n) : + wderiv a v (fun y => (f y)⁻¹) z = -(f z)^(-2 : ℤ)*wderiv a v f z := by + have h := (hasDerivAt_inv hn).comp_hasFDerivAt z hf.hasFDerivAt + have he : fderiv ℝ (fun y => (f y)⁻¹) z = -((f z)^2)⁻¹ • fderiv ℝ f z := h.fderiv + simp only [wderiv,he,_root_.smul_apply,smul_eq_mul] + simp only [_root_.zpow_neg,zpow_ofNat] + ring + +lemma second_wderiv_log_real {U : Set (V n)} (hU : IsOpen U) + {f : V n → ℝ} (hf : ContDiffOn ℝ ∞ f U) (hp : ∀ y ∈ U, f y ≠ 0) + {z : V n} (hz : z ∈ U) (a b : ℂ) (u v : V n) : + wderiv b u (wderiv a v (fun y => (Real.log (f y) : ℂ))) z = + (f z : ℂ)⁻¹*wderiv b u (wderiv a v (fun y => (f y : ℂ))) z - + (f z : ℂ)^(-2 : ℤ)*wderiv b u (fun y => (f y : ℂ)) z * + wderiv a v (fun y => (f y : ℂ)) z := by + have hs := hf.contDiffAt (hU.mem_nhds hz) + have hc : ContDiffAt ℝ ∞ (fun y => (f y : ℂ)) z := Complex.ofRealCLM.contDiff.contDiffAt.comp z hs + have he : (wderiv a v (fun y => (Real.log (f y) : ℂ))) =ᶠ[𝓝 z] + (fun y => (f y : ℂ)⁻¹*wderiv a v (fun y => (f y : ℂ)) y) := by + filter_upwards [hU.mem_nhds hz] with y hy + exact wderiv_log_real (hf.contDiffAt (hU.mem_nhds hy)) (hp y hy) a v + rw [wderiv_congr he,wderiv_mul + (show DifferentiableAt ℝ (fun y => (f y : ℂ)⁻¹) z from + (hc.differentiableAt (by simp)).inv (Complex.ofReal_ne_zero.mpr (hp z hz))) + ((wderiv_smooth hc a v).differentiableAt (by simp)), + wderiv_inv (hc.differentiableAt (by simp)) (Complex.ofReal_ne_zero.mpr (hp z hz))] + ring + +lemma dzbar_real_eq_conj {f : V n → ℝ} {z : V n} + (hf : DifferentiableAt ℝ f z) (v : V n) : + dzbar v (fun y => (f y : ℂ)) z = star (dz v (fun y => (f y : ℂ)) z) := by + simp only [dzbar,dz,wderiv,fderiv_ofReal hf] + apply Complex.ext <;> simp + +lemma log_hessian_diagonal {U : Set (V n)} (hU : IsOpen U) + {f : V n → ℝ} (hf : ContDiffOn ℝ ∞ f U) (hp : ∀ y ∈ U, f y ≠ 0) + {z : V n} (hz : z ∈ U) (k : Fin n) : + (PotentialKaehler.potentialMatrix (fun y => Real.log (f y)) z k k).re = + (f z)⁻¹*(PotentialKaehler.potentialMatrix f z k k).re - + (f z)^(-2 : ℤ)*‖dz (e k) (fun y => (f y : ℂ)) z‖^2 := by + have hs := hf.contDiffAt (hU.mem_nhds hz) + rw [potentialMatrix_eq_dzbar_dz (hs.log (hp z hz)), + potentialMatrix_eq_dzbar_dz hs] + change (wderiv Complex.I (e k) (wderiv (-Complex.I) (e k) + (fun y => (Real.log (f y) : ℂ))) z).re = _ + rw [second_wderiv_log_real hU hf hp hz] + change ((f z : ℂ)⁻¹ * dzbar (e k) (dz (e k) (fun y => (f y : ℂ))) z - + (f z : ℂ)^(-2 : ℤ)*dzbar (e k) (fun y => (f y : ℂ)) z* + dz (e k) (fun y => (f y : ℂ)) z).re = _ + rw [dzbar_real_eq_conj (hs.differentiableAt (by simp)),mul_assoc,Complex.star_def, + ← Complex.normSq_eq_conj_mul_self] + simp only [← Complex.ofReal_inv,← Complex.ofReal_zpow,Complex.sub_re,Complex.mul_re,Complex.ofReal_re, + Complex.ofReal_im,zero_mul,sub_zero,mul_zero,Complex.normSq_eq_norm_sq] + rfl +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/MatrixCoefficientSmooth.lean b/lean/OAI/Geometry/PrescribedPotential/MatrixCoefficientSmooth.lean new file mode 100644 index 0000000000000000000000000000000000000000..447c6212b8e8fe8d834af71780734c49ac927701 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/MatrixCoefficientSmooth.lean @@ -0,0 +1,53 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.MatrixHilbertCoordinates + +namespace OAI + +/-! Matrix Coefficient Smooth. -/ + +section + +noncomputable section +open Set Filter Topology Matrix Finset +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace MetricSystem +open EllipticKernel KaehlerCalculus +variable {n : ℕ} +lemma W_smooth (a : ℂ) (v : V n) : ContDiff ℝ ∞ (W (n := n) a v) := by + unfold W + apply ContDiff.const_smul + apply ContDiff.add + · exact (encode n).symm.contDiff.comp (contDiff_id.clm_apply contDiff_const) + · exact ((encode n).symm.contDiff.comp (contDiff_id.clm_apply contDiff_const)).const_smul a + +lemma quadraticCoefficient_smooth {p : HM n × (EC n →L[ℝ] HM n)} + (hp : ((encode n).symm p.1).det ≠ 0) : ContDiffAt ℝ ∞ (quadraticCoefficient (n := n)) p := by + apply (encode n).contDiff.contDiffAt.comp p + apply ContDiffAt.sum + intro i _ + apply ContDiffAt.sum + intro j _ + have hi := (inverseCoefficient_smooth hp).comp p contDiffAt_fst + have hentry := contDiffAt_pi.mp (contDiffAt_pi.mp hi i) j + apply hentry.smul + have hW (a : ℂ) (v : V n) : ContDiffAt ℝ ∞ (fun q : HM n × (EC n →L[ℝ] HM n) => W a v q.2) p := + (W_smooth a v).contDiffAt.comp p contDiffAt_snd + apply contDiffAt_pi.mpr + intro k + apply contDiffAt_pi.mpr + intro l + simp only [Matrix.mul_apply] + apply ContDiffAt.sum + intro s _ + apply ContDiffAt.mul + · apply ContDiffAt.sum + intro t _ + exact (contDiffAt_pi.mp (contDiffAt_pi.mp (hW Complex.I (e j)) k) t).mul + (contDiffAt_pi.mp (contDiffAt_pi.mp hi t) s) + · exact contDiffAt_pi.mp (contDiffAt_pi.mp (hW (-Complex.I) (e i)) s) l +end MetricSystem + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/MatrixFrameNormalization.lean b/lean/OAI/Geometry/PrescribedPotential/MatrixFrameNormalization.lean new file mode 100644 index 0000000000000000000000000000000000000000..6581523880518bf3ce645d6533cdc67ebb06c5e9 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/MatrixFrameNormalization.lean @@ -0,0 +1,58 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.LinearFrameCalculus +import OAI.Geometry.PrescribedPotential.TracePositivity + +namespace OAI + +/-! Matrix Frame Normalization. -/ + +section + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +variable {n : ℕ} + +def matrixFrame (B : Matrix (Fin n) (Fin n) ℂ) : V n →L[ℂ] V n := + (Matrix.toLin' B).toContinuousLinearMap + +lemma frameMatrix_matrixFrame (B : Matrix (Fin n) (Fin n) ℂ) : + frameMatrix (matrixFrame B) = B := by + change LinearMap.toMatrix' (Matrix.toLin' B) = B + exact LinearMap.toMatrix'_toLin' B + +lemma matrixFrame_apply (B : Matrix (Fin n) (Fin n) ℂ) (v : V n) : + matrixFrame B v = B*ᵥv := rfl + +lemma normalized_frame (M : V n → Matrix (Fin n) (Fin n) ℂ) (z : V n) (hp : (M z).PosDef) : + ∃ (B : V n →L[ℂ] V n) (w : V n), IsUnit (frameMatrix B) ∧ B w = z ∧ pullMetric B M w = 1 := by + obtain ⟨C,hC,hEq⟩ := whitening (M z) hp + obtain ⟨w,hw⟩ := (Matrix.mulVec_surjective_iff_isUnit.mpr hC) z + refine ⟨matrixFrame C,w,?_,?_,?_⟩ + · rwa [frameMatrix_matrixFrame] + · exact hw + · unfold pullMetric + rw [frameMatrix_matrixFrame,matrixFrame_apply,hw] + exact hEq + +lemma pullMetric_positive {U : Set (V n)} (B : V n →L[ℂ] V n) + (hB : IsUnit (frameMatrix B)) {M : V n → Matrix (Fin n) (Fin n) ℂ} + (hp : ∀ y ∈ U, (M y).PosDef) : ∀ y ∈ B ⁻¹' U, (pullMetric B M y).PosDef := by + intro y hy + exact (hp (B y) hy).conjTranspose_mul_mul_same (Matrix.mulVec_injective_iff_isUnit.mpr hB) + +lemma matrix_inverse_trace_congruence (B M G : Matrix (Fin n) (Fin n) ℂ) (hB : IsUnit B) : + ((Bᴴ*M*B)⁻¹*(Bᴴ*G*B)).trace = (M⁻¹*G).trace := by + have hc : B*B⁻¹ = 1 := Matrix.mul_nonsing_inv B ((Matrix.isUnit_iff_isUnit_det B).mp hB) + have hd : Bᴴ⁻¹*Bᴴ = 1 := by + rw [← Matrix.conjTranspose_nonsing_inv,← Matrix.conjTranspose_mul,hc,Matrix.conjTranspose_one] + simp only [Matrix.mul_inv_rev,Matrix.mul_assoc] + rw [← Matrix.mul_assoc Bᴴ⁻¹ Bᴴ,hd,Matrix.one_mul] + rw [← Matrix.mul_assoc M⁻¹,← Matrix.mul_assoc B⁻¹,Matrix.trace_mul_cycle,hc,Matrix.one_mul] +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/MatrixHilbertCoordinates.lean b/lean/OAI/Geometry/PrescribedPotential/MatrixHilbertCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..6b953dc04b74951705515aeec52ceec412e10ac9 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/MatrixHilbertCoordinates.lean @@ -0,0 +1,111 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalOperator +import OAI.Geometry.PrescribedPotential.KaehlerClosedDerivatives +import OAI.Geometry.PrescribedPotential.SymmetricPrincipalFrame + +namespace OAI + +/-! Matrix Hilbert Coordinates. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix Finset +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace MetricSystem +open EllipticKernel FrozenPoisson HigherJet KaehlerCalculus +abbrev Mat (n : ℕ) := Matrix (Fin n) (Fin n) ℂ +abbrev HM (n : ℕ) := EuclideanSpace ℂ (Fin n × Fin n) +local instance realECIP (n : ℕ) : InnerProductSpace ℝ (EC n) := InnerProductSpace.rclikeToReal ℂ (EC n) +local instance realHMIP (n : ℕ) : InnerProductSpace ℝ (HM n) := InnerProductSpace.rclikeToReal ℂ (HM n) + +variable {n : ℕ} +def encodeLinear (n : ℕ) : Mat n ≃ₗ[ℝ] HM n where + toFun M := WithLp.toLp 2 (fun p => M p.1 p.2) + invFun u := fun i j => u (i,j) + left_inv _ := rfl + right_inv _ := rfl + map_add' _ _ := rfl + map_smul' _ _ := rfl + +def encode (n : ℕ) : Mat n ≃L[ℝ] HM n := (encodeLinear n).toContinuousLinearEquiv +@[simp] lemma encode_apply (M : Mat n) (i j : Fin n) : encode n M (i,j) = M i j := rfl +@[simp] lemma decode_apply (u : HM n) (i j : Fin n) : (encode n).symm u i j = u (i,j) := rfl + + +def rawTrace (M : Mat n) (H : Bilin (EC n)) : ℝ := + (M*PotentialKaehler.hermitianPartMatrix (pullBilin H)).trace.re +lemma rawTrace_add (M N : Mat n) (H : Bilin (EC n)) : rawTrace (M+N) H = rawTrace M H+rawTrace N H := by + simp [rawTrace,add_mul,Matrix.trace_add] +lemma rawTrace_smul (c : ℝ) (M : Mat n) (H : Bilin (EC n)) : rawTrace (c • M) H = c*rawTrace M H := by + simp [rawTrace,Matrix.trace_smul] +lemma rawTrace_inv (M : Mat n) (H : Bilin (EC n)) : rawTrace M⁻¹ H = traceBilin M H := rfl + +variable {ι : Type*} [Fintype ι] +def principalLinear (e : OrthonormalBasis ι ℝ (EC n)) (M : Mat n) : + (EC n →L[ℝ] EC n →L[ℝ] HM n) →ₗ[ℝ] HM n where + toFun H := ∑ i, ∑ j, ((rawTrace M (rankTwo (e i) (e j))+rawTrace M (rankTwo (e j) (e i)))/2) • H (e i) (e j) + map_add' H J := by simp only [_root_.add_apply,smul_add,Finset.sum_add_distrib] + map_smul' c H := by + simp only [_root_.smul_apply,Finset.smul_sum] + exact Finset.sum_congr rfl (fun i _ => Finset.sum_congr rfl (fun j _ => smul_comm _ _ _)) + +lemma principalLinear_add (e : OrthonormalBasis ι ℝ (EC n)) (M N : Mat n) + (H : EC n →L[ℝ] EC n →L[ℝ] HM n) : + principalLinear e (M+N) H = principalLinear e M H+principalLinear e N H := by + change (∑ i, ∑ j, ((rawTrace (M+N) (rankTwo (e i) (e j))+rawTrace (M+N) (rankTwo (e j) (e i)))/2) • H (e i) (e j)) = _ + have he (a b c d : ℝ) : (a+b+(c+d))/2 = (a+c)/2+(b+d)/2 := by ring + simp only [rawTrace_add,he,add_smul,Finset.sum_add_distrib] + rfl +lemma principalLinear_smul (e : OrthonormalBasis ι ℝ (EC n)) (c : ℝ) (M : Mat n) + (H : EC n →L[ℝ] EC n →L[ℝ] HM n) : + principalLinear e (c • M) H = c • principalLinear e M H := by + change (∑ i, ∑ j, ((rawTrace (c • M) (rankTwo (e i) (e j))+rawTrace (c • M) (rankTwo (e j) (e i)))/2) • H (e i) (e j)) = _ + have he (a b c : ℝ) : (c*a+c*b)/2 = c*((a+b)/2) := by ring + simp only [rawTrace_smul,he,mul_smul,← Finset.smul_sum] + rfl + +local instance hessianNormedAdd (n : ℕ) : NormedAddCommGroup (EC n →L[ℝ] EC n →L[ℝ] HM n) := inferInstance +local instance hessianNormedSpace (n : ℕ) : NormedSpace ℝ (EC n →L[ℝ] EC n →L[ℝ] HM n) := inferInstance + +def principalBilinear (e : OrthonormalBasis ι ℝ (EC n)) : + Mat n →L[ℝ] ((EC n →L[ℝ] EC n →L[ℝ] HM n) →L[ℝ] HM n) := + ({ toFun M := (principalLinear e M).toContinuousLinearMap + map_add' M N := by + apply ContinuousLinearMap.ext + intro H + exact principalLinear_add e M N H + map_smul' c M := by + apply ContinuousLinearMap.ext + intro H + exact principalLinear_smul e c M H } : + Mat n →ₗ[ℝ] ((EC n →L[ℝ] EC n →L[ℝ] HM n) →L[ℝ] HM n)).toContinuousLinearMap + +lemma principalBilinear_inv (e : OrthonormalBasis ι ℝ (EC n)) (M : Mat n) + (H : EC n →L[ℝ] EC n →L[ℝ] HM n) : + principalBilinear e M⁻¹ H = principalApply e (traceBilin M) H := rfl + +def inverseCoefficient (u : HM n) : Mat n := ((encode n).symm u)⁻¹ + +lemma inverseCoefficient_smooth {u : HM n} (hu : ((encode n).symm u).det ≠ 0) : + ContDiffAt ℝ ∞ (inverseCoefficient (n := n)) u := by + let U : Set (HM n) := {u | ((encode n).symm u).det ≠ 0} + have hU : IsOpen U := (isClosed_eq ((encode n).symm.continuous.matrix_det) continuous_const).isOpen_compl + exact (MatrixSmoothGeneral.inverse (encode n).symm.contDiff.contDiffOn (fun y hy => hy)).contDiffAt (hU.mem_nhds hu) + + +def W (a : ℂ) (v : V n) (J : EC n →L[ℝ] HM n) : Mat n := + (1/2:ℂ) • ((encode n).symm (J ((coordinateEquiv n).symm v))+ + a • (encode n).symm (J ((coordinateEquiv n).symm (Complex.I • v)))) + +def quadraticCoefficient (p : HM n × (EC n →L[ℝ] HM n)) : HM n := + encode n (∑ i, ∑ j, (inverseCoefficient p.1 i j) • + (W Complex.I (e j) p.2*inverseCoefficient p.1*W (-Complex.I) (e i) p.2)) +end MetricSystem + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/MatrixJetDirection.lean b/lean/OAI/Geometry/PrescribedPotential/MatrixJetDirection.lean new file mode 100644 index 0000000000000000000000000000000000000000..beda3c2996a870f8c25b93edccd3f62fa1ecf255 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/MatrixJetDirection.lean @@ -0,0 +1,117 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.ChernLuLocalInequality + +namespace OAI + +/-! Matrix Jet Direction. -/ + +section + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +variable {n : ℕ} + +lemma wderiv_direction_smul (a : ℂ) (r : ℝ) (v : V n) (f : V n → ℂ) (z : V n) : + wderiv a (r • v) f z = (r:ℂ)*wderiv a v f z := by + simp only [wderiv,smul_comm Complex.I r v,map_smul,Complex.real_smul] + ring + +lemma wderiv_second_direction_smul {f : V n → ℂ} {z : V n} + (hf : ContDiffAt ℝ ∞ f z) (a b : ℂ) (r : ℝ) (v : V n) : + wderiv a (r • v) (wderiv b (r • v) f) z = + (r:ℂ)^2*wderiv a v (wderiv b v f) z := by + have he : wderiv b (r • v) f = fun y => (r:ℂ)*wderiv b v f y := + funext (fun y => wderiv_direction_smul b r v f y) + rw [he,wderiv_direction_smul, + wderiv_const_mul ((wderiv_smooth hf b v).differentiableAt (by simp))] + ring + +lemma mderiv_direction_smul (a : ℂ) (r : ℝ) (v : V n) + (M : V n → Matrix (Fin n) (Fin n) ℂ) (z : V n) : + mderiv a (r • v) M z = (r:ℂ) • mderiv a v M z := by + ext i j + exact wderiv_direction_smul a r v (fun y => M y i j) z + +lemma mderiv_second_direction_smul {M : V n → Matrix (Fin n) (Fin n) ℂ} {z : V n} + (hM : ContDiffAt ℝ ∞ M z) (a b : ℂ) (r : ℝ) (v : V n) : + mderiv a (r • v) (mderiv b (r • v) M) z = + (r:ℂ)^2 • mderiv a v (mderiv b v M) z := by + ext i j + exact wderiv_second_direction_smul (entry_smooth hM i j) a b r v + +lemma curvatureDiagonal_smul {G : V n → Matrix (Fin n) (Fin n) ℂ} {z : V n} + (hG : ContDiffAt ℝ ∞ G z) (r : ℝ) (v : V n) : + curvatureDiagonal G z (r • v) = (r:ℂ)^2 • curvatureDiagonal G z v := by + unfold curvatureDiagonal + rw [mderiv_second_direction_smul hG,mderiv_direction_smul] + simp only [Matrix.conjTranspose_smul,Complex.star_def,Complex.conj_ofReal, + smul_mul_assoc,mul_smul_comm,smul_smul,smul_sub,pow_two] + +lemma wderiv_joint_smooth {f : V n → ℂ} {z v : V n} + (hf : ContDiffAt ℝ ∞ f z) (a : ℂ) : + ContDiffAt ℝ ∞ (fun q : V n × V n => wderiv a q.2 f q.1) (z,v) := by + have hd := (hf.fderiv_right (m := ∞) (by simp)).comp (z,v) contDiffAt_fst + have hi : ContDiffAt ℝ ∞ (fun q : V n × V n => Complex.I • q.2) (z,v) := + contDiffAt_snd.const_smul Complex.I + exact ((hd.clm_apply contDiffAt_snd).add + (contDiffAt_const.mul (hd.clm_apply hi))).div_const 2 + +lemma wderiv_second_joint_continuous {U : Set (V n)} (hU : IsOpen U) + {f : V n → ℂ} (hf : ContDiffOn ℝ ∞ f U) (a b : ℂ) : + ContinuousOn (fun q : V n × V n => wderiv a q.2 (wderiv b q.2 f) q.1) (U ×ˢ univ) := by + intro q hq + have hs := hf.contDiffAt (hU.mem_nhds hq.1) + have hd := ((hs.fderiv_right (m := ∞) (by simp)).fderiv_right (m := ∞) (by simp)).comp q contDiffAt_fst + have hi : ContDiffAt ℝ ∞ (fun q : V n × V n => Complex.I • q.2) q := + contDiffAt_snd.const_smul Complex.I + have he : (fun q : V n × V n => wderiv a q.2 (wderiv b q.2 f) q.1) =ᶠ[𝓝 q] + (fun q => ((fderiv ℝ (fderiv ℝ f) q.1 q.2 q.2 + + b*fderiv ℝ (fderiv ℝ f) q.1 q.2 (Complex.I • q.2))/2 + + a*((fderiv ℝ (fderiv ℝ f) q.1 (Complex.I • q.2) q.2 + + b*fderiv ℝ (fderiv ℝ f) q.1 (Complex.I • q.2) (Complex.I • q.2))/2))/2) := by + filter_upwards [continuous_fst.continuousAt.preimage_mem_nhds (hU.mem_nhds hq.1)] with p hp + change (fderiv ℝ (wderiv b p.2 f) p.1 p.2 + a*fderiv ℝ (wderiv b p.2 f) p.1 (Complex.I • p.2))/2 = _ + rw [fderiv_wderiv (hf.contDiffAt (hU.mem_nhds hp)), + fderiv_wderiv (hf.contDiffAt (hU.mem_nhds hp))] + apply ContinuousAt.continuousWithinAt + apply ContinuousAt.congr _ he.symm + exact (((hd.clm_apply contDiffAt_snd).clm_apply contDiffAt_snd).add + (contDiffAt_const.mul ((hd.clm_apply contDiffAt_snd).clm_apply hi))).div_const 2 |>.add + (contDiffAt_const.mul ((((hd.clm_apply hi).clm_apply contDiffAt_snd).add + (contDiffAt_const.mul ((hd.clm_apply hi).clm_apply hi))).div_const 2)) |>.div_const 2 |>.continuousAt + +lemma curvatureDiagonal_joint_continuous {U : Set (V n)} (hU : IsOpen U) + {G : V n → Matrix (Fin n) (Fin n) ℂ} (hG : ContDiffOn ℝ ∞ G U) + (hn : ∀ z ∈ U, (G z).det ≠ 0) : + ContinuousOn (fun q : V n × V n => curvatureDiagonal G q.1 q.2) (U ×ˢ univ) := by + have hd : ContinuousOn (fun q : V n × V n => mderiv (-Complex.I) q.2 G q.1) (U ×ˢ univ) := by + intro q hq + apply ContinuousAt.continuousWithinAt + apply continuousAt_pi.mpr + intro i + apply continuousAt_pi.mpr + intro j + exact (wderiv_joint_smooth (entry_smooth (hG.contDiffAt (hU.mem_nhds hq.1)) i j) _).continuousAt + have hdd : ContinuousOn (fun q : V n × V n => mderiv Complex.I q.2 (mderiv (-Complex.I) q.2 G) q.1) (U ×ˢ univ) := by + apply continuousOn_pi.mpr + intro i + apply continuousOn_pi.mpr + intro j + exact wderiv_second_joint_continuous hU (contDiffOn_pi.mp (contDiffOn_pi.mp hG i) j) _ _ + have hinv : ContinuousOn (fun q : V n × V n => (G q.1)⁻¹) (U ×ˢ univ) := + (MatrixSmoothGeneral.inverse hG hn).continuousOn.comp continuous_fst.continuousOn (fun _ h => h.1) + have hdstar : ContinuousOn (fun q : V n × V n => (mderiv (-Complex.I) q.2 G q.1)ᴴ) (U ×ˢ univ) := by + apply continuousOn_pi.mpr + intro i + apply continuousOn_pi.mpr + intro j + exact (continuousOn_pi.mp (continuousOn_pi.mp hd j) i).star + exact hdd.sub ((hdstar.mul hinv).mul hd) +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/MatrixLimit.lean b/lean/OAI/Geometry/PrescribedPotential/MatrixLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..09d1d7cbe424092f78aca4b42fdc73307e103fd5 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/MatrixLimit.lean @@ -0,0 +1,42 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CircleRadialCalculus + +namespace OAI + +/-! Matrix Limit. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ComplexOrder +namespace CompactMatrixPositivity +variable {n : Type*} [Fintype n] [DecidableEq n] + +omit [DecidableEq n] in +lemma posSemidef_of_tendsto {M : ℕ → Matrix n n ℂ} {L : Matrix n n ℂ} + (hL : L.IsHermitian) (hM : ∀ j, (M j).PosSemidef) + (ht : Tendsto M atTop (𝓝 L)) : L.PosSemidef := by + apply Matrix.PosSemidef.of_dotProduct_mulVec_nonneg hL + intro v + apply Complex.nonneg_iff.mpr + refine ⟨?_,(hL.im_star_dotProduct_mulVec_self v).symm⟩ + have hc : Continuous (fun B : Matrix n n ℂ => (star v ⬝ᵥ (B *ᵥ v)).re) := by + unfold Matrix.mulVec dotProduct + fun_prop + exact ge_of_tendsto (hc.tendsto L |>.comp ht) + (Filter.Eventually.of_forall (fun j => (hM j).re_dotProduct_nonneg v)) + +lemma posDef_of_tendsto_det_ne_zero {M : ℕ → Matrix n n ℂ} {L : Matrix n n ℂ} + (hL : L.IsHermitian) (hM : ∀ j, (M j).PosDef) + (ht : Tendsto M atTop (𝓝 L)) (hd : L.det ≠ 0) : L.PosDef := + (posSemidef_of_tendsto hL (fun j => (hM j).posSemidef) ht).posDef_iff_det_ne_zero.mpr hd + +end CompactMatrixPositivity + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/MatrixLogDet.lean b/lean/OAI/Geometry/PrescribedPotential/MatrixLogDet.lean new file mode 100644 index 0000000000000000000000000000000000000000..6c41b94e32a03e65af48221c62f421103082ed56 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/MatrixLogDet.lean @@ -0,0 +1,135 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.MatrixWirtinger + +namespace OAI + +/-! Matrix Log Det. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +variable {n : ℕ} +local instance matrixLogDetCS (n : ℕ) : ContinuousSMul ℝ (Matrix (Fin n) (Fin n) ℂ) := + inferInstanceAs (ContinuousSMul ℝ (Fin n → Fin n → ℂ)) + +lemma determinant_smooth : ContDiff ℝ ∞ (Matrix.det : Matrix (Fin n) (Fin n) ℂ → ℂ) := + contDiffOn_univ.mp (MatrixSmoothGeneral.determinant contDiffOn_id) + +lemma fderiv_det (H K : Matrix (Fin n) (Fin n) ℂ) (hH : H.det ≠ 0) : + fderiv ℝ Matrix.det H K = H.det * (H⁻¹*K).trace := by + have hd := determinant_smooth.differentiable (by simp) H + have hl : HasDerivAt (fun t : ℝ => H + t • K) K 0 := by + convert (hasDerivAt_const (0 : ℝ) H).fun_add + ((hasDerivAt_id (0 : ℝ)).smul_const K) using 1 <;> first | rfl | simp only [one_smul,zero_add] + have hdat : HasFDerivAt Matrix.det (fderiv ℝ Matrix.det H) (H + (0:ℝ) • K) := by + convert hd.hasFDerivAt using 1 <;> first | rfl | simp only [zero_smul,add_zero] + have h1 := hdat.comp_hasDerivAt 0 hl + have h2 := (MongeAmpere.hasDerivAt_det_add_smul H K (isUnit_iff_ne_zero.mpr hH)).comp_ofReal + convert h1.unique h2 using 1 + +lemma fderiv_det_comp {M : V n → Matrix (Fin n) (Fin n) ℂ} {z : V n} + (hM : ContDiffAt ℝ ∞ M z) (hn : (M z).det ≠ 0) (v : V n) : + fderiv ℝ (fun y => (M y).det) z v = (M z).det*((M z)⁻¹*fderiv ℝ M z v).trace := by + have hd := determinant_smooth.differentiable (by simp) (M z) + rw [fderiv_fun_comp z hd (hM.differentiableAt (by simp)),ContinuousLinearMap.comp_apply] + exact fderiv_det _ _ hn + +lemma fderiv_matrix_apply {M : V n → Matrix (Fin n) (Fin n) ℂ} {z : V n} + (hM : ContDiffAt ℝ ∞ M z) (v : V n) (i j : Fin n) : + (fderiv ℝ M z v) i j = fderiv ℝ (fun y => M y i j) z v := by + have hp := (hasFDerivAt_apply j (M z i)).comp z + ((hasFDerivAt_apply i (M z)).comp z (hM.differentiableAt (by simp)).hasFDerivAt) + exact (congrArg (fun T : V n →L[ℝ] ℂ => T v) hp.fderiv).symm + +lemma mderiv_eq {M : V n → Matrix (Fin n) (Fin n) ℂ} {z : V n} + (hM : ContDiffAt ℝ ∞ M z) (a : ℂ) (v : V n) : + mderiv a v M z = (1/2:ℂ) • (fderiv ℝ M z v + a • fderiv ℝ M z (Complex.I • v)) := by + ext i j + simp only [mderiv,wderiv,Matrix.smul_apply,Matrix.add_apply,smul_eq_mul, + fderiv_matrix_apply hM] + ring + +lemma wderiv_det {M : V n → Matrix (Fin n) (Fin n) ℂ} {z : V n} + (hM : ContDiffAt ℝ ∞ M z) (hn : (M z).det ≠ 0) (a : ℂ) (v : V n) : + wderiv a v (fun y => (M y).det) z = (M z).det*((M z)⁻¹*mderiv a v M z).trace := by + rw [mderiv_eq hM] + simp only [wderiv,fderiv_det_comp hM hn,Matrix.mul_smul,Matrix.mul_add, + Matrix.trace_smul,Matrix.trace_add,smul_eq_mul] + ring + +lemma wderiv_log_real {f : V n → ℝ} {z : V n} + (hf : ContDiffAt ℝ ∞ f z) (hp : f z ≠ 0) (a : ℂ) (v : V n) : + wderiv a v (fun y => (Real.log (f y) : ℂ)) z = + (f z : ℂ)⁻¹*wderiv a v (fun y => (f y : ℂ)) z := by + have hl := (hf.differentiableAt (by simp)).hasFDerivAt.log hp + have he (u : V n) : fderiv ℝ (fun y => Real.log (f y)) z u = (f z)⁻¹*fderiv ℝ f z u := by + rw [hl.fderiv,_root_.smul_apply,smul_eq_mul] + simp only [wderiv,fderiv_ofReal ((hf.log hp).differentiableAt (by simp)),he, + fderiv_ofReal (hf.differentiableAt (by simp)),Complex.ofReal_mul,Complex.ofReal_inv] + ring + +lemma wderiv_logdet {U : Set (V n)} (hU : IsOpen U) + {M : V n → Matrix (Fin n) (Fin n) ℂ} (hM : ContDiffOn ℝ ∞ M U) + (hp : ∀ y ∈ U, (M y).PosDef) {z : V n} (hz : z ∈ U) (a : ℂ) (v : V n) : + wderiv a v (fun y => (Real.log (M y).det.re : ℂ)) z = + ((M z)⁻¹*mderiv a v M z).trace := by + have hs := hM.contDiffAt (hU.mem_nhds hz) + have hdr : ContDiffAt ℝ ∞ (fun y => (M y).det.re) z := + Complex.reCLM.contDiff.contDiffAt.comp z (determinant_smooth.contDiffAt.comp z hs) + have hpos := Complex.pos_iff.mp (hp z hz).det_pos + rw [wderiv_log_real hdr (ne_of_gt hpos.1)] + have he : (fun y => ((M y).det.re : ℂ)) =ᶠ[𝓝 z] (fun y => (M y).det) := by + filter_upwards [hU.mem_nhds hz] with y hy + exact Complex.ext (by simp) (by simpa using (Complex.pos_iff.mp (hp y hy).det_pos).2) + rw [wderiv_congr he,wderiv_det hs (ne_of_gt (hp z hz).det_pos)] + have hez : ((M z).det.re : ℂ) = (M z).det := he.self_of_nhds + rw [← hez] + rw [Complex.ofReal_re,← mul_assoc,inv_mul_cancel₀ (Complex.ofReal_ne_zero.mpr (ne_of_gt hpos.1)),one_mul] + +lemma second_wderiv_logdet {U : Set (V n)} (hU : IsOpen U) + {M : V n → Matrix (Fin n) (Fin n) ℂ} (hM : ContDiffOn ℝ ∞ M U) + (hp : ∀ y ∈ U, (M y).PosDef) {z : V n} (hz : z ∈ U) + (a b : ℂ) (u v : V n) : + wderiv b u (wderiv a v (fun y => (Real.log (M y).det.re : ℂ))) z = + (-(M z)⁻¹*mderiv b u M z*(M z)⁻¹*mderiv a v M z + + (M z)⁻¹*mderiv b u (mderiv a v M) z).trace := by + have hs := hM.contDiffAt (hU.mem_nhds hz) + have hi := (MatrixSmoothGeneral.inverse hM + (fun y hy => ne_of_gt (hp y hy).det_pos)).contDiffAt (hU.mem_nhds hz) + have he : wderiv a v (fun y => (Real.log (M y).det.re : ℂ)) =ᶠ[𝓝 z] + (fun y => ((M y)⁻¹*mderiv a v M y).trace) := by + filter_upwards [hU.mem_nhds hz] with y hy + exact wderiv_logdet hU hM hp hy a v + have hprod : ContDiffAt ℝ ∞ (fun y => (M y)⁻¹*mderiv a v M y) z := by + apply contDiffAt_pi.mpr + intro i + apply contDiffAt_pi.mpr + intro j + change ContDiffAt ℝ ∞ (fun y => ∑ k, (M y)⁻¹ i k * mderiv a v M y k j) z + exact ContDiffAt.sum (fun k _ => (entry_smooth hi i k).mul + (entry_smooth (mderiv_smooth hs a v) k j)) + rw [wderiv_congr he,mderiv_trace hprod, + mderiv_mul hi (mderiv_smooth hs a v), + mderiv_inverse hU hM (fun y hy => ne_of_gt (hp y hy).det_pos) hz] + +lemma second_wderiv_logdet_at_one {U : Set (V n)} (hU : IsOpen U) + {M : V n → Matrix (Fin n) (Fin n) ℂ} (hM : ContDiffOn ℝ ∞ M U) + (hp : ∀ y ∈ U, (M y).PosDef) {z : V n} (hz : z ∈ U) + (hMz : M z = 1) (a b : ℂ) (u v : V n) : + wderiv b u (wderiv a v (fun y => (Real.log (M y).det.re : ℂ))) z = + (mderiv b u (mderiv a v M) z).trace - (mderiv b u M z*mderiv a v M z).trace := by + rw [second_wderiv_logdet hU hM hp hz,hMz] + simp only [inv_one,neg_mul,one_mul,mul_one,trace_add,trace_neg] + ring + +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/MatrixPositivity.lean b/lean/OAI/Geometry/PrescribedPotential/MatrixPositivity.lean new file mode 100644 index 0000000000000000000000000000000000000000..ac389359257d160c93b93972e31ca74bae942d08 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/MatrixPositivity.lean @@ -0,0 +1,71 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CircleRadialCalculus + +namespace OAI + +/-! Matrix Positivity. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ComplexOrder +namespace CompactMatrixPositivity +variable {n : Type*} [Fintype n] + +def rq (M : Matrix n n ℂ) (v : n → ℂ) : ℝ := (star v ⬝ᵥ (M *ᵥ v)).re + +lemma rq_smul (M : Matrix n n ℂ) (r : ℝ) (v : n → ℂ) : + rq M (r • v) = r*r*rq M v := by + unfold rq + rw [star_smul, star_trivial, Matrix.mulVec_smul, smul_dotProduct, dotProduct_smul, + smul_smul] + simp only [Complex.real_smul, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, + zero_mul, sub_zero] + +lemma posDef_of_sphere {M : Matrix n n ℂ} (hM : M.IsHermitian) + (hp : ∀ v : n → ℂ, ‖v‖ = 1 → 0 < rq M v) : M.PosDef := by + apply Matrix.PosDef.of_dotProduct_mulVec_pos hM + intro v hv + apply Complex.pos_iff.mpr + refine ⟨?_,(hM.im_star_dotProduct_mulVec_self v).symm⟩ + have hn : 0 < ‖v‖ := norm_pos_iff.mpr hv + have hw : ‖(‖v‖⁻¹ : ℝ) • v‖ = 1 := by + rw [norm_smul, Real.norm_eq_abs, abs_of_pos (inv_pos.mpr hn), inv_mul_cancel₀ hn.ne'] + have hh := hp ((‖v‖⁻¹ : ℝ) • v) hw + rw [rq_smul] at hh + exact (mul_pos_iff_of_pos_left (mul_pos (inv_pos.mpr hn) (inv_pos.mpr hn))).mp hh + +lemma continuous_rq : Continuous (fun z : Matrix n n ℂ × (n → ℂ) => rq z.1 z.2) := by + unfold rq Matrix.mulVec dotProduct + fun_prop + +variable {T Y : Type*} [TopologicalSpace T] [TopologicalSpace Y] +lemma eventually_posDef {M : T → Y → Matrix n n ℂ} {t₀ : T} {K : Set Y} + (hK : IsCompact K) (hcont : Continuous (fun z : T × Y => M z.1 z.2)) + (hherm : ∀ t y, y ∈ K → (M t y).IsHermitian) + (hpos : ∀ y ∈ K, (M t₀ y).PosDef) : + ∀ᶠ t in 𝓝 t₀, ∀ y ∈ K, (M t y).PosDef := by + have hc : IsCompact (K ×ˢ Metric.sphere (0 : n → ℂ) 1) := + hK.prod (isCompact_sphere 0 1) + have hloc : ∀ y ∈ K ×ˢ Metric.sphere (0 : n → ℂ) 1, + ∀ᶠ z : T × (Y × (n → ℂ)) in 𝓝 (t₀,y), 0 < rq (M z.1 z.2.1) z.2.2 := by + rintro ⟨y,v⟩ ⟨hy,hv⟩ + have hv1 : ‖v‖ = 1 := by simpa [Metric.mem_sphere, dist_zero_right] using hv + have hv0 : v ≠ 0 := by intro h; simp [h] at hv1 + have ht : Continuous (fun z : T × (Y × (n → ℂ)) => rq (M z.1 z.2.1) z.2.2) := + continuous_rq.comp ((hcont.comp (continuous_fst.prodMk (continuous_fst.comp continuous_snd))).prodMk + (continuous_snd.comp continuous_snd)) + exact ht.continuousAt.eventually (lt_mem_nhds ((hpos y hy).re_dotProduct_pos hv0)) + filter_upwards [hc.eventually_forall_of_forall_eventually (P := fun t y => 0 < rq (M t y.1) y.2) hloc] with t ht y hy + apply posDef_of_sphere (hherm t y hy) + intro v hv + exact ht (y,v) ⟨hy,by simpa [Metric.mem_sphere, dist_zero_right] using hv⟩ +end CompactMatrixPositivity + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/MatrixRealFrames.lean b/lean/OAI/Geometry/PrescribedPotential/MatrixRealFrames.lean new file mode 100644 index 0000000000000000000000000000000000000000..aa12d9459706292b2a69f64d2e6b1c920ce65768 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/MatrixRealFrames.lean @@ -0,0 +1,139 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.BoundedNormalFrames +import OAI.Geometry.PrescribedPotential.GlobalSobolev +import OAI.Geometry.PrescribedPotential.MatrixHilbertCoordinates + +namespace OAI + +/-! Matrix Real Frames. -/ + +section + +noncomputable section +open Set Filter Topology Matrix Finset +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace MetricSystem +open EllipticKernel FrozenPoisson HigherJet KaehlerCalculus +variable {n : ℕ} +local instance frameRealECIP : InnerProductSpace ℝ (EC n) := InnerProductSpace.rclikeToReal ℂ (EC n) + + def realMatrix (M : Mat n) : EC n →L[ℝ] EC n := + (Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n) M).restrictScalars ℝ + +lemma realMatrix_mul (M N : Mat n) : realMatrix (M*N) = (realMatrix M).comp (realMatrix N) := by + apply ContinuousLinearMap.ext + intro x + change Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n) (M*N) x = Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n) M (Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n) N x) + rw [map_mul] + rfl +lemma realMatrix_one : realMatrix (1 : Mat n) = ContinuousLinearMap.id ℝ (EC n) := by + apply ContinuousLinearMap.ext + intro x + change Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n) (1 : Mat n) x = x + rw [map_one] + rfl + +lemma realMatrix_adjoint (M : Mat n) : (realMatrix M).adjoint = realMatrix Mᴴ := by + apply ContinuousLinearMap.ext + intro x + apply ext_inner_left ℝ + intro y + rw [ContinuousLinearMap.adjoint_inner_right] + change (inner ℂ (Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n) M y) x).re = (inner ℂ y (Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n) Mᴴ x)).re + congr 1 + have he : Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n) Mᴴ = (Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n) M).adjoint := map_star _ M + rw [he,ContinuousLinearMap.adjoint_inner_right] + + def frame (C D : Mat n) (hCD : C*D=1) (hDC : D*C=1) : EC n ≃L[ℝ] EC n := + { toLinearEquiv := + { toFun := fun x => (1/2:ℝ) • realMatrix C x + invFun := fun x => (2:ℝ) • realMatrix D x + left_inv := by + intro x + have he := congrArg (fun L : EC n →L[ℝ] EC n => L x) (realMatrix_mul D C) + rw [hDC,realMatrix_one] at he + simp only [ContinuousLinearMap.comp_apply,ContinuousLinearMap.id_apply] at he + simp only [map_smul,smul_smul] + rw [← he] + norm_num + right_inv := by + intro x + have he := congrArg (fun L : EC n →L[ℝ] EC n => L x) (realMatrix_mul C D) + rw [hCD,realMatrix_one] at he + simp only [ContinuousLinearMap.comp_apply,ContinuousLinearMap.id_apply] at he + simp only [map_smul,smul_smul] + rw [← he] + norm_num + map_add' := by intro x y; simp only [map_add,smul_add] + map_smul' := by intro c x; simp only [map_smul]; exact smul_comm _ _ _ } + continuous_toFun := ((continuous_const (y := (1/2:ℝ))).smul (realMatrix C).continuous) + continuous_invFun := ((continuous_const (y := (2:ℝ))).smul (realMatrix D).continuous) } + +lemma frame_gram {ι : Type*} [Fintype ι] (e : OrthonormalBasis ι ℝ (EC n)) + (M C D : Mat n) (hCD : C*D=1) (hDC : D*C=1) (hM : Cᴴ*M*C=1) + (H : EC n →L[ℝ] EC n →L[ℝ] HM n) : + principalBilinear e M⁻¹ H = ∑ i, H (frame C D hCD hDC (e i)) (frame C D hCD hDC (e i)) := by + have hD : IsUnit D := ⟨⟨D,C,hDC,hCD⟩,rfl⟩ + have hC : IsUnit C := ⟨⟨C,D,hCD,hDC⟩,rfl⟩ + have hInv : M⁻¹ = C*Cᴴ := by + rw [unnormalize_matrix hCD hM,Matrix.mul_inv_rev,← Matrix.conjTranspose_nonsing_inv] + have hid : D⁻¹ = C := by + calc + D⁻¹ = D⁻¹*(D*C) := by rw [hDC,mul_one] + _ = C := by rw [← mul_assoc,Matrix.nonsing_inv_mul _ ((Matrix.isUnit_iff_isUnit_det _).mp hD),one_mul] + rw [hid] + let T : EC n →L[ℝ] EC n := (1/2:ℝ) • realMatrix Cᴴ + have hT : T.adjoint = (1/2:ℝ) • realMatrix C := by + dsimp [T] + rw [map_smul,realMatrix_adjoint,Matrix.conjTranspose_conjTranspose] + rw [principalBilinear_inv,principalApply_gram e (traceBilin M) T] + · rw [hT] + rfl + · intro v + have hfactor : M⁻¹ = star Cᴴ * Cᴴ := by + change M⁻¹ = Cᴴᴴ*Cᴴ + simpa only [Matrix.conjTranspose_conjTranspose] using hInv + have htr : traceBilin M (rankOne v) = (1/4:ℝ)*‖Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n) Cᴴ v‖^2 := by + convert trace_rankOne_factor M Cᴴ hfactor v using 1 + congr 1 + ext x y + simp only [rankOne,ContinuousLinearMap.smulRight_apply,_root_.smul_apply,realInner_apply,smul_eq_mul] + change (inner ℂ v x).re*(inner ℂ v y).re = _ + simp only [PiLp.inner_apply,Complex.re_sum] + rfl + rw [htr] + dsimp [T,realMatrix] + simp only [_root_.smul_apply,norm_smul,Real.norm_eq_abs] + norm_num + ring + + def realMatrixLinear (n : ℕ) : Mat n →ₗ[ℝ] (EC n →L[ℝ] EC n) where + toFun := realMatrix + map_add' := by intro M N; ext x; simp [realMatrix] + map_smul' := by + intro c M + apply ContinuousLinearMap.ext + intro x + change Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n) (c • M) x = c • Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n) M x + rw [show c • M = (c:ℂ) • M from rfl,map_smul] + rfl + +lemma frame_uniform_bound (B : ℝ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ M D : Mat n, + ‖M‖ ≤ B → ‖D‖ ≤ B → ∀ hMD hDM, + ‖(frame M D hMD hDM).toContinuousLinearMap‖ ≤ C ∧ + ‖(frame M D hMD hDM).symm.toContinuousLinearMap‖ ≤ C := by + have hcontinuous : Continuous (realMatrix (n := n)) := (realMatrixLinear n).continuous_of_finiteDimensional + obtain ⟨C,hC⟩ := (isCompact_closedBall (0:Mat n) B).exists_bound_of_continuousOn hcontinuous.continuousOn + refine ⟨2*max C 0,by positivity,fun M D hM hD hMD hDM => ?_⟩ + have hm : ‖realMatrix M‖ ≤ max C 0 := (hC M (by simpa using hM)).trans (le_max_left _ _) + have hd : ‖realMatrix D‖ ≤ max C 0 := (hC D (by simpa using hD)).trans (le_max_left _ _) + change ‖(1/2:ℝ) • realMatrix M‖ ≤ 2*max C 0 ∧ ‖(2:ℝ) • realMatrix D‖ ≤ 2*max C 0 + simp only [norm_smul,Real.norm_eq_abs] + rw [abs_of_pos (by norm_num : 0 < (1/2:ℝ)),abs_of_pos (by norm_num : 0 < (2:ℝ))] + constructor <;> nlinarith [norm_nonneg (realMatrix M)] +end MetricSystem + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/MatrixTensorCalculus.lean b/lean/OAI/Geometry/PrescribedPotential/MatrixTensorCalculus.lean new file mode 100644 index 0000000000000000000000000000000000000000..701612d8bd3d227c2f2e5e51144b0b02205ed4b4 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/MatrixTensorCalculus.lean @@ -0,0 +1,69 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.WirtingerConjugate + +namespace OAI + +/-! Matrix Tensor Calculus. -/ + +section + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +variable {n : ℕ} + +lemma mderiv_sub {M N : V n → Matrix (Fin n) (Fin n) ℂ} {z : V n} + (hM : ContDiffAt ℝ ∞ M z) (hN : ContDiffAt ℝ ∞ N z) (a : ℂ) (v : V n) : + mderiv a v (fun y => M y-N y) z = mderiv a v M z-mderiv a v N z := by + simpa only [sub_eq_add_neg,mderiv_neg hN] using mderiv_add hM hN.neg a v + +lemma mderiv_sum {α : Type*} (s : Finset α) {M : α → V n → Matrix (Fin n) (Fin n) ℂ} + {z : V n} (hM : ∀ i ∈ s, ContDiffAt ℝ ∞ (M i) z) (a : ℂ) (v : V n) : + mderiv a v (fun y => ∑ i ∈ s, M i y) z = ∑ i ∈ s, mderiv a v (M i) z := by + ext i j + simp only [mderiv,Matrix.sum_apply] + exact wderiv_sum s (fun k hk => (entry_smooth (hM k hk) i j).differentiableAt (by simp)) a v + +lemma mderiv_smul {f : V n → ℂ} {M : V n → Matrix (Fin n) (Fin n) ℂ} {z : V n} + (hf : ContDiffAt ℝ ∞ f z) (hM : ContDiffAt ℝ ∞ M z) (a : ℂ) (v : V n) : + mderiv a v (fun y => f y • M y) z = wderiv a v f z • M z + f z • mderiv a v M z := by + ext i j + exact wderiv_mul (hf.differentiableAt (by simp)) + ((entry_smooth hM i j).differentiableAt (by simp)) a v + +lemma matrix_smooth_smul {f : V n → ℂ} {M : V n → Matrix (Fin n) (Fin n) ℂ} {z : V n} + (hf : ContDiffAt ℝ ∞ f z) (hM : ContDiffAt ℝ ∞ M z) : + ContDiffAt ℝ ∞ (fun y => f y • M y) z := by + apply contDiffAt_pi.mpr + intro i + apply contDiffAt_pi.mpr + intro j + exact hf.mul (entry_smooth hM i j) + +lemma mderiv_conjTranspose {M : V n → Matrix (Fin n) (Fin n) ℂ} {z : V n} + (hM : ContDiffAt ℝ ∞ M z) (v : V n) : + mderiv (-Complex.I) v (fun y => (M y)ᴴ) z = (mderiv Complex.I v M z)ᴴ := by + ext i j + exact dz_conj ((entry_smooth hM j i).differentiableAt (by simp)) v + +lemma mderiv_bar_conjTranspose {M : V n → Matrix (Fin n) (Fin n) ℂ} {z : V n} + (hM : ContDiffAt ℝ ∞ M z) (v : V n) : + mderiv Complex.I v (fun y => (M y)ᴴ) z = (mderiv (-Complex.I) v M z)ᴴ := by + ext i j + exact dzbar_conj ((entry_smooth hM j i).differentiableAt (by simp)) v + +lemma matrix_smooth_conjTranspose {M : V n → Matrix (Fin n) (Fin n) ℂ} {z : V n} + (hM : ContDiffAt ℝ ∞ M z) : ContDiffAt ℝ ∞ (fun y => (M y)ᴴ) z := by + apply contDiffAt_pi.mpr + intro i + apply contDiffAt_pi.mpr + intro j + exact Complex.conjCLE.contDiff.contDiffAt.comp z (entry_smooth hM j i) + +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/MatrixTraceInequalities.lean b/lean/OAI/Geometry/PrescribedPotential/MatrixTraceInequalities.lean new file mode 100644 index 0000000000000000000000000000000000000000..0c6c71e3b6cfea92e582d119bcb66f4cd9c2c6e9 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/MatrixTraceInequalities.lean @@ -0,0 +1,79 @@ +import Mathlib + +namespace OAI + +/-! Matrix Trace Inequalities. -/ + +section + + + +noncomputable section +open Matrix +open scoped ComplexOrder MatrixOrder +namespace KaehlerCalculus +variable {n : ℕ} + +lemma weighted_trace_cauchy (G E : Matrix (Fin n) (Fin n) ℂ) (hG : G.PosSemidef) : + ‖(E*G).trace‖^2 ≤ G.trace.re * (E*Eᴴ*G).trace.re := by + let : SeminormedAddCommGroup (Matrix (Fin n) (Fin n) ℂ) := + Matrix.toMatrixSeminormedAddCommGroup G hG + let : InnerProductSpace ℂ (Matrix (Fin n) (Fin n) ℂ) := + Matrix.toMatrixInnerProductSpace G hG + have h := norm_inner_le_norm (𝕜 := ℂ) Eᴴ (1 : Matrix (Fin n) (Fin n) ℂ) + have hn := sq_le_sq₀ (norm_nonneg _) (mul_nonneg (norm_nonneg _) (norm_nonneg _)) |>.mpr h + rw [mul_pow, ← inner_self_eq_norm_sq (𝕜 := ℂ) Eᴴ, ← inner_self_eq_norm_sq (𝕜 := ℂ) (1 : Matrix (Fin n) (Fin n) ℂ)] at hn + change ‖(1*G*(Eᴴ)ᴴ).trace‖^2 ≤ (Eᴴ*G*(Eᴴ)ᴴ).trace.re * + ((1 : Matrix (Fin n) (Fin n) ℂ)*G*(1 : Matrix (Fin n) (Fin n) ℂ)ᴴ).trace.re at hn + simpa only [conjTranspose_conjTranspose,one_mul,conjTranspose_one,mul_one, + Matrix.trace_mul_comm G E,← Matrix.mul_assoc, + Matrix.trace_mul_cycle Eᴴ G E,mul_comm] using hn + +lemma trace_mul_psd_nonneg {G R : Matrix (Fin n) (Fin n) ℂ} + (hG : G.PosSemidef) (hR : R.PosSemidef) : 0 ≤ (R*G).trace.re := by + obtain ⟨B,rfl⟩ := CStarAlgebra.nonneg_iff_eq_star_mul_self.mp hG.nonneg + have h := (hR.mul_mul_conjTranspose_same B).trace_nonneg + change 0 ≤ (R*(Bᴴ*B)).trace.re + rw [Matrix.trace_mul_comm R (Bᴴ*B)] + rw [Matrix.trace_mul_cycle] at h + exact (Complex.nonneg_iff.mp h).1 + +lemma trace_inverse_cycle {G : Matrix (Fin n) (Fin n) ℂ} (hG : G.PosDef) + (Z : Matrix (Fin n) (Fin n) ℂ) : (G⁻¹*Z*G).trace = Z.trace := by + rw [Matrix.trace_mul_cycle,Matrix.mul_nonsing_inv _ + (isUnit_iff_ne_zero.mpr (ne_of_gt hG.det_pos)),one_mul] + +lemma trace_square_completion {G : Matrix (Fin n) (Fin n) ℂ} (hG : G.PosDef) + (X Y : Matrix (Fin n) (Fin n) ℂ) : + ((X-G⁻¹*Y)*(X-G⁻¹*Y)ᴴ*G).trace = + (X*Xᴴ*G).trace-(X*Yᴴ).trace-(Xᴴ*Y).trace+(Yᴴ*G⁻¹*Y).trace := by + have hInv : G⁻¹*G = 1 := Matrix.nonsing_inv_mul _ + (isUnit_iff_ne_zero.mpr (ne_of_gt hG.det_pos)) + have he : (X-G⁻¹*Y)*(X-G⁻¹*Y)ᴴ*G = + X*Xᴴ*G-X*Yᴴ-(G⁻¹*(Y*Xᴴ))*G+G⁻¹*(Y*Yᴴ) := by + rw [Matrix.conjTranspose_sub,Matrix.conjTranspose_mul, + Matrix.conjTranspose_nonsing_inv,hG.isHermitian.eq] + simp only [sub_mul,mul_sub,Matrix.mul_assoc,hInv,mul_one] + noncomm_ring + rw [he,Matrix.trace_add,Matrix.trace_sub,Matrix.trace_sub,trace_inverse_cycle hG] + rw [Matrix.trace_mul_comm Y Xᴴ,← Matrix.mul_assoc] + rw [Matrix.trace_mul_cycle G⁻¹ Y Yᴴ] + +lemma trace_gradient_square_bound {G : Matrix (Fin n) (Fin n) ℂ} (hG : G.PosDef) + (X Y : Matrix (Fin n) (Fin n) ℂ) : + ‖(Y-X*G).trace‖^2 ≤ G.trace.re * + ((X*Xᴴ*G).trace.re-(X*Yᴴ).trace.re-(Xᴴ*Y).trace.re+(Yᴴ*G⁻¹*Y).trace.re) := by + have h := weighted_trace_cauchy G (X-G⁻¹*Y) hG.posSemidef + rw [trace_square_completion hG,Complex.add_re,Complex.sub_re,Complex.sub_re] at h + have he : ((X-G⁻¹*Y)*G).trace = -(Y-X*G).trace := by + rw [sub_mul,Matrix.trace_sub,trace_inverse_cycle hG,Matrix.trace_sub] + ring + rw [he,norm_neg] at h + exact h + +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/MatrixWirtinger.lean b/lean/OAI/Geometry/PrescribedPotential/MatrixWirtinger.lean new file mode 100644 index 0000000000000000000000000000000000000000..67f22146a2eb0927ae8eb4cfdf51254a49db7ac8 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/MatrixWirtinger.lean @@ -0,0 +1,138 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalOperator +import OAI.Geometry.PrescribedPotential.WirtingerCalculus + +namespace OAI + +/-! Matrix Wirtinger. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +variable {n : ℕ} +local instance matrixWirtingerCS (n : ℕ) : ContinuousSMul ℝ (Matrix (Fin n) (Fin n) ℂ) := + inferInstanceAs (ContinuousSMul ℝ (Fin n → Fin n → ℂ)) + +lemma wderiv_sum {α : Type*} (s : Finset α) {f : α → V n → ℂ} {z : V n} + (hf : ∀ i ∈ s, DifferentiableAt ℝ (f i) z) (a : ℂ) (v : V n) : + wderiv a v (fun y => ∑ i ∈ s, f i y) z = ∑ i ∈ s, wderiv a v (f i) z := by + classical + simp only [wderiv, fderiv_fun_sum hf, _root_.sum_apply, + Finset.mul_sum] + rw [← Finset.sum_div, Finset.sum_add_distrib] + + +def mderiv (a : ℂ) (v : V n) (M : V n → Matrix (Fin n) (Fin n) ℂ) (z : V n) : + Matrix (Fin n) (Fin n) ℂ := fun i j => wderiv a v (fun y => M y i j) z + +lemma entry_smooth {M : V n → Matrix (Fin n) (Fin n) ℂ} {z : V n} + (hM : ContDiffAt ℝ ∞ M z) (i j : Fin n) : ContDiffAt ℝ ∞ (fun y => M y i j) z := + contDiffAt_pi.mp (contDiffAt_pi.mp hM i) j + +lemma matrix_smooth_mul {M N : V n → Matrix (Fin n) (Fin n) ℂ} {z : V n} + (hM : ContDiffAt ℝ ∞ M z) (hN : ContDiffAt ℝ ∞ N z) : + ContDiffAt ℝ ∞ (fun y => M y*N y) z := by + apply contDiffAt_pi.mpr + intro i + apply contDiffAt_pi.mpr + intro j + change ContDiffAt ℝ ∞ (fun y => ∑ k, M y i k*N y k j) z + exact ContDiffAt.sum (fun k _ => (entry_smooth hM i k).mul (entry_smooth hN k j)) + +lemma mderiv_add {M N : V n → Matrix (Fin n) (Fin n) ℂ} {z : V n} + (hM : ContDiffAt ℝ ∞ M z) (hN : ContDiffAt ℝ ∞ N z) (a : ℂ) (v : V n) : + mderiv a v (fun y => M y+N y) z = mderiv a v M z+mderiv a v N z := by + ext i j + exact wderiv_add ((entry_smooth hM i j).differentiableAt (by simp)) + ((entry_smooth hN i j).differentiableAt (by simp)) a v + +lemma mderiv_neg {M : V n → Matrix (Fin n) (Fin n) ℂ} {z : V n} + (hM : ContDiffAt ℝ ∞ M z) (a : ℂ) (v : V n) : + mderiv a v (fun y => -M y) z = -mderiv a v M z := by + ext i j + change wderiv a v (fun y => -(M y i j)) z = -wderiv a v (fun y => M y i j) z + have h := wderiv_const_mul ((entry_smooth hM i j).differentiableAt (by simp)) a (-1) v + simpa only [neg_one_mul] using h + +lemma mderiv_smooth {M : V n → Matrix (Fin n) (Fin n) ℂ} {z : V n} + (hM : ContDiffAt ℝ ∞ M z) (a : ℂ) (v : V n) : + ContDiffAt ℝ ∞ (mderiv a v M) z := by + exact contDiffAt_pi.mpr (fun i => contDiffAt_pi.mpr (fun j => + wderiv_smooth (entry_smooth hM i j) a v)) + +lemma mderiv_congr {M N : V n → Matrix (Fin n) (Fin n) ℂ} {z : V n} + (he : M =ᶠ[𝓝 z] N) (a : ℂ) (v : V n) : mderiv a v M z = mderiv a v N z := by + ext i j + exact wderiv_congr (he.mono (fun y hy => congrFun (congrFun hy i) j)) a v + +lemma mderiv_const (C : Matrix (Fin n) (Fin n) ℂ) (a : ℂ) (v z : V n) : + mderiv a v (fun _ => C) z = 0 := by + ext i j + exact wderiv_const a _ v z + +lemma mderiv_mul {M N : V n → Matrix (Fin n) (Fin n) ℂ} {z : V n} + (hM : ContDiffAt ℝ ∞ M z) (hN : ContDiffAt ℝ ∞ N z) (a : ℂ) (v : V n) : + mderiv a v (fun y => M y*N y) z = mderiv a v M z*N z+M z*mderiv a v N z := by + ext i j + change wderiv a v (fun y => ∑ k, M y i k*N y k j) z = _ + rw [wderiv_sum Finset.univ (fun k _ => ((entry_smooth hM i k).differentiableAt (by simp)).fun_mul + ((entry_smooth hN k j).differentiableAt (by simp)))] + simp only [wderiv_mul ((entry_smooth hM _ _).differentiableAt (by simp)) + ((entry_smooth hN _ _).differentiableAt (by simp)), Finset.sum_add_distrib, + Matrix.add_apply,Matrix.mul_apply,mderiv] + +lemma mderiv_mul_differentiable {M N : V n → Matrix (Fin n) (Fin n) ℂ} {z : V n} + (hM : DifferentiableAt ℝ M z) (hN : DifferentiableAt ℝ N z) (a : ℂ) (v : V n) : + mderiv a v (fun y => M y*N y) z = mderiv a v M z*N z+M z*mderiv a v N z := by + have hm (i j : Fin n) := differentiableAt_pi.mp (differentiableAt_pi.mp hM i) j + have hn (i j : Fin n) := differentiableAt_pi.mp (differentiableAt_pi.mp hN i) j + ext i j + change wderiv a v (fun y => ∑ k, M y i k*N y k j) z = _ + rw [wderiv_sum Finset.univ (fun k _ => (hm i k).fun_mul (hn k j))] + simp only [wderiv_mul (hm _ _) (hn _ _),Finset.sum_add_distrib, + Matrix.add_apply,Matrix.mul_apply,mderiv] + +lemma mderiv_trace_differentiable {M : V n → Matrix (Fin n) (Fin n) ℂ} {z : V n} + (hM : DifferentiableAt ℝ M z) (a : ℂ) (v : V n) : + wderiv a v (fun y => (M y).trace) z = (mderiv a v M z).trace := by + exact wderiv_sum Finset.univ (fun i _ => + differentiableAt_pi.mp (differentiableAt_pi.mp hM i) i) a v + +lemma mderiv_inverse {U : Set (V n)} (hU : IsOpen U) + {M : V n → Matrix (Fin n) (Fin n) ℂ} (hM : ContDiffOn ℝ ∞ M U) + (hn : ∀ y ∈ U, (M y).det ≠ 0) {z : V n} (hz : z ∈ U) (a : ℂ) (v : V n) : + mderiv a v (fun y => (M y)⁻¹) z = -(M z)⁻¹*mderiv a v M z*(M z)⁻¹ := by + have hi := (MatrixSmoothGeneral.inverse hM hn).contDiffAt (hU.mem_nhds hz) + have hs := hM.contDiffAt (hU.mem_nhds hz) + have he : (fun y => M y*(M y)⁻¹) =ᶠ[𝓝 z] (fun _ => 1) := by + filter_upwards [hU.mem_nhds hz] with y hy + exact Matrix.mul_nonsing_inv _ (isUnit_iff_ne_zero.mpr (hn y hy)) + have hh := mderiv_congr he a v + rw [mderiv_mul hs hi,mderiv_const] at hh + have hm := congrArg (fun B => (M z)⁻¹*B) hh + rw [mul_add, ← mul_assoc (M z)⁻¹ (M z), + Matrix.nonsing_inv_mul _ (isUnit_iff_ne_zero.mpr (hn z hz)),one_mul,mul_zero] at hm + apply eq_neg_of_add_eq_zero_right at hm + simpa only [neg_mul, mul_assoc] using hm + +lemma mderiv_trace {M : V n → Matrix (Fin n) (Fin n) ℂ} {z : V n} + (hM : ContDiffAt ℝ ∞ M z) (a : ℂ) (v : V n) : + wderiv a v (fun y => (M y).trace) z = (mderiv a v M z).trace := by + exact wderiv_sum Finset.univ (fun i _ => (entry_smooth hM i i).differentiableAt (by simp)) a v + +lemma mderiv_comm {M : V n → Matrix (Fin n) (Fin n) ℂ} {z : V n} + (hM : ContDiffAt ℝ ∞ M z) (a b : ℂ) (u v : V n) : + mderiv a u (mderiv b v M) z = mderiv b v (mderiv a u M) z := by + ext i j + exact wderiv_comm (entry_smooth hM i j) a b u v +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/MetricFamilyBootstrap.lean b/lean/OAI/Geometry/PrescribedPotential/MetricFamilyBootstrap.lean new file mode 100644 index 0000000000000000000000000000000000000000..bf7dcb62c23a11998a15dc6fe1d7fe32dc95eb4b --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/MetricFamilyBootstrap.lean @@ -0,0 +1,99 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CompactCoefficientBootstrap +import OAI.Geometry.PrescribedPotential.EncodedMetricEquation +import OAI.Geometry.PrescribedPotential.MatrixCoefficientSmooth +import OAI.Geometry.PrescribedPotential.MatrixRealFrames + +namespace OAI + +/-! Metric Family Bootstrap. -/ + +section + +noncomputable section +open Set Filter Topology Matrix Metric Finset +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace MetricSystem +open EllipticKernel FrozenPoisson HigherJet KaehlerCalculus +variable {n : ℕ} {α : Type*} +local instance bootstrapRealECIP : InnerProductSpace ℝ (EC n) := InnerProductSpace.rclikeToReal ℂ (EC n) +local instance bootstrapRealHMIP : InnerProductSpace ℝ (HM n) := InnerProductSpace.rclikeToReal ℂ (HM n) + +lemma metric_family_bootstrap {U : Set (EC n)} (hU : IsOpen U) + (M : α → LocalKaehlerField n) (r : α → EC n → HM n) + (hdom : ∀ s x, x ∈ U → coordinateEquiv n x ∈ (M s).domain) + (hr : ∀ s, ContDiffOn ℝ ∞ (r s) U) + (hric : ∀ s x, x ∈ U → encode n ((M s).ricciHessian (coordinateEquiv n x)) = r s x) + (hfirst : ∀ K, IsCompact K → K ⊆ U → ∃ C : ℝ, ∀ s x, x ∈ K → + ‖fderiv ℝ (fun y => encode n ((M s).matrix (coordinateEquiv n y))) x‖ ≤ C) + (hframeBound : ∀ K, IsCompact K → K ⊆ U → ∃ B : ℝ, 0 ≤ B ∧ ∀ s x, x ∈ K → + ∀ C D : Mat n, C*D=1 → D*C=1 → Cᴴ*(M s).matrix (coordinateEquiv n x)*C=1 → ‖C‖ ≤ B ∧ ‖D‖ ≤ B) + (hrbounds : ∀ m K, IsCompact K → K ⊆ U → ∃ C : ℝ, ∀ j, j ≤ m → ∀ s x, x ∈ K → + ‖iteratedFDeriv ℝ j (r s) x‖ ≤ C) : + ∀ m, 1 ≤ m → ∀ K, IsCompact K → K ⊆ U → + ∃ C : ℝ, 0 ≤ C ∧ ∀ s x, x ∈ K → + ‖iteratedFDeriv ℝ m (fun y => encode n ((M s).matrix (coordinateEquiv n y))) x‖ ≤ C := by + classical + let u : α → EC n → HM n := fun s y => encode n ((M s).matrix (coordinateEquiv n y)) + have hu : ∀ s, ContDiffOn ℝ ∞ (u s) U := by + intro s x hx + exact ((encode n).contDiff.contDiffAt.comp x + (((M s).smooth.contDiffAt ((M s).isOpen.mem_nhds (hdom s x hx))).comp x + (coordinateEquiv n).contDiff.contDiffAt)).contDiffWithinAt + have hf (s : α) (x : EC n) : ∃ C D : Mat n, C*D=1 ∧ D*C=1 ∧ + (x ∈ U → Cᴴ*(M s).matrix (coordinateEquiv n x)*C=1) := by + by_cases hx : x ∈ U + · obtain ⟨C,hC,hN⟩ := whitening _ ((M s).positive _ (hdom s x hx)) + obtain ⟨Q,rfl⟩ := hC + exact ⟨Q,↑Q⁻¹,Q.mul_inv,Q.inv_mul,fun _ => hN⟩ + · exact ⟨1,1,by simp,by simp,fun hh => (hx hh).elim⟩ + choose C D hCD hDC hN using hf + let τ : α → EC n → EC n ≃L[ℝ] EC n := fun s x => frame (C s x) (D s x) (hCD s x) (hDC s x) + let basis := stdOrthonormalBasis ℝ (EC n) + apply quasilinear_compact_coefficient_bootstrap (principalBilinear basis) hU basis u r inverseCoefficient quadraticCoefficient τ hu hr + · intro s x hx + exact inverseCoefficient_smooth (by + change ((M s).matrix (coordinateEquiv n x)).det ≠ 0 + exact ne_of_gt ((M s).positive _ (hdom s x hx)).det_pos) + · intro s x hx + exact quadraticCoefficient_smooth (by + change ((M s).matrix (coordinateEquiv n x)).det ≠ 0 + exact ne_of_gt ((M s).positive _ (hdom s x hx)).det_pos) + · intro s x hx + exact (encoded_metric_equation basis (M s) (hdom s x hx)).trans (by rw [hric s x hx]) + · intro s x hx H + exact frame_gram basis _ (C s x) (D s x) (hCD s x) (hDC s x) (hN s x hx) H + · intro K hK hKU + obtain ⟨B,hB,hbound⟩ := hframeBound K hK hKU + obtain ⟨R,hR,hRbound⟩ := frame_uniform_bound (n := n) B + refine ⟨R,hR,fun s x hx => ?_⟩ + obtain ⟨hc,hd⟩ := hbound s x hx (C s x) (D s x) (hCD s x) (hDC s x) (hN s x (hKU hx)) + exact hRbound _ _ hc hd _ _ + · intro K hK hKU + obtain ⟨B,hB,hbound⟩ := hframeBound K hK hKU + obtain ⟨J,hJ⟩ := hfirst K hK hKU + let P : Set (HM n) := (fun p : Mat n × Mat n => encode n (p.2ᴴ*p.2)) '' boundedFramePairs B + have hP : IsCompact P := (boundedFramePairs_compact B).image + ((encode n).continuous.comp ((continuous_snd.matrix_conjTranspose).matrix_mul continuous_snd)) + have hpositive : ∀ p ∈ P, ((encode n).symm p).PosDef := by + rintro p ⟨q,hq,rfl⟩ + rw [ContinuousLinearEquiv.symm_apply_apply] + simpa only [mul_one] using Matrix.PosDef.one.conjTranspose_mul_mul_same + (Matrix.mulVec_injective_iff_isUnit.mpr (boundedFramePairs_units hq).2) + refine ⟨P ×ˢ closedBall (0:EC n →L[ℝ] HM n) J,hP.prod (isCompact_closedBall _ _),?_,?_⟩ + · intro s x hx + refine ⟨?_,by simpa only [firstJet,mem_closedBall,dist_zero_right] using hJ s x hx⟩ + obtain ⟨hc,hd⟩ := hbound s x hx (C s x) (D s x) (hCD s x) (hDC s x) (hN s x (hKU hx)) + refine ⟨(C s x,D s x),⟨hc,hd,hCD s x,hDC s x⟩,?_⟩ + change encode n ((D s x)ᴴ*D s x) = encode n ((M s).matrix (coordinateEquiv n x)) + rw [unnormalize_matrix (hCD s x) (hN s x (hKU hx))] + · intro p hp + have hd := ne_of_gt (hpositive p.1 hp.1).det_pos + exact ⟨inverseCoefficient_smooth hd,quadraticCoefficient_smooth hd⟩ + · exact hrbounds +end MetricSystem + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/MetricInverseTrace.lean b/lean/OAI/Geometry/PrescribedPotential/MetricInverseTrace.lean new file mode 100644 index 0000000000000000000000000000000000000000..cb8afb71e1787f6bf6d5ccd62dbf3db906d62328 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/MetricInverseTrace.lean @@ -0,0 +1,73 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.InverseTraceFunction +import OAI.Geometry.PrescribedPotential.MatrixFrameNormalization + +namespace OAI + +/-! Metric Inverse Trace. -/ + +section + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +namespace KaehlerMetric + +lemma derivativeMatrix_isUnit (g : KaehlerMetric A) (i j : Fin A.count) {x : X} + (hi : x ∈ (A.chart i).source) (hj : x ∈ (A.chart j).source) : + IsUnit (A.derivativeMatrix i j x) := by + apply (Matrix.isUnit_iff_isUnit_det _).mpr + apply isUnit_iff_ne_zero.mpr + intro he + have hh := congrArg Matrix.det (g.compatibility i j x hi hj) + rw [Matrix.det_mul,he,mul_zero] at hh + exact (ne_of_gt (g.positive i _ ((A.chart i).mapsTo hi)).det_pos) hh + +lemma inverseTrace_compatibility (g G : KaehlerMetric A) (i j : Fin A.count) {x : X} + (hi : x ∈ (A.chart i).source) (hj : x ∈ (A.chart j).source) : + KaehlerCalculus.inverseTrace (g.matrix i) (G.matrix i) (A.chart i x) = + KaehlerCalculus.inverseTrace (g.matrix j) (G.matrix j) (A.chart j x) := by + unfold KaehlerCalculus.inverseTrace + rw [g.compatibility i j x hi hj,G.compatibility i j x hi hj, + KaehlerCalculus.matrix_inverse_trace_congruence _ _ _ (g.derivativeMatrix_isUnit i j hi hj)] + +def inverseTraceValue (g G : KaehlerMetric A) (x : X) : ℝ := + let i := (A.covers x).choose + KaehlerCalculus.inverseTrace (g.matrix i) (G.matrix i) (A.chart i x) + +lemma inverseTraceValue_local (g G : KaehlerMetric A) (i : Fin A.count) {x : X} + (hi : x ∈ (A.chart i).source) : + g.inverseTraceValue G x = KaehlerCalculus.inverseTrace (g.matrix i) (G.matrix i) (A.chart i x) := by + exact g.inverseTrace_compatibility G _ i (A.covers x).choose_spec hi + +def inverseTrace (g G : KaehlerMetric A) : SmoothRealFunction A where + value := g.inverseTraceValue G + smooth i := by + apply (KaehlerCalculus.inverseTrace_smooth (A.chart i).open_target (g.smooth i) + (g.positive i) (G.smooth i)).congr + intro z hz + dsimp only [Function.comp_apply] + rw [g.inverseTraceValue_local G i ((A.chart i).mapsTo_symm hz),(A.chart i).right_inv hz] + +lemma inverseTrace_local (g G : KaehlerMetric A) (i : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart i).target) : + (g.inverseTrace G).localExpression i z = KaehlerCalculus.inverseTrace (g.matrix i) (G.matrix i) z := by + change g.inverseTraceValue G ((A.chart i).symm z) = _ + rw [g.inverseTraceValue_local G i ((A.chart i).mapsTo_symm hz),(A.chart i).right_inv hz] + +lemma inverseTrace_positive [Nonempty (Fin d)] (g G : KaehlerMetric A) (x : X) : + 0 < (g.inverseTrace G).value x := by + obtain ⟨i,hi⟩ := A.covers x + change 0 < g.inverseTraceValue G x + rw [g.inverseTraceValue_local G i hi] + exact KaehlerCalculus.inverseTrace_pos (g.positive i _ ((A.chart i).mapsTo hi)) + (G.positive i _ ((A.chart i).mapsTo hi)) +end KaehlerMetric +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/MetricLocalization.lean b/lean/OAI/Geometry/PrescribedPotential/MetricLocalization.lean new file mode 100644 index 0000000000000000000000000000000000000000..4675245820ac35addecdedd59e138244c70ba3e7 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/MetricLocalization.lean @@ -0,0 +1,223 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.VariablePoisson + +namespace OAI + +/-! Metric Localization. -/ + +section + + + +noncomputable section +open Filter Topology Set +open scoped ComplexOrder MatrixOrder Matrix.Norms.Elementwise ContDiff + +namespace MetricLocalization +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] +variable {n : ℕ} + +lemma contDiffOn_matrix_det {U : Set E} {H : E → Matrix (Fin n) (Fin n) ℂ} + (hH : ContDiffOn ℝ ∞ H U) : ContDiffOn ℝ ∞ (fun z => (H z).det) U := by + classical + simp_rw [Matrix.det_apply'] + apply ContDiffOn.sum + intro σ _ + apply contDiffOn_const.mul + apply contDiffOn_prod + intro i _ + exact contDiffOn_pi.mp (contDiffOn_pi.mp hH (σ i)) i + +lemma contDiffOn_matrix_adjugate {U : Set E} {H : E → Matrix (Fin n) (Fin n) ℂ} + (hH : ContDiffOn ℝ ∞ H U) : ContDiffOn ℝ ∞ (fun z => (H z).adjugate) U := by + classical + apply contDiffOn_pi.mpr + intro i + apply contDiffOn_pi.mpr + intro j + simp_rw [Matrix.adjugate_apply] + apply contDiffOn_matrix_det + apply contDiffOn_pi.mpr + intro k + apply contDiffOn_pi.mpr + intro l + by_cases hk : k = j + · subst k + simp only [Matrix.updateRow_self] + exact contDiffOn_const + · simp only [Matrix.updateRow_ne hk] + exact contDiffOn_pi.mp (contDiffOn_pi.mp hH k) l + +lemma contDiffOn_matrix_inv {U : Set E} {H : E → Matrix (Fin n) (Fin n) ℂ} + (hH : ContDiffOn ℝ ∞ H U) (hh : ∀ x ∈ U, (H x).det ≠ 0) : + ContDiffOn ℝ ∞ (fun z => (H z)⁻¹) U := by + simp_rw [Matrix.inv_def, Ring.inverse_eq_inv'] + exact ((contDiffOn_matrix_det hH).inv hh).smul (contDiffOn_matrix_adjugate hH) + +lemma trace_coefficient_smooth {U : Set (EllipticKernel.EC n)} + {H : EllipticKernel.EC n → Matrix (Fin n) (Fin n) ℂ} + (hH : ContDiffOn ℝ ∞ H U) (hh : ∀ x ∈ U, (H x).PosDef) + (B : EllipticKernel.Bilin (EllipticKernel.EC n)) : + ContDiffOn ℝ ∞ (fun z => (EllipticKernel.traceBilin (H z) B : ℂ)) U := by + have hi := contDiffOn_matrix_inv hH (fun x hx => ne_of_gt (hh x hx).det_pos) + have hir : ContDiffOn ℝ ∞ + (fun z => ((H z)⁻¹ * PotentialKaehler.hermitianPartMatrix + (EllipticKernel.pullBilin B)).trace.re) U := by + apply Complex.reCLM.contDiff.comp_contDiffOn + simp only [Matrix.trace, Matrix.diag_apply, Matrix.mul_apply] + apply ContDiffOn.sum + intro i _ + apply ContDiffOn.sum + intro j _ + exact (contDiffOn_pi.mp (contDiffOn_pi.mp hi i) j).mul contDiffOn_const + exact Complex.ofRealCLM.contDiff.comp_contDiffOn hir + +section Extension +variable [FiniteDimensional ℝ E] +variable {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] + +lemma smooth_bump_smul {x : E} (ψ : ContDiffBump x) (f : E → F) + (hf : ∀ y ∈ tsupport ψ, ContDiffAt ℝ ∞ f y) : + ContDiff ℝ ∞ (fun y => ψ y • f y) := by + rw [contDiff_iff_contDiffAt] + intro y + by_cases hy : y ∈ tsupport ψ + · exact ψ.contDiff.contDiffAt.smul (hf y hy) + · apply (contDiffAt_const (c := (0 : F))).congr_of_eventuallyEq + filter_upwards [notMem_tsupport_iff_eventuallyEq.mp hy] with z hz + simp [hz] + + + +lemma small_smooth_extension {U : Set E} (hU : IsOpen U) {x : E} (hx : x ∈ U) + (f : E → F) (hf : ContDiffOn ℝ ∞ f U) (hfx : f x = 0) + {ε : ℝ} (hε : 0 < ε) : + ∃ a : E → F, ContDiff ℝ ∞ a ∧ HasCompactSupport a ∧ + tsupport a ⊆ U ∧ (a =ᶠ[𝓝 x] f) ∧ ∀ y, ‖a y‖ ≤ ε := by + have hnear : ∀ᶠ y in 𝓝 x, ‖f y‖ < ε := by + have hc := (hf x hx).continuousWithinAt.continuousAt (hU.mem_nhds hx) + exact hc.norm.eventually (gt_mem_nhds (by simpa [hfx] using hε)) + obtain ⟨r, hr, hsub⟩ := Metric.nhds_basis_closedBall.mem_iff.mp + (inter_mem (hU.mem_nhds hx) hnear) + let ψ : ContDiffBump x := + { rIn := r / 2, rOut := r, rIn_pos := half_pos hr, rIn_lt_rOut := half_lt_self hr } + let a : E → F := fun y => ψ y • f y + have hsupp : tsupport a ⊆ tsupport ψ := tsupport_smul_subset_left _ _ + have hψ : tsupport ψ ⊆ U ∩ {y | ‖f y‖ < ε} := by + simpa only [ψ, ContDiffBump.tsupport_eq] using hsub + refine ⟨a, ?_, ?_, hsupp.trans (hψ.trans inter_subset_left), ?_, ?_⟩ + · apply smooth_bump_smul ψ f + intro y hy + exact (hf y (hψ hy).1).contDiffAt (hU.mem_nhds (hψ hy).1) + · exact ψ.hasCompactSupport.smul_right + · filter_upwards [ψ.eventuallyEq_one] with y hy + simp [a, hy] + · intro y + by_cases hy : y ∈ tsupport ψ + · have hf' := (hψ hy).2 + calc + ‖a y‖ = |ψ y| * ‖f y‖ := norm_smul _ _ + _ = ψ y * ‖f y‖ := by rw [abs_of_nonneg ψ.nonneg] + _ ≤ 1 * ‖f y‖ := mul_le_mul_of_nonneg_right ψ.le_one (norm_nonneg _) + _ ≤ ε := by simpa using hf'.le + · have hz : ψ y = 0 := image_eq_zero_of_notMem_tsupport hy + simp [a, hz, hε.le] + +end Extension +end MetricLocalization + +namespace MetricLocalization +open EllipticKernel FrozenPoisson SobolevChart +open scoped BoundedContinuousFunction +variable {n : ℕ} {ι : Type*} [Fintype ι] + + + +theorem local_coefficient_extension {U : Set (EC n)} (hU : IsOpen U) + (H : EC n → Matrix (Fin n) (Fin n) ℂ) (hH : ContDiffOn ℝ ∞ H U) + (hh : ∀ y ∈ U, (H y).PosDef) {x : EC n} (hx : x ∈ U) (v : ι → EC n) : + ∃ a : ι → ι → EC n →ᵇ ℂ, + (∀ i j, (a i j : EC n → ℂ).HasTemperateGrowth) ∧ + (∀ i j, HasCompactSupport (a i j : EC n → ℂ)) ∧ + perturbationBound v a * ellipticBound (H x) (hh x hx) < 1 ∧ + ∀ᶠ y in 𝓝 x, ∀ i j, + a i j y = (traceBilin (H y) (rankTwo (v i) (v j)) : ℂ) - + (traceBilin (H x) (rankTwo (v i) (v j)) : ℂ) := by + classical + let C := ellipticBound (H x) (hh x hx) + have hC : 0 < C := ellipticBound_pos _ _ + let Q : ℝ := ∑ i, ∑ j, (2 * Real.pi)^2 * ‖v i‖ * ‖v j‖ + have hQ : 0 ≤ Q := by dsimp [Q]; positivity + let ε : ℝ := 1 / (1 + Q * C) + have hden : 0 < 1 + Q * C := by positivity + have hε : 0 < ε := one_div_pos.mpr hden + let F : EC n → ι → ι → ℂ := fun y i j => + (traceBilin (H y) (rankTwo (v i) (v j)) : ℂ) - + (traceBilin (H x) (rankTwo (v i) (v j)) : ℂ) + have hF : ContDiffOn ℝ ∞ F U := by + apply contDiffOn_pi.mpr + intro i + apply contDiffOn_pi.mpr + intro j + exact (trace_coefficient_smooth hH hh _).sub contDiffOn_const + have hFx : F x = 0 := by ext i j; exact sub_self _ + obtain ⟨b, hb, hbc, _, hbe, hbn⟩ := small_smooth_extension hU hx F hF hFx hε + have hbij i j : ContDiff ℝ ∞ (fun y => b y i j) := + contDiff_pi.mp (contDiff_pi.mp hb i) j + have hbijc i j : HasCompactSupport (fun y => b y i j) := + hbc.comp_left (g := fun M : ι → ι → ℂ => M i j) rfl + have hbound i j y : ‖b y i j‖ ≤ ε := + (norm_le_pi_norm (b y i) j).trans ((norm_le_pi_norm (b y) i).trans (hbn y)) + let a : ι → ι → EC n →ᵇ ℂ := fun i j => + BoundedContinuousFunction.ofNormedAddCommGroup (fun y => b y i j) + (hbij i j).continuous ε (hbound i j) + have han i j : ‖a i j‖ ≤ ε := + (BoundedContinuousFunction.norm_le hε.le).mpr (hbound i j) + have hp : perturbationBound v a ≤ ε * Q := by + simp only [perturbationBound, Q, Finset.mul_sum] + apply Finset.sum_le_sum + intro i _ + apply Finset.sum_le_sum + intro j _ + exact mul_le_mul_of_nonneg_right (han i j) (by positivity) + refine ⟨a, fun i j => (hbijc i j).hasTemperateGrowth (hbij i j), hbijc, ?_, ?_⟩ + · change perturbationBound v a * C < 1 + calc + _ ≤ (ε * Q) * C := mul_le_mul_of_nonneg_right hp hC.le + _ = (Q * C) / (1 + Q * C) := by dsimp [ε]; ring + _ < 1 := (div_lt_one hden).mpr (by linarith) + · filter_upwards [hbe] with y hy + intro i j + exact congrFun (congrFun hy i) j + +end MetricLocalization + +namespace Anticanonical.SourceSmooth +open EllipticKernel FrozenPoisson SobolevChart +open scoped BoundedContinuousFunction +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + + + +theorem KaehlerMetric.local_inverse_coefficients (g : KaehlerMetric A) + (i : Fin A.count) {x : EC d} (hx : coordinateEquiv d x ∈ (A.chart i).target) : + let b := stdOrthonormalBasis ℝ (EC d) + let H := fun y => g.matrix i (coordinateEquiv d y) + ∃ a : Fin (Module.finrank ℝ (EC d)) → Fin (Module.finrank ℝ (EC d)) → EC d →ᵇ ℂ, + (∀ k l, (a k l : EC d → ℂ).HasTemperateGrowth) ∧ + (∀ k l, HasCompactSupport (a k l : EC d → ℂ)) ∧ + perturbationBound b a * ellipticBound (H x) (g.positive i _ hx) < 1 ∧ + ∀ᶠ y in 𝓝 x, ∀ k l, + a k l y = (traceBilin (H y) (rankTwo (b k) (b l)) : ℂ) - + (traceBilin (H x) (rankTwo (b k) (b l)) : ℂ) := by + have hs := (g.smooth i).comp (coordinateEquiv d).contDiff.contDiffOn (fun _ h => h) + exact MetricLocalization.local_coefficient_extension + ((A.chart i).open_target.preimage (coordinateEquiv d).continuous) + _ hs (fun y hy => g.positive i _ hy) hx _ + +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/MetricQuasilinearEquation.lean b/lean/OAI/Geometry/PrescribedPotential/MetricQuasilinearEquation.lean new file mode 100644 index 0000000000000000000000000000000000000000..f5462a0625960556a7c443650cfb3acfd072f1b3 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/MetricQuasilinearEquation.lean @@ -0,0 +1,36 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CalabiConnection +import OAI.Geometry.PrescribedPotential.CalabiRicciContraction + +namespace OAI + +/-! Metric Quasilinear Equation. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus.LocalKaehlerField +variable {n : ℕ} (K : LocalKaehlerField n) + +lemma metric_quasilinear_equation {z : V n} (hz : z ∈ K.domain) : + (∑ p, ∑ q, ((K.matrix z)⁻¹ p q) • + mderiv Complex.I (e q) (mderiv (-Complex.I) (e p) K.matrix) z) = + K.ricciHessian z + ∑ p, ∑ q, ((K.matrix z)⁻¹ p q) • + (mderiv Complex.I (e q) K.matrix z*(K.matrix z)⁻¹* + mderiv (-Complex.I) (e p) K.matrix z) := by + have he := congrArg (fun M => K.matrix z*M) (K.curvature_contraction hz) + simp only [Matrix.mul_sum,Matrix.mul_smul] at he + simp only [K.lower_curvature_formula hz,smul_sub,Finset.sum_sub_distrib] at he + rw [← mul_assoc,Matrix.mul_nonsing_inv _ + (isUnit_iff_ne_zero.mpr (ne_of_gt (K.positive z hz).det_pos)),one_mul] at he + exact sub_eq_iff_eq_add.mp he +end KaehlerCalculus.LocalKaehlerField + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/NonlinearCoreCommutator.lean b/lean/OAI/Geometry/PrescribedPotential/NonlinearCoreCommutator.lean new file mode 100644 index 0000000000000000000000000000000000000000..138aa4704a9dc900fae2f98e5bdab28ec61b5586 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/NonlinearCoreCommutator.lean @@ -0,0 +1,132 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.NonlinearLocalCoordinates +import OAI.Geometry.PrescribedPotential.NonlinearRemainderStrong +import OAI.Geometry.PrescribedPotential.PotentialDensityDifferential +import OAI.Geometry.PrescribedPotential.RealSobolev + +namespace OAI + +/-! Nonlinear Core Commutator. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix LineDeriv +open scoped ContDiff SchwartzMap Classical Matrix.Norms.Elementwise +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +lemma regularityError_source (p : ι) (v : EC d) (f : Smooth A) (i j : Fin d) {x : X} + (hx : x ∈ (A.euclideanChart (D.patch p).index).source) + (hκ : A.euclideanChart (D.patch p).index x ∈ tsupport (D.cutoff p : EC d → ℂ)) : + D.regularityError p v i j f x = hessianLocalizedError (D.cutoff p).realPart.val v i j + (localize A (D.patch p).index (cutoffGlobal (D.patch p).index (D.regularityOuter p)) + (cutoffGlobal_support _ _) f) (A.euclideanChart (D.patch p).index x) := by + change globalize (D.patch p).index (D.regularityCutoff p) _ x = _ + rw [globalize_apply,ite_eq_left hx,(D.regularityCutoff_one p hκ).eq_of_nhds,one_mul] + rfl + +lemma nonlinear_commutator_on_support (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (p : ι) (v : EC d) (φ : SmoothRealFunction A) {x : X} + (hx : x ∈ (A.euclideanChart (D.patch p).index).source) + (hκ : A.euclideanChart (D.patch p).index x ∈ tsupport (D.cutoff p : EC d → ℂ)) : + D.localizers.strong (k : ℝ) + (fderiv ℝ (D.completedVolume k hk) (D.localizers.embed ((k : ℝ)+2) (Smooth.ofReal φ)) + (D.localizers.embed ((k : ℝ)+2) (D.localizedDerivative p v (Smooth.ofReal φ)))) x = + D.localizedDerivative p v (Smooth.ofReal (g.potentialDensity φ)) x + + D.localizers.strong (k : ℝ) + (D.nonlinearRemainder k hk p v (D.localizers.embed ((k : ℝ)+2) (Smooth.ofReal φ))) x := by + let q := (D.patch p).index + let e := A.euclideanChart q + let y := e x + let f := localize A q (cutoffGlobal q (D.regularityOuter p)) (cutoffGlobal_support _ _) (Smooth.ofReal φ) + let κ : 𝓢(EC d, ℝ) := SchwartzMap.postcompCLM Complex.reCLM (D.cutoff p).val + let G : EC d → Matrix (Fin d) (Fin d) ℂ := fun z => g.matrix q (coordinateEquiv d z) + let B : EC d → ℂ := fun z => (G z).det⁻¹ + let ψ := (D.realLocalizedDerivative p v (RealSmooth.ofReal φ)).source + have hψ : Smooth.ofReal ψ = D.localizedDerivative p v (Smooth.ofReal φ) := + RealSmooth.ofReal_source _ + have ht : y ∈ e.target := e.mapsTo hx + have hec : coordinateEquiv d y = A.chart q x := by + simp only [y,e,ComplexAtlas.euclideanChart_apply,ContinuousLinearEquiv.apply_symm_apply] + have hf : (f : EC d → ℂ) =ᶠ[𝓝 y] Smooth.ofReal φ ∘ e.symm := + localize_cutoff_nhds q (D.regularityOuter p) (Smooth.ofReal φ) ht + (D.regularityOuter_inner p hκ) + have hH : NonlinearHessian.hessianMatrix f y = φ.hessian q (A.chart q x) := by + rw [← hec] + exact (hessianMatrix_source_nhds q φ f ht hf).eq_of_nhds + have hck : NonlinearHessian.complexCutoff κ = (D.cutoff p).realPart.val := by + ext z + rfl + have hHψ : NonlinearHessian.hessianMatrix + (SchwartzMap.smulLeftCLM ℂ (NonlinearHessian.complexCutoff κ) (∂_{v} f)) y = + ψ.hessian q (A.chart q x) := by + rw [hck,← hec] + ext i j + apply hessianEntrySchwartz_source q ψ _ ht + rw [hψ] + exact (D.localizedDerivative_local_regularity p v (Smooth.ofReal φ) ht).symm + have hG : DifferentiableAt ℝ G y := + ((metric_euclidean_smooth g q).contDiffAt (e.open_target.mem_nhds ht)).differentiableAt (by simp) + have hB : DifferentiableAt ℝ B y := + ((inverseDet_euclidean_smooth g q).contDiffAt (e.open_target.mem_nhds ht)).differentiableAt (by simp) + have hden := density_local_schwartz g q φ f ht hf + have hδden : D.localizedDerivative p v (Smooth.ofReal (g.potentialDensity φ)) x = + (κ y : ℂ) * fderiv ℝ (fun z => B z * (G z + NonlinearHessian.hessianMatrix f z).det) y v := by + rw [D.localizedDerivative_apply,ite_eq_left hx,hden.fderiv_eq] + rfl + have hM (i j : Fin d) : D.regularityMetric p i j x = G y i j := by + have hh := (D.regularityMetric_local p i j hκ).eq_of_nhds + change D.regularityMetric p i j (e.symm (e x)) = G y i j at hh + rwa [e.left_inv hx] at hh + have hBv : D.regularityInverseDet p x = B y := by + have hh := (D.regularityInverseDet_local p hκ).eq_of_nhds + change D.regularityInverseDet p (e.symm (e x)) = B y at hh + rwa [e.left_inv hx] at hh + have hDM (i j : Fin d) : D.localizedDerivative p v (D.regularityMetric p i j) x = + (κ y : ℂ) * (fderiv ℝ G y v i j) := by + rw [D.localizedDerivative_apply,ite_eq_left hx,(D.regularityMetric_local p i j hκ).fderiv_eq] + have hd : fderiv ℝ (fun z => G z i j) y v = fderiv ℝ G y v i j := by + rw [fderiv_apply (differentiableAt_pi.mp hG i),fderiv_apply hG] + rfl + change (κ y : ℂ) * fderiv ℝ (fun z => G z i j) y v = _ + rw [hd] + have hDB : D.localizedDerivative p v (D.regularityInverseDet p) x = + (κ y : ℂ) * fderiv ℝ B y v := by + rw [D.localizedDerivative_apply,ite_eq_left hx,(D.regularityInverseDet_local p hκ).fderiv_eq] + rfl + rw [← hψ,D.completedVolumeDerivative_source k hk φ ψ q (by simpa [q] using hx), + D.nonlinearRemainder_strong_embed,hδden,hBv,hDB] + have hmat : (fun (i j : Fin d) => D.regularityMetric p i j x + + D.regularityHessian p i j (Smooth.ofReal φ) x) = G y + NonlinearHessian.hessianMatrix f y := by + ext i j + rw [hM,D.regularityHessian_source p φ i j hx hκ,hH] + rfl + have herr : (fun (i j : Fin d) => D.regularityError p v i j (Smooth.ofReal φ) x - + D.localizedDerivative p v (D.regularityMetric p i j) x) = + NonlinearHessian.cutoffHessianError κ v f y - κ y • fderiv ℝ G y v := by + ext i j + rw [D.regularityError_source p v (Smooth.ofReal φ) i j hx hκ,hDM] + change hessianLocalizedError (D.cutoff p).realPart.val v i j f y - + (κ y : ℂ) * fderiv ℝ G y v i j = + hessianLocalizedError (NonlinearHessian.complexCutoff κ) v i j f y - + κ y • (fderiv ℝ G y v i j) + rw [hck,Complex.real_smul] + rw [hmat,herr] + have hh := NonlinearHessian.determinant_cutoff_commutator κ v f B G y hB hG + rw [hHψ] at hh + simpa only [B,G,hec,hH,add_sub_assoc] using hh + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/NonlinearHessianCommutator.lean b/lean/OAI/Geometry/PrescribedPotential/NonlinearHessianCommutator.lean new file mode 100644 index 0000000000000000000000000000000000000000..e9eff741909fb093ea526fd7252b10a9f13c4e59 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/NonlinearHessianCommutator.lean @@ -0,0 +1,118 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.HessianCommutator +import OAI.Geometry.PrescribedPotential.SobolevDeterminant + +namespace OAI + +/-! Nonlinear Hessian Commutator. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix LineDeriv +open scoped ContDiff SchwartzMap Classical Matrix.Norms.Elementwise +namespace NonlinearHessian +open GlobalElliptic Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} +local instance matrixContinuousSMul (n : ℕ) : ContinuousSMul ℝ (Matrix (Fin n) (Fin n) ℂ) := + inferInstanceAs (ContinuousSMul ℝ (Fin n → Fin n → ℂ)) + +lemma determinant_contDiff (n : ℕ) : + ContDiff ℝ ∞ (fun M : Matrix (Fin n) (Fin n) ℂ => M.det) := by + simp only [Matrix.det_apply'] + apply ContDiff.sum + intro σ _ + apply contDiff_const.mul + apply contDiff_prod + intro j _ + fun_prop + +def detDifferential {n : ℕ} (M : Matrix (Fin n) (Fin n) ℂ) : + Matrix (Fin n) (Fin n) ℂ →L[ℝ] ℂ := fderiv ℝ Matrix.det M + +lemma detDifferential_hasFDeriv {n : ℕ} (M : Matrix (Fin n) (Fin n) ℂ) : + HasFDerivAt Matrix.det (detDifferential M) M := + (determinant_contDiff n).differentiable (by simp) M |>.hasFDerivAt + +def hessianMatrix (f : 𝓢(EC d, ℂ)) (x : EC d) : Matrix (Fin d) (Fin d) ℂ := + fun i j => hessianEntrySchwartz i j f x + +lemma hessianMatrix_contDiff (f : 𝓢(EC d, ℂ)) : ContDiff ℝ ∞ (hessianMatrix f) := by + apply contDiff_pi.mpr + intro i + apply contDiff_pi.mpr + intro j + exact (hessianEntrySchwartz i j f).smooth' + +lemma hessianMatrix_fderiv (f : 𝓢(EC d, ℂ)) (x v : EC d) (i j : Fin d) : + fderiv ℝ (hessianMatrix f) x v i j = (∂_{v} (hessianEntrySchwartz i j f)) x := by + rw [SchwartzMap.lineDerivOp_apply_eq_fderiv] + change fderiv ℝ (fun y : EC d => fun (i j : Fin d) => hessianEntrySchwartz i j f y) x v i j = _ + have H : HasFDerivAt (fun y : EC d => fun (i j : Fin d) => hessianEntrySchwartz i j f y) + (ContinuousLinearMap.pi fun i => ContinuousLinearMap.pi fun j => + fderiv ℝ (hessianEntrySchwartz i j f) x) x := by + apply hasFDerivAt_pi.mpr + intro i + apply hasFDerivAt_pi.mpr + intro j + exact (hessianEntrySchwartz i j f).smooth'.differentiable (by simp) x |>.hasFDerivAt + exact congrArg (fun L : EC d →L[ℝ] (Fin d → Fin d → ℂ) => L v i j) H.fderiv + +def complexCutoff (κ : 𝓢(EC d, ℝ)) : 𝓢(EC d, ℂ) := + SchwartzMap.postcompCLM Complex.ofRealCLM κ + +@[simp] lemma complexCutoff_apply (κ : 𝓢(EC d, ℝ)) (x : EC d) : + complexCutoff κ x = (κ x : ℂ) := rfl + +def cutoffHessianError (κ : 𝓢(EC d, ℝ)) (v : EC d) (f : 𝓢(EC d, ℂ)) (x : EC d) : + Matrix (Fin d) (Fin d) ℂ := fun i j => hessianLocalizedError (complexCutoff κ) v i j f x + +lemma hessianMatrix_cutoff (κ : 𝓢(EC d, ℝ)) (v : EC d) (f : 𝓢(EC d, ℂ)) (x : EC d) : + hessianMatrix (SchwartzMap.smulLeftCLM ℂ (complexCutoff κ) (∂_{v} f)) x = + κ x • fderiv ℝ (hessianMatrix f) x v + cutoffHessianError κ v f x := by + ext i j + change hessianEntrySchwartz i j (SchwartzMap.smulLeftCLM ℂ (complexCutoff κ) (∂_{v} f)) x = _ + rw [hessianLocalizedError_identity] + simp only [_root_.add_apply] + rw [SchwartzMap.smulLeftCLM_apply_apply (complexCutoff κ).hasTemperateGrowth] + change (κ x : ℂ) • (∂_{v} (hessianEntrySchwartz i j f)) x + + hessianLocalizedError (complexCutoff κ) v i j f x = + κ x • (fderiv ℝ (hessianMatrix f) x v i j) + cutoffHessianError κ v f x i j + rw [hessianMatrix_fderiv] + simp only [Complex.real_smul] + rfl + + + +lemma determinant_cutoff_commutator + (κ : 𝓢(EC d, ℝ)) (v : EC d) (f : 𝓢(EC d, ℂ)) + (B : EC d → ℂ) (G : EC d → Matrix (Fin d) (Fin d) ℂ) (x : EC d) + (hB : DifferentiableAt ℝ B x) (hG : DifferentiableAt ℝ G x) : + B x * detDifferential (G x + hessianMatrix f x) + (hessianMatrix (SchwartzMap.smulLeftCLM ℂ (complexCutoff κ) (∂_{v} f)) x) = + (κ x : ℂ) * fderiv ℝ (fun y => B y * (G y + hessianMatrix f y).det) x v + + B x * detDifferential (G x + hessianMatrix f x) + (cutoffHessianError κ v f x - κ x • fderiv ℝ G x v) - + (κ x : ℂ) * fderiv ℝ B x v * (G x + hessianMatrix f x).det := by + have hH := (hessianMatrix_contDiff f).differentiable (by simp) x + have hd := (detDifferential_hasFDeriv (G x + hessianMatrix f x)).comp x + (hG.hasFDerivAt.add hH.hasFDerivAt) + have hq := (hB.hasFDerivAt.mul hd).fderiv + change fderiv ℝ (fun y => B y * (G y + hessianMatrix f y).det) x = _ at hq + have hqx : fderiv ℝ (fun y => B y * (G y + hessianMatrix f y).det) x v = + B x * detDifferential (G x + hessianMatrix f x) + (fderiv ℝ G x v + fderiv ℝ (hessianMatrix f) x v) + + (G x + hessianMatrix f x).det * fderiv ℝ B x v := by + rw [hq] + rfl + rw [hqx,hessianMatrix_cutoff] + simp only [map_add,map_sub,map_smul,Complex.real_smul] + ring +end NonlinearHessian + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/NonlinearLocalCoordinates.lean b/lean/OAI/Geometry/PrescribedPotential/NonlinearLocalCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..1cd7ddf27c0d80011c3322b312be8ece975fb94a --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/NonlinearLocalCoordinates.lean @@ -0,0 +1,99 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.NonlinearHessianCommutator +import OAI.Geometry.PrescribedPotential.RegularityCoordinates +import OAI.Geometry.PrescribedPotential.NonlinearRemainder +import OAI.Geometry.PrescribedPotential.PotentialDensity + +namespace OAI + +/-! Nonlinear Local Coordinates. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix LineDeriv +open scoped ContDiff SchwartzMap Classical Matrix.Norms.Elementwise +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] + +omit [T2Space X] [CompactSpace X] in +lemma hessianEntrySchwartz_source (q : Fin A.count) (φ : SmoothRealFunction A) + (f : 𝓢(EC d, ℂ)) {y : EC d} (hy : y ∈ (A.euclideanChart q).target) + (he : (f : EC d → ℂ) =ᶠ[𝓝 y] Smooth.ofReal φ ∘ (A.euclideanChart q).symm) + (i j : Fin d) : hessianEntrySchwartz i j f y = φ.hessian q (coordinateEquiv d y) i j := by + let u : EC d → ℝ := φ.localExpression q ∘ coordinateEquiv d + have hu : ContDiffAt ℝ ∞ u y := (φ.euclidean_smooth q).contDiffAt + (by simpa only [ComplexAtlas.euclideanChart_target] using + (A.euclideanChart q).open_target.mem_nhds hy) + have hre : (Smooth.ofReal φ ∘ (A.euclideanChart q).symm) = Complex.ofRealCLM ∘ u := rfl + rw [hessianEntrySchwartz_real hu _ (he.trans (Filter.Eventually.of_forall (congr_fun hre))) i j, + pullBilin_hessian hu] + have hcomp : u ∘ (coordinateEquiv d).symm = φ.localExpression q := by + funext z + simp [u] + rw [hcomp] + rfl + +omit [T2Space X] [CompactSpace X] in +lemma hessianMatrix_source_nhds (q : Fin A.count) (φ : SmoothRealFunction A) + (f : 𝓢(EC d, ℂ)) {y : EC d} (hy : y ∈ (A.euclideanChart q).target) + (he : (f : EC d → ℂ) =ᶠ[𝓝 y] Smooth.ofReal φ ∘ (A.euclideanChart q).symm) : + NonlinearHessian.hessianMatrix f =ᶠ[𝓝 y] (fun z => φ.hessian q (coordinateEquiv d z)) := by + filter_upwards [(A.euclideanChart q).open_target.mem_nhds hy,he.eventually_nhds] with z hz hez + ext i j + exact hessianEntrySchwartz_source q φ f hz hez i j + +omit [T2Space X] [CompactSpace X] in +lemma density_local_schwartz (g : KaehlerMetric A) (q : Fin A.count) (φ : SmoothRealFunction A) + (f : 𝓢(EC d, ℂ)) {y : EC d} (hy : y ∈ (A.euclideanChart q).target) + (he : (f : EC d → ℂ) =ᶠ[𝓝 y] Smooth.ofReal φ ∘ (A.euclideanChart q).symm) : + (Smooth.ofReal (g.potentialDensity φ) ∘ (A.euclideanChart q).symm) =ᶠ[𝓝 y] + (fun z => (g.matrix q (coordinateEquiv d z)).det⁻¹ * + (g.matrix q (coordinateEquiv d z) + NonlinearHessian.hessianMatrix f z).det) := by + filter_upwards [(A.euclideanChart q).open_target.mem_nhds hy, + hessianMatrix_source_nhds q φ f hy he] with z hz hez + change ((g.potentialDensity φ).value ((A.euclideanChart q).symm z) : ℂ) = _ + rw [g.potentialDensity_complex φ q (by simpa using ((A.euclideanChart q).symm.mapsTo hz))] + have hec : A.chart q ((A.euclideanChart q).symm z) = coordinateEquiv d z := by + have hh := congrArg (coordinateEquiv d) ((A.euclideanChart q).right_inv hz) + simpa only [ComplexAtlas.euclideanChart_apply, ContinuousLinearEquiv.apply_symm_apply] using hh + rw [KaehlerMetric.volumePolynomial,hec,hez,div_eq_mul_inv,mul_comm] + +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +omit [CompactSpace X] in +lemma regularityMetric_local (p : ι) (i j : Fin d) {y : EC d} + (hy : y ∈ tsupport (D.cutoff p : EC d → ℂ)) : + (D.regularityMetric p i j ∘ (A.euclideanChart (D.patch p).index).symm) =ᶠ[𝓝 y] + (fun z => g.matrix (D.patch p).index (coordinateEquiv d z) i j) := by + have ht := (D.cutoff p).support_sub hy + filter_upwards [chartFunction_local (D.patch p).index (D.regularityCutoff p) + (fun z => g.matrix (D.patch p).index (coordinateEquiv d z) i j) _ ht, + D.regularityCutoff_one p hy] with z hz he + change D.regularityMetric p i j ((A.euclideanChart (D.patch p).index).symm z) = _ at hz ⊢ + rw [hz,he,one_mul] + +omit [CompactSpace X] in +lemma regularityInverseDet_local (p : ι) {y : EC d} + (hy : y ∈ tsupport (D.cutoff p : EC d → ℂ)) : + (D.regularityInverseDet p ∘ (A.euclideanChart (D.patch p).index).symm) =ᶠ[𝓝 y] + (fun z => (g.matrix (D.patch p).index (coordinateEquiv d z)).det⁻¹) := by + have ht := (D.cutoff p).support_sub hy + filter_upwards [chartFunction_local (D.patch p).index (D.regularityCutoff p) + (fun z => (g.matrix (D.patch p).index (coordinateEquiv d z)).det⁻¹) _ ht, + D.regularityCutoff_one p hy] with z hz he + change D.regularityInverseDet p ((A.euclideanChart (D.patch p).index).symm z) = _ at hz ⊢ + rw [hz,he,one_mul] + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/NonlinearRemainder.lean b/lean/OAI/Geometry/PrescribedPotential/NonlinearRemainder.lean new file mode 100644 index 0000000000000000000000000000000000000000..243200130b9719640d36d1fceacd415992e2ac71 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/NonlinearRemainder.lean @@ -0,0 +1,87 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CircleRadialCalculus +import OAI.Geometry.PrescribedPotential.CompletedProduct +import OAI.Geometry.PrescribedPotential.GlobalMetricEntries +import OAI.Geometry.PrescribedPotential.RegularityCutoffs +import OAI.Geometry.PrescribedPotential.RegularityJets +import OAI.Geometry.PrescribedPotential.SobolevDetDifferential + +namespace OAI + +/-! Nonlinear Remainder. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff Classical Matrix.Norms.Elementwise +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +def regularityMetric (p : ι) (i j : Fin d) : Smooth A := + chartFunction (D.patch p).index (D.regularityCutoff p) + (fun y => g.matrix (D.patch p).index (coordinateEquiv d y) i j) + (contDiffOn_pi.mp (contDiffOn_pi.mp (metric_euclidean_smooth g (D.patch p).index) i) j) + +def regularityInverseDet (p : ι) : Smooth A := + chartFunction (D.patch p).index (D.regularityCutoff p) + (fun y => (g.matrix (D.patch p).index (coordinateEquiv d y)).det⁻¹) + (inverseDet_euclidean_smooth g (D.patch p).index) + +def regularityMatrix (k : ℕ) (p : ι) (u : D.localizers.Sobolev ((k : ℝ)+2)) : + Matrix (Fin d) (Fin d) (D.localizers.Sobolev (k : ℝ)) := + fun i j => D.localizers.embed (k : ℝ) (D.regularityMetric p i j) + + D.completedRegularityHessian k p i j u + +def regularityErrorMatrix (k : ℕ) (p : ι) (v : EC d) + (u : D.localizers.Sobolev ((k : ℝ)+2)) : + Matrix (Fin d) (Fin d) (D.localizers.Sobolev (k : ℝ)) := + fun i j => D.completedRegularityError k p v i j u - + D.localizers.embed (k : ℝ) (D.localizedDerivative p v (D.regularityMetric p i j)) + +def nonlinearRemainder (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (p : ι) (v : EC d) + (u : D.localizers.Sobolev ((k : ℝ)+2)) : D.localizers.Sobolev (k : ℝ) := + D.product k hk (D.localizers.embed (k : ℝ) (D.regularityInverseDet p)) + (D.detDifferential k hk d (D.regularityMatrix k p u) (D.regularityErrorMatrix k p v u)) - + D.product k hk (D.localizers.embed (k : ℝ) + (D.localizedDerivative p v (D.regularityInverseDet p))) + (D.determinant k hk d (D.regularityMatrix k p u)) + +lemma regularityMatrix_contDiff (k : ℕ) (p : ι) : ContDiff ℝ ∞ (D.regularityMatrix k p) := by + apply contDiff_pi.mpr + intro i + apply contDiff_pi.mpr + intro j + exact contDiff_const.add (D.completedRegularityHessian k p i j).contDiff + +lemma regularityErrorMatrix_contDiff (k : ℕ) (p : ι) (v : EC d) : + ContDiff ℝ ∞ (D.regularityErrorMatrix k p v) := by + apply contDiff_pi.mpr + intro i + apply contDiff_pi.mpr + intro j + exact (D.completedRegularityError k p v i j).contDiff.sub contDiff_const + +lemma nonlinearRemainder_contDiff (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (p : ι) (v : EC d) : + ContDiff ℝ ∞ (D.nonlinearRemainder k hk p v) := by + apply ContDiff.sub + · exact (D.product k hk (D.localizers.embed (k : ℝ) (D.regularityInverseDet p))).contDiff.comp + (((D.detDifferential_contDiff k hk d).comp (D.regularityMatrix_contDiff k p)).clm_apply + (D.regularityErrorMatrix_contDiff k p v)) + · exact (D.product k hk (D.localizers.embed (k : ℝ) + (D.localizedDerivative p v (D.regularityInverseDet p)))).contDiff.comp + ((D.determinant_map_contDiff k hk d).comp (D.regularityMatrix_contDiff k p)) + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/NonlinearRemainderStrong.lean b/lean/OAI/Geometry/PrescribedPotential/NonlinearRemainderStrong.lean new file mode 100644 index 0000000000000000000000000000000000000000..99c096ae3e9c34a1ebe40a53f507726de607bd4b --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/NonlinearRemainderStrong.lean @@ -0,0 +1,64 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.NonlinearHessianCommutator +import OAI.Geometry.PrescribedPotential.NonlinearRemainder + +namespace OAI + +/-! Nonlinear Remainder Strong. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff Classical Matrix.Norms.Elementwise +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +lemma nonlinearRemainder_strong_embed (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (p : ι) (v : EC d) (f : Smooth A) (x : X) : + D.localizers.strong (k : ℝ) + (D.nonlinearRemainder k hk p v (D.localizers.embed ((k : ℝ)+2) f)) x = + D.regularityInverseDet p x * + NonlinearHessian.detDifferential + (fun i j => D.regularityMetric p i j x + D.regularityHessian p i j f x) + (fun i j => D.regularityError p v i j f x - + D.localizedDerivative p v (D.regularityMetric p i j) x) - + D.localizedDerivative p v (D.regularityInverseDet p) x * + Matrix.det (fun i j => D.regularityMetric p i j x + D.regularityHessian p i j f x) := by + have hs : (Module.finrank ℝ (EC d) : ℝ) < 2*(k : ℝ) := by + have hh : (Module.finrank ℝ (EC d) : ℝ) < (k : ℝ) := by exact_mod_cast hk + linarith [Nat.cast_nonneg (α := ℝ) k] + simp only [nonlinearRemainder,map_sub,BoundedContinuousFunction.sub_apply, + D.product_strong,BoundedContinuousFunction.mul_apply,D.localizers.strong_embed _ hs] + erw [D.detDifferential_strong,D.determinant_strong] + have hM : (fun (i j : Fin d) => D.localizers.strong (k : ℝ) + (D.regularityMatrix k p (D.localizers.embed ((k : ℝ)+2) f) i j) x) = + (fun i j => D.regularityMetric p i j x + D.regularityHessian p i j f x) := by + funext i j + simp only [regularityMatrix,D.completedRegularityHessian_embed,map_add, + BoundedContinuousFunction.add_apply,D.localizers.strong_embed _ hs] + rfl + have hE : (fun (i j : Fin d) => D.localizers.strong (k : ℝ) + (D.regularityErrorMatrix k p v (D.localizers.embed ((k : ℝ)+2) f) i j) x) = + (fun i j => D.regularityError p v i j f x - + D.localizedDerivative p v (D.regularityMetric p i j) x) := by + funext i j + simp only [regularityErrorMatrix,D.completedRegularityError_embed,map_sub, + BoundedContinuousFunction.sub_apply,D.localizers.strong_embed _ hs] + rfl + rw [hM,hE] + rfl + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/NonlinearScale.lean b/lean/OAI/Geometry/PrescribedPotential/NonlinearScale.lean new file mode 100644 index 0000000000000000000000000000000000000000..552a3807b6882256a635917d66154a60bc95d34a --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/NonlinearScale.lean @@ -0,0 +1,159 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.RealNonlinearDerivative +import OAI.Geometry.PrescribedPotential.RealPoissonEquivalence + +namespace OAI + +/-! Nonlinear Scale. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace Localizers +variable (D : Localizers A ι) +local instance scaleNG (s : ℝ) : NormedAddCommGroup (D.RealSobolev s) := + (D.realCompletion s).normedAddCommGroup +local instance scaleNS (s : ℝ) : NormedSpace ℝ (D.RealSobolev s) := + (D.realCompletion s).normedSpace +local instance scaleTG (s : ℝ) : IsTopologicalAddGroup (D.RealSobolev s) := + Submodule.isTopologicalAddGroup _ +local instance scaleCS (s : ℝ) : ContinuousSMul ℝ (D.RealSobolev s) := + SMulMemClass.continuousSMul _ + +def realLower (s t : ℝ) (hst : t ≤ s) : D.RealSobolev s →L[ℝ] D.RealSobolev t := + ((D.lower s t).comp (D.realCompletion s).subtypeL).codRestrict (D.realCompletion t) + (fun u => D.maps_realCompletion (D.lower s t) + (fun f => ⟨f,D.lower_embed hst f.val⟩) u.val u.property) + +lemma realLower_embed {s t : ℝ} (hst : t ≤ s) (f : RealSmooth A) : + D.realLower s t hst (D.realEmbed s f) = D.realEmbed t f := by + apply Subtype.ext + exact D.lower_embed hst f.val + +lemma realLower_injective {s t : ℝ} (hst : t ≤ s) : + Function.Injective (D.realLower s t hst) := by + intro u v h + apply Subtype.ext + exact D.lower_injective hst (congrArg Subtype.val h) + +end Localizers +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) +local instance nonlinearScaleNG (s : ℝ) : NormedAddCommGroup (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedAddCommGroup +local instance nonlinearScaleNS (s : ℝ) : NormedSpace ℝ (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedSpace +local instance nonlinearScaleTG (s : ℝ) : IsTopologicalAddGroup (D.localizers.RealSobolev s) := + Submodule.isTopologicalAddGroup _ +local instance nonlinearScaleCS (s : ℝ) : ContinuousSMul ℝ (D.localizers.RealSobolev s) := + SMulMemClass.continuousSMul _ + +lemma realVolume_embed (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (f : RealSmooth A) : + D.realVolume k hk (D.localizers.realEmbed ((k : ℝ)+2) f) = + D.localizers.realEmbed (k : ℝ) (RealSmooth.ofReal (g.potentialDensity f.source)) := by + apply Subtype.ext + change D.completedVolume k hk (D.localizers.embed ((k : ℝ)+2) f.val) = _ + rw [← f.ofReal_source,D.completedVolume_embed k hk] + rfl + +lemma realVolume_lower (k l : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (hl : Module.finrank ℝ (EC d) < l) (hlk : l ≤ k) + (u : D.localizers.RealSobolev ((k : ℝ)+2)) : + D.realVolume l hl (D.localizers.realLower ((k : ℝ)+2) ((l : ℝ)+2) + (by exact_mod_cast Nat.add_le_add_right hlk 2) u) = + D.localizers.realLower (k : ℝ) (l : ℝ) (by exact_mod_cast hlk) (D.realVolume k hk u) := by + have hst : (l : ℝ)+2 ≤ (k : ℝ)+2 := by exact_mod_cast Nat.add_le_add_right hlk 2 + have hkl : (l : ℝ) ≤ (k : ℝ) := by exact_mod_cast hlk + have he : (D.realVolume l hl) ∘ D.localizers.realLower ((k : ℝ)+2) ((l : ℝ)+2) hst = + D.localizers.realLower (k : ℝ) (l : ℝ) hkl ∘ D.realVolume k hk := by + apply (D.localizers.realEmbed_dense ((k : ℝ)+2)).equalizer + ((D.realVolume_continuous l hl).comp (D.localizers.realLower _ _ hst).continuous) + ((D.localizers.realLower _ _ hkl).continuous.comp (D.realVolume_continuous k hk)) + funext f + simp only [Function.comp_apply,Localizers.realLower_embed,realVolume_embed] + exact congr_fun he u + +variable [ConnectedSpace X] +omit [ConnectedSpace X] in +lemma realVolumeDerivative_lower (k l : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (hl : Module.finrank ℝ (EC d) < l) (hlk : l ≤ k) + (u : D.localizers.RealSobolev ((k : ℝ)+2)) : + (D.realVolumeDerivative l hl (D.localizers.realLower ((k : ℝ)+2) ((l : ℝ)+2) + (by exact_mod_cast Nat.add_le_add_right hlk 2) u)).comp + (D.localizers.realLower ((k : ℝ)+2) ((l : ℝ)+2) + (by exact_mod_cast Nat.add_le_add_right hlk 2)) = + (D.localizers.realLower (k : ℝ) (l : ℝ) (by exact_mod_cast hlk)).comp + (D.realVolumeDerivative k hk u) := by + let L := D.localizers.realLower ((k : ℝ)+2) ((l : ℝ)+2) + (by exact_mod_cast Nat.add_le_add_right hlk 2) + let M := D.localizers.realLower (k : ℝ) (l : ℝ) (by exact_mod_cast hlk) + have h₁ := (D.realVolume_hasStrictFDerivAt l hl (L u)).hasFDerivAt.comp u L.hasFDerivAt + have h₂ := M.hasFDerivAt.comp u (D.realVolume_hasStrictFDerivAt k hk u).hasFDerivAt + have hf : D.realVolume l hl ∘ L = M ∘ D.realVolume k hk := + funext (D.realVolume_lower k l hk hl hlk) + rw [hf] at h₁ + exact h₁.unique h₂ + +def linearizedVolume (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (x₀ : X) + (u : D.localizers.RealSobolev ((k : ℝ)+2)) : + (D.localizers.RealSobolev ((k : ℝ)+2) × ℝ) →L[ℝ] + (D.localizers.RealSobolev (k : ℝ) × ℝ) := + ((D.realVolumeDerivative k hk u ∘L ContinuousLinearMap.fst ℝ _ ℝ) - + (D.realConstants (k : ℝ) ∘L ContinuousLinearMap.snd ℝ _ ℝ)).prod + (D.realEvaluation ((k : ℝ)+2) x₀ ∘L ContinuousLinearMap.fst ℝ _ ℝ) + +omit [ConnectedSpace X] in +lemma linearizedVolume_zero (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (x₀ : X) : + D.linearizedVolume k hk x₀ 0 = D.realAugmentedL k x₀ := by + simp only [linearizedVolume,realVolumeDerivative_zero,realAugmentedL] + +omit [ConnectedSpace X] in +lemma linearizedVolume_continuous (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (x₀ : X) : + Continuous (D.linearizedVolume k hk x₀) := by + have hc : Continuous (fun u => + (D.realVolumeDerivative k hk u ∘L ContinuousLinearMap.fst ℝ _ ℝ) - + (D.realConstants (k : ℝ) ∘L ContinuousLinearMap.snd ℝ _ ℝ)) := by + exact ((D.realVolumeDerivative_continuous k hk).clm_comp continuous_const).sub continuous_const + let : NormedAddCommGroup (D.localizers.RealSobolev ((k : ℝ)+2) × ℝ) := inferInstance + let : NormedSpace ℝ (D.localizers.RealSobolev ((k : ℝ)+2) × ℝ) := inferInstance + let : NormedAddCommGroup ((D.localizers.RealSobolev ((k : ℝ)+2) × ℝ) →L[ℝ] + D.localizers.RealSobolev (k : ℝ)) := inferInstance + let : NormedAddCommGroup ((D.localizers.RealSobolev ((k : ℝ)+2) × ℝ) →L[ℝ] ℝ) := inferInstance + exact (ContinuousLinearMap.prodₗᵢ (𝕜 := ℝ) + (E := D.localizers.RealSobolev ((k : ℝ)+2) × ℝ) + (F := D.localizers.RealSobolev (k : ℝ)) (G := ℝ) ℝ).continuous.comp + (hc.prodMk continuous_const) + +lemma linearizedVolume_invertible_nhds (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) (k : ℕ) + (hk : Module.finrank ℝ (EC d) < k) (x₀ : X) : + ∀ᶠ u in 𝓝 (0 : D.localizers.RealSobolev ((k : ℝ)+2)), + ∃ e : (D.localizers.RealSobolev ((k : ℝ)+2) × ℝ) ≃L[ℝ] + (D.localizers.RealSobolev (k : ℝ) × ℝ), + (e : _ →L[ℝ] _) = D.linearizedVolume k hk x₀ u := by + have hke : (Module.finrank ℝ (EC d) : ℝ) < 2*((k : ℝ)+2) := by + have hh : (Module.finrank ℝ (EC d) : ℝ) < (k : ℝ) := by exact_mod_cast hk + linarith [Nat.cast_nonneg (α := ℝ) k] + let e := D.realPoissonEquiv m hm he P k hke x₀ + have hz : (e : _ →L[ℝ] _) = D.linearizedVolume k hk x₀ 0 := by + rw [D.linearizedVolume_zero] + rfl + have hn := e.nhds + rw [hz] at hn + exact (D.linearizedVolume_continuous k hk x₀).continuousAt hn + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/NonlinearSobolevGain.lean b/lean/OAI/Geometry/PrescribedPotential/NonlinearSobolevGain.lean new file mode 100644 index 0000000000000000000000000000000000000000..2581f3949a06700db4e03174f09e5b896627549c --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/NonlinearSobolevGain.lean @@ -0,0 +1,116 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.PatchCutoffs +import OAI.Geometry.PrescribedPotential.RealSobolev +import OAI.Geometry.PrescribedPotential.CompletedRealification +import OAI.Geometry.PrescribedPotential.DerivativeEllipticGain +import OAI.Geometry.PrescribedPotential.SobolevFirstGain +import OAI.Geometry.PrescribedPotential.WeakNonlinearCommutator + +namespace OAI + +/-! Nonlinear Sobolev Gain. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace Localizers +variable (L : Localizers A ι) +lemma realLower_lower {s t r : ℝ} (hst : t ≤ s) (htr : r ≤ t) (u : L.RealSobolev s) : + L.realLower t r htr (L.realLower s t hst u) = + L.realLower s r (htr.trans hst) u := by + apply Subtype.ext + exact L.lower_lower hst htr u.val +end Localizers +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) +local instance nonlinearSobGainNG (s : ℝ) : NormedAddCommGroup (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedAddCommGroup +local instance nonlinearSobGainNS (s : ℝ) : NormedSpace ℝ (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedSpace +local instance nonlinearSobGainTG (s : ℝ) : IsTopologicalAddGroup (D.localizers.RealSobolev s) := + Submodule.isTopologicalAddGroup _ +local instance nonlinearSobGainCS (s : ℝ) : ContinuousSMul ℝ (D.localizers.RealSobolev s) := + SMulMemClass.continuousSMul _ + +lemma real_sobolev_first_gain (k : ℕ) (u : D.localizers.RealSobolev ((k : ℝ)+1)) + (hD : ∀ (p : ι) (v : EC d), ∃ w : D.localizers.RealSobolev ((k : ℝ)+1), + D.localizers.realLower ((k : ℝ)+1) (k : ℝ) (by linarith) w = + D.realCompletedDerivative k p v u) : + ∃ w : D.localizers.RealSobolev ((k+2 : ℕ) : ℝ), + D.localizers.realLower ((k+2 : ℕ) : ℝ) ((k : ℝ)+1) (by push_cast; linarith) w = u := by + have hc (p : ι) (v : EC d) : ∃ w : D.localizers.Sobolev ((k : ℝ)+1), + D.localizers.lower ((k : ℝ)+1) (k : ℝ) w = D.completedDerivative k p v u.val := by + obtain ⟨w,hw⟩ := hD p v + exact ⟨w.val,congrArg Subtype.val hw⟩ + obtain ⟨w,hw⟩ := D.sobolev_first_gain k u.val hc + have hm : w ∈ D.localizers.realCompletion ((k+2 : ℕ) : ℝ) := by + apply D.mem_real_of_lower_eq (k+2) (k+1) ((k : ℝ)+1) (by push_cast; rfl) (by omega) + have hh : D.localizers.lower ((k+2 : ℕ) : ℝ) ((k : ℝ)+1) w ∈ + D.localizers.realCompletion ((k : ℝ)+1) := hw.symm ▸ u.property + exact hh + exact ⟨⟨w,hm⟩,Subtype.ext hw⟩ + +lemma derivative_lifts_reindex (k : ℕ) + (u : D.localizers.RealSobolev (((k+1 : ℕ) : ℝ)+2)) + (hD : ∀ (p : ι) (v : EC d), ∃ w : D.localizers.RealSobolev (((k+1 : ℕ) : ℝ)+2), + D.localizers.realLower (((k+1 : ℕ) : ℝ)+2) ((k : ℝ)+2) (by push_cast; linarith) w = + D.potentialDerivative k p v u) : + ∀ (p : ι) (v : EC d), ∃ w : D.localizers.RealSobolev (((k+2 : ℕ) : ℝ)+1), + D.localizers.realLower (((k+2 : ℕ) : ℝ)+1) ((k+2 : ℕ) : ℝ) (by linarith) w = + D.realCompletedDerivative (k+2) p v + (D.localizers.realLower (((k+1 : ℕ) : ℝ)+2) (((k+2 : ℕ) : ℝ)+1) + (by push_cast; linarith) u) := by + intro p v + obtain ⟨w,hw⟩ := hD p v + refine ⟨D.localizers.realLower (((k+1 : ℕ) : ℝ)+2) (((k+2 : ℕ) : ℝ)+1) + (by push_cast; linarith) w,?_⟩ + apply D.localizers.realLower_injective (by norm_num : (k : ℝ)+2 ≤ ((k+2 : ℕ) : ℝ)) + rw [Localizers.realLower_lower,Localizers.realLower_lower] + exact hw + +lemma derivative_lifts_gain (k : ℕ) + (u : D.localizers.RealSobolev (((k+1 : ℕ) : ℝ)+2)) + (hD : ∀ (p : ι) (v : EC d), ∃ w : D.localizers.RealSobolev (((k+1 : ℕ) : ℝ)+2), + D.localizers.realLower (((k+1 : ℕ) : ℝ)+2) ((k : ℝ)+2) (by push_cast; linarith) w = + D.potentialDerivative k p v u) : + ∃ w : D.localizers.RealSobolev ((k+4 : ℕ) : ℝ), + D.localizers.realLower ((k+4 : ℕ) : ℝ) (((k+1 : ℕ) : ℝ)+2) (by push_cast; linarith) w = u := by + let u' := D.localizers.realLower (((k+1 : ℕ) : ℝ)+2) (((k+2 : ℕ) : ℝ)+1) + (by push_cast; linarith) u + obtain ⟨w,hw⟩ := D.real_sobolev_first_gain (k+2) u' + (D.derivative_lifts_reindex k u hD) + refine ⟨D.localizers.realLower ((k+2+2 : ℕ) : ℝ) ((k+4 : ℕ) : ℝ) (by push_cast; linarith) w,?_⟩ + apply D.localizers.realLower_injective + (by push_cast; linarith : ((k+2 : ℕ) : ℝ)+1 ≤ ((k+1 : ℕ) : ℝ)+2) + rw [Localizers.realLower_lower,Localizers.realLower_lower] + exact hw + +variable [ConnectedSpace X] + + +theorem nonlinear_sobolev_gain (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (x₀ : X) : + ∀ᶠ u in 𝓝 (0 : D.localizers.RealSobolev (((k+1 : ℕ) : ℝ)+2)), + ∀ (F : RealSmooth A), + D.realVolume (k+1) (by omega) u = D.localizers.realEmbed ((k+1 : ℕ) : ℝ) F → + ∃ w : D.localizers.RealSobolev ((k+4 : ℕ) : ℝ), + D.localizers.realLower ((k+4 : ℕ) : ℝ) (((k+1 : ℕ) : ℝ)+2) + (by push_cast; linarith) w = u := by + filter_upwards [D.nonlinear_first_derivative_gain k hk x₀] with u hu + intro F hF + exact D.derivative_lifts_gain k u (hu F hF) + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/NormalizedPathCompactness.lean b/lean/OAI/Geometry/PrescribedPotential/NormalizedPathCompactness.lean new file mode 100644 index 0000000000000000000000000000000000000000..775437ee118d4e765a993759263cf8307a35b266 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/NormalizedPathCompactness.lean @@ -0,0 +1,94 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.PatchCutoffs +import OAI.Geometry.PrescribedPotential.RealSmoothCompactness +import OAI.Geometry.PrescribedPotential.RealSobolev +import OAI.Geometry.PrescribedPotential.SmoothPathLimit +import OAI.Geometry.PrescribedPotential.VolumeNormalization + +namespace OAI + +/-! Normalized Path Compactness. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace RealSmooth + +omit [T2Space X] [CompactSpace X] in +@[simp] lemma source_ofReal (φ : SmoothRealFunction A) : (ofReal φ).source = φ := by + cases φ + rfl + +end RealSmooth +namespace Localizers +variable (D : Localizers A ι) + +lemma real_source_value_tendsto (f : ℕ → RealSmooth A) (fLim : RealSmooth A) + (hf : ∀ s : ℝ, Tendsto (fun n => D.embed s (f n).val) atTop + (𝓝 (D.embed s fLim.val))) (x : X) : + Tendsto (fun n => (f n).source.value x) atTop (𝓝 (fLim.source.value x)) := by + let s : ℝ := (Module.finrank ℝ (EC d) : ℝ)+1 + have hs : (Module.finrank ℝ (EC d) : ℝ) < 2*s := by + dsimp only [s] + linarith [Nat.cast_nonneg (α := ℝ) (Module.finrank ℝ (EC d))] + exact (Complex.continuous_re.tendsto (fLim.val x)).comp + (D.smooth_value_tendsto s hs (fun n => (f n).val) fLim.val (hf s) x) + +end Localizers +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + + + +theorem normalized_path_sequence_compact (h : SemipositiveAnticanonicalMetric A) + (x₀ : X) (t b : ℕ → ℝ) (tLim : ℝ) (ht : Tendsto t atTop (𝓝 tLim)) + (hinterval : ∀ n, t n ∈ Icc 0 1) (f : ℕ → RealSmooth A) + (hnorm : ∀ n, (f n).source.value x₀ = 0) + (hsol : ∀ n, SolvesVolumePath g h (t n) (f n).source (b n)) + (hbound : ∀ k : ℕ, ∃ C : ℝ, ∀ n : ℕ, + ‖D.localizers.embed (((2*k : ℕ) : ℝ)+2) (f n).val‖ ≤ C) : + ∃ (fLim : RealSmooth A) (bLim : ℝ) (r : ℕ → ℕ), StrictMono r ∧ + Tendsto (b ∘ r) atTop (𝓝 bLim) ∧ + (∀ s : ℝ, Tendsto (fun n => D.localizers.embed s (f (r n)).val) atTop + (𝓝 (D.localizers.embed s fLim.val))) ∧ + fLim.source.value x₀ = 0 ∧ SolvesVolumePath g h tLim fLim.source bLim := by + let : Nonempty X := ⟨x₀⟩ + let C : ℝ := ‖(⟨(prescribedForcing g h).value, + (prescribedForcing g h).continuous⟩ : C(X,ℝ))‖ + have hb (n : ℕ) : b n ∈ Icc (-C) C := + abs_le.mp (volumePath_scalar_bound g h (hinterval n) (hsol n)) + obtain ⟨bLim,_,r₀,hr₀,hb₀⟩ := (isCompact_Icc : IsCompact (Icc (-C) C)).tendsto_subseq hb + have hbound' : ∀ k : ℕ, ∃ C : ℝ, ∀ n : ℕ, + ‖D.localizers.embed (((2*k : ℕ) : ℝ)+2) (f (r₀ n)).val‖ ≤ C := by + intro k + obtain ⟨K,hK⟩ := hbound k + exact ⟨K,fun n => hK (r₀ n)⟩ + obtain ⟨fLim,r₁,hr₁,hf⟩ := D.real_smooth_sequence_compact (fun n => f (r₀ n)) hbound' + let r := r₀ ∘ r₁ + have hr : StrictMono r := hr₀.comp hr₁ + have hbLim : Tendsto (b ∘ r) atTop (𝓝 bLim) := hb₀.comp hr₁.tendsto_atTop + have hnLim : fLim.source.value x₀ = 0 := by + have hv := D.localizers.real_source_value_tendsto (fun n => f (r n)) fLim hf x₀ + have he : (fun n => (f (r n)).source.value x₀) = (fun _ : ℕ => (0 : ℝ)) := + funext (fun n => hnorm (r n)) + rw [he] at hv + exact tendsto_nhds_unique hv tendsto_const_nhds + refine ⟨fLim,bLim,r,hr,hbLim,hf,hnLim,?_⟩ + exact D.smooth_path_limit_solution h (t ∘ r) (b ∘ r) tLim bLim + (ht.comp hr.tendsto_atTop) hbLim (fun n => f (r n)) fLim hf (fun n => hsol (r n)) + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/NormalizedPoisson.lean b/lean/OAI/Geometry/PrescribedPotential/NormalizedPoisson.lean new file mode 100644 index 0000000000000000000000000000000000000000..e7f0d29a36fc377d41c25b2a176dc1d8ea89b308 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/NormalizedPoisson.lean @@ -0,0 +1,94 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CompactAlternative +import OAI.Geometry.PrescribedPotential.ComplexKernel +import OAI.Geometry.PrescribedPotential.PatchCutoffs +import OAI.Geometry.PrescribedPotential.FredholmKernel +import OAI.Geometry.PrescribedPotential.GlobalRellich + +namespace OAI + +/-! Normalized Poisson. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory +open scoped SchwartzMap ContDiff Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +omit [ConnectedSpace X] in +lemma resolventZero_compact (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) : + IsCompactOperator (D.resolventZero m hm he) := + D.lower_compact.comp_clm (D.completedResolvent m hm he) + +omit [ConnectedSpace X] in +lemma fredholmOperator_compact (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) : IsCompactOperator (D.fredholmOperator m hm he P) := + ((D.resolventZero_compact m hm he).smul (m^2 : ℝ)).sub P.compact + +lemma fredholm_surjective (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) : + Function.Surjective (1 - D.fredholmOperator m hm he P : + D.localizers.Sobolev 0 →L[ℝ] D.localizers.Sobolev 0) := + compact_one_sub_surjective _ (D.fredholmOperator_compact m hm he P) (D.fredholm_kernel m hm he P) + +include D in +theorem exists_complex_poisson (F : Smooth A) : + ∃ (u : Smooth A) (c : ℂ), complexL g u = F + Smooth.const c := by + obtain ⟨m, hm, he⟩ := D.exists_completedError_small + obtain ⟨P⟩ := D.localizers.constantProjection_exists + obtain ⟨w, hw⟩ := D.fredholm_surjective m hm he P (-D.localizers.embed 0 F) + obtain ⟨c, hc⟩ := P.value w + have hw' : w = D.localizers.embed 0 (-F - Smooth.const c) + + (m^2 : ℝ) • D.resolventZero m hm he w := by + change w - ((m^2 : ℝ) • D.resolventZero m hm he w - P.proj w) = -D.localizers.embed 0 F at hw + calc + w = -D.localizers.embed 0 F + + ((m^2 : ℝ) • D.resolventZero m hm he w - P.proj w) := sub_eq_iff_eq_add.mp hw + _ = _ := by rw [hc, map_sub, map_neg]; abel + obtain ⟨u, hu⟩ := D.allRegular_smooth (D.resolvent_feedback_regular m hm he w _ hw') + refine ⟨u, c, ?_⟩ + have hs := (D.smooth_shifted_equation m hm he w u hu).trans hw' + rw [← hu, ← map_smul, ← map_add] at hs + have heq := D.localizers.embed_injective 0 hs + apply sub_right_inj.mp + calc + (m^2 : ℝ) • u - complexL g u = -F - Smooth.const c + (m^2 : ℝ) • u := heq + _ = (m^2 : ℝ) • u - (F + Smooth.const c) := by abel + +end GluingData +end GlobalElliptic + +namespace Anticanonical.SourceSmooth +open GlobalElliptic +variable (d : ℕ) (X : Type*) [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] (A : ComplexAtlas d X) + + + +theorem normalizedPoisson (g : KaehlerMetric A) (x₀ : X) (f : SmoothRealFunction A) : + HasNormalizedPoissonSolution g x₀ f := by + obtain ⟨S, ⟨D⟩⟩ := exists_gluingData g + obtain ⟨u, c, hu⟩ := D.exists_complex_poisson (Smooth.ofReal f) + refine ⟨(u.part Complex.reCLM).normalizeAt x₀, -c.re, SmoothRealFunction.normalizeAt_value _ _, ?_⟩ + intro i z hz + rw [KaehlerMetric.linearizedMongeAmpere_normalizeAt, + ← g.laplacian_localExpression _ i hz] + change (g.laplacian (u.part Complex.reCLM)).value ((A.chart i).symm z) + -c.re = _ + rw [← complexL_re, hu, Smooth.add_apply, Complex.add_re, Smooth.ofReal_apply, Complex.ofReal_re] + change f.localExpression i z + c.re + -c.re = f.localExpression i z + ring + +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/NormalizedPotentialL1.lean b/lean/OAI/Geometry/PrescribedPotential/NormalizedPotentialL1.lean new file mode 100644 index 0000000000000000000000000000000000000000..75d5e230c4c01ea714999e307d8f90c7c4392ba8 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/NormalizedPotentialL1.lean @@ -0,0 +1,92 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CompactIntegralPropagation +import OAI.Geometry.PrescribedPotential.CoordinateBalls +import OAI.Geometry.PrescribedPotential.CoordinatePotential +import OAI.Geometry.PrescribedPotential.QuasiPSHLocalMean + +namespace OAI + +/-! Normalized Potential L1. -/ + +section + + + +noncomputable section +open Set Metric Filter Topology MeasureTheory +open scoped ContDiff InnerProductSpace +namespace Anticanonical.SourceSmooth +open EllipticKernel PotentialABP +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +local instance normalizedL1RealIP (d : ℕ) : InnerProductSpace ℝ (EC d) := + InnerProductSpace.rclikeToReal ℂ (EC d) +namespace CoordinateBall +variable [MeasurableSpace X] [BorelSpace X] (p : CoordinateBall A) + +lemma local_neg_integral (g : KaehlerMetric A) : ∃ B : ℝ, 0 ≤ B ∧ + ∀ φ : SmoothRealFunction A, g.PositivePotential φ → (∀ x, φ.value x ≤ 0) → + ∀ y ∈ p.source, (∫ x, -φ.value x ∂p.measure) ≤ B * (-φ.value y + 1) := by + obtain ⟨C, hC, hCb⟩ := p.metric_bound g + let V := volume.real (ball (0 : EC d) (2*p.radius)) + let T := 9*C*p.radius^2 + have hV : 0 ≤ V := ENNReal.toReal_nonneg + have hT : 0 ≤ T := by positivity + refine ⟨V*(1+T), mul_nonneg hV (by positivity), ?_⟩ + intro φ hφ hneg y hy + have he (z) (hz : z ∈ closedBall p.center (3*p.radius)) := p.extension_eq φ hz + have hloc := quasiPSH_local_integral (p.extension_smooth φ) p.center p.radius_pos hC + (fun z hz => by rw [he z hz]; exact hneg _) (fun z hz v => p.extension_levi_lower g φ hφ hCb hz v) + (y := A.euclideanChart p.index y) hy.2 + have hey : p.extension φ (A.euclideanChart p.index y) = φ.value y := by + rw [he _ (closedBall_subset_closedBall (by linarith [p.radius_pos]) + (ball_subset_closedBall hy.2)), (A.euclideanChart p.index).left_inv hy.1] + have hei : (∫ z in ball p.center p.radius, (0:ℝ)-p.extension φ z) = + ∫ z in ball p.center p.radius, -φ.value ((A.euclideanChart p.index).symm z) := by + apply setIntegral_congr_fun isOpen_ball.measurableSet + intro z hz + dsimp only + rw [he z (closedBall_subset_closedBall (by linarith [p.radius_pos]) + (ball_subset_closedBall hz)), zero_sub] + rw [hei, hey, zero_sub] at hloc + rw [p.integral_measure (fun x => -φ.value x) φ.continuous.neg] + apply hloc.trans + change V * (-φ.value y + T) ≤ V*(1+T)*(-φ.value y+1) + have hn : 0 ≤ -φ.value y := neg_nonneg.mpr (hneg y) + nlinarith [mul_nonneg hT hn, mul_nonneg hV (mul_nonneg hT hn)] +end CoordinateBall + + + +theorem normalized_potential_L1 [CompactSpace X] [ConnectedSpace X] + [MeasurableSpace X] [BorelSpace X] + (g : KaehlerMetric A) (S : Finset (CoordinateBall A)) + (hS : ∀ x, ∃ p ∈ S, x ∈ p.source) : + ∃ B : ℝ, ∀ φ : SmoothRealFunction A, + g.PositivePotential φ → (∀ x, φ.value x ≤ 0) → (∃ x, φ.value x = 0) → + ∀ p ∈ S, (∫ x, -φ.value x ∂p.measure) ≤ B := by + classical + let U : S → Set X := fun p => p.val.source + let μ : S → Measure X := fun p => p.val.measure + let F : (X → ℝ) → Prop := fun u => ∃ φ : SmoothRealFunction A, + g.PositivePotential φ ∧ (∀ x, φ.value x ≤ 0) ∧ u = fun x => -φ.value x + have hlocal := fun p : S => p.val.local_neg_integral g + choose C hC hc using hlocal + obtain ⟨B, hB⟩ := finite_cover_integral_bound U + (fun p => p.val.isOpen_source) (fun p => p.val.source_nonempty) + (fun x => by obtain ⟨p, hp, hx⟩ := hS x; exact ⟨⟨p, hp⟩, hx⟩) μ + (fun p q hn => p.val.measure_open_pos q.val.isOpen_source hn) F + (by rintro u ⟨φ, _, hn, rfl⟩ x; exact neg_nonneg.mpr (hn x)) + (by + rintro u ⟨φ, _, _, rfl⟩ p + exact φ.continuous.neg.integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _)) C hC + (by rintro u ⟨φ, hφ, hn, rfl⟩ p y hy; exact hc p φ hφ hn y hy) + refine ⟨B, ?_⟩ + intro φ hφ hn hz p hp + exact hB _ ⟨φ, hφ, hn, rfl⟩ (by obtain ⟨x, hx⟩ := hz; exact ⟨x, by simp [hx]⟩) ⟨p, hp⟩ +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/ParameterCoreBounds.lean b/lean/OAI/Geometry/PrescribedPotential/ParameterCoreBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..92e7bd80eb6a21c39a75158571aba265b3beb311 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/ParameterCoreBounds.lean @@ -0,0 +1,141 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CoreBounds +import OAI.Geometry.PrescribedPotential.ParameterSchwartz + +namespace OAI + +/-! Parameter Core Bounds. -/ + +section + + + +noncomputable section +open Filter Topology MeasureTheory FourierTransform TemperedDistribution LineDeriv +open scoped SchwartzMap BoundedContinuousFunction ContDiff Real ComplexOrder MatrixOrder Classical + +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +lemma CoreBound.list_sum {α : Type*} {s t : ℝ} (I : List α) + (T : α → 𝓢(E, ℂ) → 𝓢(E, ℂ)) (hh : ∀ i ∈ I, CoreBound s t (T i)) : + CoreBound s t (fun f => (I.map (fun i => T i f)).sum) := by + induction I with + | nil => exact ⟨0, le_rfl, by simp [schwartzCoord_zero]⟩ + | cons i I ih => + exact (hh i (List.mem_cons_self ..)).add (ih (fun j hj => hh j (List.mem_cons_of_mem _ hj))) + +lemma coreBound_perturbation {ι : Type*} [Fintype ι] (v : ι → E) + (a : SmoothCoefficients ι E) : CoreBound 2 0 (smoothPerturbation v a) := + ⟨perturbationBound v (coefficientBCF a), perturbationBound_nonneg v _, smoothPerturbation_bound v a⟩ + + +lemma coreBound_of_words_base (k : ℕ) {s r : ℝ} (T : 𝓢(E, ℂ) → 𝓢(E, ℂ)) + (h : ∀ ws : List E, ws.length ≤ 2 * k → CoreBound s r (fun f => schwartzWord ws (T f))) : + CoreBound s (r + 2 * (k : ℝ)) T := by + induction k generalizing T with + | zero => simpa [schwartzWord] using h [] (by simp) + | succ k ih => + have ht := ih T (fun ws hw => h ws (by omega)) + have hd (j : Fin (Module.finrank ℝ E)) := ih + (fun f => ∂_{stdOrthonormalBasis ℝ E j} (∂_{stdOrthonormalBasis ℝ E j} (T f))) + (fun ws hw => by + have hh := h (ws ++ [stdOrthonormalBasis ℝ E j, stdOrthonormalBasis ℝ E j]) + (by simp only [List.length_append, List.length_cons, List.length_nil] ; omega) + simpa only [schwartzWord_append, schwartzWord, ContinuousLinearMap.comp_apply, + ContinuousLinearMap.id_apply, lineDerivOpCLM_apply] using hh) + convert coreBound_raise_two T ht hd using 1; push_cast; ring + +end SobolevChart + +namespace FrozenPoisson.ParameterRegularity +open FrozenPoisson SobolevChart EllipticKernel +variable {n : ℕ} {ι : Type*} [Fintype ι] +variable (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (t : ℝ) (ht : 1 ≤ t) (v : ι → EC n) (a : SmoothCoefficients ι (EC n)) + (hsmall : perturbationBound v (coefficientBCF a) * ellipticBound H hH < 1) + +lemma schwartzLocal_fixed (f : 𝓢(EC n, ℂ)) : + schwartzLocal H hH t ht v a hsmall f = schwartzResolvent H t + (f + smoothPerturbation v a (schwartzLocal H hH t ht v a hsmall f)) := by + apply schwartz_distribution_injective + rw [schwartzResolvent_distribution H hH t ht] + rw [show SchwartzMap.toTemperedDistributionCLM (EC n) ℂ volume + (schwartzLocal H hH t ht v a hsmall f) = _ from + schwartzLocalValue_distribution H hH t ht v a hsmall f] + have hr := parameterHilbert_realize H hH t ht 0 + (schwartzCoord 0 f + perturbation v (coefficientBCF a) + (parameterLocal H hH t ht v (coefficientBCF a) hsmall (schwartzCoord 0 f))) + norm_num only [zero_add] at hr + rw [← schwartzLocal_coord H hH t ht v a hsmall f] at hr + rw [← schwartzCoord_perturbation, ← schwartzCoord_add, realize_schwartzCoord] at hr + rw [← hr, schwartzCoord_add, schwartzCoord_perturbation, + schwartzLocal_coord H hH t ht v a hsmall f] + exact congrArg (realize (E := EC n) 2) + (parameterLocal_fixed H hH t ht v (coefficientBCF a) hsmall (schwartzCoord 0 f)) + + + +theorem schwartzLocal_word_bound (ws : List (EC n)) {s : ℝ} (hws : (ws.length : ℝ) ≤ s) : + CoreBound s 2 (fun f => schwartzWord ws (schwartzLocal H hH t ht v a hsmall f)) := by + induction hlen : ws.length using Nat.strong_induction_on generalizing ws s with + | h k ih => + subst k + let T := schwartzLocal H hH t ht v a hsmall + have hlow : CoreBound s 0 (fun f => ((commutatorTerms ws a).map + (fun b => smoothPerturbation v b.1 (schwartzWord b.2 (T f)))).sum) := by + apply CoreBound.list_sum + intro b hb + exact (coreBound_perturbation v b.1).comp + (ih b.2.length (commutatorTerms_order ws a b hb) b.2 (le_trans (by exact_mod_cast + (commutatorTerms_order ws a b hb).le) hws) rfl) + have hforce := (coreBound_word ws (t := 0) (by linarith : 0 ≤ s - ws.length)).add hlow + obtain ⟨C, hC, hforce⟩ := hforce + let q := ellipticBound H hH * perturbationBound v (coefficientBCF a) + have hq : q < 1 := by simpa [q, mul_comm] using hsmall + have hq' : 0 < 1 - q := sub_pos.mpr hq + refine ⟨ellipticBound H hH * C / (1 - q), + div_nonneg (mul_nonneg (ellipticBound_pos H hH).le hC) hq'.le, fun f => ?_⟩ + have he := congrArg (schwartzWord ws) (schwartzLocal_fixed H hH t ht v a hsmall f) + rw [schwartz_word_resolvent ws H hH t ht, map_add, schwartz_word_perturbation] at he + have hb := schwartzResolvent_bound H hH t ht + (smoothPerturbation v a (schwartzWord ws (T f)) + + (schwartzWord ws f + ((commutatorTerms ws a).map + (fun b => smoothPerturbation v b.1 (schwartzWord b.2 (T f)))).sum)) + have he' : schwartzWord ws (T f) = schwartzResolvent H t + (smoothPerturbation v a (schwartzWord ws (T f)) + + (schwartzWord ws f + ((commutatorTerms ws a).map + (fun b => smoothPerturbation v b.1 (schwartzWord b.2 (T f)))).sum)) := by + change schwartzWord ws (T f) = _ at he + rw [add_left_comm] at he + exact he + rw [← he', schwartzCoord_add] at hb + have hbound := hb.trans (mul_le_mul_of_nonneg_left (norm_add_le _ _) + (ellipticBound_pos H hH).le) + have hp := smoothPerturbation_bound v a (schwartzWord ws (T f)) + have hf := hforce f + have hfinal : (1 - q) * ‖schwartzCoord 2 (schwartzWord ws (T f))‖ ≤ + ellipticBound H hH * C * ‖schwartzCoord s f‖ := by + dsimp only [q] + nlinarith [mul_le_mul_of_nonneg_left hp (ellipticBound_pos H hH).le, + mul_le_mul_of_nonneg_left hf (ellipticBound_pos H hH).le] + rw [div_mul_eq_mul_div, le_div_iff₀ hq'] + simpa only [mul_comm] using hfinal + + + +theorem schwartzLocal_even_bound (k : ℕ) : + CoreBound (2 * (k : ℝ)) (2 * (k : ℝ) + 2) (schwartzLocal H hH t ht v a hsmall) := by + rw [add_comm] + apply coreBound_of_words_base k + intro ws hw + apply schwartzLocal_word_bound H hH t ht v a hsmall ws + exact_mod_cast hw + +end FrozenPoisson.ParameterRegularity + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/ParameterLocal.lean b/lean/OAI/Geometry/PrescribedPotential/ParameterLocal.lean new file mode 100644 index 0000000000000000000000000000000000000000..58ec1908a35cecafb9c70225c0592bb7ec49eed7 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/ParameterLocal.lean @@ -0,0 +1,177 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.ParameterResolvent +import OAI.Geometry.PrescribedPotential.VariablePoisson + +namespace OAI + +/-! Parameter Local. -/ + +section + + + +noncomputable section +open MeasureTheory FourierTransform TemperedDistribution LineDeriv +open scoped SchwartzMap BoundedContinuousFunction ComplexOrder MatrixOrder Real + +namespace FrozenPoisson +open EllipticKernel SobolevChart +variable {n : ℕ} {ι : Type*} [Fintype ι] + +lemma parameter_resolvent_perturbation_bound (H : Matrix (Fin n) (Fin n) ℂ) + (hH : H.PosDef) (m : ℝ) (hm : 1 ≤ m) + (v : ι → EC n) (a : ι → ι → EC n →ᵇ ℂ) : + ‖perturbation v a ∘L parameterHilbert H hH m hm‖ ≤ + perturbationBound v a * ellipticBound H hH := by + apply ContinuousLinearMap.opNorm_le_bound _ (mul_nonneg (perturbationBound_nonneg v a) (ellipticBound_pos H hH).le) + intro u + change ‖perturbation v a (parameterHilbert H hH m hm u)‖ ≤ _ + calc + _ ≤ perturbationBound v a * ‖parameterHilbert H hH m hm u‖ := perturbation_bound _ _ _ + _ ≤ perturbationBound v a * (ellipticBound H hH * ‖u‖) := + mul_le_mul_of_nonneg_left (parameterHilbert_bound H hH m hm u) + (perturbationBound_nonneg v a) + _ = _ := by ring + +def parameterCorrection (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (m : ℝ) (hm : 1 ≤ m) (v : ι → EC n) (a : ι → ι → EC n →ᵇ ℂ) + (hsmall : perturbationBound v a * ellipticBound H hH < 1) : + L2 (EC n) →L[ℂ] L2 (EC n) := + ↑((Units.oneSub (perturbation v a ∘L parameterHilbert H hH m hm) + ((parameter_resolvent_perturbation_bound H hH m hm v a).trans_lt hsmall))⁻¹) + +lemma parameterCorrection_equation (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (m : ℝ) (hm : 1 ≤ m) (v : ι → EC n) (a : ι → ι → EC n →ᵇ ℂ) + (hsmall : perturbationBound v a * ellipticBound H hH < 1) (f : L2 (EC n)) : + parameterCorrection H hH m hm v a hsmall f - + perturbation v a (parameterHilbert H hH m hm + (parameterCorrection H hH m hm v a hsmall f)) = f := by + let U := Units.oneSub (perturbation v a ∘L parameterHilbert H hH m hm) + ((parameter_resolvent_perturbation_bound H hH m hm v a).trans_lt hsmall) + change ((↑U : L2 (EC n) →L[ℂ] L2 (EC n)) * ↑U⁻¹) f = f + rw [Units.mul_inv, _root_.one_apply_eq_self] + +lemma parameterCorrection_bound (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (m : ℝ) (hm : 1 ≤ m) (v : ι → EC n) (a : ι → ι → EC n →ᵇ ℂ) + (hsmall : perturbationBound v a * ellipticBound H hH < 1) (f : L2 (EC n)) : + ‖parameterCorrection H hH m hm v a hsmall f‖ ≤ + ‖f‖ / (1 - perturbationBound v a * ellipticBound H hH) := by + let u := parameterCorrection H hH m hm v a hsmall f + have he : u = f + perturbation v a (parameterHilbert H hH m hm u) := + sub_eq_iff_eq_add.mp (parameterCorrection_equation H hH m hm v a hsmall f) + have hb : ‖u‖ ≤ ‖f‖ + (perturbationBound v a * ellipticBound H hH) * ‖u‖ := by + calc + _ = ‖f + perturbation v a (parameterHilbert H hH m hm u)‖ := congrArg norm he + _ ≤ ‖f‖ + ‖perturbation v a (parameterHilbert H hH m hm u)‖ := norm_add_le _ _ + _ ≤ ‖f‖ + perturbationBound v a * ‖parameterHilbert H hH m hm u‖ := + add_le_add le_rfl (perturbation_bound v a (parameterHilbert H hH m hm u)) + _ ≤ ‖f‖ + perturbationBound v a * (ellipticBound H hH * ‖u‖) := + add_le_add le_rfl (mul_le_mul_of_nonneg_left (parameterHilbert_bound H hH m hm u) + (perturbationBound_nonneg v a)) + _ = _ := by ring + change ‖u‖ ≤ _ + rw [le_div_iff₀ (sub_pos.mpr hsmall)] + linarith + +def parameterLocal (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (m : ℝ) (hm : 1 ≤ m) (v : ι → EC n) (a : ι → ι → EC n →ᵇ ℂ) + (hsmall : perturbationBound v a * ellipticBound H hH < 1) : + L2 (EC n) →L[ℂ] L2 (EC n) := + parameterHilbert H hH m hm ∘L parameterCorrection H hH m hm v a hsmall + +lemma parameterLocal_bound (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (m : ℝ) (hm : 1 ≤ m) (v : ι → EC n) (a : ι → ι → EC n →ᵇ ℂ) + (hsmall : perturbationBound v a * ellipticBound H hH < 1) (f : L2 (EC n)) : + ‖parameterLocal H hH m hm v a hsmall f‖ ≤ + (ellipticBound H hH / (1 - perturbationBound v a * ellipticBound H hH)) * ‖f‖ := by + change ‖parameterHilbert H hH m hm (parameterCorrection H hH m hm v a hsmall f)‖ ≤ _ + apply (parameterHilbert_bound H hH m hm _).trans + calc + _ ≤ ellipticBound H hH * (‖f‖ / (1 - perturbationBound v a * ellipticBound H hH)) := + mul_le_mul_of_nonneg_left (parameterCorrection_bound H hH m hm v a hsmall f) + (ellipticBound_pos H hH).le + _ = _ := by ring + +lemma parameterLocal_equation (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (m : ℝ) (hm : 1 ≤ m) (v : ι → EC n) (a : ι → ι → EC n →ᵇ ℂ) + (hsmall : perturbationBound v a * ellipticBound H hH < 1) (f : L2 (EC n)) : + (m^2 : ℂ) • realize 2 (parameterLocal H hH m hm v a hsmall f) - + frozenDifferential H (realize 2 (parameterLocal H hH m hm v a hsmall f)) - + (perturbation v a (parameterLocal H hH m hm v a hsmall f) : 𝓢'(EC n, ℂ)) = + (f : 𝓢'(EC n, ℂ)) := by + let u := parameterCorrection H hH m hm v a hsmall f + change (m^2 : ℂ) • realize 2 (parameterHilbert H hH m hm u) - + frozenDifferential H (realize 2 (parameterHilbert H hH m hm u)) - + (perturbation v a (parameterHilbert H hH m hm u) : 𝓢'(EC n, ℂ)) = _ + rw [parameterHilbert_equation] + simpa only [map_sub, Lp.toTemperedDistributionCLM_apply] using + congrArg (Lp.toTemperedDistributionCLM ℂ volume 2) + (parameterCorrection_equation H hH m hm v a hsmall f) + + +def parameterLocalZero (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (m : ℝ) (hm : 1 ≤ m) (v : ι → EC n) (a : ι → ι → EC n →ᵇ ℂ) + (hsmall : perturbationBound v a * ellipticBound H hH < 1) : + L2 (EC n) →L[ℂ] L2 (EC n) := + parameterZero H hH m (lt_of_lt_of_le zero_lt_one hm) ∘L + parameterCorrection H hH m hm v a hsmall + +lemma parameterLocalZero_distribution (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (m : ℝ) (hm : 1 ≤ m) (v : ι → EC n) (a : ι → ι → EC n →ᵇ ℂ) + (hsmall : perturbationBound v a * ellipticBound H hH < 1) (f : L2 (EC n)) : + (parameterLocalZero H hH m hm v a hsmall f : 𝓢'(EC n, ℂ)) = + realize 2 (parameterLocal H hH m hm v a hsmall f) := by + dsimp only [parameterLocalZero, parameterLocal, ContinuousLinearMap.comp_apply] + rw [parameterZero_distribution] + have h := parameterHilbert_realize H hH m hm 0 + (parameterCorrection H hH m hm v a hsmall f) + simpa only [zero_add, realize, neg_zero, besselPotential_zero, + ContinuousLinearMap.comp_apply, ContinuousLinearMap.id_apply, + Lp.toTemperedDistributionCLM_apply] using h.symm + +lemma parameterLocalZero_bound (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (m : ℝ) (hm : 1 ≤ m) (v : ι → EC n) (a : ι → ι → EC n →ᵇ ℂ) + (hsmall : perturbationBound v a * ellipticBound H hH < 1) (f : L2 (EC n)) : + ‖parameterLocalZero H hH m hm v a hsmall f‖ ≤ + ((m^2)⁻¹ / (1 - perturbationBound v a * ellipticBound H hH)) * ‖f‖ := by + apply (parameterZero_bound H hH m (lt_of_lt_of_le zero_lt_one hm) _).trans + calc + _ ≤ (m^2)⁻¹ * (‖f‖ / (1 - perturbationBound v a * ellipticBound H hH)) := + mul_le_mul_of_nonneg_left (parameterCorrection_bound H hH m hm v a hsmall f) (by positivity) + _ = _ := by ring + +def parameterLocalFirst (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (m : ℝ) (hm : 1 ≤ m) (v : ι → EC n) (a : ι → ι → EC n →ᵇ ℂ) + (hsmall : perturbationBound v a * ellipticBound H hH < 1) (w : EC n) : + L2 (EC n) →L[ℂ] L2 (EC n) := + parameterFirst H hH m hm w ∘L parameterCorrection H hH m hm v a hsmall + +lemma parameterLocalFirst_distribution (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (m : ℝ) (hm : 1 ≤ m) (v : ι → EC n) (a : ι → ι → EC n →ᵇ ℂ) + (hsmall : perturbationBound v a * ellipticBound H hH < 1) (w : EC n) (f : L2 (EC n)) : + (parameterLocalFirst H hH m hm v a hsmall w f : 𝓢'(EC n, ℂ)) = + ∂_{w} (realize 2 (parameterLocal H hH m hm v a hsmall f)) := by + dsimp only [parameterLocalFirst, ContinuousLinearMap.comp_apply] + rw [parameterFirst_distribution, ← parameterLocalZero_distribution, + parameterLocalZero, ContinuousLinearMap.comp_apply, parameterZero_distribution] + +lemma parameterLocalFirst_bound (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (m : ℝ) (hm : 1 ≤ m) (v : ι → EC n) (a : ι → ι → EC n →ᵇ ℂ) + (hsmall : perturbationBound v a * ellipticBound H hH < 1) (w : EC n) (f : L2 (EC n)) : + ‖parameterLocalFirst H hH m hm v a hsmall w f‖ ≤ + ((2 * Real.pi * ‖w‖ * ellipticBound H hH) / + (m * (1 - perturbationBound v a * ellipticBound H hH))) * ‖f‖ := by + apply (parameterFirst_bound H hH m hm w _).trans + calc + _ ≤ ((2 * Real.pi * ‖w‖ * ellipticBound H hH) / m) * + (‖f‖ / (1 - perturbationBound v a * ellipticBound H hH)) := + mul_le_mul_of_nonneg_left (parameterCorrection_bound H hH m hm v a hsmall f) + (by positivity [ellipticBound_pos H hH]) + _ = _ := by simp only [div_eq_mul_inv, mul_inv_rev]; ring + +end FrozenPoisson + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/ParameterRegularity.lean b/lean/OAI/Geometry/PrescribedPotential/ParameterRegularity.lean new file mode 100644 index 0000000000000000000000000000000000000000..f1e597326522d9928493992b949a78af2a2bb654 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/ParameterRegularity.lean @@ -0,0 +1,242 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.LocalRegularity +import OAI.Geometry.PrescribedPotential.ParameterLocal + +namespace OAI + +/-! Parameter Regularity. -/ + +section + + + +noncomputable section +open Filter Topology MeasureTheory FourierTransform TemperedDistribution LineDeriv +open scoped SchwartzMap BoundedContinuousFunction ContDiff Real ComplexOrder MatrixOrder + +namespace FrozenPoisson.ParameterRegularity +open FrozenPoisson SobolevChart EllipticKernel +variable {n : ℕ} {ι : Type*} [Fintype ι] + +def schwartzResolvent (H : Matrix (Fin n) (Fin n) ℂ) (t : ℝ) : + 𝓢(EC n, ℂ) →L[ℂ] 𝓢(EC n, ℂ) := + SchwartzMap.fourierMultiplierCLM ℂ (parameterSymbol H t) + +lemma schwartzResolvent_distribution (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (t : ℝ) (ht : 1 ≤ t) (f : 𝓢(EC n, ℂ)) : + SchwartzMap.toTemperedDistributionCLM (EC n) ℂ volume (schwartzResolvent H t f) = + parameterResolvent H t (SchwartzMap.toTemperedDistributionCLM (EC n) ℂ volume f) := + (fourierMultiplierCLM_toTemperedDistributionCLM_eq + (parameterSymbol_temperate H hH (lt_of_lt_of_le zero_lt_one ht)) f).symm + +lemma schwartzCoord_resolvent (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (t : ℝ) (ht : 1 ≤ t) (s : ℝ) (f : 𝓢(EC n, ℂ)) : + schwartzCoord (s + 2) (schwartzResolvent H t f) = + parameterHilbert H hH t ht (schwartzCoord s f) := by + apply realize_injective (s + 2) + rw [realize_schwartzCoord, parameterHilbert_realize, realize_schwartzCoord] + exact schwartzResolvent_distribution H hH t ht f + +lemma weak_deriv_resolvent (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (t : ℝ) (ht : 1 ≤ t) (v : EC n) (u : 𝓢'(EC n, ℂ)) : + ∂_{v} (parameterResolvent H t u) = parameterResolvent H t (∂_{v} u) := by + simp only [lineDeriv_eq_fourierMultiplierCLM, parameterResolvent, map_smul] + rw [fourierMultiplierCLM_fourierMultiplierCLM_apply + (parameterSymbol_temperate H hH (lt_of_lt_of_le zero_lt_one ht)) (by fun_prop), + fourierMultiplierCLM_fourierMultiplierCLM_apply (by fun_prop) + (parameterSymbol_temperate H hH (lt_of_lt_of_le zero_lt_one ht))] + simp only [mul_comm] + +lemma schwartz_deriv_resolvent (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (t : ℝ) (ht : 1 ≤ t) (v : EC n) (f : 𝓢(EC n, ℂ)) : + ∂_{v} (schwartzResolvent H t f) = schwartzResolvent H t (∂_{v} f) := by + apply schwartz_distribution_injective + rw [← lineDerivOp_toTemperedDistributionCLM_eq, schwartzResolvent_distribution H hH t ht, + schwartzResolvent_distribution H hH t ht, ← lineDerivOp_toTemperedDistributionCLM_eq] + exact weak_deriv_resolvent H hH t ht v (SchwartzMap.toTemperedDistributionCLM (EC n) ℂ volume f) + +lemma schwartz_word_resolvent (ws : List (EC n)) (H : Matrix (Fin n) (Fin n) ℂ) + (hH : H.PosDef) (t : ℝ) (ht : 1 ≤ t) (f : 𝓢(EC n, ℂ)) : + schwartzWord ws (schwartzResolvent H t f) = schwartzResolvent H t (schwartzWord ws f) := by + induction ws with + | nil => rfl + | cons w ws ih => + change ∂_{w} (schwartzWord ws (schwartzResolvent H t f)) = _ + rw [ih, schwartz_deriv_resolvent H hH t ht] + rfl + + +def schwartzNeumann (H : Matrix (Fin n) (Fin n) ℂ) (t : ℝ) (v : ι → EC n) + (a : SmoothCoefficients ι (EC n)) : 𝓢(EC n, ℂ) →L[ℂ] 𝓢(EC n, ℂ) := + schwartzResolvent H t ∘L smoothPerturbation v a + +lemma schwartzResolvent_bound (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) (t : ℝ) (ht : 1 ≤ t) + (f : 𝓢(EC n, ℂ)) : + ‖schwartzCoord 2 (schwartzResolvent H t f)‖ ≤ + ellipticBound H hH * ‖schwartzCoord 0 f‖ := by + have hc := schwartzCoord_resolvent H hH t ht 0 f + norm_num at hc + rw [hc] + exact parameterHilbert_bound H hH t ht _ + +lemma schwartzNeumann_bound (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) (t : ℝ) (ht : 1 ≤ t) + (v : ι → EC n) (a : SmoothCoefficients ι (EC n)) (f : 𝓢(EC n, ℂ)) : + ‖schwartzCoord 2 (schwartzNeumann H t v a f)‖ ≤ + (ellipticBound H hH * perturbationBound v (coefficientBCF a)) * + ‖schwartzCoord 2 f‖ := by + calc + _ ≤ ellipticBound H hH * ‖schwartzCoord 0 (smoothPerturbation v a f)‖ := + schwartzResolvent_bound H hH t ht _ + _ ≤ ellipticBound H hH * (perturbationBound v (coefficientBCF a) * + ‖schwartzCoord 2 f‖) := + mul_le_mul_of_nonneg_left (smoothPerturbation_bound v a f) (ellipticBound_pos H hH).le + _ = _ := by ring + +lemma schwartz_word_neumann (ws : List (EC n)) (H : Matrix (Fin n) (Fin n) ℂ) + (hH : H.PosDef) (t : ℝ) (ht : 1 ≤ t) (v : ι → EC n) (a : SmoothCoefficients ι (EC n)) (f : 𝓢(EC n, ℂ)) : + schwartzWord ws (schwartzNeumann H t v a f) = + schwartzNeumann H t v a (schwartzWord ws f) + + ((commutatorTerms ws a).map + (fun term => schwartzNeumann H t v term.1 (schwartzWord term.2 f))).sum := by + change schwartzWord ws (schwartzResolvent H t (smoothPerturbation v a f)) = _ + rw [schwartz_word_resolvent ws H hH t ht, schwartz_word_perturbation, map_add, map_list_sum] + simp only [List.map_map, Function.comp_def] + rfl + +def schwartzIterate (H : Matrix (Fin n) (Fin n) ℂ) (t : ℝ) (v : ι → EC n) + (a : SmoothCoefficients ι (EC n)) (f : 𝓢(EC n, ℂ)) (N : ℕ) : 𝓢(EC n, ℂ) := + (schwartzNeumann H t v a)^[N] f + +lemma schwartzIterate_succ (H : Matrix (Fin n) (Fin n) ℂ) (t : ℝ) (v : ι → EC n) + (a : SmoothCoefficients ι (EC n)) (f : 𝓢(EC n, ℂ)) (N : ℕ) : + schwartzIterate H t v a f (N+1) = schwartzNeumann H t v a (schwartzIterate H t v a f N) := + Function.iterate_succ_apply' _ _ _ + +lemma summable_norm_neumann_of (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) (t : ℝ) (ht : 1 ≤ t) + (v : ι → EC n) (a : SmoothCoefficients ι (EC n)) (f : ℕ → 𝓢(EC n, ℂ)) + (hf : Summable (fun m => ‖schwartzCoord 2 (f m)‖)) : + Summable (fun m => ‖schwartzCoord 2 (schwartzNeumann H t v a (f m))‖) := by + apply Summable.of_nonneg_of_le (fun _ => norm_nonneg _) + (fun m => schwartzNeumann_bound H hH t ht v a (f m)) + exact hf.mul_left _ + + + +theorem neumann_summable_word (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) (t : ℝ) (ht : 1 ≤ t) + (v : ι → EC n) (a : SmoothCoefficients ι (EC n)) + (hsmall : perturbationBound v (coefficientBCF a) * ellipticBound H hH < 1) + (f : 𝓢(EC n, ℂ)) (ws : List (EC n)) : + Summable (fun m => ‖schwartzCoord 2 (schwartzWord ws (schwartzIterate H t v a f m))‖) := by + induction hlen : ws.length using Nat.strong_induction_on generalizing ws with + | h k ih => + let err : ℕ → 𝓢(EC n, ℂ) := fun m => ((commutatorTerms ws a).map + (fun term => schwartzNeumann H t v term.1 (schwartzWord term.2 (schwartzIterate H t v a f m)))).sum + have hs : Summable (fun m => ‖schwartzCoord 2 (err m)‖) := by + apply summable_norm_schwartzCoord_list + intro term hterm + apply summable_norm_neumann_of H hH t ht + exact ih term.2.length (hlen ▸ commutatorTerms_order ws a term hterm) term.2 rfl + apply summable_of_contracting_recurrence (fun _ => norm_nonneg _) + (fun _ => norm_nonneg _) (q := ellipticBound H hH * perturbationBound v (coefficientBCF a)) + (by simpa only [mul_comm] using hsmall) hs + intro m + rw [schwartzIterate_succ, schwartz_word_neumann ws H hH t ht, schwartzCoord_add] + exact (norm_add_le _ _).trans (add_le_add + (schwartzNeumann_bound H hH t ht v a _) le_rfl) + +def neumannSum (H : Matrix (Fin n) (Fin n) ℂ) (t : ℝ) (v : ι → EC n) + (a : SmoothCoefficients ι (EC n)) (f : 𝓢(EC n, ℂ)) : L2 (EC n) := + ∑' m, schwartzCoord 2 (schwartzIterate H t v a f m) + +lemma schwartzCoord_neumann (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) (t : ℝ) (ht : 1 ≤ t) + (v : ι → EC n) (a : SmoothCoefficients ι (EC n)) (f : 𝓢(EC n, ℂ)) : + schwartzCoord 2 (schwartzNeumann H t v a f) = + parameterHilbert H hH t ht (perturbation v (coefficientBCF a) (schwartzCoord 2 f)) := by + have he := schwartzCoord_resolvent H hH t ht 0 (smoothPerturbation v a f) + norm_num at he + rw [schwartzCoord_perturbation] at he + exact he + +lemma neumannSum_fixed (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) (t : ℝ) (ht : 1 ≤ t) + (v : ι → EC n) (a : SmoothCoefficients ι (EC n)) + (hsmall : perturbationBound v (coefficientBCF a) * ellipticBound H hH < 1) + (f : 𝓢(EC n, ℂ)) : + neumannSum H t v a f = schwartzCoord 2 f + + parameterHilbert H hH t ht (perturbation v (coefficientBCF a) (neumannSum H t v a f)) := by + have hs := (neumann_summable_word H hH t ht v a hsmall f []).of_norm + change Summable (fun m => schwartzCoord 2 (schwartzIterate H t v a f m)) at hs + let T := parameterHilbert H hH t ht ∘L perturbation v (coefficientBCF a) + have hmap := T.map_tsum hs + simp only [T, ContinuousLinearMap.comp_apply, ← schwartzCoord_neumann, + ← schwartzIterate_succ] at hmap + change (∑' m, schwartzCoord 2 (schwartzIterate H t v a f m)) = _ + rw [hs.tsum_eq_zero_add] + change schwartzCoord 2 f + _ = schwartzCoord 2 f + _ + exact congrArg (schwartzCoord 2 f + ·) hmap.symm + +lemma fixed_unique (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (t : ℝ) (ht : 1 ≤ t) (v : ι → EC n) (a : ι → ι → EC n →ᵇ ℂ) + (hsmall : perturbationBound v a * ellipticBound H hH < 1) + (u w f : L2 (EC n)) + (hu : u = parameterHilbert H hH t ht (f + perturbation v a u)) + (hw : w = parameterHilbert H hH t ht (f + perturbation v a w)) : u = w := by + have he : u - w = parameterHilbert H hH t ht (perturbation v a (u - w)) := by + rw [map_sub, map_sub] + rw [map_add] at hu hw + calc + u - w = (parameterHilbert H hH t ht f + parameterHilbert H hH t ht (perturbation v a u)) - + (parameterHilbert H hH t ht f + parameterHilbert H hH t ht (perturbation v a w)) := + congrArg₂ (· - ·) hu hw + _ = _ := by abel + have hb : ‖u - w‖ ≤ (perturbationBound v a * ellipticBound H hH) * ‖u - w‖ := by + calc + _ = ‖parameterHilbert H hH t ht (perturbation v a (u - w))‖ := congrArg norm he + _ ≤ _ := (parameterHilbert_bound H hH t ht _).trans + (by nlinarith [perturbation_bound v a (u - w), ellipticBound_pos H hH]) + have : ‖u - w‖ = 0 := by nlinarith [norm_nonneg (u - w)] + exact sub_eq_zero.mp (norm_eq_zero.mp this) + +lemma parameterLocal_fixed (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (t : ℝ) (ht : 1 ≤ t) (v : ι → EC n) (a : ι → ι → EC n →ᵇ ℂ) + (hsmall : perturbationBound v a * ellipticBound H hH < 1) (f : L2 (EC n)) : + parameterLocal H hH t ht v a hsmall f = parameterHilbert H hH t ht + (f + perturbation v a (parameterLocal H hH t ht v a hsmall f)) := by + change parameterHilbert H hH t ht (parameterCorrection H hH t ht v a hsmall f) = _ + congr 1 + exact sub_eq_iff_eq_add.mp (parameterCorrection_equation H hH t ht v a hsmall f) + +lemma neumannSum_eq_local (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (t : ℝ) (ht : 1 ≤ t) (v : ι → EC n) (a : SmoothCoefficients ι (EC n)) + (hsmall : perturbationBound v (coefficientBCF a) * ellipticBound H hH < 1) + (f : 𝓢(EC n, ℂ)) : + neumannSum H t v a (schwartzResolvent H t f) = + parameterLocal H hH t ht v (coefficientBCF a) hsmall (schwartzCoord 0 f) := by + apply fixed_unique H hH t ht v (coefficientBCF a) hsmall _ _ (schwartzCoord 0 f) + · rw [map_add] + have hr := schwartzCoord_resolvent H hH t ht 0 f + norm_num at hr + rw [← hr] + exact neumannSum_fixed H hH t ht v a hsmall (schwartzResolvent H t f) + · exact parameterLocal_fixed H hH t ht v (coefficientBCF a) hsmall _ + + + +theorem parameterLocal_schwartz_memSobolev (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (t : ℝ) (ht : 1 ≤ t) (v : ι → EC n) (a : SmoothCoefficients ι (EC n)) + (hsmall : perturbationBound v (coefficientBCF a) * ellipticBound H hH < 1) + (f : 𝓢(EC n, ℂ)) (k : ℕ) : + MemSobolev (2 * (k : ℝ)) 2 + (realize 2 (parameterLocal H hH t ht v (coefficientBCF a) hsmall (schwartzCoord 0 f))) := by + rw [← neumannSum_eq_local H hH t ht v a hsmall f] + apply memSobolev_even_of_words _ _ k [] + intro ws + exact memSobolev_word_of_summable (schwartzIterate H t v a (schwartzResolvent H t f)) ws + (neumann_summable_word H hH t ht v a hsmall (schwartzResolvent H t f) []) + (neumann_summable_word H hH t ht v a hsmall (schwartzResolvent H t f) ws) + +end FrozenPoisson.ParameterRegularity + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/ParameterResolvent.lean b/lean/OAI/Geometry/PrescribedPotential/ParameterResolvent.lean new file mode 100644 index 0000000000000000000000000000000000000000..a84a060bac77d3c39a6189533c944c5a3dd88d53 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/ParameterResolvent.lean @@ -0,0 +1,301 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalSobolev + +namespace OAI + +/-! Parameter Resolvent. -/ + +section + + + +noncomputable section +open MeasureTheory FourierTransform TemperedDistribution LineDeriv +open scoped SchwartzMap BoundedContinuousFunction ComplexOrder MatrixOrder Real + +namespace FrozenPoisson +open EllipticKernel SobolevChart +variable {n : ℕ} + + +def parameterSymbol (H : Matrix (Fin n) (Fin n) ℂ) (m : ℝ) (ξ : EC n) : ℂ := + ((m^2 + symbol H ξ)⁻¹ : ℝ) + +lemma parameterSymbol_temperate (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + {m : ℝ} (hm : 0 < m) : (parameterSymbol H m).HasTemperateGrowth := by + obtain ⟨B, _, hB⟩ := posDef_factor H⁻¹ hH.inv + have he : parameterSymbol H m = fun ξ => + (m^2 : ℂ)⁻¹ * (Complex.ofReal ∘ + ((fun y : EC n => (1 + ‖y‖^2)^(-1 : ℝ)) ∘ + ((m⁻¹ : ℝ) • factorMap B))) ξ := by + funext ξ + simp only [parameterSymbol, Function.comp_apply, Real.rpow_neg_one, + _root_.smul_apply, norm_smul, Real.norm_eq_abs, + abs_of_pos (inv_pos.mpr hm), mul_pow, symbol_eq_factorMap H B hB, + ← Complex.ofReal_pow, ← Complex.ofReal_inv, ← Complex.ofReal_mul] + congr 1 + field_simp + rw [he] + have hg := (Function.hasTemperateGrowth_one_add_norm_sq_rpow (EC n) (-1)).comp + ((m⁻¹ : ℝ) • factorMap B).hasTemperateGrowth + exact (Function.HasTemperateGrowth.const _).mul + (Complex.hasTemperateGrowth_ofReal.comp hg) + +lemma elliptic_symbol_bound (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) (ξ : EC n) : + 1 + ‖ξ‖^2 ≤ ellipticBound H hH * (1 + symbol H ξ) := by + have hp := symbol_nonneg H hH ξ + have h := gainSymbol_bound H hH ξ + simp only [gainSymbol, inverseSymbol, ← Complex.ofReal_mul, + Complex.norm_real, Real.norm_eq_abs] at h + rw [abs_of_nonneg (by positivity), mul_inv_le_iff₀ (by linarith [symbol_nonneg H hH ξ])] at h + exact h + +lemma parameter_gain_bound (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + {m : ℝ} (hm : 1 ≤ m) (ξ : EC n) : + ‖(1 + ‖ξ‖^2 : ℝ) * parameterSymbol H m ξ‖ ≤ ellipticBound H hH := by + have hm2 : 1 ≤ m^2 := by nlinarith + have hp := symbol_nonneg H hH ξ + simp only [parameterSymbol, ← Complex.ofReal_mul, Complex.norm_real, Real.norm_eq_abs] + rw [abs_of_nonneg (by positivity), mul_inv_le_iff₀ (by positivity)] + exact (elliptic_symbol_bound H hH ξ).trans + (mul_le_mul_of_nonneg_left (by linarith) (ellipticBound_pos H hH).le) + +lemma parameter_zero_bound (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + {m : ℝ} (hm : 0 < m) (ξ : EC n) : + ‖parameterSymbol H m ξ‖ ≤ (m^2)⁻¹ := by + have hp := symbol_nonneg H hH ξ + simp only [parameterSymbol, Complex.norm_real, Real.norm_eq_abs, + abs_of_pos (inv_pos.mpr (show 0 < m^2 + symbol H ξ by positivity))] + exact inv_anti₀ (by positivity) (by linarith) + +lemma parameter_first_weight (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + {m : ℝ} (hm : 1 ≤ m) (ξ : EC n) : + ‖ξ‖ * (m^2 + symbol H ξ)⁻¹ ≤ ellipticBound H hH / m := by + let C := ellipticBound H hH + let D := m^2 + symbol H ξ + have hC : 1 ≤ C := le_max_left _ _ + have hm0 : 0 < m := lt_of_lt_of_le zero_lt_one hm + have hm2 : 1 ≤ m^2 := by nlinarith + have hp := symbol_nonneg H hH ξ + have hD : 0 < D := by dsimp [D]; positivity + have hDm : m^2 ≤ D := by dsimp [D]; linarith + have hξ : ‖ξ‖^2 ≤ C * D := by + have hb := elliptic_symbol_bound H hH ξ + dsimp [D, C] + nlinarith [mul_nonneg (ellipticBound_pos H hH).le (sub_nonneg.mpr hm2)] + have hsq : (‖ξ‖ * m)^2 ≤ (C * D)^2 := by + calc + _ = ‖ξ‖^2 * m^2 := mul_pow _ _ _ + _ ≤ (C * D) * m^2 := mul_le_mul_of_nonneg_right hξ (sq_nonneg _) + _ ≤ (C * D) * D := mul_le_mul_of_nonneg_left hDm (by positivity) + _ ≤ (C * D)^2 := by nlinarith [mul_nonneg (sub_nonneg.mpr hC) (show 0 ≤ C * D^2 by positivity)] + have hlin : ‖ξ‖ * m ≤ C * D := (sq_le_sq₀ (by positivity) (by positivity)).mp hsq + change ‖ξ‖ * D⁻¹ ≤ C / m + rw [le_div_iff₀ hm0] + rw [mul_right_comm, mul_inv_le_iff₀ hD] + exact hlin + + +def parameterResolvent (H : Matrix (Fin n) (Fin n) ℂ) (m : ℝ) : + 𝓢'(EC n, ℂ) →L[ℂ] 𝓢'(EC n, ℂ) := fourierMultiplierCLM ℂ (parameterSymbol H m) + +def parameterForward (H : Matrix (Fin n) (Fin n) ℂ) (m : ℝ) : + 𝓢'(EC n, ℂ) →L[ℂ] 𝓢'(EC n, ℂ) := + fourierMultiplierCLM ℂ (fun ξ => ((m^2 + symbol H ξ : ℝ) : ℂ)) + +lemma parameterForward_temperate (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) (m : ℝ) : + (fun ξ => ((m^2 + symbol H ξ : ℝ) : ℂ)).HasTemperateGrowth := + Complex.hasTemperateGrowth_ofReal.comp + ((Function.HasTemperateGrowth.const _).add (symbol_temperate H hH)) + +lemma parameterForward_eq (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (m : ℝ) (u : 𝓢'(EC n, ℂ)) : + parameterForward H m u = (m^2 : ℂ) • u - frozenDifferential H u := by + rw [frozenDifferential_fourier] + have hn : (fun ξ => ((-symbol H ξ : ℝ) : ℂ)).HasTemperateGrowth := + Complex.hasTemperateGrowth_ofReal.comp (symbol_temperate H hH).neg + have he := multiplier_sub (Function.HasTemperateGrowth.const (m^2 : ℂ)) hn u + simpa only [Pi.sub_def, Complex.ofReal_neg, sub_neg_eq_add, parameterForward, + Complex.ofReal_add, Complex.ofReal_pow, fourierMultiplierCLM_const, + _root_.smul_apply, ContinuousLinearMap.id_apply] using he + +lemma parameterForward_resolvent (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + {m : ℝ} (hm : 0 < m) (u : 𝓢'(EC n, ℂ)) : + parameterForward H m (parameterResolvent H m u) = u := by + rw [parameterForward, parameterResolvent, + fourierMultiplierCLM_fourierMultiplierCLM_apply (parameterSymbol_temperate H hH hm) + (parameterForward_temperate H hH m)] + have he : parameterSymbol H m * (fun ξ => ((m^2 + symbol H ξ : ℝ) : ℂ)) = + fun _ => (1 : ℂ) := by + funext ξ + simp only [Pi.mul_apply, parameterSymbol, ← Complex.ofReal_mul] + have hp := symbol_nonneg H hH ξ + rw [inv_mul_cancel₀ (by positivity : m^2 + symbol H ξ ≠ 0), Complex.ofReal_one] + rw [he, fourierMultiplierCLM_const] + simp + +end FrozenPoisson + +namespace FrozenPoisson +open EllipticKernel SobolevChart +variable {n : ℕ} + +def parameterGain (H : Matrix (Fin n) (Fin n) ℂ) (m : ℝ) (ξ : EC n) : ℂ := + (1 + ‖ξ‖^2 : ℝ) * parameterSymbol H m ξ + +lemma parameterGain_temperate (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + {m : ℝ} (hm : 0 < m) : (parameterGain H m).HasTemperateGrowth := by + have hi := parameterSymbol_temperate H hH hm + unfold parameterGain + fun_prop + +def parameterGainBCF (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (m : ℝ) (hm : 1 ≤ m) : EC n →ᵇ ℂ := + BoundedContinuousFunction.ofNormedAddCommGroup (parameterGain H m) + (parameterGain_temperate H hH (lt_of_lt_of_le zero_lt_one hm)).1.continuous + (ellipticBound H hH) (parameter_gain_bound H hH hm) + +lemma parameterGainBCF_norm (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (m : ℝ) (hm : 1 ≤ m) : ‖parameterGainBCF H hH m hm‖ ≤ ellipticBound H hH := + (BoundedContinuousFunction.norm_le (ellipticBound_pos H hH).le).mpr + (parameter_gain_bound H hH hm) + +def parameterHilbert (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (m : ℝ) (hm : 1 ≤ m) : L2 (EC n) →L[ℂ] L2 (EC n) := + multiplier (parameterGainBCF H hH m hm) + +lemma parameterHilbert_bound (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (m : ℝ) (hm : 1 ≤ m) (u : L2 (EC n)) : + ‖parameterHilbert H hH m hm u‖ ≤ ellipticBound H hH * ‖u‖ := + (multiplier_norm_le (parameterGainBCF H hH m hm) u).trans + (mul_le_mul_of_nonneg_right (parameterGainBCF_norm H hH m hm) (norm_nonneg u)) + +lemma bessel_two_parameterResolvent (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + {m : ℝ} (hm : 0 < m) (u : 𝓢'(EC n, ℂ)) : + besselPotential (EC n) ℂ 2 (parameterResolvent H m u) = + fourierMultiplierCLM ℂ (parameterGain H m) u := by + rw [besselPotential, parameterResolvent, + fourierMultiplierCLM_fourierMultiplierCLM_apply (parameterSymbol_temperate H hH hm) + (by fun_prop)] + congr 2 + ext ξ + simp [parameterGain, mul_comm] + +lemma parameterHilbert_realize (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (m : ℝ) (hm : 1 ≤ m) (s : ℝ) (u : L2 (EC n)) : + realize (s + 2) (parameterHilbert H hH m hm u) = + parameterResolvent H m (realize s u) := by + have hm0 : 0 < m := lt_of_lt_of_le zero_lt_one hm + change besselPotential (EC n) ℂ (-(s + 2)) + (Lp.toTemperedDistributionCLM ℂ MeasureTheory.volume 2 (parameterHilbert H hH m hm u)) = _ + rw [besselPotential_neg_apply_eq_iff] + have hc : parameterResolvent H m (realize s u) = besselPotential (EC n) ℂ (-s) + (parameterResolvent H m (Lp.toTemperedDistributionCLM ℂ MeasureTheory.volume 2 u)) := + (bessel_multiplier_comm (parameterSymbol_temperate H hH hm0) (-s) _).symm + rw [hc, besselPotential_besselPotential_apply] + have hs : -s + (s + 2) = 2 := by ring + rw [hs, bessel_two_parameterResolvent H hH hm0] + exact (multiplier_distribution (parameterGainBCF H hH m hm) + (parameterGain_temperate H hH hm0) u).symm + +lemma parameterHilbert_equation (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (m : ℝ) (hm : 1 ≤ m) (f : L2 (EC n)) : + (m^2 : ℂ) • realize 2 (parameterHilbert H hH m hm f) - + frozenDifferential H (realize 2 (parameterHilbert H hH m hm f)) = + (f : 𝓢'(EC n, ℂ)) := by + rw [← parameterForward_eq H hH] + have hr := parameterHilbert_realize H hH m hm 0 f + simp only [zero_add] at hr + rw [hr, parameterForward_resolvent H hH (lt_of_lt_of_le zero_lt_one hm)] + simp [realize] + +def parameterZeroBCF (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (m : ℝ) (hm : 0 < m) : EC n →ᵇ ℂ := + BoundedContinuousFunction.ofNormedAddCommGroup (parameterSymbol H m) + (parameterSymbol_temperate H hH hm).1.continuous (m^2)⁻¹ (parameter_zero_bound H hH hm) + +def parameterZero (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (m : ℝ) (hm : 0 < m) : L2 (EC n) →L[ℂ] L2 (EC n) := + multiplier (parameterZeroBCF H hH m hm) + +lemma parameterZero_bound (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (m : ℝ) (hm : 0 < m) (f : L2 (EC n)) : + ‖parameterZero H hH m hm f‖ ≤ (m^2)⁻¹ * ‖f‖ := by + apply (multiplier_norm_le _ f).trans + apply mul_le_mul_of_nonneg_right _ (norm_nonneg _) + exact (BoundedContinuousFunction.norm_le (by positivity)).mpr (parameter_zero_bound H hH hm) + +lemma parameterZero_distribution (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (m : ℝ) (hm : 0 < m) (f : L2 (EC n)) : + (parameterZero H hH m hm f : 𝓢'(EC n, ℂ)) = parameterResolvent H m (f : 𝓢'(EC n, ℂ)) := + multiplier_distribution _ (parameterSymbol_temperate H hH hm) f + +def parameterFirstSymbol (H : Matrix (Fin n) (Fin n) ℂ) (m : ℝ) (v ξ : EC n) : ℂ := + (2 * Real.pi * Complex.I) * (inner ℝ ξ v : ℂ) * parameterSymbol H m ξ + +lemma parameterFirstSymbol_temperate (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + {m : ℝ} (hm : 0 < m) (v : EC n) : (parameterFirstSymbol H m v).HasTemperateGrowth := by + have hi := parameterSymbol_temperate H hH hm + unfold parameterFirstSymbol + fun_prop + +lemma parameterFirstSymbol_bound (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + {m : ℝ} (hm : 1 ≤ m) (v ξ : EC n) : + ‖parameterFirstSymbol H m v ξ‖ ≤ (2 * Real.pi * ‖v‖ * ellipticBound H hH) / m := by + have hm0 : 0 < m := lt_of_lt_of_le zero_lt_one hm + have hp := symbol_nonneg H hH ξ + have hi := abs_real_inner_le_norm ξ v + have hw := parameter_first_weight H hH hm ξ + simp only [parameterFirstSymbol, norm_mul, Complex.norm_I, mul_one, + Complex.norm_ofNat, Complex.norm_real, Real.norm_eq_abs, abs_of_pos Real.pi_pos, + parameterSymbol, abs_of_pos (inv_pos.mpr (show 0 < m^2 + symbol H ξ by positivity))] + calc + _ ≤ (2 * Real.pi) * (‖ξ‖ * ‖v‖) * (m^2 + symbol H ξ)⁻¹ := by gcongr + _ = (2 * Real.pi * ‖v‖) * (‖ξ‖ * (m^2 + symbol H ξ)⁻¹) := by ring + _ ≤ (2 * Real.pi * ‖v‖) * (ellipticBound H hH / m) := by gcongr + _ = _ := by ring + +def parameterFirstBCF (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (m : ℝ) (hm : 1 ≤ m) (v : EC n) : EC n →ᵇ ℂ := + BoundedContinuousFunction.ofNormedAddCommGroup (parameterFirstSymbol H m v) + (parameterFirstSymbol_temperate H hH (lt_of_lt_of_le zero_lt_one hm) v).1.continuous + ((2 * Real.pi * ‖v‖ * ellipticBound H hH) / m) (parameterFirstSymbol_bound H hH hm v) + +def parameterFirst (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (m : ℝ) (hm : 1 ≤ m) (v : EC n) : L2 (EC n) →L[ℂ] L2 (EC n) := + multiplier (parameterFirstBCF H hH m hm v) + +lemma parameterFirst_bound (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (m : ℝ) (hm : 1 ≤ m) (v : EC n) (f : L2 (EC n)) : + ‖parameterFirst H hH m hm v f‖ ≤ ((2 * Real.pi * ‖v‖ * ellipticBound H hH) / m) * ‖f‖ := by + apply (multiplier_norm_le _ f).trans + apply mul_le_mul_of_nonneg_right _ (norm_nonneg _) + exact (BoundedContinuousFunction.norm_le (by positivity [ellipticBound_pos H hH])).mpr + (parameterFirstSymbol_bound H hH hm v) + +lemma parameterFirst_distribution (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (m : ℝ) (hm : 1 ≤ m) (v : EC n) (f : L2 (EC n)) : + (parameterFirst H hH m hm v f : 𝓢'(EC n, ℂ)) = + ∂_{v} (parameterResolvent H m (f : 𝓢'(EC n, ℂ))) := by + have hm0 : 0 < m := lt_of_lt_of_le zero_lt_one hm + rw [lineDeriv_eq_fourierMultiplierCLM, parameterResolvent, + fourierMultiplierCLM_fourierMultiplierCLM_apply (parameterSymbol_temperate H hH hm0) + (by fun_prop)] + have ht : (parameterSymbol H m * (fun ξ => (inner ℝ ξ v : ℂ))).HasTemperateGrowth := by + apply (parameterSymbol_temperate H hH hm0).mul + fun_prop + rw [← _root_.smul_apply, ← fourierMultiplierCLM_smul ht, parameterFirst, + multiplier_distribution _ (parameterFirstSymbol_temperate H hH hm0 v)] + congr 2 + ext ξ + change parameterFirstSymbol H m v ξ = + (2 * Real.pi * Complex.I) * (parameterSymbol H m ξ * (inner ℝ ξ v : ℂ)) + unfold parameterFirstSymbol + ring + +end FrozenPoisson + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/ParameterSchwartz.lean b/lean/OAI/Geometry/PrescribedPotential/ParameterSchwartz.lean new file mode 100644 index 0000000000000000000000000000000000000000..645c49ba22e019df569204298343c8ef149a4b9e --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/ParameterSchwartz.lean @@ -0,0 +1,142 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.ParameterRegularity +import OAI.Geometry.PrescribedPotential.SmoothDistributions + +namespace OAI + +/-! Parameter Schwartz. -/ + +section + + + +noncomputable section +open Filter Topology MeasureTheory FourierTransform TemperedDistribution LineDeriv +open scoped SchwartzMap BoundedContinuousFunction ContDiff Real ComplexOrder MatrixOrder + +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +lemma schwartz_mul_temperate_distribution (a : 𝓢(E, ℂ)) {h : E → ℂ} + (hh : h.HasTemperateGrowth) : + ((SchwartzMap.smulLeftCLM ℂ h a : 𝓢(E, ℂ)) : 𝓢'(E, ℂ)) = + smulLeftCLM ℂ a (hh.toTemperedDistribution volume) := by + ext φ + simp only [SchwartzMap.toTemperedDistributionCLM_apply_apply, + smulLeftCLM_apply_apply, Function.HasTemperateGrowth.toTemperedDistribution_apply, + SchwartzMap.smulLeftCLM_apply_apply hh, + SchwartzMap.smulLeftCLM_apply_apply a.hasTemperateGrowth, smul_eq_mul] + apply integral_congr_ae + filter_upwards [] with x + ring + + + +def representativePerturbation {ι : Type*} [Fintype ι] (v : ι → E) + (a : SmoothCoefficients ι E) (u : E → ℂ) : 𝓢(E, ℂ) := + ∑ i, ∑ j, SchwartzMap.smulLeftCLM ℂ + (directionDerivative (v i) (directionDerivative (v j) u)) (a i j) + +lemma representativePerturbation_distribution {ι : Type*} [Fintype ι] (v : ι → E) + (a : SmoothCoefficients ι E) {u : E → ℂ} (hu : u.HasTemperateGrowth) (w : L2 E) + (hw : hu.toTemperedDistribution volume = realize 2 w) : + ((representativePerturbation v a u : 𝓢(E, ℂ)) : 𝓢'(E, ℂ)) = + (perturbation v (coefficientBCF a) w : 𝓢'(E, ℂ)) := by + rw [perturbation_distribution v _ (fun i j => (a i j).hasTemperateGrowth)] + simp only [representativePerturbation, map_sum] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + rw [schwartz_mul_temperate_distribution (a i j) + (temperate_directionDerivative (v i) (temperate_directionDerivative (v j) hu)), + temperateDistribution_derivative (v i) (temperate_directionDerivative (v j) hu), + temperateDistribution_derivative (v j) hu, hw] + rfl + +end SobolevChart + +namespace FrozenPoisson.ParameterRegularity +open FrozenPoisson SobolevChart EllipticKernel +variable {n : ℕ} {ι : Type*} [Fintype ι] + + + +theorem exists_schwartz_local (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (t : ℝ) (ht : 1 ≤ t) (v : ι → EC n) (a : SmoothCoefficients ι (EC n)) + (hsmall : perturbationBound v (coefficientBCF a) * ellipticBound H hH < 1) + (f : 𝓢(EC n, ℂ)) : + ∃ u : 𝓢(EC n, ℂ), SchwartzMap.toTemperedDistributionCLM (EC n) ℂ volume u = + realize 2 (parameterLocal H hH t ht v (coefficientBCF a) hsmall (schwartzCoord 0 f)) := by + let w := parameterLocal H hH t ht v (coefficientBCF a) hsmall (schwartzCoord 0 f) + obtain ⟨u, hu, he⟩ := all_even_smooth_representative + (parameterLocal_schwartz_memSobolev H hH t ht v a hsmall f) + have he' : hu.toTemperedDistribution volume = realize 2 w := by + rw [temperateDistribution_bounded] + exact he + let F := f + representativePerturbation v a u + refine ⟨schwartzResolvent H t F, ?_⟩ + rw [schwartzResolvent_distribution H hH t ht] + have hF : SchwartzMap.toTemperedDistributionCLM (EC n) ℂ volume F = + SchwartzMap.toTemperedDistributionCLM (EC n) ℂ volume f + + (perturbation v (coefficientBCF a) w : 𝓢'(EC n, ℂ)) := by + simp only [F, map_add, representativePerturbation_distribution v a hu w he'] + rw [hF] + have hfixed := congrArg (realize (E := EC n) 2) + (parameterLocal_fixed H hH t ht v (coefficientBCF a) hsmall (schwartzCoord 0 f)) + have hr := parameterHilbert_realize H hH t ht 0 + (schwartzCoord 0 f + perturbation v (coefficientBCF a) w) + norm_num only [zero_add] at hr + rw [hr, map_add, realize_schwartzCoord] at hfixed + simpa only [realize, neg_zero, besselPotential_zero, ContinuousLinearMap.comp_apply, + ContinuousLinearMap.id_apply, Lp.toTemperedDistributionCLM_apply] using hfixed.symm + + + +def schwartzLocalValue (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (t : ℝ) (ht : 1 ≤ t) (v : ι → EC n) (a : SmoothCoefficients ι (EC n)) + (hsmall : perturbationBound v (coefficientBCF a) * ellipticBound H hH < 1) + (f : 𝓢(EC n, ℂ)) : 𝓢(EC n, ℂ) := + (exists_schwartz_local H hH t ht v a hsmall f).choose + +lemma schwartzLocalValue_distribution (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (t : ℝ) (ht : 1 ≤ t) (v : ι → EC n) (a : SmoothCoefficients ι (EC n)) + (hsmall : perturbationBound v (coefficientBCF a) * ellipticBound H hH < 1) + (f : 𝓢(EC n, ℂ)) : + SchwartzMap.toTemperedDistributionCLM (EC n) ℂ volume + (schwartzLocalValue H hH t ht v a hsmall f) = + realize 2 (parameterLocal H hH t ht v (coefficientBCF a) hsmall (schwartzCoord 0 f)) := + (exists_schwartz_local H hH t ht v a hsmall f).choose_spec + +def schwartzLocal (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (t : ℝ) (ht : 1 ≤ t) (v : ι → EC n) (a : SmoothCoefficients ι (EC n)) + (hsmall : perturbationBound v (coefficientBCF a) * ellipticBound H hH < 1) : + 𝓢(EC n, ℂ) →ₗ[ℂ] 𝓢(EC n, ℂ) where + toFun := schwartzLocalValue H hH t ht v a hsmall + map_add' f g := by + apply schwartz_distribution_injective + simp only [map_add, schwartzLocalValue_distribution, schwartzCoord_add] + map_smul' c f := by + apply schwartz_distribution_injective + have hc : schwartzCoord 0 (c • f) = c • schwartzCoord 0 f := by + apply realize_injective 0 + simp only [map_smul, realize_schwartzCoord] + simp only [map_smul, schwartzLocalValue_distribution, hc, RingHom.id_apply] + +lemma schwartzLocal_coord (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (t : ℝ) (ht : 1 ≤ t) (v : ι → EC n) (a : SmoothCoefficients ι (EC n)) + (hsmall : perturbationBound v (coefficientBCF a) * ellipticBound H hH < 1) + (f : 𝓢(EC n, ℂ)) : + schwartzCoord 2 (schwartzLocal H hH t ht v a hsmall f) = + parameterLocal H hH t ht v (coefficientBCF a) hsmall (schwartzCoord 0 f) := by + apply realize_injective 2 + rw [realize_schwartzCoord] + exact schwartzLocalValue_distribution H hH t ht v a hsmall f + +end FrozenPoisson.ParameterRegularity + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/ParametrixAtlas.lean b/lean/OAI/Geometry/PrescribedPotential/ParametrixAtlas.lean new file mode 100644 index 0000000000000000000000000000000000000000..7d46ee95b2c2d13b4ed518f2bf66236c467f309b --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/ParametrixAtlas.lean @@ -0,0 +1,141 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.AtlasLocalization +import OAI.Geometry.PrescribedPotential.ChartParametrix +import OAI.Geometry.PrescribedPotential.LocalRegularity + +namespace OAI + +/-! Parametrix Atlas. -/ + +section + + + +noncomputable section +open Set Filter Topology Manifold IsManifold +open scoped ContDiff SchwartzMap BoundedContinuousFunction ComplexOrder MatrixOrder Matrix.Norms.Elementwise + +namespace Anticanonical.ComplexAtlas +open EllipticKernel +variable {d : ℕ} {X : Type*} [TopologicalSpace X] (A : ComplexAtlas d X) + +def euclideanChart (i : Fin A.count) : OpenPartialHomeomorph X (EC d) := + (A.chart i).trans (coordinateEquiv d).symm.toHomeomorph.toOpenPartialHomeomorph + +@[simp] lemma euclideanChart_source (i : Fin A.count) : + (A.euclideanChart i).source = (A.chart i).source := by + simp [euclideanChart] + +@[simp] lemma euclideanChart_target (i : Fin A.count) : + (A.euclideanChart i).target = (coordinateEquiv d) ⁻¹' (A.chart i).target := by + ext x + simp [euclideanChart] + +@[simp] lemma euclideanChart_apply (i : Fin A.count) (x : X) : + A.euclideanChart i x = (coordinateEquiv d).symm (A.chart i x) := rfl + +@[simp] lemma euclideanChart_symm_apply (i : Fin A.count) (y : EC d) : + (A.euclideanChart i).symm y = (A.chart i).symm (coordinateEquiv d y) := rfl + +lemma euclidean_transition_smooth (i j : Fin A.count) : + ContDiffOn ℝ ∞ ((A.euclideanChart i).symm.trans (A.euclideanChart j)) + ((A.euclideanChart i).symm.trans (A.euclideanChart j)).source := by + let e := (A.euclideanChart i).symm.trans (A.euclideanChart j) + have he : (e : EC d → EC d) = + (coordinateEquiv d).symm ∘ A.transition i j ∘ coordinateEquiv d := rfl + rw [he] + apply (coordinateEquiv d).symm.contDiff.comp_contDiffOn + apply (A.real_smooth_transition i j).comp (coordinateEquiv d).contDiff.contDiffOn + intro z hz + exact ⟨by simpa using hz.1, by simpa using hz.2⟩ + +end Anticanonical.ComplexAtlas + +namespace Anticanonical.SourceSmooth +open EllipticKernel SobolevChart FrozenPoisson MetricLocalization +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + + +structure ParametrixPatch (g : KaehlerMetric A) where + index : Fin A.count + center : EC d + mem_target : center ∈ (A.euclideanChart index).target + domain : Set (EC d) + isOpen_domain : IsOpen domain + center_mem : center ∈ domain + domain_sub : domain ⊆ (A.euclideanChart index).target + coefficient : SmoothCoefficients (BasisIndex d) (EC d) + small : perturbationBound (stdOrthonormalBasis ℝ (EC d)) (coefficientBCF coefficient) * + ellipticBound (g.matrix index (coordinateEquiv d center)) + (g.positive index _ (by simpa using mem_target)) < 1 + equals : ∀ y ∈ domain, ∀ k l, + extendedCoefficient (g.matrix index (coordinateEquiv d center)) + (coefficientBCF coefficient) k l y = + (traceBilin (g.matrix index (coordinateEquiv d y)) + (rankTwo (stdOrthonormalBasis ℝ (EC d) k) (stdOrthonormalBasis ℝ (EC d) l)) : ℂ) + +namespace ParametrixPatch +variable (g : KaehlerMetric A) + +def source (p : ParametrixPatch g) : Set X := + (A.euclideanChart p.index).source ∩ (A.euclideanChart p.index) ⁻¹' p.domain + +lemma isOpen_source (p : ParametrixPatch g) : IsOpen p.source := + (A.euclideanChart p.index).isOpen_inter_preimage p.isOpen_domain + +lemma source_sub (p : ParametrixPatch g) : p.source ⊆ (A.chart p.index).source := + fun _ hx => by simpa using hx.1 + +lemma exists_at (x : X) : ∃ p : ParametrixPatch g, x ∈ p.source := by + obtain ⟨i, hi⟩ := A.covers x + let e := A.euclideanChart i + have hxe : x ∈ e.source := by simpa [e] using hi + have hx : e x ∈ e.target := e.mapsTo hxe + let H : EC d → Matrix (Fin d) (Fin d) ℂ := fun z => g.matrix i (coordinateEquiv d z) + have hH : ContDiffOn ℝ ∞ H e.target := + (g.smooth i).comp (coordinateEquiv d).contDiff.contDiffOn (fun z hz => by simpa [e] using hz) + have hh : ∀ z ∈ e.target, (H z).PosDef := fun z hz => g.positive i _ (by simpa [e] using hz) + let b := stdOrthonormalBasis ℝ (EC d) + obtain ⟨a, hat, hac, has, hag⟩ := local_coefficient_extension e.open_target H hH hh hx b + let a' : SmoothCoefficients (BasisIndex d) (EC d) := + fun k l => (hac k l).toSchwartzMap (hat k l).1 + have hae : coefficientBCF a' = a := by funext k l; ext y; rfl + obtain ⟨V, hVsub, hVo, hxV⟩ := mem_nhds_iff.mp (inter_mem (e.open_target.mem_nhds hx) hag) + let p : ParametrixPatch g := + { index := i + center := e x + mem_target := hx + domain := V + isOpen_domain := hVo + center_mem := hxV + domain_sub := fun y hy => (hVsub hy).1 + coefficient := a' + small := by rw [hae]; exact has + equals := by + intro y hy k l + rw [hae] + change (traceBilin (H (e x)) (rankTwo (b k) (b l)) : ℂ) + a k l y = _ + rw [(hVsub hy).2 k l] + ring } + exact ⟨p, hxe, hxV⟩ + + +theorem finite_cover [CompactSpace X] : + ∃ S : Finset (ParametrixPatch g), ∀ x : X, ∃ p ∈ S, x ∈ p.source := by + classical + obtain ⟨S, hS⟩ := isCompact_univ.elim_finite_subcover (fun p : ParametrixPatch g => p.source) + (fun p => p.isOpen_source) (by + intro x _ + obtain ⟨p, hp⟩ := exists_at g x + exact mem_iUnion.mpr ⟨p, hp⟩) + refine ⟨S, fun x => ?_⟩ + obtain ⟨p, hp, hx⟩ := mem_iUnion₂.mp (hS (mem_univ x)) + exact ⟨p, hp, hx⟩ + +end ParametrixPatch +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/ParametrixCommutator.lean b/lean/OAI/Geometry/PrescribedPotential/ParametrixCommutator.lean new file mode 100644 index 0000000000000000000000000000000000000000..48394b9cf363f6e1c1dbf36a01ccdde5592722e7 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/ParametrixCommutator.lean @@ -0,0 +1,209 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.ChartParametrix +import OAI.Geometry.PrescribedPotential.ParameterLocal +import OAI.Geometry.PrescribedPotential.SobolevLocalization + +namespace OAI + +/-! Parametrix Commutator. -/ + +section + + + +noncomputable section +open MeasureTheory FourierTransform TemperedDistribution LineDeriv +open scoped SchwartzMap BoundedContinuousFunction ComplexOrder MatrixOrder Real + +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma weak_second_product (v w : E) (g : 𝓢(E, ℂ)) (u : 𝓢'(E, ℂ)) : + ∂_{v} (∂_{w} (smulLeftCLM ℂ g u)) = + smulLeftCLM ℂ g (∂_{v} (∂_{w} u)) + + (smulLeftCLM ℂ (⇑(∂_{v} g : 𝓢(E, ℂ))) (∂_{w} u) + + smulLeftCLM ℂ (⇑(∂_{w} g : 𝓢(E, ℂ))) (∂_{v} u) + + smulLeftCLM ℂ (⇑(∂_{v} (∂_{w} g) : 𝓢(E, ℂ))) u) := by + rw [weak_deriv_product, lineDerivOp_add, weak_deriv_product, weak_deriv_product] + abel + +end SobolevChart + +namespace MetricLocalization +open EllipticKernel FrozenPoisson SobolevChart +variable {n : ℕ} + + + +def cutoffError (c : BasisIndex n → BasisIndex n → EC n →ᵇ ℂ) + (g : 𝓢(EC n, ℂ)) (u : L2 (EC n)) (Du : BasisIndex n → L2 (EC n)) : L2 (EC n) := + ∑ k, ∑ l, multiply (c k l) + (multiply (∂_{stdOrthonormalBasis ℝ (EC n) k} g).toBoundedContinuousFunction (Du l) + + multiply (∂_{stdOrthonormalBasis ℝ (EC n) l} g).toBoundedContinuousFunction (Du k) + + multiply (∂_{stdOrthonormalBasis ℝ (EC n) k} + (∂_{stdOrthonormalBasis ℝ (EC n) l} g)).toBoundedContinuousFunction u) + +lemma cutoffError_distribution + (c : BasisIndex n → BasisIndex n → EC n →ᵇ ℂ) + (hc : ∀ k l, (c k l : EC n → ℂ).HasTemperateGrowth) + (g : 𝓢(EC n, ℂ)) (u : L2 (EC n)) (Du : BasisIndex n → L2 (EC n)) + (hDu : ∀ k, (Du k : 𝓢'(EC n, ℂ)) = ∂_{stdOrthonormalBasis ℝ (EC n) k} (u : 𝓢'(EC n, ℂ))) : + (cutoffError c g u Du : 𝓢'(EC n, ℂ)) = + chartDifferential c (smulLeftCLM ℂ g (u : 𝓢'(EC n, ℂ))) - + smulLeftCLM ℂ g (chartDifferential c (u : 𝓢'(EC n, ℂ))) := by + classical + change Lp.toTemperedDistributionCLM ℂ volume 2 (cutoffError c g u Du) = _ + simp only [cutoffError, map_sum, chartDifferential, + _root_.sum_apply, ContinuousLinearMap.comp_apply, lineDerivOpCLM_apply, + Lp.toTemperedDistributionCLM_apply, ← Finset.sum_sub_distrib] + apply Finset.sum_congr rfl + intro k _ + apply Finset.sum_congr rfl + intro l _ + rw [multiply_distribution _ (hc k l)] + simp only [← Lp.toTemperedDistributionCLM_apply, map_add] + simp only [Lp.toTemperedDistributionCLM_apply] + rw [multiply_distribution _ (∂_{stdOrthonormalBasis ℝ (EC n) k} g).hasTemperateGrowth, + multiply_distribution _ (∂_{stdOrthonormalBasis ℝ (EC n) l} g).hasTemperateGrowth, + multiply_distribution _ (∂_{stdOrthonormalBasis ℝ (EC n) k} + (∂_{stdOrthonormalBasis ℝ (EC n) l} g)).hasTemperateGrowth, + hDu, hDu, SobolevChart.weak_second_product] + simp only [map_add] + have he : smulLeftCLM ℂ (c k l) (smulLeftCLM ℂ g + (∂_{stdOrthonormalBasis ℝ (EC n) k} + (∂_{stdOrthonormalBasis ℝ (EC n) l} (u : 𝓢'(EC n, ℂ))))) = + smulLeftCLM ℂ g (smulLeftCLM ℂ (c k l) + (∂_{stdOrthonormalBasis ℝ (EC n) k} + (∂_{stdOrthonormalBasis ℝ (EC n) l} (u : 𝓢'(EC n, ℂ))))) := by + rw [smulLeftCLM_smulLeftCLM_apply g.hasTemperateGrowth (hc k l), + smulLeftCLM_smulLeftCLM_apply (hc k l) g.hasTemperateGrowth] + congr 2 + ext x + exact mul_comm _ _ + rw [he] + abel + +lemma cutoffError_bound + (c : BasisIndex n → BasisIndex n → EC n →ᵇ ℂ) + (g : 𝓢(EC n, ℂ)) (u : L2 (EC n)) (Du : BasisIndex n → L2 (EC n)) : + ‖cutoffError c g u Du‖ ≤ ∑ k, ∑ l, ‖c k l‖ * + (‖(∂_{stdOrthonormalBasis ℝ (EC n) k} g).toBoundedContinuousFunction‖ * ‖Du l‖ + + ‖(∂_{stdOrthonormalBasis ℝ (EC n) l} g).toBoundedContinuousFunction‖ * ‖Du k‖ + + ‖(∂_{stdOrthonormalBasis ℝ (EC n) k} + (∂_{stdOrthonormalBasis ℝ (EC n) l} g)).toBoundedContinuousFunction‖ * ‖u‖) := by + classical + unfold cutoffError + apply (norm_sum_le _ _).trans + apply Finset.sum_le_sum + intro k _ + apply (norm_sum_le _ _).trans + apply Finset.sum_le_sum + intro l _ + apply (multiply_norm_le _ _).trans + apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) + apply (norm_add_le _ _).trans + apply add_le_add + · exact (norm_add_le _ _).trans (add_le_add (multiply_norm_le _ _) (multiply_norm_le _ _)) + · exact multiply_norm_le _ _ + + + +def parameterCutoffError (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (m : ℝ) (hm : 1 ≤ m) + (a : BasisIndex n → BasisIndex n → EC n →ᵇ ℂ) + (hsmall : perturbationBound (stdOrthonormalBasis ℝ (EC n)) a * ellipticBound H hH < 1) + (g : 𝓢(EC n, ℂ)) (f : L2 (EC n)) : L2 (EC n) := + cutoffError (extendedCoefficient H a) g + (parameterLocalZero H hH m hm (stdOrthonormalBasis ℝ (EC n)) a hsmall f) + (fun k => parameterLocalFirst H hH m hm (stdOrthonormalBasis ℝ (EC n)) a hsmall + (stdOrthonormalBasis ℝ (EC n) k) f) + +lemma parameterCutoffError_distribution (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (m : ℝ) (hm : 1 ≤ m) + (a : BasisIndex n → BasisIndex n → EC n →ᵇ ℂ) + (ha : ∀ k l, (a k l : EC n → ℂ).HasTemperateGrowth) + (hsmall : perturbationBound (stdOrthonormalBasis ℝ (EC n)) a * ellipticBound H hH < 1) + (g : 𝓢(EC n, ℂ)) (f : L2 (EC n)) : + let u := realize 2 (parameterLocal H hH m hm (stdOrthonormalBasis ℝ (EC n)) a hsmall f) + (parameterCutoffError H hH m hm a hsmall g f : 𝓢'(EC n, ℂ)) = + chartDifferential (extendedCoefficient H a) (smulLeftCLM ℂ g u) - + smulLeftCLM ℂ g (chartDifferential (extendedCoefficient H a) u) := by + have hDu : ∀ k, + (parameterLocalFirst H hH m hm (stdOrthonormalBasis ℝ (EC n)) a hsmall + (stdOrthonormalBasis ℝ (EC n) k) f : 𝓢'(EC n, ℂ)) = + ∂_{stdOrthonormalBasis ℝ (EC n) k} + (parameterLocalZero H hH m hm (stdOrthonormalBasis ℝ (EC n)) a hsmall f : 𝓢'(EC n, ℂ)) := by + intro k + rw [parameterLocalFirst_distribution, parameterLocalZero_distribution] + simpa only [parameterCutoffError, parameterLocalZero_distribution] using + cutoffError_distribution (extendedCoefficient H a) (extendedCoefficient_temperate H a ha) + g _ _ hDu + + +def cutoffErrorConstant (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (a : BasisIndex n → BasisIndex n → EC n →ᵇ ℂ) (g : 𝓢(EC n, ℂ)) : ℝ := + (∑ k, ∑ l, ‖extendedCoefficient H a k l‖ * + (‖(∂_{stdOrthonormalBasis ℝ (EC n) k} g).toBoundedContinuousFunction‖ * + (2 * Real.pi * ‖stdOrthonormalBasis ℝ (EC n) l‖ * ellipticBound H hH) + + ‖(∂_{stdOrthonormalBasis ℝ (EC n) l} g).toBoundedContinuousFunction‖ * + (2 * Real.pi * ‖stdOrthonormalBasis ℝ (EC n) k‖ * ellipticBound H hH) + + ‖(∂_{stdOrthonormalBasis ℝ (EC n) k} + (∂_{stdOrthonormalBasis ℝ (EC n) l} g)).toBoundedContinuousFunction‖)) / + (1 - perturbationBound (stdOrthonormalBasis ℝ (EC n)) a * ellipticBound H hH) + +lemma parameterCutoffError_bound (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (m : ℝ) (hm : 1 ≤ m) + (a : BasisIndex n → BasisIndex n → EC n →ᵇ ℂ) + (hsmall : perturbationBound (stdOrthonormalBasis ℝ (EC n)) a * ellipticBound H hH < 1) + (g : 𝓢(EC n, ℂ)) (f : L2 (EC n)) : + ‖parameterCutoffError H hH m hm a hsmall g f‖ ≤ + (cutoffErrorConstant H hH a g / m) * ‖f‖ := by + classical + have hm0 : 0 < m := lt_of_lt_of_le zero_lt_one hm + have hden : 0 < 1 - perturbationBound (stdOrthonormalBasis ℝ (EC n)) a * ellipticBound H hH := + sub_pos.mpr hsmall + have hz : ‖parameterLocalZero H hH m hm (stdOrthonormalBasis ℝ (EC n)) a hsmall f‖ ≤ + (1 / (m * (1 - perturbationBound (stdOrthonormalBasis ℝ (EC n)) a * ellipticBound H hH))) * ‖f‖ := by + apply (parameterLocalZero_bound H hH m hm _ a hsmall f).trans + apply mul_le_mul_of_nonneg_right _ (norm_nonneg _) + have hi : (m^2)⁻¹ ≤ m⁻¹ := inv_anti₀ hm0 (by nlinarith) + calc + _ ≤ m⁻¹ / (1 - perturbationBound (stdOrthonormalBasis ℝ (EC n)) a * ellipticBound H hH) := + div_le_div_of_nonneg_right hi hden.le + _ = _ := by simp only [div_eq_mul_inv, mul_inv_rev, one_mul]; ring + apply (cutoffError_bound (extendedCoefficient H a) g _ _).trans + unfold cutoffErrorConstant + simp only [Finset.sum_div, Finset.sum_mul] + apply Finset.sum_le_sum + intro k _ + apply Finset.sum_le_sum + intro l _ + calc + _ ≤ ‖extendedCoefficient H a k l‖ * + (‖(∂_{stdOrthonormalBasis ℝ (EC n) k} g).toBoundedContinuousFunction‖ * + (((2 * Real.pi * ‖stdOrthonormalBasis ℝ (EC n) l‖ * ellipticBound H hH) / + (m * (1 - perturbationBound (stdOrthonormalBasis ℝ (EC n)) a * ellipticBound H hH))) * ‖f‖) + + ‖(∂_{stdOrthonormalBasis ℝ (EC n) l} g).toBoundedContinuousFunction‖ * + (((2 * Real.pi * ‖stdOrthonormalBasis ℝ (EC n) k‖ * ellipticBound H hH) / + (m * (1 - perturbationBound (stdOrthonormalBasis ℝ (EC n)) a * ellipticBound H hH))) * ‖f‖) + + ‖(∂_{stdOrthonormalBasis ℝ (EC n) k} + (∂_{stdOrthonormalBasis ℝ (EC n) l} g)).toBoundedContinuousFunction‖ * + ((1 / (m * (1 - perturbationBound (stdOrthonormalBasis ℝ (EC n)) a * ellipticBound H hH))) * ‖f‖)) := by + apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) + apply add_le_add + · apply add_le_add + · exact mul_le_mul_of_nonneg_left (parameterLocalFirst_bound H hH m hm _ a hsmall _ f) + (norm_nonneg _) + · exact mul_le_mul_of_nonneg_left (parameterLocalFirst_bound H hH m hm _ a hsmall _ f) + (norm_nonneg _) + · exact mul_le_mul_of_nonneg_left hz (norm_nonneg _) + _ = _ := by simp only [div_eq_mul_inv, mul_inv_rev]; ring + +end MetricLocalization + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/PatchCutoffs.lean b/lean/OAI/Geometry/PrescribedPotential/PatchCutoffs.lean new file mode 100644 index 0000000000000000000000000000000000000000..1a9a1138678fca0c4a0e9821811ba15d1226674b --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/PatchCutoffs.lean @@ -0,0 +1,115 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.ChartTransport +import OAI.Geometry.PrescribedPotential.GlobalPartition + +namespace OAI + +/-! Patch Cutoffs. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory Manifold IsManifold +open scoped ContDiff SchwartzMap Classical + +namespace GlobalElliptic +open Anticanonical EllipticKernel SobolevChart SourceSmooth +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] + + + +theorem exists_chartCutoff {K U : Set E} (hK : IsCompact K) (hU : IsOpen U) (hKU : K ⊆ U) : + ∃ κ : ChartCutoff U, ∀ x ∈ K, κ x = 1 := by + obtain ⟨L, hLc, hLl, hKL, hLU⟩ := exists_compact_closed_between hK hU hKU + obtain ⟨f, hf, hf0, _⟩ := exists_contMDiffMap_one_nhds_of_subset_interior + (𝓘(ℝ, E)) hK.isClosed hKL (n := ⊤) + have hsm : ContDiff ℝ ∞ (fun x => (f x : ℂ)) := + Complex.ofRealCLM.contDiff.comp (contMDiff_iff_contDiff.mp f.contMDiff) + have hsub : tsupport (fun x => (f x : ℂ)) ⊆ L := by + apply closure_minimal _ hLl + intro x hx + by_contra hn + exact hx (by simp [hf0 x hn]) + have hc : HasCompactSupport (fun x => (f x : ℂ)) := + hLc.of_isClosed_subset (isClosed_tsupport _) hsub + refine ⟨⟨hc.toSchwartzMap hsm, hc, hsub.trans hLU⟩, ?_⟩ + intro x hx + change (f x : ℂ) = 1 + rw [hf.self_of_nhdsSet x hx] + rfl + +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} + + + +structure GluingData (g : KaehlerMetric A) (ι : Type*) [Fintype ι] where + patch : ι → ParametrixPatch g + localizers : Localizers A ι + index_eq : ∀ p, localizers.index p = (patch p).index + support_patch : ∀ p, tsupport (localizers.weight p : X → ℂ) ⊆ (patch p).source + cutoff : ∀ p, ChartCutoff (A.euclideanChart (patch p).index).target + cutoff_support : ∀ p, tsupport (cutoff p : EC d → ℂ) ⊆ (patch p).domain + cutoff_one : ∀ p x, x ∈ tsupport (localizers.weight p : X → ℂ) → + cutoff p (A.euclideanChart (patch p).index x) = 1 + + + +theorem exists_gluingData (g : KaehlerMetric A) : + ∃ (S : Finset (ParametrixPatch g)), Nonempty (GluingData g S) := by + obtain ⟨S, D, hDI, hDS⟩ := exists_patch_localizers g + have hc (p : S) : ∃ κ : ChartCutoff p.val.domain, + ∀ x ∈ tsupport (D.weight p : X → ℂ), κ (A.euclideanChart p.val.index x) = 1 := by + let e := A.euclideanChart p.val.index + have hK : IsCompact (e '' tsupport (D.weight p : X → ℂ)) := + (isClosed_tsupport _).isCompact.image_of_continuousOn + (e.continuousOn.mono (fun x hx => (hDS p hx).1)) + have hKU : e '' tsupport (D.weight p : X → ℂ) ⊆ p.val.domain := by + rintro y ⟨x, hx, rfl⟩ + exact (hDS p hx).2 + obtain ⟨κ, hκ⟩ := exists_chartCutoff hK p.val.isOpen_domain hKU + exact ⟨κ, fun x hx => hκ _ ⟨x, hx, rfl⟩⟩ + choose κ hκ using hc + refine ⟨S, ⟨{ + patch := Subtype.val + localizers := D + index_eq := hDI + support_patch := hDS + cutoff := fun p => ⟨(κ p).val, (κ p).compact, (κ p).support_sub.trans p.val.domain_sub⟩ + cutoff_support := fun p => (κ p).support_sub + cutoff_one := hκ }⟩⟩ + +namespace GluingData +variable {ι : Type*} [Fintype ι] {g : KaehlerMetric A} (D : GluingData g ι) + +omit [T2Space X] [CompactSpace X] +lemma exists_outerCutoff (p : ι) : + ∃ η : ChartCutoff (A.euclideanChart (D.patch p).index).target, + tsupport (η : EC d → ℂ) ⊆ (D.patch p).domain ∧ + ∀ y ∈ tsupport (D.cutoff p : EC d → ℂ), η y = 1 := by + obtain ⟨η, hη⟩ := exists_chartCutoff (D.cutoff p).compact + (D.patch p).isOpen_domain (D.cutoff_support p) + exact ⟨⟨η.val, η.compact, η.support_sub.trans (D.patch p).domain_sub⟩, η.support_sub, hη⟩ + + + +def outerCutoff (p : ι) : ChartCutoff (A.euclideanChart (D.patch p).index).target := + (D.exists_outerCutoff p).choose + +lemma outerCutoff_support (p : ι) : + tsupport (D.outerCutoff p : EC d → ℂ) ⊆ (D.patch p).domain := + (D.exists_outerCutoff p).choose_spec.1 + +lemma outerCutoff_one (p : ι) (y : EC d) (hy : y ∈ tsupport (D.cutoff p : EC d → ℂ)) : + D.outerCutoff p y = 1 := (D.exists_outerCutoff p).choose_spec.2 y hy +end GluingData + +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/PatchDifferential.lean b/lean/OAI/Geometry/PrescribedPotential/PatchDifferential.lean new file mode 100644 index 0000000000000000000000000000000000000000..a2d654a6d93ed45e0f5be1e9c8646eb9a98640c1 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/PatchDifferential.lean @@ -0,0 +1,200 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.ComplexOperator +import OAI.Geometry.PrescribedPotential.CoreBounds +import OAI.Geometry.PrescribedPotential.GlobalParametrix +import OAI.Geometry.PrescribedPotential.ParameterSchwartz +import OAI.Geometry.PrescribedPotential.ParametrixCommutator + +namespace OAI + +/-! Patch Differential. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory TemperedDistribution LineDeriv +open scoped SchwartzMap ContDiff Classical ComplexOrder MatrixOrder BoundedContinuousFunction + +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +lemma schwartz_temperate_product_distribution {a : E → ℂ} + (ha : a.HasTemperateGrowth) (f : 𝓢(E, ℂ)) : + SchwartzMap.toTemperedDistributionCLM E ℂ volume (SchwartzMap.smulLeftCLM ℂ a f) = + smulLeftCLM ℂ a (f : 𝓢'(E, ℂ)) := by + ext φ + simp only [SchwartzMap.toTemperedDistributionCLM_apply_apply, + smulLeftCLM_apply_apply, SchwartzMap.smulLeftCLM_apply_apply ha, smul_eq_mul] + apply integral_congr_ae + filter_upwards [] with x + ring + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma schwartz_second_deriv (f : 𝓢(E, ℂ)) (v w x : E) : + (∂_{v} (∂_{w} f)) x = fderiv ℝ (fderiv ℝ f) x v w := by + simp only [SchwartzMap.lineDerivOp_apply_eq_fderiv] + change fderiv ℝ (fun y => fderiv ℝ f y w) x v = _ + exact PotentialKaehler.fderiv_eval_derivative + f.smooth'.contDiffAt v w +end SobolevChart + +namespace MetricLocalization +open EllipticKernel FrozenPoisson SobolevChart +variable {n : ℕ} + +def schwartzDifferential (c : BasisIndex n → BasisIndex n → EC n →ᵇ ℂ) : + 𝓢(EC n, ℂ) →L[ℂ] 𝓢(EC n, ℂ) := + ∑ k, ∑ l, SchwartzMap.smulLeftCLM ℂ (c k l) ∘L + lineDerivOpCLM ℂ 𝓢(EC n, ℂ) (stdOrthonormalBasis ℝ (EC n) k) ∘L + lineDerivOpCLM ℂ 𝓢(EC n, ℂ) (stdOrthonormalBasis ℝ (EC n) l) + +lemma schwartzDifferential_apply + (c : BasisIndex n → BasisIndex n → EC n →ᵇ ℂ) + (hc : ∀ k l, (c k l : EC n → ℂ).HasTemperateGrowth) + (f : 𝓢(EC n, ℂ)) (x : EC n) : + schwartzDifferential c f x = ∑ k, ∑ l, c k l x * + fderiv ℝ (fderiv ℝ f) x (stdOrthonormalBasis ℝ (EC n) k) + (stdOrthonormalBasis ℝ (EC n) l) := by + simp only [schwartzDifferential, _root_.sum_apply, + ContinuousLinearMap.comp_apply, lineDerivOpCLM_apply, + SchwartzMap.smulLeftCLM_apply_apply (hc _ _), smul_eq_mul, schwartz_second_deriv] + +lemma schwartzDifferential_distribution + (c : BasisIndex n → BasisIndex n → EC n →ᵇ ℂ) + (hc : ∀ k l, (c k l : EC n → ℂ).HasTemperateGrowth) (f : 𝓢(EC n, ℂ)) : + SchwartzMap.toTemperedDistributionCLM (EC n) ℂ volume (schwartzDifferential c f) = + chartDifferential c (SchwartzMap.toTemperedDistributionCLM (EC n) ℂ volume f) := by + simp only [schwartzDifferential, chartDifferential, map_sum, + _root_.sum_apply, ContinuousLinearMap.comp_apply, lineDerivOpCLM_apply] + apply Finset.sum_congr rfl + intro k _ + apply Finset.sum_congr rfl + intro l _ + rw [schwartz_temperate_product_distribution (hc k l), + ← lineDerivOp_toTemperedDistributionCLM_eq, ← lineDerivOp_toTemperedDistributionCLM_eq] + +lemma schwartzDifferential_tsupport + (c : BasisIndex n → BasisIndex n → EC n →ᵇ ℂ) (f : 𝓢(EC n, ℂ)) : + tsupport (schwartzDifferential c f : EC n → ℂ) ⊆ tsupport f := by + apply closure_minimal _ (isClosed_tsupport _) + intro x hx + by_contra hn + apply hx + simp only [schwartzDifferential, _root_.sum_apply, + ContinuousLinearMap.comp_apply, lineDerivOpCLM_apply] + apply Finset.sum_eq_zero + intro k _ + apply Finset.sum_eq_zero + intro l _ + apply image_eq_zero_of_notMem_tsupport + intro hl + exact hn (SchwartzMap.tsupport_lineDerivOp_subset _ _ + (SchwartzMap.tsupport_lineDerivOp_subset _ _ + (SchwartzMap.tsupport_smulLeftCLM_subset _ _ hl).1)) + + +def schwartzCutoffError (c : BasisIndex n → BasisIndex n → EC n →ᵇ ℂ) + (κ : 𝓢(EC n, ℂ)) : 𝓢(EC n, ℂ) →L[ℂ] 𝓢(EC n, ℂ) := + (schwartzDifferential c).comp (SchwartzMap.smulLeftCLM ℂ κ) - + (SchwartzMap.smulLeftCLM ℂ κ).comp (schwartzDifferential c) + +lemma schwartzCutoffError_distribution + (c : BasisIndex n → BasisIndex n → EC n →ᵇ ℂ) + (hc : ∀ k l, (c k l : EC n → ℂ).HasTemperateGrowth) + (κ f : 𝓢(EC n, ℂ)) : + SchwartzMap.toTemperedDistributionCLM (EC n) ℂ volume (schwartzCutoffError c κ f) = + chartDifferential c (smulLeftCLM ℂ κ (SchwartzMap.toTemperedDistributionCLM (EC n) ℂ volume f)) - + smulLeftCLM ℂ κ (chartDifferential c (SchwartzMap.toTemperedDistributionCLM (EC n) ℂ volume f)) := by + simp only [schwartzCutoffError, _root_.sub_apply, ContinuousLinearMap.comp_apply, + map_sub, schwartzDifferential_distribution c hc, + schwartz_temperate_product_distribution κ.hasTemperateGrowth] + +lemma schwartzCutoffError_tsupport + (c : BasisIndex n → BasisIndex n → EC n →ᵇ ℂ) (κ f : 𝓢(EC n, ℂ)) : + tsupport (schwartzCutoffError c κ f : EC n → ℂ) ⊆ tsupport κ := by + change tsupport (fun x => schwartzDifferential c (SchwartzMap.smulLeftCLM ℂ κ f) x - + SchwartzMap.smulLeftCLM ℂ κ (schwartzDifferential c f) x) ⊆ _ + apply (tsupport_binop_subset (fun a b : ℂ => a - b) (sub_self 0) _ _).trans + apply union_subset + · exact (schwartzDifferential_tsupport c _).trans + ((SchwartzMap.tsupport_smulLeftCLM_subset _ _).trans inter_subset_right) + · exact (SchwartzMap.tsupport_smulLeftCLM_subset _ _).trans inter_subset_right + +end MetricLocalization + +namespace Anticanonical.SourceSmooth.ParametrixPatch +open EllipticKernel SobolevChart FrozenPoisson ParameterRegularity MetricLocalization +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + {g : KaehlerMetric A} + +abbrev coefficients (p : ParametrixPatch g) := extendedCoefficient p.matrix (coefficientBCF p.coefficient) + +lemma coefficients_temperate (p : ParametrixPatch g) (k l : BasisIndex d) : + (p.coefficients k l : EC d → ℂ).HasTemperateGrowth := + extendedCoefficient_temperate p.matrix _ (fun k l => (p.coefficient k l).hasTemperateGrowth) k l + +def differential (p : ParametrixPatch g) := schwartzDifferential p.coefficients + +def cutoffError (p : ParametrixPatch g) (κ : 𝓢(EC d, ℂ)) := + schwartzCutoffError p.coefficients κ + +lemma differential_local (p : ParametrixPatch g) (f : 𝓢(EC d, ℂ)) + {y : EC d} (hy : y ∈ p.domain) : + p.differential f y = GlobalElliptic.localL g p.index f y := by + rw [differential, schwartzDifferential_apply _ p.coefficients_temperate] + unfold GlobalElliptic.localL + apply Finset.sum_congr rfl + intro k _ + apply Finset.sum_congr rfl + intro l _ + rw [p.equals y hy k l] + +lemma localInverse_distribution (p : ParametrixPatch g) (m : ℝ) (hm : 1 ≤ m) + (f : 𝓢(EC d, ℂ)) : + SchwartzMap.toTemperedDistributionCLM (EC d) ℂ volume (p.localInverse m hm f) = + realize 2 (parameterLocal p.matrix p.positive m hm (stdOrthonormalBasis ℝ (EC d)) + (coefficientBCF p.coefficient) p.small (schwartzCoord 0 f)) := + schwartzLocalValue_distribution p.matrix p.positive m hm (stdOrthonormalBasis ℝ (EC d)) + p.coefficient p.small f + +lemma localInverse_equation (p : ParametrixPatch g) (m : ℝ) (hm : 1 ≤ m) + (f : 𝓢(EC d, ℂ)) : + (m^2 : ℂ) • p.localInverse m hm f - p.differential (p.localInverse m hm f) = f := by + apply schwartz_distribution_injective + simp only [map_sub, map_smul, differential, schwartzDifferential_distribution _ p.coefficients_temperate, + localInverse_distribution] + rw [chartDifferential_extension p.matrix _ (fun k l => (p.coefficient k l).hasTemperateGrowth)] + rw [sub_add_eq_sub_sub, parameterLocal_equation] + have h := realize_schwartzCoord (0 : ℝ) f + simpa only [realize, neg_zero, besselPotential_zero, ContinuousLinearMap.comp_apply, + ContinuousLinearMap.id_apply, Lp.toTemperedDistributionCLM_apply] using h + +lemma cutoffError_coord (p : ParametrixPatch g) (m : ℝ) (hm : 1 ≤ m) + (κ f : 𝓢(EC d, ℂ)) : + schwartzCoord 0 (p.cutoffError κ (p.localInverse m hm f)) = + parameterCutoffError p.matrix p.positive m hm (coefficientBCF p.coefficient) p.small κ + (schwartzCoord 0 f) := by + apply l2_injective + simp only [Lp.toTemperedDistributionCLM_apply] + rw [schwartzCoord_distribution, besselPotential_zero, ContinuousLinearMap.id_apply] + rw [cutoffError, schwartzCutoffError_distribution _ p.coefficients_temperate, + localInverse_distribution, parameterCutoffError_distribution _ _ _ _ _ + (fun k l => (p.coefficient k l).hasTemperateGrowth)] + +lemma cutoffError_bound (p : ParametrixPatch g) (m : ℝ) (hm : 1 ≤ m) + (κ f : 𝓢(EC d, ℂ)) : + ‖schwartzCoord 0 (p.cutoffError κ (p.localInverse m hm f))‖ ≤ + cutoffErrorConstant p.matrix p.positive (coefficientBCF p.coefficient) κ / m * + ‖schwartzCoord 0 f‖ := by + rw [cutoffError_coord] + exact parameterCutoffError_bound p.matrix p.positive m hm _ p.small κ _ + +end Anticanonical.SourceSmooth.ParametrixPatch + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/PathCalabiBound.lean b/lean/OAI/Geometry/PrescribedPotential/PathCalabiBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..1ff139ff5f75560b48de0270186f8276e9185e4d --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/PathCalabiBound.lean @@ -0,0 +1,99 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CalabiLocalUniform +import OAI.Geometry.PrescribedPotential.PathCalabiRicci +import OAI.Geometry.PrescribedPotential.PathEllipticity + +namespace OAI + +/-! Path Calabi Bound. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix Metric +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth +open KaehlerCalculus EllipticKernel +local instance pathCalabiRealIP (d : ℕ) : InnerProductSpace ℝ (EC d) := + InnerProductSpace.rclikeToReal ℂ (EC d) +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [CompactSpace X] [ConnectedSpace X] + {A : ComplexAtlas d X} +namespace CoordinateBall +variable (p : CoordinateBall A) + +theorem path_calabi_bound (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ (t b : ℝ) (φ : SmoothRealFunction A), t ∈ Icc 0 1 → + ∀ hs : SolvesVolumePath g h t φ b, ∀ x ∈ p.source, + ((g.deform φ hs.choose).localField p.index).calabiNorm (A.chart p.index x) ≤ C := by + obtain ⟨R,K,hR,hK,hell⟩ := volumePath_relative_ellipticity g h + let ψ : ContDiffBump p.center := + { rIn := p.radius, rOut := 2*p.radius, rIn_pos := p.radius_pos, + rIn_lt_rOut := by linarith [p.radius_pos] } + let L : Set (V d) := coordinateEquiv d '' closedBall p.center (3*p.radius) + let χ : V d → ℝ := fun z => ψ ((coordinateEquiv d).symm z) + have hL : IsCompact L := (isCompact_closedBall _ _).image (coordinateEquiv d).continuous + have hLc (z : V d) : z ∈ L ↔ (coordinateEquiv d).symm z ∈ closedBall p.center (3*p.radius) := by + constructor + · rintro ⟨y,hy,rfl⟩ + simpa only [ContinuousLinearEquiv.symm_apply_apply] using hy + · intro hz + exact ⟨_,hz,(coordinateEquiv d).apply_symm_apply z⟩ + have hdom : L ⊆ (A.chart p.index).target := by + intro z hz + have hh := p.closure_sub (closedBall_subset_closedBall (by linarith [p.radius_pos]) ((hLc z).mp hz)) + simpa only [ComplexAtlas.euclideanChart_target,mem_preimage,ContinuousLinearEquiv.apply_symm_apply] using hh + have hχ : ContDiff ℝ ∞ χ := ψ.contDiff.comp (coordinateEquiv d).symm.contDiff + have hχint (z : V d) (hz : z ∈ L) (hn : χ z ≠ 0) : z ∈ interior L := by + have hs : (coordinateEquiv d).symm z ∈ ball p.center (2*p.radius) := by + rw [← ψ.support_eq] + exact hn + have hs' : (coordinateEquiv d).symm z ∈ ball p.center (3*p.radius) := + ball_subset_ball (by linarith [p.radius_pos]) hs + apply mem_interior_iff_mem_nhds.mpr + apply mem_of_superset (((isOpen_ball.preimage (coordinateEquiv d).symm.continuous).mem_nhds hs')) + intro y hy + exact (hLc y).mpr (ball_subset_closedBall hy) + have hHG := (g.smooth p.index).continuousOn.mono hdom + have hH : ContinuousOn (fun q : ℝ × V d => pathLogDetHessian g h p.index q.1 q.2) (Icc 0 1 ×ˢ L) := + (pathLogDetHessian_continuous g h p.index).mono (prod_mono (subset_univ _) hdom) + have hJ : ContinuousOn (fun q : ℝ × V d => pathRicciJet g h p.index q.1 q.2) (Icc 0 1 ×ˢ L) := + (pathRicciJet_continuous g h p.index).mono (prod_mono (subset_univ _) hdom) + obtain ⟨C,hC,hbound⟩ := calabi_interior_uniform isCompact_Icc hL (g.matrix p.index) hHG + (fun z hz => g.positive _ _ (hdom hz)) + (fun q : ℝ × V d => pathLogDetHessian g h p.index q.1 q.2) + (fun q : ℝ × V d => pathRicciJet g h p.index q.1 q.2) hH hJ χ hχ + (fun _ _ => ψ.nonneg) (fun _ _ => ψ.le_one) hχint hR.le hK.le + refine ⟨C,hC,?_⟩ + intro t b φ ht hs x hx + have hxV : A.chart p.index x ∈ L := by + apply (hLc _).mpr + exact closedBall_subset_closedBall (by linarith [p.radius_pos]) (ball_subset_closedBall hx.2) + apply hbound ((g.deform φ hs.choose).localField p.index) t ht hdom + (fun z hz => hell t b φ ht hs p.index z (hdom hz)) + (fun z hz => volumePath_logdet_hessian g h hs hs.choose p.index (hdom hz)) + (fun z hz => volumePath_ricciJet g h hs hs.choose p.index (hdom hz)) _ hxV + exact ψ.one_of_mem_closedBall (ball_subset_closedBall hx.2) +end CoordinateBall + + + +theorem volumePath_calabi_finite_cover (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) : + ∃ (S : Finset (CoordinateBall A)) (C : ℝ), 0 ≤ C ∧ + (∀ x, ∃ p ∈ S, x ∈ p.source) ∧ + ∀ p ∈ S, ∀ (t b : ℝ) (φ : SmoothRealFunction A), t ∈ Icc 0 1 → + ∀ hs : SolvesVolumePath g h t φ b, ∀ x ∈ p.source, + ((g.deform φ hs.choose).localField p.index).calabiNorm (A.chart p.index x) ≤ C := by + classical + obtain ⟨S,hS⟩ := CoordinateBall.finite_cover (A := A) + choose C hC hb using fun p : CoordinateBall A => p.path_calabi_bound g h + refine ⟨S,∑ p ∈ S, C p,Finset.sum_nonneg (fun p _ => hC p),hS,?_⟩ + intro p hp t b φ ht hs x hx + exact (hb p t b φ ht hs x hx).trans (Finset.single_le_sum (fun q _ => hC q) hp) +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/PathCalabiRicci.lean b/lean/OAI/Geometry/PrescribedPotential/PathCalabiRicci.lean new file mode 100644 index 0000000000000000000000000000000000000000..22bcc376082d303c0500444a0e5bab595ab6c100 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/PathCalabiRicci.lean @@ -0,0 +1,86 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CalabiConnection +import OAI.Geometry.PrescribedPotential.CalabiCovariant +import OAI.Geometry.PrescribedPotential.CalabiTensorAlgebra +import OAI.Geometry.PrescribedPotential.MatrixTensorCalculus +import OAI.Geometry.PrescribedPotential.PathRicci + +namespace OAI + +/-! Path Calabi Ricci. -/ + +section + +noncomputable section +open Set Filter Topology Matrix Metric +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth +open KaehlerCalculus EllipticKernel +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +namespace KaehlerMetric + +def localField (g : KaehlerMetric A) (i : Fin A.count) : LocalKaehlerField d where + domain := (A.chart i).target + isOpen := (A.chart i).open_target + matrix := g.matrix i + smooth := g.smooth i + positive := g.positive i + closed := g.closed i + +end KaehlerMetric + +def pathRicciJet (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) + (i : Fin A.count) (t : ℝ) (z : Coordinates d) : ConnectionTensor d := fun k => + ((1-t:ℝ):ℂ) • mderiv (-Complex.I) (e k) + (PotentialKaehler.potentialMatrix (fun y => Real.log (g.matrix i y).det.re)) z - + (t:ℂ) • mderiv (-Complex.I) (e k) (PotentialKaehler.potentialMatrix (h.weight i)) z + +lemma pathLogDetHessian_jet (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) + (i : Fin A.count) (t : ℝ) {z : Coordinates d} (hz : z ∈ (A.chart i).target) : + (fun k => mderiv (-Complex.I) (e k) (pathLogDetHessian g h i t) z) = pathRicciJet g h i t z := by + have hf := (g.localField i).ricciHessian_smooth.contDiffAt ((A.chart i).open_target.mem_nhds hz) + change ContDiffAt ℝ ∞ (PotentialKaehler.potentialMatrix (fun y => Real.log (g.matrix i y).det.re)) z at hf + have hh := PotentialKaehler.potentialMatrix_smooth ((h.smooth i).contDiffAt ((A.chart i).open_target.mem_nhds hz)) + funext k + unfold pathLogDetHessian pathRicciJet + rw [mderiv_sub (matrix_smooth_smul (contDiffAt_const (c := ((1-t:ℝ):ℂ))) hf) (matrix_smooth_smul (contDiffAt_const (c := (t:ℂ))) hh), + mderiv_smul contDiffAt_const hf,mderiv_smul contDiffAt_const hh] + simp only [wderiv_const,zero_smul,zero_add] + +lemma volumePath_ricciJet (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) + {t b : ℝ} {φ : SmoothRealFunction A} (hs : SolvesVolumePath g h t φ b) + (hp : g.PositivePotential φ) (i : Fin A.count) {z : Coordinates d} + (hz : z ∈ (A.chart i).target) : + (fun k => mderiv (-Complex.I) (e k) ((g.deform φ hp).localField i).ricciHessian z) = + pathRicciJet g h i t z := by + have he : ((g.deform φ hp).localField i).ricciHessian =ᶠ[𝓝 z] pathLogDetHessian g h i t := by + filter_upwards [(A.chart i).open_target.mem_nhds hz] with y hy + exact volumePath_logdet_hessian g h hs hp i hy + rw [← pathLogDetHessian_jet g h i t hz] + funext k + exact mderiv_congr he _ _ + +lemma pathRicciJet_continuous (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) + (i : Fin A.count) : ContinuousOn (fun q : ℝ × Coordinates d => pathRicciJet g h i q.1 q.2) + (univ ×ˢ (A.chart i).target) := by + apply continuousOn_pi.mpr + intro k + have hf : ContinuousOn (mderiv (-Complex.I) (e k) (g.localField i).ricciHessian) (A.chart i).target := by + intro z hz + exact (mderiv_smooth ((g.localField i).ricciHessian_smooth.contDiffAt + ((A.chart i).open_target.mem_nhds hz)) _ _).continuousAt.continuousWithinAt + have hh : ContinuousOn (mderiv (-Complex.I) (e k) (PotentialKaehler.potentialMatrix (h.weight i))) (A.chart i).target := by + intro z hz + exact (mderiv_smooth (PotentialKaehler.potentialMatrix_smooth ((h.smooth i).contDiffAt + ((A.chart i).open_target.mem_nhds hz))) _ _).continuousAt.continuousWithinAt + exact ((Complex.continuous_ofReal.comp (continuous_const.sub continuous_fst)).continuousOn.smul + (hf.comp continuous_snd.continuousOn (fun _ h => h.2))).sub + ((Complex.continuous_ofReal.comp continuous_fst).continuousOn.smul + (hh.comp continuous_snd.continuousOn (fun _ h => h.2))) +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/PathCoordinateC1.lean b/lean/OAI/Geometry/PrescribedPotential/PathCoordinateC1.lean new file mode 100644 index 0000000000000000000000000000000000000000..9e1a55311c5c6c994beafb25234870c21b60330b --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/PathCoordinateC1.lean @@ -0,0 +1,78 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CalabiCoordinateBound +import OAI.Geometry.PrescribedPotential.PathCalabiBound +import OAI.Geometry.PrescribedPotential.PathCalabiRicci +import OAI.Geometry.PrescribedPotential.PathEllipticity + +namespace OAI + +/-! Path Coordinate C1. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix Metric +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth +open KaehlerCalculus EllipticKernel +local instance pathC1RealIP (d : ℕ) : InnerProductSpace ℝ (EC d) := + InnerProductSpace.rclikeToReal ℂ (EC d) +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [CompactSpace X] [ConnectedSpace X] + {A : ComplexAtlas d X} +namespace CoordinateBall +variable (p : CoordinateBall A) + +theorem path_coordinate_C1_bound (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ (t b : ℝ) (φ : SmoothRealFunction A), t ∈ Icc 0 1 → + ∀ hs : SolvesVolumePath g h t φ b, ∀ x ∈ p.source, + ‖(g.deform φ hs.choose).matrix p.index (A.chart p.index x)‖ ≤ C ∧ + ‖fderiv ℝ (fun z i j => (g.deform φ hs.choose).matrix p.index z i j) + (A.chart p.index x)‖ ≤ C := by + obtain ⟨S,hS,hcal⟩ := p.path_calabi_bound g h + obtain ⟨R,H,hR,hH,hell⟩ := volumePath_relative_ellipticity g h + let L : Set (V d) := coordinateEquiv d '' closedBall p.center p.radius + have hL : IsCompact L := (isCompact_closedBall _ _).image (coordinateEquiv d).continuous + have hLc (z : V d) : z ∈ L ↔ (coordinateEquiv d).symm z ∈ closedBall p.center p.radius := by + constructor + · rintro ⟨y,hy,rfl⟩ + simpa only [ContinuousLinearEquiv.symm_apply_apply] using hy + · intro hz + exact ⟨_,hz,(coordinateEquiv d).apply_symm_apply z⟩ + have hdom : L ⊆ (A.chart p.index).target := by + intro z hz + have hh := p.closure_sub (closedBall_subset_closedBall (by linarith [p.radius_pos]) ((hLc z).mp hz)) + simpa only [ComplexAtlas.euclideanChart_target,mem_preimage,ContinuousLinearEquiv.apply_symm_apply] using hh + obtain ⟨C,hC,hbound⟩ := calabi_coordinate_C1_uniform hL (g.matrix p.index) + ((g.smooth p.index).continuousOn.mono hdom) (fun z hz => g.positive _ _ (hdom hz)) hR.le hH.le hS + refine ⟨C,hC,?_⟩ + intro t b φ ht hs x hx + have hz : A.chart p.index x ∈ L := (hLc _).mpr (ball_subset_closedBall hx.2) + obtain ⟨hl,hu⟩ := hell t b φ ht hs p.index _ (hdom hz) + exact hbound _ hz ((g.deform φ hs.choose).localField p.index) _ (hdom hz) hl hu + (hcal t b φ ht hs x hx) +end CoordinateBall + + +theorem volumePath_coordinate_C1_finite_cover (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) : + ∃ (S : Finset (CoordinateBall A)) (C : ℝ), 0 ≤ C ∧ + (∀ x, ∃ p ∈ S, x ∈ p.source) ∧ + ∀ p ∈ S, ∀ (t b : ℝ) (φ : SmoothRealFunction A), t ∈ Icc 0 1 → + ∀ hs : SolvesVolumePath g h t φ b, ∀ x ∈ p.source, + ‖(g.deform φ hs.choose).matrix p.index (A.chart p.index x)‖ ≤ C ∧ + ‖fderiv ℝ (fun z i j => (g.deform φ hs.choose).matrix p.index z i j) + (A.chart p.index x)‖ ≤ C := by + classical + obtain ⟨S,hS⟩ := CoordinateBall.finite_cover (A := A) + choose C hC hb using fun p : CoordinateBall A => p.path_coordinate_C1_bound g h + refine ⟨S,∑ p ∈ S, C p,Finset.sum_nonneg (fun p _ => hC p),hS,?_⟩ + intro p hp t b φ ht hs x hx + have hle := Finset.single_le_sum (fun q _ => hC q) hp + exact ⟨(hb p t b φ ht hs x hx).1.trans hle,(hb p t b φ ht hs x hx).2.trans hle⟩ +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/PathCoordinateDensity.lean b/lean/OAI/Geometry/PrescribedPotential/PathCoordinateDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..ca51bed2c8c634bb351b1f6dd52539f49ae7e586 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/PathCoordinateDensity.lean @@ -0,0 +1,90 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CoordinateBalls +import OAI.Geometry.PrescribedPotential.VolumeNormalization + +namespace OAI + +/-! Path Coordinate Density. -/ + +section + + + +noncomputable section +open Set Metric Filter Topology MeasureTheory Matrix +open scoped ContDiff ComplexOrder +namespace Anticanonical.SourceSmooth +open EllipticKernel +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +lemma volumePath_det_upper [CompactSpace X] [Nonempty X] + (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) + {t b : ℝ} {φ : SmoothRealFunction A} (ht : t ∈ Icc 0 1) + (hsol : SolvesVolumePath g h t φ b) (i : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart i).target) : + |(g.matrix i z + φ.hessian i z).det.re| ≤ + Real.exp (2*‖(⟨(prescribedForcing g h).value, + (prescribedForcing g h).continuous⟩ : C(X,ℝ))‖) * g.volumeCoefficient i z := by + let F : C(X,ℝ) := ⟨(prescribedForcing g h).value, (prescribedForcing g h).continuous⟩ + have hb := volumePath_scalar_bound g h ht hsol + obtain ⟨hp,he⟩ := hsol + have hd : 0 < (g.matrix i z + φ.hessian i z).det.re := (Complex.pos_iff.mp (hp i z hz).det_pos).1 + have hg := g.volumeCoefficient_pos i hz + let x := (A.chart i).symm z + have hez : Real.log ((g.matrix i z + φ.hessian i z).det.re) - Real.log (g.volumeCoefficient i z) = + t * F x + b := by + have hev := he x + change (g.logRatio (g.deform φ hp)).localExpression i z = _ at hev + rw [g.logRatio_local _ i hz] at hev + exact hev + have hFx : |t * F x| ≤ ‖F‖ := by + rw [abs_mul, abs_of_nonneg ht.1] + exact (mul_le_mul_of_nonneg_right ht.2 (abs_nonneg _)).trans + (by simpa only [Real.norm_eq_abs, one_mul] using F.norm_coe_le_norm x) + have hbound : t*F x+b ≤ 2*‖F‖ := by + have h1 := (abs_le.mp hFx).2 + have h2 := (abs_le.mp hb).2 + change b ≤ ‖F‖ at h2 + linarith + have heq : (g.matrix i z + φ.hessian i z).det.re = Real.exp (t*F x+b)*g.volumeCoefficient i z := by + calc + _ = Real.exp (Real.log ((g.matrix i z + φ.hessian i z).det.re)) := (Real.exp_log hd).symm + _ = Real.exp (t*F x+b+Real.log (g.volumeCoefficient i z)) := by congr 1; linarith + _ = _ := by rw [Real.exp_add, Real.exp_log hg] + rw [abs_of_pos hd, heq] + exact mul_le_mul_of_nonneg_right (Real.exp_le_exp.mpr hbound) hg.le + +namespace CoordinateBall +variable (p : CoordinateBall A) + +lemma path_det_bound [CompactSpace X] [Nonempty X] + (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) : + ∃ K : ℝ, 0 < K ∧ ∀ (t b : ℝ) (φ : SmoothRealFunction A), + t ∈ Icc 0 1 → SolvesVolumePath g h t φ b → + ∀ z ∈ closedBall p.center (3*p.radius), + |(g.matrix p.index (coordinateEquiv d z) + φ.hessian p.index (coordinateEquiv d z)).det.re| ≤ K := by + have hc : ContinuousOn (fun z : EC d => g.volumeCoefficient p.index (coordinateEquiv d z)) + (closedBall p.center (3*p.radius)) := by + exact ((g.volumeCoefficient_smooth p.index).continuousOn.comp + (coordinateEquiv d).continuous.continuousOn (fun z hz => by + have hh := p.closure_sub (closedBall_subset_closedBall (by linarith [p.radius_pos]) hz) + simpa only [ComplexAtlas.euclideanChart_target, mem_preimage] using hh)) + obtain ⟨B,hB⟩ := (isCompact_closedBall p.center (3*p.radius)).exists_bound_of_continuousOn hc + let M := ‖(⟨(prescribedForcing g h).value, (prescribedForcing g h).continuous⟩ : C(X,ℝ))‖ + refine ⟨Real.exp (2*M)*max B 1, mul_pos (Real.exp_pos _) (lt_max_iff.mpr (Or.inr (by norm_num))), ?_⟩ + intro t b φ ht hs z hz + have hzt : coordinateEquiv d z ∈ (A.chart p.index).target := by + have hh := p.closure_sub (closedBall_subset_closedBall (by linarith [p.radius_pos]) hz) + simpa only [ComplexAtlas.euclideanChart_target, mem_preimage] using hh + apply (volumePath_det_upper g h ht hs p.index hzt).trans + apply mul_le_mul_of_nonneg_left _ (Real.exp_pos _).le + have hbc : |g.volumeCoefficient p.index (coordinateEquiv d z)| ≤ B := by + simpa only [Real.norm_eq_abs] using hB z hz + exact (le_abs_self _).trans (hbc.trans (le_max_left _ _)) +end CoordinateBall +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/PathEllipticity.lean b/lean/OAI/Geometry/PrescribedPotential/PathEllipticity.lean new file mode 100644 index 0000000000000000000000000000000000000000..85d0f1fbd368aee856af3a6f2b41c9380ad4fefd --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/PathEllipticity.lean @@ -0,0 +1,54 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.PathTraceBound +import OAI.Geometry.PrescribedPotential.TraceEllipticity +import OAI.Geometry.PrescribedPotential.VolumeDeterminantBounds + +namespace OAI + +/-! Path Ellipticity. -/ + +section + + + +noncomputable section +open Set Matrix +open scoped ComplexOrder MatrixOrder +namespace Anticanonical.SourceSmooth +open KaehlerCalculus +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} + + + +theorem volumePath_relative_ellipticity (g : KaehlerMetric A) + (h : SemipositiveAnticanonicalMetric A) : + ∃ R K : ℝ, 0 < R ∧ 0 < K ∧ ∀ (t b : ℝ) (φ : SmoothRealFunction A), + t ∈ Icc 0 1 → ∀ _hs : SolvesVolumePath g h t φ b, + ∀ i : Fin A.count, ∀ z ∈ (A.chart i).target, + (((R:ℂ) • (g.matrix i z+φ.hessian i z))-g.matrix i z).PosSemidef ∧ + (((K:ℂ) • g.matrix i z)-(g.matrix i z+φ.hessian i z)).PosSemidef := by + obtain ⟨R,hR,hRb⟩ := volumePath_inverseTrace_bound g h + let R' := R+1 + let F : C(X,ℝ) := ⟨(prescribedForcing g h).value, (prescribedForcing g h).continuous⟩ + let K := Real.exp (2*‖F‖)*R'^(d-1) + have hRp : 0 < R' := by dsimp [R']; linarith + have hKp : 0 < K := mul_pos (Real.exp_pos _) (pow_pos hRp _) + refine ⟨R',K,hRp,hKp,?_⟩ + intro t b φ ht hs i z hz + let M := g.deform φ hs.choose + have hp : (g.matrix i z+φ.hessian i z).PosDef := hs.choose i z hz + have htr : ((g.matrix i z+φ.hessian i z)⁻¹*g.matrix i z).trace.re ≤ R' := by + have hh := hRb t b φ ht hs ((A.chart i).symm z) + change (M.inverseTrace g).localExpression i z ≤ R at hh + rw [M.inverseTrace_local g i hz] at hh + exact hh.trans (by dsimp [R']; linarith) + refine ⟨inverse_trace_lower_psd hp (g.positive i z hz) htr,?_⟩ + exact inverse_trace_relative_upper hp (g.positive i z hz) hRp.le htr + (volumePath_det_ratio_bounds g h ht hs.choose hs.choose_spec i hz).2 +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/PathFrameBounds.lean b/lean/OAI/Geometry/PrescribedPotential/PathFrameBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..3d6f301c6f5c934ac4c54a66872d838a2e96c73c --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/PathFrameBounds.lean @@ -0,0 +1,68 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CoordinateBalls +import OAI.Geometry.PrescribedPotential.FrameCompactBounds +import OAI.Geometry.PrescribedPotential.MatrixJetDirection +import OAI.Geometry.PrescribedPotential.PathRicci + +namespace OAI + +/-! Path Frame Bounds. -/ + +section + + + +noncomputable section +open Set Metric Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth +open KaehlerCalculus EllipticKernel +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +namespace CoordinateBall +variable (p : CoordinateBall A) + +lemma path_frame_bound (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ t ∈ Icc (0:ℝ) 1, ∀ x ∈ p.source, + ∀ B : Matrix (Fin d) (Fin d) ℂ, + -C*(frameGram (g.matrix p.index (A.chart p.index x)) B)^2 ≤ + frameResidual (pathLogDetHessian g h p.index t (A.chart p.index x)) + (g.matrix p.index (A.chart p.index x)) + (curvatureDiagonal (g.matrix p.index) (A.chart p.index x)) B := by + let K : Set (ℝ × EC d) := Icc 0 1 ×ˢ closedBall p.center p.radius + have hk (q : ℝ × EC d) (hq : q ∈ K) : coordinateEquiv d q.2 ∈ (A.chart p.index).target := by + have he := p.closure_sub (closedBall_subset_closedBall (by linarith [p.radius_pos]) hq.2) + simpa only [ComplexAtlas.euclideanChart_target,mem_preimage] using he + have hmap : Continuous (fun q : ℝ × EC d => (q.1,coordinateEquiv d q.2)) := + continuous_fst.prodMk ((coordinateEquiv d).continuous.comp continuous_snd) + have ha : ContinuousOn (fun q : ℝ × EC d => pathLogDetHessian g h p.index q.1 (coordinateEquiv d q.2)) K := + (pathLogDetHessian_continuous g h p.index).comp (f := fun q : ℝ × EC d => (q.1,coordinateEquiv d q.2)) hmap.continuousOn (fun q hq => ⟨mem_univ _,hk q hq⟩) + have hg : ContinuousOn (fun q : ℝ × EC d => g.matrix p.index (coordinateEquiv d q.2)) K := + (g.smooth p.index).continuousOn.comp (f := fun q : ℝ × EC d => coordinateEquiv d q.2) + ((coordinateEquiv d).continuous.comp continuous_snd).continuousOn hk + have hr := curvatureDiagonal_joint_continuous (A.chart p.index).open_target (g.smooth p.index) + (fun z hz => ne_of_gt (g.positive p.index z hz).det_pos) + have hR : ContinuousOn (fun q : (ℝ × EC d) × V d => + curvatureDiagonal (g.matrix p.index) (coordinateEquiv d q.1.2) q.2) (K ×ˢ univ) := by + apply hr.comp (f := fun q : (ℝ × EC d) × V d => (coordinateEquiv d q.1.2,q.2)) + · exact (((coordinateEquiv d).continuous.comp (continuous_snd.comp continuous_fst)).prodMk + continuous_snd).continuousOn + · intro q hq + exact ⟨hk q.1 hq.1,mem_univ _⟩ + obtain ⟨C,hC,hb⟩ := compact_frame_bound (isCompact_Icc.prod (isCompact_closedBall _ _)) + (fun q : ℝ × EC d => pathLogDetHessian g h p.index q.1 (coordinateEquiv d q.2)) + (fun q : ℝ × EC d => g.matrix p.index (coordinateEquiv d q.2)) + (fun q : ℝ × EC d => curvatureDiagonal (g.matrix p.index) (coordinateEquiv d q.2)) + ha hg (fun q hq => g.positive _ _ (hk q hq)) hR + (fun q hq r v => curvatureDiagonal_smul ((g.smooth p.index).contDiffAt + ((A.chart p.index).open_target.mem_nhds (hk q hq))) r v) + refine ⟨C,hC,?_⟩ + intro t ht x hx B + have hh := hb (t,A.euclideanChart p.index x) ⟨ht,ball_subset_closedBall hx.2⟩ B + simpa only [ComplexAtlas.euclideanChart_apply,ContinuousLinearEquiv.apply_symm_apply] using hh +end CoordinateBall +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/PathLaplaceJets.lean b/lean/OAI/Geometry/PrescribedPotential/PathLaplaceJets.lean new file mode 100644 index 0000000000000000000000000000000000000000..5181eb8c058429c90eb0249051540bf45b3dfcba --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/PathLaplaceJets.lean @@ -0,0 +1,108 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.PathMetricBootstrap +import OAI.Geometry.PrescribedPotential.UniformCompositionFamily + +namespace OAI + +/-! Path Laplace Jets. -/ + +section + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth +open KaehlerCalculus EllipticKernel MetricSystem HigherJet GlobalElliptic +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [CompactSpace X] [ConnectedSpace X] + {A : ComplexAtlas d X} +local instance pathLapECIP : InnerProductSpace ℝ (EC d) := InnerProductSpace.rclikeToReal ℂ (EC d) +local instance pathLapHMIP : InnerProductSpace ℝ (HM d) := InnerProductSpace.rclikeToReal ℂ (HM d) + +lemma path_metric_all_jets (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) + (i : Fin A.count) {K : Set (EC d)} (hK : IsCompact K) + (hKU : K ⊆ (A.euclideanChart i).target) (m : ℕ) : + ∃ C : ℝ, ∀ (s : PathSolution g h) x, x ∈ K → + ‖iteratedFDeriv ℝ m (fun y => encode d (s.metric.matrix i (coordinateEquiv d y))) x‖ ≤ C := by + by_cases hm : 1 ≤ m + · obtain ⟨C,hC,hb⟩ := path_metric_higher_bounds g h i m hm K hK hKU + exact ⟨C,hb⟩ + · have hm0 : m=0 := by omega + subst m + obtain ⟨C,hC,hb⟩ := path_metric_compact_C1 g h i hK hKU + refine ⟨‖encodeCLM d‖*C,fun s x hx => ?_⟩ + rw [norm_iteratedFDeriv_zero] + exact ((encodeCLM d).le_opNorm _).trans (mul_le_mul_of_nonneg_left (hb s x hx).1 (norm_nonneg _)) + +def laplaceMetricCoefficient (g : KaehlerMetric A) (i : Fin A.count) + (p : EC d × HM d) : ℂ := + (((g.matrix i (coordinateEquiv d p.1))⁻¹ * ((encode d).symm p.2-g.matrix i (coordinateEquiv d p.1))).trace.re : ℂ) + +omit [CompactSpace X] [ConnectedSpace X] in +lemma laplaceMetricCoefficient_smooth (g : KaehlerMetric A) (i : Fin A.count) + {x : EC d} (hx : x ∈ (A.euclideanChart i).target) (u : HM d) : + ContDiffAt ℝ ∞ (laplaceMetricCoefficient g i) (x,u) := by + have hx' : coordinateEquiv d x ∈ (A.chart i).target := by + simpa only [ComplexAtlas.euclideanChart_target,Set.mem_preimage] using hx + have hG : ContDiffAt ℝ ∞ (fun p : EC d × HM d => g.matrix i (coordinateEquiv d p.1)) (x,u) := + ((g.smooth i).contDiffAt ((A.chart i).open_target.mem_nhds hx')).comp (x,u) + ((coordinateEquiv d).contDiff.contDiffAt.comp (x,u) contDiffAt_fst) + have hI := (MatrixSmoothGeneral.inverse (g.smooth i) + (fun z hz => ne_of_gt (g.positive i z hz).det_pos)).contDiffAt ((A.chart i).open_target.mem_nhds hx') + have hInv := hI.comp (x,u) ((coordinateEquiv d).contDiff.contDiffAt.comp (x,u) contDiffAt_fst) + have hM : ContDiffAt ℝ ∞ (fun p : EC d × HM d => (encode d).symm p.2) (x,u) := + (encode d).symm.contDiff.contDiffAt.comp (x,u) contDiffAt_snd + change ContDiffAt ℝ ∞ (fun p : EC d × HM d => + (((∑ k, ∑ l, (g.matrix i (coordinateEquiv d p.1))⁻¹ k l * + ((encode d).symm p.2-g.matrix i (coordinateEquiv d p.1)) l k).re) : ℂ)) (x,u) + apply Complex.ofRealCLM.contDiff.contDiffAt.comp (x,u) + apply Complex.reCLM.contDiff.contDiffAt.comp (x,u) + apply ContDiffAt.sum + intro k _ + apply ContDiffAt.sum + intro l _ + exact (contDiffAt_pi.mp (contDiffAt_pi.mp hInv k) l).mul + (contDiffAt_pi.mp (contDiffAt_pi.mp (hM.sub hG) l) k) + +omit [CompactSpace X] [ConnectedSpace X] in +lemma path_laplacian_local (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) + (s : PathSolution g h) (i : Fin A.count) {x : EC d} (hx : x ∈ (A.euclideanChart i).target) : + Smooth.ofReal (g.laplacian s.potential) ((A.euclideanChart i).symm x) = + laplaceMetricCoefficient g i (x,encode d (s.metric.matrix i (coordinateEquiv d x))) := by + have hx' : coordinateEquiv d x ∈ (A.chart i).target := by + simpa only [ComplexAtlas.euclideanChart_target,Set.mem_preimage] using hx + change ((g.laplacian s.potential).localExpression i (coordinateEquiv d x) : ℂ) = _ + rw [g.laplacian_localExpression s.potential i hx'] + simp only [laplaceMetricCoefficient,ContinuousLinearEquiv.symm_apply_apply,PathSolution.metric,KaehlerMetric.deform, + add_sub_cancel_left,KaehlerMetric.linearizedMongeAmpere] + +lemma path_laplacian_weighted_jets (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) + (i : Fin A.count) (ρ : Smooth A) {K : Set (EC d)} (hK : IsCompact K) + (hKU : K ⊆ (A.euclideanChart i).target) (m : ℕ) : + ∃ C : ℝ, ∀ (s : PathSolution g h) x, x ∈ K → + ‖iteratedFDeriv ℝ m (fun y => ρ ((A.euclideanChart i).symm y)* + Smooth.ofReal (g.laplacian s.potential) ((A.euclideanChart i).symm y)) x‖ ≤ C := by + let u : PathSolution g h → EC d → HM d := fun s x => encode d (s.metric.matrix i (coordinateEquiv d x)) + let a : EC d × HM d → ℂ := fun p => ρ ((A.euclideanChart i).symm p.1)*laplaceMetricCoefficient g i p + have hu (s : PathSolution g h) (x : EC d) (hx : x ∈ K) : ContDiffAt ℝ ∞ (u s) x := by + have hx' : coordinateEquiv d x ∈ (A.chart i).target := by + simpa only [ComplexAtlas.euclideanChart_target,Set.mem_preimage] using hKU hx + exact (encode d).contDiff.contDiffAt.comp x + (((s.metric.smooth i).contDiffAt ((A.chart i).open_target.mem_nhds hx')).comp x (coordinateEquiv d).contDiff.contDiffAt) + have ha (x : EC d) (hx : x ∈ K) (v : HM d) : ContDiffAt ℝ ∞ a (x,v) := by + have hw : ContDiffAt ℝ ∞ (fun y => ρ ((A.euclideanChart i).symm y)) x := + (ρ.smooth i).contDiffAt ((A.euclideanChart i).open_target.mem_nhds (hKU hx)) + exact (hw.comp (x,v) contDiffAt_fst).mul (laplaceMetricCoefficient_smooth g i (hKU hx) v) + obtain ⟨C,hC⟩ := parametric_composition_family_jets u hK hu (path_metric_all_jets g h i hK hKU) a ha m + refine ⟨C,fun s x hx => ?_⟩ + have he : (fun y => ρ ((A.euclideanChart i).symm y)*Smooth.ofReal (g.laplacian s.potential) ((A.euclideanChart i).symm y)) + =ᶠ[𝓝 x] (fun y => a (y,u s y)) := by + filter_upwards [(A.euclideanChart i).open_target.mem_nhds (hKU hx)] with y hy + exact congrArg (ρ ((A.euclideanChart i).symm y)*·) (path_laplacian_local g h s i hy) + rw [(he.iteratedFDeriv (𝕜 := ℝ) m).eq_of_nhds] + exact hC s x hx +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/PathLaplacianSobolev.lean b/lean/OAI/Geometry/PrescribedPotential/PathLaplacianSobolev.lean new file mode 100644 index 0000000000000000000000000000000000000000..dde988db7ff56435694d4bb46f9ed165b6d10ed3 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/PathLaplacianSobolev.lean @@ -0,0 +1,63 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.PathLaplaceJets +import OAI.Geometry.PrescribedPotential.SchwartzFamilyBounds + +namespace OAI + +/-! Path Laplacian Sobolev. -/ + +section + +noncomputable section +open Set Filter Topology +open scoped ContDiff SchwartzMap +namespace Anticanonical.SourceSmooth +open EllipticKernel GlobalElliptic SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} + +lemma path_laplacian_localized_bound (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) + (i : Fin A.count) (ρ : Smooth A) + (hρ : tsupport (ρ : X → ℂ) ⊆ (A.euclideanChart i).source) (r : ℝ) : + ∃ C : ℝ, ∀ s : PathSolution g h, + ‖schwartzCoord r (localize A i ρ hρ (Smooth.ofReal (g.laplacian s.potential)))‖ ≤ C := by + let K := (A.euclideanChart i) '' tsupport (ρ : X → ℂ) + have hK : IsCompact K := (isClosed_tsupport (ρ : X → ℂ)).isCompact.image_of_continuousOn + ((A.euclideanChart i).continuousOn.mono hρ) + have hKU : K ⊆ (A.euclideanChart i).target := by + rintro _ ⟨x,hx,rfl⟩ + exact (A.euclideanChart i).mapsTo (hρ hx) + apply schwartzCoord_family_bound (fun s : PathSolution g h => + localize A i ρ hρ (Smooth.ofReal (g.laplacian s.potential))) hK + · intro s + exact closure_minimal (localizeFun_support A i ρ _) hK.isClosed + · intro m + obtain ⟨C,hC⟩ := path_laplacian_weighted_jets g h i ρ hK hKU m + refine ⟨C,fun s x hx => ?_⟩ + have he : (localize A i ρ hρ (Smooth.ofReal (g.laplacian s.potential)) : EC d → ℂ) + =ᶠ[𝓝 x] (fun y => ρ ((A.euclideanChart i).symm y)* + Smooth.ofReal (g.laplacian s.potential) ((A.euclideanChart i).symm y)) := by + filter_upwards [(A.euclideanChart i).open_target.mem_nhds (hKU hx)] with y hy + exact localizeFun_apply A ρ _ hy + rw [(he.iteratedFDeriv (𝕜 := ℝ) m).eq_of_nhds] + exact hC s x hx + +lemma path_laplacian_sobolev_bound (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) + {ι : Type*} [Fintype ι] (D : Localizers A ι) (r : ℝ) : + ∃ C : ℝ, ∀ s : PathSolution g h, + ‖D.embed r (Smooth.ofReal (g.laplacian s.potential))‖ ≤ C := by + choose C hC using fun i => path_laplacian_localized_bound g h (D.index i) (D.weight i) (D.support_sub i) r + let B := ∑ i, max 0 (C i) + have hB : 0 ≤ B := Finset.sum_nonneg fun _ _ => le_max_left _ _ + refine ⟨B,fun s => ?_⟩ + change ‖D.coordinates r (Smooth.ofReal (g.laplacian s.potential))‖ ≤ B + apply (pi_norm_le_iff_of_nonneg hB).mpr + intro i + exact (hC i s).trans ((le_max_right 0 (C i)).trans + (Finset.single_le_sum (fun j _ => le_max_left 0 (C j)) (Finset.mem_univ i))) +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/PathMetricBootstrap.lean b/lean/OAI/Geometry/PrescribedPotential/PathMetricBootstrap.lean new file mode 100644 index 0000000000000000000000000000000000000000..da2fc79419e1d6dc07500d5a7dfbadaaabec759c --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/PathMetricBootstrap.lean @@ -0,0 +1,96 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.AffineFamilyJets +import OAI.Geometry.PrescribedPotential.MetricFamilyBootstrap +import OAI.Geometry.PrescribedPotential.PathMetricCompactC1 + +namespace OAI + +/-! Path Metric Bootstrap. -/ + +section + +noncomputable section +open Set Filter Topology Matrix Metric Finset +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace MetricSystem +open KaehlerCalculus EllipticKernel +variable {n : ℕ} +local instance pathMetricECIP : InnerProductSpace ℝ (EC n) := InnerProductSpace.rclikeToReal ℂ (EC n) +local instance pathMetricHMIP : InnerProductSpace ℝ (HM n) := InnerProductSpace.rclikeToReal ℂ (HM n) +def encodeCLM (n : ℕ) : (Fin n → Fin n → ℂ) →L[ℝ] HM n := (encode n).toContinuousLinearMap +lemma encoded_fderiv_bound {M : V n → Fin n → Fin n → ℂ} {x : EC n} + (hM : ContDiffAt ℝ ∞ M (coordinateEquiv n x)) : + ‖fderiv ℝ (fun y => encode n (M (coordinateEquiv n y))) x‖ ≤ + ‖encodeCLM n‖*‖fderiv ℝ M (coordinateEquiv n x)‖*‖(coordinateEquiv n).toContinuousLinearMap‖ := by + have hd := (encode n).hasFDerivAt.comp x ((hM.differentiableAt (by simp)).hasFDerivAt.comp x (coordinateEquiv n).hasFDerivAt) + have hn := congrArg norm hd.fderiv + calc + _ = _ := hn + _ ≤ _ := ((encodeCLM n).opNorm_comp_le _).trans + (by nlinarith [ContinuousLinearMap.opNorm_comp_le (fderiv ℝ M (coordinateEquiv n x)) (coordinateEquiv n).toContinuousLinearMap, + norm_nonneg (encodeCLM n)]) +end MetricSystem +namespace Anticanonical.SourceSmooth +open KaehlerCalculus EllipticKernel MetricSystem HigherJet +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [CompactSpace X] [ConnectedSpace X] + {A : ComplexAtlas d X} +local instance pathBootstrapECIP : InnerProductSpace ℝ (EC d) := InnerProductSpace.rclikeToReal ℂ (EC d) +local instance pathBootstrapHMIP : InnerProductSpace ℝ (HM d) := InnerProductSpace.rclikeToReal ℂ (HM d) + +lemma path_metric_higher_bounds (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) + (i : Fin A.count) : + ∀ m, 1 ≤ m → ∀ K : Set (EC d), IsCompact K → K ⊆ (A.euclideanChart i).target → + ∃ C : ℝ, 0 ≤ C ∧ ∀ (s : PathSolution g h) x, x ∈ K → + ‖iteratedFDeriv ℝ m (fun y => encode d (s.metric.matrix i (coordinateEquiv d y))) x‖ ≤ C := by + let U := (A.euclideanChart i).target + have hU : IsOpen U := (A.euclideanChart i).open_target + have hc (x : EC d) : x ∈ U → coordinateEquiv d x ∈ (A.chart i).target := by + intro hx + simpa only [U,ComplexAtlas.euclideanChart_target,Set.mem_preimage] using hx + let f : EC d → HM d := fun x => encode d ((g.localField i).ricciHessian (coordinateEquiv d x)) + let q : EC d → HM d := fun x => encode d (PotentialKaehler.potentialMatrix (h.weight i) (coordinateEquiv d x)) + have hf : ContDiffOn ℝ ∞ f U := by + intro x hx + exact ((encode d).contDiff.contDiffAt.comp x (((g.localField i).ricciHessian_smooth.contDiffAt + ((A.chart i).open_target.mem_nhds (hc x hx))).comp x (coordinateEquiv d).contDiff.contDiffAt)).contDiffWithinAt + have hq : ContDiffOn ℝ ∞ q U := by + intro x hx + exact ((encode d).contDiff.contDiffAt.comp x ((PotentialKaehler.potentialMatrix_smooth + ((h.smooth i).contDiffAt ((A.chart i).open_target.mem_nhds (hc x hx)))).comp x + (coordinateEquiv d).contDiff.contDiffAt)).contDiffWithinAt + let r : PathSolution g h → EC d → HM d := fun s x => (1-s.t) • f x-s.t • q x + apply metric_family_bootstrap hU (fun s : PathSolution g h => s.metric.localField i) r + (fun _ x hx => hc x hx) (fun s => (hf.const_smul (1-s.t)).sub (hq.const_smul s.t)) + · intro s x hx + have he := volumePath_logdet_hessian g h s.solves s.solves.choose i (hc x hx) + change encode d (PotentialKaehler.potentialMatrix (fun y => Real.log (s.metric.matrix i y).det.re) (coordinateEquiv d x)) = _ + have hh := congrArg (encode d) he + calc + _ = encode d (pathLogDetHessian g h i s.t (coordinateEquiv d x)) := hh + _ = _ := ?_ + change encode d ((1-s.t) • (g.localField i).ricciHessian (coordinateEquiv d x)-s.t • PotentialKaehler.potentialMatrix (h.weight i) (coordinateEquiv d x)) = _ + rw [map_sub,map_smul,map_smul] + · intro K hK hKU + obtain ⟨C,hC,hbound⟩ := path_metric_compact_C1 g h i hK hKU + refine ⟨‖encodeCLM d‖*C*‖(coordinateEquiv d).toContinuousLinearMap‖,fun s x hx => ?_⟩ + apply (encoded_fderiv_bound ((s.metric.smooth i).contDiffAt ((A.chart i).open_target.mem_nhds (hc x (hKU hx))))).trans + exact mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left (hbound s x hx).2 (norm_nonneg _)) (norm_nonneg _) + · intro K hK hKU + obtain ⟨R,H,hR,hH,hell⟩ := volumePath_relative_ellipticity g h + let L := coordinateEquiv d '' K + have hL : IsCompact L := hK.image (coordinateEquiv d).continuous + have hLU : L ⊆ (A.chart i).target := by rintro _ ⟨x,hx,rfl⟩; exact hc x (hKU hx) + obtain ⟨B,hB,hbound⟩ := compact_normalizing_frames hL (g.matrix i) + ((g.smooth i).continuousOn.mono hLU) (fun z hz => g.positive i z (hLU hz)) hR.le hH.le + refine ⟨B,hB,fun s x hx C D hCD hDC hN => ?_⟩ + obtain ⟨hl,hu⟩ := hell s.t s.b s.potential s.time s.solves i _ (hc x (hKU hx)) + exact hbound _ ⟨x,hx,rfl⟩ _ C D hl hu hCD hN + · intro m K hK hKU + obtain ⟨C,hbound⟩ := affine_family_jets hU hf hq m hK hKU + exact ⟨C,fun j hj s x hx => hbound j hj s.t s.time x hx⟩ +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/PathMetricCompactC1.lean b/lean/OAI/Geometry/PrescribedPotential/PathMetricCompactC1.lean new file mode 100644 index 0000000000000000000000000000000000000000..9ec8f02bc72a55a0d7dfa328c735a4351280b36f --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/PathMetricCompactC1.lean @@ -0,0 +1,68 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.PathCoordinateC1 + +namespace OAI + +/-! Path Metric Compact C1. -/ + +section + +noncomputable section +open Set Filter Topology Matrix Metric +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth +open KaehlerCalculus EllipticKernel +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [CompactSpace X] [ConnectedSpace X] + {A : ComplexAtlas d X} + +structure PathSolution (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) where + t : ℝ + b : ℝ + potential : SmoothRealFunction A + time : t ∈ Icc 0 1 + solves : SolvesVolumePath g h t potential b +namespace PathSolution +variable {g : KaehlerMetric A} {h : SemipositiveAnticanonicalMetric A} +def metric (s : PathSolution g h) : KaehlerMetric A := g.deform s.potential s.solves.choose +end PathSolution + +local instance compactC1RealIP : InnerProductSpace ℝ (EC d) := InnerProductSpace.rclikeToReal ℂ (EC d) + +lemma path_metric_compact_C1 (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) + (i : Fin A.count) {K : Set (EC d)} (hK : IsCompact K) + (hKU : K ⊆ (A.euclideanChart i).target) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ (s : PathSolution g h) x, x ∈ K → + ‖s.metric.matrix i (coordinateEquiv d x)‖ ≤ C ∧ + ‖fderiv ℝ (fun z k l => s.metric.matrix i z k l) (coordinateEquiv d x)‖ ≤ C := by + classical + have he (x : K) : ∃ p : CoordinateBall A, p.index = i ∧ x.val ∈ ball p.center p.radius := by + obtain ⟨r,hr,hs⟩ := Metric.nhds_basis_closedBall.mem_iff.mp ((A.euclideanChart i).open_target.mem_nhds (hKU x.property)) + refine ⟨⟨i,x.val,r/4,by positivity,?_⟩,rfl,mem_ball_self (by positivity)⟩ + convert hs using 1; ring_nf + choose p hp hx using he + obtain ⟨S,hS⟩ := hK.elim_finite_subcover (fun x : K => ball (p x).center (p x).radius) + (fun _ => isOpen_ball) (fun x hxK => mem_iUnion.mpr ⟨⟨x,hxK⟩,hx ⟨x,hxK⟩⟩) + choose C hC hbound using fun x : K => (p x).path_coordinate_C1_bound g h + refine ⟨∑ x ∈ S, C x,Finset.sum_nonneg (fun x _ => hC x),?_⟩ + intro s x hxK + obtain ⟨q,hq,hxq⟩ := mem_iUnion₂.mp (hS hxK) + have ht : x ∈ (A.euclideanChart (p q).index).target := (p q).ball_sub hxq + let y := (A.euclideanChart (p q).index).symm x + have hy : y ∈ (p q).source := ⟨(A.euclideanChart _).symm.mapsTo ht,by + change A.euclideanChart _ ((A.euclideanChart _).symm x) ∈ ball _ _ + rw [(A.euclideanChart _).right_inv ht] + exact hxq⟩ + have hz : A.chart (p q).index y = coordinateEquiv d x := by + have hc := (A.euclideanChart (p q).index).right_inv ht + change (coordinateEquiv d).symm (A.chart (p q).index y) = x at hc + exact (coordinateEquiv d).symm.injective (hc.trans ((coordinateEquiv d).symm_apply_apply x).symm) + have hb := hbound q s.t s.b s.potential s.time s.solves y hy + rw [hz,hp q] at hb + have hc := Finset.single_le_sum (fun x _ => hC x) hq + exact ⟨hb.1.trans hc,hb.2.trans hc⟩ +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/PathPotentialBound.lean b/lean/OAI/Geometry/PrescribedPotential/PathPotentialBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..b6b6bbaf201909130f80b96883575834bd17f7c0 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/PathPotentialBound.lean @@ -0,0 +1,88 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CoordinateInnerCover +import OAI.Geometry.PrescribedPotential.CoordinateMinimumBound +import OAI.Geometry.PrescribedPotential.NormalizedPotentialL1 +import OAI.Geometry.PrescribedPotential.PathCoordinateDensity +import OAI.Geometry.PrescribedPotential.VolumePath + +namespace OAI + +/-! Path Potential Bound. -/ + +section + + + +noncomputable section +open Set Metric Filter Topology MeasureTheory +open scoped ContDiff +namespace Anticanonical.SourceSmooth +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} + +theorem volumePath_oscillation_bound + (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ (t b : ℝ) (φ : SmoothRealFunction A), + t ∈ Icc 0 1 → SolvesVolumePath g h t φ b → + ∀ x y, |φ.value x-φ.value y| ≤ C := by + classical + let : MeasurableSpace X := borel X + let : BorelSpace X := ⟨rfl⟩ + obtain ⟨S,hS⟩ := CoordinateBall.finite_inner_cover (A := A) + obtain ⟨B,hB⟩ := normalized_potential_L1 g S + (by intro x; obtain ⟨p,hp,hx⟩ := hS x; exact ⟨p,hp,p.half_source_sub hx⟩) + choose K hK hKb using (fun p : S => p.val.path_det_bound g h) + choose C hC using (fun p : S => p.val.minimum_bound g B (hK p)) + let R : ℝ := ∑ p : S, max (C p) 0 + have hR : 0 ≤ R := Finset.sum_nonneg (fun _ _ => le_max_right _ _) + refine ⟨R,hR,?_⟩ + intro t b φ ht hs x y + obtain ⟨xm,_,hmin⟩ := isCompact_univ.exists_isMinOn univ_nonempty φ.continuous.continuousOn + obtain ⟨xM,_,hmax⟩ := isCompact_univ.exists_isMaxOn univ_nonempty φ.continuous.continuousOn + let ψ := φ.normalizeAt xM + have hψ : g.PositivePotential ψ := by + intro i z hz + simpa only [ψ, SmoothRealFunction.hessian_normalizeAt] using hs.choose i z hz + have hψ0 : ∀ z, ψ.value z ≤ 0 := by + intro z + change φ.value z-φ.value xM ≤ 0 + exact sub_nonpos.mpr (hmax (mem_univ z)) + have hψz : ∃ z, ψ.value z = 0 := ⟨xM,φ.normalizeAt_value xM⟩ + obtain ⟨p,hp,hxm⟩ := hS xm + have hlocal := hC ⟨p,hp⟩ ψ hψ0 (hB ψ hψ hψ0 hψz p hp) + (by + intro z hz + simpa only [ψ, SmoothRealFunction.hessian_normalizeAt] using + hKb ⟨p,hp⟩ t b φ ht hs z hz) + xm hxm (by + intro z + change φ.value xm-φ.value xM ≤ φ.value z-φ.value xM + exact sub_le_sub_right (hmin (mem_univ z)) _) + have hCR : C ⟨p,hp⟩ ≤ R := (le_max_left _ _).trans + (Finset.single_le_sum (fun q _ => le_max_right (C q) 0) (Finset.mem_univ (⟨p,hp⟩ : S))) + have hosc : φ.value xM-φ.value xm ≤ R := by + change -(φ.value xm-φ.value xM) ≤ C ⟨p,hp⟩ at hlocal + linarith + have hxM : φ.value x ≤ φ.value xM := hmax (mem_univ x) + have hyM : φ.value y ≤ φ.value xM := hmax (mem_univ y) + have hmx : φ.value xm ≤ φ.value x := hmin (mem_univ x) + have hmy : φ.value xm ≤ φ.value y := hmin (mem_univ y) + exact abs_le.mpr ⟨by linarith only [hosc,hyM,hmx], by linarith only [hosc,hxM,hmy]⟩ + + + +theorem volumePath_potential_bound + (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) (x₀ : X) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ (t b : ℝ) (φ : SmoothRealFunction A), + t ∈ Icc 0 1 → φ.value x₀ = 0 → SolvesVolumePath g h t φ b → + ∀ x, |φ.value x| ≤ C := by + obtain ⟨C,hC,hb⟩ := volumePath_oscillation_bound g h + refine ⟨C,hC,?_⟩ + intro t b φ ht hn hs x + simpa only [hn,sub_zero] using hb t b φ ht hs x x₀ +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/PathRicci.lean b/lean/OAI/Geometry/PrescribedPotential/PathRicci.lean new file mode 100644 index 0000000000000000000000000000000000000000..de2dfcde64103c839a1037149c9b91e93338a3b4 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/PathRicci.lean @@ -0,0 +1,98 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.PotentialLinearCalculus +import OAI.Geometry.PrescribedPotential.ScalarFrameCalculus +import OAI.Geometry.PrescribedPotential.VolumePath + +namespace OAI + +/-! Path Ricci. -/ + +section + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth +open KaehlerCalculus +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +def pathLogDetHessian (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) + (i : Fin A.count) (t : ℝ) (z : Coordinates d) : Matrix (Fin d) (Fin d) ℂ := + ((1-t:ℝ):ℂ) • PotentialKaehler.potentialMatrix (fun y => Real.log (g.matrix i y).det.re) z - + (t:ℂ) • PotentialKaehler.potentialMatrix (h.weight i) z + +lemma volumePath_logdet_local (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) + {t b : ℝ} {φ : SmoothRealFunction A} (hs : SolvesVolumePath g h t φ b) + (hp : g.PositivePotential φ) (i : Fin A.count) {z : Coordinates d} + (hz : z ∈ (A.chart i).target) : + Real.log ((g.deform φ hp).matrix i z).det.re = + (1-t)*Real.log (g.matrix i z).det.re-t*h.weight i z+b := by + have he := hs.choose_spec ((A.chart i).symm z) + change (g.logRatio (g.deform φ hs.choose)).localExpression i z = + t*(prescribedForcing g h).localExpression i z+b at he + rw [KaehlerMetric.logRatio_local _ _ i hz,prescribedForcing_local _ _ i hz] at he + change Real.log ((g.deform φ hp).matrix i z).det.re - Real.log (g.matrix i z).det.re = + t*(-h.weight i z-Real.log (g.matrix i z).det.re)+b at he + linarith + +lemma potentialMatrix_mul_const {f : KaehlerCalculus.V d → ℝ} {z : KaehlerCalculus.V d} + (hf : ContDiffAt ℝ ∞ f z) (a : ℝ) : + PotentialKaehler.potentialMatrix (fun y => a*f y) z = + (a:ℂ) • PotentialKaehler.potentialMatrix f z := by + have hh := potentialMatrix_affine (f := fun _ => 0) contDiffAt_const hf a + have hz0 : PotentialKaehler.potentialMatrix (fun _ : KaehlerCalculus.V d => (0:ℝ)) z = 0 := by + unfold PotentialKaehler.potentialMatrix + ext i j + simp [PotentialKaehler.hermitianPartMatrix, PotentialKaehler.hermitianPartForm, PotentialKaehler.hermitianPart] + rfl + simpa only [zero_add,hz0] using hh + +lemma potentialMatrix_add_const (c : ℝ) (f : KaehlerCalculus.V d → ℝ) (z : KaehlerCalculus.V d) : + PotentialKaehler.potentialMatrix (fun y => f y+c) z = PotentialKaehler.potentialMatrix f z := by + simpa only [add_comm] using potentialMatrix_const_add c f z + +lemma volumePath_logdet_hessian (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) + {t b : ℝ} {φ : SmoothRealFunction A} (hs : SolvesVolumePath g h t φ b) + (hp : g.PositivePotential φ) (i : Fin A.count) {z : Coordinates d} + (hz : z ∈ (A.chart i).target) : + PotentialKaehler.potentialMatrix (fun y => Real.log ((g.deform φ hp).matrix i y).det.re) z = + pathLogDetHessian g h i t z := by + have he : (fun y => Real.log ((g.deform φ hp).matrix i y).det.re) =ᶠ[𝓝 z] + (fun y => (1-t)*Real.log (g.matrix i y).det.re-t*h.weight i y+b) := by + filter_upwards [(A.chart i).open_target.mem_nhds hz] with y hy + exact volumePath_logdet_local g h hs hp i hy + have hf : ContDiffAt ℝ ∞ (fun y => Real.log (g.matrix i y).det.re) z := + ((g.volumeCoefficient_smooth i).log (fun y hy => ne_of_gt (g.volumeCoefficient_pos i hy))).contDiffAt + ((A.chart i).open_target.mem_nhds hz) + have hh := (h.smooth i).contDiffAt ((A.chart i).open_target.mem_nhds hz) + rw [PotentialKaehler.potentialMatrix_congr he,potentialMatrix_add_const, + potentialMatrix_sub_smul (contDiffAt_const.mul hf) hh,potentialMatrix_mul_const hf] + rfl + +lemma pathLogDetHessian_continuous (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) + (i : Fin A.count) : + ContinuousOn (fun q : ℝ × Coordinates d => pathLogDetHessian g h i q.1 q.2) + (univ ×ˢ (A.chart i).target) := by + have hf : ContinuousOn (PotentialKaehler.potentialMatrix (fun y => Real.log (g.matrix i y).det.re)) + (A.chart i).target := by + intro z hz + apply ContinuousAt.continuousWithinAt + apply ContDiffAt.continuousAt (𝕜 := ℝ) (n := ∞) + apply PotentialKaehler.potentialMatrix_smooth + exact ((g.volumeCoefficient_smooth i).log (fun y hy => ne_of_gt (g.volumeCoefficient_pos i hy))).contDiffAt + ((A.chart i).open_target.mem_nhds hz) + have hh : ContinuousOn (PotentialKaehler.potentialMatrix (h.weight i)) (A.chart i).target := by + intro z hz + exact (PotentialKaehler.potentialMatrix_smooth ((h.smooth i).contDiffAt + ((A.chart i).open_target.mem_nhds hz))).continuousAt.continuousWithinAt + exact ((Complex.continuous_ofReal.comp (continuous_const.sub continuous_fst)).continuousOn.smul + (hf.comp continuous_snd.continuousOn (fun _ h => h.2))).sub + ((Complex.continuous_ofReal.comp continuous_fst).continuousOn.smul + (hh.comp continuous_snd.continuousOn (fun _ h => h.2))) +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/PathTraceBound.lean b/lean/OAI/Geometry/PrescribedPotential/PathTraceBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..1cda921d57d3235e5d6c5d3aa58f0689d6adc579 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/PathTraceBound.lean @@ -0,0 +1,102 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.ChernLuMaximum +import OAI.Geometry.PrescribedPotential.MetricInverseTrace +import OAI.Geometry.PrescribedPotential.PathFrameBounds +import OAI.Geometry.PrescribedPotential.PathPotentialBound +import OAI.Geometry.PrescribedPotential.PathRicci + +namespace OAI + +/-! Path Trace Bound. -/ + +section + + + +noncomputable section +open Set Metric Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth +open KaehlerCalculus +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [CompactSpace X] + [ConnectedSpace X] [Nonempty (Fin d)] {A : ComplexAtlas d X} + +theorem volumePath_inverseTrace_bound_pos_dim (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) : + ∃ R : ℝ, 0 ≤ R ∧ ∀ (t b : ℝ) (φ : SmoothRealFunction A), + t ∈ Icc 0 1 → ∀ hs : SolvesVolumePath g h t φ b, + ∀ x, ((g.deform φ hs.choose).inverseTrace g).value x ≤ R := by + classical + obtain ⟨S,hS⟩ := CoordinateBall.finite_cover (A := A) + choose C hC hCb using (fun p : S => p.val.path_frame_bound g h) + let K : ℝ := ∑ p : S, C p + have hK : 0 ≤ K := Finset.sum_nonneg (fun p _ => hC p) + have hCK (p : S) : C p ≤ K := Finset.single_le_sum (fun q _ => hC q) (Finset.mem_univ p) + obtain ⟨L,hL,hLb⟩ := volumePath_oscillation_bound g h + refine ⟨(K+1)*d*Real.exp ((K+1)*L),by positivity,?_⟩ + intro t b φ ht hs x + let M := g.deform φ hs.choose + let f := M.inverseTrace g + let Q : X → ℝ := fun y => Real.log (f.value y)-(K+1)*φ.value y + have hfp : ∀ y, 0 < f.value y := fun y => M.inverseTrace_positive g y + have hQc : Continuous Q := (f.continuous.log (fun y => ne_of_gt (hfp y))).sub + (continuous_const.mul φ.continuous) + obtain ⟨xm,_,hm⟩ := isCompact_univ.exists_isMaxOn univ_nonempty hQc.continuousOn + obtain ⟨p,hp,hxm⟩ := hS xm + have hxmi : xm ∈ (A.chart p.index).source := by + simpa only [ComplexAtlas.euclideanChart_source] using hxm.1 + let z := A.chart p.index xm + have hz : z ∈ (A.chart p.index).target := (A.chart p.index).mapsTo hxmi + have hb : ∀ B : Matrix (Fin d) (Fin d) ℂ, + -K*(frameGram (g.matrix p.index z) B)^2 ≤ frameResidual + (PotentialKaehler.potentialMatrix (fun y => Real.log (M.matrix p.index y).det.re) z) + (g.matrix p.index z) (curvatureDiagonal (g.matrix p.index) z) B := by + intro B + rw [volumePath_logdet_hessian g h hs hs.choose p.index hz] + have hh := hCb ⟨p,hp⟩ t ht xm hxm B + exact (mul_le_mul_of_nonneg_right (neg_le_neg (hCK ⟨p,hp⟩)) (sq_nonneg _)).trans hh + have hmax : IsLocalMax (fun y => Real.log (inverseTrace (M.matrix p.index) (g.matrix p.index) y)- + (K+1)*φ.localExpression p.index y) z := by + change ∀ᶠ y in 𝓝 z, _ ≤ _ + filter_upwards [(A.chart p.index).open_target.mem_nhds hz] with y hy + have hyS := M.inverseTrace_local g p.index hy + have hzS := M.inverseTrace_local g p.index hz + rw [← hyS,← hzS] + change Q ((A.chart p.index).symm y) ≤ Q ((A.chart p.index).symm z) + rw [show (A.chart p.index).symm z = xm from (A.chart p.index).left_inv hxmi] + exact hm (mem_univ _) + have hMmax : f.value xm ≤ (K+1)*d := by + change M.inverseTraceValue g xm ≤ _ + rw [M.inverseTraceValue_local g p.index hxmi] + exact inverseTrace_at_localMax_bound (A.chart p.index).open_target (M.smooth p.index) + (M.positive p.index) (M.closed p.index) (g.smooth p.index) (g.positive p.index) + (φ.smooth p.index) hz rfl K hb hmax + have hqm : Real.log (f.value x)-(K+1)*φ.value x ≤ + Real.log (f.value xm)-(K+1)*φ.value xm := hm (mem_univ x) + have hφ := (abs_le.mp (hLb t b φ ht hs x xm)).2 + have ha : 0 ≤ K+1 := by linarith + have hl : Real.log (f.value x) ≤ Real.log (f.value xm)+(K+1)*L := by + have hh := mul_le_mul_of_nonneg_left hφ ha + nlinarith only [hqm,hh] + have he := Real.exp_le_exp.mpr hl + rw [Real.exp_add,Real.exp_log (hfp x),Real.exp_log (hfp xm)] at he + exact he.trans (mul_le_mul_of_nonneg_right hMmax (Real.exp_pos _).le) +omit [Nonempty (Fin d)] in + +theorem volumePath_inverseTrace_bound (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) : + ∃ R : ℝ, 0 ≤ R ∧ ∀ (t b : ℝ) (φ : SmoothRealFunction A), + t ∈ Icc 0 1 → ∀ hs : SolvesVolumePath g h t φ b, + ∀ x, ((g.deform φ hs.choose).inverseTrace g).value x ≤ R := by + by_cases hd : d = 0 + · subst d + refine ⟨0,le_rfl,?_⟩ + intro t b φ ht hs x + simp [KaehlerMetric.inverseTrace,KaehlerMetric.inverseTraceValue,KaehlerCalculus.inverseTrace, + Matrix.trace] + · let : Nonempty (Fin d) := Fin.pos_iff_nonempty.mp (Nat.pos_of_ne_zero hd) + exact volumePath_inverseTrace_bound_pos_dim g h +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/PointPoisson.lean b/lean/OAI/Geometry/PrescribedPotential/PointPoisson.lean new file mode 100644 index 0000000000000000000000000000000000000000..df23d2545a3fa05453579581e359100630ae5cff --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/PointPoisson.lean @@ -0,0 +1,133 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalStrongEmbedding +import OAI.Geometry.PrescribedPotential.HigherMetricOperator +import OAI.Geometry.PrescribedPotential.HigherPoisson +import OAI.Geometry.PrescribedPotential.KaehlerClosedDerivatives +import OAI.Geometry.PrescribedPotential.PoissonEquivalence + +namespace OAI + +/-! Point Poisson. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +def pointEvaluation (s : ℝ) (x₀ : X) : D.localizers.Sobolev s →L[ℝ] ℂ := + (BoundedContinuousFunction.evalCLM ℝ x₀) ∘L D.localizers.strong s + +omit [ConnectedSpace X] in +lemma pointEvaluation_embed {s : ℝ} (hs : (Module.finrank ℝ (EC d) : ℝ) < 2*s) + (x₀ : X) (f : Smooth A) : D.pointEvaluation s x₀ (D.localizers.embed s f) = f x₀ := by + change D.localizers.strong s (D.localizers.embed s f) x₀ = _ + rw [D.localizers.strong_embed s hs] + rfl + +omit [ConnectedSpace X] in +lemma completedLOrder_constants (k : ℕ) (c : ℂ) : + D.completedLOrder k (D.localizers.constantsOrder ((k : ℝ)+2) c) = 0 := by + rw [Localizers.constantsOrder_apply, D.completedLOrder_embed, complexL_const, map_zero] + +omit [ConnectedSpace X] in +lemma constantsOrder_lower {s t : ℝ} (hst : t ≤ s) (a : ℂ) : + D.localizers.lower s t (D.localizers.constantsOrder s a) = + D.localizers.constantsOrder t a := by + change D.localizers.lower s t (D.localizers.embed s (Smooth.const a)) = + D.localizers.embed t (Smooth.const a) + exact D.localizers.lower_embed hst (Smooth.const a) + +omit [ConnectedSpace X] in +lemma completedLOrder_to_constant (k : ℕ) (u : D.localizers.Sobolev ((k : ℝ)+2)) (c : ℂ) + (hu : D.completedLOrder k u = D.localizers.constantsOrder (k : ℝ) c) : + D.completedL (D.localizers.lower ((k : ℝ)+2) 2 u) = D.localizers.constants c := by + have hh := congrArg (D.localizers.lower (k : ℝ) 0) hu + rw [D.completedLOrder_lower, D.constantsOrder_lower (Nat.cast_nonneg k)] at hh + exact hh + +lemma completedLOrder_constant_kernel (m : ℝ) (hm : 1 ≤ m) + (he : ‖D.completedError m hm‖ < 1) (k : ℕ) + (u : D.localizers.Sobolev ((k : ℝ)+2)) (c : ℂ) + (hu : D.completedLOrder k u = D.localizers.constantsOrder (k : ℝ) c) : + ∃ a : ℂ, u = D.localizers.constantsOrder ((k : ℝ)+2) a ∧ c = 0 := by + have hl : (2 : ℝ) ≤ (k : ℝ)+2 := by linarith [Nat.cast_nonneg (α := ℝ) k] + obtain ⟨a, ha, hc⟩ := D.completedL_constant_kernel m hm he + (D.localizers.lower ((k : ℝ)+2) 2 u) c (D.completedLOrder_to_constant k u c hu) + refine ⟨a, ?_, hc⟩ + apply D.localizers.lower_injective hl + exact ha.trans (D.constantsOrder_lower hl a).symm + +def rawPoissonOrder (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) (k : ℕ) := (D.poissonRaw_order m hm he P k).choose + +lemma rawPoissonOrder_equation (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) (k : ℕ) (f : D.localizers.Sobolev (k : ℝ)) : + D.completedLOrder k (D.rawPoissonOrder m hm he P k f) = + f + D.localizers.constantsOrder (k : ℝ) + (D.poissonResidue m hm he P (D.localizers.lower (k : ℝ) 0 f)) := by + apply D.localizers.lower_injective (Nat.cast_nonneg k) + rw [D.completedLOrder_lower, rawPoissonOrder, (D.poissonRaw_order m hm he P k).choose_spec, + D.poissonRaw_equation, map_add, Localizers.constantsOrder_apply, + D.localizers.lower_embed (Nat.cast_nonneg k)] + rfl + +def pointPoissonOrder (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) (k : ℕ) (x₀ : X) : + D.localizers.Sobolev (k : ℝ) →L[ℝ] D.localizers.Sobolev ((k : ℝ)+2) := + D.rawPoissonOrder m hm he P k - D.localizers.constantsOrder ((k : ℝ)+2) ∘L + D.pointEvaluation ((k : ℝ)+2) x₀ ∘L D.rawPoissonOrder m hm he P k + +lemma pointPoissonOrder_equation (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) (k : ℕ) (x₀ : X) + (f : D.localizers.Sobolev (k : ℝ)) : + D.completedLOrder k (D.pointPoissonOrder m hm he P k x₀ f) = + f + D.localizers.constantsOrder (k : ℝ) + (D.poissonResidue m hm he P (D.localizers.lower (k : ℝ) 0 f)) := by + simp only [pointPoissonOrder, _root_.sub_apply, ContinuousLinearMap.comp_apply, + map_sub, D.completedLOrder_constants, sub_zero, D.rawPoissonOrder_equation] + +lemma pointPoissonOrder_normalized (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) (k : ℕ) + (hk : (Module.finrank ℝ (EC d) : ℝ) < 2*((k : ℝ)+2)) (x₀ : X) + (f : D.localizers.Sobolev (k : ℝ)) : + D.pointEvaluation ((k : ℝ)+2) x₀ (D.pointPoissonOrder m hm he P k x₀ f) = 0 := by + simp only [pointPoissonOrder, _root_.sub_apply, ContinuousLinearMap.comp_apply, + map_sub, Localizers.constantsOrder_apply, D.pointEvaluation_embed hk] + exact sub_self _ + +lemma pointPoissonOrder_unique (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (k : ℕ) (hk : (Module.finrank ℝ (EC d) : ℝ) < 2*((k : ℝ)+2)) (x₀ : X) + (u v : D.localizers.Sobolev ((k : ℝ)+2)) (c e : ℂ) + (huv : D.completedLOrder k u - D.localizers.constantsOrder (k : ℝ) c = + D.completedLOrder k v - D.localizers.constantsOrder (k : ℝ) e) + (hpt : D.pointEvaluation ((k : ℝ)+2) x₀ u = D.pointEvaluation ((k : ℝ)+2) x₀ v) : + u = v ∧ c = e := by + have hL : D.completedLOrder k (u-v) = D.localizers.constantsOrder (k : ℝ) (c-e) := by + rw [map_sub, map_sub] + calc + _ = (D.completedLOrder k u - D.localizers.constantsOrder (k : ℝ) c) - + (D.completedLOrder k v - D.localizers.constantsOrder (k : ℝ) e) + + (D.localizers.constantsOrder (k : ℝ) c - D.localizers.constantsOrder (k : ℝ) e) := by abel + _ = _ := by rw [huv, sub_self, zero_add] + obtain ⟨a, ha, hc⟩ := D.completedLOrder_constant_kernel m hm he k (u-v) (c-e) hL + have heval := congrArg (D.pointEvaluation ((k : ℝ)+2) x₀) ha + rw [map_sub, hpt, sub_self, Localizers.constantsOrder_apply, D.pointEvaluation_embed hk] at heval + have ha0 : a = 0 := heval.symm + rw [ha0, map_zero] at ha + exact ⟨sub_eq_zero.mp ha, sub_eq_zero.mp hc⟩ +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/PoissonEquivalence.lean b/lean/OAI/Geometry/PrescribedPotential/PoissonEquivalence.lean new file mode 100644 index 0000000000000000000000000000000000000000..aa08f3c0172569d852deca18490c94518057aaf5 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/PoissonEquivalence.lean @@ -0,0 +1,142 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.BoundedPoisson +import OAI.Geometry.PrescribedPotential.CircleRadialCalculus +import OAI.Geometry.PrescribedPotential.ComplexKernel +import OAI.Geometry.PrescribedPotential.QuantitativeResolvent + +namespace OAI + +/-! Poisson Equivalence. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] + +omit [T2Space X] [CompactSpace X] [ConnectedSpace X] in +lemma complexL_const (g : KaehlerMetric A) (c : ℂ) : complexL g (Smooth.const c) = 0 := by + ext x + obtain ⟨i, hi⟩ := A.covers x + change complexLValue g (Smooth.const c) x = 0 + rw [complexLValue_local g _ i (by simpa using hi)] + change localL g i (fun _ => c) (A.euclideanChart i x) = 0 + simp [localL] + +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +omit [ConnectedSpace X] in +lemma completedL_constants (c : ℂ) : D.completedL (D.localizers.constantsOrder 2 c) = 0 := by + rw [Localizers.constantsOrder_apply] + change D.localizers.extendCore 2 0 (complexL g) (D.localizers.embed 2 (Smooth.const c)) = 0 + rw [D.localizers.extendCore_embed D.complexL_bound, complexL_const, map_zero] + +def poissonBounded (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) : D.localizers.Sobolev 0 →L[ℝ] D.localizers.Sobolev 2 := + D.poissonRaw m hm he P - D.localizers.constantsOrder 2 ∘L P.coefficient ∘L + D.localizers.lower 2 0 ∘L D.poissonRaw m hm he P + +lemma poissonBounded_equation (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) (f : D.localizers.Sobolev 0) : + D.completedL (D.poissonBounded m hm he P f) = + f + D.localizers.constants (D.poissonResidue m hm he P f) := by + simp only [poissonBounded, _root_.sub_apply, ContinuousLinearMap.comp_apply, + map_sub, D.completedL_constants, sub_zero, D.poissonRaw_equation] + +lemma poissonBounded_normalized (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) (f : D.localizers.Sobolev 0) : + P.coefficient (D.localizers.lower 2 0 (D.poissonBounded m hm he P f)) = 0 := by + simp only [poissonBounded, _root_.sub_apply, ContinuousLinearMap.comp_apply, + map_sub, Localizers.constantsOrder_apply, + D.localizers.lower_embed (by norm_num : (0:ℝ) ≤ 2)] + change _ - P.coefficient (D.localizers.constants _) = 0 + rw [P.coefficient_constants, sub_self] + +lemma completedL_constant_kernel (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (u : D.localizers.Sobolev 2) (c : ℂ) (hu : D.completedL u = D.localizers.constants c) : + ∃ a : ℂ, u = D.localizers.constantsOrder 2 a ∧ c = 0 := by + let w := D.shiftedOperator m u + have hr : D.resolventZero m hm he w = D.localizers.lower 2 0 u := by + change D.localizers.lower 2 0 (D.completedResolvent m hm he (D.shiftedOperator m u)) = _ + rw [D.completedResolvent_left] + have hw : w = D.localizers.embed 0 (-Smooth.const c) + (m^2 : ℝ) • D.resolventZero m hm he w := by + rw [hr, map_neg] + change (m^2 : ℝ) • D.localizers.lower 2 0 u - D.completedL u = _ + rw [hu] + change _ - D.localizers.embed 0 (Smooth.const c) = _ + abel + obtain ⟨v, hv⟩ := D.allRegular_smooth (D.resolvent_feedback_regular m hm he w _ hw) + have hemb : D.localizers.embed 2 v = u := by + apply D.localizers.lower_injective (by norm_num : (0:ℝ) ≤ 2) + rw [D.localizers.lower_embed (by norm_num : (0:ℝ) ≤ 2), hv] + exact hr + have hl : complexL g v = Smooth.const c := by + apply D.localizers.embed_injective 0 + change D.localizers.embed 0 (complexL g v) = D.localizers.constants c + rw [← hu, ← hemb] + exact (D.localizers.extendCore_embed D.complexL_bound v).symm + have hc := complexL_constant_rhs_zero g v hl + have hl0 : complexL g v = 0 := by rw [hl, hc]; rfl + obtain ⟨a, ha⟩ := complexL_kernel g v hl0 + exact ⟨a, by rw [← hemb, ha]; rfl, hc⟩ + + +def augmentedL (P : D.localizers.ConstantProjection) : + (D.localizers.Sobolev 2 × ℂ) →L[ℝ] (D.localizers.Sobolev 0 × ℂ) := + ((D.completedL ∘L ContinuousLinearMap.fst ℝ _ _) - + (D.localizers.constants ∘L ContinuousLinearMap.snd ℝ _ _)).prod + (P.coefficient ∘L D.localizers.lower 2 0 ∘L ContinuousLinearMap.fst ℝ _ _) + +lemma augmentedL_apply (P : D.localizers.ConstantProjection) (u : D.localizers.Sobolev 2) (c : ℂ) : + D.augmentedL P (u,c) = (D.completedL u - D.localizers.constants c, + P.coefficient (D.localizers.lower 2 0 u)) := rfl + +lemma augmentedL_bijective (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) : Function.Bijective (D.augmentedL P) := by + constructor + · apply (LinearMap.ker_eq_bot).mp + apply LinearMap.ker_eq_bot'.mpr + rintro ⟨u,c⟩ h + have hl : D.completedL u = D.localizers.constants c := sub_eq_zero.mp (congrArg Prod.fst h) + obtain ⟨a, ha, hc⟩ := D.completedL_constant_kernel m hm he u c hl + have hn : P.coefficient (D.localizers.lower 2 0 u) = 0 := congrArg Prod.snd h + rw [ha, Localizers.constantsOrder_apply, D.localizers.lower_embed (by norm_num : (0:ℝ) ≤ 2)] at hn + change P.coefficient (D.localizers.constants a) = 0 at hn + rw [P.coefficient_constants] at hn + rw [ha, hn, map_zero, hc] + rfl + · rintro ⟨f,a⟩ + refine ⟨(D.poissonBounded m hm he P f + D.localizers.constantsOrder 2 a, + D.poissonResidue m hm he P f), ?_⟩ + rw [D.augmentedL_apply] + apply Prod.ext + · rw [map_add, D.completedL_constants, add_zero, D.poissonBounded_equation, add_sub_cancel_right] + · change P.coefficient (D.localizers.lower 2 0 + (D.poissonBounded m hm he P f + D.localizers.constantsOrder 2 a)) = a + rw [map_add, map_add, D.poissonBounded_normalized, zero_add, + Localizers.constantsOrder_apply, D.localizers.lower_embed (by norm_num : (0:ℝ) ≤ 2)] + exact P.coefficient_constants a + + + +def poissonEquiv (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) : + (D.localizers.Sobolev 2 × ℂ) ≃L[ℝ] (D.localizers.Sobolev 0 × ℂ) := + ContinuousLinearEquiv.ofBijective (D.augmentedL P) + (LinearMap.ker_eq_bot.mpr (D.augmentedL_bijective m hm he P).1) + (LinearMap.range_eq_top.mpr (D.augmentedL_bijective m hm he P).2) + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/PositiveOpenness.lean b/lean/OAI/Geometry/PrescribedPotential/PositiveOpenness.lean new file mode 100644 index 0000000000000000000000000000000000000000..e10eb9683ca5d97f2358a045038bf82cb8014cbc --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/PositiveOpenness.lean @@ -0,0 +1,79 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.PatchCutoffs +import OAI.Geometry.PrescribedPotential.RealSobolev +import OAI.Geometry.PrescribedPotential.WeakPositive +import OAI.Geometry.PrescribedPotential.SobolevOpenness + +namespace OAI + +/-! Positive Openness. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff Classical ComplexOrder +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) +local instance positiveOpennessNG (s : ℝ) : NormedAddCommGroup (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedAddCommGroup +local instance positiveOpennessNS (s : ℝ) : NormedSpace ℝ (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedSpace +local instance positiveOpennessTG (s : ℝ) : IsTopologicalAddGroup (D.localizers.RealSobolev s) := + Submodule.isTopologicalAddGroup _ +local instance positiveOpennessCS (s : ℝ) : ContinuousSMul ℝ (D.localizers.RealSobolev s) := + SMulMemClass.continuousSMul _ + +omit [T2Space X] [CompactSpace X] in +lemma exists_weight_support (x : X) : ∃ p, x ∈ tsupport (D.localizers.weight p : X → ℂ) := by + by_contra! hn + have hz : ∑ p, D.localizers.weight p x = 0 := Finset.sum_eq_zero (fun p _ => + image_eq_zero_of_notMem_tsupport (hn p)) + rw [D.localizers.sum_one] at hz + exact one_ne_zero hz + +lemma weakPositive_embed_iff (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (f : RealSmooth A) : + D.WeakPositive k (D.localizers.realEmbed ((k : ℝ)+2) f) ↔ g.PositivePotential f.source := by + constructor + · intro h i z hz + let x := (A.chart i).symm z + have hi : x ∈ (A.chart i).source := (A.chart i).mapsTo_symm hz + have hiz : A.chart i x = z := (A.chart i).right_inv hz + obtain ⟨p,hp⟩ := D.exists_weight_support x + have hj : x ∈ (A.chart (D.patch p).index).source := by simpa using D.patch_source p hp + have hpos := h p x hp + rw [D.weakMatrix_embed k hk f p hp] at hpos + rw [← hiz, g.compatibility i (D.patch p).index x hi hj, + f.source.hessian_compatibility i (D.patch p).index hi hj, ← add_mul, ← mul_add] + exact hpos.conjTranspose_mul_mul_same (Matrix.mulVec_injective_of_det_ne_zero + (g.transition_det_isUnit i (D.patch p).index hi hj).ne_zero) + · intro h p x hx + rw [D.weakMatrix_embed k hk f p hx] + exact h _ _ ((A.chart (D.patch p).index).mapsTo (by simpa using D.patch_source p hx)) + + + +theorem positive_volume_eventually_solvable [ConnectedSpace X] + (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (x₀ : X) : + ∀ᶠ f in 𝓝 (D.realConstants (k : ℝ) 1), + ∃ (u : D.localizers.RealSobolev ((k : ℝ)+2)) (b : ℝ), + D.WeakPositive k u ∧ D.realVolume k hk u = Real.exp b • f ∧ + D.realEvaluation ((k : ℝ)+2) x₀ u = 0 := by + have hU : {z : D.localizers.RealSobolev ((k : ℝ)+2) × ℝ | D.WeakPositive k z.1} ∈ 𝓝 0 := + (show Tendsto (Prod.fst : D.localizers.RealSobolev ((k : ℝ)+2) × ℝ → _) + (𝓝 0) (𝓝 0) from continuous_fst.tendsto 0) (D.weakPositive_nhds k hk) + exact D.volume_eventually_solvable k hk x₀ hU + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/PositivePotentialLinearization.lean b/lean/OAI/Geometry/PrescribedPotential/PositivePotentialLinearization.lean new file mode 100644 index 0000000000000000000000000000000000000000..ad13332c4f5c7ec06bc5fb0f7c347e573a767007 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/PositivePotentialLinearization.lean @@ -0,0 +1,115 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.NormalizedPoisson +import OAI.Geometry.PrescribedPotential.PotentialDensity +import OAI.Geometry.PrescribedPotential.SmoothPotentialDifference +import OAI.Geometry.PrescribedPotential.VolumePath + +namespace OAI + +/-! Positive Potential Linearization. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff Classical ComplexOrder +namespace Anticanonical.SourceSmooth +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +namespace KaehlerMetric + +lemma potentialDensity_quotient (g : KaehlerMetric A) (φ : SmoothRealFunction A) + (i : Fin A.count) {x : X} (hi : x ∈ (A.chart i).source) : + (g.potentialDensity φ).value x = + (g.matrix i (A.chart i x) + φ.hessian i (A.chart i x)).det.re / + g.volumeCoefficient i (A.chart i x) := by + have hz := (A.chart i).mapsTo hi + have hN := hermitian_det_im ((g.positive i _ hz).isHermitian.add (φ.hessian_hermitian i hz)) + have hB := hermitian_det_im (g.positive i _ hz).isHermitian + have heN : ((g.matrix i (A.chart i x) + φ.hessian i (A.chart i x)).det.re : ℂ) = + (g.matrix i (A.chart i x) + φ.hessian i (A.chart i x)).det := + Complex.ext rfl hN.symm + have heB : ((g.matrix i (A.chart i x)).det.re : ℂ) = (g.matrix i (A.chart i x)).det := + Complex.ext rfl hB.symm + change g.potentialDensityValue φ x = _ + rw [g.potentialDensityValue_local φ i hi,volumePolynomial,← heN,← heB,← Complex.ofReal_div] + rfl + +lemma potentialDensity_pos (g : KaehlerMetric A) (φ : SmoothRealFunction A) + (hp : g.PositivePotential φ) (x : X) : 0 < (g.potentialDensity φ).value x := by + obtain ⟨i,hi⟩ := A.covers x + rw [g.potentialDensity_quotient φ i hi] + exact div_pos (Complex.pos_iff.mp (hp i _ ((A.chart i).mapsTo hi)).det_pos).1 + (g.volumeCoefficient_pos i ((A.chart i).mapsTo hi)) + + + +lemma potentialLogDensity_directional (g : KaehlerMetric A) (φ ψ : SmoothRealFunction A) + (hp : g.PositivePotential φ) (x : X) : + HasDerivAt (fun t : ℝ => Real.log + ((g.potentialDensity (φ.addFunction (ψ.realSMul t))).value x)) + (((g.deform φ hp).laplacian ψ).value x) 0 := by + obtain ⟨i,hi⟩ := A.covers x + have hz := (A.chart i).mapsTo hi + let H := g.matrix i (A.chart i x) + φ.hessian i (A.chart i x) + let K := ψ.hessian i (A.chart i x) + let b := g.volumeCoefficient i (A.chart i x) + have hH : H.PosDef := hp i _ hz + have hb : 0 < b := g.volumeCoefficient_pos i hz + have hdet : 0 < H.det.re := (Complex.pos_iff.mp hH.det_pos).1 + have him : H.det.im = 0 := hermitian_det_im hH.isHermitian + have hn := (MongeAmpere.hasDerivAt_det_add_smul H K + (isUnit_iff_ne_zero.mpr (ne_of_gt hH.det_pos))).real_of_complex + have hn' : HasDerivAt (fun t : ℝ => (H + (t : ℂ) • K).det.re) + (H.det.re * (H⁻¹ * K).trace.re) 0 := by + simpa only [Complex.mul_re,him,zero_mul,sub_zero] using hn + have he : (fun t : ℝ => (g.potentialDensity (φ.addFunction (ψ.realSMul t))).value x) = + (fun t : ℝ => (H + (t : ℂ) • K).det.re / b) := by + funext t + rw [g.potentialDensity_quotient _ i hi,SmoothRealFunction.hessian_addFunction _ _ i hz, + SmoothRealFunction.hessian_realSMul] + simp only [H,K,b,add_assoc] + rw [show ((g.deform φ hp).laplacian ψ).value x = (H⁻¹ * K).trace.re from + (g.deform φ hp).laplacianValue_local ψ i hi] + change HasDerivAt (Real.log ∘ (fun t : ℝ => + (g.potentialDensity (φ.addFunction (ψ.realSMul t))).value x)) _ 0 + rw [he] + have hd := (hn'.div_const b).log (show (H + ((0 : ℝ) : ℂ) • K).det.re / b ≠ 0 from by + simpa using ne_of_gt (div_pos hdet hb)) + have hc : H.det.re * (H⁻¹ * K).trace.re / b / ((H + ((0 : ℝ) : ℂ) • K).det.re / b) = + (H⁻¹ * K).trace.re := by + simp only [Complex.ofReal_zero,zero_smul,add_zero] + field_simp + rw [hc] at hd + exact hd.congr_of_eventuallyEq (Filter.Eventually.of_forall (fun t => rfl)) + +end KaehlerMetric + + + +theorem positivePotential_linearized_solvable [T2Space X] [CompactSpace X] [ConnectedSpace X] + (g : KaehlerMetric A) (φ : SmoothRealFunction A) (hp : g.PositivePotential φ) + (x₀ : X) (f : SmoothRealFunction A) : + ∃ (ψ : SmoothRealFunction A) (a : ℝ), ψ.value x₀ = 0 ∧ + ∀ x, HasDerivAt (fun t : ℝ => + Real.log ((g.potentialDensity (φ.addFunction (ψ.realSMul t))).value x) + t*a) + (f.value x) 0 := by + obtain ⟨ψ,a,hn,he⟩ := normalizedPoisson d X A (g.deform φ hp) x₀ f + refine ⟨ψ,a,hn,fun x => ?_⟩ + obtain ⟨i,hi⟩ := A.covers x + have h := (g.potentialLogDensity_directional φ ψ hp x).add ((hasDerivAt_id (0 : ℝ)).mul_const a) + have hr : ((g.deform φ hp).laplacian ψ).value x + a = f.value x := by + change (g.deform φ hp).laplacianValue ψ x + a = _ + rw [(g.deform φ hp).laplacianValue_local ψ i hi] + simpa only [SmoothRealFunction.localExpression,Function.comp_apply,(A.chart i).left_inv hi] + using he i (A.chart i x) ((A.chart i).mapsTo hi) + rw [one_mul,hr] at h + exact h.congr_of_eventuallyEq (Filter.Eventually.of_forall (fun t => rfl)) + +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/PotentialDensity.lean b/lean/OAI/Geometry/PrescribedPotential/PotentialDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..a6ca87a0e4120f5a36c9a1443e19e26fb8add680 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/PotentialDensity.lean @@ -0,0 +1,112 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalOperator + +namespace OAI + +/-! Potential Density. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Classical Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +lemma hermitian_det_im {n : ℕ} {H : Matrix (Fin n) (Fin n) ℂ} + (hH : H.IsHermitian) : H.det.im = 0 := by + have hh := congrArg (fun M : Matrix (Fin n) (Fin n) ℂ => M.det.im) hH.eq + rw [Matrix.det_conjTranspose] at hh + change -H.det.im = H.det.im at hh + linarith + +namespace KaehlerMetric + +def volumePolynomial (g : KaehlerMetric A) (φ : SmoothRealFunction A) + (i : Fin A.count) (z : Coordinates d) : ℂ := + (g.matrix i z + φ.hessian i z).det / (g.matrix i z).det + +lemma volumePolynomial_compatibility (g : KaehlerMetric A) (φ : SmoothRealFunction A) + (i j : Fin A.count) {x : X} + (hi : x ∈ (A.chart i).source) (hj : x ∈ (A.chart j).source) : + g.volumePolynomial φ i (A.chart i x) = g.volumePolynomial φ j (A.chart j x) := by + unfold volumePolynomial + apply (div_eq_div_iff + (ne_of_gt (g.positive i _ ((A.chart i).mapsTo hi)).det_pos) + (ne_of_gt (g.positive j _ ((A.chart j).mapsTo hj)).det_pos)).mpr + rw [g.compatibility i j x hi hj, φ.hessian_compatibility i j hi hj, + ← add_mul, ← mul_add] + simp only [Matrix.det_mul] + ring + +lemma volumePolynomial_im (g : KaehlerMetric A) (φ : SmoothRealFunction A) + (i : Fin A.count) {z : Coordinates d} (hz : z ∈ (A.chart i).target) : + (g.volumePolynomial φ i z).im = 0 := by + have hg := (g.positive i z hz).isHermitian + have hn := hermitian_det_im (hg.add (φ.hessian_hermitian i hz)) + have hd := hermitian_det_im hg + simp only [volumePolynomial, Complex.div_im, hn, hd, zero_mul, mul_zero, + sub_zero, zero_div] + +lemma volumePolynomial_smooth (g : KaehlerMetric A) (φ : SmoothRealFunction A) + (i : Fin A.count) : + ContDiffOn ℝ ∞ (g.volumePolynomial φ i) (A.chart i).target := by + exact (MatrixSmoothGeneral.determinant ((g.smooth i).add (φ.hessian_smooth i))).mul + ((MatrixSmoothGeneral.determinant (g.smooth i)).inv + (fun z hz => ne_of_gt (g.positive i z hz).det_pos)) + +def potentialDensityValue (g : KaehlerMetric A) (φ : SmoothRealFunction A) (x : X) : ℝ := + (g.volumePolynomial φ (A.covers x).choose (A.chart (A.covers x).choose x)).re + +lemma potentialDensityValue_local (g : KaehlerMetric A) (φ : SmoothRealFunction A) + (i : Fin A.count) {x : X} (hi : x ∈ (A.chart i).source) : + g.potentialDensityValue φ x = (g.volumePolynomial φ i (A.chart i x)).re := by + unfold potentialDensityValue + rw [g.volumePolynomial_compatibility φ _ i (A.covers x).choose_spec hi] + +def potentialDensity (g : KaehlerMetric A) (φ : SmoothRealFunction A) : SmoothRealFunction A where + value := g.potentialDensityValue φ + smooth i := by + apply (Complex.reCLM.contDiff.comp_contDiffOn (g.volumePolynomial_smooth φ i)).congr + intro z hz + dsimp only [Function.comp_apply] + rw [g.potentialDensityValue_local φ i ((A.chart i).mapsTo_symm hz), (A.chart i).right_inv hz] + rfl + +lemma potentialDensity_complex (g : KaehlerMetric A) (φ : SmoothRealFunction A) + (i : Fin A.count) {x : X} (hi : x ∈ (A.chart i).source) : + ((g.potentialDensity φ).value x : ℂ) = g.volumePolynomial φ i (A.chart i x) := by + apply Complex.ext + · exact g.potentialDensityValue_local φ i hi + · exact (g.volumePolynomial_im φ i ((A.chart i).mapsTo hi)).symm + +lemma potentialDensity_directional (g : KaehlerMetric A) (φ : SmoothRealFunction A) (x : X) : + HasDerivAt (fun t : ℝ => (g.potentialDensity (φ.realSMul t)).value x) + ((g.laplacian φ).value x) 0 := by + obtain ⟨i, hi⟩ := A.covers x + let H := g.matrix i (A.chart i x) + let K := φ.hessian i (A.chart i x) + have hn : H.det ≠ 0 := ne_of_gt (g.positive i _ ((A.chart i).mapsTo hi)).det_pos + have hd := ((MongeAmpere.hasDerivAt_det_add_smul H K (isUnit_iff_ne_zero.mpr hn)).div_const H.det).real_of_complex + have he : H.det * (H⁻¹ * K).trace / H.det = (H⁻¹ * K).trace := by + rw [mul_div_cancel_left₀ _ hn] + rw [he] at hd + have hl : (g.laplacian φ).value x = (H⁻¹ * K).trace.re := + g.laplacianValue_local φ i hi + rw [hl] + apply hd.congr_of_eventuallyEq + filter_upwards [] with t + change g.potentialDensityValue (φ.realSMul t) x = _ + rw [g.potentialDensityValue_local (φ.realSMul t) i hi] + simp only [volumePolynomial, SmoothRealFunction.hessian_realSMul] + rfl + +end KaehlerMetric +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/PotentialDensityDifferential.lean b/lean/OAI/Geometry/PrescribedPotential/PotentialDensityDifferential.lean new file mode 100644 index 0000000000000000000000000000000000000000..e852b4b719b2fe6b62cd0b1694eb5ab20d759bca --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/PotentialDensityDifferential.lean @@ -0,0 +1,107 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CompletedVolume +import OAI.Geometry.PrescribedPotential.NonlinearHessianCommutator +import OAI.Geometry.PrescribedPotential.PotentialDensity +import OAI.Geometry.PrescribedPotential.SmoothPotentialDifference + +namespace OAI + +/-! Potential Density Differential. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff Classical Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +namespace KaehlerMetric +local instance matrixContinuousSMul (n : ℕ) : ContinuousSMul ℝ (Matrix (Fin n) (Fin n) ℂ) := + inferInstanceAs (ContinuousSMul ℝ (Fin n → Fin n → ℂ)) + +lemma potentialDensity_directional_at (g : KaehlerMetric A) (φ ψ : SmoothRealFunction A) + (q : Fin A.count) {x : X} (hx : x ∈ (A.chart q).source) : + HasDerivAt (fun t : ℝ => ((g.potentialDensity (φ.addFunction (ψ.realSMul t))).value x : ℂ)) + ((g.matrix q (A.chart q x)).det⁻¹ * + NonlinearHessian.detDifferential (g.matrix q (A.chart q x) + φ.hessian q (A.chart q x)) + (ψ.hessian q (A.chart q x))) 0 := by + let M := g.matrix q (A.chart q x) + φ.hessian q (A.chart q x) + let N := ψ.hessian q (A.chart q x) + have hc := ((hasDerivAt_id (0 : ℝ)).smul_const N).const_add M + simp only [one_smul] at hc + have hM : HasFDerivAt Matrix.det (NonlinearHessian.detDifferential M) (M+(0 : ℝ) • N) := by + simpa only [zero_smul,add_zero] using NonlinearHessian.detDifferential_hasFDeriv M + have hd := (hM.comp_hasDerivAt (0 : ℝ) hc).const_mul (g.matrix q (A.chart q x)).det⁻¹ + apply hd.congr_of_eventuallyEq + filter_upwards [] with t + rw [g.potentialDensity_complex _ q hx] + unfold volumePolynomial + rw [SmoothRealFunction.hessian_addFunction _ _ q ((A.chart q).mapsTo hx), + SmoothRealFunction.hessian_realSMul] + have hs : t • N = (t : ℂ) • N := by + ext i j + exact Complex.real_smul + simp only [Function.comp_apply, id_eq] at * + rw [hs,div_eq_mul_inv,mul_comm] + congr 1 + simp only [M,N,add_assoc] + +end KaehlerMetric +end Anticanonical.SourceSmooth + +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +lemma completedVolumeDerivative_source (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (φ ψ : SmoothRealFunction A) (q : Fin A.count) {x : X} (hx : x ∈ (A.chart q).source) : + D.localizers.strong (k : ℝ) + (fderiv ℝ (D.completedVolume k hk) (D.localizers.embed ((k : ℝ)+2) (Smooth.ofReal φ)) + (D.localizers.embed ((k : ℝ)+2) (Smooth.ofReal ψ))) x = + (g.matrix q (A.chart q x)).det⁻¹ * + NonlinearHessian.detDifferential (g.matrix q (A.chart q x) + φ.hessian q (A.chart q x)) + (ψ.hessian q (A.chart q x)) := by + have hs : (Module.finrank ℝ (EC d) : ℝ) < 2*(k : ℝ) := by + have hh : (Module.finrank ℝ (EC d) : ℝ) < (k : ℝ) := by exact_mod_cast hk + linarith [Nat.cast_nonneg (α := ℝ) k] + let u := D.localizers.embed ((k : ℝ)+2) (Smooth.ofReal φ) + let v := D.localizers.embed ((k : ℝ)+2) (Smooth.ofReal ψ) + let E : D.localizers.Sobolev (k : ℝ) →L[ℝ] ℂ := + (BoundedContinuousFunction.evalCLM ℝ x).comp (D.localizers.strong (k : ℝ)) + have hc := ((hasDerivAt_id (0 : ℝ)).smul_const v).const_add u + simp only [one_smul] at hc + have hu : HasFDerivAt (D.completedVolume k hk) + (fderiv ℝ (D.completedVolume k hk) u) (u+(0 : ℝ) • v) := by + simpa only [zero_smul,add_zero] using + ((D.completedVolume_contDiff k hk).differentiable (by simp) u).hasFDerivAt + have hd := E.hasFDerivAt.comp_hasDerivAt (0 : ℝ) (hu.comp_hasDerivAt (0 : ℝ) hc) + have he (t : ℝ) : u+t • v = D.localizers.embed ((k : ℝ)+2) + (Smooth.ofReal (φ.addFunction (ψ.realSMul t))) := by + dsimp only [u,v] + rw [← map_smul,← map_add] + congr 1 + apply Smooth.ext + intro y + simp [SmoothRealFunction.addFunction,SmoothRealFunction.realSMul,Complex.real_smul] + have hp := g.potentialDensity_directional_at φ ψ q hx + apply hd.unique + apply hp.congr_of_eventuallyEq + filter_upwards [] with t + change E (D.completedVolume k hk (u+t • v)) = _ + rw [he,D.completedVolume_embed] + change D.localizers.strong (k : ℝ) (D.localizers.embed (k : ℝ) _) x = _ + rw [D.localizers.strong_embed _ hs] + rfl + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/PotentialLinearCalculus.lean b/lean/OAI/Geometry/PrescribedPotential/PotentialLinearCalculus.lean new file mode 100644 index 0000000000000000000000000000000000000000..d625e5b3e13aa5afce4ccb08e3d67e2f7780968d --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/PotentialLinearCalculus.lean @@ -0,0 +1,43 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.WirtingerCalculus + +namespace OAI + +/-! Potential Linear Calculus. -/ + +section + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +variable {n : ℕ} + +lemma potentialMatrix_affine {f g : V n → ℝ} {z : V n} + (hf : ContDiffAt ℝ ∞ f z) (hg : ContDiffAt ℝ ∞ g z) (a : ℝ) : + PotentialKaehler.potentialMatrix (fun y => f y+a*g y) z = + PotentialKaehler.potentialMatrix f z+(a:ℂ) • PotentialKaehler.potentialMatrix g z := by + have he := EllipticKernel.hessian_add_smul_sub_const hf hg a 0 + simp only [sub_zero] at he + unfold PotentialKaehler.potentialMatrix + rw [he,EllipticKernel.hermitianPartMatrix_add,EllipticKernel.hermitianPartMatrix_smul] + rfl + +lemma potentialMatrix_sub_smul {f g : V n → ℝ} {z : V n} + (hf : ContDiffAt ℝ ∞ f z) (hg : ContDiffAt ℝ ∞ g z) (a : ℝ) : + PotentialKaehler.potentialMatrix (fun y => f y-a*g y) z = + PotentialKaehler.potentialMatrix f z-(a:ℂ) • PotentialKaehler.potentialMatrix g z := by + simpa only [neg_mul,sub_eq_add_neg,Complex.ofReal_neg,neg_smul] using potentialMatrix_affine hf hg (-a) + +lemma potentialMatrix_trace_sub_smul {f g : V n → ℝ} {z : V n} + (hf : ContDiffAt ℝ ∞ f z) (hg : ContDiffAt ℝ ∞ g z) (a : ℝ) : + (PotentialKaehler.potentialMatrix (fun y => f y-a*g y) z).trace.re = + (PotentialKaehler.potentialMatrix f z).trace.re-a*(PotentialKaehler.potentialMatrix g z).trace.re := by + rw [potentialMatrix_sub_smul hf hg,Matrix.trace_sub,Matrix.trace_smul] + simp only [Complex.sub_re,smul_eq_mul,Complex.mul_re,Complex.ofReal_re,Complex.ofReal_im,zero_mul,sub_zero] +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/PrescribedPotential.lean b/lean/OAI/Geometry/PrescribedPotential/PrescribedPotential.lean new file mode 100644 index 0000000000000000000000000000000000000000..43880946a020e42f28ce80c6bd21058156a4dee4 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/PrescribedPotential.lean @@ -0,0 +1,31 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.BoundedPathContinuation +import OAI.Geometry.PrescribedPotential.UniformPathSobolev + +namespace OAI + +/-! Prescribed Potential. -/ + +section + + +noncomputable section +namespace Anticanonical.SourceSmooth +open GlobalElliptic + + + +theorem prescribedPotential (d : ℕ) (X : Type) [TopologicalSpace X] [T2Space X] + [CompactSpace X] [ConnectedSpace X] (A : ComplexAtlas d X) + (P : A.ProjectiveEmbedding) (h : SemipositiveAnticanonicalMetric A) : + HasPrescribedVolumePotential P h := by + obtain ⟨S,⟨D⟩⟩ := exists_gluingData (projectiveBackground P) + let x₀ : X := Classical.choice (inferInstance : Nonempty X) + exact prescribedPotential_of_path_bounds P h D x₀ (D.pathSobolevBounds h x₀) + +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/PrincipalComponents.lean b/lean/OAI/Geometry/PrescribedPotential/PrincipalComponents.lean new file mode 100644 index 0000000000000000000000000000000000000000..e997d9681ff77a25220e15391615ff3f34c8797b --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/PrincipalComponents.lean @@ -0,0 +1,85 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.ComplexHessian +import OAI.Geometry.PrescribedPotential.MatrixHilbertCoordinates +import OAI.Geometry.PrescribedPotential.MatrixWirtinger +import OAI.Geometry.PrescribedPotential.ScalarPrincipalWirtinger + +namespace OAI + +/-! Principal Components. -/ + +section + +noncomputable section +open Set Filter Topology Matrix Finset +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace HigherJet +open EllipticKernel FrozenPoisson KaehlerCalculus +variable {E F G : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] [NormedAddCommGroup G] [NormedSpace ℝ G] + {ι : Type*} [Fintype ι] +lemma principalApply_postcomp (e : OrthonormalBasis ι ℝ E) (L : SecondOrder E) + (H : E →L[ℝ] E →L[ℝ] F) (_J : G) (l : F →L[ℝ] G) + (Q : E →L[ℝ] E →L[ℝ] G) (hQ : ∀ v w, Q v w = l (H v w)) : + principalApply e L Q = l (principalApply e L H) := by + simp only [principalApply,map_sum,map_smul,hQ] +lemma principalApply_hessian_postcomp (e : OrthonormalBasis ι ℝ E) (L : SecondOrder E) + {f : E → F} {x : E} (hf : ContDiffAt ℝ ∞ f x) (l : F →L[ℝ] G) : + principalApply e L (fderiv ℝ (fderiv ℝ (fun y => l (f y))) x) = + l (principalApply e L (fderiv ℝ (fderiv ℝ f) x)) := + principalApply_postcomp e L _ (0:G) l _ (fun v w => GlobalElliptic.second_postcomp_general hf l v w) +end HigherJet +namespace MetricSystem +open EllipticKernel FrozenPoisson HigherJet KaehlerCalculus +variable {n : ℕ} {ι : Type*} [Fintype ι] +local instance componentRealECIP : InnerProductSpace ℝ (EC n) := InnerProductSpace.rclikeToReal ℂ (EC n) +lemma complex_principal (basis : OrthonormalBasis ι ℝ (EC n)) (M : Mat n) (hM : M.PosDef) + {f : EC n → ℂ} {x : EC n} (hf : ContDiffAt ℝ ∞ f x) : + principalApply basis (traceBilin M) (fderiv ℝ (fderiv ℝ f) x) = + ∑ p, ∑ q, M⁻¹ p q*dzbar (e q) (dz (e p) (f ∘ (coordinateEquiv n).symm)) (coordinateEquiv n x) := by + have hcomp : ContDiffAt ℝ ∞ (f ∘ (coordinateEquiv n).symm) (coordinateEquiv n x) := + (by simpa only [ContinuousLinearEquiv.symm_apply_apply] using hf : ContDiffAt ℝ ∞ f ((coordinateEquiv n).symm (coordinateEquiv n x))).comp _ (coordinateEquiv n).symm.contDiff.contDiffAt + rw [inverse_wirtinger_complex M hM hcomp] + apply Complex.ext + · have hr : ContDiffAt ℝ ∞ (fun y => (f y).re) x := Complex.reCLM.contDiff.contDiffAt.comp x hf + have he := scalar_principal_real basis M hr + have hp := principalApply_hessian_postcomp basis (traceBilin M) hf Complex.reCLM + simpa [Function.comp_def] using hp.symm.trans he + · have hi : ContDiffAt ℝ ∞ (fun y => (f y).im) x := Complex.imCLM.contDiff.contDiffAt.comp x hf + have he := scalar_principal_real basis M hi + have hp := principalApply_hessian_postcomp basis (traceBilin M) hf Complex.imCLM + simpa [Function.comp_def] using hp.symm.trans he + + def entryCLM (i j : Fin n) : HM n →L[ℝ] ℂ := + ((ContinuousLinearMap.proj j).comp (ContinuousLinearMap.proj i)).comp (encode n).symm.toContinuousLinearMap +@[simp] lemma entryCLM_apply (i j : Fin n) (u : HM n) : entryCLM i j u = u (i,j) := rfl + +lemma encoded_principal (basis : OrthonormalBasis ι ℝ (EC n)) + {M : V n → Mat n} {z : V n} (hM : ContDiffAt ℝ ∞ M z) (hp : (M z).PosDef) : + principalBilinear basis (M z)⁻¹ + (fderiv ℝ (fderiv ℝ (fun x => encode n (M (coordinateEquiv n x)))) ((coordinateEquiv n).symm z)) = + encode n (∑ p, ∑ q, (M z)⁻¹ p q • mderiv Complex.I (e q) (mderiv (-Complex.I) (e p) M) z) := by + let u : EC n → HM n := fun x => encode n (M (coordinateEquiv n x)) + let x := (coordinateEquiv n).symm z + have hu : ContDiffAt ℝ ∞ u x := (encode n).contDiff.contDiffAt.comp x + ((by simpa only [x,ContinuousLinearEquiv.apply_symm_apply] using hM : ContDiffAt ℝ ∞ M (coordinateEquiv n x)).comp x (coordinateEquiv n).contDiff.contDiffAt) + rw [principalBilinear_inv] + apply PiLp.ext + intro ij + obtain ⟨i,j⟩ := ij + have he := complex_principal basis (M z) hp ((entryCLM i j).contDiff.contDiffAt.comp x hu) + have hpcomp := principalApply_hessian_postcomp basis (traceBilin (M z)) hu (entryCLM i j) + have he := hpcomp.symm.trans he + have hf : (fun y => entryCLM i j (u y)) ∘ (coordinateEquiv n).symm = fun y => M y i j := by + funext y + simp [u] + change _ = ∑ p, ∑ q, (M z)⁻¹ p q*dzbar (e q) (dz (e p) ((fun y => entryCLM i j (u y)) ∘ (coordinateEquiv n).symm)) (coordinateEquiv n x) at he + rw [hf] at he + simpa only [entryCLM_apply,u,x,ContinuousLinearEquiv.apply_symm_apply,encode_apply, + Matrix.sum_apply,Matrix.smul_apply,smul_eq_mul,mderiv,dzbar,dz] using he +end MetricSystem + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/QuadraticContact.lean b/lean/OAI/Geometry/PrescribedPotential/QuadraticContact.lean new file mode 100644 index 0000000000000000000000000000000000000000..aadb30c8ff517c2289e9587bd3960719b9a3f170 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/QuadraticContact.lean @@ -0,0 +1,85 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CircleRadialCalculus +import OAI.Geometry.PrescribedPotential.KaehlerClosedDerivatives + +namespace OAI + +/-! Quadratic Contact. -/ + +section + + + +noncomputable section +open Matrix Set Filter Topology +open scoped InnerProductSpace ContDiff +namespace PotentialABP +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +lemma norm_sub_sq_hessian (c x v w : E) : + fderiv ℝ (fderiv ℝ (fun y : E => ‖y-c‖^2)) x v w = 2 * inner ℝ v w := by + have he : fderiv ℝ (fun y : E => ‖y-c‖^2) = fun y => (2:ℝ) • innerSL ℝ (y-c) := by + funext y + simpa [two_smul] using (((hasFDerivAt_id y).sub_const c).norm_sq).fderiv + rw [he] + have hd := ((innerSL ℝ : E →L[ℝ] E →L[ℝ] ℝ).hasFDerivAt.comp x + ((hasFDerivAt_id x).sub_const c)).const_smul (2:ℝ) + change HasFDerivAt (fun y => (2:ℝ) • innerSL ℝ (y-c)) _ x at hd + rw [hd.fderiv] + simp + rfl + +lemma quadratic_add_hessian {f : E → ℝ} (hf : ContDiff ℝ ∞ f) (δ : ℝ) + (c x v w : E) : + fderiv ℝ (fderiv ℝ (fun y => f y + δ*‖y-c‖^2)) x v w = + fderiv ℝ (fderiv ℝ f) x v w + 2*δ*inner ℝ v w := by + have hn : ContDiff ℝ ∞ (fun y : E => ‖y-c‖^2) := + (contDiff_id.sub contDiff_const).norm_sq ℝ + have he := EllipticKernel.hessian_add_smul_sub_const (z := x) hf.contDiffAt hn.contDiffAt δ 0 + simp only [sub_zero] at he + rw [he] + simp only [_root_.add_apply, _root_.smul_apply, + smul_eq_mul, norm_sub_sq_hessian] + ring + +end PotentialABP + +namespace PotentialABP +variable {d : ℕ} +local notation "E" => EuclideanSpace ℂ (Fin d) +local instance (d : ℕ) : InnerProductSpace ℝ (EuclideanSpace ℂ (Fin d)) := + InnerProductSpace.rclikeToReal ℂ (EuclideanSpace ℂ (Fin d)) +local notation "e" => EuclideanSpace.equiv (Fin d) ℂ + +lemma hessian_coord_comp {f : (Fin d → ℂ) → ℝ} (hf : ContDiff ℝ ∞ f) + (x v w : E) : + fderiv ℝ (fderiv ℝ (f ∘ e)) x v w = + fderiv ℝ (fderiv ℝ f) (e x) (e v) (e w) := by + let er := (EuclideanSpace.equiv (Fin d) ℂ).toContinuousLinearMap.restrictScalars ℝ + have her : ContDiff ℝ ∞ e := er.contDiff + have hd : fderiv ℝ e = fun _ => (er : E →L[ℝ] (Fin d → ℂ)) := by + funext y + exact er.hasFDerivAt.fderiv + rw [PotentialKaehler.second_derivative_comp her.contDiffAt hf.contDiffAt v w, hd] + simp + rfl + +lemma levi_coord_pair {f : (Fin d → ℂ) → ℝ} (hf : ContDiff ℝ ∞ f) + (x v : E) : + fderiv ℝ (fderiv ℝ (f ∘ e)) x v v + + fderiv ℝ (fderiv ℝ (f ∘ e)) x (Complex.I • v) (Complex.I • v) = + 4 * inner ℝ ((PotentialKaehler.potentialMatrix f (e x)).toEuclideanLin v) v := by + rw [hessian_coord_comp hf, hessian_coord_comp hf] + rw [real_inner_comm, real_inner_eq_re_inner (𝕜 := ℂ), EuclideanSpace.inner_eq_star_dotProduct] + rw [dotProduct_comm] + change _ = 4 * (star (e v) ⬝ᵥ ((PotentialKaehler.potentialMatrix f (e x)) *ᵥ (e v))).re + rw [PotentialKaehler.potentialMatrix, PotentialKaehler.hermitianPartMatrix_pair] + simp only [map_smul, PotentialKaehler.hermitianPart] + ring + +end PotentialABP + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/QuantitativeResolvent.lean b/lean/OAI/Geometry/PrescribedPotential/QuantitativeResolvent.lean new file mode 100644 index 0000000000000000000000000000000000000000..4656ec39e0afca5c5185d7a891c4a9e23fb080f9 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/QuantitativeResolvent.lean @@ -0,0 +1,141 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CompletedResolvent +import OAI.Geometry.PrescribedPotential.ComplexKernel +import OAI.Geometry.PrescribedPotential.GlobalSmooth + +namespace OAI + +/-! Quantitative Resolvent. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical +namespace Anticanonical.SourceSmooth.KaehlerMetric +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [CompactSpace X] + {A : ComplexAtlas d X} + +lemma positive_eigenfunction_nonpos (g : KaehlerMetric A) (φ : SmoothRealFunction A) + {a : ℝ} (ha : 0 < a) + (he : ∀ i z, z ∈ (A.chart i).target → + g.linearizedMongeAmpere φ i z = a * φ.localExpression i z) : + ∀ x, φ.value x ≤ 0 := by + intro y + let : Nonempty X := ⟨y⟩ + obtain ⟨x, _, hx⟩ := isCompact_univ.exists_isMaxOn univ_nonempty φ.continuous.continuousOn + obtain ⟨i, hi⟩ := A.covers x + have hn := g.linearized_nonpos_at_globalMax φ (fun z => hx (mem_univ z)) i hi + rw [he i _ ((A.chart i).mapsTo hi)] at hn + have hv : φ.localExpression i (A.chart i x) = φ.value x := by + simp only [SmoothRealFunction.localExpression, Function.comp_apply, (A.chart i).left_inv hi] + rw [hv] at hn + exact (hx (mem_univ y)).trans (by nlinarith) + +lemma positive_eigenfunction_zero (g : KaehlerMetric A) (φ : SmoothRealFunction A) + {a : ℝ} (ha : 0 < a) + (he : ∀ i z, z ∈ (A.chart i).target → + g.linearizedMongeAmpere φ i z = a * φ.localExpression i z) : + ∀ x, φ.value x = 0 := by + have hp := g.positive_eigenfunction_nonpos φ ha he + have hn := g.positive_eigenfunction_nonpos (φ.realSMul (-1)) ha (by + intro i z hz + rw [g.linearizedMongeAmpere_realSMul, he i z hz] + change -1 * (a * φ.localExpression i z) = a * (-1 * φ.localExpression i z) + ring) + intro x + have hnx : -1 * φ.value x ≤ 0 := hn x + exact le_antisymm (hp x) (by linarith) + +end Anticanonical.SourceSmooth.KaehlerMetric +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [CompactSpace X] + {A : ComplexAtlas d X} + +lemma shifted_complex_kernel (g : KaehlerMetric A) {a : ℝ} (ha : 0 < a) + (u : Smooth A) (hu : a • u - complexL g u = 0) : u = 0 := by + have he : complexL g u = a • u := (sub_eq_zero.mp hu).symm + have hp (p : ℂ →L[ℝ] ℝ) (hpart : ∀ x, + p (complexL g u x) = (g.laplacian (u.part p)).value x) : + ∀ x, p (u x) = 0 := by + apply g.positive_eigenfunction_zero (u.part p) ha + intro i z hz + rw [← g.laplacian_localExpression _ i hz] + change (g.laplacian (u.part p)).value ((A.chart i).symm z) = _ + rw [← hpart, he] + exact p.map_smul a (u ((A.chart i).symm z)) + have hr := hp Complex.reCLM (fun x => complexL_re g u x) + have hi := hp Complex.imCLM (fun x => complexL_im g u x) + ext x + exact Complex.ext (hr x) (hi x) + +variable [T2Space X] {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +lemma shiftedOperator_embed (m : ℝ) (f : Smooth A) : + D.shiftedOperator m (D.localizers.embed 2 f) = + D.localizers.embed 0 ((m^2 : ℝ) • f - complexL g f) := by + simp only [shiftedOperator, completedL, sub_apply, + smul_apply, D.localizers.lower_embed (by norm_num : (0:ℝ) ≤ 2), + D.localizers.extendCore_embed D.complexL_bound, map_sub, map_smul] + +lemma completedResolvent_left (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (v : D.localizers.Sobolev 2) : + D.completedResolvent m hm he (D.shiftedOperator m v) = v := by + have hfun : (D.completedResolvent m hm he) ∘ D.shiftedOperator m = id := by + apply (D.localizers.embed_dense 2).equalizer (by fun_prop) continuous_id + funext f + simp only [Function.comp_apply] + rw [D.shiftedOperator_embed] + obtain ⟨u, hu⟩ := D.allRegular_smooth (D.completedResolvent_regular m hm he + ((m^2 : ℝ) • f - complexL g f)) + have hu2 : D.localizers.embed 2 u = D.completedResolvent m hm he + (D.localizers.embed 0 ((m^2 : ℝ) • f - complexL g f)) := by + apply D.localizers.lower_injective (by norm_num : (0 : ℝ) ≤ 2) + rw [D.localizers.lower_embed (by norm_num : (0 : ℝ) ≤ 2), hu] + have hs := D.completedResolvent_equation m hm he + (D.localizers.embed 0 ((m^2 : ℝ) • f - complexL g f)) + rw [← hu2, D.shiftedOperator_embed] at hs + have hh := D.localizers.embed_injective 0 hs + have hk : (m^2 : ℝ) • (u-f) - complexL g (u-f) = 0 := by + rw [map_sub, smul_sub] + calc + (m^2 : ℝ) • u - (m^2 : ℝ) • f - (complexL g u - complexL g f) = + ((m^2 : ℝ) • u - complexL g u) - ((m^2 : ℝ) • f - complexL g f) := by abel + _ = 0 := sub_eq_zero.mpr hh + have hef : u = f := sub_eq_zero.mp (shifted_complex_kernel g (by positivity) (u-f) hk) + rw [← hu2, hef] + rfl + exact congr_fun hfun v + +lemma shiftedOperator_bijective (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) : + Function.Bijective (D.shiftedOperator m) := + ⟨Function.LeftInverse.injective (D.completedResolvent_left m hm he), + Function.RightInverse.surjective (D.completedResolvent_equation m hm he)⟩ + + +theorem elliptic_estimate (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (u : D.localizers.Sobolev 2) : + ‖u‖ ≤ ‖D.completedResolvent m hm he‖ * + ((m^2 : ℝ) * ‖D.localizers.lower 2 0 u‖ + ‖D.completedL u‖) := by + calc + ‖u‖ = ‖D.completedResolvent m hm he (D.shiftedOperator m u)‖ := + congrArg norm (D.completedResolvent_left m hm he u).symm + _ ≤ ‖D.completedResolvent m hm he‖ * ‖D.shiftedOperator m u‖ := + (D.completedResolvent m hm he).le_opNorm _ + _ ≤ _ := by + apply mul_le_mul_of_nonneg_left _ (norm_nonneg (D.completedResolvent m hm he)) + change ‖(m^2 : ℝ) • D.localizers.lower 2 0 u - D.completedL u‖ ≤ _ + exact (norm_sub_le _ _).trans (by rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg (sq_nonneg m)]) + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/QuasiPSHLocalMean.lean b/lean/OAI/Geometry/PrescribedPotential/QuasiPSHLocalMean.lean new file mode 100644 index 0000000000000000000000000000000000000000..a1e27aff03326a0c9ce3509cf3a3dc6a276ea8d0 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/QuasiPSHLocalMean.lean @@ -0,0 +1,110 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.BallSubmean +import OAI.Geometry.PrescribedPotential.QuadraticContact + +namespace OAI + +/-! Quasi P S H Local Mean. -/ + +section + + + +noncomputable section +open Set Metric MeasureTheory +open scoped ContDiff InnerProductSpace +namespace PotentialABP +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] + [FiniteDimensional ℂ E] [MeasurableSpace E] [BorelSpace E] +local instance quasiPSHLocalMeanRealInnerProductSpace : InnerProductSpace ℝ E := + InnerProductSpace.rclikeToReal ℂ E + +omit [InnerProductSpace ℂ E] [FiniteDimensional ℂ E] [MeasurableSpace E] [BorelSpace E] in +lemma closedBall_small_center_subset {c y : E} {r : ℝ} (hy : y ∈ ball c r) : + closedBall y (2*r) ⊆ closedBall c (3*r) := by + intro x hx + have ht := dist_triangle x y c + have hy' : dist y c < r := hy + have hx' : dist x y ≤ 2*r := hx + change dist x c ≤ 3*r + linarith + +omit [InnerProductSpace ℂ E] [FiniteDimensional ℂ E] [MeasurableSpace E] [BorelSpace E] in +lemma ball_small_center_subset {c y : E} {r : ℝ} (hy : y ∈ ball c r) : + ball c r ⊆ ball y (2*r) := by + intro x hx + have ht := dist_triangle x c y + have hy' : dist c y < r := by simpa [dist_comm] using hy + have hx' : dist x c < r := hx + change dist x y < 2*r + linarith + + + +theorem quasiPSH_local_integral + {f : E → ℝ} (hf : ContDiff ℝ ∞ f) (c : E) {r C M : ℝ} + (hr : 0 < r) (hC : 0 ≤ C) + (hupper : ∀ x ∈ closedBall c (3*r), f x ≤ M) + (hlevi : ∀ x ∈ closedBall c (3*r), ∀ v : E, + -(4*C*‖v‖^2) ≤ fderiv ℝ (fderiv ℝ f) x v v + + fderiv ℝ (fderiv ℝ f) x (Complex.I • v) (Complex.I • v)) + {y : E} (hy : y ∈ ball c r) : + (∫ x in ball c r, M-f x) ≤ + volume.real (ball (0:E) (2*r)) * (M-f y+9*C*r^2) := by + let q : E → ℝ := fun x => C*‖x-c‖^2 + have hq : ContDiff ℝ ∞ q := contDiff_const.mul + ((contDiff_id.sub contDiff_const).norm_sq ℝ) + have hsub := closedBall_small_center_subset hy + have hmean := smooth_ball_submean (hf.add hq) y (by positivity : 0 ≤ 2*r) ?_ + · have hu : IntegrableOn (fun x => M-f x) (ball y (2*r)) := + ((continuous_const.sub hf.continuous).continuousOn.integrableOn_compact + (isCompact_closedBall y (2*r))).mono_set ball_subset_closedBall + have hfi : IntegrableOn f (ball y (2*r)) := + (hf.continuous.continuousOn.integrableOn_compact + (isCompact_closedBall y (2*r))).mono_set ball_subset_closedBall + have hqi : IntegrableOn q (ball y (2*r)) := + (hq.continuous.continuousOn.integrableOn_compact + (isCompact_closedBall y (2*r))).mono_set ball_subset_closedBall + have hvol : volume.real (ball y (2*r)) = volume.real (ball (0:E) (2*r)) := by + simpa only [setIntegral_const, smul_eq_mul, mul_one] using + (ball_integral_translate (fun _ : E => (1:ℝ)) y (2*r)).symm + have hqB : (∫ x in ball y (2*r), q x) ≤ + volume.real (ball (0:E) (2*r)) * (9*C*r^2) := by + have hm : (∫ x in ball y (2*r), q x) ≤ + ∫ _x in ball y (2*r), (9*C*r^2) := by + apply setIntegral_mono_on hqi (integrableOn_const (C := (9*C*r^2))) + isOpen_ball.measurableSet + intro x hx + have hb := hsub (ball_subset_closedBall hx) + have hn : ‖x-c‖ ≤ 3*r := by simpa [mem_closedBall, dist_eq_norm] using hb + have hs := (sq_le_sq₀ (norm_nonneg (x-c)) (by positivity : 0 ≤ 3*r)).mpr hn + change C*‖x-c‖^2 ≤ 9*C*r^2 + nlinarith [mul_le_mul_of_nonneg_left hs hC] + simpa only [setIntegral_const, smul_eq_mul, hvol] using hm + have hm : (∫ x in ball c r, M-f x) ≤ ∫ x in ball y (2*r), M-f x := by + apply setIntegral_mono_set hu _ (Filter.Eventually.of_forall (ball_small_center_subset hy)) + filter_upwards [ae_restrict_mem isOpen_ball.measurableSet] with x hx + exact sub_nonneg.mpr (hupper x (hsub (ball_subset_closedBall hx))) + have hic : IntegrableOn (fun _ : E => M) (ball y (2*r)) volume := + integrableOn_const (C := M) + apply hm.trans + rw [integral_sub hic hfi, + setIntegral_const, smul_eq_mul, hvol] + rw [integral_add hfi hqi] at hmean + have hq0 : 0 ≤ q y := mul_nonneg hC (sq_nonneg _) + have hV : 0 ≤ volume.real (ball (0:E) (2*r)) := ENNReal.toReal_nonneg + nlinarith [mul_nonneg hV hq0] + · intro x hx v + have h := hlevi x (hsub hx) v + change 0 ≤ fderiv ℝ (fderiv ℝ (fun x => f x + C*‖x-c‖^2)) x v v + + fderiv ℝ (fderiv ℝ (fun x => f x + C*‖x-c‖^2)) x (Complex.I • v) (Complex.I • v) + rw [quadratic_add_hessian hf, quadratic_add_hessian hf] + simp only [real_inner_self_eq_norm_sq, norm_smul, Complex.norm_I, one_mul] + linarith + +end PotentialABP + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/QuasilinearFamilyBootstrap.lean b/lean/OAI/Geometry/PrescribedPotential/QuasilinearFamilyBootstrap.lean new file mode 100644 index 0000000000000000000000000000000000000000..7fe407517877fd34670fb24e27392a507b54ebd5 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/QuasilinearFamilyBootstrap.lean @@ -0,0 +1,99 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.QuasilinearHighResiduals +import OAI.Geometry.PrescribedPotential.ResidualFamilyBootstrap + +namespace OAI + +/-! Quasilinear Family Bootstrap. -/ + +section + + + +noncomputable section +open Set Filter Topology Finset Module +open scoped ContDiff +namespace HigherJet +variable {E F G : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [NormedAddCommGroup F] [InnerProductSpace ℝ F] + [NormedAddCommGroup G] [NormedSpace ℝ G] + [FiniteDimensional ℝ E] [FiniteDimensional ℝ F] + {ι α : Type*} [Fintype ι] + +local instance hessianNormedAdd : NormedAddCommGroup (E →L[ℝ] E →L[ℝ] F) := inferInstance +local instance hessianNormedSpace : NormedSpace ℝ (E →L[ℝ] E →L[ℝ] F) := inferInstance + +lemma energy_bounds_finite_norms {U : Set E} (hU : IsOpen U) (e : OrthonormalBasis ι ℝ E) + {u : α → E → F} (hu : ∀ a, ContDiffOn ℝ ∞ (u a) U) {K : Set E} (hKU : K ⊆ U) + (m : ℕ) (hlo : ∀ j, 1 ≤ j → j < m → EnergyBound (fun j a x => jetEnergy e j (u a) x) j K) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ j, 1 ≤ j → j < m → ∀ a x, x ∈ K → ‖iteratedFDeriv ℝ j (u a) x‖ ≤ C := by + classical + have he (j : Fin m) : ∃ C : ℝ, 0 ≤ C ∧ (1 ≤ j.val → ∀ a x, x ∈ K → ‖iteratedFDeriv ℝ j.val (u a) x‖ ≤ C) := by + by_cases hj : 1 ≤ j.val + · obtain ⟨R,hR,hr⟩ := hlo j hj j.isLt + obtain ⟨C,hC,hc⟩ := norm_iteratedFDeriv_le_jetEnergy (F := F) e.toBasis j.val + exact ⟨C*Real.sqrt R,by positivity,fun _ a x hx => (hc U hU (u a) (hu a) x (hKU hx)).trans + (mul_le_mul_of_nonneg_left (Real.sqrt_le_sqrt (hr a x hx)) hC.le)⟩ + · exact ⟨0,le_rfl,fun h => False.elim (hj h)⟩ + choose C hC hc using he + refine ⟨∑ j, C j,Finset.sum_nonneg (fun j _ => hC j),fun j hj hjm a x hx => ?_⟩ + exact (hc ⟨j,hjm⟩ hj a x hx).trans (Finset.single_le_sum (fun i _ => hC i) (Finset.mem_univ _)) + +lemma quasilinear_family_bootstrap (B : G →L[ℝ] (E →L[ℝ] E →L[ℝ] F) →L[ℝ] F) + {U : Set E} (hU : IsOpen U) (e : OrthonormalBasis ι ℝ E) + (u r : α → E → F) (a : F → G) (b : F × (E →L[ℝ] F) → F) + (τ : α → E → E ≃L[ℝ] E) + (hu : ∀ s, ContDiffOn ℝ ∞ (u s) U) (hr : ∀ s, ContDiffOn ℝ ∞ (r s) U) + (ha : ∀ s y, y ∈ U → ContDiffAt ℝ ∞ a (u s y)) + (hb : ∀ s y, y ∈ U → ContDiffAt ℝ ∞ b (firstJet (u s) y)) + (heq : ∀ s y, y ∈ U → B (a (u s y)) (hessian (u s) y) = r s y+b (firstJet (u s) y)) + (hframe : ∀ s x, x ∈ U → ∀ H : E →L[ℝ] E →L[ℝ] F, + B (a (u s x)) H = ∑ i, H (τ s x (e i)) (τ s x (e i))) + (hframes : ∀ K, IsCompact K → K ⊆ U → ∃ C : ℝ, 0 ≤ C ∧ ∀ s x, x ∈ K → + ‖(τ s x).toContinuousLinearMap‖ ≤ C ∧ ‖(τ s x).symm.toContinuousLinearMap‖ ≤ C) + (hcoeff : ∀ m K, IsCompact K → K ⊆ U → ∃ C : ℝ, 1 ≤ C ∧ ‖B‖ ≤ C ∧ + (∀ j, j ≤ m → (Fintype.card (OrderedFinpartition j) : ℝ) ≤ C) ∧ ∀ s x, x ∈ K → + ‖iteratedFDeriv ℝ 1 (u s) x‖ ≤ C ∧ + (∀ j, j ≤ m → ‖iteratedFDeriv ℝ j a (u s x)‖ ≤ C) ∧ + (∀ j, j ≤ m → ‖iteratedFDeriv ℝ j b (firstJet (u s) x)‖ ≤ C) ∧ + (∀ j, j ≤ m → ‖iteratedFDeriv ℝ j (r s) x‖ ≤ C)) : + ∀ m, 1 ≤ m → ∀ K, IsCompact K → K ⊆ U → + ∃ C : ℝ, 0 ≤ C ∧ ∀ s x, x ∈ K → ‖iteratedFDeriv ℝ m (u s) x‖ ≤ C := by + apply residual_family_bootstrap hU e u τ hu hframes + · intro K hK hKU + obtain ⟨C,hC,_,_,hc⟩ := hcoeff 1 K hK hKU + exact ⟨C,by linarith,fun s x hx => (hc s x hx).1⟩ + · intro K hK hKU + obtain ⟨C,hC,hB,hP,hc⟩ := hcoeff 2 K hK hKU + have hC0 : 0 ≤ C := by linarith + let R1 := 2*C+C^2+C^3 + let R2 := C+3*C^2+5*C^3+C^4+C^5 + have hR1 : 0 ≤ R1 := by dsimp [R1]; positivity + have hR2 : 0 ≤ R2 := by dsimp [R2]; positivity + refine ⟨R1+R2,add_nonneg hR1 hR2,fun s x hx => ?_⟩ + obtain ⟨hl1,hl2⟩ := quasilinear_low_residuals B hU (hu s) (hr s) (ha s) (hb s) + (heq s) (hKU hx) (fun i => τ s x (e i)) (hframe s x (hKU hx)) e hC0 hB (hP 2 le_rfl) + (hc s x hx).1 (hc s x hx).2.1 (hc s x hx).2.2.1 (hc s x hx).2.2.2 + exact ⟨fun σ => (hl1 σ).trans (mul_le_mul_of_nonneg_right (le_add_of_nonneg_right hR2) (by positivity)), + fun σ => (hl2 σ).trans (mul_le_mul_of_nonneg_right (le_add_of_nonneg_left hR1) (by positivity))⟩ + · intro m hm K hK hKU hlo + obtain ⟨C0,hC0,hB,hP,hc⟩ := hcoeff m K hK hKU + obtain ⟨C1,hC1,hlo'⟩ := energy_bounds_finite_norms hU e hu hKU m hlo + let C := C0+C1 + have hC : 1 ≤ C := by dsimp [C]; linarith + have hc0 : C0 ≤ C := by dsimp [C]; linarith + have hc1 : C1 ≤ C := by dsimp [C]; linarith + refine ⟨C+C^(m+2)*C+C*2^m*C^(m+2)*C,by + have hCnonneg : 0 ≤ C := by linarith + positivity,fun s x hx => ?_⟩ + exact quasilinear_high_residual B hU (hu s) (hr s) (ha s) (hb s) (heq s) (hKU hx) + (fun i => τ s x (e i)) (hframe s x (hKU hx)) e hm hC (hB.trans hc0) + (fun j hj => (hP j hj).trans hc0) (fun j hj hjm => (hlo' j hj hjm s x hx).trans hc1) + (fun j hj => ((hc s x hx).2.1 j hj).trans hc0) + (fun j hj => ((hc s x hx).2.2.1 j hj).trans hc0) (((hc s x hx).2.2.2 m le_rfl).trans hc0) +end HigherJet + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/QuasilinearHighResiduals.lean b/lean/OAI/Geometry/PrescribedPotential/QuasilinearHighResiduals.lean new file mode 100644 index 0000000000000000000000000000000000000000..60a3764ffae5e6d0c2850c3b52323362ac610de0 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/QuasilinearHighResiduals.lean @@ -0,0 +1,146 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.HigherJetComposition +import OAI.Geometry.PrescribedPotential.QuasilinearLowResiduals + +namespace OAI + +/-! Quasilinear High Residuals. -/ + +section + + + +noncomputable section +open Set Filter Topology Finset +open scoped ContDiff +namespace HigherJet +variable {E F G : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [NormedAddCommGroup F] [InnerProductSpace ℝ F] + [NormedAddCommGroup G] [NormedSpace ℝ G] +local instance highHessianNormed : NormedAddCommGroup (E →L[ℝ] E →L[ℝ] F) := inferInstance +local instance highHessianSpace : NormedSpace ℝ (E →L[ℝ] E →L[ℝ] F) := inferInstance + +lemma coefficient_prefactor {m i : ℕ} (hi : i ≤ m) {C : ℝ} (hC : 1 ≤ C) + (hP : (Fintype.card (OrderedFinpartition i) : ℝ) ≤ C) : + (Fintype.card (OrderedFinpartition i) : ℝ)*C*C^i ≤ C^(m+2) := by + calc + _ ≤ C*C*C^i := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right hP (by linarith)) (by positivity) + _ = C^(i+2) := by ring + _ ≤ C^(m+2) := pow_le_pow_right₀ hC (by omega) + +lemma high_coefficient_bounds {u : E → F} {a : F → G} {b : F × (E →L[ℝ] F) → F} {x : E} + (hu : ContDiffAt ℝ ∞ u x) (ha : ContDiffAt ℝ ∞ a (u x)) + (hb : ContDiffAt ℝ ∞ b (firstJet u x)) {m : ℕ} (hm : 3 ≤ m) {C : ℝ} (hC : 1 ≤ C) + (hP : ∀ i, i ≤ m → (Fintype.card (OrderedFinpartition i) : ℝ) ≤ C) + (hulow : ∀ j, 0 < j → j < m → ‖iteratedFDeriv ℝ j u x‖ ≤ C) + (haj : ∀ j, j ≤ m → ‖iteratedFDeriv ℝ j a (u x)‖ ≤ C) + (hbj : ∀ j, j ≤ m → ‖iteratedFDeriv ℝ j b (firstJet u x)‖ ≤ C) : + (∀ i, 0 < i → i < m → ‖iteratedFDeriv ℝ i (a ∘ u) x‖ ≤ C^(m+2)) ∧ + ‖iteratedFDeriv ℝ m (a ∘ u) x‖ ≤ C^(m+2)*(1+‖iteratedFDeriv ℝ m u x‖) ∧ + ‖iteratedFDeriv ℝ m (b ∘ firstJet u) x‖ ≤ + C^(m+2)*C*(1+‖iteratedFDeriv ℝ m u x‖+‖iteratedFDeriv ℝ (m+1) u x‖) := by + have hC0 : 0 ≤ C := by linarith + refine ⟨?_,?_,?_⟩ + · intro i hi him + have h := composition_top_jet_bound hu ha (m := i) (r := i+1) (by omega) hC + (show (1:ℝ) ≤ 1 by rfl) hC0 + (fun j hj hji => hulow j hj (by omega)) + (fun j hj hji => by omega) (fun j hj => haj j (by omega)) + simpa only [mul_one] using h.trans (by simpa only [mul_one] using coefficient_prefactor (Nat.le_of_lt him) hC (hP i (Nat.le_of_lt him))) + · exact (composition_top_jet_bound hu ha (m := m) (r := m) (by omega) hC + (le_add_of_nonneg_right (norm_nonneg _)) hC0 hulow + (fun j hj hjm => by + have he : j=m := by omega + rw [he] + exact le_add_of_nonneg_left zero_le_one) + haj).trans (mul_le_mul_of_nonneg_right (coefficient_prefactor (le_refl m) hC (hP m le_rfl)) (by positivity)) + · let T := C+‖iteratedFDeriv ℝ m u x‖+‖iteratedFDeriv ℝ (m+1) u x‖ + have hT : 1 ≤ T := by dsimp [T]; linarith [norm_nonneg (iteratedFDeriv ℝ m u x),norm_nonneg (iteratedFDeriv ℝ (m+1) u x)] + have hlow (j : ℕ) (hj : 0 < j) (hjm : j < m-1) : ‖iteratedFDeriv ℝ j (firstJet u) x‖ ≤ C := by + rw [norm_firstJet_deriv hu] + exact max_le (hulow j hj (by omega)) (hulow (j+1) (by omega) (by omega)) + have hhigh (j : ℕ) (hj : m-1 ≤ j) (hjm : j ≤ m) : ‖iteratedFDeriv ℝ j (firstJet u) x‖ ≤ T := by + rw [norm_firstJet_deriv hu] + by_cases he : j=m + · subst j + dsimp [T] + exact max_le (by linarith [norm_nonneg (iteratedFDeriv ℝ (m+1) u x)]) (by linarith [norm_nonneg (iteratedFDeriv ℝ m u x)]) + · have he : j+1=m := by omega + rw [he] + dsimp [T] + exact max_le ((hulow j (by omega) (by omega)).trans (by linarith [norm_nonneg (iteratedFDeriv ℝ m u x),norm_nonneg (iteratedFDeriv ℝ (m+1) u x)])) + (by linarith [norm_nonneg (iteratedFDeriv ℝ (m+1) u x)]) + apply (composition_top_jet_bound (firstJet_smoothAt hu) hb (r := m-1) (by omega) hC hT hC0 hlow hhigh hbj).trans + have ht : T ≤ C*(1+‖iteratedFDeriv ℝ m u x‖+‖iteratedFDeriv ℝ (m+1) u x‖) := by + dsimp [T] + nlinarith only [mul_nonneg (by linarith : 0 ≤ C-1) (norm_nonneg (iteratedFDeriv ℝ m u x)), + mul_nonneg (by linarith : 0 ≤ C-1) (norm_nonneg (iteratedFDeriv ℝ (m+1) u x))] + exact (mul_le_mul (coefficient_prefactor (le_refl m) hC (hP m le_rfl)) ht (by linarith) (by positivity)).trans_eq (by ring) + +variable {ι : Type*} [Fintype ι] +lemma quasilinear_high_residual (B : G →L[ℝ] (E →L[ℝ] E →L[ℝ] F) →L[ℝ] F) + {U : Set E} (hU : IsOpen U) {u r : E → F} {a : F → G} {b : F × (E →L[ℝ] F) → F} + (hu : ContDiffOn ℝ ∞ u U) (hr : ContDiffOn ℝ ∞ r U) + (ha : ∀ y ∈ U, ContDiffAt ℝ ∞ a (u y)) + (hb : ∀ y ∈ U, ContDiffAt ℝ ∞ b (firstJet u y)) + (heq : ∀ y ∈ U, B (a (u y)) (hessian u y) = r y+b (firstJet u y)) + {x : E} (hx : x ∈ U) (v : ι → E) + (hframe : ∀ H : E →L[ℝ] E →L[ℝ] F, B (a (u x)) H = ∑ i, H (v i) (v i)) + (e : OrthonormalBasis ι ℝ E) {m : ℕ} (hm : 3 ≤ m) {C : ℝ} (hC : 1 ≤ C) (hB : ‖B‖ ≤ C) + (hP : ∀ i, i ≤ m → (Fintype.card (OrderedFinpartition i) : ℝ) ≤ C) + (hulow : ∀ j, 0 < j → j < m → ‖iteratedFDeriv ℝ j u x‖ ≤ C) + (haj : ∀ j, j ≤ m → ‖iteratedFDeriv ℝ j a (u x)‖ ≤ C) + (hbj : ∀ j, j ≤ m → ‖iteratedFDeriv ℝ j b (firstJet u x)‖ ≤ C) + (hrj : ‖iteratedFDeriv ℝ m r x‖ ≤ C) : + ∀ σ : Fin m → ι, ‖frameLaplace v (jetFamily e m u σ) x‖ ≤ + (C+C^(m+2)*C+C*2^m*C^(m+2)*C)*(1+‖iteratedFDeriv ℝ m u x‖+‖iteratedFDeriv ℝ (m+1) u x‖) := by + have hC0 : 0 ≤ C := by linarith + have hac : ContDiffOn ℝ ∞ (a ∘ u) U := fun y hy => ((ha y hy).comp y (hu.contDiffAt (hU.mem_nhds hy))).contDiffWithinAt + have hbc : ContDiffOn ℝ ∞ (b ∘ firstJet u) U := fun y hy => ((hb y hy).comp y (firstJet_smoothAt (hu.contDiffAt (hU.mem_nhds hy)))).contDiffWithinAt + obtain ⟨halow,hatop,hbtop⟩ := high_coefficient_bounds (hu.contDiffAt (hU.mem_nhds hx)) (ha x hx) (hb x hx) hm hC hP hulow haj hbj + let T := 1+‖iteratedFDeriv ℝ m u x‖+‖iteratedFDeriv ℝ (m+1) u x‖ + have hT : 1 ≤ T := by dsimp [T]; linarith [norm_nonneg (iteratedFDeriv ℝ m u x),norm_nonneg (iteratedFDeriv ℝ (m+1) u x)] + have hprod (i : ℕ) (hi : 0 < i) (him : i ≤ m) : + ‖iteratedFDeriv ℝ i (a ∘ u) x‖*‖iteratedFDeriv ℝ (m-i) (hessian u) x‖ ≤ (C^(m+2)*C)*T := by + rw [norm_hessian_deriv] + by_cases he : i=m + · subst i + have hm2 : m-m+2=2 := by omega + rw [hm2] + have h2 := hulow 2 (by decide) (by omega) + have hh : 1+‖iteratedFDeriv ℝ m u x‖ ≤ T := by dsimp [T]; exact le_add_of_nonneg_right (norm_nonneg _) + calc + _ ≤ (C^(m+2)*(1+‖iteratedFDeriv ℝ m u x‖))*C := mul_le_mul hatop h2 (norm_nonneg _) (by positivity) + _ = (C^(m+2)*C)*(1+‖iteratedFDeriv ℝ m u x‖) := by ring + _ ≤ _ := mul_le_mul_of_nonneg_left hh (by positivity) + · have hi' : i < m := by omega + have hh : ‖iteratedFDeriv ℝ (m-i+2) u x‖ ≤ C*T := by + by_cases h1 : i=1 + · subst i + have he : m-1+2=m+1 := by omega + rw [he] + exact (show ‖iteratedFDeriv ℝ (m+1) u x‖ ≤ T by dsimp [T]; linarith [norm_nonneg (iteratedFDeriv ℝ m u x)]).trans (le_mul_of_one_le_left (by linarith) hC) + · by_cases h2 : i=2 + · subst i + have he : m-2+2=m := by omega + rw [he] + exact (show ‖iteratedFDeriv ℝ m u x‖ ≤ T by dsimp [T]; linarith [norm_nonneg (iteratedFDeriv ℝ (m+1) u x)]).trans (le_mul_of_one_le_left (by linarith) hC) + · exact (hulow _ (by omega) (by omega)).trans (le_mul_of_one_le_right hC0 hT) + exact (mul_le_mul (halow i hi hi') hh (norm_nonneg _) (by positivity)).trans_eq (by ring) + have hcomm := frozen_product_tame_bound B hU hac (hessian_smoothOn hU hu) hx m + (show 0 ≤ C^(m+2)*C by positivity) (show 0 ≤ T by linarith) hprod + intro σ + have hnorm := (frozen_equation_jet_norm B hU hu (hr.add hbc) hac heq hx v hframe e m σ).trans + (add_le_add (norm_iteratedFDeriv_add_le (hr.contDiffAt (hU.mem_nhds hx)) (hbc.contDiffAt (hU.mem_nhds hx)) m) le_rfl) + have hcomm' : ‖iteratedFDeriv ℝ m (fun y => B (a (u y)-a (u x)) (hessian u y)) x‖ ≤ (C*2^m*C^(m+2)*C)*T := + hcomm.trans (by nlinarith only [mul_le_mul_of_nonneg_right hB (show 0 ≤ 2^m*(C^(m+2)*C)*T by positivity)]) + have hr' : ‖iteratedFDeriv ℝ m r x‖ ≤ C*T := hrj.trans (le_mul_of_one_le_right hC0 hT) + change _ ≤ (C+C^(m+2)*C+C*2^m*C^(m+2)*C)*T + change _ ≤ C^(m+2)*C*T at hbtop + exact (hnorm.trans (add_le_add (add_le_add hr' hbtop) hcomm')).trans_eq (by ring) +end HigherJet + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/QuasilinearJetBasics.lean b/lean/OAI/Geometry/PrescribedPotential/QuasilinearJetBasics.lean new file mode 100644 index 0000000000000000000000000000000000000000..9eaf604ecfa1aeb56ac11931b10427b9d261eeae --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/QuasilinearJetBasics.lean @@ -0,0 +1,95 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.FrozenEllipticJets +import OAI.Geometry.PrescribedPotential.HigherJetCommutator + +namespace OAI + +/-! Quasilinear Jet Basics. -/ + +section + + +noncomputable section +open Set Filter Topology Finset +open scoped ContDiff +namespace HigherJet +variable {E F G : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] + [NormedAddCommGroup G] [NormedSpace ℝ G] + +def firstJet (u : E → F) (x : E) : F × (E →L[ℝ] F) := (u x,fderiv ℝ u x) +lemma firstJet_smoothOn {U : Set E} (hU : IsOpen U) {u : E → F} + (hu : ContDiffOn ℝ ∞ u U) : ContDiffOn ℝ ∞ (firstJet u) U := + hu.prodMk (hu.fderiv_of_isOpen hU (m := ∞) (by simp)) +lemma firstJet_smoothAt {u : E → F} {x : E} (hu : ContDiffAt ℝ ∞ u x) : + ContDiffAt ℝ ∞ (firstJet u) x := hu.prodMk (hu.fderiv_right (m := ∞) (by simp)) +lemma norm_firstJet_deriv {u : E → F} {x : E} (hu : ContDiffAt ℝ ∞ u x) (m : ℕ) : + ‖iteratedFDeriv ℝ m (firstJet u) x‖ = + max ‖iteratedFDeriv ℝ m u x‖ ‖iteratedFDeriv ℝ (m+1) u x‖ := by + change ‖iteratedFDeriv ℝ m (fun y => (u y,fderiv ℝ u y)) x‖ = _ + rw [iteratedFDeriv_prodMk hu (hu.fderiv_right (m := ∞) (by simp)) + (show (m:ℕ∞ω) ≤ ∞ from WithTop.coe_le_coe.mpr le_top), + ContinuousMultilinearMap.opNorm_prod,norm_iteratedFDeriv_fderiv] +lemma composition_first_jet_bound {f : E → F} {g : F → G} {x : E} + (hf : ContDiffAt ℝ ∞ f x) (hg : ContDiffAt ℝ ∞ g (f x)) : + ‖iteratedFDeriv ℝ 1 (g ∘ f) x‖ ≤ + ‖iteratedFDeriv ℝ 1 g (f x)‖*‖iteratedFDeriv ℝ 1 f x‖ := by + simp only [norm_iteratedFDeriv_one] + rw [fderiv_comp x (hg.differentiableAt (by simp)) (hf.differentiableAt (by simp))] + exact ContinuousLinearMap.opNorm_comp_le _ _ + + + +lemma compact_coefficient_jets {K : Set F} (hK : IsCompact K) {a : F → G} + (ha : ∀ y ∈ K, ContDiffAt ℝ ∞ a y) (m : ℕ) : + ∃ C : ℝ, 1 ≤ C ∧ ∀ j, j ≤ m → ∀ y ∈ K, ‖iteratedFDeriv ℝ j a y‖ ≤ C := by + have hb (j : ℕ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ y ∈ K, ‖iteratedFDeriv ℝ j a y‖ ≤ C := by + obtain ⟨C,hC⟩ := hK.exists_bound_of_continuousOn (fun y hy => + ((ha y hy).iteratedFDeriv_right (m := ∞) (i := j) + (by exact WithTop.coe_le_coe.mpr le_top)).continuousAt.continuousWithinAt) + exact ⟨max C 0,le_max_right _ _,fun y hy => (hC y hy).trans (le_max_left _ _)⟩ + choose C hC hb using hb + refine ⟨1+∑ j ∈ range (m+1), C j,le_add_of_nonneg_right (Finset.sum_nonneg (fun j _ => hC j)),?_⟩ + intro j hj y hy + exact (hb j y hy).trans ((Finset.single_le_sum (fun i _ => hC i) + (mem_range.mpr (by omega))).trans (le_add_of_nonneg_left zero_le_one)) + +end HigherJet +namespace HigherJet +variable {E F G : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [InnerProductSpace ℝ F] + [NormedAddCommGroup G] [NormedSpace ℝ G] +lemma norm_hessian_deriv (u : E → F) (x : E) (m : ℕ) : + ‖iteratedFDeriv ℝ m (hessian u) x‖ = ‖iteratedFDeriv ℝ (m+2) u x‖ := by + simp only [hessian,norm_iteratedFDeriv_fderiv] + +local instance hessianNormed : NormedAddCommGroup (E →L[ℝ] E →L[ℝ] F) := inferInstance +local instance hessianSpace : NormedSpace ℝ (E →L[ℝ] E →L[ℝ] F) := inferInstance + +lemma frozen_first_bound (B : G →L[ℝ] (E →L[ℝ] E →L[ℝ] F) →L[ℝ] F) + {U : Set E} (hU : IsOpen U) {u : E → F} {a : E → G} + (hu : ContDiffOn ℝ ∞ u U) (ha : ContDiffOn ℝ ∞ a U) {x : E} (hx : x ∈ U) : + ‖iteratedFDeriv ℝ 1 (fun y => B (a y-a x) (hessian u y)) x‖ ≤ + ‖B‖*‖iteratedFDeriv ℝ 1 a x‖*‖iteratedFDeriv ℝ 2 u x‖ := by + have h := frozen_product_jet_bound B hU ha (hessian_smoothOn hU hu) hx 1 + simpa only [Finset.sum_range_succ,Finset.sum_range_zero,Nat.choose_zero_right, + Nat.choose_self,Nat.cast_one,ite_true,one_mul,zero_mul,zero_add,ite_false, + Nat.reduceSub,norm_hessian_deriv,Nat.reduceAdd,show ¬ (1 : ℕ) = 0 from by decide,mul_assoc] using h + +lemma frozen_second_bound (B : G →L[ℝ] (E →L[ℝ] E →L[ℝ] F) →L[ℝ] F) + {U : Set E} (hU : IsOpen U) {u : E → F} {a : E → G} + (hu : ContDiffOn ℝ ∞ u U) (ha : ContDiffOn ℝ ∞ a U) {x : E} (hx : x ∈ U) : + ‖iteratedFDeriv ℝ 2 (fun y => B (a y-a x) (hessian u y)) x‖ ≤ + ‖B‖*(2*‖iteratedFDeriv ℝ 1 a x‖*‖iteratedFDeriv ℝ 3 u x‖+ + ‖iteratedFDeriv ℝ 2 a x‖*‖iteratedFDeriv ℝ 2 u x‖) := by + have h := frozen_product_jet_bound B hU ha (hessian_smoothOn hU hu) hx 2 + norm_num only [Finset.sum_range_succ,Finset.sum_range_zero,Nat.choose_zero_right, + Nat.choose_self,Nat.choose_one_right,ite_true,one_mul,zero_mul,zero_add,ite_false, + Nat.reduceSub,norm_hessian_deriv,not_false_eq_true,Nat.cast_one,Nat.cast_ofNat] at h + exact h +end HigherJet + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/QuasilinearLowResiduals.lean b/lean/OAI/Geometry/PrescribedPotential/QuasilinearLowResiduals.lean new file mode 100644 index 0000000000000000000000000000000000000000..a395a1223aa66be72aaa7eb52eb0453d7a7915aa --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/QuasilinearLowResiduals.lean @@ -0,0 +1,137 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.DirectionalJetEnergy +import OAI.Geometry.PrescribedPotential.QuasilinearJetBasics +import OAI.Geometry.PrescribedPotential.QuasilinearResidualAlgebra +import OAI.Geometry.PrescribedPotential.SecondJetComposition + +namespace OAI + +/-! Quasilinear Low Residuals. -/ + +section + + + +noncomputable section +open Set Filter Topology Finset +open scoped ContDiff +namespace HigherJet +variable {E F G : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [NormedAddCommGroup F] [InnerProductSpace ℝ F] + [NormedAddCommGroup G] [NormedSpace ℝ G] +local instance lowHessianNormed : NormedAddCommGroup (E →L[ℝ] E →L[ℝ] F) := inferInstance +local instance lowHessianSpace : NormedSpace ℝ (E →L[ℝ] E →L[ℝ] F) := inferInstance + +lemma norm_iteratedFDeriv_add_le {f g : E → F} {x : E} + (hf : ContDiffAt ℝ ∞ f x) (hg : ContDiffAt ℝ ∞ g x) (m : ℕ) : + ‖iteratedFDeriv ℝ m (fun y => f y+g y) x‖ ≤ + ‖iteratedFDeriv ℝ m f x‖+‖iteratedFDeriv ℝ m g x‖ := by + change ‖iteratedFDeriv ℝ m (f+g) x‖ ≤ _ + rw [iteratedFDeriv_add_apply (hf.of_le (show (m:ℕ∞ω) ≤ ∞ from WithTop.coe_le_coe.mpr le_top)) + (hg.of_le (show (m:ℕ∞ω) ≤ ∞ from WithTop.coe_le_coe.mpr le_top))] + exact norm_add_le _ _ + +lemma low_coefficient_bounds {u : E → F} {a : F → G} {b : F × (E →L[ℝ] F) → F} {x : E} + (hu : ContDiffAt ℝ ∞ u x) (ha : ContDiffAt ℝ ∞ a (u x)) + (hb : ContDiffAt ℝ ∞ b (firstJet u x)) {C : ℝ} (hC : 0 ≤ C) + (hP : (Fintype.card (OrderedFinpartition 2) : ℝ) ≤ C) + (hu1 : ‖iteratedFDeriv ℝ 1 u x‖ ≤ C) + (haj : ∀ j, j ≤ 2 → ‖iteratedFDeriv ℝ j a (u x)‖ ≤ C) + (hbj : ∀ j, j ≤ 2 → ‖iteratedFDeriv ℝ j b (firstJet u x)‖ ≤ C) : + ‖iteratedFDeriv ℝ 1 (a ∘ u) x‖ ≤ C^2 ∧ + ‖iteratedFDeriv ℝ 2 (a ∘ u) x‖ ≤ C^2*(‖iteratedFDeriv ℝ 2 u x‖+C^2) ∧ + ‖iteratedFDeriv ℝ 1 (b ∘ firstJet u) x‖ ≤ C*(C+‖iteratedFDeriv ℝ 2 u x‖) ∧ + ‖iteratedFDeriv ℝ 2 (b ∘ firstJet u) x‖ ≤ C^2*(‖iteratedFDeriv ℝ 2 u x‖+ + ‖iteratedFDeriv ℝ 3 u x‖+(C+‖iteratedFDeriv ℝ 2 u x‖)^2) := by + have hPC : (Fintype.card (OrderedFinpartition 2) : ℝ)*C ≤ C^2 := by + nlinarith only [mul_le_mul_of_nonneg_right hP hC] + have hf1 : ‖iteratedFDeriv ℝ 1 (firstJet u) x‖ ≤ C+‖iteratedFDeriv ℝ 2 u x‖ := by + rw [norm_firstJet_deriv hu] + exact max_le ((hu1.trans (le_add_of_nonneg_right (norm_nonneg _)))) + (le_add_of_nonneg_left hC) + have hf2 : ‖iteratedFDeriv ℝ 2 (firstJet u) x‖ ≤ ‖iteratedFDeriv ℝ 2 u x‖+‖iteratedFDeriv ℝ 3 u x‖ := by + rw [norm_firstJet_deriv hu] + exact max_le (le_add_of_nonneg_right (norm_nonneg _)) (le_add_of_nonneg_left (norm_nonneg _)) + refine ⟨?_,?_,?_,?_⟩ + · exact (composition_first_jet_bound hu ha).trans (by + simpa only [pow_two] using mul_le_mul (haj 1 (by decide)) hu1 (norm_nonneg _) hC) + · exact (composition_second_jet_bound hu ha hC haj).trans + (mul_le_mul hPC (add_le_add le_rfl (pow_le_pow_left₀ (norm_nonneg _) hu1 2)) + (by positivity) (sq_nonneg C)) + · exact (composition_first_jet_bound (firstJet_smoothAt hu) hb).trans + (mul_le_mul (hbj 1 (by decide)) hf1 (norm_nonneg _) hC) + · exact (composition_second_jet_bound (firstJet_smoothAt hu) hb hC hbj).trans + (mul_le_mul hPC (add_le_add hf2 (pow_le_pow_left₀ (norm_nonneg _) hf1 2)) + (by positivity) (sq_nonneg C)) + +variable {ι : Type*} [Fintype ι] +lemma frozen_equation_jet_norm (B : G →L[ℝ] (E →L[ℝ] E →L[ℝ] F) →L[ℝ] F) + {U : Set E} (hU : IsOpen U) {u r : E → F} {a : E → G} + (hu : ContDiffOn ℝ ∞ u U) (hr : ContDiffOn ℝ ∞ r U) + (ha : ContDiffOn ℝ ∞ a U) (heq : ∀ y ∈ U, B (a y) (hessian u y) = r y) + {x : E} (hx : x ∈ U) (v : ι → E) + (hframe : ∀ H : E →L[ℝ] E →L[ℝ] F, B (a x) H = ∑ i, H (v i) (v i)) + (e : OrthonormalBasis ι ℝ E) (m : ℕ) (σ : Fin m → ι) : + ‖frameLaplace v (jetFamily e m u σ) x‖ ≤ ‖iteratedFDeriv ℝ m r x‖+ + ‖iteratedFDeriv ℝ m (fun y => B (a y-a x) (hessian u y)) x‖ := by + unfold jetFamily + rw [frozen_equation_word B hU hu hr ha heq hx v hframe] + apply (norm_sub_le _ _).trans + apply add_le_add + · simpa only [Function.comp_def,e.norm_eq_one,Finset.prod_const_one,mul_one] using + norm_word_ofFn_le hU hr m (fun i => e (σ i)) hx + · simpa only [Function.comp_def,e.norm_eq_one,Finset.prod_const_one,mul_one] using + norm_word_ofFn_le hU ((B.contDiff.comp_contDiffOn (ha.sub contDiffOn_const)).clm_apply + (hessian_smoothOn hU hu)) m (fun i => e (σ i)) hx + +lemma quasilinear_low_residuals (B : G →L[ℝ] (E →L[ℝ] E →L[ℝ] F) →L[ℝ] F) + {U : Set E} (hU : IsOpen U) {u r : E → F} {a : F → G} {b : F × (E →L[ℝ] F) → F} + (hu : ContDiffOn ℝ ∞ u U) (hr : ContDiffOn ℝ ∞ r U) + (ha : ∀ y ∈ U, ContDiffAt ℝ ∞ a (u y)) + (hb : ∀ y ∈ U, ContDiffAt ℝ ∞ b (firstJet u y)) + (heq : ∀ y ∈ U, B (a (u y)) (hessian u y) = r y+b (firstJet u y)) + {x : E} (hx : x ∈ U) (v : ι → E) + (hframe : ∀ H : E →L[ℝ] E →L[ℝ] F, B (a (u x)) H = ∑ i, H (v i) (v i)) + (e : OrthonormalBasis ι ℝ E) {C : ℝ} (hC : 0 ≤ C) (hB : ‖B‖ ≤ C) + (hP : (Fintype.card (OrderedFinpartition 2) : ℝ) ≤ C) + (hu1 : ‖iteratedFDeriv ℝ 1 u x‖ ≤ C) + (haj : ∀ j, j ≤ 2 → ‖iteratedFDeriv ℝ j a (u x)‖ ≤ C) + (hbj : ∀ j, j ≤ 2 → ‖iteratedFDeriv ℝ j b (firstJet u x)‖ ≤ C) + (hrj : ∀ j, j ≤ 2 → ‖iteratedFDeriv ℝ j r x‖ ≤ C) : + (∀ σ : Fin 1 → ι, ‖frameLaplace v (jetFamily e 1 u σ) x‖ ≤ + (2*C+C^2+C^3)*(1+‖iteratedFDeriv ℝ 2 u x‖)) ∧ + (∀ σ : Fin 2 → ι, ‖frameLaplace v (jetFamily e 2 u σ) x‖ ≤ + (C+3*C^2+5*C^3+C^4+C^5)*(1+‖iteratedFDeriv ℝ 2 u x‖^2+‖iteratedFDeriv ℝ 3 u x‖)) := by + have hac : ContDiffOn ℝ ∞ (a ∘ u) U := fun y hy => + ((ha y hy).comp y (hu.contDiffAt (hU.mem_nhds hy))).contDiffWithinAt + have hbc : ContDiffOn ℝ ∞ (b ∘ firstJet u) U := fun y hy => + ((hb y hy).comp y (firstJet_smoothAt (hu.contDiffAt (hU.mem_nhds hy)))).contDiffWithinAt + obtain ⟨ha1,ha2,hb1,hb2⟩ := low_coefficient_bounds (hu.contDiffAt (hU.mem_nhds hx)) + (ha x hx) (hb x hx) hC hP hu1 haj hbj + have hnorm (m : ℕ) (σ : Fin m → ι) : ‖frameLaplace v (jetFamily e m u σ) x‖ ≤ + ‖iteratedFDeriv ℝ m r x‖+‖iteratedFDeriv ℝ m (b ∘ firstJet u) x‖+ + ‖iteratedFDeriv ℝ m (fun y => B (a (u y)-a (u x)) (hessian u y)) x‖ := by + exact (frozen_equation_jet_norm B hU hu (hr.add hbc) hac heq hx v hframe e m σ).trans + (add_le_add (norm_iteratedFDeriv_add_le (hr.contDiffAt (hU.mem_nhds hx)) + (hbc.contDiffAt (hU.mem_nhds hx)) m) le_rfl) + constructor + · intro σ + apply affine_residual_bound hC (norm_nonneg _) (hrj 1 (by decide)) hb1 _ (hnorm 1 σ) + have hh := frozen_first_bound B hU hu hac hx + exact hh.trans (by + calc + _ ≤ C*C^2*‖iteratedFDeriv ℝ 2 u x‖ := + mul_le_mul_of_nonneg_right (mul_le_mul hB ha1 (norm_nonneg _) hC) (norm_nonneg _) + _ = _ := by ring) + · intro σ + apply quadratic_residual_bound hC (norm_nonneg _) (norm_nonneg _) (hrj 2 (by decide)) hb2 _ (hnorm 2 σ) + exact (frozen_second_bound B hU hu hac hx).trans (mul_le_mul hB + (add_le_add + (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left ha1 (by norm_num)) (norm_nonneg _)) + (mul_le_mul_of_nonneg_right ha2 (norm_nonneg _))) (by positivity) hC) +end HigherJet + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/QuasilinearResidualAlgebra.lean b/lean/OAI/Geometry/PrescribedPotential/QuasilinearResidualAlgebra.lean new file mode 100644 index 0000000000000000000000000000000000000000..419943ccdc780d93c2a757619096d6ae70afe42f --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/QuasilinearResidualAlgebra.lean @@ -0,0 +1,44 @@ +import Mathlib + +namespace OAI + +/-! Quasilinear Residual Algebra. -/ + +section + + +namespace HigherJet +lemma affine_residual_bound {c r A B D L : ℝ} (hc : 0 ≤ c) (hr : 0 ≤ r) + (hA : A ≤ c) (hB : B ≤ c*(c+r)) (hD : D ≤ c^3*r) (hL : L ≤ A+B+D) : + L ≤ (2*c+c^2+c^3)*(1+r) := by + have h1 : 0 ≤ c*r := mul_nonneg hc hr + have h2 : 0 ≤ c^2*r := mul_nonneg (sq_nonneg c) hr + have h3 : 0 ≤ c+c^3 := by positivity + nlinarith only [hA,hB,hD,hL,h1,h2,h3] + +lemma four_monomial_bound {a b c d r s : ℝ} + (ha : 0 ≤ a) (hb : 0 ≤ b) (hc : 0 ≤ c) (hd : 0 ≤ d) (_hr : 0 ≤ r) (hs : 0 ≤ s) : + a+b*r+c*r^2+d*s ≤ (a+b+c+d)*(1+r^2+s) := by + have h0 : 1 ≤ 1+r^2+s := by nlinarith only [sq_nonneg r,hs] + have h1 : r ≤ 1+r^2+s := by nlinarith only [sq_nonneg (r-1),hs] + have h2 : r^2 ≤ 1+r^2+s := by linarith only [hs] + have h3 : s ≤ 1+r^2+s := by nlinarith only [sq_nonneg r] + have a0 := mul_le_mul_of_nonneg_left h0 ha + have a1 := mul_le_mul_of_nonneg_left h1 hb + have a2 := mul_le_mul_of_nonneg_left h2 hc + have a3 := mul_le_mul_of_nonneg_left h3 hd + nlinarith only [a0,a1,a2,a3] + +lemma quadratic_residual_bound {c r s A B D L : ℝ} (hc : 0 ≤ c) (hr : 0 ≤ r) (hs : 0 ≤ s) + (hA : A ≤ c) (hB : B ≤ c^2*(r+s+(c+r)^2)) + (hD : D ≤ c*(2*c^2*s+c^2*(r+c^2)*r)) (hL : L ≤ A+B+D) : + L ≤ (c+3*c^2+5*c^3+c^4+c^5)*(1+r^2+s) := by + have h := four_monomial_bound (a := c+c^4) (b := c^2+2*c^3+c^5) + (c := c^2+c^3) (d := c^2+2*c^3) (by positivity) (by positivity) (by positivity) + (by positivity) hr hs + nlinarith only [hA,hB,hD,hL,h] +end HigherJet + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/RealCutoffBounds.lean b/lean/OAI/Geometry/PrescribedPotential/RealCutoffBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..e906e13e1d9002c65db39545fdccff5e48cb9c87 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/RealCutoffBounds.lean @@ -0,0 +1,82 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.RealFrameScalar + +namespace OAI + +/-! Real Cutoff Bounds. -/ + +section + + +noncomputable section +open Set Filter Topology Finset +open scoped ContDiff +namespace HigherJet +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + {ι : Type*} [Fintype ι] + +omit [Fintype ι] in +lemma frameGradient_const_mul {f : E → ℝ} {x : E} (hf : DifferentiableAt ℝ f x) + (v : ι → E) (c : ℝ) : frameGradient v (fun y => c*f y) x = c • frameGradient v f x := by + rw [frameGradient_mul (differentiableAt_const c) hf,frameGradient_const] + simp + +lemma frameGradient_square {f : E → ℝ} {x : E} (hf : DifferentiableAt ℝ f x) (v : ι → E) : + ‖frameGradient v (fun y => (f y)^2) x‖^2 = 4*(f x)^2*‖frameGradient v f x‖^2 := by + have he : (fun y => (f y)^2) = (fun y => f y*f y) := by funext y; ring + rw [he,frameGradient_mul hf hf,← add_smul,norm_smul,Real.norm_eq_abs,mul_pow,sq_abs] + ring + +lemma cutoff_uniform_frames {K : Set E} (hK : IsCompact K) (χ : E → ℝ) + (hχ : ContDiff ℝ ∞ χ) {B : ℝ} (hB : 0 ≤ B) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ x ∈ K, ∀ v : ι → E, (∀ i, ‖v i‖ ≤ B) → + -C ≤ frameLaplace v (fun y => (χ y)^2) x ∧ + ‖frameGradient v (fun y => (χ y)^2) x‖^2 ≤ C*(χ x)^2 := by + obtain ⟨D,hD⟩ := hK.exists_bound_of_continuousOn (hχ.fderiv_right (m := ∞) (by simp)).continuous.continuousOn + obtain ⟨H,hH⟩ := hK.exists_bound_of_continuousOn + (((hχ.pow 2).fderiv_right (m := ∞) (by simp)).fderiv_right (m := ∞) (by simp)).continuous.continuousOn + let D' := max D 0 + let H' := max H 0 + let C := (Fintype.card ι : ℝ)*H'*B^2 + 4*(Fintype.card ι : ℝ)*D'^2*B^2 + have hD' : 0 ≤ D' := le_max_right _ _ + have hH' : 0 ≤ H' := le_max_right _ _ + have hC1 : (Fintype.card ι : ℝ)*H'*B^2 ≤ C := le_add_of_nonneg_right (by positivity) + have hC2 : 4*(Fintype.card ι : ℝ)*D'^2*B^2 ≤ C := le_add_of_nonneg_left (by positivity) + refine ⟨C,by dsimp [C]; positivity,?_⟩ + intro x hx v hv + have hd : ‖fderiv ℝ χ x‖ ≤ D' := (hD x hx).trans (le_max_left _ _) + have hh : ‖fderiv ℝ (fderiv ℝ (fun y => (χ y)^2)) x‖ ≤ H' := (hH x hx).trans (le_max_left _ _) + have hgrad : ‖frameGradient v χ x‖^2 ≤ (Fintype.card ι : ℝ)*D'^2*B^2 := by + rw [norm_frameGradient_sq] + calc + _ ≤ ∑ _i : ι, (D'*B)^2 := by + apply sum_le_sum + intro i _ + apply pow_le_pow_left₀ (norm_nonneg _) + exact ((fderiv ℝ χ x).le_opNorm _).trans (mul_le_mul hd (hv i) (norm_nonneg _) hD') + _ = _ := by simp; ring + constructor + · have hl : ‖frameLaplace v (fun y => (χ y)^2) x‖ ≤ (Fintype.card ι : ℝ)*H'*B^2 := by + unfold frameLaplace + calc + _ ≤ ∑ i, ‖dir (v i) (dir (v i) (fun y => (χ y)^2)) x‖ := norm_sum_le _ _ + _ ≤ ∑ _i : ι, H'*B^2 := by + apply sum_le_sum + intro i _ + rw [dir_dir (hχ.contDiffAt.pow 2)] + exact (((fderiv ℝ (fderiv ℝ (fun y => (χ y)^2)) x) (v i)).le_opNorm _).trans + ((mul_le_mul + (((fderiv ℝ (fderiv ℝ (fun y => (χ y)^2)) x).le_opNorm _).trans + (mul_le_mul hh (hv i) (norm_nonneg _) hH')) (hv i) (norm_nonneg _) (by positivity)).trans_eq (by ring)) + _ = _ := by simp; ring + exact (neg_le_neg (hl.trans hC1)).trans (by simpa only [Real.norm_eq_abs] using neg_abs_le (frameLaplace v (fun y => (χ y)^2) x)) + · rw [frameGradient_square (hχ.differentiable (by simp) x)] + have hm := mul_le_mul_of_nonneg_left hgrad (show 0 ≤ 4*(χ x)^2 by positivity) + have hn := mul_le_mul_of_nonneg_right hC2 (sq_nonneg (χ x)) + nlinarith only [hm,hn] +end HigherJet + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/RealDeterminantOrder.lean b/lean/OAI/Geometry/PrescribedPotential/RealDeterminantOrder.lean new file mode 100644 index 0000000000000000000000000000000000000000..b50ae92a255824ddf094e73c82354a4bb5ecb224 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/RealDeterminantOrder.lean @@ -0,0 +1,90 @@ +import Mathlib + +namespace OAI + +/-! Real Determinant Order. -/ + +section + + + +noncomputable section +open Matrix Polynomial Filter Set +open scoped MatrixOrder Matrix.Norms.Elementwise +namespace PotentialABP +variable {n : Type*} [Fintype n] [DecidableEq n] + +lemma real_trace_mul_nonneg {A B : Matrix n n ℝ} + (hA : A.PosSemidef) (hB : B.PosSemidef) : 0 ≤ (A*B).trace := by + let S := CFC.sqrt A + have hS : S.PosSemidef := (CFC.sqrt_nonneg A).posSemidef + have hsquare : S*S = A := by simpa [S, pow_two] using CFC.sq_sqrt A hA.nonneg + have htr := (hB.mul_mul_conjTranspose_same S).trace_nonneg + have he : (S*B*Sᴴ).trace = (A*B).trace := by + rw [hS.isHermitian.eq, Matrix.trace_mul_cycle, hsquare] + rwa [he] at htr + +lemma real_hasDerivAt_det_one_add_smul (M : Matrix n n ℝ) : + HasDerivAt (fun t : ℝ => (1+t • M).det) M.trace 0 := by + have hp := (Matrix.det (1 + (Polynomial.X : ℝ[X]) • M.map Polynomial.C)).hasDerivAt (0 : ℝ) + rw [Matrix.derivative_det_one_add_X_smul] at hp + simpa [eval_det, ← Matrix.smul_eq_mul_diagonal] using hp + +lemma real_hasDerivAt_det_add_smul (H K : Matrix n n ℝ) (hH : IsUnit H.det) : + HasDerivAt (fun t : ℝ => (H+t • K).det) (H.det*(H⁻¹*K).trace) 0 := by + have hd := (real_hasDerivAt_det_one_add_smul (H⁻¹*K)).const_mul H.det + apply hd.congr_of_eventuallyEq + filter_upwards [] with t + rw [← Matrix.det_mul] + congr 1 + simp [Matrix.mul_add, ← Matrix.mul_assoc, + Matrix.mul_nonsing_inv _ hH] + +lemma real_hasDerivAt_det_shift (A B : Matrix n n ℝ) (t : ℝ) + (ht : (A+t • B).PosDef) : + HasDerivAt (fun s : ℝ => (A+s • B).det) + ((A+t • B).det*((A+t • B)⁻¹*B).trace) t := by + have hd := real_hasDerivAt_det_add_smul (A+t • B) B + (isUnit_iff_ne_zero.mpr ht.det_pos.ne') + have hc := hd.comp_of_eq t ((hasDerivAt_id t).sub_const t) (by simp) + simp only [mul_one] at hc + apply hc.congr_of_eventuallyEq + filter_upwards [] with s + dsimp only [Function.comp_apply,id_eq] + simp only [sub_smul] + congr 1 + abel + +lemma real_det_add_posSemidef (A B : Matrix n n ℝ) (hA : A.PosDef) (hB : B.PosSemidef) : + A.det ≤ (A+B).det := by + let f : ℝ → ℝ := fun t => (A+t • B).det + have hp (t : ℝ) (ht : 0 ≤ t) : (A+t • B).PosDef := hA.add_posSemidef (hB.smul ht) + have hd (t : ℝ) (ht : 0 ≤ t) := real_hasDerivAt_det_shift A B t (hp t ht) + have hm : MonotoneOn f (Icc 0 1) := by + apply monotoneOn_of_deriv_nonneg (convex_Icc 0 1) + · intro t ht + exact (hd t ht.1).continuousAt.continuousWithinAt + · intro t ht + exact (hd t (interior_subset ht).1).differentiableAt.differentiableWithinAt + · intro t ht + rw [(hd t (interior_subset ht).1).deriv] + exact mul_nonneg (hp t (interior_subset ht).1).det_pos.le + (real_trace_mul_nonneg (hp t (interior_subset ht).1).inv.posSemidef hB) + simpa [f] using hm (show (0:ℝ) ∈ Icc 0 1 by constructor <;> norm_num) + (show (1:ℝ) ∈ Icc 0 1 by constructor <;> norm_num) (by norm_num) + +lemma real_det_mono {A B : Matrix n n ℝ} (hA : A.PosSemidef) + (hBA : (B-A).PosSemidef) : A.det ≤ B.det := by + by_cases ha : A.det = 0 + · rw [ha] + have hb : B.PosSemidef := by simpa using hA.add hBA + exact hb.det_nonneg + · simpa using real_det_add_posSemidef A (B-A) + (hA.posDef_iff_det_ne_zero.mpr ha) hBA + +end PotentialABP + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/RealFrameScalar.lean b/lean/OAI/Geometry/PrescribedPotential/RealFrameScalar.lean new file mode 100644 index 0000000000000000000000000000000000000000..519cca0cd5e11678f21b201c2b1d718c9ea09a53 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/RealFrameScalar.lean @@ -0,0 +1,129 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalSobolev +import OAI.Geometry.PrescribedPotential.RealJetEnergy + +namespace OAI + +/-! Real Frame Scalar. -/ + +section + + +noncomputable section +open Set Filter Topology Finset +open scoped ContDiff +namespace HigherJet +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + {ι : Type*} [Fintype ι] + +def frameGradient (v : ι → E) (f : E → ℝ) (x : E) : EuclideanSpace ℝ ι := + WithLp.toLp 2 (fun i => dir (v i) f x) + +lemma norm_frameGradient_sq (v : ι → E) (f : E → ℝ) (x : E) : + ‖frameGradient v f x‖^2 = frameGradientSq v f x := by + rw [PiLp.norm_sq_eq_of_L2] + rfl + +lemma dir_mul {f g : E → ℝ} {x : E} (hf : DifferentiableAt ℝ f x) + (hg : DifferentiableAt ℝ g x) (v : E) : + dir v (fun y => f y*g y) x = dir v f x*g x+f x*dir v g x := by + have h := congrArg (fun T : E →L[ℝ] ℝ => T v) (hf.hasFDerivAt.mul hg.hasFDerivAt).fderiv + change dir v (fun y => f y*g y) x = _ at h + simp only [add_apply, smul_apply, smul_eq_mul] at h + rw [h] + simp only [dir] + ring + +omit [Fintype ι] in +lemma frameGradient_mul {f g : E → ℝ} {x : E} (hf : DifferentiableAt ℝ f x) + (hg : DifferentiableAt ℝ g x) (v : ι → E) : + frameGradient v (fun y => f y*g y) x = + g x • frameGradient v f x+f x • frameGradient v g x := by + ext i + simp only [frameGradient,PiLp.add_apply,PiLp.smul_apply,PiLp.toLp_apply,smul_eq_mul,dir_mul hf hg] + ring + +omit [Fintype ι] in +lemma frameGradient_add {f g : E → ℝ} {x : E} (hf : DifferentiableAt ℝ f x) + (hg : DifferentiableAt ℝ g x) (v : ι → E) : + frameGradient v (fun y => f y+g y) x = frameGradient v f x+frameGradient v g x := by + ext i + exact dir_add hf hg _ + +omit [Fintype ι] in +lemma frameGradient_const (c : ℝ) (v : ι → E) (x : E) : + frameGradient v (fun _ : E => c) x = 0 := by + ext i + simp [frameGradient,dir] + +lemma frameLaplace_mul {U : Set E} (hU : IsOpen U) {f g : E → ℝ} + (hf : ContDiffOn ℝ ∞ f U) (hg : ContDiffOn ℝ ∞ g U) + {x : E} (hx : x ∈ U) (v : ι → E) : + frameLaplace v (fun y => f y*g y) x = + f x*frameLaplace v g x+g x*frameLaplace v f x+ + 2*inner ℝ (frameGradient v f x) (frameGradient v g x) := by + have hfa := (hf.contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp) + have hga := (hg.contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp) + have he (i : ι) : dir (v i) (fun y => f y*g y) =ᶠ[𝓝 x] + (fun y => dir (v i) f y*g y+f y*dir (v i) g y) := by + filter_upwards [hU.mem_nhds hx] with y hy + exact dir_mul ((hf.contDiffAt (hU.mem_nhds hy)).differentiableAt (by simp)) + ((hg.contDiffAt (hU.mem_nhds hy)).differentiableAt (by simp)) _ + have hd (i : ι) : dir (v i) (dir (v i) (fun y => f y*g y)) x = + f x*dir (v i) (dir (v i) g) x+g x*dir (v i) (dir (v i) f) x+ + 2*(dir (v i) f x*dir (v i) g x) := by + have hdf := ((dir_smoothOn hU hf (v i)).contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp) + have hdg := ((dir_smoothOn hU hg (v i)).contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp) + rw [dir_congr (he i),dir_add (f := fun y => dir (v i) f y*g y) (g := fun y => f y*dir (v i) g y) + (hdf.mul hga) (hfa.mul hdg),dir_mul hdf hga,dir_mul hfa hdg] + ring + simp only [frameLaplace,hd,Finset.sum_add_distrib,← Finset.mul_sum, + frameGradient,PiLp.inner_apply,RCLike.inner_apply,starRingEnd_apply,star_trivial] + congr 2 + apply Finset.sum_congr rfl + intro i _ + ring + +lemma frameLaplace_add {U : Set E} (hU : IsOpen U) {f g : E → ℝ} + (hf : ContDiffOn ℝ ∞ f U) (hg : ContDiffOn ℝ ∞ g U) + {x : E} (hx : x ∈ U) (v : ι → E) : + frameLaplace v (fun y => f y+g y) x = frameLaplace v f x+frameLaplace v g x := by + have he (i : ι) : dir (v i) (fun y => f y+g y) =ᶠ[𝓝 x] + (fun y => dir (v i) f y+dir (v i) g y) := by + filter_upwards [hU.mem_nhds hx] with y hy + exact dir_add ((hf.contDiffAt (hU.mem_nhds hy)).differentiableAt (by simp)) + ((hg.contDiffAt (hU.mem_nhds hy)).differentiableAt (by simp)) _ + simp only [frameLaplace,dir_congr (he _),dir_add + (((dir_smoothOn hU hf _).contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp)) + (((dir_smoothOn hU hg _).contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp)),Finset.sum_add_distrib] + +lemma frameLaplace_const (c : ℝ) (v : ι → E) (x : E) : + frameLaplace v (fun _ : E => c) x = 0 := by + have he (i : ι) : dir (v i) (fun _ : E => c) = fun _ => 0 := by + ext y + simp [dir] + simp only [frameLaplace,he] + apply Finset.sum_eq_zero + intro i _ + exact congrArg (fun T : E →L[ℝ] ℝ => T (v i)) + (hasFDerivAt_const (x := x) (c := (0 : ℝ))).fderiv + +omit [Fintype ι] in +lemma frameGradient_eq_zero_of_localMax {f : E → ℝ} {x : E} (h : IsLocalMax f x) (v : ι → E) : + frameGradient v f x = 0 := by + ext i + simp [frameGradient,dir,h.fderiv_eq_zero] + +lemma frameLaplace_nonpos_of_localMax {f : E → ℝ} {x : E} + (hf : ContDiffAt ℝ ∞ f x) (h : IsLocalMax f x) (v : ι → E) : + frameLaplace v f x ≤ 0 := by + apply Finset.sum_nonpos + intro i _ + rw [dir_dir hf] + exact EllipticKernel.second_fderiv_nonpos_at_localMax hf h (v i) +end HigherJet + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/RealJetEnergy.lean b/lean/OAI/Geometry/PrescribedPotential/RealJetEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..ccf236c66da335c03b3b92e9639fb47bdb644c63 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/RealJetEnergy.lean @@ -0,0 +1,133 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.HigherDirectionalJets + +namespace OAI + +/-! Real Jet Energy. -/ + +section + + +noncomputable section +open Set Filter Topology Finset +open scoped ContDiff +namespace HigherJet +variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [InnerProductSpace ℝ F] + +lemma dir_add {f g : E → F} {x : E} (hf : DifferentiableAt ℝ f x) + (hg : DifferentiableAt ℝ g x) (v : E) : + dir v (fun y => f y+g y) x = dir v f x+dir v g x := by + exact congrArg (fun T : E →L[ℝ] F => T v) (hf.hasFDerivAt.add hg.hasFDerivAt).fderiv + +lemma dir_smul {f : E → F} {x : E} (hf : DifferentiableAt ℝ f x) (c : ℝ) (v : E) : + dir v (fun y => c • f y) x = c • dir v f x := by + exact congrArg (fun T : E →L[ℝ] F => T v) (hf.hasFDerivAt.const_smul c).fderiv + +lemma dir_inner {f g : E → F} {x : E} (hf : DifferentiableAt ℝ f x) + (hg : DifferentiableAt ℝ g x) (v : E) : + dir v (fun y => inner ℝ (f y) (g y)) x = + inner ℝ (f x) (dir v g x)+inner ℝ (dir v f x) (g x) := + fderiv_inner_apply ℝ hf hg v + +lemma dir_norm_sq {f : E → F} {x : E} (hf : DifferentiableAt ℝ f x) (v : E) : + dir v (fun y => ‖f y‖^2) x = 2*inner ℝ (f x) (dir v f x) := by + simpa only [dir,smul_apply,ContinuousLinearMap.comp_apply, + innerSL_apply_apply,two_smul,two_mul,add_apply] using congrArg (fun map : E →L[ℝ] ℝ => map v) hf.hasFDerivAt.norm_sq.fderiv + +lemma dir_dir_norm_sq {U : Set E} (hU : IsOpen U) {f : E → F} + (hf : ContDiffOn ℝ ∞ f U) {x : E} (hx : x ∈ U) (v : E) : + dir v (dir v (fun y => ‖f y‖^2)) x = + 2*‖dir v f x‖^2+2*inner ℝ (f x) (dir v (dir v f) x) := by + have he : dir v (fun y => ‖f y‖^2) =ᶠ[𝓝 x] + (fun y => 2*inner ℝ (f y) (dir v f y)) := by + filter_upwards [hU.mem_nhds hx] with y hy + exact dir_norm_sq ((hf.contDiffAt (hU.mem_nhds hy)).differentiableAt (by simp)) v + rw [dir_congr he] + have hfa := (hf.contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp) + have hda := ((dir_smoothOn hU hf v).contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp) + change dir v (fun y => (2:ℝ) • inner ℝ (f y) (dir v f y)) x = _ + rw [dir_smul (hfa.inner ℝ hda),dir_inner hfa hda,real_inner_self_eq_norm_sq] + simp only [smul_eq_mul] + ring + +variable {ι κ : Type*} [Fintype ι] [Fintype κ] + +def frameLaplace (v : ι → E) (f : E → F) (x : E) : F := ∑ i, dir (v i) (dir (v i) f) x + +def frameGradientSq (v : ι → E) (f : E → F) (x : E) : ℝ := ∑ i, ‖dir (v i) f x‖^2 + +lemma frameLaplace_norm_sq {U : Set E} (hU : IsOpen U) {f : E → F} + (hf : ContDiffOn ℝ ∞ f U) {x : E} (hx : x ∈ U) (v : ι → E) : + frameLaplace v (fun y => ‖f y‖^2) x = + 2*frameGradientSq v f x+2*inner ℝ (f x) (frameLaplace v f x) := by + simp only [frameLaplace,dir_dir_norm_sq hU hf hx,Finset.sum_add_distrib, + ← Finset.mul_sum,inner_sum,frameGradientSq] + +lemma dir_sum (f : κ → E → F) {x : E} (hf : ∀ j, DifferentiableAt ℝ (f j) x) (v : E) : + dir v (fun y => ∑ j, f j y) x = ∑ j, dir v (f j) x := by + rw [show (fun y => ∑ j, f j y) = ∑ j, f j from by ext y; simp] + simpa only [dir,Finset.sum_apply,_root_.sum_apply] using congrArg (fun map : E →L[ℝ] F => map v) + ((HasFDerivAt.sum (u := Finset.univ) (fun j _ => (hf j).hasFDerivAt)).fderiv) + +lemma frameLaplace_sum {U : Set E} (hU : IsOpen U) (f : κ → E → F) + (hf : ∀ j, ContDiffOn ℝ ∞ (f j) U) {x : E} (hx : x ∈ U) (v : ι → E) : + frameLaplace v (fun y => ∑ j, f j y) x = ∑ j, frameLaplace v (f j) x := by + have hd (i : ι) : dir (v i) (fun y => ∑ j, f j y) =ᶠ[𝓝 x] + (fun y => ∑ j, dir (v i) (f j) y) := by + filter_upwards [hU.mem_nhds hx] with y hy + exact dir_sum f (fun j => ((hf j).contDiffAt (hU.mem_nhds hy)).differentiableAt (by simp)) _ + simp only [frameLaplace,dir_congr (hd _),dir_sum _ (fun j => + ((dir_smoothOn hU (hf j) _).contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp))] + exact Finset.sum_comm + +def familyEnergy (f : κ → E → F) (x : E) : ℝ := ∑ j, ‖f j x‖^2 + +def familyDissipation (v : ι → E) (f : κ → E → F) (x : E) : ℝ := + ∑ j, frameGradientSq v (f j) x + +lemma familyEnergy_smoothOn {U : Set E} {f : κ → E → F} + (hf : ∀ j, ContDiffOn ℝ ∞ (f j) U) : ContDiffOn ℝ ∞ (familyEnergy f) U := + ContDiffOn.sum (fun j _ => (hf j).norm_sq (𝕜 := ℝ)) + +lemma familyEnergy_laplace {U : Set E} (hU : IsOpen U) {f : κ → E → F} + (hf : ∀ j, ContDiffOn ℝ ∞ (f j) U) {x : E} (hx : x ∈ U) (v : ι → E) : + frameLaplace v (familyEnergy f) x = 2*familyDissipation v f x+ + 2*∑ j, inner ℝ (f j x) (frameLaplace v (f j) x) := by + change frameLaplace v (fun y => ∑ j, ‖f j y‖^2) x = _ + rw [frameLaplace_sum hU _ (fun j => (hf j).norm_sq (𝕜 := ℝ)) hx] + simp only [frameLaplace_norm_sq hU (hf _) hx,Finset.sum_add_distrib, + ← Finset.mul_sum,familyDissipation] + +lemma familyEnergy_gradient_bound {U : Set E} (hU : IsOpen U) {f : κ → E → F} + (hf : ∀ j, ContDiffOn ℝ ∞ (f j) U) {x : E} (hx : x ∈ U) (v : ι → E) : + frameGradientSq v (familyEnergy f) x ≤ + 4*familyEnergy f x*familyDissipation v f x := by + have he (i : ι) : dir (v i) (familyEnergy f) x = + 2*∑ j, inner ℝ (f j x) (dir (v i) (f j) x) := by + change dir (v i) (fun y => ∑ j, ‖f j y‖^2) x = _ + rw [dir_sum _ (fun j => + (((hf j).norm_sq (𝕜 := ℝ)).contDiffAt (hU.mem_nhds hx)).differentiableAt (by simp))] + simp only [dir_norm_sq ((hf _).contDiffAt (hU.mem_nhds hx) |>.differentiableAt (by simp)),Finset.mul_sum] + have hb (i : ι) : (∑ j, inner ℝ (f j x) (dir (v i) (f j) x))^2 ≤ + familyEnergy f x*(∑ j, ‖dir (v i) (f j) x‖^2) := by + let a : PiLp 2 (fun _ : κ => F) := WithLp.toLp 2 (fun j => f j x) + let b : PiLp 2 (fun _ : κ => F) := WithLp.toLp 2 (fun j => dir (v i) (f j) x) + have hh := (sq_le_sq₀ (abs_nonneg (inner ℝ a b)) + (mul_nonneg (norm_nonneg a) (norm_nonneg b))).mpr (abs_real_inner_le_norm a b) + simpa only [sq_abs,mul_pow,PiLp.inner_apply,PiLp.norm_sq_eq_of_L2, + a,b,PiLp.toLp_apply,familyEnergy] using hh + calc + _ = ∑ i, 4*(∑ j, inner ℝ (f j x) (dir (v i) (f j) x))^2 := by + simp only [frameGradientSq,he,Real.norm_eq_abs,sq_abs,mul_pow]; norm_num + _ ≤ ∑ i, 4*familyEnergy f x*(∑ j, ‖dir (v i) (f j) x‖^2) := by + exact Finset.sum_le_sum (fun i _ => by nlinarith only [hb i]) + _ = _ := by + rw [← Finset.mul_sum,Finset.sum_comm] + rfl +end HigherJet + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/RealMapSmooth.lean b/lean/OAI/Geometry/PrescribedPotential/RealMapSmooth.lean new file mode 100644 index 0000000000000000000000000000000000000000..77891ffafed2953b55f0deb1438091635c514ca7 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/RealMapSmooth.lean @@ -0,0 +1,57 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CircleRadialCalculus +import OAI.Geometry.PrescribedPotential.CompletedRealification +import OAI.Geometry.PrescribedPotential.NonlinearRemainder +import OAI.Geometry.PrescribedPotential.PatchCutoffs +import OAI.Geometry.PrescribedPotential.RealNonlinearCommutator + +namespace OAI + +/-! Real Map Smooth. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) +local instance rmapNG (s : ℝ) : NormedAddCommGroup (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedAddCommGroup +local instance rmapNS (s : ℝ) : NormedSpace ℝ (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedSpace +local instance rmapTG (s : ℝ) : IsTopologicalAddGroup (D.localizers.RealSobolev s) := + Submodule.isTopologicalAddGroup _ +local instance rmapCS (s : ℝ) : ContinuousSMul ℝ (D.localizers.RealSobolev s) := + SMulMemClass.continuousSMul _ + +variable [ConnectedSpace X] + +omit [ConnectedSpace X] in +lemma realNonlinearRemainder_as_projection (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (p : ι) (v : EC d) : + D.realNonlinearRemainder k hk p v = fun u => + D.realProjection k (D.nonlinearRemainder k hk p v u.val) := by + funext u + exact (D.realProjection_of_real k (D.realNonlinearRemainder k hk p v u)).symm + +omit [ConnectedSpace X] in +lemma realNonlinearRemainder_contDiff (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (p : ι) (v : EC d) : ContDiff ℝ ∞ (D.realNonlinearRemainder k hk p v) := by + rw [D.realNonlinearRemainder_as_projection k hk p v] + exact (D.realProjection k).contDiff.comp + ((D.nonlinearRemainder_contDiff k hk p v).comp + (D.localizers.realCompletion ((k : ℝ)+2)).subtypeL.contDiff) +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/RealNonlinearCommutator.lean b/lean/OAI/Geometry/PrescribedPotential/RealNonlinearCommutator.lean new file mode 100644 index 0000000000000000000000000000000000000000..a1ec024c2b419ef8513f766e13b1cd8e2a38562d --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/RealNonlinearCommutator.lean @@ -0,0 +1,115 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalNonlinearCommutator +import OAI.Geometry.PrescribedPotential.PatchCutoffs +import OAI.Geometry.PrescribedPotential.RealNonlinearDerivative +import OAI.Geometry.PrescribedPotential.RealSobolev +import OAI.Geometry.PrescribedPotential.RegularityCutoffs + +namespace OAI + +/-! Real Nonlinear Commutator. -/ + +section + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) +local instance realNonlinearCommutatorNormedAddCommGroup (s : ℝ) : NormedAddCommGroup (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedAddCommGroup +local instance realNonlinearCommutatorNormedSpace (s : ℝ) : NormedSpace ℝ (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedSpace +local instance realNonlinearCommutatorIsTopologicalAddGroup (s : ℝ) : IsTopologicalAddGroup (D.localizers.RealSobolev s) := + Submodule.isTopologicalAddGroup _ +local instance realNonlinearCommutatorContinuousSMul (s : ℝ) : ContinuousSMul ℝ (D.localizers.RealSobolev s) := + SMulMemClass.continuousSMul _ + +lemma realVolumeDerivative_val (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (u w : D.localizers.RealSobolev ((k : ℝ)+2)) : + (D.realVolumeDerivative k hk u w).val = + fderiv ℝ (D.completedVolume k hk) u.val w.val := by + let J := (D.localizers.realCompletion ((k : ℝ)+2)).subtypeL + have hd := ((D.completedVolume_contDiff k hk).differentiable (by simp) u.val).hasFDerivAt.comp u + J.hasFDerivAt + change (fderiv ℝ (fun y : D.localizers.RealSobolev ((k : ℝ)+2) => + D.completedVolume k hk y.val) u) w = _ + exact congrArg (fun L : D.localizers.RealSobolev ((k : ℝ)+2) →L[ℝ] + D.localizers.Sobolev (k : ℝ) => L w) hd.fderiv + +lemma nonlinearRemainder_core_real (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (p : ι) (v : EC d) (f : RealSmooth A) : + D.nonlinearRemainder k hk p v (D.localizers.embed ((k : ℝ)+2) f.val) ∈ + D.localizers.realCompletion (k : ℝ) := by + have hh := D.nonlinear_commutator_core k hk p v f.source + rw [f.ofReal_source] at hh + have he : D.nonlinearRemainder k hk p v (D.localizers.embed ((k : ℝ)+2) f.val) = + (D.realVolumeDerivative k hk (D.localizers.realEmbed ((k : ℝ)+2) f) + (D.localizers.realEmbed ((k : ℝ)+2) (D.realLocalizedDerivative p v f))).val - + D.localizers.embed (k : ℝ) (D.localizedDerivative p v (Smooth.ofReal (g.potentialDensity f.source))) := by + rw [D.realVolumeDerivative_val] + change D.nonlinearRemainder k hk p v (D.localizers.embed ((k : ℝ)+2) f.val) = + fderiv ℝ (D.completedVolume k hk) (D.localizers.embed ((k : ℝ)+2) f.val) + (D.localizers.embed ((k : ℝ)+2) (D.localizedDerivative p v f.val)) - + D.localizers.embed (k : ℝ) (D.localizedDerivative p v (Smooth.ofReal (g.potentialDensity f.source))) + rw [hh,add_sub_cancel_left] + rw [he] + apply (D.localizers.realCompletion (k : ℝ)).sub_mem + · exact Subtype.property _ + · exact (D.localizers.realEmbed (k : ℝ) + (D.realLocalizedDerivative p v (RealSmooth.ofReal (g.potentialDensity f.source)))).property + +lemma nonlinearRemainder_real (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (p : ι) (v : EC d) (u : D.localizers.RealSobolev ((k : ℝ)+2)) : + D.nonlinearRemainder k hk p v u.val ∈ D.localizers.realCompletion (k : ℝ) := by + have hc : Continuous (fun u : D.localizers.RealSobolev ((k : ℝ)+2) => + D.nonlinearRemainder k hk p v u.val) := + (D.nonlinearRemainder_contDiff k hk p v).continuous.comp continuous_subtype_val + exact (D.localizers.realEmbed_dense ((k : ℝ)+2)).induction_on u + ((Submodule.isClosed_topologicalClosure _).preimage hc) + (D.nonlinearRemainder_core_real k hk p v) + +def realNonlinearRemainder (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (p : ι) (v : EC d) (u : D.localizers.RealSobolev ((k : ℝ)+2)) : + D.localizers.RealSobolev (k : ℝ) := + ⟨D.nonlinearRemainder k hk p v u.val,D.nonlinearRemainder_real k hk p v u⟩ + +lemma realNonlinearRemainder_continuous (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (p : ι) (v : EC d) : Continuous (D.realNonlinearRemainder k hk p v) := + ((D.nonlinearRemainder_contDiff k hk p v).continuous.comp continuous_subtype_val).subtype_mk _ + +lemma real_commutator_core (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (p : ι) (v : EC d) (f : RealSmooth A) : + D.realVolumeDerivative k hk (D.localizers.realEmbed ((k : ℝ)+2) f) + (D.localizers.realEmbed ((k : ℝ)+2) (D.realLocalizedDerivative p v f)) = + D.localizers.realEmbed (k : ℝ) + (D.realLocalizedDerivative p v (RealSmooth.ofReal (g.potentialDensity f.source))) + + D.realNonlinearRemainder k hk p v (D.localizers.realEmbed ((k : ℝ)+2) f) := by + apply Subtype.ext + rw [D.realVolumeDerivative_val] + have hh := D.nonlinear_commutator_core k hk p v f.source + rwa [f.ofReal_source] at hh + +def realCompletedDerivative (k : ℕ) (p : ι) (v : EC d) : + D.localizers.RealSobolev ((k : ℝ)+1) →L[ℝ] D.localizers.RealSobolev (k : ℝ) := + ((D.completedDerivative k p v).comp (D.localizers.realCompletion ((k : ℝ)+1)).subtypeL).codRestrict + (D.localizers.realCompletion (k : ℝ)) (fun u => D.completedDerivative_real k p v u.val u.property) + +lemma realCompletedDerivative_embed (k : ℕ) (p : ι) (v : EC d) (f : RealSmooth A) : + D.realCompletedDerivative k p v (D.localizers.realEmbed ((k : ℝ)+1) f) = + D.localizers.realEmbed (k : ℝ) (D.realLocalizedDerivative p v f) := by + apply Subtype.ext + exact D.completedDerivative_embed k p v f.val + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/RealNonlinearDerivative.lean b/lean/OAI/Geometry/PrescribedPotential/RealNonlinearDerivative.lean new file mode 100644 index 0000000000000000000000000000000000000000..63640b1f5498a0ba25cb5a21b29cb627eda37a1a --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/RealNonlinearDerivative.lean @@ -0,0 +1,105 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.RealVolume + +namespace OAI + +/-! Real Nonlinear Derivative. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical +namespace ClosedDerivative +variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] + +lemma derivative_mem (S : Submodule ℝ F) (hS : IsClosed (S : Set F)) + (f : E → S) {J : E →L[ℝ] F} {x : E} + (hJ : HasFDerivAt (fun y => (f y).val) J x) (v : E) : J v ∈ S := by + have hc : HasDerivAt (fun t : ℝ => x + t • v) v 0 := by + simpa using (hasDerivAt_id (0 : ℝ)).smul_const v |>.const_add x + have hJ' : HasFDerivAt (fun y => (f y).val) J (x+(0 : ℝ) • v) := by simpa using hJ + have hd := hJ'.comp_hasDerivAt (0 : ℝ) hc + apply hS.mem_of_tendsto hd.tendsto_slope + filter_upwards [] with t + exact S.smul_mem _ (S.sub_mem (f (x+t • v)).property (f (x+(0 : ℝ) • v)).property) + +def restrict (S : Submodule ℝ F) (hS : IsClosed (S : Set F)) + (f : E → S) (hf : Differentiable ℝ (fun y => (f y).val)) (x : E) : E →L[ℝ] S := + (fderiv ℝ (fun y => (f y).val) x).codRestrict S + (derivative_mem S hS f (hf x).hasFDerivAt) + +lemma restrict_comp (S : Submodule ℝ F) (hS : IsClosed (S : Set F)) + (f : E → S) (hf : Differentiable ℝ (fun y => (f y).val)) (x : E) : + S.subtypeL ∘L restrict S hS f hf x = fderiv ℝ (fun y => (f y).val) x := by + ext v; rfl + +lemma hasStrictFDerivAt (S : Submodule ℝ F) (hS : IsClosed (S : Set F)) + (f : E → S) (hf : ContDiff ℝ ∞ (fun y => (f y).val)) (x : E) : + HasStrictFDerivAt f (restrict S hS f (hf.differentiable (by simp)) x) x := by + apply (RealClosedDerivative.subtype_iff S f _ x).mpr + rw [restrict_comp] + exact hf.hasStrictFDerivAt (by simp) + +lemma restrict_continuous (S : Submodule ℝ F) (hS : IsClosed (S : Set F)) + (f : E → S) (hf : ContDiff ℝ ∞ (fun y => (f y).val)) : + Continuous (restrict S hS f (hf.differentiable (by simp))) := by + let e : (E →L[ℝ] S) →ₗᵢ[ℝ] (E →L[ℝ] F) := S.subtypeₗᵢ.postcomp + have hIso : Isometry (e : (E →L[ℝ] S) → (E →L[ℝ] F)) := e.isometry + apply hIso.isEmbedding.continuous_iff.mpr + change Continuous (fun x => S.subtypeL ∘L restrict S hS f _ x) + simp_rw [restrict_comp] + exact (hf.fderiv_right (m := ∞) (by simp)).continuous +end ClosedDerivative + +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) +local instance nonlinDerivNormedGroup (s : ℝ) : NormedAddCommGroup (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedAddCommGroup +local instance nonlinDerivNormedSpace (s : ℝ) : NormedSpace ℝ (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedSpace +local instance nonlinDerivTopologicalGroup (s : ℝ) : IsTopologicalAddGroup (D.localizers.RealSobolev s) := + Submodule.isTopologicalAddGroup _ +local instance nonlinDerivContinuousSMul (s : ℝ) : ContinuousSMul ℝ (D.localizers.RealSobolev s) := + SMulMemClass.continuousSMul _ + +def realVolumeDerivative (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (u : D.localizers.RealSobolev ((k : ℝ)+2)) : + D.localizers.RealSobolev ((k : ℝ)+2) →L[ℝ] D.localizers.RealSobolev (k : ℝ) := + ClosedDerivative.restrict (D.localizers.realCompletion (k : ℝ)) + (Submodule.isClosed_topologicalClosure _) (D.realVolume k hk) + ((D.realVolume_ambient_contDiff k hk).differentiable (by simp)) u + +omit [ConnectedSpace X] in +lemma realVolume_hasStrictFDerivAt (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (u : D.localizers.RealSobolev ((k : ℝ)+2)) : + HasStrictFDerivAt (D.realVolume k hk) (D.realVolumeDerivative k hk u) u := + ClosedDerivative.hasStrictFDerivAt _ (Submodule.isClosed_topologicalClosure _) + _ (D.realVolume_ambient_contDiff k hk) _ + +omit [ConnectedSpace X] in +lemma realVolumeDerivative_continuous (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) : + Continuous (D.realVolumeDerivative k hk) := + ClosedDerivative.restrict_continuous _ (Submodule.isClosed_topologicalClosure _) + _ (D.realVolume_ambient_contDiff k hk) + +omit [ConnectedSpace X] in +lemma realVolumeDerivative_zero (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) : + D.realVolumeDerivative k hk 0 = D.realLOrder k := + (D.realVolume_hasStrictFDerivAt k hk 0).hasFDerivAt.unique + (D.realVolume_hasStrictFDerivAt_zero k hk).hasFDerivAt + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/RealPoisson.lean b/lean/OAI/Geometry/PrescribedPotential/RealPoisson.lean new file mode 100644 index 0000000000000000000000000000000000000000..aff58c95f98a5e0f363c6d7486c736985f3e7bd1 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/RealPoisson.lean @@ -0,0 +1,126 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.RealSmoothOperator +import OAI.Geometry.PrescribedPotential.PointPoisson + +namespace OAI + +/-! Real Poisson. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +lemma pointPoissonOrder_realCore (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) (k : ℕ) + (hk : (Module.finrank ℝ (EC d) : ℝ) < 2*((k : ℝ)+2)) (x₀ : X) (f : RealSmooth A) : + ∃ (u : RealSmooth A) (c : ℝ), + D.pointPoissonOrder m hm he P k x₀ (D.localizers.embed (k : ℝ) f.val) = + D.localizers.embed ((k : ℝ)+2) u.val ∧ + D.poissonResidue m hm he P (D.localizers.embed 0 f.val) = (c : ℂ) := by + obtain ⟨u,c,hu,heq⟩ := exists_real_smooth_poisson g x₀ f + refine ⟨u,c,?_⟩ + apply D.pointPoissonOrder_unique m hm he k hk x₀ + · rw [D.pointPoissonOrder_equation, D.localizers.lower_embed (Nat.cast_nonneg k), + D.completedLOrder_embed, heq, map_add] + change (_ + D.localizers.constantsOrder (k : ℝ) _) - _ = (_ + D.localizers.constantsOrder (k : ℝ) _) - _ + abel + · rw [D.pointPoissonOrder_normalized m hm he P k hk, + D.pointEvaluation_embed hk, hu] + +def realLOrder (k : ℕ) : + D.localizers.RealSobolev ((k : ℝ)+2) →L[ℝ] D.localizers.RealSobolev (k : ℝ) := + ((D.completedLOrder k).comp (D.localizers.realCompletion ((k : ℝ)+2)).subtypeL).codRestrict + (D.localizers.realCompletion (k : ℝ)) (fun u => + D.localizers.maps_realCompletion (D.completedLOrder k) (fun f => + ⟨RealSmooth.laplace g f, D.completedLOrder_embed k f.val⟩) u.val u.property) + +def realConstants (s : ℝ) : ℝ →L[ℝ] D.localizers.RealSobolev s := + ((D.localizers.constantsOrder s).comp Complex.ofRealCLM).codRestrict + (D.localizers.realCompletion s) (fun c => (D.localizers.realEmbed s (RealSmooth.const c)).property) + +def realEvaluation (s : ℝ) (x₀ : X) : D.localizers.RealSobolev s →L[ℝ] ℝ := + Complex.reCLM ∘L D.pointEvaluation s x₀ ∘L (D.localizers.realCompletion s).subtypeL + +def realPointPoisson (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) (k : ℕ) + (hk : (Module.finrank ℝ (EC d) : ℝ) < 2*((k : ℝ)+2)) (x₀ : X) : + D.localizers.RealSobolev (k : ℝ) →L[ℝ] D.localizers.RealSobolev ((k : ℝ)+2) := + ((D.pointPoissonOrder m hm he P k x₀).comp (D.localizers.realCompletion (k : ℝ)).subtypeL).codRestrict + (D.localizers.realCompletion ((k : ℝ)+2)) (fun u => + D.localizers.maps_realCompletion (D.pointPoissonOrder m hm he P k x₀) (fun f => by + obtain ⟨v,c,hv,_⟩ := D.pointPoissonOrder_realCore m hm he P k hk x₀ f + exact ⟨v,hv⟩) u.val u.property) + +lemma residue_real (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) (k : ℕ) + (hk : (Module.finrank ℝ (EC d) : ℝ) < 2*((k : ℝ)+2)) (x₀ : X) + (u : D.localizers.RealSobolev (k : ℝ)) : + (D.poissonResidue m hm he P (D.localizers.lower (k : ℝ) 0 u.val)).im = 0 := by + have hh : (fun u : D.localizers.RealSobolev (k : ℝ) => + (D.poissonResidue m hm he P (D.localizers.lower (k : ℝ) 0 u.val)).im) = (fun _ => 0) := by + apply (D.localizers.realEmbed_dense (k : ℝ)).equalizer (by fun_prop) continuous_const + funext f + dsimp only [Function.comp_apply] + rw [D.localizers.realEmbed_val, D.localizers.lower_embed (Nat.cast_nonneg k)] + obtain ⟨v,c,_,hc⟩ := D.pointPoissonOrder_realCore m hm he P k hk x₀ f + rw [hc, Complex.ofReal_im] + exact congr_fun hh u + +def realResidue (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) (k : ℕ) : D.localizers.RealSobolev (k : ℝ) →L[ℝ] ℝ := + Complex.reCLM ∘L D.poissonResidue m hm he P ∘L D.localizers.lower (k : ℝ) 0 ∘L + (D.localizers.realCompletion (k : ℝ)).subtypeL + +lemma realPointPoisson_equation (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) (k : ℕ) + (hk : (Module.finrank ℝ (EC d) : ℝ) < 2*((k : ℝ)+2)) (x₀ : X) + (f : D.localizers.RealSobolev (k : ℝ)) : + D.realLOrder k (D.realPointPoisson m hm he P k hk x₀ f) = + f + D.realConstants (k : ℝ) (D.realResidue m hm he P k f) := by + apply Subtype.ext + change D.completedLOrder k (D.pointPoissonOrder m hm he P k x₀ f.val) = + f.val + D.localizers.constantsOrder (k : ℝ) + ((D.poissonResidue m hm he P (D.localizers.lower (k : ℝ) 0 f.val)).re : ℂ) + rw [D.pointPoissonOrder_equation] + congr 2 + exact Complex.ext rfl (D.residue_real m hm he P k hk x₀ f) + +lemma realPointPoisson_normalized (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) (k : ℕ) + (hk : (Module.finrank ℝ (EC d) : ℝ) < 2*((k : ℝ)+2)) (x₀ : X) + (f : D.localizers.RealSobolev (k : ℝ)) : + D.realEvaluation ((k : ℝ)+2) x₀ (D.realPointPoisson m hm he P k hk x₀ f) = 0 := by + change (D.pointEvaluation ((k : ℝ)+2) x₀ + (D.pointPoissonOrder m hm he P k x₀ f.val)).re = 0 + rw [D.pointPoissonOrder_normalized m hm he P k hk] + rfl + +omit [ConnectedSpace X] in +lemma realLOrder_constants (k : ℕ) (c : ℝ) : + D.realLOrder k (D.realConstants ((k : ℝ)+2) c) = 0 := + Subtype.ext (D.completedLOrder_constants k (c : ℂ)) + +omit [ConnectedSpace X] in +lemma realEvaluation_constants {s : ℝ} (hs : (Module.finrank ℝ (EC d) : ℝ) < 2*s) + (x₀ : X) (c : ℝ) : D.realEvaluation s x₀ (D.realConstants s c) = c := by + change (D.pointEvaluation s x₀ (D.localizers.embed s (Smooth.const (c : ℂ)))).re = c + rw [D.pointEvaluation_embed hs] + rfl + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/RealPoissonEquivalence.lean b/lean/OAI/Geometry/PrescribedPotential/RealPoissonEquivalence.lean new file mode 100644 index 0000000000000000000000000000000000000000..6270ddab3c38929afec6a1452b34690ad81d2b33 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/RealPoissonEquivalence.lean @@ -0,0 +1,89 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.BoundedPoisson +import OAI.Geometry.PrescribedPotential.RealPoisson + +namespace OAI + +/-! Real Poisson Equivalence. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +local instance realPoissonEquivalenceNormedAddCommGroup (s : ℝ) : + NormedAddCommGroup (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedAddCommGroup +local instance realPoissonEquivalenceNormedSpace (s : ℝ) : + NormedSpace ℝ (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedSpace +local instance realPoissonEquivalenceIsTopologicalAddGroup (s : ℝ) : + IsTopologicalAddGroup (D.localizers.RealSobolev s) := + Submodule.isTopologicalAddGroup _ +local instance realPoissonEquivalenceContinuousSMul (s : ℝ) : + ContinuousSMul ℝ (D.localizers.RealSobolev s) := + SMulMemClass.continuousSMul _ + +def realAugmentedL (k : ℕ) (x₀ : X) : + (D.localizers.RealSobolev ((k : ℝ)+2) × ℝ) →L[ℝ] + (D.localizers.RealSobolev (k : ℝ) × ℝ) := + ((D.realLOrder k ∘L ContinuousLinearMap.fst ℝ (D.localizers.RealSobolev ((k : ℝ)+2)) ℝ) - + (D.realConstants (k : ℝ) ∘L ContinuousLinearMap.snd ℝ (D.localizers.RealSobolev ((k : ℝ)+2)) ℝ)).prod + (D.realEvaluation ((k : ℝ)+2) x₀ ∘L ContinuousLinearMap.fst ℝ (D.localizers.RealSobolev ((k : ℝ)+2)) ℝ) + +lemma realAugmentedL_bijective (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) (k : ℕ) + (hk : (Module.finrank ℝ (EC d) : ℝ) < 2*((k : ℝ)+2)) (x₀ : X) : + Function.Bijective (D.realAugmentedL k x₀) := by + constructor + · apply (LinearMap.ker_eq_bot).mp + apply LinearMap.ker_eq_bot'.mpr + rintro ⟨u,c⟩ h + have hl : D.realLOrder k u = D.realConstants (k : ℝ) c := sub_eq_zero.mp (congrArg Prod.fst h) + have hcplx : D.completedLOrder k u.val = D.localizers.constantsOrder (k : ℝ) (c : ℂ) := + congrArg Subtype.val hl + obtain ⟨a, ha, hc⟩ := D.completedLOrder_constant_kernel m hm he k u.val (c : ℂ) hcplx + have hn : D.realEvaluation ((k : ℝ)+2) x₀ u = 0 := congrArg Prod.snd h + change (D.pointEvaluation ((k : ℝ)+2) x₀ u.val).re = 0 at hn + rw [ha, Localizers.constantsOrder_apply, D.pointEvaluation_embed hk] at hn + have hi := D.localizers.real_strong hk u x₀ + rw [ha, Localizers.constantsOrder_apply, D.localizers.strong_embed _ hk] at hi + have ha0 : a = 0 := Complex.ext hn hi + have hu0 : u = 0 := by apply Subtype.ext; rw [ha, ha0, map_zero]; rfl + have hc0 : c = 0 := Complex.ofReal_eq_zero.mp hc + exact Prod.ext hu0 hc0 + · rintro ⟨f,a⟩ + refine ⟨(D.realPointPoisson m hm he P k hk x₀ f + D.realConstants ((k : ℝ)+2) a, + D.realResidue m hm he P k f), ?_⟩ + apply Prod.ext + · change D.realLOrder k (_ + _) - _ = f + rw [map_add, D.realPointPoisson_equation, D.realLOrder_constants, add_zero] + exact add_sub_cancel_right _ _ + · change D.realEvaluation ((k : ℝ)+2) x₀ (_ + _) = a + rw [map_add, D.realPointPoisson_normalized, D.realEvaluation_constants hk, zero_add] + +def realPoissonEquiv (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) (k : ℕ) + (hk : (Module.finrank ℝ (EC d) : ℝ) < 2*((k : ℝ)+2)) (x₀ : X) : + (D.localizers.RealSobolev ((k : ℝ)+2) × ℝ) ≃L[ℝ] + (D.localizers.RealSobolev (k : ℝ) × ℝ) := + ContinuousLinearEquiv.ofBijective (D.realAugmentedL k x₀) + (LinearMap.ker_eq_bot.mpr (D.realAugmentedL_bijective m hm he P k hk x₀).1) + (LinearMap.range_eq_top.mpr (D.realAugmentedL_bijective m hm he P k hk x₀).2) + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/RealSmoothCompactness.lean b/lean/OAI/Geometry/PrescribedPotential/RealSmoothCompactness.lean new file mode 100644 index 0000000000000000000000000000000000000000..4f4b86ed5cb5f96bfcae25138760095538c6f518 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/RealSmoothCompactness.lean @@ -0,0 +1,81 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalStrongEmbedding +import OAI.Geometry.PrescribedPotential.PatchCutoffs +import OAI.Geometry.PrescribedPotential.RealSobolev +import OAI.Geometry.PrescribedPotential.SmoothSequenceCompactness + +namespace OAI + +/-! Real Smooth Compactness. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace Localizers +variable (D : Localizers A ι) + +lemma smooth_tendsto_real_order (f : ℕ → Smooth A) (fLim : Smooth A) + (hf : ∀ k : ℕ, Tendsto (fun n => D.embed (k : ℝ) (f n)) atTop + (𝓝 (D.embed (k : ℝ) fLim))) (s : ℝ) : + Tendsto (fun n => D.embed s (f n)) atTop (𝓝 (D.embed s fLim)) := by + obtain ⟨k,hk⟩ := exists_nat_ge s + have hh := D.lower_tendsto_smooth hk f (D.embed (k : ℝ) fLim) (hf k) + simpa only [D.lower_embed hk] using hh + +lemma smooth_value_tendsto (s : ℝ) (hs : (Module.finrank ℝ (EC d) : ℝ) < 2*s) + (f : ℕ → Smooth A) (fLim : Smooth A) + (hf : Tendsto (fun n => D.embed s (f n)) atTop (𝓝 (D.embed s fLim))) (x : X) : + Tendsto (fun n => f n x) atTop (𝓝 (fLim x)) := by + have hc : Continuous (fun u : D.Sobolev s => D.strong s u x) := + (D.strong s).continuous.eval continuous_const + have ht := (hc.tendsto (D.embed s fLim)).comp hf + simpa only [Function.comp_def,D.strong_embed s hs,Smooth.bounded, + BoundedContinuousFunction.mkOfCompact_apply,ContinuousMap.coe_mk] using ht + +lemma smooth_limit_real (f : ℕ → RealSmooth A) (fLim : Smooth A) + (hf : ∀ s : ℝ, Tendsto (fun n => D.embed s (f n).val) atTop + (𝓝 (D.embed s fLim))) : ∀ x, (fLim x).im = 0 := by + intro x + let s : ℝ := (Module.finrank ℝ (EC d) : ℝ)+1 + have hs : (Module.finrank ℝ (EC d) : ℝ) < 2*s := by + dsimp only [s] + linarith [Nat.cast_nonneg (α := ℝ) (Module.finrank ℝ (EC d))] + have hv := D.smooth_value_tendsto s hs (fun n => (f n).val) fLim (hf s) x + have hh := (Complex.continuous_im.tendsto (fLim x)).comp hv + have he : (fun n => ((f n).val x).im) = (fun _ : ℕ => (0 : ℝ)) := + funext (fun n => (f n).property x) + change Tendsto (fun n => ((f n).val x).im) atTop (𝓝 (fLim x).im) at hh + rw [he] at hh + exact tendsto_nhds_unique hh tendsto_const_nhds + +end Localizers +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + + + +theorem real_smooth_sequence_compact (f : ℕ → RealSmooth A) + (hbound : ∀ k : ℕ, ∃ C : ℝ, ∀ n : ℕ, + ‖D.localizers.embed (((2*k : ℕ) : ℝ)+2) (f n).val‖ ≤ C) : + ∃ (fLim : RealSmooth A) (r : ℕ → ℕ), StrictMono r ∧ ∀ s : ℝ, + Tendsto (fun n => D.localizers.embed s (f (r n)).val) atTop + (𝓝 (D.localizers.embed s fLim.val)) := by + obtain ⟨fLim,r,hr,hf⟩ := D.smooth_sequence_compact (fun n => (f n).val) hbound + have hf' := D.localizers.smooth_tendsto_real_order (fun n => (f (r n)).val) fLim hf + exact ⟨⟨fLim,D.localizers.smooth_limit_real (fun n => f (r n)) fLim hf'⟩,r,hr,hf'⟩ + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/RealSmoothOperator.lean b/lean/OAI/Geometry/PrescribedPotential/RealSmoothOperator.lean new file mode 100644 index 0000000000000000000000000000000000000000..8bcdb959220fc329757f324cebf15268e6621db7 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/RealSmoothOperator.lean @@ -0,0 +1,82 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.NormalizedPoisson +import OAI.Geometry.PrescribedPotential.RealSobolev + +namespace OAI + +/-! Real Smooth Operator. -/ + +section + + + +noncomputable section +namespace Anticanonical.SourceSmooth.SmoothRealFunction +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +lemma ext_value {f h : SmoothRealFunction A} (he : f.value = h.value) : f = h := by + cases f + cases h + cases he + rfl +end Anticanonical.SourceSmooth.SmoothRealFunction +namespace GlobalElliptic +open Anticanonical SourceSmooth +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +lemma Smooth.ofReal_part_re (f : SmoothRealFunction A) : + (Smooth.ofReal f).part Complex.reCLM = f := + SmoothRealFunction.ext_value rfl + +lemma Smooth.ofReal_part_im (f : SmoothRealFunction A) : + (Smooth.ofReal f).part Complex.imCLM = SmoothRealFunction.constant 0 := + SmoothRealFunction.ext_value rfl + +lemma laplacian_constant (g : KaehlerMetric A) (c : ℝ) : + g.laplacian (SmoothRealFunction.constant c) = SmoothRealFunction.constant 0 := by + apply SmoothRealFunction.ext_value + funext x + obtain ⟨i, hi⟩ := A.covers x + change g.laplacianValue (SmoothRealFunction.constant c) x = 0 + rw [g.laplacianValue_local _ i hi, g.linearizedMongeAmpere_constant] + rfl + +lemma complexL_ofReal (g : KaehlerMetric A) (f : SmoothRealFunction A) : + complexL g (Smooth.ofReal f) = Smooth.ofReal (g.laplacian f) := by + apply Smooth.ext + intro x + apply Complex.ext + · rw [complexL_re, Smooth.ofReal_part_re] + rfl + · rw [complexL_im, Smooth.ofReal_part_im, laplacian_constant] + rfl + +lemma exists_real_smooth_poisson [T2Space X] [CompactSpace X] [ConnectedSpace X] + (g : KaehlerMetric A) (x₀ : X) (f : RealSmooth A) : + ∃ (u : RealSmooth A) (c : ℝ), u.val x₀ = 0 ∧ + complexL g u.val = f.val + Smooth.const (c : ℂ) := by + obtain ⟨φ, b, hφ, he⟩ := normalizedPoisson d X A g x₀ f.source + refine ⟨RealSmooth.ofReal φ, -b, ?_, ?_⟩ + · change (φ.value x₀ : ℂ) = 0 + rw [hφ, Complex.ofReal_zero] + · change complexL g (Smooth.ofReal φ) = _ + rw [complexL_ofReal, ← RealSmooth.ofReal_source f] + apply Smooth.ext + intro x + obtain ⟨i, hi⟩ := A.covers x + have hh := he i (A.chart i x) ((A.chart i).mapsTo hi) + have hl : (g.laplacian φ).value x = g.linearizedMongeAmpere φ i (A.chart i x) := + g.laplacianValue_local φ i hi + have hf : f.source.localExpression i (A.chart i x) = f.source.value x := by + change f.source.value ((A.chart i).symm (A.chart i x)) = _ + rw [(A.chart i).left_inv hi] + rw [hf, ← hl] at hh + change ((g.laplacian φ).value x : ℂ) = (f.source.value x : ℂ) + ((-b : ℝ) : ℂ) + rw [← Complex.ofReal_add] + congr 1 + linarith +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/RealSobolev.lean b/lean/OAI/Geometry/PrescribedPotential/RealSobolev.lean new file mode 100644 index 0000000000000000000000000000000000000000..6bc6e2ac8e93bb30ae3d84e46d8b845d10f613a0 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/RealSobolev.lean @@ -0,0 +1,131 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CircleRadialCalculus +import OAI.Geometry.PrescribedPotential.ComplexKernel +import OAI.Geometry.PrescribedPotential.GlobalStrongEmbedding +import OAI.Geometry.PrescribedPotential.MatrixHilbertCoordinates + +namespace OAI + +/-! Real Sobolev. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical +namespace ClosedCore +variable {V W H G : Type*} [TopologicalSpace H] [TopologicalSpace G] +lemma maps_closure_range (e : V → H) (q : W → G) (L : H → G) (hL : Continuous L) + (he : ∀ f, ∃ h, L (e f) = q h) : + ∀ u ∈ closure (range e), L u ∈ closure (range q) := by + apply closure_minimal _ (isClosed_closure.preimage hL) + rintro _ ⟨f, rfl⟩ + obtain ⟨h, hh⟩ := he f + exact subset_closure ⟨h, hh.symm⟩ +end ClosedCore + +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +def realSmoothSpace (A : ComplexAtlas d X) : Submodule ℝ (Smooth A) where + carrier := {f | ∀ x, (f x).im = 0} + zero_mem' := by intro x; rfl + add_mem' := by intro f h hf hh x; simp [hf x, hh x] + smul_mem' := by intro c f hf x; simp [hf x] + +abbrev RealSmooth (A : ComplexAtlas d X) := ↥(realSmoothSpace A) + +namespace RealSmooth + +def ofReal (f : SmoothRealFunction A) : RealSmooth A := + ⟨Smooth.ofReal f, fun _ => Complex.ofReal_im _⟩ + +def source (f : RealSmooth A) : SmoothRealFunction A := f.val.part Complex.reCLM + +lemma ofReal_source (f : RealSmooth A) : Smooth.ofReal f.source = f.val := by + apply Smooth.ext + intro x + exact Complex.ext rfl (f.property x).symm + +def const (r : ℝ) : RealSmooth A := ⟨Smooth.const r, fun _ => Complex.ofReal_im _⟩ + +lemma complexL_real (g : KaehlerMetric A) (f : RealSmooth A) : + complexL g f.val ∈ realSmoothSpace A := by + intro x + rw [complexL_im] + have hi : f.val.part Complex.imCLM = SmoothRealFunction.constant 0 := by + cases h : f.val.part Complex.imCLM with + | mk v hv => + have he : v = fun _ => 0 := by + funext x + have hh := congrArg (fun u : SmoothRealFunction A => u.value x) h + exact hh.symm.trans (f.property x) + subst v + rfl + rw [hi] + obtain ⟨i, hi⟩ := A.covers x + change g.laplacianValue (SmoothRealFunction.constant 0) x = 0 + rw [g.laplacianValue_local _ i hi, g.linearizedMongeAmpere_constant] + rfl + +def laplace (g : KaehlerMetric A) : RealSmooth A →ₗ[ℝ] RealSmooth A := + ((complexL g).comp (realSmoothSpace A).subtype).codRestrict (realSmoothSpace A) + (fun f => complexL_real g f) + +end RealSmooth + +variable [T2Space X] [CompactSpace X] {ι : Type*} [Fintype ι] +namespace Localizers +variable (D : Localizers A ι) + +def realCoreMap (s : ℝ) : RealSmooth A →ₗ[ℝ] D.Sobolev s := + (D.embed s).comp (realSmoothSpace A).subtype + +def realCompletion (s : ℝ) : Submodule ℝ (D.Sobolev s) := + (D.realCoreMap s).range.topologicalClosure + +abbrev RealSobolev (s : ℝ) := ↥(D.realCompletion s) + +instance realSobolev_complete (s : ℝ) : CompleteSpace (D.RealSobolev s) := + inferInstanceAs (CompleteSpace (D.realCoreMap s).range.topologicalClosure) + +def realEmbed (s : ℝ) : RealSmooth A →ₗ[ℝ] D.RealSobolev s := + (D.realCoreMap s).codRestrict (D.realCompletion s) + (fun f => (D.realCoreMap s).range.le_topologicalClosure (LinearMap.mem_range_self _ f)) + +@[simp] lemma realEmbed_val (s : ℝ) (f : RealSmooth A) : + (D.realEmbed s f).val = D.embed s f.val := rfl + +lemma realEmbed_dense (s : ℝ) : DenseRange (D.realEmbed s) := by + rw [DenseRange, Subtype.dense_iff] + change closure ((D.realCoreMap s).range : Set (D.Sobolev s)) ⊆ _ + apply closure_mono + rintro _ ⟨f, rfl⟩ + exact ⟨D.realEmbed s f, ⟨f, rfl⟩, rfl⟩ + +lemma maps_realCompletion {s t : ℝ} (L : D.Sobolev s →L[ℝ] D.Sobolev t) + (hL : ∀ f : RealSmooth A, ∃ h : RealSmooth A, L (D.embed s f.val) = D.embed t h.val) : + ∀ u ∈ D.realCompletion s, L u ∈ D.realCompletion t := by + exact ClosedCore.maps_closure_range (D.realCoreMap s) (D.realCoreMap t) L L.continuous hL + +lemma real_strong {s : ℝ} (hs : (Module.finrank ℝ (EC d) : ℝ) < 2*s) + (u : D.RealSobolev s) (x : X) : (D.strong s u.val x).im = 0 := by + have hc : IsClosed {v : D.Sobolev s | (D.strong s v x).im = 0} := + isClosed_eq (Complex.continuous_im.comp ((BoundedContinuousFunction.lipschitz_eval_const x).continuous.comp + (D.strong s).continuous)) continuous_const + apply closure_minimal (s := ((D.realCoreMap s).range : Set (D.Sobolev s))) _ hc u.property + rintro _ ⟨f, rfl⟩ + change (D.strong s (D.embed s f.val) x).im = 0 + rw [D.strong_embed s hs] + exact f.property x + +end Localizers +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/RealVolume.lean b/lean/OAI/Geometry/PrescribedPotential/RealVolume.lean new file mode 100644 index 0000000000000000000000000000000000000000..0994933cb2ebdafa0a1104c9a94fafda4a3c26d4 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/RealVolume.lean @@ -0,0 +1,141 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.RealSmoothOperator +import OAI.Geometry.PrescribedPotential.CompletedVolume +import OAI.Geometry.PrescribedPotential.RealPoisson + +namespace OAI + +/-! Real Volume. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical BoundedContinuousFunction ComplexOrder +namespace RealClosedDerivative +variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] + +lemma subtype_iff (S : Submodule ℝ F) (f : E → S) (L : E →L[ℝ] S) (x : E) : + HasStrictFDerivAt f L x ↔ + HasStrictFDerivAt (fun y => (f y).val) (S.subtypeL ∘L L) x := by + simp only [hasStrictFDerivAt_iff_isLittleO] + conv_lhs => rw [← Asymptotics.isLittleO_norm_left] + conv_rhs => rw [← Asymptotics.isLittleO_norm_left] + rfl +end RealClosedDerivative + +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +local instance (s : ℝ) : NormedAddCommGroup (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedAddCommGroup +local instance (s : ℝ) : NormedSpace ℝ (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedSpace +local instance (s : ℝ) : IsTopologicalAddGroup (D.localizers.RealSobolev s) := + Submodule.isTopologicalAddGroup _ +local instance (s : ℝ) : ContinuousSMul ℝ (D.localizers.RealSobolev s) := + SMulMemClass.continuousSMul _ + +def realVolume (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (u : D.localizers.RealSobolev ((k : ℝ)+2)) : D.localizers.RealSobolev (k : ℝ) := + ⟨D.completedVolume k hk u.val, D.completedVolume_real k hk u.val u.property⟩ + +lemma realVolume_continuous (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) : + Continuous (D.realVolume k hk) := + ((D.completedVolume_contDiff k hk).continuous.comp continuous_subtype_val).subtype_mk _ + +lemma realVolume_ambient_contDiff (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) : + ContDiff ℝ ∞ (fun u : D.localizers.RealSobolev ((k : ℝ)+2) => (D.realVolume k hk u).val) := + (D.completedVolume_contDiff k hk).comp (D.localizers.realCompletion ((k : ℝ)+2)).subtypeL.contDiff + +lemma completedVolume_real_directional (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (f : RealSmooth A) (x : X) : + HasDerivAt (fun t : ℝ => D.localizers.strong (k : ℝ) + (D.completedVolume k hk (t • D.localizers.embed ((k : ℝ)+2) f.val)) x) + (complexL g f.val x) 0 := by + have hs : (Module.finrank ℝ (EC d) : ℝ) < 2*(k : ℝ) := by + have hh : (Module.finrank ℝ (EC d) : ℝ) < (k : ℝ) := by exact_mod_cast hk + linarith [Nat.cast_nonneg (α := ℝ) k] + have he (t : ℝ) : t • D.localizers.embed ((k : ℝ)+2) f.val = + D.localizers.embed ((k : ℝ)+2) (Smooth.ofReal (f.source.realSMul t)) := by + rw [← map_smul, ← f.ofReal_source] + congr 1 + ext y + simp [SmoothRealFunction.realSMul, Complex.real_smul] + have hd := Complex.ofRealCLM.hasFDerivAt.comp_hasDerivAt 0 + (g.potentialDensity_directional f.source x) + have hl : complexL g f.val x = ((g.laplacian f.source).value x : ℂ) := by + rw [← f.ofReal_source, complexL_ofReal] + rfl + rw [hl] + apply hd.congr_of_eventuallyEq + filter_upwards [] with t + rw [he, D.completedVolume_embed, D.localizers.strong_embed _ hs] + rfl + +lemma realVolume_hasStrictFDerivAt_zero (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) : + HasStrictFDerivAt (D.realVolume k hk) (D.realLOrder k) 0 := by + let F := fun u : D.localizers.RealSobolev ((k : ℝ)+2) => (D.realVolume k hk u).val + let J := fderiv ℝ F 0 + have hJ : HasStrictFDerivAt F J 0 := (D.realVolume_ambient_contDiff k hk).hasStrictFDerivAt (by simp) + have hs : (Module.finrank ℝ (EC d) : ℝ) < 2*(k : ℝ) := by + have hh : (Module.finrank ℝ (EC d) : ℝ) < (k : ℝ) := by exact_mod_cast hk + linarith [Nat.cast_nonneg (α := ℝ) k] + have hj : J = (D.localizers.realCompletion (k : ℝ)).subtypeL ∘L D.realLOrder k := by + apply DFunLike.coe_injective + apply (D.localizers.realEmbed_dense ((k : ℝ)+2)).equalizer J.continuous (by fun_prop) + funext f + apply D.localizers.strong_injective (k : ℝ) hs + ext x + let v := D.localizers.realEmbed ((k : ℝ)+2) f + have hc : HasDerivAt (fun t : ℝ => t • v) v 0 := by + simpa using (hasDerivAt_id (0 : ℝ)).smul_const v + have hF : HasFDerivAt F J ((0 : ℝ) • v) := by simpa using hJ.hasFDerivAt + have hv := hF.comp_hasDerivAt 0 hc + have he := (D.pointEvaluation (k : ℝ) x).hasFDerivAt.comp_hasDerivAt 0 hv + have hdr := D.completedVolume_real_directional k hk f x + have heq := he.unique hdr + change D.localizers.strong (k : ℝ) (J v) x = complexL g f.val x at heq + change D.localizers.strong (k : ℝ) (J v) x = _ + rw [heq] + change complexL g f.val x = D.localizers.strong (k : ℝ) + (D.completedLOrder k (D.localizers.embed ((k : ℝ)+2) f.val)) x + rw [D.completedLOrder_embed, D.localizers.strong_embed _ hs] + rfl + apply (RealClosedDerivative.subtype_iff (D.localizers.realCompletion (k : ℝ)) _ _ _).mpr + rw [← hj] + exact hJ + +lemma realVolume_zero (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) : + D.realVolume k hk 0 = D.realConstants (k : ℝ) 1 := by + have h₀ : Smooth.ofReal (SmoothRealFunction.constant (A := A) 0) = 0 := by + ext x + change (↑(0 : ℝ) : ℂ) = 0 + exact Complex.ofReal_zero + have hv := D.completedVolume_embed k hk (SmoothRealFunction.constant (A := A) 0) + rw [h₀, map_zero] at hv + apply Subtype.ext + change D.completedVolume k hk 0 = D.localizers.embed (k : ℝ) (Smooth.const (↑(1 : ℝ))) + rw [hv] + congr 1 + ext x + obtain ⟨i, hi⟩ := A.covers x + change ((g.potentialDensity (SmoothRealFunction.constant 0)).value x : ℂ) = 1 + rw [g.potentialDensity_complex _ i hi] + simp only [KaehlerMetric.volumePolynomial, SmoothRealFunction.hessian_constant, add_zero] + exact div_self (ne_of_gt (g.positive i _ ((A.chart i).mapsTo hi)).det_pos) + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/RegularityCoordinates.lean b/lean/OAI/Geometry/PrescribedPotential/RegularityCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..339d84fdb7576717d86e734be6ab1840b6884138 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/RegularityCoordinates.lean @@ -0,0 +1,119 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalMetricEntries +import OAI.Geometry.PrescribedPotential.GlobalParametrixEquation +import OAI.Geometry.PrescribedPotential.LocalizedDerivations +import OAI.Geometry.PrescribedPotential.RegularityJets + +namespace OAI + +/-! Regularity Coordinates. -/ + +section + + + +noncomputable section +open Set Filter Topology LineDeriv +open scoped ContDiff SchwartzMap Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] + +lemma localize_cutoff_nhds (q : Fin A.count) (η : ChartCutoff (A.euclideanChart q).target) + (f : Smooth A) {y : EC d} (hy : y ∈ (A.euclideanChart q).target) + (hη : (η : EC d → ℂ) =ᶠ[𝓝 y] (fun _ => 1)) : + (localize A q (cutoffGlobal q η) (cutoffGlobal_support q η) f : EC d → ℂ) + =ᶠ[𝓝 y] f ∘ (A.euclideanChart q).symm := by + filter_upwards [(A.euclideanChart q).open_target.mem_nhds hy,hη] with z hz he + rw [localize_apply,localizeFun_apply A _ _ hz] + have hs : (A.euclideanChart q).symm z ∈ (A.euclideanChart q).source := + (A.euclideanChart q).symm.mapsTo hz + change (if (A.euclideanChart q).symm z ∈ (A.euclideanChart q).source then + η (A.euclideanChart q ((A.euclideanChart q).symm z)) else 0) * _ = _ + rw [ite_eq_left hs,(A.euclideanChart q).right_inv hz,he,one_mul] + rfl + +lemma hessianEntrySchwartz_congr {f h : 𝓢(EC d, ℂ)} {y : EC d} + (he : (f : EC d → ℂ) =ᶠ[𝓝 y] (h : EC d → ℂ)) (i j : Fin d) : + hessianEntrySchwartz i j f y = hessianEntrySchwartz i j h y := by + simp only [hessianEntrySchwartz_apply,(he.fderiv (𝕜 := ℝ)).fderiv_eq] + +omit [CompactSpace X] in +lemma chartFunction_local (q : Fin A.count) (κ : ChartCutoff (A.euclideanChart q).target) + (f : EC d → ℂ) (hf : ContDiffOn ℝ ∞ f (A.euclideanChart q).target) + {y : EC d} (hy : y ∈ (A.euclideanChart q).target) : + (chartFunction q κ f hf ∘ (A.euclideanChart q).symm) =ᶠ[𝓝 y] (fun z => κ z * f z) := by + filter_upwards [(A.euclideanChart q).open_target.mem_nhds hy] with z hz + rw [Function.comp_apply,chartFunction_apply _ _ _ _ ((A.euclideanChart q).symm.mapsTo hz), + (A.euclideanChart q).right_inv hz] + +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +omit [T2Space X] [CompactSpace X] in +lemma cutoff_support_regularity (p : ι) : + tsupport (D.cutoff p : EC d → ℂ) ⊆ tsupport (D.regularityCutoff p : EC d → ℂ) := by + intro y hy + apply subset_tsupport + change D.regularityCutoff p y ≠ 0 + rw [(D.regularityCutoff_one p hy).eq_of_nhds] + exact one_ne_zero + +omit [T2Space X] [CompactSpace X] in +lemma regularityOuter_inner (p : ι) {y : EC d} + (hy : y ∈ tsupport (D.cutoff p : EC d → ℂ)) : + (D.regularityOuter p : EC d → ℂ) =ᶠ[𝓝 y] (fun _ => 1) := + D.regularityOuter_one p (D.cutoff_support_regularity p hy) + +lemma localizedDerivative_regularity (p : ι) (v : EC d) (f : Smooth A) : + D.localizedDerivative p v f = globalize (D.patch p).index (D.cutoff p).realPart + (∂_{v} (localize A (D.patch p).index (cutoffGlobal (D.patch p).index (D.regularityOuter p)) + (cutoffGlobal_support _ _) f)) := by + apply Smooth.ext + intro x + rw [D.localizedDerivative_apply,globalize_apply] + split_ifs with hx + · by_cases hκ : (D.cutoff p).realPart (A.euclideanChart (D.patch p).index x) = 0 + · rw [hκ,zero_mul,zero_mul] + · have ht := (A.euclideanChart (D.patch p).index).mapsTo hx + have hs := (D.cutoff p).realPart_support (subset_tsupport _ hκ) + have he := localize_cutoff_nhds (D.patch p).index (D.regularityOuter p) f ht + (D.regularityOuter_inner p hs) + rw [SchwartzMap.lineDerivOp_apply_eq_fderiv,he.fderiv_eq] + · rfl + +lemma localizedDerivative_local_regularity (p : ι) (v : EC d) (f : Smooth A) + {y : EC d} (hy : y ∈ (A.euclideanChart (D.patch p).index).target) : + (D.localizedDerivative p v f ∘ (A.euclideanChart (D.patch p).index).symm) =ᶠ[𝓝 y] + (SchwartzMap.smulLeftCLM ℂ (D.cutoff p).realPart.val + (∂_{v} (localize A (D.patch p).index (cutoffGlobal (D.patch p).index (D.regularityOuter p)) + (cutoffGlobal_support _ _) f)) : EC d → ℂ) := by + rw [D.localizedDerivative_regularity] + exact globalize_local _ _ _ hy + +lemma regularityHessian_localizedDerivative (p : ι) (v : EC d) (f : Smooth A) + (i j : Fin d) {x : X} + (hx : x ∈ (A.euclideanChart (D.patch p).index).source) + (hκ : A.euclideanChart (D.patch p).index x ∈ tsupport (D.cutoff p : EC d → ℂ)) : + D.regularityHessian p i j (D.localizedDerivative p v f) x = + hessianEntrySchwartz i j (SchwartzMap.smulLeftCLM ℂ (D.cutoff p).realPart.val + (∂_{v} (localize A (D.patch p).index (cutoffGlobal (D.patch p).index (D.regularityOuter p)) + (cutoffGlobal_support _ _) f))) (A.euclideanChart (D.patch p).index x) := by + change globalize (D.patch p).index (D.regularityCutoff p) + (hessianEntrySchwartz i j (localize A (D.patch p).index + (cutoffGlobal (D.patch p).index (D.regularityOuter p)) (cutoffGlobal_support _ _) + (D.localizedDerivative p v f))) x = _ + rw [globalize_apply,ite_eq_left hx,(D.regularityCutoff_one p hκ).eq_of_nhds,one_mul] + apply hessianEntrySchwartz_congr + exact (localize_cutoff_nhds _ _ _ ((A.euclideanChart (D.patch p).index).mapsTo hx) + (D.regularityOuter_inner p hκ)).trans + (D.localizedDerivative_local_regularity p v f ((A.euclideanChart (D.patch p).index).mapsTo hx)) + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/RegularityCutoffs.lean b/lean/OAI/Geometry/PrescribedPotential/RegularityCutoffs.lean new file mode 100644 index 0000000000000000000000000000000000000000..8569099bc000ddbb5849aded88e023b92d36bc90 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/RegularityCutoffs.lean @@ -0,0 +1,124 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.LocalizedDerivations +import OAI.Geometry.PrescribedPotential.RealSobolev + +namespace OAI + +/-! Regularity Cutoffs. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory Manifold IsManifold +open scoped ContDiff SchwartzMap Classical +namespace GlobalElliptic +open Anticanonical EllipticKernel SobolevChart SourceSmooth +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] + +lemma exists_chartCutoff_nhds {K U : Set E} (hK : IsCompact K) (hU : IsOpen U) (hKU : K ⊆ U) : + ∃ κ : ChartCutoff U, (∀ x, (κ x).im = 0) ∧ + ∀ x ∈ K, (κ : E → ℂ) =ᶠ[𝓝 x] (fun _ => 1) := by + obtain ⟨L, hLc, hLl, hKL, hLU⟩ := exists_compact_closed_between hK hU hKU + obtain ⟨f, hf, hf0, _⟩ := exists_contMDiffMap_one_nhds_of_subset_interior + (𝓘(ℝ, E)) hK.isClosed hKL (n := ⊤) + have hsm : ContDiff ℝ ∞ (fun x => (f x : ℂ)) := + Complex.ofRealCLM.contDiff.comp (contMDiff_iff_contDiff.mp f.contMDiff) + have hsub : tsupport (fun x => (f x : ℂ)) ⊆ L := by + apply closure_minimal _ hLl + intro x hx + by_contra hn + exact hx (by simp [hf0 x hn]) + have hc : HasCompactSupport (fun x => (f x : ℂ)) := + hLc.of_isClosed_subset (isClosed_tsupport _) hsub + refine ⟨⟨hc.toSchwartzMap hsm, hc, hsub.trans hLU⟩, fun _ => Complex.ofReal_im _, ?_⟩ + intro x hx + filter_upwards [hf.filter_mono (nhds_le_nhdsSet hx)] with y hy + change (f y : ℂ) = 1 + rw [hy] + rfl + +variable {d : ℕ} {X : Type*} [TopologicalSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +lemma exists_regularityCutoff (p : ι) : + ∃ η : ChartCutoff (A.euclideanChart (D.patch p).index).target, + (∀ x, (η x).im = 0) ∧ + ∀ x ∈ tsupport (D.cutoff p : EC d → ℂ), + (η : EC d → ℂ) =ᶠ[𝓝 x] (fun _ => 1) := + exists_chartCutoff_nhds (D.cutoff p).compact + (A.euclideanChart (D.patch p).index).open_target (D.cutoff p).support_sub + +def regularityCutoff (p : ι) : ChartCutoff (A.euclideanChart (D.patch p).index).target := + (D.exists_regularityCutoff p).choose + +lemma regularityCutoff_real (p : ι) (x : EC d) : (D.regularityCutoff p x).im = 0 := + (D.exists_regularityCutoff p).choose_spec.1 x + +lemma regularityCutoff_one (p : ι) {x : EC d} + (hx : x ∈ tsupport (D.cutoff p : EC d → ℂ)) : + (D.regularityCutoff p : EC d → ℂ) =ᶠ[𝓝 x] (fun _ => 1) := + (D.exists_regularityCutoff p).choose_spec.2 x hx + +lemma exists_regularityOuter (p : ι) : + ∃ η : ChartCutoff (A.euclideanChart (D.patch p).index).target, + (∀ x, (η x).im = 0) ∧ + ∀ x ∈ tsupport (D.regularityCutoff p : EC d → ℂ), + (η : EC d → ℂ) =ᶠ[𝓝 x] (fun _ => 1) := + exists_chartCutoff_nhds (D.regularityCutoff p).compact + (A.euclideanChart (D.patch p).index).open_target (D.regularityCutoff p).support_sub + +def regularityOuter (p : ι) : ChartCutoff (A.euclideanChart (D.patch p).index).target := + (D.exists_regularityOuter p).choose + +lemma regularityOuter_one (p : ι) {x : EC d} + (hx : x ∈ tsupport (D.regularityCutoff p : EC d → ℂ)) : + (D.regularityOuter p : EC d → ℂ) =ᶠ[𝓝 x] (fun _ => 1) := + (D.exists_regularityOuter p).choose_spec.2 x hx + +variable [T2Space X] [CompactSpace X] + +lemma localizedDerivative_real (p : ι) (v : EC d) (f : RealSmooth A) : + D.localizedDerivative p v f.val ∈ realSmoothSpace A := by + intro x + rw [D.localizedDerivative_apply] + split_ifs with hx + · have ht := (A.euclideanChart (D.patch p).index).mapsTo hx + have hd : DifferentiableAt ℝ (f.val ∘ (A.euclideanChart (D.patch p).index).symm) + (A.euclideanChart (D.patch p).index x) := + ((f.val.smooth (D.patch p).index).contDiffAt + ((A.euclideanChart (D.patch p).index).open_target.mem_nhds ht)).differentiableAt (by simp) + have he : (fun y : EC d => (f.val ((A.euclideanChart (D.patch p).index).symm y)).im) = + (fun _ => 0) := funext (fun y => f.property _) + have hh := congrArg (fun L : EC d →L[ℝ] ℝ => L v) + ((Complex.imCLM.hasFDerivAt.comp _ hd.hasFDerivAt).fderiv) + change fderiv ℝ (fun y => (f.val ((A.euclideanChart (D.patch p).index).symm y)).im) + (A.euclideanChart (D.patch p).index x) v = _ at hh + rw [he, fderiv_const_apply, zero_apply] at hh + simp only [ChartCutoff.realPart_apply, Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, + zero_mul, add_zero] + exact mul_eq_zero_of_right _ hh.symm + · rfl + +def realLocalizedDerivative (p : ι) (v : EC d) : RealSmooth A →ₗ[ℝ] RealSmooth A := + ((D.localizedDerivative p v).comp (realSmoothSpace A).subtype).codRestrict + (realSmoothSpace A) (D.localizedDerivative_real p v) + +lemma completedDerivative_real (k : ℕ) (p : ι) (v : EC d) : + ∀ u ∈ D.localizers.realCompletion ((k : ℝ)+1), + D.completedDerivative k p v u ∈ D.localizers.realCompletion (k : ℝ) := by + apply D.localizers.maps_realCompletion + intro f + exact ⟨D.realLocalizedDerivative p v f,D.completedDerivative_embed k p v f.val⟩ + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/RegularityJets.lean b/lean/OAI/Geometry/PrescribedPotential/RegularityJets.lean new file mode 100644 index 0000000000000000000000000000000000000000..7ad69461680ef54bcb8a0d12ea9929a5acaf84e8 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/RegularityJets.lean @@ -0,0 +1,136 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalHessian +import OAI.Geometry.PrescribedPotential.HessianCommutator +import OAI.Geometry.PrescribedPotential.RegularityCutoffs + +namespace OAI + +/-! Regularity Jets. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory +open scoped ContDiff SchwartzMap Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] + +def chartOperator (q : Fin A.count) (κ η : ChartCutoff (A.euclideanChart q).target) + (T : 𝓢(EC d, ℂ) →L[ℂ] 𝓢(EC d, ℂ)) : Smooth A →ₗ[ℝ] Smooth A := + (globalize q κ).comp ((T.restrictScalars ℝ).toLinearMap.comp + (localizeLinear A q (cutoffGlobal q η) (cutoffGlobal_support q η))) + +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +lemma chartOperator_bound (q : Fin A.count) + (κ η : ChartCutoff (A.euclideanChart q).target) (k l : ℕ) + (T : 𝓢(EC d, ℂ) →L[ℂ] 𝓢(EC d, ℂ)) (hT : CoreBound (l : ℝ) (k : ℝ) T) : + D.localizers.BoundedCore (l : ℝ) (k : ℝ) (chartOperator q κ η T) := by + obtain ⟨B,hB,hb⟩ := globalize_integer_bound D.localizers q κ k + obtain ⟨C,hC,hc⟩ := hT + obtain ⟨E,hE,he⟩ := D.localization_integer_bound q (cutoffGlobal q η) (cutoffGlobal_support q η) l + refine ⟨B*(C*E),mul_nonneg hB (mul_nonneg hC hE),fun f => ?_⟩ + let u := localize A q (cutoffGlobal q η) (cutoffGlobal_support q η) f + change ‖D.localizers.embed (k : ℝ) (globalize q κ (T u))‖ ≤ _ + calc + _ ≤ B*‖schwartzCoord (k : ℝ) (T u)‖ := hb _ + _ ≤ B*(C*‖schwartzCoord (l : ℝ) u‖) := mul_le_mul_of_nonneg_left (hc u) hB + _ ≤ B*(C*(E*‖D.localizers.embed (l : ℝ) f‖)) := + mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left (he f) hC) hB + _ = _ := by ring + +def regularityHessian (p : ι) (i j : Fin d) : Smooth A →ₗ[ℝ] Smooth A := + chartOperator (D.patch p).index (D.regularityCutoff p) (D.regularityOuter p) (hessianEntrySchwartz i j) + +def regularityError (p : ι) (v : EC d) (i j : Fin d) : Smooth A →ₗ[ℝ] Smooth A := + chartOperator (D.patch p).index (D.regularityCutoff p) (D.regularityOuter p) + (hessianLocalizedError (D.cutoff p).realPart.val v i j) + +lemma regularityHessian_bound (k : ℕ) (p : ι) (i j : Fin d) : + D.localizers.BoundedCore ((k : ℝ)+2) (k : ℝ) (D.regularityHessian p i j) := by + have hh := D.chartOperator_bound (D.patch p).index (D.regularityCutoff p) (D.regularityOuter p) + k (k+2) (hessianEntrySchwartz i j) (by + simpa only [Nat.cast_add,Nat.cast_ofNat] using hessianEntrySchwartz_bound (k : ℝ) i j) + simpa only [Nat.cast_add,Nat.cast_ofNat,regularityHessian] using hh + +lemma regularityError_bound (k : ℕ) (p : ι) (v : EC d) (i j : Fin d) : + D.localizers.BoundedCore ((k : ℝ)+2) (k : ℝ) (D.regularityError p v i j) := by + have hh := D.chartOperator_bound (D.patch p).index (D.regularityCutoff p) (D.regularityOuter p) + k (k+2) (hessianLocalizedError (D.cutoff p).realPart.val v i j) (by + simpa only [Nat.cast_add,Nat.cast_ofNat] + using hessianLocalizedError_bound (D.cutoff p).realPart.val v i j k) + simpa only [Nat.cast_add,Nat.cast_ofNat,regularityError] using hh + +end GluingData + +lemma chartHessian_source (q : Fin A.count) (κ η : ChartCutoff (A.euclideanChart q).target) + (hη : ∀ y ∈ tsupport (κ : EC d → ℂ), η y = 1) + (φ : SmoothRealFunction A) (i j : Fin d) {x : X} + (hx : x ∈ (A.euclideanChart q).source) : + chartOperator q κ η (hessianEntrySchwartz i j) (Smooth.ofReal φ) x = + κ (A.euclideanChart q x) * φ.hessian q (A.chart q x) i j := by + change globalize q κ (hessianEntrySchwartz i j + (localize A q (cutoffGlobal q η) (cutoffGlobal_support q η) (Smooth.ofReal φ))) x = _ + rw [globalize_apply,ite_eq_left hx] + by_cases hc : κ (A.euclideanChart q x) = 0 + · rw [hc,zero_mul,zero_mul] + have ht := (A.euclideanChart q).mapsTo hx + have he := localize_cutoff_eventually q κ η hη (Smooth.ofReal φ) ht hc + let u : EC d → ℝ := φ.localExpression q ∘ coordinateEquiv d + have hu : ContDiffAt ℝ ∞ u (A.euclideanChart q x) := (φ.euclidean_smooth q).contDiffAt + (by simpa only [ComplexAtlas.euclideanChart_target] using + (A.euclideanChart q).open_target.mem_nhds ht) + have hre : (fun y => Smooth.ofReal φ ((A.euclideanChart q).symm y)) = Complex.ofRealCLM ∘ u := rfl + rw [hessianEntrySchwartz_real hu _ (he.trans (Filter.Eventually.of_forall (congr_fun hre))) i j, + pullBilin_hessian hu] + have hcomp : u ∘ (coordinateEquiv d).symm = φ.localExpression q := by + funext z; simp [u] + rw [hcomp] + change κ (A.euclideanChart q x) * PotentialKaehler.hermitianPartMatrix + (fderiv ℝ (fderiv ℝ (φ.localExpression q)) + (coordinateEquiv d (A.euclideanChart q x))) i j = _ + rw [ComplexAtlas.euclideanChart_apply,ContinuousLinearEquiv.apply_symm_apply] + rfl + +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +lemma regularityHessian_source (p : ι) (φ : SmoothRealFunction A) (i j : Fin d) {x : X} + (hx : x ∈ (A.euclideanChart (D.patch p).index).source) + (hκ : A.euclideanChart (D.patch p).index x ∈ tsupport (D.cutoff p : EC d → ℂ)) : + D.regularityHessian p i j (Smooth.ofReal φ) x = + φ.hessian (D.patch p).index (A.chart (D.patch p).index x) i j := by + rw [regularityHessian,chartHessian_source _ _ _ + (fun y hy => (D.regularityOuter_one p hy).eq_of_nhds) φ i j hx, + (D.regularityCutoff_one p hκ).eq_of_nhds,one_mul] + +def completedRegularityHessian (k : ℕ) (p : ι) (i j : Fin d) : + D.localizers.Sobolev ((k : ℝ)+2) →L[ℝ] D.localizers.Sobolev (k : ℝ) := + D.localizers.extendCore ((k : ℝ)+2) (k : ℝ) (D.regularityHessian p i j) + +def completedRegularityError (k : ℕ) (p : ι) (v : EC d) (i j : Fin d) : + D.localizers.Sobolev ((k : ℝ)+2) →L[ℝ] D.localizers.Sobolev (k : ℝ) := + D.localizers.extendCore ((k : ℝ)+2) (k : ℝ) (D.regularityError p v i j) + +lemma completedRegularityHessian_embed (k : ℕ) (p : ι) (i j : Fin d) (f : Smooth A) : + D.completedRegularityHessian k p i j (D.localizers.embed ((k : ℝ)+2) f) = + D.localizers.embed (k : ℝ) (D.regularityHessian p i j f) := + D.localizers.extendCore_embed (D.regularityHessian_bound k p i j) f + +lemma completedRegularityError_embed (k : ℕ) (p : ι) (v : EC d) (i j : Fin d) (f : Smooth A) : + D.completedRegularityError k p v i j (D.localizers.embed ((k : ℝ)+2) f) = + D.localizers.embed (k : ℝ) (D.regularityError p v i j f) := + D.localizers.extendCore_embed (D.regularityError_bound k p v i j) f + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/ResidualFamilyBootstrap.lean b/lean/OAI/Geometry/PrescribedPotential/ResidualFamilyBootstrap.lean new file mode 100644 index 0000000000000000000000000000000000000000..ab725cbb54297023954fa6b23a1023638111f88d --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/ResidualFamilyBootstrap.lean @@ -0,0 +1,169 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.FamilyBernsteinBootstrap +import OAI.Geometry.PrescribedPotential.JetEnergyEstimates +import OAI.Geometry.PrescribedPotential.UniformJetControls + +namespace OAI + +/-! Residual Family Bootstrap. -/ + +section + +noncomputable section +open Set Filter Topology Finset Module +open scoped ContDiff +namespace HigherJet +variable {E F : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [NormedAddCommGroup F] [InnerProductSpace ℝ F] + [FiniteDimensional ℝ E] [FiniteDimensional ℝ F] + {ι α : Type*} [Fintype ι] + +lemma residual_family_low_energy {U : Set E} (hU : IsOpen U) + (e : OrthonormalBasis ι ℝ E) (u : α → E → F) (τ : α → E → E ≃L[ℝ] E) + (hu : ∀ a, ContDiffOn ℝ ∞ (u a) U) + (hframes : ∀ K, IsCompact K → K ⊆ U → ∃ B : ℝ, 0 ≤ B ∧ ∀ a x, x ∈ K → + ‖(τ a x).toContinuousLinearMap‖ ≤ B ∧ ‖(τ a x).symm.toContinuousLinearMap‖ ≤ B) + (hfirst : ∀ K, IsCompact K → K ⊆ U → ∃ R : ℝ, 0 ≤ R ∧ ∀ a x, x ∈ K → ‖iteratedFDeriv ℝ 1 (u a) x‖ ≤ R) + (hlow : ∀ K, IsCompact K → K ⊆ U → ∃ R : ℝ, 0 ≤ R ∧ ∀ a x, x ∈ K → + (∀ σ, ‖frameLaplace (fun i => τ a x (e i)) (jetFamily e 1 (u a) σ) x‖ ≤ R*(1+‖iteratedFDeriv ℝ 2 (u a) x‖)) ∧ + (∀ σ, ‖frameLaplace (fun i => τ a x (e i)) (jetFamily e 2 (u a) σ) x‖ ≤ R*(1+‖iteratedFDeriv ℝ 2 (u a) x‖^2+‖iteratedFDeriv ℝ 3 (u a) x‖))) + : + ∀ K, IsCompact K → K ⊆ U → ∃ R : ℝ, 0 ≤ R ∧ ∀ a x, x ∈ K → + familyDissipation (fun i => τ a x (e i)) (jetFamily e 1 (u a)) x-R ≤ frameLaplace (fun i => τ a x (e i)) (jetEnergy e 1 (u a)) x ∧ + familyDissipation (fun i => τ a x (e i)) (jetFamily e 2 (u a)) x-R*(1+jetEnergy e 2 (u a) x*Real.sqrt (jetEnergy e 2 (u a) x)) ≤ frameLaplace (fun i => τ a x (e i)) (jetEnergy e 2 (u a)) x := by + let S := fun m a x => jetEnergy e m (u a) x + let D := fun m a x => familyDissipation (fun i => τ a x (e i)) (jetFamily e m (u a)) x + have hf : ∀ K, IsCompact K → K ⊆ U → EnergyBound S 1 K := by + intro K hK hKU + obtain ⟨R,hR,hr⟩ := hfirst K hK hKU + refine ⟨(Fintype.card (Fin 1 → ι) : ℝ)*R^2,by positivity,fun a x hx => ?_⟩ + exact (jetEnergy_le_norm hU (hu a) e 1 (hKU hx)).trans + (mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (norm_nonneg _) (hr a x hx) 2) (by positivity)) + intro K hK hKU + obtain ⟨B,hB,hτ⟩ := hframes K hK hKU + obtain ⟨A1,hA1,hc1⟩ := uniform_jet_controls (F := F) e 1 hB + obtain ⟨A2,hA2,hc2⟩ := uniform_jet_controls (F := F) e 2 hB + obtain ⟨R0,hR0,hr0⟩ := hf K hK hKU + obtain ⟨R,hR,hr⟩ := hlow K hK hKU + let A := A1+A2+Real.sqrt R0 + have hAA : 1 ≤ A := by dsimp [A]; linarith [Real.sqrt_nonneg R0] + have h1A : A1 ≤ A := by dsimp [A]; linarith [Real.sqrt_nonneg R0] + have h2A : A2 ≤ A := by dsimp [A]; linarith [Real.sqrt_nonneg R0] + let C1 := 2*(A+(Fintype.card (Fin 1 → ι)+1)*R*A)^2+(A+(Fintype.card (Fin 1 → ι)+1)*R*A)^4 + let C2 := 4*((Fintype.card (Fin 2 → ι)+1)*R*A^2)+2*((Fintype.card (Fin 2 → ι)+1)*R*A^2)^2 + have hC1 : 0 ≤ C1 := by dsimp [C1]; positivity + have hC2 : 0 ≤ C2 := by dsimp [C2]; positivity + refine ⟨C1+C2,add_nonneg hC1 hC2,fun a x hx => ?_⟩ + have hcx1 := hc1 U hU (u a) (hu a) x (hKU hx) (τ a x) (hτ a x hx).1 (hτ a x hx).2 + have hcx2 := hc2 U hU (u a) (hu a) x (hKU hx) (τ a x) (hτ a x hx).1 (hτ a x hx).2 + have hs : Real.sqrt (S 1 a x) ≤ A := (Real.sqrt_le_sqrt (hr0 a x hx)).trans (by dsimp [A]; linarith) + have hh1 := energy_first_of_residual hU (hu a) e (hKU hx) (fun i => τ a x (e i)) hAA hR hs + (hcx1.2.1.trans (mul_le_mul_of_nonneg_right h1A (Real.sqrt_nonneg _))) (hr a x hx).1 + have hh2 := energy_second_of_residual hU (hu a) e (hKU hx) (fun i => τ a x (e i)) hAA hR + (hcx2.1.trans (mul_le_mul_of_nonneg_right h2A (Real.sqrt_nonneg _))) + (hcx2.2.1.trans (mul_le_mul_of_nonneg_right h2A (Real.sqrt_nonneg _))) (hr a x hx).2 + change D 1 a x-C1 ≤ _ at hh1 + change D 2 a x-C2*(1+S 2 a x*Real.sqrt (S 2 a x)) ≤ _ at hh2 + constructor + · exact (sub_le_sub_left (le_add_of_nonneg_right hC2) _).trans hh1 + · have hq : 0 ≤ 1+S 2 a x*Real.sqrt (S 2 a x) := by have := jetEnergy_nonneg e 2 (u a) x; positivity + exact (sub_le_sub_left (mul_le_mul_of_nonneg_right (le_add_of_nonneg_left hC1) hq) _).trans hh2 + +lemma residual_family_high_energy {U : Set E} (hU : IsOpen U) + (e : OrthonormalBasis ι ℝ E) (u : α → E → F) (τ : α → E → E ≃L[ℝ] E) + (hu : ∀ a, ContDiffOn ℝ ∞ (u a) U) + (hframes : ∀ K, IsCompact K → K ⊆ U → ∃ B : ℝ, 0 ≤ B ∧ ∀ a x, x ∈ K → + ‖(τ a x).toContinuousLinearMap‖ ≤ B ∧ ‖(τ a x).symm.toContinuousLinearMap‖ ≤ B) + (_hfirst : ∀ K, IsCompact K → K ⊆ U → ∃ R : ℝ, 0 ≤ R ∧ ∀ a x, x ∈ K → ‖iteratedFDeriv ℝ 1 (u a) x‖ ≤ R) + (_hlow : ∀ K, IsCompact K → K ⊆ U → ∃ R : ℝ, 0 ≤ R ∧ ∀ a x, x ∈ K → + (∀ σ, ‖frameLaplace (fun i => τ a x (e i)) (jetFamily e 1 (u a) σ) x‖ ≤ R*(1+‖iteratedFDeriv ℝ 2 (u a) x‖)) ∧ + (∀ σ, ‖frameLaplace (fun i => τ a x (e i)) (jetFamily e 2 (u a) σ) x‖ ≤ R*(1+‖iteratedFDeriv ℝ 2 (u a) x‖^2+‖iteratedFDeriv ℝ 3 (u a) x‖))) + (hhigh : ∀ m, 3 ≤ m → ∀ K, IsCompact K → K ⊆ U → + (∀ j, 1 ≤ j → j < m → EnergyBound (fun j a x => jetEnergy e j (u a) x) j K) → + ∃ R : ℝ, 0 ≤ R ∧ ∀ a x, x ∈ K → ∀ σ, + ‖frameLaplace (fun i => τ a x (e i)) (jetFamily e m (u a) σ) x‖ ≤ + R*(1+‖iteratedFDeriv ℝ m (u a) x‖+‖iteratedFDeriv ℝ (m+1) (u a) x‖)) : + ∀ m, 3 ≤ m → ∀ K, IsCompact K → K ⊆ U → + (∀ j, 1 ≤ j → j < m → EnergyBound (fun j a x => jetEnergy e j (u a) x) j K) → ∃ R : ℝ, 0 ≤ R ∧ ∀ a x, x ∈ K → + familyDissipation (fun i => τ a x (e i)) (jetFamily e m (u a)) x-R*(1+jetEnergy e m (u a) x) ≤ frameLaplace (fun i => τ a x (e i)) (jetEnergy e m (u a)) x := by + intro m hm K hK hKU hlo + obtain ⟨B,hB,hτ⟩ := hframes K hK hKU + obtain ⟨A,hA,hc⟩ := uniform_jet_controls (F := F) e m hB + obtain ⟨R,hR,hr⟩ := hhigh m hm K hK hKU hlo + refine ⟨4*((Fintype.card (Fin m → ι)+1)*R*A)+((Fintype.card (Fin m → ι)+1)*R*A)^2,by positivity,fun a x hx => ?_⟩ + have hc' := hc U hU (u a) (hu a) x (hKU hx) (τ a x) (hτ a x hx).1 (hτ a x hx).2 + exact energy_high_of_residual hU (hu a) e m (hKU hx) (fun i => τ a x (e i)) hA hR hc'.1 hc'.2.1 (hr a x hx) + +lemma residual_family_bootstrap {U : Set E} (hU : IsOpen U) + (e : OrthonormalBasis ι ℝ E) (u : α → E → F) (τ : α → E → E ≃L[ℝ] E) + (hu : ∀ a, ContDiffOn ℝ ∞ (u a) U) + (hframes : ∀ K, IsCompact K → K ⊆ U → ∃ B : ℝ, 0 ≤ B ∧ ∀ a x, x ∈ K → + ‖(τ a x).toContinuousLinearMap‖ ≤ B ∧ ‖(τ a x).symm.toContinuousLinearMap‖ ≤ B) + (hfirst : ∀ K, IsCompact K → K ⊆ U → ∃ R : ℝ, 0 ≤ R ∧ ∀ a x, x ∈ K → ‖iteratedFDeriv ℝ 1 (u a) x‖ ≤ R) + (hlow : ∀ K, IsCompact K → K ⊆ U → ∃ R : ℝ, 0 ≤ R ∧ ∀ a x, x ∈ K → + (∀ σ, ‖frameLaplace (fun i => τ a x (e i)) (jetFamily e 1 (u a) σ) x‖ ≤ R*(1+‖iteratedFDeriv ℝ 2 (u a) x‖)) ∧ + (∀ σ, ‖frameLaplace (fun i => τ a x (e i)) (jetFamily e 2 (u a) σ) x‖ ≤ R*(1+‖iteratedFDeriv ℝ 2 (u a) x‖^2+‖iteratedFDeriv ℝ 3 (u a) x‖))) + (hhigh : ∀ m, 3 ≤ m → ∀ K, IsCompact K → K ⊆ U → + (∀ j, 1 ≤ j → j < m → EnergyBound (fun j a x => jetEnergy e j (u a) x) j K) → + ∃ R : ℝ, 0 ≤ R ∧ ∀ a x, x ∈ K → ∀ σ, + ‖frameLaplace (fun i => τ a x (e i)) (jetFamily e m (u a) σ) x‖ ≤ + R*(1+‖iteratedFDeriv ℝ m (u a) x‖+‖iteratedFDeriv ℝ (m+1) (u a) x‖)) : + ∀ m, 1 ≤ m → ∀ K, IsCompact K → K ⊆ U → + ∃ R : ℝ, 0 ≤ R ∧ ∀ a x, x ∈ K → ‖iteratedFDeriv ℝ m (u a) x‖ ≤ R := by + let S := fun m a x => jetEnergy e m (u a) x + let D := fun m a x => familyDissipation (fun i => τ a x (e i)) (jetFamily e m (u a)) x + have hf : ∀ K, IsCompact K → K ⊆ U → EnergyBound S 1 K := by + intro K hK hKU + obtain ⟨R,hR,hr⟩ := hfirst K hK hKU + refine ⟨(Fintype.card (Fin 1 → ι) : ℝ)*R^2,by positivity,fun a x hx => ?_⟩ + exact (jetEnergy_le_norm hU (hu a) e 1 (hKU hx)).trans + (mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (norm_nonneg _) (hr a x hx) 2) (by positivity)) + have hlowE := residual_family_low_energy hU e u τ hu hframes hfirst hlow + have hhighE := residual_family_high_energy hU e u τ hu hframes hfirst hlow hhigh + have hb : ∀ m, 1 ≤ m → ∀ K, IsCompact K → K ⊆ U → EnergyBound S m K := by + apply family_bernstein_bootstrap hU S D (fun a x i => τ a x (e i)) + · exact fun m a => jetEnergy_smoothOn hU (hu a) e m + · exact fun m a x _ => ⟨jetEnergy_nonneg _ _ _ _,familyDissipation_nonneg _ _ _⟩ + · exact fun m a x hx => jetEnergy_gradient_bound hU (hu a) e m hx _ + · intro K hK hKU + obtain ⟨B,hB,hτ⟩ := hframes K hK hKU + refine ⟨B,hB,fun a x hx i => ?_⟩ + exact ((τ a x).toContinuousLinearMap.le_opNorm (e i)).trans (by simpa only [e.norm_eq_one,mul_one] using (hτ a x hx).1) + · intro m _ K hK hKU + obtain ⟨B,hB,hτ⟩ := hframes K hK hKU + obtain ⟨A,hA,hc⟩ := uniform_jet_controls (F := F) e m hB + exact ⟨A,hA,fun a x hx => (hc U hU (u a) (hu a) x (hKU hx) (τ a x) (hτ a x hx).1 (hτ a x hx).2).2.2⟩ + · exact hf + · intro m hm K hK hKU hlo + by_cases h1 : m=1 + · subst m + obtain ⟨R,hR,hr⟩ := hlowE K hK hKU + exact ⟨R,hR,fun a x hx => (hr a x hx).1⟩ + · by_cases h2 : m=2 + · subst m + obtain ⟨R,hR,hr⟩ := hlowE K hK hKU + obtain ⟨C,hC,hc⟩ := hlo 2 (by decide) le_rfl + refine ⟨R*(1+C*Real.sqrt C),by positivity,fun a x hx => ?_⟩ + have ht := mul_le_mul_of_nonneg_left (add_le_add_left + (mul_le_mul (hc a x hx) (Real.sqrt_le_sqrt (hc a x hx)) (Real.sqrt_nonneg _) hC) 1) hR + linarith only [ht,(hr a x hx).2] + · obtain ⟨R,hR,hr⟩ := hhighE m (by omega) K hK hKU (fun j hj hjm => hlo j hj (by omega)) + obtain ⟨C,hC,hc⟩ := hlo m hm le_rfl + refine ⟨R*(1+C),by positivity,fun a x hx => ?_⟩ + have ht := mul_le_mul_of_nonneg_left (add_le_add_left (hc a x hx) 1) hR + linarith only [ht,hr a x hx] + · intro K hK hKU + obtain ⟨R,hR,hr⟩ := hlowE K hK hKU + exact ⟨R,hR,fun a x hx => (by have hd := familyDissipation_nonneg (fun i => τ a x (e i)) (jetFamily e 2 (u a)) x; linarith only [hd,(hr a x hx).2])⟩ + · exact hhighE + intro m hm K hK hKU + obtain ⟨R,hR,hr⟩ := hb m hm K hK hKU + obtain ⟨C,hC,hc⟩ := norm_iteratedFDeriv_le_jetEnergy (F := F) e.toBasis m + exact ⟨C*Real.sqrt R,by positivity,fun a x hx => (hc U hU (u a) (hu a) x (hKU hx)).trans + (mul_le_mul_of_nonneg_left (Real.sqrt_le_sqrt (hr a x hx)) hC.le)⟩ +end HigherJet + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/ScalarFrameCalculus.lean b/lean/OAI/Geometry/PrescribedPotential/ScalarFrameCalculus.lean new file mode 100644 index 0000000000000000000000000000000000000000..7a92c59cd47f6c7c1649f1371a0ac24211144299 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/ScalarFrameCalculus.lean @@ -0,0 +1,92 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.InverseTraceFunction +import OAI.Geometry.PrescribedPotential.LinearFrameCalculus + +namespace OAI + +/-! Scalar Frame Calculus. -/ + +section + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +variable {n : ℕ} + +lemma potentialMatrix_const_add (c : ℝ) (f : V n → ℝ) (z : V n) : + PotentialKaehler.potentialMatrix (fun y => c+f y) z = PotentialKaehler.potentialMatrix f z := by + unfold PotentialKaehler.potentialMatrix + have he : fderiv ℝ (fun y => c+f y) = fderiv ℝ f := funext (fun _ => fderiv_const_add c) + rw [he] + +lemma potentialMatrix_linear (B : V n →L[ℂ] V n) {f : V n → ℝ} {z : V n} + (hf : ContDiffAt ℝ ∞ f (B z)) : + PotentialKaehler.potentialMatrix (fun y => f (B y)) z = + (frameMatrix B)ᴴ*PotentialKaehler.potentialMatrix f (B z)*frameMatrix B := by + have he := PotentialKaehler.potentialMatrix_comp B.contDiff.contDiffAt hf + have hb : fderiv ℂ (fun y => B y) z = B := B.fderiv + simpa only [Function.comp_def,hb,frameMatrix] using he + +lemma det_congruence_re (G B : Matrix (Fin n) (Fin n) ℂ) : + (Bᴴ*G*B).det.re = ‖B.det‖^2*G.det.re := by + rw [Matrix.det_mul,Matrix.det_mul,Matrix.det_conjTranspose] + have he : (starRingEnd ℂ) B.det*G.det*B.det = + ((‖B.det‖^2 : ℝ):ℂ)*G.det := by + rw [show (starRingEnd ℂ) B.det*G.det*B.det = + (B.det*(starRingEnd ℂ) B.det)*G.det by ring,Complex.mul_conj,Complex.normSq_eq_norm_sq] + change ((starRingEnd ℂ) B.det*G.det*B.det).re = _ + rw [he,Complex.mul_re,Complex.ofReal_re,Complex.ofReal_im,zero_mul,sub_zero] + +lemma logdet_congruence (G B : Matrix (Fin n) (Fin n) ℂ) + (hG : G.PosDef) (hB : IsUnit B) : + Real.log (Bᴴ*G*B).det.re = Real.log (‖B.det‖^2) + Real.log G.det.re := by + have hb : B.det ≠ 0 := isUnit_iff_ne_zero.mp ((Matrix.isUnit_iff_isUnit_det B).mp hB) + rw [det_congruence_re] + exact Real.log_mul (pow_ne_zero 2 (norm_ne_zero_iff.mpr hb)) + (ne_of_gt (Complex.pos_iff.mp hG.det_pos).1) + +lemma matrix_logdet_smooth {U : Set (V n)} + {M : V n → Matrix (Fin n) (Fin n) ℂ} (hM : ContDiffOn ℝ ∞ M U) + (hp : ∀ y ∈ U, (M y).PosDef) : + ContDiffOn ℝ ∞ (fun y => Real.log (M y).det.re) U := by + exact (Complex.reCLM.contDiff.comp_contDiffOn + (determinant_smooth.comp_contDiffOn hM)).log + (fun y hy => ne_of_gt (Complex.pos_iff.mp (hp y hy).det_pos).1) + +lemma potentialMatrix_logdet_pullMetric {U : Set (V n)} (hU : IsOpen U) + (B : V n →L[ℂ] V n) (hB : IsUnit (frameMatrix B)) + {M : V n → Matrix (Fin n) (Fin n) ℂ} (hM : ContDiffOn ℝ ∞ M U) + (hp : ∀ y ∈ U, (M y).PosDef) {z : V n} (hz : B z ∈ U) : + PotentialKaehler.potentialMatrix (fun y => Real.log (pullMetric B M y).det.re) z = + (frameMatrix B)ᴴ * PotentialKaehler.potentialMatrix (fun y => Real.log (M y).det.re) (B z) * frameMatrix B := by + have he : (fun y => Real.log (pullMetric B M y).det.re) =ᶠ[𝓝 z] + (fun y => Real.log (‖(frameMatrix B).det‖^2) + Real.log (M (B y)).det.re) := by + filter_upwards [B.continuous.continuousAt.preimage_mem_nhds (hU.mem_nhds hz)] with y hy + exact logdet_congruence (M (B y)) (frameMatrix B) (hp (B y) hy) hB + rw [PotentialKaehler.potentialMatrix_congr he] + rw [potentialMatrix_const_add] + exact potentialMatrix_linear B (f := fun y => Real.log (M y).det.re) + (z := z) ((matrix_logdet_smooth hM hp).contDiffAt (hU.mem_nhds hz)) + +lemma inverseTrace_pullMetric (B : V n →L[ℂ] V n) (hB : IsUnit (frameMatrix B)) + (M G : V n → Matrix (Fin n) (Fin n) ℂ) (z : V n) : + inverseTrace (pullMetric B M) (pullMetric B G) z = inverseTrace M G (B z) := by + let C := frameMatrix B + have hc : C*C⁻¹ = 1 := Matrix.mul_nonsing_inv C ((Matrix.isUnit_iff_isUnit_det C).mp hB) + have hd : Cᴴ⁻¹*Cᴴ = 1 := by + rw [← Matrix.conjTranspose_nonsing_inv,← Matrix.conjTranspose_mul,hc,Matrix.conjTranspose_one] + unfold inverseTrace pullMetric + change ((Cᴴ*M (B z)*C)⁻¹*(Cᴴ*G (B z)*C)).trace.re = _ + simp only [Matrix.mul_inv_rev,Matrix.mul_assoc] + rw [← Matrix.mul_assoc Cᴴ⁻¹ Cᴴ,hd,Matrix.one_mul] + have he : (C⁻¹*((M (B z))⁻¹*(G (B z)*C))).trace = ((M (B z))⁻¹*G (B z)).trace := by + rw [← Matrix.mul_assoc (M (B z))⁻¹,← Matrix.mul_assoc C⁻¹, + Matrix.trace_mul_cycle, hc,Matrix.one_mul] + rw [he] +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/ScalarPrincipalWirtinger.lean b/lean/OAI/Geometry/PrescribedPotential/ScalarPrincipalWirtinger.lean new file mode 100644 index 0000000000000000000000000000000000000000..f72f2908a2d84a748915044250425c046b558657 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/ScalarPrincipalWirtinger.lean @@ -0,0 +1,86 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.ComplexOperator +import OAI.Geometry.PrescribedPotential.KaehlerClosedDerivatives +import OAI.Geometry.PrescribedPotential.SymmetricPrincipalFrame +import OAI.Geometry.PrescribedPotential.TracePositivity + +namespace OAI + +/-! Scalar Principal Wirtinger. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix Finset +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +open EllipticKernel FrozenPoisson HigherJet +variable {n : ℕ} +local instance realECIP : InnerProductSpace ℝ (EC n) := InnerProductSpace.rclikeToReal ℂ (EC n) + +lemma scalar_principal_real {ι : Type*} [Fintype ι] (e : OrthonormalBasis ι ℝ (EC n)) + (M : Matrix (Fin n) (Fin n) ℂ) {f : EC n → ℝ} {x : EC n} (hf : ContDiffAt ℝ ∞ f x) : + principalApply e (traceBilin M) (fderiv ℝ (fderiv ℝ f) x) = + (M⁻¹*PotentialKaehler.potentialMatrix (f ∘ (coordinateEquiv n).symm) (coordinateEquiv n x)).trace.re := by + rw [principalApply_symmetric e _ _ (hf.isSymmSndFDerivAt (by + simp only [minSmoothness_of_isRCLikeNormedField] + exact WithTop.coe_le_coe.mpr le_top))] + have he : traceBilin M (fderiv ℝ (fderiv ℝ f) x) = + ∑ i, ∑ j, traceBilin M (rankTwo (e i) (e j))*fderiv ℝ (fderiv ℝ f) x (e i) (e j) := by + conv_lhs => rw [bilin_expansion e (fderiv ℝ (fderiv ℝ f) x)] + simp only [map_sum,map_smul,smul_eq_mul] + exact sum_congr rfl (fun i _ => sum_congr rfl (fun j _ => mul_comm _ _)) + simp only [smul_eq_mul] + rw [← he,traceBilin_apply,pullBilin_hessian hf] + rfl + +lemma wirtinger_re_im {f : V n → ℂ} {z : V n} (hf : ContDiffAt ℝ ∞ f z) (u v : V n) : + dzbar u (dz v f) z = + dzbar u (dz v (fun y => ((f y).re:ℂ))) z + + Complex.I*dzbar u (dz v (fun y => ((f y).im:ℂ))) z := by + have hr : ContDiffAt ℝ ∞ (fun y => (f y).re) z := Complex.reCLM.contDiff.contDiffAt.comp z hf + have hi : ContDiffAt ℝ ∞ (fun y => (f y).im) z := Complex.imCLM.contDiff.contDiffAt.comp z hf + rw [dzbar_dz_real hr,dzbar_dz_real hi] + simp only [dzbar,dz,wderiv,fderiv_wderiv hf] + have hre (a b : V n) : fderiv ℝ (fderiv ℝ (fun y => (f y).re)) z a b = + (fderiv ℝ (fderiv ℝ f) z a b).re := GlobalElliptic.second_postcomp hf Complex.reCLM a b + have him (a b : V n) : fderiv ℝ (fderiv ℝ (fun y => (f y).im)) z a b = + (fderiv ℝ (fderiv ℝ f) z a b).im := GlobalElliptic.second_postcomp hf Complex.imCLM a b + simp only [PotentialKaehler.hermitianPart,hre,him] + apply Complex.ext <;> simp <;> ring + +lemma inverse_wirtinger_real (M : Matrix (Fin n) (Fin n) ℂ) (hM : M.PosDef) + {f : V n → ℝ} {z : V n} (hf : ContDiffAt ℝ ∞ f z) : + (∑ p, ∑ q, M⁻¹ p q*dzbar (e q) (dz (e p) (fun y => (f y:ℂ))) z) = + (((M⁻¹*PotentialKaehler.potentialMatrix f z).trace.re : ℝ):ℂ) := by + rw [trace_mul_real hM.inv.isHermitian (PotentialKaehler.potentialMatrix_hermitian hf)] + simp only [Matrix.trace] + apply sum_congr rfl + intro p _ + apply sum_congr rfl + intro q _ + change M⁻¹ p q*dzbar (e q) (dz (e p) (fun y => (f y:ℂ))) z = M⁻¹ p q*PotentialKaehler.potentialMatrix f z q p + rw [potentialMatrix_eq_dzbar_dz hf] + rfl + +lemma inverse_wirtinger_complex (M : Matrix (Fin n) (Fin n) ℂ) (hM : M.PosDef) + {f : V n → ℂ} {z : V n} (hf : ContDiffAt ℝ ∞ f z) : + (∑ p, ∑ q, M⁻¹ p q*dzbar (e q) (dz (e p) f) z) = + ((M⁻¹*PotentialKaehler.potentialMatrix (fun y => (f y).re) z).trace.re:ℂ) + + Complex.I*((M⁻¹*PotentialKaehler.potentialMatrix (fun y => (f y).im) z).trace.re:ℂ) := by + simp only [wirtinger_re_im hf,mul_add,sum_add_distrib] + have he : (∑ p, ∑ q, M⁻¹ p q*(Complex.I*dzbar (e q) (dz (e p) (fun y => ((f y).im:ℂ))) z)) = + Complex.I*(∑ p, ∑ q, M⁻¹ p q*dzbar (e q) (dz (e p) (fun y => ((f y).im:ℂ))) z) := by + simp only [Finset.mul_sum] + exact sum_congr rfl (fun p _ => sum_congr rfl (fun q _ => by ring)) + have hr : ContDiffAt ℝ ∞ (fun y => (f y).re) z := Complex.reCLM.contDiff.contDiffAt.comp z hf + have hi : ContDiffAt ℝ ∞ (fun y => (f y).im) z := Complex.imCLM.contDiff.contDiffAt.comp z hf + rw [he,inverse_wirtinger_real M hM hr,inverse_wirtinger_real M hM hi] +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/ScalarProductLaplacian.lean b/lean/OAI/Geometry/PrescribedPotential/ScalarProductLaplacian.lean new file mode 100644 index 0000000000000000000000000000000000000000..bee40d15628c70ed10c4a839444764ca82a771b9 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/ScalarProductLaplacian.lean @@ -0,0 +1,93 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.WirtingerConjugate + +namespace OAI + +/-! Scalar Product Laplacian. -/ + +section + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +variable {n : ℕ} + +def holGradient (f : V n → ℝ) (z : V n) : EuclideanSpace ℂ (Fin n) := + WithLp.toLp 2 (fun k => dz (e k) (fun y => (f y:ℂ)) z) + +def holGradientSquare (f : V n → ℝ) (z : V n) : ℝ := ‖holGradient f z‖^2 + +def gradientCross (f g : V n → ℝ) (z : V n) : ℝ := + 2*(inner ℂ (holGradient f z) (holGradient g z)).re + +lemma holGradientSquare_eq (f : V n → ℝ) (z : V n) : + holGradientSquare f z = ∑ k, ‖dz (e k) (fun y => (f y:ℂ)) z‖^2 := by + rw [holGradientSquare,PiLp.norm_sq_eq_of_L2] + rfl + +lemma gradientCross_sq (f g : V n → ℝ) (z : V n) : + (gradientCross f g z)^2 ≤ 4*holGradientSquare f z*holGradientSquare g z := by + have hi := norm_inner_le_norm (𝕜 := ℂ) (holGradient f z) (holGradient g z) + have hr := Complex.abs_re_le_norm (inner ℂ (holGradient f z) (holGradient g z)) + have hs := (sq_le_sq₀ (abs_nonneg _) (mul_nonneg (norm_nonneg _) (norm_nonneg _))).mpr (hr.trans hi) + simp only [sq_abs,mul_pow] at hs + unfold gradientCross holGradientSquare + nlinarith + +lemma dzbar_real {f : V n → ℝ} {z : V n} (hf : ContDiffAt ℝ ∞ f z) (v : V n) : + dzbar v (fun y => (f y:ℂ)) z = star (dz v (fun y => (f y:ℂ)) z) := by + have hd : DifferentiableAt ℝ (fun y => (f y:ℂ)) z := + (Complex.ofRealCLM.contDiff.contDiffAt.comp z hf).differentiableAt (by simp) + have hh := dzbar_conj hd v + simpa only [Complex.star_def,Complex.conj_ofReal] using hh + +lemma potentialMatrix_trace_mul {f g : V n → ℝ} {z : V n} + (hf : ContDiffAt ℝ ∞ f z) (hg : ContDiffAt ℝ ∞ g z) : + (PotentialKaehler.potentialMatrix (fun y => f y*g y) z).trace.re = + f z*(PotentialKaehler.potentialMatrix g z).trace.re + + g z*(PotentialKaehler.potentialMatrix f z).trace.re + gradientCross f g z := by + have hfc : ContDiffAt ℝ ∞ (fun y => (f y:ℂ)) z := Complex.ofRealCLM.contDiff.contDiffAt.comp z hf + have hgc : ContDiffAt ℝ ∞ (fun y => (g y:ℂ)) z := Complex.ofRealCLM.contDiff.contDiffAt.comp z hg + have hd (k : Fin n) : dz (e k) (fun y => ((f y*g y:ℝ):ℂ)) =ᶠ[𝓝 z] + (fun y => dz (e k) (fun x => (f x:ℂ)) y*(g y:ℂ)+(f y:ℂ)*dz (e k) (fun x => (g x:ℂ)) y) := by + filter_upwards [(hfc.of_le (show (1 : WithTop ℕ∞) ≤ ∞ by simp)).eventually (by simp), + (hgc.of_le (show (1 : WithTop ℕ∞) ≤ ∞ by simp)).eventually (by simp)] with y hyF hyG + simp only [Complex.ofReal_mul] + exact wderiv_mul (hyF.differentiableAt (by simp)) (hyG.differentiableAt (by simp)) _ _ + have hdd (k : Fin n) : (PotentialKaehler.potentialMatrix (fun y => f y*g y) z) k k = + (g z:ℂ)*(PotentialKaehler.potentialMatrix f z) k k + + (f z:ℂ)*(PotentialKaehler.potentialMatrix g z) k k + + dz (e k) (fun y => (f y:ℂ)) z*star (dz (e k) (fun y => (g y:ℂ)) z)+ + star (dz (e k) (fun y => (f y:ℂ)) z)*dz (e k) (fun y => (g y:ℂ)) z := by + rw [potentialMatrix_eq_dzbar_dz (hf.mul hg)] + change wderiv Complex.I (e k) (dz (e k) _) z = _ + rw [wderiv_congr (hd k)] + unfold dz + rw [wderiv_add + (((wderiv_smooth hfc (-Complex.I) (e k)).mul hgc).differentiableAt (by simp)) + ((hfc.mul (wderiv_smooth hgc (-Complex.I) (e k))).differentiableAt (by simp)), + wderiv_mul ((wderiv_smooth hfc (-Complex.I) (e k)).differentiableAt (by simp)) (hgc.differentiableAt (by simp)), + wderiv_mul (hfc.differentiableAt (by simp)) ((wderiv_smooth hgc (-Complex.I) (e k)).differentiableAt (by simp))] + change dzbar (e k) (dz (e k) _) z * _ + dz (e k) _ z * dzbar (e k) _ z + + (dzbar (e k) _ z * dz (e k) _ z + _ * dzbar (e k) (dz (e k) _) z) = _ + have hef : dzbar (e k) (dz (e k) (fun y => (f y:ℂ))) z = PotentialKaehler.potentialMatrix f z k k := + (potentialMatrix_eq_dzbar_dz hf k k).symm + have heg : dzbar (e k) (dz (e k) (fun y => (g y:ℂ))) z = PotentialKaehler.potentialMatrix g z k k := + (potentialMatrix_eq_dzbar_dz hg k k).symm + rw [dzbar_real hf,dzbar_real hg,hef,heg] + change _ = (g z:ℂ)*_ + (f z:ℂ)*_ + dz (e k) _ z*star (dz (e k) _ z) + star (dz (e k) _ z)*dz (e k) _ z + ring + simp only [Matrix.trace,Matrix.diag_apply,hdd,Complex.re_sum,Complex.add_re, + Complex.mul_re,Complex.ofReal_re,Complex.ofReal_im,zero_mul,sub_zero, + Finset.sum_add_distrib,← Finset.mul_sum,gradientCross,holGradient, + PiLp.inner_apply,RCLike.inner_apply,Complex.star_def] + simp only [Complex.conj_re,Complex.conj_im] + simp only [mul_comm] + ring_nf +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/SchwartzConjugation.lean b/lean/OAI/Geometry/PrescribedPotential/SchwartzConjugation.lean new file mode 100644 index 0000000000000000000000000000000000000000..71237509b9be445d39d9b264b22dbcc181a79fe4 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/SchwartzConjugation.lean @@ -0,0 +1,67 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CircleRadialCalculus +import OAI.Geometry.PrescribedPotential.IntegerBounds + +namespace OAI + +/-! Schwartz Conjugation. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory LineDeriv +open scoped ContDiff SchwartzMap Classical +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +def schwartzConj : 𝓢(E,ℂ) →L[ℝ] 𝓢(E,ℂ) := SchwartzMap.postcompCLM Complex.conjCLE.toContinuousLinearMap + +@[simp] lemma schwartzConj_apply (f : 𝓢(E,ℂ)) (x : E) : schwartzConj f x = star (f x) := rfl + +lemma schwartzConj_deriv (v : E) (f : 𝓢(E,ℂ)) : + (∂_{v} (schwartzConj f) : 𝓢(E,ℂ)) = schwartzConj (∂_{v} f) := by + ext x + simp only [SchwartzMap.lineDerivOp_apply_eq_fderiv,schwartzConj_apply] + exact congrArg (fun L : E →L[ℝ] ℂ => L v) + (Complex.conjCLE.toContinuousLinearMap.hasFDerivAt.comp x + ((f.smooth ⊤).differentiable (by simp) x).hasFDerivAt).fderiv + +lemma schwartzConj_word (ws : List E) (f : 𝓢(E,ℂ)) : + schwartzWord ws (schwartzConj f) = schwartzConj (schwartzWord ws f) := by + induction ws generalizing f with + | nil => rfl + | cons v ws ih => + change ∂_{v} (schwartzWord ws (schwartzConj f)) = schwartzConj (∂_{v} (schwartzWord ws f)) + rw [ih,schwartzConj_deriv] + +variable [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +lemma schwartzConj_norm_zero (f : 𝓢(E,ℂ)) : + ‖schwartzCoord 0 (schwartzConj f)‖ = ‖schwartzCoord 0 f‖ := by + have he (u : 𝓢(E,ℂ)) : schwartzCoord 0 u = u.toLp 2 volume := by + apply l2_injective + simpa [realize] using realize_schwartzCoord 0 u + rw [he,he,SchwartzMap.norm_toLp,SchwartzMap.norm_toLp] + congr 1 + apply eLpNorm_congr_norm_ae (schwartzConj f).continuous.aestronglyMeasurable + f.continuous.aestronglyMeasurable + exact Filter.Eventually.of_forall (fun x => by simp) + +lemma schwartzConj_integer_bound (k : ℕ) : CoreBound (k : ℝ) (k : ℝ) (schwartzConj (E := E)) := by + have hh := coreBound_of_words_integer k (s := (k : ℝ)) (t := 0) (schwartzConj (E := E)) (fun ws hws => by + obtain ⟨C,hC,hb⟩ := coreBound_word ws (s := (k : ℝ)) (t := 0) (by + have hh : (ws.length : ℝ) ≤ k := by exact_mod_cast hws + linarith) + refine ⟨C,hC,fun f => ?_⟩ + dsimp only + rw [schwartzConj_word,schwartzConj_norm_zero] + exact hb f) + simpa using hh +end SobolevChart + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/SchwartzFamilyBounds.lean b/lean/OAI/Geometry/PrescribedPotential/SchwartzFamilyBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..cd8c70feb89da366243cea0ea55b267d6772e9b6 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/SchwartzFamilyBounds.lean @@ -0,0 +1,62 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.LocalRegularity + +namespace OAI + +/-! Schwartz Family Bounds. -/ + +section + +noncomputable section +open Set Filter Topology MeasureTheory TemperedDistribution +open scoped SchwartzMap ContDiff +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +def schwartzCoordCLM (s : ℝ) : 𝓢(E,ℂ) →L[ℂ] L2 E := + (SchwartzMap.toLpCLM ℂ ℂ 2 volume) ∘L + SchwartzMap.fourierMultiplierCLM ℂ (fun x : E => (((1+‖x‖^2)^(s/2) : ℝ) : ℂ)) + +lemma schwartzCoordCLM_apply (s : ℝ) (f : 𝓢(E,ℂ)) : + schwartzCoordCLM s f = schwartzCoord s f := by + apply l2_injective + change ((SchwartzMap.fourierMultiplierCLM ℂ (fun x : E => (((1+‖x‖^2)^(s/2) : ℝ) : ℂ)) f).toLp 2 : 𝓢'(E,ℂ)) = _ + rw [Lp.toTemperedDistribution_toLp_eq,Lp.toTemperedDistributionCLM_apply,← bessel_realize s,realize_schwartzCoord] + exact (fourierMultiplierCLM_toTemperedDistributionCLM_eq (by fun_prop) f).symm + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma schwartz_family_bounded {I : Type*} (f : I → 𝓢(E,ℂ)) {K : Set E} + (hK : IsCompact K) (hsupp : ∀ i, tsupport (f i : E → ℂ) ⊆ K) + (hjet : ∀ m : ℕ, ∃ C : ℝ, ∀ i x, x ∈ K → ‖iteratedFDeriv ℝ m (f i) x‖ ≤ C) : + Bornology.IsVonNBounded ℂ (Set.range f) := by + apply (schwartz_withSeminorms ℂ E ℂ).isVonNBounded_iff_seminorm_bounded.mpr + rintro ⟨a,m⟩ + obtain ⟨R,hR,hRK⟩ := hK.isBounded.exists_pos_norm_le + obtain ⟨C,hC⟩ := hjet m + let B := R^a * max 0 C + have hB : 0 ≤ B := mul_nonneg (pow_nonneg hR.le a) (le_max_left _ _) + refine ⟨B+1,by linarith,?_⟩ + rintro _ ⟨i,rfl⟩ + apply lt_of_le_of_lt (SchwartzMap.seminorm_le_bound ℂ a m (f i) hB ?_) (by linarith) + intro x + by_cases hx : x ∈ K + · exact mul_le_mul (pow_le_pow_left₀ (norm_nonneg x) (hRK x hx) a) + ((hC i x hx).trans (le_max_right _ _)) (norm_nonneg _) (pow_nonneg hR.le a) + · have hz : iteratedFDeriv ℝ m (f i) x = 0 := Function.notMem_support.mp + (fun ha => hx (hsupp i (support_iteratedFDeriv_subset m ha))) + simpa [hz] using hB + +lemma schwartzCoord_family_bound {I : Type*} (f : I → 𝓢(E,ℂ)) {K : Set E} + (hK : IsCompact K) (hsupp : ∀ i, tsupport (f i : E → ℂ) ⊆ K) + (hjet : ∀ m : ℕ, ∃ C : ℝ, ∀ i x, x ∈ K → ‖iteratedFDeriv ℝ m (f i) x‖ ≤ C) + (s : ℝ) : ∃ C : ℝ, ∀ i, ‖schwartzCoord s (f i)‖ ≤ C := by + have hb := (schwartz_family_bounded f hK hsupp hjet).image (schwartzCoordCLM s) + obtain ⟨C,hC⟩ := (NormedSpace.isVonNBounded_iff' ℂ).mp hb + exact ⟨C,fun i => by simpa only [schwartzCoordCLM_apply] using hC _ ⟨f i,⟨i,rfl⟩,rfl⟩⟩ +end SobolevChart + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/SecondJetComposition.lean b/lean/OAI/Geometry/PrescribedPotential/SecondJetComposition.lean new file mode 100644 index 0000000000000000000000000000000000000000..965ef29a0354bde1f5d311734aadb9c035df6d7a --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/SecondJetComposition.lean @@ -0,0 +1,82 @@ +import Mathlib + +namespace OAI + +/-! Second Jet Composition. -/ + +section + + + +noncomputable section +open Finset +open scoped ContDiff +namespace HigherJet +lemma positive_list_sum_two {l : List ℕ} (hp : ∀ j ∈ l, 0 < j) (hs : l.sum = 2) : + l = [2] ∨ l = [1,1] := by + cases l with + | nil => simp at hs + | cons a l => + have ha := hp a (by simp) + cases l with + | nil => simp at hs; simp [hs] + | cons b l => + have hb := hp b (by simp) + cases l with + | nil => + simp only [List.sum_cons,List.sum_nil,Nat.add_zero] at hs + have : a=1 ∧ b=1 := by omega + simp [this.1,this.2] + | cons c l => + have hc := hp c (by simp) + simp only [List.sum_cons] at hs + omega + +lemma OrderedFinpartition.prod_second_bound (c : OrderedFinpartition 2) + (a : ℕ → ℝ) (ha : ∀ i, 0 ≤ a i) : + ∏ i, a (c.partSize i) ≤ a 2+(a 1)^2 := by + have hsum : (List.ofFn c.partSize).sum = 2 := by + rw [List.sum_ofFn] + simpa using c.sum_sigma_eq_sum (fun _ => (1 : ℕ)) + have hpos : ∀ j ∈ List.ofFn c.partSize, 0 < j := by + intro j hj + obtain ⟨i,rfl⟩ := List.mem_ofFn.mp hj + exact c.partSize_pos i + have he : ∏ i, a (c.partSize i) = ((List.ofFn c.partSize).map a).prod := by + rw [List.map_ofFn,List.prod_ofFn] + rfl + rw [he] + obtain h | h := positive_list_sum_two hpos hsum + · simp only [h,List.map_cons,List.map_nil,List.prod_cons,List.prod_nil,mul_one] + exact le_add_of_nonneg_right (sq_nonneg _) + · simp only [h,List.map_cons,List.map_nil,List.prod_cons,List.prod_nil,mul_one] + nlinarith only [ha 2] + +variable {E F G : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] + [NormedAddCommGroup G] [NormedSpace ℝ G] +lemma composition_second_jet_bound {f : E → F} {g : F → G} {x : E} + (hf : ContDiffAt ℝ ∞ f x) (hg : ContDiffAt ℝ ∞ g (f x)) + {C : ℝ} (hC : 0 ≤ C) + (hgjet : ∀ j, j ≤ 2 → ‖iteratedFDeriv ℝ j g (f x)‖ ≤ C) : + ‖iteratedFDeriv ℝ 2 (g ∘ f) x‖ ≤ + (Fintype.card (OrderedFinpartition 2) : ℝ)*C* + (‖iteratedFDeriv ℝ 2 f x‖+‖iteratedFDeriv ℝ 1 f x‖^2) := by + rw [iteratedFDeriv_comp (i := 2) hg hf (by exact WithTop.coe_le_coe.mpr le_top),FormalMultilinearSeries.taylorComp] + calc + _ ≤ ∑ c : OrderedFinpartition 2, ‖c.compAlongOrderedFinpartition + (iteratedFDeriv ℝ c.length g (f x)) (fun i => iteratedFDeriv ℝ (c.partSize i) f x)‖ := norm_sum_le _ _ + _ ≤ ∑ _c : OrderedFinpartition 2, C*(‖iteratedFDeriv ℝ 2 f x‖+‖iteratedFDeriv ℝ 1 f x‖^2) := by + apply Finset.sum_le_sum + intro c _ + exact c.norm_compAlongOrderedFinpartition_le _ _ |>.trans + (mul_le_mul (hgjet _ c.length_le) + (OrderedFinpartition.prod_second_bound c (fun j => ‖iteratedFDeriv ℝ j f x‖) (fun j => norm_nonneg _)) + (Finset.prod_nonneg (fun _ _ => norm_nonneg _)) hC) + _ = _ := by simp [mul_assoc] +end HigherJet + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/SmoothChartInverse.lean b/lean/OAI/Geometry/PrescribedPotential/SmoothChartInverse.lean new file mode 100644 index 0000000000000000000000000000000000000000..c0d1f5160be99ccdabfde533f160eb3bbff0f5d0 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/SmoothChartInverse.lean @@ -0,0 +1,160 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.ChartParametrix +import OAI.Geometry.PrescribedPotential.LocalRegularity +import OAI.Geometry.PrescribedPotential.SmoothDistributions + +namespace OAI + +/-! Smooth Chart Inverse. -/ + +section + + + +noncomputable section +open Filter Set Topology MeasureTheory TemperedDistribution LineDeriv +open scoped SchwartzMap BoundedContinuousFunction ComplexOrder MatrixOrder Matrix.Norms.Elementwise ContDiff + +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +lemma temperateDistribution_sum {ι : Type*} [Fintype ι] (f : ι → E → ℂ) + (hf : ∀ i, (f i).HasTemperateGrowth) : + (Function.HasTemperateGrowth.sum (s := Finset.univ) (fun i _ => hf i)).toTemperedDistribution volume = + ∑ i, (hf i).toTemperedDistribution volume := by + simp only [temperateDistribution_eq_smul_volume] + rw [smulLeftCLM_sum (fun i _ => hf i)] + simp + +lemma temperateDistribution_mul {f g : E → ℂ} (hf : f.HasTemperateGrowth) + (hg : g.HasTemperateGrowth) : + (hf.mul hg).toTemperedDistribution volume = + smulLeftCLM ℂ f (hg.toTemperedDistribution volume) := by + simp only [temperateDistribution_eq_smul_volume] + rw [smulLeftCLM_smulLeftCLM_apply hg hf, mul_comm] + +end SobolevChart + +namespace MetricLocalization +open EllipticKernel FrozenPoisson SobolevChart +variable {n : ℕ} + +def classicalDifferential (c : BasisIndex n → BasisIndex n → EC n →ᵇ ℂ) + (f : EC n → ℂ) : EC n → ℂ := fun x => + ∑ k, ∑ l, c k l x * directionDerivative (stdOrthonormalBasis ℝ (EC n) k) + (directionDerivative (stdOrthonormalBasis ℝ (EC n) l) f) x + +lemma classicalDifferential_temperate + (c : BasisIndex n → BasisIndex n → EC n →ᵇ ℂ) + (hc : ∀ k l, (c k l : EC n → ℂ).HasTemperateGrowth) + {f : EC n → ℂ} (hf : f.HasTemperateGrowth) : + (classicalDifferential c f).HasTemperateGrowth := by + apply Function.HasTemperateGrowth.sum + intro k _ + apply Function.HasTemperateGrowth.sum + intro l _ + exact (hc k l).mul (temperate_directionDerivative _ (temperate_directionDerivative _ hf)) + +lemma classicalDifferential_distribution + (c : BasisIndex n → BasisIndex n → EC n →ᵇ ℂ) + (hc : ∀ k l, (c k l : EC n → ℂ).HasTemperateGrowth) + {f : EC n → ℂ} (hf : f.HasTemperateGrowth) : + (classicalDifferential_temperate c hc hf).toTemperedDistribution volume = + chartDifferential c (hf.toTemperedDistribution volume) := by + let b := stdOrthonormalBasis ℝ (EC n) + have hg k l := (hc k l).mul + (temperate_directionDerivative (b k) (temperate_directionDerivative (b l) hf)) + change (Function.HasTemperateGrowth.sum + (s := Finset.univ) (fun k _ => Function.HasTemperateGrowth.sum + (s := Finset.univ) (fun l _ => hg k l))).toTemperedDistribution volume = _ + rw [temperateDistribution_sum + (fun k x => ∑ l, c k l x * directionDerivative (b k) (directionDerivative (b l) f) x) + (fun k => Function.HasTemperateGrowth.sum (fun l _ => hg k l))] + simp only [chartDifferential, sum_apply, ContinuousLinearMap.comp_apply] + apply Finset.sum_congr rfl + intro k _ + rw [temperateDistribution_sum + (fun l x => c k l x * directionDerivative (b k) (directionDerivative (b l) f) x) + (hg k)] + apply Finset.sum_congr rfl + intro l _ + rw [temperateDistribution_mul (hc k l) + (temperate_directionDerivative (b k) (temperate_directionDerivative (b l) hf)), + temperateDistribution_derivative (b k) (temperate_directionDerivative (b l) hf), + temperateDistribution_derivative (b l) hf] + rfl + + + +theorem extended_smooth_solution + (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (a : SmoothCoefficients (BasisIndex n) (EC n)) + (hsmall : perturbationBound (stdOrthonormalBasis ℝ (EC n)) (coefficientBCF a) * + ellipticBound H hH < 1) (f : 𝓢(EC n, ℂ)) : + ∃ u : EC n →ᵇ ℂ, (u : EC n → ℂ).HasTemperateGrowth ∧ + (fun x => u x - classicalDifferential (extendedCoefficient H (coefficientBCF a)) u x) = f := by + let v := stdOrthonormalBasis ℝ (EC n) + let R := localResolvent H hH v (coefficientBCF a) hsmall + obtain ⟨u, hu, hue⟩ := all_even_smooth_representative + (localResolvent_schwartz_memSobolev H hH v a hsmall f) + have ha k l : (coefficientBCF a k l : EC n → ℂ).HasTemperateGrowth := + (a k l).hasTemperateGrowth + have hc := extendedCoefficient_temperate H (coefficientBCF a) ha + refine ⟨u, hu, ?_⟩ + apply temperateDistribution_injective (hu.sub (classicalDifferential_temperate _ hc hu)) + f.hasTemperateGrowth + rw [temperateDistribution_sub hu (classicalDifferential_temperate _ hc hu), + classicalDifferential_distribution _ hc hu, + temperateDistribution_bounded u hu, hue, temperateDistribution_schwartz] + rw [chartDifferential_extension H (coefficientBCF a) ha] + rw [← sub_sub] + have he := localResolvent_equation H hH v (coefficientBCF a) hsmall (schwartzCoord 0 f) + have hz : realize 0 (schwartzCoord 0 f) = (schwartzCoord 0 f : 𝓢'(EC n, ℂ)) := by + simp [realize] + rw [← hz, realize_schwartzCoord] at he + exact he + + + +theorem germ_smooth_solution {U : Set (EC n)} (hU : IsOpen U) + (H : EC n → Matrix (Fin n) (Fin n) ℂ) (hH : ContDiffOn ℝ ∞ H U) + (hh : ∀ y ∈ U, (H y).PosDef) {x : EC n} (hx : x ∈ U) : + ∃ V : Set (EC n), IsOpen V ∧ x ∈ V ∧ V ⊆ U ∧ + ∀ f : 𝓢(EC n, ℂ), ∃ u : EC n →ᵇ ℂ, + (u : EC n → ℂ).HasTemperateGrowth ∧ ∀ y ∈ V, + u y - (∑ k, ∑ l, (traceBilin (H y) + (rankTwo (stdOrthonormalBasis ℝ (EC n) k) + (stdOrthonormalBasis ℝ (EC n) l)) : ℂ) * + directionDerivative (stdOrthonormalBasis ℝ (EC n) k) + (directionDerivative (stdOrthonormalBasis ℝ (EC n) l) u) y) = f y := by + let b := stdOrthonormalBasis ℝ (EC n) + obtain ⟨a, hat, hac, has, hag⟩ := local_coefficient_extension hU H hH hh hx b + let a' : SmoothCoefficients (BasisIndex n) (EC n) := + fun k l => (hac k l).toSchwartzMap (hat k l).1 + have hae : coefficientBCF a' = a := by + funext k l + ext y + rfl + have has' : perturbationBound b (coefficientBCF a') * ellipticBound (H x) (hh x hx) < 1 := by + rw [hae] + exact has + obtain ⟨V, hVsub, hVo, hxV⟩ := mem_nhds_iff.mp (inter_mem (hU.mem_nhds hx) hag) + refine ⟨V, hVo, hxV, fun y hy => (hVsub hy).1, fun f => ?_⟩ + obtain ⟨u, hu, he⟩ := extended_smooth_solution (H x) (hh x hx) a' has' f + refine ⟨u, hu, fun y hy => ?_⟩ + have hc k l : extendedCoefficient (H x) (coefficientBCF a') k l y = + (traceBilin (H y) (rankTwo (b k) (b l)) : ℂ) := by + rw [hae] + change (traceBilin (H x) (rankTwo (b k) (b l)) : ℂ) + a k l y = _ + rw [(hVsub hy).2 k l] + ring + have hey := congrFun he y + simpa only [classicalDifferential, hc] using hey + +end MetricLocalization + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/SmoothDistributions.lean b/lean/OAI/Geometry/PrescribedPotential/SmoothDistributions.lean new file mode 100644 index 0000000000000000000000000000000000000000..f93db3f1929104fda6b816b79e7d67f01af9a6ca --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/SmoothDistributions.lean @@ -0,0 +1,114 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.SobolevEmbedding + +namespace OAI + +/-! Smooth Distributions. -/ + +section + + +noncomputable section +open MeasureTheory FourierTransform TemperedDistribution LineDeriv +open scoped SchwartzMap BoundedContinuousFunction ContDiff + +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma temperate_fderiv {f : E → ℂ} (hf : f.HasTemperateGrowth) : + (fderiv ℝ f).HasTemperateGrowth := by + refine ⟨hf.1.fderiv_right (by simp), fun n => ?_⟩ + simpa only [norm_iteratedFDeriv_fderiv] using hf.2 (n + 1) + +def directionDerivative (v : E) (f : E → ℂ) : E → ℂ := fun x => fderiv ℝ f x v + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma temperate_directionDerivative (v : E) {f : E → ℂ} (hf : f.HasTemperateGrowth) : + (directionDerivative v f).HasTemperateGrowth := by + have hd := temperate_fderiv hf + unfold directionDerivative + exact (ContinuousLinearMap.apply ℝ ℂ v).hasTemperateGrowth.comp hd + +lemma temperateDistribution_eq_smul_volume {f : E → ℂ} (hf : f.HasTemperateGrowth) : + hf.toTemperedDistribution volume = smulLeftCLM ℂ f (volume.toTemperedDistribution) := by + ext φ + simp only [Function.HasTemperateGrowth.toTemperedDistribution_apply, + smulLeftCLM_apply_apply, Measure.toTemperedDistribution_apply, + SchwartzMap.smulLeftCLM_apply hf] + simp only [smul_eq_mul, mul_comm] + +lemma temperateDistribution_sub {f g : E → ℂ} (hf : f.HasTemperateGrowth) + (hg : g.HasTemperateGrowth) : + (hf.sub hg).toTemperedDistribution volume = + hf.toTemperedDistribution volume - hg.toTemperedDistribution volume := by + simp only [temperateDistribution_eq_smul_volume] + rw [smulLeftCLM_sub hf hg] + rfl + +lemma temperateDistribution_schwartz (f : 𝓢(E, ℂ)) : + f.hasTemperateGrowth.toTemperedDistribution volume = (f : 𝓢'(E, ℂ)) := by + ext φ + simp + +lemma temperateDistribution_bounded (f : E →ᵇ ℂ) (hf : (f : E → ℂ).HasTemperateGrowth) : + hf.toTemperedDistribution volume = boundedDistribution f := by + ext φ + rw [Function.HasTemperateGrowth.toTemperedDistribution_apply volume hf φ, boundedDistribution_apply] + +lemma temperate_schwartz_integrable {f : E → ℂ} (hf : f.HasTemperateGrowth) + (φ : 𝓢(E, ℂ)) : Integrable (fun x => φ x * f x) := by + simpa only [SchwartzMap.smulLeftCLM_apply hf, smul_eq_mul, mul_comm] using + (SchwartzMap.smulLeftCLM ℂ f φ).integrable (μ := volume) + + + +lemma temperateDistribution_derivative (v : E) {f : E → ℂ} (hf : f.HasTemperateGrowth) : + (temperate_directionDerivative v hf).toTemperedDistribution volume = + ∂_{v} (hf.toTemperedDistribution volume) := by + ext φ + simp only [Function.HasTemperateGrowth.toTemperedDistribution_apply, + TemperedDistribution.lineDerivOp_apply_apply, map_neg] + change (∫ x, φ x * directionDerivative v f x) = -(∫ x, (∂_{v} φ) x * f x) + apply integral_bilinear_hasLineDerivAt_right_eq_neg_left_of_integrable + (B := ContinuousLinearMap.mul ℝ ℂ) (v := v) + (temperate_schwartz_integrable hf (∂_{v} φ)) + (temperate_schwartz_integrable (temperate_directionDerivative v hf) φ) + (temperate_schwartz_integrable hf φ) + · intro x _ + simpa only [SchwartzMap.lineDerivOp_apply_eq_fderiv] using + (SchwartzMap.hasFDerivAt φ x).hasLineDerivAt v + · intro x _ + exact ((hf.1.differentiable (by simp)) x).hasFDerivAt.hasLineDerivAt v + +lemma temperateDistribution_eq_zero_iff {f : E → ℂ} (hf : f.HasTemperateGrowth) : + hf.toTemperedDistribution volume = 0 ↔ f = 0 := by + constructor + · intro h + apply (hf.1.continuous.ae_eq_iff_eq volume continuous_zero).mp + apply ae_eq_zero_of_integral_contDiff_smul_eq_zero (μ := (volume : Measure E)) + hf.1.continuous.locallyIntegrable + intro g hg hc + let φ : 𝓢(E, ℂ) := (hc.comp_left (show Complex.ofReal 0 = 0 by rfl)).toSchwartzMap + (Complex.ofRealCLM.contDiff.comp hg) + have he := congrArg (fun t : 𝓢'(E, ℂ) => t φ) h + change (∫ x, ((g x : ℝ) : ℂ) • f x) = 0 at he + simpa only [Complex.real_smul, smul_eq_mul] using he + · rintro rfl + ext φ + simp + +lemma temperateDistribution_injective {f g : E → ℂ} (hf : f.HasTemperateGrowth) + (hg : g.HasTemperateGrowth) + (h : hf.toTemperedDistribution volume = hg.toTemperedDistribution volume) : f = g := by + apply sub_eq_zero.mp + apply (temperateDistribution_eq_zero_iff (hf.sub hg)).mp + rw [temperateDistribution_sub hf hg, h, sub_self] + +end SobolevChart + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/SmoothLocalPath.lean b/lean/OAI/Geometry/PrescribedPotential/SmoothLocalPath.lean new file mode 100644 index 0000000000000000000000000000000000000000..9fb8baa4a59789b3e7597b73fa4711636b34047a --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/SmoothLocalPath.lean @@ -0,0 +1,111 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.PatchCutoffs +import OAI.Geometry.PrescribedPotential.RealSobolev +import OAI.Geometry.PrescribedPotential.SobolevExponential +import OAI.Geometry.PrescribedPotential.FixedScaleBootstrap +import OAI.Geometry.PrescribedPotential.PositiveOpenness +import OAI.Geometry.PrescribedPotential.TwoScaleRegularity + +namespace OAI + +/-! Smooth Local Path. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace RealSmooth + +def exponentialForcing (F : RealSmooth A) (t : ℝ) : SmoothRealFunction A where + value := fun x => Real.exp (t * F.source.value x) + smooth i := by + exact (contDiffOn_const.mul (F.source.smooth i)).exp + +end RealSmooth +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) +local instance smPathNG (s : ℝ) : NormedAddCommGroup (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedAddCommGroup +local instance smPathNS (s : ℝ) : NormedSpace ℝ (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedSpace +local instance smPathTG (s : ℝ) : IsTopologicalAddGroup (D.localizers.RealSobolev s) := + Submodule.isTopologicalAddGroup _ +local instance smPathCS (s : ℝ) : ContinuousSMul ℝ (D.localizers.RealSobolev s) := + SMulMemClass.continuousSMul _ + +lemma exponentialDensity_embed (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (F : RealSmooth A) (t : ℝ) : + D.exponentialDensity k hk F t = + D.localizers.realEmbed (k : ℝ) (RealSmooth.ofReal (F.exponentialForcing t)) := by + have hs : (Module.finrank ℝ (EC d) : ℝ) < 2*(k : ℝ) := by + have hh : (Module.finrank ℝ (EC d) : ℝ) < (k : ℝ) := by exact_mod_cast hk + linarith [Nat.cast_nonneg (α := ℝ) k] + apply Subtype.ext + apply D.localizers.strong_injective (k : ℝ) hs + ext x + rw [D.exponentialDensity_strong] + change _ = D.localizers.strong (k : ℝ) (D.localizers.embed (k : ℝ) _) x + rw [D.localizers.strong_embed _ hs] + rfl + +include D in + + +theorem smooth_path_eventually_solvable (F : RealSmooth A) (x₀ : X) : + ∀ᶠ t : ℝ in 𝓝 0, ∃ (φ : SmoothRealFunction A) (b : ℝ), + g.PositivePotential φ ∧ φ.value x₀ = 0 ∧ + ∀ x, (g.potentialDensity φ).value x = Real.exp (t * F.source.value x + b) := by + let s := Module.finrank ℝ (EC d) + 1 + have hs : Module.finrank ℝ (EC d) < s := by dsimp [s]; omega + have hk : Module.finrank ℝ (EC d) < s+1 := by omega + let U : Set (D.localizers.RealSobolev (((s+1 : ℕ) : ℝ)+2) × ℝ) := {z | + (∀ R : RealSmooth A, D.realVolume (s+1) hk z.1 = D.localizers.realEmbed ((s+1 : ℕ) : ℝ) R → + ∃ φ : RealSmooth A, D.localizers.realEmbed (((s+1 : ℕ) : ℝ)+2) φ = z.1) ∧ + D.WeakPositive (s+1) z.1} + have hU : U ∈ 𝓝 0 := by + have ht : Tendsto (Prod.fst : D.localizers.RealSobolev (((s+1 : ℕ) : ℝ)+2) × ℝ → _) + (𝓝 0) (𝓝 0) := continuous_fst.tendsto 0 + exact ht ((D.fixed_spatial_smoothness s hs x₀).and (D.weakPositive_nhds (s+1) hk)) + have ht := (D.exponentialDensity_continuous (s+1) hk F).tendsto 0 + rw [D.exponentialDensity_zero] at ht + filter_upwards [ht.eventually (D.volume_eventually_solvable (s+1) hk x₀ hU)] with t ht + obtain ⟨u,b,hu,hV,hN⟩ := ht + obtain ⟨hSm,hP⟩ := hu + have he : D.realVolume (s+1) hk u = D.localizers.realEmbed ((s+1 : ℕ) : ℝ) + (Real.exp b • RealSmooth.ofReal (F.exponentialForcing t)) := by + rw [hV,D.exponentialDensity_embed,map_smul] + obtain ⟨φ,hφ⟩ := hSm _ he + change D.localizers.realEmbed (((s+1 : ℕ) : ℝ)+2) φ = u at hφ + refine ⟨φ.source,b,?_,?_,?_⟩ + · apply (D.weakPositive_embed_iff (s+1) hk φ).mp + rwa [hφ] + · rw [← hφ,D.realEvaluation_embed] at hN + · exact hN + · have hh : (Module.finrank ℝ (EC d) : ℝ) < (s : ℝ) := by exact_mod_cast hs + push_cast + linarith only [hh, Nat.cast_nonneg (α := ℝ) s] + · intro x + rw [← hφ,D.realVolume_embed,D.exponentialDensity_embed] at hV + have hh := congrArg (D.realEvaluation ((s+1 : ℕ) : ℝ) x) hV + have hpos : (Module.finrank ℝ (EC d) : ℝ) < 2*((s+1 : ℕ) : ℝ) := by + have hh : (Module.finrank ℝ (EC d) : ℝ) < (s : ℝ) := by exact_mod_cast hs + push_cast + linarith only [hh, Nat.cast_nonneg (α := ℝ) s] + rw [map_smul,D.realEvaluation_embed hpos,D.realEvaluation_embed hpos] at hh + change (g.potentialDensity φ.source).value x = Real.exp b * Real.exp (t * F.source.value x) at hh + rw [hh,Real.exp_add] + ring +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/SmoothPathLimit.lean b/lean/OAI/Geometry/PrescribedPotential/SmoothPathLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..884a80a9275e859aab26897045ff2ce48f3e4c79 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/SmoothPathLimit.lean @@ -0,0 +1,139 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.MatrixLimit +import OAI.Geometry.PrescribedPotential.PatchCutoffs +import OAI.Geometry.PrescribedPotential.RealSobolev +import OAI.Geometry.PrescribedPotential.VolumePath +import OAI.Geometry.PrescribedPotential.SmoothPathOpenness +import OAI.Geometry.PrescribedPotential.PositiveOpenness +import OAI.Geometry.PrescribedPotential.CompletedVolume +import OAI.Geometry.PrescribedPotential.RealSmoothCompactness + +namespace OAI + +/-! Smooth Path Limit. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff Classical ComplexOrder +namespace Anticanonical.SourceSmooth +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +lemma solvesVolumePath_density (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) + {t b : ℝ} {φ : SmoothRealFunction A} (he : SolvesVolumePath g h t φ b) (x : X) : + (g.potentialDensity φ).value x = Real.exp (t * (prescribedForcing g h).value x + b) := by + have hh := congrArg Real.exp (he.2 x) + rw [g.logRatio_deform_eq_logDensity φ he.1 x, + Real.exp_log (g.potentialDensity_pos φ he.1 x)] at hh + exact hh + +lemma solvesVolumePath_of_density (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) + {t b : ℝ} {φ : SmoothRealFunction A} (hp : g.PositivePotential φ) + (he : ∀ x, (g.potentialDensity φ).value x = + Real.exp (t * (prescribedForcing g h).value x + b)) : SolvesVolumePath g h t φ b := by + refine ⟨hp,fun x => ?_⟩ + rw [g.logRatio_deform_eq_logDensity φ hp x,he x,Real.log_exp] + +end Anticanonical.SourceSmooth +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) +local instance smoothLimitNG (s : ℝ) : NormedAddCommGroup (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedAddCommGroup +local instance smoothLimitNS (s : ℝ) : NormedSpace ℝ (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedSpace + +lemma realMatrix_tendsto (k : ℕ) (f : ℕ → RealSmooth A) (fLim : RealSmooth A) + (hf : Tendsto (fun n => D.localizers.embed ((k : ℝ)+2) (f n).val) atTop + (𝓝 (D.localizers.embed ((k : ℝ)+2) fLim.val))) (p : ι) (x : X) : + Tendsto (fun n => D.weakMatrix k (D.localizers.realEmbed ((k : ℝ)+2) (f n)) p x) + atTop (𝓝 (D.weakMatrix k (D.localizers.realEmbed ((k : ℝ)+2) fLim) p x)) := by + have hr : Tendsto (fun n => D.localizers.realEmbed ((k : ℝ)+2) (f n)) atTop + (𝓝 (D.localizers.realEmbed ((k : ℝ)+2) fLim)) := tendsto_subtype_rng.mpr hf + have hc : Continuous (fun u : D.localizers.RealSobolev ((k : ℝ)+2) => D.weakMatrix k u p x) := + (D.weakMatrix_continuous k p).comp (continuous_id.prodMk continuous_const) + exact hc.tendsto _ |>.comp hr + +lemma completedVolume_realSmooth_embed (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (f : RealSmooth A) : + D.completedVolume k hk (D.localizers.embed ((k : ℝ)+2) f.val) = + D.localizers.embed (k : ℝ) (Smooth.ofReal (g.potentialDensity f.source)) := by + rw [← f.ofReal_source,D.completedVolume_embed] + +lemma potentialDensity_tendsto (f : ℕ → RealSmooth A) (fLim : RealSmooth A) + (hf : ∀ s : ℝ, Tendsto (fun n => D.localizers.embed s (f n).val) atTop + (𝓝 (D.localizers.embed s fLim.val))) (x : X) : + Tendsto (fun n => (g.potentialDensity (f n).source).value x) atTop + (𝓝 ((g.potentialDensity fLim.source).value x)) := by + let k := Module.finrank ℝ (EC d)+1 + have hk : Module.finrank ℝ (EC d) < k := Nat.lt_succ_self _ + have hs : (Module.finrank ℝ (EC d) : ℝ) < 2*(k : ℝ) := by + have hkr : (Module.finrank ℝ (EC d) : ℝ) < (k : ℝ) := by exact_mod_cast hk + linarith only [hkr,Nat.cast_nonneg (α := ℝ) k] + have hc := (D.completedVolume_contDiff k hk).continuous.tendsto + (D.localizers.embed ((k : ℝ)+2) fLim.val) |>.comp (hf ((k : ℝ)+2)) + simp only [Function.comp_def,D.completedVolume_realSmooth_embed k hk] at hc + have hv := D.localizers.smooth_value_tendsto (k : ℝ) hs + (fun n => Smooth.ofReal (g.potentialDensity (f n).source)) + (Smooth.ofReal (g.potentialDensity fLim.source)) hc x + have hr := (Complex.continuous_re.tendsto + ((Smooth.ofReal (g.potentialDensity fLim.source)) x)).comp hv + simpa only [Function.comp_def,Smooth.ofReal_apply,Complex.ofReal_re] using hr + +lemma positivePotential_of_smooth_limit (f : ℕ → RealSmooth A) (fLim : RealSmooth A) + (hf : ∀ s : ℝ, Tendsto (fun n => D.localizers.embed s (f n).val) atTop + (𝓝 (D.localizers.embed s fLim.val))) + (hp : ∀ n, g.PositivePotential (f n).source) + (hd : ∀ x, 0 < (g.potentialDensity fLim.source).value x) : g.PositivePotential fLim.source := by + let k := Module.finrank ℝ (EC d)+1 + have hk : Module.finrank ℝ (EC d) < k := Nat.lt_succ_self _ + apply (D.weakPositive_embed_iff k hk fLim).mp + intro p x hx + have hi : x ∈ (A.chart (D.patch p).index).source := by simpa using D.patch_source p hx + have hdet : (D.weakMatrix k (D.localizers.realEmbed ((k : ℝ)+2) fLim) p x).det ≠ 0 := by + rw [D.weakMatrix_embed k hk fLim p hx] + intro he + have hh := hd x + rw [g.potentialDensity_quotient fLim.source (D.patch p).index hi,he, + Complex.zero_re,zero_div] at hh + exact lt_irrefl 0 hh + exact CompactMatrixPositivity.posDef_of_tendsto_det_ne_zero + (D.weakMatrix_hermitian k hk _ p hx) + (fun n => (D.weakPositive_embed_iff k hk (f n)).mpr (hp n) p x hx) + (D.realMatrix_tendsto k f fLim (hf ((k : ℝ)+2)) p x) hdet + + + +theorem smooth_path_limit_solution (h : SemipositiveAnticanonicalMetric A) + (t b : ℕ → ℝ) (tLim bLim : ℝ) (ht : Tendsto t atTop (𝓝 tLim)) + (hb : Tendsto b atTop (𝓝 bLim)) (f : ℕ → RealSmooth A) (fLim : RealSmooth A) + (hf : ∀ s : ℝ, Tendsto (fun n => D.localizers.embed s (f n).val) atTop + (𝓝 (D.localizers.embed s fLim.val))) + (hsol : ∀ n, SolvesVolumePath g h (t n) (f n).source (b n)) : + SolvesVolumePath g h tLim fLim.source bLim := by + have he (x : X) : (g.potentialDensity fLim.source).value x = + Real.exp (tLim * (prescribedForcing g h).value x + bLim) := by + have hl := D.potentialDensity_tendsto f fLim hf x + have hn : (fun n => (g.potentialDensity (f n).source).value x) = + (fun n => Real.exp (t n * (prescribedForcing g h).value x + b n)) := + funext (fun n => solvesVolumePath_density g h (hsol n) x) + rw [hn] at hl + exact tendsto_nhds_unique hl (Real.continuous_exp.tendsto _ |>.comp + ((ht.mul_const ((prescribedForcing g h).value x)).add hb)) + apply solvesVolumePath_of_density g h _ he + exact D.positivePotential_of_smooth_limit f fLim hf (fun n => (hsol n).1) + (fun x => (he x).symm ▸ Real.exp_pos _) + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/SmoothPathOpenness.lean b/lean/OAI/Geometry/PrescribedPotential/SmoothPathOpenness.lean new file mode 100644 index 0000000000000000000000000000000000000000..a279952080c1a69d6fdb80e59468031064db8d38 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/SmoothPathOpenness.lean @@ -0,0 +1,111 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.PatchCutoffs +import OAI.Geometry.PrescribedPotential.PositivePotentialLinearization +import OAI.Geometry.PrescribedPotential.RealSobolev +import OAI.Geometry.PrescribedPotential.SmoothLocalPath +import OAI.Geometry.PrescribedPotential.SmoothPotentialDifference +import OAI.Geometry.PrescribedPotential.VolumePath + +namespace OAI + +/-! Smooth Path Openness. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff Classical ComplexOrder +namespace Anticanonical.SourceSmooth +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +namespace KaehlerMetric + +lemma logRatio_deform_eq_logDensity (g : KaehlerMetric A) (φ : SmoothRealFunction A) + (hp : g.PositivePotential φ) (x : X) : + (g.logRatio (g.deform φ hp)).value x = Real.log ((g.potentialDensity φ).value x) := by + obtain ⟨i,hi⟩ := A.covers x + change g.logRatioValue (g.deform φ hp) x = _ + rw [g.logRatioValue_local _ i hi,g.potentialDensity_quotient φ i hi] + exact (Real.log_div + (ne_of_gt ((g.deform φ hp).volumeCoefficient_pos i ((A.chart i).mapsTo hi))) + (ne_of_gt (g.volumeCoefficient_pos i ((A.chart i).mapsTo hi)))).symm + +lemma positivePotential_add (g : KaehlerMetric A) (φ ψ : SmoothRealFunction A) + (hφ : g.PositivePotential φ) (hψ : (g.deform φ hφ).PositivePotential ψ) : + g.PositivePotential (φ.addFunction ψ) := by + intro i z hz + rw [SmoothRealFunction.hessian_addFunction φ ψ i hz,← add_assoc] + exact hψ i z hz + +lemma logRatio_deform_add (g : KaehlerMetric A) (φ ψ : SmoothRealFunction A) + (hφ : g.PositivePotential φ) (hψ : (g.deform φ hφ).PositivePotential ψ) (x : X) : + (g.logRatio (g.deform (φ.addFunction ψ) (g.positivePotential_add φ ψ hφ hψ))).value x = + (g.logRatio (g.deform φ hφ)).value x + + ((g.deform φ hφ).logRatio ((g.deform φ hφ).deform ψ hψ)).value x := by + obtain ⟨i,hi⟩ := A.covers x + change g.logRatioValue _ x = g.logRatioValue _ x + (g.deform φ hφ).logRatioValue _ x + rw [g.logRatioValue_local _ i hi,g.logRatioValue_local _ i hi, + (g.deform φ hφ).logRatioValue_local _ i hi] + simp only [volumeCoefficient,deform, + SmoothRealFunction.hessian_addFunction φ ψ i ((A.chart i).mapsTo hi),add_assoc] + ring + +end KaehlerMetric + + + +theorem smooth_log_path_eventually_solvable [T2Space X] [CompactSpace X] [ConnectedSpace X] + (g : KaehlerMetric A) (F : SmoothRealFunction A) (x₀ : X) : + ∀ᶠ t : ℝ in 𝓝 0, ∃ (φ : SmoothRealFunction A) (b : ℝ) + (hp : g.PositivePotential φ), φ.value x₀ = 0 ∧ + ∀ x, (g.logRatio (g.deform φ hp)).value x = t * F.value x + b := by + obtain ⟨S,⟨D⟩⟩ := GlobalElliptic.exists_gluingData g + filter_upwards [D.smooth_path_eventually_solvable (GlobalElliptic.RealSmooth.ofReal F) x₀] + with t ht + obtain ⟨φ,b,hp,hn,he⟩ := ht + refine ⟨φ,b,hp,hn,fun x => ?_⟩ + rw [g.logRatio_deform_eq_logDensity φ hp x,he x,Real.log_exp] + rfl + + + +def SmoothVolumePathTimes (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) + (x₀ : X) : Set ℝ := + {t | ∃ (φ : SmoothRealFunction A) (b : ℝ), φ.value x₀ = 0 ∧ SolvesVolumePath g h t φ b} + +lemma smoothVolumePathTimes_zero (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) + (x₀ : X) : 0 ∈ SmoothVolumePathTimes g h x₀ := + ⟨SmoothRealFunction.constant 0,0,rfl,volumePath_zero g h⟩ + +lemma smoothVolumePathTimes_eventually [T2Space X] [CompactSpace X] [ConnectedSpace X] + (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) (x₀ : X) + {t₀ : ℝ} (ht₀ : t₀ ∈ SmoothVolumePathTimes g h x₀) : + ∀ᶠ t in 𝓝 t₀, t ∈ SmoothVolumePathTimes g h x₀ := by + obtain ⟨φ₀,b₀,hn₀,hp₀,he₀⟩ := ht₀ + have hs : Tendsto (fun t : ℝ => t-t₀) (𝓝 t₀) (𝓝 0) := by + have hc : Continuous (fun t : ℝ => t-t₀) := continuous_id.sub continuous_const + simpa only [sub_self] using hc.tendsto t₀ + filter_upwards [hs.eventually (smooth_log_path_eventually_solvable + (g.deform φ₀ hp₀) (prescribedForcing g h) x₀)] with t ht + obtain ⟨ψ,a,hψ,hnψ,heψ⟩ := ht + refine ⟨φ₀.addFunction ψ,b₀+a,?_,g.positivePotential_add φ₀ ψ hp₀ hψ,?_⟩ + · change φ₀.value x₀ + ψ.value x₀ = 0 + rw [hn₀,hnψ,add_zero] + · intro x + rw [g.logRatio_deform_add φ₀ ψ hp₀ hψ,he₀ x,heψ x] + ring + + + +theorem smoothVolumePathTimes_isOpen [T2Space X] [CompactSpace X] [ConnectedSpace X] + (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) (x₀ : X) : + IsOpen (SmoothVolumePathTimes g h x₀) := + isOpen_iff_mem_nhds.mpr (fun _ ht => smoothVolumePathTimes_eventually g h x₀ ht) + +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/SmoothPotentialDifference.lean b/lean/OAI/Geometry/PrescribedPotential/SmoothPotentialDifference.lean new file mode 100644 index 0000000000000000000000000000000000000000..2bf492594b07de562b8e04572de82c4e7e734b23 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/SmoothPotentialDifference.lean @@ -0,0 +1,53 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.AnalyticSupport + +namespace OAI + +/-! Smooth Potential Difference. -/ + +section + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Classical +namespace Anticanonical.SourceSmooth +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +namespace SmoothRealFunction + +def addFunction (φ ψ : SmoothRealFunction A) : SmoothRealFunction A where + value x := φ.value x + ψ.value x + smooth i := (φ.smooth i).add (ψ.smooth i) + +lemma hessian_addFunction (φ ψ : SmoothRealFunction A) (i : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart i).target) : + (φ.addFunction ψ).hessian i z = φ.hessian i z + ψ.hessian i z := by + have hφ := (φ.smooth i).contDiffAt ((A.chart i).open_target.mem_nhds hz) + have hψ := (ψ.smooth i).contDiffAt ((A.chart i).open_target.mem_nhds hz) + change ContDiffAt ℝ ∞ (φ.localExpression i) z at hφ + change ContDiffAt ℝ ∞ (ψ.localExpression i) z at hψ + change PotentialKaehler.hermitianPartMatrix + (fderiv ℝ (fderiv ℝ (φ.localExpression i + ψ.localExpression i)) z) = _ + rw [EllipticKernel.hessian_add hφ hψ, EllipticKernel.hermitianPartMatrix_add] + rfl + +def difference (φ ψ : SmoothRealFunction A) : SmoothRealFunction A := + φ.addFunction (ψ.realSMul (-1)) + +lemma difference_value (φ ψ : SmoothRealFunction A) (x : X) : + (φ.difference ψ).value x = φ.value x - ψ.value x := by + change φ.value x + -1 * ψ.value x = _ + ring + +lemma hessian_difference (φ ψ : SmoothRealFunction A) (i : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart i).target) : + (φ.difference ψ).hessian i z = φ.hessian i z - ψ.hessian i z := by + rw [difference, hessian_addFunction φ _ i hz, hessian_realSMul] + simp [sub_eq_add_neg] +end SmoothRealFunction +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/SmoothSequenceCompactness.lean b/lean/OAI/Geometry/PrescribedPotential/SmoothSequenceCompactness.lean new file mode 100644 index 0000000000000000000000000000000000000000..f5fbea15bac95310ef9cf5e23ba7862746853e7f --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/SmoothSequenceCompactness.lean @@ -0,0 +1,90 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CircleRadialCalculus +import OAI.Geometry.PrescribedPotential.EvenRellich +import OAI.Geometry.PrescribedPotential.GlobalSmooth +import OAI.Geometry.PrescribedPotential.PatchCutoffs + +namespace OAI + +/-! Smooth Sequence Compactness. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace Localizers +variable (D : Localizers A ι) + +lemma lower_tendsto_smooth {s t : ℝ} (hst : t ≤ s) (f : ℕ → Smooth A) + (u : D.Sobolev s) (hf : Tendsto (fun n => D.embed s (f n)) atTop (𝓝 u)) : + Tendsto (fun n => D.embed t (f n)) atTop (𝓝 (D.lower s t u)) := by + have hh := (D.lower s t).continuous.tendsto u |>.comp hf + simpa only [Function.comp_def,D.lower_embed hst] using hh + +end Localizers +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +lemma even_tower_subsequence (f : ℕ → Smooth A) + (hbound : ∀ k : ℕ, ∃ C : ℝ, ∀ n : ℕ, + ‖D.localizers.embed (((2*k : ℕ) : ℝ)+2) (f n)‖ ≤ C) : + ∃ (u : ∀ k : ℕ, D.localizers.Sobolev ((2*k : ℕ) : ℝ)) (r : ℕ → ℕ), + StrictMono r ∧ ∀ k : ℕ, + Tendsto (fun n => D.localizers.embed ((2*k : ℕ) : ℝ) (f (r n))) atTop (𝓝 (u k)) := by + choose C hC using hbound + let K (k : ℕ) : Set (D.localizers.Sobolev ((2*k : ℕ) : ℝ)) := + closure (D.localizers.lower (((2*k : ℕ) : ℝ)+2) ((2*k : ℕ) : ℝ) '' + Metric.closedBall 0 (C k)) + have hK (k : ℕ) : IsCompact (K k) := + (D.lower_even_compact k).isCompact_closure_image_closedBall (C k) + have hf (n : ℕ) : (fun k : ℕ => D.localizers.embed ((2*k : ℕ) : ℝ) (f n)) ∈ + {x | ∀ k, x k ∈ K k} := by + intro k + apply subset_closure + refine ⟨D.localizers.embed (((2*k : ℕ) : ℝ)+2) (f n),?_,?_⟩ + · simpa only [Metric.mem_closedBall,dist_zero_right] using hC k n + · exact D.localizers.lower_embed (by linarith : ((2*k : ℕ) : ℝ) ≤ ((2*k : ℕ) : ℝ)+2) (f n) + obtain ⟨u,_,r,hr,hu⟩ := (isCompact_pi_infinite hK).tendsto_subseq hf + refine ⟨u,r,hr,fun k => ?_⟩ + exact (continuous_apply k).tendsto u |>.comp hu + + + +theorem smooth_sequence_compact (f : ℕ → Smooth A) + (hbound : ∀ k : ℕ, ∃ C : ℝ, ∀ n : ℕ, + ‖D.localizers.embed (((2*k : ℕ) : ℝ)+2) (f n)‖ ≤ C) : + ∃ (fLim : Smooth A) (r : ℕ → ℕ), StrictMono r ∧ ∀ k : ℕ, + Tendsto (fun n => D.localizers.embed (k : ℝ) (f (r n))) atTop + (𝓝 (D.localizers.embed (k : ℝ) fLim)) := by + obtain ⟨u,r,hr,hu⟩ := D.even_tower_subsequence f hbound + let u₀ := D.localizers.lower ((2*0 : ℕ) : ℝ) 0 (u 0) + have h₀ : Tendsto (fun n => D.localizers.embed 0 (f (r n))) atTop (𝓝 u₀) := + D.localizers.lower_tendsto_smooth (Nat.cast_nonneg _) (fun n => f (r n)) (u 0) (hu 0) + let v (k : ℕ) := D.localizers.lower ((2*k : ℕ) : ℝ) (k : ℝ) (u k) + have hv (k : ℕ) : Tendsto (fun n => D.localizers.embed (k : ℝ) (f (r n))) atTop (𝓝 (v k)) := + D.localizers.lower_tendsto_smooth (by exact_mod_cast (show k ≤ 2*k by omega)) + (fun n => f (r n)) (u k) (hu k) + have hv₀ (k : ℕ) : D.localizers.lower (k : ℝ) 0 (v k) = u₀ := by + exact tendsto_nhds_unique + (D.localizers.lower_tendsto_smooth (Nat.cast_nonneg k) (fun n => f (r n)) (v k) (hv k)) h₀ + obtain ⟨fLim,hfLim⟩ := D.allRegular_smooth (fun k => ⟨v k,hv₀ k⟩) + refine ⟨fLim,r,hr,fun k => ?_⟩ + have he : v k = D.localizers.embed (k : ℝ) fLim := by + apply D.localizers.lower_injective (Nat.cast_nonneg k) + rw [hv₀,D.localizers.lower_embed (Nat.cast_nonneg k),hfLim] + exact he ▸ hv k + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/SobolevDetDifferential.lean b/lean/OAI/Geometry/PrescribedPotential/SobolevDetDifferential.lean new file mode 100644 index 0000000000000000000000000000000000000000..8254cf568effd03df1650b2e77adce9231a97342 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/SobolevDetDifferential.lean @@ -0,0 +1,64 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.NonlinearHessianCommutator + +namespace OAI + +/-! Sobolev Det Differential. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff Classical Matrix.Norms.Elementwise +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +lemma determinant_map_contDiff (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (n : ℕ) : + ContDiff ℝ ∞ (D.determinant k hk n) := by + change ContDiff ℝ ∞ (fun M : Fin n → Fin n → D.localizers.Sobolev (k : ℝ) => + D.determinant k hk n M) + exact D.determinant_contDiff k hk n (fun i j (M : Fin n → Fin n → D.localizers.Sobolev (k : ℝ)) => M i j) (fun i j => by fun_prop) + +def detDifferential (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (n : ℕ) + (M : Matrix (Fin n) (Fin n) (D.localizers.Sobolev (k : ℝ))) : + (Fin n → Fin n → D.localizers.Sobolev (k : ℝ)) →L[ℝ] D.localizers.Sobolev (k : ℝ) := + fderiv ℝ (D.determinant k hk n) M + +lemma detDifferential_contDiff (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (n : ℕ) : + ContDiff ℝ ∞ (D.detDifferential k hk n) := by + exact (D.determinant_map_contDiff k hk n).fderiv_right (by simp) + +lemma detDifferential_strong (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (n : ℕ) + (M N : Matrix (Fin n) (Fin n) (D.localizers.Sobolev (k : ℝ))) (x : X) : + D.localizers.strong (k : ℝ) (D.detDifferential k hk n M N) x = + NonlinearHessian.detDifferential + (fun i j => D.localizers.strong (k : ℝ) (M i j) x) + (fun i j => D.localizers.strong (k : ℝ) (N i j) x) := by + let E : D.localizers.Sobolev (k : ℝ) →L[ℝ] ℂ := + (BoundedContinuousFunction.evalCLM ℝ x).comp (D.localizers.strong (k : ℝ)) + let EM : (Fin n → Fin n → D.localizers.Sobolev (k : ℝ)) →L[ℝ] + (Fin n → Fin n → ℂ) := ContinuousLinearMap.pi fun i => ContinuousLinearMap.pi fun j => + (E.comp (ContinuousLinearMap.proj j : (Fin n → D.localizers.Sobolev (k : ℝ)) →L[ℝ] + D.localizers.Sobolev (k : ℝ))).comp (ContinuousLinearMap.proj i) + have hleft := E.hasFDerivAt.comp M + ((D.determinant_map_contDiff k hk n).differentiable (by simp) M).hasFDerivAt + have hright := (NonlinearHessian.detDifferential_hasFDeriv (EM M)).comp M EM.hasFDerivAt + have he : (fun u => E (D.determinant k hk n u)) = (fun u => Matrix.det (EM u)) := by + funext u + exact D.determinant_strong k hk n u x + have hh := hleft.unique (hright.congr_of_eventuallyEq (Filter.Eventually.of_forall (congr_fun he))) + exact congrArg (fun T : (Fin n → Fin n → D.localizers.Sobolev (k : ℝ)) →L[ℝ] ℂ => T N) hh + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/SobolevDeterminant.lean b/lean/OAI/Geometry/PrescribedPotential/SobolevDeterminant.lean new file mode 100644 index 0000000000000000000000000000000000000000..fdbd06f5c6847e6c1ae608fcd2c151db5d847e63 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/SobolevDeterminant.lean @@ -0,0 +1,88 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CompletedProduct +import OAI.Geometry.PrescribedPotential.GlobalOperator +import OAI.Geometry.PrescribedPotential.PatchCutoffs + +namespace OAI + +/-! Sobolev Determinant. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff Classical BoundedContinuousFunction +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +def finiteProduct (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) : + ∀ n : ℕ, (Fin n → D.localizers.Sobolev (k : ℝ)) → D.localizers.Sobolev (k : ℝ) + | 0, _ => D.localizers.embed (k : ℝ) (Smooth.const 1) + | n+1, f => D.product k hk (f 0) (finiteProduct k hk n (fun i => f i.succ)) + +lemma finiteProduct_contDiff {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (n : ℕ) + (f : Fin n → E → D.localizers.Sobolev (k : ℝ)) (hf : ∀ i, ContDiff ℝ ∞ (f i)) : + ContDiff ℝ ∞ (fun u => D.finiteProduct k hk n (fun i => f i u)) := by + induction n with + | zero => exact contDiff_const + | succ n ih => + exact ((D.product k hk).contDiff.comp (hf 0)).clm_apply (ih _ (fun i => hf i.succ)) + +lemma finiteProduct_strong (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (n : ℕ) + (f : Fin n → D.localizers.Sobolev (k : ℝ)) (x : X) : + D.localizers.strong (k : ℝ) (D.finiteProduct k hk n f) x = + ∏ i, D.localizers.strong (k : ℝ) (f i) x := by + have hs : (Module.finrank ℝ (EC d) : ℝ) < 2*(k : ℝ) := by + have hh : (Module.finrank ℝ (EC d) : ℝ) < (k : ℝ) := by exact_mod_cast hk + linarith [Nat.cast_nonneg (α := ℝ) k] + induction n with + | zero => + rw [finiteProduct, D.localizers.strong_embed _ hs] + simp only [Finset.univ_eq_empty, Finset.prod_empty] + rfl + | succ n ih => + rw [finiteProduct, D.product_strong, BoundedContinuousFunction.mul_apply, + ih, Fin.prod_univ_succ] + +def determinant (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (n : ℕ) + (M : Matrix (Fin n) (Fin n) (D.localizers.Sobolev (k : ℝ))) : + D.localizers.Sobolev (k : ℝ) := + ∑ σ : Equiv.Perm (Fin n), ((↑(Equiv.Perm.sign σ) : ℤ) : ℝ) • + D.finiteProduct k hk n (fun i => M (σ i) i) + +lemma determinant_contDiff {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (n : ℕ) + (M : Fin n → Fin n → E → D.localizers.Sobolev (k : ℝ)) + (hM : ∀ i j, ContDiff ℝ ∞ (M i j)) : + ContDiff ℝ ∞ (fun u => D.determinant k hk n (fun i j => M i j u)) := by + apply ContDiff.sum + intro σ _ + exact (D.finiteProduct_contDiff k hk n _ (fun i => hM (σ i) i)).const_smul _ + +lemma determinant_strong (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (n : ℕ) + (M : Matrix (Fin n) (Fin n) (D.localizers.Sobolev (k : ℝ))) (x : X) : + D.localizers.strong (k : ℝ) (D.determinant k hk n M) x = + Matrix.det (fun i j => D.localizers.strong (k : ℝ) (M i j) x) := by + change (Fin n → Fin n → D.localizers.Sobolev (k : ℝ)) at M + simp only [determinant, map_sum, map_smul, BoundedContinuousFunction.sum_apply, + BoundedContinuousFunction.smul_apply] + erw [Matrix.det_apply'] + apply Finset.sum_congr rfl + intro σ _ + rw [D.finiteProduct_strong] + simp only [Complex.real_smul, Complex.ofReal_intCast] + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/SobolevEmbedding.lean b/lean/OAI/Geometry/PrescribedPotential/SobolevEmbedding.lean new file mode 100644 index 0000000000000000000000000000000000000000..0d4671bf97f623d79ee676cf5405f2cae1d9d6e0 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/SobolevEmbedding.lean @@ -0,0 +1,160 @@ +import Mathlib + +namespace OAI + +/-! Sobolev Embedding. -/ + +section + + + +noncomputable section +open MeasureTheory FourierTransform TemperedDistribution +open scoped SchwartzMap BoundedContinuousFunction ContDiff + +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +def inverseWeight (k : ℕ) : E →ᵇ ℂ := + BoundedContinuousFunction.ofNormedAddCommGroup + (fun x : E => (((1 + ‖x‖ ^ 2) ^ (-(k : ℝ)) : ℝ) : ℂ)) + (by + have ht : (fun x : E => (((1 + ‖x‖ ^ 2) ^ (-(k : ℝ)) : ℝ) : ℂ)).HasTemperateGrowth := by fun_prop + exact ht.1.continuous) 1 (by + intro x + change ‖(((1 + ‖x‖ ^ 2) ^ (-(k : ℝ)) : ℝ) : ℂ)‖ ≤ 1 + rw [Complex.norm_real, Real.norm_eq_abs, + abs_of_pos (Real.rpow_pos_of_pos (by positivity : 0 < 1 + ‖x‖ ^ 2) _)] + exact Real.rpow_le_one_of_one_le_of_nonpos + (by nlinarith [sq_nonneg ‖x‖] : 1 ≤ 1 + ‖x‖ ^ 2) (neg_nonpos.mpr (Nat.cast_nonneg k))) + +lemma inverseWeight_temperate (k : ℕ) : + (inverseWeight (E := E) k : E → ℂ).HasTemperateGrowth := by + change (fun x : E => (((1 + ‖x‖ ^ 2) ^ (-(k : ℝ)) : ℝ) : ℂ)).HasTemperateGrowth + fun_prop + +lemma weight_cancel (k : ℕ) (x : E) : + (((1 + ‖x‖ ^ 2) ^ k : ℝ) : ℂ) * inverseWeight k x = 1 := by + change (((1 + ‖x‖ ^ 2) ^ k : ℝ) : ℂ) * + (((1 + ‖x‖ ^ 2) ^ (-(k : ℝ)) : ℝ) : ℂ) = 1 + rw [← Complex.ofReal_mul, ← Complex.ofReal_one, Complex.ofReal_inj] + rw [← Real.rpow_natCast, ← Real.rpow_add (by positivity), add_neg_cancel, Real.rpow_zero] + +variable [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +lemma all_even_bessel_fourier_L1 {u : 𝓢'(E, ℂ)} + (hu : ∀ k : ℕ, MemSobolev (2 * (k : ℝ)) 2 u) (k : ℕ) : + ∃ v : Lp ℂ 1 (volume : Measure E), + 𝓕 (besselPotential E ℂ (2 * k) u) = (v : 𝓢'(E, ℂ)) := by + have hm : MemSobolev (2 * ((Module.finrank ℝ E + 1 : ℕ) : ℝ)) 2 + (besselPotential E ℂ (2 * k) u) := by + rw [memSobolev_besselPotential_iff] + convert hu (k + (Module.finrank ℝ E + 1)) using 1; push_cast; ring + exact hm.fourier_memL1 (by push_cast; nlinarith [Nat.cast_nonneg (α := ℝ) (Module.finrank ℝ E)]) + + + +lemma all_even_fourier_moments {u : 𝓢'(E, ℂ)} + (hu : ∀ k : ℕ, MemSobolev (2 * (k : ℝ)) 2 u) : + ∃ v : Lp ℂ 1 (volume : Measure E), + 𝓕 u = (v : 𝓢'(E, ℂ)) ∧ + ∀ n : ℕ, Integrable (fun x => ‖x‖ ^ n * ‖v x‖) := by + obtain ⟨v, hv⟩ := all_even_bessel_fourier_L1 hu 0 + simp only [Nat.cast_zero, mul_zero, besselPotential_zero, + ContinuousLinearMap.id_apply] at hv + refine ⟨v, hv, fun n => ?_⟩ + obtain ⟨w, hw⟩ := all_even_bessel_fourier_L1 hu n + have hw' : smulLeftCLM ℂ (fun x : E => (((1 + ‖x‖ ^ 2) ^ n : ℝ) : ℂ)) + (𝓕 u) = (w : 𝓢'(E, ℂ)) := by + rw [fourier_besselPotential_eq_smulLeftCLM_fourier_apply] at hw + simpa only [mul_div_cancel_left₀ (n : ℝ) (by norm_num : (2 : ℝ) ≠ 0), + Real.rpow_natCast] using hw + let b := inverseWeight (E := E) n + have hb := b.memLp_top (μ := volume) + have he : (hb.toLp b : Lp ℂ ⊤ volume) • w = v := by + apply (LinearMap.ker_eq_bot.mp (Lp.ker_toTemperedDistributionCLM_eq_bot + (F := ℂ) (E := E) (μ := volume) (p := 1))) + change (((hb.toLp b : Lp ℂ ⊤ volume) • w : Lp ℂ 1 volume) : 𝓢'(E, ℂ)) = (v : 𝓢'(E, ℂ)) + rw [Lp.toTemperedDistribution_smul_eq (inverseWeight_temperate n) hb, + ← hw', smulLeftCLM_smulLeftCLM_apply (by fun_prop) (inverseWeight_temperate n)] + have hc : (fun x : E => (((1 + ‖x‖ ^ 2) ^ n : ℝ) : ℂ)) * (b : E → ℂ) = fun _ => 1 := by + ext x + exact weight_cancel n x + rw [hc, smulLeftCLM_const, one_smul, hv] + have he' : ∀ᵐ x, ((1 + ‖x‖ ^ 2) ^ n : ℝ) * ‖v x‖ = ‖w x‖ := by + have hh := Lp.coeFn_lpSMul (r := 1) (hb.toLp b : Lp ℂ ⊤ volume) w + rw [he] at hh + filter_upwards [hh, hb.coeFn_toLp] with x hx hb' + have hx' : (((1 + ‖x‖ ^ 2) ^ n : ℝ) : ℂ) * v x = w x := by + rw [hx, Pi.smul_apply', hb', smul_eq_mul, ← mul_assoc, weight_cancel, one_mul] + simpa only [norm_mul, Complex.norm_real, Real.norm_eq_abs, + abs_of_nonneg (show 0 ≤ (1 + ‖x‖ ^ 2) ^ n by positivity)] using congrArg norm hx' + apply (L1.integrable_coeFn w).norm.mono' + (((continuous_norm.pow n).aestronglyMeasurable).mul (Lp.aestronglyMeasurable v).norm) + filter_upwards [he'] with x hx + change ‖‖x‖ ^ n * ‖v x‖‖ ≤ ‖w x‖ + rw [Real.norm_of_nonneg (mul_nonneg (pow_nonneg (norm_nonneg x) n) (norm_nonneg (v x))), ← hx] + apply mul_le_mul_of_nonneg_right _ (norm_nonneg _) + apply pow_le_pow_left₀ (norm_nonneg _) + nlinarith [sq_nonneg (‖x‖ - 1 / 2)] + + +def boundedDistribution (f : E →ᵇ ℂ) : 𝓢'(E, ℂ) := + (f.memLp_top (μ := volume)).toLp f + +lemma boundedDistribution_apply (f : E →ᵇ ℂ) (φ : 𝓢(E, ℂ)) : + boundedDistribution f φ = ∫ x, φ x • f x := by + rw [boundedDistribution, Lp.toTemperedDistribution_apply] + apply integral_congr_ae + filter_upwards [(f.memLp_top (μ := volume)).coeFn_toLp] with x hx + rw [hx] + +lemma fourier_L1_distribution (v : Lp ℂ 1 (volume : Measure E)) : + boundedDistribution (Real.Lp.fourierTransform v) = 𝓕 (v : 𝓢'(E, ℂ)) := by + ext φ + rw [boundedDistribution_apply, TemperedDistribution.fourier_apply, + Lp.toTemperedDistribution_apply] + symm + simpa using! VectorFourier.integral_fourierIntegral_smul_eq_flip + (L := innerₗ E) Real.continuous_fourierChar continuous_inner + φ.integrable (L1.integrable_coeFn v) + +lemma fourierInv_L1_distribution (v : Lp ℂ 1 (volume : Measure E)) : + boundedDistribution (Real.Lp.fourierTransformInv v) = 𝓕⁻ (v : 𝓢'(E, ℂ)) := by + ext φ + rw [boundedDistribution_apply, TemperedDistribution.fourierInv_apply, + Lp.toTemperedDistribution_apply] + symm + simpa [SchwartzMap.fourierInv_coe, Real.fourierInv_eq, VectorFourier.fourierIntegral, real_inner_comm] using! + VectorFourier.integral_fourierIntegral_smul_eq_flip + (μ := volume) (ν := volume) (L := -innerₗ E) Real.continuous_fourierChar continuous_inner.neg + φ.integrable (L1.integrable_coeFn v) + +lemma fourier_temperate_of_moments {f : E → ℂ} (hf : AEStronglyMeasurable f) + (hm : ∀ n : ℕ, Integrable (fun x => ‖x‖ ^ n * ‖f x‖)) : + (𝓕 f).HasTemperateGrowth := by + refine ⟨Real.contDiff_fourier (N := ⊤) (fun n _ => hm n), fun n => ?_⟩ + refine ⟨0, ∫ x, ‖VectorFourier.fourierPowSMulRight (innerSL ℝ) f x n‖, fun x => ?_⟩ + rw [Real.iteratedFDeriv_fourier (N := ⊤) (fun k _ => hm k) hf (by simp)] + simp only [pow_zero, mul_one] + exact VectorFourier.norm_fourierIntegral_le_integral_norm + Real.fourierChar volume (innerₗ E) _ x + + + +theorem all_even_smooth_representative {u : 𝓢'(E, ℂ)} + (hu : ∀ k : ℕ, MemSobolev (2 * (k : ℝ)) 2 u) : + ∃ f : E →ᵇ ℂ, (f : E → ℂ).HasTemperateGrowth ∧ boundedDistribution f = u := by + obtain ⟨v, hv, hm⟩ := all_even_fourier_moments hu + refine ⟨Real.Lp.fourierTransformInv v, ?_, ?_⟩ + · have ht := fourier_temperate_of_moments (Lp.aestronglyMeasurable v) hm + change (fun x : E => 𝓕 (v : E → ℂ) (-x)).HasTemperateGrowth + fun_prop + · rw [fourierInv_L1_distribution, ← hv, fourierInv_fourier_eq] + +end SobolevChart + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/SobolevExponential.lean b/lean/OAI/Geometry/PrescribedPotential/SobolevExponential.lean new file mode 100644 index 0000000000000000000000000000000000000000..a4077033f55feb0cd5aed7623f9c27c673571d9a --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/SobolevExponential.lean @@ -0,0 +1,141 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CompletedProduct +import OAI.Geometry.PrescribedPotential.PatchCutoffs +import OAI.Geometry.PrescribedPotential.RealPoisson +import OAI.Geometry.PrescribedPotential.RealSobolev + +namespace OAI + +/-! Sobolev Exponential. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical BoundedContinuousFunction +namespace ExponentialEvaluation +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] +lemma apply_exp (L : E →L[ℝ] E) (q : E →L[ℝ] ℝ) (a : ℝ) + (hq : ∀ v, q (L v) = a * q v) (v : E) : + q (NormedSpace.exp L v) = Real.exp a * q v := by + have hp (n : ℕ) : q ((L^n) v) = a^n * q v := by + induction n with + | zero => simp + | succ n hn => + rw [pow_succ'] + change q (L ((L^n) v)) = _ + rw [hq, hn, pow_succ'] + ring + let e := q.comp (ContinuousLinearMap.apply ℝ E v) + have hl := e.hasSum (NormedSpace.exp_series_hasSum_exp' (𝕂 := ℝ) L) + have hr := (NormedSpace.exp_series_hasSum_exp' (𝕂 := ℝ) a).mul_right (q v) + rw [← Real.exp_eq_exp_ℝ] at hr + have ht : (fun n : ℕ => e ((n.factorial : ℝ)⁻¹ • L^n)) = + (fun n : ℕ => (n.factorial : ℝ)⁻¹ • a^n * q v) := by + funext n + change q (((n.factorial : ℝ)⁻¹ • L^n) v) = (n.factorial : ℝ)⁻¹ * a^n * q v + rw [_root_.smul_apply, map_smul, hp] + simp only [smul_eq_mul] + ring + rw [ht] at hl + exact hl.unique hr + +def orbit (L : E →L[ℝ] E) (v : E) (t : ℝ) : E := + NormedSpace.exp (t • L) v + +omit [CompleteSpace E] in +lemma orbit_zero (L : E →L[ℝ] E) (v : E) : orbit L v 0 = v := by + simp [orbit, NormedSpace.exp_zero] + +lemma orbit_continuous (L : E →L[ℝ] E) (v : E) : Continuous (orbit L v) := by + have ht : Continuous (fun t : ℝ => t • L) := continuous_id.smul continuous_const + have he : Continuous (NormedSpace.exp : (E →L[ℝ] E) → (E →L[ℝ] E)) := + continuous_iff_continuousAt.mpr (fun w => (NormedSpace.exp_analytic (𝕂 := ℝ) w).continuousAt) + exact (ContinuousLinearMap.apply ℝ E v).continuous.comp (he.comp ht) +end ExponentialEvaluation + +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace RealSmooth + +def mul (F h : RealSmooth A) : RealSmooth A := + ⟨F.val.mul h.val, fun x => by + change (F.val x * h.val x).im = 0 + rw [Complex.mul_im, F.property, h.property] + ring⟩ +end RealSmooth +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) +local instance expRealNormedGroup (s : ℝ) : NormedAddCommGroup (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedAddCommGroup +local instance expRealNormedSpace (s : ℝ) : NormedSpace ℝ (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedSpace +local instance expRealTopologicalGroup (s : ℝ) : IsTopologicalAddGroup (D.localizers.RealSobolev s) := + Submodule.isTopologicalAddGroup _ +local instance expRealContinuousSMul (s : ℝ) : ContinuousSMul ℝ (D.localizers.RealSobolev s) := + SMulMemClass.continuousSMul _ + +def realMultiplier (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (F : RealSmooth A) : + D.localizers.RealSobolev (k : ℝ) →L[ℝ] D.localizers.RealSobolev (k : ℝ) := + ((D.product k hk (D.localizers.embed (k : ℝ) F.val)).comp + (D.localizers.realCompletion (k : ℝ)).subtypeL).codRestrict + (D.localizers.realCompletion (k : ℝ)) (fun u => + D.localizers.maps_realCompletion (D.product k hk (D.localizers.embed (k : ℝ) F.val)) + (fun h => ⟨F.mul h,D.product_embed k hk F.val h.val⟩) u.val u.property) + +lemma realMultiplier_evaluation (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (F : RealSmooth A) (u : D.localizers.RealSobolev (k : ℝ)) (x : X) : + D.realEvaluation (k : ℝ) x (D.realMultiplier k hk F u) = + F.source.value x * D.realEvaluation (k : ℝ) x u := by + have hs : (Module.finrank ℝ (EC d) : ℝ) < 2*(k : ℝ) := by + have hh : (Module.finrank ℝ (EC d) : ℝ) < (k : ℝ) := by exact_mod_cast hk + linarith [Nat.cast_nonneg (α := ℝ) k] + change (D.localizers.strong (k : ℝ) + (D.product k hk (D.localizers.embed (k : ℝ) F.val) u.val) x).re = _ + rw [D.product_strong, BoundedContinuousFunction.mul_apply, D.localizers.strong_embed _ hs] + change (F.val x * D.localizers.strong (k : ℝ) u.val x).re = _ + rw [Complex.mul_re, F.property, zero_mul, sub_zero] + rfl + + + +def exponentialDensity (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (F : RealSmooth A) (t : ℝ) : D.localizers.RealSobolev (k : ℝ) := + ExponentialEvaluation.orbit (D.realMultiplier k hk F) (D.realConstants (k : ℝ) 1) t + +lemma exponentialDensity_zero (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (F : RealSmooth A) : D.exponentialDensity k hk F 0 = D.realConstants (k : ℝ) 1 := by + exact ExponentialEvaluation.orbit_zero _ _ + +lemma exponentialDensity_continuous (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (F : RealSmooth A) : Continuous (D.exponentialDensity k hk F) := by + exact ExponentialEvaluation.orbit_continuous _ _ + +lemma exponentialDensity_strong [ConnectedSpace X] (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (F : RealSmooth A) (t : ℝ) (x : X) : + D.localizers.strong (k : ℝ) (D.exponentialDensity k hk F t).val x = + (Real.exp (t * F.source.value x) : ℂ) := by + have hs : (Module.finrank ℝ (EC d) : ℝ) < 2*(k : ℝ) := by + have hh : (Module.finrank ℝ (EC d) : ℝ) < (k : ℝ) := by exact_mod_cast hk + linarith [Nat.cast_nonneg (α := ℝ) k] + have hh := ExponentialEvaluation.apply_exp (t • D.realMultiplier k hk F) + (D.realEvaluation (k : ℝ) x) (t * F.source.value x) (fun u => by + rw [_root_.smul_apply, map_smul, D.realMultiplier_evaluation] + simp only [smul_eq_mul] + ring) (D.realConstants (k : ℝ) 1) + rw [D.realEvaluation_constants hs, mul_one] at hh + apply Complex.ext + · exact hh + · exact D.localizers.real_strong hs (D.exponentialDensity k hk F t) x + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/SobolevFirstGain.lean b/lean/OAI/Geometry/PrescribedPotential/SobolevFirstGain.lean new file mode 100644 index 0000000000000000000000000000000000000000..545bd10ac19043e3006a742f127957f8c438bf5b --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/SobolevFirstGain.lean @@ -0,0 +1,89 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.SobolevReconstruction +import OAI.Geometry.PrescribedPotential.WeakDerivativeLocalization + +namespace OAI + +/-! Sobolev First Gain. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory TemperedDistribution LineDeriv +open scoped ContDiff SchwartzMap Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +lemma completedLocalize_plus_one_embed (k : ℕ) (i : Fin A.count) (ρ : Smooth A) + (hρ : tsupport (ρ : X → ℂ) ⊆ (A.euclideanChart i).source) (f : Smooth A) : + D.completedLocalize ((k : ℝ)+1) i ρ hρ (D.localizers.embed ((k : ℝ)+1) f) = + schwartzCoord ((k : ℝ)+1) (localize A i ρ hρ f) := by + obtain ⟨C,_,hC⟩ := D.localization_integer_bound i ρ hρ (k+1) + rw [Nat.cast_add,Nat.cast_one] at hC + exact LinearMap.extendOfNorm_eq (D.localizers.embed_dense ((k : ℝ)+1)) ⟨C,hC⟩ f + +lemma completedLocalize_lower_one (k : ℕ) (i : Fin A.count) (ρ : Smooth A) + (hρ : tsupport (ρ : X → ℂ) ⊆ (A.euclideanChart i).source) + (u : D.localizers.Sobolev ((k : ℝ)+1)) : + realize (k : ℝ) (D.completedLocalize (k : ℝ) i ρ hρ + (D.localizers.lower ((k : ℝ)+1) (k : ℝ) u)) = + realize ((k : ℝ)+1) (D.completedLocalize ((k : ℝ)+1) i ρ hρ u) := by + have he : (fun u : D.localizers.Sobolev ((k : ℝ)+1) => realize (k : ℝ) + (D.completedLocalize (k : ℝ) i ρ hρ (D.localizers.lower ((k : ℝ)+1) (k : ℝ) u))) = + (fun u => realize ((k : ℝ)+1) (D.completedLocalize ((k : ℝ)+1) i ρ hρ u)) := by + apply (D.localizers.embed_dense ((k : ℝ)+1)).equalizer (by fun_prop) (by fun_prop) + funext f + dsimp only [Function.comp_apply] + simp only [D.localizers.lower_embed (by linarith : (k : ℝ) ≤ (k : ℝ)+1), + D.completedLocalize_embed,D.completedLocalize_plus_one_embed,realize_schwartzCoord] + exact congr_fun he u + +lemma local_mem_of_derivative_lifts (k : ℕ) (u : D.localizers.Sobolev ((k : ℝ)+1)) + (hD : ∀ (p : ι) (v : EC d), ∃ w : D.localizers.Sobolev ((k : ℝ)+1), + D.localizers.lower ((k : ℝ)+1) (k : ℝ) w = D.completedDerivative k p v u) + (p : ι) : + MemSobolev ((k : ℝ)+2) 2 (D.localizers.distribution ((k : ℝ)+1) p u) := by + have hu : MemSobolev ((k : ℝ)+1) 2 (D.localizers.distribution ((k : ℝ)+1) p u) := + realize_memSobolev _ _ + have hder (v : EC d) : MemSobolev ((k : ℝ)+1) 2 + (∂_{v} (D.localizers.distribution ((k : ℝ)+1) p u)) := by + obtain ⟨w,hw⟩ := hD p v + rw [D.distribution_derivative,D.completedLocalize_lower_one,← hw, + D.localizers.distribution_lower (by linarith : (k : ℝ) ≤ (k : ℝ)+1)] + exact (realize_memSobolev _ _).add (realize_memSobolev _ _) + convert memSobolev_of_first_basis hu (fun j => hder (stdOrthonormalBasis ℝ (EC d) j)) using 1 + ring + + + +theorem sobolev_first_gain (k : ℕ) (u : D.localizers.Sobolev ((k : ℝ)+1)) + (hD : ∀ (p : ι) (v : EC d), ∃ w : D.localizers.Sobolev ((k : ℝ)+1), + D.localizers.lower ((k : ℝ)+1) (k : ℝ) w = D.completedDerivative k p v u) : + ∃ w : D.localizers.Sobolev ((k+2 : ℕ) : ℝ), + D.localizers.lower ((k+2 : ℕ) : ℝ) ((k : ℝ)+1) w = u := by + have h0 : 0 ≤ (k : ℝ)+1 := by positivity + have hh : ∀ p, MemSobolev ((k+2 : ℕ) : ℝ) 2 + (D.localizers.distribution 0 p (D.localizers.lower ((k : ℝ)+1) 0 u)) := by + intro p + rw [D.localizers.distribution_lower h0] + simpa only [Nat.cast_add,Nat.cast_ofNat] using D.local_mem_of_derivative_lifts k u hD p + obtain ⟨w,hw⟩ := D.sobolev_of_local_order (k+2) (D.localizers.lower ((k : ℝ)+1) 0 u) hh + refine ⟨w, (D.localizers.lower_injective h0) ?_⟩ + have hc := congrArg (fun L : D.localizers.Sobolev ((k+2 : ℕ) : ℝ) →L[ℝ] + D.localizers.Sobolev 0 => L w) + (D.localizers.lower_comp (by push_cast; linarith : (k : ℝ)+1 ≤ ((k+2 : ℕ) : ℝ)) h0) + exact hc.trans hw + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/SobolevLocalization.lean b/lean/OAI/Geometry/PrescribedPotential/SobolevLocalization.lean new file mode 100644 index 0000000000000000000000000000000000000000..058f6dd9fe581bf26867c69c42a8320cf5f9d4f2 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/SobolevLocalization.lean @@ -0,0 +1,188 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.SobolevParametrix + +namespace OAI + +/-! Sobolev Localization. -/ + +section + + + +noncomputable section +open Filter Topology MeasureTheory FourierTransform TemperedDistribution LineDeriv +open scoped SchwartzMap BoundedContinuousFunction ContDiff Laplacian Real + +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +lemma schwartz_deriv_product (v : E) (g φ : 𝓢(E, ℂ)) : + ∂_{v} (SchwartzMap.smulLeftCLM ℂ g φ) = + SchwartzMap.smulLeftCLM ℂ (⇑(∂_{v} g : 𝓢(E, ℂ))) φ + + SchwartzMap.smulLeftCLM ℂ g (∂_{v} φ) := by + ext x + have he : (SchwartzMap.smulLeftCLM ℂ g φ : E → ℂ) = fun y => g y * φ y := by + ext y + simp [SchwartzMap.smulLeftCLM_apply_apply g.hasTemperateGrowth, smul_eq_mul] + simp only [SchwartzMap.lineDerivOp_apply_eq_fderiv, he, add_apply, + SchwartzMap.smulLeftCLM_apply_apply g.hasTemperateGrowth, + SchwartzMap.smulLeftCLM_apply_apply (∂_{v} g).hasTemperateGrowth, smul_eq_mul] + rw [fderiv_fun_mul g.differentiableAt φ.differentiableAt] + simp only [_root_.add_apply, _root_.smul_apply, smul_eq_mul] + ring + + +lemma weak_deriv_product (v : E) (g : 𝓢(E, ℂ)) (u : 𝓢'(E, ℂ)) : + ∂_{v} (smulLeftCLM ℂ g u) = smulLeftCLM ℂ (⇑(∂_{v} g : 𝓢(E, ℂ))) u + + smulLeftCLM ℂ g (∂_{v} u) := by + ext φ + simp only [TemperedDistribution.lineDerivOp_apply_apply, + TemperedDistribution.smulLeftCLM_apply_apply, add_apply, map_neg] + rw [schwartz_deriv_product, map_add] + abel + +variable [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +lemma multiplier_add {g h : E → ℂ} (hg : g.HasTemperateGrowth) (hh : h.HasTemperateGrowth) + (u : 𝓢'(E, ℂ)) : + fourierMultiplierCLM ℂ (g + h) u = fourierMultiplierCLM ℂ g u + + fourierMultiplierCLM ℂ h u := by + simp [fourierMultiplierCLM_apply, smulLeftCLM_add hg hh] + +lemma bessel_two_laplacian (u : 𝓢'(E, ℂ)) : + besselPotential E ℂ 2 u = u - (((2 * Real.pi)^2 : ℝ) : ℂ)⁻¹ • Δ u := by + have hpi : (((2 * Real.pi)^2 : ℝ) : ℂ) ≠ 0 := by exact_mod_cast (by positivity : (2 * Real.pi)^2 ≠ 0) + have hlo := TemperedDistribution.laplacian_eq_fourierMultiplierCLM u + rw [RCLike.real_smul_eq_coe_smul (K := ℂ), RCLike.ofReal_neg] at hlo + change Δ u = -(((2 * Real.pi)^2 : ℝ) : ℂ) • _ at hlo + rw [hlo, smul_smul, mul_neg, inv_mul_cancel₀ hpi, neg_one_smul, + sub_neg_eq_add] + unfold besselPotential + have hs : (fun x : E => (((1 + ‖x‖^2)^((2:ℝ)/2) : ℝ) : ℂ)) = + (fun _ : E => (1:ℂ)) + (fun x : E => ((‖x‖^2 : ℝ) : ℂ)) := by + ext x + norm_num + rw [hs, multiplier_add (by fun_prop) (by fun_prop)] + simp + +lemma memSobolev_sum {ι : Type*} (s : ℝ) (S : Finset ι) (u : ι → 𝓢'(E, ℂ)) + (hu : ∀ i ∈ S, MemSobolev s 2 (u i)) : MemSobolev s 2 (∑ i ∈ S, u i) := by + classical + induction S using Finset.induction_on with + | empty => simp + | @insert i S hi ih => + rw [Finset.sum_insert hi] + exact (hu i (Finset.mem_insert_self ..)).add + (ih (fun j hj => hu j (Finset.mem_insert_of_mem hj))) + + +lemma memSobolev_of_laplacian {s : ℝ} {u : 𝓢'(E, ℂ)} + (hu : MemSobolev s 2 u) (hΔ : MemSobolev s 2 (Δ u)) : MemSobolev (s + 2) 2 u := by + rw [add_comm, ← memSobolev_besselPotential_iff] + rw [bessel_two_laplacian] + exact hu.sub (hΔ.smul _) + +lemma memSobolev_of_second_basis {s : ℝ} {u : 𝓢'(E, ℂ)} + (hu : MemSobolev s 2 u) + (hD : ∀ j, MemSobolev s 2 (∂_{stdOrthonormalBasis ℝ E j} + (∂_{stdOrthonormalBasis ℝ E j} u))) : MemSobolev (s + 2) 2 u := by + apply memSobolev_of_laplacian hu + rw [TemperedDistribution.laplacian_eq_sum (stdOrthonormalBasis ℝ E)] + exact memSobolev_sum _ _ _ (fun j _ => hD j) + +lemma memSobolev_zero_mul_schwartz (g : 𝓢(E, ℂ)) {u : 𝓢'(E, ℂ)} + (hu : MemSobolev 0 2 u) : MemSobolev 0 2 (smulLeftCLM ℂ g u) := by + obtain ⟨v, hv⟩ := memSobolev_zero_iff.mp hu + apply memSobolev_zero_iff.mpr + refine ⟨multiply g.toBoundedContinuousFunction v, ?_⟩ + rw [hv, multiply_distribution _ g.hasTemperateGrowth] + rfl + + + +theorem memSobolev_even_mul_schwartz (k : ℕ) (g : 𝓢(E, ℂ)) {u : 𝓢'(E, ℂ)} + (hu : MemSobolev (2 * (k : ℝ)) 2 u) : + MemSobolev (2 * (k : ℝ)) 2 (smulLeftCLM ℂ g u) := by + induction k generalizing g u with + | zero => simpa using memSobolev_zero_mul_schwartz g (by simpa using hu) + | succ k ih => + have he : 2 * ((k + 1 : ℕ) : ℝ) = 2 * (k : ℝ) + 2 := by push_cast; ring + rw [he] at hu ⊢ + apply memSobolev_of_second_basis (ih g (hu.mono (by linarith))) + intro j + let v := stdOrthonormalBasis ℝ E j + have hu' : MemSobolev (2 * (k : ℝ)) 2 (∂_{v} u) := + hu.lineDerivOp.mono (by linarith) + have hu'' : MemSobolev (2 * (k : ℝ)) 2 (∂_{v} (∂_{v} u)) := + hu.lineDerivOp.lineDerivOp.mono (by linarith) + change MemSobolev _ _ (∂_{v} (∂_{v} (smulLeftCLM ℂ g u))) + rw [weak_deriv_product, lineDerivOp_add, weak_deriv_product, weak_deriv_product] + exact ((ih _ (hu.mono (by linarith))).add (ih _ hu')).add + ((ih _ hu').add (ih _ hu'')) + + + +def liftOperatorValue (s t : ℝ) (T : 𝓢'(E, ℂ) →L[ℂ] 𝓢'(E, ℂ)) + (hT : ∀ u, MemSobolev s 2 u → MemSobolev t 2 (T u)) (u : L2 E) : L2 E := + ((memSobolev_iff_realize t (T (realize s u))).mp + (hT _ (realize_memSobolev s u))).choose + +lemma realize_liftOperatorValue (s t : ℝ) (T : 𝓢'(E, ℂ) →L[ℂ] 𝓢'(E, ℂ)) + (hT : ∀ u, MemSobolev s 2 u → MemSobolev t 2 (T u)) (u : L2 E) : + realize t (liftOperatorValue s t T hT u) = T (realize s u) := + ((memSobolev_iff_realize t _).mp (hT _ (realize_memSobolev s u))).choose_spec + +def liftOperatorLinear (s t : ℝ) + (T : 𝓢'(E, ℂ) →L[ℂ] 𝓢'(E, ℂ)) + (hT : ∀ u, MemSobolev s 2 u → MemSobolev t 2 (T u)) : L2 E →ₗ[ℂ] L2 E where + toFun := liftOperatorValue s t T hT + map_add' u v := by + apply realize_injective t + simp only [map_add, realize_liftOperatorValue] + map_smul' c u := by + apply realize_injective t + simp only [map_smul, realize_liftOperatorValue, RingHom.id_apply] + +lemma realize_liftOperatorLinear (s t : ℝ) + (T : 𝓢'(E, ℂ) →L[ℂ] 𝓢'(E, ℂ)) + (hT : ∀ u, MemSobolev s 2 u → MemSobolev t 2 (T u)) (u : L2 E) : + realize t (liftOperatorLinear s t T hT u) = T (realize s u) := + ((memSobolev_iff_realize t _).mp (hT _ (realize_memSobolev s u))).choose_spec + +def liftOperator (s t : ℝ) (T : 𝓢'(E, ℂ) →L[ℂ] 𝓢'(E, ℂ)) + (hT : ∀ u, MemSobolev s 2 u → MemSobolev t 2 (T u)) : L2 E →L[ℂ] L2 E where + toLinearMap := liftOperatorLinear s t T hT + cont := by + apply LinearMap.continuous_of_seq_closed_graph + intro u x y hu hv + apply realize_injective t + have h₁ := ((realize t).continuous.tendsto y).comp hv + have h₂ := (T.continuous.tendsto (realize s x)).comp + (((realize s).continuous.tendsto x).comp hu) + change Tendsto (fun n => realize t (liftOperatorLinear s t T hT (u n))) + atTop (nhds (realize t y)) at h₁ + simp_rw [realize_liftOperatorLinear] at h₁ + exact (tendsto_nhds_unique h₁ h₂).trans (realize_liftOperatorLinear s t T hT x).symm + +lemma realize_liftOperator (s t : ℝ) + (T : 𝓢'(E, ℂ) →L[ℂ] 𝓢'(E, ℂ)) + (hT : ∀ u, MemSobolev s 2 u → MemSobolev t 2 (T u)) (u : L2 E) : + realize t (liftOperator s t T hT u) = T (realize s u) := + realize_liftOperatorLinear s t T hT u + + +def cutoff (k : ℕ) (g : 𝓢(E, ℂ)) : L2 E →L[ℂ] L2 E := + liftOperator (2 * (k : ℝ)) (2 * (k : ℝ)) (smulLeftCLM ℂ g) + (fun _ hu => memSobolev_even_mul_schwartz k g hu) + +lemma realize_cutoff (k : ℕ) (g : 𝓢(E, ℂ)) (u : L2 E) : + realize (2 * (k : ℝ)) (cutoff k g u) = + smulLeftCLM ℂ g (realize (2 * (k : ℝ)) u) := + realize_liftOperator _ _ _ _ _ + +end SobolevChart + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/SobolevOpenness.lean b/lean/OAI/Geometry/PrescribedPotential/SobolevOpenness.lean new file mode 100644 index 0000000000000000000000000000000000000000..5ec7ddc511c88fa06378252fb7dbd651048d285f --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/SobolevOpenness.lean @@ -0,0 +1,84 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.PatchCutoffs +import OAI.Geometry.PrescribedPotential.AugmentedVolume +import OAI.Geometry.PrescribedPotential.CompletedResolvent + +namespace OAI + +/-! Sobolev Openness. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical +namespace LocalNonlinearInverse +variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + [NormedAddCommGroup F] [NormedSpace ℝ F] [CompleteSpace F] +lemma image_mem_nhds {f : E → F} {L : E →L[ℝ] F} {a : E} + (hf : HasStrictFDerivAt f L a) (hL : Function.Surjective L) + {U : Set E} (hU : U ∈ 𝓝 a) : f '' U ∈ 𝓝 (f a) := by + rw [← hf.map_nhds_eq_of_surj (LinearMap.range_eq_top.mpr hL)] + change f ⁻¹' (f '' U) ∈ 𝓝 a + exact mem_of_superset hU (fun x hx => ⟨x,hx,rfl⟩) +end LocalNonlinearInverse + +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) +local instance sobolevOpennessNormedAddCommGroup (s : ℝ) : + NormedAddCommGroup (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedAddCommGroup +local instance sobolevOpennessNormedSpace (s : ℝ) : NormedSpace ℝ (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedSpace +local instance sobolevOpennessIsTopologicalAddGroup (s : ℝ) : + IsTopologicalAddGroup (D.localizers.RealSobolev s) := + Submodule.isTopologicalAddGroup _ +local instance sobolevOpennessContinuousSMul (s : ℝ) : + ContinuousSMul ℝ (D.localizers.RealSobolev s) := + SMulMemClass.continuousSMul _ + +lemma augmentedVolume_image_nhds (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (x₀ : X) + {U : Set (D.localizers.RealSobolev ((k : ℝ)+2) × ℝ)} (hU : U ∈ 𝓝 0) : + D.augmentedVolume k hk x₀ '' U ∈ 𝓝 (D.realConstants (k : ℝ) 1, 0) := by + obtain ⟨m,hm,he⟩ := D.exists_completedError_small + obtain ⟨P⟩ := D.localizers.constantProjection_exists + have hs : (Module.finrank ℝ (EC d) : ℝ) < 2*((k : ℝ)+2) := by + have hh : (Module.finrank ℝ (EC d) : ℝ) < (k : ℝ) := by exact_mod_cast hk + linarith [Nat.cast_nonneg (α := ℝ) k] + have hi := LocalNonlinearInverse.image_mem_nhds + (D.augmentedVolume_hasStrictFDerivAt_zero k hk x₀) + (D.realAugmentedL_bijective m hm he P k hs x₀).2 hU + rwa [D.augmentedVolume_zero] at hi + + + +theorem volume_eventually_solvable (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (x₀ : X) + {U : Set (D.localizers.RealSobolev ((k : ℝ)+2) × ℝ)} (hU : U ∈ 𝓝 0) : + ∀ᶠ f in 𝓝 (D.realConstants (k : ℝ) 1), + ∃ (u : D.localizers.RealSobolev ((k : ℝ)+2)) (b : ℝ), + (u,b) ∈ U ∧ D.realVolume k hk u = Real.exp b • f ∧ + D.realEvaluation ((k : ℝ)+2) x₀ u = 0 := by + have hi := D.augmentedVolume_image_nhds k hk x₀ hU + have ht : Tendsto (fun f : D.localizers.RealSobolev (k : ℝ) => (f, (0 : ℝ))) + (𝓝 (D.realConstants (k : ℝ) 1)) (𝓝 (D.realConstants (k : ℝ) 1, 0)) := + continuousAt_id.prodMk continuousAt_const + filter_upwards [ht hi] with f hf + obtain ⟨⟨u,b⟩,hu,hv⟩ := hf + refine ⟨u,b,hu,?_,congrArg Prod.snd hv⟩ + have hh := congrArg (fun z => Real.exp b • z.1) hv + change Real.exp b • (Real.exp (-b) • D.realVolume k hk u) = Real.exp b • f at hh + simpa only [smul_smul, ← Real.exp_add, add_neg_cancel, Real.exp_zero, one_smul] using hh + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/SobolevParametrix.lean b/lean/OAI/Geometry/PrescribedPotential/SobolevParametrix.lean new file mode 100644 index 0000000000000000000000000000000000000000..f4b5315a05c1fbbf61801c34fc1a8d4c39c065a9 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/SobolevParametrix.lean @@ -0,0 +1,198 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.FrozenPoisson + +namespace OAI + +/-! Sobolev Parametrix. -/ + +section + + + +noncomputable section +open MeasureTheory FourierTransform TemperedDistribution +open scoped SchwartzMap BoundedContinuousFunction ComplexOrder MatrixOrder Real + +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +abbrev L2 (E : Type*) [MeasureSpace E] := Lp ℂ 2 (volume : Measure E) + + + +def realize (s : ℝ) : L2 E →L[ℂ] 𝓢'(E, ℂ) := + besselPotential E ℂ (-s) ∘L Lp.toTemperedDistributionCLM ℂ volume 2 + +lemma bessel_realize (s : ℝ) (u : L2 E) : + besselPotential E ℂ s (realize s u) = (u : 𝓢'(E, ℂ)) := by + simp [realize] + +lemma realize_memSobolev (s : ℝ) (u : L2 E) : MemSobolev s 2 (realize s u) := + ⟨u, bessel_realize s u⟩ + +lemma l2_injective : Function.Injective (Lp.toTemperedDistributionCLM ℂ (volume : Measure E) 2) := + LinearMap.ker_eq_bot.mp Lp.ker_toTemperedDistributionCLM_eq_bot + +lemma realize_injective (s : ℝ) : Function.Injective (realize (E := E) s) := by + intro u v h + apply l2_injective + rw [Lp.toTemperedDistributionCLM_apply, Lp.toTemperedDistributionCLM_apply] + simpa only [bessel_realize] using congrArg (besselPotential E ℂ s) h + +lemma memSobolev_iff_realize (s : ℝ) (u : 𝓢'(E, ℂ)) : + MemSobolev s 2 u ↔ ∃ v : L2 E, realize s v = u := by + constructor + · rintro ⟨v, hv⟩ + refine ⟨v, ?_⟩ + change besselPotential E ℂ (-s) (v : 𝓢'(E, ℂ)) = u + exact (besselPotential_neg_apply_eq_iff s _ u).mpr hv + · rintro ⟨v, rfl⟩ + exact realize_memSobolev s v + + +def multiply (g : E →ᵇ ℂ) : L2 E →L[ℂ] L2 E := + (ContinuousLinearMap.mul ℂ ℂ).holderL volume ⊤ 2 2 (g.memLp_top.toLp g) + +lemma multiply_eq (g : E →ᵇ ℂ) (u : L2 E) : + multiply g u = (g.memLp_top.toLp g : Lp ℂ ⊤ volume) • u := by + apply Lp.ext + filter_upwards [(ContinuousLinearMap.mul ℂ ℂ).coeFn_holder + (r := 2) (g.memLp_top.toLp g : Lp ℂ ⊤ volume) u, + Lp.coeFn_lpSMul (r := 2) (g.memLp_top.toLp g : Lp ℂ ⊤ volume) u] with x h₁ h₂ + exact h₁.trans (by simpa [Pi.smul_apply, smul_eq_mul] using h₂.symm) + +lemma multiply_norm_le (g : E →ᵇ ℂ) (u : L2 E) : + ‖multiply g u‖ ≤ ‖g‖ * ‖u‖ := by + rw [multiply_eq] + apply Lp.norm_le_mul_norm_of_ae_le_mul + filter_upwards [Lp.coeFn_lpSMul (r := 2) + (g.memLp_top.toLp g : Lp ℂ ⊤ volume) u, + (g.memLp_top (μ := volume)).coeFn_toLp] with x h₁ h₂ + rw [h₁, Pi.smul_apply', h₂, norm_smul] + exact mul_le_mul_of_nonneg_right (g.norm_coe_le_norm x) (norm_nonneg _) + +lemma multiply_distribution (g : E →ᵇ ℂ) (hg : (g : E → ℂ).HasTemperateGrowth) + (u : L2 E) : + (multiply g u : 𝓢'(E, ℂ)) = smulLeftCLM ℂ g (u : 𝓢'(E, ℂ)) := by + rw [multiply_eq] + exact Lp.toTemperedDistribution_smul_eq hg g.memLp_top u + + +def multiplier (g : E →ᵇ ℂ) : L2 E →L[ℂ] L2 E := + fourierInvCLM ℂ (L2 E) ∘L multiply g ∘L fourierCLM ℂ (L2 E) + +lemma multiplier_norm_le (g : E →ᵇ ℂ) (u : L2 E) : + ‖multiplier g u‖ ≤ ‖g‖ * ‖u‖ := by + change ‖(Lp.fourierTransformₗᵢ E ℂ).symm (multiply g (𝓕 u))‖ ≤ _ + rw [(Lp.fourierTransformₗᵢ E ℂ).symm.norm_map] + simpa only [Lp.norm_fourier_eq] using multiply_norm_le g (𝓕 u) + +lemma multiplier_distribution (g : E →ᵇ ℂ) (hg : (g : E → ℂ).HasTemperateGrowth) + (u : L2 E) : + (multiplier g u : 𝓢'(E, ℂ)) = fourierMultiplierCLM ℂ g (u : 𝓢'(E, ℂ)) := by + change ((𝓕⁻ (multiply g (𝓕 u)) : L2 E) : 𝓢'(E, ℂ)) = _ + rw [← Lp.fourierInv_toTemperedDistribution_eq, multiply_distribution g hg, + ← Lp.fourier_toTemperedDistribution_eq] + rfl + +lemma bessel_multiplier_comm {g : E → ℂ} (hg : g.HasTemperateGrowth) + (s : ℝ) (u : 𝓢'(E, ℂ)) : + besselPotential E ℂ s (fourierMultiplierCLM ℂ g u) = + fourierMultiplierCLM ℂ g (besselPotential E ℂ s u) := by + rw [besselPotential, fourierMultiplierCLM_fourierMultiplierCLM_apply hg (by fun_prop), + fourierMultiplierCLM_fourierMultiplierCLM_apply (by fun_prop) hg, mul_comm] + +lemma realize_multiplier (s : ℝ) (g : E →ᵇ ℂ) + (hg : (g : E → ℂ).HasTemperateGrowth) (u : L2 E) : + realize s (multiplier g u) = fourierMultiplierCLM ℂ g (realize s u) := by + change besselPotential E ℂ (-s) (multiplier g u : 𝓢'(E, ℂ)) = _ + rw [multiplier_distribution g hg, bessel_multiplier_comm hg] + rfl + +end SobolevChart + +namespace FrozenPoisson +open EllipticKernel SobolevChart +variable {n : ℕ} + +def gainSymbol (H : Matrix (Fin n) (Fin n) ℂ) (ξ : EC n) : ℂ := + (1 + ‖ξ‖^2 : ℝ) * inverseSymbol H ξ + +lemma gainSymbol_temperate (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) : + (gainSymbol H).HasTemperateGrowth := by + have hi := inverseSymbol_temperate H hH + unfold gainSymbol + fun_prop + + +def ellipticBound (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) : ℝ := + max 1 (inverseSymbol_weighted_bounded H hH).choose + +lemma ellipticBound_pos (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) : + 0 < ellipticBound H hH := lt_of_lt_of_le zero_lt_one (le_max_left _ _) + +lemma gainSymbol_bound (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) (ξ : EC n) : + ‖gainSymbol H ξ‖ ≤ ellipticBound H hH := + ((inverseSymbol_weighted_bounded H hH).choose_spec ξ).trans (le_max_right _ _) + +def gainSymbolBCF (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) : EC n →ᵇ ℂ := + BoundedContinuousFunction.ofNormedAddCommGroup (gainSymbol H) + (gainSymbol_temperate H hH).1.continuous (ellipticBound H hH) (gainSymbol_bound H hH) + +lemma gainSymbolBCF_norm (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) : + ‖gainSymbolBCF H hH‖ ≤ ellipticBound H hH := + (BoundedContinuousFunction.norm_le (ellipticBound_pos H hH).le).mpr (gainSymbol_bound H hH) + + +def hilbertResolvent (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) : + L2 (EC n) →L[ℂ] L2 (EC n) := multiplier (gainSymbolBCF H hH) + +lemma hilbertResolvent_bound (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (u : L2 (EC n)) : + ‖hilbertResolvent H hH u‖ ≤ ellipticBound H hH * ‖u‖ := + (multiplier_norm_le (gainSymbolBCF H hH) u).trans + (mul_le_mul_of_nonneg_right (gainSymbolBCF_norm H hH) (norm_nonneg u)) + +lemma bessel_two_resolvent (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (u : 𝓢'(EC n, ℂ)) : + besselPotential (EC n) ℂ 2 (resolvent H u) = + fourierMultiplierCLM ℂ (gainSymbol H) u := by + rw [besselPotential, resolvent, + fourierMultiplierCLM_fourierMultiplierCLM_apply (inverseSymbol_temperate H hH) + (by fun_prop)] + congr 2 + ext ξ + simp [gainSymbol, mul_comm] + +lemma hilbertResolvent_realize (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (s : ℝ) (u : L2 (EC n)) : + realize (s + 2) (hilbertResolvent H hH u) = resolvent H (realize s u) := by + change besselPotential (EC n) ℂ (-(s + 2)) + (Lp.toTemperedDistributionCLM ℂ MeasureTheory.volume 2 (hilbertResolvent H hH u)) = _ + rw [besselPotential_neg_apply_eq_iff] + have hc : resolvent H (realize s u) = besselPotential (EC n) ℂ (-s) + (resolvent H (Lp.toTemperedDistributionCLM ℂ MeasureTheory.volume 2 u)) := + (bessel_multiplier_comm (inverseSymbol_temperate H hH) (-s) _).symm + rw [hc, besselPotential_besselPotential_apply] + have hs : -s + (s + 2) = 2 := by ring + rw [hs, bessel_two_resolvent H hH] + exact (multiplier_distribution (gainSymbolBCF H hH) (gainSymbol_temperate H hH) u).symm + + + +theorem hilbert_frozen_inverse (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (s : ℝ) (f : L2 (EC n)) : + let u := hilbertResolvent H hH f + realize (s + 2) u - frozenDifferential H (realize (s + 2) u) = realize s f ∧ + ‖u‖ ≤ ellipticBound H hH * ‖f‖ := by + refine ⟨?_, hilbertResolvent_bound H hH f⟩ + rw [← shifted_eq_identity_sub H hH, hilbertResolvent_realize, + shifted_resolvent H hH] + +end FrozenPoisson + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/SobolevProduct.lean b/lean/OAI/Geometry/PrescribedPotential/SobolevProduct.lean new file mode 100644 index 0000000000000000000000000000000000000000..f07964104bd7108700f515bf840b8afc0b380314 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/SobolevProduct.lean @@ -0,0 +1,174 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CutoffHigher +import OAI.Geometry.PrescribedPotential.StrongSobolevEmbedding + +namespace OAI + +/-! Sobolev Product. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory TemperedDistribution LineDeriv +open scoped SchwartzMap BoundedContinuousFunction ContDiff Classical +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +lemma boundedDistribution_schwartz (f : 𝓢(E, ℂ)) : + boundedDistributionCLM f.toBoundedContinuousFunction = (f : 𝓢'(E, ℂ)) := by + ext φ + rw [boundedDistributionCLM_apply, boundedDistribution_apply] + rfl + +lemma strongEmbedding_schwartz (s : ℝ) (hs : (Module.finrank ℝ E : ℝ) < 2*s) + (f : 𝓢(E, ℂ)) : strongEmbedding s hs (schwartzCoord s f) = f.toBoundedContinuousFunction := by + apply boundedDistribution_injective + rw [strongEmbedding_distribution, realize_schwartzCoord, boundedDistribution_schwartz] + +lemma schwartz_word_sup_bound (ws : List E) (s : ℝ) + (hs : (Module.finrank ℝ E : ℝ) < 2*(s-ws.length)) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ f : 𝓢(E, ℂ), + ‖(schwartzWord ws f).toBoundedContinuousFunction‖ ≤ C * ‖schwartzCoord s f‖ := by + obtain ⟨C,hC,hb⟩ := coreBound_word ws (s := s) (t := s-ws.length) le_rfl + refine ⟨‖strongEmbedding (E := E) (s-ws.length) hs‖*C, + mul_nonneg (norm_nonneg _) hC, fun f => ?_⟩ + rw [← strongEmbedding_schwartz (s-ws.length) hs] + exact ((strongEmbedding (s-ws.length) hs).le_opNorm _).trans (by + simpa only [mul_assoc] using mul_le_mul_of_nonneg_left (hb f) + (norm_nonneg (strongEmbedding (E := E) (s-ws.length) hs))) + + +def BinaryCoreBound (s t : ℝ) (T : 𝓢(E, ℂ) → 𝓢(E, ℂ) → 𝓢(E, ℂ)) : Prop := + ∃ C : ℝ, 0 ≤ C ∧ ∀ f g, + ‖schwartzCoord t (T f g)‖ ≤ C * (‖schwartzCoord s f‖ * ‖schwartzCoord s g‖) + +lemma BinaryCoreBound.add {s t : ℝ} {T U : 𝓢(E, ℂ) → 𝓢(E, ℂ) → 𝓢(E, ℂ)} + (hT : BinaryCoreBound s t T) (hU : BinaryCoreBound s t U) : + BinaryCoreBound s t (fun f g => T f g + U f g) := by + obtain ⟨C,hC,hc⟩ := hT + obtain ⟨D,hD,hd⟩ := hU + refine ⟨C+D, add_nonneg hC hD, fun f g => ?_⟩ + rw [schwartzCoord_add, add_mul] + exact (norm_add_le _ _).trans (add_le_add (hc f g) (hd f g)) + +lemma binaryBound_raise_one {s t : ℝ} (T : 𝓢(E, ℂ) → 𝓢(E, ℂ) → 𝓢(E, ℂ)) + (hT : BinaryCoreBound s t T) + (hD : ∀ j, BinaryCoreBound s t (fun f g => ∂_{stdOrthonormalBasis ℝ E j} (T f g))) : + BinaryCoreBound s (t+1) T := by + obtain ⟨C,hC,hc⟩ := hT + choose D hD0 hd using hD + let c : ℝ := ‖(((2*Real.pi)^2 : ℝ) : ℂ)⁻¹‖ + refine ⟨‖raiseZero (E := E) t‖*C + c*∑ j, ‖raiseDeriv t (stdOrthonormalBasis ℝ E j)‖*D j, + add_nonneg (mul_nonneg (norm_nonneg _) hC) + (mul_nonneg (norm_nonneg _) (Finset.sum_nonneg (fun j _ => mul_nonneg (norm_nonneg _) (hD0 j)))), + fun f g => ?_⟩ + rw [schwartzCoord_raise_one] + calc + _ ≤ ‖raiseZero t (schwartzCoord t (T f g))‖ + + c*‖∑ j, raiseDeriv t (stdOrthonormalBasis ℝ E j) + (schwartzCoord t (∂_{stdOrthonormalBasis ℝ E j} (T f g)))‖ := by + simpa only [norm_smul] using norm_sub_le + (raiseZero t (schwartzCoord t (T f g))) + ((((2*Real.pi)^2 : ℝ) : ℂ)⁻¹ • ∑ j, raiseDeriv t (stdOrthonormalBasis ℝ E j) + (schwartzCoord t (∂_{stdOrthonormalBasis ℝ E j} (T f g)))) + _ ≤ (‖raiseZero (E := E) t‖*C)*(‖schwartzCoord s f‖*‖schwartzCoord s g‖) + + c*∑ j, (‖raiseDeriv t (stdOrthonormalBasis ℝ E j)‖*D j)* + (‖schwartzCoord s f‖*‖schwartzCoord s g‖) := by + apply add_le_add + · exact ((raiseZero t).le_opNorm _).trans (by + simpa only [mul_assoc] using mul_le_mul_of_nonneg_left (hc f g) + (norm_nonneg (raiseZero (E := E) t))) + · apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) + apply (norm_sum_le _ _).trans + apply Finset.sum_le_sum + intro j _ + exact ((raiseDeriv t (stdOrthonormalBasis ℝ E j)).le_opNorm _).trans (by + simpa only [mul_assoc] using mul_le_mul_of_nonneg_left (hd j f g) + (norm_nonneg (raiseDeriv t (stdOrthonormalBasis ℝ E j)))) + _ = _ := by rw [← Finset.sum_mul]; ring + +lemma binaryBound_of_words (k : ℕ) {s : ℝ} + (T : 𝓢(E, ℂ) → 𝓢(E, ℂ) → 𝓢(E, ℂ)) + (h : ∀ ws : List E, ws.length ≤ k → + BinaryCoreBound s 0 (fun f g => schwartzWord ws (T f g))) : + BinaryCoreBound s (k : ℝ) T := by + induction k generalizing T with + | zero => simpa [schwartzWord] using h [] (by simp) + | succ k ih => + have ht := ih T (fun ws hw => h ws (by omega)) + have hd (j : Fin (Module.finrank ℝ E)) := ih + (fun f g => ∂_{stdOrthonormalBasis ℝ E j} (T f g)) + (fun ws hw => by + have hh := h (ws ++ [stdOrthonormalBasis ℝ E j]) + (by simp only [List.length_append, List.length_cons, List.length_nil]; omega) + simpa only [schwartzWord_append, schwartzWord, ContinuousLinearMap.comp_apply, + ContinuousLinearMap.id_apply, lineDerivOpCLM_apply] using hh) + simpa only [Nat.cast_succ] using binaryBound_raise_one T ht hd + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma schwartz_product_swap (f g : 𝓢(E, ℂ)) : + SchwartzMap.smulLeftCLM ℂ f g = SchwartzMap.smulLeftCLM ℂ g f := by + ext x + simp only [SchwartzMap.smulLeftCLM_apply_apply f.hasTemperateGrowth, + SchwartzMap.smulLeftCLM_apply_apply g.hasTemperateGrowth, smul_eq_mul, mul_comm] + +lemma binaryBound_product_words_zero (m : ℕ) (hm : Module.finrank ℝ E < m) + (p q : List E) (hpq : p.length+q.length ≤ m) : + BinaryCoreBound (m : ℝ) 0 (fun f g => + SchwartzMap.smulLeftCLM ℂ (schwartzWord p f) (schwartzWord q g)) := by + have base (p q : List E) (hpq : p.length+q.length ≤ m) (hp : 2*p.length ≤ m) : + BinaryCoreBound (m : ℝ) 0 (fun f g => + SchwartzMap.smulLeftCLM ℂ (schwartzWord p f) (schwartzWord q g)) := by + have hs : (Module.finrank ℝ E : ℝ) < 2*((m : ℝ)-p.length) := by + have h₁ : (Module.finrank ℝ E : ℝ) < m := by exact_mod_cast hm + have h₂ : 2*(p.length : ℝ) ≤ m := by exact_mod_cast hp + linarith + obtain ⟨C,hC,hc⟩ := schwartz_word_sup_bound p (m : ℝ) hs + obtain ⟨D,hD,hd⟩ := coreBound_word q (s := (m : ℝ)) (t := 0) (by + have hh : (q.length : ℝ) ≤ m := by exact_mod_cast (show q.length ≤ m by omega) + linarith) + refine ⟨C*D, mul_nonneg hC hD, fun f g => ?_⟩ + rw [schwartzCoord_product_zero] + exact (multiply_norm_le _ _).trans (by + have hh := mul_le_mul (hc f) (hd g) (norm_nonneg _) + (mul_nonneg hC (norm_nonneg _)) + convert hh using 1; ring) + by_cases hp : 2*p.length ≤ m + · exact base p q hpq hp + · obtain ⟨C,hC,hc⟩ := base q p (by omega) (by omega) + refine ⟨C,hC, fun f g => ?_⟩ + dsimp only + rw [schwartz_product_swap (schwartzWord p f) (schwartzWord q g)] + simpa only [mul_comm] using hc g f + +lemma binaryBound_word_product (m : ℕ) (hm : Module.finrank ℝ E < m) + (ws p q : List E) (hw : ws.length+p.length+q.length ≤ m) : + BinaryCoreBound (m : ℝ) 0 (fun f g => schwartzWord ws + (SchwartzMap.smulLeftCLM ℂ (schwartzWord p f) (schwartzWord q g))) := by + induction ws generalizing p q with + | nil => exact binaryBound_product_words_zero m hm p q (by simpa using hw) + | cons v ws ih => + have h₁ := ih (v::p) q (by simp only [List.length_cons] at *; omega) + have h₂ := ih p (v::q) (by simp only [List.length_cons] at *; omega) + convert h₁.add h₂ using 1 + funext f g + change ∂_{v} (schwartzWord ws (SchwartzMap.smulLeftCLM ℂ (schwartzWord p f) (schwartzWord q g))) = _ + rw [← GlobalElliptic.word_deriv_comm, schwartz_deriv_product, map_add] + rfl + + +theorem schwartz_sobolev_product_bound (m : ℕ) (hm : Module.finrank ℝ E < m) : + BinaryCoreBound (m : ℝ) (m : ℝ) (fun f g : 𝓢(E, ℂ) => SchwartzMap.smulLeftCLM ℂ f g) := by + apply binaryBound_of_words m + intro ws hw + exact binaryBound_word_product m hm ws [] [] (by simpa using hw) + +end SobolevChart + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/SobolevReconstruction.lean b/lean/OAI/Geometry/PrescribedPotential/SobolevReconstruction.lean new file mode 100644 index 0000000000000000000000000000000000000000..27f2b80d1bbf720578d9d56e692ad9bcca7eaf1f --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/SobolevReconstruction.lean @@ -0,0 +1,97 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.LiteralWeakHessian +import OAI.Geometry.PrescribedPotential.GlobalSmooth + +namespace OAI + +/-! Sobolev Reconstruction. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory TemperedDistribution LineDeriv +open scoped ContDiff SchwartzMap Classical +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +lemma memSobolev_of_first_basis {s : ℝ} {u : 𝓢'(E, ℂ)} + (hu : MemSobolev s 2 u) + (hD : ∀ j, MemSobolev s 2 (∂_{stdOrthonormalBasis ℝ E j} u)) : + MemSobolev (s+1) 2 u := by + have hh := memSobolev_of_second_basis (hu.mono (show s-1 ≤ s by linarith)) + (fun j => (hD j).lineDerivOp (m := stdOrthonormalBasis ℝ E j)) + convert hh using 1 + ring + +def lowerCoord (s t : ℝ) (hst : t ≤ s) : L2 E →L[ℂ] L2 E := + liftOperator s t (ContinuousLinearMap.id ℂ _) (fun _ hu => hu.mono hst) + +lemma realize_lowerCoord (s t : ℝ) (hst : t ≤ s) (u : L2 E) : + realize t (lowerCoord s t hst u) = realize s u := + realize_liftOperator s t _ _ u + +lemma lowerCoord_schwartz (s t : ℝ) (hst : t ≤ s) (f : 𝓢(E,ℂ)) : + lowerCoord s t hst (schwartzCoord s f) = schwartzCoord t f := by + apply realize_injective t + rw [realize_lowerCoord,realize_schwartzCoord,realize_schwartzCoord] + +end SobolevChart +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace Localizers +variable (D : Localizers A ι) + +def globalizeOrder (k : ℕ) (q : Fin A.count) (κ : ChartCutoff (A.euclideanChart q).target) : + L2 (EC d) →L[ℝ] D.Sobolev (k : ℝ) := + ((D.embed (k : ℝ)).comp (globalize q κ)).extendOfNorm (schwartzCoordLinear (k : ℝ)) + +lemma globalizeOrder_schwartz (k : ℕ) (q : Fin A.count) + (κ : ChartCutoff (A.euclideanChart q).target) (f : 𝓢(EC d,ℂ)) : + D.globalizeOrder k q κ (schwartzCoord (k : ℝ) f) = D.embed (k : ℝ) (globalize q κ f) := by + obtain ⟨C,hC,h⟩ := globalize_integer_bound D q κ k + exact LinearMap.extendOfNorm_eq (schwartzCoord_dense (k : ℝ)) ⟨C,h⟩ f + +lemma globalizeOrder_lower_zero (k : ℕ) (q : Fin A.count) + (κ : ChartCutoff (A.euclideanChart q).target) (u : L2 (EC d)) : + D.lower (k : ℝ) 0 (D.globalizeOrder k q κ u) = + D.globalizeL2 q κ (lowerCoord (k : ℝ) 0 (Nat.cast_nonneg k) u) := by + have hh : D.lower (k : ℝ) 0 ∘ D.globalizeOrder k q κ = + D.globalizeL2 q κ ∘ lowerCoord (k : ℝ) 0 (Nat.cast_nonneg k) := by + apply (schwartzCoord_dense (k : ℝ)).equalizer (by fun_prop) (by fun_prop) + funext f + simp only [Function.comp_apply,D.globalizeOrder_schwartz,D.lower_embed (Nat.cast_nonneg k), + lowerCoord_schwartz,D.globalizeL2_schwartz] + exact congr_fun hh u + +end Localizers +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + + + +theorem sobolev_of_local_order (k : ℕ) (u : D.localizers.Sobolev 0) + (hu : ∀ p, MemSobolev (k : ℝ) 2 (D.localizers.distribution 0 p u)) : + ∃ v : D.localizers.Sobolev (k : ℝ), D.localizers.lower (k : ℝ) 0 v = u := by + choose f hf using fun p => (memSobolev_iff_realize (k : ℝ) _).mp (hu p) + refine ⟨∑ p, D.localizers.globalizeOrder k (D.patch p).index (D.cutoff p) (f p),?_⟩ + rw [map_sum,← D.reconstruct_eq u,D.reconstruct_apply] + apply Finset.sum_congr rfl + intro p _ + rw [D.localizers.globalizeOrder_lower_zero] + congr 1 + apply realize_injective 0 + rw [realize_lowerCoord,hf] + rfl + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/SourceTarget.lean b/lean/OAI/Geometry/PrescribedPotential/SourceTarget.lean new file mode 100644 index 0000000000000000000000000000000000000000..122a62c171e4364d6068d8be765e51a3e53be05c --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/SourceTarget.lean @@ -0,0 +1,75 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.AnalyticSupport + +namespace OAI + +/-! Source Target. -/ + +section + + + +namespace Anticanonical.SourceSmooth +open Filter +open scoped ContDiff +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +lemma levi_congr {φ ψ : Coordinates d → ℝ} {z : Coordinates d} + (h : φ =ᶠ[nhds z] ψ) (v : Coordinates d) : levi φ z v = levi ψ z v := by + have h' := h.fderiv (𝕜 := ℝ) + simp only [levi, h'.fderiv_eq] + +lemma levi_sub_const (φ : Coordinates d → ℝ) (c : ℝ) (z v : Coordinates d) : + levi (fun w => φ w - c) z v = levi φ z v := by + have h : fderiv ℝ (fun w => φ w - c) = fderiv ℝ φ := by + funext w + exact fderiv_sub_const c + simp only [levi, h] + +theorem KaehlerMetric.ricci_eq_of_volume + (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) + {c : ℝ} (hc : 0 < c) + (heq : ∀ i z, z ∈ (A.chart i).target → + g.volumeCoefficient i z = c * Real.exp (-h.weight i z)) + (i : Fin A.count) {z : Coordinates d} (hz : z ∈ (A.chart i).target) + (v : Coordinates d) : g.ricciQuadratic i z v = levi (h.weight i) z v := by + have hlocal : g.ricciPotential i =ᶠ[nhds z] + (fun w => h.weight i w - Real.log c) := by + filter_upwards [(A.chart i).open_target.mem_nhds hz] with w hw + dsimp [KaehlerMetric.ricciPotential] + rw [heq i w hw, Real.log_mul (ne_of_gt hc) (ne_of_gt (Real.exp_pos _)), + Real.log_exp] + ring + exact (levi_congr hlocal v).trans (levi_sub_const _ _ _ _) + + + +def HasPrescribedVolumePotential (P : A.ProjectiveEmbedding) + (h : SemipositiveAnticanonicalMetric A) : Prop := + ∃ (φ : SmoothRealFunction A) (c : ℝ), 0 < c ∧ + (projectiveBackground P).PositivePotential φ ∧ + ∀ i z, z ∈ (A.chart i).target → + ((projectiveBackground P).matrix i z + φ.hessian i z).det.re = + c * Real.exp (-h.weight i z) + + + +theorem prescribedRicci_of_potential (P : A.ProjectiveEmbedding) + (h : SemipositiveAnticanonicalMetric A) (φ : SmoothRealFunction A) + (hp : (projectiveBackground P).PositivePotential φ) {c : ℝ} (hc : 0 < c) + (heq : ∀ i z, z ∈ (A.chart i).target → + ((projectiveBackground P).matrix i z + φ.hessian i z).det.re = + c * Real.exp (-h.weight i z)) : + ∃ g : KaehlerMetric A, (∀ i z, g.matrix i z = + (projectiveBackground P).matrix i z + φ.hessian i z) ∧ + ∀ i z, z ∈ (A.chart i).target → + ∀ v : Coordinates d, g.ricciQuadratic i z v = levi (h.weight i) z v := by + refine ⟨(projectiveBackground P).deform φ hp, fun _ _ => rfl, ?_⟩ + intro i z hz v + exact KaehlerMetric.ricci_eq_of_volume ((projectiveBackground P).deform φ hp) h hc heq i hz v + +end Anticanonical.SourceSmooth + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/StrongDerivatives.lean b/lean/OAI/Geometry/PrescribedPotential/StrongDerivatives.lean new file mode 100644 index 0000000000000000000000000000000000000000..19c518d183d97bbf8df27f28bb1a8e4b1e476671 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/StrongDerivatives.lean @@ -0,0 +1,127 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.FiniteSobolevEmbedding +import OAI.Geometry.PrescribedPotential.SobolevProduct + +namespace OAI + +/-! Strong Derivatives. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory FourierTransform TemperedDistribution LineDeriv +open scoped SchwartzMap BoundedContinuousFunction ContDiff +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +lemma schwartzCoord_dense (s : ℝ) : DenseRange (schwartzCoord (E := E) s) := by + apply (SchwartzMap.denseRange_toLpCLM (E := E) (F := ℂ) (p := 2) + (μ := volume) (by norm_num)).mono + rintro u ⟨f, rfl⟩ + let ψ := SchwartzMap.fourierMultiplierCLM ℂ + (fun x : E => (((1 + ‖x‖^2)^((-s)/2) : ℝ) : ℂ)) f + refine ⟨ψ, ?_⟩ + apply l2_injective + change (schwartzCoord s ψ : 𝓢'(E,ℂ)) = ((f.toLp 2 volume : L2 E) : 𝓢'(E,ℂ)) + rw [schwartzCoord_distribution] + have hψ : (ψ : 𝓢'(E,ℂ)) = besselPotential E ℂ (-s) (f : 𝓢'(E,ℂ)) := + (fourierMultiplierCLM_toTemperedDistributionCLM_eq (by fun_prop) f).symm + rw [hψ, besselPotential_besselPotential_apply, neg_add_cancel, + besselPotential_zero, ContinuousLinearMap.id_apply] + exact (Lp.toTemperedDistribution_toLp_eq f).symm + +lemma exists_schwartz_approx (s : ℝ) (u : L2 E) : + ∃ f : ℕ → 𝓢(E,ℂ), Tendsto (fun n => schwartzCoord s (f n)) atTop (nhds u) := by + obtain ⟨v,hv,ht⟩ := mem_closure_iff_seq_limit.mp (schwartzCoord_dense s u) + choose f hf using hv + refine ⟨f, ?_⟩ + simpa only [hf] using ht + + +def derivativeCoord (s : ℝ) (v : E) : L2 E →L[ℂ] L2 E := + liftOperator s (s-1) (lineDerivOpCLM ℂ 𝓢'(E,ℂ) v) (fun _ hu => hu.lineDerivOp) + +lemma derivativeCoord_schwartz (s : ℝ) (v : E) (f : 𝓢(E,ℂ)) : + derivativeCoord s v (schwartzCoord s f) = schwartzCoord (s-1) (∂_{v} f) := by + apply realize_injective (s-1) + exact (realize_liftOperator s (s-1) _ _ _).trans (by + rw [realize_schwartzCoord, realize_schwartzCoord] + exact lineDerivOp_toTemperedDistributionCLM_eq f v) + +lemma strong_hasLineDerivAt (s : ℝ) + (hs : (Module.finrank ℝ E : ℝ) < 2*s) + (hs' : (Module.finrank ℝ E : ℝ) < 2*(s-1)) (u : L2 E) (x v : E) : + HasLineDerivAt ℝ (strongEmbedding s hs u : E → ℂ) + (strongEmbedding (s-1) hs' (derivativeCoord s v u) x) x v := by + obtain ⟨f,hf⟩ := exists_schwartz_approx s u + have h0 := ((strongEmbedding s hs).continuous.tendsto u).comp hf + have h1 := ((strongEmbedding (s-1) hs').continuous.tendsto + (derivativeCoord s v u)).comp (((derivativeCoord s v).continuous.tendsto u).comp hf) + change Tendsto (fun n => strongEmbedding (s-1) hs' + (derivativeCoord s v (schwartzCoord s (f n)))) atTop + (nhds (strongEmbedding (s-1) hs' (derivativeCoord s v u))) at h1 + change Tendsto (fun n => strongEmbedding s hs (schwartzCoord s (f n))) atTop + (nhds (strongEmbedding s hs u)) at h0 + simp_rw [derivativeCoord_schwartz, strongEmbedding_schwartz] at h1 + simp_rw [strongEmbedding_schwartz] at h0 + have h1' := (BoundedContinuousFunction.tendsto_iff_tendstoUniformly.mp h1).comp + (fun t : ℝ => x + t • v) + have h0' := BoundedContinuousFunction.tendsto_iff_tendstoUniformly.mp h0 + have hd : ∀ n (t : ℝ), HasDerivAt (fun t : ℝ => f n (x + t • v)) + ((∂_{v} (f n) : 𝓢(E,ℂ)) (x + t • v)) t := by + intro n t + simpa only [SchwartzMap.lineDerivOp_apply_eq_fderiv, one_smul, Function.comp_def, id_eq] using + (f n).differentiableAt.hasFDerivAt.comp_hasDerivAt t + ((hasDerivAt_id t).smul_const v |>.const_add x) + have hh := hasDerivAt_of_tendstoUniformly h1' (Eventually.of_forall hd) + (fun t => h0'.tendsto_at (x+t • v)) 0 + simpa only [HasLineDerivAt, Function.comp_apply, zero_smul, add_zero] using hh + +lemma strong_lineDeriv (s : ℝ) + (hs : (Module.finrank ℝ E : ℝ) < 2*s) + (hs' : (Module.finrank ℝ E : ℝ) < 2*(s-1)) (u : L2 E) (x v : E) : + lineDeriv ℝ (strongEmbedding s hs u : E → ℂ) x v = + strongEmbedding (s-1) hs' (derivativeCoord s v u) x := + (strong_hasLineDerivAt s hs hs' u x v).lineDeriv + +lemma strong_fderiv (s : ℝ) + (hs : (Module.finrank ℝ E : ℝ) < 2*s) + (hs' : (Module.finrank ℝ E : ℝ) < 2*(s-1)) + (hN : (Module.finrank ℝ E : ℝ) < 2*(s-2)) (u : L2 E) (x v : E) : + fderiv ℝ (strongEmbedding s hs u : E → ℂ) x v = + strongEmbedding (s-1) hs' (derivativeCoord s v u) x := by + have hd := (strongEmbedding_contDiff s hs 1 (by simpa using hN) u).differentiable + (by norm_num) + rw [← (hd x).lineDeriv_eq_fderiv] + exact strong_lineDeriv s hs hs' u x v + +lemma strong_second_fderiv (s : ℝ) + (hs : (Module.finrank ℝ E : ℝ) < 2*s) + (h1 : (Module.finrank ℝ E : ℝ) < 2*(s-1)) + (h2 : (Module.finrank ℝ E : ℝ) < 2*((s-1)-1)) + (hN : (Module.finrank ℝ E : ℝ) < 2*(s-4)) (u : L2 E) (x v w : E) : + fderiv ℝ (fderiv ℝ (strongEmbedding s hs u : E → ℂ)) x v w = + strongEmbedding ((s-1)-1) h2 + (derivativeCoord (s-1) v (derivativeCoord s w u)) x := by + have hf := strongEmbedding_contDiff s hs 2 (by norm_num; exact hN) u + have hd := (hf.fderiv_right (m := 1) (by norm_num)).differentiable (by norm_num) + have he : (fun y => fderiv ℝ (strongEmbedding s hs u : E → ℂ) y w) = + (strongEmbedding (s-1) h1 (derivativeCoord s w u) : E → ℂ) := by + funext y + exact strong_fderiv s hs h1 (by linarith) u y w + have hh : fderiv ℝ (fun y => fderiv ℝ (strongEmbedding s hs u : E → ℂ) y w) x v = + fderiv ℝ (fderiv ℝ (strongEmbedding s hs u : E → ℂ)) x v w := by + rw [fderiv_clm_apply (hd x) (differentiableAt_const w)] + simp + rw [← hh, he] + exact strong_fderiv (s-1) h1 h2 (by linarith) (derivativeCoord s w u) x v + +end SobolevChart + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/StrongSobolevEmbedding.lean b/lean/OAI/Geometry/PrescribedPotential/StrongSobolevEmbedding.lean new file mode 100644 index 0000000000000000000000000000000000000000..62a152ef162fffa7de016cfc89a7ef5678812462 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/StrongSobolevEmbedding.lean @@ -0,0 +1,103 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.SobolevEmbedding +import OAI.Geometry.PrescribedPotential.SobolevParametrix + +namespace OAI + +/-! Strong Sobolev Embedding. -/ + +section + + + +noncomputable section +open Set Filter Topology MeasureTheory FourierTransform TemperedDistribution +open scoped SchwartzMap BoundedContinuousFunction ContDiff +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +def boundedToLinfLinear : (E →ᵇ ℂ) →ₗ[ℂ] Lp ℂ ⊤ (volume : Measure E) where + toFun f := f.memLp_top.toLp f + map_add' _ _ := rfl + map_smul' _ _ := rfl + +lemma boundedToLinf_norm (f : E →ᵇ ℂ) : ‖boundedToLinfLinear f‖ ≤ ‖f‖ := by + rw [show boundedToLinfLinear f = f.memLp_top.toLp f from rfl, Lp.norm_toLp, + eLpNorm_exponent_top f.memLp_top.aestronglyMeasurable] + exact ENNReal.toReal_le_of_le_ofReal (norm_nonneg _) + (eLpNormEssSup_le_of_ae_bound (Eventually.of_forall f.norm_coe_le_norm)) + +def boundedToLinf : (E →ᵇ ℂ) →L[ℂ] Lp ℂ ⊤ (volume : Measure E) := + boundedToLinfLinear.mkContinuous 1 (fun f => by simpa using boundedToLinf_norm f) + +lemma boundedToLinf_injective : Function.Injective (boundedToLinf (E := E)) := by + intro f g h + apply DFunLike.coe_injective + apply (f.continuous.ae_eq_iff_eq volume g.continuous).mp + exact (f.memLp_top.coeFn_toLp).symm.trans ((show + (f.memLp_top.toLp f : E → ℂ) =ᵐ[volume] (g.memLp_top.toLp g : E → ℂ) by rw [show + f.memLp_top.toLp f = g.memLp_top.toLp g from h]).trans g.memLp_top.coeFn_toLp) + +def boundedDistributionCLM : (E →ᵇ ℂ) →L[ℂ] 𝓢'(E, ℂ) := + Lp.toTemperedDistributionCLM ℂ volume ⊤ ∘L boundedToLinf + +lemma boundedDistributionCLM_apply (f : E →ᵇ ℂ) : + boundedDistributionCLM f = boundedDistribution f := rfl + +lemma boundedDistribution_injective : Function.Injective (boundedDistributionCLM (E := E)) := + (LinearMap.ker_eq_bot.mp (Lp.ker_toTemperedDistributionCLM_eq_bot + (F := ℂ) (E := E) (μ := volume) (p := ⊤))).comp boundedToLinf_injective + +lemma strong_representation (s : ℝ) (hs : (Module.finrank ℝ E : ℝ) < 2*s) (u : L2 E) : + ∃ f : E →ᵇ ℂ, boundedDistributionCLM f = realize s u := by + obtain ⟨v,hv⟩ := (realize_memSobolev s u).fourier_memL1 hs + refine ⟨Real.Lp.fourierTransformInv v, ?_⟩ + rw [boundedDistributionCLM_apply, fourierInv_L1_distribution, ← hv, fourierInv_fourier_eq] + +def strongRepresentative (s : ℝ) (hs : (Module.finrank ℝ E : ℝ) < 2*s) (u : L2 E) : E →ᵇ ℂ := + (strong_representation s hs u).choose + +lemma strongRepresentative_distribution (s : ℝ) (hs : (Module.finrank ℝ E : ℝ) < 2*s) (u : L2 E) : + boundedDistributionCLM (strongRepresentative s hs u) = realize s u := + (strong_representation s hs u).choose_spec + +def strongRepresentativeLinear (s : ℝ) (hs : (Module.finrank ℝ E : ℝ) < 2*s) : + L2 E →ₗ[ℂ] (E →ᵇ ℂ) where + toFun := strongRepresentative s hs + map_add' u v := by + apply boundedDistribution_injective + simp only [strongRepresentative_distribution, map_add] + map_smul' c u := by + apply boundedDistribution_injective + simp only [strongRepresentative_distribution, map_smul, RingHom.id_apply] + + +def strongEmbedding (s : ℝ) (hs : (Module.finrank ℝ E : ℝ) < 2*s) : + L2 E →L[ℂ] (E →ᵇ ℂ) where + toLinearMap := strongRepresentativeLinear s hs + cont := by + apply LinearMap.continuous_of_seq_closed_graph + intro u x y hu hv + apply boundedDistribution_injective + have h₁ := ((boundedDistributionCLM (E := E)).continuous.tendsto y).comp hv + have h₂ := ((realize (E := E) s).continuous.tendsto x).comp hu + change Tendsto (fun n => boundedDistributionCLM (strongRepresentative s hs (u n))) + atTop (nhds (boundedDistributionCLM y)) at h₁ + simp_rw [strongRepresentative_distribution] at h₁ + exact (tendsto_nhds_unique h₁ h₂).trans (strongRepresentative_distribution s hs x).symm + +lemma strongEmbedding_distribution (s : ℝ) (hs : (Module.finrank ℝ E : ℝ) < 2*s) (u : L2 E) : + boundedDistributionCLM (strongEmbedding s hs u) = realize s u := + strongRepresentative_distribution s hs u + +lemma strongEmbedding_norm (s : ℝ) (hs : (Module.finrank ℝ E : ℝ) < 2*s) (u : L2 E) (x : E) : + ‖strongEmbedding s hs u x‖ ≤ ‖strongEmbedding (E := E) s hs‖ * ‖u‖ := + ((strongEmbedding s hs u).norm_coe_le_norm x).trans ((strongEmbedding s hs).le_opNorm u) + +end SobolevChart + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/SymmetricPrincipalFrame.lean b/lean/OAI/Geometry/PrescribedPotential/SymmetricPrincipalFrame.lean new file mode 100644 index 0000000000000000000000000000000000000000..83da261ca9a6d9d2625177cc5e950a1d0caebe7b --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/SymmetricPrincipalFrame.lean @@ -0,0 +1,89 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.FrozenPoisson + +namespace OAI + +/-! Symmetric Principal Frame. -/ + +section + + + +noncomputable section +open Set Filter Topology Finset +open scoped ContDiff +namespace HigherJet +open EllipticKernel FrozenPoisson +variable {E F : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] + {ι : Type*} [Fintype ι] + +def principalApply (e : OrthonormalBasis ι ℝ E) (L : SecondOrder E) + (H : E →L[ℝ] E →L[ℝ] F) : F := + ∑ i, ∑ j, ((L (rankTwo (e i) (e j))+L (rankTwo (e j) (e i)))/2) • H (e i) (e j) + +lemma rankOne_add (v w : E) : rankOne (v+w) = rankOne v+rankOne w+rankTwo v w+rankTwo w v := by + ext x y + simp only [rankOne,rankTwo,_root_.add_apply,ContinuousLinearMap.smulRight_apply, + realInner_apply,inner_add_left,_root_.smul_apply,smul_eq_mul] + ring + +lemma principal_coefficient_gram (L : SecondOrder E) (T : E →L[ℝ] E) + (h : ∀ v, L (rankOne v) = ‖T v‖^2) (v w : E) : + (L (rankTwo v w)+L (rankTwo w v))/2 = inner ℝ (T v) (T w) := by + have hh := h (v+w) + rw [rankOne_add] at hh + simp only [map_add,h] at hh + rw [norm_add_sq_real] at hh + linarith only [hh] + +lemma bilinear_basis_expansion (e : OrthonormalBasis ι ℝ E) (H : E →L[ℝ] E →L[ℝ] F) (v w : E) : + H v w = ∑ i, ∑ j, (inner ℝ (e i) v * inner ℝ (e j) w) • H (e i) (e j) := by + conv_lhs => rw [← e.sum_repr' v,← e.sum_repr' w] + simp only [map_sum,map_smul,_root_.sum_apply,_root_.smul_apply, + Finset.smul_sum,smul_smul] + rw [Finset.sum_comm] + apply sum_congr rfl + intro i _ + apply sum_congr rfl + intro j _ + rw [mul_comm] + +lemma principalApply_gram [CompleteSpace E] (e : OrthonormalBasis ι ℝ E) + (L : SecondOrder E) (T : E →L[ℝ] E) (h : ∀ v, L (rankOne v) = ‖T v‖^2) + (H : E →L[ℝ] E →L[ℝ] F) : + principalApply e L H = ∑ k, H (T.adjoint (e k)) (T.adjoint (e k)) := by + simp only [principalApply,principal_coefficient_gram L T h] + conv_rhs => arg 2; ext k; rw [bilinear_basis_expansion e H] + calc + _ = ∑ i, ∑ j, (∑ k, inner ℝ (e i) (T.adjoint (e k))*inner ℝ (e j) (T.adjoint (e k))) • H (e i) (e j) := by + apply sum_congr rfl + intro i _ + apply sum_congr rfl + intro j _ + congr 1 + simp only [ContinuousLinearMap.adjoint_inner_right] + rw [← e.sum_inner_mul_inner (T (e i)) (T (e j))] + exact sum_congr rfl (fun k _ => by rw [real_inner_comm (e k) (T (e j))]) + _ = _ := by + simp only [Finset.sum_smul] + conv_lhs => arg 2; ext i; rw [Finset.sum_comm] + rw [Finset.sum_comm] + +lemma principalApply_symmetric (e : OrthonormalBasis ι ℝ E) (L : SecondOrder E) + (H : E →L[ℝ] E →L[ℝ] F) (hH : ∀ v w, H v w = H w v) : + principalApply e L H = ∑ i, ∑ j, L (rankTwo (e i) (e j)) • H (e i) (e j) := by + have he : (∑ i, ∑ j, L (rankTwo (e j) (e i)) • H (e i) (e j)) = + ∑ i, ∑ j, L (rankTwo (e i) (e j)) • H (e i) (e j) := by + rw [Finset.sum_comm] + exact sum_congr rfl (fun i _ => sum_congr rfl (fun j _ => congrArg (fun v : F => L (rankTwo (e i) (e j)) • v) (hH _ _))) + simp only [principalApply,div_eq_mul_inv,mul_comm _ (2:ℝ)⁻¹,mul_smul,add_smul,Finset.sum_add_distrib,← Finset.smul_sum] + rw [he] + module + +end HigherJet + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/TraceEllipticity.lean b/lean/OAI/Geometry/PrescribedPotential/TraceEllipticity.lean new file mode 100644 index 0000000000000000000000000000000000000000..9365a2b7ec0085b95b3c2c575d82520152696368 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/TraceEllipticity.lean @@ -0,0 +1,165 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.MatrixFrameNormalization + +namespace OAI + +/-! Trace Ellipticity. -/ + +section + + +noncomputable section +open Matrix +open scoped ComplexOrder MatrixOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +variable {n : ℕ} + +lemma eig_upper_psd {M : Matrix (Fin n) (Fin n) ℂ} (hh : M.IsHermitian) + (C : ℝ) (he : ∀ i, hh.eigenvalues i ≤ C) : (((C:ℂ) • 1)-M).PosSemidef := by + have hd : (Matrix.diagonal (fun i => ((C-hh.eigenvalues i:ℝ):ℂ))).PosSemidef := + Matrix.PosSemidef.diagonal (fun i => by + change (0:ℂ) ≤ ((C-hh.eigenvalues i:ℝ):ℂ) + exact_mod_cast sub_nonneg.mpr (he i)) + have hu := hd.mul_mul_conjTranspose_same (hh.eigenvectorUnitary : Matrix (Fin n) (Fin n) ℂ) + have hD : Matrix.diagonal (fun i => ((C-hh.eigenvalues i:ℝ):ℂ)) = + (C:ℂ) • (1 : Matrix (Fin n) (Fin n) ℂ)-Matrix.diagonal (fun i => (hh.eigenvalues i:ℂ)) := by + simp only [Complex.ofReal_sub,Matrix.diagonal_sub,Matrix.smul_one_eq_diagonal] + rw [hD,Matrix.mul_sub,Matrix.sub_mul,Matrix.mul_smul,Matrix.mul_one,Matrix.smul_mul] at hu + have hunit : (hh.eigenvectorUnitary : Matrix (Fin n) (Fin n) ℂ)* + (hh.eigenvectorUnitary : Matrix (Fin n) (Fin n) ℂ)ᴴ = 1 := Unitary.coe_mul_star_self _ + rw [hunit] at hu + have hs := hh.spectral_theorem + simp only [Unitary.conjStarAlgAut_apply,Function.comp_def] at hs + exact hs ▸ hu + +lemma trace_upper_psd {M : Matrix (Fin n) (Fin n) ℂ} (hM : M.PosSemidef) : + (((M.trace.re:ℂ) • 1)-M).PosSemidef := by + apply eig_upper_psd hM.isHermitian + intro i + rw [hM.isHermitian.trace_eq_sum_eigenvalues,Complex.re_sum] + exact Finset.single_le_sum (fun j _ => hM.eigenvalues_nonneg j) (Finset.mem_univ i) + +lemma inverse_trace_lower_psd {M G : Matrix (Fin n) (Fin n) ℂ} + (hM : M.PosDef) (hG : G.PosDef) {R : ℝ} (hR : (M⁻¹*G).trace.re ≤ R) : + (((R:ℂ) • M)-G).PosSemidef := by + obtain ⟨B,hB,hBM⟩ := whitening M hM + let N := Bᴴ*G*B + have hN : N.PosDef := hG.conjTranspose_mul_mul_same (Matrix.mulVec_injective_iff_isUnit.mpr hB) + have htr : N.trace.re = (M⁻¹*G).trace.re := by + have he := matrix_inverse_trace_congruence B M G hB + rw [hBM,inv_one,one_mul] at he + exact congrArg Complex.re he + have hn := trace_upper_psd hN.posSemidef + have hd : (((R-N.trace.re:ℝ):ℂ) • (1 : Matrix (Fin n) (Fin n) ℂ)).PosSemidef := + Matrix.PosSemidef.smul Matrix.PosSemidef.one (by exact_mod_cast sub_nonneg.mpr (htr ▸ hR)) + have hh := hn.add hd + have he : (((N.trace.re:ℂ) • (1 : Matrix (Fin n) (Fin n) ℂ))-N)+ + ((R-N.trace.re:ℝ):ℂ) • 1 = (R:ℂ) • 1-N := by + rw [Complex.ofReal_sub,sub_smul] + abel + rw [he] at hh + have hp : (Bᴴ*((R:ℂ) • M-G)*B).PosSemidef := by + simpa only [mul_sub,sub_mul,mul_smul_comm,smul_mul_assoc,hBM] using hh + exact (hB.posSemidef_star_left_conjugate_iff).mp hp + +lemma inverse_trace_eigenvalues {M : Matrix (Fin n) (Fin n) ℂ} (hM : M.PosDef) : + M⁻¹.trace.re = ∑ i, (hM.isHermitian.eigenvalues i)⁻¹ := by + let U := hM.isHermitian.eigenvectorUnitary + have hs := hM.isHermitian.spectral_theorem + simp only [Unitary.conjStarAlgAut_apply,Function.comp_def] at hs + change M = (U : Matrix (Fin n) (Fin n) ℂ) * + Matrix.diagonal (fun i => (hM.isHermitian.eigenvalues i:ℂ)) * + (U : Matrix (Fin n) (Fin n) ℂ)ᴴ at hs + have hu : (U : Matrix (Fin n) (Fin n) ℂ)⁻¹ = (U : Matrix (Fin n) (Fin n) ℂ)ᴴ := + Matrix.inv_eq_left_inv (Unitary.coe_star_mul_self U) + have hv : ((U : Matrix (Fin n) (Fin n) ℂ)ᴴ)⁻¹ = (U : Matrix (Fin n) (Fin n) ℂ) := + Matrix.inv_eq_left_inv (Unitary.coe_mul_star_self U) + have hid : (Matrix.diagonal (fun i => (hM.isHermitian.eigenvalues i:ℂ)))⁻¹ = + Matrix.diagonal (fun i => ((hM.isHermitian.eigenvalues i:ℂ))⁻¹) := by + apply Matrix.inv_eq_left_inv + rw [Matrix.diagonal_mul_diagonal] + have he : (fun i => (hM.isHermitian.eigenvalues i:ℂ)⁻¹ * (hM.isHermitian.eigenvalues i:ℂ)) = fun _ => 1 := by + funext i + exact inv_mul_cancel₀ (Complex.ofReal_ne_zero.mpr (hM.eigenvalues_pos i).ne') + rw [he, Matrix.diagonal_one] + have hi : M⁻¹ = (U : Matrix (Fin n) (Fin n) ℂ)* + Matrix.diagonal (fun i => (((hM.isHermitian.eigenvalues i)⁻¹:ℝ):ℂ)) * + (U : Matrix (Fin n) (Fin n) ℂ)ᴴ := by + conv_lhs => rw [hs] + simp only [Matrix.mul_inv_rev, hu, hv, hid, Matrix.mul_assoc] + simp only [Complex.ofReal_inv] + have huu : (U : Matrix (Fin n) (Fin n) ℂ)ᴴ * (U : Matrix (Fin n) (Fin n) ℂ) = 1 := + Unitary.coe_star_mul_self U + rw [hi, Matrix.trace_mul_cycle, huu, Matrix.one_mul, + Matrix.trace_diagonal, Complex.re_sum] + rfl + +lemma inverse_trace_det_upper {M : Matrix (Fin n) (Fin n) ℂ} (hM : M.PosDef) + {R D : ℝ} (_hR0 : 0 ≤ R) (hR : M⁻¹.trace.re ≤ R) (hD : M.det.re ≤ D) : + ((((D * R^(n-1):ℝ):ℂ) • 1)-M).PosSemidef := by + apply eig_upper_psd hM.isHermitian + intro i + let ell := hM.isHermitian.eigenvalues + have hp : ∀ j, 0 < ell j := hM.eigenvalues_pos + have hb : ∀ j, (ell j)⁻¹ ≤ R := by + intro j + apply le_trans _ hR + rw [inverse_trace_eigenvalues hM] + exact Finset.single_le_sum (fun k _ => inv_nonneg.mpr (hp k).le) (Finset.mem_univ j) + have hprod : (∏ j ∈ Finset.univ.erase i, (ell j)⁻¹) ≤ R^(n-1) := by + have hh := Finset.prod_le_prod₀ (s := Finset.univ.erase i) + (fun j _ => inv_nonneg.mpr (hp j).le) (fun j _ => hb j) + simpa only [Finset.prod_const, Finset.card_erase_of_mem (Finset.mem_univ i), + Finset.card_univ, Fintype.card_fin] using hh + have hdet : M.det.re = ∏ j, ell j := by + rw [hM.isHermitian.det_eq_prod_eigenvalues, ← RCLike.ofReal_prod] + rfl + have he : ell i = M.det.re * ∏ j ∈ Finset.univ.erase i, (ell j)⁻¹ := by + rw [hdet,← Finset.mul_prod_erase Finset.univ ell (Finset.mem_univ i), + Finset.prod_inv_distrib, mul_assoc, mul_inv_cancel₀, mul_one] + exact Finset.prod_ne_zero_iff.mpr (fun j _ => (hp j).ne') + change ell i ≤ _ + rw [he] + exact mul_le_mul hD hprod + (Finset.prod_nonneg (fun j _ => inv_nonneg.mpr (hp j).le)) + (le_trans (Complex.nonneg_iff.mp hM.det_pos.le).1 hD) + +lemma det_ratio_whitening {M G B : Matrix (Fin n) (Fin n) ℂ} + (hM : M.PosDef) (hG : G.PosDef) (hB : IsUnit B) (hBG : Bᴴ*G*B = 1) : + (Bᴴ*M*B).det.re = M.det.re/G.det.re := by + have hN := hM.conjTranspose_mul_mul_same (Matrix.mulVec_injective_iff_isUnit.mpr hB) + have he : (Bᴴ*M*B).det * G.det = M.det := by + have hh := congrArg Matrix.det hBG + simp only [Matrix.det_mul, Matrix.det_one] at hh ⊢ + calc + Bᴴ.det * M.det * B.det * G.det = M.det * (Bᴴ.det * G.det * B.det) := by ring + _ = M.det := by rw [hh,mul_one] + have hr : (Bᴴ*M*B).det.re * G.det.re = M.det.re := by + have hh := congrArg Complex.re he + rw [Complex.mul_re, ← (Complex.pos_iff.mp hN.det_pos).2, + zero_mul,sub_zero] at hh + exact hh + exact (eq_div_iff (ne_of_gt (Complex.pos_iff.mp hG.det_pos).1)).mpr hr + +lemma inverse_trace_relative_upper {M G : Matrix (Fin n) (Fin n) ℂ} + (hM : M.PosDef) (hG : G.PosDef) {R D : ℝ} + (hR0 : 0 ≤ R) (hR : (M⁻¹*G).trace.re ≤ R) (hD : M.det.re/G.det.re ≤ D) : + ((((D*R^(n-1):ℝ):ℂ) • G)-M).PosSemidef := by + obtain ⟨B,hB,hBG⟩ := whitening G hG + let N := Bᴴ*M*B + have hN : N.PosDef := hM.conjTranspose_mul_mul_same (Matrix.mulVec_injective_iff_isUnit.mpr hB) + have htr : N⁻¹.trace.re = (M⁻¹*G).trace.re := by + have he := matrix_inverse_trace_congruence B M G hB + rw [hBG,mul_one] at he + exact congrArg Complex.re he + have hd : N.det.re ≤ D := (det_ratio_whitening hM hG hB hBG).trans_le hD + have hh := inverse_trace_det_upper hN hR0 (htr ▸ hR) hd + have he : (Bᴴ*((((D*R^(n-1):ℝ):ℂ) • G)-M)*B).PosSemidef := by + simpa only [mul_sub,sub_mul,mul_smul_comm,smul_mul_assoc,hBG] using hh + exact hB.posSemidef_star_left_conjugate_iff.mp he +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/TracePositivity.lean b/lean/OAI/Geometry/PrescribedPotential/TracePositivity.lean new file mode 100644 index 0000000000000000000000000000000000000000..c4857b0a0c34b74162575711756143d7d456a0c0 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/TracePositivity.lean @@ -0,0 +1,51 @@ +import Mathlib + +namespace OAI + +/-! Trace Positivity. -/ + +section + +noncomputable section +open Matrix +open scoped ComplexOrder MatrixOrder +namespace KaehlerCalculus +variable {n : ℕ} + +lemma trace_mul_real {A B : Matrix (Fin n) (Fin n) ℂ} + (hA : A.IsHermitian) (hB : B.IsHermitian) : + ((A*B).trace.re : ℂ) = (A*B).trace := by + have he : star (A*B).trace = (A*B).trace := by + rw [← Matrix.trace_conjTranspose,Matrix.conjTranspose_mul,hA.eq,hB.eq,Matrix.trace_mul_comm] + apply Complex.ext + · simp + · have hi := congrArg Complex.im he + simp only [Complex.star_def,Complex.conj_im] at hi + simp only [Complex.ofReal_im] + linarith + +lemma trace_mul_pos [Nonempty (Fin n)] {A B : Matrix (Fin n) (Fin n) ℂ} + (hA : A.PosDef) (hB : B.PosDef) : 0 < (A*B).trace.re := by + obtain ⟨Q,hQ,rfl⟩ := CStarAlgebra.isStrictlyPositive_iff_eq_star_mul_self.mp hA.isStrictlyPositive + have h := (hB.mul_mul_conjTranspose_same (Matrix.vecMul_injective_iff_isUnit.mpr hQ)).trace_pos + change 0 < (Qᴴ*Q*B).trace.re + rw [Matrix.trace_mul_cycle] at h + exact (Complex.pos_iff.mp h).1 + +lemma whitening (M : Matrix (Fin n) (Fin n) ℂ) (hM : M.PosDef) : + ∃ B : Matrix (Fin n) (Fin n) ℂ, IsUnit B ∧ Bᴴ*M*B = 1 := by + obtain ⟨Q,hQ,hM⟩ := CStarAlgebra.isStrictlyPositive_iff_eq_star_mul_self.mp hM.isStrictlyPositive + obtain ⟨Q,rfl⟩ := hQ + let R : Matrix (Fin n) (Fin n) ℂ := ↑(Q⁻¹) + have hQR : (Q : Matrix (Fin n) (Fin n) ℂ)*R = 1 := Q.mul_inv + refine ⟨R,(Q⁻¹).isUnit,?_⟩ + rw [hM] + change Rᴴ*((Q : Matrix (Fin n) (Fin n) ℂ)ᴴ*(Q : Matrix (Fin n) (Fin n) ℂ))*R = 1 + rw [Matrix.mul_assoc Rᴴ,Matrix.mul_assoc, hQR,Matrix.mul_one, + ← Matrix.conjTranspose_mul,hQR,Matrix.conjTranspose_one] +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/TruncatedRellich.lean b/lean/OAI/Geometry/PrescribedPotential/TruncatedRellich.lean new file mode 100644 index 0000000000000000000000000000000000000000..12c998820c7e90b13a8e7b1e683676399f93402b --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/TruncatedRellich.lean @@ -0,0 +1,116 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.FourierKernel +import OAI.Geometry.PrescribedPotential.KernelCompact +import OAI.Geometry.PrescribedPotential.LocalizedCompact + +namespace OAI + +/-! Truncated Rellich. -/ + +section + + + +noncomputable section +open MeasureTheory Set Filter Topology FourierTransform +open scoped BoundedContinuousFunction SchwartzMap Classical ComplexInnerProductSpace +namespace EllipticCompact +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] +open SobolevChart + +lemma multiply_ae (g : E →ᵇ ℂ) (u : L2 E) : + multiply g u =ᵐ[volume] fun x => g x * u x := by + rw [multiply_eq] + filter_upwards [Lp.coeFn_lpSMul (r := 2) (g.memLp_top.toLp g : Lp ℂ ⊤ volume) u, + (g.memLp_top (μ := volume)).coeFn_toLp] with x h h' + rw [h, Pi.smul_apply', h', smul_eq_mul] + +lemma multiply_toLp (g f : 𝓢(E, ℂ)) : + multiply g.toBoundedContinuousFunction (f.toLp 2) = + (SchwartzMap.smulLeftCLM ℂ g f).toLp 2 := by + apply Lp.ext + filter_upwards [multiply_ae g.toBoundedContinuousFunction (f.toLp 2), + f.coeFn_toLp 2 volume, (SchwartzMap.smulLeftCLM ℂ g f).coeFn_toLp 2 volume] with x hm hf hp + rw [hm, hf, hp, SchwartzMap.smulLeftCLM_apply_apply g.hasTemperateGrowth, smul_eq_mul] + rfl + +lemma kernelSection_inner (χ f : 𝓢(E, ℂ)) (x : E) : + inner ℂ (kernelSection χ x) (f.toLp 2) = + (𝓕⁻ (SchwartzMap.smulLeftCLM ℂ χ f) : 𝓢(E, ℂ)) x := by + rw [L2.inner_def] + conv_rhs => rw [SchwartzMap.fourierInv_coe, Real.fourierInv_eq] + apply integral_congr_ae + filter_upwards [kernelSection_ae χ x, f.coeFn_toLp 2 volume] with y hχ hf + rw [hχ, hf, RCLike.inner_apply, kernelSectionFun, starRingEnd_apply, star_star, + SchwartzMap.smulLeftCLM_apply_apply χ.hasTemperateGrowth] + simp only [Circle.smul_def, smul_eq_mul] + ring + +def sectionsOn (χ : 𝓢(E, ℂ)) (hχ : HasCompactSupport χ) + (s : Set E) [CompactSpace s] : s →ᵇ (L2 E →L[ℂ] ℂ) := + BoundedContinuousFunction.mkOfCompact ⟨fun x => innerSL ℂ (kernelSection χ x), + (innerSL ℂ).continuous.comp ((kernelSection_continuous χ hχ).comp continuous_subtype_val)⟩ + +lemma sectionsOn_core (χ : 𝓢(E, ℂ)) (hχ : HasCompactSupport χ) + (s : Set E) [CompactSpace s] (f : 𝓢(E, ℂ)) : + kernelOperator (sectionsOn χ hχ s) (f.toLp 2) = + (𝓕⁻ (SchwartzMap.smulLeftCLM ℂ χ f) : 𝓢(E, ℂ)).toBoundedContinuousFunction.compContinuous + ⟨Subtype.val, continuous_subtype_val⟩ := by + ext x + change innerSL ℂ (kernelSection χ x) (f.toLp 2) = _ + rw [innerSL_apply_apply] + exact kernelSection_inner χ f x + +lemma localize_sections_core (κ χ : 𝓢(E, ℂ)) (hχ : HasCompactSupport χ) + (s : Set E) [CompactSpace s] (hs : MeasurableSet s) (hκs : Function.support κ ⊆ s) + (f : 𝓢(E, ℂ)) : + localizeL2 κ s hs (kernelOperator (sectionsOn χ hχ s) (f.toLp 2)) = + (SchwartzMap.smulLeftCLM ℂ κ (𝓕⁻ (SchwartzMap.smulLeftCLM ℂ χ f))).toLp 2 := by + rw [sectionsOn_core] + apply Lp.ext + filter_upwards [localizeL2_restrict κ s hs hκs + (𝓕⁻ (SchwartzMap.smulLeftCLM ℂ χ f) : 𝓢(E, ℂ)).toBoundedContinuousFunction, + (SchwartzMap.smulLeftCLM ℂ κ (𝓕⁻ (SchwartzMap.smulLeftCLM ℂ χ f))).coeFn_toLp 2 volume] + with x h₁ h₂ + rw [h₁, h₂, SchwartzMap.smulLeftCLM_apply_apply κ.hasTemperateGrowth, smul_eq_mul] + rfl + +lemma truncated_core (κ χ f : 𝓢(E, ℂ)) : + (multiply κ.toBoundedContinuousFunction ∘L + fourierInvCLM ℂ (L2 E) ∘L multiply χ.toBoundedContinuousFunction) (f.toLp 2) = + (SchwartzMap.smulLeftCLM ℂ κ (𝓕⁻ (SchwartzMap.smulLeftCLM ℂ χ f))).toLp 2 := by + simp only [ContinuousLinearMap.comp_apply, fourierInvCLM_apply] + exact (congrArg (fun u : L2 E => multiply κ.toBoundedContinuousFunction (𝓕⁻ u)) + (multiply_toLp χ f)).trans + ((congrArg (multiply κ.toBoundedContinuousFunction) + (SchwartzMap.toLp_fourierInv_eq (SchwartzMap.smulLeftCLM ℂ χ f))).trans + (multiply_toLp κ (𝓕⁻ (SchwartzMap.smulLeftCLM ℂ χ f)))) + +lemma compact_truncated (κ χ : 𝓢(E, ℂ)) + (hκ : HasCompactSupport κ) (hχ : HasCompactSupport χ) : + IsCompactOperator (multiply κ.toBoundedContinuousFunction ∘L + fourierInvCLM ℂ (L2 E) ∘L multiply χ.toBoundedContinuousFunction) := by + let s := tsupport κ + let : CompactSpace s := isCompact_iff_compactSpace.mp hκ + have hs : MeasurableSet s := (isClosed_tsupport κ).measurableSet + let T := (localizeL2 κ s hs).comp (kernelOperator (sectionsOn χ hχ s)) + have hT : IsCompactOperator T := + (kernelOperator_compact (sectionsOn χ hχ s)).clm_comp (localizeL2 κ s hs) + have he : T = multiply κ.toBoundedContinuousFunction ∘L + fourierInvCLM ℂ (L2 E) ∘L multiply χ.toBoundedContinuousFunction := by + apply DFunLike.coe_injective + apply (SchwartzMap.denseRange_toLpCLM (E := E) (F := ℂ) (p := 2) (μ := volume) (by norm_num)).equalizer + T.continuous (by fun_prop) + funext f + exact (localize_sections_core κ χ hχ s hs (subset_tsupport κ) f).trans + (truncated_core κ χ f).symm + rw [← he] + exact hT + +end EllipticCompact + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/TwoScaleRegularity.lean b/lean/OAI/Geometry/PrescribedPotential/TwoScaleRegularity.lean new file mode 100644 index 0000000000000000000000000000000000000000..10a6980a6cf256e8224178dacb86108848aeb0c4 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/TwoScaleRegularity.lean @@ -0,0 +1,166 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.NonlinearScale + +namespace OAI + +/-! Two Scale Regularity. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) +local instance gainNG (s : ℝ) : NormedAddCommGroup (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedAddCommGroup +local instance gainNS (s : ℝ) : NormedSpace ℝ (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedSpace +local instance gainTG (s : ℝ) : IsTopologicalAddGroup (D.localizers.RealSobolev s) := + Submodule.isTopologicalAddGroup _ +local instance gainCS (s : ℝ) : ContinuousSMul ℝ (D.localizers.RealSobolev s) := + SMulMemClass.continuousSMul _ + +omit [ConnectedSpace X] in +lemma realConstants_lower {s t : ℝ} (hst : t ≤ s) (c : ℝ) : + D.localizers.realLower s t hst (D.realConstants s c) = D.realConstants t c := by + apply Subtype.ext + exact D.constantsOrder_lower hst (c : ℂ) + +omit [ConnectedSpace X] in +lemma realEvaluation_embed {s : ℝ} (hs : (Module.finrank ℝ (EC d) : ℝ) < 2*s) + (x₀ : X) (f : RealSmooth A) : + D.realEvaluation s x₀ (D.localizers.realEmbed s f) = (f.val x₀).re := by + change (D.pointEvaluation s x₀ (D.localizers.embed s f.val)).re = _ + rw [D.pointEvaluation_embed hs] + +omit [ConnectedSpace X] in +lemma realEvaluation_lower {s t : ℝ} (hst : t ≤ s) + (ht : (Module.finrank ℝ (EC d) : ℝ) < 2*t) (x₀ : X) + (u : D.localizers.RealSobolev s) : + D.realEvaluation t x₀ (D.localizers.realLower s t hst u) = D.realEvaluation s x₀ u := by + let : NormedAddCommGroup (D.localizers.RealSobolev s) := inferInstance + let : NormedSpace ℝ (D.localizers.RealSobolev s) := inferInstance + let : NormedAddCommGroup (D.localizers.RealSobolev t) := inferInstance + let : NormedSpace ℝ (D.localizers.RealSobolev t) := inferInstance + have hs : (Module.finrank ℝ (EC d) : ℝ) < 2*s := by linarith + have hf : (fun v : D.localizers.RealSobolev s => + D.realEvaluation t x₀ (D.localizers.realLower s t hst v)) = + (fun v : D.localizers.RealSobolev s => D.realEvaluation s x₀ v) := by + apply (D.localizers.realEmbed_dense s).equalizer + ((D.realEvaluation t x₀).continuous.comp (D.localizers.realLower s t hst).continuous) + (D.realEvaluation s x₀).continuous + funext f + simp only [Function.comp_apply,Localizers.realLower_embed,D.realEvaluation_embed ht, + D.realEvaluation_embed hs] + exact congr_fun hf u + +def pairLower (s t : ℝ) (hst : t ≤ s) : + (D.localizers.RealSobolev s × ℝ) →L[ℝ] (D.localizers.RealSobolev t × ℝ) := + (D.localizers.realLower s t hst ∘L ContinuousLinearMap.fst ℝ _ ℝ).prod + (ContinuousLinearMap.snd ℝ _ ℝ) + +omit [ConnectedSpace X] in +lemma pairLower_apply (s t : ℝ) (hst : t ≤ s) + (w : D.localizers.RealSobolev s × ℝ) : + D.pairLower s t hst w = (D.localizers.realLower s t hst w.1,w.2) := rfl + +omit [ConnectedSpace X] in +lemma linearizedVolume_apply (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (x₀ : X) + (u : D.localizers.RealSobolev ((k : ℝ)+2)) + (w : D.localizers.RealSobolev ((k : ℝ)+2) × ℝ) : + D.linearizedVolume k hk x₀ u w = + (D.realVolumeDerivative k hk u w.1 - D.realConstants (k : ℝ) w.2, + D.realEvaluation ((k : ℝ)+2) x₀ w.1) := by + simp only [linearizedVolume,ContinuousLinearMap.prod_apply,_root_.sub_apply, + ContinuousLinearMap.comp_apply] + rfl + +omit [ConnectedSpace X] in +lemma linearizedVolume_lower (k l : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (hl : Module.finrank ℝ (EC d) < l) (hlk : l ≤ k) (x₀ : X) + (u : D.localizers.RealSobolev ((k : ℝ)+2)) (w : D.localizers.RealSobolev ((k : ℝ)+2) × ℝ) : + D.linearizedVolume l hl x₀ (D.localizers.realLower ((k : ℝ)+2) ((l : ℝ)+2) + (by exact_mod_cast Nat.add_le_add_right hlk 2) u) + (D.pairLower ((k : ℝ)+2) ((l : ℝ)+2) (by exact_mod_cast Nat.add_le_add_right hlk 2) w) = + D.pairLower (k : ℝ) (l : ℝ) (by exact_mod_cast hlk) (D.linearizedVolume k hk x₀ u w) := by + let : NormedAddCommGroup (D.localizers.RealSobolev ((k : ℝ)+2)) := inferInstance + let : NormedSpace ℝ (D.localizers.RealSobolev ((k : ℝ)+2)) := inferInstance + let : NormedAddCommGroup (D.localizers.RealSobolev ((l : ℝ)+2)) := inferInstance + let : NormedSpace ℝ (D.localizers.RealSobolev ((l : ℝ)+2)) := inferInstance + let : NormedAddCommGroup (D.localizers.RealSobolev (k : ℝ)) := inferInstance + let : NormedSpace ℝ (D.localizers.RealSobolev (k : ℝ)) := inferInstance + let : NormedAddCommGroup (D.localizers.RealSobolev (l : ℝ)) := inferInstance + let : NormedSpace ℝ (D.localizers.RealSobolev (l : ℝ)) := inferInstance + have hst : (l : ℝ)+2 ≤ (k : ℝ)+2 := by exact_mod_cast Nat.add_le_add_right hlk 2 + have hkl : (l : ℝ) ≤ (k : ℝ) := by exact_mod_cast hlk + simp only [linearizedVolume_apply,pairLower_apply] + apply Prod.ext + · have hh := congrArg (fun L : D.localizers.RealSobolev ((k : ℝ)+2) →L[ℝ] + D.localizers.RealSobolev (l : ℝ) => L w.1) + (D.realVolumeDerivative_lower k l hk hl hlk u) + simp only [ContinuousLinearMap.comp_apply] at hh + rw [map_sub,D.realConstants_lower,hh] + · apply D.realEvaluation_lower hst + have hh : (Module.finrank ℝ (EC d) : ℝ) < (l : ℝ) := by exact_mod_cast hl + linarith [Nat.cast_nonneg (α := ℝ) l] + + + +theorem linearizedVolume_local_gain (k l : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (hl : Module.finrank ℝ (EC d) < l) (hlk : l ≤ k) (x₀ : X) : + ∀ᶠ u in 𝓝 (0 : D.localizers.RealSobolev ((k : ℝ)+2)), + ∀ (w : D.localizers.RealSobolev ((l : ℝ)+2) × ℝ) + (f : D.localizers.RealSobolev (k : ℝ) × ℝ), + D.linearizedVolume l hl x₀ (D.localizers.realLower ((k : ℝ)+2) ((l : ℝ)+2) + (by exact_mod_cast Nat.add_le_add_right hlk 2) u) w = + D.pairLower (k : ℝ) (l : ℝ) (by exact_mod_cast hlk) f → + ∃ v : D.localizers.RealSobolev ((k : ℝ)+2) × ℝ, + D.pairLower ((k : ℝ)+2) ((l : ℝ)+2) (by exact_mod_cast Nat.add_le_add_right hlk 2) v = w ∧ + D.linearizedVolume k hk x₀ u v = f := by + obtain ⟨m,hm,he⟩ := D.exists_completedError_small + obtain ⟨P⟩ := D.localizers.constantProjection_exists + let : NormedAddCommGroup (D.localizers.RealSobolev ((k : ℝ)+2)) := inferInstance + let : NormedSpace ℝ (D.localizers.RealSobolev ((k : ℝ)+2)) := inferInstance + let : NormedAddCommGroup (D.localizers.RealSobolev ((l : ℝ)+2)) := inferInstance + let : NormedSpace ℝ (D.localizers.RealSobolev ((l : ℝ)+2)) := inferInstance + let : NormedAddCommGroup (D.localizers.RealSobolev (k : ℝ)) := inferInstance + let : NormedSpace ℝ (D.localizers.RealSobolev (k : ℝ)) := inferInstance + let : NormedAddCommGroup (D.localizers.RealSobolev (l : ℝ)) := inferInstance + let : NormedSpace ℝ (D.localizers.RealSobolev (l : ℝ)) := inferInstance + have hst : (l : ℝ)+2 ≤ (k : ℝ)+2 := by exact_mod_cast Nat.add_le_add_right hlk 2 + have hkl : (l : ℝ) ≤ (k : ℝ) := by exact_mod_cast hlk + let L := D.localizers.realLower ((k : ℝ)+2) ((l : ℝ)+2) hst + have hN : Tendsto L (𝓝 0) (𝓝 0) := by simpa only [map_zero] using L.continuous.tendsto 0 + filter_upwards [D.linearizedVolume_invertible_nhds m hm he P k hk x₀, + hN.eventually (D.linearizedVolume_invertible_nhds m hm he P l hl x₀)] with u hu hv + obtain ⟨e,heq⟩ := hu + obtain ⟨e',heq'⟩ := hv + intro w f hw + refine ⟨e.symm f,?_,?_⟩ + · apply e'.injective + have hm₁ := congrArg (fun T : _ →L[ℝ] _ => T + (D.pairLower ((k : ℝ)+2) ((l : ℝ)+2) hst (e.symm f))) heq' + have hm₂ := congrArg (fun T : _ →L[ℝ] _ => T w) heq' + have hm₃ := congrArg (fun T : _ →L[ℝ] _ => T (e.symm f)) heq + have hei : e.toContinuousLinearMap (e.symm f) = f := e.apply_symm_apply f + rw [hei] at hm₃ + exact hm₁.trans ((D.linearizedVolume_lower k l hk hl hlk x₀ u (e.symm f)).trans + ((congrArg (D.pairLower (k : ℝ) (l : ℝ) hkl) hm₃.symm).trans + (hw.symm.trans hm₂.symm))) + · have hh := congrArg (fun T : _ →L[ℝ] _ => T (e.symm f)) heq + exact hh.symm.trans (e.apply_symm_apply f) + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/UniformCompositionFamily.lean b/lean/OAI/Geometry/PrescribedPotential/UniformCompositionFamily.lean new file mode 100644 index 0000000000000000000000000000000000000000..1b1922226ec9e103d09a97fe38c8fe9a2d75e7f2 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/UniformCompositionFamily.lean @@ -0,0 +1,73 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CircleRadialCalculus +import OAI.Geometry.PrescribedPotential.HigherJetComposition +import OAI.Geometry.PrescribedPotential.QuasilinearJetBasics + +namespace OAI + +/-! Uniform Composition Family. -/ + +section + +noncomputable section +open Set Filter Topology Finset +open scoped ContDiff +namespace HigherJet +variable {E F G : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] + [NormedAddCommGroup G] [NormedSpace ℝ G] +lemma composition_family_jets {I : Type*} (f : I → E → F) {K : Set E} + (hf : ∀ i x, x ∈ K → ContDiffAt ℝ ∞ (f i) x) + (hjet : ∀ m : ℕ, ∃ C : ℝ, ∀ i x, x ∈ K → ‖iteratedFDeriv ℝ m (f i) x‖ ≤ C) + {Q : Set F} (hQ : IsCompact Q) (hrange : ∀ i x, x ∈ K → f i x ∈ Q) + (g : F → G) (hg : ∀ y ∈ Q, ContDiffAt ℝ ∞ g y) (m : ℕ) : + ∃ C : ℝ, ∀ i x, x ∈ K → ‖iteratedFDeriv ℝ m (g ∘ f i) x‖ ≤ C := by + classical + choose C hC using hjet + let B := 1+∑ j ∈ range (m+1), max 0 (C j) + have hB : 1 ≤ B := le_add_of_nonneg_right (Finset.sum_nonneg (fun _ _ => le_max_left _ _)) + have hbound (i : I) (x : E) (hx : x ∈ K) (j : ℕ) (hj : j ≤ m) : ‖iteratedFDeriv ℝ j (f i) x‖ ≤ B := by + exact (hC j i x hx).trans ((le_max_right _ _).trans ((Finset.single_le_sum + (fun _ _ => le_max_left _ _) (mem_range.mpr (by omega))).trans (le_add_of_nonneg_left zero_le_one))) + obtain ⟨A,hA,hAj⟩ := compact_coefficient_jets hQ hg m + refine ⟨(Fintype.card (OrderedFinpartition m):ℝ)*A*B^m*1,fun i x hx => ?_⟩ + exact composition_top_jet_bound (hf i x hx) (hg _ (hrange i x hx)) (r := m+1) + (by omega) hB le_rfl (by linarith) (fun j hj hjm => hbound i x hx j (by omega)) + (fun j hj hjm => (by omega)) (fun j hj => hAj j hj _ (hrange i x hx)) + +lemma pair_fixed_family_jets {I : Type*} (f : I → E → F) {v : E → G} {K : Set E} + (hK : IsCompact K) (hf : ∀ i x, x ∈ K → ContDiffAt ℝ ∞ (f i) x) + (hv : ∀ x ∈ K, ContDiffAt ℝ ∞ v x) + (hjet : ∀ m : ℕ, ∃ C : ℝ, ∀ i x, x ∈ K → ‖iteratedFDeriv ℝ m (f i) x‖ ≤ C) + (m : ℕ) : ∃ C : ℝ, ∀ i x, x ∈ K → + ‖iteratedFDeriv ℝ m (fun y => (v y,f i y)) x‖ ≤ C := by + obtain ⟨C,hC⟩ := hjet m + obtain ⟨B,hB,hbound⟩ := compact_coefficient_jets hK hv m + refine ⟨max B C,fun i x hx => ?_⟩ + rw [iteratedFDeriv_prodMk (hv x hx) (hf i x hx) + (show (m:ℕ∞ω) ≤ ∞ from WithTop.coe_le_coe.mpr le_top),ContinuousMultilinearMap.opNorm_prod] + exact max_le_max (hbound m le_rfl x hx) (hC i x hx) + +lemma parametric_composition_family_jets [FiniteDimensional ℝ F] {I : Type*} + (f : I → E → F) {K : Set E} (hK : IsCompact K) + (hf : ∀ i x, x ∈ K → ContDiffAt ℝ ∞ (f i) x) + (hjet : ∀ m : ℕ, ∃ C : ℝ, ∀ i x, x ∈ K → ‖iteratedFDeriv ℝ m (f i) x‖ ≤ C) + (g : E × F → G) (hg : ∀ x ∈ K, ∀ y, ContDiffAt ℝ ∞ g (x,y)) (m : ℕ) : + ∃ C : ℝ, ∀ i x, x ∈ K → ‖iteratedFDeriv ℝ m (fun y => g (y,f i y)) x‖ ≤ C := by + obtain ⟨R,hR⟩ := hjet 0 + let Q := K ×ˢ Metric.closedBall (0:F) (max 0 R) + have hQ : IsCompact Q := hK.prod (isCompact_closedBall _ _) + let ff : I → E → E × F := fun i x => (x,f i x) + have hff : ∀ i x, x ∈ K → ContDiffAt ℝ ∞ (ff i) x := fun i x hx => contDiffAt_id.prodMk (hf i x hx) + apply composition_family_jets ff hff (pair_fixed_family_jets f hK hf (fun _ _ => contDiffAt_id) hjet) hQ + · intro i x hx + exact ⟨hx,by simpa only [Metric.mem_closedBall,dist_zero_right,norm_iteratedFDeriv_zero] using + (hR i x hx).trans (le_max_right 0 R)⟩ + · rintro ⟨x,y⟩ hxy + exact hg x hxy.1 y +end HigherJet + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/UniformJetControls.lean b/lean/OAI/Geometry/PrescribedPotential/UniformJetControls.lean new file mode 100644 index 0000000000000000000000000000000000000000..7cb3f16a436a3738f7f2cd7cdfd6665dd2ddd864 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/UniformJetControls.lean @@ -0,0 +1,62 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.JetEnergyUniform + +namespace OAI + +/-! Uniform Jet Controls. -/ + +section + +noncomputable section +open Set Filter Topology Finset Module +open scoped ContDiff +namespace HigherJet +variable {E F : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [NormedAddCommGroup F] [InnerProductSpace ℝ F] + [FiniteDimensional ℝ E] [FiniteDimensional ℝ F] + {ι : Type*} [Fintype ι] + +lemma sqrt_coercivity {S D q : ℝ} (_hS : 0 ≤ S) (hD : 0 ≤ D) (hq : 0 ≤ q) + (h : S ≤ q*D) : Real.sqrt S ≤ (1+q)*Real.sqrt D := by + apply (Real.sqrt_le_iff).mpr + refine ⟨by positivity,?_⟩ + rw [mul_pow,Real.sq_sqrt hD] + have hh : q ≤ (1+q)^2 := by nlinarith only [sq_nonneg q] + exact h.trans (mul_le_mul_of_nonneg_right hh hD) + +lemma uniform_jet_controls (e : OrthonormalBasis ι ℝ E) (m : ℕ) {B : ℝ} (hB : 0 ≤ B) : + ∃ A : ℝ, 1 ≤ A ∧ ∀ (U : Set E), IsOpen U → ∀ u : E → F, ContDiffOn ℝ ∞ u U → + ∀ x ∈ U, ∀ τ : E ≃L[ℝ] E, ‖τ.toContinuousLinearMap‖ ≤ B → ‖τ.symm.toContinuousLinearMap‖ ≤ B → + ‖iteratedFDeriv ℝ m u x‖ ≤ A*Real.sqrt (jetEnergy e m u x) ∧ + ‖iteratedFDeriv ℝ (m+1) u x‖ ≤ A*Real.sqrt (familyDissipation (fun i => τ (e i)) (jetFamily e m u) x) ∧ + jetEnergy e (m+1) u x ≤ A*familyDissipation (fun i => τ (e i)) (jetFamily e m u) x ∧ + familyDissipation (fun i => τ (e i)) (jetFamily e m u) x ≤ A*jetEnergy e (m+1) u x := by + obtain ⟨N,hN,hn⟩ := norm_iteratedFDeriv_le_jetEnergy (F := F) e.toBasis m + obtain ⟨P,hP,hp⟩ := norm_iteratedFDeriv_le_jetEnergy (F := F) e.toBasis (m+1) + obtain ⟨C,hC,hc⟩ := jetEnergy_frame_coercivity (F := F) e + obtain ⟨D,hD,hd⟩ := jetEnergy_frame_upper (F := F) e + let A := 1+N+P*(1+C*B^2)+C*B^2+D*B^2 + have ht : 0 ≤ P*(1+C*B^2) := by positivity + have hc0 : 0 ≤ C*B^2 := by positivity + have hd0 : 0 ≤ D*B^2 := by positivity + have hnA : N ≤ A := by dsimp [A]; linarith only [hN,ht,hc0,hd0] + have hpA : P*(1+C*B^2) ≤ A := by dsimp [A]; nlinarith only [hN,hC,hD,sq_nonneg B,mul_nonneg hC.le (sq_nonneg B),mul_nonneg hD.le (sq_nonneg B)] + have hcA : C*B^2 ≤ A := by dsimp [A]; linarith only [hN,ht,hc0,hd0] + have hdA : D*B^2 ≤ A := by dsimp [A]; linarith only [hN,ht,hc0,hd0] + refine ⟨A,by dsimp [A]; linarith only [hN,ht,hc0,hd0],?_⟩ + intro U hU u hu x hx τ hτ hτi + have hco := hc m u x τ B hB hτi + have hup := hd m u x τ B hB hτ + have hs := sqrt_coercivity (jetEnergy_nonneg _ _ _ _) (familyDissipation_nonneg _ _ _) + (show 0 ≤ C*B^2 by positivity) hco + refine ⟨(hn U hU u hu x hx).trans (mul_le_mul_of_nonneg_right hnA (Real.sqrt_nonneg _)),?_, + hco.trans (mul_le_mul_of_nonneg_right hcA (familyDissipation_nonneg _ _ _)), + hup.trans (mul_le_mul_of_nonneg_right hdA (jetEnergy_nonneg _ _ _ _))⟩ + exact (hp U hU u hu x hx).trans ((mul_le_mul_of_nonneg_left hs hP.le).trans + (by simpa only [mul_assoc] using mul_le_mul_of_nonneg_right hpA (Real.sqrt_nonneg _))) +end HigherJet + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/UniformPathSobolev.lean b/lean/OAI/Geometry/PrescribedPotential/UniformPathSobolev.lean new file mode 100644 index 0000000000000000000000000000000000000000..637ada471111c306a92108a40d0905b9944422f7 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/UniformPathSobolev.lean @@ -0,0 +1,90 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.BoundedPathContinuation +import OAI.Geometry.PrescribedPotential.CompletedResolvent +import OAI.Geometry.PrescribedPotential.PathLaplacianSobolev +import OAI.Geometry.PrescribedPotential.PointPoisson +import OAI.Geometry.PrescribedPotential.RealSmoothOperator + +namespace OAI + +/-! Uniform Path Sobolev. -/ + +section + +noncomputable section +open Set Filter Topology +open scoped ContDiff +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +lemma pointPoissonOrder_laplacian (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) (k : ℕ) + (hk : (Module.finrank ℝ (EC d) : ℝ) < 2*((k : ℝ)+2)) (x₀ : X) + (φ : SmoothRealFunction A) (hn : φ.value x₀ = 0) : + D.localizers.embed ((k : ℝ)+2) (Smooth.ofReal φ) = + D.pointPoissonOrder m hm he P k x₀ (D.localizers.embed (k : ℝ) (Smooth.ofReal (g.laplacian φ))) := by + let F := D.localizers.embed (k : ℝ) (Smooth.ofReal (g.laplacian φ)) + apply (D.pointPoissonOrder_unique m hm he k hk x₀ _ _ 0 + (D.poissonResidue m hm he P (D.localizers.lower (k : ℝ) 0 F)) ?_ ?_).1 + · rw [map_zero,sub_zero,D.completedLOrder_embed,complexL_ofReal,D.pointPoissonOrder_equation] + exact (add_sub_cancel_right F _).symm + · rw [D.pointEvaluation_embed hk,D.pointPoissonOrder_normalized m hm he P k hk] + simp only [Smooth.ofReal_apply,hn,Complex.ofReal_zero] + +lemma normalized_sobolev_laplacian_estimate (m : ℝ) (hm : 1 ≤ m) (he : ‖D.completedError m hm‖ < 1) + (P : D.localizers.ConstantProjection) (k : ℕ) + (hk : (Module.finrank ℝ (EC d) : ℝ) < 2*((k : ℝ)+2)) (x₀ : X) + (r : ℝ) (hr : r ≤ (k : ℝ)+2) (φ : SmoothRealFunction A) (hn : φ.value x₀ = 0) : + ‖D.localizers.embed r (Smooth.ofReal φ)‖ ≤ + ‖D.localizers.lower ((k : ℝ)+2) r‖ * + (‖D.pointPoissonOrder m hm he P k x₀‖ * + ‖D.localizers.embed (k : ℝ) (Smooth.ofReal (g.laplacian φ))‖) := by + have hv := D.pointPoissonOrder_laplacian m hm he P k hk x₀ φ hn + have hhigh : ‖D.localizers.embed ((k : ℝ)+2) (Smooth.ofReal φ)‖ ≤ + ‖D.pointPoissonOrder m hm he P k x₀‖ * + ‖D.localizers.embed (k : ℝ) (Smooth.ofReal (g.laplacian φ))‖ := by + rw [hv] + exact (D.pointPoissonOrder m hm he P k x₀).le_opNorm _ + calc + _ = ‖D.localizers.lower ((k : ℝ)+2) r (D.localizers.embed ((k : ℝ)+2) (Smooth.ofReal φ))‖ := + congrArg norm (D.localizers.lower_embed hr (Smooth.ofReal φ)).symm + _ ≤ ‖D.localizers.lower ((k : ℝ)+2) r‖ * ‖D.localizers.embed ((k : ℝ)+2) (Smooth.ofReal φ)‖ := + (D.localizers.lower ((k : ℝ)+2) r).le_opNorm _ + _ ≤ _ := mul_le_mul_of_nonneg_left hhigh (norm_nonneg (D.localizers.lower ((k : ℝ)+2) r)) + + + +theorem pathSobolevBounds (h : SemipositiveAnticanonicalMetric A) (x₀ : X) : + D.PathSobolevBounds h x₀ := by + obtain ⟨m,hm,he⟩ := D.exists_completedError_small + obtain ⟨P⟩ := D.localizers.constantProjection_exists + intro k + let j : ℕ := 2*k + Module.finrank ℝ (EC d) + have hj : (Module.finrank ℝ (EC d) : ℝ) < 2*((j : ℝ)+2) := by + dsimp [j] + push_cast + nlinarith [Nat.cast_nonneg (α := ℝ) k,Nat.cast_nonneg (α := ℝ) (Module.finrank ℝ (EC d))] + have hkj : (((2*k : ℕ) : ℝ)+2) ≤ ((j : ℝ)+2) := by + dsimp [j] + push_cast + linarith [Nat.cast_nonneg (α := ℝ) (Module.finrank ℝ (EC d))] + obtain ⟨C,hC⟩ := path_laplacian_sobolev_bound g h D.localizers (j : ℝ) + refine ⟨‖D.localizers.lower ((j : ℝ)+2) (((2*k : ℕ) : ℝ)+2)‖ * + (‖D.pointPoissonOrder m hm he P j x₀‖*C),fun t b φ ht hn hs => ?_⟩ + let s : PathSolution g h := ⟨t,b,φ,ht,hs⟩ + exact (D.normalized_sobolev_laplacian_estimate m hm he P j hj x₀ + (((2*k : ℕ) : ℝ)+2) hkj φ hn).trans + (mul_le_mul_of_nonneg_left + (mul_le_mul_of_nonneg_left (hC s) (norm_nonneg (D.pointPoissonOrder m hm he P j x₀))) + (norm_nonneg (D.localizers.lower ((j : ℝ)+2) (((2*k : ℕ) : ℝ)+2)))) +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/VariablePoisson.lean b/lean/OAI/Geometry/PrescribedPotential/VariablePoisson.lean new file mode 100644 index 0000000000000000000000000000000000000000..cf79f6108b81cb2000ca9be3c76e5acb12b59187 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/VariablePoisson.lean @@ -0,0 +1,265 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.SobolevParametrix + +namespace OAI + +/-! Variable Poisson. -/ + +section + + + +noncomputable section +open MeasureTheory FourierTransform TemperedDistribution LineDeriv +open scoped SchwartzMap BoundedContinuousFunction ComplexOrder MatrixOrder Real + +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + + +def secondH2Symbol (v w ξ : E) : ℂ := + (-(2 * Real.pi)^2 : ℂ) * (inner ℝ ξ v : ℂ) * (inner ℝ ξ w : ℂ) * + ((1 + ‖ξ‖^2)^(-1 : ℝ) : ℝ) + +lemma secondH2Symbol_temperate (v w : E) : + (secondH2Symbol v w).HasTemperateGrowth := by + unfold secondH2Symbol + fun_prop + +lemma secondH2Symbol_bound (v w ξ : E) : + ‖secondH2Symbol v w ξ‖ ≤ (2 * Real.pi)^2 * ‖v‖ * ‖w‖ := by + have hp : 0 < 1 + ‖ξ‖^2 := by positivity + have hv := abs_real_inner_le_norm ξ v + have hw := abs_real_inner_le_norm ξ w + have hmul := mul_le_mul hv hw (abs_nonneg _) (mul_nonneg (norm_nonneg _) (norm_nonneg _)) + have hle : |inner ℝ ξ v| * |inner ℝ ξ w| ≤ + (1 + ‖ξ‖^2) * (‖v‖ * ‖w‖) := by + have hnonneg : 0 ≤ ‖v‖ * ‖w‖ := mul_nonneg (norm_nonneg _) (norm_nonneg _) + nlinarith + simp only [secondH2Symbol, norm_mul, norm_neg, norm_pow, Complex.norm_ofNat, + Complex.norm_real, Real.norm_eq_abs, abs_of_pos Real.pi_pos, Real.rpow_neg_one, + abs_inv, abs_of_pos hp] + have hpi : 0 ≤ (2 * Real.pi)^2 := sq_nonneg _ + calc + _ = (2 * Real.pi)^2 * ((|inner ℝ ξ v| * |inner ℝ ξ w|) / (1 + ‖ξ‖^2)) := by ring + _ ≤ (2 * Real.pi)^2 * (‖v‖ * ‖w‖) := + mul_le_mul_of_nonneg_left ((div_le_iff₀ hp).mpr (by nlinarith [hle])) hpi + _ = _ := by ring + +def secondH2SymbolBCF (v w : E) : E →ᵇ ℂ := + BoundedContinuousFunction.ofNormedAddCommGroup (secondH2Symbol v w) + (secondH2Symbol_temperate v w).1.continuous + ((2 * Real.pi)^2 * ‖v‖ * ‖w‖) (secondH2Symbol_bound v w) + +lemma secondH2SymbolBCF_norm (v w : E) : + ‖secondH2SymbolBCF v w‖ ≤ (2 * Real.pi)^2 * ‖v‖ * ‖w‖ := + (BoundedContinuousFunction.norm_le (by positivity)).mpr (secondH2Symbol_bound v w) + +variable [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +def secondH2 (v w : E) : L2 E →L[ℂ] L2 E := multiplier (secondH2SymbolBCF v w) + +lemma secondH2_bound (v w : E) (u : L2 E) : + ‖secondH2 v w u‖ ≤ ((2 * Real.pi)^2 * ‖v‖ * ‖w‖) * ‖u‖ := + (multiplier_norm_le (secondH2SymbolBCF v w) u).trans + (mul_le_mul_of_nonneg_right (secondH2SymbolBCF_norm v w) (norm_nonneg _)) + +lemma secondH2_distribution (v w : E) (u : L2 E) : + (secondH2 v w u : 𝓢'(E, ℂ)) = ∂_{v} (∂_{w} (realize 2 u)) := by + rw [FrozenPoisson.second_deriv_multiplier] + change (multiplier (secondH2SymbolBCF v w) u : 𝓢'(E, ℂ)) = + fourierMultiplierCLM ℂ _ (besselPotential E ℂ (-2) (u : 𝓢'(E, ℂ))) + rw [multiplier_distribution _ (secondH2Symbol_temperate v w), besselPotential, + fourierMultiplierCLM_fourierMultiplierCLM_apply (by fun_prop) (by fun_prop)] + congr 2 + ext ξ + change secondH2Symbol v w ξ = _ + simp only [secondH2Symbol, Pi.mul_apply] + norm_num + ring + +variable {ι : Type*} [Fintype ι] + + +def perturbation (v : ι → E) (a : ι → ι → E →ᵇ ℂ) : L2 E →L[ℂ] L2 E := + ∑ i, ∑ j, multiply (a i j) ∘L secondH2 (v i) (v j) + +def perturbationBound (v : ι → E) (a : ι → ι → E →ᵇ ℂ) : ℝ := + ∑ i, ∑ j, ‖a i j‖ * ((2 * Real.pi)^2 * ‖v i‖ * ‖v j‖) + +omit [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma perturbationBound_nonneg (v : ι → E) (a : ι → ι → E →ᵇ ℂ) : + 0 ≤ perturbationBound v a := by + unfold perturbationBound + positivity + +lemma perturbation_bound (v : ι → E) (a : ι → ι → E →ᵇ ℂ) (u : L2 E) : + ‖perturbation v a u‖ ≤ perturbationBound v a * ‖u‖ := by + simp only [perturbation, _root_.sum_apply, ContinuousLinearMap.comp_apply, + perturbationBound, Finset.sum_mul] + apply (norm_sum_le _ _).trans + apply Finset.sum_le_sum + intro i _ + apply (norm_sum_le _ _).trans + apply Finset.sum_le_sum + intro j _ + calc + _ ≤ ‖a i j‖ * ‖secondH2 (v i) (v j) u‖ := multiply_norm_le _ _ + _ ≤ ‖a i j‖ * (((2 * Real.pi)^2 * ‖v i‖ * ‖v j‖) * ‖u‖) := + mul_le_mul_of_nonneg_left (secondH2_bound _ _ u) (norm_nonneg _) + _ = _ := by ring + +lemma perturbation_distribution (v : ι → E) (a : ι → ι → E →ᵇ ℂ) + (ha : ∀ i j, (a i j : E → ℂ).HasTemperateGrowth) (u : L2 E) : + (perturbation v a u : 𝓢'(E, ℂ)) = + ∑ i, ∑ j, smulLeftCLM ℂ (a i j) (∂_{v i} (∂_{v j} (realize 2 u))) := by + change Lp.toTemperedDistributionCLM ℂ volume 2 _ = _ + simp only [perturbation, _root_.sum_apply, ContinuousLinearMap.comp_apply, + map_sum] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + rw [Lp.toTemperedDistributionCLM_apply, multiply_distribution _ (ha i j), + secondH2_distribution] + +end SobolevChart + +namespace FrozenPoisson +open EllipticKernel SobolevChart +variable {n : ℕ} {ι : Type*} [Fintype ι] + +lemma perturbation_resolvent_bound (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (v : ι → EC n) (a : ι → ι → EC n →ᵇ ℂ) : + ‖perturbation v a ∘L hilbertResolvent H hH‖ ≤ + perturbationBound v a * ellipticBound H hH := by + apply ContinuousLinearMap.opNorm_le_bound (perturbation v a ∘L hilbertResolvent H hH) + (mul_nonneg (perturbationBound_nonneg v a) (ellipticBound_pos H hH).le) + intro u + calc + _ ≤ perturbationBound v a * ‖hilbertResolvent H hH u‖ := perturbation_bound _ _ _ + _ ≤ perturbationBound v a * (ellipticBound H hH * ‖u‖) := + mul_le_mul_of_nonneg_left (hilbertResolvent_bound H hH u) + (perturbationBound_nonneg v a) + _ = _ := by ring + + +def localResolvent (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (v : ι → EC n) (a : ι → ι → EC n →ᵇ ℂ) + (hsmall : perturbationBound v a * ellipticBound H hH < 1) : + L2 (EC n) →L[ℂ] L2 (EC n) := + hilbertResolvent H hH ∘L + (↑((Units.oneSub (perturbation v a ∘L hilbertResolvent H hH) + ((perturbation_resolvent_bound H hH v a).trans_lt hsmall))⁻¹) : + L2 (EC n) →L[ℂ] L2 (EC n)) + +lemma localResolvent_equation (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (v : ι → EC n) (a : ι → ι → EC n →ᵇ ℂ) + (hsmall : perturbationBound v a * ellipticBound H hH < 1) (f : L2 (EC n)) : + realize 2 (localResolvent H hH v a hsmall f) - + frozenDifferential H (realize 2 (localResolvent H hH v a hsmall f)) - + (perturbation v a (localResolvent H hH v a hsmall f) : 𝓢'(EC n, ℂ)) = + (f : 𝓢'(EC n, ℂ)) := by + let U := Units.oneSub (perturbation v a ∘L hilbertResolvent H hH) + ((perturbation_resolvent_bound H hH v a).trans_lt hsmall) + let f' := (↑U⁻¹ : L2 (EC n) →L[ℂ] L2 (EC n)) f + have he : f' - perturbation v a (hilbertResolvent H hH f') = f := by + change ((↑U : L2 (EC n) →L[ℂ] L2 (EC n)) * ↑U⁻¹) f = f + rw [Units.mul_inv, one_apply_eq_self] + have hr := (hilbert_frozen_inverse H hH 0 f').1 + norm_num at hr + change realize 2 (hilbertResolvent H hH f') - + frozenDifferential H (realize 2 (hilbertResolvent H hH f')) - + (perturbation v a (hilbertResolvent H hH f') : 𝓢'(EC n, ℂ)) = _ + rw [hr] + have hz (g : L2 (EC n)) : realize 0 g = (g : 𝓢'(EC n, ℂ)) := by simp [realize] + rw [hz] + simpa only [map_sub, Lp.toTemperedDistributionCLM_apply] using + congrArg (Lp.toTemperedDistributionCLM ℂ volume 2) he + +lemma fixed_for_perturbed (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (v : ι → EC n) (a : ι → ι → EC n →ᵇ ℂ) (u f : L2 (EC n)) + (hu : realize 2 u - frozenDifferential H (realize 2 u) - + (perturbation v a u : 𝓢'(EC n, ℂ)) = (f : 𝓢'(EC n, ℂ))) : + u = hilbertResolvent H hH (f + perturbation v a u) := by + apply realize_injective 2 + have hs : 2 = (0 : ℝ) + 2 := by norm_num + rw [hs, hilbertResolvent_realize H hH 0] + have he : shifted H (realize 2 u) = + realize 0 (f + perturbation v a u) := by + rw [shifted_eq_identity_sub H hH] + simpa [realize, map_add, sub_eq_iff_eq_add] using sub_eq_iff_eq_add.mp hu + rw [← he, resolvent_shifted H hH] + norm_num + +lemma perturbed_unique (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (v : ι → EC n) (a : ι → ι → EC n →ᵇ ℂ) + (hsmall : perturbationBound v a * ellipticBound H hH < 1) + (u w f : L2 (EC n)) + (hu : realize 2 u - frozenDifferential H (realize 2 u) - + (perturbation v a u : 𝓢'(EC n, ℂ)) = (f : 𝓢'(EC n, ℂ))) + (hw : realize 2 w - frozenDifferential H (realize 2 w) - + (perturbation v a w : 𝓢'(EC n, ℂ)) = (f : 𝓢'(EC n, ℂ))) : u = w := by + have huf := fixed_for_perturbed H hH v a u f hu + have hwf := fixed_for_perturbed H hH v a w f hw + have he : u - w = hilbertResolvent H hH (perturbation v a (u - w)) := by + rw [map_sub, map_sub] + rw [map_add] at huf hwf + calc + u - w = (hilbertResolvent H hH f + hilbertResolvent H hH (perturbation v a u)) - + (hilbertResolvent H hH f + hilbertResolvent H hH (perturbation v a w)) := + congrArg₂ (· - ·) huf hwf + _ = _ := by abel + have hn : ‖u - w‖ ≤ ellipticBound H hH * perturbationBound v a * ‖u - w‖ := by + calc + _ = ‖hilbertResolvent H hH (perturbation v a (u - w))‖ := congrArg norm he + _ ≤ _ := (hilbertResolvent_bound H hH _).trans + (by nlinarith [perturbation_bound v a (u - w), ellipticBound_pos H hH]) + have : ‖u - w‖ = 0 := by nlinarith [norm_nonneg (u - w)] + exact sub_eq_zero.mp (norm_eq_zero.mp this) + +lemma localResolvent_bound (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (v : ι → EC n) (a : ι → ι → EC n →ᵇ ℂ) + (hsmall : perturbationBound v a * ellipticBound H hH < 1) (f : L2 (EC n)) : + ‖localResolvent H hH v a hsmall f‖ ≤ + (ellipticBound H hH / (1 - perturbationBound v a * ellipticBound H hH)) * ‖f‖ := by + let u := localResolvent H hH v a hsmall f + have he := fixed_for_perturbed H hH v a u f (localResolvent_equation H hH v a hsmall f) + have hn : ‖u‖ ≤ ellipticBound H hH * + (‖f‖ + perturbationBound v a * ‖u‖) := by + calc + ‖u‖ = ‖hilbertResolvent H hH (f + perturbation v a u)‖ := congrArg norm he + _ ≤ ellipticBound H hH * ‖f + perturbation v a u‖ := hilbertResolvent_bound H hH _ + _ ≤ _ := mul_le_mul_of_nonneg_left + ((norm_add_le _ _).trans (add_le_add le_rfl (perturbation_bound v a u))) + (ellipticBound_pos H hH).le + have hp : 0 < 1 - perturbationBound v a * ellipticBound H hH := sub_pos.mpr hsmall + change ‖u‖ ≤ _ + rw [div_mul_eq_mul_div, le_div_iff₀ hp] + nlinarith + + + +theorem variable_sobolev_resolvent (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (v : ι → EC n) (a : ι → ι → EC n →ᵇ ℂ) + (ha : ∀ i j, (a i j : EC n → ℂ).HasTemperateGrowth) + (hsmall : perturbationBound v a * ellipticBound H hH < 1) (f : L2 (EC n)) : + ∃! u : L2 (EC n), + realize 2 u - frozenDifferential H (realize 2 u) - + ∑ i, ∑ j, smulLeftCLM ℂ (a i j) (∂_{v i} (∂_{v j} (realize 2 u))) = + (f : 𝓢'(EC n, ℂ)) := by + refine ⟨localResolvent H hH v a hsmall f, ?_, ?_⟩ + · dsimp only + rw [← perturbation_distribution v a ha] + exact localResolvent_equation H hH v a hsmall f + · intro u hu + rw [← perturbation_distribution v a ha] at hu + exact perturbed_unique H hH v a hsmall u _ f hu + (localResolvent_equation H hH v a hsmall f) + +end FrozenPoisson + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/VolumeDeterminantBounds.lean b/lean/OAI/Geometry/PrescribedPotential/VolumeDeterminantBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..efb370b81d82077f2466d3253e91b3c9899c487c --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/VolumeDeterminantBounds.lean @@ -0,0 +1,64 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.VolumeNormalization + +namespace OAI + +/-! Volume Determinant Bounds. -/ + +section + + + +noncomputable section +open Matrix Filter Set Topology +open scoped ComplexOrder Classical ContDiff +namespace Anticanonical.SourceSmooth +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +lemma volumePath_logRatio_bound [CompactSpace X] [Nonempty X] + (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) + {t b : ℝ} {φ : SmoothRealFunction A} (ht : t ∈ Icc 0 1) + (hp : g.PositivePotential φ) + (he : ∀ x, (g.logRatio (g.deform φ hp)).value x = t*(prescribedForcing g h).value x+b) + (x : X) : |(g.logRatio (g.deform φ hp)).value x| ≤ + 2*‖(⟨(prescribedForcing g h).value, (prescribedForcing g h).continuous⟩ : C(X,ℝ))‖ := by + let F : C(X,ℝ) := ⟨(prescribedForcing g h).value, (prescribedForcing g h).continuous⟩ + have hb := volumePath_scalar_bound g h ht ⟨hp,he⟩ + have hf : |t*(prescribedForcing g h).value x| ≤ ‖F‖ := by + rw [abs_mul, abs_of_nonneg ht.1] + apply (mul_le_mul_of_nonneg_right ht.2 (abs_nonneg _)).trans + simpa [F, Real.norm_eq_abs] using F.norm_coe_le_norm x + rw [he x] + exact (abs_add_le _ _).trans (by change _ ≤ 2*‖F‖; linarith) + + + +theorem volumePath_det_ratio_bounds [CompactSpace X] [Nonempty X] + (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) + {t b : ℝ} {φ : SmoothRealFunction A} (ht : t ∈ Icc 0 1) + (hp : g.PositivePotential φ) + (he : ∀ x, (g.logRatio (g.deform φ hp)).value x = t*(prescribedForcing g h).value x+b) + (i : Fin A.count) {z : Coordinates d} (hz : z ∈ (A.chart i).target) : + let M := ‖(⟨(prescribedForcing g h).value, (prescribedForcing g h).continuous⟩ : C(X,ℝ))‖; + Real.exp (-2*M) ≤ (g.matrix i z + φ.hessian i z).det.re / (g.matrix i z).det.re ∧ + (g.matrix i z + φ.hessian i z).det.re / (g.matrix i z).det.re ≤ Real.exp (2*M) := by + let M := ‖(⟨(prescribedForcing g h).value, (prescribedForcing g h).continuous⟩ : C(X,ℝ))‖ + let x := (A.chart i).symm z + have hi : x ∈ (A.chart i).source := (A.chart i).mapsTo_symm hz + have hl := volumePath_logRatio_bound g h ht hp he x + change |g.logRatioValue (g.deform φ hp) x| ≤ 2*M at hl + rw [g.logRatioValue_local _ i hi, (A.chart i).right_inv hz] at hl + have heq : (g.matrix i z + φ.hessian i z).det.re / (g.matrix i z).det.re = + Real.exp (Real.log ((g.deform φ hp).volumeCoefficient i z) - Real.log (g.volumeCoefficient i z)) := by + rw [Real.exp_sub, Real.exp_log ((g.deform φ hp).volumeCoefficient_pos i hz), + Real.exp_log (g.volumeCoefficient_pos i hz)] + rfl + rw [heq] + obtain ⟨hlo,hup⟩ := abs_le.mp hl + exact ⟨Real.exp_le_exp.mpr (by simpa only [neg_mul] using hlo), Real.exp_le_exp.mpr hup⟩ +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/VolumeNormalization.lean b/lean/OAI/Geometry/PrescribedPotential/VolumeNormalization.lean new file mode 100644 index 0000000000000000000000000000000000000000..73674643d308039b0af95587353f357c3730644a --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/VolumeNormalization.lean @@ -0,0 +1,100 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.DeterminantOrder +import OAI.Geometry.PrescribedPotential.GlobalSobolev +import OAI.Geometry.PrescribedPotential.VolumePath + +namespace OAI + +/-! Volume Normalization. -/ + +section + + + +noncomputable section +open Matrix Filter Set Topology +open scoped ComplexOrder Classical ContDiff +namespace Anticanonical.SourceSmooth +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +namespace SmoothRealFunction + +lemma negative_hessian_posSemidef_at_globalMax (φ : SmoothRealFunction A) {x : X} + (hx : ∀ y, φ.value y ≤ φ.value x) (i : Fin A.count) (hi : x ∈ (A.chart i).source) : + (-φ.hessian i (A.chart i x)).PosSemidef := by + have hs := (φ.smooth i).contDiffAt + ((A.chart i).open_target.mem_nhds ((A.chart i).mapsTo hi)) + have hm : IsLocalMax (φ.localExpression i) (A.chart i x) := by + apply Filter.Eventually.of_forall + intro z + simpa [localExpression, (A.chart i).left_inv hi] using hx ((A.chart i).symm z) + exact EllipticKernel.negative_potentialMatrix_posSemidef_at_localMax hs hm + +lemma hessian_posSemidef_at_globalMin (φ : SmoothRealFunction A) {x : X} + (hx : ∀ y, φ.value x ≤ φ.value y) (i : Fin A.count) (hi : x ∈ (A.chart i).source) : + (φ.hessian i (A.chart i x)).PosSemidef := by + have hm : ∀ y, (φ.realSMul (-1)).value y ≤ (φ.realSMul (-1)).value x := by + intro y + change -1 * φ.value y ≤ -1 * φ.value x + linarith [hx y] + have hp := (φ.realSMul (-1)).negative_hessian_posSemidef_at_globalMax hm i hi + simpa [hessian_realSMul] using hp +end SmoothRealFunction +namespace KaehlerMetric + +lemma logRatio_deform_nonpos_at_globalMax (g : KaehlerMetric A) (φ : SmoothRealFunction A) + (hp : g.PositivePotential φ) {x : X} (hx : ∀ y, φ.value y ≤ φ.value x) : + (g.logRatio (g.deform φ hp)).value x ≤ 0 := by + obtain ⟨i,hi⟩ := A.covers x + have hz := (A.chart i).mapsTo hi + have hd : (g.matrix i (A.chart i x) + φ.hessian i (A.chart i x)).det.re ≤ + (g.matrix i (A.chart i x)).det.re := by + apply MongeAmpere.det_re_mono (hp i _ hz) + simpa only [sub_add_cancel_left] using φ.negative_hessian_posSemidef_at_globalMax hx i hi + change g.logRatioValue (g.deform φ hp) x ≤ 0 + rw [g.logRatioValue_local _ i hi] + apply sub_nonpos.mpr + apply Real.log_le_log ((g.deform φ hp).volumeCoefficient_pos i hz) + exact hd + +lemma logRatio_deform_nonneg_at_globalMin (g : KaehlerMetric A) (φ : SmoothRealFunction A) + (hp : g.PositivePotential φ) {x : X} (hx : ∀ y, φ.value x ≤ φ.value y) : + 0 ≤ (g.logRatio (g.deform φ hp)).value x := by + obtain ⟨i,hi⟩ := A.covers x + have hz := (A.chart i).mapsTo hi + have hd := MongeAmpere.det_re_add_posSemidef _ _ (g.positive i _ hz) + (φ.hessian_posSemidef_at_globalMin hx i hi) + change 0 ≤ g.logRatioValue (g.deform φ hp) x + rw [g.logRatioValue_local _ i hi] + apply sub_nonneg.mpr + exact Real.log_le_log (g.volumeCoefficient_pos i hz) hd +end KaehlerMetric + + + +theorem volumePath_scalar_bound [CompactSpace X] [Nonempty X] + (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) + {t b : ℝ} {φ : SmoothRealFunction A} (ht : t ∈ Icc 0 1) + (hsol : SolvesVolumePath g h t φ b) : + |b| ≤ ‖(⟨(prescribedForcing g h).value, (prescribedForcing g h).continuous⟩ : C(X,ℝ))‖ := by + let F : C(X,ℝ) := ⟨(prescribedForcing g h).value, (prescribedForcing g h).continuous⟩ + obtain ⟨hp,he⟩ := hsol + have hbound (x : X) : |t * (prescribedForcing g h).value x| ≤ ‖F‖ := by + rw [abs_mul, abs_of_nonneg ht.1] + exact (mul_le_mul_of_nonneg_right ht.2 (abs_nonneg _)).trans (by + simpa [F, Real.norm_eq_abs] using F.norm_coe_le_norm x) + obtain ⟨x,_,hx⟩ := isCompact_univ.exists_isMaxOn univ_nonempty φ.continuous.continuousOn + obtain ⟨y,_,hy⟩ := isCompact_univ.exists_isMinOn univ_nonempty φ.continuous.continuousOn + have hmax := g.logRatio_deform_nonpos_at_globalMax φ hp (fun z => hx (mem_univ z)) + have hmin := g.logRatio_deform_nonneg_at_globalMin φ hp (fun z => hy (mem_univ z)) + rw [he x] at hmax + rw [he y] at hmin + obtain ⟨hlx,hux⟩ := abs_le.mp (hbound x) + obtain ⟨hly,huy⟩ := abs_le.mp (hbound y) + apply abs_le.mpr + constructor <;> linarith +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/VolumePath.lean b/lean/OAI/Geometry/PrescribedPotential/VolumePath.lean new file mode 100644 index 0000000000000000000000000000000000000000..02c10617b9abf92839e6ef0a60f2f3ee41ae0cea --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/VolumePath.lean @@ -0,0 +1,178 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.SourceTarget + +namespace OAI + +/-! Volume Path. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Classical +namespace Anticanonical.SourceSmooth +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +namespace KaehlerMetric + +lemma volumeCoefficient_pos (g : KaehlerMetric A) (i : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart i).target) : 0 < g.volumeCoefficient i z := + (Complex.pos_iff.mp (g.positive i z hz).det_pos).1 + +lemma volumeCoefficient_smooth (g : KaehlerMetric A) (i : Fin A.count) : + ContDiffOn ℝ ∞ (g.volumeCoefficient i) (A.chart i).target := by + apply Complex.reCLM.contDiff.comp_contDiffOn + simp only [Matrix.det_apply'] + apply ContDiffOn.sum + intro σ _ + apply contDiffOn_const.mul + apply contDiffOn_prod + intro j _ + exact contDiffOn_pi.mp (contDiffOn_pi.mp (g.smooth i) (σ j)) j + +lemma volumeCoefficient_compatibility (g : KaehlerMetric A) (i j : Fin A.count) {x : X} + (hi : x ∈ (A.chart i).source) (hj : x ∈ (A.chart j).source) : + g.volumeCoefficient i (A.chart i x) = ‖A.jacobian i j x‖^2 * + g.volumeCoefficient j (A.chart j x) := by + unfold volumeCoefficient + rw [g.compatibility i j x hi hj, Matrix.det_mul, Matrix.det_mul, Matrix.det_conjTranspose] + change ((starRingEnd ℂ) (A.jacobian i j x) * + (g.matrix j (A.chart j x)).det * A.jacobian i j x).re = _ + have he : (starRingEnd ℂ) (A.jacobian i j x) * + (g.matrix j (A.chart j x)).det * A.jacobian i j x = + ((‖A.jacobian i j x‖^2 : ℝ) : ℂ) * (g.matrix j (A.chart j x)).det := by + rw [show (starRingEnd ℂ) (A.jacobian i j x) * + (g.matrix j (A.chart j x)).det * A.jacobian i j x = + (A.jacobian i j x * (starRingEnd ℂ) (A.jacobian i j x)) * + (g.matrix j (A.chart j x)).det by ring, Complex.mul_conj, + Complex.normSq_eq_norm_sq] + rw [he, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, zero_mul, sub_zero] + +lemma logVolume_compatibility (g : KaehlerMetric A) (i j : Fin A.count) {x : X} + (hi : x ∈ (A.chart i).source) (hj : x ∈ (A.chart j).source) : + Real.log (g.volumeCoefficient i (A.chart i x)) = + Real.log (‖A.jacobian i j x‖^2) + Real.log (g.volumeCoefficient j (A.chart j x)) := by + rw [g.volumeCoefficient_compatibility i j hi hj] + apply Real.log_mul + · have hpos := g.volumeCoefficient_pos i ((A.chart i).mapsTo hi) + rw [g.volumeCoefficient_compatibility i j hi hj] at hpos + exact left_ne_zero_of_mul (ne_of_gt hpos) + · exact ne_of_gt (g.volumeCoefficient_pos j ((A.chart j).mapsTo hj)) + + +def logRatioValue (g₀ g : KaehlerMetric A) (x : X) : ℝ := + let i := (A.covers x).choose; + Real.log (g.volumeCoefficient i (A.chart i x)) - + Real.log (g₀.volumeCoefficient i (A.chart i x)) + +lemma logRatioValue_local (g₀ g : KaehlerMetric A) (i : Fin A.count) {x : X} + (hi : x ∈ (A.chart i).source) : + g₀.logRatioValue g x = Real.log (g.volumeCoefficient i (A.chart i x)) - + Real.log (g₀.volumeCoefficient i (A.chart i x)) := by + dsimp only [logRatioValue] + rw [g.logVolume_compatibility _ i (A.covers x).choose_spec hi, + g₀.logVolume_compatibility _ i (A.covers x).choose_spec hi] + ring + +def logRatio (g₀ g : KaehlerMetric A) : SmoothRealFunction A where + value := g₀.logRatioValue g + smooth i := by + have hg := (g.volumeCoefficient_smooth i).log + (fun z hz => ne_of_gt (g.volumeCoefficient_pos i hz)) + have h₀ := (g₀.volumeCoefficient_smooth i).log + (fun z hz => ne_of_gt (g₀.volumeCoefficient_pos i hz)) + apply (hg.sub h₀).congr + intro z hz + dsimp only [Function.comp_apply] + rw [g₀.logRatioValue_local g i ((A.chart i).mapsTo_symm hz), (A.chart i).right_inv hz] + +lemma logRatio_local (g₀ g : KaehlerMetric A) (i : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart i).target) : + (g₀.logRatio g).localExpression i z = + Real.log (g.volumeCoefficient i z) - Real.log (g₀.volumeCoefficient i z) := by + change g₀.logRatioValue g ((A.chart i).symm z) = _ + rw [g₀.logRatioValue_local g i ((A.chart i).mapsTo_symm hz), (A.chart i).right_inv hz] + +end KaehlerMetric + + + +def prescribedForcingValue (g₀ : KaehlerMetric A) + (h : SemipositiveAnticanonicalMetric A) (x : X) : ℝ := + let i := (A.covers x).choose; + -h.weight i (A.chart i x) - Real.log (g₀.volumeCoefficient i (A.chart i x)) + +lemma prescribedForcingValue_local (g₀ : KaehlerMetric A) + (h : SemipositiveAnticanonicalMetric A) (i : Fin A.count) {x : X} + (hi : x ∈ (A.chart i).source) : + prescribedForcingValue g₀ h x = + -h.weight i (A.chart i x) - Real.log (g₀.volumeCoefficient i (A.chart i x)) := by + dsimp only [prescribedForcingValue] + have hw := h.compatibility (A.covers x).choose i x (A.covers x).choose_spec hi + rw [g₀.logVolume_compatibility _ i (A.covers x).choose_spec hi] + linarith + +def prescribedForcing (g₀ : KaehlerMetric A) + (h : SemipositiveAnticanonicalMetric A) : SmoothRealFunction A where + value := prescribedForcingValue g₀ h + smooth i := by + apply ((h.smooth i).neg.sub ((g₀.volumeCoefficient_smooth i).log + (fun z hz => ne_of_gt (g₀.volumeCoefficient_pos i hz)))).congr + intro z hz + dsimp only [Function.comp_apply] + rw [prescribedForcingValue_local g₀ h i ((A.chart i).mapsTo_symm hz), (A.chart i).right_inv hz] + +lemma prescribedForcing_local (g₀ : KaehlerMetric A) + (h : SemipositiveAnticanonicalMetric A) (i : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart i).target) : + (prescribedForcing g₀ h).localExpression i z = + -h.weight i z - Real.log (g₀.volumeCoefficient i z) := by + change prescribedForcingValue g₀ h ((A.chart i).symm z) = _ + rw [prescribedForcingValue_local g₀ h i ((A.chart i).mapsTo_symm hz), (A.chart i).right_inv hz] + + + +def SolvesVolumePath (g₀ : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) + (t : ℝ) (φ : SmoothRealFunction A) (b : ℝ) : Prop := + ∃ hp : g₀.PositivePotential φ, ∀ x, + (g₀.logRatio (g₀.deform φ hp)).value x = t * (prescribedForcing g₀ h).value x + b + +lemma volumePath_zero (g₀ : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) : + SolvesVolumePath g₀ h 0 (SmoothRealFunction.constant 0) 0 := by + have hp : g₀.PositivePotential (SmoothRealFunction.constant 0) := by + intro i z hz + rw [SmoothRealFunction.hessian_constant, add_zero] + exact g₀.positive i z hz + refine ⟨hp, fun x => ?_⟩ + obtain ⟨i,hi⟩ := A.covers x + change g₀.logRatioValue (g₀.deform _ hp) x = _ + rw [g₀.logRatioValue_local _ i hi] + simp [KaehlerMetric.volumeCoefficient, KaehlerMetric.deform, + SmoothRealFunction.hessian_constant] + + + +lemma volumePath_one (P : A.ProjectiveEmbedding) (h : SemipositiveAnticanonicalMetric A) + (φ : SmoothRealFunction A) (b : ℝ) + (hsol : SolvesVolumePath (projectiveBackground P) h 1 φ b) : + HasPrescribedVolumePotential P h := by + obtain ⟨hp, heq⟩ := hsol + refine ⟨φ, Real.exp b, Real.exp_pos b, hp, fun i z hz => ?_⟩ + have hev := heq ((A.chart i).symm z) + change ((projectiveBackground P).logRatio ((projectiveBackground P).deform φ hp)).localExpression i z = + 1 * (prescribedForcing (projectiveBackground P) h).localExpression i z + b at hev + rw [KaehlerMetric.logRatio_local _ _ i hz, prescribedForcing_local _ _ i hz, one_mul] at hev + have hv : Real.log (((projectiveBackground P).deform φ hp).volumeCoefficient i z) = b - h.weight i z := by + linarith + have he := congrArg Real.exp hv + rw [Real.exp_log (((projectiveBackground P).deform φ hp).volumeCoefficient_pos i hz), + sub_eq_add_neg, Real.exp_add] at he + exact he + +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/WeakDerivativeLocalization.lean b/lean/OAI/Geometry/PrescribedPotential/WeakDerivativeLocalization.lean new file mode 100644 index 0000000000000000000000000000000000000000..6decd9072c626ac48eeb0bb4b352c882f873625f --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/WeakDerivativeLocalization.lean @@ -0,0 +1,75 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CircleRadialCalculus +import OAI.Geometry.PrescribedPotential.PatchCutoffs +import OAI.Geometry.PrescribedPotential.DerivativeLocalization +import OAI.Geometry.PrescribedPotential.LiteralWeakHessian + +namespace OAI + +/-! Weak Derivative Localization. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory TemperedDistribution LineDeriv +open scoped ContDiff SchwartzMap Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +lemma distribution_embed_forcing (s : ℝ) (p : ι) (f : Smooth A) : + D.localizers.distribution s p (D.localizers.embed s f) = + SchwartzMap.toTemperedDistributionCLM (EC d) ℂ volume (D.forcing p f) := D.localizers.distribution_embed s p f + +lemma completedLocalize_lower (k l : ℕ) (hlk : l ≤ k) (i : Fin A.count) (ρ : Smooth A) + (hρ : tsupport (ρ : X → ℂ) ⊆ (A.euclideanChart i).source) + (u : D.localizers.Sobolev (k : ℝ)) : + realize (l : ℝ) (D.completedLocalize (l : ℝ) i ρ hρ + (D.localizers.lower (k : ℝ) (l : ℝ) u)) = + realize (k : ℝ) (D.completedLocalize (k : ℝ) i ρ hρ u) := by + have hkl : (l : ℝ) ≤ (k : ℝ) := by exact_mod_cast hlk + have he : (fun u : D.localizers.Sobolev (k : ℝ) => realize (l : ℝ) + (D.completedLocalize (l : ℝ) i ρ hρ (D.localizers.lower (k : ℝ) (l : ℝ) u))) = + (fun u => realize (k : ℝ) (D.completedLocalize (k : ℝ) i ρ hρ u)) := by + apply (D.localizers.embed_dense (k : ℝ)).equalizer (by fun_prop) (by fun_prop) + funext f + dsimp only [Function.comp_apply] + simp only [D.localizers.lower_embed hkl,D.completedLocalize_embed,realize_schwartzCoord] + exact congr_fun he u + +lemma distribution_derivative (k : ℕ) (p : ι) (v : EC d) + (u : D.localizers.Sobolev ((k : ℝ)+1)) : + (∂_{v} (D.localizers.distribution ((k : ℝ)+1) p u) : 𝓢'(EC d,ℂ)) = + realize (k : ℝ) (D.completedLocalize (k : ℝ) (D.patch p).index + (D.localizedDerivative p v (D.localizers.weight p)) (D.derivativeWeight_support p v) + (D.localizers.lower ((k : ℝ)+1) (k : ℝ) u)) + + D.localizers.distribution (k : ℝ) p (D.completedDerivative k p v u) := by + have he : (fun u : D.localizers.Sobolev ((k : ℝ)+1) => + (∂_{v} (D.localizers.distribution ((k : ℝ)+1) p u) : 𝓢'(EC d,ℂ))) = + (fun u => realize (k : ℝ) (D.completedLocalize (k : ℝ) (D.patch p).index + (D.localizedDerivative p v (D.localizers.weight p)) (D.derivativeWeight_support p v) + (D.localizers.lower ((k : ℝ)+1) (k : ℝ) u)) + + D.localizers.distribution (k : ℝ) p (D.completedDerivative k p v u)) := by + apply (D.localizers.embed_dense ((k : ℝ)+1)).equalizer + ((lineDerivOpCLM ℂ 𝓢'(EC d,ℂ) v).continuous.comp + (D.localizers.distribution ((k : ℝ)+1) p).continuous) (by fun_prop) + funext f + dsimp only [Function.comp_apply] + rw [D.distribution_embed_forcing,D.localizers.lower_embed (by linarith : (k : ℝ) ≤ (k : ℝ)+1), + D.completedLocalize_embed,realize_schwartzCoord,D.completedDerivative_embed, + D.distribution_embed_forcing,lineDerivOpCLM_apply, + lineDerivOp_toTemperedDistributionCLM_eq,D.forcing_derivative,map_add] + exact congr_fun he u + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/WeakNonlinearCommutator.lean b/lean/OAI/Geometry/PrescribedPotential/WeakNonlinearCommutator.lean new file mode 100644 index 0000000000000000000000000000000000000000..5ee7e0498516a69b74ac3a0d336efeb17f62594e --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/WeakNonlinearCommutator.lean @@ -0,0 +1,129 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.NonlinearScale +import OAI.Geometry.PrescribedPotential.RealNonlinearCommutator + +namespace OAI + +/-! Weak Nonlinear Commutator. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) +local instance weakNonlinearCommutatorNormedAddCommGroup (s : ℝ) : NormedAddCommGroup (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedAddCommGroup +local instance weakNonlinearCommutatorNormedSpace (s : ℝ) : NormedSpace ℝ (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedSpace +local instance weakNonlinearCommutatorIsTopologicalAddGroup (s : ℝ) : IsTopologicalAddGroup (D.localizers.RealSobolev s) := + Submodule.isTopologicalAddGroup _ +local instance weakNonlinearCommutatorContinuousSMul (s : ℝ) : ContinuousSMul ℝ (D.localizers.RealSobolev s) := + SMulMemClass.continuousSMul _ + +lemma realNonlinearRemainder_lower (k l : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (hl : Module.finrank ℝ (EC d) < l) (hlk : l ≤ k) (p : ι) (v : EC d) + (u : D.localizers.RealSobolev ((k : ℝ)+2)) : + D.localizers.realLower (k : ℝ) (l : ℝ) (by exact_mod_cast hlk) + (D.realNonlinearRemainder k hk p v u) = + D.realNonlinearRemainder l hl p v + (D.localizers.realLower ((k : ℝ)+2) ((l : ℝ)+2) + (by exact_mod_cast Nat.add_le_add_right hlk 2) u) := by + have hst : (l : ℝ)+2 ≤ (k : ℝ)+2 := by exact_mod_cast Nat.add_le_add_right hlk 2 + have hkl : (l : ℝ) ≤ (k : ℝ) := by exact_mod_cast hlk + let L := D.localizers.realLower ((k : ℝ)+2) ((l : ℝ)+2) hst + let M := D.localizers.realLower (k : ℝ) (l : ℝ) hkl + have he : M ∘ D.realNonlinearRemainder k hk p v = + D.realNonlinearRemainder l hl p v ∘ L := by + apply (D.localizers.realEmbed_dense ((k : ℝ)+2)).equalizer + (M.continuous.comp (D.realNonlinearRemainder_continuous k hk p v)) + ((D.realNonlinearRemainder_continuous l hl p v).comp L.continuous) + funext f + dsimp only [Function.comp_apply] + have hh := congrArg M (D.real_commutator_core k hk p v f) + have hd := congrArg (fun T : D.localizers.RealSobolev ((k : ℝ)+2) →L[ℝ] + D.localizers.RealSobolev (l : ℝ) => T + (D.localizers.realEmbed ((k : ℝ)+2) (D.realLocalizedDerivative p v f))) + (D.realVolumeDerivative_lower k l hk hl hlk (D.localizers.realEmbed ((k : ℝ)+2) f)) + simp only [ContinuousLinearMap.comp_apply,Localizers.realLower_embed] at hd + change M (D.realVolumeDerivative k hk (D.localizers.realEmbed ((k : ℝ)+2) f) + (D.localizers.realEmbed ((k : ℝ)+2) (D.realLocalizedDerivative p v f))) = _ at hh + rw [← hd,D.real_commutator_core l hl p v f,map_add] at hh + dsimp only [M] at hh + rw [Localizers.realLower_embed] at hh + change _ = D.localizers.realEmbed (l : ℝ) + (D.realLocalizedDerivative p v (RealSmooth.ofReal (g.potentialDensity f.source))) + + M (D.realNonlinearRemainder k hk p v (D.localizers.realEmbed ((k : ℝ)+2) f)) at hh + have hh' := add_left_cancel hh + change M (D.realNonlinearRemainder k hk p v (D.localizers.realEmbed ((k : ℝ)+2) f)) = _ + rw [show L (D.localizers.realEmbed ((k : ℝ)+2) f) = D.localizers.realEmbed ((l : ℝ)+2) f + from D.localizers.realLower_embed hst f] + exact hh'.symm + exact congr_fun he u + +def potentialDerivative (k : ℕ) (p : ι) (v : EC d) : + D.localizers.RealSobolev (((k+1 : ℕ) : ℝ)+2) →L[ℝ] + D.localizers.RealSobolev ((k : ℝ)+2) := + D.localizers.realLower ((k+2 : ℕ) : ℝ) ((k : ℝ)+2) (by norm_num) ∘L + D.realCompletedDerivative (k+2) p v ∘L + D.localizers.realLower (((k+1 : ℕ) : ℝ)+2) (((k+2 : ℕ) : ℝ)+1) (by push_cast; linarith) + +lemma potentialDerivative_embed (k : ℕ) (p : ι) (v : EC d) (f : RealSmooth A) : + D.potentialDerivative k p v (D.localizers.realEmbed (((k+1 : ℕ) : ℝ)+2) f) = + D.localizers.realEmbed ((k : ℝ)+2) (D.realLocalizedDerivative p v f) := by + simp only [potentialDerivative,ContinuousLinearMap.comp_apply, + Localizers.realLower_embed,realCompletedDerivative_embed] + +def densityDerivative (k : ℕ) (p : ι) (v : EC d) : + D.localizers.RealSobolev ((k+1 : ℕ) : ℝ) →L[ℝ] D.localizers.RealSobolev (k : ℝ) := + D.realCompletedDerivative k p v ∘L + D.localizers.realLower ((k+1 : ℕ) : ℝ) ((k : ℝ)+1) (by norm_num) + +lemma densityDerivative_embed (k : ℕ) (p : ι) (v : EC d) (f : RealSmooth A) : + D.densityDerivative k p v (D.localizers.realEmbed ((k+1 : ℕ) : ℝ) f) = + D.localizers.realEmbed (k : ℝ) (D.realLocalizedDerivative p v f) := by + simp only [densityDerivative,ContinuousLinearMap.comp_apply, + Localizers.realLower_embed,realCompletedDerivative_embed] + + + +theorem nonlinear_commutator_weak (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (p : ι) (v : EC d) (u : D.localizers.RealSobolev (((k+1 : ℕ) : ℝ)+2)) : + D.realVolumeDerivative k hk + (D.localizers.realLower (((k+1 : ℕ) : ℝ)+2) ((k : ℝ)+2) (by push_cast; linarith) u) + (D.potentialDerivative k p v u) = + D.densityDerivative k p v (D.realVolume (k+1) (by omega) u) + + D.localizers.realLower ((k+1 : ℕ) : ℝ) (k : ℝ) (by push_cast; linarith) + (D.realNonlinearRemainder (k+1) (by omega) p v u) := by + let L := D.localizers.realLower (((k+1 : ℕ) : ℝ)+2) ((k : ℝ)+2) (by push_cast; linarith) + let M := D.localizers.realLower ((k+1 : ℕ) : ℝ) (k : ℝ) (by push_cast; linarith) + have he : (fun u => D.realVolumeDerivative k hk (L u) (D.potentialDerivative k p v u)) = + (fun u => D.densityDerivative k p v (D.realVolume (k+1) (by omega) u) + + M (D.realNonlinearRemainder (k+1) (by omega) p v u)) := by + apply (D.localizers.realEmbed_dense (((k+1 : ℕ) : ℝ)+2)).equalizer + (((D.realVolumeDerivative_continuous k hk).comp L.continuous).clm_apply + (D.potentialDerivative k p v).continuous) + (((D.densityDerivative k p v).continuous.comp (D.realVolume_continuous (k+1) (by omega))).add + (M.continuous.comp (D.realNonlinearRemainder_continuous (k+1) (by omega) p v))) + funext f + dsimp only [L,M,Function.comp_apply,Pi.add_apply] + rw [Localizers.realLower_embed,D.potentialDerivative_embed,D.realVolume_embed, + D.densityDerivative_embed,D.realNonlinearRemainder_lower (k+1) k (by omega) hk (by omega), + Localizers.realLower_embed] + exact D.real_commutator_core k hk p v f + exact congr_fun he u + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/WeakPositive.lean b/lean/OAI/Geometry/PrescribedPotential/WeakPositive.lean new file mode 100644 index 0000000000000000000000000000000000000000..dccb633e4fb6d085a75a96eadeaf687c94e1574c --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/WeakPositive.lean @@ -0,0 +1,112 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalHessian +import OAI.Geometry.PrescribedPotential.GlobalMetricEntries +import OAI.Geometry.PrescribedPotential.MatrixPositivity +import OAI.Geometry.PrescribedPotential.PatchCutoffs +import OAI.Geometry.PrescribedPotential.RealSobolev + +namespace OAI + +/-! Weak Positive. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff Classical ComplexOrder +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) +local instance weakPositiveNG (s : ℝ) : NormedAddCommGroup (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedAddCommGroup +local instance weakPositiveNS (s : ℝ) : NormedSpace ℝ (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedSpace +local instance weakPositiveTG (s : ℝ) : IsTopologicalAddGroup (D.localizers.RealSobolev s) := + Submodule.isTopologicalAddGroup _ +local instance weakPositiveCS (s : ℝ) : ContinuousSMul ℝ (D.localizers.RealSobolev s) := + SMulMemClass.continuousSMul _ + +def weakMatrix (k : ℕ) (u : D.localizers.RealSobolev ((k : ℝ)+2)) (p : ι) (x : X) : + Matrix (Fin d) (Fin d) ℂ := fun i j => D.metricEntry p i j x + + D.localizers.strong (k : ℝ) (D.completedHessian k p i j u.val) x + +lemma weakMatrix_continuous (k : ℕ) (p : ι) : + Continuous (fun z : D.localizers.RealSobolev ((k : ℝ)+2) × X => D.weakMatrix k z.1 p z.2) := by + apply continuous_pi + intro i + apply continuous_pi + intro j + apply ((D.metricEntry p i j).continuous.comp continuous_snd).add + have hc : Continuous (fun z : D.localizers.RealSobolev ((k : ℝ)+2) × X => + D.localizers.strong (k : ℝ) (D.completedHessian k p i j z.1.val)) := + (D.localizers.strong (k : ℝ)).continuous.comp ((D.completedHessian k p i j).continuous.comp + (continuous_subtype_val.comp continuous_fst)) + exact hc.eval continuous_snd + +lemma weakMatrix_embed (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (f : RealSmooth A) + (p : ι) {x : X} (hx : x ∈ tsupport (D.localizers.weight p : X → ℂ)) : + D.weakMatrix k (D.localizers.realEmbed ((k : ℝ)+2) f) p x = + g.matrix (D.patch p).index (A.chart (D.patch p).index x) + + f.source.hessian (D.patch p).index (A.chart (D.patch p).index x) := by + have hs : (Module.finrank ℝ (EC d) : ℝ) < 2*(k : ℝ) := by + have hh : (Module.finrank ℝ (EC d) : ℝ) < (k : ℝ) := by exact_mod_cast hk + linarith [Nat.cast_nonneg (α := ℝ) k] + ext i j + change D.metricEntry p i j x + D.localizers.strong (k : ℝ) + (D.completedHessian k p i j (D.localizers.embed ((k : ℝ)+2) f.val)) x = _ + rw [D.completedHessian_embed, D.localizers.strong_embed _ hs] + change D.metricEntry p i j x + D.localizedHessian p i j f.val x = _ + rw [D.metricEntry_apply p i j hx, ← f.ofReal_source, D.localizedHessian_source p i j f.source hx] + rfl + +lemma weakMatrix_hermitian (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (u : D.localizers.RealSobolev ((k : ℝ)+2)) (p : ι) {x : X} + (hx : x ∈ tsupport (D.localizers.weight p : X → ℂ)) : (D.weakMatrix k u p x).IsHermitian := by + have hc : Continuous (fun v : D.localizers.RealSobolev ((k : ℝ)+2) => D.weakMatrix k v p x) := + (D.weakMatrix_continuous k p).comp (continuous_id.prodMk continuous_const) + have he : (fun v : D.localizers.RealSobolev ((k : ℝ)+2) => (D.weakMatrix k v p x)ᴴ) = + (fun v => D.weakMatrix k v p x) := by + apply (D.localizers.realEmbed_dense ((k : ℝ)+2)).equalizer hc.matrix_conjTranspose hc + funext f + dsimp only [Function.comp_apply] + rw [D.weakMatrix_embed k hk f p hx] + have hs : A.chart (D.patch p).index x ∈ (A.chart (D.patch p).index).target := + (A.chart (D.patch p).index).mapsTo (by simpa using D.patch_source p hx) + exact (g.positive _ _ hs).isHermitian.add (f.source.hessian_hermitian _ hs) + exact congr_fun he u + +lemma weakMatrix_zero (k : ℕ) (p : ι) {x : X} + (hx : x ∈ tsupport (D.localizers.weight p : X → ℂ)) : + D.weakMatrix k 0 p x = g.matrix (D.patch p).index (A.chart (D.patch p).index x) := by + ext i j + change D.metricEntry p i j x + D.localizers.strong (k : ℝ) (D.completedHessian k p i j 0) x = _ + rw [map_zero, map_zero] + exact (add_zero _).trans (D.metricEntry_apply p i j hx) + +def WeakPositive (k : ℕ) (u : D.localizers.RealSobolev ((k : ℝ)+2)) : Prop := + ∀ p x, x ∈ tsupport (D.localizers.weight p : X → ℂ) → (D.weakMatrix k u p x).PosDef + +lemma weakPositive_nhds (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) : + ∀ᶠ u in 𝓝 (0 : D.localizers.RealSobolev ((k : ℝ)+2)), D.WeakPositive k u := by + apply Filter.eventually_all.mpr + intro p + apply CompactMatrixPositivity.eventually_posDef (isClosed_tsupport _).isCompact + (D.weakMatrix_continuous k p) + · intro u x hx + exact D.weakMatrix_hermitian k hk u p hx + · intro x hx + rw [D.weakMatrix_zero k p hx] + exact g.positive _ _ ((A.chart (D.patch p).index).mapsTo (by simpa using D.patch_source p hx)) + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/WirtingerCalculus.lean b/lean/OAI/Geometry/PrescribedPotential/WirtingerCalculus.lean new file mode 100644 index 0000000000000000000000000000000000000000..641569478caf6a64ff05e8cd51f6998a6d7c3472 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/WirtingerCalculus.lean @@ -0,0 +1,122 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.AnalyticSupport + +namespace OAI + +/-! Wirtinger Calculus. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff +namespace KaehlerCalculus +variable {n : ℕ} +abbrev V (n : ℕ) := Fin n → ℂ + +def wderiv (a : ℂ) (v : V n) (f : V n → ℂ) (z : V n) : ℂ := + (fderiv ℝ f z v + a * fderiv ℝ f z (Complex.I • v))/2 + +def dz (v : V n) (f : V n → ℂ) : V n → ℂ := wderiv (-Complex.I) v f +def dzbar (v : V n) (f : V n → ℂ) : V n → ℂ := wderiv Complex.I v f + +lemma wderiv_smooth {f : V n → ℂ} {z : V n} + (hf : ContDiffAt ℝ ∞ f z) (a : ℂ) (v : V n) : + ContDiffAt ℝ ∞ (wderiv a v f) z := by + have hd := hf.fderiv_right (m := ∞) (by simp) + exact ((hd.clm_apply contDiffAt_const).add + (contDiffAt_const.mul (hd.clm_apply contDiffAt_const))).div_const 2 + +lemma wderiv_congr {f g : V n → ℂ} {z : V n} (h : f =ᶠ[𝓝 z] g) (a : ℂ) (v : V n) : + wderiv a v f z = wderiv a v g z := by + simp only [wderiv,h.fderiv_eq] + +lemma wderiv_add {f g : V n → ℂ} {z : V n} + (hf : DifferentiableAt ℝ f z) (hg : DifferentiableAt ℝ g z) (a : ℂ) (v : V n) : + wderiv a v (fun y => f y+g y) z = wderiv a v f z+wderiv a v g z := by + simp only [wderiv,fderiv_fun_add hf hg,add_apply] + ring + +lemma wderiv_const_mul {f : V n → ℂ} {z : V n} + (hf : DifferentiableAt ℝ f z) (a c : ℂ) (v : V n) : + wderiv a v (fun y => c*f y) z = c*wderiv a v f z := by + simp only [wderiv,fderiv_const_mul hf,smul_apply,smul_eq_mul] + ring + +lemma wderiv_mul {f g : V n → ℂ} {z : V n} + (hf : DifferentiableAt ℝ f z) (hg : DifferentiableAt ℝ g z) (a : ℂ) (v : V n) : + wderiv a v (fun y => f y*g y) z = + wderiv a v f z*g z+f z*wderiv a v g z := by + simp only [wderiv,fderiv_fun_mul hf hg,add_apply, + smul_apply,smul_eq_mul] + ring + +lemma wderiv_const (a c : ℂ) (v z : V n) : wderiv a v (fun _ => c) z = 0 := by + simp [wderiv] + +lemma fderiv_wderiv {f : V n → ℂ} {z : V n} + (hf : ContDiffAt ℝ ∞ f z) (a : ℂ) (u v : V n) : + fderiv ℝ (wderiv a v f) z u = + (fderiv ℝ (fderiv ℝ f) z u v + + a*fderiv ℝ (fderiv ℝ f) z u (Complex.I • v))/2 := by + have hd (w : V n) : DifferentiableAt ℝ (fun y => fderiv ℝ f y w) z := + ((hf.fderiv_right (m := ∞) (by simp)).clm_apply contDiffAt_const).differentiableAt (by simp) + unfold wderiv + simp only [div_eq_mul_inv] + rw [fderiv_mul_const ((hd v).fun_add ((hd (Complex.I • v)).const_mul a)), + fderiv_fun_add (hd v) ((hd (Complex.I • v)).const_mul a),fderiv_const_mul (hd (Complex.I • v))] + simp only [smul_apply,add_apply,smul_eq_mul, + PotentialKaehler.fderiv_eval_derivative hf] + ring + +lemma wderiv_comm {f : V n → ℂ} {z : V n} + (hf : ContDiffAt ℝ ∞ f z) (a b : ℂ) (u v : V n) : + wderiv a u (wderiv b v f) z = wderiv b v (wderiv a u f) z := by + simp only [wderiv, fderiv_wderiv hf] + have hs := hf.isSymmSndFDerivAt (by simp only [minSmoothness_of_isRCLikeNormedField]; change ((2 : ℕ∞) : WithTop ℕ∞) ≤ ((⊤ : ℕ∞) : WithTop ℕ∞); exact WithTop.coe_le_coe.mpr le_top) + rw [hs u v, hs u (Complex.I • v), hs (Complex.I • u) v, + hs (Complex.I • u) (Complex.I • v)] + ring + +lemma fderiv_ofReal {f : V n → ℝ} {z : V n} + (hf : DifferentiableAt ℝ f z) (v : V n) : + fderiv ℝ (fun y => (f y : ℂ)) z v = (fderiv ℝ f z v : ℂ) := by + exact congrArg (fun T : V n →L[ℝ] ℂ => T v) + ((Complex.ofRealCLM.hasFDerivAt.comp z hf.hasFDerivAt).fderiv) + +lemma snd_fderiv_ofReal {f : V n → ℝ} {z : V n} + (hf : ContDiffAt ℝ ∞ f z) (u v : V n) : + fderiv ℝ (fderiv ℝ (fun y => (f y : ℂ))) z u v = + (fderiv ℝ (fderiv ℝ f) z u v : ℂ) := by + have hc : ContDiffAt ℝ ∞ (fun y => (f y : ℂ)) z := Complex.ofRealCLM.contDiff.contDiffAt.comp z hf + rw [← PotentialKaehler.fderiv_eval_derivative hc] + have he : (fun y => fderiv ℝ (fun y => (f y : ℂ)) y v) =ᶠ[𝓝 z] + (fun y => (fderiv ℝ f y v : ℂ)) := by + filter_upwards [(hf.of_le (show (1 : WithTop ℕ∞) ≤ ∞ by simp)).eventually (by decide)] with y hy + exact fderiv_ofReal (hy.differentiableAt (by simp)) v + rw [he.fderiv_eq, fderiv_ofReal + (((hf.fderiv_right (m := ∞) (by simp)).clm_apply contDiffAt_const).differentiableAt (by simp)), + PotentialKaehler.fderiv_eval_derivative hf] + +lemma dzbar_dz_real {f : V n → ℝ} {z : V n} + (hf : ContDiffAt ℝ ∞ f z) (u v : V n) : + dzbar u (dz v (fun y => (f y : ℂ))) z = + PotentialKaehler.hermitianPart (fderiv ℝ (fderiv ℝ f) z) u v := by + have hc : ContDiffAt ℝ ∞ (fun y => (f y : ℂ)) z := Complex.ofRealCLM.contDiff.contDiffAt.comp z hf + simp only [dzbar,dz,wderiv,fderiv_wderiv hc,snd_fderiv_ofReal hf] + apply Complex.ext <;> simp [PotentialKaehler.hermitianPart] <;> ring + +lemma potentialMatrix_eq_dzbar_dz {f : V n → ℝ} {z : V n} + (hf : ContDiffAt ℝ ∞ f z) (i j : Fin n) : + PotentialKaehler.potentialMatrix f z i j = + dzbar (Pi.single i 1) (dz (Pi.single j 1) (fun y => (f y : ℂ))) z := by + rw [dzbar_dz_real hf] + exact PotentialKaehler.hermitianPartMatrix_apply _ i j +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedPotential/WirtingerConjugate.lean b/lean/OAI/Geometry/PrescribedPotential/WirtingerConjugate.lean new file mode 100644 index 0000000000000000000000000000000000000000..a99677ecd6776906edaa620cb31c97c54a6b6471 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedPotential/WirtingerConjugate.lean @@ -0,0 +1,64 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.KaehlerClosedDerivatives +import OAI.Geometry.PrescribedPotential.MatrixWirtinger + +namespace OAI + +/-! Wirtinger Conjugate. -/ + +section + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace KaehlerCalculus +variable {n : ℕ} + +lemma fderiv_conj {f : V n → ℂ} {z : V n} (hf : DifferentiableAt ℝ f z) (v : V n) : + fderiv ℝ (fun y => star (f y)) z v = star (fderiv ℝ f z v) := by + exact congrArg (fun T : V n →L[ℝ] ℂ => T v) + ((Complex.conjCLE.toContinuousLinearMap.hasFDerivAt.comp z hf.hasFDerivAt).fderiv) + +lemma dzbar_conj {f : V n → ℂ} {z : V n} (hf : DifferentiableAt ℝ f z) (v : V n) : + dzbar v (fun y => star (f y)) z = star (dz v f z) := by + simp only [dzbar,dz,wderiv,fderiv_conj hf] + simp + +lemma dz_conj {f : V n → ℂ} {z : V n} (hf : DifferentiableAt ℝ f z) (v : V n) : + dz v (fun y => star (f y)) z = star (dzbar v f z) := by + simp only [dzbar,dz,wderiv,fderiv_conj hf] + simp + +lemma mderiv_bar_eq_conjTranspose {U : Set (V n)} (hU : IsOpen U) + {M : V n → Matrix (Fin n) (Fin n) ℂ} (hM : ContDiffOn ℝ ∞ M U) + (hh : ∀ y ∈ U, (M y).IsHermitian) {z : V n} (hz : z ∈ U) (v : V n) : + mderiv Complex.I v M z = (mderiv (-Complex.I) v M z)ᴴ := by + ext i j + have he : (fun y => M y i j) =ᶠ[𝓝 z] (fun y => star (M y j i)) := by + filter_upwards [hU.mem_nhds hz] with y hy + exact ((hh y hy).apply i j).symm + change dzbar v (fun y => M y i j) z = star (dz v (fun y => M y j i) z) + rw [show dzbar v (fun y => M y i j) z = dzbar v (fun y => star (M y j i)) z + from wderiv_congr he _ _] + exact dzbar_conj ((entry_smooth (hM.contDiffAt (hU.mem_nhds hz)) j i).differentiableAt (by simp)) v + +lemma closed_dzbar_symmetry {U : Set (V n)} (hU : IsOpen U) + {M : V n → Matrix (Fin n) (Fin n) ℂ} + (hM : ContDiffOn ℝ ∞ M U) (hh : ∀ y ∈ U, (M y).IsHermitian) + (hclosed : ∀ y ∈ U, ∀ u v w : V n, + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (M q) v w) y u + + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (M q) w u) y v + + fderiv ℝ (fun q => Anticanonical.ComplexAtlas.fundamentalForm (M q) u v) y w = 0) + {z : V n} (hz : z ∈ U) (i j k : Fin n) : + dzbar (e k) (fun y => M y i j) z = dzbar (e i) (fun y => M y k j) z := by + have h1 := congrFun (congrFun (mderiv_bar_eq_conjTranspose hU hM hh hz (e k)) i) j + have h2 := congrFun (congrFun (mderiv_bar_eq_conjTranspose hU hM hh hz (e i)) k) j + change dzbar (e k) (fun y => M y i j) z = star (dz (e k) (fun y => M y j i) z) at h1 + change dzbar (e i) (fun y => M y k j) z = star (dz (e i) (fun y => M y j k) z) at h2 + rw [h1,h2,closed_dz_symmetry hU hM hh hclosed hz j i k] +end KaehlerCalculus + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/ArrayWirtinger.lean b/lean/OAI/Geometry/PrescribedRicci/ArrayWirtinger.lean new file mode 100644 index 0000000000000000000000000000000000000000..fc1bad100e23fbed04d4d1dd2b9059ee9e451eb8 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/ArrayWirtinger.lean @@ -0,0 +1,88 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.CalabiTensorAlgebra +import OAI.Geometry.PrescribedRicci.ChernPairDifferential +import OAI.Geometry.PrescribedRicci.KahlerGradientEnergy +import OAI.Geometry.PrescribedRicci.MatrixWirtinger + +namespace OAI + +/-! Array Wirtinger. -/ + +noncomputable section +open Matrix Filter Set Topology +open scoped ContDiff ComplexOrder Kronecker +namespace Anticanonical.SourceSmooth.KaehlerMetric +open MongeAmpere +variable {d : ℕ} {n : Type*} + +lemma holArray_eq_holDerivative {f : Coordinates d → Matrix (Fin d) (Fin d) ℂ} + {z : Coordinates d} (hf : DifferentiableAt ℝ f z) (a : Fin d) : + holArray f z a = holDerivative f z a := by + ext i j + exact holDeriv_entry hf a i j + +lemma barArray_eq_barDerivative {f : Coordinates d → Matrix (Fin d) (Fin d) ℂ} + {z : Coordinates d} (hf : DifferentiableAt ℝ f z) (a : Fin d) : + barArray f z a = barDerivative f z a := by + ext i j + exact barDeriv_entry hf a i j + +lemma holArray_const (K : Matrix n n ℂ) (z : Coordinates d) (a : Fin d) : + holArray (fun _ => K) z a = 0 := by + ext i j + simp [holArray,holDeriv] + +lemma barArray_const (K : Matrix n n ℂ) (z : Coordinates d) (a : Fin d) : + barArray (fun _ => K) z a = 0 := by + ext i j + simp [barArray,barDeriv] + +lemma holArray_transpose (K : Coordinates d → Matrix n n ℂ) (z : Coordinates d) (a : Fin d) : + holArray (fun y => (K y).transpose) z a = (holArray K z a).transpose := rfl + +lemma barArray_transpose (K : Coordinates d → Matrix n n ℂ) (z : Coordinates d) (a : Fin d) : + barArray (fun y => (K y).transpose) z a = (barArray K z a).transpose := rfl + +lemma barArray_eq_adjoint_hol {K : Coordinates d → Matrix n n ℂ} {z : Coordinates d} + (hK : ∀ᶠ y in nhds z, (K y).IsHermitian) (a : Fin d) : + barArray K z a = (holArray K z a)ᴴ := by + ext i j + change barDeriv (fun y => K y i j) z a = star (holDeriv (fun y => K y j i) z a) + have he : (fun y => K y i j) =ᶠ[nhds z] (fun y => star (K y j i)) := by + filter_upwards [hK] with y hy + exact (Matrix.IsHermitian.ext_iff.mp hy i j).symm + rw [barDeriv_congr he,barDeriv_star] + +lemma holArray_tensor3 {L U V : Coordinates d → Matrix n n ℂ} {z : Coordinates d} + (hL : ∀ i j, DifferentiableAt ℝ (fun y => L y i j) z) + (hU : ∀ i j, DifferentiableAt ℝ (fun y => U y i j) z) + (hV : ∀ i j, DifferentiableAt ℝ (fun y => V y i j) z) (a : Fin d) : + holArray (fun y => tensor3 (L y) (U y) (V y)) z a = + tensor3 (holArray L z a) (U z) (V z)+ + tensor3 (L z) (holArray U z a) (V z)+tensor3 (L z) (U z) (holArray V z a) := by + ext i j + change holDeriv (fun y => L y i.1 j.1*(U y i.2.1 j.2.1*V y i.2.2 j.2.2)) z a = _ + rw [holDeriv_mul (hL _ _) ((hU _ _).fun_mul (hV _ _)), + holDeriv_mul (hU _ _) (hV _ _)] + simp only [Matrix.add_apply,tensor3_apply,holArray] + ring + +lemma barArray_tensor3 {L U V : Coordinates d → Matrix n n ℂ} {z : Coordinates d} + (hL : ∀ i j, DifferentiableAt ℝ (fun y => L y i j) z) + (hU : ∀ i j, DifferentiableAt ℝ (fun y => U y i j) z) + (hV : ∀ i j, DifferentiableAt ℝ (fun y => V y i j) z) (a : Fin d) : + barArray (fun y => tensor3 (L y) (U y) (V y)) z a = + tensor3 (barArray L z a) (U z) (V z)+ + tensor3 (L z) (barArray U z a) (V z)+tensor3 (L z) (U z) (barArray V z a) := by + ext i j + change barDeriv (fun y => L y i.1 j.1*(U y i.2.1 j.2.1*V y i.2.2 j.2.2)) z a = _ + rw [barDeriv_mul (hL _ _) ((hU _ _).fun_mul (hV _ _)), + barDeriv_mul (hU _ _) (hV _ _)] + simp only [Matrix.add_apply,tensor3_apply,barArray] + ring + +end Anticanonical.SourceSmooth.KaehlerMetric + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/BoundedSmoothPoisson.lean b/lean/OAI/Geometry/PrescribedRicci/BoundedSmoothPoisson.lean new file mode 100644 index 0000000000000000000000000000000000000000..1b89363232809b25a9b335b85c6219c9f57e71cf --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/BoundedSmoothPoisson.lean @@ -0,0 +1,60 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.BoundedPoisson +import OAI.Geometry.PrescribedPotential.ComplexOperator +import OAI.Geometry.PrescribedPotential.PatchCutoffs + +namespace OAI + +/-! Bounded Smooth Poisson. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory +open scoped SchwartzMap ContDiff Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +theorem exists_complex_poisson_bounded : ∃ C : ℝ, 0 ≤ C ∧ ∀ F : Smooth A, + ∃ (u : Smooth A) (c : ℂ), complexL g u = F + Smooth.const c ∧ + ‖D.localizers.embed 0 u‖ ≤ C * ‖D.localizers.embed 0 F‖ := by + obtain ⟨m, hm, he⟩ := D.exists_completedError_small + obtain ⟨P⟩ := D.localizers.constantProjection_exists + let T := D.resolventZero m hm he ∘L D.poissonInput m hm he P + refine ⟨‖T‖, norm_nonneg T, fun F => ?_⟩ + let w := D.poissonInput m hm he P (D.localizers.embed 0 F) + have hT := T.le_opNorm (D.localizers.embed 0 F) + let c := D.poissonResidue m hm he P (D.localizers.embed 0 F) + have hc : P.proj w = D.localizers.embed 0 (Smooth.const c) := + (P.coefficient_spec w).symm + have hw : w = D.localizers.embed 0 (-F - Smooth.const c) + + (m^2 : ℝ) • D.resolventZero m hm he w := by + have hh := D.poissonInput_equation m hm he P (D.localizers.embed 0 F) + change w = -D.localizers.embed 0 F - P.proj w + _ at hh + rw [hc] at hh + simpa only [map_sub, map_neg] using hh + obtain ⟨u, hu⟩ := D.allRegular_smooth (D.resolvent_feedback_regular m hm he w _ hw) + refine ⟨u, c, ?_, ?_⟩ + · have hs := (D.smooth_shifted_equation m hm he w u hu).trans hw + rw [← hu, ← map_smul, ← map_add] at hs + have hh := D.localizers.embed_injective 0 hs + apply sub_right_inj.mp + calc + (m^2 : ℝ) • u - complexL g u = -F - Smooth.const c + (m^2 : ℝ) • u := hh + _ = (m^2 : ℝ) • u - (F + Smooth.const c) := by abel + · rw [hu] + simpa only [T, ContinuousLinearMap.comp_apply, w] using hT + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/CalabiBochner.lean b/lean/OAI/Geometry/PrescribedRicci/CalabiBochner.lean new file mode 100644 index 0000000000000000000000000000000000000000..67b81b9cb5f52d52903d48aa52ecc72872dbc19b --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/CalabiBochner.lean @@ -0,0 +1,62 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.CalabiRough +import OAI.Geometry.PrescribedRicci.CalabiTensorAlgebra +import OAI.Geometry.PrescribedRicci.ContractedBochner +import OAI.Geometry.PrescribedRicci.MatrixWirtinger + +namespace OAI + +/-! Calabi Bochner. -/ + +section + + + +noncomputable section +open Matrix Set Filter Topology +open scoped ComplexOrder ContDiff MatrixOrder +namespace Anticanonical.SourceSmooth.KaehlerMetric +open MongeAmpere +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +local notation "TI" => TensorIndex (Fin d) + +def calabiEnergy (g : KaehlerMetric A) (q : Fin A.count) (z : Coordinates d) : ℝ := + (tensorEnergy (g.matrix q z)⁻¹ (g.calabiMetric q z) (barVector (g.calabiTensor q) z)).re+ + (tensorEnergy (g.matrix q z)⁻¹.transpose (g.calabiMetric q z) + (covHol (g.calabiConnection q) (g.calabiTensor q) z)).re + +def calabiRoughTerm (g : KaehlerMetric A) (q : Fin A.count) (z : Coordinates d) : TI → ℂ := + fun i => (-(g.matrix q z)⁻¹*holDerivative (g.curvatureRicci q) z i.1+ + ((g.matrix q z)⁻¹*g.curvatureRicci q z)*g.chernConnection q z i.1) i.2.1 i.2.2 + +lemma calabiEnergy_nonneg (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) : 0 ≤ g.calabiEnergy q z := by + unfold calabiEnergy + exact add_nonneg (tensorEnergy_nonneg (g.positive q z hz).inv.posSemidef + (g.calabiMetric_posDef q hz).posSemidef _) + (tensorEnergy_nonneg (g.positive q z hz).inv.transpose.posSemidef + (g.calabiMetric_posDef q hz).posSemidef _) + +lemma calabiNorm_laplacian (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) : + ((g.matrix q z)⁻¹*PotentialKaehler.potentialMatrix (g.calabiNorm q) z).trace.re = + g.calabiEnergy q z+ + 2*(hermPair (g.calabiMetric q z) (g.calabiTensor q z) (g.calabiRoughTerm q z)).re+ + (hermPair (g.calabiMetric q z) (g.calabiTensor q z) + ((tensorConnection (-((g.matrix q z)⁻¹*g.curvatureRicci q z)))*ᵥ + g.calabiTensor q z)).re := by + have h := contracted_bochners_identity (A.chart q).open_target hz + (fun y hy => g.calabiMetric_smooth q hy) (fun y hy => g.calabiConnection_smooth q hy) + (fun y hy => g.calabiTensor_smooth q hy) + (fun y hy => (g.calabiMetric_posDef q hy).isHermitian) + (fun y hy => g.calabiMetric_hol q hy) (fun y hy => g.calabiMetric_bar q hy) + (g.matrix q z)⁻¹ (g.positive q z hz).inv.isHermitian + rw [g.calabiTensor_rough q hz,g.calabiConnection_contracted_curvature q hz] at h + exact h + +end Anticanonical.SourceSmooth.KaehlerMetric + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/CalabiCutoffCalculus.lean b/lean/OAI/Geometry/PrescribedRicci/CalabiCutoffCalculus.lean new file mode 100644 index 0000000000000000000000000000000000000000..5cc73bf877c497557af260ac4981edb55f69dc42 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/CalabiCutoffCalculus.lean @@ -0,0 +1,114 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.CalabiTensorBounds +import OAI.Geometry.PrescribedRicci.KahlerGradientEnergy +import OAI.Geometry.PrescribedRicci.VolumePathRicci + +namespace OAI + +/-! Calabi Cutoff Calculus. -/ + +section + + +noncomputable section +open Matrix Set Filter Topology +open scoped ContDiff ComplexOrder MatrixOrder Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth.KaehlerMetric +open MongeAmpere +variable {d : ℕ} + +def localLap (H : Matrix (Fin d) (Fin d) ℂ) (f : Coordinates d → ℝ) + (z : Coordinates d) : ℝ := (H⁻¹*PotentialKaehler.potentialMatrix f z).trace.re + +lemma localLap_affine {f h : Coordinates d → ℝ} {z : Coordinates d} + (hf : ContDiffAt ℝ ∞ f z) (hh : ContDiffAt ℝ ∞ h z) + (H : Matrix (Fin d) (Fin d) ℂ) (a : ℝ) : + localLap H (fun y => f y+a*h y) z = localLap H f z+a*localLap H h z := by + have he := PotentialKaehler.potentialMatrix_affine hf hh a 0 + simp only [add_zero] at he + unfold localLap + rw [he,mul_add,Matrix.mul_smul,trace_add,trace_smul,Complex.add_re] + simp only [smul_eq_mul,Complex.mul_re,Complex.ofReal_re,Complex.ofReal_im,zero_mul,sub_zero] + +lemma localLap_abs_bound (H : Matrix (Fin d) (Fin d) ℂ) (f : Coordinates d → ℝ) + (z : Coordinates d) : |localLap H f z| ≤ + (d:ℝ)^2*‖H⁻¹‖*‖PotentialKaehler.potentialMatrix f z‖ := by + apply (Complex.abs_re_le_norm _).trans + exact (trace_entry_bound (fun i j => norm_entry_le_entrywise_sup_norm + (H⁻¹*PotentialKaehler.potentialMatrix f z) (i:=i) (j:=j))).trans + ((mul_le_mul_of_nonneg_left (matrix_norm_mul_le _ _) (by positivity)).trans_eq (by + simp only [Fintype.card_fin]; ring)) + +lemma gradientPair_norm_bound (H : Matrix (Fin d) (Fin d) ℂ) (p q : Fin d → ℂ) : + ‖gradientPair H p q‖ ≤ (d:ℝ)^2*‖H⁻¹‖*‖p‖*‖q‖ := by + unfold gradientPair + apply (norm_sum_le _ _).trans + calc + _ ≤ ∑ _j : Fin d, ∑ _i : Fin d, ‖H⁻¹‖*‖p‖*‖q‖ := by + apply Finset.sum_le_sum + intro j _ + apply (norm_sum_le _ _).trans + apply Finset.sum_le_sum + intro i _ + simp only [norm_mul,norm_star] + exact mul_le_mul (mul_le_mul (norm_entry_le_entrywise_sup_norm _) + (norm_le_pi_norm p i) (norm_nonneg _) (norm_nonneg _)) + (norm_le_pi_norm q j) (norm_nonneg _) (by positivity) + _ = _ := by simp only [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul]; ring + +lemma holRealDeriv_square {χ : Coordinates d → ℝ} {z : Coordinates d} + (hχ : DifferentiableAt ℝ χ z) : + holRealDeriv (fun y => χ y*χ y) z = (2*(χ z : ℂ)) • holRealDeriv χ z := by + funext a + rw [holRealDeriv_mul hχ hχ] + simp only [Pi.smul_apply,smul_eq_mul] + ring + +lemma norm_pi_sq_bound {ι : Type*} [Fintype ι] {v : ι → ℂ} {B : ℝ} + (hB : 0 ≤ B) (hv : ∀ i, ‖v i‖^2 ≤ B) : ‖v‖^2 ≤ B := by + have hn : ‖v‖ ≤ Real.sqrt B := (pi_norm_le_iff_of_nonneg (Real.sqrt_nonneg B)).mpr + (fun i => (Real.le_sqrt (norm_nonneg _) hB).mpr (hv i)) + exact ((sq_le_sq₀ (norm_nonneg _) (Real.sqrt_nonneg _)).mpr hn).trans_eq (Real.sq_sqrt hB) + +lemma square_absorb {a x y : ℝ} (_ha : 0 ≤ a) (hx : 0 ≤ x) (hy : 0 ≤ y) + (hb : a^2 ≤ x*y) : a ≤ (x+y)/2 := by + nlinarith [sq_nonneg (x-y)] + +lemma cutoff_cross_bound (H : Matrix (Fin d) (Fin d) ℂ) + {χ S : Coordinates d → ℝ} {z : Coordinates d} + (hχ : DifferentiableAt ℝ χ z) {M B K s E : ℝ} + (hM : 0 ≤ M) (hB : 0 ≤ B) (hK : 0 ≤ K) (hs : 0 ≤ s) (hE : 0 ≤ E) + (hI : ‖H⁻¹‖ ≤ M) (hDχ : ‖holRealDeriv χ z‖ ≤ B) + (hDS : ‖holRealDeriv S z‖^2 ≤ K*s*E) : + 2*(gradientPair H (holRealDeriv (fun y => χ y*χ y) z) (holRealDeriv S z)).re ≥ + -(χ z)^2*E/2-((4*(d:ℝ)^2*M*B)^2*K)*s/2 := by + let L := 4*(d:ℝ)^2*M*B + have hL : 0 ≤ L := by dsimp [L]; positivity + have hn : 2*‖gradientPair H (holRealDeriv (fun y => χ y*χ y) z) + (holRealDeriv S z)‖ ≤ L*|χ z| *‖holRealDeriv S z‖ := by + apply (mul_le_mul_of_nonneg_left (gradientPair_norm_bound _ _ _) (by norm_num)).trans + rw [holRealDeriv_square hχ,norm_smul,norm_mul] + norm_num only [Complex.norm_real,Real.norm_eq_abs,Complex.norm_ofNat] + calc + _ ≤ 2*((d:ℝ)^2*M*(2*|χ z| *B)*‖holRealDeriv S z‖) := by + gcongr + _ = _ := by dsimp [L]; ring + have hsq : (L*|χ z| *‖holRealDeriv S z‖)^2 ≤ ((χ z)^2*E)*(L^2*K*s) := by + have hh := mul_le_mul_of_nonneg_left hDS (show 0 ≤ L^2*(χ z)^2 by positivity) + calc + _ = L^2*(χ z)^2*‖holRealDeriv S z‖^2 := by rw [mul_pow,mul_pow,sq_abs] + _ ≤ L^2*(χ z)^2*(K*s*E) := hh + _ = _ := by ring + have ha := square_absorb (show 0 ≤ L*|χ z| *‖holRealDeriv S z‖ by positivity) + (show 0 ≤ (χ z)^2*E by positivity) (show 0 ≤ L^2*K*s by positivity) hsq + have hr := (abs_le.mp (Complex.abs_re_le_norm + (gradientPair H (holRealDeriv (fun y => χ y*χ y) z) (holRealDeriv S z)))).1 + change _ ≥ -(χ z)^2*E/2-(L^2*K)*s/2 + linarith + +end Anticanonical.SourceSmooth.KaehlerMetric + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/CalabiCutoffDifferential.lean b/lean/OAI/Geometry/PrescribedRicci/CalabiCutoffDifferential.lean new file mode 100644 index 0000000000000000000000000000000000000000..4bc7d3ca1ace67f0fe714489799409ad6dd24fa9 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/CalabiCutoffDifferential.lean @@ -0,0 +1,67 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.CalabiCutoffCalculus + +namespace OAI + +/-! Calabi Cutoff Differential. -/ + +section + + + +noncomputable section +open Matrix Set Filter Topology +open scoped ContDiff ComplexOrder MatrixOrder Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth.KaehlerMetric +variable {d : ℕ} + +def cutoffCoefficient (d : ℕ) (M B C K δ : ℝ) : ℝ := + (B^2*C+(d:ℝ)^2*M*B+(4*(d:ℝ)^2*M*B)^2*K/2+1)/δ + +lemma cutoffCoefficient_pos {M B C K δ : ℝ} (hM : 0 ≤ M) (hB : 0 ≤ B) + (hC : 0 ≤ C) (hK : 0 ≤ K) (hδ : 0 < δ) : + 0 < cutoffCoefficient d M B C K δ := by unfold cutoffCoefficient; positivity + +lemma cutoff_test_lower_bound (H : Matrix (Fin d) (Fin d) ℂ) (hH : H.PosDef) + {χ S T : Coordinates d → ℝ} {z : Coordinates d} + (hχ : ContDiffAt ℝ ∞ χ z) (hS : ContDiffAt ℝ ∞ S z) (hT : ContDiffAt ℝ ∞ T z) + {M B C K δ R E : ℝ} (hM : 0 ≤ M) (hB : 0 ≤ B) (hC : 0 ≤ C) + (hK : 0 ≤ K) (hδ : 0 < δ) (hE : 0 ≤ E) (hSz : 0 ≤ S z) + (hI : ‖H⁻¹‖ ≤ M) (hχB : |χ z| ≤ B) (hDχ : ‖holRealDeriv χ z‖ ≤ B) + (hDDχ : ‖PotentialKaehler.potentialMatrix (fun y => χ y*χ y) z‖ ≤ B) + (hDS : ‖holRealDeriv S z‖^2 ≤ K*S z*E) + (hLS : E-C*(S z+1) ≤ localLap H S z) + (hLT : δ*S z-R ≤ localLap H T z) : + S z-B^2*C-cutoffCoefficient d M B C K δ*R ≤ + localLap H (fun y => χ y*χ y*S y+cutoffCoefficient d M B C K δ*T y) z := by + let a := cutoffCoefficient d M B C K δ + have ha : 0 ≤ a := (cutoffCoefficient_pos hM hB hC hK hδ).le + have had : a*δ = B^2*C+(d:ℝ)^2*M*B+(4*(d:ℝ)^2*M*B)^2*K/2+1 := by + dsimp [a,cutoffCoefficient] + exact div_mul_cancel₀ _ hδ.ne' + have hc2 : (χ z)^2 ≤ B^2 := by + simpa only [sq_abs] using (sq_le_sq₀ (abs_nonneg _) hB).mpr hχB + have hχlap : -(d:ℝ)^2*M*B ≤ localLap H (fun y => χ y*χ y) z := by + have hh := (localLap_abs_bound H (fun y => χ y*χ y) z).trans + (mul_le_mul (mul_le_mul_of_nonneg_left hI (sq_nonneg _)) hDDχ (norm_nonneg _) (by positivity)) + convert! (abs_le.mp hh).1 using 1 + ring + have hcross := cutoff_cross_bound H (hχ.differentiableAt (by simp)) hM hB hK hSz hE hI hDχ hDS + have h1 := mul_le_mul_of_nonneg_left hLS (sq_nonneg (χ z)) + have h2 := mul_le_mul_of_nonneg_left hχlap hSz + have h3 := mul_le_mul_of_nonneg_left hLT ha + have h4 := mul_le_mul_of_nonneg_right hc2 (show 0 ≤ C*(S z+1) by positivity) + have h5 : 0 ≤ (χ z)^2*E := mul_nonneg (sq_nonneg _) hE + rw [localLap_affine ((hχ.mul hχ).mul hS) hT,localLap, + trace_hessian_product (hχ.mul hχ) hS H hH.isHermitian] + change S z-B^2*C-a*R ≤ χ z*χ z*localLap H S z+ + S z*localLap H (fun y => χ y*χ y) z+ + 2*(gradientPair H (holRealDeriv (fun y => χ y*χ y) z) (holRealDeriv S z)).re+a*localLap H T z + nlinarith [congrArg (fun t : ℝ => t*S z) had] + +end Anticanonical.SourceSmooth.KaehlerMetric + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/CalabiGradient.lean b/lean/OAI/Geometry/PrescribedRicci/CalabiGradient.lean new file mode 100644 index 0000000000000000000000000000000000000000..76c2e0ff17303bd9fd9fe882c28608cdcf86e1fd --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/CalabiGradient.lean @@ -0,0 +1,106 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.CalabiBochner +import OAI.Geometry.PrescribedRicci.CalabiLower +import OAI.Geometry.PrescribedRicci.CalabiTensorBounds +import OAI.Geometry.PrescribedRicci.TensorEnergyBounds + +namespace OAI + +/-! Calabi Gradient. -/ + +section + + + +noncomputable section +open Matrix Set Filter Topology +open scoped ComplexOrder ContDiff MatrixOrder Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth.KaehlerMetric +open MongeAmpere +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +local notation "TI" => TensorIndex (Fin d) + +lemma calabiNorm_hol (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (a : Fin d) : + holRealDeriv (g.calabiNorm q) z a = + hermPair (g.calabiMetric q z) (barVector (g.calabiTensor q) z a) (g.calabiTensor q z)+ + hermPair (g.calabiMetric q z) (g.calabiTensor q z) + (covHol (g.calabiConnection q) (g.calabiTensor q) z a) := by + rw [← holDeriv_ofReal ((g.calabiNorm_smooth q hz).differentiableAt (by simp))] + have he : (fun y => (g.calabiNorm q y : ℂ)) =ᶠ[nhds z] + fun y => hermPair (g.calabiMetric q y) (g.calabiTensor q y) (g.calabiTensor q y) := by + filter_upwards [(A.chart q).open_target.mem_nhds hz] with y hy + exact hermPair_self_ofReal (g.calabiMetric_posDef q hy).isHermitian _ + rw [holDeriv_congr he] + exact hermPair_hol_compatible (fun i j => (g.calabiMetric_smooth q hz i j).differentiableAt (by simp)) + (fun i => (g.calabiTensor_smooth q hz i).differentiableAt (by simp)) + (fun i => (g.calabiTensor_smooth q hz i).differentiableAt (by simp)) a (g.calabiMetric_hol q hz a) + +lemma calabiDerivative_sq_bound (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) {M : ℝ} (hM : 0 ≤ M) + (hH : ‖g.matrix q z‖ ≤ M) (hI : ‖(g.matrix q z)⁻¹‖ ≤ M) (a : Fin d) : + ‖barVector (g.calabiTensor q) z a‖^2+ + ‖covHol (g.calabiConnection q) (g.calabiTensor q) z a‖^2 ≤ M^4*g.calabiEnergy q z := by + have hi : ((g.matrix q z)⁻¹)⁻¹ = g.matrix q z := Matrix.inv_eq_right_inv + (Matrix.nonsing_inv_mul _ (isUnit_iff_ne_zero.mpr (g.positive q z hz).det_pos.ne')) + have hiT : ((g.matrix q z)⁻¹.transpose)⁻¹ = (g.matrix q z).transpose := by + rw [← Matrix.transpose_nonsing_inv,hi] + have hki := tensorMetric_inv_norm_bound (g.positive q z hz) hM hH hI + have h1 := vectorNorm_sq_le_tensorEnergy (g.positive q z hz).inv (g.calabiMetric_posDef q hz) + (barVector (g.calabiTensor q) z) a + have h2 := vectorNorm_sq_le_tensorEnergy (g.positive q z hz).inv.transpose (g.calabiMetric_posDef q hz) + (covHol (g.calabiConnection q) (g.calabiTensor q) z) a + rw [hi] at h1 + rw [hiT,Matrix.norm_transpose] at h2 + have hcoeff : ‖g.matrix q z‖*‖(g.calabiMetric q z)⁻¹‖ ≤ M^4 := by + exact (mul_le_mul hH hki (norm_nonneg _) hM).trans_eq (by ring) + have hp1 := tensorEnergy_nonneg (g.positive q z hz).inv.posSemidef + (g.calabiMetric_posDef q hz).posSemidef (barVector (g.calabiTensor q) z) + have hp2 := tensorEnergy_nonneg (g.positive q z hz).inv.transpose.posSemidef + (g.calabiMetric_posDef q hz).posSemidef + (covHol (g.calabiConnection q) (g.calabiTensor q) z) + apply (add_le_add (h1.trans (mul_le_mul_of_nonneg_right hcoeff hp1)) + (h2.trans (mul_le_mul_of_nonneg_right hcoeff hp2))).trans_eq + unfold calabiEnergy + ring + +lemma calabiNorm_gradient_sq_bound (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) {M : ℝ} (hM : 0 ≤ M) + (hH : ‖g.matrix q z‖ ≤ M) (hI : ‖(g.matrix q z)⁻¹‖ ≤ M) (a : Fin d) : + ‖holRealDeriv (g.calabiNorm q) z a‖^2 ≤ + 2*(Fintype.card TI : ℝ)^4*M^13*g.calabiNorm q z*g.calabiEnergy q z := by + let f := g.calabiTensor q z + let u := barVector (g.calabiTensor q) z a + let v := covHol (g.calabiConnection q) (g.calabiTensor q) z a + let N : ℝ := Fintype.card TI + have hK : ‖g.calabiMetric q z‖ ≤ M^3 := tensorMetric_norm_bound hM hH hI + have hS := g.calabiNorm_nonneg q hz + have hE := g.calabiEnergy_nonneg q hz + have hf := g.calabiTensor_sq_bound q hz hM hH hI + have hd := g.calabiDerivative_sq_bound q hz hM hH hI a + have hb : ‖holRealDeriv (g.calabiNorm q) z a‖ ≤ N^2*M^3*‖f‖*(‖u‖+‖v‖) := by + rw [g.calabiNorm_hol q hz] + apply (norm_add_le _ _).trans + have hp1 := (pair_norm_le (g.calabiMetric q z) u f).trans + (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right + (mul_le_mul_of_nonneg_left hK (sq_nonneg N)) (norm_nonneg u)) (norm_nonneg f)) + have hp2 := (pair_norm_le (g.calabiMetric q z) f v).trans + (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right + (mul_le_mul_of_nonneg_left hK (sq_nonneg N)) (norm_nonneg f)) (norm_nonneg v)) + exact (add_le_add hp1 hp2).trans_eq (by ring) + have hsq := (sq_le_sq₀ (norm_nonneg _) (show 0 ≤ N^2*M^3*‖f‖*(‖u‖+‖v‖) by positivity)).mpr hb + have huv : (‖u‖+‖v‖)^2 ≤ 2*(‖u‖^2+‖v‖^2) := by nlinarith [sq_nonneg (‖u‖-‖v‖)] + calc + _ ≤ (N^2*M^3*‖f‖*(‖u‖+‖v‖))^2 := hsq + _ = N^4*M^6*‖f‖^2*(‖u‖+‖v‖)^2 := by ring + _ ≤ N^4*M^6*(M^3*g.calabiNorm q z)*(2*(M^4*g.calabiEnergy q z)) := + mul_le_mul (mul_le_mul_of_nonneg_left hf (by positivity)) + (huv.trans (mul_le_mul_of_nonneg_left hd (by norm_num))) (sq_nonneg _) (by positivity) + _ = _ := by dsimp [N]; ring + +end Anticanonical.SourceSmooth.KaehlerMetric + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/CalabiLocalMaximum.lean b/lean/OAI/Geometry/PrescribedRicci/CalabiLocalMaximum.lean new file mode 100644 index 0000000000000000000000000000000000000000..d9cb6d7a2287f9f188ab15fce192ad1abeeaa639 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/CalabiLocalMaximum.lean @@ -0,0 +1,119 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.CalabiCutoffDifferential +import OAI.Geometry.PrescribedRicci.CalabiGradient +import OAI.Geometry.PrescribedRicci.CalabiLower +import OAI.Geometry.PrescribedRicci.CalabiTraceBound + +namespace OAI + +/-! Calabi Local Maximum. -/ + +section + + + +noncomputable section +open Matrix Set Filter Topology +open scoped ContDiff ComplexOrder MatrixOrder Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth.KaehlerMetric +open MongeAmpere +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +lemma flatTrace_nonneg (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) : 0 ≤ g.flatTrace q z := + (Complex.nonneg_iff.mp (g.positive q z hz).posSemidef.trace_nonneg).1 + +lemma compact_cutoff_derivative_bound {L : Set (Coordinates d)} (hL : IsCompact L) + (χ : Coordinates d → ℝ) (hχ : ContDiff ℝ ∞ χ) : + ∃ B : ℝ, 0 < B ∧ ∀ z ∈ L, |χ z| ≤ B ∧ ‖holRealDeriv χ z‖ ≤ B ∧ + ‖PotentialKaehler.potentialMatrix (fun y => χ y*χ y) z‖ ≤ B := by + let size : Coordinates d → ℝ := fun z => |χ z|+‖holRealDeriv χ z‖+ + ‖PotentialKaehler.potentialMatrix (fun y => χ y*χ y) z‖ + have hs : Continuous size := by + have hd : ContDiff ℝ ∞ (fun z => holRealDeriv χ z) := contDiff_iff_contDiffAt.mpr + (fun z => contDiffAt_pi.mpr (fun a => contDiffAt_holRealDeriv hχ.contDiffAt a)) + have hdd : ContDiff ℝ ∞ (fun z => PotentialKaehler.potentialMatrix (fun y => χ y*χ y) z) := + contDiff_iff_contDiffAt.mpr (fun z => PotentialKaehler.potentialMatrix_smooth (hχ.mul hχ).contDiffAt) + exact (hχ.continuous.abs.add hd.continuous.norm).add hdd.continuous.norm + obtain ⟨b,hb⟩ := hL.bddAbove_image hs.continuousOn + refine ⟨1+max 0 b,by positivity,?_⟩ + intro z hz + have hh := (hb (mem_image_of_mem _ hz)).trans (le_max_right (0:ℝ) b) + dsimp [size] at hh + refine ⟨?_,?_,?_⟩ <;> linarith [abs_nonneg (χ z),norm_nonneg (holRealDeriv χ z), + norm_nonneg (PotentialKaehler.potentialMatrix (fun y => χ y*χ y) z)] + + + +theorem calabi_bound_on_compact (q : Fin A.count) {L : Set (Coordinates d)} + (hL : IsCompact L) (hLt : L ⊆ (A.chart q).target) + (χ : Coordinates d → ℝ) (hχ : ContDiff ℝ ∞ χ) + (hχL : tsupport χ ⊆ interior L) {M R : ℝ} (hM : 0 ≤ M) (hR : 0 ≤ R) : + ∃ P : ℝ, 0 < P ∧ ∀ g : KaehlerMetric A, + (∀ z ∈ L, ‖g.matrix q z‖ ≤ M ∧ ‖(g.matrix q z)⁻¹‖ ≤ M ∧ + ‖g.curvatureRicci q z‖ ≤ R ∧ ∀ a, ‖holDerivative (g.curvatureRicci q) z a‖ ≤ R) → + ∀ z ∈ L, χ z = 1 → g.calabiNorm q z ≤ P := by + obtain ⟨C,hC,hCal⟩ := calabiNorm_lower_bound d M R hM hR + obtain ⟨B,hB,hcut⟩ := compact_cutoff_derivative_bound hL χ hχ + let K := 2*(Fintype.card (TensorIndex (Fin d)):ℝ)^4*M^13 + let δ := (1+(Fintype.card (TensorIndex (Fin d)):ℝ)^2*M^5)⁻¹ + have hK : 0 ≤ K := by dsimp [K]; positivity + have hδ : 0 < δ := by dsimp [δ]; positivity + let a := cutoffCoefficient d M B C K δ + have ha : 0 < a := cutoffCoefficient_pos hM hB.le hC.le hK hδ + let Q := B^2*C+a*((d:ℝ)*R) + have hQ : 0 ≤ Q := by dsimp [Q]; positivity + refine ⟨1+B^2*Q+a*((d:ℝ)*M),by positivity,?_⟩ + intro g hbounds z hz hzχ + let f : Coordinates d → ℝ := fun y => χ y*χ y*g.calabiNorm q y+a*g.flatTrace q y + have hfs (y : Coordinates d) (hy : y ∈ L) : ContDiffAt ℝ ∞ f y := + ((hχ.contDiffAt.mul hχ.contDiffAt).mul (g.calabiNorm_smooth q (hLt hy))).add + (contDiffAt_const.mul (g.flatTrace_smooth q (hLt hy))) + obtain ⟨x,hx,hmax⟩ := hL.exists_isMaxOn ⟨z,hz⟩ (fun y hy => (hfs y hy).continuousAt.continuousWithinAt) + have hzle : g.calabiNorm q z ≤ f z := by + change _ ≤ χ z*χ z*g.calabiNorm q z+a*g.flatTrace q z + rw [hzχ] + have ht := mul_nonneg ha.le (g.flatTrace_nonneg q (hLt hz)) + nlinarith + have hmaxbound : f x ≤ B^2*Q+a*((d:ℝ)*M) := by + have ht := g.flatTrace_bound q x (hbounds x hx).1 + by_cases h0 : χ x = 0 + · change χ x*χ x*g.calabiNorm q x+a*g.flatTrace q x ≤ _ + rw [h0] + have hh := mul_le_mul_of_nonneg_left ht ha.le + nlinarith [mul_nonneg (sq_nonneg B) hQ] + · have hn : L ∈ nhds x := mem_interior_iff_mem_nhds.mp (hχL (subset_tsupport _ h0)) + have hlocal : IsLocalMax f x := Filter.eventually_of_mem hn (fun y hy => hmax hy) + have hnonpos := EllipticKernel.trace_potentialMatrix_nonpos_at_localMax + (hfs x hx) hlocal (g.matrix q x) (g.positive q x (hLt hx)) + have hb := hbounds x hx + have hgrad : ‖holRealDeriv (g.calabiNorm q) x‖^2 ≤ K*g.calabiNorm q x*g.calabiEnergy q x := + norm_pi_sq_bound (by positivity [g.calabiNorm_nonneg q (hLt hx),g.calabiEnergy_nonneg q (hLt hx)]) + (fun j => g.calabiNorm_gradient_sq_bound q (hLt hx) hM hb.1 hb.2.1 j) + have hlow := cutoff_test_lower_bound (g.matrix q x) (g.positive q x (hLt hx)) + hχ.contDiffAt (g.calabiNorm_smooth q (hLt hx)) (g.flatTrace_smooth q (hLt hx)) + hM hB.le hC.le hK hδ (g.calabiEnergy_nonneg q (hLt hx)) (g.calabiNorm_nonneg q (hLt hx)) + hb.2.1 (hcut x hx).1 (hcut x hx).2.1 (hcut x hx).2.2 hgrad + (hCal g q x (hLt hx) hb.1 hb.2.1 hb.2.2.1 hb.2.2.2) + (g.flatTrace_lower_bound q (hLt hx) hM hb.1 hb.2.1 hb.2.2.1) + have hS : g.calabiNorm q x ≤ Q := by + change g.calabiNorm q x-B^2*C-a*((d:ℝ)*R) ≤ localLap (g.matrix q x) f x at hlow + change localLap (g.matrix q x) f x ≤ 0 at hnonpos + dsimp [Q] + linarith + have hcx : χ x*χ x ≤ B^2 := by + have hh := (sq_le_sq₀ (abs_nonneg (χ x)) hB.le).mpr (hcut x hx).1 + rw [sq_abs] at hh + simpa only [pow_two] using hh + have hh := mul_le_mul hcx hS (g.calabiNorm_nonneg q (hLt hx)) (sq_nonneg B) + have hhT := mul_le_mul_of_nonneg_left ht ha.le + change χ x*χ x*g.calabiNorm q x+a*g.flatTrace q x ≤ _ + linarith + exact (hzle.trans (hmax hz)).trans (hmaxbound.trans (by linarith)) + +end Anticanonical.SourceSmooth.KaehlerMetric + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/CalabiLower.lean b/lean/OAI/Geometry/PrescribedRicci/CalabiLower.lean new file mode 100644 index 0000000000000000000000000000000000000000..b84d38d5393ee489b762b094741ac29c2a0439ec --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/CalabiLower.lean @@ -0,0 +1,146 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.CalabiBochner +import OAI.Geometry.PrescribedRicci.CalabiTensorBounds +import OAI.Geometry.PrescribedRicci.HermitianCoercivity +import OAI.Geometry.PrescribedRicci.MatrixWirtinger + +namespace OAI + +/-! Calabi Lower. -/ + +section + + +noncomputable section +open Matrix Set Filter Topology +open scoped ComplexOrder ContDiff MatrixOrder Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth.KaehlerMetric +open MongeAmpere +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +local notation "TI" => TensorIndex (Fin d) + +lemma chernConnection_norm_le_calabiTensor (g : KaehlerMetric A) (q : Fin A.count) + (z : Coordinates d) (a : Fin d) : ‖g.chernConnection q z a‖ ≤ ‖g.calabiTensor q z‖ := by + apply matrix_norm_le_of_entries (norm_nonneg _) + intro i j + exact norm_le_pi_norm (g.calabiTensor q z) (a,i,j) + +lemma calabiTensor_sq_bound (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) {M : ℝ} (hM : 0 ≤ M) + (hH : ‖g.matrix q z‖ ≤ M) (hI : ‖(g.matrix q z)⁻¹‖ ≤ M) : + ‖g.calabiTensor q z‖^2 ≤ M^3*g.calabiNorm q z := by + exact (norm_sq_le_hermPair (g.calabiMetric_posDef q hz) _).trans + (mul_le_mul_of_nonneg_right (tensorMetric_inv_norm_bound (g.positive q z hz) hM hH hI) + (g.calabiNorm_nonneg q hz)) + +lemma calabiRoughTerm_bound (g : KaehlerMetric A) (q : Fin A.count) (z : Coordinates d) + {M R : ℝ} (hM : 0 ≤ M) (hR : 0 ≤ R) (hI : ‖(g.matrix q z)⁻¹‖ ≤ M) + (hRc : ‖g.curvatureRicci q z‖ ≤ R) + (hDR : ∀ a, ‖holDerivative (g.curvatureRicci q) z a‖ ≤ R) : + ‖g.calabiRoughTerm q z‖ ≤ (d:ℝ)*M*R+(d:ℝ)^2*M*R*‖g.calabiTensor q z‖ := by + have hn : (0:ℝ) ≤ d := Nat.cast_nonneg _ + have hb : ‖(g.matrix q z)⁻¹*g.curvatureRicci q z‖ ≤ (d:ℝ)*M*R := by + apply (matrix_norm_mul_le _ _).trans + simp only [Fintype.card_fin] + exact mul_le_mul (mul_le_mul_of_nonneg_left hI hn) hRc (norm_nonneg _) (by positivity) + apply (pi_norm_le_iff_of_nonneg (by positivity)).mpr + intro i + change ‖(-(g.matrix q z)⁻¹*holDerivative (g.curvatureRicci q) z i.1+ + ((g.matrix q z)⁻¹*g.curvatureRicci q z)*g.chernConnection q z i.1) i.2.1 i.2.2‖ ≤ _ + apply (norm_entry_le_entrywise_sup_norm _).trans + apply (norm_add_le _ _).trans + have h1 : ‖-(g.matrix q z)⁻¹*holDerivative (g.curvatureRicci q) z i.1‖ ≤ (d:ℝ)*M*R := by + rw [neg_mul,norm_neg] + apply (matrix_norm_mul_le _ _).trans + simp only [Fintype.card_fin] + exact mul_le_mul (mul_le_mul_of_nonneg_left hI hn) (hDR i.1) (norm_nonneg _) (by positivity) + have h2 : ‖((g.matrix q z)⁻¹*g.curvatureRicci q z)*g.chernConnection q z i.1‖ ≤ + (d:ℝ)^2*M*R*‖g.calabiTensor q z‖ := by + apply (matrix_norm_mul_le _ _).trans + simp only [Fintype.card_fin] + calc + _ ≤ (d:ℝ)*((d:ℝ)*M*R)*‖g.calabiTensor q z‖ := + mul_le_mul (mul_le_mul_of_nonneg_left hb hn) + (g.chernConnection_norm_le_calabiTensor q z i.1) (norm_nonneg _) (by positivity) + _ = _ := by ring + exact add_le_add h1 h2 + +lemma tensorCurvature_bound (g : KaehlerMetric A) (q : Fin A.count) (z : Coordinates d) + {M R : ℝ} (hM : 0 ≤ M) (_hR : 0 ≤ R) (hI : ‖(g.matrix q z)⁻¹‖ ≤ M) + (hRc : ‖g.curvatureRicci q z‖ ≤ R) : + ‖tensorConnection (-((g.matrix q z)⁻¹*g.curvatureRicci q z))‖ ≤ 3*(d:ℝ)*M*R := by + apply (tensorConnection_norm_le _).trans + rw [norm_neg] + have h := matrix_norm_mul_le (g.matrix q z)⁻¹ (g.curvatureRicci q z) + simp only [Fintype.card_fin] at h + calc + _ ≤ 3*((d:ℝ)*M*R) := mul_le_mul_of_nonneg_left + (h.trans (mul_le_mul (mul_le_mul_of_nonneg_left hI (Nat.cast_nonneg _)) hRc + (norm_nonneg _) (by positivity))) (by norm_num) + _ = _ := by ring + + + +theorem calabiNorm_lower_bound (d : ℕ) (M R : ℝ) (hM : 0 ≤ M) (hR : 0 ≤ R) : + ∃ C : ℝ, 0 < C ∧ ∀ {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + (g : KaehlerMetric A) (q : Fin A.count) (z : Coordinates d), z ∈ (A.chart q).target → + ‖g.matrix q z‖ ≤ M → ‖(g.matrix q z)⁻¹‖ ≤ M → ‖g.curvatureRicci q z‖ ≤ R → + (∀ a, ‖holDerivative (g.curvatureRicci q) z a‖ ≤ R) → + g.calabiEnergy q z-C*(g.calabiNorm q z+1) ≤ + ((g.matrix q z)⁻¹*PotentialKaehler.potentialMatrix (g.calabiNorm q) z).trace.re := by + let N : ℝ := Fintype.card (TensorIndex (Fin d)) + let A₀ := N^2*M^3*((d:ℝ)*M*R+(d:ℝ)^2*M*R) + let B₀ := N^2*M^3*(N*(3*(d:ℝ)*M*R)) + have hN : 0 ≤ N := Nat.cast_nonneg _ + have hA : 0 ≤ A₀ := by dsimp [A₀]; positivity + have hB : 0 ≤ B₀ := by dsimp [B₀]; positivity + refine ⟨1+2*A₀*(1+2*M^3)+B₀*M^3,by positivity,?_⟩ + intro X _ A g q z hz hH hI hRc hDR + let f := g.calabiTensor q z + let S := g.calabiNorm q z + have hS : 0 ≤ S := g.calabiNorm_nonneg q hz + have hf : ‖f‖^2 ≤ M^3*S := g.calabiTensor_sq_bound q hz hM hH hI + have hK : ‖g.calabiMetric q z‖ ≤ M^3 := tensorMetric_norm_bound hM hH hI + have hr : ‖g.calabiRoughTerm q z‖ ≤ ((d:ℝ)*M*R+(d:ℝ)^2*M*R)*(1+‖f‖) := by + apply (g.calabiRoughTerm_bound q z hM hR hI hRc hDR).trans + dsimp [f] + nlinarith [mul_nonneg (show 0 ≤ (d:ℝ)*M*R by positivity) (norm_nonneg (g.calabiTensor q z)), + show (0:ℝ) ≤ (d:ℝ)^2*M*R by positivity] + have hpair1 : ‖hermPair (g.calabiMetric q z) f (g.calabiRoughTerm q z)‖ ≤ A₀*(1+2*M^3*S) := by + apply (pair_norm_le _ _ _).trans + calc + _ ≤ N^2*M^3*‖f‖*(((d:ℝ)*M*R+(d:ℝ)^2*M*R)*(1+‖f‖)) := + mul_le_mul (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hK (sq_nonneg N)) + (norm_nonneg f)) hr (norm_nonneg _) (by positivity) + _ = A₀*(‖f‖+‖f‖^2) := by dsimp [A₀]; ring + _ ≤ A₀*(1+2*M^3*S) := mul_le_mul_of_nonneg_left (by nlinarith [sq_nonneg (‖f‖-1)]) hA + have ha : ‖tensorConnection (-((g.matrix q z)⁻¹*g.curvatureRicci q z))*ᵥ f‖ ≤ + N*(3*(d:ℝ)*M*R)*‖f‖ := by + exact (mulVec_norm_le _ _).trans (mul_le_mul_of_nonneg_right + (mul_le_mul_of_nonneg_left (g.tensorCurvature_bound q z hM hR hI hRc) hN) (norm_nonneg f)) + have hpair2 : ‖hermPair (g.calabiMetric q z) f + (tensorConnection (-((g.matrix q z)⁻¹*g.curvatureRicci q z))*ᵥ f)‖ ≤ B₀*M^3*S := by + apply (pair_norm_le _ _ _).trans + calc + _ ≤ N^2*M^3*‖f‖*(N*(3*(d:ℝ)*M*R)*‖f‖) := + mul_le_mul (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hK (sq_nonneg N)) + (norm_nonneg f)) ha (norm_nonneg _) (by positivity) + _ = B₀*‖f‖^2 := by dsimp [B₀]; ring + _ ≤ B₀*(M^3*S) := mul_le_mul_of_nonneg_left hf hB + _ = _ := by ring + rw [g.calabiNorm_laplacian q hz] + have hp1 := (abs_le.mp (Complex.abs_re_le_norm (hermPair (g.calabiMetric q z) f (g.calabiRoughTerm q z)))).1 + have hp2 := (abs_le.mp (Complex.abs_re_le_norm (hermPair (g.calabiMetric q z) f + (tensorConnection (-((g.matrix q z)⁻¹*g.curvatureRicci q z))*ᵥ f)))).1 + change g.calabiEnergy q z-(1+2*A₀*(1+2*M^3)+B₀*M^3)*(S+1) ≤ _ + change _ ≤ g.calabiEnergy q z+2*(hermPair (g.calabiMetric q z) f (g.calabiRoughTerm q z)).re+ + (hermPair (g.calabiMetric q z) f (tensorConnection (-((g.matrix q z)⁻¹*g.curvatureRicci q z))*ᵥ f)).re + nlinarith [mul_nonneg hA hS, mul_nonneg hB (pow_nonneg hM 3), + mul_nonneg hA (pow_nonneg hM 3)] + +end Anticanonical.SourceSmooth.KaehlerMetric + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/CalabiMetricC1.lean b/lean/OAI/Geometry/PrescribedRicci/CalabiMetricC1.lean new file mode 100644 index 0000000000000000000000000000000000000000..ccdb05449bf80d789624a91789e9ba17a4db2918 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/CalabiMetricC1.lean @@ -0,0 +1,129 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.ArrayWirtinger +import OAI.Geometry.PrescribedRicci.CalabiLower +import OAI.Geometry.PrescribedRicci.CalabiTensorBounds +import OAI.Geometry.PrescribedRicci.CompactPathBounds +import OAI.Geometry.PrescribedRicci.UniformCalabi +import OAI.Geometry.PrescribedPotential.VolumePath + +namespace OAI + +/-! Calabi Metric C1. -/ + +section + + + +noncomputable section +open Matrix Set Filter Topology +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth.KaehlerMetric +open MongeAmpere +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +local notation "Mat" => Matrix (Fin d) (Fin d) ℂ + +lemma real_direction_of_hol_bar (f : Coordinates d → Mat) (z : Coordinates d) (a : Fin d) : + fderiv ℝ f z (coordinateVector a) = holDerivative f z a+barDerivative f z a := by + ext i j + simp only [holDerivative,barDerivative,Matrix.add_apply,Matrix.smul_apply,Matrix.sub_apply,smul_eq_mul] + ring + +lemma imaginary_direction_of_hol_bar (f : Coordinates d → Mat) (z : Coordinates d) (a : Fin d) : + fderiv ℝ f z (Complex.I • coordinateVector a) = Complex.I • (holDerivative f z a-barDerivative f z a) := by + ext i j + simp only [holDerivative,barDerivative,Matrix.add_apply,Matrix.smul_apply,Matrix.sub_apply,smul_eq_mul] + ring_nf + simp + +lemma norm_real_linear_map_bound {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] + (L : Coordinates d →L[ℝ] F) {B : ℝ} (hB : 0 ≤ B) + (hre : ∀ a, ‖L (coordinateVector a)‖ ≤ B) + (him : ∀ a, ‖L (Complex.I • coordinateVector a)‖ ≤ B) : + ‖L‖ ≤ (2*(d:ℝ))*B := by + apply L.opNorm_le_bound (by positivity) + intro v + have he : v = ∑ j, ((v j).re • coordinateVector j + (v j).im • (Complex.I • coordinateVector j)) := by + ext k + simp only [coordinateVector,Finset.sum_apply,Pi.add_apply,Pi.smul_apply,smul_eq_mul, + Complex.real_smul,Pi.single_apply] + simp [mul_ite,Finset.sum_add_distrib] + calc + ‖L v‖ = ‖∑ j, ((v j).re • L (coordinateVector j)+(v j).im • L (Complex.I • coordinateVector j))‖ := by + conv_lhs => rw [he,map_sum] + simp only [map_add,map_smul] + _ ≤ ∑ j : Fin d, (‖(v j).re‖*‖L (coordinateVector j)‖+‖(v j).im‖*‖L (Complex.I • coordinateVector j)‖) := by + apply (norm_sum_le _ _).trans + apply Finset.sum_le_sum + intro j _ + simpa only [norm_smul] using norm_add_le ((v j).re • L (coordinateVector j)) ((v j).im • L (Complex.I • coordinateVector j)) + _ ≤ ∑ _j : Fin d, (‖v‖*B+‖v‖*B) := by + apply Finset.sum_le_sum + intro j _ + exact add_le_add + (mul_le_mul ((Complex.abs_re_le_norm _).trans (norm_le_pi_norm v j)) (hre j) (norm_nonneg _) (norm_nonneg _)) + (mul_le_mul ((Complex.abs_im_le_norm _).trans (norm_le_pi_norm v j)) (him j) (norm_nonneg _) (norm_nonneg _)) + _ = _ := by simp only [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul]; ring + +lemma metric_fderiv_bound (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) {M P : ℝ} (hM : 0 ≤ M) (hP : 0 ≤ P) + (hH : ‖g.matrix q z‖ ≤ M) (hI : ‖(g.matrix q z)⁻¹‖ ≤ M) + (hCal : g.calabiNorm q z ≤ P) (i j : Fin d) : + ‖fderiv ℝ (fun y => g.matrix q y i j) z‖ ≤ 4*(d:ℝ)^2*M*(1+M^3*P) := by + let B := 1+M^3*P + have hT2 := (g.calabiTensor_sq_bound q hz hM hH hI).trans + (mul_le_mul_of_nonneg_left hCal (pow_nonneg hM 3)) + have hT : ‖g.calabiTensor q z‖ ≤ B := by + dsimp [B] + nlinarith only [hT2,sq_nonneg (‖g.calabiTensor q z‖-1)] + have hg : DifferentiableAt ℝ (g.matrix q) z := + ((g.smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hz)).differentiableAt (by simp) + have hhol (a : Fin d) : ‖holDerivative (g.matrix q) z a‖ ≤ (d:ℝ)*M*B := by + rw [← holArray_eq_holDerivative hg,g.metric_hol_connection q hz] + apply (matrix_norm_mul_le _ _).trans + simp only [Fintype.card_fin] + exact mul_le_mul + (mul_le_mul_of_nonneg_left hH (Nat.cast_nonneg d)) + ((g.chernConnection_norm_le_calabiTensor q z a).trans hT) (norm_nonneg _) (by positivity) + have hbar (a : Fin d) : ‖barDerivative (g.matrix q) z a‖ ≤ (d:ℝ)*M*B := by + rw [← barArray_eq_barDerivative hg,barArray_eq_adjoint_hol, + Matrix.norm_conjTranspose,holArray_eq_holDerivative hg] + · exact hhol a + · filter_upwards [(A.chart q).open_target.mem_nhds hz] with y hy + exact (g.positive q y hy).isHermitian + have hB : 0 ≤ 2*(d:ℝ)*M*B := by dsimp [B]; positivity + have hre (a : Fin d) : ‖fderiv ℝ (fun y => g.matrix q y i j) z (coordinateVector a)‖ ≤ 2*(d:ℝ)*M*B := by + rw [fderiv_entry hg,real_direction_of_hol_bar] + exact (norm_entry_le_entrywise_sup_norm _).trans ((norm_add_le _ _).trans (by linarith only [hhol a,hbar a])) + have him (a : Fin d) : ‖fderiv ℝ (fun y => g.matrix q y i j) z (Complex.I • coordinateVector a)‖ ≤ 2*(d:ℝ)*M*B := by + rw [fderiv_entry hg,imaginary_direction_of_hol_bar] + apply (norm_entry_le_entrywise_sup_norm _).trans + rw [norm_smul,Complex.norm_I,one_mul] + exact (norm_sub_le _ _).trans (by linarith only [hhol a,hbar a]) + have hh := norm_real_linear_map_bound (fderiv ℝ (fun y => g.matrix q y i j) z) hB hre him + convert hh using 1 + dsimp only [B] + ring + +variable [T2Space X] [CompactSpace X] [ConnectedSpace X] + +theorem volumePath_metric_C1_on_compact (g : KaehlerMetric A) + (line : SemipositiveAnticanonicalMetric A) (hd : 2 ≤ d) (q : Fin A.count) + {K : Set (Coordinates d)} (hK : IsCompact K) (hKt : K ⊆ (A.chart q).target) : + ∃ P : ℝ, 0 < P ∧ ∀ (φ : SmoothRealFunction A) (hp : g.PositivePotential φ), + g.integral φ.value = 0 → ∀ (t b : ℝ), t ∈ Icc (0:ℝ) 1 → + (∀ x, (g.logRatio (g.deform φ hp)).value x = t*(prescribedForcing g line).value x+b) → + ∀ z ∈ K, ∀ i j : Fin d, ‖fderiv ℝ (fun y => (g.deform φ hp).matrix q y i j) z‖ ≤ P := by + obtain ⟨M,hM,hmetric⟩ := g.volumePath_metric_bounds_on_compact line hd q hK hKt + obtain ⟨P,hP,hcal⟩ := g.volumePath_calabi_bound_on_compact line hd q hK hKt + refine ⟨1+4*(d:ℝ)^2*M*(1+M^3*P),by positivity,?_⟩ + intro φ hp hm t b ht heq z hz i j + have hb := hmetric φ hp hm t b ht heq z hz + have hh := metric_fderiv_bound (g.deform φ hp) q (hKt hz) hM.le hP.le hb.1 hb.2 + (hcal φ hp hm t b ht heq z hz) i j + linarith only [hh] +end Anticanonical.SourceSmooth.KaehlerMetric + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/CalabiRough.lean b/lean/OAI/Geometry/PrescribedRicci/CalabiRough.lean new file mode 100644 index 0000000000000000000000000000000000000000..195413d1d2981bb19d4ba6444edeb0983ce71ce8 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/CalabiRough.lean @@ -0,0 +1,162 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.CalabiTensorAlgebra +import OAI.Geometry.PrescribedRicci.CalabiTensorMetric +import OAI.Geometry.PrescribedRicci.ChernBianchi +import OAI.Geometry.PrescribedRicci.ChernPairDifferential +import OAI.Geometry.PrescribedRicci.ChernRough +import OAI.Geometry.PrescribedRicci.KahlerGradientEnergy +import OAI.Geometry.PrescribedRicci.MatrixWirtinger +import OAI.Geometry.PrescribedRicci.MatrixWirtingerExtra + +namespace OAI + +/-! Calabi Rough. -/ + +section + + + +noncomputable section +open Matrix Filter Set Topology +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth.KaehlerMetric +open MongeAmpere +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +local notation "Mat" => Matrix (Fin d) (Fin d) ℂ +local notation "TI" => TensorIndex (Fin d) + +lemma holDeriv_neg (f : Coordinates d → ℂ) (z : Coordinates d) (a : Fin d) : + holDeriv (fun y => -f y) z a = -holDeriv f z a := by + unfold holDeriv + rw [fderiv_fun_neg] + simp only [_root_.neg_apply] + ring + +lemma barDeriv_neg (f : Coordinates d → ℂ) (z : Coordinates d) (a : Fin d) : + barDeriv (fun y => -f y) z a = -barDeriv f z a := by + unfold barDeriv + rw [fderiv_fun_neg] + simp only [_root_.neg_apply] + ring + +lemma calabiTensor_bar (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (b : Fin d) (i : TI) : + barVector (g.calabiTensor q) z b i = -g.chernCurvature q z b i.1 i.2.1 i.2.2 := by + change barDeriv (fun y => g.chernConnection q y i.1 i.2.1 i.2.2) z b = _ + rw [barDeriv_entry ((g.chernConnection_smooth q hz i.1).differentiableAt (by simp)), + g.chernConnection_bar q hz] + rfl + +lemma calabiTensor_covHol_bar (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (u b a k j : Fin d) : + covHol (g.calabiConnection q) (fun y => barVector (g.calabiTensor q) y b) z u (a,k,j) = + -(holDerivative (fun y => g.chernCurvature q y b a) z u+ + g.chernConnection q z u*g.chernCurvature q z b a- + g.chernCurvature q z b a*g.chernConnection q z u- + ∑ v, g.chernConnection q z u v a • g.chernCurvature q z b v) k j := by + have he : (fun y => barVector (g.calabiTensor q) y b (a,k,j)) =ᶠ[nhds z] + (fun y => -g.chernCurvature q y b a k j) := by + filter_upwards [(A.chart q).open_target.mem_nhds hz] with y hy + exact g.calabiTensor_bar q hy b (a,k,j) + change holDeriv (fun y => barVector (g.calabiTensor q) y b (a,k,j)) z u+ + (tensorConnection (g.chernConnection q z u)*ᵥ barVector (g.calabiTensor q) z b) (a,k,j) = _ + rw [holDeriv_congr he,holDeriv_neg, + holDeriv_entry ((g.chernCurvature_smooth q hz b a).differentiableAt (by simp)), + tensorConnection_mulVec] + simp_rw [g.calabiTensor_bar q hz] + simp only [Matrix.add_apply,Matrix.sub_apply,Matrix.mul_apply,Matrix.sum_apply, + Matrix.smul_apply,smul_eq_mul,mul_neg,Finset.sum_neg_distrib] + simp only [mul_comm] + ring + +lemma calabiTensor_rough (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) : + ∑ u, ∑ b, ((g.matrix q z)⁻¹ u b) • + covHol (g.calabiConnection q) (fun y => barVector (g.calabiTensor q) y b) z u = + fun i : TI => (-(g.matrix q z)⁻¹*holDerivative (g.curvatureRicci q) z i.1+ + ((g.matrix q z)⁻¹*g.curvatureRicci q z)*g.chernConnection q z i.1) i.2.1 i.2.2 := by + funext ⟨a,k,j⟩ + simp only [Finset.sum_apply,Pi.smul_apply,smul_eq_mul] + simp_rw [g.calabiTensor_covHol_bar q hz] + have he := congrArg (fun M : Mat => -(M k j)) (g.chernCurvature_rough q hz a) + simp only [Matrix.sum_apply,Matrix.smul_apply,Matrix.sub_apply,Matrix.add_apply, + Matrix.neg_apply,neg_mul,smul_eq_mul,mul_neg,Finset.sum_neg_distrib] at he ⊢ + convert he using 1 + ring + +lemma barDeriv_mul_const {f : Coordinates d → ℂ} {z : Coordinates d} + (hf : DifferentiableAt ℝ f z) (c : ℂ) (b : Fin d) : + barDeriv (fun y => f y*c) z b = barDeriv f z b*c := by + rw [barDeriv_mul hf (differentiableAt_const c)] + simp [barDeriv] + +lemma barDeriv_const_mul {f : Coordinates d → ℂ} {z : Coordinates d} + (hf : DifferentiableAt ℝ f z) (c : ℂ) (b : Fin d) : + barDeriv (fun y => c*f y) z b = c*barDeriv f z b := by + rw [barDeriv_mul (differentiableAt_const c) hf] + simp [barDeriv] + +lemma barArray_tensorConnection {G : Coordinates d → Mat} {z : Coordinates d} + (hG : DifferentiableAt ℝ G z) (b : Fin d) : + barArray (fun y => tensorConnection (G y)) z b = tensorConnection (barDerivative G z b) := by + have hg (i j : Fin d) := differentiableAt_pi.mp (differentiableAt_pi.mp hG i) j + have hconst (c : ℂ) : DifferentiableAt ℝ (fun _ : Coordinates d => c) z := + differentiableAt_const c + ext i j + let f1 : Coordinates d → ℂ := fun y => -G y j.1 i.1*((1:Mat) i.2.1 j.2.1*(1:Mat) i.2.2 j.2.2) + let f2 : Coordinates d → ℂ := fun y => (1:Mat) i.1 j.1*(G y i.2.1 j.2.1*(1:Mat) i.2.2 j.2.2) + let f3 : Coordinates d → ℂ := fun y => (1:Mat) i.1 j.1*((1:Mat) i.2.1 j.2.1*(-G y j.2.2 i.2.2)) + have h1 : DifferentiableAt ℝ f1 z := (hg _ _).neg.fun_mul (hconst _) + have h2 : DifferentiableAt ℝ f2 z := (hconst _).fun_mul ((hg _ _).fun_mul (hconst _)) + have h3 : DifferentiableAt ℝ f3 z := (hconst _).fun_mul ((hconst _).fun_mul (hg _ _).neg) + have h12 : DifferentiableAt ℝ (fun y => f1 y+f2 y) z := h1.fun_add h2 + change barDeriv (fun y => f1 y+f2 y+f3 y) z b = _ + rw [barDeriv_add h12 h3,barDeriv_add h1 h2] + dsimp only [f1,f2,f3] + rw [barDeriv_mul_const (f := fun y => -G y j.1 i.1) (hg _ _).neg, + barDeriv_const_mul (f := fun y => G y i.2.1 j.2.1*(1:Mat) i.2.2 j.2.2) + ((hg _ _).fun_mul (hconst _)), + barDeriv_mul_const (f := fun y => G y i.2.1 j.2.1) (hg _ _), + barDeriv_const_mul (f := fun y => (1:Mat) i.2.1 j.2.1*(-G y j.2.2 i.2.2)) + ((hconst _).fun_mul (hg _ _).neg), + barDeriv_const_mul (f := fun y => -G y j.2.2 i.2.2) (hg _ _).neg] + simp only [barDeriv_neg,barDeriv_entry hG,Matrix.add_apply,tensorConnection,tensor3_apply, + Matrix.transpose_apply,Matrix.neg_apply] + +lemma tensorConnection_sum_smul {ι : Type*} [Fintype ι] (c : ι → ℂ) (M : ι → Mat) : + tensorConnection (∑ i, c i • M i) = ∑ i, c i • tensorConnection (M i) := by + ext a b + simp only [tensorConnection,tensor3_apply,Matrix.transpose_apply,Matrix.neg_apply, + Matrix.add_apply,Matrix.sum_apply,Matrix.smul_apply,smul_eq_mul, + Finset.mul_sum,Finset.sum_mul,mul_add,neg_mul,mul_neg, + ← Finset.sum_neg_distrib,← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro i _ + ring + +lemma calabiConnection_contracted_curvature (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) : + ∑ a, ∑ b, ((g.matrix q z)⁻¹ a b) • + barArray (fun y => g.calabiConnection q y a) z b = + tensorConnection (-((g.matrix q z)⁻¹*g.curvatureRicci q z)) := by + have hb (a b : Fin d) : barArray (fun y => g.calabiConnection q y a) z b = + tensorConnection (-g.chernCurvature q z b a) := by + exact (barArray_tensorConnection + ((g.chernConnection_smooth q hz a).differentiableAt (by simp)) b).trans + (congrArg tensorConnection (g.chernConnection_bar q hz a b)) + simp_rw [hb] + have hs := tensorConnection_sum_smul + (fun ab : Fin d × Fin d => (g.matrix q z)⁻¹ ab.1 ab.2) + (fun ab : Fin d × Fin d => -g.chernCurvature q z ab.2 ab.1) + simp only [Fintype.sum_prod_type] at hs + rw [← hs] + congr 1 + simp only [smul_neg,Finset.sum_neg_distrib, + g.chernCurvature_contraction q hz] + +end Anticanonical.SourceSmooth.KaehlerMetric + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/CalabiTensorAlgebra.lean b/lean/OAI/Geometry/PrescribedRicci/CalabiTensorAlgebra.lean new file mode 100644 index 0000000000000000000000000000000000000000..eb202ee197afc340c54a65bdd0bd825a9b51d241 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/CalabiTensorAlgebra.lean @@ -0,0 +1,77 @@ +import Mathlib + +namespace OAI + +/-! Calabi Tensor Algebra. -/ + +noncomputable section +open Matrix +open scoped Kronecker ComplexOrder MatrixOrder +namespace MongeAmpere +variable {n : Type*} [Fintype n] [DecidableEq n] + +abbrev TensorIndex (n : Type*) := n × (n × n) + +def tensor3 (L U V : Matrix n n ℂ) : Matrix (TensorIndex n) (TensorIndex n) ℂ := + L ⊗ₖ (U ⊗ₖ V) + +omit [Fintype n] [DecidableEq n] in +lemma tensor3_apply (L U V : Matrix n n ℂ) (i j : TensorIndex n) : + tensor3 L U V i j = L i.1 j.1*(U i.2.1 j.2.1*V i.2.2 j.2.2) := rfl + +omit [DecidableEq n] in +lemma tensor3_mul (L U V L' U' V' : Matrix n n ℂ) : + tensor3 L U V*tensor3 L' U' V' = tensor3 (L*L') (U*U') (V*V') := by + simp only [tensor3,← Matrix.mul_kronecker_mul] + +omit [Fintype n] in +lemma tensor3_one : tensor3 (1 : Matrix n n ℂ) 1 1 = 1 := by + simp only [tensor3,Matrix.one_kronecker_one] + +lemma tensor3_mulVec_left (L : Matrix n n ℂ) (T : TensorIndex n → ℂ) (a k j : n) : + (tensor3 L 1 1*ᵥ T) (a,k,j) = ∑ v, L a v*T (v,k,j) := by + classical + simp [Matrix.mulVec,dotProduct,Fintype.sum_prod_type,tensor3_apply, + Matrix.one_apply,mul_ite,ite_mul] + +lemma tensor3_mulVec_middle (U : Matrix n n ℂ) (T : TensorIndex n → ℂ) (a k j : n) : + (tensor3 1 U 1*ᵥ T) (a,k,j) = ∑ v, U k v*T (a,v,j) := by + classical + simp [Matrix.mulVec,dotProduct,Fintype.sum_prod_type,tensor3_apply, + Matrix.one_apply,mul_ite,ite_mul] + +lemma tensor3_mulVec_right (V : Matrix n n ℂ) (T : TensorIndex n → ℂ) (a k j : n) : + (tensor3 1 1 V*ᵥ T) (a,k,j) = ∑ v, V j v*T (a,k,v) := by + classical + simp [Matrix.mulVec,dotProduct,Fintype.sum_prod_type,tensor3_apply, + Matrix.one_apply,mul_ite,ite_mul] + +def tensorMetric (H : Matrix n n ℂ) : Matrix (TensorIndex n) (TensorIndex n) ℂ := + tensor3 H⁻¹.transpose H H⁻¹.transpose + +def tensorConnection (G : Matrix n n ℂ) : Matrix (TensorIndex n) (TensorIndex n) ℂ := + tensor3 (-G.transpose) 1 1+tensor3 1 G 1+tensor3 1 1 (-G.transpose) + +lemma tensorMetric_posDef {H : Matrix n n ℂ} (hH : H.PosDef) : (tensorMetric H).PosDef := + hH.inv.transpose.kronecker (hH.kronecker hH.inv.transpose) + +lemma tensorConnection_mulVec (G : Matrix n n ℂ) (T : TensorIndex n → ℂ) (a k j : n) : + (tensorConnection G*ᵥ T) (a,k,j) = ∑ v, G k v*T (a,v,j)- + (∑ v, G v a*T (v,k,j))-(∑ v, G v j*T (a,k,v)) := by + simp only [tensorConnection,Matrix.add_mulVec,Pi.add_apply,tensor3_mulVec_left, + tensor3_mulVec_middle,tensor3_mulVec_right,Matrix.neg_apply,Matrix.transpose_apply, + neg_mul,Finset.sum_neg_distrib] + ring + +lemma tensorMetric_mul_connection (H G : Matrix n n ℂ) : + tensorMetric H*tensorConnection G = + tensor3 (H⁻¹.transpose*(-G.transpose)) H H⁻¹.transpose+ + tensor3 H⁻¹.transpose (H*G) H⁻¹.transpose+ + tensor3 H⁻¹.transpose H (H⁻¹.transpose*(-G.transpose)) := by + simp only [tensorMetric,tensorConnection,Matrix.mul_add,tensor3_mul,mul_one] + +end MongeAmpere + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/CalabiTensorBounds.lean b/lean/OAI/Geometry/PrescribedRicci/CalabiTensorBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..202a69c733870abd144934df1281e6bc395c7b62 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/CalabiTensorBounds.lean @@ -0,0 +1,104 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.CalabiTensorAlgebra +import OAI.Geometry.PrescribedRicci.MatrixCompactBounds +import OAI.Geometry.PrescribedRicci.MatrixComponentBounds + +namespace OAI + +/-! Calabi Tensor Bounds. -/ + +noncomputable section +open Matrix +open scoped ComplexOrder MatrixOrder Matrix.Norms.Elementwise +namespace MongeAmpere +variable {n : Type*} [Fintype n] [DecidableEq n] + +omit [DecidableEq n] in +lemma tensor3_norm_le (L U V : Matrix n n ℂ) : + ‖tensor3 L U V‖ ≤ ‖L‖*‖U‖*‖V‖ := by + apply matrix_norm_le_of_entries (by positivity) + intro i j + rw [tensor3_apply,norm_mul,norm_mul] + calc + _ ≤ ‖L‖*(‖U‖*‖V‖) := mul_le_mul (norm_entry_le_entrywise_sup_norm L) + (mul_le_mul (norm_entry_le_entrywise_sup_norm U) (norm_entry_le_entrywise_sup_norm V) + (norm_nonneg _) (norm_nonneg _)) (mul_nonneg (norm_nonneg _) (norm_nonneg _)) (norm_nonneg _) + _ = _ := by ring + +lemma tensorMetric_inv {H : Matrix n n ℂ} (hH : H.PosDef) : + (tensorMetric H)⁻¹ = tensor3 H.transpose H⁻¹ H.transpose := by + apply Matrix.inv_eq_right_inv + rw [tensorMetric,tensor3_mul,← Matrix.transpose_mul, + Matrix.mul_nonsing_inv _ (isUnit_iff_ne_zero.mpr hH.det_pos.ne'), + Matrix.transpose_one,tensor3_one] + +lemma tensorMetric_norm_bound {H : Matrix n n ℂ} {M : ℝ} + (hM : 0 ≤ M) (hH : ‖H‖ ≤ M) (hI : ‖H⁻¹‖ ≤ M) : ‖tensorMetric H‖ ≤ M^3 := by + apply (tensor3_norm_le _ _ _).trans + rw [Matrix.norm_transpose] + calc + _ ≤ M*M*M := mul_le_mul + (mul_le_mul hI hH (norm_nonneg _) hM) hI (norm_nonneg _) (mul_nonneg hM hM) + _ = _ := by ring + +lemma tensorMetric_inv_norm_bound {H : Matrix n n ℂ} (hHp : H.PosDef) {M : ℝ} + (hM : 0 ≤ M) (hH : ‖H‖ ≤ M) (hI : ‖H⁻¹‖ ≤ M) : ‖(tensorMetric H)⁻¹‖ ≤ M^3 := by + rw [tensorMetric_inv hHp] + apply (tensor3_norm_le _ _ _).trans + rw [Matrix.norm_transpose] + calc + _ ≤ M*M*M := mul_le_mul + (mul_le_mul hH hI (norm_nonneg _) hM) hH (norm_nonneg _) (mul_nonneg hM hM) + _ = _ := by ring + +lemma tensorConnection_norm_le (G : Matrix n n ℂ) : ‖tensorConnection G‖ ≤ 3*‖G‖ := by + have hone : ‖(1 : Matrix n n ℂ)‖ ≤ 1 := by + apply matrix_norm_le_of_entries zero_le_one + intro i j + simp only [Matrix.one_apply] + split_ifs <;> simp + have h1 : ‖tensor3 (-G.transpose) 1 1‖ ≤ ‖G‖ := by + apply (tensor3_norm_le _ _ _).trans + simp only [norm_neg,Matrix.norm_transpose] + nlinarith [norm_nonneg (1 : Matrix n n ℂ),norm_nonneg G, + mul_le_mul_of_nonneg_left hone (norm_nonneg G), + mul_le_mul_of_nonneg_left hone (mul_nonneg (norm_nonneg G) (norm_nonneg (1:Matrix n n ℂ)))] + have h2 : ‖tensor3 1 G 1‖ ≤ ‖G‖ := by + apply (tensor3_norm_le _ _ _).trans + nlinarith [norm_nonneg (1 : Matrix n n ℂ),norm_nonneg G, + mul_le_mul_of_nonneg_right hone (norm_nonneg G), + mul_le_mul_of_nonneg_left hone (mul_nonneg (norm_nonneg (1:Matrix n n ℂ)) (norm_nonneg G))] + have h3 : ‖tensor3 1 1 (-G.transpose)‖ ≤ ‖G‖ := by + apply (tensor3_norm_le _ _ _).trans + simp only [norm_neg,Matrix.norm_transpose] + have ho : ‖(1 : Matrix n n ℂ)‖*‖(1 : Matrix n n ℂ)‖ ≤ 1 := + (mul_le_mul hone hone (norm_nonneg _) zero_le_one).trans_eq (one_mul 1) + simpa using mul_le_mul_of_nonneg_right ho (norm_nonneg G) + exact (norm_add_le _ _).trans ((add_le_add ((norm_add_le _ _).trans + (add_le_add h1 h2)) h3).trans_eq (by ring)) + +omit [DecidableEq n] in +lemma matrix_norm_mul_le (A B : Matrix n n ℂ) : + ‖A*B‖ ≤ (Fintype.card n:ℝ)*‖A‖*‖B‖ := by + exact matrix_norm_le_of_entries (by positivity) + (entry_mul_bound (norm_nonneg A) (fun _ _ => norm_entry_le_entrywise_sup_norm A) + (fun _ _ => norm_entry_le_entrywise_sup_norm B)) + +omit [DecidableEq n] in +lemma mulVec_norm_le (A : Matrix n n ℂ) (v : n → ℂ) : + ‖A*ᵥ v‖ ≤ (Fintype.card n:ℝ)*‖A‖*‖v‖ := by + apply (pi_norm_le_iff_of_nonneg (by positivity)).mpr + intro i + calc + _ ≤ ∑ j, ‖A i j*v j‖ := norm_sum_le _ _ + _ ≤ ∑ _j : n, ‖A‖*‖v‖ := Finset.sum_le_sum (fun j _ => by + rw [norm_mul] + exact mul_le_mul (norm_entry_le_entrywise_sup_norm A) (norm_le_pi_norm v j) + (norm_nonneg _) (norm_nonneg _)) + _ = _ := by simp only [Finset.sum_const,Finset.card_univ,nsmul_eq_mul]; ring + +end MongeAmpere + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/CalabiTensorMetric.lean b/lean/OAI/Geometry/PrescribedRicci/CalabiTensorMetric.lean new file mode 100644 index 0000000000000000000000000000000000000000..2d29eb7508fbcb57424cf5a088c04b87f027b440 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/CalabiTensorMetric.lean @@ -0,0 +1,117 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.ArrayWirtinger +import OAI.Geometry.PrescribedRicci.ChernConnection + +namespace OAI + +/-! Calabi Tensor Metric. -/ + +noncomputable section +open Matrix Filter Set Topology +open scoped ContDiff ComplexOrder Kronecker Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth.KaehlerMetric +open MongeAmpere +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +local notation "Mat" => Matrix (Fin d) (Fin d) ℂ +local notation "TI" => TensorIndex (Fin d) + +def calabiTensor (g : KaehlerMetric A) (q : Fin A.count) (z : Coordinates d) : TI → ℂ := + fun v => g.chernConnection q z v.1 v.2.1 v.2.2 + +def calabiMetric (g : KaehlerMetric A) (q : Fin A.count) (z : Coordinates d) : Matrix TI TI ℂ := + tensorMetric (g.matrix q z) + +def calabiConnection (g : KaehlerMetric A) (q : Fin A.count) (z : Coordinates d) + (a : Fin d) : Matrix TI TI ℂ := tensorConnection (g.chernConnection q z a) + +def calabiNorm (g : KaehlerMetric A) (q : Fin A.count) (z : Coordinates d) : ℝ := + (hermPair (g.calabiMetric q z) (g.calabiTensor q z) (g.calabiTensor q z)).re + +lemma calabiTensor_smooth (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (i : TI) : + ContDiffAt ℝ ∞ (fun y => g.calabiTensor q y i) z := + contDiffAt_pi.mp (contDiffAt_pi.mp (g.chernConnection_smooth q hz i.1) i.2.1) i.2.2 + +lemma calabiMetric_posDef (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) : (g.calabiMetric q z).PosDef := + tensorMetric_posDef (g.positive q z hz) + +lemma calabiNorm_nonneg (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) : 0 ≤ g.calabiNorm q z := + hermPair_nonneg (g.calabiMetric_posDef q hz).posSemidef _ + +lemma calabiMetric_smooth (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (i j : TI) : + ContDiffAt ℝ ∞ (fun y => g.calabiMetric q y i j) z := by + have hg := (g.smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hz) + have hi : ContDiffAt ℝ ∞ (fun y => (g.matrix q y)⁻¹) z := + ((MongeAmpere.contDiffAt_inv _ (g.positive q z hz).det_pos.ne').restrict_scalars ℝ).comp z hg + exact (contDiffAt_pi.mp (contDiffAt_pi.mp hi j.1) i.1).mul + ((contDiffAt_pi.mp (contDiffAt_pi.mp hg i.2.1) j.2.1).mul + (contDiffAt_pi.mp (contDiffAt_pi.mp hi j.2.2) i.2.2)) + +lemma calabiConnection_smooth (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (a : Fin d) (i j : TI) : + ContDiffAt ℝ ∞ (fun y => g.calabiConnection q y a i j) z := by + have hc (u v : Fin d) : ContDiffAt ℝ ∞ (fun y => g.chernConnection q y a u v) z := + contDiffAt_pi.mp (contDiffAt_pi.mp (g.chernConnection_smooth q hz a) u) v + exact (((hc j.1 i.1).neg.mul (contDiffAt_const.mul contDiffAt_const)).add + (contDiffAt_const.mul ((hc i.2.1 j.2.1).mul contDiffAt_const))).add + (contDiffAt_const.mul (contDiffAt_const.mul (hc j.2.2 i.2.2).neg)) + +lemma calabiNorm_smooth (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) : + ContDiffAt ℝ ∞ (g.calabiNorm q) z := + Complex.reCLM.contDiff.contDiffAt.comp z + (hermPair_smooth (g.calabiMetric_smooth q hz) (g.calabiTensor_smooth q hz) (g.calabiTensor_smooth q hz)) + +lemma metric_hol_connection (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (a : Fin d) : + holArray (g.matrix q) z a = g.matrix q z*g.chernConnection q z a := by + rw [holArray_eq_holDerivative + (((g.smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hz)).differentiableAt (by simp))] + rw [chernConnection,← mul_assoc,Matrix.mul_nonsing_inv _ + (isUnit_iff_ne_zero.mpr (g.positive q z hz).det_pos.ne'),one_mul] + +lemma inverse_metric_hol_connection (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (a : Fin d) : + holArray (fun y => (g.matrix q y)⁻¹.transpose) z a = + (g.matrix q z)⁻¹.transpose*(-(g.chernConnection q z a).transpose) := by + have hg := (g.smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hz) + have hi : ContDiffAt ℝ ∞ (fun y => (g.matrix q y)⁻¹) z := + ((MongeAmpere.contDiffAt_inv _ (g.positive q z hz).det_pos.ne').restrict_scalars ℝ).comp z hg + rw [holArray_transpose,holArray_eq_holDerivative (hi.differentiableAt (by simp)), + holDerivative_inv (hg.differentiableAt (by simp)) + (isUnit_iff_ne_zero.mpr (g.positive q z hz).det_pos.ne')] + simp only [chernConnection,Matrix.transpose_neg,Matrix.transpose_mul,mul_neg,mul_assoc] + +lemma calabiMetric_hol (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (a : Fin d) : + holArray (g.calabiMetric q) z a = g.calabiMetric q z*g.calabiConnection q z a := by + have hg := (g.smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hz) + have hi : ContDiffAt ℝ ∞ (fun y => (g.matrix q y)⁻¹) z := + ((MongeAmpere.contDiffAt_inv _ (g.positive q z hz).det_pos.ne').restrict_scalars ℝ).comp z hg + have hg' (i j : Fin d) : DifferentiableAt ℝ (fun y => g.matrix q y i j) z := + (contDiffAt_pi.mp (contDiffAt_pi.mp hg i) j).differentiableAt (by simp) + have hi' (i j : Fin d) : DifferentiableAt ℝ (fun y => (g.matrix q y)⁻¹.transpose i j) z := + (contDiffAt_pi.mp (contDiffAt_pi.mp hi j) i).differentiableAt (by simp) + change holArray (fun y => tensor3 (g.matrix q y)⁻¹.transpose (g.matrix q y) + (g.matrix q y)⁻¹.transpose) z a = _ + rw [holArray_tensor3 hi' hg' hi',g.metric_hol_connection q hz, + g.inverse_metric_hol_connection q hz] + exact (tensorMetric_mul_connection _ _).symm + +lemma calabiMetric_bar (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (a : Fin d) : + barArray (g.calabiMetric q) z a = (g.calabiConnection q z a)ᴴ*g.calabiMetric q z := by + have hh : ∀ᶠ y in nhds z, (g.calabiMetric q y).IsHermitian := by + filter_upwards [(A.chart q).open_target.mem_nhds hz] with y hy + exact (g.calabiMetric_posDef q hy).isHermitian + rw [barArray_eq_adjoint_hol hh,g.calabiMetric_hol q hz,Matrix.conjTranspose_mul, + (g.calabiMetric_posDef q hz).isHermitian.eq] + +end Anticanonical.SourceSmooth.KaehlerMetric + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/CalabiTrace.lean b/lean/OAI/Geometry/PrescribedRicci/CalabiTrace.lean new file mode 100644 index 0000000000000000000000000000000000000000..eae68cf853a505cc88d044dfcac5cc8a6cf3ec00 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/CalabiTrace.lean @@ -0,0 +1,113 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.CalabiTensorAlgebra +import OAI.Geometry.PrescribedRicci.CalabiTensorMetric +import OAI.Geometry.PrescribedRicci.ChernConnection +import OAI.Geometry.PrescribedRicci.HermitianTensorEnergy +import OAI.Geometry.PrescribedRicci.KahlerGradientEnergy + +namespace OAI + +/-! Calabi Trace. -/ + +noncomputable section +open Matrix Set Filter Topology +open scoped ComplexOrder ContDiff MatrixOrder Kronecker Matrix.Norms.Elementwise +namespace MongeAmpere +variable {n : Type*} [Fintype n] [DecidableEq n] +lemma hermPair_kronecker_one_trace (H U V : Matrix n n ℂ) : + hermPair (H ⊗ₖ (1 : Matrix n n ℂ)) (fun p => U p.1 p.2) (fun p => V p.1 p.2) = + (Uᴴ*H*V).trace := by + classical + simp only [hermPair_expand,Fintype.sum_prod_type,Matrix.kronecker_apply,Matrix.one_apply, + mul_ite,ite_mul,mul_one,mul_zero,zero_mul,Finset.sum_ite_eq,Finset.mem_univ,ite_true, + Matrix.trace,Matrix.diag_apply,Matrix.mul_apply,Matrix.conjTranspose_apply,Finset.sum_mul] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro j _ + rw [Finset.sum_comm] + +omit [DecidableEq n] in +lemma trace_real {H : Matrix n n ℂ} (hH : H.IsHermitian) : (H.trace.re : ℂ) = H.trace := by + have he : star H.trace = H.trace := by rw [← trace_conjTranspose,hH.eq] + have hi := congrArg Complex.im he + apply Complex.ext + · rfl + · simp only [Complex.ofReal_im] + simp only [Complex.star_def,Complex.conj_im] at hi + linarith +end MongeAmpere +namespace Anticanonical.SourceSmooth.KaehlerMetric +open MongeAmpere +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +local notation "TI" => TensorIndex (Fin d) + +def flatTrace (g : KaehlerMetric A) (q : Fin A.count) (z : Coordinates d) : ℝ := + (g.matrix q z).trace.re + +lemma flatTrace_smooth (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) : ContDiffAt ℝ ∞ (g.flatTrace q) z := by + have hs := (g.smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hz) + exact Complex.reCLM.contDiff.contDiffAt.comp z (ContDiffAt.sum (fun i _ => + contDiffAt_pi.mp (contDiffAt_pi.mp hs i) i)) + +lemma flatTrace_hol (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (a : Fin d) : + holRealDeriv (g.flatTrace q) z a = (holDerivative (g.matrix q) z a).trace := by + rw [← holDeriv_ofReal ((g.flatTrace_smooth q hz).differentiableAt (by simp))] + have he : (fun y => (g.flatTrace q y : ℂ)) =ᶠ[nhds z] fun y => (g.matrix q y).trace := by + filter_upwards [(A.chart q).open_target.mem_nhds hz] with y hy + exact trace_real (g.positive q y hy).isHermitian + rw [holDeriv_congr he,holDeriv_trace + (((g.smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hz)).differentiableAt (by simp))] + +lemma flatTrace_hessian (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (b a : Fin d) : + PotentialKaehler.potentialMatrix (g.flatTrace q) z b a = + ((g.chernConnection q z b)ᴴ*g.matrix q z*g.chernConnection q z a).trace- + (g.curvatureMatrix q z b a).trace := by + rw [← barDeriv_holRealDeriv (g.flatTrace_smooth q hz)] + have he : (fun y => holRealDeriv (g.flatTrace q) y a) =ᶠ[nhds z] + fun y => (holDerivative (g.matrix q) y a).trace := by + filter_upwards [(A.chart q).open_target.mem_nhds hz] with y hy + exact g.flatTrace_hol q hy a + rw [barDeriv_congr he,barDeriv_trace ((contDiffAt_holDerivative + ((g.smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hz)) a).differentiableAt (by simp))] + have hp : (g.chernConnection q z b)ᴴ*g.matrix q z*g.chernConnection q z a = + barDerivative (g.matrix q) z b*(g.matrix q z)⁻¹*holDerivative (g.matrix q) z a := by + simp only [chernConnection,Matrix.conjTranspose_mul,g.holDerivative_adjoint q hz, + (g.positive q z hz).inv.isHermitian.eq] + rw [mul_assoc,Matrix.mul_nonsing_inv_cancel_left _ _ + (isUnit_iff_ne_zero.mpr (g.positive q z hz).det_pos.ne')] + rw [hp] + simp only [curvatureMatrix,trace_add,trace_neg] + abel + +lemma flatTrace_laplacian (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) : + ((g.matrix q z)⁻¹*PotentialKaehler.potentialMatrix (g.flatTrace q) z).trace.re = + (hermPair (tensor3 (g.matrix q z)⁻¹.transpose (g.matrix q z) 1) + (g.calabiTensor q z) (g.calabiTensor q z)).re-(g.curvatureRicci q z).trace.re := by + have he : ((g.matrix q z)⁻¹*PotentialKaehler.potentialMatrix (g.flatTrace q) z).trace = + hermPair (tensor3 (g.matrix q z)⁻¹.transpose (g.matrix q z) 1) + (g.calabiTensor q z) (g.calabiTensor q z)-(g.curvatureRicci q z).trace := by + change (∑ u, ∑ b, (g.matrix q z)⁻¹ u b*PotentialKaehler.potentialMatrix (g.flatTrace q) z b u) = _ + simp_rw [g.flatTrace_hessian q hz] + simp only [mul_sub,Finset.sum_sub_distrib] + congr 1 + · have ht := tensorEnergy_eq (g.matrix q z)⁻¹.transpose + ((g.matrix q z) ⊗ₖ (1 : Matrix (Fin d) (Fin d) ℂ)) + (fun a (p : Fin d × Fin d) => g.chernConnection q z a p.1 p.2) + change _ = hermPair (tensor3 (g.matrix q z)⁻¹.transpose (g.matrix q z) 1) + (g.calabiTensor q z) (g.calabiTensor q z) at ht + rw [← ht,← tensorEnergy_flip] + simp only [hermPair_kronecker_one_trace] + · have hh := congrArg Matrix.trace (g.curvature_contraction q hz) + simp only [trace_sum,trace_smul,smul_eq_mul] at hh + exact hh + exact congrArg Complex.re he + +end Anticanonical.SourceSmooth.KaehlerMetric + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/CalabiTraceBound.lean b/lean/OAI/Geometry/PrescribedRicci/CalabiTraceBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..8fae80e4bfc78064efb69e5e7af611178d0e264f --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/CalabiTraceBound.lean @@ -0,0 +1,106 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.AnalyticSupport +import OAI.Geometry.PrescribedRicci.CalabiTensorBounds +import OAI.Geometry.PrescribedRicci.CalabiTrace +import OAI.Geometry.PrescribedRicci.HermitianCoercivity + +namespace OAI + +/-! Calabi Trace Bound. -/ + +noncomputable section +open Matrix Set Filter Topology +open scoped ComplexOrder ContDiff MatrixOrder Kronecker Matrix.Norms.Elementwise +namespace MongeAmpere +variable {n : Type*} [Fintype n] [DecidableEq n] +lemma flatTensor_inv {H : Matrix n n ℂ} (hH : H.PosDef) : + (tensor3 H⁻¹.transpose H 1)⁻¹ = tensor3 H.transpose H⁻¹ 1 := by + apply Matrix.inv_eq_right_inv + rw [tensor3_mul,← Matrix.transpose_mul, + Matrix.mul_nonsing_inv _ (isUnit_iff_ne_zero.mpr hH.det_pos.ne'), + Matrix.transpose_one,one_mul,tensor3_one] + +lemma entrywise_norm_one_le : ‖(1 : Matrix n n ℂ)‖ ≤ 1 := by + apply matrix_norm_le_of_entries zero_le_one + intro i j + simp only [Matrix.one_apply] + split_ifs <;> simp + +lemma flatTensor_inv_norm {H : Matrix n n ℂ} (hHp : H.PosDef) {M : ℝ} + (hM : 0 ≤ M) (hH : ‖H‖ ≤ M) (hI : ‖H⁻¹‖ ≤ M) : + ‖(tensor3 H⁻¹.transpose H 1)⁻¹‖ ≤ M^2 := by + rw [flatTensor_inv hHp] + apply (tensor3_norm_le _ _ _).trans + rw [Matrix.norm_transpose] + exact (mul_le_mul (mul_le_mul hH hI (norm_nonneg _) hM) entrywise_norm_one_le + (norm_nonneg _) (mul_nonneg hM hM)).trans_eq (by ring) +end MongeAmpere +namespace Anticanonical.SourceSmooth.KaehlerMetric +open MongeAmpere +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +local notation "TI" => TensorIndex (Fin d) + +lemma calabiNorm_le_flatEnergy (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) {M : ℝ} (hM : 0 ≤ M) + (hH : ‖g.matrix q z‖ ≤ M) (hI : ‖(g.matrix q z)⁻¹‖ ≤ M) : + g.calabiNorm q z ≤ (Fintype.card TI:ℝ)^2*M^5* + (hermPair (tensor3 (g.matrix q z)⁻¹.transpose (g.matrix q z) 1) + (g.calabiTensor q z) (g.calabiTensor q z)).re := by + let f := g.calabiTensor q z + let K := tensor3 (g.matrix q z)⁻¹.transpose (g.matrix q z) 1 + have hK : K.PosDef := (g.positive q z hz).inv.transpose.kronecker + ((g.positive q z hz).kronecker Matrix.PosDef.one) + have hE : 0 ≤ (hermPair K f f).re := hermPair_nonneg hK.posSemidef _ + have hf : ‖f‖^2 ≤ M^2*(hermPair K f f).re := (norm_sq_le_hermPair hK f).trans + (mul_le_mul_of_nonneg_right (flatTensor_inv_norm (g.positive q z hz) hM hH hI) hE) + have hb : g.calabiNorm q z ≤ (Fintype.card TI:ℝ)^2*M^3*‖f‖^2 := by + apply (Complex.re_le_norm (hermPair (g.calabiMetric q z) f f)).trans + apply (pair_norm_le _ _ _).trans + have hh := tensorMetric_norm_bound hM hH hI + calc + _ ≤ (Fintype.card TI:ℝ)^2*M^3*‖f‖*‖f‖ := + mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right + (mul_le_mul_of_nonneg_left hh (sq_nonneg _)) (norm_nonneg _)) (norm_nonneg _) + _ = _ := by ring + apply hb.trans + calc + _ ≤ (Fintype.card TI:ℝ)^2*M^3*(M^2*(hermPair K f f).re) := + mul_le_mul_of_nonneg_left hf (by positivity) + _ = _ := by dsimp [K,f]; ring + +lemma flatTrace_lower_bound (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) {M R : ℝ} (hM : 0 ≤ M) + (hH : ‖g.matrix q z‖ ≤ M) (hI : ‖(g.matrix q z)⁻¹‖ ≤ M) + (hR : ‖g.curvatureRicci q z‖ ≤ R) : + (1+(Fintype.card TI:ℝ)^2*M^5)⁻¹*g.calabiNorm q z-(d:ℝ)*R ≤ + ((g.matrix q z)⁻¹*PotentialKaehler.potentialMatrix (g.flatTrace q) z).trace.re := by + let E := (hermPair (tensor3 (g.matrix q z)⁻¹.transpose (g.matrix q z) 1) + (g.calabiTensor q z) (g.calabiTensor q z)).re + have hE : 0 ≤ E := hermPair_nonneg + ((g.positive q z hz).inv.transpose.kronecker + ((g.positive q z hz).kronecker Matrix.PosDef.one)).posSemidef _ + have hb := g.calabiNorm_le_flatEnergy q hz hM hH hI + have hδ : 0 < 1+(Fintype.card TI:ℝ)^2*M^5 := by positivity + have hS : (1+(Fintype.card TI:ℝ)^2*M^5)⁻¹*g.calabiNorm q z ≤ E := by + rw [← div_eq_inv_mul,div_le_iff₀ hδ] + change g.calabiNorm q z ≤ E*(1+(Fintype.card TI:ℝ)^2*M^5) + change g.calabiNorm q z ≤ (Fintype.card TI:ℝ)^2*M^5*E at hb + nlinarith + have hRc : (g.curvatureRicci q z).trace.re ≤ (d:ℝ)*R := by + apply (Complex.re_le_norm _).trans + simpa only [Fintype.card_fin] using trace_entry_bound (fun i j => + (norm_entry_le_entrywise_sup_norm (g.curvatureRicci q z) (i:=i) (j:=j)).trans hR) + rw [g.flatTrace_laplacian q hz] + exact sub_le_sub hS hRc + +lemma flatTrace_bound (g : KaehlerMetric A) (q : Fin A.count) (z : Coordinates d) + {M : ℝ} (hH : ‖g.matrix q z‖ ≤ M) : g.flatTrace q z ≤ (d:ℝ)*M := by + apply (Complex.re_le_norm _).trans + simpa only [Fintype.card_fin] using trace_entry_bound (fun i j => + (norm_entry_le_entrywise_sup_norm (g.matrix q z) (i:=i) (j:=j)).trans hH) + +end Anticanonical.SourceSmooth.KaehlerMetric + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/ChartSobolevAlgebra.lean b/lean/OAI/Geometry/PrescribedRicci/ChartSobolevAlgebra.lean new file mode 100644 index 0000000000000000000000000000000000000000..955dfe34580413caa0b16aa4db18b9e8ef231884 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/ChartSobolevAlgebra.lean @@ -0,0 +1,141 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.BoundedBilinearCompletion +import OAI.Geometry.PrescribedPotential.SobolevReconstruction + +namespace OAI + +/-! Chart Sobolev Algebra. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory TemperedDistribution LineDeriv +open scoped SchwartzMap BoundedContinuousFunction ContDiff Classical +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +def schwartzProductLinear : 𝓢(E,ℂ) →ₗ[ℝ] 𝓢(E,ℂ) →ₗ[ℝ] 𝓢(E,ℂ) where + toFun f := (SchwartzMap.smulLeftCLM ℂ f).restrictScalars ℝ |>.toLinearMap + map_add' f g := by + ext h x + change (SchwartzMap.smulLeftCLM ℂ (f+g) h) x = + (SchwartzMap.smulLeftCLM ℂ f h) x + (SchwartzMap.smulLeftCLM ℂ g h) x + rw [SchwartzMap.smulLeftCLM_apply_apply (f+g).hasTemperateGrowth, + SchwartzMap.smulLeftCLM_apply_apply f.hasTemperateGrowth, + SchwartzMap.smulLeftCLM_apply_apply g.hasTemperateGrowth] + simp only [add_apply,smul_eq_mul] + ring + map_smul' c f := by + ext h x + change (SchwartzMap.smulLeftCLM ℂ (c • f) h) x = + c • (SchwartzMap.smulLeftCLM ℂ f h) x + rw [SchwartzMap.smulLeftCLM_apply_apply (c • f).hasTemperateGrowth, + SchwartzMap.smulLeftCLM_apply_apply f.hasTemperateGrowth] + simp only [smul_apply,smul_eq_mul,Complex.real_smul] + ring + +def productCoord (k : ℕ) (hk : Module.finrank ℝ E < k) : L2 E →L[ℝ] L2 E →L[ℝ] L2 E := + BoundedBilinearCompletion.extend (schwartzCoordLinear (k:ℝ)) (schwartzCoord_dense (k:ℝ)) + schwartzProductLinear (schwartz_sobolev_product_bound k hk).choose_spec.2 + +lemma productCoord_schwartz (k : ℕ) (hk : Module.finrank ℝ E < k) (f g : 𝓢(E,ℂ)) : + productCoord k hk (schwartzCoord (k:ℝ) f) (schwartzCoord (k:ℝ) g) = + schwartzCoord (k:ℝ) (SchwartzMap.smulLeftCLM ℂ f g) := + BoundedBilinearCompletion.extend_eq _ (schwartzCoord_dense (k:ℝ)) _ + (schwartz_sobolev_product_bound k hk).choose_spec.1 + (schwartz_sobolev_product_bound k hk).choose_spec.2 f g + +lemma productCoord_strong (k : ℕ) (hk : Module.finrank ℝ E < k) + (hs : (Module.finrank ℝ E:ℝ) < 2*(k:ℝ)) (u v : L2 E) : + strongEmbedding (k:ℝ) hs (productCoord k hk u v) = + strongEmbedding (k:ℝ) hs u * strongEmbedding (k:ℝ) hs v := by + have core (f : 𝓢(E,ℂ)) : (fun v => strongEmbedding (k:ℝ) hs + (productCoord k hk (schwartzCoord (k:ℝ) f) v)) = + (fun v => strongEmbedding (k:ℝ) hs (schwartzCoord (k:ℝ) f) * strongEmbedding (k:ℝ) hs v) := by + apply (schwartzCoord_dense (k:ℝ)).equalizer (by fun_prop) (by fun_prop) + funext g + simp only [Function.comp_apply,productCoord_schwartz,strongEmbedding_schwartz] + ext x + exact SchwartzMap.smulLeftCLM_apply_apply f.hasTemperateGrowth g x + have he : (fun u => strongEmbedding (k:ℝ) hs (productCoord k hk u v)) = + (fun u => strongEmbedding (k:ℝ) hs u * strongEmbedding (k:ℝ) hs v) := by + apply (schwartzCoord_dense (k:ℝ)).equalizer (by fun_prop) (by fun_prop) + funext f + exact congr_fun (core f) v + exact congr_fun he u + +lemma productCoord_lower_zero_core (k : ℕ) (hk : Module.finrank ℝ E < k) + (hs : (Module.finrank ℝ E:ℝ) < 2*(k:ℝ)) (f : 𝓢(E,ℂ)) (v : L2 E) : + lowerCoord (k:ℝ) 0 (Nat.cast_nonneg k) (productCoord k hk (schwartzCoord (k:ℝ) f) v) = + multiply (strongEmbedding (k:ℝ) hs (schwartzCoord (k:ℝ) f)) + (lowerCoord (k:ℝ) 0 (Nat.cast_nonneg k) v) := by + have he : (fun v : L2 E => lowerCoord (k:ℝ) 0 (Nat.cast_nonneg k) + (productCoord k hk (schwartzCoord (k:ℝ) f) v)) = + (fun v => multiply (strongEmbedding (k:ℝ) hs (schwartzCoord (k:ℝ) f)) + (lowerCoord (k:ℝ) 0 (Nat.cast_nonneg k) v)) := by + apply (schwartzCoord_dense (k:ℝ)).equalizer + ((lowerCoord (k:ℝ) 0 (Nat.cast_nonneg k)).continuous.comp + (productCoord k hk (schwartzCoord (k:ℝ) f)).continuous) + ((multiply (strongEmbedding (k:ℝ) hs (schwartzCoord (k:ℝ) f))).continuous.comp + (lowerCoord (k:ℝ) 0 (Nat.cast_nonneg k)).continuous) + funext g + simp only [Function.comp_apply,productCoord_schwartz, + lowerCoord_schwartz,strongEmbedding_schwartz] + exact schwartzCoord_product_zero f g + exact congr_fun he v + +lemma productCoord_lower_zero (k : ℕ) (hk : Module.finrank ℝ E < k) + (hs : (Module.finrank ℝ E:ℝ) < 2*(k:ℝ)) (u v : L2 E) : + lowerCoord (k:ℝ) 0 (Nat.cast_nonneg k) (productCoord k hk u v) = + multiply (strongEmbedding (k:ℝ) hs u) (lowerCoord (k:ℝ) 0 (Nat.cast_nonneg k) v) := by + have hc : Continuous (fun u : L2 E => multiply (strongEmbedding (k:ℝ) hs u) + (lowerCoord (k:ℝ) 0 (Nat.cast_nonneg k) v)) := + by + change Continuous (fun u : L2 E => (ContinuousLinearMap.mul ℂ ℂ).holderL volume ⊤ 2 2 + (boundedToLinf (strongEmbedding (k:ℝ) hs u)) (lowerCoord (k:ℝ) 0 (Nat.cast_nonneg k) v)) + exact (((ContinuousLinearMap.mul ℂ ℂ).holderL volume ⊤ 2 2).continuous.comp + (boundedToLinf.continuous.comp (strongEmbedding (k:ℝ) hs).continuous)).clm_apply continuous_const + have he : (fun u => lowerCoord (k:ℝ) 0 (Nat.cast_nonneg k) (productCoord k hk u v)) = + (fun u => multiply (strongEmbedding (k:ℝ) hs u) (lowerCoord (k:ℝ) 0 (Nat.cast_nonneg k) v)) := by + apply (schwartzCoord_dense (k:ℝ)).equalizer + ((lowerCoord (k:ℝ) 0 (Nat.cast_nonneg k)).continuous.comp + ((productCoord k hk).continuous.clm_apply continuous_const)) hc + funext f + exact productCoord_lower_zero_core k hk hs f v + exact congr_fun he u + +lemma strongEmbedding_lower {s t : ℝ} (hst : t ≤ s) + (hs : (Module.finrank ℝ E:ℝ) < 2*s) (ht : (Module.finrank ℝ E:ℝ) < 2*t) + (u : L2 E) : strongEmbedding t ht (lowerCoord s t hst u) = strongEmbedding s hs u := by + apply boundedDistribution_injective + rw [strongEmbedding_distribution,realize_lowerCoord,strongEmbedding_distribution] + +lemma productCoord_lower (k l : ℕ) (hk : Module.finrank ℝ E < k) + (hl : Module.finrank ℝ E < l) (hlk : l ≤ k) (u v : L2 E) : + lowerCoord (k:ℝ) (l:ℝ) (by exact_mod_cast hlk) (productCoord k hk u v) = + productCoord l hl (lowerCoord (k:ℝ) (l:ℝ) (by exact_mod_cast hlk) u) + (lowerCoord (k:ℝ) (l:ℝ) (by exact_mod_cast hlk) v) := by + have core (f : 𝓢(E,ℂ)) : (fun v => lowerCoord (k:ℝ) (l:ℝ) (by exact_mod_cast hlk) + (productCoord k hk (schwartzCoord (k:ℝ) f) v)) = + (fun v => productCoord l hl (lowerCoord (k:ℝ) (l:ℝ) (by exact_mod_cast hlk) (schwartzCoord (k:ℝ) f)) + (lowerCoord (k:ℝ) (l:ℝ) (by exact_mod_cast hlk) v)) := by + apply (schwartzCoord_dense (k:ℝ)).equalizer (by fun_prop) (by fun_prop) + funext g + simp only [Function.comp_apply,productCoord_schwartz,lowerCoord_schwartz] + have he : (fun u => lowerCoord (k:ℝ) (l:ℝ) (by exact_mod_cast hlk) (productCoord k hk u v)) = + (fun u => productCoord l hl (lowerCoord (k:ℝ) (l:ℝ) (by exact_mod_cast hlk) u) + (lowerCoord (k:ℝ) (l:ℝ) (by exact_mod_cast hlk) v)) := by + apply (schwartzCoord_dense (k:ℝ)).equalizer (by fun_prop) (by fun_prop) + funext f + exact congr_fun (core f) v + exact congr_fun he u + +end SobolevChart + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/ChernBianchi.lean b/lean/OAI/Geometry/PrescribedRicci/ChernBianchi.lean new file mode 100644 index 0000000000000000000000000000000000000000..96fdd5265810174cc5dfed2e9dde0dbb0e99c2bb --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/ChernBianchi.lean @@ -0,0 +1,94 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.ChernConnection + +namespace OAI + +/-! Chern Bianchi. -/ + +noncomputable section +open Matrix Filter Set Topology +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth.KaehlerMetric +variable {d : ℕ} +local notation "Mat" => Matrix (Fin d) (Fin d) ℂ + +lemma holDerivative_neg (f : Coordinates d → Mat) (z : Coordinates d) (a : Fin d) : + holDerivative (fun y => -f y) z a = -holDerivative f z a := by + unfold holDerivative + have he : fderiv ℝ (fun y => -f y) z = -fderiv ℝ f z := by + exact fderiv_fun_neg + rw [he] + ext i j + simp only [_root_.neg_apply,Matrix.smul_apply,Matrix.sub_apply,Matrix.neg_apply,smul_eq_mul] + ring + +variable {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +lemma chernCurvature_smooth (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (b a : Fin d) : + ContDiffAt ℝ ∞ (fun y => g.chernCurvature q y b a) z := by + have hg := (g.smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hz) + have hi : ContDiffAt ℝ ∞ (fun y => (g.matrix q y)⁻¹) z := + ((MongeAmpere.contDiffAt_inv _ (g.positive q z hz).det_pos.ne').restrict_scalars ℝ).comp z hg + unfold chernCurvature curvatureMatrix + exact matrix_mul_contDiffAt hi + ((contDiffAt_barDerivative (contDiffAt_holDerivative hg a) b).neg.add + (matrix_mul_contDiffAt (matrix_mul_contDiffAt (contDiffAt_barDerivative hg b) hi) + (contDiffAt_holDerivative hg a))) + +lemma chernConnection_hol_bar (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (b a u : Fin d) : + holDerivative (fun y => barDerivative (fun w => g.chernConnection q w a) y b) z u = + -holDerivative (fun y => g.chernCurvature q y b a) z u := by + have he : (fun y => barDerivative (fun w => g.chernConnection q w a) y b) =ᶠ[nhds z] + (fun y => -g.chernCurvature q y b a) := by + filter_upwards [(A.chart q).open_target.mem_nhds hz] with y hy + exact g.chernConnection_bar q hy a b + rw [holDerivative_congr he,holDerivative_neg] + +lemma chern_bianchi (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (b a u : Fin d) : + holDerivative (fun y => g.chernCurvature q y b a) z u + + g.chernConnection q z u*g.chernCurvature q z b a - + g.chernCurvature q z b a*g.chernConnection q z u = + holDerivative (fun y => g.chernCurvature q y b u) z a + + g.chernConnection q z a*g.chernCurvature q z b u - + g.chernCurvature q z b u*g.chernConnection q z a := by + have hc (v : Fin d) := g.chernConnection_smooth q hz v + have he : (fun y => holDerivative (fun w => g.chernConnection q w a) y u- + holDerivative (fun w => g.chernConnection q w u) y a) =ᶠ[nhds z] + (fun y => g.chernConnection q y a*g.chernConnection q y u- + g.chernConnection q y u*g.chernConnection q y a) := by + filter_upwards [(A.chart q).open_target.mem_nhds hz] with y hy + exact g.chernConnection_maurerCartan q hy a u + have hb := barDerivative_congr he b + rw [barDerivative_sub ((contDiffAt_holDerivative (hc a) u).differentiableAt (by simp)) + ((contDiffAt_holDerivative (hc u) a).differentiableAt (by simp)), + bar_hol_comm (hc a),bar_hol_comm (hc u),g.chernConnection_hol_bar q hz, + g.chernConnection_hol_bar q hz] at hb + rw [barDerivative_sub (matrix_mul_differentiableAt ((hc a).differentiableAt (by simp)) + ((hc u).differentiableAt (by simp))) + (matrix_mul_differentiableAt ((hc u).differentiableAt (by simp)) + ((hc a).differentiableAt (by simp))), + barDerivative_mul ((hc a).differentiableAt (by simp)) ((hc u).differentiableAt (by simp)), + barDerivative_mul ((hc u).differentiableAt (by simp)) ((hc a).differentiableAt (by simp)), + g.chernConnection_bar q hz,g.chernConnection_bar q hz] at hb + simp only [neg_mul,mul_neg] at hb + have hh := congrArg (fun M : Mat => M+ + (holDerivative (fun y => g.chernCurvature q y b a) z u+ + g.chernConnection q z a*g.chernCurvature q z b u- + g.chernCurvature q z b u*g.chernConnection q z a)) hb + convert hh.symm using 1 <;> abel + +lemma chernCurvature_contraction (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) : + ∑ u, ∑ b, ((g.matrix q z)⁻¹ u b) • g.chernCurvature q z b u = + (g.matrix q z)⁻¹*g.curvatureRicci q z := by + rw [← g.curvature_contraction q hz] + simp only [chernCurvature,Matrix.mul_sum,Matrix.mul_smul] + +end Anticanonical.SourceSmooth.KaehlerMetric + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/ChernBochner.lean b/lean/OAI/Geometry/PrescribedRicci/ChernBochner.lean new file mode 100644 index 0000000000000000000000000000000000000000..f686d643770b39b4df750355558d635d3fa6edb5 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/ChernBochner.lean @@ -0,0 +1,79 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.ChernPairDifferential +import OAI.Geometry.PrescribedRicci.KahlerGradientEnergy + +namespace OAI + +/-! Chern Bochner. -/ + +noncomputable section +open Matrix Filter Set Topology +open scoped ContDiff ComplexOrder +namespace Anticanonical.SourceSmooth.KaehlerMetric +open MongeAmpere +variable {d : ℕ} {n : Type*} [Fintype n] + +lemma bar_covHol {C : Coordinates d → Fin d → Matrix n n ℂ} {f : Coordinates d → n → ℂ} + {z : Coordinates d} (hC : ∀ a i j, ContDiffAt ℝ ∞ (fun y => C y a i j) z) + (hf : ∀ i, ContDiffAt ℝ ∞ (fun y => f y i) z) (a b : Fin d) : + barVector (fun y => covHol C f y a) z b = + covHol C (fun y => barVector f y b) z a+ + barArray (fun y => C y a) z b*ᵥ f z := by + ext i + have hc (j : n) : DifferentiableAt ℝ (fun y => C y a i j*f y j) z := + ((hC a i j).differentiableAt (by simp)).fun_mul ((hf j).differentiableAt (by simp)) + change barDeriv (fun y => holDeriv (fun w => f w i) y a + ∑ j, C y a i j*f y j) z b = + holDeriv (fun y => barDeriv (fun w => f w i) y b) z a+ + ∑ j, C z a i j*barDeriv (fun y => f y j) z b+ + ∑ j, barDeriv (fun y => C y a i j) z b*f z j + rw [barDeriv_add ((contDiffAt_holDeriv (hf i) a).differentiableAt (by simp)) + (DifferentiableAt.fun_sum (u:=Finset.univ) (fun j _ => hc j)), + barDeriv_sum hc,scalar_bar_hol_comm (hf i)] + simp_rw [barDeriv_mul ((hC a i _).differentiableAt (by simp)) ((hf _).differentiableAt (by simp))] + rw [Finset.sum_add_distrib] + abel + +lemma hermPair_bochners_identity {s : Set (Coordinates d)} (hs : IsOpen s) + {K : Coordinates d → Matrix n n ℂ} {C : Coordinates d → Fin d → Matrix n n ℂ} + {f : Coordinates d → n → ℂ} {z : Coordinates d} (hz : z ∈ s) + (hK : ∀ y ∈ s, ∀ i j, ContDiffAt ℝ ∞ (fun w => K w i j) y) + (hC : ∀ y ∈ s, ∀ a i j, ContDiffAt ℝ ∞ (fun w => C w a i j) y) + (hf : ∀ y ∈ s, ∀ i, ContDiffAt ℝ ∞ (fun w => f w i) y) + (hhol : ∀ y ∈ s, ∀ a, holArray K y a = K y*C y a) + (hbar : ∀ y ∈ s, ∀ a, barArray K y a = (C y a)ᴴ*K y) (a b : Fin d) : + barDeriv (fun y => holDeriv (fun w => hermPair (K w) (f w) (f w)) y a) z b = + hermPair (K z) (covHol C (fun y => barVector f y a) z b) (f z)+ + hermPair (K z) (barVector f z a) (barVector f z b)+ + hermPair (K z) (covHol C f z b) (covHol C f z a)+ + hermPair (K z) (f z) (covHol C (fun y => barVector f y b) z a)+ + hermPair (K z) (f z) (barArray (fun y => C y a) z b*ᵥ f z) := by + have hKz := hK z hz + have hfz := hf z hz + have hbarf (u : Fin d) (i : n) : ContDiffAt ℝ ∞ (fun y => barVector f y u i) z := + contDiffAt_barDeriv (hfz i) u + have hcovf (u : Fin d) := covHol_smooth (hC z hz) hfz u + have he : (fun y => holDeriv (fun w => hermPair (K w) (f w) (f w)) y a) =ᶠ[nhds z] + (fun y => hermPair (K y) (barVector f y a) (f y)+ + hermPair (K y) (f y) (covHol C f y a)) := by + filter_upwards [hs.mem_nhds hz] with y hy + exact hermPair_hol_compatible + (fun i j => (hK y hy i j).differentiableAt (by simp)) + (fun i => (hf y hy i).differentiableAt (by simp)) + (fun i => (hf y hy i).differentiableAt (by simp)) a (hhol y hy a) + rw [barDeriv_congr he] + rw [barDeriv_add ((hermPair_smooth hKz (hbarf a) hfz).differentiableAt (by simp)) + ((hermPair_smooth hKz hfz (hcovf a)).differentiableAt (by simp))] + rw [hermPair_bar_compatible (fun i j => (hKz i j).differentiableAt (by simp)) + (fun i => (hbarf a i).differentiableAt (by simp)) + (fun i => (hfz i).differentiableAt (by simp)) b (hbar z hz b), + hermPair_bar_compatible (fun i j => (hKz i j).differentiableAt (by simp)) + (fun i => (hfz i).differentiableAt (by simp)) + (fun i => (hcovf a i).differentiableAt (by simp)) b (hbar z hz b), + bar_covHol (hC z hz) hfz,hermPair_add_right] + abel + +end Anticanonical.SourceSmooth.KaehlerMetric + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/ChernConnection.lean b/lean/OAI/Geometry/PrescribedRicci/ChernConnection.lean new file mode 100644 index 0000000000000000000000000000000000000000..0a6f83a14228552850b4a0262a39b1a1e3ae6986 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/ChernConnection.lean @@ -0,0 +1,120 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.ChernLuAlgebra +import OAI.Geometry.PrescribedRicci.MatrixWirtingerExtra +import OAI.Geometry.PrescribedRicci.MatrixWirtingerSecond + +namespace OAI + +/-! Chern Connection. -/ + +noncomputable section +open Matrix Filter Set Topology +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth.KaehlerMetric +variable {d : ℕ} +local notation "Mat" => Matrix (Fin d) (Fin d) ℂ + +lemma holDerivative_congr {f g : Coordinates d → Mat} {z : Coordinates d} + (he : f =ᶠ[nhds z] g) (a : Fin d) : holDerivative f z a = holDerivative g z a := by + unfold holDerivative + rw [he.fderiv_eq] + +lemma holDerivative_sub {f g : Coordinates d → Mat} {z : Coordinates d} + (hf : DifferentiableAt ℝ f z) (hg : DifferentiableAt ℝ g z) (a : Fin d) : + holDerivative (fun y => f y-g y) z a = holDerivative f z a-holDerivative g z a := by + unfold holDerivative + have he : fderiv ℝ (fun y => f y-g y) z = fderiv ℝ f z-fderiv ℝ g z := by + convert! (hf.hasFDerivAt.sub hg.hasFDerivAt).fderiv using 1 + rw [he] + simp only [_root_.sub_apply,smul_sub] + abel + +lemma hol_hol_comm {f : Coordinates d → Mat} {z : Coordinates d} + (hf : ContDiffAt ℝ ∞ f z) (a b : Fin d) : + holDerivative (fun y => holDerivative f y a) z b = + holDerivative (fun y => holDerivative f y b) z a := by + change (2:ℂ)⁻¹ • (fderiv ℝ (fun y => holDerivative f y a) z (coordinateVector b) - + Complex.I • fderiv ℝ (fun y => holDerivative f y a) z (Complex.I • coordinateVector b)) = + (2:ℂ)⁻¹ • (fderiv ℝ (fun y => holDerivative f y b) z (coordinateVector a) - + Complex.I • fderiv ℝ (fun y => holDerivative f y b) z (Complex.I • coordinateVector a)) + rw [fderiv_holDerivative hf,fderiv_holDerivative hf, + fderiv_holDerivative hf,fderiv_holDerivative hf] + have hs (u v : Coordinates d) : fderiv ℝ (fderiv ℝ f) z u v = fderiv ℝ (fderiv ℝ f) z v u := by + exact hf.isSymmSndFDerivAt (by + simp only [minSmoothness_of_isRCLikeNormedField] + change ((2:ℕ∞):WithTop ℕ∞) ≤ ((⊤:ℕ∞):WithTop ℕ∞) + exact WithTop.coe_le_coe.mpr le_top) u v + rw [hs (coordinateVector a) (coordinateVector b), + hs (coordinateVector a) (Complex.I • coordinateVector b), + hs (Complex.I • coordinateVector a) (coordinateVector b), + hs (Complex.I • coordinateVector a) (Complex.I • coordinateVector b)] + ext i j + simp only [Matrix.smul_apply,Matrix.sub_apply,smul_eq_mul] + ring + +variable {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +def chernConnection (g : KaehlerMetric A) (q : Fin A.count) (z : Coordinates d) (a : Fin d) : Mat := + (g.matrix q z)⁻¹*holDerivative (g.matrix q) z a + +def chernCurvature (g : KaehlerMetric A) (q : Fin A.count) (z : Coordinates d) + (b a : Fin d) : Mat := (g.matrix q z)⁻¹*g.curvatureMatrix q z b a + +lemma chernConnection_smooth (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (a : Fin d) : + ContDiffAt ℝ ∞ (fun y => g.chernConnection q y a) z := by + have hg := (g.smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hz) + exact matrix_mul_contDiffAt + (((MongeAmpere.contDiffAt_inv _ (g.positive q z hz).det_pos.ne').restrict_scalars ℝ).comp z hg) + (contDiffAt_holDerivative hg a) + +lemma chernConnection_torsion (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (a k j : Fin d) : + g.chernConnection q z a k j = g.chernConnection q z j k a := by + simp only [chernConnection,Matrix.mul_apply] + apply Finset.sum_congr rfl + intro u _ + rw [g.holDerivative_symm q hz a u j] + +lemma chernConnection_bar (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (a b : Fin d) : + barDerivative (fun y => g.chernConnection q y a) z b = -g.chernCurvature q z b a := by + have hg := (g.smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hz) + have hi : ContDiffAt ℝ ∞ (fun y => (g.matrix q y)⁻¹) z := + ((MongeAmpere.contDiffAt_inv _ (g.positive q z hz).det_pos.ne').restrict_scalars ℝ).comp z hg + unfold chernConnection + rw [barDerivative_mul (hi.differentiableAt (by simp)) + ((contDiffAt_holDerivative hg a).differentiableAt (by simp)), + barDerivative_inv (hg.differentiableAt (by simp)) (isUnit_iff_ne_zero.mpr (g.positive q z hz).det_pos.ne')] + simp only [chernCurvature,curvatureMatrix,mul_add,neg_mul,mul_neg,mul_assoc] + abel + +lemma chernConnection_hol (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (a u : Fin d) : + holDerivative (fun y => g.chernConnection q y a) z u = + -(g.chernConnection q z u*g.chernConnection q z a)+ + (g.matrix q z)⁻¹*holDerivative (fun y => holDerivative (g.matrix q) y a) z u := by + have hg := (g.smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hz) + have hi : ContDiffAt ℝ ∞ (fun y => (g.matrix q y)⁻¹) z := + ((MongeAmpere.contDiffAt_inv _ (g.positive q z hz).det_pos.ne').restrict_scalars ℝ).comp z hg + unfold chernConnection + rw [holDerivative_mul (hi.differentiableAt (by simp)) + ((contDiffAt_holDerivative hg a).differentiableAt (by simp)), + holDerivative_inv (hg.differentiableAt (by simp)) (isUnit_iff_ne_zero.mpr (g.positive q z hz).det_pos.ne')] + simp only [neg_mul,mul_assoc] + +lemma chernConnection_maurerCartan (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (a u : Fin d) : + holDerivative (fun y => g.chernConnection q y a) z u - + holDerivative (fun y => g.chernConnection q y u) z a = + g.chernConnection q z a*g.chernConnection q z u- + g.chernConnection q z u*g.chernConnection q z a := by + rw [g.chernConnection_hol q hz,g.chernConnection_hol q hz, + hol_hol_comm ((g.smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hz)) a u] + abel + +end Anticanonical.SourceSmooth.KaehlerMetric + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/ChernLuAlgebra.lean b/lean/OAI/Geometry/PrescribedRicci/ChernLuAlgebra.lean new file mode 100644 index 0000000000000000000000000000000000000000..9699bf8f0e8f6776c9fbf177bbe3332455fc9f57 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/ChernLuAlgebra.lean @@ -0,0 +1,93 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.MatrixWirtinger +import OAI.Geometry.PrescribedRicci.MatrixWirtingerSecond + +namespace OAI + +/-! Chern Lu Algebra. -/ + +noncomputable section +open Matrix Filter Set Topology +open scoped ContDiff ComplexOrder MatrixOrder Matrix.Norms.Elementwise +namespace MongeAmpere +variable {n : Type*} [Fintype n] [DecidableEq n] + +lemma trace_lu_identity (B G Pg Qg Ph Qh Rg Rh : Matrix n n ℂ) + (hG : IsUnit G.det) : + (B*Rg-B*Qh*B*Pg-B*Ph*B*Qg-B*Rh*B*G+ + B*Qh*B*Ph*B*G+B*Ph*B*Qh*B*G).trace = + (-(B*(-Rg+Qg*G⁻¹*Pg))).trace + + (B*(Qg-Qh*B*G)*G⁻¹*(Pg-G*B*Ph)).trace + + (B*(-Rh+Qh*B*Ph)*B*G).trace := by + have he : B*(Qg-Qh*B*G)*G⁻¹*(Pg-G*B*Ph) = + B*Qg*G⁻¹*Pg-B*Qg*B*Ph-B*Qh*B*Pg+B*Qh*B*G*B*Ph := by + simp only [mul_sub,sub_mul] + simp only [mul_assoc,Matrix.mul_nonsing_inv_cancel_left G _ hG, + Matrix.nonsing_inv_mul_cancel_left G _ hG] + noncomm_ring + rw [he] + simp only [mul_add,add_mul,mul_neg,neg_mul,trace_add,trace_sub,trace_neg] + have h1 : (B*Ph*B*Qg).trace = (B*Qg*B*Ph).trace := by + simpa only [mul_assoc] using Matrix.trace_mul_comm (B*Ph) (B*Qg) + have h2 : (B*Ph*B*Qh*B*G).trace = (B*Qh*B*G*B*Ph).trace := by + simpa only [mul_assoc] using Matrix.trace_mul_comm (B*Ph) (B*Qh*B*G) + simp only [mul_assoc] at h1 h2 ⊢ + linear_combination h2 - h1 + +end MongeAmpere +namespace Anticanonical.SourceSmooth.KaehlerMetric +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +local notation "Mat" => Matrix (Fin d) (Fin d) ℂ + +def curvatureMatrix (g : KaehlerMetric A) (q : Fin A.count) (z : Coordinates d) + (b a : Fin d) : Mat := + -barDerivative (fun y => holDerivative (g.matrix q) y a) z b + + barDerivative (g.matrix q) z b*(g.matrix q z)⁻¹*holDerivative (g.matrix q) z a + +lemma curvatureMatrix_exchange (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (a b i j : Fin d) : + g.curvatureMatrix q z b a i j = g.curvatureMatrix q z i j b a := by + unfold curvatureMatrix + simp only [Matrix.add_apply,Matrix.neg_apply] + rw [g.secondDerivative_row_symm q hz a b i j, + g.secondDerivative_col_symm q hz a i b j] + congr 1 + simp only [Matrix.mul_apply] + apply Finset.sum_congr rfl + intro k _ + rw [g.holDerivative_symm q hz a k j] + congr 1 + apply Finset.sum_congr rfl + intro l _ + rw [g.barDerivative_symm q hz b i l] + +def curvatureRicci (g : KaehlerMetric A) (q : Fin A.count) (z : Coordinates d) : Mat := + fun b a => ((g.matrix q z)⁻¹*g.curvatureMatrix q z b a).trace + +lemma curvature_contraction (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) : + ∑ a, ∑ b, ((g.matrix q z)⁻¹ a b) • g.curvatureMatrix q z b a = + g.curvatureRicci q z := by + ext i j + simp only [Matrix.sum_apply,Matrix.smul_apply,smul_eq_mul,curvatureRicci, + Matrix.trace,Matrix.diag_apply,Matrix.mul_apply] + apply Finset.sum_congr rfl + intro a _ + apply Finset.sum_congr rfl + intro b _ + rw [g.curvatureMatrix_exchange q hz a b i j] + +lemma curvature_trace_contraction (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (G : Mat) : + ∑ a, ∑ b, (g.matrix q z)⁻¹ a b * + ((g.matrix q z)⁻¹*g.curvatureMatrix q z b a*(g.matrix q z)⁻¹*G).trace = + ((g.matrix q z)⁻¹*g.curvatureRicci q z*(g.matrix q z)⁻¹*G).trace := by + rw [← g.curvature_contraction q hz] + simp only [Matrix.mul_sum,Matrix.sum_mul,Matrix.mul_smul,Matrix.smul_mul, + trace_sum,trace_smul,smul_eq_mul] + +end Anticanonical.SourceSmooth.KaehlerMetric + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/ChernLuConnection.lean b/lean/OAI/Geometry/PrescribedRicci/ChernLuConnection.lean new file mode 100644 index 0000000000000000000000000000000000000000..3ac232a7594189e96fda2e694c0b58e63647b311 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/ChernLuConnection.lean @@ -0,0 +1,151 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.CurvatureRicci +import OAI.Geometry.PrescribedRicci.KahlerGradientEnergy +import OAI.Geometry.PrescribedRicci.KaehlerTrace +import OAI.Geometry.PrescribedRicci.MatrixWirtingerExtra + +namespace OAI + +/-! Chern Lu Connection. -/ + +section + + + +noncomputable section +open Matrix Filter Set Topology +open scoped ContDiff ComplexOrder MatrixOrder Matrix.Norms.Elementwise +namespace MongeAmpere +variable {n : Type*} [Fintype n] [DecidableEq n] + +lemma trace_lu_W_identity (B G Pg Qg Ph Qh Rg Rh : Matrix n n ℂ) + (hG : IsUnit G.det) : + (-(B*Qh*B)*(Pg-G*B*Ph)+ + B*(Rg-(Qg*B*Ph-G*B*Qh*B*Ph+G*B*Rh))).trace = + (-(B*(-Rg+Qg*G⁻¹*Pg))).trace + + (B*(Qg-Qh*B*G)*G⁻¹*(Pg-G*B*Ph)).trace + + (B*(-Rh+Qh*B*Ph)*B*G).trace := by + have he : B*(Qg-Qh*B*G)*G⁻¹*(Pg-G*B*Ph) = + B*Qg*G⁻¹*Pg-B*Qg*B*Ph-B*Qh*B*Pg+B*Qh*B*G*B*Ph := by + simp only [mul_sub,sub_mul] + simp only [mul_assoc,Matrix.mul_nonsing_inv_cancel_left G _ hG, + Matrix.nonsing_inv_mul_cancel_left G _ hG] + noncomm_ring + rw [he] + simp only [mul_add,add_mul,mul_sub,mul_neg,neg_mul,trace_add,trace_sub,trace_neg] + have h1 : (B*G*B*Qh*B*Ph).trace = (B*Qh*B*Ph*B*G).trace := by + simpa only [mul_assoc] using Matrix.trace_mul_comm (B*G) (B*Qh*B*Ph) + have h2 : (B*G*B*Rh).trace = (B*Rh*B*G).trace := by + simpa only [mul_assoc] using Matrix.trace_mul_comm (B*G) (B*Rh) + simp only [mul_assoc] at h1 h2 ⊢ + linear_combination h1-h2 + +end MongeAmpere +namespace Anticanonical.SourceSmooth.KaehlerMetric +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +local notation "Mat" => Matrix (Fin d) (Fin d) ℂ + +def connectionDifference (h g : KaehlerMetric A) (q : Fin A.count) + (z : Coordinates d) (a : Fin d) : Mat := + holDerivative (g.matrix q) z a - g.matrix q z*(h.matrix q z)⁻¹*holDerivative (h.matrix q) z a + +lemma connectionDifference_smooth (h g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (a : Fin d) : + ContDiffAt ℝ ∞ (fun y => h.connectionDifference g q y a) z := by + have hg := (g.smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hz) + have hh := (h.smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hz) + have hi : ContDiffAt ℝ ∞ (fun y => (h.matrix q y)⁻¹) z := + ((MongeAmpere.contDiffAt_inv _ (h.positive q z hz).det_pos.ne').restrict_scalars ℝ).comp z hh + exact (contDiffAt_holDerivative hg a).sub + (matrix_mul_contDiffAt (matrix_mul_contDiffAt hg hi) (contDiffAt_holDerivative hh a)) + +lemma connectionDifference_adjoint (h g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (a : Fin d) : + (h.connectionDifference g q z a)ᴴ = + barDerivative (g.matrix q) z a - barDerivative (h.matrix q) z a*(h.matrix q z)⁻¹*g.matrix q z := by + unfold connectionDifference + rw [conjTranspose_sub,conjTranspose_mul,conjTranspose_mul, + g.holDerivative_adjoint q hz,h.holDerivative_adjoint q hz, + (h.positive q z hz).inv.isHermitian.eq,(g.positive q z hz).isHermitian.eq] + simp only [mul_assoc] + +lemma holRealDeriv_traceMetric (h g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (a : Fin d) : + holRealDeriv ((h.traceMetric g).localExpression q) z a = + ((h.matrix q z)⁻¹*h.connectionDifference g q z a).trace := by + have hs : ContDiffAt ℝ ∞ ((h.traceMetric g).localExpression q) z := + ((h.traceMetric g).smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hz) + have hg := (g.smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hz) + have hh := (h.smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hz) + have hi : ContDiffAt ℝ ∞ (fun y => (h.matrix q y)⁻¹) z := + ((MongeAmpere.contDiffAt_inv _ (h.positive q z hz).det_pos.ne').restrict_scalars ℝ).comp z hh + have he : (fun y => (((h.traceMetric g).localExpression q y):ℂ)) =ᶠ[nhds z] + (fun y => ((h.matrix q y)⁻¹*g.matrix q y).trace) := by + filter_upwards [(A.chart q).open_target.mem_nhds hz] with y hy + rw [h.traceMetric_local g q hy] + exact MongeAmpere.trace_mul_real (h.positive q y hy).inv.isHermitian (g.positive q y hy).isHermitian + rw [← holDeriv_ofReal (hs.differentiableAt (by simp)),holDeriv_congr he, + holDeriv_trace (matrix_mul_differentiableAt (hi.differentiableAt (by simp)) (hg.differentiableAt (by simp))), + holDerivative_mul (hi.differentiableAt (by simp)) (hg.differentiableAt (by simp)), + holDerivative_inv (hh.differentiableAt (by simp)) (isUnit_iff_ne_zero.mpr (h.positive q z hz).det_pos.ne')] + simp only [connectionDifference,neg_mul,mul_sub,trace_add,trace_sub,trace_neg] + have hc : ((h.matrix q z)⁻¹*holDerivative (h.matrix q) z a*(h.matrix q z)⁻¹*g.matrix q z).trace = + ((h.matrix q z)⁻¹*g.matrix q z*(h.matrix q z)⁻¹*holDerivative (h.matrix q) z a).trace := by + simpa only [mul_assoc] using Matrix.trace_mul_comm + ((h.matrix q z)⁻¹*holDerivative (h.matrix q) z a) ((h.matrix q z)⁻¹*g.matrix q z) + simp only [mul_assoc] at hc ⊢ + linear_combination -hc + +lemma barDerivative_connectionDifference (h g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (b a : Fin d) : + barDerivative (fun y => h.connectionDifference g q y a) z b = + barDerivative (fun y => holDerivative (g.matrix q) y a) z b - + (barDerivative (g.matrix q) z b*(h.matrix q z)⁻¹*holDerivative (h.matrix q) z a - + g.matrix q z*(h.matrix q z)⁻¹*barDerivative (h.matrix q) z b*(h.matrix q z)⁻¹*holDerivative (h.matrix q) z a + + g.matrix q z*(h.matrix q z)⁻¹*barDerivative (fun y => holDerivative (h.matrix q) y a) z b) := by + have hg := (g.smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hz) + have hh := (h.smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hz) + have hi : ContDiffAt ℝ ∞ (fun y => (h.matrix q y)⁻¹) z := + ((MongeAmpere.contDiffAt_inv _ (h.positive q z hz).det_pos.ne').restrict_scalars ℝ).comp z hh + have pd := (contDiffAt_holDerivative hh a).differentiableAt (by simp) + have gd := hg.differentiableAt (by simp) + have id := hi.differentiableAt (by simp) + unfold connectionDifference + rw [barDerivative_sub ((contDiffAt_holDerivative hg a).differentiableAt (by simp)) + (matrix_mul_differentiableAt (matrix_mul_differentiableAt gd id) pd), + barDerivative_mul (matrix_mul_differentiableAt gd id) pd, + barDerivative_mul gd id, + barDerivative_inv (hh.differentiableAt (by simp)) (isUnit_iff_ne_zero.mpr (h.positive q z hz).det_pos.ne')] + simp only [mul_neg,neg_mul,add_mul,mul_assoc,sub_eq_add_neg] + +lemma hessian_traceMetric (h g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (b a : Fin d) : + (h.traceMetric g).hessian q z b a = + (-((h.matrix q z)⁻¹*g.curvatureMatrix q z b a)).trace + + ((h.matrix q z)⁻¹*(h.connectionDifference g q z b)ᴴ*(g.matrix q z)⁻¹*h.connectionDifference g q z a).trace + + ((h.matrix q z)⁻¹*h.curvatureMatrix q z b a*(h.matrix q z)⁻¹*g.matrix q z).trace := by + have hh := (h.smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hz) + have hi : ContDiffAt ℝ ∞ (fun y => (h.matrix q y)⁻¹) z := + ((MongeAmpere.contDiffAt_inv _ (h.positive q z hz).det_pos.ne').restrict_scalars ℝ).comp z hh + have hw := (h.connectionDifference_smooth g q hz a).differentiableAt (by simp) + have he : (fun y => holRealDeriv ((h.traceMetric g).localExpression q) y a) =ᶠ[nhds z] + (fun y => ((h.matrix q y)⁻¹*h.connectionDifference g q y a).trace) := by + filter_upwards [(A.chart q).open_target.mem_nhds hz] with y hy + exact h.holRealDeriv_traceMetric g q hy a + have hs : ContDiffAt ℝ ∞ ((h.traceMetric g).localExpression q) z := + ((h.traceMetric g).smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hz) + change PotentialKaehler.potentialMatrix ((h.traceMetric g).localExpression q) z b a = _ + rw [← barDeriv_holRealDeriv hs, + barDeriv_congr he,barDeriv_trace (matrix_mul_differentiableAt (hi.differentiableAt (by simp)) hw), + barDerivative_mul (hi.differentiableAt (by simp)) hw, + barDerivative_inv (hh.differentiableAt (by simp)) (isUnit_iff_ne_zero.mpr (h.positive q z hz).det_pos.ne'), + h.barDerivative_connectionDifference g q hz,h.connectionDifference_adjoint g q hz] + exact MongeAmpere.trace_lu_W_identity _ _ _ _ _ _ _ _ + (isUnit_iff_ne_zero.mpr (g.positive q z hz).det_pos.ne') + +end Anticanonical.SourceSmooth.KaehlerMetric + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/ChernLuDifferential.lean b/lean/OAI/Geometry/PrescribedRicci/ChernLuDifferential.lean new file mode 100644 index 0000000000000000000000000000000000000000..9b875b37d055cb5df44dd2ad0b9c1957fe241f73 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/ChernLuDifferential.lean @@ -0,0 +1,97 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.ChernLuGradient +import OAI.Geometry.PrescribedRicci.KahlerGradientEnergy +import OAI.Geometry.PrescribedRicci.ChernLuConnection +import OAI.Geometry.PrescribedRicci.GlobalKahlerEnergy +import OAI.Geometry.PrescribedRicci.KaehlerLogTrace + +namespace OAI + +/-! Chern Lu Differential. -/ + +section + + + +noncomputable section +open Matrix Filter Set Topology +open scoped ContDiff ComplexOrder MatrixOrder Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth.KaehlerMetric +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +def connectionEnergy (h g : KaehlerMetric A) (q : Fin A.count) (z : Coordinates d) : ℝ := + (∑ a, ∑ b, (h.matrix q z)⁻¹ a b * + ((h.matrix q z)⁻¹*(h.connectionDifference g q z b)ᴴ*(g.matrix q z)⁻¹*h.connectionDifference g q z a).trace).re + +def targetCurvatureTerm (h g : KaehlerMetric A) (q : Fin A.count) (z : Coordinates d) : ℝ := + (∑ a, ∑ b, (h.matrix q z)⁻¹ a b * + ((h.matrix q z)⁻¹*g.curvatureMatrix q z b a).trace).re + +def sourceRicciTerm (h g : KaehlerMetric A) (q : Fin A.count) (z : Coordinates d) : ℝ := + ((h.matrix q z)⁻¹*h.curvatureRicci q z*(h.matrix q z)⁻¹*g.matrix q z).trace.re + +lemma laplacian_traceMetric (h g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) : + (h.laplacian (h.traceMetric g)).localExpression q z = + -h.targetCurvatureTerm g q z + h.connectionEnergy g q z + h.sourceRicciTerm g q z := by + have hl := h.laplacianValue_local (h.traceMetric g) q ((A.chart q).mapsTo_symm hz) + change (h.laplacian (h.traceMetric g)).localExpression q z = _ at hl + rw [(A.chart q).right_inv hz] at hl + rw [hl] + simp only [linearizedMongeAmpere,Matrix.trace,Matrix.diag_apply,Matrix.mul_apply] + simp only [h.hessian_traceMetric g q hz,trace_neg,mul_add,mul_neg, + Finset.sum_add_distrib,Finset.sum_neg_distrib,Complex.add_re,Complex.neg_re] + change -h.targetCurvatureTerm g q z+h.connectionEnergy g q z+_ = _ + congr 1 + exact congrArg Complex.re (h.curvature_trace_contraction q hz (g.matrix q z)) + +lemma trace_gradient_bound (h g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) : + (h.energy (h.traceMetric g) (h.traceMetric g)).localExpression q z ≤ + (h.traceMetric g).localExpression q z * h.connectionEnergy g q z := by + rw [h.energy_local (h.traceMetric g) (h.traceMetric g) q hz,h.traceMetric_local g q hz] + unfold gradientPair connectionEnergy + simp only [h.holRealDeriv_traceMetric g q hz] + exact MongeAmpere.chernLu_gradient_bound _ _ (h.positive q z hz).inv.posSemidef + (g.positive q z hz) (h.connectionDifference g q z) + +lemma chernLu_pointwise (h g : KaehlerMetric A) (hd : 0 < d) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) : + ((h.traceMetric g).localExpression q z)⁻¹ * + (-h.targetCurvatureTerm g q z+h.sourceRicciTerm g q z) ≤ + (h.laplacian (h.logTrace g hd)).localExpression q z := by + have hs : 0 < (h.traceMetric g).localExpression q z := + h.traceMetric_pos g hd ((A.chart q).symm z) + have hg := h.trace_gradient_bound g q hz + rw [h.laplacian_logTrace g hd q hz,h.laplacian_traceMetric g q hz] + have hc := mul_le_mul_of_nonneg_left hg (inv_nonneg.mpr (sq_nonneg ((h.traceMetric g).localExpression q z))) + have he : (((h.traceMetric g).localExpression q z)^2)⁻¹ * + ((h.traceMetric g).localExpression q z*h.connectionEnergy g q z) = + ((h.traceMetric g).localExpression q z)⁻¹ * h.connectionEnergy g q z := by + field_simp + rw [he] at hc + linarith + +lemma chernLu_of_component_bounds (h g : KaehlerMetric A) (hd : 0 < d) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) {C R : ℝ} + (hC : h.targetCurvatureTerm g q z ≤ C*((h.traceMetric g).localExpression q z)^2) + (hR : -R*((h.traceMetric g).localExpression q z)^2 ≤ h.sourceRicciTerm g q z) : + -(C+R)*(h.traceMetric g).localExpression q z ≤ + (h.laplacian (h.logTrace g hd)).localExpression q z := by + have hs : 0 < (h.traceMetric g).localExpression q z := + h.traceMetric_pos g hd ((A.chart q).symm z) + apply le_trans _ (h.chernLu_pointwise g hd q hz) + have hh : -(C+R)*((h.traceMetric g).localExpression q z)^2 ≤ + -h.targetCurvatureTerm g q z+h.sourceRicciTerm g q z := by linarith + have hm := mul_le_mul_of_nonneg_left hh (inv_pos.mpr hs).le + have he : ((h.traceMetric g).localExpression q z)⁻¹ * + (-(C+R)*((h.traceMetric g).localExpression q z)^2) = + -(C+R)*(h.traceMetric g).localExpression q z := by field_simp + rwa [he] at hm + +end Anticanonical.SourceSmooth.KaehlerMetric + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/ChernLuGradient.lean b/lean/OAI/Geometry/PrescribedRicci/ChernLuGradient.lean new file mode 100644 index 0000000000000000000000000000000000000000..e5cf98375671927e637943ce154c3b78a10fd57d --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/ChernLuGradient.lean @@ -0,0 +1,116 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.TraceCauchySchwarz + +namespace OAI + +/-! Chern Lu Gradient. -/ + +noncomputable section +open Matrix +open scoped ComplexOrder MatrixOrder +namespace MongeAmpere +variable {n m : Type*} [Fintype n] [DecidableEq n] [Fintype m] [DecidableEq m] + +omit [DecidableEq n] [DecidableEq m] in +lemma tracePair_sum (B K : Matrix n n ℂ) (W : m → Matrix n n ℂ) (v : m → ℂ) : + (B*(∑ i, v i • W i)ᴴ*K*(∑ j, v j • W j)).trace = + ∑ i, ∑ j, star (v i)*v j*(B*(W i)ᴴ*K*W j).trace := by + simp only [conjTranspose_sum,conjTranspose_smul,Matrix.sum_mul, + Matrix.mul_smul,Matrix.smul_mul,trace_sum,trace_smul,smul_eq_mul,Finset.mul_sum] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + ring + +omit [DecidableEq n] [DecidableEq m] in +lemma trace_sum_smul (B : Matrix n n ℂ) (W : m → Matrix n n ℂ) (v : m → ℂ) : + (B*(∑ i, v i • W i)).trace = ∑ i, v i*(B*W i).trace := by + simp only [Matrix.mul_sum,Matrix.mul_smul,trace_sum,trace_smul,smul_eq_mul] + +omit [DecidableEq m] in +lemma trace_schur_posSemidef (B G : Matrix n n ℂ) (hB : B.PosSemidef) + (hG : G.PosDef) (W : m → Matrix n n ℂ) : + Matrix.PosSemidef (fun i j => ((B*G).trace.re : ℂ)*(B*(W i)ᴴ*G⁻¹*W j).trace - + star (B*W i).trace*(B*W j).trace : Matrix m m ℂ) := by + let S := (B*G).trace.re + let N : Matrix m m ℂ := fun i j => (S:ℂ)*(B*(W i)ᴴ*G⁻¹*W j).trace - + star (B*W i).trace*(B*W j).trace + have hs (i j : m) : star (B*(W j)ᴴ*G⁻¹*W i).trace = (B*(W i)ᴴ*G⁻¹*W j).trace := + (tracePairCore B G⁻¹ hB hG.inv.posSemidef).conj_inner_symm _ _ + apply Matrix.posSemidef_iff_dotProduct_mulVec.mpr + constructor + · apply Matrix.IsHermitian.ext + intro i j + change star (N j i) = N i j + dsimp only [N] + rw [star_sub,star_mul,star_mul,star_star,hs] + simp only [Complex.star_def,Complex.conj_ofReal] + ring + · intro v + let C := ∑ i, v i • W i + have he : star v ⬝ᵥ (N *ᵥ v) = (S:ℂ)*(B*Cᴴ*G⁻¹*C).trace - + star (B*C).trace*(B*C).trace := by + dsimp only [C] + rw [tracePair_sum,trace_sum_smul] + simp only [dotProduct,mulVec,Pi.star_apply,N,Finset.mul_sum,Finset.sum_mul, + Finset.sum_sub_distrib,mul_sub,sub_mul,star_sum,star_mul] + congr 1 + · apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + ring + · rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + ring + change 0 ≤ star v ⬝ᵥ (N *ᵥ v) + rw [he] + have hq := (tracePairCore B G⁻¹ hB hG.inv.posSemidef).conj_inner_symm C C + have hqi : (B*Cᴴ*G⁻¹*C).trace.im = 0 := by + have hi := congrArg Complex.im hq + simp only [Complex.conj_im] at hi + change -(B*Cᴴ*G⁻¹*C).trace.im = (B*Cᴴ*G⁻¹*C).trace.im at hi + linarith + have hCS := trace_cauchySchwarz B G C hB hG + apply Complex.nonneg_iff.mpr + constructor + · simp only [Complex.sub_re,Complex.mul_re,Complex.ofReal_re,Complex.ofReal_im,zero_mul,sub_zero, + Complex.star_def,Complex.conj_re,Complex.conj_im] + rw [Complex.sq_norm,Complex.normSq_apply] at hCS + dsimp only [S] + nlinarith + · simp only [Complex.sub_im,Complex.mul_im,Complex.ofReal_re,Complex.ofReal_im,zero_mul,add_zero, + hqi,mul_zero,Complex.star_def,Complex.conj_re,Complex.conj_im] + ring + +lemma chernLu_gradient_bound (B G : Matrix n n ℂ) (hB : B.PosSemidef) + (hG : G.PosDef) (W : n → Matrix n n ℂ) : + (∑ a, ∑ b, B a b*star (B*W b).trace*(B*W a).trace).re ≤ + (B*G).trace.re * (∑ a, ∑ b, B a b*(B*(W b)ᴴ*G⁻¹*W a).trace).re := by + have hn := EllipticKernel.trace_mul_nonneg hB (trace_schur_posSemidef B G hB hG W) + simp only [Matrix.trace,Matrix.diag_apply,Matrix.mul_apply] at hn + have he : (∑ a, ∑ b, B a b * + (((B*G).trace.re:ℂ)*(B*(W b)ᴴ*G⁻¹*W a).trace-star (B*W b).trace*(B*W a).trace)) = + ((B*G).trace.re:ℂ)*(∑ a, ∑ b, B a b*(B*(W b)ᴴ*G⁻¹*W a).trace) - + (∑ a, ∑ b, B a b*star (B*W b).trace*(B*W a).trace) := by + simp only [Finset.mul_sum,← Finset.sum_sub_distrib] + apply Finset.sum_congr rfl + intro a _ + apply Finset.sum_congr rfl + intro b _ + ring + change 0 ≤ (∑ a, ∑ b, B a b * + (((B*G).trace.re:ℂ)*(B*(W b)ᴴ*G⁻¹*W a).trace-star (B*W b).trace*(B*W a).trace)).re at hn + rw [he,Complex.sub_re,Complex.re_ofReal_mul] at hn + linarith + +end MongeAmpere + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/ChernPairDifferential.lean b/lean/OAI/Geometry/PrescribedRicci/ChernPairDifferential.lean new file mode 100644 index 0000000000000000000000000000000000000000..5d440467128578e88391f2c9c89ac0bbbf65cbe5 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/ChernPairDifferential.lean @@ -0,0 +1,121 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.HermitianPair +import OAI.Geometry.PrescribedRicci.LocalKahlerEnergy +import OAI.Geometry.PrescribedRicci.WirtingerScalar + +namespace OAI + +/-! Chern Pair Differential. -/ + +noncomputable section +open Matrix Filter Set Topology +open scoped ContDiff ComplexOrder +namespace Anticanonical.SourceSmooth.KaehlerMetric +open MongeAmpere +variable {d : ℕ} {n : Type*} [Fintype n] + +def holVector (f : Coordinates d → n → ℂ) (z : Coordinates d) (a : Fin d) : n → ℂ := + fun i => holDeriv (fun y => f y i) z a + +def barVector (f : Coordinates d → n → ℂ) (z : Coordinates d) (a : Fin d) : n → ℂ := + fun i => barDeriv (fun y => f y i) z a + +def holArray (K : Coordinates d → Matrix n n ℂ) (z : Coordinates d) (a : Fin d) : Matrix n n ℂ := + fun i j => holDeriv (fun y => K y i j) z a + +def barArray (K : Coordinates d → Matrix n n ℂ) (z : Coordinates d) (a : Fin d) : Matrix n n ℂ := + fun i j => barDeriv (fun y => K y i j) z a + +lemma hermPair_smooth {K : Coordinates d → Matrix n n ℂ} {f g : Coordinates d → n → ℂ} + {z : Coordinates d} (hK : ∀ i j, ContDiffAt ℝ ∞ (fun y => K y i j) z) + (hf : ∀ i, ContDiffAt ℝ ∞ (fun y => f y i) z) + (hg : ∀ i, ContDiffAt ℝ ∞ (fun y => g y i) z) : + ContDiffAt ℝ ∞ (fun y => hermPair (K y) (f y) (g y)) z := by + simp only [hermPair_expand] + apply ContDiffAt.sum + intro i _ + apply ContDiffAt.sum + intro j _ + exact ((((starL' ℝ : ℂ ≃L[ℝ] ℂ).contDiff.contDiffAt).comp z (hf i)).mul (hK i j)).mul (hg j) + +lemma hermPair_hol {K : Coordinates d → Matrix n n ℂ} {f g : Coordinates d → n → ℂ} + {z : Coordinates d} (hK : ∀ i j, DifferentiableAt ℝ (fun y => K y i j) z) + (hf : ∀ i, DifferentiableAt ℝ (fun y => f y i) z) + (hg : ∀ i, DifferentiableAt ℝ (fun y => g y i) z) (a : Fin d) : + holDeriv (fun y => hermPair (K y) (f y) (g y)) z a = + hermPair (K z) (barVector f z a) (g z)+hermPair (holArray K z a) (f z) (g z)+ + hermPair (K z) (f z) (holVector g z a) := by + have hterm (i j : n) : DifferentiableAt ℝ (fun y => star (f y i)*K y i j*g y j) z := + (((hf i).star).fun_mul (hK i j)).fun_mul (hg j) + have hrow (i : n) : DifferentiableAt ℝ (fun y => ∑ j, star (f y i)*K y i j*g y j) z := + DifferentiableAt.fun_sum (u:=Finset.univ) (fun j _ => hterm i j) + simp only [hermPair_expand] + rw [holDeriv_sum hrow] + simp_rw [holDeriv_sum (fun j => hterm _ j)] + have he (i j : n) : holDeriv (fun y => star (f y i)*K y i j*g y j) z a = + (holDeriv (fun y => star (f y i)) z a*K z i j+star (f z i)*holDeriv (fun y => K y i j) z a)*g z j+ + (star (f z i)*K z i j)*holDeriv (fun y => g y j) z a := by + rw [holDeriv_mul (((hf i).star).fun_mul (hK i j)) (hg j), + holDeriv_mul (hf i).star (hK i j)] + simp_rw [he,holDeriv_star] + simp only [holArray,holVector,barVector,add_mul,Finset.sum_add_distrib] + +lemma hermPair_bar {K : Coordinates d → Matrix n n ℂ} {f g : Coordinates d → n → ℂ} + {z : Coordinates d} (hK : ∀ i j, DifferentiableAt ℝ (fun y => K y i j) z) + (hf : ∀ i, DifferentiableAt ℝ (fun y => f y i) z) + (hg : ∀ i, DifferentiableAt ℝ (fun y => g y i) z) (a : Fin d) : + barDeriv (fun y => hermPair (K y) (f y) (g y)) z a = + hermPair (K z) (holVector f z a) (g z)+hermPair (barArray K z a) (f z) (g z)+ + hermPair (K z) (f z) (barVector g z a) := by + have hterm (i j : n) : DifferentiableAt ℝ (fun y => star (f y i)*K y i j*g y j) z := + (((hf i).star).fun_mul (hK i j)).fun_mul (hg j) + have hrow (i : n) : DifferentiableAt ℝ (fun y => ∑ j, star (f y i)*K y i j*g y j) z := + DifferentiableAt.fun_sum (u:=Finset.univ) (fun j _ => hterm i j) + simp only [hermPair_expand] + rw [barDeriv_sum hrow] + simp_rw [barDeriv_sum (fun j => hterm _ j)] + have he (i j : n) : barDeriv (fun y => star (f y i)*K y i j*g y j) z a = + (barDeriv (fun y => star (f y i)) z a*K z i j+star (f z i)*barDeriv (fun y => K y i j) z a)*g z j+ + (star (f z i)*K z i j)*barDeriv (fun y => g y j) z a := by + rw [barDeriv_mul (((hf i).star).fun_mul (hK i j)) (hg j), + barDeriv_mul (hf i).star (hK i j)] + simp_rw [he,barDeriv_star] + simp only [barArray,holVector,barVector,add_mul,Finset.sum_add_distrib] + +def covHol (C : Coordinates d → Fin d → Matrix n n ℂ) (f : Coordinates d → n → ℂ) + (z : Coordinates d) (a : Fin d) : n → ℂ := holVector f z a+C z a*ᵥ f z + +lemma covHol_smooth {C : Coordinates d → Fin d → Matrix n n ℂ} {f : Coordinates d → n → ℂ} + {z : Coordinates d} (hC : ∀ a i j, ContDiffAt ℝ ∞ (fun y => C y a i j) z) + (hf : ∀ i, ContDiffAt ℝ ∞ (fun y => f y i) z) (a : Fin d) (i : n) : + ContDiffAt ℝ ∞ (fun y => covHol C f y a i) z := by + change ContDiffAt ℝ ∞ (fun y => holDeriv (fun w => f w i) y a+∑ j, C y a i j*f y j) z + exact (contDiffAt_holDeriv (hf i) a).add + (ContDiffAt.sum (fun j _ => (hC a i j).mul (hf j))) + +lemma hermPair_hol_compatible {K : Coordinates d → Matrix n n ℂ} + {C : Coordinates d → Fin d → Matrix n n ℂ} {f g : Coordinates d → n → ℂ} + {z : Coordinates d} (hK : ∀ i j, DifferentiableAt ℝ (fun y => K y i j) z) + (hf : ∀ i, DifferentiableAt ℝ (fun y => f y i) z) + (hg : ∀ i, DifferentiableAt ℝ (fun y => g y i) z) (a : Fin d) + (hcomp : holArray K z a = K z*C z a) : + holDeriv (fun y => hermPair (K y) (f y) (g y)) z a = + hermPair (K z) (barVector f z a) (g z)+hermPair (K z) (f z) (covHol C g z a) := by + rw [hermPair_hol hK hf hg,hcomp,covHol,hermPair_add_right,← hermPair_mulVec_right] + abel + +lemma hermPair_bar_compatible {K : Coordinates d → Matrix n n ℂ} + {C : Coordinates d → Fin d → Matrix n n ℂ} {f g : Coordinates d → n → ℂ} + {z : Coordinates d} (hK : ∀ i j, DifferentiableAt ℝ (fun y => K y i j) z) + (hf : ∀ i, DifferentiableAt ℝ (fun y => f y i) z) + (hg : ∀ i, DifferentiableAt ℝ (fun y => g y i) z) (a : Fin d) + (hcomp : barArray K z a = (C z a)ᴴ*K z) : + barDeriv (fun y => hermPair (K y) (f y) (g y)) z a = + hermPair (K z) (covHol C f z a) (g z)+hermPair (K z) (f z) (barVector g z a) := by + rw [hermPair_bar hK hf hg,hcomp,covHol,hermPair_add_left,← hermPair_mulVec_left] + +end Anticanonical.SourceSmooth.KaehlerMetric + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/ChernRough.lean b/lean/OAI/Geometry/PrescribedRicci/ChernRough.lean new file mode 100644 index 0000000000000000000000000000000000000000..442a93a3831396450a79c7dc4306dea76d0192e0 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/ChernRough.lean @@ -0,0 +1,144 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.ChernConnection +import OAI.Geometry.PrescribedRicci.ChernBianchi +import OAI.Geometry.PrescribedRicci.CurvatureCompactBounds +import OAI.Geometry.PrescribedRicci.WirtingerScalar + +namespace OAI + +/-! Chern Rough. -/ + +section + + +noncomputable section +open Matrix Filter Set Topology +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth.KaehlerMetric +open MongeAmpere +variable {d : ℕ} +local notation "Mat" => Matrix (Fin d) (Fin d) ℂ + +lemma holDerivative_sum_smul {ι : Type*} [Fintype ι] + {f : ι → Coordinates d → ℂ} {M : ι → Coordinates d → Mat} {z : Coordinates d} + (hf : ∀ i, DifferentiableAt ℝ (f i) z) (hM : ∀ i, DifferentiableAt ℝ (M i) z) + (a : Fin d) : + holDerivative (fun y => ∑ i, f i y • M i y) z a = + ∑ i, (holDeriv (f i) z a • M i z + f i z • holDerivative (M i) z a) := by + have hm (i : ι) (k j : Fin d) := (differentiableAt_pi.mp (differentiableAt_pi.mp (hM i) k) j) + have ht (i : ι) : DifferentiableAt ℝ (fun y => f i y • M i y) z := (hf i).smul (hM i) + have hs : DifferentiableAt ℝ (fun y => ∑ i, f i y • M i y) z := + DifferentiableAt.fun_sum (u:=Finset.univ) (fun i _ => ht i) + ext k j + rw [← holDeriv_entry hs] + simp only [Matrix.sum_apply,Matrix.smul_apply,smul_eq_mul] + rw [holDeriv_sum (fun i => (hf i).fun_mul (hm i k j))] + apply Finset.sum_congr rfl + intro i _ + rw [holDeriv_mul (hf i) (hm i k j),holDeriv_entry (hM i)] + rfl + +variable {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +lemma inverse_derivative_curvature_correction (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (a : Fin d) : + ∑ u, ∑ b, holDerivative (fun y => (g.matrix q y)⁻¹) z a u b • g.chernCurvature q z b u = + -(∑ u, ∑ b, ((g.matrix q z)⁻¹ u b) • + (∑ v, (g.chernConnection q z u v a) • g.chernCurvature q z b v)) := by + have hg := (g.smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hz) + rw [holDerivative_inv (hg.differentiableAt (by simp)) + (isUnit_iff_ne_zero.mpr (g.positive q z hz).det_pos.ne')] + change ∑ u, ∑ b, (-(g.chernConnection q z a*(g.matrix q z)⁻¹)) u b • + g.chernCurvature q z b u = _ + simp only [Matrix.neg_apply,Matrix.mul_apply,neg_smul,Finset.sum_neg_distrib, + Finset.sum_smul,Finset.smul_sum,smul_smul] + congr 1 + conv_lhs => + rw [Finset.sum_comm] + arg 2 + ext b + rw [Finset.sum_comm] + conv_lhs => rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro u _ + apply Finset.sum_congr rfl + intro b _ + apply Finset.sum_congr rfl + intro v _ + rw [g.chernConnection_torsion q hz a v u] + congr 1 + ring + +lemma chernCurvature_rough (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (a : Fin d) : + ∑ u, ∑ b, ((g.matrix q z)⁻¹ u b) • + (holDerivative (fun y => g.chernCurvature q y b a) z u + + g.chernConnection q z u*g.chernCurvature q z b a- + g.chernCurvature q z b a*g.chernConnection q z u- + ∑ v, g.chernConnection q z u v a • g.chernCurvature q z b v) = + (g.matrix q z)⁻¹*holDerivative (g.curvatureRicci q) z a- + ((g.matrix q z)⁻¹*g.curvatureRicci q z)*g.chernConnection q z a := by + have hg := (g.smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hz) + have hi : ContDiffAt ℝ ∞ (fun y => (g.matrix q y)⁻¹) z := + ((MongeAmpere.contDiffAt_inv _ (g.positive q z hz).det_pos.ne').restrict_scalars ℝ).comp z hg + have hI (u b : Fin d) : DifferentiableAt ℝ (fun y => (g.matrix q y)⁻¹ u b) z := + (contDiffAt_pi.mp (contDiffAt_pi.mp hi u) b).differentiableAt (by simp) + have hR (b u : Fin d) := (g.chernCurvature_smooth q hz b u).differentiableAt (by simp) + have hr := (g.curvatureRicci_smooth q hz).differentiableAt (by simp) + have he : (fun y => ∑ ub : Fin d × Fin d, + (g.matrix q y)⁻¹ ub.1 ub.2 • g.chernCurvature q y ub.2 ub.1) =ᶠ[nhds z] + (fun y => (g.matrix q y)⁻¹*g.curvatureRicci q y) := by + filter_upwards [(A.chart q).open_target.mem_nhds hz] with y hy + simpa only [Fintype.sum_prod_type] using g.chernCurvature_contraction q hy + have hd := holDerivative_congr he a + have hdL := holDerivative_sum_smul + (f:=fun ub : Fin d × Fin d => fun y => (g.matrix q y)⁻¹ ub.1 ub.2) + (M:=fun ub : Fin d × Fin d => fun y => g.chernCurvature q y ub.2 ub.1) + (fun ub => hI ub.1 ub.2) (fun ub => hR ub.2 ub.1) a + rw [hdL] at hd + have hdR := holDerivative_mul (f:=fun y => (g.matrix q y)⁻¹) + (g:=g.curvatureRicci q) (hi.differentiableAt (by simp)) hr a + rw [hdR] at hd + have hdi := holDerivative_inv (hg.differentiableAt (by simp)) + (isUnit_iff_ne_zero.mpr (g.positive q z hz).det_pos.ne') a + rw [hdi] at hd + simp only [Fintype.sum_prod_type,Finset.sum_add_distrib] at hd + simp_rw [holDeriv_entry (hi.differentiableAt (by simp))] at hd + rw [g.inverse_derivative_curvature_correction q hz] at hd + simp only [neg_mul,mul_assoc] at hd + rw [← mul_assoc (g.matrix q z)⁻¹ (holDerivative (g.matrix q) z a) + ((g.matrix q z)⁻¹*g.curvatureRicci q z)] at hd + change -(∑ u, ∑ b, ((g.matrix q z)⁻¹ u b) • + (∑ v, g.chernConnection q z u v a • g.chernCurvature q z b v)) + + (∑ u, ∑ b, ((g.matrix q z)⁻¹ u b) • + holDerivative (fun y => g.chernCurvature q y b u) z a) = + -(g.chernConnection q z a*((g.matrix q z)⁻¹*g.curvatureRicci q z))+ + (g.matrix q z)⁻¹*holDerivative (g.curvatureRicci q) z a at hd + conv_lhs => + arg 2 + ext u + arg 2 + ext b + rw [g.chern_bianchi q hz] + have hleft : (∑ u, ∑ b, ((g.matrix q z)⁻¹ u b) • + (g.chernConnection q z a*g.chernCurvature q z b u)) = + g.chernConnection q z a*((g.matrix q z)⁻¹*g.curvatureRicci q z) := by + rw [← g.chernCurvature_contraction q hz] + simp only [Matrix.mul_sum,Matrix.mul_smul] + have hright : (∑ u, ∑ b, ((g.matrix q z)⁻¹ u b) • + (g.chernCurvature q z b u*g.chernConnection q z a)) = + ((g.matrix q z)⁻¹*g.curvatureRicci q z)*g.chernConnection q z a := by + rw [← g.chernCurvature_contraction q hz] + simp only [Matrix.sum_mul,Matrix.smul_mul] + simp only [smul_sub,smul_add,Finset.sum_sub_distrib,Finset.sum_add_distrib,hleft,hright] + have hh := congrArg (fun M : Mat => M+ + g.chernConnection q z a*((g.matrix q z)⁻¹*g.curvatureRicci q z)- + ((g.matrix q z)⁻¹*g.curvatureRicci q z)*g.chernConnection q z a) hd + convert hh using 1 <;> abel + +end Anticanonical.SourceSmooth.KaehlerMetric + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/CofactorBilin.lean b/lean/OAI/Geometry/PrescribedRicci/CofactorBilin.lean new file mode 100644 index 0000000000000000000000000000000000000000..94d56b756109be247cc4baf9780b32710db47544 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/CofactorBilin.lean @@ -0,0 +1,76 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.FiniteCofactor + +namespace OAI + +/-! Cofactor Bilin. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff SchwartzMap Classical BoundedContinuousFunction Matrix.Norms.Elementwise +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart FrozenPoisson +variable {d : ℕ} +local instance : NormedAddCommGroup (Bilin (EC d)) := inferInstance +local instance : NormedSpace ℝ (Bilin (EC d)) := inferInstance + +def cofactorBilinLinear (c : ℂ) (M : Matrix (Fin d) (Fin d) ℂ) : Bilin (EC d) →ₗ[ℝ] ℝ where + toFun B := (c * NonlinearHessian.detDifferential M (GluingData.cofactorMatrix B)).re + map_add' B C := by + simp only [GluingData.cofactorMatrix,pullBilin_add,hermitianPartMatrix_add,map_add,mul_add,Complex.add_re] + map_smul' r B := by + simp only [GluingData.cofactorMatrix,pullBilin_smul,hermitianPartMatrix_smul,map_smul, + RingHom.id_apply,Complex.real_smul,smul_eq_mul] + simp only [Complex.mul_re,Complex.mul_im, + Complex.ofReal_re,Complex.ofReal_im,zero_mul,sub_zero,add_zero] + ring + +def cofactorBilin (c : ℂ) (M : Matrix (Fin d) (Fin d) ℂ) : SecondOrder (EC d) := + by + change Bilin (EC d) →L[ℝ] ℝ + exact (cofactorBilinLinear c M).toContinuousLinearMap + +lemma cofactorBilin_apply (c : ℂ) (M : Matrix (Fin d) (Fin d) ℂ) (B : Bilin (EC d)) : + cofactorBilin c M B = (c * NonlinearHessian.detDifferential M (GluingData.cofactorMatrix B)).re := rfl + +lemma cofactorBilin_expansion (c : ℂ) (M : Matrix (Fin d) (Fin d) ℂ) (B : Bilin (EC d)) : + (cofactorBilin c M B : ℂ) = ∑ i, ∑ j, + (cofactorBilin c M (rankTwo (stdOrthonormalBasis ℝ (EC d) i) + (stdOrthonormalBasis ℝ (EC d) j)) : ℂ) * + (B (stdOrthonormalBasis ℝ (EC d) i) (stdOrthonormalBasis ℝ (EC d) j) : ℂ) := by + conv_lhs => rw [bilin_expansion (stdOrthonormalBasis ℝ (EC d)) B] + simp only [map_sum,map_smul,smul_eq_mul,Complex.ofReal_sum,Complex.ofReal_mul] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + ring + +lemma cofactor_smooth_expression {U : EC d → ℝ} {y : EC d} + (hU : ContDiffAt ℝ ∞ U y) (f : 𝓢(EC d,ℂ)) + (he : (f : EC d → ℂ) =ᶠ[𝓝 y] Complex.ofRealCLM ∘ U) + (c : ℂ) (M : Matrix (Fin d) (Fin d) ℂ) : + ((c * NonlinearHessian.detDifferential M (fun i j => hessianEntrySchwartz i j f y)).re : ℂ) = + ∑ i, ∑ j, (cofactorBilin c M (rankTwo (stdOrthonormalBasis ℝ (EC d) i) + (stdOrthonormalBasis ℝ (EC d) j)) : ℂ) * + fderiv ℝ (fderiv ℝ f) y (stdOrthonormalBasis ℝ (EC d) i) (stdOrthonormalBasis ℝ (EC d) j) := by + simp_rw [hessianEntrySchwartz_real hU f he] + change (cofactorBilin c M (fderiv ℝ (fderiv ℝ U) y) : ℂ) = _ + rw [cofactorBilin_expansion] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + rw [(he.fderiv (𝕜:=ℝ)).fderiv_eq,second_postcomp_general hU] + rfl + +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/CofactorCore.lean b/lean/OAI/Geometry/PrescribedRicci/CofactorCore.lean new file mode 100644 index 0000000000000000000000000000000000000000..e7868d7aa993acebd6103887191f41eec90e419f --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/CofactorCore.lean @@ -0,0 +1,136 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.FiniteCofactor +import OAI.Geometry.PrescribedRicci.FiniteCofactorPatch + +namespace OAI + +/-! Cofactor Core. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff SchwartzMap Classical BoundedContinuousFunction Matrix.Norms.Elementwise +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart FrozenPoisson MetricLocalization +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +def cofactorComplexCore (p : ι) (B : Bilin (EC d)) (f : Smooth A) : Smooth A := + ⟨fun x => D.inverseDet p x * NonlinearHessian.detDifferential + (fun i j => D.metricEntry p i j x + D.localizedHessian p i j f x) (cofactorMatrix B), + fun q => by + apply (D.inverseDet p).smooth q |>.mul + apply ContDiffOn.clm_apply + · apply ((NonlinearHessian.determinant_contDiff d).fderiv_right (m:=∞) (by simp)).comp_contDiffOn + apply contDiffOn_pi.mpr + intro i + apply contDiffOn_pi.mpr + intro j + exact ((D.metricEntry p i j).smooth q).add ((D.localizedHessian p i j f).smooth q) + · exact contDiffOn_const⟩ + +def cofactorScalarCore (p : ι) (B : Bilin (EC d)) (f : Smooth A) : Smooth A := + Smooth.realify (D.cofactorComplexCore p B f) + +lemma cofactorScalarCore_apply (p : ι) (B : Bilin (EC d)) (f : Smooth A) (x : X) : + D.cofactorScalarCore p B f x = + ((D.inverseDet p x * NonlinearHessian.detDifferential + (fun i j => D.metricEntry p i j x + D.localizedHessian p i j f x) (cofactorMatrix B)).re : ℂ) := by + exact Smooth.realify_apply _ x + +lemma cofactorScalar_embed (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (p : ι) (B : Bilin (EC d)) (f : Smooth A) : + D.cofactorScalar k hk p B (D.localizers.embed ((k:ℝ)+2) f) = + D.localizers.embed (k:ℝ) (D.cofactorScalarCore p B f) := by + have hs : (Module.finrank ℝ (EC d):ℝ) < 2*(k:ℝ) := by + have hh : (Module.finrank ℝ (EC d):ℝ) < (k:ℝ) := by exact_mod_cast hk + linarith [Nat.cast_nonneg (α:=ℝ) k] + apply D.localizers.strong_injective (k:ℝ) hs + ext x + rw [D.cofactorScalar_strong,D.localizers.strong_embed _ hs] + simp_rw [D.completedHessian_embed,D.localizers.strong_embed _ hs] + exact (D.cofactorScalarCore_apply p B f x).symm + +def cofactorLocalCore (p : ι) (i j : BasisIndex d) (f : Smooth A) : 𝓢(EC d,ℂ) := + (D.patch p).coefficient i j + + localize A (D.patch p).index (cutoffGlobal (D.patch p).index (D.cutoff p)) + (cutoffGlobal_support _ _) + (D.cofactorScalarCore p (rankTwo (stdOrthonormalBasis ℝ (EC d) i) + (stdOrthonormalBasis ℝ (EC d) j)) f - + D.cofactorScalarCore p (rankTwo (stdOrthonormalBasis ℝ (EC d) i) + (stdOrthonormalBasis ℝ (EC d) j)) 0) + +lemma cofactorLocal_embed (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (p : ι) (i j : BasisIndex d) (f : Smooth A) : + D.cofactorLocal k hk p i j (D.localizers.embed ((k:ℝ)+2) f) = + schwartzCoord (k:ℝ) (D.cofactorLocalCore p i j f) := by + rw [cofactorLocal,D.cofactorScalar_embed] + have h0 := D.cofactorScalar_embed k hk p + (rankTwo (stdOrthonormalBasis ℝ (EC d) i) (stdOrthonormalBasis ℝ (EC d) j)) 0 + rw [map_zero] at h0 + rw [h0,← map_sub,D.completedLocalize_embed,← schwartzCoord_add] + rfl + +lemma cofactorBCF_embed (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (hs : (Module.finrank ℝ (EC d):ℝ) < 2*(k:ℝ)) (p : ι) (f : Smooth A) : + D.cofactorBCF k hk hs p (D.localizers.embed ((k:ℝ)+2) f) = + coefficientBCF (D.cofactorLocalCore p · · f) := by + funext i j + rw [cofactorBCF,D.cofactorLocal_embed,strongEmbedding_schwartz] + rfl + +lemma cofactorScalarCore_zero_source (p : ι) (B : Bilin (EC d)) {x : X} + (hx : x ∈ tsupport (D.localizers.weight p : X → ℂ)) : + D.cofactorScalarCore p B 0 x = + (traceBilin (g.matrix (D.patch p).index (A.chart (D.patch p).index x)) B : ℂ) := by + let k := Module.finrank ℝ (EC d)+1 + have hk : Module.finrank ℝ (EC d) < k := by omega + have hs : (Module.finrank ℝ (EC d):ℝ) < 2*(k:ℝ) := by + dsimp [k] + push_cast + linarith [Nat.cast_nonneg (α:=ℝ) (Module.finrank ℝ (EC d))] + have hh := D.cofactorScalar_zero_source k hk p B hx + have he := D.cofactorScalar_embed k hk p B 0 + rw [map_zero] at he + rw [he,D.localizers.strong_embed _ hs] at hh + exact hh + +lemma cofactorLocalCore_source (p : ι) (i j : BasisIndex d) (f : Smooth A) {x : X} + (hx : x ∈ tsupport (D.localizers.weight p : X → ℂ)) : + extendedCoefficient (D.patch p).matrix (coefficientBCF (D.cofactorLocalCore p · · f)) i j + (A.euclideanChart (D.patch p).index x) = + D.cofactorScalarCore p (rankTwo (stdOrthonormalBasis ℝ (EC d) i) + (stdOrthonormalBasis ℝ (EC d) j)) f x := by + have hs := D.patch_source p hx + have hy := (A.euclideanChart (D.patch p).index).mapsTo hs + have he := (A.euclideanChart (D.patch p).index).left_inv hs + change (traceBilin (D.patch p).matrix (rankTwo _ _) : ℂ) + + D.cofactorLocalCore p i j f (A.euclideanChart (D.patch p).index x) = _ + rw [cofactorLocalCore,_root_.add_apply,localize_apply,localizeFun_apply A _ _ hy,he] + have hc : cutoffGlobal (D.patch p).index (D.cutoff p) x = 1 := by + change (if x ∈ (A.euclideanChart (D.patch p).index).source then _ else _) = _ + rw [ite_eq_left hs,D.cutoff_one p x hx] + rw [hc,one_mul] + change _ + ((D.patch p).coefficient i j (A.euclideanChart (D.patch p).index x) + + (D.cofactorScalarCore p _ f x-D.cofactorScalarCore p _ 0 x)) = _ + rw [← add_assoc] + have hp := (D.patch p).equals (A.euclideanChart (D.patch p).index x) + (D.support_patch p hx).2 i j + change (traceBilin (D.patch p).matrix (rankTwo _ _) : ℂ) + + (D.patch p).coefficient i j (A.euclideanChart (D.patch p).index x) = _ at hp + rw [hp,D.cofactorScalarCore_zero_source p _ hx] + simp only [ComplexAtlas.euclideanChart_apply,ContinuousLinearEquiv.apply_symm_apply] + ring + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/CofactorCoreEquation.lean b/lean/OAI/Geometry/PrescribedRicci/CofactorCoreEquation.lean new file mode 100644 index 0000000000000000000000000000000000000000..9761780af2b34dbe5a5809b8003da3a978c71cc3 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/CofactorCoreEquation.lean @@ -0,0 +1,81 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.PatchCutoffs +import OAI.Geometry.PrescribedPotential.PotentialDensityDifferential +import OAI.Geometry.PrescribedPotential.RealNonlinearCommutator +import OAI.Geometry.PrescribedPotential.RealSobolev +import OAI.Geometry.PrescribedPotential.SobolevProduct +import OAI.Geometry.PrescribedRicci.CofactorLocalization + +namespace OAI + +/-! Cofactor Core Equation. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix _root_.MeasureTheory _root_.OAI.MeasureTheory +open scoped ContDiff SchwartzMap Classical BoundedContinuousFunction Matrix.Norms.Elementwise +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart FrozenPoisson MetricLocalization +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) +local instance cofactorCoreEquationNG (s : ℝ) : NormedAddCommGroup (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedAddCommGroup +local instance cofactorCoreEquationNS (s : ℝ) : NormedSpace ℝ (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedSpace +local instance cofactorCoreEquationTG (s : ℝ) : IsTopologicalAddGroup (D.localizers.RealSobolev s) := + Submodule.isTopologicalAddGroup _ +local instance cofactorCoreEquationCS (s : ℝ) : ContinuousSMul ℝ (D.localizers.RealSobolev s) := + SMulMemClass.continuousSMul _ + +omit [ConnectedSpace X] in +lemma cofactor_core_forcing (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (p : ι) (φ ψ : RealSmooth A) : + schwartzCoord (k:ℝ) (SchwartzMap.smulLeftCLM ℂ (D.weightCore p) + (schwartzDifferential (extendedCoefficient (D.patch p).matrix + (coefficientBCF (D.cofactorLocalCore p · · φ.val))) (D.outerCore p ψ.val))) = + (D.realVolumeDerivative k hk (D.localizers.realEmbed ((k:ℝ)+2) φ) + (D.localizers.realEmbed ((k:ℝ)+2) ψ)).val.val p := by + have hs : (Module.finrank ℝ (EC d):ℝ) < 2*(k:ℝ) := by + have hh : (Module.finrank ℝ (EC d):ℝ) < (k:ℝ) := by exact_mod_cast hk + linarith [Nat.cast_nonneg (α:=ℝ) k] + apply realize_injective (k:ℝ) + rw [← strongEmbedding_distribution (k:ℝ) hs,← strongEmbedding_distribution (k:ℝ) hs] + congr 1 + ext y + rw [strongEmbedding_schwartz,SchwartzMap.toBoundedContinuousFunction_apply,D.localizers.strong_localized (k:ℝ) hs, + SchwartzMap.smulLeftCLM_apply_apply (D.weightCore p).hasTemperateGrowth,smul_eq_mul, + D.weightCore_apply,D.index_eq] + split_ifs with hy + · by_cases hw : D.localizers.weight p ((A.euclideanChart (D.patch p).index).symm y) = 0 + · rw [hw,zero_mul,zero_mul] + · have hx := subset_tsupport (D.localizers.weight p : X → ℂ) hw + have he := (A.euclideanChart (D.patch p).index).right_inv hy + have hh := D.cofactorDifferential_source p φ.source ψ.source hx + rw [φ.ofReal_source,ψ.ofReal_source,he] at hh + rw [hh] + congr 1 + have hv := D.completedVolumeDerivative_source k hk φ.source ψ.source (D.patch p).index + (x:=((A.euclideanChart (D.patch p).index).symm y)) (by simpa using D.patch_source p hx) + rw [φ.ofReal_source,ψ.ofReal_source] at hv + rw [← hv] + have hd := D.realVolumeDerivative_val k hk + (D.localizers.realEmbed ((k:ℝ)+2) φ) (D.localizers.realEmbed ((k:ℝ)+2) ψ) + simp only [Localizers.realEmbed_val] at hd + simp only [← hd] + apply Complex.ext + · rfl + · exact (D.localizers.real_strong hs _ _).symm + · exact zero_mul _ + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/CofactorLocalization.lean b/lean/OAI/Geometry/PrescribedRicci/CofactorLocalization.lean new file mode 100644 index 0000000000000000000000000000000000000000..0fcdb200c016db266e4c48f137a8aa7d0ceb2490 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/CofactorLocalization.lean @@ -0,0 +1,112 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.CofactorBilin +import OAI.Geometry.PrescribedRicci.CofactorCore +import OAI.Geometry.PrescribedPotential.GlobalHessian + +namespace OAI + +/-! Cofactor Localization. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix _root_.MeasureTheory _root_.OAI.MeasureTheory +open scoped ContDiff SchwartzMap Classical BoundedContinuousFunction Matrix.Norms.Elementwise +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart FrozenPoisson MetricLocalization +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +def outerCore (p : ι) (f : Smooth A) : 𝓢(EC d,ℂ) := + localize A (D.patch p).index (cutoffGlobal (D.patch p).index (D.outerCutoff p)) + (cutoffGlobal_support _ _) f + +def weightCore (p : ι) : 𝓢(EC d,ℂ) := D.forcing p (Smooth.const 1) + +lemma outerCore_eventually (p : ι) (f : Smooth A) {x : X} + (hx : x ∈ tsupport (D.localizers.weight p : X → ℂ)) : + (D.outerCore p f : EC d → ℂ) =ᶠ[𝓝 (A.euclideanChart (D.patch p).index x)] + f ∘ (A.euclideanChart (D.patch p).index).symm := + localize_cutoff_eventually _ (D.cutoff p) (D.outerCutoff p) (D.outerCutoff_one p) f + ((A.euclideanChart _).mapsTo (D.patch_source p hx)) + (by rw [D.cutoff_one p x hx]; exact one_ne_zero) + +lemma outerHessian_source (p : ι) (i j : Fin d) (φ : SmoothRealFunction A) {x : X} + (hx : x ∈ tsupport (D.localizers.weight p : X → ℂ)) : + hessianEntrySchwartz i j (D.outerCore p (Smooth.ofReal φ)) + (A.euclideanChart (D.patch p).index x) = + φ.hessian (D.patch p).index (A.chart (D.patch p).index x) i j := by + have hh := D.localizedHessian_source p i j φ hx + change globalize (D.patch p).index (D.cutoff p) + (hessianEntrySchwartz i j (D.outerCore p (Smooth.ofReal φ))) x = _ at hh + rw [globalize_apply,ite_eq_left (D.patch_source p hx),D.cutoff_one p x hx,one_mul] at hh + exact hh + +lemma cofactorDifferential_source (p : ι) (φ ψ : SmoothRealFunction A) {x : X} + (hx : x ∈ tsupport (D.localizers.weight p : X → ℂ)) : + schwartzDifferential + (extendedCoefficient (D.patch p).matrix (coefficientBCF (D.cofactorLocalCore p · · (Smooth.ofReal φ)))) + (D.outerCore p (Smooth.ofReal ψ)) (A.euclideanChart (D.patch p).index x) = + (((g.matrix (D.patch p).index (A.chart (D.patch p).index x)).det⁻¹ * + NonlinearHessian.detDifferential + (g.matrix (D.patch p).index (A.chart (D.patch p).index x) + + φ.hessian (D.patch p).index (A.chart (D.patch p).index x)) + (ψ.hessian (D.patch p).index (A.chart (D.patch p).index x))).re : ℂ) := by + let q := (D.patch p).index + let e := A.euclideanChart q + let U := ψ.localExpression q ∘ coordinateEquiv d + have hs := D.patch_source p hx + have ht := e.mapsTo hs + have hU : ContDiffAt ℝ ∞ U (e x) := (ψ.euclidean_smooth q).contDiffAt + (by simpa only [e,ComplexAtlas.euclideanChart_target] using e.open_target.mem_nhds ht) + have he : (D.outerCore p (Smooth.ofReal ψ) : EC d → ℂ) =ᶠ[𝓝 (e x)] Complex.ofRealCLM ∘ U := + D.outerCore_eventually p (Smooth.ofReal ψ) hx + rw [schwartzDifferential_apply _ (extendedCoefficient_temperate _ _ + (fun i j => (D.cofactorLocalCore p i j (Smooth.ofReal φ)).hasTemperateGrowth))] + simp_rw [D.cofactorLocalCore_source p _ _ _ hx,D.cofactorScalarCore_apply, + D.metricEntry_apply p _ _ hx,D.inverseDet_apply p hx,D.localizedHessian_source p _ _ φ hx] + have hh := cofactor_smooth_expression hU (D.outerCore p (Smooth.ofReal ψ)) he + (g.matrix q (A.chart q x)).det⁻¹ + (g.matrix q (A.chart q x)+φ.hessian q (A.chart q x)) + dsimp only [q,e] at hh + simp_rw [D.outerHessian_source p _ _ ψ hx] at hh + exact hh.symm + +lemma weightCore_apply (p : ι) (y : EC d) : D.weightCore p y = + if y ∈ (A.euclideanChart (D.patch p).index).target then + D.localizers.weight p ((A.euclideanChart (D.patch p).index).symm y) else 0 := by + change localize A (D.localizers.index p) (D.localizers.weight p) (D.localizers.support_sub p) + (Smooth.const 1) y = _ + simp only [localize_apply,localizeFun,D.index_eq] + have hc (z : X) : (Smooth.const (A:=A) 1) z = 1 := rfl + simp only [hc,mul_one] + +lemma weightCore_outerCore (p : ι) (f : Smooth A) : + SchwartzMap.smulLeftCLM ℂ (D.weightCore p) (D.outerCore p f) = D.forcing p f := by + ext y + rw [SchwartzMap.smulLeftCLM_apply_apply (D.weightCore p).hasTemperateGrowth,smul_eq_mul, + D.weightCore_apply] + change _ = localizeFun A (D.localizers.index p) (D.localizers.weight p) f y + simp only [localizeFun,D.index_eq] + split_ifs with hy + · by_cases hw : D.localizers.weight p ((A.euclideanChart (D.patch p).index).symm y) = 0 + · rw [hw,zero_mul,zero_mul] + · have hx := subset_tsupport (D.localizers.weight p : X → ℂ) hw + have he := (A.euclideanChart (D.patch p).index).right_inv hy + have hh := (D.outerCore_eventually p f hx).self_of_nhds + rw [he] at hh + rw [hh] + rfl + · exact zero_mul _ + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/CofactorWeakEquation.lean b/lean/OAI/Geometry/PrescribedRicci/CofactorWeakEquation.lean new file mode 100644 index 0000000000000000000000000000000000000000..562e417ef728829a270329f89d48ef79d5f5f54b --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/CofactorWeakEquation.lean @@ -0,0 +1,197 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.NonlinearScale +import OAI.Geometry.PrescribedRicci.CofactorCore +import OAI.Geometry.PrescribedRicci.CofactorCoreEquation +import OAI.Geometry.PrescribedRicci.RoughCutoff +import OAI.Geometry.PrescribedRicci.TameApproximation + +namespace OAI + +/-! Cofactor Weak Equation. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix _root_.MeasureTheory _root_.OAI.MeasureTheory TemperedDistribution +open scoped ContDiff SchwartzMap Classical BoundedContinuousFunction Matrix.Norms.Elementwise +namespace MetricLocalization +open EllipticKernel SobolevChart FrozenPoisson +lemma cofactor_cutoff_distribution {n : ℕ} (H : Matrix (Fin n) (Fin n) ℂ) + (a : SmoothCoefficients (BasisIndex n) (EC n)) (κ f : 𝓢(EC n,ℂ)) : + frozenDifferential H (SchwartzMap.toTemperedDistributionCLM (EC n) ℂ volume + (SchwartzMap.smulLeftCLM ℂ κ f)) + + (Lp.toTemperedDistributionCLM ℂ volume 2 + (perturbation (stdOrthonormalBasis ℝ (EC n)) (coefficientBCF a) + (schwartzCoord 2 (SchwartzMap.smulLeftCLM ℂ κ f)))) = + SchwartzMap.toTemperedDistributionCLM (EC n) ℂ volume + (SchwartzMap.smulLeftCLM ℂ κ (schwartzDifferential (extendedCoefficient H (coefficientBCF a)) f)) + + SchwartzMap.toTemperedDistributionCLM (EC n) ℂ volume + (schwartzCutoffError (extendedCoefficient H (coefficientBCF a)) κ f) := by + change frozenDifferential H (SchwartzMap.toTemperedDistributionCLM (EC n) ℂ volume + (SchwartzMap.smulLeftCLM ℂ κ f)) + + ((perturbation (stdOrthonormalBasis ℝ (EC n)) (coefficientBCF a) + (schwartzCoord 2 (SchwartzMap.smulLeftCLM ℂ κ f)) : L2 (EC n)) : 𝓢'(EC n,ℂ)) = _ + rw [← realize_schwartzCoord 2 (SchwartzMap.smulLeftCLM ℂ κ f), + ← chartDifferential_extension H (coefficientBCF a) (fun i j => (a i j).hasTemperateGrowth), + realize_schwartzCoord,← schwartzDifferential_distribution _ + (extendedCoefficient_temperate H (coefficientBCF a) (fun i j => (a i j).hasTemperateGrowth)),← map_add] + congr 1 + change schwartzDifferential (extendedCoefficient H (coefficientBCF a)) + (SchwartzMap.smulLeftCLM ℂ κ f) = + SchwartzMap.smulLeftCLM ℂ κ (schwartzDifferential (extendedCoefficient H (coefficientBCF a)) f) + + (schwartzDifferential (extendedCoefficient H (coefficientBCF a)) (SchwartzMap.smulLeftCLM ℂ κ f) - + SchwartzMap.smulLeftCLM ℂ κ (schwartzDifferential (extendedCoefficient H (coefficientBCF a)) f)) + abel +end MetricLocalization + +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart FrozenPoisson MetricLocalization +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) +local instance cofactorWeakEquationNG (s : ℝ) : NormedAddCommGroup (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedAddCommGroup +local instance cofactorWeakEquationNS (s : ℝ) : NormedSpace ℝ (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedSpace +local instance cofactorWeakEquationTG (s : ℝ) : IsTopologicalAddGroup (D.localizers.RealSobolev s) := + Submodule.isTopologicalAddGroup _ +local instance cofactorWeakEquationCS (s : ℝ) : ContinuousSMul ℝ (D.localizers.RealSobolev s) := + SMulMemClass.continuousSMul _ + +def outerCompleted (s : ℝ) (p : ι) : D.localizers.Sobolev s →L[ℝ] L2 (EC d) := + D.completedLocalize s (D.patch p).index (cutoffGlobal (D.patch p).index (D.outerCutoff p)) + (cutoffGlobal_support _ _) + +lemma outerCompleted_embed (k : ℕ) (p : ι) (f : Smooth A) : + D.outerCompleted (k:ℝ) p (D.localizers.embed (k:ℝ) f) = + schwartzCoord (k:ℝ) (D.outerCore p f) := + D.completedLocalize_embed k _ _ _ f + +lemma outerCompleted_embed_add_two (k : ℕ) (p : ι) (f : Smooth A) : + D.outerCompleted ((k:ℝ)+2) p (D.localizers.embed ((k:ℝ)+2) f) = + schwartzCoord ((k:ℝ)+2) (D.outerCore p f) := by + have hh := D.outerCompleted_embed (k+2) p f + have he : ((k+2:ℕ):ℝ) = (k:ℝ)+2 := by push_cast; rfl + rw [he] at hh + exact hh + +abbrev CofactorPair (k : ℕ) := + D.localizers.RealSobolev (((k+1:ℕ):ℝ)+2) × D.localizers.RealSobolev ((k:ℝ)+2) + +def cofactorWeakLeft (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (hs : (Module.finrank ℝ (EC d):ℝ) < 2*((k+1:ℕ):ℝ)) (p : ι) + (z : D.CofactorPair k) : 𝓢'(EC d,ℂ) := + frozenDifferential (D.patch p).matrix (D.localizers.distribution ((k:ℝ)+2) p z.2.val) + + (Lp.toTemperedDistributionCLM ℂ volume 2) + (perturbation (stdOrthonormalBasis ℝ (EC d)) (D.cofactorBCF (k+1) (by omega) hs p z.1.val) + (lowerCoord ((k:ℝ)+2) 2 (by linarith [Nat.cast_nonneg (α:=ℝ) k]) (z.2.val.val p))) + +def cofactorWeakRight (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (p : ι) + (z : D.CofactorPair k) : 𝓢'(EC d,ℂ) := + D.localizers.distribution (k:ℝ) p ((D.realVolumeDerivative k hk + (D.localizers.realLower (((k+1:ℕ):ℝ)+2) ((k:ℝ)+2) (by push_cast; linarith) z.1) z.2).val) + + realize ((k+1:ℕ):ℝ) (roughCutoff (D.patch p).matrix (k+1) (by omega) (D.weightCore p) + (fun i j => D.cofactorLocal (k+1) (by omega) p i j z.1.val) + (lowerCoord ((k:ℝ)+2) (((k+1:ℕ):ℝ)+1) (by push_cast; linarith) + (D.outerCompleted ((k:ℝ)+2) p z.2.val))) + +lemma cofactorWeakLeft_continuous (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (hs : (Module.finrank ℝ (EC d):ℝ) < 2*((k+1:ℕ):ℝ)) (p : ι) : + Continuous (D.cofactorWeakLeft k hk hs p) := by + have hw : Continuous (fun z : D.CofactorPair k => z.2.val) := + continuous_subtype_val.comp continuous_snd + have hwp : Continuous (fun z : D.CofactorPair k => z.2.val.val p) := + (continuous_apply p).comp (continuous_subtype_val.comp hw) + have hu : Continuous (fun z : D.CofactorPair k => z.1.val) := + continuous_subtype_val.comp continuous_fst + have hc : Continuous (fun z : D.CofactorPair k => D.cofactorBCF (k+1) (by omega) hs p z.1.val) := + (D.cofactorBCF_continuous (k+1) (by omega) hs p).comp hu + have hl : Continuous (fun z : D.CofactorPair k => + lowerCoord ((k:ℝ)+2) 2 (by linarith [Nat.cast_nonneg (α:=ℝ) k]) (z.2.val.val p)) := + (lowerCoord ((k:ℝ)+2) 2 (by linarith [Nat.cast_nonneg (α:=ℝ) k])).continuous.comp hwp + have hp := (continuous_perturbation (stdOrthonormalBasis ℝ (EC d))).comp (hc.prodMk hl) + exact ((frozenDifferential (D.patch p).matrix).continuous.comp + ((D.localizers.distribution ((k:ℝ)+2) p).continuous.comp hw)).add + ((Lp.toTemperedDistributionCLM ℂ volume 2).continuous.comp hp) + +lemma cofactorCutoff_continuous (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (p : ι) : + Continuous (fun z : D.CofactorPair k => + roughCutoff (D.patch p).matrix (k+1) (by omega) (D.weightCore p) + (fun i j => D.cofactorLocal (k+1) (by omega) p i j z.1.val) + (lowerCoord ((k:ℝ)+2) (((k+1:ℕ):ℝ)+1) (by push_cast; linarith) + (D.outerCompleted ((k:ℝ)+2) p z.2.val))) := by + have ha : Continuous (fun z : D.CofactorPair k => + fun i j => D.cofactorLocal (k+1) (by omega) p i j z.1.val) := by + apply continuous_pi + intro i + apply continuous_pi + intro j + exact (D.cofactorLocal_continuous (k+1) (by omega) p i j).comp + (continuous_subtype_val.comp continuous_fst) + have hw : Continuous (fun z : D.CofactorPair k => + lowerCoord ((k:ℝ)+2) (((k+1:ℕ):ℝ)+1) (by push_cast; linarith) + (D.outerCompleted ((k:ℝ)+2) p z.2.val)) := + (lowerCoord ((k:ℝ)+2) (((k+1:ℕ):ℝ)+1) (by push_cast; linarith)).continuous.comp + ((D.outerCompleted ((k:ℝ)+2) p).continuous.comp (continuous_subtype_val.comp continuous_snd)) + have hp := ha.prodMk hw + have hc := roughCutoff_continuous (D.patch p).matrix (k+1) (by omega) (D.weightCore p) + have hr := hc.comp hp + exact hr + +lemma cofactorWeakRight_continuous (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (p : ι) : + Continuous (D.cofactorWeakRight k hk p) := by + have hu : Continuous (fun z : D.CofactorPair k => + D.localizers.realLower (((k+1:ℕ):ℝ)+2) ((k:ℝ)+2) (by push_cast; linarith) z.1) := + (D.localizers.realLower (((k+1:ℕ):ℝ)+2) ((k:ℝ)+2) (by push_cast; linarith)).continuous.comp continuous_fst + have hv : Continuous (fun z : D.CofactorPair k => D.realVolumeDerivative k hk + (D.localizers.realLower (((k+1:ℕ):ℝ)+2) ((k:ℝ)+2) (by push_cast; linarith) z.1) z.2) := + ((D.realVolumeDerivative_continuous k hk).comp hu).clm_apply continuous_snd + have h₁ := (D.localizers.distribution (k:ℝ) p).continuous.comp (continuous_subtype_val.comp hv) + exact h₁.add ((realize ((k+1:ℕ):ℝ)).continuous.comp (D.cofactorCutoff_continuous k hk p)) + +lemma cofactorWeak_core (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (hs : (Module.finrank ℝ (EC d):ℝ) < 2*((k+1:ℕ):ℝ)) (p : ι) (φ ψ : RealSmooth A) : + D.cofactorWeakLeft k hk hs p (D.localizers.realEmbed (((k+1:ℕ):ℝ)+2) φ, + D.localizers.realEmbed ((k:ℝ)+2) ψ) = + D.cofactorWeakRight k hk p (D.localizers.realEmbed (((k+1:ℕ):ℝ)+2) φ, + D.localizers.realEmbed ((k:ℝ)+2) ψ) := by + dsimp only [cofactorWeakLeft,cofactorWeakRight,Prod.fst,Prod.snd,Localizers.realEmbed_val] + rw [D.cofactorBCF_embed,D.outerCompleted_embed_add_two,lowerCoord_schwartz, + Localizers.realLower_embed] + simp_rw [D.cofactorLocal_embed] + rw [roughCutoff_schwartz,realize_schwartzCoord] + change _ = realize (k:ℝ) ((D.realVolumeDerivative k hk + (D.localizers.realEmbed ((k:ℝ)+2) φ) (D.localizers.realEmbed ((k:ℝ)+2) ψ)).val.val p) + _ + rw [← D.cofactor_core_forcing k hk p φ ψ,realize_schwartzCoord, + D.localizers.distribution_embed] + change frozenDifferential _ (SchwartzMap.toTemperedDistributionCLM (EC d) ℂ volume (D.forcing p ψ.val)) + + ((Lp.toTemperedDistributionCLM ℂ volume 2) (perturbation _ _ + (lowerCoord ((k:ℝ)+2) 2 (by linarith [Nat.cast_nonneg (α:=ℝ) k]) + (schwartzCoord ((k:ℝ)+2) (D.forcing p ψ.val))))) = _ + rw [lowerCoord_schwartz,← D.weightCore_outerCore p ψ.val] + exact cofactor_cutoff_distribution (D.patch p).matrix (D.cofactorLocalCore p · · φ.val) + (D.weightCore p) (D.outerCore p ψ.val) + +lemma cofactor_weak_equation (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (hs : (Module.finrank ℝ (EC d):ℝ) < 2*((k+1:ℕ):ℝ)) (p : ι) + (u : D.localizers.RealSobolev (((k+1:ℕ):ℝ)+2)) + (w : D.localizers.RealSobolev ((k:ℝ)+2)) : + D.cofactorWeakLeft k hk hs p (u,w) = D.cofactorWeakRight k hk p (u,w) := by + have he : D.cofactorWeakLeft k hk hs p = D.cofactorWeakRight k hk p := by + apply ((D.localizers.realEmbed_dense (((k+1:ℕ):ℝ)+2)).prodMap + (D.localizers.realEmbed_dense ((k:ℝ)+2))).equalizer + (D.cofactorWeakLeft_continuous k hk hs p) (D.cofactorWeakRight_continuous k hk p) + funext z + exact D.cofactorWeak_core k hk hs p z.1 z.2 + exact congr_fun he (u,w) + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/CompactParameterIntegral.lean b/lean/OAI/Geometry/PrescribedRicci/CompactParameterIntegral.lean new file mode 100644 index 0000000000000000000000000000000000000000..003f421dbdf89df1b6ffebbceaf4c10c4eedc331 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/CompactParameterIntegral.lean @@ -0,0 +1,46 @@ +import Mathlib + +namespace OAI + +/-! Compact Parameter Integral. -/ + +noncomputable section +open Set Filter Topology MeasureTheory +namespace KahlerCalculus +variable {E : Type*} [TopologicalSpace E] [T2Space E] + [MeasurableSpace E] [BorelSpace E] {μ : Measure E} [IsFiniteMeasureOnCompacts μ] + +lemma hasDerivAt_integral_compact {F F' : ℝ → E → ℝ} {K : Set E} + (hK : IsCompact K) (hF : Continuous (Function.uncurry F)) + (hF' : Continuous (Function.uncurry F')) + (hs : ∀ t, Function.support (F t) ⊆ K) + (hs' : ∀ t, Function.support (F' t) ⊆ K) + (hd : ∀ t z, HasDerivAt (fun s => F s z) (F' t z) t) (t : ℝ) : + HasDerivAt (fun s => ∫ z, F s z ∂μ) (∫ z, F' t z ∂μ) t := by + have hfc (s : ℝ) : Continuous (F s) := hF.comp (continuous_const.prodMk continuous_id) + have hfc' (s : ℝ) : Continuous (F' s) := hF'.comp (continuous_const.prodMk continuous_id) + have hfi (s : ℝ) : Integrable (F s) μ := (hfc s).integrable_of_hasCompactSupport + (HasCompactSupport.of_support_subset_isCompact hK (hs s)) + obtain ⟨C, hC⟩ := (isCompact_Icc (a := t - 1) (b := t + 1)).prod hK + |>.exists_bound_of_continuousOn hF'.continuousOn + let B : E → ℝ := K.indicator (fun _ => max C 0) + have hB : Integrable B μ := by + apply (integrable_indicator_iff hK.measurableSet).mpr + exact integrableOn_const hK.measure_lt_top.ne + refine (hasDerivAt_integral_of_dominated_loc_of_deriv_le + (Ioo_mem_nhds (by linarith : t - 1 < t) (by linarith : t < t + 1)) + (Filter.Eventually.of_forall (fun s => (hfc s).aestronglyMeasurable)) (hfi t) + (hfc' t).aestronglyMeasurable ?_ hB ?_).2 + · filter_upwards [] with z s hst + by_cases hz : z ∈ K + · exact (hC (s, z) ⟨⟨hst.1.le, hst.2.le⟩, hz⟩).trans + (by simpa only [B, Set.indicator_of_mem hz] using le_max_left C 0) + · have he : F' s z = 0 := Function.notMem_support.mp (fun hn => hz (hs' s hn)) + simp only [he, norm_zero, B, Set.indicator_of_notMem hz, le_refl] + · exact Filter.Eventually.of_forall (fun z s _ => hd s z) + +end KahlerCalculus + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/CompactPathBounds.lean b/lean/OAI/Geometry/PrescribedRicci/CompactPathBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..6867a283e8c883a8ebc5b3d26f8d128c2a8e2d69 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/CompactPathBounds.lean @@ -0,0 +1,91 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalSobolev +import OAI.Geometry.PrescribedRicci.MatrixCompactBounds +import OAI.Geometry.PrescribedRicci.TraceEntryBounds +import OAI.Geometry.PrescribedPotential.VolumePath +import OAI.Geometry.PrescribedRicci.CurvatureCompactBounds +import OAI.Geometry.PrescribedRicci.KahlerVolumeVariation +import OAI.Geometry.PrescribedRicci.MongeAmpereL2 +import OAI.Geometry.PrescribedRicci.TraceMaximum + +namespace OAI + +/-! Compact Path Bounds. -/ + +section + + + +noncomputable section +open Matrix Set Filter Topology +open scoped ContDiff ComplexOrder MatrixOrder Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth.KaehlerMetric +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} + +theorem volumePath_metric_bounds_on_compact (g : KaehlerMetric A) (line : SemipositiveAnticanonicalMetric A) + (hd : 2 ≤ d) (q : Fin A.count) {L : Set (Coordinates d)} + (hL : IsCompact L) (hLt : L ⊆ (A.chart q).target) : ∃ K : ℝ, 0 < K ∧ + ∀ (φ : SmoothRealFunction A) (hp : g.PositivePotential φ), g.integral φ.value = 0 → + ∀ (t b : ℝ), t ∈ Icc (0:ℝ) 1 → + (∀ x, (g.logRatio (g.deform φ hp)).value x = t*(prescribedForcing g line).value x+b) → + ∀ z ∈ L, ‖(g.deform φ hp).matrix q z‖ ≤ K ∧ + ‖((g.deform φ hp).matrix q z)⁻¹‖ ≤ K := by + have hd' : 0 < d := by omega + let : Nonempty (Fin d) := Fin.pos_iff_nonempty.mp hd' + obtain ⟨T,hT,htrace⟩ := g.volumePath_trace_bound line hd + obtain ⟨m,hm⟩ := hL.bddAbove_image + ((g.backgroundSize_continuousOn (prescribedForcing g line) q).mono hLt) + let M := max 1 m + have hM : 1 ≤ M := le_max_left _ _ + have hbg (z : Coordinates d) (hz : z ∈ L) : + g.BackgroundComponentBound (prescribedForcing g line) q z M := + g.backgroundComponents_of_size _ q z ((hm (mem_image_of_mem _ hz)).trans (le_max_right _ _)) + have hM0 : 0 ≤ M := by linarith + obtain ⟨D,hD,hdet⟩ := MongeAmpere.compact_matrix_bound + (show Continuous (fun H : Matrix (Fin d) (Fin d) ℂ => H.det.re) from + Complex.continuous_re.comp continuous_id.matrix_det) M + obtain ⟨Q,hQ,hmetric⟩ := MongeAmpere.metric_norm_bound_from_inverse (n:=Fin d) (M*T) + let E := Real.exp (2*‖(⟨(prescribedForcing g line).value, + (prescribedForcing g line).continuous⟩ : C(X,ℝ))‖) + have hE : 0 < E := Real.exp_pos _ + refine ⟨1+M*T+E*D*Q,by positivity,?_⟩ + intro φ hp hmean t b ht heq z hzL + have hz := hLt hzL + let x := (A.chart q).symm z + have hxs := (A.chart q).map_target hz + have hxz : A.chart q x = z := (A.chart q).right_inv hz + let H := (g.deform φ hp).matrix q z + have hH := (g.deform φ hp).positive q z hz + have hbi : ‖H⁻¹‖ ≤ M*T := by + apply MongeAmpere.matrix_norm_le_of_entries (mul_nonneg hM0 hT.le) + intro i j + have hi := MongeAmpere.entry_le_relative_trace H⁻¹ (g.matrix q z) hH.inv + (g.positive q _ hz) hM0 + (fun i => (Complex.re_le_norm _).trans ((hbg z hzL).2.1 i i)) i j + have hs := htrace φ hp hmean t b ht heq x + change (g.deform φ hp).traceMetricValue g x ≤ T at hs + rw [(g.deform φ hp).traceMetricValue_local g q hxs,hxz] at hs + exact hi.trans (mul_le_mul_of_nonneg_left hs hM0) + have hdh : H.det.re ≤ E*D := by + have hv := g.density_mul_volume φ q hz + change (g.potentialDensity φ).value x*(g.matrix q z).det.re = H.det.re at hv + rw [← hv] + have hρ := (g.volumePath_density_bounds line ht hp heq x).2 + change (g.potentialDensity φ).value x ≤ E at hρ + exact mul_le_mul hρ + (hdet _ (MongeAmpere.matrix_norm_le_of_entries hM0 (hbg z hzL).1)) + (Complex.pos_iff.mp (g.positive q _ hz).det_pos).1.le hE.le + constructor + · have hb := (hmetric H hH hbi).trans (mul_le_mul_of_nonneg_right hdh hQ.le) + change ‖H‖ ≤ _ + nlinarith [mul_nonneg hM0 hT.le] + · change ‖H⁻¹‖ ≤ _ + nlinarith [mul_nonneg (mul_nonneg hE.le hD.le) hQ.le] + +end Anticanonical.SourceSmooth.KaehlerMetric + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/CompactPathRicci.lean b/lean/OAI/Geometry/PrescribedRicci/CompactPathRicci.lean new file mode 100644 index 0000000000000000000000000000000000000000..1d34a50e6208287d4c74cc3ca8070f49406da966 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/CompactPathRicci.lean @@ -0,0 +1,102 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.ChernLuAlgebra +import OAI.Geometry.PrescribedRicci.CurvatureCompactBounds +import OAI.Geometry.PrescribedRicci.VolumePathRicci +import OAI.Geometry.PrescribedPotential.VolumePath + +namespace OAI + +/-! Compact Path Ricci. -/ + +section + + + +noncomputable section +open Matrix Set Filter Topology +open scoped ContDiff ComplexOrder MatrixOrder Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth.KaehlerMetric +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +lemma volumePath_holDerivative_congr {f h : Coordinates d → Matrix (Fin d) (Fin d) ℂ} + {z : Coordinates d} (he : f =ᶠ[nhds z] h) (a : Fin d) : + holDerivative f z a = holDerivative h z a := by unfold holDerivative; rw [he.fderiv_eq] + +lemma holDerivative_sub_smul {f h : Coordinates d → Matrix (Fin d) (Fin d) ℂ} + {z : Coordinates d} (hf : DifferentiableAt ℝ f z) (hh : DifferentiableAt ℝ h z) + (t : ℂ) (a : Fin d) : + holDerivative (fun y => f y-t • h y) z a = holDerivative f z a-t • holDerivative h z a := by + unfold holDerivative + have he : fderiv ℝ (fun y => f y-t • h y) z = fderiv ℝ f z-t • fderiv ℝ h z := by + convert! (hf.hasFDerivAt.sub (hh.hasFDerivAt.const_smul t)).fderiv using 1 + rw [he] + simp only [_root_.sub_apply,_root_.smul_apply,smul_sub, + smul_smul] + module + +lemma volumePath_ricci_hol (g : KaehlerMetric A) (line : SemipositiveAnticanonicalMetric A) + {t b : ℝ} {φ : SmoothRealFunction A} (hp : g.PositivePotential φ) + (heq : ∀ x, (g.logRatio (g.deform φ hp)).value x = + t*(prescribedForcing g line).value x+b) + (q : Fin A.count) {z : Coordinates d} (hz : z ∈ (A.chart q).target) (a : Fin d) : + holDerivative ((g.deform φ hp).curvatureRicci q) z a = + holDerivative (g.curvatureRicci q) z a- + (t:ℂ) • holDerivative ((prescribedForcing g line).hessian q) z a := by + have he := Filter.eventually_of_mem ((A.chart q).open_target.mem_nhds hz) + (fun y hy => g.volumePath_ricci line hp heq q hy) + rw [volumePath_holDerivative_congr he,holDerivative_sub_smul + ((g.curvatureRicci_smooth q hz).differentiableAt (by simp)) + ((((prescribedForcing g line).hessian_smooth q).contDiffAt + ((A.chart q).open_target.mem_nhds hz)).differentiableAt (by simp))] + +lemma volumePath_ricci_bounds_on_compact (g : KaehlerMetric A) + (line : SemipositiveAnticanonicalMetric A) (q : Fin A.count) {L : Set (Coordinates d)} + (hL : IsCompact L) (hLt : L ⊆ (A.chart q).target) : + ∃ R : ℝ, 0 < R ∧ ∀ (φ : SmoothRealFunction A) (hp : g.PositivePotential φ) + (t b : ℝ), t ∈ Icc (0:ℝ) 1 → + (∀ x, (g.logRatio (g.deform φ hp)).value x = t*(prescribedForcing g line).value x+b) → + ∀ z ∈ L, ‖(g.deform φ hp).curvatureRicci q z‖ ≤ R ∧ + ∀ a, ‖holDerivative ((g.deform φ hp).curvatureRicci q) z a‖ ≤ R := by + let F := prescribedForcing g line + let size : Coordinates d → ℝ := fun z => ‖g.curvatureRicci q z‖+‖F.hessian q z‖+ + ‖holDerivative (g.curvatureRicci q) z‖+‖holDerivative (F.hessian q) z‖ + have hs : ContinuousOn size L := by + intro z hz + have hR := g.curvatureRicci_smooth q (hLt hz) + have hF := (F.hessian_smooth q).contDiffAt ((A.chart q).open_target.mem_nhds (hLt hz)) + have hdR : ContDiffAt ℝ ∞ (fun y => holDerivative (g.curvatureRicci q) y) z := + contDiffAt_pi.mpr (fun a => contDiffAt_holDerivative hR a) + have hdF : ContDiffAt ℝ ∞ (fun y => holDerivative (F.hessian q) y) z := + contDiffAt_pi.mpr (fun a => contDiffAt_holDerivative hF a) + exact (((hR.continuousAt.norm.add hF.continuousAt.norm).add hdR.continuousAt.norm).add + hdF.continuousAt.norm).continuousWithinAt + obtain ⟨r,hr⟩ := hL.bddAbove_image hs + refine ⟨1+max 0 r,by positivity,?_⟩ + intro φ hp t b ht heq z hz + have htr : ‖(t:ℂ)‖ ≤ 1 := by simpa only [Complex.norm_real,Real.norm_eq_abs,abs_of_nonneg ht.1] using ht.2 + have hb : size z ≤ 1+max 0 r := (hr (mem_image_of_mem _ hz)).trans (by linarith [le_max_right (0:ℝ) r]) + constructor + · rw [g.volumePath_ricci line hp heq q (hLt hz)] + apply (norm_sub_le _ _).trans + rw [norm_smul] + have hn := mul_le_mul_of_nonneg_right htr (norm_nonneg (F.hessian q z)) + change ‖g.curvatureRicci q z‖+‖(t:ℂ)‖*‖F.hessian q z‖ ≤ _ + dsimp [size] at hb + linarith [norm_nonneg (holDerivative (g.curvatureRicci q) z),norm_nonneg (holDerivative (F.hessian q) z)] + · intro a + rw [g.volumePath_ricci_hol line hp heq q (hLt hz) a] + apply (norm_sub_le _ _).trans + rw [norm_smul] + have hn := mul_le_mul_of_nonneg_right htr (norm_nonneg (holDerivative (F.hessian q) z a)) + have h1 := norm_le_pi_norm (holDerivative (g.curvatureRicci q) z) a + have h2 := norm_le_pi_norm (holDerivative (F.hessian q) z) a + change ‖holDerivative (g.curvatureRicci q) z a‖+‖(t:ℂ)‖*‖holDerivative (F.hessian q) z a‖ ≤ _ + dsimp [size] at hb + linarith [norm_nonneg (g.curvatureRicci q z),norm_nonneg (F.hessian q z)] + +end Anticanonical.SourceSmooth.KaehlerMetric + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/ComplexIntegrationByParts.lean b/lean/OAI/Geometry/PrescribedRicci/ComplexIntegrationByParts.lean new file mode 100644 index 0000000000000000000000000000000000000000..8903f72ec77def90f027c5e47794ba84724a8106 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/ComplexIntegrationByParts.lean @@ -0,0 +1,132 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalSobolev +import OAI.Geometry.PrescribedRicci.KahlerCofactorDivergence + +namespace OAI + +/-! Complex Integration By Parts. -/ + +noncomputable section +open Matrix Filter Set Topology MeasureTheory +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth +namespace KaehlerMetric +variable {d : ℕ} + +def barDeriv (f : Coordinates d → ℂ) (z : Coordinates d) (j : Fin d) : ℂ := + (2 : ℂ)⁻¹ * (fderiv ℝ f z (coordinateVector j) + + Complex.I * fderiv ℝ f z (Complex.I • coordinateVector j)) + +def holDeriv (f : Coordinates d → ℂ) (z : Coordinates d) (j : Fin d) : ℂ := + (2 : ℂ)⁻¹ * (fderiv ℝ f z (coordinateVector j) - + Complex.I * fderiv ℝ f z (Complex.I • coordinateVector j)) + +lemma contDiff_deriv_direction {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] {f : E → F} + (hf : ContDiff ℝ ∞ f) (v : E) : ContDiff ℝ ∞ (fun z => fderiv ℝ f z v) := + (hf.fderiv_right (by simp)).clm_apply contDiff_const + +lemma contDiff_barDeriv {f : Coordinates d → ℂ} (hf : ContDiff ℝ ∞ f) (j : Fin d) : + ContDiff ℝ ∞ (fun z => barDeriv f z j) := + contDiff_const.mul ((contDiff_deriv_direction hf _).add + (contDiff_const.mul (contDiff_deriv_direction hf _))) + +lemma contDiff_holDeriv {f : Coordinates d → ℂ} (hf : ContDiff ℝ ∞ f) (j : Fin d) : + ContDiff ℝ ∞ (fun z => holDeriv f z j) := + contDiff_const.mul ((contDiff_deriv_direction hf _).sub + (contDiff_const.mul (contDiff_deriv_direction hf _))) + +lemma compactSupport_barDeriv {f : Coordinates d → ℂ} (hf : HasCompactSupport f) + (j : Fin d) : HasCompactSupport (fun z => barDeriv f z j) := by + exact ((hf.fderiv_apply ℝ (coordinateVector j)).add + (hf.fderiv_apply ℝ (Complex.I • coordinateVector j)).mul_left).mul_left + +lemma integrable_mul_deriv {f g : Coordinates d → ℂ} + (hf : ContDiff ℝ ∞ f) (hg : ContDiff ℝ ∞ g) (hc : HasCompactSupport f) + (v : Coordinates d) : Integrable (fun z => f z * fderiv ℝ g z v) := + (hf.continuous.mul (contDiff_deriv_direction hg v).continuous).integrable_of_hasCompactSupport + hc.mul_right + +lemma integrable_deriv_mul {f g : Coordinates d → ℂ} + (hf : ContDiff ℝ ∞ f) (hg : ContDiff ℝ ∞ g) (hc : HasCompactSupport f) + (v : Coordinates d) : Integrable (fun z => fderiv ℝ f z v * g z) := + ((contDiff_deriv_direction hf v).continuous.mul hg.continuous).integrable_of_hasCompactSupport + (hc.fderiv_apply ℝ v).mul_right + +lemma contDiffAt_deriv_direction {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] {f : E → F} {z : E} + (hf : ContDiffAt ℝ ∞ f z) (v : E) : ContDiffAt ℝ ∞ (fun y => fderiv ℝ f y v) z := + (hf.fderiv_right (by simp)).clm_apply contDiffAt_const + +lemma continuous_mul_on_tsupport {E : Type*} [TopologicalSpace E] {f g : E → ℂ} + (hf : Continuous f) (hg : ∀ z ∈ tsupport f, ContinuousAt g z) : + Continuous (fun z => f z * g z) := by + rw [continuous_iff_continuousAt] + intro z + by_cases hz : z ∈ tsupport f + · exact hf.continuousAt.mul (hg z hz) + · apply (continuousAt_const (y := (0 : ℂ))).congr + filter_upwards [notMem_tsupport_iff_eventuallyEq.mp hz] with y hy + simp only [hy, zero_mul, Pi.zero_apply] + +lemma contDiff_mul_on_tsupport {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + {f g : E → ℂ} (hf : ContDiff ℝ ∞ f) + (hg : ∀ z ∈ tsupport f, ContDiffAt ℝ ∞ g z) : + ContDiff ℝ ∞ (fun z => f z * g z) := by + rw [contDiff_iff_contDiffAt] + intro z + by_cases hz : z ∈ tsupport f + · exact hf.contDiffAt.mul (hg z hz) + · apply (contDiffAt_const (c := (0 : ℂ))).congr_of_eventuallyEq + filter_upwards [notMem_tsupport_iff_eventuallyEq.mp hz] with y hy + simp only [hy, zero_mul, Pi.zero_apply] + +lemma integrable_mul_deriv_local {f g : Coordinates d → ℂ} + (hf : ContDiff ℝ ∞ f) (hg : ∀ z ∈ tsupport f, ContDiffAt ℝ ∞ g z) + (hc : HasCompactSupport f) (v : Coordinates d) : + Integrable (fun z => f z * fderiv ℝ g z v) := + (continuous_mul_on_tsupport hf.continuous (fun z hz => + (contDiffAt_deriv_direction (hg z hz) v).continuousAt)).integrable_of_hasCompactSupport + hc.mul_right + +lemma integrable_deriv_mul_local {f g : Coordinates d → ℂ} + (hf : ContDiff ℝ ∞ f) (hg : ∀ z ∈ tsupport f, ContDiffAt ℝ ∞ g z) + (hc : HasCompactSupport f) (v : Coordinates d) : + Integrable (fun z => fderiv ℝ f z v * g z) := + (continuous_mul_on_tsupport (contDiff_deriv_direction hf v).continuous (fun z hz => + (hg z (tsupport_fderiv_apply_subset ℝ v hz)).continuousAt)).integrable_of_hasCompactSupport + (hc.fderiv_apply ℝ v).mul_right + +lemma integral_mul_barDeriv_local {f g : Coordinates d → ℂ} + (hf : ContDiff ℝ ∞ f) (hg : ∀ z ∈ tsupport f, ContDiffAt ℝ ∞ g z) + (hc : HasCompactSupport f) (j : Fin d) : + (∫ z, f z * barDeriv g z j) = -(∫ z, barDeriv f z j * g z) := by + have hv (v : Coordinates d) : (∫ z, f z * fderiv ℝ g z v) = + -(∫ z, fderiv ℝ f z v * g z) := + integral_mul_fderiv_eq_neg_fderiv_mul_of_integrable + (integrable_deriv_mul_local hf hg hc v) (integrable_mul_deriv_local hf hg hc v) + ((continuous_mul_on_tsupport hf.continuous (fun z hz => (hg z hz).continuousAt)).integrable_of_hasCompactSupport hc.mul_right) + (fun z _ => hf.differentiable (by simp) z) + (fun z hz => (hg z hz).differentiableAt (by simp)) + have he (z : Coordinates d) : f z * barDeriv g z j = + (2 : ℂ)⁻¹ * (f z * fderiv ℝ g z (coordinateVector j)) + + ((2 : ℂ)⁻¹ * Complex.I) * (f z * fderiv ℝ g z (Complex.I • coordinateVector j)) := by + unfold barDeriv + ring + have he' (z : Coordinates d) : barDeriv f z j * g z = + (2 : ℂ)⁻¹ * (fderiv ℝ f z (coordinateVector j) * g z) + + ((2 : ℂ)⁻¹ * Complex.I) * (fderiv ℝ f z (Complex.I • coordinateVector j) * g z) := by + unfold barDeriv + ring + simp_rw [he, he'] + rw [integral_add ((integrable_mul_deriv_local hf hg hc _).const_mul _) ((integrable_mul_deriv_local hf hg hc _).const_mul _), + integral_add ((integrable_deriv_mul_local hf hg hc _).const_mul _) ((integrable_deriv_mul_local hf hg hc _).const_mul _)] + simp only [integral_const_mul, hv] + ring + +end KaehlerMetric +end Anticanonical.SourceSmooth + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/ComplexJet.lean b/lean/OAI/Geometry/PrescribedRicci/ComplexJet.lean new file mode 100644 index 0000000000000000000000000000000000000000..f617707e4048d9dfd13cef3703874ab469e0cd7c --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/ComplexJet.lean @@ -0,0 +1,116 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.FamilyJetNorm + +namespace OAI + +/-! Complex Jet. -/ + +section + + + +noncomputable section +open Set Filter Topology MeasureTheory +open scoped ContDiff ENNReal Classical BigOperators +namespace TameInterpolation +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] +variable {ι κ : Type*} [Fintype ι] [Nonempty ι] [Fintype κ] [Nonempty κ] + +def cdir (v : E) (f : E → ℂ) (x : E) : ℂ := fderiv ℝ f x v + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma cdir_smooth (v : E) {f : E → ℂ} (hf : ContDiff ℝ ∞ f) : ContDiff ℝ ∞ (cdir v f) := + (hf.fderiv_right (by simp)).clm_apply contDiff_const + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma cdir_compact (v : E) {f : E → ℂ} (hf : HasCompactSupport f) : + HasCompactSupport (cdir v f) := + (hf.fderiv ℝ).comp_left (g:=fun L : E →L[ℝ] ℂ => L v) (by simp) + +def cjet (e : ι → E) (f : E → ℂ) : {j : ℕ} → (Fin j → ι) → E → ℂ + | 0,_ => f + | _j+1,w => cdir (e (w 0)) (cjet e f (w ∘ Fin.succ)) + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + [Fintype ι] [Nonempty ι] in +lemma cjet_smooth (e : ι → E) {f : E → ℂ} (hf : ContDiff ℝ ∞ f) + {j : ℕ} (w : Fin j → ι) : ContDiff ℝ ∞ (cjet e f w) := by + induction j with + | zero => exact hf + | succ j ih => exact cdir_smooth _ (ih _) + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + [Fintype ι] [Nonempty ι] in +lemma cjet_compact (e : ι → E) {f : E → ℂ} (hf : HasCompactSupport f) + {j : ℕ} (w : Fin j → ι) : HasCompactSupport (cjet e f w) := by + induction j with + | zero => exact hf + | succ j ih => exact cdir_compact _ (ih _) + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + [Fintype ι] [Nonempty ι] in +lemma cjet_real_map (e : ι → E) {f : E → ℂ} (hf : ContDiff ℝ ∞ f) + (L : ℂ →L[ℝ] ℝ) {j : ℕ} (w : Fin j → ι) : + jet e (fun x => L (f x)) w = fun x => L (cjet e f w x) := by + induction j with + | zero => rfl + | succ j ih => + simp only [jet,cjet,ih] + funext x + dsimp only [dir,cdir] + exact congrArg (fun T : E →L[ℝ] ℝ => T (e (w 0))) + (L.hasFDerivAt.comp x ((cjet_smooth e hf _).differentiable (by simp) x).hasFDerivAt).fderiv + +def realComponents (f : κ → E → ℂ) : κ × Bool → E → ℝ := + fun a x => if a.2 then (f a.1 x).im else (f a.1 x).re + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + [Fintype κ] [Nonempty κ] in +lemma realComponents_smooth (f : κ → E → ℂ) (hf : ∀ a, ContDiff ℝ ∞ (f a)) + (a : κ × Bool) : ContDiff ℝ ∞ (realComponents f a) := by + rcases a with ⟨a,b⟩; cases b + · exact Complex.reCLM.contDiff.comp (hf a) + · exact Complex.imCLM.contDiff.comp (hf a) + +omit [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] [MeasurableSpace E] + [BorelSpace E] [Fintype κ] [Nonempty κ] in +lemma realComponents_compact (f : κ → E → ℂ) (hf : ∀ a, HasCompactSupport (f a)) + (a : κ × Bool) : HasCompactSupport (realComponents f a) := by + rcases a with ⟨a,b⟩; cases b + · exact (hf a).comp_left (g:=Complex.re) rfl + · exact (hf a).comp_left (g:=Complex.im) rfl + +lemma lpNorm_complex_le (f : E → ℂ) {p : ℝ≥0∞} (hp : 1 ≤ p) + (hr : MemLp (fun x => (f x).re) p volume) (hi : MemLp (fun x => (f x).im) p volume) : + lpNorm f p volume ≤ lpNorm (fun x => (f x).re) p volume + lpNorm (fun x => (f x).im) p volume := by + have hh := lpNorm_mono_real (hr.norm.add hi.norm) (f:=f) + (fun x => by simpa only [Real.norm_eq_abs,Pi.add_apply] using Complex.norm_le_abs_re_add_abs_im (f x)) + apply hh.trans + simpa only [lpNorm_norm hr.aestronglyMeasurable,lpNorm_norm hi.aestronglyMeasurable] using lpNorm_add_le hr.norm (g:=fun x => ‖(f x).im‖) hp + +lemma cjet_lpNorm_le (e : ι → E) (f : κ → E → ℂ) + (hf : ∀ a, ContDiff ℝ ∞ (f a)) (hc : ∀ a, HasCompactSupport (f a)) + (a : κ) {j : ℕ} (w : Fin j → ι) {p : ℝ≥0∞} (hp : 1 ≤ p) : + lpNorm (cjet e (f a) w) p volume ≤ 2*familyJetNorm e (realComponents f) j p := by + have hr : ContDiff ℝ ∞ (fun x => (cjet e (f a) w x).re) := Complex.reCLM.contDiff.comp (cjet_smooth e (hf a) w) + have hi : ContDiff ℝ ∞ (fun x => (cjet e (f a) w x).im) := Complex.imCLM.contDiff.comp (cjet_smooth e (hf a) w) + have hcr := (cjet_compact e (hc a) w).comp_left (g:=Complex.re) rfl + have hci := (cjet_compact e (hc a) w).comp_left (g:=Complex.im) rfl + have hl := lpNorm_complex_le _ hp (hr.continuous.memLp_of_hasCompactSupport hcr) (hi.continuous.memLp_of_hasCompactSupport hci) + have h1 := (lpNorm_jet_le e (realComponents f (a,false)) w p).trans (jetNorm_le_family e (realComponents f) (a,false) j p) + have h2 := (lpNorm_jet_le e (realComponents f (a,true)) w p).trans (jetNorm_le_family e (realComponents f) (a,true) j p) + change lpNorm (jet e (fun x => Complex.reCLM (f a x)) w) p volume ≤ _ at h1 + change lpNorm (jet e (fun x => Complex.imCLM (f a x)) w) p volume ≤ _ at h2 + rw [cjet_real_map e (hf a) Complex.reCLM] at h1 + rw [cjet_real_map e (hf a) Complex.imCLM] at h2 + change lpNorm (fun x => (cjet e (f a) w x).re) p volume ≤ _ at h1 + change lpNorm (fun x => (cjet e (f a) w x).im) p volume ≤ _ at h2 + linarith only [hl,h1,h2] + +end TameInterpolation + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/ComplexJetProduct.lean b/lean/OAI/Geometry/PrescribedRicci/ComplexJetProduct.lean new file mode 100644 index 0000000000000000000000000000000000000000..79163a412abdfe84246318e0153191c4a33948aa --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/ComplexJetProduct.lean @@ -0,0 +1,93 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.ComplexJet +import OAI.Geometry.PrescribedRicci.HolderFiniteProduct + +namespace OAI + +/-! Complex Jet Product. -/ + +section + + +noncomputable section +open Set MeasureTheory +open scoped ContDiff ENNReal Classical BigOperators +namespace TameInterpolation +variable {Y : Type*} [MeasurableSpace Y] {μ : Measure Y} + +lemma lpNorm_complex_mul_le {p q r : ℝ≥0∞} [ENNReal.HolderTriple p q r] + {f g : Y → ℂ} (hf : MemLp f p μ) (hg : MemLp g q μ) : + lpNorm (fun x => f x*g x) r μ ≤ lpNorm f p μ*lpNorm g q μ := by + have he := eLpNorm_smul_le_mul_eLpNorm (p:=p) (q:=q) (r:=r) + hf.aestronglyMeasurable hg.aestronglyMeasurable + change eLpNorm (fun x => f x*g x) r μ ≤ eLpNorm f p μ * eLpNorm g q μ at he + have hh := ENNReal.toReal_mono (ENNReal.mul_ne_top hf.eLpNorm_ne_top hg.eLpNorm_ne_top) he + simpa only [ENNReal.toReal_mul,toReal_eLpNorm] using hh + +lemma lpNorm_complex_finite_prod {ι : Type*} (s : Finset ι) (f : ι → Y → ℂ) (p : ι → ℝ≥0∞) + (hf : ∀ i ∈ s, MemLp (f i) (p i) μ) : + lpNorm (fun x => ∏ i ∈ s, f i x) (∑ i ∈ s, (p i)⁻¹)⁻¹ μ ≤ + ∏ i ∈ s, lpNorm (f i) (p i) μ := by + induction s using Finset.cons_induction with + | empty => + by_cases hμ : μ = 0 + · simp [hμ] + · simp [lpNorm_const, hμ] + | cons i s hi ih => + have hfi : MemLp (f i) (p i) μ := hf i (Finset.mem_cons_self ..) + have hfs : ∀ a ∈ s, MemLp (f a) (p a) μ := fun a ha => hf a (Finset.mem_cons_of_mem ha) + have hprod := MemLp.fun_prod hfs + let : ENNReal.HolderTriple (p i) (∑ a ∈ s, (p a)⁻¹)⁻¹ (∑ a ∈ Finset.cons i s hi, (p a)⁻¹)⁻¹ := + ⟨by simp only [inv_inv,Finset.sum_cons]⟩ + simp only [Finset.prod_cons] + exact (lpNorm_complex_mul_le hfi hprod).trans (mul_le_mul_of_nonneg_left (ih hfs) lpNorm_nonneg) + +lemma exponent_one_le {m j : ℕ} (hm : 0 < m) (hj : j ≤ m) : 1 ≤ exponent m j := by + by_cases hj0 : j = 0 + · subst j; simp [exponent_zero] + · rw [exponent_of_pos hm (Nat.pos_of_ne_zero hj0)] + apply ENNReal.one_le_ofReal.mpr + apply (le_div_iff₀ (by exact_mod_cast (Nat.pos_of_ne_zero hj0) : 0 < (j:ℝ))).mpr + have hh : (j:ℝ) ≤ (m:ℝ) := by exact_mod_cast hj + have h0 : 0 ≤ (m:ℝ) := by positivity + linarith only [hh,h0] + +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] +variable {ι κ : Type*} [Fintype ι] [Nonempty ι] [Fintype κ] [Nonempty κ] + +theorem cjet_product_L2 (e : ι → E) (f : κ → E → ℂ) + (hf : ∀ a, ContDiff ℝ ∞ (f a)) (hc : ∀ a, HasCompactSupport (f a)) + (m : ℕ) (hm : 0 < m) {ν : Type*} (s : Finset ν) + (a : ν → κ) (j : ν → ℕ) (w : (i : ν) → Fin (j i) → ι) + (hs : ∑ i ∈ s, j i = m) : + lpNorm (fun x => ∏ i ∈ s, cjet e (f (a i)) (w i) x) 2 volume ≤ + 2^s.card * ((2*(m:ℝ))^(∑ i ∈ s, j i*(m-j i)) * + (familyJetNorm e (realComponents f) 0 ∞)^(s.card-1) * + familyJetNorm e (realComponents f) m 2) := by + have hi (i : ν) : MemLp (cjet e (f (a i)) (w i)) (exponent m (j i)) volume := + (cjet_smooth e (hf (a i)) (w i)).continuous.memLp_of_hasCompactSupport + (cjet_compact e (hc (a i)) (w i)) + have hh := lpNorm_complex_finite_prod (μ:=volume) s + (fun i => cjet e (f (a i)) (w i)) (fun i => exponent m (j i)) (fun i _ => hi i) + rw [exponent_sum_inverse s j m hm hs] at hh + apply hh.trans + have hprod : (∏ i ∈ s, lpNorm (cjet e (f (a i)) (w i)) (exponent m (j i)) volume) ≤ + ∏ i ∈ s, 2*familyJetNorm e (realComponents f) (j i) (exponent m (j i)) := by + apply Finset.prod_le_prod₀ + · intro i _; exact lpNorm_nonneg + · intro i hmem + have hj : j i ≤ m := by + rw [← hs]; exact Finset.single_le_sum (fun _ _ => Nat.zero_le _) hmem + exact cjet_lpNorm_le e f hf hc _ _ (exponent_one_le hm hj) + apply hprod.trans + rw [Finset.prod_mul_distrib,Finset.prod_const] + exact mul_le_mul_of_nonneg_left + (family_jet_tame_many e (realComponents f) (realComponents_smooth f hf) + (realComponents_compact f hc) m hm s j hs) (by positivity) +end TameInterpolation + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/ContractedBochner.lean b/lean/OAI/Geometry/PrescribedRicci/ContractedBochner.lean new file mode 100644 index 0000000000000000000000000000000000000000..838a31b824460eb23ad8eeed088cc901f8719348 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/ContractedBochner.lean @@ -0,0 +1,87 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.ChernBochner +import OAI.Geometry.PrescribedRicci.HermitianTensorEnergy +import OAI.Geometry.PrescribedRicci.MatrixWirtingerExtra + +namespace OAI + +/-! Contracted Bochner. -/ + +noncomputable section +open Matrix Set Filter Topology +open scoped ComplexOrder ContDiff MatrixOrder +namespace MongeAmpere +variable {n : Type*} [Fintype n] +lemma hermPair_self_ofReal {K : Matrix n n ℂ} (hK : K.IsHermitian) (v : n → ℂ) : + ((hermPair K v v).re : ℂ) = hermPair K v v := by + have he := congrArg Complex.im (hermPair_conj K hK v v) + apply Complex.ext + · rfl + · simp only [Complex.ofReal_im] + simp only [Complex.star_def,Complex.conj_im] at he + linarith +end MongeAmpere +namespace Anticanonical.SourceSmooth.KaehlerMetric +open MongeAmpere +variable {d : ℕ} {n : Type*} [Fintype n] + +lemma hessian_hermPair {s : Set (Coordinates d)} (hs : IsOpen s) + {K : Coordinates d → Matrix n n ℂ} {f : Coordinates d → n → ℂ} + {z : Coordinates d} (hz : z ∈ s) + (hK : ∀ y ∈ s, (K y).IsHermitian) + (hKs : ∀ y ∈ s, ∀ i j, ContDiffAt ℝ ∞ (fun w => K w i j) y) + (hf : ∀ y ∈ s, ∀ i, ContDiffAt ℝ ∞ (fun w => f w i) y) (a b : Fin d) : + PotentialKaehler.potentialMatrix (fun y => (hermPair (K y) (f y) (f y)).re) z b a = + barDeriv (fun y => holDeriv (fun w => hermPair (K w) (f w) (f w)) y a) z b := by + have hdr (y : Coordinates d) (hy : y ∈ s) : + ContDiffAt ℝ ∞ (fun w => (hermPair (K w) (f w) (f w)).re) y := + Complex.reCLM.contDiff.contDiffAt.comp y (hermPair_smooth (hKs y hy) (hf y hy) (hf y hy)) + rw [← barDeriv_holRealDeriv (hdr z hz)] + apply barDeriv_congr + filter_upwards [hs.mem_nhds hz] with y hy + rw [← holDeriv_ofReal ((hdr y hy).differentiableAt (by simp))] + apply holDeriv_congr + filter_upwards [hs.mem_nhds hy] with w hw + exact hermPair_self_ofReal (hK w hw) _ + +lemma contracted_bochners_identity {s : Set (Coordinates d)} (hs : IsOpen s) + {K : Coordinates d → Matrix n n ℂ} {C : Coordinates d → Fin d → Matrix n n ℂ} + {f : Coordinates d → n → ℂ} {z : Coordinates d} (hz : z ∈ s) + (hK : ∀ y ∈ s, ∀ i j, ContDiffAt ℝ ∞ (fun w => K w i j) y) + (hC : ∀ y ∈ s, ∀ a i j, ContDiffAt ℝ ∞ (fun w => C w a i j) y) + (hf : ∀ y ∈ s, ∀ i, ContDiffAt ℝ ∞ (fun w => f w i) y) + (hKh : ∀ y ∈ s, (K y).IsHermitian) + (hhol : ∀ y ∈ s, ∀ a, holArray K y a = K y*C y a) + (hbar : ∀ y ∈ s, ∀ a, barArray K y a = (C y a)ᴴ*K y) + (B : Matrix (Fin d) (Fin d) ℂ) (hB : B.IsHermitian) : + (B*PotentialKaehler.potentialMatrix (fun y => (hermPair (K y) (f y) (f y)).re) z).trace.re = + (tensorEnergy B (K z) (barVector f z)).re+ + (tensorEnergy B.transpose (K z) (covHol C f z)).re+ + 2*(hermPair (K z) (f z) + (∑ a, ∑ b, B a b • covHol C (fun y => barVector f y b) z a)).re+ + (hermPair (K z) (f z) + ((∑ a, ∑ b, B a b • barArray (fun y => C y a) z b)*ᵥ f z)).re := by + have he (a b : Fin d) := hermPair_bochners_identity hs hz hK hC hf hhol hbar a b + simp only [Matrix.trace,Matrix.diag_apply,Matrix.mul_apply] + simp_rw [hessian_hermPair hs hz hKh hK hf,he] + simp only [mul_add,Finset.sum_add_distrib] + rw [hermPair_weighted_rough_left B hB,hermPair_weighted_rough_right, + hermPair_weighted_curvature,tensorEnergy_flip] + change (hermPair (K z) + (∑ a, ∑ b, B a b • covHol C (fun y => barVector f y b) z a) (f z)+ + tensorEnergy B (K z) (barVector f z)+ + tensorEnergy B.transpose (K z) (covHol C f z)+ + hermPair (K z) (f z) + (∑ a, ∑ b, B a b • covHol C (fun y => barVector f y b) z a)+ + hermPair (K z) (f z) + ((∑ a, ∑ b, B a b • barArray (fun y => C y a) z b)*ᵥ f z)).re = _ + have hc := congrArg Complex.re (hermPair_conj (K z) (hKh z hz) (f z) + (∑ a, ∑ b, B a b • covHol C (fun y => barVector f y b) z a)) + simp only [Complex.add_re,Complex.star_def,Complex.conj_re] at hc ⊢ + linarith + +end Anticanonical.SourceSmooth.KaehlerMetric + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/CoordinateVolumeComparison.lean b/lean/OAI/Geometry/PrescribedRicci/CoordinateVolumeComparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..a5ea33f7a4ef5800449334c5a5552d06084630ce --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/CoordinateVolumeComparison.lean @@ -0,0 +1,95 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalRellich +import OAI.Geometry.PrescribedRicci.GlobalKahlerIntegral + +namespace OAI + +/-! Coordinate Volume Comparison. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory +open scoped SchwartzMap ContDiff Classical +namespace EllipticKernel + +instance coordinateMap_haar (d : ℕ) : + (Measure.map (coordinateEquiv d) (volume : Measure (EC d))).IsAddHaarMeasure := + (coordinateEquiv d).isAddHaarMeasure_map _ + +def coordinateVolumeFactor (d : ℕ) : ℝ := + Measure.addHaarScalarFactor (Measure.map (coordinateEquiv d) (volume : Measure (EC d))) volume + +lemma coordinateVolumeFactor_pos (d : ℕ) : 0 < coordinateVolumeFactor d := + Measure.addHaarScalarFactor_pos_of_isAddHaarMeasure _ _ + +lemma integral_coordinates (d : ℕ) {F : Anticanonical.Coordinates d → ℝ} (hF : Continuous F) : + (∫ z : EC d, F (coordinateEquiv d z)) = coordinateVolumeFactor d * ∫ z, F z := by + rw [← integral_map (coordinateEquiv d).continuous.measurable.aemeasurable hF.aestronglyMeasurable, + Measure.isAddLeftInvariant_eq_smul (Measure.map (coordinateEquiv d) volume) volume, + integral_smul_nnreal_measure] + rfl + +end EllipticKernel +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +lemma schwartzCoord_zero_eq (f : 𝓢(E, ℂ)) : schwartzCoord 0 f = f.toLp 2 := by + apply realize_injective 0 + rw [realize_schwartzCoord, realize_zero] + exact (Lp.toTemperedDistribution_toLp_eq f).symm + +lemma norm_sq_schwartzCoord_zero (f : 𝓢(E, ℂ)) : + ‖schwartzCoord 0 f‖ ^ 2 = ∫ z, ‖f z‖ ^ 2 := by + rw [schwartzCoord_zero_eq] + have hi := inner_self_eq_norm_sq_to_K (𝕜 := ℂ) (f.toLp 2) + rw [SchwartzMap.inner_toL2_toL2_eq f f volume] at hi + simp only [inner_self_eq_norm_sq_to_K, ← RCLike.ofReal_pow] at hi + rw [integral_ofReal] at hi + exact (RCLike.ofReal_injective hi).symm + +end SobolevChart +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} + +lemma norm_localize_coordinates (i : Fin A.count) (ρ f : Smooth A) + (hs : tsupport (ρ : X → ℂ) ⊆ (A.euclideanChart i).source) (z : EC d) : + ‖localize A i ρ hs f z‖ ^ 2 = + KaehlerMetric.localizeFunction i (fun x => ‖ρ x * f x‖ ^ 2) (coordinateEquiv d z) := by + by_cases hz : z ∈ (A.euclideanChart i).target + · have hz' : coordinateEquiv d z ∈ (A.chart i).target := by simpa using hz + simp only [localize_apply, localizeFun, ite_eq_left hz, + KaehlerMetric.localizeFunction, ite_eq_left hz'] + rfl + · have hz' : coordinateEquiv d z ∉ (A.chart i).target := by simpa using hz + simp only [localize_apply, localizeFun, ite_eq_right hz, + KaehlerMetric.localizeFunction, ite_eq_right hz', norm_zero, zero_pow (by decide : 2 ≠ 0)] + +lemma norm_sq_localize_integral (i : Fin A.count) (ρ f : Smooth A) + (hs : tsupport (ρ : X → ℂ) ⊆ (A.euclideanChart i).source) : + ‖schwartzCoord 0 (localize A i ρ hs f)‖ ^ 2 = + coordinateVolumeFactor d * ∫ z, KaehlerMetric.localizeFunction i (fun x => ‖ρ x * f x‖ ^ 2) z := by + rw [norm_sq_schwartzCoord_zero] + simp_rw [norm_localize_coordinates] + apply integral_coordinates + apply (KaehlerMetric.localizeFunction_continuous_compact i + ((ρ.continuous.mul f.continuous).norm.pow 2) ?_).1 + refine Subset.trans (closure_minimal ?_ (isClosed_tsupport (ρ : X → ℂ))) (by simpa using hs) + intro x hx + apply subset_tsupport + change ρ x ≠ 0 + intro h + have : ‖ρ x * f x‖ ^ 2 = 0 := by rw [h, zero_mul, norm_zero, zero_pow (by decide : 2 ≠ 0)] + exact hx this + +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/CurvatureCompactBounds.lean b/lean/OAI/Geometry/PrescribedRicci/CurvatureCompactBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..3fd7f2402bc1a6c6a9c698d2ebff71d4a6f3fe7f --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/CurvatureCompactBounds.lean @@ -0,0 +1,123 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.GlobalKahlerIntegral +import OAI.Geometry.PrescribedRicci.MatrixWirtinger +import OAI.Geometry.PrescribedRicci.MatrixWirtingerExtra +import OAI.Geometry.PrescribedRicci.VolumePathRicci + +namespace OAI + +/-! Curvature Compact Bounds. -/ + +section + + + +noncomputable section +open Matrix Filter Set Topology +open scoped ContDiff ComplexOrder MatrixOrder Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth.KaehlerMetric +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +lemma curvatureMatrix_smooth (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (b a : Fin d) : + ContDiffAt ℝ ∞ (fun y => g.curvatureMatrix q y b a) z := by + have hs := (g.smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hz) + have hi : ContDiffAt ℝ ∞ (fun y => (g.matrix q y)⁻¹) z := + ((MongeAmpere.contDiffAt_inv _ (g.positive q z hz).det_pos.ne').restrict_scalars ℝ).comp z hs + exact (contDiffAt_barDerivative (contDiffAt_holDerivative hs a) b).neg.add + (matrix_mul_contDiffAt (matrix_mul_contDiffAt (contDiffAt_barDerivative hs b) hi) + (contDiffAt_holDerivative hs a)) + +lemma curvatureRicci_smooth (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) : + ContDiffAt ℝ ∞ (g.curvatureRicci q) z := by + apply (PotentialKaehler.potentialMatrix_smooth (g.ricciPotential_contDiffAt q hz)).congr_of_eventuallyEq + filter_upwards [(A.chart q).open_target.mem_nhds hz] with y hy + exact g.curvatureRicci_eq q hy + +def backgroundSize (g : KaehlerMetric A) (F : SmoothRealFunction A) + (q : Fin A.count) (z : Coordinates d) : ℝ := + 1+‖g.matrix q z‖+‖(g.matrix q z)⁻¹‖+‖g.curvatureRicci q z‖+ + ‖F.hessian q z‖+‖g.curvatureMatrix q z‖ + +def BackgroundComponentBound (g : KaehlerMetric A) (F : SmoothRealFunction A) + (q : Fin A.count) (z : Coordinates d) (M : ℝ) : Prop := + (∀ i j, ‖g.matrix q z i j‖ ≤ M) ∧ + (∀ i j, ‖(g.matrix q z)⁻¹ i j‖ ≤ M) ∧ + (∀ i j, ‖g.curvatureRicci q z i j‖ ≤ M) ∧ + (∀ i j, ‖F.hessian q z i j‖ ≤ M) ∧ + (∀ a b i j, ‖g.curvatureMatrix q z b a i j‖ ≤ M) + +lemma backgroundSize_continuousOn (g : KaehlerMetric A) (F : SmoothRealFunction A) + (q : Fin A.count) : ContinuousOn (g.backgroundSize F q) (A.chart q).target := by + intro z hz + have hs := (g.smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hz) + have hi : ContDiffAt ℝ ∞ (fun y => (g.matrix q y)⁻¹) z := + ((MongeAmpere.contDiffAt_inv _ (g.positive q z hz).det_pos.ne').restrict_scalars ℝ).comp z hs + have hR : ContDiffAt ℝ ∞ (g.curvatureMatrix q) z := by + apply contDiffAt_pi.mpr + intro b + apply contDiffAt_pi.mpr + intro a + exact g.curvatureMatrix_smooth q hz b a + exact (((((continuousAt_const.add hs.continuousAt.norm).add hi.continuousAt.norm).add + (g.curvatureRicci_smooth q hz).continuousAt.norm).add + ((F.hessian_smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hz)).continuousAt.norm).add + hR.continuousAt.norm).continuousWithinAt + +lemma backgroundComponents_of_size (g : KaehlerMetric A) (F : SmoothRealFunction A) + (q : Fin A.count) (z : Coordinates d) {M : ℝ} (hb : g.backgroundSize F q z ≤ M) : + g.BackgroundComponentBound F q z M := by + have h1 : ‖g.matrix q z‖ ≤ M := by unfold backgroundSize at hb; linarith [norm_nonneg ((g.matrix q z)⁻¹),norm_nonneg (g.curvatureRicci q z),norm_nonneg (F.hessian q z),norm_nonneg (g.curvatureMatrix q z)] + have h2 : ‖(g.matrix q z)⁻¹‖ ≤ M := by unfold backgroundSize at hb; linarith [norm_nonneg (g.matrix q z),norm_nonneg (g.curvatureRicci q z),norm_nonneg (F.hessian q z),norm_nonneg (g.curvatureMatrix q z)] + have h3 : ‖g.curvatureRicci q z‖ ≤ M := by unfold backgroundSize at hb; linarith [norm_nonneg (g.matrix q z),norm_nonneg ((g.matrix q z)⁻¹),norm_nonneg (F.hessian q z),norm_nonneg (g.curvatureMatrix q z)] + have h4 : ‖F.hessian q z‖ ≤ M := by unfold backgroundSize at hb; linarith [norm_nonneg (g.matrix q z),norm_nonneg ((g.matrix q z)⁻¹),norm_nonneg (g.curvatureRicci q z),norm_nonneg (g.curvatureMatrix q z)] + have h5 : ‖g.curvatureMatrix q z‖ ≤ M := by unfold backgroundSize at hb; linarith [norm_nonneg (g.matrix q z),norm_nonneg ((g.matrix q z)⁻¹),norm_nonneg (g.curvatureRicci q z),norm_nonneg (F.hessian q z)] + refine ⟨fun i j => ?_,fun i j => ?_,fun i j => ?_,fun i j => ?_,fun a b i j => ?_⟩ + · exact (norm_le_pi_norm _ j).trans ((norm_le_pi_norm _ i).trans h1) + · exact (norm_le_pi_norm _ j).trans ((norm_le_pi_norm _ i).trans h2) + · exact (norm_le_pi_norm _ j).trans ((norm_le_pi_norm _ i).trans h3) + · exact (norm_le_pi_norm _ j).trans ((norm_le_pi_norm _ i).trans h4) + · exact (norm_le_pi_norm _ j).trans ((norm_le_pi_norm _ i).trans + ((norm_le_pi_norm _ a).trans ((norm_le_pi_norm _ b).trans h5))) + +variable [T2Space X] [CompactSpace X] + +lemma compact_background_bounds (g : KaehlerMetric A) (F : SmoothRealFunction A) : + ∃ M : ℝ, 1 ≤ M ∧ ∀ q : Fin A.count, ∀ x ∈ tsupport (chartPartition (A:=A) q).value, + g.BackgroundComponentBound F q (A.chart q x) M := by + have hb (q : Fin A.count) : ∃ M : ℝ, 1 ≤ M ∧ ∀ x ∈ tsupport (chartPartition (A:=A) q).value, + g.backgroundSize F q (A.chart q x) ≤ M := by + let K := (A.chart q) '' tsupport (chartPartition (A:=A) q).value + have hK : IsCompact K := (isClosed_tsupport _).isCompact.image_of_continuousOn + ((A.chart q).continuousOn.mono (chartPartition_support q)) + have hKt : K ⊆ (A.chart q).target := by + rintro z ⟨x,hx,rfl⟩ + exact (A.chart q).mapsTo (chartPartition_support q hx) + obtain ⟨b,hb⟩ := hK.bddAbove_image ((g.backgroundSize_continuousOn F q).mono hKt) + refine ⟨max 1 b,le_max_left _ _,fun x hx => ?_⟩ + exact (hb (mem_image_of_mem _ (mem_image_of_mem _ hx))).trans (le_max_right _ _) + choose M hM hMb using hb + refine ⟨1+∑ q, M q,?_,fun q x hx => g.backgroundComponents_of_size F q (A.chart q x) ?_⟩ + · have hn : 0 ≤ ∑ q, M q := Finset.sum_nonneg (fun q _ => (by norm_num : (0:ℝ)≤1).trans (hM q)) + linarith + · have hle : M q ≤ ∑ j, M j := Finset.single_le_sum + (fun j _ => (by norm_num : (0:ℝ)≤1).trans (hM j)) (Finset.mem_univ q) + exact (hMb q x hx).trans (by linarith) + +lemma exists_partition_chart (x : X) : ∃ q : Fin A.count, + x ∈ tsupport (chartPartition (A:=A) q).value := by + by_contra! hh + have hz (q : Fin A.count) : (chartPartition (A:=A) q).value x = 0 := by + by_contra hn + exact hh q (subset_tsupport _ hn) + have he := chartPartition_sum (A:=A) x + simp only [hz,Finset.sum_const_zero] at he + norm_num at he + +end Anticanonical.SourceSmooth.KaehlerMetric + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/CurvatureRicci.lean b/lean/OAI/Geometry/PrescribedRicci/CurvatureRicci.lean new file mode 100644 index 0000000000000000000000000000000000000000..7e32db4ee85a027b09b22ea6587c248b322123d6 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/CurvatureRicci.lean @@ -0,0 +1,114 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.ChernLuAlgebra +import OAI.Geometry.PrescribedPotential.VolumePath + +namespace OAI + +/-! Curvature Ricci. -/ + +section + + + +noncomputable section +open Matrix Filter Set Topology +open scoped ContDiff ComplexOrder MatrixOrder Matrix.Norms.Elementwise +namespace MongeAmpere +variable {d : ℕ} +local notation "Mat" => Matrix (Fin d) (Fin d) ℂ + +lemma contDiffAt_logdetReal (H : Mat) (hH : H.PosDef) : + ContDiffAt ℝ ∞ (fun M : Mat => Real.log M.det.re) H := by + exact ((Complex.reCLM.contDiff.contDiffAt).comp H + ((contDiff_det.restrict_scalars ℝ).contDiffAt)).log + (ne_of_gt (Complex.pos_iff.mp hH.det_pos).1) + +lemma fderiv_logdetReal (H K : Mat) (hH : H.PosDef) : + fderiv ℝ (fun M : Mat => Real.log M.det.re) H K = (H⁻¹*K).trace.re := by + have hp : HasDerivAt (fun t : ℝ => H + (t:ℂ) • K) K 0 := by + convert! ((hasDerivAt_id (0 : ℝ)).smul_const K).const_add H using 1 + simp only [one_smul] + have hd := ((contDiffAt_logdetReal H hH).differentiableAt (by simp)).hasFDerivAt + have hd' : HasFDerivAt (fun M : Mat => Real.log M.det.re) + (fderiv ℝ (fun M : Mat => Real.log M.det.re) H) (H + ((0:ℝ):ℂ) • K) := by + convert! hd using 1 + simp only [Complex.ofReal_zero,zero_smul,add_zero] + have hf := hd'.comp_hasDerivAt 0 hp + exact hf.unique (hasDerivAt_logdet_add_smul H K hH) + +lemma trace_mul_real {H K : Mat} (hH : H.IsHermitian) (hK : K.IsHermitian) : + ((H*K).trace.re : ℂ) = (H*K).trace := by + have he : star (H*K).trace = (H*K).trace := by + rw [← trace_conjTranspose,conjTranspose_mul,hH.eq,hK.eq,trace_mul_comm] + have hi := congrArg Complex.im he + change -(H*K).trace.im = (H*K).trace.im at hi + apply Complex.ext + · rfl + · simp only [Complex.ofReal_im]; linarith + +end MongeAmpere +namespace Anticanonical.SourceSmooth.KaehlerMetric +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +local notation "Mat" => Matrix (Fin d) (Fin d) ℂ + +lemma fderiv_logVolume (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (v : Coordinates d) : + fderiv ℝ (fun y => Real.log (g.volumeCoefficient q y)) z v = + ((g.matrix q z)⁻¹*fderiv ℝ (g.matrix q) z v).trace.re := by + have hg := ((g.smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hz)).differentiableAt (by simp) + have hh := (((MongeAmpere.contDiffAt_logdetReal _ (g.positive q z hz)).differentiableAt (by simp)).hasFDerivAt.comp z hg.hasFDerivAt).fderiv + have he := congrArg (fun L : Coordinates d →L[ℝ] ℝ => L v) hh + exact he.trans (MongeAmpere.fderiv_logdetReal _ _ (g.positive q z hz)) + +lemma holRealDeriv_logVolume (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (a : Fin d) : + holRealDeriv (fun y => Real.log (g.volumeCoefficient q y)) z a = + ((g.matrix q z)⁻¹*holDerivative (g.matrix q) z a).trace := by + change (2:ℂ)⁻¹ * ((fderiv ℝ (fun y => Real.log (g.volumeCoefficient q y)) z (coordinateVector a):ℂ) - + Complex.I * (fderiv ℝ (fun y => Real.log (g.volumeCoefficient q y)) z (Complex.I • coordinateVector a):ℂ)) = _ + rw [g.fderiv_logVolume q hz,g.fderiv_logVolume q hz, + MongeAmpere.trace_mul_real (g.positive q z hz).inv.isHermitian (g.derivative_hermitian q hz _), + MongeAmpere.trace_mul_real (g.positive q z hz).inv.isHermitian (g.derivative_hermitian q hz _)] + simp only [holDerivative,Matrix.mul_smul,mul_sub,trace_smul,trace_sub,smul_eq_mul] + +lemma curvatureRicci_eq (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) : + g.curvatureRicci q z = PotentialKaehler.potentialMatrix (g.ricciPotential q) z := by + have hs := (g.smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hz) + have hi := ((MongeAmpere.contDiffAt_inv _ (g.positive q z hz).det_pos.ne').restrict_scalars ℝ).comp z hs + have hl := (g.volumeCoefficient_smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hz) + have hl' := hl.log (g.volumeCoefficient_pos q hz).ne' + ext b a + have he : (fun y => holRealDeriv (g.ricciPotential q) y a) =ᶠ[nhds z] + (fun y => -((g.matrix q y)⁻¹*holDerivative (g.matrix q) y a).trace) := by + filter_upwards [(A.chart q).open_target.mem_nhds hz] with y hy + have hh := (g.volumeCoefficient_smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hy) + have hh' := (hh.log (g.volumeCoefficient_pos q hy).ne').differentiableAt (by simp) + change holRealForm a (fderiv ℝ (fun w => -Real.log (g.volumeCoefficient q w)) y) = _ + rw [fderiv_fun_neg,map_neg] + exact congrArg Neg.neg (g.holRealDeriv_logVolume q hy a) + change ((g.matrix q z)⁻¹*g.curvatureMatrix q z b a).trace = + PotentialKaehler.potentialMatrix (g.ricciPotential q) z b a + have hric : ContDiffAt ℝ ∞ (g.ricciPotential q) z := hl'.neg + rw [← barDeriv_holRealDeriv hric] + have hb : barDeriv (fun y => holRealDeriv (g.ricciPotential q) y a) z b = + -barDeriv (fun y => ((g.matrix q y)⁻¹*holDerivative (g.matrix q) y a).trace) z b := by + unfold barDeriv + rw [he.fderiv_eq,fderiv_fun_neg] + simp only [_root_.neg_apply]; ring + have hid : DifferentiableAt ℝ (fun y => (g.matrix q y)⁻¹) z := hi.differentiableAt (by simp) + have hpd := (contDiffAt_holDerivative hs a).differentiableAt (by simp) + have hprod : DifferentiableAt ℝ (fun y => (g.matrix q y)⁻¹*holDerivative (g.matrix q) y a) z := + (MongeAmpere.matrixMulCLM.hasFDerivAt_of_bilinear hid.hasFDerivAt hpd.hasFDerivAt).differentiableAt + rw [hb,barDeriv_trace hprod, + barDerivative_mul hid hpd, + barDerivative_inv (hs.differentiableAt (by simp)) (isUnit_iff_ne_zero.mpr (g.positive q z hz).det_pos.ne')] + simp only [curvatureMatrix,mul_add,mul_neg,neg_mul,trace_add,trace_neg,mul_assoc] + abel + +end Anticanonical.SourceSmooth.KaehlerMetric + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/CutoffJetBound.lean b/lean/OAI/Geometry/PrescribedRicci/CutoffJetBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..467a7dbe03cb53dcccc6a77973e87413896796fc --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/CutoffJetBound.lean @@ -0,0 +1,102 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.ChartTransport +import OAI.Geometry.PrescribedRicci.JetTrim + +namespace OAI + +/-! Cutoff Jet Bound. -/ + +section + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory LineDeriv +open scoped ContDiff SchwartzMap Classical ENNReal +namespace GlobalElliptic +open SobolevChart TameInterpolation +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + {ι κ Z : Type*} [Fintype ι] [Nonempty ι] [Fintype κ] [Nonempty κ] + +lemma initialJet_zero_bound (e : ι → E) (F : κ → 𝓢(E,ℂ)) {B : ℝ} (hB : 0 ≤ B) + (h0 : ∀ a x, ‖F a x‖ ≤ B) + (h1 : ∀ a i x, ‖fderiv ℝ (F a) x (e i)‖ ≤ B) : + familyJetNorm e (realComponents (initialJet e (fun a x => F a x))) 0 ∞ ≤ B := by + obtain ⟨⟨⟨a,i⟩,b⟩,ha⟩ := familyJetNorm_attained e (realComponents (initialJet e (fun a x => F a x))) 0 ∞ + rw [ha] + obtain ⟨w,hw⟩ := jetNorm_attained e (realComponents (initialJet e (fun a x => F a x)) ((a,i),b)) 0 ∞ + rw [hw] + have hh (x : E) : ‖initialJet e (fun a x => F a x) (a,i) x‖ ≤ B := by + cases i with + | none => exact h0 a x + | some i => exact h1 a i x + have hmeas := (realComponents_smooth (initialJet e (fun a x => F a x)) + (initialJet_smooth e _ (fun a => (F a).smooth')) ((a,i),b)).continuous.aestronglyMeasurable (μ:=volume) + change lpNorm (realComponents (initialJet e (fun a x => F a x)) ((a,i),b)) ∞ volume ≤ B + rw [← toReal_eLpNorm,eLpNorm_exponent_top hmeas] + apply (ENNReal.toReal_mono ENNReal.ofReal_ne_top (eLpNormEssSup_le_of_ae_bound ?_)).trans_eq + (ENNReal.toReal_ofReal hB) + filter_upwards [] with x + change ‖if b then (initialJet e (fun a x => F a x) (a,i) x).im else + (initialJet e (fun a x => F a x) (a,i) x).re‖ ≤ B + cases b + · exact (Complex.abs_re_le_norm _).trans (hh x) + · exact (Complex.abs_im_le_norm _).trans (hh x) + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] [Nonempty ι] in +lemma ChartCutoff.uniform_C1 {U : Set E} (σ : ChartCutoff U) (hU : IsOpen U) + (e : ι → E) (f : Z → E → ℂ) (hs : ∀ z, ContDiffOn ℝ ∞ (f z) U) + {M P : ℝ} (hM : 0 ≤ M) (hP : 0 ≤ P) + (hm : ∀ z x, x ∈ tsupport (σ : E → ℂ) → ‖f z x‖ ≤ M) + (hp : ∀ z x, x ∈ tsupport (σ : E → ℂ) → ∀ i, ‖fderiv ℝ (f z) x (e i)‖ ≤ P) : + ∃ B : ℝ, 0 ≤ B ∧ ∀ z, (∀ x, ‖σ.product hU (hs z) x‖ ≤ B) ∧ + (∀ i x, ‖fderiv ℝ (σ.product hU (hs z)) x (e i)‖ ≤ B) := by + let K := ‖σ.val.toBoundedContinuousFunction‖ + let Q := ∑ i, ‖(∂_{e i} σ.val).toBoundedContinuousFunction‖ + have hK : 0 ≤ K := norm_nonneg _ + have hQ : 0 ≤ Q := Finset.sum_nonneg fun _ _ => norm_nonneg _ + have hB : 0 ≤ K*M+(Q*M+K*P) := add_nonneg (mul_nonneg hK hM) + (add_nonneg (mul_nonneg hQ hM) (mul_nonneg hK hP)) + refine ⟨K*M+(Q*M+K*P),hB,fun z => ⟨?_,?_⟩⟩ + · intro x + by_cases hx : x ∈ tsupport (σ : E → ℂ) + · rw [ChartCutoff.product_apply,norm_mul] + have h := mul_le_mul (σ.val.toBoundedContinuousFunction.norm_coe_le_norm x) (hm z x hx) + (norm_nonneg _) hK + change ‖σ x‖*‖f z x‖ ≤ K*M at h + nlinarith only [h,mul_nonneg hQ hM,mul_nonneg hK hP] + · rw [ChartCutoff.product_apply,image_eq_zero_of_notMem_tsupport hx,zero_mul,norm_zero] + exact hB + · intro i x + by_cases hx : x ∈ tsupport (σ : E → ℂ) + · have hf := ((hs z).contDiffAt (hU.mem_nhds (σ.support_sub hx))).differentiableAt (by simp) + have he : fderiv ℝ (σ.product hU (hs z)) x (e i) = + σ x * fderiv ℝ (f z) x (e i) + fderiv ℝ σ.val x (e i) * f z x := by + change fderiv ℝ (fun y => σ.val y * f z y) x (e i) = _ + rw [fderiv_fun_mul (σ.val.differentiableAt) hf] + simp only [_root_.add_apply,_root_.smul_apply,smul_eq_mul] + ring + rw [he] + have hq : ‖fderiv ℝ σ.val x (e i)‖ ≤ Q := by + have hh := (∂_{e i} σ.val).toBoundedContinuousFunction.norm_coe_le_norm x + change ‖(∂_{e i} σ.val) x‖ ≤ _ at hh + rw [SchwartzMap.lineDerivOp_apply_eq_fderiv] at hh + exact hh.trans (Finset.single_le_sum (fun j _ => norm_nonneg (∂_{e j} σ.val).toBoundedContinuousFunction) (Finset.mem_univ i)) + have hk : ‖σ x‖ ≤ K := σ.val.toBoundedContinuousFunction.norm_coe_le_norm x + have hsum : ‖σ x * fderiv ℝ (f z) x (e i) + fderiv ℝ σ.val x (e i) * f z x‖ ≤ K*P+Q*M := by + apply (norm_add_le _ _).trans + simp only [norm_mul] + exact add_le_add (mul_le_mul hk (hp z x hx i) (norm_nonneg _) hK) + (mul_le_mul hq (hm z x hx) (norm_nonneg _) hQ) + exact hsum.trans (by nlinarith only [mul_nonneg hK hM]) + · have he : (σ.product hU (hs z) : E → ℂ) =ᶠ[𝓝 x] 0 := by + filter_upwards [notMem_tsupport_iff_eventuallyEq.mp hx] with y hy + simp only [ChartCutoff.product_apply]; rw [hy]; simp + rw [he.fderiv_eq] + simpa using hB +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/DeterminantJet.lean b/lean/OAI/Geometry/PrescribedRicci/DeterminantJet.lean new file mode 100644 index 0000000000000000000000000000000000000000..f0f85cff653462cf360f764cdf2ac2be2233d4c2 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/DeterminantJet.lean @@ -0,0 +1,131 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.JetRemainder +import OAI.Geometry.PrescribedRicci.MatrixDifferentialNew +import OAI.Geometry.PrescribedPotential.NonlinearHessianCommutator + +namespace OAI + +/-! Determinant Jet. -/ + +section + + + +noncomputable section +open Set Finset Matrix +open scoped ContDiff Classical BigOperators Matrix.Norms.Elementwise +namespace TameInterpolation +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] +variable {ι : Type*} {n : ℕ} + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma cword_finite_sum (e : ι → E) (ws : List ι) {ν : Type*} (s : Finset ν) + (f : ν → E → ℂ) (hf : ∀ i ∈ s, ContDiff ℝ ∞ (f i)) : + cword e (fun x => ∑ i ∈ s, f i x) ws = fun x => ∑ i ∈ s, cword e (f i) ws x := by + induction ws with + | nil => rfl + | cons a ws ih => + change cdir (e a) (cword e (fun x => ∑ i ∈ s, f i x) ws) = _ + rw [ih,cdir_finite_sum e a s _ (fun i hi => cword_smooth e (hf i hi) ws)] + rfl + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma cword_const_mul (e : ι → E) (ws : List ι) (c : ℂ) (f : E → ℂ) + (hf : ContDiff ℝ ∞ f) : + cword e (fun x => c*f x) ws = fun x => c*cword e f ws x := by + induction ws with + | nil => rfl + | cons a ws ih => + change cdir (e a) (cword e (fun x => c*f x) ws) = _ + rw [ih] + funext x + unfold cdir + rw [fderiv_const_mul ((cword_smooth e hf ws).differentiable (by simp) x)] + rfl + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma monoEval_single (e : ι → E) (f : Fin n → E → ℂ) (ws : List ι) (i : Fin n) (x : E) : + monoEval e f (singleState ws i) x = cword e (f i) ws x * ∏ j ∈ Finset.univ.erase i, f j x := by + unfold monoEval + rw [← Finset.mul_prod_erase Finset.univ _ (Finset.mem_univ i)] + simp only [singleState,Function.update_self] + congr 1 + apply Finset.prod_congr rfl + intro j hj + rw [Function.update_of_ne (Finset.mem_erase.mp hj).1] + rfl + +def detPrincipal (M N : Matrix (Fin n) (Fin n) ℂ) : ℂ := + ∑ σ : Equiv.Perm (Fin n), (Equiv.Perm.sign σ : ℂ) * + ∑ i, N (σ i) i * ∏ j ∈ Finset.univ.erase i, M (σ j) j + +lemma detPrincipal_eq (M N : Matrix (Fin n) (Fin n) ℂ) : + detPrincipal M N = NonlinearHessian.detDifferential M N := by + have hp : HasDerivAt (fun t : ℂ => (M+t•N).det) (detPrincipal M N) 0 := by + have hent (i j : Fin n) : HasDerivAt (fun t : ℂ => M i j+t*N i j) (N i j) 0 := by + simpa using ((hasDerivAt_id (0:ℂ)).mul_const (N i j)).const_add (M i j) + have hprod (σ : Equiv.Perm (Fin n)) := + HasDerivAt.finsetProd (u:=Finset.univ) (fun i _ => hent (σ i) i) + have hs := HasDerivAt.fun_sum (u:=Finset.univ) + (fun σ _ => hprod σ |>.const_mul (Equiv.Perm.sign σ : ℂ)) + convert! hs using 1 + · funext t + simp only [Matrix.det_apply',Matrix.add_apply,Matrix.smul_apply,smul_eq_mul, + Finset.prod_apply] + · unfold detPrincipal + simp only [zero_mul,add_zero,smul_eq_mul,mul_comm] + have hc : HasDerivAt (fun t : ℂ => M+t•N) N 0 := by + convert! ((hasDerivAt_id (0:ℂ)).smul_const N).const_add M using 1 + simp only [one_smul] + have hd := (MongeAmpere.differentiable_det (M+(0:ℂ)•N)).hasFDerivAt.comp_hasDerivAt 0 hc + have hd' : HasDerivAt (fun t : ℂ => (M+t•N).det) + (fderiv ℂ (fun K : Matrix (Fin n) (Fin n) ℂ => K.det) M N) 0 := by + convert! hd using 1 + simp only [zero_smul,add_zero] + rfl + have hr := ((MongeAmpere.differentiable_det M).hasFDerivAt.restrictScalars ℝ).fderiv + have hre := congrArg (fun L : Matrix (Fin n) (Fin n) ℂ →L[ℝ] ℂ => L N) hr + exact (hp.unique hd').trans hre.symm + +def detJetRemainder (e : ι → E) (H : E → Matrix (Fin n) (Fin n) ℂ) (ws : List ι) (x : E) : ℂ := + ∑ σ : Equiv.Perm (Fin n), (Equiv.Perm.sign σ : ℂ) * + ((monoRemainder ws).map (fun s => monoEval e (fun i x => H x (σ i) i) s x)).sum + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +theorem cword_det_remainder (e : ι → E) (H : E → Matrix (Fin n) (Fin n) ℂ) + (hH : ∀ i j, ContDiff ℝ ∞ (fun x => H x i j)) (ws : List ι) (hw : ws ≠ []) (x : E) : + cword e (fun x => (H x).det) ws x = + NonlinearHessian.detDifferential (H x) (fun i j => cword e (fun y => H y i j) ws x) + + detJetRemainder e H ws x := by + have he : (fun x => (H x).det) = (fun x => ∑ σ : Equiv.Perm (Fin n), + (Equiv.Perm.sign σ : ℂ)*∏ i, H x (σ i) i) := by + funext x; exact Matrix.det_apply' (H x) + rw [he,cword_finite_sum e ws _ _ (by + intro σ _; exact contDiff_const.mul (contDiff_prod fun i _ => hH (σ i) i))] + simp_rw [cword_const_mul e ws _ _ (contDiff_prod fun i _ => hH _ i)] + simp_rw [cword_product_remainder e _ (fun i => hH _ i) ws hw] + erw [← detPrincipal_eq] + unfold detPrincipal detJetRemainder + rw [← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro σ _ + simp_rw [monoEval_single] + ring + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +theorem cword_det_trace (e : ι → E) (H : E → Matrix (Fin n) (Fin n) ℂ) + (hH : ∀ i j, ContDiff ℝ ∞ (fun x => H x i j)) (ws : List ι) (hw : ws ≠ []) (x : E) + (hinv : IsUnit (H x).det) : + cword e (fun x => (H x).det) ws x = + (H x).det * ((H x)⁻¹ * (show Matrix (Fin n) (Fin n) ℂ from fun i j => cword e (fun y => H y i j) ws x)).trace + + detJetRemainder e H ws x := by + rw [cword_det_remainder e H hH ws hw x] + congr 1 + exact MongeAmpere.real_fderiv_det_apply _ _ hinv +end TameInterpolation + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/DimensionOnePotential.lean b/lean/OAI/Geometry/PrescribedRicci/DimensionOnePotential.lean new file mode 100644 index 0000000000000000000000000000000000000000..78d7cb7cfbaf1d47aeca3a4c5522271f6afa66bc --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/DimensionOnePotential.lean @@ -0,0 +1,111 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.NormalizedPoisson +import OAI.Geometry.PrescribedPotential.VolumePath + +namespace OAI + +/-! Dimension One Potential. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff Classical ComplexOrder +namespace MongeAmpere + +lemma singleton_det_add (H K : Matrix (Fin 1) (Fin 1) ℂ) (hH : H.PosDef) : + (H + K).det.re = H.det.re * (1 + (H⁻¹ * K).trace.re) := by + have hr : ((H 0 0).re : ℂ) = H 0 0 := + Complex.conj_eq_iff_re.mp (hH.isHermitian.apply 0 0) + have hn : (H 0 0).re ≠ 0 := ne_of_gt (Complex.pos_iff.mp hH.diag_pos).1 + simp only [Matrix.det_fin_one, Matrix.add_apply, Complex.add_re, + Matrix.trace_fin_one, Matrix.mul_apply, Fin.sum_univ_one, + Matrix.inv_def, Matrix.adjugate_fin_one, Matrix.det_fin_one] + rw [← hr] + simp [Complex.mul_re, Complex.inv_re, Complex.inv_im, Complex.normSq, Ring.inverse_eq_inv] + field_simp + +lemma singleton_posDef_of_det (H : Matrix (Fin 1) (Fin 1) ℂ) + (hH : H.IsHermitian) (hp : 0 < H.det.re) : H.PosDef := by + have hd : H = Matrix.diagonal (fun _ : Fin 1 => H 0 0) := by + ext i j + fin_cases i + fin_cases j + simp + rw [hd, Matrix.posDef_diagonal_iff] + intro i + apply Complex.pos_iff.mpr + refine ⟨?_, ?_⟩ + · simpa only [Matrix.det_fin_one] using hp + · exact (Complex.conj_eq_iff_im.mp (hH.apply 0 0)).symm +end MongeAmpere + +namespace Anticanonical.SourceSmooth +variable {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas 1 X} + + + +theorem dimensionOne_positiveDensity (g : KaehlerMetric A) (q : SmoothRealFunction A) + (hq : ∀ x, 0 < q.value x) : + ∃ (φ : SmoothRealFunction A) (c : ℝ), 0 < c ∧ g.PositivePotential φ ∧ + ∀ i z, z ∈ (A.chart i).target → + (g.matrix i z + φ.hessian i z).det.re = + c * q.localExpression i z * g.volumeCoefficient i z := by + let x₀ : X := Classical.arbitrary X + obtain ⟨u,a,hn,he⟩ := normalizedPoisson 1 X A g x₀ q + have ha : 0 < a := by + obtain ⟨x,_,hx⟩ := isCompact_univ.exists_isMaxOn Set.univ_nonempty u.continuous.continuousOn + obtain ⟨i,hi⟩ := A.covers x + have hm := g.linearized_nonpos_at_globalMax u (fun y => hx (mem_univ y)) i hi + have heq := he i (A.chart i x) ((A.chart i).mapsTo hi) + have hqe : q.localExpression i (A.chart i x) = q.value x := by + simp only [SmoothRealFunction.localExpression, Function.comp_apply, (A.chart i).left_inv hi] + rw [hqe] at heq + linarith [hq x] + let φ := u.realSMul a⁻¹ + have heq (i : Fin A.count) (z : Coordinates 1) (hz : z ∈ (A.chart i).target) : + (g.matrix i z + φ.hessian i z).det.re = + a⁻¹ * q.localExpression i z * g.volumeCoefficient i z := by + rw [MongeAmpere.singleton_det_add _ _ (g.positive i z hz)] + change g.volumeCoefficient i z * (1 + g.linearizedMongeAmpere φ i z) = _ + rw [show φ = u.realSMul a⁻¹ from rfl, g.linearizedMongeAmpere_realSMul] + have hh := he i z hz + have hae : a ≠ 0 := ne_of_gt ha + field_simp + rw [add_comm a _,hh] + refine ⟨φ,a⁻¹,inv_pos.mpr ha,?_,heq⟩ + intro i z hz + apply MongeAmpere.singleton_posDef_of_det + · exact (g.positive i z hz).isHermitian.add (φ.hessian_hermitian i hz) + · rw [heq i z hz] + exact mul_pos (mul_pos (inv_pos.mpr ha) (hq ((A.chart i).symm z))) + (g.volumeCoefficient_pos i hz) + + + +theorem prescribedPotential_dimensionOne (X : Type) [TopologicalSpace X] [T2Space X] + [CompactSpace X] [ConnectedSpace X] (A : ComplexAtlas 1 X) + (P : A.ProjectiveEmbedding) (h : SemipositiveAnticanonicalMetric A) : + HasPrescribedVolumePotential P h := by + let g := projectiveBackground P + let F := prescribedForcing g h + let q : SmoothRealFunction A := { + value := fun x => Real.exp (F.value x) + smooth := fun i => Real.contDiff_exp.contDiffOn.comp (F.smooth i) (fun _ _ => mem_univ _) } + obtain ⟨φ,c,hc,hp,he⟩ := dimensionOne_positiveDensity g q (fun x => Real.exp_pos _) + refine ⟨φ,c,hc,hp,fun i z hz => ?_⟩ + rw [he i z hz] + change c * Real.exp (F.localExpression i z) * g.volumeCoefficient i z = _ + rw [prescribedForcing_local g h i hz, Real.exp_sub, + Real.exp_log (g.volumeCoefficient_pos i hz)] + field_simp [ne_of_gt (g.volumeCoefficient_pos i hz)] + +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/DimensionZeroPotential.lean b/lean/OAI/Geometry/PrescribedRicci/DimensionZeroPotential.lean new file mode 100644 index 0000000000000000000000000000000000000000..af4828c8c15ada59c7a78ec8e3d3e9372892cb9a --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/DimensionZeroPotential.lean @@ -0,0 +1,48 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.NormalizedPoisson +import OAI.Geometry.PrescribedPotential.VolumePath + +namespace OAI + +/-! Dimension Zero Potential. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff Classical ComplexOrder +namespace Anticanonical.SourceSmooth +variable {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas 0 X} + +lemma dimensionZero_forcing_constant (g : KaehlerMetric A) + (line : SemipositiveAnticanonicalMetric A) : + ∃ c : ℝ, ∀ x, (prescribedForcing g line).value x = c := by + obtain ⟨u,c,_,he⟩ := normalizedPoisson 0 X A g (Classical.arbitrary X) (prescribedForcing g line) + refine ⟨c,fun x => ?_⟩ + obtain ⟨i,hi⟩ := A.covers x + have h := he i (A.chart i x) ((A.chart i).mapsTo hi) + have hz : g.linearizedMongeAmpere u i (A.chart i x) = 0 := by + simp [KaehlerMetric.linearizedMongeAmpere,Matrix.trace] + rw [hz,zero_add] at h + have hx : (prescribedForcing g line).localExpression i (A.chart i x) = + (prescribedForcing g line).value x := by + simp only [SmoothRealFunction.localExpression,Function.comp_apply,(A.chart i).left_inv hi] + exact (h.trans hx).symm + +lemma volumePath_zeroDim_one (g : KaehlerMetric A) (line : SemipositiveAnticanonicalMetric A) : + ∃ (φ : SmoothRealFunction A) (b : ℝ), SolvesVolumePath g line 1 φ b := by + obtain ⟨c,hc⟩ := dimensionZero_forcing_constant g line + obtain ⟨hp,hzero⟩ := volumePath_zero g line + refine ⟨SmoothRealFunction.constant 0,-c,hp,fun x => ?_⟩ + rw [hzero x,hc x] + ring + +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/DirectionalInterpolation.lean b/lean/OAI/Geometry/PrescribedRicci/DirectionalInterpolation.lean new file mode 100644 index 0000000000000000000000000000000000000000..baaf59fd4a35b12e0f2cc7a728a971f42a53b43e --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/DirectionalInterpolation.lean @@ -0,0 +1,83 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.LpPowerBounds +import OAI.Geometry.PrescribedRicci.PowerIntegration + +namespace OAI + +/-! Directional Interpolation. -/ + +section + + + +noncomputable section +open Set Filter Topology MeasureTheory +open scoped ContDiff ENNReal +namespace TameInterpolation +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +lemma directional_lp_interpolation {p : ℝ} (hp : 2 < p) + (α β r s : ℝ≥0∞) [ENNReal.HolderTriple α β s] [ENNReal.HolderTriple s r 1] + (hr : r * ENNReal.ofReal (p-2) = ENNReal.ofReal p) + (v : E) {f : E → ℝ} (hf : ContDiff ℝ ∞ f) (hc : HasCompactSupport f) : + (lpNorm (dir v f) (ENNReal.ofReal p) volume)^2 ≤ + (p-1)*lpNorm f α volume*lpNorm (dir v (dir v f)) β volume := by + let a := dir v f + let b := dir v a + have ha : ContDiff ℝ ∞ a := dir_smooth v hf + have hb : ContDiff ℝ ∞ b := dir_smooth v ha + have hac : HasCompactSupport a := dir_compact v hc + have hbc : HasCompactSupport b := dir_compact v hac + have hfa : MemLp f α := hf.continuous.memLp_of_hasCompactSupport hc + have hbb : MemLp b β := hb.continuous.memLp_of_hasCompactSupport hbc + have hfb : MemLp (fun x => f x*b x) s := hfa.fun_mul hbb + have hpc : Continuous (fun x => |a x|^(p-2)) := + ha.continuous.abs.rpow_const (fun _ => Or.inr (by linarith)) + have hps : HasCompactSupport (fun x => |a x|^(p-2)) := + hac.comp_left (g:=fun x : ℝ => |x|^(p-2)) (by simp [Real.zero_rpow (by linarith : p-2 ≠ 0)]) + have hpr : MemLp (fun x => |a x|^(p-2)) r := hpc.memLp_of_hasCompactSupport hps + have hpw : lpNorm (fun x => |a x|^(p-2)) r volume = + (lpNorm a (ENNReal.ofReal p) volume)^(p-2) := by + simpa only [Real.norm_eq_abs,hr] using lpNorm_norm_rpow a ha.continuous.aestronglyMeasurable r (by linarith : 0 < p-2) + have hI : |∫ x, f x*|a x|^(p-2)*b x| ≤ + (lpNorm f α volume*lpNorm b β volume)*(lpNorm a (ENNReal.ofReal p) volume)^(p-2) := by + have he : (fun x => f x*|a x|^(p-2)*b x) = (fun x => (f x*b x)*|a x|^(p-2)) := by + funext x; ring + rw [he] + calc + _ ≤ lpNorm (fun x => (f x*b x)*|a x|^(p-2)) 1 volume := + integral_norm_le_lpNorm (hfb.aestronglyMeasurable.mul hpr.aestronglyMeasurable) + _ ≤ lpNorm (fun x => f x*b x) s volume * lpNorm (fun x => |a x|^(p-2)) r volume := lpNorm_mul_le hfb hpr + _ ≤ (lpNorm f α volume*lpNorm b β volume)*lpNorm (fun x => |a x|^(p-2)) r volume := + mul_le_mul_of_nonneg_right (lpNorm_mul_le hfa hbb) lpNorm_nonneg + _ = _ := by rw [hpw] + let Y := lpNorm a (ENNReal.ofReal p) volume + have hY : 0 ≤ Y := lpNorm_nonneg + have he := power_dir_integration hp v hf hc + have hpow : Y^p ≤ ((p-1)*lpNorm f α volume*lpNorm b β volume)*Y^(p-2) := by + calc + Y^p = ∫ x, |a x|^p := by simpa [Y,Real.norm_eq_abs] using lpNorm_rpow_integral a ha.continuous.aestronglyMeasurable (by linarith : 0 < p) + _ = -(p-1) * ∫ x, f x*|a x|^(p-2)*b x := he + _ ≤ (p-1)*|∫ x, f x*|a x|^(p-2)*b x| := by + nlinarith [neg_le_abs (∫ x, f x*|a x|^(p-2)*b x)] + _ ≤ (p-1)*((lpNorm f α volume*lpNorm b β volume)*Y^(p-2)) := + mul_le_mul_of_nonneg_left hI (by linarith) + _ = _ := by ring + by_cases hz : Y = 0 + · change Y^2 ≤ _ + rw [hz,zero_pow (by decide : 2 ≠ 0)] + exact mul_nonneg (mul_nonneg (by linarith) lpNorm_nonneg) lpNorm_nonneg + · have hYp : 0 < Y := lt_of_le_of_ne hY (Ne.symm hz) + have hyr : Y^p = Y^2*Y^(p-2) := by + rw [← Real.rpow_natCast Y 2,← Real.rpow_add hYp] + congr 1 + ring + rw [hyr] at hpow + exact (mul_le_mul_iff_left₀ (Real.rpow_pos_of_pos hYp (p-2))).mp hpow +end TameInterpolation + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/DiscreteInterpolation.lean b/lean/OAI/Geometry/PrescribedRicci/DiscreteInterpolation.lean new file mode 100644 index 0000000000000000000000000000000000000000..af2df4d170eec1b10107da9a35a6fe14c8b3916f --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/DiscreteInterpolation.lean @@ -0,0 +1,123 @@ +import Mathlib + +namespace OAI + +/-! Discrete Interpolation. -/ + +noncomputable section +open Set Filter Topology +namespace TameInterpolation + +lemma discrete_maximum (m : ℕ) (z : ℕ → ℝ) (h0 : z 0 ≤ 0) (hm : z m ≤ 0) + (hr : ∀ j, j+2 ≤ m → 2*z (j+1) ≤ z j+z (j+2)) : + ∀ j, j ≤ m → z j ≤ 0 := by + let S := Finset.range (m+1) + have hS : S.Nonempty := ⟨0,by simp [S]⟩ + let M := S.sup' hS z + have hupper (j : ℕ) (hj : j ≤ m) : z j ≤ M := + Finset.le_sup' z (by simpa [S] using Nat.lt_succ_of_le hj) + have hm0 : M ≤ 0 := by + by_contra! hM + obtain ⟨i,hi,he⟩ := Finset.exists_mem_eq_sup' hS z + have hex : ∃ i, i ≤ m ∧ z i = M := ⟨i,by simpa [S] using hi,he.symm⟩ + let q := Nat.find hex + have hq := Nat.find_spec hex + change q ≤ m ∧ z q = M at hq + have hq0 : 0 < q := by + by_contra! hn + have hzero : q = 0 := by omega + rw [hzero] at hq + linarith only [h0,hq.2,hM] + have hqm : q < m := by + by_contra! hn + have heq : q = m := by omega + rw [heq] at hq + linarith only [hm,hq.2,hM] + have hrec := hr (q-1) (by omega) + have hleft := hupper (q-1) (by omega) + have hright := hupper (q+1) (by omega) + have he1 : q-1+1 = q := by omega + have he2 : q-1+2 = q+1 := by omega + rw [he1,he2,hq.2] at hrec + have hprev : z (q-1) = M := by linarith only [hrec,hleft,hright] + have hmin := Nat.find_min' hex (show q-1 ≤ m ∧ z (q-1) = M from ⟨by omega,hprev⟩) + change q ≤ q-1 at hmin + omega + exact fun j hj => (hupper j hj).trans hm0 + +lemma positive_sequence_product (m j : ℕ) (hm : 0 < m) (hj : j ≤ m) + (a : ℕ → ℝ) (ha : ∀ i, 0 < a i) (C : ℝ) (hC : 0 < C) + (hr : ∀ i, i+2 ≤ m → (a (i+1))^2 ≤ C*a i*a (i+2)) : + a j*a (m-j) ≤ C^(j*(m-j))*a 0*a m := by + have hm' : (m:ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt hm) + let z : ℕ → ℝ := fun i => Real.log (a i) - ((i:ℝ)/(m:ℝ))*Real.log (a m) - + (1-(i:ℝ)/(m:ℝ))*Real.log (a 0) - ((i:ℝ)*((m:ℝ)-(i:ℝ))/2)*Real.log C + have hz0 : z 0 ≤ 0 := by simp [z] + have hzm : z m ≤ 0 := by simp [z,hm'] + have hzr (i : ℕ) (hi : i+2 ≤ m) : 2*z (i+1) ≤ z i+z (i+2) := by + have hlog := Real.log_le_log (sq_pos_of_pos (ha (i+1))) (hr i hi) + rw [Real.log_pow,Real.log_mul (mul_ne_zero hC.ne' (ha i).ne') (ha (i+2)).ne', + Real.log_mul hC.ne' (ha i).ne'] at hlog + have he : z i+z (i+2)-2*z (i+1) = + Real.log (a i)+Real.log (a (i+2))-2*Real.log (a (i+1))+Real.log C := by + dsimp [z] + push_cast + ring + norm_num only [Nat.cast_ofNat] at hlog + linarith only [hlog,he] + have h1 := discrete_maximum m z hz0 hzm hzr j hj + have h2 := discrete_maximum m z hz0 hzm hzr (m-j) (by omega) + have he : z j+z (m-j) = Real.log (a j)+Real.log (a (m-j))- + Real.log (a 0)-Real.log (a m)-((j*(m-j):ℕ):ℝ)*Real.log C := by + dsimp [z] + rw [Nat.cast_sub hj,Nat.cast_mul,Nat.cast_sub hj] + field_simp + ring + have hlog : Real.log (a j*a (m-j)) ≤ Real.log (C^(j*(m-j))*a 0*a m) := by + rw [Real.log_mul (ha j).ne' (ha (m-j)).ne', + Real.log_mul (mul_ne_zero (pow_ne_zero _ hC.ne') (ha 0).ne') (ha m).ne', + Real.log_mul (pow_ne_zero _ hC.ne') (ha 0).ne',Real.log_pow] + linarith only [h1,h2,he] + have hh := Real.exp_le_exp.mpr hlog + rw [Real.exp_log (mul_pos (ha j) (ha (m-j))), + Real.exp_log (mul_pos (mul_pos (pow_pos hC _) (ha 0)) (ha m))] at hh + exact hh + +lemma clamp_recurrence (m : ℕ) (a : ℕ → ℝ) (ha : ∀ i, 0 ≤ a i) + (C : ℝ) (hC : 1 ≤ C) + (hr : ∀ i, i+2 ≤ m → (a (i+1))^2 ≤ C*a i*a (i+2)) + (ε : ℝ) (hε : 0 < ε) : + ∀ i, i+2 ≤ m → (max (a (i+1)) ε)^2 ≤ C*max (a i) ε*max (a (i+2)) ε := by + intro i hi + by_cases hmid : a (i+1) ≤ ε + · rw [max_eq_right hmid] + have hprod : ε*ε ≤ max (a i) ε*max (a (i+2)) ε := + mul_le_mul (le_max_right _ _) (le_max_right _ _) hε.le (hε.le.trans (le_max_right _ _)) + nlinarith [mul_nonneg hε.le hε.le] + · rw [max_eq_left (le_of_not_ge hmid)] + exact (hr i hi).trans (by gcongr <;> first | exact le_max_left _ _ | exact ha _) + +theorem nonnegative_sequence_product (m j : ℕ) (hm : 0 < m) (hj : j ≤ m) + (a : ℕ → ℝ) (ha : ∀ i, 0 ≤ a i) (C : ℝ) (hC : 1 ≤ C) + (hr : ∀ i, i+2 ≤ m → (a (i+1))^2 ≤ C*a i*a (i+2)) : + a j*a (m-j) ≤ C^(j*(m-j))*a 0*a m := by + have hbound (ε : ℝ) (hε : 0 < ε) : + a j*a (m-j) ≤ C^(j*(m-j))*max (a 0) ε*max (a m) ε := by + apply (mul_le_mul (le_max_left _ _) (le_max_left _ _) (ha _) (le_trans (ha _) (le_max_left _ _))).trans + exact positive_sequence_product m j hm hj (fun i => max (a i) ε) + (fun i => hε.trans_le (le_max_right _ _)) C (by linarith only [hC]) + (clamp_recurrence m a ha C hC hr ε hε) + have hcont : Continuous (fun ε : ℝ => C^(j*(m-j))*max (a 0) ε*max (a m) ε) := + (continuous_const.mul (continuous_const.max continuous_id)).mul (continuous_const.max continuous_id) + have hlim : Tendsto (fun ε : ℝ => C^(j*(m-j))*max (a 0) ε*max (a m) ε) + (𝓝[>] 0) (𝓝 (C^(j*(m-j))*a 0*a m)) := by + simpa only [max_eq_left (ha 0),max_eq_left (ha m)] using + (hcont.tendsto 0).mono_left nhdsWithin_le_nhds + apply ge_of_tendsto hlim + filter_upwards [self_mem_nhdsWithin] with ε hε + exact hbound ε hε +end TameInterpolation + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/DiscreteManyProduct.lean b/lean/OAI/Geometry/PrescribedRicci/DiscreteManyProduct.lean new file mode 100644 index 0000000000000000000000000000000000000000..5bf8fc72691d45965be6a208dce75fb3b8387463 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/DiscreteManyProduct.lean @@ -0,0 +1,111 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.DiscreteInterpolation + +namespace OAI + +/-! Discrete Many Product. -/ + +noncomputable section +open Set Filter Topology +open scoped BigOperators +namespace TameInterpolation + +lemma positive_sequence_log_bound (m : ℕ) (hm : 0 < m) + (a : ℕ → ℝ) (ha : ∀ i, 0 < a i) (C : ℝ) (hC : 0 < C) + (hr : ∀ i, i+2 ≤ m → (a (i+1))^2 ≤ C*a i*a (i+2)) + (j : ℕ) (hj : j ≤ m) : + Real.log (a j) ≤ ((j:ℝ)/(m:ℝ))*Real.log (a m) + + (1-(j:ℝ)/(m:ℝ))*Real.log (a 0) + ((j:ℝ)*((m:ℝ)-(j:ℝ))/2)*Real.log C := by + have hm' : (m:ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt hm) + let z : ℕ → ℝ := fun i => Real.log (a i) - ((i:ℝ)/(m:ℝ))*Real.log (a m) - + (1-(i:ℝ)/(m:ℝ))*Real.log (a 0) - ((i:ℝ)*((m:ℝ)-(i:ℝ))/2)*Real.log C + have hz0 : z 0 ≤ 0 := by simp [z] + have hzm : z m ≤ 0 := by simp [z,hm'] + have hzr (i : ℕ) (hi : i+2 ≤ m) : 2*z (i+1) ≤ z i+z (i+2) := by + have hlog := Real.log_le_log (sq_pos_of_pos (ha (i+1))) (hr i hi) + rw [Real.log_pow,Real.log_mul (mul_ne_zero hC.ne' (ha i).ne') (ha (i+2)).ne', + Real.log_mul hC.ne' (ha i).ne'] at hlog + have he : z i+z (i+2)-2*z (i+1) = + Real.log (a i)+Real.log (a (i+2))-2*Real.log (a (i+1))+Real.log C := by + dsimp [z] + push_cast + ring + norm_num only [Nat.cast_ofNat] at hlog + linarith only [hlog,he] + have h := discrete_maximum m z hz0 hzm hzr j hj + dsimp [z] at h + linarith only [h] + +lemma positive_sequence_many (m : ℕ) (hm : 0 < m) + (a : ℕ → ℝ) (ha : ∀ i, 0 < a i) (C : ℝ) (hC : 1 ≤ C) + (hr : ∀ i, i+2 ≤ m → (a (i+1))^2 ≤ C*a i*a (i+2)) + {ι : Type*} (s : Finset ι) (j : ι → ℕ) (hs : ∑ i ∈ s, j i = m) : + ∏ i ∈ s, a (j i) ≤ C^(∑ i ∈ s, j i*(m-j i))*a 0^(s.card-1)*a m := by + have hC0 : 0 < C := by linarith only [hC] + have hm' : (m:ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt hm) + have hsn : s.Nonempty := by + by_contra h + rw [Finset.not_nonempty_iff_eq_empty.mp h,Finset.sum_empty] at hs + omega + have hj (i : ι) (hi : i ∈ s) : j i ≤ m := by + rw [← hs] + exact Finset.single_le_sum (fun _ _ => Nat.zero_le _) hi + have hc : (s.card:ℝ)-1 = ((s.card-1:ℕ):ℝ) := by + rw [Nat.cast_sub (by simpa using hsn.card_pos),Nat.cast_one] + have hs' : ∑ i ∈ s, (j i:ℝ)/(m:ℝ) = 1 := by + rw [← Finset.sum_div,← Nat.cast_sum,hs,div_self hm'] + have he1 : ∑ i ∈ s, (j i:ℝ)/(m:ℝ)*Real.log (a m) = Real.log (a m) := by + rw [← Finset.sum_mul,hs',one_mul] + have he2 : ∑ i ∈ s, (1-(j i:ℝ)/(m:ℝ))*Real.log (a 0) = ((s.card-1:ℕ):ℝ)*Real.log (a 0) := by + rw [← Finset.sum_mul,Finset.sum_sub_distrib,hs'] + simp only [Finset.sum_const,nsmul_eq_mul,mul_one,hc] + have he3 : ∑ i ∈ s, ((j i:ℝ)*((m:ℝ)-(j i:ℝ))/2)*Real.log C ≤ + ((∑ i ∈ s, j i*(m-j i):ℕ):ℝ)*Real.log C := by + rw [Nat.cast_sum,Finset.sum_mul] + apply Finset.sum_le_sum + intro i hi + rw [Nat.cast_mul,Nat.cast_sub (hj i hi)] + have hnon : 0 ≤ (j i:ℝ)*((m:ℝ)-(j i:ℝ)) := by + exact mul_nonneg (by positivity) (sub_nonneg.mpr (by exact_mod_cast hj i hi)) + have hlogC : 0 ≤ Real.log C := Real.log_nonneg hC + nlinarith only [hnon,hlogC,mul_nonneg hnon hlogC] + have hlog : ∑ i ∈ s, Real.log (a (j i)) ≤ + ((∑ i ∈ s, j i*(m-j i):ℕ):ℝ)*Real.log C + ((s.card-1:ℕ):ℝ)*Real.log (a 0)+Real.log (a m) := by + have hh := Finset.sum_le_sum (fun i hi => positive_sequence_log_bound m hm a ha C hC0 hr (j i) (hj i hi)) + rw [Finset.sum_add_distrib,Finset.sum_add_distrib,he1,he2] at hh + linarith only [hh,he3] + have hl : Real.log (∏ i ∈ s, a (j i)) = ∑ i ∈ s, Real.log (a (j i)) := + Real.log_prod (fun _ _ => (ha _).ne') + have hp : 0 < ∏ i ∈ s, a (j i) := Finset.prod_pos (fun _ _ => ha _) + have hrp : 0 < C^(∑ i ∈ s, j i*(m-j i))*a 0^(s.card-1)*a m := mul_pos (mul_pos (pow_pos hC0 _) (pow_pos (ha 0) _)) (ha m) + have hrlog : Real.log (C^(∑ i ∈ s, j i*(m-j i))*a 0^(s.card-1)*a m) = + ((∑ i ∈ s, j i*(m-j i):ℕ):ℝ)*Real.log C + ((s.card-1:ℕ):ℝ)*Real.log (a 0)+Real.log (a m) := by + rw [Real.log_mul (mul_ne_zero (pow_ne_zero _ hC0.ne') (pow_ne_zero _ (ha 0).ne')) (ha m).ne', + Real.log_mul (pow_ne_zero _ hC0.ne') (pow_ne_zero _ (ha 0).ne'),Real.log_pow,Real.log_pow] + rw [← hl,← hrlog] at hlog + exact (Real.log_le_log_iff hp hrp).mp hlog + +lemma nonnegative_sequence_many (m : ℕ) (hm : 0 < m) + (a : ℕ → ℝ) (ha : ∀ i, 0 ≤ a i) (C : ℝ) (hC : 1 ≤ C) + (hr : ∀ i, i+2 ≤ m → (a (i+1))^2 ≤ C*a i*a (i+2)) + {ι : Type*} (s : Finset ι) (j : ι → ℕ) (hs : ∑ i ∈ s, j i = m) : + ∏ i ∈ s, a (j i) ≤ C^(∑ i ∈ s, j i*(m-j i))*a 0^(s.card-1)*a m := by + have hbound (ε : ℝ) (hε : 0 < ε) : + ∏ i ∈ s, a (j i) ≤ C^(∑ i ∈ s, j i*(m-j i))*(max (a 0) ε)^(s.card-1)*max (a m) ε := by + apply (Finset.prod_le_prod₀ (fun i _ => ha (j i)) (fun i _ => le_max_left (a (j i)) ε)).trans + exact positive_sequence_many m hm (fun i => max (a i) ε) + (fun i => hε.trans_le (le_max_right _ _)) C hC (clamp_recurrence m a ha C hC hr ε hε) s j hs + have hcont : Continuous (fun ε : ℝ => C^(∑ i ∈ s, j i*(m-j i))*(max (a 0) ε)^(s.card-1)*max (a m) ε) := by + fun_prop + have hlim : Tendsto (fun ε : ℝ => C^(∑ i ∈ s, j i*(m-j i))*(max (a 0) ε)^(s.card-1)*max (a m) ε) + (𝓝[>] 0) (𝓝 (C^(∑ i ∈ s, j i*(m-j i))*a 0^(s.card-1)*a m)) := by + simpa only [max_eq_left (ha 0),max_eq_left (ha m)] using + (hcont.tendsto 0).mono_left nhdsWithin_le_nhds + apply ge_of_tendsto hlim + filter_upwards [self_mem_nhdsWithin] with ε hε + exact hbound ε hε +end TameInterpolation + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/FamilyJetNorm.lean b/lean/OAI/Geometry/PrescribedRicci/FamilyJetNorm.lean new file mode 100644 index 0000000000000000000000000000000000000000..41e80e3e04ef9c63dace67b339a104f1023ba50f --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/FamilyJetNorm.lean @@ -0,0 +1,73 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.DiscreteManyProduct +import OAI.Geometry.PrescribedRicci.JetTameProduct + +namespace OAI + +/-! Family Jet Norm. -/ + +section + + + +noncomputable section +open Set Filter Topology MeasureTheory +open scoped ContDiff ENNReal Classical BigOperators +namespace TameInterpolation +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] +variable {ι κ : Type*} [Fintype ι] [Nonempty ι] [Fintype κ] [Nonempty κ] + +def familyJetNorm (e : ι → E) (f : κ → E → ℝ) (j : ℕ) (p : ℝ≥0∞) : ℝ := + Finset.univ.sup' Finset.univ_nonempty (fun a : κ => jetNorm e (f a) j p) + +lemma jetNorm_le_family (e : ι → E) (f : κ → E → ℝ) (a : κ) (j : ℕ) (p : ℝ≥0∞) : + jetNorm e (f a) j p ≤ familyJetNorm e f j p := by + exact Finset.le_sup' (fun a : κ => jetNorm e (f a) j p) (Finset.mem_univ a) + +lemma familyJetNorm_nonneg (e : ι → E) (f : κ → E → ℝ) (j : ℕ) (p : ℝ≥0∞) : + 0 ≤ familyJetNorm e f j p := + (jetNorm_nonneg e (f (Classical.choice ‹Nonempty κ›)) j p).trans (jetNorm_le_family _ _ _ _ _) + +lemma familyJetNorm_attained (e : ι → E) (f : κ → E → ℝ) (j : ℕ) (p : ℝ≥0∞) : + ∃ a : κ, familyJetNorm e f j p = jetNorm e (f a) j p := by + obtain ⟨a,_,ha⟩ := Finset.exists_mem_eq_sup' (s:=Finset.univ) Finset.univ_nonempty + (fun a : κ => jetNorm e (f a) j p) + exact ⟨a,ha⟩ + +lemma familyJetNorm_recurrence (e : ι → E) (f : κ → E → ℝ) + (hf : ∀ a, ContDiff ℝ ∞ (f a)) (hc : ∀ a, HasCompactSupport (f a)) + (m : ℕ) (hm : 0 < m) (j : ℕ) (hj : j+2 ≤ m) : + (familyJetNorm e f (j+1) (exponent m (j+1)))^2 ≤ + (2*(m:ℝ))*familyJetNorm e f j (exponent m j)*familyJetNorm e f (j+2) (exponent m (j+2)) := by + obtain ⟨a,ha⟩ := familyJetNorm_attained e f (j+1) (exponent m (j+1)) + rw [ha] + apply (jet_exponent_recurrence e (hf a) (hc a) m hm j hj).trans + exact mul_le_mul + (mul_le_mul_of_nonneg_left (jetNorm_le_family _ _ _ _ _) (by positivity)) + (jetNorm_le_family _ _ _ _ _) (jetNorm_nonneg _ _ _ _) (mul_nonneg (by positivity) (familyJetNorm_nonneg _ _ _ _)) + +lemma exponent_top {m : ℕ} (hm : 0 < m) : exponent m m = 2 := by + rw [exponent_of_pos hm hm] + have hmn : (m:ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt hm) + rw [mul_div_cancel_right₀ _ hmn] + norm_num + +theorem family_jet_tame_many (e : ι → E) (f : κ → E → ℝ) + (hf : ∀ a, ContDiff ℝ ∞ (f a)) (hc : ∀ a, HasCompactSupport (f a)) + (m : ℕ) (hm : 0 < m) {ν : Type*} (s : Finset ν) (j : ν → ℕ) + (hs : ∑ i ∈ s, j i = m) : + ∏ i ∈ s, familyJetNorm e f (j i) (exponent m (j i)) ≤ + (2*(m:ℝ))^(∑ i ∈ s, j i*(m-j i))*(familyJetNorm e f 0 ∞)^(s.card-1)*familyJetNorm e f m 2 := by + have hC : 1 ≤ 2*(m:ℝ) := by + have : (1:ℝ) ≤ (m:ℝ) := by exact_mod_cast hm + linarith only [this] + simpa only [exponent_zero,exponent_top hm] using nonnegative_sequence_many m hm + (fun i => familyJetNorm e f i (exponent m i)) (fun _ => familyJetNorm_nonneg _ _ _ _) + (2*(m:ℝ)) hC (familyJetNorm_recurrence e f hf hc m hm) s j hs +end TameInterpolation + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/FiniteCofactor.lean b/lean/OAI/Geometry/PrescribedRicci/FiniteCofactor.lean new file mode 100644 index 0000000000000000000000000000000000000000..8db392b4b04ba015db768985c29091c1ac576e22 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/FiniteCofactor.lean @@ -0,0 +1,136 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CompletedRealification +import OAI.Geometry.PrescribedPotential.GlobalConjugation +import OAI.Geometry.PrescribedPotential.GlobalHessian +import OAI.Geometry.PrescribedPotential.GlobalMetricEntries +import OAI.Geometry.PrescribedRicci.MatrixDifferentialNew +import OAI.Geometry.PrescribedPotential.NonlinearHessianCommutator +import OAI.Geometry.PrescribedPotential.SobolevDetDifferential + +namespace OAI + +/-! Finite Cofactor. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff SchwartzMap Classical BoundedContinuousFunction ComplexOrder MatrixOrder Matrix.Norms.Elementwise +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace Localizers +variable (L : Localizers A ι) +lemma strong_lower {s t : ℝ} (hst : t ≤ s) + (hs : (Module.finrank ℝ (EC d):ℝ) < 2*s) + (ht : (Module.finrank ℝ (EC d):ℝ) < 2*t) (u : L.Sobolev s) : + L.strong t (L.lower s t u) = L.strong s u := by + have he : (fun u => L.strong t (L.lower s t u)) = (fun u => L.strong s u) := by + apply (L.embed_dense s).equalizer (by fun_prop) (by fun_prop) + funext f + simp only [Function.comp_apply,L.lower_embed hst,L.strong_embed s hs,L.strong_embed t ht] + exact congr_fun he u +end Localizers +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +lemma completedHessian_lower (k l : ℕ) (hlk : l ≤ k) (p : ι) (i j : Fin d) + (u : D.localizers.Sobolev ((k:ℝ)+2)) : + D.completedHessian l p i j (D.localizers.lower ((k:ℝ)+2) ((l:ℝ)+2) u) = + D.localizers.lower (k:ℝ) (l:ℝ) (D.completedHessian k p i j u) := by + have hkl : (l:ℝ) ≤ (k:ℝ) := by exact_mod_cast hlk + have he : (fun u => D.completedHessian l p i j (D.localizers.lower ((k:ℝ)+2) ((l:ℝ)+2) u)) = + (fun u => D.localizers.lower (k:ℝ) (l:ℝ) (D.completedHessian k p i j u)) := by + apply (D.localizers.embed_dense ((k:ℝ)+2)).equalizer (by fun_prop) (by fun_prop) + funext f + simp only [Function.comp_apply,D.completedHessian_embed, + D.localizers.lower_embed (add_le_add hkl le_rfl),D.localizers.lower_embed hkl] + exact congr_fun he u + +lemma completedRealify_strong (k : ℕ) + (hk : (Module.finrank ℝ (EC d):ℝ) < 2*(k:ℝ)) (u : D.localizers.Sobolev (k:ℝ)) (x : X) : + D.localizers.strong (k:ℝ) (D.completedRealify k u) x = + ((D.localizers.strong (k:ℝ) u x).re : ℂ) := by + have he : (fun u => D.localizers.strong (k:ℝ) (D.completedRealify k u) x) = + (fun u => ((D.localizers.strong (k:ℝ) u x).re : ℂ)) := by + apply (D.localizers.embed_dense (k:ℝ)).equalizer (by fun_prop) (by fun_prop) + funext f + simp only [Function.comp_apply,D.completedRealify_embed,D.localizers.strong_embed _ hk] + exact Smooth.realify_apply f x + exact congr_fun he u + +def cofactorMatrix (B : Bilin (EC d)) : Matrix (Fin d) (Fin d) ℂ := + PotentialKaehler.hermitianPartMatrix (pullBilin B) + +def cofactorScalar (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (p : ι) + (B : Bilin (EC d)) (u : D.localizers.Sobolev ((k:ℝ)+2)) : D.localizers.Sobolev (k:ℝ) := + D.completedRealify k (D.product k hk (D.localizers.embed (k:ℝ) (D.inverseDet p)) + (D.detDifferential k hk d + (fun i j => D.localizers.embed (k:ℝ) (D.metricEntry p i j) + D.completedHessian k p i j u) + (fun i j => D.localizers.embed (k:ℝ) (Smooth.const (cofactorMatrix B i j))))) + +lemma cofactorScalar_continuous (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (p : ι) (B : Bilin (EC d)) : Continuous (D.cofactorScalar k hk p B) := by + apply (D.completedRealify k).continuous.comp + apply (D.product k hk (D.localizers.embed (k:ℝ) (D.inverseDet p))).continuous.comp + apply Continuous.clm_apply + · exact (D.detDifferential_contDiff k hk d).continuous.comp (by fun_prop) + · fun_prop + +lemma cofactorScalar_strong (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (p : ι) (B : Bilin (EC d)) (u : D.localizers.Sobolev ((k:ℝ)+2)) (x : X) : + D.localizers.strong (k:ℝ) (D.cofactorScalar k hk p B u) x = + ((D.inverseDet p x * NonlinearHessian.detDifferential + (fun i j => D.metricEntry p i j x + D.localizers.strong (k:ℝ) (D.completedHessian k p i j u) x) + (cofactorMatrix B)).re : ℂ) := by + have hs : (Module.finrank ℝ (EC d):ℝ) < 2*(k:ℝ) := by + have hh : (Module.finrank ℝ (EC d):ℝ) < k := by exact_mod_cast hk + linarith [Nat.cast_nonneg (α:=ℝ) k] + rw [cofactorScalar,D.completedRealify_strong k hs,D.product_strong, + BoundedContinuousFunction.mul_apply,D.localizers.strong_embed _ hs] + erw [D.detDifferential_strong] + simp only [map_add,BoundedContinuousFunction.add_apply,D.localizers.strong_embed _ hs] + rfl + +lemma cofactorScalar_zero_source (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (p : ι) (B : Bilin (EC d)) {x : X} + (hx : x ∈ tsupport (D.localizers.weight p : X → ℂ)) : + D.localizers.strong (k:ℝ) (D.cofactorScalar k hk p B 0) x = + (traceBilin (g.matrix (D.patch p).index (A.chart (D.patch p).index x)) B : ℂ) := by + rw [D.cofactorScalar_strong] + simp only [map_zero,BoundedContinuousFunction.coe_zero,Pi.zero_apply,add_zero] + simp_rw [D.metricEntry_apply p _ _ hx] + rw [D.inverseDet_apply p hx] + have hp := g.positive (D.patch p).index _ ((A.chart (D.patch p).index).mapsTo (by simpa using D.patch_source p hx)) + change (((((g.matrix (D.patch p).index (A.chart (D.patch p).index x)).det)⁻¹ * + fderiv ℝ Matrix.det (g.matrix (D.patch p).index (A.chart (D.patch p).index x)) (cofactorMatrix B)).re : ℂ)) = _ + rw [MongeAmpere.real_fderiv_det_apply _ _ + (isUnit_iff_ne_zero.mpr hp.det_pos.ne')] + rw [← mul_assoc,inv_mul_cancel₀ hp.det_pos.ne',one_mul] + rfl + +lemma cofactorScalar_strong_lower (k l : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (hl : Module.finrank ℝ (EC d) < l) (hlk : l ≤ k) (p : ι) (B : Bilin (EC d)) + (u : D.localizers.Sobolev ((k:ℝ)+2)) (x : X) : + D.localizers.strong (l:ℝ) (D.cofactorScalar l hl p B + (D.localizers.lower ((k:ℝ)+2) ((l:ℝ)+2) u)) x = + D.localizers.strong (k:ℝ) (D.cofactorScalar k hk p B u) x := by + have hs : (Module.finrank ℝ (EC d):ℝ) < 2*(l:ℝ) := by + have hh : (Module.finrank ℝ (EC d):ℝ) < l := by exact_mod_cast hl + linarith [Nat.cast_nonneg (α:=ℝ) l] + have hkl : (l:ℝ) ≤ (k:ℝ) := by exact_mod_cast hlk + have ht : (Module.finrank ℝ (EC d):ℝ) < 2*(k:ℝ) := by linarith + rw [D.cofactorScalar_strong,D.cofactorScalar_strong] + simp_rw [D.completedHessian_lower k l hlk, + D.localizers.strong_lower hkl ht hs] + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/FiniteCofactorPatch.lean b/lean/OAI/Geometry/PrescribedRicci/FiniteCofactorPatch.lean new file mode 100644 index 0000000000000000000000000000000000000000..6d51e981f7ae3d08435dc52b2008e8886b8e4017 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/FiniteCofactorPatch.lean @@ -0,0 +1,130 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.BoundedPoisson +import OAI.Geometry.PrescribedPotential.GlobalHessian +import OAI.Geometry.PrescribedPotential.LiteralWeakHessian +import OAI.Geometry.PrescribedRicci.TameApproximation +import OAI.Geometry.PrescribedRicci.FiniteCofactor + +namespace OAI + +/-! Finite Cofactor Patch. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff SchwartzMap Classical BoundedContinuousFunction ComplexOrder MatrixOrder +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart FrozenPoisson MetricLocalization +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +def cofactorLocal (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (p : ι) (i j : BasisIndex d) (u : D.localizers.Sobolev ((k:ℝ)+2)) : L2 (EC d) := + schwartzCoord (k:ℝ) ((D.patch p).coefficient i j) + + D.completedLocalize (k:ℝ) (D.patch p).index (cutoffGlobal (D.patch p).index (D.cutoff p)) + (cutoffGlobal_support _ _) + (D.cofactorScalar k hk p (rankTwo (stdOrthonormalBasis ℝ (EC d) i) + (stdOrthonormalBasis ℝ (EC d) j)) u - + D.cofactorScalar k hk p (rankTwo (stdOrthonormalBasis ℝ (EC d) i) + (stdOrthonormalBasis ℝ (EC d) j)) 0) + +lemma cofactorLocal_continuous (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (p : ι) (i j : BasisIndex d) : Continuous (D.cofactorLocal k hk p i j) := by + exact continuous_const.add ((D.completedLocalize _ _ _ _).continuous.comp + ((D.cofactorScalar_continuous k hk p _).sub continuous_const)) + +lemma cofactorLocal_zero (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (p : ι) (i j : BasisIndex d) : + D.cofactorLocal k hk p i j 0 = schwartzCoord (k:ℝ) ((D.patch p).coefficient i j) := by + simp [cofactorLocal] + +def cofactorBCF (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (hs : (Module.finrank ℝ (EC d):ℝ) < 2*(k:ℝ)) (p : ι) + (u : D.localizers.Sobolev ((k:ℝ)+2)) : BasisIndex d → BasisIndex d → EC d →ᵇ ℂ := + fun i j => strongEmbedding (k:ℝ) hs (D.cofactorLocal k hk p i j u) + +lemma cofactorBCF_continuous (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (hs : (Module.finrank ℝ (EC d):ℝ) < 2*(k:ℝ)) (p : ι) : + Continuous (D.cofactorBCF k hk hs p) := by + apply continuous_pi + intro i + apply continuous_pi + intro j + exact (strongEmbedding _ hs).continuous.comp (D.cofactorLocal_continuous k hk p i j) + +lemma cofactorBCF_zero (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (hs : (Module.finrank ℝ (EC d):ℝ) < 2*(k:ℝ)) (p : ι) : + D.cofactorBCF k hk hs p 0 = coefficientBCF (D.patch p).coefficient := by + funext i j + rw [cofactorBCF,D.cofactorLocal_zero,strongEmbedding_schwartz] + rfl + +lemma cofactorBCF_lower (k l : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (hl : Module.finrank ℝ (EC d) < l) (hlk : l ≤ k) + (hk₂ : (Module.finrank ℝ (EC d):ℝ) < 2*(k:ℝ)) + (hl₂ : (Module.finrank ℝ (EC d):ℝ) < 2*(l:ℝ)) (p : ι) + (u : D.localizers.Sobolev ((k:ℝ)+2)) : + D.cofactorBCF l hl hl₂ p (D.localizers.lower ((k:ℝ)+2) ((l:ℝ)+2) u) = + D.cofactorBCF k hk hk₂ p u := by + funext i j + ext y + simp only [cofactorBCF,cofactorLocal,map_add,BoundedContinuousFunction.add_apply, + strongEmbedding_schwartz] + rw [D.completedLocalize_strong l hl₂,D.completedLocalize_strong k hk₂] + split_ifs + · simp only [map_sub,BoundedContinuousFunction.sub_apply] + rw [D.cofactorScalar_strong_lower k l hk hl hlk] + have hh := D.cofactorScalar_strong_lower k l hk hl hlk p + (rankTwo (stdOrthonormalBasis ℝ (EC d) i) (stdOrthonormalBasis ℝ (EC d) j)) 0 + ((A.euclideanChart (D.patch p).index).symm y) + rw [map_zero] at hh + rw [hh] + · rfl + +def CofactorSmall (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (hs : (Module.finrank ℝ (EC d):ℝ) < 2*(k:ℝ)) + (u : D.localizers.Sobolev ((k:ℝ)+2)) : Prop := + ∀ p, perturbationBound (stdOrthonormalBasis ℝ (EC d)) (D.cofactorBCF k hk hs p u) * + ellipticBound (g.matrix (D.patch p).index (coordinateEquiv d (D.patch p).center)) + (g.positive _ _ (by simpa using (D.patch p).mem_target)) < 1 + +lemma cofactor_small_nhds (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (hs : (Module.finrank ℝ (EC d):ℝ) < 2*(k:ℝ)) : + ∀ᶠ u in 𝓝 (0 : D.localizers.Sobolev ((k:ℝ)+2)), D.CofactorSmall k hk hs u := by + apply eventually_all.mpr + intro p + have hc := ((continuous_perturbationBound (stdOrthonormalBasis ℝ (EC d))).comp + (D.cofactorBCF_continuous k hk hs p)).mul_const + (ellipticBound (g.matrix (D.patch p).index (coordinateEquiv d (D.patch p).center)) + (g.positive _ _ (by simpa using (D.patch p).mem_target))) + apply hc.continuousAt (gt_mem_nhds ?_) + simp only [Function.comp_apply] + rw [D.cofactorBCF_zero] + exact (D.patch p).small + + + +lemma cofactor_small_of_lower (k l : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (hl : Module.finrank ℝ (EC d) < l) (hlk : l ≤ k) + (hk₂ : (Module.finrank ℝ (EC d):ℝ) < 2*(k:ℝ)) + (hl₂ : (Module.finrank ℝ (EC d):ℝ) < 2*(l:ℝ)) + (u : D.localizers.Sobolev ((k:ℝ)+2)) + (hu : D.CofactorSmall l hl hl₂ (D.localizers.lower ((k:ℝ)+2) ((l:ℝ)+2) u)) : + D.CofactorSmall k hk hk₂ u := by + intro p + have hh := hu p + rw [D.cofactorBCF_lower k l hk hl hlk hk₂ hl₂] at hh + exact hh + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/FixedCofactorBootstrap.lean b/lean/OAI/Geometry/PrescribedRicci/FixedCofactorBootstrap.lean new file mode 100644 index 0000000000000000000000000000000000000000..664e13c683703a07db3de5da619a05ff04b4de32 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/FixedCofactorBootstrap.lean @@ -0,0 +1,153 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.FiniteCofactorPatch +import OAI.Geometry.PrescribedRicci.FixedCofactorStep +import OAI.Geometry.PrescribedPotential.GlobalSmooth +import OAI.Geometry.PrescribedPotential.NonlinearSobolevGain +import OAI.Geometry.PrescribedPotential.PatchCutoffs +import OAI.Geometry.PrescribedPotential.RealSobolev + +namespace OAI + +/-! Fixed Cofactor Bootstrap. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) +local instance fixedCofactorBootNG (s : ℝ) : NormedAddCommGroup (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedAddCommGroup +local instance fixedCofactorBootNS (s : ℝ) : NormedSpace ℝ (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedSpace +local instance fixedCofactorBootTG (s : ℝ) : IsTopologicalAddGroup (D.localizers.RealSobolev s) := + Submodule.isTopologicalAddGroup _ +local instance fixedCofactorBootCS (s : ℝ) : ContinuousSMul ℝ (D.localizers.RealSobolev s) := + SMulMemClass.continuousSMul _ + +lemma lift_over_lift {s t r : ℝ} (hst : t ≤ s) (htr : r ≤ t) + (u : D.localizers.RealSobolev r) (v : D.localizers.RealSobolev t) + (hv : D.localizers.realLower t r htr v = u) + (h : ∃ z : D.localizers.RealSobolev s, D.localizers.realLower s t hst z = v) : + ∃ z : D.localizers.RealSobolev s, D.localizers.realLower s r (htr.trans hst) z = u := by + obtain ⟨z,hz⟩ := h + refine ⟨z,?_⟩ + rw [← D.localizers.realLower_lower hst htr z,hz,hv] + +lemma cofactor_small_lifted (k l : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (hl : Module.finrank ℝ (EC d) < l) (hkl : k ≤ l) + (hs : (Module.finrank ℝ (EC d):ℝ) < 2*(k:ℝ)) + (ht : (Module.finrank ℝ (EC d):ℝ) < 2*(l:ℝ)) + (u : D.localizers.RealSobolev ((k:ℝ)+2)) + (v : D.localizers.RealSobolev ((l:ℝ)+2)) + (hv : D.localizers.realLower ((l:ℝ)+2) ((k:ℝ)+2) (by exact_mod_cast Nat.add_le_add_right hkl 2) v = u) + (hu : D.CofactorSmall k hk hs u.val) : D.CofactorSmall l hl ht v.val := by + apply D.cofactor_small_of_lower l k hl hk hkl ht hs v.val + have he := congrArg Subtype.val hv + change D.localizers.lower _ _ v.val = u.val at he + rw [he] + exact hu + +lemma cofactor_lift_step (k l : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (hl : Module.finrank ℝ (EC d) < l) (hkl : k ≤ l) + (hs : (Module.finrank ℝ (EC d):ℝ) < 2*((k+1:ℕ):ℝ)) + (ht : (Module.finrank ℝ (EC d):ℝ) < 2*((l+1:ℕ):ℝ)) + (u : D.localizers.RealSobolev (((k+1:ℕ):ℝ)+2)) + (v : D.localizers.RealSobolev (((l+1:ℕ):ℝ)+2)) + (hv : D.localizers.realLower (((l+1:ℕ):ℝ)+2) (((k+1:ℕ):ℝ)+2) + (by exact_mod_cast Nat.add_le_add_right (Nat.add_le_add_right hkl 1) 2) v = u) + (hu : D.CofactorSmall (k+1) (by omega) hs u.val) (F : RealSmooth A) + (hF : D.realVolume (k+1) (by omega) u = D.localizers.realEmbed ((k+1:ℕ):ℝ) F) : + ∃ z : D.localizers.RealSobolev (((l+2:ℕ):ℝ)+2), + D.localizers.realLower (((l+2:ℕ):ℝ)+2) (((k+1:ℕ):ℝ)+2) (by push_cast; exact_mod_cast Nat.add_le_add_right (by omega : k+1 ≤ l+2) 2) z = u := by + have hsmall : D.CofactorSmall (l+1) (by omega) ht v.val := D.cofactor_small_lifted (k+1) (l+1) (by omega) (by omega) (by omega) hs ht u v hv hu + have hEq : D.realVolume (l+1) (by omega) v = D.localizers.realEmbed ((l+1:ℕ):ℝ) F := D.cofactor_lift_equation (k+1) (l+1) (by omega) (by omega) (by omega) u v hv F hF + have hgain := D.cofactor_nonlinear_step l hl ht v hsmall F hEq + obtain ⟨z,hz⟩ := hgain + refine ⟨z,?_⟩ + have hst : (((l+1:ℕ):ℝ)+2) ≤ (((l+2:ℕ):ℝ)+2) := by push_cast; linarith only + have htr : (((k+1:ℕ):ℝ)+2) ≤ (((l+1:ℕ):ℝ)+2) := by exact_mod_cast Nat.add_le_add_right (Nat.add_le_add_right hkl 1) 2 + rw [← D.localizers.realLower_lower (s:=((l+2:ℕ):ℝ)+2) (t:=((l+1:ℕ):ℝ)+2) + (r:=((k+1:ℕ):ℝ)+2) hst htr z, hz, hv] + +lemma cofactor_solution_lifts (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (hs : (Module.finrank ℝ (EC d):ℝ) < 2*((k+1:ℕ):ℝ)) + (u : D.localizers.RealSobolev (((k+1:ℕ):ℝ)+2)) + (hu : D.CofactorSmall (k+1) (by omega) hs u.val) (F : RealSmooth A) + (hF : D.realVolume (k+1) (by omega) u = D.localizers.realEmbed ((k+1:ℕ):ℝ) F) : + ∀ n : ℕ, ∃ z : D.localizers.RealSobolev (((k+n+1:ℕ):ℝ)+2), + D.localizers.realLower (((k+n+1:ℕ):ℝ)+2) (((k+1:ℕ):ℝ)+2) + (by push_cast; linarith only [Nat.cast_nonneg (α:=ℝ) n]) z = u := by + intro n + induction n with + | zero => + refine ⟨u,?_⟩ + apply Subtype.ext + change D.localizers.lower _ _ u.val = u.val + rw [D.localizers.lower_self,ContinuousLinearMap.id_apply] + | succ n ih => + obtain ⟨v,hv⟩ := ih + have ht : (Module.finrank ℝ (EC d):ℝ) < 2*((k+n+1:ℕ):ℝ) := + hs.trans_le (by exact_mod_cast Nat.mul_le_mul_left 2 (by omega : k+1 ≤ k+n+1)) + have hh := D.cofactor_lift_step k (k+n) hk (by omega) (by omega) hs ht u v hv hu F hF + exact D.realLift_transport _ _ _ _ _ (by congr 2) u hh + +lemma realLift_order_witness (s t : ℝ) (k : ℕ) (hs : 0 ≤ s) (hst : s ≤ t) + (hkt : (k:ℝ) ≤ t) (u : D.localizers.RealSobolev s) (v : D.localizers.RealSobolev t) + (hv : D.localizers.realLower t s hst v = u) : + ∃ w : D.localizers.Sobolev (k:ℝ), D.localizers.lower (k:ℝ) 0 w = + D.localizers.lower s 0 u.val := by + refine ⟨D.localizers.lower t (k:ℝ) v.val, ?_⟩ + rw [D.localizers.lower_lower hkt (Nat.cast_nonneg k)] + rw [← D.localizers.lower_lower hst hs v.val] + exact congrArg (D.localizers.lower s 0) (congrArg Subtype.val hv) + +lemma cofactor_solution_allRegular (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (hs : (Module.finrank ℝ (EC d):ℝ) < 2*((k+1:ℕ):ℝ)) + (u : D.localizers.RealSobolev (((k+1:ℕ):ℝ)+2)) + (hu : D.CofactorSmall (k+1) (by omega) hs u.val) (F : RealSmooth A) + (hF : D.realVolume (k+1) (by omega) u = D.localizers.realEmbed ((k+1:ℕ):ℝ) F) : + D.localizers.AllRegular (D.localizers.lower (((k+1:ℕ):ℝ)+2) 0 u.val) := by + intro n + have hb : 0 ≤ ((k+1:ℕ):ℝ)+2 := by positivity + have hnb : ((k+1:ℕ):ℝ)+2 ≤ ((k+n+1:ℕ):ℝ)+2 := by + push_cast; linarith only [Nat.cast_nonneg (α:=ℝ) n] + have hnv : (n:ℝ) ≤ ((k+n+1:ℕ):ℝ)+2 := by + push_cast; linarith only [Nat.cast_nonneg (α:=ℝ) k] + obtain ⟨v,hv⟩ := D.cofactor_solution_lifts k hk hs u hu F hF n + exact D.realLift_order_witness _ _ n hb hnb hnv u v hv + + + +theorem cofactor_solution_smooth (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (hs : (Module.finrank ℝ (EC d):ℝ) < 2*((k+1:ℕ):ℝ)) + (u : D.localizers.RealSobolev (((k+1:ℕ):ℝ)+2)) + (hu : D.CofactorSmall (k+1) (by omega) hs u.val) (F : RealSmooth A) + (hF : D.realVolume (k+1) (by omega) u = D.localizers.realEmbed ((k+1:ℕ):ℝ) F) : + ∃ φ : RealSmooth A, D.localizers.realEmbed (((k+1:ℕ):ℝ)+2) φ = u := by + obtain ⟨f,hf⟩ := D.allRegular_smooth (D.cofactor_solution_allRegular k hk hs u hu F hF) + have he : D.localizers.embed (((k+1:ℕ):ℝ)+2) f = u.val := by + apply D.localizers.lower_injective (by positivity : 0 ≤ ((k+1:ℕ):ℝ)+2) + rw [D.localizers.lower_embed (by positivity)] + exact hf + have hb : (Module.finrank ℝ (EC d):ℝ) < 2*(((k+1:ℕ):ℝ)+2) := by linarith only [hs] + have hr (x : X) : (f x).im = 0 := by + have hh := D.localizers.real_strong hb u x + rw [← he,D.localizers.strong_embed _ hb] at hh + exact hh + exact ⟨⟨f,hr⟩,Subtype.ext he⟩ + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/FixedCofactorStep.lean b/lean/OAI/Geometry/PrescribedRicci/FixedCofactorStep.lean new file mode 100644 index 0000000000000000000000000000000000000000..ecbf78f1af393aa05984a39a9a2f88cb06193d90 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/FixedCofactorStep.lean @@ -0,0 +1,78 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.DerivativeEllipticGain +import OAI.Geometry.PrescribedPotential.NonlinearScale +import OAI.Geometry.PrescribedPotential.NonlinearSobolevGain +import OAI.Geometry.PrescribedPotential.WeakNonlinearCommutator +import OAI.Geometry.PrescribedRicci.FiniteCofactorPatch +import OAI.Geometry.PrescribedRicci.TameCofactorGain + +namespace OAI + +/-! Fixed Cofactor Step. -/ + +section + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) +local instance fixedCofactorStepNG (s : ℝ) : NormedAddCommGroup (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedAddCommGroup +local instance fixedCofactorStepNS (s : ℝ) : NormedSpace ℝ (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedSpace +local instance fixedCofactorStepTG (s : ℝ) : IsTopologicalAddGroup (D.localizers.RealSobolev s) := + Submodule.isTopologicalAddGroup _ +local instance fixedCofactorStepCS (s : ℝ) : ContinuousSMul ℝ (D.localizers.RealSobolev s) := + SMulMemClass.continuousSMul _ + +omit [ConnectedSpace X] in +lemma realLift_transport (s t r : ℝ) (hs : r ≤ s) (ht : r ≤ t) (hst : s = t) + (u : D.localizers.RealSobolev r) + (h : ∃ z : D.localizers.RealSobolev s, D.localizers.realLower s r hs z = u) : + ∃ z : D.localizers.RealSobolev t, D.localizers.realLower t r ht z = u := by + subst t + exact h + +omit [ConnectedSpace X] in +theorem cofactor_nonlinear_step (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (hs : (Module.finrank ℝ (EC d):ℝ) < 2*((k+1:ℕ):ℝ)) + (u : D.localizers.RealSobolev (((k+1:ℕ):ℝ)+2)) + (hu : D.CofactorSmall (k+1) (by omega) hs u.val) + (F : RealSmooth A) + (hF : D.realVolume (k+1) (by omega) u = D.localizers.realEmbed ((k+1:ℕ):ℝ) F) : + ∃ z : D.localizers.RealSobolev (((k+2:ℕ):ℝ)+2), + D.localizers.realLower (((k+2:ℕ):ℝ)+2) (((k+1:ℕ):ℝ)+2) (by push_cast; linarith) z = u := by + have hD (p : ι) (v : EC d) := D.cofactor_global_gain k hk hs u hu + (D.potentialDerivative k p v u) + (D.localizers.realEmbed ((k+1:ℕ):ℝ) (D.realLocalizedDerivative p v F) + + D.realNonlinearRemainder (k+1) (by omega) p v u) + (D.nonlinear_commutator_solution k hk p v u F hF) + have hh := D.derivative_lifts_gain k u hD + have he : ((k+4:ℕ):ℝ) = ((k+2:ℕ):ℝ)+2 := by push_cast; ring + exact D.realLift_transport _ _ _ _ _ he u hh + + +omit [ConnectedSpace X] in +lemma cofactor_lift_equation (k l : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (hl : Module.finrank ℝ (EC d) < l) (hkl : k ≤ l) + (u : D.localizers.RealSobolev ((k:ℝ)+2)) + (v : D.localizers.RealSobolev ((l:ℝ)+2)) + (hv : D.localizers.realLower ((l:ℝ)+2) ((k:ℝ)+2) (by exact_mod_cast Nat.add_le_add_right hkl 2) v = u) + (F : RealSmooth A) (hF : D.realVolume k hk u = D.localizers.realEmbed (k:ℝ) F) : + D.realVolume l hl v = D.localizers.realEmbed (l:ℝ) F := by + apply D.localizers.realLower_injective (by exact_mod_cast hkl : (k:ℝ) ≤ (l:ℝ)) + rw [← D.realVolume_lower l k hl hk hkl, hv, hF,Localizers.realLower_embed] + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/GlobalKahlerEnergy.lean b/lean/OAI/Geometry/PrescribedRicci/GlobalKahlerEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..ecd11dcb4c9c42c4978d7b1f92ec694ce9fa3a89 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/GlobalKahlerEnergy.lean @@ -0,0 +1,137 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.KahlerGradientEnergy +import OAI.Geometry.PrescribedRicci.KahlerIntegration +import OAI.Geometry.PrescribedPotential.GlobalOperator +import OAI.Geometry.PrescribedPotential.SmoothPotentialDifference + +namespace OAI + +/-! Global Kahler Energy. -/ + +section + + + +noncomputable section +open Matrix Filter Set Topology MeasureTheory +open scoped ContDiff ComplexOrder Classical +namespace Anticanonical.SourceSmooth +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +namespace KaehlerMetric + + +def energy (g : KaehlerMetric A) (ψ φ : SmoothRealFunction A) : SmoothRealFunction A where + value x := ((g.laplacian (ψ.product φ)).value x - + ψ.value x * (g.laplacian φ).value x - φ.value x * (g.laplacian ψ).value x) / 2 + smooth i := (((g.laplacian (ψ.product φ)).smooth i).sub + ((ψ.smooth i).mul ((g.laplacian φ).smooth i))).sub + ((φ.smooth i).mul ((g.laplacian ψ).smooth i)) |>.div_const 2 + +lemma energy_local (g : KaehlerMetric A) (ψ φ : SmoothRealFunction A) + (i : Fin A.count) {z : Coordinates d} (hz : z ∈ (A.chart i).target) : + (g.energy ψ φ).localExpression i z = + (gradientPair (g.matrix i z) (holRealDeriv (ψ.localExpression i) z) + (holRealDeriv (φ.localExpression i) z)).re := by + have hp := trace_hessian_product (φ := ψ.localExpression i) (ψ := φ.localExpression i) + ((ψ.smooth i).contDiffAt ((A.chart i).open_target.mem_nhds hz)) + ((φ.smooth i).contDiffAt ((A.chart i).open_target.mem_nhds hz)) + (g.matrix i z) (g.positive i z hz).isHermitian + change ((g.laplacian (ψ.product φ)).localExpression i z - + ψ.localExpression i z * (g.laplacian φ).localExpression i z - + φ.localExpression i z * (g.laplacian ψ).localExpression i z) / 2 = _ + rw [g.laplacian_localExpression _ i hz, g.laplacian_localExpression _ i hz, + g.laplacian_localExpression _ i hz] + change (((g.matrix i z)⁻¹ * PotentialKaehler.potentialMatrix + (fun y => ψ.localExpression i y * φ.localExpression i y) z).trace.re - + ψ.localExpression i z * ((g.matrix i z)⁻¹ * φ.hessian i z).trace.re - + φ.localExpression i z * ((g.matrix i z)⁻¹ * ψ.hessian i z).trace.re) / 2 = _ + rw [hp] + change (_ - _ * ((g.matrix i z)⁻¹ * PotentialKaehler.potentialMatrix (φ.localExpression i) z).trace.re - + _ * ((g.matrix i z)⁻¹ * PotentialKaehler.potentialMatrix (ψ.localExpression i) z).trace.re) / 2 = _ + ring + +lemma energy_nonneg (g : KaehlerMetric A) (φ : SmoothRealFunction A) (x : X) : + 0 ≤ (g.energy φ φ).value x := by + obtain ⟨i, hi⟩ := A.covers x + have hz := (A.chart i).mapsTo hi + have he := g.energy_local φ φ i hz + simp only [SmoothRealFunction.localExpression, Function.comp_apply, (A.chart i).left_inv hi] at he + rw [he] + exact gradientPair_self_nonneg _ (g.positive i _ hz) _ + +lemma energy_symm (g : KaehlerMetric A) (ψ φ : SmoothRealFunction A) : + (g.energy ψ φ).value = (g.energy φ ψ).value := by + funext x + obtain ⟨i, hi⟩ := A.covers x + have hz := (A.chart i).mapsTo hi + have he := g.energy_local ψ φ i hz + have he' := g.energy_local φ ψ i hz + simp only [SmoothRealFunction.localExpression, Function.comp_apply, (A.chart i).left_inv hi] at he he' + rw [he, he', ← gradientPair_star _ (g.positive i _ hz).isHermitian] + rfl + +lemma holRealDeriv_zero_of_notMem_tsupport (ψ : SmoothRealFunction A) (i : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart i).target) + (hs : (A.chart i).symm z ∉ tsupport ψ.value) : holRealDeriv (ψ.localExpression i) z = 0 := by + have he : ψ.localExpression i =ᶠ[𝓝 z] (fun _ => 0) := + (notMem_tsupport_iff_eventuallyEq.mp hs).comp_tendsto + (((A.chart i).continuousOn_symm z hz).continuousAt ((A.chart i).open_target.mem_nhds hz)) + funext j + unfold holRealDeriv + rw [he.fderiv_eq] + simp only [fderiv_const_apply, map_zero, Pi.zero_apply] + +lemma energy_support (g : KaehlerMetric A) (ψ φ : SmoothRealFunction A) : + tsupport (g.energy ψ φ).value ⊆ tsupport ψ.value := by + apply closure_minimal _ (isClosed_tsupport _) + intro x hx + by_contra hs + obtain ⟨i, hi⟩ := A.covers x + have hz := (A.chart i).mapsTo hi + have he := g.energy_local ψ φ i hz + have hd := holRealDeriv_zero_of_notMem_tsupport ψ i hz + (by simpa only [(A.chart i).left_inv hi] using hs) + simp only [SmoothRealFunction.localExpression, Function.comp_apply, (A.chart i).left_inv hi] at he + dsimp only [SmoothRealFunction.localExpression] at hd + rw [hd] at he + simp only [gradientPair, Pi.zero_apply, star_zero, mul_zero, zero_mul, Finset.sum_const_zero, + Complex.zero_re] at he + exact hx he + +lemma holRealDeriv_add {f h : Coordinates d → ℝ} {z : Coordinates d} + (hf : DifferentiableAt ℝ f z) (hh : DifferentiableAt ℝ h z) : + holRealDeriv (fun y => f y + h y) z = holRealDeriv f z + holRealDeriv h z := by + funext j + unfold holRealDeriv + rw [fderiv_fun_add hf hh, map_add] + rfl + +lemma gradientPair_add_left (H : Matrix (Fin d) (Fin d) ℂ) (p q r : Fin d → ℂ) : + gradientPair H (p + q) r = gradientPair H p r + gradientPair H q r := by + simp [gradientPair, Pi.add_apply, mul_add, add_mul, Finset.sum_add_distrib] + +lemma energy_add_left (g : KaehlerMetric A) (ψ χ φ : SmoothRealFunction A) : + (g.energy (ψ.addFunction χ) φ).value = + fun x => (g.energy ψ φ).value x + (g.energy χ φ).value x := by + funext x + obtain ⟨i, hi⟩ := A.covers x + have hz := (A.chart i).mapsTo hi + have he := g.energy_local (ψ.addFunction χ) φ i hz + have he₁ := g.energy_local ψ φ i hz + have he₂ := g.energy_local χ φ i hz + simp only [SmoothRealFunction.localExpression, Function.comp_apply, (A.chart i).left_inv hi] at he he₁ he₂ + rw [he, he₁, he₂] + change (gradientPair _ (holRealDeriv (fun y => ψ.localExpression i y + χ.localExpression i y) _) + _).re = _ + rw [holRealDeriv_add (f := ψ.localExpression i) (h := χ.localExpression i) (((ψ.smooth i).contDiffAt ((A.chart i).open_target.mem_nhds hz)).differentiableAt (by simp)) + (((χ.smooth i).contDiffAt ((A.chart i).open_target.mem_nhds hz)).differentiableAt (by simp)), + gradientPair_add_left, Complex.add_re] + rfl + +end KaehlerMetric +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/GlobalKahlerIntegral.lean b/lean/OAI/Geometry/PrescribedRicci/GlobalKahlerIntegral.lean new file mode 100644 index 0000000000000000000000000000000000000000..c7e3d2d067bb9d0464027a563389d9d1577a36d7 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/GlobalKahlerIntegral.lean @@ -0,0 +1,186 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.KahlerIntegration + +namespace OAI + +/-! Global Kahler Integral. -/ + +section + + + +noncomputable section +open Matrix Filter Set Topology MeasureTheory +open scoped ContDiff ComplexOrder Classical +namespace Anticanonical.SourceSmooth +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +namespace KaehlerMetric + +def localizeFunction (i : Fin A.count) (f : X → ℝ) (z : Coordinates d) : ℝ := + if z ∈ (A.chart i).target then f ((A.chart i).symm z) else 0 + +lemma localizeFunction_support (i : Fin A.count) (f : X → ℝ) : + Function.support (localizeFunction (A := A) i f) ⊆ (A.chart i) '' tsupport f := by + intro z hz + change localizeFunction i f z ≠ 0 at hz + by_cases ht : z ∈ (A.chart i).target + · have hh : f ((A.chart i).symm z) ≠ 0 := by simpa [localizeFunction, ht] using hz + exact ⟨(A.chart i).symm z, subset_tsupport _ hh, (A.chart i).right_inv ht⟩ + · exact (hz (ite_eq_right ht)).elim + +lemma localizeFunction_continuous_compact [T2Space X] [CompactSpace X] + (i : Fin A.count) {f : X → ℝ} (hf : Continuous f) + (hs : tsupport f ⊆ (A.chart i).source) : + Continuous (localizeFunction (A := A) i f) ∧ + HasCompactSupport (localizeFunction (A := A) i f) ∧ + tsupport (localizeFunction (A := A) i f) ⊆ (A.chart i).target := by + let e := A.chart i + let K := e '' tsupport f + have hK : IsCompact K := (isClosed_tsupport _).isCompact.image_of_continuousOn + (e.continuousOn.mono hs) + have hsub : Function.support (localizeFunction i f) ⊆ K := localizeFunction_support i f + have hts : tsupport (localizeFunction i f) ⊆ K := closure_minimal hsub hK.isClosed + refine ⟨?_, HasCompactSupport.of_support_subset_isCompact hK hsub, ?_⟩ + · rw [continuous_iff_continuousAt] + intro z + by_cases hz : z ∈ e.target + · apply (hf.continuousAt.comp ((e.continuousOn_symm z hz).continuousAt + (e.open_target.mem_nhds hz))).congr + filter_upwards [e.open_target.mem_nhds hz] with y hy + exact (ite_eq_left hy).symm + · have hzK : z ∉ K := by + rintro ⟨x, hx, rfl⟩ + exact hz (e.mapsTo (hs hx)) + apply (continuousAt_const (y := (0 : ℝ))).congr + filter_upwards [hK.isClosed.isOpen_compl.mem_nhds hzK] with y hy + exact (Function.notMem_support.mp (fun h => hy (hsub h))).symm + · rintro z hz + obtain ⟨x, hx, rfl⟩ := hts hz + exact e.mapsTo (hs hx) + +lemma continuous_real_mul_on_tsupport {E : Type*} [TopologicalSpace E] {f h : E → ℝ} + (hf : Continuous f) (hh : ∀ z ∈ tsupport f, ContinuousAt h z) : + Continuous (fun z => f z * h z) := by + rw [continuous_iff_continuousAt] + intro z + by_cases hz : z ∈ tsupport f + · exact hf.continuousAt.mul (hh z hz) + · apply (continuousAt_const (y := (0 : ℝ))).congr + filter_upwards [notMem_tsupport_iff_eventuallyEq.mp hz] with y hy + simp only [hy, zero_mul, Pi.zero_apply] + +lemma chart_integrable [T2Space X] [CompactSpace X] (g : KaehlerMetric A) + (i : Fin A.count) {f : X → ℝ} (hf : Continuous f) + (hs : tsupport f ⊆ (A.chart i).source) : + IntegrableOn (fun z => f ((A.chart i).symm z) * g.volumeCoefficient i z) + (A.chart i).target := by + obtain ⟨hl, hc, ht⟩ := localizeFunction_continuous_compact i hf hs + have hi : Integrable (fun z => localizeFunction i f z * g.volumeCoefficient i z) := + (continuous_real_mul_on_tsupport hl (fun z hz => + ((g.volumeCoefficient_smooth i).continuousOn z (ht hz)).continuousAt + ((A.chart i).open_target.mem_nhds (ht hz)))).integrable_of_hasCompactSupport hc.mul_right + apply hi.integrableOn.congr_fun _ (A.chart i).open_target.measurableSet + intro z hz + simp only [localizeFunction, ite_eq_left hz] + +lemma chartIntegral_linear_add [T2Space X] [CompactSpace X] (g : KaehlerMetric A) + (i : Fin A.count) {f h : X → ℝ} (hf : Continuous f) (hh : Continuous h) + (hsf : tsupport f ⊆ (A.chart i).source) (hsh : tsupport h ⊆ (A.chart i).source) : + g.chartIntegral i (fun x => f x + h x) = g.chartIntegral i f + g.chartIntegral i h := by + simp only [chartIntegral, add_mul] + exact integral_add (g.chart_integrable i hf hsf) (g.chart_integrable i hh hsh) + +lemma chartIntegral_sum [T2Space X] [CompactSpace X] (g : KaehlerMetric A) + (i : Fin A.count) {ι : Type*} (s : Finset ι) (f : ι → X → ℝ) + (hf : ∀ k ∈ s, Continuous (f k)) (hs : ∀ k ∈ s, tsupport (f k) ⊆ (A.chart i).source) : + g.chartIntegral i (fun x => ∑ k ∈ s, f k x) = ∑ k ∈ s, g.chartIntegral i (f k) := by + simp only [chartIntegral, Finset.sum_mul] + exact integral_finsetSum s (fun k hk => g.chart_integrable i (hf k hk) (hs k hk)) + +def chartPartition [T2Space X] [CompactSpace X] : Fin A.count → SmoothRealFunction A := + A.exists_smooth_partition.choose + +lemma chartPartition_nonneg [T2Space X] [CompactSpace X] (i : Fin A.count) (x : X) : + 0 ≤ (chartPartition (A := A) i).value x := A.exists_smooth_partition.choose_spec.1 i x + +lemma chartPartition_sum [T2Space X] [CompactSpace X] (x : X) : + ∑ i, (chartPartition (A := A) i).value x = 1 := A.exists_smooth_partition.choose_spec.2.1 x + +lemma chartPartition_support [T2Space X] [CompactSpace X] (i : Fin A.count) : + tsupport (chartPartition (A := A) i).value ⊆ (A.chart i).source := + A.exists_smooth_partition.choose_spec.2.2 i + + + +def integral [T2Space X] [CompactSpace X] (g : KaehlerMetric A) (f : X → ℝ) : ℝ := + ∑ i, g.chartIntegral i (fun x => (chartPartition i).value x * f x) + +lemma integral_chart [T2Space X] [CompactSpace X] (g : KaehlerMetric A) + (j : Fin A.count) {f : X → ℝ} (hf : Continuous f) + (hs : tsupport f ⊆ (A.chart j).source) : g.integral f = g.chartIntegral j f := by + unfold integral + have he : ∀ i, g.chartIntegral i (fun x => (chartPartition i).value x * f x) = + g.chartIntegral j (fun x => (chartPartition i).value x * f x) := by + intro i + apply g.chartIntegral_eq + · exact fun x hx => chartPartition_support i + (subset_tsupport _ (Function.support_mul_subset_left _ _ hx)) + · exact fun x hx => hs (subset_tsupport _ (Function.support_mul_subset_right _ _ hx)) + simp_rw [he] + rw [← g.chartIntegral_sum j Finset.univ (fun i x => (chartPartition i).value x * f x) + (fun i _ => (chartPartition i).continuous.fun_mul hf) + (fun i _ => tsupport_mul_subset_right.trans hs)] + congr 1 + funext x + rw [← Finset.sum_mul, chartPartition_sum, one_mul] + +lemma integral_add [T2Space X] [CompactSpace X] (g : KaehlerMetric A) + {f h : X → ℝ} (hf : Continuous f) (hh : Continuous h) : + g.integral (fun x => f x + h x) = g.integral f + g.integral h := by + unfold integral + rw [← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro i _ + simp_rw [mul_add] + exact g.chartIntegral_linear_add i ((chartPartition i).continuous.mul hf) + ((chartPartition i).continuous.mul hh) + (tsupport_mul_subset_left.trans (chartPartition_support i)) + (tsupport_mul_subset_left.trans (chartPartition_support i)) + +lemma integral_const_mul [T2Space X] [CompactSpace X] (g : KaehlerMetric A) + (c : ℝ) (f : X → ℝ) : g.integral (fun x => c * f x) = c * g.integral f := by + simp only [integral, chartIntegral, Finset.mul_sum] + apply Finset.sum_congr rfl + intro i _ + simp_rw [show ∀ z, (chartPartition i).value ((A.chart i).symm z) * (c * f ((A.chart i).symm z)) * + g.volumeCoefficient i z = c * ((chartPartition i).value ((A.chart i).symm z) * + f ((A.chart i).symm z) * g.volumeCoefficient i z) by intro z; ring] + exact MeasureTheory.integral_const_mul c _ + +lemma integral_sum [T2Space X] [CompactSpace X] (g : KaehlerMetric A) + {ι : Type*} (s : Finset ι) (f : ι → X → ℝ) (hf : ∀ k ∈ s, Continuous (f k)) : + g.integral (fun x => ∑ k ∈ s, f k x) = ∑ k ∈ s, g.integral (f k) := by + simp only [integral, Finset.mul_sum] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro i _ + exact g.chartIntegral_sum i s _ (fun k hk => (chartPartition i).continuous.mul (hf k hk)) + (fun k _ => tsupport_mul_subset_left.trans (chartPartition_support i)) + +lemma integral_nonneg [T2Space X] [CompactSpace X] (g : KaehlerMetric A) + {f : X → ℝ} (hf : ∀ x, 0 ≤ f x) : 0 ≤ g.integral f := by + apply Finset.sum_nonneg + intro i _ + apply setIntegral_nonneg (A.chart i).open_target.measurableSet + intro z hz + exact mul_nonneg (mul_nonneg (chartPartition_nonneg i _) (hf _)) + (g.volumeCoefficient_pos i hz).le + +end KaehlerMetric +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/GlobalSmoothCompact.lean b/lean/OAI/Geometry/PrescribedRicci/GlobalSmoothCompact.lean new file mode 100644 index 0000000000000000000000000000000000000000..8b386e1903c14361f482e99265c61e14e90eac7e --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/GlobalSmoothCompact.lean @@ -0,0 +1,114 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalRellich +import OAI.Geometry.PrescribedPotential.PatchCutoffs +import OAI.Geometry.PrescribedRicci.SobolevInterpolation + +namespace OAI + +/-! Global Smooth Compact. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff SchwartzMap Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace Localizers +variable (D : Localizers A ι) +lemma sobolev_interpolation (r s t : ℝ) (hst : s < t) {ε : ℝ} (hε : 0 < ε) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ f : Smooth A, + ‖D.embed s f‖ ≤ ε*‖D.embed t f‖+C*‖D.embed r f‖ := by + obtain ⟨C,hC,hc⟩ := schwartz_sobolev_interpolation (E:=EC d) r s t hst hε + refine ⟨C,hC,fun f => ?_⟩ + change ‖D.coordinates s f‖ ≤ ε*‖D.coordinates t f‖+C*‖D.coordinates r f‖ + apply (pi_norm_le_iff_of_nonneg (by positivity)).mpr + intro p + exact (hc (localize A (D.index p) (D.weight p) (D.support_sub p) f)).trans + (add_le_add (mul_le_mul_of_nonneg_left (norm_le_pi_norm (D.coordinates t f) p) hε.le) + (mul_le_mul_of_nonneg_left (norm_le_pi_norm (D.coordinates r f) p) hC)) + +lemma cauchy_of_low (f : ℕ → Smooth A) (s t : ℝ) (hst : s < t) + (hbound : ∃ B : ℝ, 0 ≤ B ∧ ∀ n, ‖D.embed t (f n)‖ ≤ B) + (hc : CauchySeq (fun n => D.embed 0 (f n))) : + CauchySeq (fun n => D.embed s (f n)) := by + obtain ⟨B,hB,hb⟩ := hbound + apply Metric.cauchySeq_iff.mpr + intro ε hε + let η := ε/(4*(B+1)) + have hη : 0 < η := div_pos hε (by positivity) + obtain ⟨C,hC,hI⟩ := D.sobolev_interpolation 0 s t hst hη + obtain ⟨N,hN⟩ := Metric.cauchySeq_iff.mp hc (ε/(4*(C+1))) (div_pos hε (by positivity)) + refine ⟨N,fun m hm n hn => ?_⟩ + have hhigh : ‖D.embed t (f m-f n)‖ ≤ 2*B := by + rw [map_sub] + exact (norm_sub_le _ _).trans (by linarith [hb m,hb n]) + have hlow : ‖D.embed 0 (f m-f n)‖ < ε/(4*(C+1)) := by + simpa only [map_sub,dist_eq_norm] using hN m hm n hn + rw [dist_eq_norm,← map_sub] + have h1 : η*(2*B) < ε/2 := by + dsimp [η] + rw [div_mul_eq_mul_div] + apply (div_lt_iff₀ (by positivity : 0 < 4*(B+1))).mpr + nlinarith + have h2 : C*(ε/(4*(C+1))) < ε/2 := by + rw [← mul_div_assoc] + apply (div_lt_iff₀ (by positivity : 0 < 4*(C+1))).mpr + nlinarith + calc + _ ≤ η*‖D.embed t (f m-f n)‖+C*‖D.embed 0 (f m-f n)‖ := hI _ + _ ≤ η*(2*B)+C*(ε/(4*(C+1))) := add_le_add + (mul_le_mul_of_nonneg_left hhigh hη.le) (mul_le_mul_of_nonneg_left hlow.le hC) + _ < ε := by linarith +end Localizers +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +theorem smooth_limit_of_all_bounds (f : ℕ → Smooth A) + (hb : ∀ k : ℕ, ∃ B : ℝ, 0 ≤ B ∧ ∀ n, ‖D.localizers.embed (k:ℝ) (f n)‖ ≤ B) + (u : D.localizers.Sobolev 0) + (hu : Tendsto (fun n => D.localizers.embed 0 (f n)) atTop (𝓝 u)) : + ∃ F : Smooth A, ∀ k : ℕ, Tendsto (fun n => D.localizers.embed (k:ℝ) (f n)) + atTop (𝓝 (D.localizers.embed (k:ℝ) F)) := by + have hc (k : ℕ) : CauchySeq (fun n => D.localizers.embed (k:ℝ) (f n)) := + D.localizers.cauchy_of_low f (k:ℝ) ((k+1:ℕ):ℝ) (by exact_mod_cast Nat.lt_succ_self k) + (hb (k+1)) hu.cauchySeq + choose v hv using fun k => cauchySeq_tendsto_of_complete (hc k) + have hlow (k : ℕ) : D.localizers.lower (k:ℝ) 0 (v k) = u := by + have hh := ((D.localizers.lower (k:ℝ) 0).continuous.tendsto (v k)).comp (hv k) + simp only [Function.comp_def,D.localizers.lower_embed (Nat.cast_nonneg k)] at hh + exact tendsto_nhds_unique hh hu + obtain ⟨F,hF⟩ := D.allRegular_smooth (show D.localizers.AllRegular u from fun k => ⟨v k,hlow k⟩) + refine ⟨F,fun k => ?_⟩ + have he : v k = D.localizers.embed (k:ℝ) F := by + apply D.localizers.lower_injective (Nat.cast_nonneg k) + rw [hlow,D.localizers.lower_embed (Nat.cast_nonneg k),hF] + exact he ▸ hv k + +theorem smooth_subsequence (f : ℕ → Smooth A) + (hb : ∀ k : ℕ, ∃ B : ℝ, 0 ≤ B ∧ ∀ n, ‖D.localizers.embed (k:ℝ) (f n)‖ ≤ B) : + ∃ F : Smooth A, ∃ ν : ℕ → ℕ, StrictMono ν ∧ ∀ k : ℕ, + Tendsto (fun n => D.localizers.embed (k:ℝ) (f (ν n))) atTop + (𝓝 (D.localizers.embed (k:ℝ) F)) := by + obtain ⟨B,hB,hb2⟩ := hb 2 + let K := closure (D.localizers.lower 2 0 '' Metric.closedBall 0 B) + have hK : IsCompact K := D.lower_compact.isCompact_closure_image_closedBall B + have hfK (n : ℕ) : D.localizers.embed 0 (f n) ∈ K := by + apply subset_closure + refine ⟨D.localizers.embed 2 (f n),?_,D.localizers.lower_embed (by norm_num) (f n)⟩ + simpa only [Metric.mem_closedBall,dist_zero_right,Nat.cast_ofNat] using hb2 n + obtain ⟨u,_,ν,hν,hu⟩ := hK.tendsto_subseq hfK + obtain ⟨F,hF⟩ := D.smooth_limit_of_all_bounds (f ∘ ν) + (fun k => by obtain ⟨B,hB,hb⟩ := hb k; exact ⟨B,hB,fun n => hb (ν n)⟩) u hu + exact ⟨F,ν,hν,hF⟩ +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/HermitianCoercivity.lean b/lean/OAI/Geometry/PrescribedRicci/HermitianCoercivity.lean new file mode 100644 index 0000000000000000000000000000000000000000..f49a08ba6d2760cc76dda7eb014fce541cf1490e --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/HermitianCoercivity.lean @@ -0,0 +1,67 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.HermitianPair + +namespace OAI + +/-! Hermitian Coercivity. -/ + +noncomputable section +open Matrix +open scoped ComplexOrder MatrixOrder Matrix.Norms.Elementwise +namespace MongeAmpere +variable {n : Type*} [Fintype n] [DecidableEq n] + +lemma hermPair_single (v : n → ℂ) (i : n) : + hermPair (1 : Matrix n n ℂ) (Pi.single i 1) v = v i := by + simp [hermPair,dotProduct,Pi.single_apply] + +lemma hermPair_dual_coordinate {K : Matrix n n ℂ} (hK : K.PosDef) (v : n → ℂ) (i : n) : + hermPair K (K⁻¹*ᵥ Pi.single i 1) v = v i := by + rw [hermPair_mulVec_left,hK.inv.isHermitian.eq,Matrix.nonsing_inv_mul _ + (isUnit_iff_ne_zero.mpr hK.det_pos.ne'),hermPair_single] + +lemma component_sq_le_hermPair {K : Matrix n n ℂ} (hK : K.PosDef) (v : n → ℂ) (i : n) : + ‖v i‖^2 ≤ (K⁻¹ i i).re*(hermPair K v v).re := by + have he := hermPair_cauchySchwarz K hK.posSemidef (K⁻¹*ᵥ Pi.single i 1) v + rw [hermPair_dual_coordinate hK,hermPair_dual_coordinate hK] at he + simpa [Matrix.mulVec,dotProduct,Pi.single_apply] using he + +lemma norm_sq_le_hermPair {K : Matrix n n ℂ} (hK : K.PosDef) (v : n → ℂ) : + ‖v‖^2 ≤ ‖K⁻¹‖*(hermPair K v v).re := by + have hs := hermPair_nonneg hK.posSemidef v + have hprod : 0 ≤ ‖K⁻¹‖*(hermPair K v v).re := mul_nonneg (norm_nonneg _) hs + have hc (i : n) : ‖v i‖^2 ≤ ‖K⁻¹‖*(hermPair K v v).re := by + apply (component_sq_le_hermPair hK v i).trans + exact mul_le_mul_of_nonneg_right ((Complex.re_le_norm _).trans + (norm_entry_le_entrywise_sup_norm (K⁻¹))) hs + have hv : ‖v‖ ≤ Real.sqrt (‖K⁻¹‖*(hermPair K v v).re) := by + apply (pi_norm_le_iff_of_nonneg (Real.sqrt_nonneg _)).mpr + intro i + exact (Real.le_sqrt (norm_nonneg _) hprod).mpr (hc i) + have hh := sq_le_sq₀ (norm_nonneg v) (Real.sqrt_nonneg (‖K⁻¹‖*(hermPair K v v).re)) + exact (hh.mpr hv).trans_eq (Real.sq_sqrt hprod) + +omit [DecidableEq n] in +lemma pair_norm_le (K : Matrix n n ℂ) (v w : n → ℂ) : + ‖hermPair K v w‖ ≤ (Fintype.card n : ℝ)^2*‖K‖*‖v‖*‖w‖ := by + rw [hermPair_expand] + apply (norm_sum_le _ _).trans + calc + ∑ i, ‖∑ j, star (v i)*K i j*w j‖ ≤ + ∑ i : n, ∑ j : n, ‖v‖*‖K‖*‖w‖ := by + apply Finset.sum_le_sum + intro i _ + apply (norm_sum_le _ _).trans + apply Finset.sum_le_sum + intro j _ + simp only [norm_mul,norm_star] + exact mul_le_mul (mul_le_mul (norm_le_pi_norm v i) + (norm_entry_le_entrywise_sup_norm K) (norm_nonneg _) (norm_nonneg _)) + (norm_le_pi_norm w j) (norm_nonneg _) (mul_nonneg (norm_nonneg _) (norm_nonneg _)) + _ = _ := by simp only [Finset.sum_const,Finset.card_univ,nsmul_eq_mul]; ring + +end MongeAmpere + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/HermitianPair.lean b/lean/OAI/Geometry/PrescribedRicci/HermitianPair.lean new file mode 100644 index 0000000000000000000000000000000000000000..a84cbad79255273c456fff6fef16c52e0f55759f --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/HermitianPair.lean @@ -0,0 +1,72 @@ +import Mathlib + +namespace OAI + +/-! Hermitian Pair. -/ + +noncomputable section +open Matrix +open scoped ComplexOrder MatrixOrder +namespace MongeAmpere +variable {n : Type*} [Fintype n] + +def hermPair (K : Matrix n n ℂ) (v w : n → ℂ) : ℂ := star v ⬝ᵥ (K *ᵥ w) + +lemma hermPair_expand (K : Matrix n n ℂ) (v w : n → ℂ) : + hermPair K v w = ∑ i, ∑ j, star (v i)*K i j*w j := by + simp only [hermPair,dotProduct,Matrix.mulVec,Finset.mul_sum,mul_assoc,Pi.star_apply] + +lemma hermPair_add_left (K : Matrix n n ℂ) (u v w : n → ℂ) : + hermPair K (u+v) w = hermPair K u w+hermPair K v w := by + simp only [hermPair,star_add,add_dotProduct] + +lemma hermPair_add_right (K : Matrix n n ℂ) (u v w : n → ℂ) : + hermPair K u (v+w) = hermPair K u v+hermPair K u w := by + simp only [hermPair,Matrix.mulVec_add,dotProduct_add] + +lemma hermPair_smul_left (K : Matrix n n ℂ) (u v : n → ℂ) (c : ℂ) : + hermPair K (c • u) v = star c*hermPair K u v := by + simp only [hermPair,star_smul,smul_dotProduct,smul_eq_mul] + +lemma hermPair_smul_right (K : Matrix n n ℂ) (u v : n → ℂ) (c : ℂ) : + hermPair K u (c • v) = c*hermPair K u v := by + simp only [hermPair,Matrix.mulVec_smul,dotProduct_smul,smul_eq_mul] + +lemma hermPair_conj (K : Matrix n n ℂ) (hK : K.IsHermitian) (u v : n → ℂ) : + star (hermPair K u v) = hermPair K v u := by + simp only [hermPair] + rw [star_dotProduct,star_star,star_mulVec,hK.eq] + exact (dotProduct_mulVec (star v) K u).symm + +lemma hermPair_mulVec_left (K C : Matrix n n ℂ) (u v : n → ℂ) : + hermPair K (C *ᵥ u) v = hermPair (Cᴴ*K) u v := by + simp only [hermPair,star_mulVec,← dotProduct_mulVec,Matrix.mulVec_mulVec] + +lemma hermPair_mulVec_right (K C : Matrix n n ℂ) (u v : n → ℂ) : + hermPair K u (C *ᵥ v) = hermPair (K*C) u v := by + simp only [hermPair,Matrix.mulVec_mulVec] + +lemma hermPair_nonneg {K : Matrix n n ℂ} (hK : K.PosSemidef) (u : n → ℂ) : + 0 ≤ (hermPair K u u).re := hK.re_dotProduct_nonneg u + +@[instance_reducible] def hermPairCore (K : Matrix n n ℂ) (hK : K.PosSemidef) : + PreInnerProductSpace.Core ℂ (n → ℂ) where + inner := hermPair K + conj_inner_symm x y := hermPair_conj K hK.isHermitian y x + re_inner_nonneg := hermPair_nonneg hK + add_left := hermPair_add_left K + smul_left x y c := hermPair_smul_left K x y c + +lemma hermPair_cauchySchwarz (K : Matrix n n ℂ) (hK : K.PosSemidef) (u v : n → ℂ) : + ‖hermPair K u v‖^2 ≤ (hermPair K u u).re*(hermPair K v v).re := by + let := hermPairCore K hK + have h := InnerProductSpace.Core.inner_mul_inner_self_le (𝕜:=ℂ) u v + change ‖hermPair K u v‖*‖hermPair K v u‖ ≤ (hermPair K u u).re*(hermPair K v v).re at h + rw [← hermPair_conj K hK.isHermitian u v,norm_star] at h + simpa only [pow_two] using h + +end MongeAmpere + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/HermitianTensorEnergy.lean b/lean/OAI/Geometry/PrescribedRicci/HermitianTensorEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..a5fd610221b6db545bfed29390820e0ac66fc4d0 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/HermitianTensorEnergy.lean @@ -0,0 +1,95 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.HermitianPair + +namespace OAI + +/-! Hermitian Tensor Energy. -/ + +noncomputable section +open Matrix +open scoped ComplexOrder MatrixOrder Kronecker +namespace MongeAmpere +variable {n m : Type*} [Fintype n] [Fintype m] + +lemma hermPair_sum_left {ι : Type*} (s : Finset ι) (K : Matrix n n ℂ) (V : ι → n → ℂ) (w : n → ℂ) : + hermPair K (∑ i ∈ s, V i) w = ∑ i ∈ s, hermPair K (V i) w := by + classical + induction s using Finset.induction_on with + | empty => simp [hermPair] + | @insert i s hi ih => simp only [Finset.sum_insert hi,hermPair_add_left,ih] + +lemma hermPair_sum_right {ι : Type*} (s : Finset ι) (K : Matrix n n ℂ) (v : n → ℂ) (W : ι → n → ℂ) : + hermPair K v (∑ i ∈ s, W i) = ∑ i ∈ s, hermPair K v (W i) := by + classical + induction s using Finset.induction_on with + | empty => simp [hermPair] + | @insert i s hi ih => simp only [Finset.sum_insert hi,hermPair_add_right,ih] + +def tensorEnergy (B : Matrix m m ℂ) (K : Matrix n n ℂ) (V : m → n → ℂ) : ℂ := + ∑ a, ∑ b, B a b*hermPair K (V a) (V b) + +lemma tensorEnergy_eq (B : Matrix m m ℂ) (K : Matrix n n ℂ) (V : m → n → ℂ) : + tensorEnergy B K V = hermPair (B ⊗ₖ K) (fun i => V i.1 i.2) (fun i => V i.1 i.2) := by + simp only [tensorEnergy,hermPair_expand,Fintype.sum_prod_type,Matrix.kronecker_apply, + Finset.mul_sum] + apply Finset.sum_congr rfl + intro a _ + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro b _ + apply Finset.sum_congr rfl + intro j _ + ring + +lemma tensorEnergy_nonneg {B : Matrix m m ℂ} {K : Matrix n n ℂ} + (hB : B.PosSemidef) (hK : K.PosSemidef) (V : m → n → ℂ) : + 0 ≤ (tensorEnergy B K V).re := by + classical + rw [tensorEnergy_eq] + exact hermPair_nonneg (hB.kronecker hK) _ + +lemma hermPair_weighted_rough_left (B : Matrix m m ℂ) (hB : B.IsHermitian) + (K : Matrix n n ℂ) (P : m → m → n → ℂ) (f : n → ℂ) : + ∑ a, ∑ b, B a b*hermPair K (P b a) f = + hermPair K (∑ a, ∑ b, B a b • P a b) f := by + classical + simp only [hermPair_sum_left,hermPair_smul_left] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro a _ + apply Finset.sum_congr rfl + intro b _ + rw [show star (B a b) = B b a from Matrix.IsHermitian.ext_iff.mp hB b a] + +lemma hermPair_weighted_rough_right (B : Matrix m m ℂ) (K : Matrix n n ℂ) + (P : m → m → n → ℂ) (f : n → ℂ) : + ∑ a, ∑ b, B a b*hermPair K f (P a b) = + hermPair K f (∑ a, ∑ b, B a b • P a b) := by + classical + simp only [hermPair_sum_right,hermPair_smul_right] + +lemma hermPair_weighted_curvature (B : Matrix m m ℂ) (K : Matrix n n ℂ) + (R : m → m → Matrix n n ℂ) (f : n → ℂ) : + ∑ a, ∑ b, B a b*hermPair K f (R a b*ᵥ f) = + hermPair K f ((∑ a, ∑ b, B a b • R a b)*ᵥ f) := by + classical + simp only [Matrix.sum_mulVec,Matrix.smul_mulVec,hermPair_sum_right,hermPair_smul_right] + +lemma tensorEnergy_flip (B : Matrix m m ℂ) (K : Matrix n n ℂ) (V : m → n → ℂ) : + ∑ a, ∑ b, B a b*hermPair K (V b) (V a) = tensorEnergy B.transpose K V := by + rw [Finset.sum_comm] + rfl + +lemma hermPair_two_re (K : Matrix n n ℂ) (hK : K.IsHermitian) (v w : n → ℂ) : + (hermPair K v w+hermPair K w v).re = 2*(hermPair K w v).re := by + rw [← hermPair_conj K hK w v] + simp only [Complex.add_re,Complex.star_def,Complex.conj_re] + ring + +end MongeAmpere + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/HolderFiniteProduct.lean b/lean/OAI/Geometry/PrescribedRicci/HolderFiniteProduct.lean new file mode 100644 index 0000000000000000000000000000000000000000..502fc5ccf902abdc25e9ceffa5a0a6564536aec1 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/HolderFiniteProduct.lean @@ -0,0 +1,50 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.InterpolationExponents +import OAI.Geometry.PrescribedRicci.LpPowerBounds + +namespace OAI + +/-! Holder Finite Product. -/ + +section + + +noncomputable section +open MeasureTheory +open scoped ENNReal BigOperators Classical +namespace TameInterpolation +variable {Y : Type*} [MeasurableSpace Y] {μ : Measure Y} + +lemma lpNorm_finite_prod {ι : Type*} (s : Finset ι) (f : ι → Y → ℝ) (p : ι → ℝ≥0∞) + (hf : ∀ i ∈ s, MemLp (f i) (p i) μ) : + lpNorm (fun x => ∏ i ∈ s, f i x) (∑ i ∈ s, (p i)⁻¹)⁻¹ μ ≤ + ∏ i ∈ s, lpNorm (f i) (p i) μ := by + induction s using Finset.cons_induction with + | empty => + by_cases hμ : μ = 0 + · simp [hμ] + · simp [lpNorm_const, hμ] + | cons i s hi ih => + have hfi : MemLp (f i) (p i) μ := hf i (Finset.mem_cons_self ..) + have hfs : ∀ a ∈ s, MemLp (f a) (p a) μ := fun a ha => hf a (Finset.mem_cons_of_mem ha) + have hprod := MemLp.fun_prod hfs + let : ENNReal.HolderTriple (p i) (∑ a ∈ s, (p a)⁻¹)⁻¹ (∑ a ∈ Finset.cons i s hi, (p a)⁻¹)⁻¹ := + ⟨by simp only [inv_inv,Finset.sum_cons]⟩ + simp only [Finset.prod_cons] + exact (lpNorm_mul_le hfi hprod).trans (mul_le_mul_of_nonneg_left (ih hfs) lpNorm_nonneg) + +lemma exponent_sum_inverse {ι : Type*} (s : Finset ι) (j : ι → ℕ) (m : ℕ) + (hm : 0 < m) (hs : ∑ i ∈ s, j i = m) : + (∑ i ∈ s, (exponent m (j i))⁻¹)⁻¹ = 2 := by + simp only [exponent,inv_inv] + rw [← ENNReal.ofReal_sum_of_nonneg (fun i _ => by positivity),← Finset.sum_div,← Nat.cast_sum,hs] + have hm' : (m:ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt hm) + have he : (m:ℝ)/(2*(m:ℝ)) = 1/2 := by field_simp + rw [he,← ENNReal.ofReal_inv_of_pos (by norm_num : (0:ℝ) < 1/2)] + norm_num +end TameInterpolation + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/IntegratedKahlerEnergy.lean b/lean/OAI/Geometry/PrescribedRicci/IntegratedKahlerEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..7da506c85ef533197fe866eaa4614e4d1db72829 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/IntegratedKahlerEnergy.lean @@ -0,0 +1,154 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.GlobalKahlerEnergy +import OAI.Geometry.PrescribedRicci.KahlerGradientEnergy +import OAI.Geometry.PrescribedRicci.KahlerIntegration + +namespace OAI + +/-! Integrated Kahler Energy. -/ + +section + + + +noncomputable section +open Matrix Filter Set Topology MeasureTheory +open scoped ContDiff ComplexOrder Classical +namespace Anticanonical.SourceSmooth +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +namespace KaehlerMetric + +lemma determinant_eq_volume (g : KaehlerMetric A) (i : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart i).target) : + (g.matrix i z).det = (g.volumeCoefficient i z : ℂ) := by + apply Complex.ext + · rfl + · exact (Complex.pos_iff.mp (g.positive i z hz).det_pos).2.symm + +lemma holRealDeriv_zero_off_support {q : Coordinates d → ℝ} {z : Coordinates d} + (hz : z ∉ tsupport q) : holRealDeriv q z = 0 := by + have hd : fderiv ℝ q z = 0 := image_eq_zero_of_notMem_tsupport + (fun h => hz (tsupport_fderiv_subset ℝ h)) + funext j + simp only [holRealDeriv, hd, map_zero, Pi.zero_apply] + +lemma integral_real_cofactor (g : KaehlerMetric A) (φ : SmoothRealFunction A) + (i : Fin A.count) {q : Coordinates d → ℝ} (hq : ContDiff ℝ ∞ q) + (hc : HasCompactSupport q) (hs : tsupport q ⊆ (A.chart i).target) : + (∫ z, q z * g.volumeCoefficient i z * ((g.matrix i z)⁻¹ * φ.hessian i z).trace.re) = + -(∫ z, g.volumeCoefficient i z * + (gradientPair (g.matrix i z) (holRealDeriv q z) (holRealDeriv (φ.localExpression i) z)).re) := by + let qc : Coordinates d → ℂ := fun z => (q z : ℂ) + have hqc : ContDiff ℝ ∞ qc := Complex.ofRealCLM.contDiff.comp hq + have hcc : HasCompactSupport qc := hc.comp_left Complex.ofReal_zero + have hsc : tsupport qc ⊆ (A.chart i).target := (tsupport_comp_subset Complex.ofReal_zero q).trans hs + have hd (j : Fin d) : ∀ z ∈ tsupport qc, + ContDiffAt ℝ ∞ (fun y => g.cofactorFlux φ i y j) z := + fun z hz => g.contDiffAt_cofactorFlux φ i (hsc hz) j + let F := fun z => qc z * ((g.matrix i z).det * ((g.matrix i z)⁻¹ * φ.hessian i z).trace) + let G := fun z => ∑ j, barDeriv qc z j * g.cofactorFlux φ i z j + have hF : Integrable F := by + have hh := integrable_finsetSum Finset.univ (fun j _ => integrable_mul_barDeriv_local hqc (hd j) hcc j) + apply hh.congr (Filter.Eventually.of_forall _) + intro z + simp only [← Finset.mul_sum] + by_cases hz : z ∈ tsupport qc + · rw [g.cofactorFlux_divergence φ i (hsc hz)] + · simp only [F, image_eq_zero_of_notMem_tsupport hz, zero_mul] + have hG : Integrable G := integrable_finsetSum Finset.univ + (fun j _ => integrable_barDeriv_mul_local hqc (hd j) hcc j) + have he := congrArg Complex.re (g.integral_cofactorFlux φ i hqc hcc hsc) + have hFe : ∀ z, (F z).re = q z * g.volumeCoefficient i z * + ((g.matrix i z)⁻¹ * φ.hessian i z).trace.re := by + intro z + by_cases hz : z ∈ tsupport q + · simp only [F, qc, g.determinant_eq_volume i (hs hz), Complex.mul_re, + Complex.ofReal_re, Complex.ofReal_im, zero_mul, sub_zero, Complex.mul_im, + add_zero] + ring + · simp only [F, qc, image_eq_zero_of_notMem_tsupport hz, Complex.ofReal_zero, + zero_mul, Complex.zero_re] + have hGe : ∀ z, (G z).re = g.volumeCoefficient i z * + (gradientPair (g.matrix i z) (holRealDeriv q z) (holRealDeriv (φ.localExpression i) z)).re := by + intro z + have hb : ∀ j, barDeriv qc z j = star (holRealDeriv q z j) := + fun j => barDeriv_ofReal (hq.differentiable (by simp) z) j + have hc' : G z = (g.matrix i z).det * + gradientPair (g.matrix i z) (holRealDeriv q z) (holRealDeriv (φ.localExpression i) z) := by + simp only [G, cofactorFlux, hb, MongeAmpere.weightedInverse, Matrix.smul_apply, + smul_eq_mul, gradientPair, Finset.mul_sum] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro k _ + apply Finset.sum_congr rfl + intro j _ + ring + rw [hc'] + by_cases hz : z ∈ tsupport q + · rw [g.determinant_eq_volume i (hs hz)] + simp only [Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, zero_mul, sub_zero] + · rw [holRealDeriv_zero_off_support hz] + simp only [gradientPair, Pi.zero_apply, star_zero, mul_zero, zero_mul, + Finset.sum_const_zero, Complex.zero_re] + change (∫ z, F z).re = (-(∫ z, G z)).re at he + have hrF := Complex.reCLM.integral_comp_comm hF + have hrG := Complex.reCLM.integral_comp_comm hG + change (∫ z, (F z).re) = (∫ z, F z).re at hrF + change (∫ z, (G z).re) = (∫ z, G z).re at hrG + rw [← hrF, Complex.neg_re, ← hrG] at he + simpa only [hFe, hGe] using he + +lemma chart_energy_identity [T2Space X] [CompactSpace X] (g : KaehlerMetric A) + (ψ φ : SmoothRealFunction A) (i : Fin A.count) + (hs : tsupport ψ.value ⊆ (A.chart i).source) : + g.chartIntegral i (fun x => ψ.value x * (g.laplacian φ).value x) = + -g.chartIntegral i (g.energy ψ φ).value := by + obtain ⟨hq, hc, ht⟩ := ψ.localized_smooth_compact i hs + have he := g.integral_real_cofactor φ i hq hc ht + have hl : (fun z => ψ.localized i z * g.volumeCoefficient i z * + ((g.matrix i z)⁻¹ * φ.hessian i z).trace.re) = + (A.chart i).target.indicator (fun z => + ψ.value ((A.chart i).symm z) * (g.laplacian φ).value ((A.chart i).symm z) * + g.volumeCoefficient i z) := by + funext z + by_cases hz : z ∈ (A.chart i).target + · rw [Set.indicator_of_mem hz, ψ.localized_eq hz] + have hp := g.laplacian_localExpression φ i hz + change (g.laplacian φ).value ((A.chart i).symm z) = _ at hp + rw [hp] + change _ * _ * _ = _ * ((g.matrix i z)⁻¹ * φ.hessian i z).trace.re * _ + dsimp only [SmoothRealFunction.localExpression, Function.comp_apply] + ring + · simp only [SmoothRealFunction.localized, ite_eq_right hz, Set.indicator_of_notMem hz, zero_mul] + have hr : (fun z => g.volumeCoefficient i z * + (gradientPair (g.matrix i z) (holRealDeriv (ψ.localized i) z) + (holRealDeriv (φ.localExpression i) z)).re) = + (A.chart i).target.indicator (fun z => (g.energy ψ φ).value ((A.chart i).symm z) * + g.volumeCoefficient i z) := by + funext z + by_cases hz : z ∈ (A.chart i).target + · rw [Set.indicator_of_mem hz] + have hloc : ψ.localized i =ᶠ[𝓝 z] ψ.localExpression i := by + filter_upwards [(A.chart i).open_target.mem_nhds hz] with y hy using ψ.localized_eq hy + have hd : holRealDeriv (ψ.localized i) z = holRealDeriv (ψ.localExpression i) z := by + funext j + unfold holRealDeriv + rw [hloc.fderiv_eq] + rw [hd] + have hh := g.energy_local ψ φ i hz + change (g.energy ψ φ).value ((A.chart i).symm z) = _ at hh + rw [hh, mul_comm] + · rw [Set.indicator_of_notMem hz, holRealDeriv_zero_off_support (fun h => hz (ht h))] + simp only [gradientPair, Pi.zero_apply, star_zero, mul_zero, zero_mul, + Finset.sum_const_zero, Complex.zero_re] + rw [hl, hr, integral_indicator (A.chart i).open_target.measurableSet, + integral_indicator (A.chart i).open_target.measurableSet] at he + exact he + +end KaehlerMetric +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/InterpolationExponents.lean b/lean/OAI/Geometry/PrescribedRicci/InterpolationExponents.lean new file mode 100644 index 0000000000000000000000000000000000000000..1a5d977198f3bea9113a252bb08108550d6d1344 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/InterpolationExponents.lean @@ -0,0 +1,64 @@ +import Mathlib + +namespace OAI + +/-! Interpolation Exponents. -/ + +noncomputable section +open scoped ENNReal +namespace TameInterpolation + +def exponent (m j : ℕ) : ℝ≥0∞ := (ENNReal.ofReal ((j:ℝ)/(2*(m:ℝ))))⁻¹ + +lemma exponent_zero (m : ℕ) : exponent m 0 = ∞ := by simp [exponent] + +lemma exponent_of_pos {m j : ℕ} (hm : 0 < m) (hj : 0 < j) : + exponent m j = ENNReal.ofReal (2*(m:ℝ)/(j:ℝ)) := by + have hm' : 0 < (m:ℝ) := by exact_mod_cast hm + have hj' : 0 < (j:ℝ) := by exact_mod_cast hj + rw [exponent,← ENNReal.ofReal_inv_of_pos (div_pos hj' (by positivity))] + congr 1 + field_simp + +lemma holder_inverse (a b : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) : + ENNReal.HolderTriple (ENNReal.ofReal a)⁻¹ (ENNReal.ofReal b)⁻¹ (ENNReal.ofReal (a+b))⁻¹ := by + constructor + simp only [inv_inv,ENNReal.ofReal_add ha hb] + +lemma exponent_middle_gt {m j : ℕ} (hj : j+1 < m) : 2 < 2*(m:ℝ)/((j+1:ℕ):ℝ) := by + have hj' : 0 < ((j+1:ℕ):ℝ) := by positivity + apply (lt_div_iff₀ hj').mpr + have hh : ((j+1:ℕ):ℝ) < (m:ℝ) := by exact_mod_cast hj + linarith only [hh] + +lemma exponent_holder_step {m j : ℕ} (hj : j+1 < m) : + ENNReal.HolderTriple (exponent m j) (exponent m (j+2)) + (ENNReal.ofReal (2/(2*(m:ℝ)/((j+1:ℕ):ℝ)) ))⁻¹ := by + have hm : 0 < (m:ℝ) := by exact_mod_cast (by omega : 0 < m) + have hj0 : (j+1:ℝ) ≠ 0 := by positivity + have he : 2/(2*(m:ℝ)/((j+1:ℕ):ℝ)) = (j:ℝ)/(2*(m:ℝ))+((j+2:ℕ):ℝ)/(2*(m:ℝ)) := by + push_cast + field_simp + ring + rw [he] + exact holder_inverse _ _ (by positivity) (by positivity) + +lemma interpolation_holder_conjugate {p : ℝ} (hp : 2 < p) : + ENNReal.HolderTriple (ENNReal.ofReal (2/p))⁻¹ (ENNReal.ofReal ((p-2)/p))⁻¹ 1 := by + constructor + simp only [inv_inv,inv_one,← ENNReal.ofReal_add (by positivity : 0 ≤ 2/p) (by positivity : 0 ≤ (p-2)/p)] + rw [show 2/p+(p-2)/p = 1 by field_simp; ring] + exact ENNReal.ofReal_one + +lemma interpolation_power_exponent {p : ℝ} (hp : 2 < p) : + (ENNReal.ofReal ((p-2)/p))⁻¹ * ENNReal.ofReal (p-2) = ENNReal.ofReal p := by + have hp0 : 0 < p := by linarith only [hp] + have hp2 : 0 < p-2 := by linarith only [hp] + rw [← ENNReal.ofReal_inv_of_pos (div_pos hp2 hp0),← ENNReal.ofReal_mul (inv_nonneg.mpr (div_nonneg hp2.le hp0.le))] + congr 1 + field_simp +end TameInterpolation + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/JetInterpolation.lean b/lean/OAI/Geometry/PrescribedRicci/JetInterpolation.lean new file mode 100644 index 0000000000000000000000000000000000000000..30c3045e60937d6bb3cca2dec7f79fd0a0c42f91 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/JetInterpolation.lean @@ -0,0 +1,80 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.DirectionalInterpolation + +namespace OAI + +/-! Jet Interpolation. -/ + +section + + +noncomputable section +open Set Filter Topology MeasureTheory +open scoped ContDiff ENNReal +namespace TameInterpolation +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] +variable {ι : Type*} [Fintype ι] [Nonempty ι] + +def jet (e : ι → E) (f : E → ℝ) : {j : ℕ} → (Fin j → ι) → E → ℝ + | 0,_ => f + | _+1,w => dir (e (w 0)) (jet e f (w ∘ Fin.succ)) + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] [Fintype ι] [Nonempty ι] in +lemma jet_smooth (e : ι → E) {f : E → ℝ} (hf : ContDiff ℝ ∞ f) + {j : ℕ} (w : Fin j → ι) : ContDiff ℝ ∞ (jet e f w) := by + induction j with + | zero => exact hf + | succ j ih => exact dir_smooth _ (ih _) + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] [Fintype ι] [Nonempty ι] in +lemma jet_compact (e : ι → E) {f : E → ℝ} (hf : HasCompactSupport f) + {j : ℕ} (w : Fin j → ι) : HasCompactSupport (jet e f w) := by + induction j with + | zero => exact hf + | succ j ih => exact dir_compact _ (ih _) + +def jetNorm (e : ι → E) (f : E → ℝ) (j : ℕ) (p : ℝ≥0∞) : ℝ := + Finset.univ.sup' Finset.univ_nonempty (fun w : Fin j → ι => lpNorm (jet e f w) p volume) + +lemma lpNorm_jet_le (e : ι → E) (f : E → ℝ) {j : ℕ} (w : Fin j → ι) (p : ℝ≥0∞) : + lpNorm (jet e f w) p volume ≤ jetNorm e f j p := by + exact Finset.le_sup' (fun w : Fin j → ι => lpNorm (jet e f w) p volume) (Finset.mem_univ w) + +lemma jetNorm_nonneg (e : ι → E) (f : E → ℝ) (j : ℕ) (p : ℝ≥0∞) : + 0 ≤ jetNorm e f j p := + le_trans lpNorm_nonneg (lpNorm_jet_le e f (fun _ => Classical.choice ‹Nonempty ι›) p) + +lemma jetNorm_attained (e : ι → E) (f : E → ℝ) (j : ℕ) (p : ℝ≥0∞) : + ∃ w : Fin j → ι, jetNorm e f j p = lpNorm (jet e f w) p volume := by + obtain ⟨w,_,hw⟩ := Finset.exists_mem_eq_sup' (s:=Finset.univ) Finset.univ_nonempty + (fun w : Fin j → ι => lpNorm (jet e f w) p volume) + exact ⟨w,hw⟩ + +lemma jetNorm_step (e : ι → E) {f : E → ℝ} (hf : ContDiff ℝ ∞ f) (hc : HasCompactSupport f) + (j : ℕ) {p : ℝ} (hp : 2 < p) (α β r s : ℝ≥0∞) + [ENNReal.HolderTriple α β s] [ENNReal.HolderTriple s r 1] + (hr : r * ENNReal.ofReal (p-2) = ENNReal.ofReal p) : + (jetNorm e f (j+1) (ENNReal.ofReal p))^2 ≤ + (p-1)*jetNorm e f j α*jetNorm e f (j+2) β := by + obtain ⟨w,hw⟩ := jetNorm_attained e f (j+1) (ENNReal.ofReal p) + rw [hw] + let w₀ : Fin j → ι := w ∘ Fin.succ + have he : dir (e (w 0)) (dir (e (w 0)) (jet e f w₀)) = + jet e f (Fin.cons (w 0) (Fin.cons (w 0) w₀)) := by + simp only [jet,Fin.cons_zero,Fin.cons_succ,Function.comp_def] + have h := directional_lp_interpolation hp α β r s hr (e (w 0)) + (jet_smooth e hf w₀) (jet_compact e hc w₀) + rw [he] at h + apply h.trans + apply mul_le_mul + · exact mul_le_mul_of_nonneg_left (lpNorm_jet_le e f w₀ α) (by linarith only [hp]) + · exact lpNorm_jet_le e f _ β + · exact lpNorm_nonneg + · exact mul_nonneg (by linarith only [hp]) (jetNorm_nonneg e f j α) +end TameInterpolation + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/JetPolynomial.lean b/lean/OAI/Geometry/PrescribedRicci/JetPolynomial.lean new file mode 100644 index 0000000000000000000000000000000000000000..1857ce8922dd17bda25c8b2f54afacef91ac5b00 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/JetPolynomial.lean @@ -0,0 +1,131 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.ComplexJet + +namespace OAI + +/-! Jet Polynomial. -/ + +section + + + +noncomputable section +open Set Finset +open scoped ContDiff Classical BigOperators +namespace TameInterpolation +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] +variable {ι κ : Type*} [Fintype κ] [DecidableEq κ] + +def cword (e : ι → E) (f : E → ℂ) : List ι → E → ℂ + | [] => f + | a::as => cdir (e a) (cword e f as) + +lemma cword_smooth (e : ι → E) {f : E → ℂ} (hf : ContDiff ℝ ∞ f) (as : List ι) : + ContDiff ℝ ∞ (cword e f as) := by + induction as with + | nil => exact hf + | cons a as ih => exact cdir_smooth _ ih + +lemma cword_compact (e : ι → E) {f : E → ℂ} (hf : HasCompactSupport f) (as : List ι) : + HasCompactSupport (cword e f as) := by + induction as with + | nil => exact hf + | cons a as ih => exact cdir_compact _ ih + +def monoEval (e : ι → E) (f : κ → E → ℂ) (s : κ → List ι) (x : E) : ℂ := + ∏ i, cword e (f i) (s i) x + +def stepState (a : ι) (s : κ → List ι) (i : κ) : κ → List ι := + Function.update s i (a::s i) + +def stateOrder (s : κ → List ι) : ℕ := ∑ i, (s i).length + +def activeSet (s : κ → List ι) : Finset κ := Finset.univ.filter fun i => s i ≠ [] + +lemma stateOrder_step (a : ι) (s : κ → List ι) (i : κ) : + stateOrder (stepState a s i) = stateOrder s+1 := by + unfold stateOrder + rw [← Finset.add_sum_erase Finset.univ (fun j => (stepState a s i j).length) (Finset.mem_univ i), + ← Finset.add_sum_erase Finset.univ (fun j => (s j).length) (Finset.mem_univ i)] + simp only [stepState,Function.update_self,List.length_cons] + have he : ∑ j ∈ Finset.univ.erase i, (Function.update s i (a::s i) j).length = + ∑ j ∈ Finset.univ.erase i, (s j).length := by + apply Finset.sum_congr rfl + intro j hj + rw [Function.update_of_ne (by simpa using (Finset.mem_erase.mp hj).1)] + rw [he]; omega + +lemma activeSet_step (a : ι) (s : κ → List ι) (i : κ) : + activeSet (stepState a s i) = insert i (activeSet s) := by + apply Finset.ext + intro j + change j ∈ Finset.univ.filter (fun j => stepState a s i j ≠ []) ↔ + j ∈ insert i (Finset.univ.filter (fun j => s j ≠ [])) + rw [Finset.mem_filter,Finset.mem_insert,Finset.mem_filter] + simp only [Finset.mem_univ,true_and] + by_cases hj : j = i + · subst j; simp [stepState] + · simp [stepState,hj] + +omit [DecidableEq κ] in +lemma monoEval_smooth (e : ι → E) (f : κ → E → ℂ) (hf : ∀ i, ContDiff ℝ ∞ (f i)) + (s : κ → List ι) : ContDiff ℝ ∞ (monoEval e f s) := by + apply contDiff_prod + intro i _ + exact cword_smooth e (hf i) _ + +lemma cdir_monoEval (e : ι → E) (f : κ → E → ℂ) (hf : ∀ i, ContDiff ℝ ∞ (f i)) + (a : ι) (s : κ → List ι) : + cdir (e a) (monoEval e f s) = fun x => ∑ i, monoEval e f (stepState a s i) x := by + funext x + unfold cdir monoEval + rw [fderiv_finsetProd (fun i _ => (cword_smooth e (hf i) _).differentiable (by simp) x)] + simp only [_root_.sum_apply,smul_apply,smul_eq_mul] + apply Finset.sum_congr rfl + intro i _ + rw [← Finset.mul_prod_erase Finset.univ + (fun j => cword e (f j) (stepState a s i j) x) (Finset.mem_univ i)] + simp only [stepState,Function.update_self,cword,cdir] + have he : ∏ j ∈ Finset.univ.erase i, cword e (f j) (Function.update s i (a::s i) j) x = + ∏ j ∈ Finset.univ.erase i, cword e (f j) (s j) x := by + apply Finset.prod_congr rfl + intro j hj + rw [Function.update_of_ne (by simpa using (Finset.mem_erase.mp hj).1)] + rw [he] + ring + +lemma cdir_finite_sum (e : ι → E) (a : ι) {ν : Type*} (s : Finset ν) + (f : ν → E → ℂ) (hf : ∀ i ∈ s, ContDiff ℝ ∞ (f i)) : + cdir (e a) (fun x => ∑ i ∈ s, f i x) = fun x => ∑ i ∈ s, cdir (e a) (f i) x := by + funext x + unfold cdir + rw [fderiv_fun_sum (fun i hi => (hf i hi).differentiable (by simp) x)] + simp only [_root_.sum_apply] + +lemma cdir_list_sum (e : ι → E) (a : ι) {ν : Type*} (s : List ν) + (f : ν → E → ℂ) (hf : ∀ i ∈ s, ContDiff ℝ ∞ (f i)) : + cdir (e a) (fun x => (s.map (fun i => f i x)).sum) = + fun x => (s.map (fun i => cdir (e a) (f i) x)).sum := by + induction s with + | nil => funext x; simp [cdir] + | cons i s ih => + have hsum : ContDiff ℝ ∞ (fun x => (s.map (fun j => f j x)).sum) := by + have hh : ∀ j ∈ s, ContDiff ℝ ∞ (f j) := fun j hj => hf j (List.mem_cons_of_mem i hj) + clear ih hf + induction s with + | nil => exact contDiff_const + | cons j s ih => + exact (hh j (List.mem_cons_self ..)).add (ih (fun k hk => hh k (List.mem_cons_of_mem j hk))) + simp only [List.map_cons,List.sum_cons] + funext x + unfold cdir + rw [fderiv_fun_add ((hf i (List.mem_cons_self ..)).differentiable (by simp) x) + (hsum.differentiable (by simp) x),add_apply] + exact congrArg (fun z : ℂ => fderiv ℝ (f i) x (e a)+z) + (congrFun (ih (fun j hj => hf j (List.mem_cons_of_mem i hj))) x) +end TameInterpolation + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/JetProductL2.lean b/lean/OAI/Geometry/PrescribedRicci/JetProductL2.lean new file mode 100644 index 0000000000000000000000000000000000000000..ef63e8b8e4f5cf4dde99f42ba6330b816103c069 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/JetProductL2.lean @@ -0,0 +1,47 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.FamilyJetNorm +import OAI.Geometry.PrescribedRicci.HolderFiniteProduct + +namespace OAI + +/-! Jet Product L2. -/ + +section + + + +noncomputable section +open Set Filter Topology MeasureTheory +open scoped ContDiff ENNReal Classical BigOperators +namespace TameInterpolation +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] +variable {ι κ : Type*} [Fintype ι] [Nonempty ι] [Fintype κ] [Nonempty κ] + +theorem jet_product_L2 (e : ι → E) (f : κ → E → ℝ) + (hf : ∀ a, ContDiff ℝ ∞ (f a)) (hc : ∀ a, HasCompactSupport (f a)) + (m : ℕ) (hm : 0 < m) {ν : Type*} (s : Finset ν) + (a : ν → κ) (j : ν → ℕ) (w : (i : ν) → Fin (j i) → ι) + (hs : ∑ i ∈ s, j i = m) : + lpNorm (fun x => ∏ i ∈ s, jet e (f (a i)) (w i) x) 2 volume ≤ + (2*(m:ℝ))^(∑ i ∈ s, j i*(m-j i)) * + (familyJetNorm e f 0 ∞)^(s.card-1) * familyJetNorm e f m 2 := by + have hi (i : ν) : MemLp (jet e (f (a i)) (w i)) (exponent m (j i)) volume := + (jet_smooth e (hf (a i)) (w i)).continuous.memLp_of_hasCompactSupport + (jet_compact e (hc (a i)) (w i)) + have hh := lpNorm_finite_prod (μ:=volume) s + (fun i => jet e (f (a i)) (w i)) (fun i => exponent m (j i)) (fun i _ => hi i) + rw [exponent_sum_inverse s j m hm hs] at hh + apply hh.trans + apply le_trans _ (family_jet_tame_many e f hf hc m hm s j hs) + apply Finset.prod_le_prod₀ + · intro i _; exact lpNorm_nonneg + · intro i _ + exact (lpNorm_jet_le e (f (a i)) (w i) (exponent m (j i))).trans + (jetNorm_le_family e f (a i) (j i) (exponent m (j i))) +end TameInterpolation + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/JetRemainder.lean b/lean/OAI/Geometry/PrescribedRicci/JetRemainder.lean new file mode 100644 index 0000000000000000000000000000000000000000..3d3447e22d5735d6ff10a82c67286ea48e988fe2 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/JetRemainder.lean @@ -0,0 +1,173 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.JetPolynomial + +namespace OAI + +/-! Jet Remainder. -/ + +section + + + +noncomputable section +open Set Finset +open scoped ContDiff Classical BigOperators +namespace TameInterpolation +variable {ι κ : Type*} [Fintype κ] [DecidableEq κ] + +def singleState (ws : List ι) (i : κ) : κ → List ι := Function.update (fun _ => []) i ws + +def mixedStep (a : ι) (ws : List ι) : List (κ → List ι) := + Finset.univ.toList.flatMap fun i => (Finset.univ.erase i).toList.map fun j => + stepState a (singleState ws i) j + +def monoRemainder : List ι → List (κ → List ι) + | [] => [] + | [_] => [] + | a::b::ws => (monoRemainder (b::ws)).flatMap + (fun s => Finset.univ.toList.map (stepState a s)) ++ mixedStep a (b::ws) + +lemma singleState_order (ws : List ι) (i : κ) : stateOrder (singleState ws i) = ws.length := by + unfold stateOrder + rw [← Finset.add_sum_erase Finset.univ (fun j => (singleState ws i j).length) (Finset.mem_univ i)] + simp only [singleState,Function.update_self] + have he : (∑ j ∈ Finset.univ.erase i, (Function.update (fun _ : κ => ([]:List ι)) i ws j).length) = 0 := by + apply Finset.sum_eq_zero + intro j hj + rw [Function.update_of_ne (Finset.mem_erase.mp hj).1] + rfl + rw [he,Nat.add_zero] + +lemma singleState_active {ws : List ι} (hw : ws ≠ []) (i : κ) : + activeSet (singleState ws i) = {i} := by + apply Finset.ext + intro j + change j ∈ Finset.univ.filter (fun j => singleState ws i j ≠ []) ↔ j ∈ ({i}:Finset κ) + rw [Finset.mem_filter,Finset.mem_singleton] + simp only [Finset.mem_univ,true_and] + by_cases hj : j = i + · subst j; simp [singleState,hw] + · simp [singleState,hj] + +omit [Fintype κ] in +lemma singleState_step_same (a : ι) (ws : List ι) (i : κ) : + stepState a (singleState ws i) i = singleState (a::ws) i := by + simp only [stepState,singleState,Function.update_self,Function.update_idem] + +lemma monoRemainder_order (ws : List ι) (s : κ → List ι) (hs : s ∈ monoRemainder ws) : + stateOrder s = ws.length ∧ 2 ≤ (activeSet s).card := by + induction ws generalizing s with + | nil => simp [monoRemainder] at hs + | cons a ws ih => + cases ws with + | nil => simp [monoRemainder] at hs + | cons b ws => + simp only [monoRemainder,List.mem_append] at hs + rcases hs with hs | hs + · obtain ⟨s',hs',hs⟩ := List.mem_flatMap.mp hs + obtain ⟨i,_,rfl⟩ := List.mem_map.mp hs + have hh := ih s' hs' + constructor + · simp only [stateOrder_step,hh.1,List.length_cons] + · rw [activeSet_step] + exact hh.2.trans (Finset.card_mono (Finset.subset_insert _ _)) + · obtain ⟨i,_,hs⟩ := List.mem_flatMap.mp hs + obtain ⟨j,hj,rfl⟩ := List.mem_map.mp hs + have hji : j ≠ i := (Finset.mem_erase.mp (Finset.mem_toList.mp hj)).1 + constructor + · simp only [stateOrder_step,singleState_order,List.length_cons] + · rw [activeSet_step,singleState_active (by simp), + Finset.card_insert_of_notMem (by simpa using hji),Finset.card_singleton] + +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +lemma sum_flatMap_map {α β γ : Type*} [AddCommMonoid γ] + (s : List α) (g : α → List β) (f : β → γ) : + ((s.flatMap g).map f).sum = (s.map (fun a => ((g a).map f).sum)).sum := by + induction s with + | nil => rfl + | cons a s ih => simp only [List.flatMap_cons,List.map_append,List.sum_append,List.map_cons,List.sum_cons,ih] + +lemma mixedStep_sum (e : ι → E) (f : κ → E → ℂ) (a : ι) (ws : List ι) (x : E) : + ((mixedStep a ws).map (fun s => monoEval e f s x)).sum = + ∑ i, ∑ j ∈ Finset.univ.erase i, monoEval e f (stepState a (singleState ws i) j) x := by + unfold mixedStep + rw [sum_flatMap_map] + simp + +lemma cdir_principal (e : ι → E) (f : κ → E → ℂ) (hf : ∀ i, ContDiff ℝ ∞ (f i)) + (a : ι) (ws : List ι) : + cdir (e a) (fun x => ∑ i, monoEval e f (singleState ws i) x) = fun x => + (∑ i, monoEval e f (singleState (a::ws) i) x)+ + ((mixedStep a ws).map (fun s => monoEval e f s x)).sum := by + rw [cdir_finite_sum e a _ _ (fun i _ => monoEval_smooth e f hf _)] + simp_rw [cdir_monoEval e f hf] + funext x + rw [mixedStep_sum,← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro i _ + rw [← Finset.add_sum_erase Finset.univ + (fun j => monoEval e f (stepState a (singleState ws i) j) x) (Finset.mem_univ i), + singleState_step_same] + +lemma monoRemainder_step_sum (e : ι → E) (f : κ → E → ℂ) + (hf : ∀ i, ContDiff ℝ ∞ (f i)) (a b : ι) (ws : List ι) : + cdir (e a) (fun x => ((monoRemainder (b::ws)).map (fun s => monoEval e f s x)).sum) = + fun x => (((monoRemainder (b::ws)).flatMap + (fun s => Finset.univ.toList.map (stepState a s))).map (fun s => monoEval e f s x)).sum := by + rw [cdir_list_sum e a _ _ (fun s _ => monoEval_smooth e f hf s)] + simp_rw [cdir_monoEval e f hf] + funext x + rw [sum_flatMap_map] + simp + +omit [DecidableEq κ] in +lemma smooth_mono_list_sum (e : ι → E) (f : κ → E → ℂ) + (hf : ∀ i, ContDiff ℝ ∞ (f i)) (ss : List (κ → List ι)) : + ContDiff ℝ ∞ (fun x => (ss.map (fun s => monoEval e f s x)).sum) := by + induction ss with + | nil => exact contDiff_const + | cons s ss ih => exact (monoEval_smooth e f hf s).add ih + +theorem cword_product_remainder (e : ι → E) (f : κ → E → ℂ) + (hf : ∀ i, ContDiff ℝ ∞ (f i)) (ws : List ι) (hw : ws ≠ []) : + cword e (fun x => ∏ i, f i x) ws = fun x => + (∑ i, monoEval e f (singleState ws i) x)+ + ((monoRemainder ws).map (fun s => monoEval e f s x)).sum := by + induction ws with + | nil => exact (hw rfl).elim + | cons a ws ih => + cases ws with + | nil => + change cdir (e a) (monoEval e f (fun _ => [])) = _ + rw [cdir_monoEval e f hf] + funext x + simp only [monoRemainder,List.map_nil,List.sum_nil,add_zero] + apply Finset.sum_congr rfl + intro i _ + rfl + | cons b ws => + have hi := ih (by simp) + change cdir (e a) (cword e (fun x => ∏ i, f i x) (b::ws)) = _ + rw [hi] + have h1 : ContDiff ℝ ∞ (fun x => ∑ i, monoEval e f (singleState (b::ws) i) x) := by + apply ContDiff.sum; intro i _; exact monoEval_smooth e f hf _ + have h2 := smooth_mono_list_sum e f hf (monoRemainder (b::ws)) + have hadd : cdir (e a) (fun x => (∑ i, monoEval e f (singleState (b::ws) i) x)+ + ((monoRemainder (b::ws)).map (fun s => monoEval e f s x)).sum) = + fun x => cdir (e a) (fun x => ∑ i, monoEval e f (singleState (b::ws) i) x) x+ + cdir (e a) (fun x => ((monoRemainder (b::ws)).map (fun s => monoEval e f s x)).sum) x := by + funext x + unfold cdir + rw [fderiv_fun_add (h1.differentiable (by simp) x) (h2.differentiable (by simp) x)] + rfl + rw [hadd,cdir_principal e f hf,monoRemainder_step_sum e f hf] + funext x + simp only [monoRemainder,List.map_append,List.sum_append] + abel +end TameInterpolation + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/JetRemainderBound.lean b/lean/OAI/Geometry/PrescribedRicci/JetRemainderBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..759ff457aed1b2c64d6155be5875ed615d9f5c90 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/JetRemainderBound.lean @@ -0,0 +1,119 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.JetTrim + +namespace OAI + +/-! Jet Remainder Bound. -/ + +section + + + +noncomputable section +open Set Finset MeasureTheory +open scoped ContDiff Classical BigOperators ENNReal +namespace TameInterpolation +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] +variable {ι κ : Type*} [Fintype ι] [Nonempty ι] [Fintype κ] [Nonempty κ] [DecidableEq κ] + +omit [Nonempty κ] in +lemma lpNorm_complex_prod_L2_Linf (f : κ → E → ℂ) (i : κ) + (hf2 : MemLp (f i) 2 volume) (hfi : ∀ j, MemLp (f j) ∞ volume) + {A B : ℝ} (_hA : 0 ≤ A) (hB : 0 ≤ B) + (hfa : ∀ j, lpNorm (f j) ∞ volume ≤ A) (hfb : lpNorm (f i) 2 volume ≤ B) : + lpNorm (fun x => ∏ j, f j x) 2 volume ≤ B*A^(Fintype.card κ-1) := by + let p : κ → ℝ≥0∞ := fun j => if j = i then 2 else ∞ + have hp : ∀ j, MemLp (f j) (p j) volume := by + intro j; by_cases hj : j = i + · subst j; simpa [p] using hf2 + · simpa [p,hj] using hfi j + have hs : (∑ j, (p j)⁻¹)⁻¹ = 2 := by + rw [← Finset.add_sum_erase Finset.univ (fun j => (p j)⁻¹) (Finset.mem_univ i)] + have he : ∑ j ∈ Finset.univ.erase i, (p j)⁻¹ = 0 := by + apply Finset.sum_eq_zero + intro j hj + simp [p,(Finset.mem_erase.mp hj).1] + simp [he,p] + have hh := lpNorm_complex_finite_prod (μ:=volume) Finset.univ f p (fun j _ => hp j) + rw [hs] at hh + apply hh.trans + rw [← Finset.mul_prod_erase Finset.univ (fun j => lpNorm (f j) (p j) volume) (Finset.mem_univ i)] + have hi : p i = 2 := by simp [p] + rw [hi] + apply mul_le_mul hfb _ (Finset.prod_nonneg fun _ _ => lpNorm_nonneg) hB + have he : ∏ j ∈ Finset.univ.erase i, lpNorm (f j) (p j) volume ≤ + ∏ _j ∈ Finset.univ.erase i, A := by + apply Finset.prod_le_prod₀ + · intro j _; exact lpNorm_nonneg + · intro j hj + simpa [p,(Finset.mem_erase.mp hj).1] using hfa j + simpa using he + +lemma monoEval_tame_zero (e : ι → E) (f : κ → E → ℂ) + (hf : ∀ i, ContDiff ℝ ∞ (f i)) (hc : ∀ i, HasCompactSupport (f i)) + (s : κ → List ι) (hm : ∑ i, (trimWord (s i)).length = 0) : + lpNorm (monoEval e f s) 2 volume ≤ + (2*familyJetNorm e (realComponents (initialJet e f)) 0 2) * + (2*familyJetNorm e (realComponents (initialJet e f)) 0 ∞)^(Fintype.card κ-1) := by + have hzero (i : κ) : trimWord (s i) = [] := by + apply List.length_eq_zero_iff.mp + exact Nat.eq_zero_of_le_zero (hm ▸ Finset.single_le_sum (f:=fun i => (trimWord (s i)).length) (fun _ _ => Nat.zero_le _) (Finset.mem_univ i)) + let g := initialJet e f + let a : κ → κ × Option ι := fun i => (i,baseDirection (s i)) + have he : monoEval e f s = fun x => ∏ i, g (a i) x := by + funext x; unfold monoEval + apply Finset.prod_congr rfl + intro i _ + rw [cword_trim e f i (s i),hzero i] + rfl + rw [he] + have hg := initialJet_smooth e f hf + have hgc := initialJet_compact e f hc + let i : κ := Classical.choice inferInstance + apply lpNorm_complex_prod_L2_Linf (fun i => g (a i)) i + ((hg _).continuous.memLp_of_hasCompactSupport (hgc _)) + (fun j => (hg _).continuous.memLp_of_hasCompactSupport (hgc _)) + (mul_nonneg (by norm_num) (familyJetNorm_nonneg ..)) + (mul_nonneg (by norm_num) (familyJetNorm_nonneg ..)) + · intro j + exact cjet_lpNorm_le e g hg hgc (a j) (Fin.elim0 : Fin 0 → ι) (by simp) + · exact cjet_lpNorm_le e g hg hgc (a i) (Fin.elim0 : Fin 0 → ι) (by norm_num) + +theorem monoRemainder_uniform_bound {Z : Type*} (e : ι → E) (F : Z → κ → E → ℂ) + (hf : ∀ z i, ContDiff ℝ ∞ (F z i)) (hc : ∀ z i, HasCompactSupport (F z i)) + (ws : List ι) (s : κ → List ι) (hs : s ∈ monoRemainder ws) + {A : ℝ} (hA : 0 ≤ A) + (h0 : ∀ z, familyJetNorm e (realComponents (initialJet e (F z))) 0 ∞ ≤ A) + (h2 : ∀ j ≤ ws.length-2, ∃ B : ℝ, 0 ≤ B ∧ + ∀ z, familyJetNorm e (realComponents (initialJet e (F z))) j 2 ≤ B) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ z, lpNorm (monoEval e (F z) s) 2 volume ≤ C := by + let m := ∑ i, (trimWord (s i)).length + have hmle : m ≤ ws.length-2 := remainder_trimmed_order hs + obtain ⟨B,hB,hb⟩ := h2 m hmle + by_cases hm : m = 0 + · refine ⟨(2*B)*(2*A)^(Fintype.card κ-1),by positivity,fun z => ?_⟩ + apply (monoEval_tame_zero e (F z) (hf z) (hc z) s hm).trans + apply mul_le_mul + · exact mul_le_mul_of_nonneg_left (by simpa [hm] using hb z) (by norm_num) + · exact pow_le_pow_left₀ (mul_nonneg (by norm_num) (familyJetNorm_nonneg ..)) + (mul_le_mul_of_nonneg_left (h0 z) (by norm_num)) _ + · exact pow_nonneg (mul_nonneg (by norm_num) (familyJetNorm_nonneg ..)) _ + · positivity + · let K : ℝ := 2^(Fintype.card κ) * (2*(m:ℝ))^(∑ i, (trimWord (s i)).length*(m-(trimWord (s i)).length)) + have hK : 0 ≤ K := by dsimp [K]; positivity + refine ⟨K*A^(Fintype.card κ-1)*B,by positivity,fun z => ?_⟩ + apply (monoEval_tame_positive e (F z) (hf z) (hc z) s (Nat.pos_of_ne_zero hm)).trans + simp only [← mul_assoc] + change K * _ * _ ≤ K * _ * _ + apply mul_le_mul + · exact mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (familyJetNorm_nonneg ..) (h0 z) _) hK + · exact hb z + · exact familyJetNorm_nonneg .. + · positivity +end TameInterpolation + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/JetSobolev.lean b/lean/OAI/Geometry/PrescribedRicci/JetSobolev.lean new file mode 100644 index 0000000000000000000000000000000000000000..36975c443a44a6bfa81b28cc102151ab5af08e38 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/JetSobolev.lean @@ -0,0 +1,132 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CoreBounds +import OAI.Geometry.PrescribedRicci.JetTrim + +namespace OAI + +/-! Jet Sobolev. -/ + +section + + + +noncomputable section +open Set Finset MeasureTheory LineDeriv TemperedDistribution +open scoped ContDiff Classical BigOperators ENNReal SchwartzMap +namespace TameInterpolation +open SobolevChart EllipticKernel +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] +variable {ι κ : Type*} + +lemma cdir_schwartz (v : E) (f : 𝓢(E,ℂ)) : cdir v f = (∂_{v} f : 𝓢(E,ℂ)) := by + funext x + rw [SchwartzMap.lineDerivOp_apply_eq_fderiv] + rfl + +lemma cword_schwartz (e : ι → E) (f : 𝓢(E,ℂ)) (ws : List ι) : + cword e f ws = (schwartzWord (ws.map e) f : E → ℂ) := by + induction ws with + | nil => rfl + | cons a ws ih => + change cdir (e a) (cword e f ws) = _ + rw [ih,cdir_schwartz] + rfl + +lemma cjet_schwartz (e : ι → E) (f : 𝓢(E,ℂ)) {j : ℕ} (w : Fin j → ι) : + cjet e f w = (schwartzWord ((List.ofFn w).map e) f : E → ℂ) := by + induction j with + | zero => rfl + | succ j ih => + simp only [cjet,List.ofFn_succ,List.map_cons,schwartzWord,ContinuousLinearMap.comp_apply] + rw [ih,cdir_schwartz] + rfl + +variable [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +lemma lpNorm_schwartz_zero (f : 𝓢(E,ℂ)) : lpNorm (f : E → ℂ) 2 volume = ‖schwartzCoord 0 f‖ := by + have he : schwartzCoord 0 f = f.toLp 2 volume := by + apply l2_injective + simpa [realize] using realize_schwartzCoord 0 f + rw [he,SchwartzMap.norm_toLp,toReal_eLpNorm] + +lemma lpNorm_realComponent_le (f : E → ℂ) {p : ℝ≥0∞} (hf : MemLp f p volume) (b : Bool) : + lpNorm (fun x => if b then (f x).im else (f x).re) p volume ≤ lpNorm f p volume := by + apply (lpNorm_mono_real hf.norm (fun x => ?_)).trans_eq (lpNorm_norm hf.aestronglyMeasurable p) + cases b + · exact Complex.abs_re_le_norm (f x) + · exact Complex.abs_im_le_norm (f x) + +variable [Fintype ι] [Nonempty ι] [Fintype κ] [Nonempty κ] + +theorem familyJetNorm_sobolev_bound (e : ι → E) (j : ℕ) (s : ℝ) (hs : (j:ℝ) ≤ s) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ F : κ → 𝓢(E,ℂ), + familyJetNorm e (realComponents (fun i => (F i : E → ℂ))) j 2 ≤ + C*∑ i, ‖schwartzCoord s (F i)‖ := by + have hb (w : Fin j → ι) : CoreBound s 0 (schwartzWord ((List.ofFn w).map e)) := + coreBound_word _ (by simpa using sub_nonneg.mpr hs) + choose C hC hbound using hb + refine ⟨∑ w, C w,Finset.sum_nonneg fun w _ => hC w,fun F => ?_⟩ + obtain ⟨⟨i,b⟩,ha⟩ := familyJetNorm_attained e (realComponents (fun i => (F i : E → ℂ))) j 2 + obtain ⟨w,hw⟩ := jetNorm_attained e (realComponents (fun i => (F i : E → ℂ)) (i,b)) j 2 + rw [ha,hw] + have he : jet e (realComponents (fun i => (F i : E → ℂ)) (i,b)) w = + fun x => if b then (cjet e (F i) w x).im else (cjet e (F i) w x).re := by + cases b + · exact cjet_real_map e (F i).smooth' Complex.reCLM w + · exact cjet_real_map e (F i).smooth' Complex.imCLM w + rw [he] + have hmem : MemLp (cjet e (F i) w) 2 volume := by rw [cjet_schwartz]; exact (schwartzWord _ _).memLp _ _ + apply (lpNorm_realComponent_le _ hmem b).trans + rw [cjet_schwartz,lpNorm_schwartz_zero] + apply (hbound w (F i)).trans + exact mul_le_mul (Finset.single_le_sum (fun w _ => hC w) (Finset.mem_univ w)) + (Finset.single_le_sum (f:=fun i => ‖schwartzCoord s (F i)‖) (fun _ _ => norm_nonneg _) (Finset.mem_univ i)) + (norm_nonneg _) (Finset.sum_nonneg fun w _ => hC w) + +def initialSchwartz (e : ι → E) (F : κ → 𝓢(E,ℂ)) (q : κ × Option ι) : 𝓢(E,ℂ) := + match q.2 with + | none => F q.1 + | some a => ∂_{e a} (F q.1) + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + [Fintype ι] [Nonempty ι] [Fintype κ] [Nonempty κ] in +lemma initialSchwartz_coe (e : ι → E) (F : κ → 𝓢(E,ℂ)) (q : κ × Option ι) : + (initialSchwartz e F q : E → ℂ) = initialJet e (fun i => (F i : E → ℂ)) q := by + rcases q with ⟨i,q⟩; cases q + · rfl + · exact (cdir_schwartz _ _).symm + +theorem initialJet_sobolev_bound (e : ι → E) (j : ℕ) (s : ℝ) (hs : (j:ℝ)+1 ≤ s) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ F : κ → 𝓢(E,ℂ), + familyJetNorm e (realComponents (initialJet e (fun i => (F i : E → ℂ)))) j 2 ≤ + C*∑ i, ‖schwartzCoord s (F i)‖ := by + obtain ⟨B,hB,hb⟩ := familyJetNorm_sobolev_bound (κ:=κ×Option ι) e j (j:ℝ) le_rfl + have hq (q : Option ι) : ∃ C : ℝ, 0 ≤ C ∧ ∀ f : 𝓢(E,ℂ), + ‖schwartzCoord (j:ℝ) (initialSchwartz e (fun _ : κ => f) (Classical.choice inferInstance,q))‖ ≤ + C*‖schwartzCoord s f‖ := by + cases q with + | none => exact CoreBound.id (by linarith) + | some a => exact coreBound_deriv (e a) (by linarith) + choose C hC hcb using hq + refine ⟨B*∑ q : κ×Option ι, C q.2,mul_nonneg hB (Finset.sum_nonneg fun q _ => hC q.2),fun F => ?_⟩ + have he : (fun q => (initialSchwartz e F q : E → ℂ)) = initialJet e (fun i => (F i : E → ℂ)) := + funext (initialSchwartz_coe e F) + rw [← he] + apply (hb (initialSchwartz e F)).trans + rw [mul_assoc,Finset.sum_mul] + apply mul_le_mul_of_nonneg_left _ hB + apply Finset.sum_le_sum + intro q _ + have hqq := hcb q.2 (F q.1) + have heq : initialSchwartz e (fun _ : κ => F q.1) (Classical.choice inferInstance,q.2) = initialSchwartz e F q := by + cases q with + | mk i a => cases a <;> rfl + rw [heq] at hqq + exact hqq.trans (mul_le_mul_of_nonneg_left + (Finset.single_le_sum (f:=fun i => ‖schwartzCoord s (F i)‖) (fun _ _ => norm_nonneg _) (Finset.mem_univ q.1)) (hC q.2)) +end TameInterpolation + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/JetTameProduct.lean b/lean/OAI/Geometry/PrescribedRicci/JetTameProduct.lean new file mode 100644 index 0000000000000000000000000000000000000000..762e648def937b508ff79d26daeefab85c9b59a4 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/JetTameProduct.lean @@ -0,0 +1,64 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.DiscreteInterpolation +import OAI.Geometry.PrescribedRicci.InterpolationExponents +import OAI.Geometry.PrescribedRicci.JetInterpolation + +namespace OAI + +/-! Jet Tame Product. -/ + +section + + + +noncomputable section +open Set Filter Topology MeasureTheory +open scoped ContDiff ENNReal +namespace TameInterpolation +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] +variable {ι : Type*} [Fintype ι] [Nonempty ι] + +lemma jet_exponent_recurrence (e : ι → E) {f : E → ℝ} + (hf : ContDiff ℝ ∞ f) (hc : HasCompactSupport f) (m : ℕ) (hm : 0 < m) + (j : ℕ) (hj : j+2 ≤ m) : + (jetNorm e f (j+1) (exponent m (j+1)))^2 ≤ + (2*(m:ℝ))*jetNorm e f j (exponent m j)*jetNorm e f (j+2) (exponent m (j+2)) := by + let p : ℝ := 2*(m:ℝ)/((j+1:ℕ):ℝ) + have hp : 2 < p := exponent_middle_gt (by omega : j+1 < m) + let := exponent_holder_step (by omega : j+1 < m) + let := interpolation_holder_conjugate hp + have h := jetNorm_step e hf hc j hp (exponent m j) (exponent m (j+2)) + (ENNReal.ofReal ((p-2)/p))⁻¹ (ENNReal.ofReal (2/p))⁻¹ (interpolation_power_exponent hp) + rw [exponent_of_pos hm (by omega : 0 < j+1)] + apply h.trans + have hpm : p ≤ 2*(m:ℝ) := by + apply (div_le_iff₀ (by positivity : 0 < ((j+1:ℕ):ℝ))).mpr + have hj1 : (1:ℝ) ≤ ((j+1:ℕ):ℝ) := by exact_mod_cast (by omega : 1 ≤ j+1) + nlinarith only [hj1,Nat.cast_nonneg (α:=ℝ) m] + exact mul_le_mul_of_nonneg_right + (mul_le_mul_of_nonneg_right (by linarith only [hpm]) (jetNorm_nonneg _ _ _ _)) (jetNorm_nonneg _ _ _ _) + +theorem jet_tame_product (e : ι → E) {f : E → ℝ} + (hf : ContDiff ℝ ∞ f) (hc : HasCompactSupport f) (m j : ℕ) + (hm : 0 < m) (hj : j ≤ m) : + jetNorm e f j (exponent m j)*jetNorm e f (m-j) (exponent m (m-j)) ≤ + (2*(m:ℝ))^(j*(m-j))*jetNorm e f 0 ∞*jetNorm e f m 2 := by + have h := nonnegative_sequence_product m j hm hj + (fun i => jetNorm e f i (exponent m i)) (fun _ => jetNorm_nonneg _ _ _ _) + (2*(m:ℝ)) (by + have : (1:ℝ) ≤ (m:ℝ) := by exact_mod_cast hm + linarith only [this]) + (fun i hi => jet_exponent_recurrence e hf hc m hm i hi) + have he : exponent m m = 2 := by + rw [exponent_of_pos hm hm] + have hmn : (m:ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt hm) + rw [mul_div_cancel_right₀ _ hmn] + norm_num + simpa only [exponent_zero,he] using h +end TameInterpolation + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/JetTrim.lean b/lean/OAI/Geometry/PrescribedRicci/JetTrim.lean new file mode 100644 index 0000000000000000000000000000000000000000..8f267f0d342080bb889d21e59e49b971ece7c478 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/JetTrim.lean @@ -0,0 +1,123 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.ComplexJetProduct +import OAI.Geometry.PrescribedRicci.JetRemainder + +namespace OAI + +/-! Jet Trim. -/ + +section + + + +noncomputable section +open Set Finset MeasureTheory +open scoped ContDiff Classical BigOperators ENNReal +namespace TameInterpolation +variable {ι κ : Type*} + +def trimWord : List ι → List ι + | [] => [] + | [_] => [] + | a::b::ws => a::trimWord (b::ws) +def baseDirection : List ι → Option ι + | [] => none + | [a] => some a + | _::b::ws => baseDirection (b::ws) + +lemma trimWord_length (ws : List ι) : (trimWord ws).length = ws.length-1 := by + induction ws with + | nil => rfl + | cons a ws ih => cases ws <;> simp_all [trimWord] + +lemma trimWord_length_add (ws : List ι) : + (trimWord ws).length + (if ws = [] then 0 else 1) = ws.length := by + rw [trimWord_length] + cases ws <;> simp + +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +def initialJet (e : ι → E) (f : κ → E → ℂ) (q : κ × Option ι) : E → ℂ := + match q.2 with + | none => f q.1 + | some a => cdir (e a) (f q.1) + +lemma initialJet_smooth (e : ι → E) (f : κ → E → ℂ) + (hf : ∀ i, ContDiff ℝ ∞ (f i)) (q : κ × Option ι) : + ContDiff ℝ ∞ (initialJet e f q) := by + rcases q with ⟨i,q⟩; cases q + · exact hf i + · exact cdir_smooth _ (hf i) + +lemma initialJet_compact (e : ι → E) (f : κ → E → ℂ) + (hf : ∀ i, HasCompactSupport (f i)) (q : κ × Option ι) : + HasCompactSupport (initialJet e f q) := by + rcases q with ⟨i,q⟩; cases q + · exact hf i + · exact cdir_compact _ (hf i) + +lemma cword_trim (e : ι → E) (f : κ → E → ℂ) (i : κ) (ws : List ι) : + cword e (f i) ws = cword e (initialJet e f (i,baseDirection ws)) (trimWord ws) := by + induction ws with + | nil => rfl + | cons a ws ih => + cases ws with + | nil => rfl + | cons b ws => exact congrArg (cdir (e a)) ih + +lemma cword_eq_cjet (e : ι → E) (f : E → ℂ) (ws : List ι) : + cword e f ws = cjet e f ws.get := by + induction ws with + | nil => rfl + | cons a ws ih => + change cdir (e a) (cword e f ws) = cdir (e a) (cjet e f (fun i => (a::ws).get i.succ)) + rw [ih] + rfl + +variable [Fintype κ] [DecidableEq κ] +omit [DecidableEq κ] in +lemma trimmed_order (s : κ → List ι) : + (∑ i, (trimWord (s i)).length) + (activeSet s).card = stateOrder s := by + have hcard : (activeSet s).card = ∑ i, if s i = [] then 0 else 1 := by + classical + simp [activeSet,Finset.card_filter,ite_not] + rw [hcard,← Finset.sum_add_distrib] + exact Finset.sum_congr rfl (fun i _ => trimWord_length_add (s i)) + +lemma remainder_trimmed_order {ws : List ι} {s : κ → List ι} (hs : s ∈ monoRemainder ws) : + ∑ i, (trimWord (s i)).length ≤ ws.length-2 := by + have h := monoRemainder_order ws s hs + have he := trimmed_order s + omega + +variable [Fintype ι] [Nonempty ι] [Nonempty κ] +variable [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +omit [DecidableEq κ] in +theorem monoEval_tame_positive (e : ι → E) (f : κ → E → ℂ) + (hf : ∀ i, ContDiff ℝ ∞ (f i)) (hc : ∀ i, HasCompactSupport (f i)) + (s : κ → List ι) (hm : 0 < ∑ i, (trimWord (s i)).length) : + let m := ∑ i, (trimWord (s i)).length + lpNorm (monoEval e f s) 2 volume ≤ + 2^(Fintype.card κ) * ((2*(m:ℝ))^(∑ i, (trimWord (s i)).length*(m-(trimWord (s i)).length)) * + familyJetNorm e (realComponents (initialJet e f)) 0 ∞ ^ (Fintype.card κ-1) * + familyJetNorm e (realComponents (initialJet e f)) m 2) := by + dsimp only + have he : monoEval e f s = fun x => ∏ i, cjet e + (initialJet e f (i,baseDirection (s i))) (trimWord (s i)).get x := by + funext x + unfold monoEval + apply Finset.prod_congr rfl + intro i _ + rw [cword_trim e f i (s i),cword_eq_cjet] + rw [he] + exact cjet_product_L2 e (initialJet e f) (initialJet_smooth e f hf) + (initialJet_compact e f hc) _ hm Finset.univ + (fun i => (i,baseDirection (s i))) (fun i => (trimWord (s i)).length) + (fun i => (trimWord (s i)).get) rfl +end TameInterpolation + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/KaehlerLogTrace.lean b/lean/OAI/Geometry/PrescribedRicci/KaehlerLogTrace.lean new file mode 100644 index 0000000000000000000000000000000000000000..0a258ca2b5dc4e0e1b13e04069ac1fd4aad919f4 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/KaehlerLogTrace.lean @@ -0,0 +1,112 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.KahlerEnergyChain +import OAI.Geometry.PrescribedRicci.KaehlerTrace + +namespace OAI + +/-! Kaehler Log Trace. -/ + +section + + +noncomputable section +open Matrix Filter Set Topology +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth.KaehlerMetric +variable {d : ℕ} + +lemma holRealDeriv_log {φ : Coordinates d → ℝ} {z : Coordinates d} + (hφ : DifferentiableAt ℝ φ z) (hp : φ z ≠ 0) (a : Fin d) : + holRealDeriv (fun y => Real.log (φ y)) z a = + ((φ z)⁻¹:ℝ) * holRealDeriv φ z a := by + have he := congrFun (holRealDeriv_comp hφ (Real.differentiableAt_log hp)) a + simpa only [Function.comp_def,Real.deriv_log] using he + +lemma holRealDeriv_inv {φ : Coordinates d → ℝ} {z : Coordinates d} + (hφ : DifferentiableAt ℝ φ z) (hp : φ z ≠ 0) (a : Fin d) : + holRealDeriv (fun y => (φ y)⁻¹) z a = + (-((φ z)^2)⁻¹:ℝ) * holRealDeriv φ z a := by + have he := congrFun (holRealDeriv_comp hφ (differentiableAt_inv hp)) a + simpa only [Function.comp_def,deriv_inv] using he + +lemma potentialMatrix_log {φ : Coordinates d → ℝ} {z : Coordinates d} + (hφ : ContDiffAt ℝ ∞ φ z) (hp : φ z ≠ 0) (b a : Fin d) : + PotentialKaehler.potentialMatrix (fun y => Real.log (φ y)) z b a = + ((φ z)⁻¹:ℝ)*PotentialKaehler.potentialMatrix φ z b a - + (((φ z)^2)⁻¹:ℝ)*star (holRealDeriv φ z b)*holRealDeriv φ z a := by + rw [← barDeriv_holRealDeriv (hφ.log hp)] + have he : (fun y => holRealDeriv (fun w => Real.log (φ w)) y a) =ᶠ[nhds z] + (fun y => (((φ y)⁻¹:ℝ):ℂ)*holRealDeriv φ y a) := by + filter_upwards [(hφ.of_le (show (1:ℕ∞ω) ≤ ∞ by simp)).eventually (by simp), + hφ.continuousAt.eventually (eventually_ne_nhds hp)] with y hy hn + exact holRealDeriv_log (hy.differentiableAt (by simp)) hn a + have hd := hφ.differentiableAt (by simp) + have hi : DifferentiableAt ℝ (fun y => (φ y)⁻¹) z := hd.inv hp + have hic : DifferentiableAt ℝ (fun y => (((φ y)⁻¹:ℝ):ℂ)) z := + Complex.ofRealCLM.differentiableAt.comp z hi + rw [barDeriv_congr he,barDeriv_mul hic + ((contDiffAt_holRealDeriv hφ a).differentiableAt (by simp)), + barDeriv_ofReal hi,barDeriv_holRealDeriv hφ,holRealDeriv_inv hd hp] + simp only [star_mul,Complex.star_def,Complex.ofReal_neg,map_neg,Complex.conj_ofReal] + ring + +variable {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +def logTrace (h g : KaehlerMetric A) (hd : 0 < d) : SmoothRealFunction A where + value x := Real.log ((h.traceMetric g).value x) + smooth q := ((h.traceMetric g).smooth q).log (fun z _hz => + (h.traceMetric_pos g hd ((A.chart q).symm z)).ne') + +lemma laplacian_logTrace (h g : KaehlerMetric A) (hd : 0 < d) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) : + (h.laplacian (h.logTrace g hd)).localExpression q z = + ((h.traceMetric g).localExpression q z)⁻¹ * (h.laplacian (h.traceMetric g)).localExpression q z - + (((h.traceMetric g).localExpression q z)^2)⁻¹ * + (h.energy (h.traceMetric g) (h.traceMetric g)).localExpression q z := by + have hs := ((h.traceMetric g).smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hz) + have hp : (h.traceMetric g).localExpression q z ≠ 0 := + (h.traceMetric_pos g hd ((A.chart q).symm z)).ne' + have hx := (A.chart q).mapsTo_symm hz + have hlocφ := h.laplacianValue_local (h.traceMetric g) q hx + have hlocl := h.laplacianValue_local (h.logTrace g hd) q hx + have hloce := h.energy_local (h.traceMetric g) (h.traceMetric g) q hz + change (h.laplacianValue (h.logTrace g hd)) ((A.chart q).symm z) = _ + rw [hlocl,(A.chart q).right_inv hz] + change _ = ((h.traceMetric g).localExpression q z)⁻¹ * + h.laplacianValue (h.traceMetric g) ((A.chart q).symm z) - _ + rw [hlocφ,(A.chart q).right_inv hz] + change _ = _ - _ * (h.energy (h.traceMetric g) (h.traceMetric g)).value ((A.chart q).symm z) + change (h.energy (h.traceMetric g) (h.traceMetric g)).value ((A.chart q).symm z) = _ at hloce + rw [hloce] + simp only [linearizedMongeAmpere,Matrix.trace,Matrix.diag_apply,Matrix.mul_apply,gradientPair] + have hm (b a : Fin d) : (h.logTrace g hd).hessian q z b a = + (((h.traceMetric g).localExpression q z)⁻¹:ℝ)*(h.traceMetric g).hessian q z b a - + ((((h.traceMetric g).localExpression q z)^2)⁻¹:ℝ)* + star (holRealDeriv ((h.traceMetric g).localExpression q) z b)* + holRealDeriv ((h.traceMetric g).localExpression q) z a := + potentialMatrix_log hs hp b a + simp only [hm,mul_sub,Finset.sum_sub_distrib] + have he (c : ℝ) (f : Fin d → Fin d → ℂ) : + (∑ a, ∑ b, (h.matrix q z)⁻¹ a b*((c:ℂ)*f b a)).re = + c*(∑ a, ∑ b, (h.matrix q z)⁻¹ a b*f b a).re := by + have hh : (∑ a, ∑ b, (h.matrix q z)⁻¹ a b*((c:ℂ)*f b a)) = + (c:ℂ)*(∑ a, ∑ b, (h.matrix q z)⁻¹ a b*f b a) := by + simp only [Finset.mul_sum] + apply Finset.sum_congr rfl + intro a _ + apply Finset.sum_congr rfl + intro b _ + ring + rw [hh,Complex.mul_re,Complex.ofReal_re,Complex.ofReal_im,zero_mul,sub_zero] + rw [Complex.sub_re] + apply congrArg₂ (fun a b : ℝ => a-b) + · exact he ((h.traceMetric g).localExpression q z)⁻¹ ((h.traceMetric g).hessian q z) + · simpa only [mul_assoc] using he (((h.traceMetric g).localExpression q z)^2)⁻¹ + (fun b a => star (holRealDeriv ((h.traceMetric g).localExpression q) z b)*holRealDeriv ((h.traceMetric g).localExpression q) z a) + +end Anticanonical.SourceSmooth.KaehlerMetric + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/KaehlerTrace.lean b/lean/OAI/Geometry/PrescribedRicci/KaehlerTrace.lean new file mode 100644 index 0000000000000000000000000000000000000000..4ad27efd457fbd0bc7305511488441c72f7333be --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/KaehlerTrace.lean @@ -0,0 +1,110 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalOperator + +namespace OAI + +/-! Kaehler Trace. -/ + +noncomputable section +open Matrix Filter Set Topology +open scoped ContDiff ComplexOrder MatrixOrder Matrix.Norms.Elementwise +namespace MongeAmpere +variable {n : Type*} [Fintype n] [DecidableEq n] + +lemma trace_mul_pos [Nonempty n] {H G : Matrix n n ℂ} + (hH : H.PosDef) (hG : G.PosDef) : 0 < (H*G).trace.re := by + let S := CFC.sqrt H + have hS : S.PosSemidef := (CFC.sqrt_nonneg H).posSemidef + have hs : S*S=H := by simpa [S,pow_two] using CFC.sq_sqrt H hH.posSemidef.nonneg + have hSn : S.det ≠ 0 := by + intro hz + have he := congrArg Matrix.det hs + rw [det_mul,hz,zero_mul] at he + exact hH.det_pos.ne' he.symm + have hp := hG.conjTranspose_mul_mul_same (Matrix.mulVec_injective_of_det_ne_zero hSn) + have ht := (Complex.pos_iff.mp hp.trace_pos).1 + have he : (Sᴴ*G*S).trace = (H*G).trace := by + rw [hS.isHermitian.eq,trace_mul_cycle,hs] + rwa [he] at ht + +end MongeAmpere +namespace Anticanonical.SourceSmooth.KaehlerMetric +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +lemma traceMetric_compatibility (g h : KaehlerMetric A) (i j : Fin A.count) + {x : X} (hi : x ∈ (A.chart i).source) (hj : x ∈ (A.chart j).source) : + ((g.matrix i (A.chart i x))⁻¹*h.matrix i (A.chart i x)).trace = + ((g.matrix j (A.chart j x))⁻¹*h.matrix j (A.chart j x)).trace := by + let D := A.derivativeMatrix i j x + have hD : IsUnit D.det := g.transition_det_isUnit i j hi hj + have hs : IsUnit Dᴴ.det := by rw [det_conjTranspose]; exact hD.star + rw [g.compatibility i j x hi hj,h.compatibility i j x hi hj] + change ((Dᴴ*g.matrix j (A.chart j x)*D)⁻¹*(Dᴴ*h.matrix j (A.chart j x)*D)).trace = _ + rw [Matrix.mul_inv_rev,Matrix.mul_inv_rev] + simp only [mul_assoc,nonsing_inv_mul_cancel_left Dᴴ _ hs] + have he : D⁻¹ * ((g.matrix j (A.chart j x))⁻¹ * (h.matrix j (A.chart j x) * D)) = + D⁻¹ * ((g.matrix j (A.chart j x))⁻¹ * h.matrix j (A.chart j x)) * D := by simp only [mul_assoc] + rw [he, trace_mul_cycle, mul_nonsing_inv D hD, one_mul] + +def traceMetricValue (g h : KaehlerMetric A) (x : X) : ℝ := + (((g.matrix (A.covers x).choose (A.chart (A.covers x).choose x))⁻¹)* + h.matrix (A.covers x).choose (A.chart (A.covers x).choose x)).trace.re + +lemma traceMetricValue_local (g h : KaehlerMetric A) (i : Fin A.count) + {x : X} (hx : x ∈ (A.chart i).source) : + g.traceMetricValue h x = ((g.matrix i (A.chart i x))⁻¹*h.matrix i (A.chart i x)).trace.re := + congrArg Complex.re (g.traceMetric_compatibility h _ i (A.covers x).choose_spec hx) + +lemma traceMetric_local_smooth (g h : KaehlerMetric A) (i : Fin A.count) : + ContDiffOn ℝ ∞ (fun z => ((g.matrix i z)⁻¹*h.matrix i z).trace.re) (A.chart i).target := by + apply Complex.reCLM.contDiff.comp_contDiffOn + simp only [Matrix.trace,Matrix.diag_apply,Matrix.mul_apply] + apply ContDiffOn.sum + intro j _ + apply ContDiffOn.sum + intro k _ + exact (contDiffOn_pi.mp (contDiffOn_pi.mp (MatrixSmoothGeneral.inverse (g.smooth i) + (fun z hz => (g.positive i z hz).det_pos.ne')) j) k).mul + (contDiffOn_pi.mp (contDiffOn_pi.mp (h.smooth i) k) j) + +def traceMetric (g h : KaehlerMetric A) : SmoothRealFunction A where + value := g.traceMetricValue h + smooth i := by + apply (g.traceMetric_local_smooth h i).congr + intro z hz + dsimp only [Function.comp_apply] + rw [g.traceMetricValue_local h i ((A.chart i).mapsTo_symm hz),(A.chart i).right_inv hz] + +lemma traceMetric_local (g h : KaehlerMetric A) (i : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart i).target) : + (g.traceMetric h).localExpression i z = ((g.matrix i z)⁻¹*h.matrix i z).trace.re := by + change g.traceMetricValue h ((A.chart i).symm z) = _ + rw [g.traceMetricValue_local h i ((A.chart i).mapsTo_symm hz),(A.chart i).right_inv hz] + +lemma traceMetric_pos (g h : KaehlerMetric A) (hd : 0 < d) (x : X) : + 0 < (g.traceMetric h).value x := by + let : Nonempty (Fin d) := ⟨⟨0,hd⟩⟩ + obtain ⟨i,hi⟩ := A.covers x + change 0 < g.traceMetricValue h x + rw [g.traceMetricValue_local h i hi] + exact MongeAmpere.trace_mul_pos (g.positive i _ ((A.chart i).mapsTo hi)).inv + (h.positive i _ ((A.chart i).mapsTo hi)) + +lemma laplacian_deform (g : KaehlerMetric A) (φ : SmoothRealFunction A) + (hp : g.PositivePotential φ) (x : X) : + ((g.deform φ hp).laplacian φ).value x = d-((g.deform φ hp).traceMetric g).value x := by + obtain ⟨i,hi⟩ := A.covers x + let H := (g.deform φ hp).matrix i (A.chart i x) + have hH : IsUnit H.det := isUnit_iff_ne_zero.mpr ((g.deform φ hp).positive i _ ((A.chart i).mapsTo hi)).det_pos.ne' + change (g.deform φ hp).laplacianValue φ x = (d:ℝ)-(g.deform φ hp).traceMetricValue g x + rw [(g.deform φ hp).laplacianValue_local φ i hi,(g.deform φ hp).traceMetricValue_local g i hi] + unfold linearizedMongeAmpere + have he : φ.hessian i (A.chart i x) = H-g.matrix i (A.chart i x) := by dsimp [H,deform]; abel + rw [he,mul_sub,Matrix.nonsing_inv_mul _ hH,trace_sub,Complex.sub_re,trace_one] + simp + +end Anticanonical.SourceSmooth.KaehlerMetric + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/KahlerCauchySchwarz.lean b/lean/OAI/Geometry/PrescribedRicci/KahlerCauchySchwarz.lean new file mode 100644 index 0000000000000000000000000000000000000000..f67988a48fa4bed5f71c0ad4e40f0d3bd157f6f4 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/KahlerCauchySchwarz.lean @@ -0,0 +1,113 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalSobolev +import OAI.Geometry.PrescribedPotential.SmoothPotentialDifference +import OAI.Geometry.PrescribedRicci.KahlerEnergyChain +import OAI.Geometry.PrescribedRicci.KahlerGreenIdentity +import OAI.Geometry.PrescribedRicci.MongeAmpereEnergy + +namespace OAI + +/-! Kahler Cauchy Schwarz. -/ + +section + + + +noncomputable section +open Matrix Filter Set Topology MeasureTheory +open scoped ContDiff ComplexOrder Classical +namespace Anticanonical.SourceSmooth +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +namespace KaehlerMetric + +lemma energy_realSMul_left (g : KaehlerMetric A) (ψ φ : SmoothRealFunction A) + (a : ℝ) (x : X) : (g.energy (ψ.realSMul a) φ).value x = a * (g.energy ψ φ).value x := by + change (g.energy (ψ.compose (fun t => a * t) (contDiff_const.mul contDiff_id)) φ).value x = _ + have hd : deriv (fun t => a * t) (ψ.value x) = a := by + simpa only [id_eq, mul_one] using ((hasDerivAt_id (ψ.value x)).const_mul a).deriv + rw [g.energy_comp_left, hd] + +lemma energy_constant_left (g : KaehlerMetric A) (φ : SmoothRealFunction A) (a : ℝ) (x : X) : + (g.energy (SmoothRealFunction.constant a) φ).value x = 0 := by + change (g.energy ((SmoothRealFunction.constant (A := A) 0).compose (fun _ => a) contDiff_const) φ).value x = _ + rw [g.energy_comp_left, deriv_const, zero_mul] + +variable [T2Space X] [CompactSpace X] + +lemma integral_laplacian (g : KaehlerMetric A) (φ : SmoothRealFunction A) : + g.integral (g.laplacian φ).value = 0 := by + have h := g.green_identity (SmoothRealFunction.constant 1) φ + have he : (g.energy (SmoothRealFunction.constant 1) φ).value = fun _ => 0 := + funext (g.energy_constant_left φ 1) + rw [he, g.integral_zero, neg_zero] at h + simpa only [SmoothRealFunction.constant, one_mul] using h + +lemma integral_cauchySchwarz (g : KaehlerMetric A) {f h : X → ℝ} + (hf : Continuous f) (hh : Continuous h) : + (g.integral (fun x => f x * h x)) ^ 2 ≤ + g.integral (fun x => f x ^ 2) * g.integral (fun x => h x ^ 2) := by + have hq (t : ℝ) : 0 ≤ g.integral (fun x => f x ^ 2) * (t*t) + + (2 * g.integral (fun x => f x * h x)) * t + g.integral (fun x => h x ^ 2) := by + calc + 0 ≤ g.integral (fun x => (t * f x + h x) ^ 2) := g.integral_nonneg (fun _ => sq_nonneg _) + _ = _ := by + have he : (fun x => (t*f x+h x)^2) = + fun x => (t*t) * (f x)^2 + (2*t) * (f x*h x) + (h x)^2 := by funext x; ring + rw [he, g.integral_add + (f := fun x => (t*t) * f x ^ 2 + (2*t) * (f x*h x)) + (h := fun x => h x ^ 2) + ((continuous_const.fun_mul (hf.pow 2)).fun_add (continuous_const.fun_mul (hf.fun_mul hh))) + (hh.pow 2), g.integral_add + (f := fun x => (t*t) * f x ^ 2) (h := fun x => (2*t) * (f x*h x)) + (continuous_const.fun_mul (hf.pow 2)) (continuous_const.fun_mul (hf.fun_mul hh)), + g.integral_const_mul, g.integral_const_mul] + ring + have hd := discrim_le_zero hq + unfold discrim at hd + nlinarith + +omit [T2Space X] [CompactSpace X] in +lemma energy_add_right (g : KaehlerMetric A) (φ ψ χ : SmoothRealFunction A) : + (g.energy φ (ψ.addFunction χ)).value = + fun x => (g.energy φ ψ).value x + (g.energy φ χ).value x := by + rw [g.energy_symm, g.energy_add_left, g.energy_symm ψ φ, g.energy_symm χ φ] + +omit [T2Space X] [CompactSpace X] in +lemma energy_realSMul_right (g : KaehlerMetric A) (ψ φ : SmoothRealFunction A) + (a : ℝ) (x : X) : (g.energy ψ (φ.realSMul a)).value x = a * (g.energy ψ φ).value x := by + rw [g.energy_symm, g.energy_realSMul_left, g.energy_symm φ ψ] + +lemma energy_cauchySchwarz (g : KaehlerMetric A) (φ ψ : SmoothRealFunction A) : + (g.integral (g.energy φ ψ).value) ^ 2 ≤ + g.integral (g.energy φ φ).value * g.integral (g.energy ψ ψ).value := by + have he (t : ℝ) (x : X) : + (g.energy ((φ.realSMul t).addFunction ψ) ((φ.realSMul t).addFunction ψ)).value x = + (t*t) * (g.energy φ φ).value x + (2*t) * (g.energy φ ψ).value x + (g.energy ψ ψ).value x := by + simp only [g.energy_add_left, g.energy_add_right, g.energy_realSMul_left, + g.energy_realSMul_right, g.energy_symm ψ φ] + ring + have hq (t : ℝ) : 0 ≤ g.integral (g.energy φ φ).value * (t*t) + + (2 * g.integral (g.energy φ ψ).value) * t + g.integral (g.energy ψ ψ).value := by + calc + 0 ≤ g.integral (g.energy ((φ.realSMul t).addFunction ψ) ((φ.realSMul t).addFunction ψ)).value := + g.integral_nonneg (g.energy_nonneg _) + _ = _ := by + rw [show (g.energy ((φ.realSMul t).addFunction ψ) ((φ.realSMul t).addFunction ψ)).value = + (fun x => (t*t) * (g.energy φ φ).value x + (2*t) * (g.energy φ ψ).value x + + (g.energy ψ ψ).value x) from funext (he t)] + rw [g.integral_add ((continuous_const.fun_mul (g.energy φ φ).continuous).fun_add + (continuous_const.fun_mul (g.energy φ ψ).continuous)) (g.energy ψ ψ).continuous, + g.integral_add (continuous_const.fun_mul (g.energy φ φ).continuous) + (continuous_const.fun_mul (g.energy φ ψ).continuous), g.integral_const_mul, g.integral_const_mul] + ring + have hd := discrim_le_zero hq + unfold discrim at hd + nlinarith + +end KaehlerMetric +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/KahlerChartGradient.lean b/lean/OAI/Geometry/PrescribedRicci/KahlerChartGradient.lean new file mode 100644 index 0000000000000000000000000000000000000000..772a31866cf50d90c8c1cc35c88b53ce084df2e3 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/KahlerChartGradient.lean @@ -0,0 +1,115 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.GlobalKahlerEnergy +import OAI.Geometry.PrescribedRicci.GlobalKahlerIntegral +import OAI.Geometry.PrescribedRicci.KahlerGradientCoercivity +import OAI.Geometry.PrescribedRicci.KahlerLocalL2Comparison + +namespace OAI + +/-! Kahler Chart Gradient. -/ + +section + + +noncomputable section +open Matrix Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory +open scoped ContDiff Classical +namespace Anticanonical.SourceSmooth.KaehlerMetric +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} + +omit [T2Space X] [CompactSpace X] in +lemma formEnergy_localized (g : KaehlerMetric A) (ψ : SmoothRealFunction A) + (i : Fin A.count) {z : Coordinates d} (hz : z ∈ (A.chart i).target) : + formEnergy (g.matrix i z) (fderiv ℝ (ψ.localized i) z) = + (g.energy ψ ψ).value ((A.chart i).symm z) := by + have he : ψ.localized i =ᶠ[𝓝 z] ψ.localExpression i := by + filter_upwards [(A.chart i).open_target.mem_nhds hz] with y hy using ψ.localized_eq hy + rw [he.fderiv_eq] + exact (g.energy_local ψ ψ i hz).symm + +omit [T2Space X] [CompactSpace X] in +lemma localized_gradient_pointwise (g : KaehlerMetric A) (i : Fin A.count) + (ψ : SmoothRealFunction A) {K : Set (Coordinates d)} + (ht : K ⊆ (A.chart i).target) (hqK : tsupport (ψ.localized i) ⊆ K) + {a v : ℝ} (hv : 0 ≤ v) + (hgrad : ∀ z ∈ K, ∀ L : Coordinates d →L[ℝ] ℝ, + a * ‖L‖ ^ 2 ≤ formEnergy (g.matrix i z) L) + (hvol : ∀ z ∈ K, v ≤ g.volumeCoefficient i z) (z : Coordinates d) : + (a*v) * ‖fderiv ℝ (ψ.localized i) z‖ ^ 2 ≤ + localizeFunction i (g.energy ψ ψ).value z * g.volumeCoefficient i z := by + by_cases hz : z ∈ tsupport (ψ.localized i) + · have hzK := hqK hz + have hzT := ht hzK + have hG := hgrad z hzK (fderiv ℝ (ψ.localized i) z) + rw [g.formEnergy_localized ψ i hzT] at hG + simp only [localizeFunction, ite_eq_left hzT] + calc + _ = v * (a * ‖fderiv ℝ (ψ.localized i) z‖^2) := by ring + _ ≤ v * (g.energy ψ ψ).value ((A.chart i).symm z) := mul_le_mul_of_nonneg_left hG hv + _ ≤ g.volumeCoefficient i z * (g.energy ψ ψ).value ((A.chart i).symm z) := + mul_le_mul_of_nonneg_right (hvol z hzK) (g.energy_nonneg ψ _) + _ = _ := mul_comm _ _ + · have hd : fderiv ℝ (ψ.localized i) z = 0 := + image_eq_zero_of_notMem_tsupport (fun hh => hz (tsupport_fderiv_subset ℝ hh)) + rw [hd, norm_zero, zero_pow (by omega : (2:ℕ) ≠ 0), mul_zero] + by_cases ht : z ∈ (A.chart i).target + · simp only [localizeFunction, ite_eq_left ht] + exact mul_nonneg (g.energy_nonneg ψ _) (g.volumeCoefficient_pos i ht).le + · simp only [localizeFunction, ite_eq_right ht, zero_mul, le_refl] + +lemma localized_gradient_integrable (ψ : SmoothRealFunction A) (i : Fin A.count) + (hψs : tsupport ψ.value ⊆ (A.chart i).source) : + Integrable (fun z : Coordinates d => ‖fderiv ℝ (ψ.localized i) z‖^2) := by + obtain ⟨hq,hqc,hqt⟩ := ψ.localized_smooth_compact i hψs + have hD : Continuous (fun z => ‖fderiv ℝ (ψ.localized i) z‖^2) := + (hq.continuous_fderiv (by simp)).norm.pow 2 + have hDc : HasCompactSupport (fun z => ‖fderiv ℝ (ψ.localized i) z‖^2) := + HasCompactSupport.comp_left (f := fderiv ℝ (ψ.localized i)) + (g := fun L : Coordinates d →L[ℝ] ℝ => ‖L‖^2) (hqc.fderiv ℝ) (by simp) + exact hD.integrable_of_hasCompactSupport hDc + +lemma localized_gradient_integral_le (g : KaehlerMetric A) (i : Fin A.count) + (ψ : SmoothRealFunction A) (hψs : tsupport ψ.value ⊆ (A.chart i).source) + {c : ℝ} (hc : 0 < c) + (hpoint : ∀ z : Coordinates d, c * ‖fderiv ℝ (ψ.localized i) z‖ ^ 2 ≤ + localizeFunction i (g.energy ψ ψ).value z * g.volumeCoefficient i z) : + (∫ z : Coordinates d, ‖fderiv ℝ (ψ.localized i) z‖ ^ 2) ≤ + c⁻¹ * g.integral (g.energy ψ ψ).value := by + have hEs : tsupport (g.energy ψ ψ).value ⊆ (A.chart i).source := + (g.energy_support ψ ψ).trans hψs + have hint := g.chart_weighted_integrable i (g.energy ψ ψ).continuous hEs + have hDi := localized_gradient_integrable ψ i hψs + have hh := MeasureTheory.integral_mono (hDi.const_mul c) hint hpoint + rw [MeasureTheory.integral_const_mul] at hh + have he : (∫ z, localizeFunction i (g.energy ψ ψ).value z * g.volumeCoefficient i z) = + g.integral (g.energy ψ ψ).value := by + rw [g.integral_chart i (g.energy ψ ψ).continuous hEs, g.chartIntegral_eq_localize] + rw [he] at hh + calc + _ = c⁻¹ * (c * ∫ z : Coordinates d, ‖fderiv ℝ (ψ.localized i) z‖ ^ 2) := by + rw [← mul_assoc, inv_mul_cancel₀ hc.ne', one_mul] + _ ≤ _ := mul_le_mul_of_nonneg_left hh (inv_pos.mpr hc).le + +lemma chart_gradient_L2_bound (g : KaehlerMetric A) (i : Fin A.count) + {K : Set X} (hK : IsCompact K) (hs : K ⊆ (A.chart i).source) : + ∃ C : ℝ, 0 < C ∧ ∀ ψ : SmoothRealFunction A, tsupport ψ.value ⊆ K → + (∫ z : Coordinates d, ‖fderiv ℝ (ψ.localized i) z‖ ^ 2) ≤ + C * g.integral (g.energy ψ ψ).value := by + let K' := (A.chart i) '' K + have hK' : IsCompact K' := hK.image_of_continuousOn ((A.chart i).continuousOn.mono hs) + have ht : K' ⊆ (A.chart i).target := by rintro z ⟨x,hx,rfl⟩; exact (A.chart i).mapsTo (hs hx) + obtain ⟨a,ha,hgrad⟩ := g.compact_gradient_coercivity i hK' ht + obtain ⟨v,b,hv,hb,hvol⟩ := g.compact_volume_bounds i hK' ht + refine ⟨(a*v)⁻¹, inv_pos.mpr (mul_pos ha hv), fun ψ hψ => ?_⟩ + have hqK : tsupport (ψ.localized i) ⊆ K' := + closure_minimal ((ψ.localized_support i).trans (image_mono hψ)) hK'.isClosed + apply g.localized_gradient_integral_le i ψ (hψ.trans hs) (mul_pos ha hv) + exact g.localized_gradient_pointwise i ψ ht hqK hv.le hgrad (fun z hz => (hvol z hz).1) + +end Anticanonical.SourceSmooth.KaehlerMetric + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/KahlerChartLp.lean b/lean/OAI/Geometry/PrescribedRicci/KahlerChartLp.lean new file mode 100644 index 0000000000000000000000000000000000000000..a56751ada6a1694c13b4c6f9a846b794bda955e9 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/KahlerChartLp.lean @@ -0,0 +1,91 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.GlobalKahlerIntegral +import OAI.Geometry.PrescribedRicci.KahlerLocalL2Comparison +import OAI.Geometry.PrescribedRicci.KahlerVolumeMeasure + +namespace OAI + +/-! Kahler Chart Lp. -/ + +section + + +noncomputable section +open Matrix Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory +open scoped ContDiff Classical NNReal ENNReal +namespace Anticanonical.SourceSmooth.KaehlerMetric +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} + +lemma chart_integral_upper (g : KaehlerMetric A) (i : Fin A.count) + {K : Set X} (hK : IsCompact K) (hs : K ⊆ (A.chart i).source) : + ∃ b : ℝ, 0 < b ∧ ∀ f : X → ℝ, Continuous f → (∀ x, 0 ≤ f x) → + tsupport f ⊆ K → g.integral f ≤ b * ∫ z : Coordinates d, localizeFunction i f z := by + let K' := (A.chart i) '' K + have hK' : IsCompact K' := hK.image_of_continuousOn ((A.chart i).continuousOn.mono hs) + have ht : K' ⊆ (A.chart i).target := by rintro z ⟨x,hx,rfl⟩; exact (A.chart i).mapsTo (hs hx) + obtain ⟨a,b,ha,hb,hab⟩ := g.compact_volume_bounds i hK' ht + refine ⟨b,hb,fun f hf hn hfs => ?_⟩ + have hss := hfs.trans hs + obtain ⟨hl,hc,hlt⟩ := localizeFunction_continuous_compact i hf hss + have hi : Integrable (localizeFunction i f) volume := hl.integrable_of_hasCompactSupport hc + have hwi := g.chart_weighted_integrable i hf hss + have hsup : Function.support (localizeFunction i f) ⊆ K' := + (localizeFunction_support i f).trans (image_mono hfs) + rw [g.integral_chart i hf hss, g.chartIntegral_eq_localize, ← MeasureTheory.integral_const_mul] + apply MeasureTheory.integral_mono hwi (hi.const_mul b) + intro z + by_cases hz : z ∈ Function.support (localizeFunction i f) + · have hp : 0 ≤ localizeFunction i f z := by + unfold localizeFunction + split_ifs <;> simp_all only [le_refl] + simpa only [mul_comm] using mul_le_mul_of_nonneg_left (hab z (hsup hz)).2 hp + · simp only [Function.notMem_support.mp hz, zero_mul, mul_zero, le_refl] + +omit [T2Space X] [CompactSpace X] in +lemma tsupport_norm_rpow {f : X → ℝ} {q : ℝ} (hq : 0 < q) : + tsupport (fun x => ‖f x‖ ^ q) ⊆ tsupport f := by + apply closure_minimal _ (isClosed_tsupport _) + intro x hx + apply subset_tsupport + intro hz + exact hx (by simp [hz, Real.zero_rpow hq.ne']) + +omit [T2Space X] [CompactSpace X] in +lemma localize_norm_rpow (i : Fin A.count) (f : X → ℝ) {q : ℝ} (hq : 0 < q) : + localizeFunction i (fun x => ‖f x‖ ^ q) = fun z => ‖localizeFunction i f z‖ ^ q := by + funext z + unfold localizeFunction + split_ifs <;> simp [Real.zero_rpow hq.ne'] + +variable [MeasurableSpace X] [BorelSpace X] +lemma chart_lpNorm_bound (g : KaehlerMetric A) (i : Fin A.count) + {K : Set X} (hK : IsCompact K) (hs : K ⊆ (A.chart i).source) : + ∃ b : ℝ, 0 < b ∧ ∀ (ψ : SmoothRealFunction A), tsupport ψ.value ⊆ K → + ∀ q : ℝ≥0, 0 < q → lpNorm ψ.value q g.volumeMeasure ≤ + b ^ (q : ℝ)⁻¹ * lpNorm (ψ.localized i) q volume := by + obtain ⟨b,hb,hbnd⟩ := g.chart_integral_upper i hK hs + refine ⟨b,hb,fun ψ hψ q hq => ?_⟩ + have hqR : (0:ℝ) < q := hq + have hc : Continuous (fun x => ‖ψ.value x‖ ^ (q:ℝ)) := + ψ.continuous.norm.rpow_const (fun _ => Or.inr hqR.le) + have hpow := hbnd (fun x => ‖ψ.value x‖ ^ (q:ℝ)) hc + (fun x => Real.rpow_nonneg (norm_nonneg _) _) ((tsupport_norm_rpow hqR).trans hψ) + rw [g.integral_volumeMeasure hc |>.symm, localize_norm_rpow i ψ.value hqR] at hpow + have hloc : localizeFunction i ψ.value = ψ.localized i := rfl + rw [hloc] at hpow + obtain ⟨hl,hcl,_⟩ := ψ.localized_smooth_compact i (hψ.trans hs) + rw [lpNorm_nnreal_eq_integral_norm_rpow hq.ne' ψ.continuous.aestronglyMeasurable, + lpNorm_nnreal_eq_integral_norm_rpow hq.ne' hl.continuous.aestronglyMeasurable] + calc + _ ≤ (b * ∫ z, ‖ψ.localized i z‖ ^ (q:ℝ)) ^ (q:ℝ)⁻¹ := + Real.rpow_le_rpow (MeasureTheory.integral_nonneg (fun x => Real.rpow_nonneg (norm_nonneg _) _)) hpow + (inv_nonneg.mpr hqR.le) + _ = _ := Real.mul_rpow hb.le (MeasureTheory.integral_nonneg (fun z => Real.rpow_nonneg (norm_nonneg _) _)) + +end Anticanonical.SourceSmooth.KaehlerMetric + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/KahlerCofactorDivergence.lean b/lean/OAI/Geometry/PrescribedRicci/KahlerCofactorDivergence.lean new file mode 100644 index 0000000000000000000000000000000000000000..10c0ec4803b6605bae5f6c661869173749428408 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/KahlerCofactorDivergence.lean @@ -0,0 +1,193 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.MatrixDifferentialNew + +namespace OAI + +/-! Kahler Cofactor Divergence. -/ + +noncomputable section +open Matrix Filter Set Topology +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth +namespace KaehlerMetric +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +abbrev coordinateVector (j : Fin d) : Coordinates d := Pi.single j 1 + +lemma pair_coordinate (M : Matrix (Fin d) (Fin d) ℂ) (j k : Fin d) : + star (coordinateVector j) ⬝ᵥ (M *ᵥ coordinateVector k) = M j k := by + change star (Pi.single j 1) ⬝ᵥ (M *ᵥ Pi.single k 1) = _ + rw [Pi.star_single, star_one, single_dotProduct, one_mul] + change M j ⬝ᵥ Pi.single k 1 = M j k + rw [dotProduct_single, mul_one] + +lemma fundamentalForm_coordinate (M : Matrix (Fin d) (Fin d) ℂ) (j k : Fin d) : + ComplexAtlas.fundamentalForm M (coordinateVector j) (coordinateVector k) = (M j k).im := by + simp only [ComplexAtlas.fundamentalForm, pair_coordinate] + +lemma fundamentalForm_I_coordinate (M : Matrix (Fin d) (Fin d) ℂ) (j k : Fin d) : + ComplexAtlas.fundamentalForm M (Complex.I • coordinateVector j) (coordinateVector k) = + -(M j k).re := by + simp only [ComplexAtlas.fundamentalForm, star_smul, smul_dotProduct, pair_coordinate] + simp [smul_eq_mul] + +lemma fundamentalForm_coordinate_I (M : Matrix (Fin d) (Fin d) ℂ) (j k : Fin d) : + ComplexAtlas.fundamentalForm M (coordinateVector j) (Complex.I • coordinateVector k) = + (M j k).re := by + simp only [ComplexAtlas.fundamentalForm, mulVec_smul, dotProduct_smul, pair_coordinate] + simp [smul_eq_mul] + +lemma fundamentalForm_I_I (M : Matrix (Fin d) (Fin d) ℂ) (j k : Fin d) : + ComplexAtlas.fundamentalForm M (Complex.I • coordinateVector j) + (Complex.I • coordinateVector k) = (M j k).im := by + simp only [ComplexAtlas.fundamentalForm, star_smul, mulVec_smul, smul_dotProduct, + dotProduct_smul, pair_coordinate] + simp [smul_eq_mul, Complex.mul_im] + +def fundamentalFormCLM (u v : Coordinates d) : Matrix (Fin d) (Fin d) ℂ →L[ℝ] ℝ := + LinearMap.toContinuousLinearMap + { toFun := fun M => ComplexAtlas.fundamentalForm M u v + map_add' := by + intro M N + exact fundamentalForm_add M N u v + map_smul' := by + intro c M + simp [ComplexAtlas.fundamentalForm, smul_mulVec, dotProduct_smul] } + +lemma fundamentalForm_fderiv (g : KaehlerMetric A) (i : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart i).target) (u v w : Coordinates d) : + fderiv ℝ (fun y => ComplexAtlas.fundamentalForm (g.matrix i y) v w) z u = + ComplexAtlas.fundamentalForm (fderiv ℝ (g.matrix i) z u) v w := by + have hg := ((g.smooth i).contDiffAt ((A.chart i).open_target.mem_nhds hz)).differentiableAt + (by simp) + exact congrArg (fun L : Coordinates d →L[ℝ] ℝ => L u) + (((fundamentalFormCLM v w).hasFDerivAt.comp z hg.hasFDerivAt).fderiv) + +lemma derivative_closed (g : KaehlerMetric A) (i : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart i).target) (u v w : Coordinates d) : + ComplexAtlas.fundamentalForm (fderiv ℝ (g.matrix i) z u) v w + + ComplexAtlas.fundamentalForm (fderiv ℝ (g.matrix i) z v) w u + + ComplexAtlas.fundamentalForm (fderiv ℝ (g.matrix i) z w) u v = 0 := by + simpa only [g.fundamentalForm_fderiv i hz] using g.closed i z hz u v w + +def conjugateTransposeCLM : Matrix (Fin d) (Fin d) ℂ →L[ℝ] Matrix (Fin d) (Fin d) ℂ := + LinearMap.toContinuousLinearMap + { toFun := Matrix.conjTranspose + map_add' := Matrix.conjTranspose_add + map_smul' := by intro c M; simp } + +lemma derivative_hermitian (g : KaehlerMetric A) (i : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart i).target) (u : Coordinates d) : + (fderiv ℝ (g.matrix i) z u).IsHermitian := by + have he : (fun y => (g.matrix i y)ᴴ) =ᶠ[nhds z] g.matrix i := by + filter_upwards [(A.chart i).open_target.mem_nhds hz] with y hy + exact (g.positive i y hy).isHermitian + have hg := ((g.smooth i).contDiffAt ((A.chart i).open_target.mem_nhds hz)).differentiableAt + (by simp) + have hd := congrArg (fun L : Coordinates d →L[ℝ] Matrix (Fin d) (Fin d) ℂ => L u) + he.fderiv_eq + have hs := ((conjugateTransposeCLM (d := d)).hasFDerivAt.comp z hg.hasFDerivAt).fderiv + have hs' : fderiv ℝ (fun y => (g.matrix i y)ᴴ) z u = + (fderiv ℝ (g.matrix i) z u)ᴴ := + congrArg (fun L : Coordinates d →L[ℝ] Matrix (Fin d) (Fin d) ℂ => L u) hs + exact hs'.symm.trans hd + +def barDerivative (f : Coordinates d → Matrix (Fin d) (Fin d) ℂ) + (z : Coordinates d) (j : Fin d) : Matrix (Fin d) (Fin d) ℂ := + (2 : ℂ)⁻¹ • (fderiv ℝ f z (coordinateVector j) + + Complex.I • fderiv ℝ f z (Complex.I • coordinateVector j)) + +lemma barDerivative_symm (g : KaehlerMetric A) (a : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart a).target) (i j k : Fin d) : + barDerivative (g.matrix a) z i j k = barDerivative (g.matrix a) z j i k := by + have h1 := g.derivative_closed a hz (coordinateVector i) (coordinateVector j) + (Complex.I • coordinateVector k) + have h2 := g.derivative_closed a hz (Complex.I • coordinateVector i) + (Complex.I • coordinateVector j) (Complex.I • coordinateVector k) + have h3 := g.derivative_closed a hz (coordinateVector i) (coordinateVector j) + (coordinateVector k) + have h4 := g.derivative_closed a hz (Complex.I • coordinateVector i) + (Complex.I • coordinateVector j) (coordinateVector k) + simp only [fundamentalForm_coordinate, fundamentalForm_I_coordinate, + fundamentalForm_coordinate_I, fundamentalForm_I_I] at h1 h2 h3 h4 + have hr := congrArg Complex.re ((g.derivative_hermitian a hz (coordinateVector j)).apply i k) + have hi := congrArg Complex.im ((g.derivative_hermitian a hz (coordinateVector j)).apply i k) + have hIr := congrArg Complex.re + ((g.derivative_hermitian a hz (Complex.I • coordinateVector j)).apply i k) + have hIi := congrArg Complex.im + ((g.derivative_hermitian a hz (Complex.I • coordinateVector j)).apply i k) + simp only [Complex.star_def, Complex.conj_re, Complex.conj_im] at hr hi hIr hIi + apply Complex.ext + · simp only [barDerivative, Matrix.smul_apply, Matrix.add_apply, smul_eq_mul, + Complex.mul_re, Complex.mul_im, Complex.add_re, Complex.add_im] + norm_num + linarith + · simp only [barDerivative, Matrix.smul_apply, Matrix.add_apply, smul_eq_mul, + Complex.mul_re, Complex.mul_im, Complex.add_re, Complex.add_im] + norm_num + linarith + +lemma barDerivative_comp {f : Coordinates d → Matrix (Fin d) (Fin d) ℂ} + {F : Matrix (Fin d) (Fin d) ℂ → Matrix (Fin d) (Fin d) ℂ} + {z : Coordinates d} (hf : DifferentiableAt ℝ f z) + (hF : DifferentiableAt ℂ F (f z)) (j : Fin d) : + barDerivative (F ∘ f) z j = fderiv ℂ F (f z) (barDerivative f z j) := by + have hd := ((hF.hasFDerivAt.restrictScalars ℝ).comp z hf.hasFDerivAt).fderiv + unfold barDerivative + have h1 := congrArg (fun L : Coordinates d →L[ℝ] Matrix (Fin d) (Fin d) ℂ => + L (coordinateVector j)) hd + have h2 := congrArg (fun L : Coordinates d →L[ℝ] Matrix (Fin d) (Fin d) ℂ => + L (Complex.I • coordinateVector j)) hd + calc + _ = (2 : ℂ)⁻¹ • (fderiv ℂ F (f z) (fderiv ℝ f z (coordinateVector j)) + + Complex.I • fderiv ℂ F (f z) (fderiv ℝ f z (Complex.I • coordinateVector j))) := + congrArg₂ (fun U V : Matrix (Fin d) (Fin d) ℂ => (2 : ℂ)⁻¹ • (U + Complex.I • V)) h1 h2 + _ = _ := by + simp only [map_smul (fderiv ℂ F (f z)), map_add (fderiv ℂ F (f z))] + +private lemma sum_swap_outer_inner (f : Fin d → Fin d → Fin d → ℂ) : + ∑ i, ∑ j, ∑ k, f i j k = ∑ k, ∑ j, ∑ i, f i j k := by + calc + _ = ∑ j, ∑ i, ∑ k, f i j k := Finset.sum_comm + _ = ∑ j, ∑ k, ∑ i, f i j k := by + apply Finset.sum_congr rfl + intro j _ + exact Finset.sum_comm + _ = _ := Finset.sum_comm + +lemma cofactor_cancellation (B : Matrix (Fin d) (Fin d) ℂ) + (C : Fin d → Matrix (Fin d) (Fin d) ℂ) + (hC : ∀ i j k, C i j k = C j i k) (k : Fin d) : + ∑ i, ((B * C i).trace * B k i - (B * C i * B) k i) = 0 := by + rw [Finset.sum_sub_distrib, sub_eq_zero] + simp only [Matrix.trace, Matrix.diag, Matrix.mul_apply, Finset.sum_mul] + rw [sum_swap_outer_inner] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + apply Finset.sum_congr rfl + intro l _ + rw [hC l i j] + ring + +theorem weightedInverse_divergence (g : KaehlerMetric A) (a : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart a).target) (k : Fin d) : + ∑ i, barDerivative (MongeAmpere.weightedInverse ∘ g.matrix a) z i k i = 0 := by + have hg := ((g.smooth a).contDiffAt ((A.chart a).open_target.mem_nhds hz)).differentiableAt + (by simp) + have hdet : IsUnit (g.matrix a z).det := + isUnit_iff_ne_zero.mpr (ne_of_gt (g.positive a z hz).det_pos) + simp only [barDerivative_comp hg (MongeAmpere.differentiableAt_weightedInverse _ hdet), + MongeAmpere.fderiv_weightedInverse_apply _ _ hdet, Matrix.smul_apply, + Matrix.sub_apply, smul_eq_mul] + rw [← Finset.mul_sum] + rw [cofactor_cancellation _ _ (g.barDerivative_symm a hz)] + exact mul_zero _ + +end KaehlerMetric +end Anticanonical.SourceSmooth + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/KahlerEnergyChain.lean b/lean/OAI/Geometry/PrescribedRicci/KahlerEnergyChain.lean new file mode 100644 index 0000000000000000000000000000000000000000..73ab14731ea71b89f8a3207576fd105adc60db6f --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/KahlerEnergyChain.lean @@ -0,0 +1,76 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.KahlerGradientEnergy +import OAI.Geometry.PrescribedRicci.GlobalKahlerEnergy + +namespace OAI + +/-! Kahler Energy Chain. -/ + +section + + +noncomputable section +open Matrix Filter Set Topology MeasureTheory +open scoped ContDiff ComplexOrder Classical +namespace Anticanonical.SourceSmooth +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +namespace SmoothRealFunction + +def compose (φ : SmoothRealFunction A) (F : ℝ → ℝ) (hF : ContDiff ℝ ∞ F) : + SmoothRealFunction A where + value x := F (φ.value x) + smooth i := hF.comp_contDiffOn (φ.smooth i) + +end SmoothRealFunction +namespace KaehlerMetric + +lemma holRealDeriv_comp {φ : Coordinates d → ℝ} {F : ℝ → ℝ} {z : Coordinates d} + (hφ : DifferentiableAt ℝ φ z) (hF : DifferentiableAt ℝ F (φ z)) : + holRealDeriv (F ∘ φ) z = fun j => ((deriv F (φ z) : ℝ) : ℂ) * holRealDeriv φ z j := by + funext j + unfold holRealDeriv + rw [(hF.hasDerivAt.comp_hasFDerivAt z hφ.hasFDerivAt).fderiv] + rw [map_smul] + rfl + +lemma gradientPair_real_smul_left (H : Matrix (Fin d) (Fin d) ℂ) + (p q : Fin d → ℂ) (a : ℝ) : + gradientPair H (fun i => (a : ℂ) * p i) q = (a : ℂ) * gradientPair H p q := by + simp only [gradientPair, star_mul, Complex.star_def, Complex.conj_ofReal, Finset.mul_sum] + apply Finset.sum_congr rfl + intro j _ + apply Finset.sum_congr rfl + intro i _ + ring + +lemma energy_comp_left (g : KaehlerMetric A) (ψ φ : SmoothRealFunction A) + (F : ℝ → ℝ) (hF : ContDiff ℝ ∞ F) (x : X) : + (g.energy (ψ.compose F hF) φ).value x = + deriv F (ψ.value x) * (g.energy ψ φ).value x := by + obtain ⟨i, hi⟩ := A.covers x + have hz := (A.chart i).mapsTo hi + have he := g.energy_local (ψ.compose F hF) φ i hz + have he' := g.energy_local ψ φ i hz + simp only [SmoothRealFunction.localExpression, Function.comp_apply, (A.chart i).left_inv hi] at he he' + rw [he, he'] + change (gradientPair _ (holRealDeriv (F ∘ ψ.localExpression i) _) _).re = _ + rw [holRealDeriv_comp (φ := ψ.localExpression i) (((ψ.smooth i).contDiffAt ((A.chart i).open_target.mem_nhds hz)).differentiableAt (by simp)) + (hF.differentiable (by simp) _), gradientPair_real_smul_left] + simp only [Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, zero_mul, sub_zero, + SmoothRealFunction.localExpression, Function.comp_apply, (A.chart i).left_inv hi] + +lemma energy_comp_self (g : KaehlerMetric A) (φ : SmoothRealFunction A) + (F : ℝ → ℝ) (hF : ContDiff ℝ ∞ F) (x : X) : + (g.energy (φ.compose F hF) (φ.compose F hF)).value x = + (deriv F (φ.value x)) ^ 2 * (g.energy φ φ).value x := by + rw [g.energy_comp_left, g.energy_symm φ (φ.compose F hF), g.energy_comp_left] + ring + +end KaehlerMetric +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/KahlerEnergyCutoff.lean b/lean/OAI/Geometry/PrescribedRicci/KahlerEnergyCutoff.lean new file mode 100644 index 0000000000000000000000000000000000000000..83b7c4132deae2fd3856d8c1916a4feed6851d82 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/KahlerEnergyCutoff.lean @@ -0,0 +1,69 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalSobolev +import OAI.Geometry.PrescribedRicci.KahlerEnergyProduct +import OAI.Geometry.PrescribedRicci.MongeAmpereEnergy + +namespace OAI + +/-! Kahler Energy Cutoff. -/ + +section + + + +noncomputable section +open Matrix Set Filter Topology MeasureTheory +open scoped ContDiff Classical +namespace Anticanonical.SourceSmooth.KaehlerMetric +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} + +omit [T2Space X] in +lemma cutoff_energy_bound (g : KaehlerMetric A) (ρ : SmoothRealFunction A) : + ∃ C : ℝ, 0 < C ∧ ∀ (φ : SmoothRealFunction A) (x : X), + (g.energy (ρ.product φ) (ρ.product φ)).value x ≤ + C * ((g.energy φ φ).value x + φ.value x ^ 2) := by + let F : C(X,ℝ) := ⟨ρ.value,ρ.continuous⟩ + let E : C(X,ℝ) := ⟨(g.energy ρ ρ).value,(g.energy ρ ρ).continuous⟩ + let C : ℝ := 2*(‖F‖^2+‖E‖+1) + have hC : 0 < C := by dsimp [C]; positivity + refine ⟨C,hC,fun φ x => ?_⟩ + have hF : ρ.value x ^ 2 ≤ ‖F‖^2 := by + have hh := F.norm_coe_le_norm x + have hs := (sq_le_sq₀ (norm_nonneg _) (norm_nonneg _)).2 hh + simpa only [Real.norm_eq_abs, sq_abs, F, ContinuousMap.coe_mk] using hs + have hE : (g.energy ρ ρ).value x ≤ ‖E‖ := by + exact (le_abs_self _).trans (by simpa only [Real.norm_eq_abs, E, ContinuousMap.coe_mk] using E.norm_coe_le_norm x) + have hcoefF : 2*ρ.value x^2 ≤ C := by dsimp [C]; nlinarith [norm_nonneg E] + have hcoefE : 2*(g.energy ρ ρ).value x ≤ C := by dsimp [C]; nlinarith [sq_nonneg ‖F‖] + calc + _ ≤ 2*ρ.value x^2*(g.energy φ φ).value x + 2*φ.value x^2*(g.energy ρ ρ).value x := + g.energy_product_le ρ φ x + _ = (2*ρ.value x^2)*(g.energy φ φ).value x + (2*(g.energy ρ ρ).value x)*φ.value x^2 := by ring + _ ≤ C*(g.energy φ φ).value x + C*φ.value x^2 := + add_le_add (mul_le_mul_of_nonneg_right hcoefF (g.energy_nonneg φ x)) + (mul_le_mul_of_nonneg_right hcoefE (sq_nonneg _)) + _ = _ := by ring + +lemma cutoff_integral_energy_bound (g : KaehlerMetric A) (ρ : SmoothRealFunction A) : + ∃ C : ℝ, 0 < C ∧ ∀ φ : SmoothRealFunction A, + g.integral (g.energy (ρ.product φ) (ρ.product φ)).value ≤ + C * (g.integral (g.energy φ φ).value + g.integral (fun x => φ.value x^2)) := by + obtain ⟨C,hC,hbound⟩ := g.cutoff_energy_bound ρ + refine ⟨C,hC,fun φ => ?_⟩ + have hh := g.integral_mono (g.energy (ρ.product φ) (ρ.product φ)).continuous + (continuous_const.fun_mul ((g.energy φ φ).continuous.fun_add (φ.continuous.pow 2))) (hbound φ) + rwa [g.integral_const_mul, g.integral_add (g.energy φ φ).continuous (φ.continuous.pow 2)] at hh + +omit [T2Space X] [CompactSpace X] in +lemma product_support_left (ρ φ : SmoothRealFunction A) : + tsupport (ρ.product φ).value ⊆ tsupport ρ.value := by + apply closure_minimal _ (isClosed_tsupport _) + exact (Function.support_mul_subset_left _ _).trans subset_closure + +end Anticanonical.SourceSmooth.KaehlerMetric + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/KahlerEnergyProduct.lean b/lean/OAI/Geometry/PrescribedRicci/KahlerEnergyProduct.lean new file mode 100644 index 0000000000000000000000000000000000000000..55637d50e1502e3335bd0e2e5c798f6aaf7aac01 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/KahlerEnergyProduct.lean @@ -0,0 +1,86 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.GlobalKahlerEnergy +import OAI.Geometry.PrescribedRicci.KahlerEnergyChain + +namespace OAI + +/-! Kahler Energy Product. -/ + +section + + +noncomputable section +open Matrix Set Filter Topology MeasureTheory +open scoped ContDiff ComplexOrder Classical +namespace Anticanonical.SourceSmooth.KaehlerMetric +variable {d : ℕ} + +lemma gradientPair_add_right (H : Matrix (Fin d) (Fin d) ℂ) (p q r : Fin d → ℂ) : + gradientPair H p (q+r) = gradientPair H p q + gradientPair H p r := by + simp [gradientPair, Pi.add_apply, mul_add, Finset.sum_add_distrib] + +lemma gradientPair_real_smul_right (H : Matrix (Fin d) (Fin d) ℂ) + (p q : Fin d → ℂ) (a : ℝ) : + gradientPair H p (fun i => (a : ℂ)*q i) = (a : ℂ)*gradientPair H p q := by + simp only [gradientPair, Finset.mul_sum] + apply Finset.sum_congr rfl + intro j _ + apply Finset.sum_congr rfl + intro i _ + ring + +lemma gradientPair_smul_self (H : Matrix (Fin d) (Fin d) ℂ) (p : Fin d → ℂ) (a : ℝ) : + (gradientPair H (fun i => (a:ℂ)*p i) (fun i => (a:ℂ)*p i)).re = + a^2 * (gradientPair H p p).re := by + rw [gradientPair_real_smul_left, gradientPair_real_smul_right] + simp only [Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, zero_mul, sub_zero] + ring + +lemma gradientPair_add_self_le (H : Matrix (Fin d) (Fin d) ℂ) (hH : H.PosDef) + (p q : Fin d → ℂ) : + (gradientPair H (p+q) (p+q)).re ≤ + 2 * (gradientPair H p p).re + 2 * (gradientPair H q q).re := by + have hh := gradientPair_self_nonneg H hH (p + fun i => ((-1:ℝ):ℂ)*q i) + simp only [gradientPair_add_left, gradientPair_add_right, + gradientPair_real_smul_left, gradientPair_real_smul_right, + Complex.add_re, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, + zero_mul, sub_zero] at hh ⊢ + nlinarith + +variable {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +lemma energy_product_le (g : KaehlerMetric A) (ψ φ : SmoothRealFunction A) (x : X) : + (g.energy (ψ.product φ) (ψ.product φ)).value x ≤ + 2 * ψ.value x ^ 2 * (g.energy φ φ).value x + + 2 * φ.value x ^ 2 * (g.energy ψ ψ).value x := by + obtain ⟨i,hi⟩ := A.covers x + have hz := (A.chart i).mapsTo hi + have he := g.energy_local (ψ.product φ) (ψ.product φ) i hz + have heψ := g.energy_local ψ ψ i hz + have heφ := g.energy_local φ φ i hz + simp only [SmoothRealFunction.localExpression, Function.comp_apply, + (A.chart i).left_inv hi] at he heψ heφ + rw [he,heψ,heφ] + have hd : holRealDeriv ((ψ.product φ).localExpression i) ((A.chart i) x) = + (fun j => (ψ.value x : ℂ) * holRealDeriv (φ.localExpression i) ((A.chart i) x) j) + + (fun j => (φ.value x : ℂ) * holRealDeriv (ψ.localExpression i) ((A.chart i) x) j) := by + funext j + change holRealDeriv (fun y => ψ.localExpression i y * φ.localExpression i y) _ j = _ + rw [holRealDeriv_mul (φ := ψ.localExpression i) (ψ := φ.localExpression i) (((ψ.smooth i).contDiffAt ((A.chart i).open_target.mem_nhds hz)).differentiableAt (by simp)) + (((φ.smooth i).contDiffAt ((A.chart i).open_target.mem_nhds hz)).differentiableAt (by simp))] + simp only [SmoothRealFunction.localExpression, Function.comp_apply, + (A.chart i).left_inv hi, Pi.add_apply] + change (gradientPair _ (holRealDeriv ((ψ.product φ).localExpression i) _) + (holRealDeriv ((ψ.product φ).localExpression i) _)).re ≤ _ + rw [hd] + have hh := gradientPair_add_self_le _ (g.positive i _ hz) + (fun j => (ψ.value x : ℂ)*holRealDeriv (φ.localExpression i) ((A.chart i) x) j) + (fun j => (φ.value x : ℂ)*holRealDeriv (ψ.localExpression i) ((A.chart i) x) j) + rw [gradientPair_smul_self,gradientPair_smul_self] at hh + simpa only [mul_assoc, SmoothRealFunction.localExpression] using hh + +end Anticanonical.SourceSmooth.KaehlerMetric + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/KahlerGradientCoercivity.lean b/lean/OAI/Geometry/PrescribedRicci/KahlerGradientCoercivity.lean new file mode 100644 index 0000000000000000000000000000000000000000..680ce9b89dbc704ab690028bc0fa7aa4a0295c32 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/KahlerGradientCoercivity.lean @@ -0,0 +1,145 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.KahlerGradientEnergy + +namespace OAI + +/-! Kahler Gradient Coercivity. -/ + +noncomputable section +open Matrix Set Filter Topology MeasureTheory +open scoped ContDiff ComplexOrder Classical Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth.KaehlerMetric +variable {d : ℕ} + +lemma holRealForm_injective : Function.Injective + (fun L : Coordinates d →L[ℝ] ℝ => fun j => holRealForm j L) := by + suffices hz : ∀ L : Coordinates d →L[ℝ] ℝ, (∀ j, holRealForm j L = 0) → L = 0 by + intro L M he + have hh := hz (L-M) (by intro j; simp only [map_sub]; exact sub_eq_zero.mpr (congrFun he j)) + exact sub_eq_zero.mp hh + intro L hL + have hre (j : Fin d) : L (coordinateVector j) = 0 := by + have hh := congrArg Complex.re (hL j) + simp [holRealForm] at hh + linarith + have him (j : Fin d) : L (Complex.I • coordinateVector j) = 0 := by + have hh := congrArg Complex.im (hL j) + simp [holRealForm] at hh + linarith + apply ContinuousLinearMap.ext + intro v + have he : v = ∑ j, ((v j).re • coordinateVector j + (v j).im • (Complex.I • coordinateVector j)) := by + ext k + simp only [coordinateVector, Finset.sum_apply, Pi.add_apply, Pi.smul_apply, smul_eq_mul, + Complex.real_smul, Pi.single_apply] + simp [mul_ite, Finset.sum_add_distrib] + rw [he, map_sum] + simp only [map_add, map_smul, hre, him, smul_zero, add_zero, Finset.sum_const_zero, + _root_.zero_apply] + +def formEnergy (H : Matrix (Fin d) (Fin d) ℂ) (L : Coordinates d →L[ℝ] ℝ) : ℝ := + (gradientPair H (fun j => holRealForm j L) (fun j => holRealForm j L)).re + +lemma formEnergy_pos (H : Matrix (Fin d) (Fin d) ℂ) (hH : H.PosDef) + (L : Coordinates d →L[ℝ] ℝ) (hL : L ≠ 0) : 0 < formEnergy H L := by + let p := fun j => holRealForm j L + have hp : p ≠ 0 := by + intro hh + apply hL + apply holRealForm_injective + funext j + change holRealForm j L = holRealForm j 0 + rw [map_zero] + exact congrFun hh j + have hps : star p ≠ 0 := by simpa using hp + have hh := hH.inv.re_dotProduct_pos hps + have he : gradientPair H p p = star (star p) ⬝ᵥ (H⁻¹ *ᵥ star p) := by + simp only [gradientPair, dotProduct, Matrix.mulVec, Pi.star_apply, star_star, Finset.mul_sum] + apply Finset.sum_congr rfl + intro j _ + apply Finset.sum_congr rfl + intro i _ + ring + change 0 < (gradientPair H p p).re + rw [he] + exact hh + +lemma formEnergy_smul (H : Matrix (Fin d) (Fin d) ℂ) (c : ℝ) + (L : Coordinates d →L[ℝ] ℝ) : formEnergy H (c • L) = c^2 * formEnergy H L := by + unfold formEnergy gradientPair + simp only [map_smul, Complex.real_smul, star_mul, Complex.star_def, Complex.conj_ofReal] + have he : (∑ j, ∑ i, H⁻¹ j i * (star ((c : ℂ) * holRealForm i L)) * ((c : ℂ) * holRealForm j L)) = + (c : ℂ)^2 * ∑ j, ∑ i, H⁻¹ j i * star (holRealForm i L) * holRealForm j L := by + simp only [star_mul, Complex.star_def, Complex.conj_ofReal, Finset.mul_sum] + apply Finset.sum_congr rfl + intro j _ + apply Finset.sum_congr rfl + intro i _ + ring + simp only [star_mul, Complex.star_def, Complex.conj_ofReal] at he + rw [he, ← Complex.ofReal_pow] + simp only [Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, zero_mul, sub_zero] + +variable {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +lemma continuousOn_formEnergy (g : KaehlerMetric A) (i : Fin A.count) : + ContinuousOn (fun z : Coordinates d × (Coordinates d →L[ℝ] ℝ) => formEnergy (g.matrix i z.1) z.2) + ((A.chart i).target ×ˢ Set.univ) := by + have hH : ContinuousOn (fun z => (g.matrix i z)⁻¹) (A.chart i).target := by + intro z hz + exact (MongeAmpere.contDiffAt_inv _ (ne_of_gt (g.positive i z hz).det_pos)).continuousAt.comp_continuousWithinAt + ((g.smooth i).continuousOn z hz) + unfold formEnergy gradientPair + apply Complex.continuous_re.comp_continuousOn + apply continuousOn_finsetSum + intro j _ + apply continuousOn_finsetSum + intro k _ + exact (((continuousOn_pi.mp (continuousOn_pi.mp hH j) k).comp continuous_fst.continuousOn + (fun z hz => hz.1)).mul ((holRealForm k).continuous.comp continuous_snd).star.continuousOn).mul + ((holRealForm j).continuous.comp continuous_snd).continuousOn + +lemma compact_gradient_coercivity (g : KaehlerMetric A) (i : Fin A.count) + {K : Set (Coordinates d)} (hK : IsCompact K) (hs : K ⊆ (A.chart i).target) : + ∃ a : ℝ, 0 < a ∧ ∀ z ∈ K, ∀ L : Coordinates d →L[ℝ] ℝ, + a * ‖L‖^2 ≤ formEnergy (g.matrix i z) L := by + let S : Set (Coordinates d × (Coordinates d →L[ℝ] ℝ)) := K ×ˢ Metric.sphere 0 1 + have hc : IsCompact S := hK.prod (isCompact_sphere 0 1) + have hcF := (g.continuousOn_formEnergy i).mono (show S ⊆ (A.chart i).target ×ˢ univ from + fun z hz => ⟨hs hz.1, mem_univ _⟩) + by_cases hn : S.Nonempty + · obtain ⟨⟨z₀,L₀⟩,hm,hlow⟩ := hc.exists_isMinOn hn hcF + have hL₀ : L₀ ≠ 0 := by + intro h + have := hm.2 + simp [h] at this + refine ⟨formEnergy (g.matrix i z₀) L₀, formEnergy_pos _ (g.positive i z₀ (hs hm.1)) L₀ hL₀, ?_⟩ + intro z hz L + by_cases hL : L = 0 + · simp [hL, formEnergy, gradientPair] + · have hnorm : 0 < ‖L‖ := norm_pos_iff.mpr hL + have hnL : ‖(‖L‖⁻¹ : ℝ) • L‖ = 1 := by + rw [norm_smul, Real.norm_eq_abs, abs_of_pos (inv_pos.mpr hnorm), inv_mul_cancel₀ hnorm.ne'] + have hh := hlow (show (z,(‖L‖⁻¹ : ℝ) • L) ∈ S from + ⟨hz, by simpa only [Metric.mem_sphere, dist_zero_right] using hnL⟩) + change formEnergy (g.matrix i z₀) L₀ ≤ formEnergy (g.matrix i z) ((‖L‖⁻¹ : ℝ) • L) at hh + rw [formEnergy_smul] at hh + have ht := mul_le_mul_of_nonneg_right hh (sq_nonneg ‖L‖) + have he : ‖L‖⁻¹ ^2 * formEnergy (g.matrix i z) L * ‖L‖^2 = formEnergy (g.matrix i z) L := by + calc + _ = formEnergy (g.matrix i z) L * (‖L‖⁻¹ ^2 * ‖L‖^2) := by ring + _ = _ := by rw [← mul_pow, inv_mul_cancel₀ hnorm.ne']; simp + rwa [he] at ht + · refine ⟨1,by norm_num,fun z hz L => ?_⟩ + by_cases hL : L = 0 + · simp [hL, formEnergy, gradientPair] + · have hnorm : 0 < ‖L‖ := norm_pos_iff.mpr hL + have hnL : ‖(‖L‖⁻¹ : ℝ) • L‖ = 1 := by + rw [norm_smul, Real.norm_eq_abs, abs_of_pos (inv_pos.mpr hnorm), inv_mul_cancel₀ hnorm.ne'] + exact (hn ⟨(z,(‖L‖⁻¹ : ℝ) • L),hz,by simpa only [Metric.mem_sphere, dist_zero_right] using hnL⟩).elim + +end Anticanonical.SourceSmooth.KaehlerMetric + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/KahlerGradientEnergy.lean b/lean/OAI/Geometry/PrescribedRicci/KahlerGradientEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..2b99c98cb0f930c616d39b747a3315f7100fca1f --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/KahlerGradientEnergy.lean @@ -0,0 +1,126 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.LocalKahlerEnergy + +namespace OAI + +/-! Kahler Gradient Energy. -/ + +noncomputable section +open Matrix Filter Set Topology MeasureTheory +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise Classical +namespace Anticanonical.SourceSmooth.KaehlerMetric +variable {d : ℕ} + +lemma barDeriv_congr {f h : Coordinates d → ℂ} {z : Coordinates d} + (he : f =ᶠ[𝓝 z] h) (i : Fin d) : barDeriv f z i = barDeriv h z i := by + unfold barDeriv + rw [he.fderiv_eq] + +lemma barDeriv_add {f h : Coordinates d → ℂ} {z : Coordinates d} + (hf : DifferentiableAt ℝ f z) (hh : DifferentiableAt ℝ h z) (i : Fin d) : + barDeriv (fun y => f y + h y) z i = barDeriv f z i + barDeriv h z i := by + unfold barDeriv + rw [fderiv_fun_add hf hh] + simp only [_root_.add_apply] + ring + +lemma barDeriv_ofReal {φ : Coordinates d → ℝ} {z : Coordinates d} + (hφ : DifferentiableAt ℝ φ z) (i : Fin d) : + barDeriv (fun y => (φ y : ℂ)) z i = star (holRealDeriv φ z i) := by + have hd := (Complex.ofRealCLM.hasFDerivAt.comp z hφ.hasFDerivAt).fderiv + change fderiv ℝ (fun y => (φ y : ℂ)) z = _ at hd + unfold barDeriv holRealDeriv holRealForm + rw [hd] + apply Complex.ext <;> simp + +lemma holRealDeriv_mul {φ ψ : Coordinates d → ℝ} {z : Coordinates d} + (hφ : DifferentiableAt ℝ φ z) (hψ : DifferentiableAt ℝ ψ z) (j : Fin d) : + holRealDeriv (fun y => φ y * ψ y) z j = + (φ z : ℂ) * holRealDeriv ψ z j + (ψ z : ℂ) * holRealDeriv φ z j := by + unfold holRealDeriv + rw [fderiv_fun_mul hφ hψ, map_add, map_smul, map_smul] + simp only [Complex.real_smul] + +lemma potentialMatrix_mul {φ ψ : Coordinates d → ℝ} {z : Coordinates d} + (hφ : ContDiffAt ℝ ∞ φ z) (hψ : ContDiffAt ℝ ∞ ψ z) (i j : Fin d) : + PotentialKaehler.potentialMatrix (fun y => φ y * ψ y) z i j = + (φ z : ℂ) * PotentialKaehler.potentialMatrix ψ z i j + + (ψ z : ℂ) * PotentialKaehler.potentialMatrix φ z i j + + star (holRealDeriv φ z i) * holRealDeriv ψ z j + + star (holRealDeriv ψ z i) * holRealDeriv φ z j := by + rw [← barDeriv_holRealDeriv (hφ.mul hψ)] + have hev : (fun y => holRealDeriv (fun w => φ w * ψ w) y j) =ᶠ[𝓝 z] + fun y => (φ y : ℂ) * holRealDeriv ψ y j + (ψ y : ℂ) * holRealDeriv φ y j := by + filter_upwards [(hφ.of_le (show (1 : ℕ∞ω) ≤ ∞ by simp)).eventually (by simp), + (hψ.of_le (show (1 : ℕ∞ω) ≤ ∞ by simp)).eventually (by simp)] with y hyφ hyψ + exact holRealDeriv_mul (hyφ.differentiableAt (by simp)) (hyψ.differentiableAt (by simp)) j + rw [barDeriv_congr hev] + have hdφ := hφ.differentiableAt (by simp) + have hdψ := hψ.differentiableAt (by simp) + have hcφ : DifferentiableAt ℝ (fun y => (φ y : ℂ)) z := + Complex.ofRealCLM.differentiableAt.comp z hdφ + have hcψ : DifferentiableAt ℝ (fun y => (ψ y : ℂ)) z := + Complex.ofRealCLM.differentiableAt.comp z hdψ + have hhφ := (contDiffAt_holRealDeriv hφ j).differentiableAt (by simp) + have hhψ := (contDiffAt_holRealDeriv hψ j).differentiableAt (by simp) + rw [barDeriv_add (hcφ.fun_mul hhψ) (hcψ.fun_mul hhφ), + barDeriv_mul hcφ hhψ, barDeriv_mul hcψ hhφ, + barDeriv_ofReal hdφ, barDeriv_ofReal hdψ, + barDeriv_holRealDeriv hψ, barDeriv_holRealDeriv hφ] + ring + +def gradientPair (H : Matrix (Fin d) (Fin d) ℂ) (p q : Fin d → ℂ) : ℂ := + ∑ j, ∑ i, H⁻¹ j i * star (p i) * q j + +lemma gradientPair_star (H : Matrix (Fin d) (Fin d) ℂ) (hH : H.IsHermitian) + (p q : Fin d → ℂ) : star (gradientPair H p q) = gradientPair H q p := by + have hi := hH.inv + unfold gradientPair + simp only [star_sum, star_mul, star_star] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro j _ + apply Finset.sum_congr rfl + intro i _ + have he : star (H⁻¹ i j) = H⁻¹ j i := congrFun (congrFun hi.eq j) i + rw [he] + ring + +lemma gradientPair_self_nonneg (H : Matrix (Fin d) (Fin d) ℂ) (hH : H.PosDef) + (p : Fin d → ℂ) : 0 ≤ (gradientPair H p p).re := by + have hp := hH.inv.posSemidef.dotProduct_mulVec_nonneg (star p) + have he : gradientPair H p p = star (star p) ⬝ᵥ (H⁻¹ *ᵥ star p) := by + simp only [gradientPair, dotProduct, Matrix.mulVec, Pi.star_apply, star_star, Finset.mul_sum] + apply Finset.sum_congr rfl + intro j _ + apply Finset.sum_congr rfl + intro i _ + ring + rw [he] + exact (Complex.nonneg_iff.mp hp).1 + +lemma trace_hessian_product {φ ψ : Coordinates d → ℝ} {z : Coordinates d} + (hφ : ContDiffAt ℝ ∞ φ z) (hψ : ContDiffAt ℝ ∞ ψ z) + (H : Matrix (Fin d) (Fin d) ℂ) (hH : H.IsHermitian) : + ((H⁻¹ * PotentialKaehler.potentialMatrix (fun y => φ y * ψ y) z).trace).re = + φ z * ((H⁻¹ * PotentialKaehler.potentialMatrix ψ z).trace).re + + ψ z * ((H⁻¹ * PotentialKaehler.potentialMatrix φ z).trace).re + + 2 * (gradientPair H (holRealDeriv φ z) (holRealDeriv ψ z)).re := by + have he : (H⁻¹ * PotentialKaehler.potentialMatrix (fun y => φ y * ψ y) z).trace = + (φ z : ℂ) * (H⁻¹ * PotentialKaehler.potentialMatrix ψ z).trace + + (ψ z : ℂ) * (H⁻¹ * PotentialKaehler.potentialMatrix φ z).trace + + gradientPair H (holRealDeriv φ z) (holRealDeriv ψ z) + + gradientPair H (holRealDeriv ψ z) (holRealDeriv φ z) := by + simp only [Matrix.trace, Matrix.diag, Matrix.mul_apply, potentialMatrix_mul hφ hψ, + gradientPair, Finset.mul_sum, mul_add, Finset.sum_add_distrib] + simp only [mul_assoc, mul_left_comm, mul_comm] + rw [he, ← gradientPair_star H hH] + simp only [Complex.add_re, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, + zero_mul, sub_zero, Complex.star_def, Complex.conj_re] + ring + +end Anticanonical.SourceSmooth.KaehlerMetric + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/KahlerGreenIdentity.lean b/lean/OAI/Geometry/PrescribedRicci/KahlerGreenIdentity.lean new file mode 100644 index 0000000000000000000000000000000000000000..1412bc414951de98bcfaa1f027c9c15b787a6850 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/KahlerGreenIdentity.lean @@ -0,0 +1,99 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.GlobalKahlerIntegral +import OAI.Geometry.PrescribedRicci.IntegratedKahlerEnergy +import OAI.Geometry.PrescribedRicci.KahlerGradientEnergy + +namespace OAI + +/-! Kahler Green Identity. -/ + +section + + + +noncomputable section +open Matrix Filter Set Topology MeasureTheory +open scoped ContDiff ComplexOrder Classical +namespace Anticanonical.SourceSmooth +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +namespace KaehlerMetric + +lemma holRealDeriv_sum {ι : Type*} (s : Finset ι) {f : ι → Coordinates d → ℝ} + {z : Coordinates d} (hf : ∀ k ∈ s, DifferentiableAt ℝ (f k) z) : + holRealDeriv (fun y => ∑ k ∈ s, f k y) z = fun j => ∑ k ∈ s, holRealDeriv (f k) z j := by + funext j + unfold holRealDeriv + rw [fderiv_fun_sum hf, map_sum] + +lemma gradientPair_sum_left {ι : Type*} (s : Finset ι) (H : Matrix (Fin d) (Fin d) ℂ) + (p : ι → Fin d → ℂ) (q : Fin d → ℂ) : + gradientPair H (fun j => ∑ k ∈ s, p k j) q = ∑ k ∈ s, gradientPair H (p k) q := by + simp only [gradientPair, star_sum, Finset.mul_sum, Finset.sum_mul] + simp_rw [Finset.sum_comm (s := Finset.univ) (t := s)] + +lemma energy_partition [T2Space X] [CompactSpace X] (g : KaehlerMetric A) + (ψ φ : SmoothRealFunction A) (x : X) : + ∑ i, (g.energy ((chartPartition i).product ψ) φ).value x = (g.energy ψ φ).value x := by + obtain ⟨a, ha⟩ := A.covers x + have hz := (A.chart a).mapsTo ha + have he (i : Fin A.count) := g.energy_local ((chartPartition i).product ψ) φ a hz + have he' := g.energy_local ψ φ a hz + simp only [SmoothRealFunction.localExpression, Function.comp_apply, (A.chart a).left_inv ha] at he he' + simp_rw [he, he', ← Complex.re_sum] + rw [← gradientPair_sum_left] + have hs : (fun y => ∑ i, ((chartPartition i).product ψ).localExpression a y) = ψ.localExpression a := by + funext y + change (∑ i, (chartPartition i).value ((A.chart a).symm y) * ψ.value ((A.chart a).symm y)) = _ + rw [← Finset.sum_mul, chartPartition_sum, one_mul] + rfl + have hd := holRealDeriv_sum Finset.univ + (f := fun i => ((chartPartition i).product ψ).localExpression a) + (fun i _ => ((((chartPartition i).product ψ).smooth a).contDiffAt + ((A.chart a).open_target.mem_nhds hz)).differentiableAt (by simp)) + rw [hs] at hd + exact congrArg (fun p => (gradientPair (g.matrix a (A.chart a x)) p + (holRealDeriv (φ.value ∘ (A.chart a).symm) (A.chart a x))).re) hd.symm + + +theorem green_identity [T2Space X] [CompactSpace X] (g : KaehlerMetric A) + (ψ φ : SmoothRealFunction A) : + g.integral (fun x => ψ.value x * (g.laplacian φ).value x) = + -g.integral (g.energy ψ φ).value := by + have hs (i : Fin A.count) : tsupport ((chartPartition i).product ψ).value ⊆ (A.chart i).source := + tsupport_mul_subset_left.trans (chartPartition_support i) + have he (i : Fin A.count) : + g.chartIntegral i (fun x => (chartPartition i).value x * (ψ.value x * (g.laplacian φ).value x)) = + -g.integral (g.energy ((chartPartition i).product ψ) φ).value := by + rw [g.integral_chart i (g.energy ((chartPartition i).product ψ) φ).continuous + ((g.energy_support _ _).trans (hs i))] + have hh := g.chart_energy_identity ((chartPartition i).product ψ) φ i (hs i) + convert hh using 1 + congr 1 + funext x + change _ = ((chartPartition i).value x * ψ.value x) * (g.laplacian φ).value x + ring + change (∑ i, g.chartIntegral i (fun x => (chartPartition i).value x * + (ψ.value x * (g.laplacian φ).value x))) = _ + simp_rw [he] + rw [Finset.sum_neg_distrib, ← g.integral_sum Finset.univ _ + (fun i _ => (g.energy ((chartPartition i).product ψ) φ).continuous)] + simp_rw [g.energy_partition ψ φ] + +lemma integral_laplacian_mul_symm [T2Space X] [CompactSpace X] (g : KaehlerMetric A) + (ψ φ : SmoothRealFunction A) : + g.integral (fun x => ψ.value x * (g.laplacian φ).value x) = + g.integral (fun x => φ.value x * (g.laplacian ψ).value x) := by + rw [g.green_identity, g.green_identity, g.energy_symm] + +lemma integral_laplacian_self_nonpos [T2Space X] [CompactSpace X] (g : KaehlerMetric A) + (φ : SmoothRealFunction A) : g.integral (fun x => φ.value x * (g.laplacian φ).value x) ≤ 0 := by + rw [g.green_identity] + exact neg_nonpos.mpr (g.integral_nonneg (g.energy_nonneg φ)) + +end KaehlerMetric +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/KahlerIntegralPos.lean b/lean/OAI/Geometry/PrescribedRicci/KahlerIntegralPos.lean new file mode 100644 index 0000000000000000000000000000000000000000..7d56a352a6457e50566dd33d295abbe9a2646d65 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/KahlerIntegralPos.lean @@ -0,0 +1,81 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.GlobalKahlerIntegral +import OAI.Geometry.PrescribedRicci.KahlerLocalL2Comparison +import OAI.Geometry.PrescribedRicci.KahlerVolumeMeasure + +namespace OAI + +/-! Kahler Integral Pos. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory +open scoped ContDiff Classical +namespace Anticanonical.SourceSmooth.KaehlerMetric +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} + +lemma integral_pos (g : KaehlerMetric A) {f : X → ℝ} (hf : Continuous f) + (hn : ∀ x, 0 ≤ f x) {x : X} (hx : 0 < f x) : 0 < g.integral f := by + obtain ⟨i,hi⟩ : ∃ i : Fin A.count, 0 < (chartPartition i).value x := by + by_contra! hh + have hsum := Finset.sum_nonpos (s:=Finset.univ) (f:=fun i : Fin A.count => (chartPartition i).value x) (fun i _ => hh i) + rw [chartPartition_sum] at hsum + linarith + let F : X → ℝ := fun y => (chartPartition i).value y * f y + have hF : Continuous F := (chartPartition i).continuous.fun_mul hf + have hFs : tsupport F ⊆ (A.chart i).source := tsupport_mul_subset_left.trans (chartPartition_support i) + obtain ⟨hl,hc,ht⟩ := localizeFunction_continuous_compact i hF hFs + let H : Coordinates d → ℝ := fun z => localizeFunction i F z * g.volumeCoefficient i z + have hH : Continuous H := continuous_real_mul_on_tsupport hl (fun z hz => + ((g.volumeCoefficient_smooth i).continuousOn z (ht hz)).continuousAt ((A.chart i).open_target.mem_nhds (ht hz))) + have hHn (z : Coordinates d) : 0 ≤ H z := by + by_cases hz : z ∈ (A.chart i).target + · dsimp [H,localizeFunction]; rw [ite_eq_left hz] + exact mul_nonneg (mul_nonneg (chartPartition_nonneg i _) (hn _)) (g.volumeCoefficient_pos i hz).le + · simp [H,localizeFunction,hz] + have hxs : x ∈ (A.chart i).source := chartPartition_support i (subset_tsupport _ (ne_of_gt hi)) + have hz := (A.chart i).mapsTo hxs + have hHx : 0 < H ((A.chart i) x) := by + dsimp only [H,localizeFunction] + rw [ite_eq_left hz,(A.chart i).left_inv hxs] + exact mul_pos (mul_pos hi hx) (g.volumeCoefficient_pos i hz) + have hI : 0 < g.chartIntegral i F := by + rw [g.chartIntegral_eq_localize] + exact hH.integral_pos_of_hasCompactSupport_nonneg_nonzero hc.mul_right hHn (ne_of_gt hHx) + apply hI.trans_le + change g.chartIntegral i F ≤ ∑ j, g.chartIntegral j (fun y => (chartPartition j).value y*f y) + apply Finset.single_le_sum (f:=fun j : Fin A.count => g.chartIntegral j (fun y => (chartPartition j).value y*f y)) _ (Finset.mem_univ i) + intro j _ + apply setIntegral_nonneg (A.chart j).open_target.measurableSet + intro z hz + exact mul_nonneg (mul_nonneg (chartPartition_nonneg j _) (hn _)) (g.volumeCoefficient_pos j hz).le + +variable [MeasurableSpace X] [BorelSpace X] + +instance volumeMeasure_openPos (g : KaehlerMetric A) : g.volumeMeasure.IsOpenPosMeasure where + open_pos U hU hUn := by + obtain ⟨x,hx⟩ := hUn + obtain ⟨f,hf1,_,hfs,hfn⟩ := exists_continuousMap_one_of_isCompact_subset_isOpen + (isCompact_singleton (x:=x)) hU (singleton_subset_iff.mpr hx) + have hpos := g.integral_pos f.continuous (fun y => (hfn y).1) + (show 0 < f x by rw [hf1 (mem_singleton x)]; norm_num) + intro hzero + have hae : f =ᵐ[g.volumeMeasure] (fun _ => (0:ℝ)) := by + apply ae_iff.mpr + apply measure_mono_null _ hzero + intro y hy + exact hfs (subset_tsupport f hy) + have hz : g.integral f = 0 := by + rw [← g.integral_volumeMeasure f.continuous, integral_congr_ae hae, MeasureTheory.integral_zero] + linarith + +end Anticanonical.SourceSmooth.KaehlerMetric + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/KahlerIntegration.lean b/lean/OAI/Geometry/PrescribedRicci/KahlerIntegration.lean new file mode 100644 index 0000000000000000000000000000000000000000..f6744619bde20064e6c4df825b4929173961e1b9 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/KahlerIntegration.lean @@ -0,0 +1,157 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.AnalyticSupport +import OAI.Geometry.PrescribedPotential.AtlasLocalization +import OAI.Geometry.PrescribedPotential.VolumePath + +namespace OAI + +/-! Kahler Integration. -/ + +section + + + +noncomputable section +open Matrix Filter Set Topology MeasureTheory +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise Classical +namespace Anticanonical +namespace ComplexAtlas +variable {d : ℕ} {X : Type*} [TopologicalSpace X] (A : ComplexAtlas d X) + +def transitionHomeomorph (i j : Fin A.count) : + OpenPartialHomeomorph (Coordinates d) (Coordinates d) := + (A.chart i).symm.trans (A.chart j) + +lemma transitionHomeomorph_source (i j : Fin A.count) : + (A.transitionHomeomorph i j).source = coordinateOverlap (A.chart i) (A.chart j) := rfl + +lemma transition_fderiv_det (i j : Fin A.count) {z : Coordinates d} + (hz : z ∈ coordinateOverlap (A.chart i) (A.chart j)) : + |(fderiv ℝ (A.transition i j) z).det| = + ‖A.jacobian i j ((A.chart i).symm z)‖ ^ 2 := by + have hd := (A.holomorphic i j).differentiableAt + ((A.isOpen_coordinateOverlap i j).mem_nhds hz) + change DifferentiableAt ℂ (A.transition i j) z at hd + rw [hd.fderiv_restrictScalars ℝ] + simp only [ContinuousLinearMap.det, ContinuousLinearMap.coe_restrictScalars, + LinearMap.det_restrictScalars, Algebra.norm_complex_eq, jacobian, (A.chart i).right_inv hz.1, + LinearMap.det_toMatrix'] + change |Complex.normSq _| = _ + rw [Complex.normSq_eq_norm_sq, abs_of_nonneg (sq_nonneg _)] + +lemma transition_hasFDerivAt (i j : Fin A.count) {z : Coordinates d} + (hz : z ∈ (A.transitionHomeomorph i j).source) : + HasFDerivAt (A.transitionHomeomorph i j) (fderiv ℝ (A.transition i j) z) z := + ((A.real_smooth_transition i j).contDiffAt + ((A.isOpen_coordinateOverlap i j).mem_nhds hz)).differentiableAt (by simp) |>.hasFDerivAt + +end ComplexAtlas +namespace SourceSmooth +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +namespace SmoothRealFunction + +def product (φ ψ : SmoothRealFunction A) : SmoothRealFunction A where + value x := φ.value x * ψ.value x + smooth i := (φ.smooth i).mul (ψ.smooth i) + + + +def localized (φ : SmoothRealFunction A) (i : Fin A.count) (z : Coordinates d) : ℝ := + if z ∈ (A.chart i).target then φ.localExpression i z else 0 + +lemma localized_eq {φ : SmoothRealFunction A} {i : Fin A.count} {z : Coordinates d} + (hz : z ∈ (A.chart i).target) : φ.localized i z = φ.localExpression i z := ite_eq_left hz + +lemma localized_support (φ : SmoothRealFunction A) (i : Fin A.count) : + Function.support (φ.localized i) ⊆ (A.chart i) '' tsupport φ.value := by + intro z hz + change φ.localized i z ≠ 0 at hz + by_cases ht : z ∈ (A.chart i).target + · have hh : φ.value ((A.chart i).symm z) ≠ 0 := by + simpa only [localized_eq ht, localExpression, Function.comp_apply] using hz + exact ⟨(A.chart i).symm z, subset_tsupport _ hh, (A.chart i).right_inv ht⟩ + · exact (hz (ite_eq_right ht)).elim + +lemma localized_smooth_compact [T2Space X] [CompactSpace X] + (φ : SmoothRealFunction A) (i : Fin A.count) + (hφ : tsupport φ.value ⊆ (A.chart i).source) : + ContDiff ℝ ∞ (φ.localized i) ∧ HasCompactSupport (φ.localized i) ∧ + tsupport (φ.localized i) ⊆ (A.chart i).target := by + let e := A.chart i + let K := e '' tsupport φ.value + have hK : IsCompact K := (isClosed_tsupport _).isCompact.image_of_continuousOn + (e.continuousOn.mono hφ) + have hs : Function.support (φ.localized i) ⊆ K := φ.localized_support i + have hts : tsupport (φ.localized i) ⊆ K := closure_minimal hs hK.isClosed + refine ⟨?_, HasCompactSupport.of_support_subset_isCompact hK hs, ?_⟩ + · rw [contDiff_iff_contDiffAt] + intro z + by_cases hz : z ∈ e.target + · apply ((φ.smooth i).contDiffAt (e.open_target.mem_nhds hz)).congr_of_eventuallyEq + filter_upwards [e.open_target.mem_nhds hz] with y hy using φ.localized_eq hy + · have hzK : z ∉ K := by + rintro ⟨x, hx, rfl⟩ + exact hz (e.mapsTo (hφ hx)) + apply (contDiffAt_const (c := (0 : ℝ))).congr_of_eventuallyEq + filter_upwards [hK.isClosed.isOpen_compl.mem_nhds hzK] with y hy + exact Function.notMem_support.mp (fun h => hy (hs h)) + · rintro z hz + obtain ⟨x, hx, rfl⟩ := hts hz + exact e.mapsTo (hφ hx) + +end SmoothRealFunction +namespace KaehlerMetric + +def chartIntegral (g : KaehlerMetric A) (i : Fin A.count) (f : X → ℝ) : ℝ := + ∫ z in (A.chart i).target, f ((A.chart i).symm z) * g.volumeCoefficient i z + + + +theorem chartIntegral_eq (g : KaehlerMetric A) (i j : Fin A.count) (f : X → ℝ) + (hi : Function.support f ⊆ (A.chart i).source) + (hj : Function.support f ⊆ (A.chart j).source) : + g.chartIntegral i f = g.chartIntegral j f := by + let e := A.transitionHomeomorph i j + have hs (a b : Fin A.count) (hb : Function.support f ⊆ (A.chart b).source) : + (∫ z in (A.transitionHomeomorph a b).source, + f ((A.chart a).symm z) * g.volumeCoefficient a z) = g.chartIntegral a f := by + symm + apply setIntegral_eq_of_subset_of_forall_sdiff_eq_zero (A.chart a).open_target.measurableSet + (fun _ h => h.1) + intro z hz + have hn : (A.chart a).symm z ∉ (A.chart b).source := by + intro h + exact hz.2 ⟨hz.1, h⟩ + have hf : f ((A.chart a).symm z) = 0 := Function.notMem_support.mp (fun h => hn (hb h)) + rw [hf, zero_mul] + rw [← hs i j hj, ← hs j i hi] + have heq := integral_target_eq_integral_abs_det_fderiv_smul (μ := (volume : Measure (Coordinates d))) + (f := e) (f' := fun z => fderiv ℝ (A.transition i j) z) + (fun z hz => A.transition_hasFDerivAt i j hz) + (fun z => f ((A.chart j).symm z) * g.volumeCoefficient j z) + have htarget : e.target = (A.transitionHomeomorph j i).source := by + ext z + rfl + rw [htarget] at heq + rw [heq] + apply setIntegral_congr_fun e.open_source.measurableSet + intro z hz + have hzi : (A.chart i).symm z ∈ (A.chart i).source := (A.chart i).mapsTo_symm hz.1 + have hzj : (A.chart i).symm z ∈ (A.chart j).source := hz.2 + have hc := g.volumeCoefficient_compatibility i j hzi hzj + rw [(A.chart i).right_inv hz.1] at hc + change f ((A.chart i).symm z) * g.volumeCoefficient i z = + |(fderiv ℝ (A.transition i j) z).det| * + (f ((A.chart j).symm (A.chart j ((A.chart i).symm z))) * + g.volumeCoefficient j (A.chart j ((A.chart i).symm z))) + rw [A.transition_fderiv_det i j hz, (A.chart j).left_inv hzj, hc] + ring + +end KaehlerMetric +end SourceSmooth +end Anticanonical + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/KahlerL2Comparison.lean b/lean/OAI/Geometry/PrescribedRicci/KahlerL2Comparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..8455c11cb625eeabed5e6a1be1250287661712da --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/KahlerL2Comparison.lean @@ -0,0 +1,126 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.KahlerLocalL2Comparison +import OAI.Geometry.PrescribedRicci.MongeAmpereEnergy + +namespace OAI + +/-! Kahler L2 Comparison. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory +open scoped SchwartzMap ContDiff Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} + +lemma finite_norm_sq_le_sum {ι : Type*} [Fintype ι] {E : ι → Type*} + [∀ i, SeminormedAddCommGroup (E i)] (f : ∀ i, E i) : ‖f‖ ^ 2 ≤ ∑ i, ‖f i‖ ^ 2 := by + have hn : 0 ≤ ∑ i, ‖f i‖ ^ 2 := Finset.sum_nonneg (fun _ _ => sq_nonneg _) + have hb : ‖f‖ ≤ Real.sqrt (∑ i, ‖f i‖ ^ 2) := by + apply (pi_norm_le_iff_of_nonneg (Real.sqrt_nonneg _)).2 + intro i + exact (Real.le_sqrt (norm_nonneg _) hn).2 + (Finset.single_le_sum (fun j _ => sq_nonneg ‖f j‖) (Finset.mem_univ i)) + exact (Real.le_sqrt (norm_nonneg _) hn).1 hb + +omit [T2Space X] in +lemma smooth_square_bounded (ρ : Smooth A) : ∃ M : ℝ, 0 < M ∧ ∀ x, ‖ρ x‖ ^ 2 ≤ M := by + obtain ⟨b,hb⟩ := isCompact_univ.bddAbove_image (ρ.continuous.norm.pow 2).continuousOn + refine ⟨max b 1, lt_of_lt_of_le (by norm_num) (le_max_right _ _), fun x => ?_⟩ + exact (hb (mem_image_of_mem _ (mem_univ x))).trans (le_max_left _ _) + +namespace Localizers +variable {ι : Type*} [Fintype ι] (D : Localizers A ι) + +lemma norm_coordinate_le (f : Smooth A) (i : ι) : + ‖schwartzCoord 0 (localize A (D.index i) (D.weight i) (D.support_sub i) f)‖ ≤ + ‖D.embed 0 f‖ := norm_le_pi_norm (D.coordinates 0 f) i + + +theorem kahler_L2_comparison (g : KaehlerMetric A) : ∃ C B : ℝ, 0 < C ∧ 0 < B ∧ + ∀ f : Smooth A, + ‖D.embed 0 f‖ ^ 2 ≤ C * g.integral (fun x => ‖f x‖ ^ 2) ∧ + g.integral (fun x => ‖f x‖ ^ 2) ≤ B * ‖D.embed 0 f‖ ^ 2 := by + have hl (i : ι) := local_weighted_L2_comparison g (D.index i) (D.weight i) (D.support_sub i) + choose a b ha hb hab using hl + choose M hM hMb using (fun i : ι => smooth_square_bounded (D.weight i)) + let c := coordinateVolumeFactor d + have hc : 0 < c := coordinateVolumeFactor_pos d + let C := 1 + ∑ i, c * M i / a i + let B := 1 + (Fintype.card ι : ℝ) * ∑ i, b i / c + have hC : 0 < C := by + have hh : 0 ≤ ∑ i, c * M i / a i := Finset.sum_nonneg + (fun i _ => div_nonneg (mul_nonneg hc.le (hM i).le) (ha i).le) + dsimp [C]; linarith + have hB : 0 < B := by + have hh : 0 ≤ (Fintype.card ι : ℝ) * ∑ i, b i / c := mul_nonneg (Nat.cast_nonneg _) + (Finset.sum_nonneg (fun i _ => div_nonneg (hb i).le hc.le)) + dsimp [B]; linarith + refine ⟨C,B,hC,hB,fun f => ?_⟩ + let I := g.integral (fun x => ‖f x‖ ^ 2) + let Iw (i : ι) := g.integral (fun x => ‖D.weight i x * f x‖ ^ 2) + have hI : 0 ≤ I := g.integral_nonneg (fun _ => sq_nonneg _) + have hIw (i : ι) : Iw i ≤ M i * I := by + rw [← g.integral_const_mul] + apply g.integral_mono ((D.weight i).continuous.fun_mul f.continuous |>.norm.pow 2) + (continuous_const.mul (f.continuous.norm.pow 2)) + intro x + change ‖D.weight i x * f x‖ ^ 2 ≤ M i * ‖f x‖ ^ 2 + rw [norm_mul, mul_pow] + exact mul_le_mul_of_nonneg_right (hMb i x) (sq_nonneg _) + have hp (i : ι) : + ‖schwartzCoord 0 (localize A (D.index i) (D.weight i) (D.support_sub i) f)‖ ^ 2 ≤ + (c * M i / a i) * I := by + calc + _ ≤ (c * Iw i) / a i := (le_div_iff₀ (ha i)).2 (by rw [mul_comm]; exact (hab i f).1) + _ ≤ (c * (M i * I)) / a i := div_le_div_of_nonneg_right + (mul_le_mul_of_nonneg_left (hIw i) hc.le) (ha i).le + _ = _ := by ring + have hq (i : ι) : Iw i ≤ (b i / c) * ‖D.embed 0 f‖ ^ 2 := by + calc + _ ≤ (b i * ‖schwartzCoord 0 (localize A (D.index i) (D.weight i) (D.support_sub i) f)‖ ^ 2) / c := + (le_div_iff₀ hc).2 (by rw [mul_comm]; exact (hab i f).2) + _ ≤ (b i * ‖D.embed 0 f‖ ^ 2) / c := div_le_div_of_nonneg_right + (mul_le_mul_of_nonneg_left ((sq_le_sq₀ (norm_nonneg _) (norm_nonneg _)).2 + (D.norm_coordinate_le f i)) (hb i).le) hc.le + _ = _ := by ring + constructor + · calc + _ = ‖D.coordinates 0 f‖ ^ 2 := rfl + _ ≤ ∑ i, ‖D.coordinates 0 f i‖ ^ 2 := finite_norm_sq_le_sum _ + _ ≤ ∑ i, (c * M i / a i) * I := Finset.sum_le_sum (fun i _ => hp i) + _ = (∑ i, c * M i / a i) * I := (Finset.sum_mul _ _ _).symm + _ ≤ C * I := mul_le_mul_of_nonneg_right (by dsimp [C]; linarith) hI + · have hi : I ≤ (Fintype.card ι : ℝ) * ∑ i, Iw i := by + dsimp only [I, Iw] + rw [← g.integral_sum Finset.univ (fun i x => ‖D.weight i x * f x‖ ^ 2) (fun i _ => + ((D.weight i).continuous.fun_mul f.continuous).norm.pow 2), ← g.integral_const_mul] + apply g.integral_mono (f.continuous.norm.pow 2) + (continuous_const.mul (continuous_finsetSum _ (fun i _ => + ((D.weight i).continuous.fun_mul f.continuous).norm.pow 2))) + intro x + have hs : ∑ i, D.weight i x * f x = f x := by rw [← Finset.sum_mul, D.sum_one, one_mul] + calc + ‖f x‖ ^ 2 = ‖∑ i, D.weight i x * f x‖ ^ 2 := by rw [hs] + _ ≤ (∑ i, ‖D.weight i x * f x‖) ^ 2 := + (sq_le_sq₀ (norm_nonneg _) (Finset.sum_nonneg (fun i _ => norm_nonneg _))).2 (norm_sum_le _ _) + _ ≤ _ := sq_sum_le_card_mul_sum_sq + calc + I ≤ (Fintype.card ι : ℝ) * ∑ i, Iw i := hi + _ ≤ (Fintype.card ι : ℝ) * ∑ i, (b i / c) * ‖D.embed 0 f‖ ^ 2 := + mul_le_mul_of_nonneg_left (Finset.sum_le_sum (fun i _ => hq i)) (Nat.cast_nonneg _) + _ = ((Fintype.card ι : ℝ) * ∑ i, b i / c) * ‖D.embed 0 f‖ ^ 2 := by rw [← Finset.sum_mul]; ring + _ ≤ B * ‖D.embed 0 f‖ ^ 2 := mul_le_mul_of_nonneg_right (by dsimp [B]; linarith) (sq_nonneg _) + +end Localizers +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/KahlerLocalL2Comparison.lean b/lean/OAI/Geometry/PrescribedRicci/KahlerLocalL2Comparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..c61bca8ea09b3f43d2a520520410a112114b0183 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/KahlerLocalL2Comparison.lean @@ -0,0 +1,122 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.CoordinateVolumeComparison +import OAI.Geometry.PrescribedRicci.GlobalKahlerIntegral + +namespace OAI + +/-! Kahler Local L2 Comparison. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory +open scoped SchwartzMap ContDiff Classical +namespace Anticanonical.SourceSmooth +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +namespace KaehlerMetric + +lemma chartIntegral_eq_localize (g : KaehlerMetric A) (i : Fin A.count) (f : X → ℝ) : + g.chartIntegral i f = ∫ z, localizeFunction i f z * g.volumeCoefficient i z := by + rw [chartIntegral, ← integral_indicator (A.chart i).open_target.measurableSet] + apply integral_congr_ae + filter_upwards [] with z + by_cases hz : z ∈ (A.chart i).target + · simp only [Set.indicator_of_mem hz, localizeFunction, ite_eq_left hz] + · simp only [Set.indicator_of_notMem hz, localizeFunction, ite_eq_right hz, zero_mul] + +lemma chart_weighted_integrable [T2Space X] [CompactSpace X] (g : KaehlerMetric A) + (i : Fin A.count) {f : X → ℝ} (hf : Continuous f) (hs : tsupport f ⊆ (A.chart i).source) : + Integrable (fun z => localizeFunction i f z * g.volumeCoefficient i z) := by + obtain ⟨hl,hc,ht⟩ := localizeFunction_continuous_compact i hf hs + exact (continuous_real_mul_on_tsupport hl (fun z hz => + ((g.volumeCoefficient_smooth i).continuousOn z (ht hz)).continuousAt + ((A.chart i).open_target.mem_nhds (ht hz)))).integrable_of_hasCompactSupport hc.mul_right + +lemma compact_volume_bounds (g : KaehlerMetric A) (i : Fin A.count) + {K : Set (Coordinates d)} (hK : IsCompact K) (hs : K ⊆ (A.chart i).target) : + ∃ a b : ℝ, 0 < a ∧ 0 < b ∧ ∀ z ∈ K, a ≤ g.volumeCoefficient i z ∧ g.volumeCoefficient i z ≤ b := by + have hc := (g.volumeCoefficient_smooth i).continuousOn.mono hs + obtain ⟨b,hb⟩ := hK.bddAbove_image hc + by_cases hn : K.Nonempty + · obtain ⟨z,hz,hm⟩ := hK.exists_isMinOn hn hc + refine ⟨g.volumeCoefficient i z, max b 1, g.volumeCoefficient_pos i (hs hz), + lt_of_lt_of_le (by norm_num : (0:ℝ)<1) (le_max_right _ _), fun y hy => ⟨hm hy, ?_⟩⟩ + exact (hb (mem_image_of_mem _ hy)).trans (le_max_left _ _) + · refine ⟨1,1,by norm_num,by norm_num,fun z hz => ?_⟩ + exact (hn ⟨z,hz⟩).elim + +end KaehlerMetric +end Anticanonical.SourceSmooth +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} + +omit [T2Space X] [CompactSpace X] in +lemma square_weight_support (ρ f : Smooth A) : + tsupport (fun x => ‖ρ x * f x‖ ^ 2) ⊆ tsupport (ρ : X → ℂ) := by + apply closure_minimal _ (isClosed_tsupport _) + intro x hx + apply subset_tsupport + change ρ x ≠ 0 + intro h + exact hx (by simp [h]) + +lemma local_weighted_L2_comparison (g : KaehlerMetric A) (i : Fin A.count) (ρ : Smooth A) + (hs : tsupport (ρ : X → ℂ) ⊆ (A.euclideanChart i).source) : + ∃ a b : ℝ, 0 < a ∧ 0 < b ∧ ∀ f : Smooth A, + a * ‖schwartzCoord 0 (localize A i ρ hs f)‖ ^ 2 ≤ + coordinateVolumeFactor d * g.integral (fun x => ‖ρ x * f x‖ ^ 2) ∧ + coordinateVolumeFactor d * g.integral (fun x => ‖ρ x * f x‖ ^ 2) ≤ + b * ‖schwartzCoord 0 (localize A i ρ hs f)‖ ^ 2 := by + have hs' : tsupport (ρ : X → ℂ) ⊆ (A.chart i).source := by simpa using hs + let K := (A.chart i) '' tsupport (ρ : X → ℂ) + have hK : IsCompact K := (isClosed_tsupport _).isCompact.image_of_continuousOn + ((A.chart i).continuousOn.mono hs') + have hKt : K ⊆ (A.chart i).target := by rintro z ⟨x,hx,rfl⟩; exact (A.chart i).mapsTo (hs' hx) + obtain ⟨a,b,ha,hb,hab⟩ := g.compact_volume_bounds i hK hKt + refine ⟨a,b,ha,hb,fun f => ?_⟩ + let F (x : X) := ‖ρ x * f x‖ ^ 2 + have hF : Continuous F := (ρ.continuous.fun_mul f.continuous).norm.pow 2 + have hFs : tsupport F ⊆ (A.chart i).source := (square_weight_support ρ f).trans hs' + have hraw := KaehlerMetric.localizeFunction_continuous_compact i hF hFs + have hi : Integrable (KaehlerMetric.localizeFunction i F) (volume : Measure (Coordinates d)) := + hraw.1.integrable_of_hasCompactSupport hraw.2.1 + have hwi := g.chart_weighted_integrable i hF hFs + have hsK : Function.support (KaehlerMetric.localizeFunction i F) ⊆ K := + (KaehlerMetric.localizeFunction_support i F).trans (image_mono (square_weight_support ρ f)) + have hpos (z : Coordinates d) : 0 ≤ KaehlerMetric.localizeFunction i F z := by + unfold KaehlerMetric.localizeFunction + split_ifs <;> positivity + have hl : a * ∫ z, KaehlerMetric.localizeFunction i F z ≤ g.integral F := by + rw [g.integral_chart i hF hFs, g.chartIntegral_eq_localize, ← integral_const_mul] + apply MeasureTheory.integral_mono (hi.const_mul a) hwi + intro z + by_cases hz : z ∈ Function.support (KaehlerMetric.localizeFunction i F) + · simpa only [mul_comm] using mul_le_mul_of_nonneg_left (hab z (hsK hz)).1 (hpos z) + · simp only [Function.notMem_support.mp hz, mul_zero, zero_mul, le_refl] + have hu : g.integral F ≤ b * ∫ z, KaehlerMetric.localizeFunction i F z := by + rw [g.integral_chart i hF hFs, g.chartIntegral_eq_localize, ← integral_const_mul] + apply MeasureTheory.integral_mono hwi (hi.const_mul b) + intro z + by_cases hz : z ∈ Function.support (KaehlerMetric.localizeFunction i F) + · simpa only [mul_comm] using mul_le_mul_of_nonneg_left (hab z (hsK hz)).2 (hpos z) + · simp only [Function.notMem_support.mp hz, mul_zero, zero_mul, le_refl] + rw [norm_sq_localize_integral] + constructor + · calc + _ = coordinateVolumeFactor d * (a * ∫ z, KaehlerMetric.localizeFunction i F z) := by ring + _ ≤ _ := mul_le_mul_of_nonneg_left hl (coordinateVolumeFactor_pos d).le + · calc + _ ≤ coordinateVolumeFactor d * (b * ∫ z, KaehlerMetric.localizeFunction i F z) := + mul_le_mul_of_nonneg_left hu (coordinateVolumeFactor_pos d).le + _ = _ := by ring + +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/KahlerPoincare.lean b/lean/OAI/Geometry/PrescribedRicci/KahlerPoincare.lean new file mode 100644 index 0000000000000000000000000000000000000000..87f7ef5e3195e45d32aa6cd0384dab555cad993f --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/KahlerPoincare.lean @@ -0,0 +1,74 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.AnalyticSupport +import OAI.Geometry.PrescribedRicci.GlobalKahlerEnergy +import OAI.Geometry.PrescribedRicci.KahlerCauchySchwarz +import OAI.Geometry.PrescribedRicci.KahlerGreenIdentity +import OAI.Geometry.PrescribedRicci.KahlerPoissonL2 + +namespace OAI + +/-! Kahler Poincare. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory +open scoped ContDiff Classical +namespace Anticanonical.SourceSmooth +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} +namespace KaehlerMetric + +theorem poincare (g : KaehlerMetric A) : ∃ P : ℝ, 0 < P ∧ + ∀ φ : SmoothRealFunction A, g.integral φ.value = 0 → + g.integral (fun x => φ.value x ^ 2) ≤ P * g.integral (g.energy φ φ).value := by + obtain ⟨K,hK,hpoisson⟩ := g.exists_meanZero_poisson_L2 + refine ⟨K+1, by linarith, fun φ hφ => ?_⟩ + obtain ⟨u,hLu,hU⟩ := hpoisson φ hφ + let Iφ := g.integral (fun x => φ.value x ^ 2) + let E := g.integral (g.energy φ φ).value + let Eu := g.integral (g.energy u u).value + have hI : 0 ≤ Iφ := g.integral_nonneg (fun _ => sq_nonneg _) + have hE : 0 ≤ E := g.integral_nonneg (g.energy_nonneg _) + have hEu : 0 ≤ Eu := g.integral_nonneg (g.energy_nonneg _) + have hgreenU : g.integral (fun x => u.value x * φ.value x) = -Eu := by + have hh := g.green_identity u u + rw [hLu] at hh + exact hh + have hgreen : Iφ = - g.integral (g.energy φ u).value := by + have hh := g.green_identity φ u + rw [hLu] at hh + simpa only [Iφ, pow_two] using hh + have hEuSq : Eu ^ 2 ≤ K * Iφ ^ 2 := by + have hh := g.integral_cauchySchwarz u.continuous φ.continuous + rw [hgreenU, neg_sq] at hh + calc + Eu ^ 2 ≤ g.integral (fun x => u.value x ^ 2) * Iφ := hh + _ ≤ (K * Iφ) * Iφ := mul_le_mul_of_nonneg_right hU hI + _ = _ := by ring + have hEuBound : Eu ≤ (K+1) * Iφ := by + apply (sq_le_sq₀ hEu (mul_nonneg (by linarith) hI)).1 + calc + Eu ^ 2 ≤ K * Iφ ^ 2 := hEuSq + _ ≤ (K+1)^2 * Iφ^2 := mul_le_mul_of_nonneg_right (by nlinarith [sq_nonneg K]) (sq_nonneg Iφ) + _ = _ := by ring + have hfinal : Iφ ^ 2 ≤ (K+1) * E * Iφ := by + calc + Iφ ^ 2 = (g.integral (g.energy φ u).value) ^ 2 := by rw [hgreen, neg_sq] + _ ≤ E * Eu := g.energy_cauchySchwarz φ u + _ ≤ E * ((K+1)*Iφ) := mul_le_mul_of_nonneg_left hEuBound hE + _ = _ := by ring + change Iφ ≤ (K+1)*E + by_cases hz : Iφ = 0 + · rw [hz]; exact mul_nonneg (by linarith) hE + · exact (mul_le_mul_iff_right₀ (lt_of_le_of_ne hI (Ne.symm hz))).1 (by simpa only [pow_two, mul_assoc, mul_comm, mul_left_comm] using hfinal) + +end KaehlerMetric +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/KahlerPoissonL2.lean b/lean/OAI/Geometry/PrescribedRicci/KahlerPoissonL2.lean new file mode 100644 index 0000000000000000000000000000000000000000..161678b372a521cb8b5a4bbac40cf6f71e517af9 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/KahlerPoissonL2.lean @@ -0,0 +1,93 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.ComplexKernel +import OAI.Geometry.PrescribedPotential.PatchCutoffs +import OAI.Geometry.PrescribedRicci.BoundedSmoothPoisson +import OAI.Geometry.PrescribedRicci.KahlerCauchySchwarz +import OAI.Geometry.PrescribedRicci.KahlerL2Comparison +import OAI.Geometry.PrescribedRicci.MongeAmpereEnergy + +namespace OAI + +/-! Kahler Poisson L2. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory +open scoped SchwartzMap ContDiff Classical +namespace Anticanonical.SourceSmooth +open GlobalElliptic +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} +namespace KaehlerMetric + +lemma integral_const (g : KaehlerMetric A) (c : ℝ) : + g.integral (fun _ => c) = c * g.integral (fun _ => 1) := by + simpa only [mul_one] using g.integral_const_mul c (fun _ => 1) + +lemma volume_pos [Nonempty X] (g : KaehlerMetric A) : 0 < g.integral (fun _ => 1) := by + obtain ⟨S,⟨D⟩⟩ := exists_gluingData g + obtain ⟨C,B,hC,hB,hbound⟩ := D.localizers.kahler_L2_comparison g + have hn : D.localizers.embed 0 (Smooth.const 1) ≠ 0 := by + intro hh + have he : Smooth.const (A := A) 1 = 0 := D.localizers.embed_injective 0 (by simpa using hh) + have hx := congrArg (fun f : Smooth A => f (Classical.arbitrary X)) he + exact one_ne_zero hx + have hnorm : 0 < ‖D.localizers.embed 0 (Smooth.const 1)‖ ^ 2 := sq_pos_of_pos (norm_pos_iff.mpr hn) + have hb := (hbound (Smooth.const 1)).1 + change ‖D.localizers.embed 0 (Smooth.const 1)‖ ^ 2 ≤ C * g.integral (fun _ => ‖(1 : ℂ)‖ ^ 2) at hb + simp only [norm_one, one_pow] at hb + exact (mul_pos_iff_of_pos_left hC).mp (hnorm.trans_le hb) + +variable [ConnectedSpace X] + + + +theorem exists_meanZero_poisson_L2 (g : KaehlerMetric A) : ∃ K : ℝ, 0 < K ∧ + ∀ f : SmoothRealFunction A, g.integral f.value = 0 → ∃ u : SmoothRealFunction A, + (g.laplacian u).value = f.value ∧ + g.integral (fun x => u.value x ^ 2) ≤ K * g.integral (fun x => f.value x ^ 2) := by + obtain ⟨S,⟨D⟩⟩ := exists_gluingData g + obtain ⟨C,B,hC,hB,hbound⟩ := D.localizers.kahler_L2_comparison g + obtain ⟨Q,hQ,hpoisson⟩ := D.exists_complex_poisson_bounded + let K := 1 + B * Q ^ 2 * C + have hK : 0 < K := by dsimp [K]; positivity + refine ⟨K,hK,fun f hf => ?_⟩ + obtain ⟨v,c,hv,hvn⟩ := hpoisson (Smooth.ofReal f) + let u := v.part Complex.reCLM + have he (x : X) : (g.laplacian u).value x = f.value x + c.re := by + rw [← complexL_re, hv, Smooth.add_apply, Complex.add_re, Smooth.ofReal_apply, Complex.ofReal_re] + rfl + have hz : c.re = 0 := by + have hi := g.integral_laplacian u + rw [show (g.laplacian u).value = (fun x => f.value x + c.re) from funext he, + g.integral_add f.continuous continuous_const, hf, zero_add, g.integral_const] at hi + exact (mul_eq_zero.mp hi).resolve_right (ne_of_gt g.volume_pos) + have hI : 0 ≤ g.integral (fun x => f.value x ^ 2) := g.integral_nonneg (fun _ => sq_nonneg _) + refine ⟨u, funext (fun x => by rw [he x,hz,add_zero]), ?_⟩ + have hr : g.integral (fun x => u.value x ^ 2) ≤ g.integral (fun x => ‖v x‖ ^ 2) := by + apply g.integral_mono (u.continuous.pow 2) (v.continuous.norm.pow 2) + intro x + change (v x).re ^ 2 ≤ ‖v x‖ ^ 2 + simpa only [sq_abs] using (sq_le_sq₀ (abs_nonneg _) (norm_nonneg _)).2 (Complex.abs_re_le_norm (v x)) + have hnv : ‖D.localizers.embed 0 v‖ ^ 2 ≤ Q ^ 2 * ‖D.localizers.embed 0 (Smooth.ofReal f)‖ ^ 2 := by + simpa only [mul_pow] using (sq_le_sq₀ (norm_nonneg _) (mul_nonneg hQ (norm_nonneg _))).2 hvn + have hnf : ‖D.localizers.embed 0 (Smooth.ofReal f)‖ ^ 2 ≤ C * g.integral (fun x => f.value x ^ 2) := by + simpa only [Smooth.ofReal_apply, Complex.norm_real, Real.norm_eq_abs, sq_abs] using (hbound (Smooth.ofReal f)).1 + calc + _ ≤ g.integral (fun x => ‖v x‖ ^ 2) := hr + _ ≤ B * ‖D.localizers.embed 0 v‖ ^ 2 := (hbound v).2 + _ ≤ B * (Q ^ 2 * ‖D.localizers.embed 0 (Smooth.ofReal f)‖ ^ 2) := mul_le_mul_of_nonneg_left hnv hB.le + _ ≤ B * (Q ^ 2 * (C * g.integral (fun x => f.value x ^ 2))) := + mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left hnf (sq_nonneg Q)) hB.le + _ ≤ K * g.integral (fun x => f.value x ^ 2) := by dsimp [K]; nlinarith + +end KaehlerMetric +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/KahlerSobolev.lean b/lean/OAI/Geometry/PrescribedRicci/KahlerSobolev.lean new file mode 100644 index 0000000000000000000000000000000000000000..f9e47d049d9308dd3546d830f153d83212dd3d8f --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/KahlerSobolev.lean @@ -0,0 +1,87 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.GlobalKahlerIntegral +import OAI.Geometry.PrescribedRicci.KahlerEnergyCutoff +import OAI.Geometry.PrescribedRicci.KahlerSobolevLocal + +namespace OAI + +/-! Kahler Sobolev. -/ + +section + + + +noncomputable section +open Matrix Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory +open scoped ContDiff Classical NNReal ENNReal +namespace Anticanonical.SourceSmooth.KaehlerMetric +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [MeasurableSpace X] [BorelSpace X] {A : ComplexAtlas d X} + +lemma partition_lpNorm_le (g : KaehlerMetric A) (φ : SmoothRealFunction A) + {q : ℝ≥0} (hq : 1 ≤ q) : + lpNorm φ.value q g.volumeMeasure ≤ + ∑ i, lpNorm ((chartPartition i).product φ).value q g.volumeMeasure := by + have he : φ.value = ∑ i : Fin A.count, ((chartPartition i).product φ).value := by + funext x + simp only [Finset.sum_apply, SmoothRealFunction.product] + rw [← Finset.sum_mul, chartPartition_sum, one_mul] + rw [he] + apply lpNorm_sum_le + · intro i _ + exact ((chartPartition i).product φ).continuous.memLp_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _) + · exact_mod_cast hq + +lemma partition_lpNorm_sq_le (g : KaehlerMetric A) (φ : SmoothRealFunction A) + {q : ℝ≥0} (hq : 1 ≤ q) : + (lpNorm φ.value q g.volumeMeasure)^2 ≤ + (A.count:ℝ) * ∑ i, (lpNorm ((chartPartition i).product φ).value q g.volumeMeasure)^2 := by + have hh := g.partition_lpNorm_le φ hq + have hs := (sq_le_sq₀ lpNorm_nonneg (Finset.sum_nonneg (fun _ _ => lpNorm_nonneg))).mpr hh + refine hs.trans ?_ + simpa only [one_mul, one_pow, Finset.sum_const, Finset.card_univ, Fintype.card_fin, + nsmul_eq_mul, mul_one] using Finset.sum_mul_sq_le_sq_mul_sq Finset.univ + (fun _ : Fin A.count => (1:ℝ)) + (fun i => lpNorm ((chartPartition i).product φ).value q g.volumeMeasure) + + + +theorem sobolev (g : KaehlerMetric A) (hd : 2 ≤ d) : + ∃ q : ℝ≥0, 2 < q ∧ ∃ S : ℝ, 0 < S ∧ ∀ φ : SmoothRealFunction A, + (lpNorm φ.value q g.volumeMeasure)^2 ≤ + S * (g.integral (g.energy φ φ).value + g.integral (fun x => φ.value x^2)) := by + obtain ⟨q,hq,hqe⟩ := critical_exponent hd + have hc (i : Fin A.count) := g.chart_sobolev i + (isClosed_tsupport (chartPartition (A:=A) i).value).isCompact + (chartPartition_support i) hq (by omega : 0 < d) hqe + choose C hC hClocal using hc + have hb (i : Fin A.count) := g.cutoff_integral_energy_bound (chartPartition i) + choose B hB hBcut using hb + let T : ℝ := (A.count:ℝ) * ∑ i, C i * B i + have hT : 0 ≤ T := mul_nonneg (Nat.cast_nonneg _) (Finset.sum_nonneg (fun i _ => mul_nonneg (hC i).le (hB i).le)) + refine ⟨q,hq,1+T,by linarith,fun φ => ?_⟩ + let J := g.integral (g.energy φ φ).value + g.integral (fun x => φ.value x^2) + have hJ : 0 ≤ J := add_nonneg (g.integral_nonneg (g.energy_nonneg φ)) + (g.integral_nonneg (fun _ => sq_nonneg _)) + have hlocal (i : Fin A.count) : + (lpNorm ((chartPartition i).product φ).value q g.volumeMeasure)^2 ≤ C i * B i * J := by + have hh := hClocal i ((chartPartition i).product φ) (product_support_left _ _) + calc + _ ≤ C i * g.integral (g.energy ((chartPartition i).product φ) ((chartPartition i).product φ)).value := hh + _ ≤ C i * (B i * J) := mul_le_mul_of_nonneg_left (hBcut i φ) (hC i).le + _ = _ := by ring + calc + _ ≤ (A.count:ℝ) * ∑ i, (lpNorm ((chartPartition i).product φ).value q g.volumeMeasure)^2 := + g.partition_lpNorm_sq_le φ (le_trans (by norm_num) hq.le) + _ ≤ (A.count:ℝ) * ∑ i, C i * B i * J := + mul_le_mul_of_nonneg_left (Finset.sum_le_sum (fun i _ => hlocal i)) (Nat.cast_nonneg _) + _ = T * J := by rw [← Finset.sum_mul]; simp only [T, mul_assoc] + _ ≤ _ := by change T*J ≤ (1+T)*J; nlinarith + +end Anticanonical.SourceSmooth.KaehlerMetric + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/KahlerSobolevLocal.lean b/lean/OAI/Geometry/PrescribedRicci/KahlerSobolevLocal.lean new file mode 100644 index 0000000000000000000000000000000000000000..76f9c2271d903f939dadbeec71b01519928c3ff4 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/KahlerSobolevLocal.lean @@ -0,0 +1,102 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.AnalyticSupport +import OAI.Geometry.PrescribedRicci.KahlerChartGradient +import OAI.Geometry.PrescribedRicci.KahlerChartLp + +namespace OAI + +/-! Kahler Sobolev Local. -/ + +section + + +noncomputable section +open Matrix Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory +open scoped ContDiff Classical NNReal ENNReal +namespace Anticanonical.SourceSmooth.KaehlerMetric +variable {d : ℕ} + +lemma coordinates_finrank : Module.finrank ℝ (Coordinates d) = 2*d := by + simp [Coordinates, Module.finrank_pi_fintype, Complex.finrank_real_complex, mul_comm] + +lemma critical_exponent (hd : 2 ≤ d) : + ∃ q : ℝ≥0, 2 < q ∧ (q:ℝ)⁻¹ = (2:ℝ)⁻¹ - ((2*d:ℕ):ℝ)⁻¹ := by + have hdR : (2:ℝ) ≤ d := by exact_mod_cast hd + have hp : 0 < (d:ℝ)-1 := by linarith + let q : ℝ≥0 := ⟨2*(d:ℝ)/((d:ℝ)-1), (div_pos (by positivity) hp).le⟩ + refine ⟨q, ?_, ?_⟩ + · change (2:ℝ) < 2*(d:ℝ)/((d:ℝ)-1) + apply (lt_div_iff₀ hp).2 + linarith + · change (2*(d:ℝ)/((d:ℝ)-1))⁻¹ = _ + push_cast + field_simp + +lemma lpNorm_two_sq {E : Type*} [NormedAddCommGroup E] + {Y : Type*} [MeasurableSpace Y] {μ : Measure Y} {f : Y → E} + (hf : AEStronglyMeasurable f μ) : + (lpNorm f 2 μ) ^ 2 = ∫ x, ‖f x‖^2 ∂μ := by + rw [show (2:ℝ≥0∞) = ((2:ℝ≥0):ℝ≥0∞) by norm_num, + lpNorm_nnreal_eq_integral_norm_rpow (by norm_num : (2:ℝ≥0) ≠ 0) hf] + simp only [NNReal.coe_ofNat, Real.rpow_two] + simpa only [one_div, Nat.cast_ofNat] using Real.rpow_inv_natCast_pow (x := ∫ x, ‖f x‖^2 ∂μ) (n := 2) + (MeasureTheory.integral_nonneg (fun x => sq_nonneg ‖f x‖)) (by norm_num) + +lemma euclidean_sobolev_sq {q : ℝ≥0} (hd : 0 < d) + (he : (q:ℝ)⁻¹ = (2:ℝ)⁻¹ - ((2*d:ℕ):ℝ)⁻¹) + {u : Coordinates d → ℝ} (hu : ContDiff ℝ ∞ u) (huc : HasCompactSupport u) : + (lpNorm u q volume)^2 ≤ + ((eLpNormLESNormFDerivOfEqInnerConst (volume : Measure (Coordinates d)) 2 : ℝ≥0):ℝ)^2 * + ∫ z, ‖fderiv ℝ u z‖^2 := by + have hn : 0 < Module.finrank ℝ (Coordinates d) := by rw [coordinates_finrank]; omega + have he' : (q:ℝ)⁻¹ = (((2:ℝ≥0):ℝ))⁻¹ - (Module.finrank ℝ (Coordinates d) : ℝ)⁻¹ := by + simpa only [coordinates_finrank, NNReal.coe_ofNat] using he + have hD := hu.continuous_fderiv (by simp) + have hm : MemLp (fderiv ℝ u) 2 volume := hD.memLp_of_hasCompactSupport (huc.fderiv ℝ) + have hh := eLpNorm_le_eLpNorm_fderiv_of_eq_inner (volume : Measure (Coordinates d)) + (hu.of_le (by simp)) huc (by norm_num : (1:ℝ≥0) ≤ 2) hn he' + have hhR := ENNReal.toReal_mono (ENNReal.mul_ne_top ENNReal.coe_ne_top hm.eLpNorm_ne_top) hh + rw [ENNReal.toReal_mul, ENNReal.coe_toReal, + toReal_eLpNorm, toReal_eLpNorm] at hhR + have hsq := (sq_le_sq₀ lpNorm_nonneg (mul_nonneg (NNReal.coe_nonneg _) lpNorm_nonneg)).mpr hhR + rw [mul_pow, lpNorm_two_sq hm.aestronglyMeasurable] at hsq + exact hsq + +variable {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [MeasurableSpace X] [BorelSpace X] {A : ComplexAtlas d X} + +lemma chart_sobolev (g : KaehlerMetric A) (i : Fin A.count) + {K : Set X} (hK : IsCompact K) (hs : K ⊆ (A.chart i).source) + {q : ℝ≥0} (hq : 2 < q) (hd : 0 < d) + (he : (q:ℝ)⁻¹ = (2:ℝ)⁻¹ - ((2*d:ℕ):ℝ)⁻¹) : + ∃ C : ℝ, 0 < C ∧ ∀ ψ : SmoothRealFunction A, tsupport ψ.value ⊆ K → + (lpNorm ψ.value q g.volumeMeasure)^2 ≤ C * g.integral (g.energy ψ ψ).value := by + obtain ⟨b,hb,hbnd⟩ := g.chart_lpNorm_bound i hK hs + obtain ⟨a,ha,habnd⟩ := g.chart_gradient_L2_bound i hK hs + let S : ℝ := eLpNormLESNormFDerivOfEqInnerConst (volume : Measure (Coordinates d)) 2 + let B : ℝ := b ^ (q:ℝ)⁻¹ + have hB : 0 ≤ B := Real.rpow_nonneg hb.le _ + have hcoef : 0 ≤ B^2*S^2*a := mul_nonneg (mul_nonneg (sq_nonneg _) (sq_nonneg _)) ha.le + refine ⟨1+B^2*S^2*a,by linarith,fun ψ hψ => ?_⟩ + have hq0 : 0 < q := lt_trans (by norm_num) hq + have hl := hbnd ψ hψ q hq0 + have hls := (sq_le_sq₀ lpNorm_nonneg (mul_nonneg hB lpNorm_nonneg)).mpr hl + obtain ⟨hu,huc,_⟩ := ψ.localized_smooth_compact i (hψ.trans hs) + have hsobo := euclidean_sobolev_sq hd he hu huc + have hgr := habnd ψ hψ + have hEn := g.integral_nonneg (g.energy_nonneg ψ) + calc + _ ≤ B^2 * (lpNorm (ψ.localized i) q volume)^2 := by simpa only [mul_pow] using hls + _ ≤ B^2 * (S^2 * ∫ z, ‖fderiv ℝ (ψ.localized i) z‖^2) := + mul_le_mul_of_nonneg_left hsobo (sq_nonneg _) + _ = (B^2*S^2) * ∫ z, ‖fderiv ℝ (ψ.localized i) z‖^2 := by ring + _ ≤ (B^2*S^2) * (a*g.integral (g.energy ψ ψ).value) := + mul_le_mul_of_nonneg_left hgr (mul_nonneg (sq_nonneg _) (sq_nonneg _)) + _ ≤ _ := by nlinarith + +end Anticanonical.SourceSmooth.KaehlerMetric + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/KahlerVolumeMeasure.lean b/lean/OAI/Geometry/PrescribedRicci/KahlerVolumeMeasure.lean new file mode 100644 index 0000000000000000000000000000000000000000..5bae1731d3390020f0ef9f721c31bba701d86461 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/KahlerVolumeMeasure.lean @@ -0,0 +1,50 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.AnalyticSupport +import OAI.Geometry.PrescribedRicci.MongeAmpereEnergy + +namespace OAI + +/-! Kahler Volume Measure. -/ + +section + + +noncomputable section +open Matrix Filter Set Topology MeasureTheory +open scoped ContDiff ComplexOrder Classical CompactlySupported +namespace Anticanonical.SourceSmooth +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} +namespace KaehlerMetric + +def integralPositive (g : KaehlerMetric A) : C_c(X, ℝ) →ₚ[ℝ] ℝ where + toFun f := g.integral f + map_add' f h := g.integral_add f.continuous h.continuous + map_smul' c f := g.integral_const_mul c f + monotone' f h hfh := g.integral_mono f.continuous h.continuous hfh + +variable [MeasurableSpace X] [BorelSpace X] + +def volumeMeasure (g : KaehlerMetric A) : Measure X := + RealRMK.rieszMeasure g.integralPositive + +instance volumeMeasure_regular (g : KaehlerMetric A) : g.volumeMeasure.Regular := by + dsimp [volumeMeasure] + infer_instance + +instance volumeMeasure_finite (g : KaehlerMetric A) : IsFiniteMeasure g.volumeMeasure := by + dsimp [volumeMeasure] + infer_instance + +lemma integral_volumeMeasure (g : KaehlerMetric A) {f : X → ℝ} (hf : Continuous f) : + ∫ x, f x ∂g.volumeMeasure = g.integral f := by + exact RealRMK.integral_rieszMeasure g.integralPositive + ⟨⟨f, hf⟩, HasCompactSupport.of_compactSpace f⟩ + +end KaehlerMetric +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/KahlerVolumeVariation.lean b/lean/OAI/Geometry/PrescribedRicci/KahlerVolumeVariation.lean new file mode 100644 index 0000000000000000000000000000000000000000..c53f1c2d9b2f6e1264f706a6063a50a76ddda31d --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/KahlerVolumeVariation.lean @@ -0,0 +1,201 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.CompactParameterIntegral +import OAI.Geometry.PrescribedRicci.GlobalKahlerEnergy +import OAI.Geometry.PrescribedRicci.KahlerGreenIdentity +import OAI.Geometry.PrescribedPotential.PotentialDensity + +namespace OAI + +/-! Kahler Volume Variation. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix MeasureTheory +open scoped ContDiff ComplexOrder Classical Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +namespace KaehlerMetric + +lemma PositivePotential.segment {g : KaehlerMetric A} {φ : SmoothRealFunction A} + (hp : g.PositivePotential φ) {s : ℝ} (hs : s ∈ Icc 0 1) : + g.PositivePotential (φ.realSMul s) := by + intro i z hz + rw [SmoothRealFunction.hessian_realSMul] + by_cases h1 : s = 1 + · simpa only [h1, Complex.ofReal_one, one_smul] using hp i z hz + have hc : (0 : ℂ) < ((1 - s : ℝ) : ℂ) := + Complex.pos_iff.mpr ⟨sub_pos.mpr (lt_of_le_of_ne hs.2 h1), rfl⟩ + have hq := (hp i z hz).posSemidef.smul + (show (0 : ℂ) ≤ (s : ℂ) from Complex.nonneg_iff.mpr ⟨hs.1, rfl⟩) + have he := ((g.positive i z hz).smul hc).add_posSemidef hq + convert he using 1 + ext j k + simp only [Matrix.add_apply, Matrix.smul_apply, smul_eq_mul, Complex.ofReal_sub, Complex.ofReal_one] + ring + +lemma continuous_weighted_parameter {E : Type*} [TopologicalSpace E] + {w : E → ℝ} (hw : Continuous w) {F : ℝ × E → ℝ} + (hF : ∀ p, p.2 ∈ tsupport w → ContinuousAt F p) : + Continuous (fun p : ℝ × E => w p.2 * F p) := by + apply continuous_real_mul_on_tsupport (hw.comp continuous_snd) + intro p hp + exact hF p (tsupport_comp_subset_preimage w continuous_snd hp) + +lemma chart_det_variation [T2Space X] [CompactSpace X] + (g : KaehlerMetric A) (φ : SmoothRealFunction A) (i : Fin A.count) + {w : X → ℝ} (hw : Continuous w) (hs : tsupport w ⊆ (A.chart i).source) (s : ℝ) : + HasDerivAt (fun t => ∫ z, localizeFunction i w z * + (g.matrix i z + t • φ.hessian i z).det.re) + (∫ z, localizeFunction i w z * + (fderiv ℝ (fun M : Matrix (Fin d) (Fin d) ℂ => M.det) + (g.matrix i z + s • φ.hessian i z) (φ.hessian i z)).re) s := by + obtain ⟨hl, hc, ht⟩ := localizeFunction_continuous_compact i hw hs + let F (t : ℝ) (z : Coordinates d) := localizeFunction i w z * + (g.matrix i z + t • φ.hessian i z).det.re + let F' (t : ℝ) (z : Coordinates d) := localizeFunction i w z * + (fderiv ℝ (fun M : Matrix (Fin d) (Fin d) ℂ => M.det) + (g.matrix i z + t • φ.hessian i z) (φ.hessian i z)).re + have hM (p : ℝ × Coordinates d) (hp : p.2 ∈ tsupport (localizeFunction i w)) : + ContinuousAt (fun q : ℝ × Coordinates d => g.matrix i q.2 + q.1 • φ.hessian i q.2) p := by + have hg := ((g.smooth i).contDiffAt ((A.chart i).open_target.mem_nhds (ht hp))).continuousAt + have hf := ((φ.hessian_smooth i).contDiffAt ((A.chart i).open_target.mem_nhds (ht hp))).continuousAt + exact (hg.comp continuousAt_snd).add + (continuousAt_fst.smul (hf.comp continuousAt_snd)) + have hF : Continuous (Function.uncurry F) := by + apply continuous_weighted_parameter hl + intro p hp + exact Complex.continuous_re.continuousAt.comp + (MongeAmpere.contDiff_det.continuous.continuousAt.comp (hM p hp)) + have hF' : Continuous (Function.uncurry F') := by + apply continuous_weighted_parameter hl + intro p hp + have hf := ((φ.hessian_smooth i).contDiffAt ((A.chart i).open_target.mem_nhds (ht hp))).continuousAt + exact Complex.continuous_re.continuousAt.comp + ((((MongeAmpere.contDiff_det.restrict_scalars ℝ).continuous_fderiv (by simp)).continuousAt.comp + (hM p hp)).clm_apply (hf.comp continuousAt_snd)) + exact KahlerCalculus.hasDerivAt_integral_compact hc hF hF' + (fun t => (Function.support_mul_subset_left _ _).trans (subset_tsupport _)) + (fun t => (Function.support_mul_subset_left _ _).trans (subset_tsupport _)) + (fun t z => by + have hh := (hasDerivAt_id t).smul_const (φ.hessian i z) |>.const_add (g.matrix i z) + have hd := ((MongeAmpere.differentiable_det _).restrictScalars ℝ).hasFDerivAt.comp_hasDerivAt t hh + have hr := Complex.reCLM.hasFDerivAt.comp_hasDerivAt t hd + convert! hr.const_mul (localizeFunction i w z) using 1 + simp only [F', one_smul, id_eq, Complex.reCLM_apply] + rfl) s + +lemma density_mul_volume (g : KaehlerMetric A) (φ : SmoothRealFunction A) + (i : Fin A.count) {z : Coordinates d} (hz : z ∈ (A.chart i).target) : + (g.potentialDensity φ).value ((A.chart i).symm z) * g.volumeCoefficient i z = + (g.matrix i z + φ.hessian i z).det.re := by + have he := g.potentialDensity_complex φ i ((A.chart i).mapsTo_symm hz) + rw [(A.chart i).right_inv hz] at he + have hn := (g.positive i z hz).det_pos.ne' + have hh := congrArg (fun c : ℂ => (c * (g.matrix i z).det).re) he + simp only [volumePolynomial, div_mul_cancel₀ _ hn, Complex.mul_re, Complex.ofReal_re, + Complex.ofReal_im, zero_mul, sub_zero] at hh + exact hh + +lemma integral_density [T2Space X] [CompactSpace X] (g : KaehlerMetric A) + (φ : SmoothRealFunction A) (hp : g.PositivePotential φ) (w : X → ℝ) : + g.integral (fun x => w x * (g.potentialDensity φ).value x) = (g.deform φ hp).integral w := by + apply Finset.sum_congr rfl + intro i _ + apply setIntegral_congr_fun (A.chart i).open_target.measurableSet + intro z hz + change (chartPartition i).value ((A.chart i).symm z) * + (w ((A.chart i).symm z) * (g.potentialDensity φ).value ((A.chart i).symm z)) * + g.volumeCoefficient i z = _ + rw [mul_assoc, mul_assoc, density_mul_volume g φ i hz] + exact (mul_assoc _ _ _).symm + +lemma real_smul_hessian (φ : SmoothRealFunction A) (s : ℝ) (i : Fin A.count) (z : Coordinates d) : + s • φ.hessian i z = (φ.realSMul s).hessian i z := by + rw [SmoothRealFunction.hessian_realSMul] + ext j k + exact Complex.real_smul + +lemma integral_density_full [T2Space X] [CompactSpace X] (g : KaehlerMetric A) + (φ : SmoothRealFunction A) (w : X → ℝ) : + g.integral (fun x => w x * (g.potentialDensity φ).value x) = + ∑ i, ∫ z, localizeFunction i (fun x => (chartPartition i).value x * w x) z * + (g.matrix i z + φ.hessian i z).det.re := by + apply Finset.sum_congr rfl + intro i _ + unfold chartIntegral + rw [← integral_indicator (A.chart i).open_target.measurableSet] + apply integral_congr_ae + filter_upwards [] with z + by_cases hz : z ∈ (A.chart i).target + · rw [Set.indicator_of_mem hz] + simp only [localizeFunction, ite_eq_left hz] + rw [mul_assoc, mul_assoc, density_mul_volume g φ i hz, ← mul_assoc] + · simp only [Set.indicator_of_notMem hz, localizeFunction, ite_eq_right hz, zero_mul] + +lemma full_firstVariation_eq [T2Space X] [CompactSpace X] + (g : KaehlerMetric A) (φ : SmoothRealFunction A) (s : ℝ) + (hp : g.PositivePotential (φ.realSMul s)) (i : Fin A.count) (w : X → ℝ) : + (∫ z, localizeFunction i w z * + (fderiv ℝ (fun M : Matrix (Fin d) (Fin d) ℂ => M.det) + (g.matrix i z + s • φ.hessian i z) (φ.hessian i z)).re) = + (g.deform (φ.realSMul s) hp).chartIntegral i + (fun x => w x * ((g.deform (φ.realSMul s) hp).laplacian φ).value x) := by + let gs := g.deform (φ.realSMul s) hp + change _ = ∫ z in (A.chart i).target, + (w ((A.chart i).symm z) * (gs.laplacian φ).value ((A.chart i).symm z)) * gs.volumeCoefficient i z + rw [← integral_indicator (A.chart i).open_target.measurableSet] + apply integral_congr_ae + filter_upwards [] with z + by_cases hz : z ∈ (A.chart i).target + · rw [Set.indicator_of_mem hz] + simp only [localizeFunction, ite_eq_left hz, real_smul_hessian] + change w ((A.chart i).symm z) * (fderiv ℝ (fun M : Matrix (Fin d) (Fin d) ℂ => M.det) + (gs.matrix i z) (φ.hessian i z)).re = _ + rw [MongeAmpere.real_fderiv_det_apply _ _ (isUnit_iff_ne_zero.mpr (gs.positive i z hz).det_pos.ne')] + have hl := gs.laplacian_localExpression φ i hz + change (gs.laplacian φ).value ((A.chart i).symm z) = _ at hl + rw [hl, Complex.mul_re, hermitian_det_im (gs.positive i z hz).isHermitian, zero_mul, sub_zero] + change _ = (_ * ((gs.matrix i z)⁻¹ * φ.hessian i z).trace.re) * (gs.matrix i z).det.re + ring + · simp only [Set.indicator_of_notMem hz, localizeFunction, ite_eq_right hz, zero_mul] + + + +theorem volume_firstVariation [T2Space X] [CompactSpace X] + (g : KaehlerMetric A) (φ ψ : SmoothRealFunction A) (s : ℝ) + (hp : g.PositivePotential (φ.realSMul s)) : + HasDerivAt (fun t => g.integral (fun x => ψ.value x * + (g.potentialDensity (φ.realSMul t)).value x)) + (-(g.deform (φ.realSMul s) hp).integral + ((g.deform (φ.realSMul s) hp).energy ψ φ).value) s := by + have hh := HasDerivAt.fun_sum (u := Finset.univ) (fun i _ => g.chart_det_variation φ i + ((chartPartition i).continuous.fun_mul ψ.continuous) + (tsupport_mul_subset_left.trans (chartPartition_support i)) s) + simp_rw [g.full_firstVariation_eq φ s hp] at hh + have he : (∑ i, (g.deform (φ.realSMul s) hp).chartIntegral i + (fun x => ((chartPartition i).value x * ψ.value x) * + ((g.deform (φ.realSMul s) hp).laplacian φ).value x)) = + -(g.deform (φ.realSMul s) hp).integral ((g.deform (φ.realSMul s) hp).energy ψ φ).value := by + rw [← (g.deform (φ.realSMul s) hp).green_identity ψ φ] + unfold integral + congr 1 + funext i + congr 1 + funext x + ring + rw [he] at hh + convert! hh using 1 + funext t + rw [g.integral_density_full] + simp only [real_smul_hessian] + +end KaehlerMetric +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/LocalDeterminantBound.lean b/lean/OAI/Geometry/PrescribedRicci/LocalDeterminantBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..bd7003b44b4da1537b98b03a4d7c32fe3c0560d3 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/LocalDeterminantBound.lean @@ -0,0 +1,101 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.LocalDeterminantEquation +import OAI.Geometry.PrescribedRicci.UniformDeterminantRemainder +import OAI.Geometry.PrescribedRicci.UniformL2 + +namespace OAI + +/-! Local Determinant Bound. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix _root_.MeasureTheory _root_.OAI.MeasureTheory LineDeriv +open scoped ContDiff SchwartzMap Classical Matrix.Norms.Elementwise BoundedContinuousFunction ENNReal +namespace TameInterpolation +open SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] +variable {ι : Type*} [Fintype ι] [Nonempty ι] {n : ℕ} [Nonempty (Fin n)] {Z : Type*} +omit [Fintype ι] [Nonempty ι] in +lemma detJetRemainder_memLp (e : ι → E) (F : Fin n → Fin n → 𝓢(E,ℂ)) + (hc : ∀ i j, HasCompactSupport (F i j : E → ℂ)) (ws : List ι) : + MemLp (detJetRemainder e (fun x i j => F i j x) ws) 2 volume := by + have hs (σ : Equiv.Perm (Fin n)) : ∀ L : List (Fin n → List ι), + MemLp (fun x => (L.map (fun s => monoEval e (fun i x => F (σ i) i x) s x)).sum) 2 volume := by + intro L + induction L with + | nil => simp + | cons a L ih => + exact ((monoEval_smooth e _ (fun i => (F (σ i) i).smooth') a).continuous.memLp_of_hasCompactSupport + (monoEval_compact e _ (fun i => hc (σ i) i) a)).add ih + have hh := memLp_finsetSum Finset.univ (fun σ _ => (hs σ (monoRemainder ws)).const_mul (Equiv.Perm.sign σ : ℂ)) + convert! hh using 1 + +lemma detJetRemainder_uniformL2 (e : ι → E) (F : Z → Fin n → Fin n → 𝓢(E,ℂ)) + (hc : ∀ z i j, HasCompactSupport (F z i j : E → ℂ)) (ws : List ι) + (h0 : ∀ σ : Equiv.Perm (Fin n), ∃ A : ℝ, 0 ≤ A ∧ ∀ z, + familyJetNorm e (realComponents (initialJet e (fun i x => F z (σ i) i x))) 0 ∞ ≤ A) + (hS : ∀ i j, UniformSobolev ((ws.length:ℝ)-1) (fun z => F z i j)) : + UniformL2 (fun z => detJetRemainder e (fun x i j => F z i j x) ws) := + ⟨fun z => detJetRemainder_memLp e (F z) (hc z) ws,detJetRemainder_uniform_bound e F hc ws h0 hS⟩ +end TameInterpolation + +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart FrozenPoisson MetricLocalization TameInterpolation +variable {d : ℕ} {Z : Type*} +lemma norm_trace_mul_le_sum (M N : Matrix (Fin d) (Fin d) ℂ) {B : ℝ} + (hB : ∀ i j, ‖M i j‖ ≤ B) : + ‖(M*N).trace‖ ≤ B*∑ i, ∑ j, ‖N j i‖ := by + change ‖∑ i, ∑ j, M i j*N j i‖ ≤ _ + rw [Finset.mul_sum] + apply (norm_sum_le _ _).trans + apply Finset.sum_le_sum + intro i _ + rw [Finset.mul_sum] + exact (norm_sum_le _ _).trans (Finset.sum_le_sum (fun j _ => by + rw [norm_mul] + exact mul_le_mul_of_nonneg_right (hB i j) (norm_nonneg _))) + +lemma determinant_word_cutoff_bound + {ι : Type*} (e : ι → EC d) (ws : List ι) (hw : ws ≠ []) + (κ f : 𝓢(EC d,ℂ)) (G H : Fin d → Fin d → 𝓢(EC d,ℂ)) + (ρ : 𝓢(EC d,ℂ)) (y : EC d) + (he : ∀ i j, (H i j : EC d → ℂ) =ᶠ[𝓝 y] + (fun x => G i j x+hessianEntrySchwartz i j f x)) + (hρ : (fun x => (show Matrix (Fin d) (Fin d) ℂ from fun i j => H i j x).det) =ᶠ[𝓝 y] ρ) + (hinv : IsUnit (show Matrix (Fin d) (Fin d) ℂ from fun i j => H i j y).det) + {B J K : ℝ} (hB : 0 ≤ B) (hJ : 0 ≤ J) + (hb : ∀ i j, ‖(show Matrix (Fin d) (Fin d) ℂ from fun i j => H i j y)⁻¹ i j‖ ≤ B) + (hj : ‖(show Matrix (Fin d) (Fin d) ℂ from fun i j => H i j y).det⁻¹‖ ≤ J) + (hk : ‖κ y‖ ≤ K) : + ‖(((show Matrix (Fin d) (Fin d) ℂ from fun i j => H i j y)⁻¹) * + (show Matrix (Fin d) (Fin d) ℂ from fun i j => hessianEntrySchwartz i j + (SchwartzMap.smulLeftCLM ℂ κ (schwartzWord (ws.map e) f)) y)).trace‖ ≤ + K*J*(‖schwartzWord (ws.map e) ρ y‖+‖detJetRemainder e (fun x i j => H i j x) ws y‖)+ + B*∑ i, ∑ j, (‖wordHessianError κ (ws.map e) j i f y‖+K*‖schwartzWord (ws.map e) (G j i) y‖) := by + rw [determinant_word_cutoff_trace e ws hw κ f G H ρ y he hρ hinv] + apply (norm_add_le _ _).trans + apply add_le_add + · rw [norm_mul,norm_mul] + exact mul_le_mul (mul_le_mul hk hj (norm_nonneg _) (le_trans (norm_nonneg _) hk)) + (norm_sub_le _ _) (norm_nonneg _) (mul_nonneg (le_trans (norm_nonneg _) hk) hJ) + · apply (norm_trace_mul_le_sum _ _ hb).trans + apply mul_le_mul_of_nonneg_left _ hB + apply Finset.sum_le_sum + intro i _ + apply Finset.sum_le_sum + intro j _ + change ‖wordHessianError κ (ws.map e) j i f y-κ y*schwartzWord (ws.map e) (G j i) y‖ ≤ _ + apply (norm_sub_le _ _).trans + apply add_le_add_right + rw [norm_mul] + exact mul_le_mul_of_nonneg_right hk (norm_nonneg _) +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/LocalDeterminantEquation.lean b/lean/OAI/Geometry/PrescribedRicci/LocalDeterminantEquation.lean new file mode 100644 index 0000000000000000000000000000000000000000..71c21b2872c3dd5652f9f0d4a720922266cb894f --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/LocalDeterminantEquation.lean @@ -0,0 +1,132 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.CofactorBilin +import OAI.Geometry.PrescribedRicci.DeterminantJet +import OAI.Geometry.PrescribedRicci.SchwartzHessianWords + +namespace OAI + +/-! Local Determinant Equation. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix LineDeriv +open scoped ContDiff SchwartzMap Classical Matrix.Norms.Elementwise BoundedContinuousFunction +namespace TameInterpolation +open SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] {ι : Type*} +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma cword_eventuallyEq (e : ι → E) (ws : List ι) {f g : E → ℂ} {x : E} + (h : f =ᶠ[𝓝 x] g) : cword e f ws =ᶠ[𝓝 x] cword e g ws := by + induction ws with + | nil => exact h + | cons a ws ih => + filter_upwards [ih.fderiv (𝕜:=ℝ)] with y hy + exact congrArg (fun L : E →L[ℝ] ℂ => L (e a)) hy +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma cword_add (e : ι → E) (ws : List ι) (f g : E → ℂ) + (hf : ContDiff ℝ ∞ f) (hg : ContDiff ℝ ∞ g) : + cword e (fun x => f x+g x) ws = fun x => cword e f ws x+cword e g ws x := by + induction ws with + | nil => rfl + | cons a ws ih => + change cdir (e a) (cword e (fun x => f x+g x) ws) = _ + rw [ih] + funext x + unfold cdir + rw [fderiv_fun_add ((cword_smooth e hf ws).differentiable (by simp) x) + ((cword_smooth e hg ws).differentiable (by simp) x)] + rfl +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma cwordSchwartz_general (e : ι → E) (f : 𝓢(E,ℂ)) (ws : List ι) : + cword e f ws = (schwartzWord (ws.map e) f : E → ℂ) := by + induction ws with + | nil => rfl + | cons a ws ih => + change cdir (e a) (cword e f ws) = _ + rw [ih,cdir_schwartz] + rfl +end TameInterpolation +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart FrozenPoisson MetricLocalization TameInterpolation +variable {d : ℕ} +lemma cofactorBilin_inverse_det (H : Matrix (Fin d) (Fin d) ℂ) (h : IsUnit H.det) : + cofactorBilin H.det⁻¹ H = traceBilin H := by + ext B + rw [cofactorBilin_apply,NonlinearHessian.detDifferential,MongeAmpere.real_fderiv_det_apply H _ h] + rw [← mul_assoc,inv_mul_cancel₀ h.ne_zero,one_mul] + rfl + +lemma schwartz_real_trace_expression (H : Matrix (Fin d) (Fin d) ℂ) (h : IsUnit H.det) + (f : 𝓢(EC d,ℂ)) (hr : ∀ x, (f x).im = 0) (y : EC d) : + ∑ i, ∑ j, (traceBilin H (rankTwo (stdOrthonormalBasis ℝ (EC d) i) + (stdOrthonormalBasis ℝ (EC d) j)) : ℂ) * + fderiv ℝ (fderiv ℝ f) y (stdOrthonormalBasis ℝ (EC d) i) (stdOrthonormalBasis ℝ (EC d) j) = + (((H⁻¹ * (show Matrix (Fin d) (Fin d) ℂ from fun i j => hessianEntrySchwartz i j f y)).trace).re : ℂ) := by + have he : (f : EC d → ℂ) =ᶠ[𝓝 y] Complex.ofRealCLM ∘ (fun x => (f x).re) := by + filter_upwards [] with x + exact Complex.ext rfl (by simpa using hr x) + have hh := cofactor_smooth_expression (Complex.reCLM.contDiff.comp f.smooth').contDiffAt f he H.det⁻¹ H + rw [cofactorBilin_inverse_det H h,NonlinearHessian.detDifferential] at hh + erw [MongeAmpere.real_fderiv_det_apply H _ h, + ← mul_assoc,inv_mul_cancel₀ h.ne_zero,one_mul] at hh + exact hh.symm + +lemma wordHessian_trace_cutoff (κ f : 𝓢(EC d,ℂ)) (ws : List (EC d)) + (G H : Fin d → Fin d → 𝓢(EC d,ℂ)) (y : EC d) + (he : ∀ i j, (H i j : EC d → ℂ) =ᶠ[𝓝 y] + (fun x => G i j x+hessianEntrySchwartz i j f x)) : + (show Matrix (Fin d) (Fin d) ℂ from fun i j => hessianEntrySchwartz i j (SchwartzMap.smulLeftCLM ℂ κ (schwartzWord ws f)) y) = + κ y • (show Matrix (Fin d) (Fin d) ℂ from fun i j => schwartzWord ws (H i j) y) + + (show Matrix (Fin d) (Fin d) ℂ from fun i j => wordHessianError κ ws i j f y-κ y*schwartzWord ws (G i j) y) := by + ext i j + change _ = κ y * schwartzWord ws (H i j) y + (wordHessianError κ ws i j f y-κ y*schwartzWord ws (G i j) y) + rw [wordHessianError_identity] + simp only [_root_.add_apply,SchwartzMap.smulLeftCLM_apply_apply κ.hasTemperateGrowth, + smul_eq_mul] + have hh := (cword_eventuallyEq id ws (he i j)).eq_of_nhds + erw [cword_add id ws (G i j : EC d → ℂ) (hessianEntrySchwartz i j f : EC d → ℂ) (G i j).smooth' (hessianEntrySchwartz i j f).smooth'] at hh + simp only [cwordSchwartz_general,List.map_id] at hh + rw [hh] + ring + + + +theorem determinant_word_cutoff_trace + {ι : Type*} (e : ι → EC d) (ws : List ι) (hw : ws ≠ []) + (κ f : 𝓢(EC d,ℂ)) (G H : Fin d → Fin d → 𝓢(EC d,ℂ)) + (ρ : 𝓢(EC d,ℂ)) (y : EC d) + (he : ∀ i j, (H i j : EC d → ℂ) =ᶠ[𝓝 y] + (fun x => G i j x+hessianEntrySchwartz i j f x)) + (hρ : (fun x => (show Matrix (Fin d) (Fin d) ℂ from fun i j => H i j x).det) =ᶠ[𝓝 y] ρ) + (hinv : IsUnit (show Matrix (Fin d) (Fin d) ℂ from fun i j => H i j y).det) : + (((show Matrix (Fin d) (Fin d) ℂ from fun i j => H i j y)⁻¹) * + (show Matrix (Fin d) (Fin d) ℂ from fun i j => hessianEntrySchwartz i j (SchwartzMap.smulLeftCLM ℂ κ (schwartzWord (ws.map e) f)) y)).trace = + κ y * (show Matrix (Fin d) (Fin d) ℂ from fun i j => H i j y).det⁻¹ * + (schwartzWord (ws.map e) ρ y-detJetRemainder e (fun x i j => H i j x) ws y) + + (((show Matrix (Fin d) (Fin d) ℂ from fun i j => H i j y)⁻¹) * + (show Matrix (Fin d) (Fin d) ℂ from fun i j => wordHessianError κ (ws.map e) i j f y-κ y*schwartzWord (ws.map e) (G i j) y)).trace := by + let M : Matrix (Fin d) (Fin d) ℂ := fun i j => H i j y + have hd := cword_det_trace e (fun x i j => H i j x) (fun i j => (H i j).smooth') ws hw y hinv + have hdρ := (cword_eventuallyEq e ws hρ).eq_of_nhds + rw [cwordSchwartz_general] at hdρ + rw [hdρ] at hd + simp only [cwordSchwartz_general] at hd + have ht : ((M⁻¹ * (show Matrix (Fin d) (Fin d) ℂ from fun i j => schwartzWord (ws.map e) (H i j) y)).trace) = + M.det⁻¹ * (schwartzWord (ws.map e) ρ y-detJetRemainder e (fun x i j => H i j x) ws y) := by + have hh := congrArg (fun z : ℂ => M.det⁻¹*z) (sub_eq_iff_eq_add.mpr hd) + simpa only [M,← mul_assoc,inv_mul_cancel₀ hinv.ne_zero,one_mul] using hh.symm + rw [wordHessian_trace_cutoff κ f (ws.map e) G H y he] + rw [Matrix.mul_add,Matrix.mul_smul,trace_add,trace_smul] + change κ y * (M⁻¹ * _).trace + _ = _ + rw [ht] + ring +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/LocalDeterminantGain.lean b/lean/OAI/Geometry/PrescribedRicci/LocalDeterminantGain.lean new file mode 100644 index 0000000000000000000000000000000000000000..edad29ad06dd84986a114b6bfe77089ad9b71221 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/LocalDeterminantGain.lean @@ -0,0 +1,117 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.LocalDeterminantBound + +namespace OAI + +/-! Local Determinant Gain. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix _root_.MeasureTheory _root_.OAI.MeasureTheory LineDeriv +open scoped ContDiff SchwartzMap Classical Matrix.Norms.Elementwise BoundedContinuousFunction ENNReal +open scoped ComplexOrder MatrixOrder +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] {Z : Type*} +lemma UniformSobolev.neg {s : ℝ} {F : Z → 𝓢(E,ℂ)} (hF : UniformSobolev s F) : + UniformSobolev s (fun z => -F z) := by + obtain ⟨C,hC,hc⟩ := hF + refine ⟨C,hC,fun z => ?_⟩ + have he : schwartzCoord s (-F z) = -schwartzCoord s (F z) := by + simpa only [neg_one_smul] using schwartzCoord_smul s (-1) (F z) + change ‖schwartzCoord s (-F z)‖ ≤ C + rw [he,norm_neg] + exact hc z + +lemma UniformSobolev.sub {s : ℝ} {F G : Z → 𝓢(E,ℂ)} + (hF : UniformSobolev s F) (hG : UniformSobolev s G) : + UniformSobolev s (fun z => F z-G z) := by + simpa only [sub_eq_add_neg] using hF.add hG.neg +end SobolevChart +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart FrozenPoisson MetricLocalization TameInterpolation +variable {d : ℕ} [Nonempty (Fin d)] {Z : Type*} + +lemma uniform_determinant_word_differential + {ι : Type*} [Fintype ι] [Nonempty ι] (e : ι → EC d) (ws : List ι) (hw : ws ≠ []) + (κ : 𝓢(EC d,ℂ)) (f ρ : Z → 𝓢(EC d,ℂ)) (G H : Z → Fin d → Fin d → 𝓢(EC d,ℂ)) + (c : Z → BasisIndex d → BasisIndex d → EC d →ᵇ ℂ) + (hc : ∀ z i j, (c z i j : EC d → ℂ).HasTemperateGrowth) + (hec : ∀ z y, y ∈ tsupport (κ : EC d → ℂ) → ∀ i j, + c z i j y = (traceBilin (fun k l => H z k l y) + (rankTwo (stdOrthonormalBasis ℝ (EC d) i) (stdOrthonormalBasis ℝ (EC d) j)) : ℂ)) + (hr : ∀ z y, (SchwartzMap.smulLeftCLM ℂ κ (schwartzWord (ws.map e) (f z)) y).im = 0) + (he : ∀ z y, y ∈ tsupport (κ : EC d → ℂ) → ∀ i j, + (H z i j : EC d → ℂ) =ᶠ[𝓝 y] (fun x => G z i j x+hessianEntrySchwartz i j (f z) x)) + (heρ : ∀ z y, y ∈ tsupport (κ : EC d → ℂ) → + (fun x => (show Matrix (Fin d) (Fin d) ℂ from fun i j => H z i j x).det) =ᶠ[𝓝 y] ρ z) + (hinv : ∀ z y, y ∈ tsupport (κ : EC d → ℂ) → + IsUnit (show Matrix (Fin d) (Fin d) ℂ from fun i j => H z i j y).det) + {B J : ℝ} (hB : 0 ≤ B) (hJ : 0 ≤ J) + (hb : ∀ z y, y ∈ tsupport (κ : EC d → ℂ) → ∀ i j, + ‖(show Matrix (Fin d) (Fin d) ℂ from fun i j => H z i j y)⁻¹ i j‖ ≤ B) + (hj : ∀ z y, y ∈ tsupport (κ : EC d → ℂ) → + ‖(show Matrix (Fin d) (Fin d) ℂ from fun i j => H z i j y).det⁻¹‖ ≤ J) + (hF : UniformSobolev ((ws.length:ℝ)+1) f) + (hρ : UniformSobolev (ws.length:ℝ) ρ) + (hG : ∀ i j, UniformSobolev (ws.length:ℝ) (fun z => G z i j)) + (hHc : ∀ z i j, HasCompactSupport (H z i j : EC d → ℂ)) + (hH0 : ∀ σ : Equiv.Perm (Fin d), ∃ A : ℝ, 0 ≤ A ∧ ∀ z, + familyJetNorm e (realComponents (initialJet e (fun i x => H z (σ i) i x))) 0 ∞ ≤ A) + (hHS : ∀ i j, UniformSobolev ((ws.length:ℝ)-1) (fun z => H z i j)) : + UniformSobolev 0 (fun z => schwartzDifferential (c z) + (SchwartzMap.smulLeftCLM ℂ κ (schwartzWord (ws.map e) (f z)))) := by + let K := ‖κ.toBoundedContinuousFunction‖ + have hK : 0 ≤ K := norm_nonneg _ + have hk (y) : ‖κ y‖ ≤ K := κ.toBoundedContinuousFunction.norm_coe_le_norm y + let R (z : Z) := detJetRemainder e (fun x i j => H z i j x) ws + have hR : UniformL2 R := detJetRemainder_uniformL2 e H hHc ws hH0 hHS + have hp : UniformL2 (fun z x => ‖schwartzWord (ws.map e) (ρ z) x‖) := + (hρ.word (ws.map e) (by simp)).uniformL2.norm + have herr (i j) : UniformL2 (fun z x => ‖wordHessianError κ (ws.map e) i j (f z) x‖) := by + apply UniformL2.norm + apply UniformSobolev.uniformL2 + apply hF.of_coreBound + simpa only [List.length_map] using wordHessianError_bound κ (ws.map e) i j + have hbg (i j) : UniformL2 (fun z x => K*‖schwartzWord (ws.map e) (G z i j) x‖) := by + simpa only [smul_eq_mul] using ((hG i j).word (ws.map e) (by simp)).uniformL2.norm.smul K + have hmajor : UniformL2 (fun z y => + K*J*(‖schwartzWord (ws.map e) (ρ z) y‖+‖R z y‖)+ + B*∑ i, ∑ j, (‖wordHessianError κ (ws.map e) j i (f z) y‖+ + K*‖schwartzWord (ws.map e) (G z j i) y‖)) := by + simpa only [smul_eq_mul] using ((hp.add hR.norm).smul (K*J)).add + ((UniformL2.sum Finset.univ (fun i => fun z y => ∑ j, (‖wordHessianError κ (ws.map e) j i (f z) y‖+ + K*‖schwartzWord (ws.map e) (G z j i) y‖)) (fun i _ => + UniformL2.sum Finset.univ _ (fun j _ => (herr j i).add (hbg j i)))).smul B) + apply UniformSobolev.zero_of_majorant hmajor + intro z y + by_cases hy : y ∈ tsupport (κ : EC d → ℂ) + · rw [schwartzDifferential_apply _ (hc z)] + have hsum : (∑ i, ∑ j, c z i j y * + fderiv ℝ (fderiv ℝ (SchwartzMap.smulLeftCLM ℂ κ (schwartzWord (ws.map e) (f z)))) y + (stdOrthonormalBasis ℝ (EC d) i) (stdOrthonormalBasis ℝ (EC d) j)) = + (((show Matrix (Fin d) (Fin d) ℂ from fun i j => H z i j y)⁻¹ * + (show Matrix (Fin d) (Fin d) ℂ from fun i j => hessianEntrySchwartz i j + (SchwartzMap.smulLeftCLM ℂ κ (schwartzWord (ws.map e) (f z))) y)).trace.re : ℂ) := by + simp_rw [hec z y hy] + exact schwartz_real_trace_expression _ (hinv z y hy) _ (hr z) y + rw [hsum,Complex.norm_real,Real.norm_eq_abs] + exact (Complex.abs_re_le_norm _).trans + (determinant_word_cutoff_bound e ws hw κ (f z) (G z) (H z) (ρ z) y + (he z y hy) (heρ z y hy) (hinv z y hy) hB hJ (hb z y hy) (hj z y hy) (hk y)) + · have hzero : schwartzDifferential (c z) (SchwartzMap.smulLeftCLM ℂ κ (schwartzWord (ws.map e) (f z))) y = 0 := + image_eq_zero_of_notMem_tsupport (fun ht => hy (((schwartzDifferential_tsupport _ _).trans + ((SchwartzMap.tsupport_smulLeftCLM_subset _ _).trans inter_subset_right)) ht)) + rw [hzero,norm_zero] + exact add_nonneg (mul_nonneg (mul_nonneg hK hJ) (add_nonneg (norm_nonneg _) (norm_nonneg _))) + (mul_nonneg hB (Finset.sum_nonneg fun i _ => Finset.sum_nonneg fun j _ => + add_nonneg (norm_nonneg _) (mul_nonneg hK (norm_nonneg _)))) +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/LocalKahlerEnergy.lean b/lean/OAI/Geometry/PrescribedRicci/LocalKahlerEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..1446a7d95bf91a2b897d2b3e9275d74542164774 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/LocalKahlerEnergy.lean @@ -0,0 +1,220 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.ComplexIntegrationByParts + +namespace OAI + +/-! Local Kahler Energy. -/ + +noncomputable section +open Matrix Filter Set Topology MeasureTheory +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth +namespace KaehlerMetric +variable {d : ℕ} + +def holRealForm (j : Fin d) : (Coordinates d →L[ℝ] ℝ) →L[ℝ] ℂ := + LinearMap.toContinuousLinearMap + { toFun := fun L => (2 : ℂ)⁻¹ * ((L (coordinateVector j) : ℂ) - + Complex.I * (L (Complex.I • coordinateVector j) : ℂ)) + map_add' := by intro L M; simp; ring + map_smul' := by intro c L; simp [smul_eq_mul, Complex.real_smul]; ring } + +def holRealDeriv (φ : Coordinates d → ℝ) (z : Coordinates d) (j : Fin d) : ℂ := + holRealForm j (fderiv ℝ φ z) + +lemma contDiffAt_holRealDeriv {φ : Coordinates d → ℝ} {z : Coordinates d} + (hφ : ContDiffAt ℝ ∞ φ z) (j : Fin d) : + ContDiffAt ℝ ∞ (fun y => holRealDeriv φ y j) z := + (holRealForm j).contDiff.contDiffAt.comp z (hφ.fderiv_right (by simp)) + +lemma fderiv_holRealDeriv {φ : Coordinates d → ℝ} {z : Coordinates d} + (hφ : ContDiffAt ℝ ∞ φ z) (j : Fin d) (v : Coordinates d) : + fderiv ℝ (fun y => holRealDeriv φ y j) z v = + holRealForm j (fderiv ℝ (fderiv ℝ φ) z v) := by + have hd := ((holRealForm j).hasFDerivAt.comp z + ((hφ.fderiv_right (m := ∞) (by simp)).differentiableAt (by simp)).hasFDerivAt).fderiv + exact congrArg (fun L : Coordinates d →L[ℝ] ℂ => L v) hd + +lemma barDeriv_holRealDeriv {φ : Coordinates d → ℝ} {z : Coordinates d} + (hφ : ContDiffAt ℝ ∞ φ z) (i j : Fin d) : + barDeriv (fun y => holRealDeriv φ y j) z i = PotentialKaehler.potentialMatrix φ z i j := by + unfold barDeriv + rw [fderiv_holRealDeriv hφ, fderiv_holRealDeriv hφ] + simp only [PotentialKaehler.potentialMatrix, PotentialKaehler.hermitianPartMatrix_apply, + PotentialKaehler.hermitianPart, holRealForm] + apply Complex.ext <;> simp <;> ring + +lemma barDeriv_mul {f h : Coordinates d → ℂ} {z : Coordinates d} + (hf : DifferentiableAt ℝ f z) (hh : DifferentiableAt ℝ h z) (i : Fin d) : + barDeriv (fun y => f y * h y) z i = + barDeriv f z i * h z + f z * barDeriv h z i := by + unfold barDeriv + rw [fderiv_fun_mul hf hh] + simp only [_root_.add_apply, _root_.smul_apply, smul_eq_mul] + ring + +def entryCLM (i j : Fin d) : Matrix (Fin d) (Fin d) ℂ →L[ℝ] ℂ := + (ContinuousLinearMap.proj j : (Fin d → ℂ) →L[ℝ] ℂ).comp + (ContinuousLinearMap.proj i : Matrix (Fin d) (Fin d) ℂ →L[ℝ] (Fin d → ℂ)) + +lemma fderiv_entry {f : Coordinates d → Matrix (Fin d) (Fin d) ℂ} {z : Coordinates d} + (hf : DifferentiableAt ℝ f z) (i j : Fin d) (v : Coordinates d) : + fderiv ℝ (fun y => f y i j) z v = fderiv ℝ f z v i j := by + exact congrArg (fun L : Coordinates d →L[ℝ] ℂ => L v) + (((entryCLM i j).hasFDerivAt.comp z hf.hasFDerivAt).fderiv) + +lemma barDeriv_entry {f : Coordinates d → Matrix (Fin d) (Fin d) ℂ} {z : Coordinates d} + (hf : DifferentiableAt ℝ f z) (i j k : Fin d) : + barDeriv (fun y => f y j k) z i = barDerivative f z i j k := by + unfold barDeriv barDerivative + rw [fderiv_entry hf, fderiv_entry hf] + rfl + +lemma barDeriv_sum {ι : Type*} [Fintype ι] {f : ι → Coordinates d → ℂ} + {z : Coordinates d} (hf : ∀ k, DifferentiableAt ℝ (f k) z) (i : Fin d) : + barDeriv (fun y => ∑ k, f k y) z i = ∑ k, barDeriv (f k) z i := by + unfold barDeriv + rw [fderiv_fun_sum (fun k _ => hf k)] + simp only [_root_.sum_apply, Finset.mul_sum, mul_add, Finset.sum_add_distrib] + +lemma contDiffAt_barDeriv {f : Coordinates d → ℂ} {z : Coordinates d} + (hf : ContDiffAt ℝ ∞ f z) (i : Fin d) : + ContDiffAt ℝ ∞ (fun y => barDeriv f y i) z := + contDiffAt_const.mul ((contDiffAt_deriv_direction hf _).add + (contDiffAt_const.mul (contDiffAt_deriv_direction hf _))) + +variable {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +lemma contDiffAt_weightedInverse_matrix (g : KaehlerMetric A) (a : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart a).target) : + ContDiffAt ℝ ∞ (MongeAmpere.weightedInverse ∘ g.matrix a) z := by + have hd : IsUnit (g.matrix a z).det := isUnit_iff_ne_zero.mpr + (ne_of_gt (g.positive a z hz).det_pos) + exact ((MongeAmpere.contDiffAt_weightedInverse _ hd).restrict_scalars ℝ).comp z + ((g.smooth a).contDiffAt ((A.chart a).open_target.mem_nhds hz)) + +lemma weightedInverse_entry_divergence (g : KaehlerMetric A) (a : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart a).target) (k : Fin d) : + ∑ i, barDeriv (fun y => MongeAmpere.weightedInverse (g.matrix a y) k i) z i = 0 := by + have hd := (g.contDiffAt_weightedInverse_matrix a hz).differentiableAt (by simp) + calc + _ = ∑ i, barDerivative (MongeAmpere.weightedInverse ∘ g.matrix a) z i k i := + Finset.sum_congr rfl (fun i _ => barDeriv_entry hd i k i) + _ = 0 := g.weightedInverse_divergence a hz k + +def cofactorFlux (g : KaehlerMetric A) (φ : SmoothRealFunction A) + (a : Fin A.count) (z : Coordinates d) (i : Fin d) : ℂ := + ∑ j, MongeAmpere.weightedInverse (g.matrix a z) j i * holRealDeriv (φ.localExpression a) z j + +lemma contDiffAt_cofactorFlux (g : KaehlerMetric A) (φ : SmoothRealFunction A) + (a : Fin A.count) {z : Coordinates d} (hz : z ∈ (A.chart a).target) (i : Fin d) : + ContDiffAt ℝ ∞ (fun y => g.cofactorFlux φ a y i) z := by + apply ContDiffAt.sum + intro j _ + exact ((entryCLM j i).contDiff.contDiffAt.comp z + (g.contDiffAt_weightedInverse_matrix a hz)).mul + (contDiffAt_holRealDeriv + ((φ.smooth a).contDiffAt ((A.chart a).open_target.mem_nhds hz)) j) + +theorem cofactorFlux_divergence (g : KaehlerMetric A) (φ : SmoothRealFunction A) + (a : Fin A.count) {z : Coordinates d} (hz : z ∈ (A.chart a).target) : + ∑ i, barDeriv (fun y => g.cofactorFlux φ a y i) z i = + (g.matrix a z).det * ((g.matrix a z)⁻¹ * φ.hessian a z).trace := by + have hφ := (φ.smooth a).contDiffAt ((A.chart a).open_target.mem_nhds hz) + have hQ := g.contDiffAt_weightedInverse_matrix a hz + have hent (j i : Fin d) : DifferentiableAt ℝ + (fun y => MongeAmpere.weightedInverse (g.matrix a y) j i) z := + ((entryCLM j i).contDiff.contDiffAt.comp z hQ).differentiableAt (by simp) + have hhol (j : Fin d) := (contDiffAt_holRealDeriv hφ j).differentiableAt (by simp) + have he (i : Fin d) : barDeriv (fun y => g.cofactorFlux φ a y i) z i = + ∑ j, (barDeriv (fun y => MongeAmpere.weightedInverse (g.matrix a y) j i) z i * + holRealDeriv (φ.localExpression a) z j + + MongeAmpere.weightedInverse (g.matrix a z) j i * φ.hessian a z i j) := by + calc + _ = ∑ j, barDeriv (fun y => MongeAmpere.weightedInverse (g.matrix a y) j i * + holRealDeriv (φ.localExpression a) y j) z i := + barDeriv_sum (f := fun j y => MongeAmpere.weightedInverse (g.matrix a y) j i * + holRealDeriv (φ.localExpression a) y j) (fun j => (hent j i).mul (hhol j)) i + _ = _ := by + apply Finset.sum_congr rfl + intro j _ + exact (barDeriv_mul (hent j i) (hhol j) i).trans + (congrArg (fun c : ℂ => barDeriv + (fun y => MongeAmpere.weightedInverse (g.matrix a y) j i) z i * + holRealDeriv (φ.localExpression a) z j + + MongeAmpere.weightedInverse (g.matrix a z) j i * c) + (barDeriv_holRealDeriv hφ i j)) + simp_rw [he, Finset.sum_add_distrib] + have hc : (∑ i, ∑ j, + barDeriv (fun y => MongeAmpere.weightedInverse (g.matrix a y) j i) z i * + holRealDeriv (φ.localExpression a) z j) = 0 := by + rw [Finset.sum_comm] + simp only [← Finset.sum_mul, g.weightedInverse_entry_divergence a hz, zero_mul, + Finset.sum_const_zero] + rw [hc, zero_add] + simp only [MongeAmpere.weightedInverse, Matrix.smul_apply, smul_eq_mul, + Matrix.trace, Matrix.diag, Matrix.mul_apply, Finset.mul_sum] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + ring + +lemma integrable_mul_barDeriv_local {f h : Coordinates d → ℂ} + (hf : ContDiff ℝ ∞ f) (hh : ∀ z ∈ tsupport f, ContDiffAt ℝ ∞ h z) + (hc : HasCompactSupport f) (i : Fin d) : + Integrable (fun z => f z * barDeriv h z i) := by + have he : (fun z => f z * barDeriv h z i) = + fun z => (2 : ℂ)⁻¹ * (f z * fderiv ℝ h z (coordinateVector i)) + + ((2 : ℂ)⁻¹ * Complex.I) * (f z * fderiv ℝ h z (Complex.I • coordinateVector i)) := by + funext z + unfold barDeriv + ring + rw [he] + exact ((integrable_mul_deriv_local hf hh hc _).const_mul _).add + ((integrable_mul_deriv_local hf hh hc _).const_mul _) + +lemma integrable_barDeriv_mul_local {f h : Coordinates d → ℂ} + (hf : ContDiff ℝ ∞ f) (hh : ∀ z ∈ tsupport f, ContDiffAt ℝ ∞ h z) + (hc : HasCompactSupport f) (i : Fin d) : + Integrable (fun z => barDeriv f z i * h z) := by + have he : (fun z => barDeriv f z i * h z) = + fun z => (2 : ℂ)⁻¹ * (fderiv ℝ f z (coordinateVector i) * h z) + + ((2 : ℂ)⁻¹ * Complex.I) * (fderiv ℝ f z (Complex.I • coordinateVector i) * h z) := by + funext z + unfold barDeriv + ring + rw [he] + exact ((integrable_deriv_mul_local hf hh hc _).const_mul _).add + ((integrable_deriv_mul_local hf hh hc _).const_mul _) + +theorem integral_cofactorFlux (g : KaehlerMetric A) (φ : SmoothRealFunction A) + (a : Fin A.count) {ψ : Coordinates d → ℂ} + (hψ : ContDiff ℝ ∞ ψ) (hc : HasCompactSupport ψ) + (hs : tsupport ψ ⊆ (A.chart a).target) : + (∫ z, ψ z * ((g.matrix a z).det * ((g.matrix a z)⁻¹ * φ.hessian a z).trace)) = + -(∫ z, ∑ i, barDeriv ψ z i * g.cofactorFlux φ a z i) := by + have hd (i : Fin d) : ∀ z ∈ tsupport ψ, + ContDiffAt ℝ ∞ (fun y => g.cofactorFlux φ a y i) z := + fun z hz => g.contDiffAt_cofactorFlux φ a (hs hz) i + have hleft : (fun z => ψ z * ((g.matrix a z).det * + ((g.matrix a z)⁻¹ * φ.hessian a z).trace)) = + fun z => ∑ i, ψ z * barDeriv (fun y => g.cofactorFlux φ a y i) z i := by + funext z + rw [← Finset.mul_sum] + by_cases hz : z ∈ tsupport ψ + · rw [g.cofactorFlux_divergence φ a (hs hz)] + · simp [image_eq_zero_of_notMem_tsupport hz] + rw [hleft, integral_finsetSum _ (fun i _ => + integrable_mul_barDeriv_local hψ (hd i) hc i)] + simp_rw [integral_mul_barDeriv_local hψ (hd _) hc] + rw [Finset.sum_neg_distrib, integral_finsetSum _ (fun i _ => + integrable_barDeriv_mul_local hψ (hd i) hc i)] + +end KaehlerMetric +end Anticanonical.SourceSmooth + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/LocalizedPathData.lean b/lean/OAI/Geometry/PrescribedRicci/LocalizedPathData.lean new file mode 100644 index 0000000000000000000000000000000000000000..57fdd9264a7755acd1f2f8ed039b7caa9e9b8038 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/LocalizedPathData.lean @@ -0,0 +1,120 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalMetricEntries +import OAI.Geometry.PrescribedRicci.PathUniformForcing + +namespace OAI + +/-! Localized Path Data. -/ + +section + + +noncomputable section +open Set Filter Topology Matrix LineDeriv +open scoped ContDiff SchwartzMap Classical ComplexOrder MatrixOrder Matrix.Norms.Elementwise +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} + +def cutMetric (g : KaehlerMetric A) (q : Fin A.count) + (σ : ChartCutoff (A.euclideanChart q).target) (i j : Fin d) : 𝓢(EC d,ℂ) := + σ.product (A.euclideanChart q).open_target + (contDiffOn_pi.mp (contDiffOn_pi.mp (GluingData.metric_euclidean_smooth g q) i) j) + +omit [T2Space X] [CompactSpace X] in +lemma cutMetric_apply (g : KaehlerMetric A) (q : Fin A.count) + (σ : ChartCutoff (A.euclideanChart q).target) (i j : Fin d) (y : EC d) : + cutMetric g q σ i j y = σ y*g.matrix q (coordinateEquiv d y) i j := rfl + +lemma localize_cutoff_germ (q : Fin A.count) (τ : ChartCutoff (A.euclideanChart q).target) + (F : Smooth A) {y : EC d} (_hy : y ∈ (A.euclideanChart q).target) + (hτ : (τ : EC d → ℂ) =ᶠ[𝓝 y] fun _ => 1) : + (localize A q (cutoffGlobal q τ) (cutoffGlobal_support q τ) F : EC d → ℂ) =ᶠ[𝓝 y] + F ∘ (A.euclideanChart q).symm := by + rw [localize_cutoff_product] + filter_upwards [hτ] with x hx + simp only [ChartCutoff.product_apply,hx,one_mul,Function.comp_apply] + +lemma localized_hessian_germ (q : Fin A.count) (τ : ChartCutoff (A.euclideanChart q).target) + (φ : SmoothRealFunction A) {y : EC d} (hy : y ∈ (A.euclideanChart q).target) + (hτ : (τ : EC d → ℂ) =ᶠ[𝓝 y] fun _ => 1) (i j : Fin d) : + (hessianEntrySchwartz i j (localize A q (cutoffGlobal q τ) (cutoffGlobal_support q τ) + (Smooth.ofReal φ)) : EC d → ℂ) =ᶠ[𝓝 y] + (fun x => φ.hessian q (coordinateEquiv d x) i j) := by + have hev := (localize_cutoff_germ q τ (Smooth.ofReal φ) hy hτ).eventuallyEq_nhds + filter_upwards [hev,(A.euclideanChart q).open_target.mem_nhds hy] with x hx hxt + let u : EC d → ℝ := φ.localExpression q ∘ coordinateEquiv d + have hu : ContDiffAt ℝ ∞ u x := (φ.euclidean_smooth q).contDiffAt + (by simpa only [ComplexAtlas.euclideanChart_target] using (A.euclideanChart q).open_target.mem_nhds hxt) + have he : (Smooth.ofReal φ : X → ℂ) ∘ (A.euclideanChart q).symm = Complex.ofRealCLM ∘ u := rfl + rw [he] at hx + rw [hessianEntrySchwartz_real hu _ hx i j,pullBilin_hessian hu] + have hcomp : u ∘ (coordinateEquiv d).symm = φ.localExpression q := by + funext z; simp [u] + rw [hcomp] + rfl + +lemma cutMetric_deform (g : KaehlerMetric A) (q : Fin A.count) + (σ τ : ChartCutoff (A.euclideanChart q).target) + (hτ : ∀ y ∈ tsupport (σ : EC d → ℂ), (τ : EC d → ℂ) =ᶠ[𝓝 y] fun _ => 1) + (φ : SmoothRealFunction A) (hp : g.PositivePotential φ) (i j : Fin d) : + cutMetric (g.deform φ hp) q σ i j = cutMetric g q σ i j+ + SchwartzMap.smulLeftCLM ℂ σ.val (hessianEntrySchwartz i j + (localize A q (cutoffGlobal q τ) (cutoffGlobal_support q τ) (Smooth.ofReal φ))) := by + ext y + simp only [_root_.add_apply, SchwartzMap.smulLeftCLM_apply_apply σ.val.hasTemperateGrowth, smul_eq_mul] + by_cases hy : y ∈ tsupport (σ : EC d → ℂ) + · have hh := (localized_hessian_germ q τ φ (σ.support_sub hy) (hτ y hy) i j).eq_of_nhds + change σ y*(g.matrix q (coordinateEquiv d y) i j+φ.hessian q (coordinateEquiv d y) i j) = + σ y*g.matrix q (coordinateEquiv d y) i j+σ y*_ + rw [hh,mul_add] + · have hh : σ y = 0 := image_eq_zero_of_notMem_tsupport hy + change σ y*_ = σ y*_+σ y*_ + rw [hh]; ring + +lemma cutMetric_deform_germ (g : KaehlerMetric A) (q : Fin A.count) + (σ τ : ChartCutoff (A.euclideanChart q).target) (φ : SmoothRealFunction A) (hp : g.PositivePotential φ) + {y : EC d} (hy : y ∈ (A.euclideanChart q).target) + (hσ : (σ : EC d → ℂ) =ᶠ[𝓝 y] fun _ => 1) + (hτ : (τ : EC d → ℂ) =ᶠ[𝓝 y] fun _ => 1) (i j : Fin d) : + (cutMetric (g.deform φ hp) q σ i j : EC d → ℂ) =ᶠ[𝓝 y] + (fun x => cutMetric g q σ i j x+hessianEntrySchwartz i j + (localize A q (cutoffGlobal q τ) (cutoffGlobal_support q τ) (Smooth.ofReal φ)) x) := by + filter_upwards [hσ,localized_hessian_germ q τ φ hy hτ i j] with x hx hh + simp only [cutMetric_apply,hx,one_mul] + rw [hh] + rfl + +lemma schwartzWord_real {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] (ws : List E) (F : 𝓢(E,ℂ)) (hF : ∀ x, (F x).im = 0) : + ∀ x, (schwartzWord ws F x).im = 0 := by + induction ws with + | nil => exact hF + | cons v ws ih => + intro x + let G := schwartzWord ws F + have he : (fun y => (G y).im) = fun _ => (0:ℝ) := funext ih + have hh := congrArg (fun L : E →L[ℝ] ℝ => L v) + ((Complex.imCLM.hasFDerivAt.comp x G.differentiableAt.hasFDerivAt).fderiv) + change fderiv ℝ (fun y => (G y).im) x v = (fderiv ℝ G x v).im at hh + rw [he] at hh + simp only [schwartzWord,ContinuousLinearMap.comp_apply,lineDerivOpCLM_apply] + rw [SchwartzMap.lineDerivOp_apply_eq_fderiv] + change (fderiv ℝ G x v).im = 0 + rw [← hh] + simp + +lemma localize_cutoff_real (q : Fin A.count) (τ : ChartCutoff (A.euclideanChart q).target) + (hτ : ∀ y, (τ y).im = 0) (φ : SmoothRealFunction A) : + ∀ y, (localize A q (cutoffGlobal q τ) (cutoffGlobal_support q τ) (Smooth.ofReal φ) y).im = 0 := by + intro y + rw [localize_cutoff_product,ChartCutoff.product_apply] + change (τ y*(φ.value ((A.euclideanChart q).symm y):ℂ)).im = 0 + simp only [Complex.mul_im,Complex.ofReal_re,Complex.ofReal_im,hτ,zero_mul,mul_zero,add_zero] +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/LpPowerBounds.lean b/lean/OAI/Geometry/PrescribedRicci/LpPowerBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..15a4e9dd67db7c07112ce50371ff7f3f66776c4d --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/LpPowerBounds.lean @@ -0,0 +1,51 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.GlobalKahlerIntegral + +namespace OAI + +/-! Lp Power Bounds. -/ + +section + + + +noncomputable section +open MeasureTheory +open scoped ENNReal +namespace TameInterpolation +variable {Y : Type*} [MeasurableSpace Y] {μ : Measure Y} + +lemma lpNorm_mul_le {p q r : ℝ≥0∞} [ENNReal.HolderTriple p q r] + {f g : Y → ℝ} (hf : MemLp f p μ) (hg : MemLp g q μ) : + lpNorm (fun x => f x*g x) r μ ≤ lpNorm f p μ*lpNorm g q μ := by + have he := eLpNorm_smul_le_mul_eLpNorm (p:=p) (q:=q) (r:=r) + hf.aestronglyMeasurable hg.aestronglyMeasurable + change eLpNorm (fun x => f x*g x) r μ ≤ eLpNorm f p μ * eLpNorm g q μ at he + have hh := ENNReal.toReal_mono (ENNReal.mul_ne_top hf.eLpNorm_ne_top hg.eLpNorm_ne_top) he + simpa only [ENNReal.toReal_mul,toReal_eLpNorm] using hh + +lemma lpNorm_norm_rpow {E : Type*} [NormedAddCommGroup E] + (f : Y → E) (hf : AEStronglyMeasurable f μ) (p : ℝ≥0∞) {q : ℝ} (hq : 0 < q) : + lpNorm (fun x => ‖f x‖^q) p μ = (lpNorm f (p*ENNReal.ofReal q) μ)^q := by + rw [← toReal_eLpNorm,eLpNorm_norm_rpow f hf hq, + ← ENNReal.toReal_rpow,toReal_eLpNorm] + +lemma lpNorm_rpow_integral {E : Type*} [NormedAddCommGroup E] + (f : Y → E) (hf : AEStronglyMeasurable f μ) {p : ℝ} (hp : 0 < p) : + (lpNorm f (ENNReal.ofReal p) μ)^p = ∫ x, ‖f x‖^p ∂μ := by + rw [lpNorm_eq_integral_norm_rpow_toReal (by positivity : ENNReal.ofReal p ≠ 0) ENNReal.ofReal_ne_top hf, + ENNReal.toReal_ofReal hp.le] + rw [← Real.rpow_mul (integral_nonneg fun x => Real.rpow_nonneg (norm_nonneg _) _)] + simp [hp.ne'] + +lemma integral_norm_le_lpNorm {f : Y → ℝ} (hf : AEStronglyMeasurable f μ) : + |∫ x, f x ∂μ| ≤ lpNorm f 1 μ := by + rw [lpNorm_one_eq_integral_norm hf] + exact norm_integral_le_integral_norm f + +end TameInterpolation + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/MatrixCofactorOrder.lean b/lean/OAI/Geometry/PrescribedRicci/MatrixCofactorOrder.lean new file mode 100644 index 0000000000000000000000000000000000000000..fcd3a48c007b9e9e8ccd2dc9879cb426c4d02aa6 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/MatrixCofactorOrder.lean @@ -0,0 +1,114 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.DeterminantOrder + +namespace OAI + +/-! Matrix Cofactor Order. -/ + +section + + + +noncomputable section +open Matrix Filter Set Topology +open scoped ComplexOrder Matrix.Norms.Elementwise Classical +namespace MongeAmpere +variable {d : ℕ} +local notation "Mat" => Matrix (Fin d) (Fin d) ℂ + +def cofactorQuadratic (H : Mat) (v : Fin d → ℂ) : ℝ := + (H.det * (star v ⬝ᵥ (H⁻¹ *ᵥ v))).re + +lemma det_add_rankOne (H : Mat) (hH : IsUnit H.det) (v : Fin d → ℂ) (t : ℂ) : + (H + t • Matrix.vecMulVec v (star v)).det = H.det + t * (H.det * (star v ⬝ᵥ (H⁻¹ *ᵥ v))) := by + have hu : t • Matrix.vecMulVec v (star v) = + Matrix.replicateCol Unit (t • v) * Matrix.replicateRow Unit (star v) := by + ext i j + simp [Matrix.mul_apply, Matrix.vecMulVec, mul_assoc] + rw [hu, Matrix.det_add_replicateCol_mul_replicateRow hH] + rw [Matrix.det_unique (A := (1 + Matrix.replicateRow Unit (star v) * H⁻¹ * + Matrix.replicateCol Unit (t • v)))] + have hv : (Matrix.replicateRow Unit (star v) * H⁻¹ * Matrix.replicateCol Unit (t • v)) () () = + t * (star v ⬝ᵥ (H⁻¹ *ᵥ v)) := by + simp only [Matrix.mul_apply, Matrix.replicateRow_apply, Matrix.replicateCol_apply, + Pi.smul_apply, smul_eq_mul, Matrix.mulVec, dotProduct, Finset.mul_sum, Finset.sum_mul] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + ring + change H.det * (1 + (Matrix.replicateRow Unit (star v) * H⁻¹ * Matrix.replicateCol Unit (t • v)) () ()) = _ + rw [hv] + ring + +lemma det_re_add_rankOne (H : Mat) (hH : H.PosDef) (v : Fin d → ℂ) (t : ℝ) : + (H + (t : ℂ) • Matrix.vecMulVec v (star v)).det.re = H.det.re + t * cofactorQuadratic H v := by + rw [det_add_rankOne H (isUnit_iff_ne_zero.mpr hH.det_pos.ne')] + simp only [Complex.add_re, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, + zero_mul, sub_zero, cofactorQuadratic] + + + +lemma cofactorQuadratic_mono {H K : Mat} (hH : H.PosDef) (hK : K.PosDef) + (hKH : (K - H).PosSemidef) (v : Fin d → ℂ) : + cofactorQuadratic H v ≤ cofactorQuadratic K v := by + have hb (t : ℝ) (ht : 0 ≤ t) : H.det.re + t * cofactorQuadratic H v ≤ + K.det.re + t * cofactorQuadratic K v := by + have ht' := (Matrix.posSemidef_vecMulVec_self_star v).smul + (show (0 : ℂ) ≤ (t : ℂ) from Complex.nonneg_iff.mpr ⟨ht, rfl⟩) + have hh : ((K + (t : ℂ) • Matrix.vecMulVec v (star v)) - + (H + (t : ℂ) • Matrix.vecMulVec v (star v))).PosSemidef := by + convert hKH using 1 + abel + have hm := det_re_mono (hH.add_posSemidef ht') hh + simpa only [det_re_add_rankOne H hH, det_re_add_rankOne K hK] using hm + by_contra hn + have hp : 0 < cofactorQuadratic H v - cofactorQuadratic K v := sub_pos.mpr (lt_of_not_ge hn) + let t := (|K.det.re - H.det.re| + 1) / (cofactorQuadratic H v - cofactorQuadratic K v) + have ht : 0 ≤ t := by dsimp [t]; positivity + have he : t * (cofactorQuadratic H v - cofactorQuadratic K v) = |K.det.re - H.det.re| + 1 := + div_mul_cancel₀ _ hp.ne' + have hh := hb t ht + nlinarith [le_abs_self (K.det.re - H.det.re)] + +lemma cofactorQuadratic_nonneg (H : Mat) (hH : H.PosDef) (v : Fin d → ℂ) : + 0 ≤ cofactorQuadratic H v := by + exact (Complex.nonneg_iff.mp (mul_nonneg hH.det_pos.le + (hH.inv.posSemidef.dotProduct_mulVec_nonneg v))).1 + +lemma cofactorQuadratic_smul (H : Mat) (hH : H.PosDef) (v : Fin d → ℂ) + (hd : 0 < d) (c : ℝ) (hc : 0 < c) : + cofactorQuadratic ((c : ℂ) • H) v = c ^ (d - 1) * cofactorQuadratic H v := by + have hn : (c : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr hc.ne' + let : Invertible (c : ℂ) := invertibleOfNonzero hn + have hi := Matrix.inv_smul H (c : ℂ) (isUnit_iff_ne_zero.mpr hH.det_pos.ne') + have hp : (c : ℂ) ^ d * (c : ℂ)⁻¹ = (c : ℂ) ^ (d - 1) := by + conv_lhs => rw [show d = (d - 1) + 1 by omega, pow_succ] + rw [mul_assoc, mul_inv_cancel₀ hn, mul_one] + simp only [cofactorQuadratic, Matrix.det_smul, Fintype.card_fin, hi, invOf_eq_inv, + Matrix.smul_mulVec, dotProduct_smul, smul_eq_mul] + rw [show (c : ℂ) ^ d * H.det * ((c : ℂ)⁻¹ * (star v ⬝ᵥ (H⁻¹ *ᵥ v))) = + ((c : ℂ) ^ d * (c : ℂ)⁻¹) * (H.det * (star v ⬝ᵥ (H⁻¹ *ᵥ v))) by ring, hp, + ← Complex.ofReal_pow] + simp only [Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, zero_mul, sub_zero] + +lemma cofactorQuadratic_segment {H K : Mat} (hH : H.PosDef) (hK : K.PosDef) + (v : Fin d → ℂ) (hd : 0 < d) {s : ℝ} (hs : s ∈ Set.Ico 0 1) : + (1 - s) ^ (d - 1) * cofactorQuadratic H v ≤ + cofactorQuadratic (((1 - s : ℝ) : ℂ) • H + (s : ℂ) • K) v := by + have hc : (0 : ℂ) < ((1 - s : ℝ) : ℂ) := Complex.pos_iff.mpr ⟨sub_pos.mpr hs.2, rfl⟩ + have hp := hH.smul hc + have hq := hK.posSemidef.smul + (show (0 : ℂ) ≤ (s : ℂ) from Complex.nonneg_iff.mpr ⟨hs.1, rfl⟩) + have hm := cofactorQuadratic_mono hp (hp.add_posSemidef hq) + (show ((((1 - s : ℝ) : ℂ) • H + (s : ℂ) • K) - ((1 - s : ℝ) : ℂ) • H).PosSemidef by + simpa only [add_sub_cancel_left] using hq) v + rwa [cofactorQuadratic_smul H hH v hd (1 - s) (sub_pos.mpr hs.2)] at hm + +end MongeAmpere + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/MatrixCompactBounds.lean b/lean/OAI/Geometry/PrescribedRicci/MatrixCompactBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..633662bb36f9ad1f589cd15a72c86f716875c3b3 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/MatrixCompactBounds.lean @@ -0,0 +1,56 @@ +import Mathlib + +namespace OAI + +/-! Matrix Compact Bounds. -/ + +noncomputable section +open Matrix Set +open scoped Matrix.Norms.Elementwise ComplexOrder MatrixOrder +namespace MongeAmpere +variable {n : Type*} [Fintype n] +local notation "Mat" => Matrix n n ℂ + +lemma compact_matrix_bound {f : Mat → ℝ} (hf : Continuous f) (B : ℝ) : + ∃ Q : ℝ, 0 < Q ∧ ∀ H : Mat, ‖H‖ ≤ B → f H ≤ Q := by + obtain ⟨b,hb⟩ := (isCompact_closedBall (0:Mat) B).bddAbove_image hf.continuousOn + refine ⟨max b 1,lt_of_lt_of_le zero_lt_one (le_max_right _ _),fun H hH => ?_⟩ + exact (hb (mem_image_of_mem _ (by simpa only [Metric.mem_closedBall,dist_zero_right] using hH))).trans + (le_max_left _ _) + +lemma matrix_norm_le_of_entries {H : Mat} {B : ℝ} (hB : 0 ≤ B) + (hH : ∀ i j, ‖H i j‖ ≤ B) : ‖H‖ ≤ B := by + apply (pi_norm_le_iff_of_nonneg hB).mpr + intro i + exact (pi_norm_le_iff_of_nonneg hB).mpr (hH i) + +variable [DecidableEq n] + +lemma posDef_eq_det_smul_adjugate_inv (H : Mat) (hH : H.PosDef) : + H = H.det • H⁻¹.adjugate := by + let : Invertible H := Matrix.invertibleOfIsUnitDet H (isUnit_iff_ne_zero.mpr hH.det_pos.ne') + calc + H = H⁻¹⁻¹ := (Matrix.inv_inv_of_invertible H).symm + _ = (Ring.inverse H⁻¹.det) • H⁻¹.adjugate := Matrix.inv_def _ + _ = H.det • H⁻¹.adjugate := by rw [Matrix.det_nonsing_inv]; simp only [Ring.inverse_eq_inv',inv_inv] + +lemma posDef_norm_det (H : Mat) (hH : H.PosDef) : ‖H.det‖ = H.det.re := by + have he : H.det = (H.det.re:ℂ) := Complex.ext rfl (by simpa using (Complex.pos_iff.mp hH.det_pos).2.symm) + rw [he,Complex.norm_real,Real.norm_eq_abs,abs_of_nonneg (Complex.pos_iff.mp hH.det_pos).1.le] + rfl + +lemma metric_norm_bound_from_inverse (B : ℝ) : ∃ Q : ℝ, 0 < Q ∧ + ∀ H : Mat, H.PosDef → ‖H⁻¹‖ ≤ B → ‖H‖ ≤ H.det.re*Q := by + obtain ⟨Q,hQ,hb⟩ := compact_matrix_bound (show Continuous (fun H : Mat => ‖H.adjugate‖) from + (continuous_id.matrix_adjugate : Continuous (fun H : Mat => H.adjugate)).norm) B + refine ⟨Q,hQ,fun H hH hi => ?_⟩ + calc + ‖H‖ = ‖H.det • H⁻¹.adjugate‖ := congrArg norm (posDef_eq_det_smul_adjugate_inv H hH) + _ = H.det.re*‖H⁻¹.adjugate‖ := by rw [norm_smul,posDef_norm_det H hH] + _ ≤ _ := mul_le_mul_of_nonneg_left (hb _ hi) (Complex.pos_iff.mp hH.det_pos).1.le + +end MongeAmpere + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/MatrixComponentBounds.lean b/lean/OAI/Geometry/PrescribedRicci/MatrixComponentBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..fbc1ef7ac192d2133d85e6ba870df81eb1e8a1ea --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/MatrixComponentBounds.lean @@ -0,0 +1,76 @@ +import Mathlib + +namespace OAI + +/-! Matrix Component Bounds. -/ + +noncomputable section +open Matrix +open scoped ComplexOrder MatrixOrder +namespace MongeAmpere +variable {n : Type*} [Fintype n] +local notation "Mat" => Matrix n n ℂ + +lemma entry_mul_bound {A B : Mat} {a b : ℝ} (ha : 0 ≤ a) + (hA : ∀ i j, ‖A i j‖ ≤ a) (hB : ∀ i j, ‖B i j‖ ≤ b) (i j : n) : + ‖(A*B) i j‖ ≤ (Fintype.card n:ℝ)*a*b := by + rw [Matrix.mul_apply] + calc + _ ≤ ∑ k, ‖A i k*B k j‖ := norm_sum_le _ _ + _ ≤ ∑ _k : n, a*b := Finset.sum_le_sum (fun k _ => by + rw [norm_mul] + exact mul_le_mul (hA i k) (hB k j) (norm_nonneg _) ha) + _ = _ := by simp only [Finset.sum_const,Finset.card_univ,nsmul_eq_mul]; ring + +lemma trace_entry_bound {A : Mat} {a : ℝ} (hA : ∀ i j, ‖A i j‖ ≤ a) : + ‖A.trace‖ ≤ (Fintype.card n:ℝ)*a := by + calc + _ ≤ ∑ i, ‖A i i‖ := norm_sum_le _ _ + _ ≤ ∑ _i : n, a := Finset.sum_le_sum (fun i _ => hA i i) + _ = _ := by simp + +lemma trace_mul_entry_bound {A B : Mat} {a b : ℝ} (ha : 0 ≤ a) + (hA : ∀ i j, ‖A i j‖ ≤ a) (hB : ∀ i j, ‖B i j‖ ≤ b) : + ‖(A*B).trace‖ ≤ (Fintype.card n:ℝ)^2*a*b := by + calc + _ ≤ (Fintype.card n:ℝ)*((Fintype.card n:ℝ)*a*b) := + trace_entry_bound (entry_mul_bound ha hA hB) + _ = _ := by ring + +lemma trace_four_entry_bound {A B C D : Mat} {a b c e : ℝ} + (ha : 0 ≤ a) (hb : 0 ≤ b) (hc : 0 ≤ c) + (hA : ∀ i j, ‖A i j‖ ≤ a) (hB : ∀ i j, ‖B i j‖ ≤ b) + (hC : ∀ i j, ‖C i j‖ ≤ c) (hD : ∀ i j, ‖D i j‖ ≤ e) : + ‖(A*B*C*D).trace‖ ≤ (Fintype.card n:ℝ)^4*a*b*c*e := by + have hn : (0:ℝ) ≤ Fintype.card n := Nat.cast_nonneg _ + have hab := entry_mul_bound ha hA hB + have habc := entry_mul_bound (mul_nonneg (mul_nonneg hn ha) hb) hab hC + calc + _ ≤ (Fintype.card n:ℝ)^2*((Fintype.card n:ℝ)*((Fintype.card n:ℝ)*a*b)*c)*e := + trace_mul_entry_bound (by positivity) habc hD + _ = _ := by ring + +lemma contracted_curvature_bound {B : Mat} {R : n → n → Mat} {a r : ℝ} + (ha : 0 ≤ a) (hB : ∀ i j, ‖B i j‖ ≤ a) + (hR : ∀ a b i j, ‖R b a i j‖ ≤ r) : + ‖∑ a, ∑ b, B a b*(B*R b a).trace‖ ≤ (Fintype.card n:ℝ)^4*a^2*r := by + have ht (i j : n) : ‖(B*R j i).trace‖ ≤ (Fintype.card n:ℝ)^2*a*r := + trace_mul_entry_bound ha hB (hR i j) + calc + _ ≤ ∑ i, ‖∑ j, B i j*(B*R j i).trace‖ := norm_sum_le _ _ + _ ≤ ∑ i, ∑ j, ‖B i j*(B*R j i).trace‖ := + Finset.sum_le_sum (fun i _ => norm_sum_le _ _) + _ ≤ ∑ _i : n, ∑ _j : n, a*((Fintype.card n:ℝ)^2*a*r) := by + apply Finset.sum_le_sum + intro i _ + apply Finset.sum_le_sum + intro j _ + rw [norm_mul] + exact mul_le_mul (hB i j) (ht i j) (norm_nonneg _) ha + _ = _ := by simp only [Finset.sum_const,Finset.card_univ,nsmul_eq_mul]; ring + +end MongeAmpere + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/MatrixDifferentialNew.lean b/lean/OAI/Geometry/PrescribedRicci/MatrixDifferentialNew.lean new file mode 100644 index 0000000000000000000000000000000000000000..ac793474296477fbfcb3a13bfd42c3a2715ff60d --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/MatrixDifferentialNew.lean @@ -0,0 +1,157 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.AnalyticSupport + +namespace OAI + +/-! Matrix Differential New. -/ + +noncomputable section +open Matrix Filter Topology +open scoped ContDiff Matrix.Norms.Elementwise +namespace MongeAmpere +variable {d : ℕ} +local notation "Mat" => Matrix (Fin d) (Fin d) ℂ + +lemma contDiff_det : ContDiff ℂ ∞ (fun H : Mat => H.det) := by + simp only [Matrix.det_apply'] + apply ContDiff.sum + intro σ _ + apply contDiff_const.mul + apply contDiff_prod + intro j _ + exact contDiff_apply_apply ℂ ℂ (σ j) j + +lemma differentiable_det : Differentiable ℂ (fun H : Mat => H.det) := + contDiff_det.differentiable (by simp) + +lemma fderiv_det_apply (H K : Mat) (hH : IsUnit H.det) : + fderiv ℂ (fun M : Mat => M.det) H K = H.det * (H⁻¹ * K).trace := by + have hp : HasDerivAt (fun t : ℂ => H + t • K) K 0 := by + convert! ((hasDerivAt_id (0 : ℂ)).smul_const K).const_add H using 1 + simp only [one_smul] + have hf := (differentiable_det (H + (0 : ℂ) • K)).hasFDerivAt.comp_hasDerivAt 0 hp + have hf' : HasDerivAt (fun t : ℂ => (H + t • K).det) + (fderiv ℂ (fun M : Mat => M.det) H K) 0 := by + convert! hf using 1 + simp only [zero_smul, add_zero] + rfl + exact hf'.unique (hasDerivAt_det_add_smul H K hH) + +lemma real_fderiv_det_apply (H K : Mat) (hH : IsUnit H.det) : + fderiv ℝ (fun M : Mat => M.det) H K = H.det * (H⁻¹ * K).trace := by + have hd := ((differentiable_det H).hasFDerivAt.restrictScalars ℝ).fderiv + have he := congrArg (fun L : Mat →L[ℝ] ℂ => L K) hd + exact he.trans (fderiv_det_apply H K hH) + +lemma contDiff_adjugate : ContDiff ℂ ∞ (fun H : Mat => H.adjugate) := by + apply contDiff_pi.mpr + intro i + apply contDiff_pi.mpr + intro j + simp only [Matrix.adjugate_apply] + apply contDiff_det.comp + apply contDiff_pi.mpr + intro k + apply contDiff_pi.mpr + intro l + by_cases hk : k = j + · subst k + simp only [Matrix.updateRow_self] + exact contDiff_const + · simp only [Matrix.updateRow_ne hk] + exact contDiff_apply_apply ℂ ℂ k l + +lemma differentiableAt_inv (H : Mat) (hH : H.det ≠ 0) : + DifferentiableAt ℂ (fun M : Mat => M⁻¹) H := by + simp only [Matrix.inv_def, Ring.inverse_eq_inv'] + exact ((differentiable_det H).inv hH).smul + (contDiff_adjugate.differentiable (by simp) H) + +def matrixMulCLM : Mat →L[ℝ] Mat →L[ℝ] Mat := + LinearMap.toContinuousLinearMap + { toFun := fun M => LinearMap.toContinuousLinearMap + { toFun := fun N => M * N + map_add' := fun N P => Matrix.mul_add M N P + map_smul' := by intro c N; exact Matrix.mul_smul M c N } + map_add' := by + intro M N + apply ContinuousLinearMap.ext + intro P + exact Matrix.add_mul M N P + map_smul' := by + intro c M + apply ContinuousLinearMap.ext + intro N + exact Matrix.smul_mul c M N } + +lemma real_fderiv_matrix_mul {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + {f h : E → Mat} {x : E} (hf : DifferentiableAt ℝ f x) + (hh : DifferentiableAt ℝ h x) (u : E) : + fderiv ℝ (fun y => f y * h y) x u = + f x * fderiv ℝ h x u + fderiv ℝ f x u * h x := by + have he := (matrixMulCLM.hasFDerivAt_of_bilinear hf.hasFDerivAt hh.hasFDerivAt).fderiv + exact congrArg (fun L : E →L[ℝ] Mat => L u) he + +lemma real_fderiv_inv_apply (H K : Mat) (hH : IsUnit H.det) : + fderiv ℝ (fun M : Mat => M⁻¹) H K = -(H⁻¹ * K * H⁻¹) := by + have hi := (differentiableAt_inv H (isUnit_iff_ne_zero.mp hH)).restrictScalars ℝ + have he : (fun M : Mat => M * M⁻¹) =ᶠ[nhds H] (fun _ => 1) := by + filter_upwards [(isOpen_ne.preimage differentiable_det.continuous).mem_nhds + (isUnit_iff_ne_zero.mp hH)] with M hM + exact Matrix.mul_nonsing_inv M (isUnit_iff_ne_zero.mpr hM) + have hd := congrArg (fun L : Mat →L[ℝ] Mat => L K) he.fderiv_eq + have hp := real_fderiv_matrix_mul (differentiableAt_id (𝕜 := ℝ)) hi K + have hid : (fderiv ℝ (id : Mat → Mat) H) K = K := + congrArg (fun L : Mat →L[ℝ] Mat => L K) (fderiv_id (𝕜 := ℝ) (x := H)) + have hz : H * fderiv ℝ (fun M : Mat => M⁻¹) H K + K * H⁻¹ = 0 := by + have hp' : (fderiv ℝ (fun M : Mat => M * M⁻¹) H) K = + H * fderiv ℝ (fun M : Mat => M⁻¹) H K + K * H⁻¹ := + hp.trans (congrArg (fun N : Mat => + H * fderiv ℝ (fun M : Mat => M⁻¹) H K + N * H⁻¹) hid) + have hc : fderiv ℝ (fun _ : Mat => (1 : Mat)) H = 0 := fderiv_const_apply _ + exact hp'.symm.trans (hd.trans (congrArg (fun L : Mat →L[ℝ] Mat => L K) hc)) + + have hl := congrArg (fun M : Mat => H⁻¹ * M) hz + rw [Matrix.mul_add, ← Matrix.mul_assoc, Matrix.nonsing_inv_mul _ hH, + Matrix.one_mul, Matrix.mul_zero, ← Matrix.mul_assoc] at hl + exact eq_neg_of_add_eq_zero_left hl + +lemma fderiv_inv_apply (H K : Mat) (hH : IsUnit H.det) : + fderiv ℂ (fun M : Mat => M⁻¹) H K = -(H⁻¹ * K * H⁻¹) := by + have hd := ((differentiableAt_inv H (isUnit_iff_ne_zero.mp hH)).hasFDerivAt.restrictScalars ℝ).fderiv + have he := congrArg (fun L : Mat →L[ℝ] Mat => L K) hd + exact he.symm.trans (real_fderiv_inv_apply H K hH) + +lemma contDiffAt_inv (H : Mat) (hH : H.det ≠ 0) : + ContDiffAt ℂ ∞ (fun M : Mat => M⁻¹) H := by + simp only [Matrix.inv_def, Ring.inverse_eq_inv'] + exact (contDiff_det.contDiffAt.inv hH).smul contDiff_adjugate.contDiffAt + +def weightedInverse (H : Mat) : Mat := H.det • H⁻¹ + +lemma contDiffAt_weightedInverse (H : Mat) (hH : IsUnit H.det) : + ContDiffAt ℂ ∞ weightedInverse H := + contDiff_det.contDiffAt.smul (contDiffAt_inv H (isUnit_iff_ne_zero.mp hH)) + +lemma differentiableAt_weightedInverse (H : Mat) (hH : IsUnit H.det) : + DifferentiableAt ℂ weightedInverse H := + (differentiable_det H).smul (differentiableAt_inv H (isUnit_iff_ne_zero.mp hH)) + +lemma fderiv_weightedInverse_apply (H K : Mat) (hH : IsUnit H.det) : + fderiv ℂ weightedInverse H K = + H.det • ((H⁻¹ * K).trace • H⁻¹ - H⁻¹ * K * H⁻¹) := by + have he := ((differentiable_det H).hasFDerivAt.smul + (differentiableAt_inv H (isUnit_iff_ne_zero.mp hH)).hasFDerivAt).fderiv + have he' := congrArg (fun L : Mat →L[ℂ] Mat => L K) he + change fderiv ℂ weightedInverse H K = + H.det • (fderiv ℂ (fun M : Mat => M⁻¹) H K) + + (fderiv ℂ (fun M : Mat => M.det) H K) • H⁻¹ at he' + rw [fderiv_det_apply H K hH, fderiv_inv_apply H K hH] at he' + rw [he', smul_sub, smul_neg, mul_smul] + abel + +end MongeAmpere + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/MatrixWirtinger.lean b/lean/OAI/Geometry/PrescribedRicci/MatrixWirtinger.lean new file mode 100644 index 0000000000000000000000000000000000000000..8bfa506c548f5b3d3506f82bf1f5a78b2c6be1ab --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/MatrixWirtinger.lean @@ -0,0 +1,129 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.LocalKahlerEnergy + +namespace OAI + +/-! Matrix Wirtinger. -/ + +noncomputable section +open Matrix Filter Set Topology +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth.KaehlerMetric +variable {d : ℕ} +local notation "Mat" => Matrix (Fin d) (Fin d) ℂ + +def holDerivative (f : Coordinates d → Mat) (z : Coordinates d) (a : Fin d) : Mat := + (2:ℂ)⁻¹ • (fderiv ℝ f z (coordinateVector a) - + Complex.I • fderiv ℝ f z (Complex.I • coordinateVector a)) + +lemma holDeriv_entry {f : Coordinates d → Mat} {z : Coordinates d} + (hf : DifferentiableAt ℝ f z) (a i j : Fin d) : + holDeriv (fun y => f y i j) z a = holDerivative f z a i j := by + unfold holDeriv holDerivative + rw [fderiv_entry hf,fderiv_entry hf] + rfl + +lemma contDiffAt_barDerivative {f : Coordinates d → Mat} {z : Coordinates d} + (hf : ContDiffAt ℝ ∞ f z) (a : Fin d) : + ContDiffAt ℝ ∞ (fun y => barDerivative f y a) z := by + unfold barDerivative + exact ContDiffAt.smul (contDiffAt_const (c := (2:ℂ)⁻¹)) + ((contDiffAt_deriv_direction hf (coordinateVector a)).add + (ContDiffAt.smul (contDiffAt_const (c := Complex.I)) + (contDiffAt_deriv_direction hf (Complex.I • coordinateVector a)))) + +lemma contDiffAt_holDerivative {f : Coordinates d → Mat} {z : Coordinates d} + (hf : ContDiffAt ℝ ∞ f z) (a : Fin d) : + ContDiffAt ℝ ∞ (fun y => holDerivative f y a) z := by + unfold holDerivative + exact ContDiffAt.smul (contDiffAt_const (c := (2:ℂ)⁻¹)) + ((contDiffAt_deriv_direction hf (coordinateVector a)).sub + (ContDiffAt.smul (contDiffAt_const (c := Complex.I)) + (contDiffAt_deriv_direction hf (Complex.I • coordinateVector a)))) + +lemma barDerivative_mul {f g : Coordinates d → Mat} {z : Coordinates d} + (hf : DifferentiableAt ℝ f z) (hg : DifferentiableAt ℝ g z) (a : Fin d) : + barDerivative (fun y => f y*g y) z a = barDerivative f z a*g z + f z*barDerivative g z a := by + unfold barDerivative + rw [MongeAmpere.real_fderiv_matrix_mul hf hg,MongeAmpere.real_fderiv_matrix_mul hf hg] + simp only [smul_add,Matrix.smul_mul,Matrix.mul_smul,mul_add,add_mul] + abel + +lemma holDerivative_mul {f g : Coordinates d → Mat} {z : Coordinates d} + (hf : DifferentiableAt ℝ f z) (hg : DifferentiableAt ℝ g z) (a : Fin d) : + holDerivative (fun y => f y*g y) z a = holDerivative f z a*g z + f z*holDerivative g z a := by + unfold holDerivative + rw [MongeAmpere.real_fderiv_matrix_mul hf hg,MongeAmpere.real_fderiv_matrix_mul hf hg] + simp only [smul_add,smul_sub,Matrix.smul_mul,Matrix.mul_smul,mul_sub,sub_mul] + abel + +lemma barDerivative_inv {f : Coordinates d → Mat} {z : Coordinates d} + (hf : DifferentiableAt ℝ f z) (hi : IsUnit (f z).det) (a : Fin d) : + barDerivative (fun y => (f y)⁻¹) z a = - ((f z)⁻¹*barDerivative f z a*(f z)⁻¹) := by + have hh := barDerivative_comp hf (MongeAmpere.differentiableAt_inv (f z) (isUnit_iff_ne_zero.mp hi)) a + exact hh.trans (MongeAmpere.fderiv_inv_apply _ _ hi) + +lemma holDerivative_comp {f : Coordinates d → Mat} {F : Mat → Mat} {z : Coordinates d} + (hf : DifferentiableAt ℝ f z) (hF : DifferentiableAt ℂ F (f z)) (a : Fin d) : + holDerivative (F ∘ f) z a = fderiv ℂ F (f z) (holDerivative f z a) := by + have hd := ((hF.hasFDerivAt.restrictScalars ℝ).comp z hf.hasFDerivAt).fderiv + unfold holDerivative + have h1 := congrArg (fun L : Coordinates d →L[ℝ] Mat => L (coordinateVector a)) hd + have h2 := congrArg (fun L : Coordinates d →L[ℝ] Mat => L (Complex.I • coordinateVector a)) hd + calc + _ = (2:ℂ)⁻¹ • (fderiv ℂ F (f z) (fderiv ℝ f z (coordinateVector a)) - + Complex.I • fderiv ℂ F (f z) (fderiv ℝ f z (Complex.I • coordinateVector a))) := + congrArg₂ (fun U V : Mat => (2:ℂ)⁻¹ • (U-Complex.I • V)) h1 h2 + _ = _ := by simp only [map_smul,map_sub] + +lemma holDerivative_inv {f : Coordinates d → Mat} {z : Coordinates d} + (hf : DifferentiableAt ℝ f z) (hi : IsUnit (f z).det) (a : Fin d) : + holDerivative (fun y => (f y)⁻¹) z a = - ((f z)⁻¹*holDerivative f z a*(f z)⁻¹) := by + have hh := holDerivative_comp hf (MongeAmpere.differentiableAt_inv (f z) (isUnit_iff_ne_zero.mp hi)) a + exact hh.trans (MongeAmpere.fderiv_inv_apply _ _ hi) + +def matrixTraceCLM : Mat →L[ℝ] ℂ := (Matrix.traceLinearMap (Fin d) ℝ ℂ).toContinuousLinearMap + +lemma fderiv_trace {f : Coordinates d → Mat} {z : Coordinates d} + (hf : DifferentiableAt ℝ f z) (v : Coordinates d) : + fderiv ℝ (fun y => (f y).trace) z v = (fderiv ℝ f z v).trace := by + exact congrArg (fun L : Coordinates d →L[ℝ] ℂ => L v) + (((matrixTraceCLM (d:=d)).hasFDerivAt.comp z hf.hasFDerivAt).fderiv) + +lemma barDeriv_trace {f : Coordinates d → Mat} {z : Coordinates d} + (hf : DifferentiableAt ℝ f z) (a : Fin d) : + barDeriv (fun y => (f y).trace) z a = (barDerivative f z a).trace := by + unfold barDeriv barDerivative + rw [fderiv_trace hf,fderiv_trace hf] + simp only [trace_smul,trace_add,smul_eq_mul] + +lemma holDeriv_trace {f : Coordinates d → Mat} {z : Coordinates d} + (hf : DifferentiableAt ℝ f z) (a : Fin d) : + holDeriv (fun y => (f y).trace) z a = (holDerivative f z a).trace := by + unfold holDeriv holDerivative + rw [fderiv_trace hf,fderiv_trace hf] + simp only [trace_smul,trace_sub,smul_eq_mul] + +variable {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +lemma holDerivative_adjoint (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (a : Fin d) : + (holDerivative (g.matrix q) z a)ᴴ = barDerivative (g.matrix q) z a := by + unfold holDerivative barDerivative + rw [conjTranspose_smul,conjTranspose_sub,conjTranspose_smul, + (g.derivative_hermitian q hz _).eq,(g.derivative_hermitian q hz _).eq] + simp only [map_inv₀,map_ofNat,Complex.star_def,Complex.conj_I,neg_smul,sub_neg_eq_add] + +lemma holDerivative_symm (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (a i j : Fin d) : + holDerivative (g.matrix q) z a i j = holDerivative (g.matrix q) z j i a := by + have hh := congrArg (fun M : Mat => star (M j i)) (g.holDerivative_adjoint q hz a) + have hh' := congrArg (fun M : Mat => star (M a i)) (g.holDerivative_adjoint q hz j) + simp only [conjTranspose_apply,star_star] at hh hh' + rw [hh,hh',g.barDerivative_symm q hz a j i] + +end Anticanonical.SourceSmooth.KaehlerMetric + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/MatrixWirtingerExtra.lean b/lean/OAI/Geometry/PrescribedRicci/MatrixWirtingerExtra.lean new file mode 100644 index 0000000000000000000000000000000000000000..1e44cff9e2b5f804cd59f62a538e5d0825c8e100 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/MatrixWirtingerExtra.lean @@ -0,0 +1,66 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.LocalKahlerEnergy + +namespace OAI + +/-! Matrix Wirtinger Extra. -/ + +noncomputable section +open Matrix Filter Set Topology +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth.KaehlerMetric +variable {d : ℕ} +local notation "Mat" => Matrix (Fin d) (Fin d) ℂ + +lemma matrix_mul_differentiableAt {f g : Coordinates d → Mat} {z : Coordinates d} + (hf : DifferentiableAt ℝ f z) (hg : DifferentiableAt ℝ g z) : + DifferentiableAt ℝ (fun y => f y*g y) z := + (MongeAmpere.matrixMulCLM.hasFDerivAt_of_bilinear hf.hasFDerivAt hg.hasFDerivAt).differentiableAt + +lemma matrix_mul_contDiffAt {f g : Coordinates d → Mat} {z : Coordinates d} + (hf : ContDiffAt ℝ ∞ f z) (hg : ContDiffAt ℝ ∞ g z) : + ContDiffAt ℝ ∞ (fun y => f y*g y) z := by + apply contDiffAt_pi.mpr + intro i + apply contDiffAt_pi.mpr + intro j + simp only [Matrix.mul_apply] + apply ContDiffAt.sum + intro k _ + exact (contDiffAt_pi.mp (contDiffAt_pi.mp hf i) k).mul + (contDiffAt_pi.mp (contDiffAt_pi.mp hg k) j) + +lemma barDerivative_congr {f g : Coordinates d → Mat} {z : Coordinates d} + (he : f =ᶠ[nhds z] g) (a : Fin d) : barDerivative f z a = barDerivative g z a := by + unfold barDerivative + rw [he.fderiv_eq] + +lemma barDerivative_sub {f g : Coordinates d → Mat} {z : Coordinates d} + (hf : DifferentiableAt ℝ f z) (hg : DifferentiableAt ℝ g z) (a : Fin d) : + barDerivative (fun y => f y-g y) z a = barDerivative f z a - barDerivative g z a := by + unfold barDerivative + have he : fderiv ℝ (fun y => f y-g y) z = fderiv ℝ f z - fderiv ℝ g z := by + convert! (hf.hasFDerivAt.sub hg.hasFDerivAt).fderiv using 1 + rw [he] + simp only [_root_.sub_apply,smul_sub,smul_add] + abel + +lemma holDeriv_congr {f g : Coordinates d → ℂ} {z : Coordinates d} + (he : f =ᶠ[nhds z] g) (a : Fin d) : holDeriv f z a = holDeriv g z a := by + unfold holDeriv + rw [he.fderiv_eq] + +lemma holDeriv_ofReal {φ : Coordinates d → ℝ} {z : Coordinates d} + (hφ : DifferentiableAt ℝ φ z) (a : Fin d) : + holDeriv (fun y => (φ y:ℂ)) z a = holRealDeriv φ z a := by + have hd := (Complex.ofRealCLM.hasFDerivAt.comp z hφ.hasFDerivAt).fderiv + change fderiv ℝ (fun y => (φ y:ℂ)) z = _ at hd + unfold holDeriv holRealDeriv holRealForm + rw [hd] + rfl + +end Anticanonical.SourceSmooth.KaehlerMetric + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/MatrixWirtingerSecond.lean b/lean/OAI/Geometry/PrescribedRicci/MatrixWirtingerSecond.lean new file mode 100644 index 0000000000000000000000000000000000000000..6987592a54b7b0a0206eb8b8dcf0d336c33afde2 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/MatrixWirtingerSecond.lean @@ -0,0 +1,107 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.MatrixWirtinger + +namespace OAI + +/-! Matrix Wirtinger Second. -/ + +noncomputable section +open Matrix Filter Set Topology +open scoped ContDiff ComplexOrder Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth.KaehlerMetric +variable {d : ℕ} +local notation "Mat" => Matrix (Fin d) (Fin d) ℂ + +def barMatrixForm (a : Fin d) : (Coordinates d →L[ℝ] Mat) →L[ℝ] Mat := + (2:ℂ)⁻¹ • ((ContinuousLinearMap.apply ℝ Mat (coordinateVector a)) + + Complex.I • (ContinuousLinearMap.apply ℝ Mat (Complex.I • coordinateVector a))) + +def holMatrixForm (a : Fin d) : (Coordinates d →L[ℝ] Mat) →L[ℝ] Mat := + (2:ℂ)⁻¹ • ((ContinuousLinearMap.apply ℝ Mat (coordinateVector a)) - + Complex.I • (ContinuousLinearMap.apply ℝ Mat (Complex.I • coordinateVector a))) + +lemma fderiv_barDerivative {f : Coordinates d → Mat} {z : Coordinates d} + (hf : ContDiffAt ℝ ∞ f z) (a : Fin d) (v : Coordinates d) : + fderiv ℝ (fun y => barDerivative f y a) z v = + (2:ℂ)⁻¹ • (fderiv ℝ (fderiv ℝ f) z v (coordinateVector a) + + Complex.I • fderiv ℝ (fderiv ℝ f) z v (Complex.I • coordinateVector a)) := by + exact congrArg (fun L : Coordinates d →L[ℝ] Mat => L v) + (((barMatrixForm a).hasFDerivAt.comp z + ((hf.fderiv_right (m:=∞) (by simp)).differentiableAt (by simp)).hasFDerivAt).fderiv) + +lemma fderiv_holDerivative {f : Coordinates d → Mat} {z : Coordinates d} + (hf : ContDiffAt ℝ ∞ f z) (a : Fin d) (v : Coordinates d) : + fderiv ℝ (fun y => holDerivative f y a) z v = + (2:ℂ)⁻¹ • (fderiv ℝ (fderiv ℝ f) z v (coordinateVector a) - + Complex.I • fderiv ℝ (fderiv ℝ f) z v (Complex.I • coordinateVector a)) := by + exact congrArg (fun L : Coordinates d →L[ℝ] Mat => L v) + (((holMatrixForm a).hasFDerivAt.comp z + ((hf.fderiv_right (m:=∞) (by simp)).differentiableAt (by simp)).hasFDerivAt).fderiv) + +lemma bar_hol_comm {f : Coordinates d → Mat} {z : Coordinates d} + (hf : ContDiffAt ℝ ∞ f z) (a b : Fin d) : + barDerivative (fun y => holDerivative f y a) z b = + holDerivative (fun y => barDerivative f y b) z a := by + unfold barDerivative holDerivative + have ha := fderiv_holDerivative hf a (coordinateVector b) + have hb := fderiv_holDerivative hf a (Complex.I • coordinateVector b) + have hc := fderiv_barDerivative hf b (coordinateVector a) + have hd := fderiv_barDerivative hf b (Complex.I • coordinateVector a) + change fderiv ℝ (fun y => (2:ℂ)⁻¹ • (fderiv ℝ f y (coordinateVector a)- + Complex.I • fderiv ℝ f y (Complex.I • coordinateVector a))) z (coordinateVector b) = _ at ha + change fderiv ℝ (fun y => (2:ℂ)⁻¹ • (fderiv ℝ f y (coordinateVector a)- + Complex.I • fderiv ℝ f y (Complex.I • coordinateVector a))) z (Complex.I • coordinateVector b) = _ at hb + change fderiv ℝ (fun y => (2:ℂ)⁻¹ • (fderiv ℝ f y (coordinateVector b)+ + Complex.I • fderiv ℝ f y (Complex.I • coordinateVector b))) z (coordinateVector a) = _ at hc + change fderiv ℝ (fun y => (2:ℂ)⁻¹ • (fderiv ℝ f y (coordinateVector b)+ + Complex.I • fderiv ℝ f y (Complex.I • coordinateVector b))) z (Complex.I • coordinateVector a) = _ at hd + rw [ha,hb,hc,hd] + have hs (u v : Coordinates d) : fderiv ℝ (fderiv ℝ f) z u v = fderiv ℝ (fderiv ℝ f) z v u := by + exact hf.isSymmSndFDerivAt (by + simp only [minSmoothness_of_isRCLikeNormedField] + change ((2:ℕ∞):WithTop ℕ∞) ≤ ((⊤:ℕ∞):WithTop ℕ∞) + exact WithTop.coe_le_coe.mpr le_top) u v + rw [hs (coordinateVector a) (coordinateVector b), + hs (coordinateVector a) (Complex.I • coordinateVector b), + hs (Complex.I • coordinateVector a) (coordinateVector b), + hs (Complex.I • coordinateVector a) (Complex.I • coordinateVector b)] + ext i j + simp only [Matrix.smul_apply,Matrix.add_apply,Matrix.sub_apply,smul_eq_mul] + ring + +variable {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +lemma secondDerivative_col_symm (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (a b i j : Fin d) : + barDerivative (fun y => holDerivative (g.matrix q) y a) z b i j = + barDerivative (fun y => holDerivative (g.matrix q) y j) z b i a := by + have hs := (g.smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hz) + have he : (fun y => holDerivative (g.matrix q) y a i j) =ᶠ[nhds z] + (fun y => holDerivative (g.matrix q) y j i a) := by + filter_upwards [(A.chart q).open_target.mem_nhds hz] with y hy + exact g.holDerivative_symm q hy a i j + rw [← barDeriv_entry ((contDiffAt_holDerivative hs a).differentiableAt (by simp)), + ← barDeriv_entry ((contDiffAt_holDerivative hs j).differentiableAt (by simp))] + unfold barDeriv + rw [he.fderiv_eq] + +lemma secondDerivative_row_symm (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) (a b i j : Fin d) : + barDerivative (fun y => holDerivative (g.matrix q) y a) z b i j = + barDerivative (fun y => holDerivative (g.matrix q) y a) z i b j := by + have hs := (g.smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hz) + rw [bar_hol_comm hs,bar_hol_comm hs] + have he : (fun y => barDerivative (g.matrix q) y b i j) =ᶠ[nhds z] + (fun y => barDerivative (g.matrix q) y i b j) := by + filter_upwards [(A.chart q).open_target.mem_nhds hz] with y hy + exact g.barDerivative_symm q hy b i j + rw [← holDeriv_entry ((contDiffAt_barDerivative hs b).differentiableAt (by simp)), + ← holDeriv_entry ((contDiffAt_barDerivative hs i).differentiableAt (by simp))] + unfold holDeriv + rw [he.fderiv_eq] + +end Anticanonical.SourceSmooth.KaehlerMetric + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/MomentBoundPointwise.lean b/lean/OAI/Geometry/PrescribedRicci/MomentBoundPointwise.lean new file mode 100644 index 0000000000000000000000000000000000000000..bea289ae6018980e94659bacfa64cd0d7e807b54 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/MomentBoundPointwise.lean @@ -0,0 +1,46 @@ +import Mathlib + +namespace OAI + +/-! Moment Bound Pointwise. -/ + +noncomputable section +open Set Filter Topology MeasureTheory +namespace Anticanonical.SourceSmooth + +lemma continuous_le_of_moments {X : Type*} [TopologicalSpace X] [MeasurableSpace X] + [BorelSpace X] {μ : Measure X} [IsFiniteMeasure μ] [μ.IsOpenPosMeasure] + {w : X → ℝ} (hw : Continuous w) (hwn : ∀ x, 0 ≤ w x) + (p : ℕ → ℝ) (hp : ∀ n, 0 < p n) (hpt : Tendsto p atTop atTop) + {B : ℝ} (hB : 0 ≤ B) + (hi : ∀ n, Integrable (fun x => w x ^ p n) μ) + (hb : ∀ n, ∫ x, w x ^ p n ∂μ ≤ B ^ p n) : ∀ x, w x ≤ B := by + intro x + by_contra! hx + obtain ⟨r,hrB,hrx⟩ := exists_between hx + have hr : 0 < r := lt_of_le_of_lt hB hrB + let U := {y | r < w y} + have hU : IsOpen U := isOpen_lt continuous_const hw + have hUm : 0 < μ.real U := ENNReal.toReal_pos (ne_of_gt (hU.measure_pos μ ⟨x,hrx⟩)) (by finiteness) + have hbound (n : ℕ) : μ.real U ≤ (B/r)^(p n) := by + have hs : U ⊆ {y | r^(p n) ≤ w y^(p n)} := fun y hy => + Real.rpow_le_rpow hr.le hy.le (hp n).le + have hm := mul_meas_ge_le_integral_of_nonneg + (ae_of_all μ (fun y => Real.rpow_nonneg (hwn y) (p n))) (hi n) (r^(p n)) + have hh : r^(p n)*μ.real U ≤ B^(p n) := + (mul_le_mul_of_nonneg_left (measureReal_mono hs) (Real.rpow_nonneg hr.le _)).trans (hm.trans (hb n)) + rw [Real.div_rpow hB hr.le] + apply (le_div_iff₀ (Real.rpow_pos_of_pos hr _)).mpr + simpa only [mul_comm] using hh + have hlim : Tendsto (fun n => (B/r)^(p n)) atTop (𝓝 0) := + (tendsto_rpow_atTop_of_base_lt_one (B/r) + (by have hh := div_nonneg hB hr.le; linarith) + ((div_lt_one hr).mpr hrB)).comp hpt + have hz : μ.real U ≤ 0 := ge_of_tendsto hlim (Eventually.of_forall hbound) + exact (not_le_of_gt hUm) hz + +end Anticanonical.SourceSmooth + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/MongeAmpereC0.lean b/lean/OAI/Geometry/PrescribedRicci/MongeAmpereC0.lean new file mode 100644 index 0000000000000000000000000000000000000000..6e64e55c179014ff356572584b6dfa6cd13a7b83 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/MongeAmpereC0.lean @@ -0,0 +1,99 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.MomentBoundPointwise +import OAI.Geometry.PrescribedRicci.MongeAmpereMoments +import OAI.Geometry.PrescribedRicci.MongeAmpereL2 +import OAI.Geometry.PrescribedRicci.KahlerIntegralPos +import OAI.Geometry.PrescribedPotential.VolumePath + +namespace OAI + +/-! Monge Ampere C0. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory +open scoped ContDiff Classical +namespace Anticanonical.SourceSmooth.KaehlerMetric +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} + + + +theorem mongeAmpere_C0_bound (g : KaehlerMetric A) (hd : 2 ≤ d) + (D : ℝ) (hD : 0 ≤ D) : ∃ C : ℝ, 0 ≤ C ∧ + ∀ φ : SmoothRealFunction A, g.PositivePotential φ → g.integral φ.value = 0 → + (∀ x, |1-(g.potentialDensity φ).value x| ≤ D) → ∀ x, |φ.value x| ≤ C := by + let : MeasurableSpace X := borel X + let : BorelSpace X := ⟨rfl⟩ + obtain ⟨L,hL,hL2⟩ := g.mongeAmpere_L2_bound (by omega : 0 < d) D hD + obtain ⟨ν,B,hν,hB,hM⟩ := g.mongeAmpere_moment_bounds hd D hD + let V := g.integral (fun _ => (1:ℝ)) + have hV : 0 ≤ V := g.integral_nonneg (fun _ => zero_le_one) + let M : ℝ := (V+L)^(1/2:ℝ) + have hMn : 0 ≤ M := Real.rpow_nonneg (add_nonneg hV hL) _ + refine ⟨B*M,mul_nonneg hB hMn,fun φ hp hm hρ => ?_⟩ + have h2 : g.powerMoment φ 2 ≤ M := by + have hI : g.powerIntegral φ 2 = V + g.integral (fun x => φ.value x^2) := by + simp only [powerIntegral, div_self (by norm_num : (2:ℝ) ≠ 0), Real.rpow_one] + exact g.integral_add continuous_const (φ.continuous.pow 2) + change (g.powerIntegral φ 2)^(1/2:ℝ) ≤ (V+L)^(1/2:ℝ) + apply Real.rpow_le_rpow (g.powerIntegral_nonneg φ 2) _ (by norm_num) + rw [hI] + have hh := hL2 φ hp hm hρ + linarith + let w : X → ℝ := fun x => Real.sqrt (1+φ.value x^2) + have hw : Continuous w := (continuous_const.add (φ.continuous.pow 2)).sqrt + have hwn (x : X) : 0 ≤ w x := Real.sqrt_nonneg _ + let p : ℕ → ℝ := fun n => 2*ν^n + have hp0 (n : ℕ) : 0 < p n := mul_pos (by norm_num) (pow_pos (lt_trans zero_lt_one hν) n) + have hpt : Tendsto p atTop atTop := (tendsto_pow_atTop_atTop_of_one_lt hν).const_mul_atTop (by norm_num) + have hwp (n : ℕ) : (fun x => w x^(p n)) = (fun x => (1+φ.value x^2)^((p n)/2)) := by + funext x + dsimp only [w] + rw [Real.sqrt_eq_rpow, ← Real.rpow_mul (by positivity : 0 ≤ 1+φ.value x^2)] + congr 1; ring + have hi (n : ℕ) : Integrable (fun x => w x ^ p n) g.volumeMeasure := by + rw [hwp] + exact (powerIntegrand_continuous φ _).integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) + have hmom (n : ℕ) : ∫ x, w x^p n ∂g.volumeMeasure ≤ (B*M)^p n := by + rw [hwp, g.integral_volumeMeasure (powerIntegrand_continuous φ _)] + have hh : g.powerMoment φ (p n) ≤ B*M := + (hM φ hp hρ n).trans (mul_le_mul_of_nonneg_left h2 hB) + have hpow := Real.rpow_le_rpow (g.powerMoment_nonneg φ (p n)) hh (hp0 n).le + dsimp only [powerMoment] at hpow + rw [← Real.rpow_mul (g.powerIntegral_nonneg φ (p n)), one_div_mul_cancel (ne_of_gt (hp0 n)), Real.rpow_one] at hpow + exact hpow + have hpoint := continuous_le_of_moments hw hwn p hp0 hpt (mul_nonneg hB hMn) hi hmom + intro x + calc + |φ.value x| = Real.sqrt (φ.value x^2) := (Real.sqrt_sq_eq_abs _).symm + _ ≤ w x := Real.sqrt_le_sqrt (by linarith) + _ ≤ _ := hpoint x + + +theorem volumePath_C0_bound (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) + (hd : 2 ≤ d) : ∃ C : ℝ, 0 ≤ C ∧ + ∀ (φ : SmoothRealFunction A) (hp : g.PositivePotential φ), g.integral φ.value = 0 → + ∀ (t b : ℝ), t ∈ Icc 0 1 → + (∀ x, (g.logRatio (g.deform φ hp)).value x = t*(prescribedForcing g h).value x+b) → + ∀ x, |φ.value x| ≤ C := by + let M := ‖(⟨(prescribedForcing g h).value, (prescribedForcing g h).continuous⟩ : C(X,ℝ))‖ + let D := 1+Real.exp (2*M) + obtain ⟨C,hC,hbound⟩ := g.mongeAmpere_C0_bound hd D (by dsimp [D]; positivity) + refine ⟨C,hC,fun φ hp hm t b ht he => hbound φ hp hm (fun x => ?_)⟩ + have hh := g.volumePath_density_bounds h ht hp he x + have hpρ : 0 ≤ (g.potentialDensity φ).value x := (Real.exp_pos _).le.trans hh.1 + calc + |1-(g.potentialDensity φ).value x| ≤ |(1:ℝ)|+|(g.potentialDensity φ).value x| := abs_sub _ _ + _ = 1+(g.potentialDensity φ).value x := by rw [abs_one, abs_of_nonneg hpρ] + _ ≤ _ := by dsimp [D,M]; linarith [hh.2] + +end Anticanonical.SourceSmooth.KaehlerMetric + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/MongeAmpereEnergy.lean b/lean/OAI/Geometry/PrescribedRicci/MongeAmpereEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..00789428344e80c0fa439ace15c22a320cbd725f --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/MongeAmpereEnergy.lean @@ -0,0 +1,196 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.GlobalKahlerEnergy +import OAI.Geometry.PrescribedRicci.GlobalKahlerIntegral +import OAI.Geometry.PrescribedRicci.MatrixCofactorOrder +import OAI.Geometry.PrescribedPotential.PotentialDensity +import OAI.Geometry.PrescribedRicci.KahlerVolumeVariation + +namespace OAI + +/-! Monge Ampere Energy. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix MeasureTheory +open scoped ContDiff ComplexOrder Classical Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +namespace KaehlerMetric + +lemma integral_sub [T2Space X] [CompactSpace X] (g : KaehlerMetric A) + {f h : X → ℝ} (hf : Continuous f) (hh : Continuous h) : + g.integral (fun x => f x - h x) = g.integral f - g.integral h := by + have he : (fun x => f x - h x) = fun x => f x + (-1) * h x := by funext x; ring + rw [he, g.integral_add hf (show Continuous (fun x => (-1) * h x) from continuous_const.fun_mul hh), g.integral_const_mul] + ring + +lemma integral_mono [T2Space X] [CompactSpace X] (g : KaehlerMetric A) + {f h : X → ℝ} (hf : Continuous f) (hh : Continuous h) (hle : ∀ x, f x ≤ h x) : + g.integral f ≤ g.integral h := by + have he := g.integral_nonneg (fun x => sub_nonneg.mpr (hle x)) + rw [g.integral_sub hh hf] at he + exact sub_nonneg.mp he + +lemma integral_zero [T2Space X] [CompactSpace X] (g : KaehlerMetric A) : + g.integral (fun _ => 0) = 0 := by simp [integral, chartIntegral] + +lemma cofactorQuadratic_eq_gradientPair (H : Matrix (Fin d) (Fin d) ℂ) + (hH : H.IsHermitian) (p : Fin d → ℂ) : + MongeAmpere.cofactorQuadratic H (star p) = H.det.re * (gradientPair H p p).re := by + have he : star (star p) ⬝ᵥ (H⁻¹ *ᵥ star p) = gradientPair H p p := by + simp only [gradientPair, dotProduct, Matrix.mulVec, Pi.star_apply, star_star, Finset.mul_sum] + apply Finset.sum_congr rfl + intro j _ + apply Finset.sum_congr rfl + intro i _ + ring + rw [MongeAmpere.cofactorQuadratic, he, Complex.mul_re, hermitian_det_im hH, zero_mul, sub_zero] + +lemma energy_segment_coercive (g : KaehlerMetric A) (φ : SmoothRealFunction A) + (hp : g.PositivePotential φ) (hd : 0 < d) (s : ℝ) (hs : s ∈ Ico 0 1) (x : X) : + (1 - s) ^ (d - 1) * (g.energy φ φ).value x ≤ + (g.potentialDensity (φ.realSMul s)).value x * + ((g.deform (φ.realSMul s) (hp.segment ⟨hs.1, hs.2.le⟩)).energy φ φ).value x := by + let gs := g.deform (φ.realSMul s) (hp.segment ⟨hs.1, hs.2.le⟩) + obtain ⟨i, hi⟩ := A.covers x + have hz := (A.chart i).mapsTo hi + let z := A.chart i x + let p := holRealDeriv (φ.localExpression i) z + have hem : (((1 - s : ℝ) : ℂ) • g.matrix i z + (s : ℂ) • + (g.matrix i z + φ.hessian i z)) = gs.matrix i z := by + change _ = g.matrix i z + (φ.realSMul s).hessian i z + rw [SmoothRealFunction.hessian_realSMul] + ext j k + simp only [Matrix.add_apply, Matrix.smul_apply, smul_eq_mul, Complex.ofReal_sub, Complex.ofReal_one] + ring + have hm := MongeAmpere.cofactorQuadratic_segment (g.positive i z hz) (hp i z hz) (star p) hd hs + rw [hem, cofactorQuadratic_eq_gradientPair _ (g.positive i z hz).isHermitian, + cofactorQuadratic_eq_gradientPair _ (gs.positive i z hz).isHermitian] at hm + have he := g.energy_local φ φ i hz + have he' := gs.energy_local φ φ i hz + simp only [SmoothRealFunction.localExpression, Function.comp_apply, (A.chart i).left_inv hi] at he he' + change (g.energy φ φ).value x = (gradientPair (g.matrix i z) p p).re at he + change (gs.energy φ φ).value x = (gradientPair (gs.matrix i z) p p).re at he' + rw [← he, ← he'] at hm + have hv := g.density_mul_volume (φ.realSMul s) i hz + rw [(A.chart i).left_inv hi] at hv + change (g.potentialDensity (φ.realSMul s)).value x * (g.matrix i z).det.re = (gs.matrix i z).det.re at hv + apply (mul_le_mul_iff_of_pos_left (g.volumeCoefficient_pos i hz)).mp + change (g.matrix i z).det.re * _ ≤ (g.matrix i z).det.re * _ + calc + _ = (1 - s) ^ (d - 1) * ((g.matrix i z).det.re * (g.energy φ φ).value x) := by ring + _ ≤ (gs.matrix i z).det.re * (gs.energy φ φ).value x := hm + _ = _ := by rw [← hv]; ring + +lemma integral_energy_segment_coercive [T2Space X] [CompactSpace X] + (g : KaehlerMetric A) (φ : SmoothRealFunction A) (hp : g.PositivePotential φ) + (hd : 0 < d) (s : ℝ) (hs : s ∈ Ico 0 1) : + (1 - s) ^ (d - 1) * g.integral (g.energy φ φ).value ≤ + (g.deform (φ.realSMul s) (hp.segment ⟨hs.1, hs.2.le⟩)).integral + ((g.deform (φ.realSMul s) (hp.segment ⟨hs.1, hs.2.le⟩)).energy φ φ).value := by + let gs := g.deform (φ.realSMul s) (hp.segment ⟨hs.1, hs.2.le⟩) + rw [← g.integral_const_mul, ← g.integral_density (φ.realSMul s) (hp.segment ⟨hs.1, hs.2.le⟩)] + apply g.integral_mono (continuous_const.mul (g.energy φ φ).continuous) + ((gs.energy φ φ).continuous.mul (g.potentialDensity _).continuous) + intro x + change (1 - s) ^ (d - 1) * (g.energy φ φ).value x ≤ + (gs.energy φ φ).value x * (g.potentialDensity (φ.realSMul s)).value x + simpa only [mul_comm] using g.energy_segment_coercive φ hp hd s hs x + + + +lemma integral_energy_half_segment [T2Space X] [CompactSpace X] + (g : KaehlerMetric A) (φ : SmoothRealFunction A) (hp : g.PositivePotential φ) + (hd : 0 < d) (s : ℝ) (hs : s ∈ Icc 0 (1/2)) : + (1/2 : ℝ) ^ (d - 1) * g.integral (g.energy φ φ).value ≤ + (g.deform (φ.realSMul s) (hp.segment ⟨hs.1, by linarith [hs.2]⟩)).integral + ((g.deform (φ.realSMul s) (hp.segment ⟨hs.1, by linarith [hs.2]⟩)).energy φ φ).value := by + have hs' : s ∈ Ico 0 1 := ⟨hs.1, by linarith [hs.2]⟩ + refine le_trans ?_ (g.integral_energy_segment_coercive φ hp hd s hs') + exact mul_le_mul_of_nonneg_right + (pow_le_pow_left₀ (by norm_num) (by linarith [hs.2]) (d - 1)) + (g.integral_nonneg (g.energy_nonneg φ)) + +lemma potentialDensity_smul_zero (g : KaehlerMetric A) (φ : SmoothRealFunction A) (x : X) : + (g.potentialDensity (φ.realSMul 0)).value x = 1 := by + obtain ⟨i, hi⟩ := A.covers x + change g.potentialDensityValue _ x = _ + rw [g.potentialDensityValue_local _ i hi] + simp only [volumePolynomial, SmoothRealFunction.hessian_realSMul, Complex.ofReal_zero, + zero_smul, add_zero, div_self (g.positive i _ ((A.chart i).mapsTo hi)).det_pos.ne', Complex.one_re] + +lemma potentialDensity_smul_one (g : KaehlerMetric A) (φ : SmoothRealFunction A) (x : X) : + (g.potentialDensity (φ.realSMul 1)).value x = (g.potentialDensity φ).value x := by + obtain ⟨i, hi⟩ := A.covers x + change g.potentialDensityValue _ x = g.potentialDensityValue _ x + rw [g.potentialDensityValue_local _ i hi, g.potentialDensityValue_local _ i hi] + simp only [volumePolynomial, SmoothRealFunction.hessian_realSMul, Complex.ofReal_one, one_smul] + + + +theorem mongeAmpere_energy [T2Space X] [CompactSpace X] + (g : KaehlerMetric A) (φ : SmoothRealFunction A) (hp : g.PositivePotential φ) (hd : 0 < d) : + (1/2 : ℝ) ^ d * g.integral (g.energy φ φ).value ≤ + g.integral φ.value - g.integral (fun x => φ.value x * (g.potentialDensity φ).value x) := by + let f (t : ℝ) := g.integral (fun x => φ.value x * (g.potentialDensity (φ.realSMul t)).value x) + have hf (s : ℝ) (hs : s ∈ Icc 0 1) := g.volume_firstVariation φ φ s (hp.segment hs) + have hfc : ContinuousOn f (Icc 0 1) := fun s hs => (hf s hs).continuousAt.continuousWithinAt + have hfd : DifferentiableOn ℝ f (interior (Icc 0 1)) := + fun s hs => (hf s (interior_subset hs)).differentiableAt.differentiableWithinAt + have ha : AntitoneOn f (Icc 0 1) := antitoneOn_of_deriv_nonpos (convex_Icc 0 1) hfc hfd (by + intro s hs + rw [(hf s (interior_subset hs)).deriv] + exact neg_nonpos.mpr ((g.deform (φ.realSMul s) (hp.segment (interior_subset hs))).integral_nonneg + ((g.deform (φ.realSMul s) (hp.segment (interior_subset hs))).energy_nonneg φ))) + have hsub : Icc (0 : ℝ) (1/2) ⊆ Icc 0 1 := fun s hs => ⟨hs.1, by linarith [hs.2]⟩ + have hdh : DifferentiableOn ℝ f (interior (Icc 0 (1/2))) := + fun s hs => (hf s (hsub (interior_subset hs))).differentiableAt.differentiableWithinAt + have hh := (convex_Icc (0 : ℝ) (1/2)).image_sub_le_mul_sub_of_deriv_le + (hfc.mono hsub) hdh (C := -((1/2 : ℝ) ^ (d - 1) * g.integral (g.energy φ φ).value)) + (by + intro s hs + rw [(hf s (hsub (interior_subset hs))).deriv] + exact neg_le_neg (g.integral_energy_half_segment φ hp hd s (interior_subset hs))) + 0 (by norm_num) (1/2) (by norm_num) (by norm_num) + have he := ha (show (1/2 : ℝ) ∈ Icc 0 1 by norm_num) (show (1 : ℝ) ∈ Icc 0 1 by norm_num) (by norm_num) + have h0 : f 0 = g.integral φ.value := by + dsimp only [f] + simp_rw [g.potentialDensity_smul_zero, mul_one] + have h1 : f 1 = g.integral (fun x => φ.value x * (g.potentialDensity φ).value x) := by + dsimp only [f] + simp_rw [g.potentialDensity_smul_one] + have hpow : (1/2 : ℝ) ^ d = (1/2 : ℝ) ^ (d - 1) * (1/2) := by + conv_lhs => rw [show d = (d - 1) + 1 by omega, pow_succ] + rw [h0] at hh + rw [h1] at he + rw [hpow] + nlinarith + +lemma mongeAmpere_energy_density_bound [T2Space X] [CompactSpace X] + (g : KaehlerMetric A) (φ : SmoothRealFunction A) (hp : g.PositivePotential φ) (hd : 0 < d) + (D : ℝ) (hD : ∀ x, |1 - (g.potentialDensity φ).value x| ≤ D) : + (1/2 : ℝ) ^ d * g.integral (g.energy φ φ).value ≤ D * g.integral (fun x => |φ.value x|) := by + refine (g.mongeAmpere_energy φ hp hd).trans ?_ + rw [← g.integral_sub φ.continuous (φ.continuous.fun_mul (g.potentialDensity φ).continuous), + ← g.integral_const_mul] + apply g.integral_mono (φ.continuous.sub (φ.continuous.fun_mul (g.potentialDensity φ).continuous)) + (continuous_const.mul φ.continuous.abs) + intro x + change φ.value x - φ.value x * (g.potentialDensity φ).value x ≤ D * |φ.value x| + calc + _ = φ.value x * (1 - (g.potentialDensity φ).value x) := by ring + _ ≤ |φ.value x * (1 - (g.potentialDensity φ).value x)| := le_abs_self _ + _ = |φ.value x| * |1 - (g.potentialDensity φ).value x| := abs_mul _ _ + _ ≤ |φ.value x| * D := mul_le_mul_of_nonneg_left (hD x) (abs_nonneg _) + _ = _ := mul_comm _ _ + +end KaehlerMetric +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/MongeAmpereL2.lean b/lean/OAI/Geometry/PrescribedRicci/MongeAmpereL2.lean new file mode 100644 index 0000000000000000000000000000000000000000..29dd0b6c7a56e5a3e047bb6f901807c19a9e4a12 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/MongeAmpereL2.lean @@ -0,0 +1,114 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.KahlerPoincare +import OAI.Geometry.PrescribedRicci.KahlerVolumeVariation +import OAI.Geometry.PrescribedRicci.MongeAmpereEnergy +import OAI.Geometry.PrescribedPotential.VolumeDeterminantBounds + +namespace OAI + +/-! Monge Ampere L2. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory +open scoped ContDiff Classical +namespace Anticanonical.SourceSmooth +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} +namespace KaehlerMetric + +theorem mongeAmpere_L2_bound (g : KaehlerMetric A) (hd : 0 < d) + (D : ℝ) (hD : 0 ≤ D) : ∃ C : ℝ, 0 ≤ C ∧ + ∀ φ : SmoothRealFunction A, g.PositivePotential φ → g.integral φ.value = 0 → + (∀ x, |1 - (g.potentialDensity φ).value x| ≤ D) → + g.integral (fun x => φ.value x ^ 2) ≤ C := by + obtain ⟨P,hP,hpoincare⟩ := g.poincare + let c : ℝ := (1/2) ^ d + have hc : 0 < c := pow_pos (by norm_num) _ + let V := g.integral (fun _ => 1) + have hV : 0 ≤ V := g.integral_nonneg (fun _ => zero_le_one) + refine ⟨(P*D)^2 * V / c^2, div_nonneg (mul_nonneg (sq_nonneg _) hV) (sq_nonneg _), ?_⟩ + intro φ hp hmean hρ + let Iφ := g.integral (fun x => φ.value x ^ 2) + let Eφ := g.integral (g.energy φ φ).value + let Lφ := g.integral (fun x => |φ.value x|) + have hI : 0 ≤ Iφ := g.integral_nonneg (fun _ => sq_nonneg _) + have hL : 0 ≤ Lφ := g.integral_nonneg (fun _ => abs_nonneg _) + have hpi : Iφ ≤ P * Eφ := hpoincare φ hmean + have hma : c * Eφ ≤ D * Lφ := g.mongeAmpere_energy_density_bound φ hp hd D hρ + have hcs : Lφ ^ 2 ≤ Iφ * V := by + have hh := g.integral_cauchySchwarz φ.continuous.abs (continuous_const (y := (1 : ℝ))) + simpa only [one_pow, mul_one, sq_abs] using hh + have hfirst : c * Iφ ≤ (P*D) * Lφ := by + calc + c * Iφ ≤ c * (P * Eφ) := mul_le_mul_of_nonneg_left hpi hc.le + _ = P * (c * Eφ) := by ring + _ ≤ P * (D * Lφ) := mul_le_mul_of_nonneg_left hma hP.le + _ = _ := by ring + have hs : (c*Iφ)^2 ≤ ((P*D)*Lφ)^2 := + (sq_le_sq₀ (mul_nonneg hc.le hI) (mul_nonneg (mul_nonneg hP.le hD) hL)).2 hfirst + have hprod : (c^2 * Iφ) * Iφ ≤ ((P*D)^2 * V) * Iφ := by + calc + (c^2 * Iφ) * Iφ = (c*Iφ)^2 := by ring + _ ≤ ((P*D)*Lφ)^2 := hs + _ = (P*D)^2 * Lφ^2 := by ring + _ ≤ (P*D)^2 * (Iφ*V) := mul_le_mul_of_nonneg_left hcs (sq_nonneg _) + _ = _ := by ring + change Iφ ≤ (P*D)^2 * V / c^2 + by_cases hz : Iφ = 0 + · rw [hz]; exact div_nonneg (mul_nonneg (sq_nonneg _) hV) (sq_nonneg _) + · apply (le_div_iff₀ (sq_pos_of_pos hc)).2 + have hh := (mul_le_mul_iff_left₀ (lt_of_le_of_ne hI (Ne.symm hz))).1 hprod + simpa only [mul_comm] using hh + +omit [T2Space X] in +lemma volumePath_density_bounds (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) + {t b : ℝ} {φ : SmoothRealFunction A} (ht : t ∈ Icc 0 1) + (hp : g.PositivePotential φ) + (he : ∀ x, (g.logRatio (g.deform φ hp)).value x = t*(prescribedForcing g h).value x+b) + (x : X) : + let M := ‖(⟨(prescribedForcing g h).value, (prescribedForcing g h).continuous⟩ : C(X,ℝ))‖; + Real.exp (-2*M) ≤ (g.potentialDensity φ).value x ∧ + (g.potentialDensity φ).value x ≤ Real.exp (2*M) := by + obtain ⟨i,hi⟩ := A.covers x + have hz := (A.chart i).mapsTo hi + have hh := volumePath_det_ratio_bounds g h ht hp he i hz + have hdens := g.density_mul_volume φ i hz + rw [(A.chart i).left_inv hi] at hdens + have hv := g.volumeCoefficient_pos i hz + change 0 < (g.matrix i (A.chart i x)).det.re at hv + have heq : (g.potentialDensity φ).value x = + (g.matrix i (A.chart i x) + φ.hessian i (A.chart i x)).det.re / + (g.matrix i (A.chart i x)).det.re := (eq_div_iff (ne_of_gt hv)).2 hdens + rw [heq] + exact hh + + + +theorem volumePath_L2_bound (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) + (hd : 0 < d) : ∃ C : ℝ, 0 ≤ C ∧ + ∀ (t b : ℝ) (φ : SmoothRealFunction A) (hp : g.PositivePotential φ), t ∈ Icc 0 1 → + g.integral φ.value = 0 → + (∀ x, (g.logRatio (g.deform φ hp)).value x = t*(prescribedForcing g h).value x+b) → + g.integral (fun x => φ.value x ^ 2) ≤ C := by + let M := ‖(⟨(prescribedForcing g h).value, (prescribedForcing g h).continuous⟩ : C(X,ℝ))‖ + obtain ⟨C,hC,hbound⟩ := g.mongeAmpere_L2_bound hd (1 + Real.exp (2*M)) (by positivity) + refine ⟨C,hC,fun t b φ hp ht hmean he => hbound φ hp hmean ?_⟩ + intro x + obtain ⟨hlo,hup⟩ := g.volumePath_density_bounds h ht hp he x + change Real.exp (-2*M) ≤ _ at hlo + change _ ≤ Real.exp (2*M) at hup + have hρ : 0 ≤ (g.potentialDensity φ).value x := (Real.exp_pos _).le.trans hlo + apply abs_le.mpr + constructor <;> linarith [Real.exp_pos (2*M)] + +end KaehlerMetric +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/MongeAmpereMoments.lean b/lean/OAI/Geometry/PrescribedRicci/MongeAmpereMoments.lean new file mode 100644 index 0000000000000000000000000000000000000000..7850f9b47d8fa216ca83d2784505c08d9a79be0d --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/MongeAmpereMoments.lean @@ -0,0 +1,134 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.MongeAmperePowerEnergy +import OAI.Geometry.PrescribedRicci.MoserIteration +import OAI.Geometry.PrescribedRicci.KahlerSobolev +import OAI.Geometry.PrescribedRicci.KahlerVolumeMeasure + +namespace OAI + +/-! Monge Ampere Moments. -/ + +section + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory +open scoped ContDiff Classical NNReal ENNReal +namespace Anticanonical.SourceSmooth.KaehlerMetric +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [MeasurableSpace X] [BorelSpace X] {A : ComplexAtlas d X} + +def powerIntegral (g : KaehlerMetric A) (φ : SmoothRealFunction A) (p : ℝ) : ℝ := + g.integral (fun x => (1+φ.value x^2)^(p/2)) +def powerMoment (g : KaehlerMetric A) (φ : SmoothRealFunction A) (p : ℝ) : ℝ := + (g.powerIntegral φ p)^(1/p) + +omit [T2Space X] [CompactSpace X] [MeasurableSpace X] [BorelSpace X] in +lemma powerIntegrand_continuous (φ : SmoothRealFunction A) (p : ℝ) : + Continuous (fun x => (1+φ.value x^2)^(p/2)) := + (continuous_const.add (φ.continuous.pow 2)).rpow_const (fun x => Or.inl (show 1+φ.value x^2 ≠ 0 from ne_of_gt (by positivity))) +omit [MeasurableSpace X] [BorelSpace X] in +lemma powerIntegral_nonneg (g : KaehlerMetric A) (φ : SmoothRealFunction A) (p : ℝ) : + 0 ≤ g.powerIntegral φ p := g.integral_nonneg (fun _ => Real.rpow_nonneg (by positivity) _) +omit [MeasurableSpace X] [BorelSpace X] in +lemma powerMoment_nonneg (g : KaehlerMetric A) (φ : SmoothRealFunction A) (p : ℝ) : + 0 ≤ g.powerMoment φ p := Real.rpow_nonneg (g.powerIntegral_nonneg φ p) _ + +lemma moserPower_lpNorm_sq (g : KaehlerMetric A) (φ : SmoothRealFunction A) + {q : ℝ≥0} (hq : 0 < q) (p : ℝ) : + (lpNorm (φ.compose (moserPower p) (moserPower_smooth p)).value q g.volumeMeasure)^2 = + (g.powerIntegral φ (p*(q:ℝ)/2))^(2/(q:ℝ)) := by + rw [lpNorm_nnreal_eq_integral_norm_rpow (ne_of_gt hq) + (φ.compose (moserPower p) (moserPower_smooth p)).continuous.aestronglyMeasurable] + have he : (fun x => ‖(φ.compose (moserPower p) (moserPower_smooth p)).value x‖^(q:ℝ)) = + (fun x => (1+φ.value x^2)^((p*(q:ℝ)/2)/2)) := by + funext x + rw [show (φ.compose (moserPower p) (moserPower_smooth p)).value x = moserPower p (φ.value x) from rfl, + moserPower_rpow] + congr 1; ring + rw [he, g.integral_volumeMeasure (powerIntegrand_continuous φ _)] + change ((g.powerIntegral φ (p*(q:ℝ)/2))^((q:ℝ)⁻¹))^2 = _ + rw [← Real.rpow_two, ← Real.rpow_mul (g.powerIntegral_nonneg φ _)] + congr 1; ring + + +theorem mongeAmpere_moment_step (g : KaehlerMetric A) (hd : 2 ≤ d) + (D : ℝ) (hD : 0 ≤ D) : ∃ ν C : ℝ, 1 < ν ∧ 0 < C ∧ + ∀ φ : SmoothRealFunction A, g.PositivePotential φ → + (∀ x, |1-(g.potentialDensity φ).value x| ≤ D) → + ∀ p : ℝ, 2 ≤ p → g.powerMoment φ (p*ν) ≤ + (C*p^2)^(1/p) * g.powerMoment φ p := by + obtain ⟨q,hq,S,hS,hsob⟩ := g.sobolev hd + have hqR : (2:ℝ) < q := by exact_mod_cast hq + let ν : ℝ := (q:ℝ)/2 + let K : ℝ := D/(1/2:ℝ)^d + let C : ℝ := S*(K+1) + have hK : 0 ≤ K := div_nonneg hD (by positivity) + have hC : 0 < C := mul_pos hS (by linarith) + refine ⟨ν,C,by dsimp [ν]; linarith,hC,?_⟩ + intro φ hp hρ p hpow + let ψ := φ.compose (moserPower p) (moserPower_smooth p) + have hs := hsob ψ + have he := g.mongeAmpere_power_energy (by omega : 0 < d) D hD φ hp hρ p hpow + have heI : g.integral (fun x => (moserPower p (φ.value x))^2) = g.powerIntegral φ p := by + simp only [moserPower_sq, powerIntegral] + have hsI : g.integral (fun x => ψ.value x^2) = g.powerIntegral φ p := heI + rw [heI] at he + rw [hsI, g.moserPower_lpNorm_sq φ (lt_trans (by norm_num) hq) p] at hs + have hp0 : 0 < p := by linarith + have hc : S*((p^2/4)*K+1) ≤ C*p^2 := by + dsimp only [C] + have hp2 : 1 ≤ p^2 := by nlinarith + have hh : (p^2/4)*K+1 ≤ (K+1)*p^2 := by nlinarith [mul_nonneg hK (sq_nonneg p)] + nlinarith [mul_le_mul_of_nonneg_left hh hS.le] + have hh : (g.powerIntegral φ (p*ν))^(1/ν) ≤ C*p^2*g.powerIntegral φ p := by + have hνeq : 1/ν = 2/(q:ℝ) := by dsimp [ν]; ring + have hpe : p*ν = p*(q:ℝ)/2 := by dsimp [ν]; ring + rw [hνeq,hpe] + calc + _ ≤ S*(g.integral (g.energy ψ ψ).value + g.powerIntegral φ p) := hs + _ ≤ S*((p^2/4)*K*g.powerIntegral φ p + g.powerIntegral φ p) := mul_le_mul_of_nonneg_left (by dsimp only [ψ,K]; linarith only [he]) hS.le + _ = S*((p^2/4)*K+1)*g.powerIntegral φ p := by ring + _ ≤ _ := mul_le_mul_of_nonneg_right hc (g.powerIntegral_nonneg φ p) + have hν0 : 0 < ν := by dsimp [ν]; positivity + have hh' := Real.rpow_le_rpow (Real.rpow_nonneg (g.powerIntegral_nonneg φ (p*ν)) _) hh (le_of_lt (one_div_pos.mpr hp0)) + rw [← Real.rpow_mul (g.powerIntegral_nonneg φ (p*ν)), + Real.mul_rpow (mul_nonneg hC.le (sq_nonneg p)) (g.powerIntegral_nonneg φ p)] at hh' + convert hh' using 1 <;> dsimp only [powerMoment] + congr 1 + field_simp + + +theorem mongeAmpere_moment_bounds (g : KaehlerMetric A) (hd : 2 ≤ d) + (D : ℝ) (hD : 0 ≤ D) : ∃ ν B : ℝ, 1 < ν ∧ 0 ≤ B ∧ + ∀ φ : SmoothRealFunction A, g.PositivePotential φ → + (∀ x, |1-(g.potentialDensity φ).value x| ≤ D) → + ∀ n : ℕ, g.powerMoment φ (2*ν^n) ≤ B * g.powerMoment φ 2 := by + obtain ⟨ν,C,hν,hC,hstep⟩ := g.mongeAmpere_moment_step hd D hD + let a (n : ℕ) := (C*(2*ν^n)^2)^(1/(2*ν^n)) + let u (n : ℕ) := ∏ j ∈ Finset.range n, a j + have hu : ∀ n, 0 ≤ u n := fun n => Finset.prod_nonneg (fun j _ => Real.rpow_nonneg (by positivity) _) + have hs (n : ℕ) : u (n+1) ≤ (C*(2*ν^n)^2)^(1/(2*ν^n))*u n := by simp only [u, Finset.prod_range_succ, a]; rw [mul_comm] + obtain ⟨B,hB,hbound⟩ := moser_sequence_bound ν C 2 hν hC u hu hs (by norm_num) + refine ⟨ν,B,hν,hB,fun φ hp hρ n => ?_⟩ + have hi (n : ℕ) : g.powerMoment φ (2*ν^n) ≤ u n * g.powerMoment φ 2 := by + induction n with + | zero => simp [u] + | succ n ih => + have hn : 2 ≤ 2*ν^n := by nlinarith [one_le_pow₀ (n:=n) hν.le] + have he : 2*ν^(n+1) = (2*ν^n)*ν := by rw [pow_succ]; ring + rw [he] + calc + _ ≤ a n * g.powerMoment φ (2*ν^n) := hstep φ hp hρ (2*ν^n) hn + _ ≤ a n * (u n * g.powerMoment φ 2) := mul_le_mul_of_nonneg_left ih (Real.rpow_nonneg (by positivity) _) + _ = _ := by dsimp only [u]; rw [Finset.prod_range_succ]; ring + apply (hi n).trans + apply mul_le_mul_of_nonneg_right _ (g.powerMoment_nonneg φ 2) + simpa only [u, Finset.range_zero, Finset.prod_empty, mul_one] using hbound n + +end Anticanonical.SourceSmooth.KaehlerMetric + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/MongeAmperePowerEnergy.lean b/lean/OAI/Geometry/PrescribedRicci/MongeAmperePowerEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..2165170cf962e5f0cdb358bb0ff3dca59dc0297d --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/MongeAmperePowerEnergy.lean @@ -0,0 +1,155 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalSobolev +import OAI.Geometry.PrescribedRicci.WeightedMongeAmpereEnergy + +namespace OAI + +/-! Monge Ampere Power Energy. -/ + +section + + +noncomputable section +open Set Filter Topology MeasureTheory +open scoped ContDiff Classical +namespace Anticanonical.SourceSmooth + +private def powerBase (t : ℝ) : ℝ := 1+t^2 +private lemma powerBase_pos (t : ℝ) : 0 < powerBase t := by dsimp [powerBase]; positivity +private lemma powerBase_smooth : ContDiff ℝ ∞ powerBase := by unfold powerBase; fun_prop +private lemma powerBase_deriv (t : ℝ) : HasDerivAt powerBase (2*t) t := by + convert (hasDerivAt_const t (1:ℝ)).add ((hasDerivAt_id t).pow 2) using 1 <;> first | rfl | norm_num [powerBase] + +def moserTest (p t : ℝ) : ℝ := t * powerBase t ^ (p/2-1) +def moserPower (p t : ℝ) : ℝ := powerBase t ^ (p/4) + +lemma moserTest_smooth (p : ℝ) : ContDiff ℝ ∞ (moserTest p) := + contDiff_id.mul (powerBase_smooth.rpow_const_of_ne (fun t => ne_of_gt (powerBase_pos t))) +lemma moserPower_smooth (p : ℝ) : ContDiff ℝ ∞ (moserPower p) := + powerBase_smooth.rpow_const_of_ne (fun t => ne_of_gt (powerBase_pos t)) + +lemma moserTest_deriv (p t : ℝ) : deriv (moserTest p) t = + powerBase t ^ (p/2-1) + t*((p/2-1)*powerBase t ^ (p/2-1-1)*(2*t)) := by + have h := ((hasDerivAt_id t).mul ((powerBase_deriv t).rpow_const (p:=p/2-1) (Or.inl (ne_of_gt (powerBase_pos t))))).deriv + change deriv (moserTest p) t = _ at h + rw [h] + dsimp only [id_eq] + ring + +lemma moserPower_deriv (p t : ℝ) : deriv (moserPower p) t = + (p/4)*powerBase t ^ (p/4-1)*(2*t) := by + have h := ((powerBase_deriv t).rpow_const (p:=p/4) (Or.inl (ne_of_gt (powerBase_pos t)))).deriv + change deriv (moserPower p) t = _ at h + rw [h] + ring + +lemma moserTest_deriv_lower {p : ℝ} (hp : 2 ≤ p) (t : ℝ) : + powerBase t ^ (p/2-1) ≤ deriv (moserTest p) t := by + rw [moserTest_deriv] + have ha : 0 ≤ p/2-1 := by linarith + have hb := Real.rpow_nonneg (powerBase_pos t).le (p/2-1-1) + nlinarith [mul_nonneg (mul_nonneg ha hb) (sq_nonneg t)] + +lemma moserTest_deriv_nonneg {p : ℝ} (hp : 2 ≤ p) (t : ℝ) : + 0 ≤ deriv (moserTest p) t := + (Real.rpow_nonneg (powerBase_pos t).le _).trans (moserTest_deriv_lower hp t) + +lemma moserPower_deriv_sq_le {p : ℝ} (hp : 2 ≤ p) (t : ℝ) : + (deriv (moserPower p) t)^2 ≤ (p^2/4) * deriv (moserTest p) t := by + have hb := powerBase_pos t + have he : (powerBase t ^ (p/4-1))^2 = powerBase t ^ (p/2-2) := by + rw [← Real.rpow_two, ← Real.rpow_mul hb.le] + congr 1; ring + have he' : powerBase t ^ (p/2-2) * powerBase t = powerBase t ^ (p/2-1) := by + conv_lhs => rhs; rw [← Real.rpow_one (powerBase t)] + rw [← Real.rpow_add hb] + congr 1; ring + calc + _ = (p^2/4) * (powerBase t ^ (p/2-2) * t^2) := by rw [moserPower_deriv, mul_pow, mul_pow, he]; ring + _ ≤ (p^2/4) * (powerBase t ^ (p/2-2) * powerBase t) := by + gcongr + dsimp [powerBase]; linarith + _ = (p^2/4) * powerBase t ^ (p/2-1) := by rw [he'] + _ ≤ _ := mul_le_mul_of_nonneg_left (moserTest_deriv_lower hp t) (by positivity) + +lemma abs_moserTest_le (p t : ℝ) : |moserTest p t| ≤ (moserPower p t)^2 := by + have hb := powerBase_pos t + have hab : |t| ≤ powerBase t := by + dsimp [powerBase] + nlinarith [sq_nonneg (|t|-1), sq_abs t] + have he : powerBase t * powerBase t ^ (p/2-1) = (moserPower p t)^2 := by + unfold moserPower + rw [← Real.rpow_two, ← Real.rpow_mul hb.le] + conv_lhs => lhs; rw [← Real.rpow_one (powerBase t)] + rw [← Real.rpow_add hb] + congr 1; ring + calc + _ = |t| * powerBase t ^ (p/2-1) := by rw [moserTest, abs_mul, abs_of_nonneg (Real.rpow_nonneg hb.le _)] + _ ≤ powerBase t * powerBase t ^ (p/2-1) := mul_le_mul_of_nonneg_right hab (Real.rpow_nonneg hb.le _) + _ = _ := he + +lemma moserPower_sq (p t : ℝ) : (moserPower p t)^2 = (1+t^2)^(p/2) := by + unfold moserPower powerBase + rw [← Real.rpow_two, ← Real.rpow_mul (by positivity : (0:ℝ) ≤ 1+t^2)] + congr 1; ring + +lemma moserPower_rpow (p q t : ℝ) : ‖moserPower p t‖^q = (1+t^2)^(p*q/4) := by + unfold moserPower powerBase + rw [Real.norm_eq_abs, abs_of_pos (Real.rpow_pos_of_pos (by positivity) _), + ← Real.rpow_mul (by positivity : (0:ℝ) ≤ 1+t^2)] + congr 1; ring + +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} +namespace KaehlerMetric + +theorem mongeAmpere_power_energy (g : KaehlerMetric A) (hd : 0 < d) + (D : ℝ) (_hD : 0 ≤ D) (φ : SmoothRealFunction A) (hp : g.PositivePotential φ) + (hρ : ∀ x, |1 - (g.potentialDensity φ).value x| ≤ D) + (p : ℝ) (hpow : 2 ≤ p) : + g.integral (g.energy (φ.compose (moserPower p) (moserPower_smooth p)) + (φ.compose (moserPower p) (moserPower_smooth p))).value ≤ + (p^2/4) * (D / (1/2:ℝ)^d) * g.integral (fun x => (moserPower p (φ.value x))^2) := by + let F := moserTest p + let U := moserPower p + have hF := moserTest_smooth p + have hU := moserPower_smooth p + have hma := g.mongeAmpere_weighted_energy φ hp hd F hF (moserTest_deriv_nonneg hpow) + have hFc : Continuous (fun x => F (φ.value x)) := hF.continuous.comp φ.continuous + have hUc : Continuous (fun x => (U (φ.value x))^2) := (hU.continuous.comp φ.continuous).pow 2 + have hbound : g.integral (fun x => F (φ.value x)) - + g.integral (fun x => F (φ.value x) * (g.potentialDensity φ).value x) ≤ + D * g.integral (fun x => (U (φ.value x))^2) := by + rw [← g.integral_sub hFc (hFc.fun_mul (g.potentialDensity φ).continuous), ← g.integral_const_mul] + apply g.integral_mono (hFc.sub (hFc.fun_mul (g.potentialDensity φ).continuous)) (continuous_const.fun_mul hUc) + intro x + calc + _ = F (φ.value x) * (1-(g.potentialDensity φ).value x) := by simp only [Pi.sub_apply]; ring + _ ≤ |F (φ.value x) * (1-(g.potentialDensity φ).value x)| := le_abs_self _ + _ = |F (φ.value x)| * |1-(g.potentialDensity φ).value x| := abs_mul _ _ + _ ≤ (U (φ.value x))^2 * D := mul_le_mul (abs_moserTest_le p _) (hρ x) (abs_nonneg _) (sq_nonneg _) + _ = _ := mul_comm _ _ + have hE : g.integral (g.energy (φ.compose U hU) (φ.compose U hU)).value ≤ + (p^2/4) * g.integral (fun x => deriv F (φ.value x) * (g.energy φ φ).value x) := by + rw [← g.integral_const_mul] + apply g.integral_mono (g.energy _ _).continuous + (continuous_const.fun_mul (((hF.continuous_deriv (by simp)).comp φ.continuous).fun_mul (g.energy φ φ).continuous)) + intro x + rw [g.energy_comp_self] + have hh := mul_le_mul_of_nonneg_right (moserPower_deriv_sq_le hpow (φ.value x)) (g.energy_nonneg φ x) + simpa only [U, Function.comp_apply, mul_assoc] using hh + have hc : 0 < (1/2:ℝ)^d := by positivity + have hma' : g.integral (fun x => deriv F (φ.value x) * (g.energy φ φ).value x) ≤ + (D / (1/2:ℝ)^d) * g.integral (fun x => (U (φ.value x))^2) := by + rw [div_mul_eq_mul_div] + apply (le_div_iff₀ hc).mpr + simpa only [mul_comm] using hma.trans hbound + exact hE.trans (by simpa only [mul_assoc] using mul_le_mul_of_nonneg_left hma' (show 0 ≤ p^2/4 by positivity)) + +end KaehlerMetric +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/MoserIteration.lean b/lean/OAI/Geometry/PrescribedRicci/MoserIteration.lean new file mode 100644 index 0000000000000000000000000000000000000000..5b3243ef5e2184498d0ae675aad94cf2848c8964 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/MoserIteration.lean @@ -0,0 +1,54 @@ +import Mathlib + +namespace OAI + +/-! Moser Iteration. -/ + +noncomputable section +open Filter Finset Topology +namespace Anticanonical.SourceSmooth + +theorem moser_sequence_bound (ν C a : ℝ) (hν : 1 < ν) (hC : 0 < C) + (u : ℕ → ℝ) (hu : ∀ n, 0 ≤ u n) + (hstep : ∀ n, u (n+1) ≤ (C*(a*ν^n)^2) ^ (1/(a*ν^n)) * u n) + (ha : 0 < a) : ∃ B : ℝ, 0 ≤ B ∧ ∀ n, u n ≤ B * u 0 := by + let b : ℕ → ℝ := fun n => (Real.log C + 2*Real.log a + 2*(n:ℝ)*Real.log ν) / (a*ν^n) + have hν0 : 0 < ν := lt_trans zero_lt_one hν + have hb (n : ℕ) : (C*(a*ν^n)^2) ^ (1/(a*ν^n)) = Real.exp (b n) := by + rw [Real.rpow_def_of_pos (mul_pos hC (sq_pos_of_pos (mul_pos ha (pow_pos hν0 _)) ))] + rw [Real.log_mul (ne_of_gt hC) (ne_of_gt (sq_pos_of_pos (mul_pos ha (pow_pos hν0 _)))), + Real.log_pow, Real.log_mul (ne_of_gt ha) (ne_of_gt (pow_pos hν0 _)), Real.log_pow] + congr 1; dsimp [b]; ring + have hs : Summable b := by + have hi : |ν⁻¹| < 1 := by rw [abs_of_pos (inv_pos.mpr hν0)]; exact inv_lt_one_of_one_lt₀ hν + have hg := summable_geometric_of_abs_lt_one hi + have hn : Summable (fun n : ℕ => (n:ℝ)*ν⁻¹^n) := by + simpa only [pow_one] using summable_pow_mul_geometric_of_norm_lt_one 1 (show ‖ν⁻¹‖ < 1 by simpa only [Real.norm_eq_abs] using hi) + apply (((hg.mul_left (Real.log C + 2*Real.log a)).add (hn.mul_left (2*Real.log ν))).div_const a).congr + intro n + dsimp only [b] + simp only [inv_pow, div_eq_mul_inv, mul_inv_rev] + ring + have hsabs := hs.abs + refine ⟨Real.exp (∑' n, |b n|), (Real.exp_pos _).le, ?_⟩ + have hind (n : ℕ) : u n ≤ Real.exp (∑ k ∈ range n, b k) * u 0 := by + induction n with + | zero => simp + | succ n ih => + calc + u (n+1) ≤ Real.exp (b n) * u n := by simpa only [hb] using hstep n + _ ≤ Real.exp (b n) * (Real.exp (∑ k ∈ range n, b k) * u 0) := mul_le_mul_of_nonneg_left ih (Real.exp_pos _).le + _ = _ := by rw [sum_range_succ, Real.exp_add]; ring + intro n + apply (hind n).trans + apply mul_le_mul_of_nonneg_right _ (hu 0) + apply Real.exp_le_exp.mpr + calc + ∑ k ∈ range n, b k ≤ ∑ k ∈ range n, |b k| := sum_le_sum (fun _ _ => le_abs_self _) + _ ≤ ∑' k, |b k| := Summable.sum_le_tsum (range n) (fun k _ => abs_nonneg (b k)) hsabs + +end Anticanonical.SourceSmooth + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/NormalizeVolumePath.lean b/lean/OAI/Geometry/PrescribedRicci/NormalizeVolumePath.lean new file mode 100644 index 0000000000000000000000000000000000000000..770d2bb9ff2bbcfadf77843825f22432be7655e1 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/NormalizeVolumePath.lean @@ -0,0 +1,69 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.SmoothPotentialDifference +import OAI.Geometry.PrescribedPotential.VolumePath +import OAI.Geometry.PrescribedRicci.KahlerIntegralPos +import OAI.Geometry.PrescribedRicci.PathUniformSobolevBase + +namespace OAI + +/-! Normalize Volume Path. -/ + +section + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical +namespace Anticanonical.SourceSmooth +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} +namespace KaehlerMetric +omit [T2Space X] [CompactSpace X] [ConnectedSpace X] in +lemma positive_add_constant (g : KaehlerMetric A) (φ : SmoothRealFunction A) + (hp : g.PositivePotential φ) (c : ℝ) : + g.PositivePotential (φ.addFunction (SmoothRealFunction.constant c)) := by + intro i z hz + rw [SmoothRealFunction.hessian_addFunction _ _ i hz,SmoothRealFunction.hessian_constant,add_zero] + exact hp i z hz + +omit [T2Space X] [CompactSpace X] [ConnectedSpace X] in +lemma logRatio_add_constant (g : KaehlerMetric A) (φ : SmoothRealFunction A) + (hp : g.PositivePotential φ) (c : ℝ) (x : X) : + (g.logRatio (g.deform (φ.addFunction (SmoothRealFunction.constant c)) + (g.positive_add_constant φ hp c))).value x = (g.logRatio (g.deform φ hp)).value x := by + obtain ⟨i,hi⟩ := A.covers x + change g.logRatioValue _ x = g.logRatioValue _ x + rw [g.logRatioValue_local _ i hi,g.logRatioValue_local _ i hi] + simp only [volumeCoefficient,deform, + SmoothRealFunction.hessian_addFunction _ _ i ((A.chart i).mapsTo hi), + SmoothRealFunction.hessian_constant,add_zero] + +lemma normalizeVolumePath (g : KaehlerMetric A) (line : SemipositiveAnticanonicalMetric A) + {t : ℝ} (ht : t ∈ Icc (0:ℝ) 1) {φ : SmoothRealFunction A} {b : ℝ} + (hsol : SolvesVolumePath g line t φ b) : + ∃ z : g.NormalizedPathSolution line, z.time = t ∧ z.constant = b := by + obtain ⟨hp,he⟩ := hsol + let V := g.integral (fun _ => (1:ℝ)) + obtain ⟨x₀⟩ := (inferInstance : Nonempty X) + have hV : 0 < V := g.integral_pos continuous_const (fun _ => zero_le_one) (x:=x₀) zero_lt_one + let c := -g.integral φ.value/V + let ψ := φ.addFunction (SmoothRealFunction.constant c) + have hm : g.integral ψ.value = 0 := by + change g.integral (fun x => φ.value x+c) = 0 + rw [g.integral_add φ.continuous continuous_const] + have hc : g.integral (fun _ : X => c) = c*V := by + simpa only [mul_one] using g.integral_const_mul c (fun _ => (1:ℝ)) + rw [hc] + dsimp [c] + rw [div_mul_cancel₀ _ hV.ne'] + ring + refine ⟨⟨ψ,g.positive_add_constant φ hp c,hm,t,ht,b,?_⟩,rfl,rfl⟩ + intro x + rw [g.logRatio_add_constant φ hp c x,he x] +end KaehlerMetric +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/PathLocalGain.lean b/lean/OAI/Geometry/PrescribedRicci/PathLocalGain.lean new file mode 100644 index 0000000000000000000000000000000000000000..de68e806182f6b9b777682d7f98c9c220527a7f7 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/PathLocalGain.lean @@ -0,0 +1,235 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.LocalDeterminantGain +import OAI.Geometry.PrescribedRicci.MatrixCompactBounds +import OAI.Geometry.PrescribedRicci.PathLocalizedDensity +import OAI.Geometry.PrescribedRicci.PathLocalizedMetricBounds +import OAI.Geometry.PrescribedRicci.PathUniformAtlas +import OAI.Geometry.PrescribedRicci.UniformLocalGain + +namespace OAI + +/-! Path Local Gain. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff SchwartzMap Classical ComplexOrder MatrixOrder Matrix.Norms.Elementwise +namespace SobolevChart +lemma UniformSobolev.cutoff_integer {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] {Z : Type*} + (κ : 𝓢(E,ℂ)) (k : ℕ) {f : Z → 𝓢(E,ℂ)} (hf : UniformSobolev (k:ℝ) f) : + UniformSobolev (k:ℝ) (fun z => SchwartzMap.smulLeftCLM ℂ κ (f z)) := + hf.of_coreBound (coreBound_product_integer κ k) +lemma UniformSobolev.cutoff_zero {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] {Z : Type*} + (κ : 𝓢(E,ℂ)) {f : Z → 𝓢(E,ℂ)} (hf : UniformSobolev 0 f) : + UniformSobolev 0 (fun z => SchwartzMap.smulLeftCLM ℂ κ (f z)) := by + exact hf.of_coreBound (by simpa only [Nat.cast_zero] using coreBound_product_integer κ 0) +lemma UniformSobolev.cutoff_two {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] {Z : Type*} + (κ : 𝓢(E,ℂ)) {f : Z → 𝓢(E,ℂ)} (hf : UniformSobolev 2 f) : + UniformSobolev 2 (fun z => SchwartzMap.smulLeftCLM ℂ κ (f z)) := by + exact hf.of_coreBound (by simpa only [Nat.cast_ofNat] using coreBound_product_integer κ 2) +end SobolevChart +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart MetricLocalization FrozenPoisson +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] + {g : KaehlerMetric A} +namespace GluingData +variable (D : GluingData g ι) + +lemma cutoff_nested_one {U : Set (EC d)} (κ σ τ : ChartCutoff U) + (hσ : ∀ y ∈ tsupport (κ : EC d → ℂ), (σ : EC d → ℂ) =ᶠ[𝓝 y] fun _ => 1) + (hτ : ∀ y ∈ tsupport (σ : EC d → ℂ), (τ : EC d → ℂ) =ᶠ[𝓝 y] fun _ => 1) : + ∀ y ∈ tsupport (κ : EC d → ℂ), (τ : EC d → ℂ) =ᶠ[𝓝 y] fun _ => 1 := by + intro y hy + apply hτ + apply subset_tsupport + change σ y ≠ 0 + rw [(hσ y hy).eq_of_nhds] + exact one_ne_zero + +omit [ConnectedSpace X] in +lemma path_cutoff_identity (q : Fin A.count) (κ τ : ChartCutoff (A.euclideanChart q).target) + (hτ : ∀ y ∈ tsupport (κ : EC d → ℂ), (τ : EC d → ℂ) =ᶠ[𝓝 y] fun _ => 1) + (φ : SmoothRealFunction A) : + localize A q (cutoffGlobal q κ) (cutoffGlobal_support q κ) (Smooth.ofReal φ) = + SchwartzMap.smulLeftCLM ℂ κ.val + (localize A q (cutoffGlobal q τ) (cutoffGlobal_support q τ) (Smooth.ofReal φ)) := by + ext y + rw [localize_cutoff_product,ChartCutoff.product_apply, + SchwartzMap.smulLeftCLM_apply_apply κ.val.hasTemperateGrowth,smul_eq_mul] + by_cases hy : y ∈ tsupport (κ : EC d → ℂ) + · rw [(localize_cutoff_germ q τ (Smooth.ofReal φ) (κ.support_sub hy) (hτ y hy)).eq_of_nhds] + · simp only [image_eq_zero_of_notMem_tsupport hy,zero_mul] + +omit [ConnectedSpace X] in +lemma path_cutoff_bound (line : SemipositiveAnticanonicalMetric A) (q : Fin A.count) + (τ : ChartCutoff (A.euclideanChart q).target) (k : ℕ) + (hprev : ∃ C : ℝ, 0 ≤ C ∧ ∀ z : g.NormalizedPathSolution line, + ‖D.localizers.embed (k:ℝ) (Smooth.ofReal z.potential)‖ ≤ C) : + UniformSobolev (k:ℝ) (fun z : g.NormalizedPathSolution line => + localize A q (cutoffGlobal q τ) (cutoffGlobal_support q τ) (Smooth.ofReal z.potential)) := by + obtain ⟨C,hC,hb⟩ := hprev + obtain ⟨B,hB,hlocal⟩ := D.localization_integer_bound q + (cutoffGlobal q τ) (cutoffGlobal_support q τ) k + exact ⟨B*C,mul_nonneg hB hC,fun z => (hlocal (Smooth.ofReal z.potential)).trans + (mul_le_mul_of_nonneg_left (hb z) hB)⟩ + +include D in +lemma path_local_word_differential (line : SemipositiveAnticanonicalMetric A) (hd : 2 ≤ d) + (p : UniformPathPatch g line) + (κ σ τ : ChartCutoff (A.euclideanChart p.index).target) + (hκp : tsupport (κ : EC d → ℂ) ⊆ p.domain) + (hκr : ∀ y, (κ y).im = 0) (hτr : ∀ y, (τ y).im = 0) + (hσ : ∀ y ∈ tsupport (κ : EC d → ℂ), (σ : EC d → ℂ) =ᶠ[𝓝 y] fun _ => 1) + (hτ : ∀ y ∈ tsupport (σ : EC d → ℂ), (τ : EC d → ℂ) =ᶠ[𝓝 y] fun _ => 1) + (ws : List (BasisIndex d)) (hw0 : ws ≠ []) + (hF : UniformSobolev ((ws.length:ℝ)+1) (fun z : g.NormalizedPathSolution line => + localize A p.index (cutoffGlobal p.index τ) (cutoffGlobal_support p.index τ) (Smooth.ofReal z.potential))) : + UniformSobolev 0 (fun z : g.NormalizedPathSolution line => + schwartzDifferential (extendedCoefficient + ((g.deform z.potential z.positive).matrix p.index (coordinateEquiv d p.center)) + (coefficientBCF (p.coefficient z))) + (SchwartzMap.smulLeftCLM ℂ κ.val (schwartzWord (ws.map (stdOrthonormalBasis ℝ (EC d))) + (localize A p.index (cutoffGlobal p.index τ) (cutoffGlobal_support p.index τ) (Smooth.ofReal z.potential))))) := by + let : Nonempty (Fin d) := ⟨⟨0,by omega⟩⟩ + let : Nonempty (BasisIndex d) := ⟨⟨0,Module.finrank_pos⟩⟩ + let f (z : g.NormalizedPathSolution line) := + localize A p.index (cutoffGlobal p.index τ) (cutoffGlobal_support p.index τ) (Smooth.ofReal z.potential) + let F (z : g.NormalizedPathSolution line) := SchwartzMap.smulLeftCLM ℂ κ.val + (schwartzWord (ws.map (stdOrthonormalBasis ℝ (EC d))) (f z)) + have hτκ := cutoff_nested_one κ σ τ hσ hτ + let H (z : g.NormalizedPathSolution line) := cutMetric (g.deform z.potential z.positive) p.index σ + let G (_ : g.NormalizedPathSolution line) := cutMetric g p.index σ + let c (z : g.NormalizedPathSolution line) := + extendedCoefficient ((g.deform z.potential z.positive).matrix p.index (coordinateEquiv d p.center)) + (coefficientBCF (p.coefficient z)) + have hc (z : g.NormalizedPathSolution line) (i j) : (c z i j : EC d → ℂ).HasTemperateGrowth := + extendedCoefficient_temperate _ _ (fun i j => ((p.coefficient z) i j).hasTemperateGrowth) i j + have heH (z : g.NormalizedPathSolution line) (y : EC d) (hy : y ∈ tsupport (κ : EC d → ℂ)) : + (show Matrix (Fin d) (Fin d) ℂ from fun i j => H z i j y) = + (g.deform z.potential z.positive).matrix p.index (coordinateEquiv d y) := by + ext i j + change σ y*_ = _ + rw [(hσ y hy).eq_of_nhds,one_mul] + let K := coordinateEquiv d '' tsupport (κ : EC d → ℂ) + have hKt : K ⊆ (A.chart p.index).target := by + rintro _ ⟨y,hy,rfl⟩ + simpa using κ.support_sub hy + obtain ⟨B,hB,hb⟩ := g.volumePath_metric_bounds_on_compact line hd p.index + (κ.compact.image (coordinateEquiv d).continuous) hKt + obtain ⟨J,hJ,hj⟩ := MongeAmpere.compact_matrix_bound + (show Continuous (fun M : Matrix (Fin d) (Fin d) ℂ => ‖M.det‖) from continuous_id.matrix_det.norm) B + change UniformSobolev 0 (fun z => schwartzDifferential (c z) (F z)) + apply uniform_determinant_word_differential (stdOrthonormalBasis ℝ (EC d)) ws hw0 + κ.val f (cutPathDensity g line p.index σ) G H c hc + · intro z y hy i j + rw [heH z y hy] + exact p.equals z y (hκp hy) i j + · intro z y + rw [SchwartzMap.smulLeftCLM_apply_apply κ.val.hasTemperateGrowth] + change (κ y*schwartzWord _ (f z) y).im = 0 + rw [Complex.mul_im,hκr,schwartzWord_real _ _ (localize_cutoff_real p.index τ hτr z.potential)] + ring + · intro z y hy i j + exact cutMetric_deform_germ g p.index σ τ z.potential z.positive + (κ.support_sub hy) (hσ y hy) (hτκ y hy) i j + · intro z y hy + exact cutPathDensity_germ line p.index σ z (κ.support_sub hy) (hσ y hy) + · intro z y hy + rw [heH z y hy] + exact isUnit_iff_ne_zero.mpr ((g.deform z.potential z.positive).positive p.index _ + (by simpa using κ.support_sub hy)).det_pos.ne' + · exact hB.le + · exact hJ.le + · intro z y hy i j + rw [heH z y hy] + exact (norm_entry_le_entrywise_sup_norm _).trans + (hb z.potential z.positive z.mean_zero z.time z.constant z.time_mem z.equation _ + (mem_image_of_mem _ hy)).2 + · intro z y hy + rw [heH z y hy,← Ring.inverse_eq_inv,← Matrix.det_nonsing_inv] + exact hj _ (hb z.potential z.positive z.mean_zero z.time z.constant z.time_mem z.equation _ + (mem_image_of_mem _ hy)).2 + · exact hF + · exact cutPathDensity_uniform D line p.index σ ws.length + · intro i j + exact UniformSobolev.const _ _ + · intro z i j + exact σ.product_compact _ + · exact cutMetric_uniform_initialJet line hd p.index σ + · intro i j + have hn : 1 ≤ ws.length := List.length_pos_iff.mpr hw0 + have hncast : ((ws.length-1:ℕ):ℝ) = (ws.length:ℝ)-1 := by rw [Nat.cast_sub hn]; norm_num + have hlow : UniformSobolev (((ws.length-1:ℕ):ℝ)+2) f := hF.mono (by rw [hncast]; linarith) + simpa only [hncast] using cutMetric_uniform_sobolev line p.index σ τ hτ (ws.length-1) hlow i j + +include D in +lemma path_local_word_H2 (line : SemipositiveAnticanonicalMetric A) (hd : 2 ≤ d) + (p : UniformPathPatch g line) + (κ σ τ : ChartCutoff (A.euclideanChart p.index).target) + (hκp : tsupport (κ : EC d → ℂ) ⊆ p.domain) + (hκr : ∀ y, (κ y).im = 0) (hτr : ∀ y, (τ y).im = 0) + (hσ : ∀ y ∈ tsupport (κ : EC d → ℂ), (σ : EC d → ℂ) =ᶠ[𝓝 y] fun _ => 1) + (hτ : ∀ y ∈ tsupport (σ : EC d → ℂ), (τ : EC d → ℂ) =ᶠ[𝓝 y] fun _ => 1) + (ws : List (BasisIndex d)) + (hF : UniformSobolev ((ws.length:ℝ)+1) (fun z : g.NormalizedPathSolution line => + localize A p.index (cutoffGlobal p.index τ) (cutoffGlobal_support p.index τ) (Smooth.ofReal z.potential))) + (hF2 : UniformSobolev 2 (fun z : g.NormalizedPathSolution line => + localize A p.index (cutoffGlobal p.index τ) (cutoffGlobal_support p.index τ) (Smooth.ofReal z.potential))) : + UniformSobolev 2 (fun z : g.NormalizedPathSolution line => + SchwartzMap.smulLeftCLM ℂ κ.val (schwartzWord (ws.map (stdOrthonormalBasis ℝ (EC d))) + (localize A p.index (cutoffGlobal p.index τ) (cutoffGlobal_support p.index τ) (Smooth.ofReal z.potential)))) := by + have hword := hF.word (t:=0) (ws.map (stdOrthonormalBasis ℝ (EC d))) + (by simp only [List.length_map]; linarith) + have hfword := hword.cutoff_zero κ.val + by_cases hw0 : ws = [] + · subst ws + simpa only [List.map_nil,schwartzWord,ContinuousLinearMap.id_apply] using + hF2.cutoff_two κ.val + have hD := D.path_local_word_differential line hd p κ σ τ hκp hκr hτr hσ hτ ws hw0 hF + exact uniform_schwartz_H2_of_differential (Z:=g.NormalizedPathSolution line) (n:=d) p.bound_pos.le + (fun z => (g.deform z.potential z.positive).matrix p.index (coordinateEquiv d p.center)) + (fun z => (g.deform z.potential z.positive).positive p.index _ (by simpa using p.center_target)) + p.matrix_bound (fun z => coefficientBCF (p.coefficient z)) + (fun z i j => (p.coefficient z i j).hasTemperateGrowth) p.small _ hfword hD + +lemma path_local_gain (line : SemipositiveAnticanonicalMetric A) (hd : 2 ≤ d) + (p : UniformPathPatch g line) + (κ σ τ : ChartCutoff (A.euclideanChart p.index).target) + (hκp : tsupport (κ : EC d → ℂ) ⊆ p.domain) + (hκr : ∀ y, (κ y).im = 0) (hτr : ∀ y, (τ y).im = 0) + (hσ : ∀ y ∈ tsupport (κ : EC d → ℂ), (σ : EC d → ℂ) =ᶠ[𝓝 y] fun _ => 1) + (hτ : ∀ y ∈ tsupport (σ : EC d → ℂ), (τ : EC d → ℂ) =ᶠ[𝓝 y] fun _ => 1) + (k : ℕ) (hk : 1 ≤ k) + (hprev : ∃ C : ℝ, 0 ≤ C ∧ ∀ z : g.NormalizedPathSolution line, + ‖D.localizers.embed ((k:ℝ)+1) (Smooth.ofReal z.potential)‖ ≤ C) : + UniformSobolev ((k:ℝ)+2) (fun z : g.NormalizedPathSolution line => + localize A p.index (cutoffGlobal p.index κ) (cutoffGlobal_support p.index κ) + (Smooth.ofReal z.potential)) := by + let f (z : g.NormalizedPathSolution line) := + localize A p.index (cutoffGlobal p.index τ) (cutoffGlobal_support p.index τ) (Smooth.ofReal z.potential) + have hF : UniformSobolev ((k:ℝ)+1) f := by + have he : (k:ℝ)+1 = ((k+1:ℕ):ℝ) := by simp + rw [he] at hprev ⊢ + exact D.path_cutoff_bound line p.index τ (k+1) hprev + have heF (z : g.NormalizedPathSolution line) := path_cutoff_identity p.index κ τ + (cutoff_nested_one κ σ τ hσ hτ) z.potential + simp_rw [heF] + apply uniform_cutoff_word_gain κ.val k hF + intro ws hw + have hlen : (ws.length:ℝ) ≤ k := by exact_mod_cast hw + exact D.path_local_word_H2 line hd p κ σ τ hκp hκr hτr hσ hτ ws + (hF.mono (by linarith)) (hF.mono (by exact_mod_cast (show 2 ≤ k+1 by omega))) +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/PathLocalizedDensity.lean b/lean/OAI/Geometry/PrescribedRicci/PathLocalizedDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..4a196752a6fbfcbfb3fe1bd25dc5af8862da6b2a --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/PathLocalizedDensity.lean @@ -0,0 +1,102 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.PositivePotentialLinearization +import OAI.Geometry.PrescribedRicci.LocalizedPathData +import OAI.Geometry.PrescribedRicci.PositivePathOpenness + +namespace OAI + +/-! Path Localized Density. -/ + +section + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff SchwartzMap Classical ComplexOrder MatrixOrder Matrix.Norms.Elementwise +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] + {g : KaehlerMetric A} + +omit [T2Space X] [CompactSpace X] [ConnectedSpace X] in +lemma metric_det_euclidean_smooth (g : KaehlerMetric A) (q : Fin A.count) : + ContDiffOn ℝ ∞ (fun y : EC d => (g.matrix q (coordinateEquiv d y)).det) + (A.euclideanChart q).target := by + simp only [Matrix.det_apply'] + apply ContDiffOn.sum + intro π _ + apply contDiffOn_const.mul + apply contDiffOn_prod + intro i _ + exact contDiffOn_pi.mp (contDiffOn_pi.mp (GluingData.metric_euclidean_smooth g q) (π i)) i + +def cutPathDensity (g : KaehlerMetric A) (line : SemipositiveAnticanonicalMetric A) + (q : Fin A.count) (σ : ChartCutoff (A.euclideanChart q).target) + (z : g.NormalizedPathSolution line) : 𝓢(EC d,ℂ) := + localize A q + (cutoffGlobal q (σ.mulOn (A.euclideanChart q).open_target (metric_det_euclidean_smooth g q))) + (cutoffGlobal_support q _) + ((RealSmooth.ofReal (prescribedForcing g line)).expAffine z.time z.constant).val + +omit [ConnectedSpace X] in +lemma cutPathDensity_apply (line : SemipositiveAnticanonicalMetric A) + (q : Fin A.count) (σ : ChartCutoff (A.euclideanChart q).target) + (z : g.NormalizedPathSolution line) (y : EC d) : + cutPathDensity g line q σ z y = σ y*(g.matrix q (coordinateEquiv d y)).det* + (Real.exp (z.time*(prescribedForcing g line).value ((A.euclideanChart q).symm y)+z.constant):ℂ) := by + rw [cutPathDensity,localize_cutoff_product] + rfl + +lemma cutPathDensity_uniform (D : GluingData g ι) (line : SemipositiveAnticanonicalMetric A) + (q : Fin A.count) (σ : ChartCutoff (A.euclideanChart q).target) (k : ℕ) : + UniformSobolev (k:ℝ) (cutPathDensity g line q σ) := + D.uniform_localize k _ (D.volumePath_forcing_uniform line k) q _ _ + +omit [ConnectedSpace X] in +lemma path_determinant_equation (line : SemipositiveAnticanonicalMetric A) + (z : g.NormalizedPathSolution line) (q : Fin A.count) {y : EC d} + (hy : y ∈ (A.euclideanChart q).target) : + ((g.deform z.potential z.positive).matrix q (coordinateEquiv d y)).det = + (g.matrix q (coordinateEquiv d y)).det * + (Real.exp (z.time*(prescribedForcing g line).value ((A.euclideanChart q).symm y)+z.constant):ℂ) := by + let x := (A.euclideanChart q).symm y + have hyt : coordinateEquiv d y ∈ (A.chart q).target := by simpa using hy + have hx : x ∈ (A.chart q).source := by simpa [x] using (A.euclideanChart q).symm.mapsTo hy + have hxy : A.chart q x = coordinateEquiv d y := + (A.chart q).right_inv hyt + have hp := g.potentialDensity_pos z.potential z.positive x + have heq := z.equation x + rw [g.logRatio_eq_log_density z.potential z.positive x] at heq + have he : (g.potentialDensity z.potential).value x = + Real.exp (z.time*(prescribedForcing g line).value x+z.constant) := by + rw [← heq,Real.exp_log hp] + have hd := g.potentialDensity_complex z.potential q hx + rw [hxy,he] at hd + change (Real.exp (_):ℂ) = _/_ at hd + have hn : (g.matrix q (coordinateEquiv d y)).det ≠ 0 := (g.positive q _ hyt).det_pos.ne' + rw [eq_div_iff hn] at hd + exact hd.symm.trans (mul_comm _ _) + +omit [ConnectedSpace X] in +lemma cutPathDensity_germ (line : SemipositiveAnticanonicalMetric A) + (q : Fin A.count) (σ : ChartCutoff (A.euclideanChart q).target) + (z : g.NormalizedPathSolution line) {y : EC d} (hy : y ∈ (A.euclideanChart q).target) + (hσ : (σ : EC d → ℂ) =ᶠ[𝓝 y] fun _ => 1) : + (fun x => (show Matrix (Fin d) (Fin d) ℂ from fun i j => + cutMetric (g.deform z.potential z.positive) q σ i j x).det) =ᶠ[𝓝 y] + cutPathDensity g line q σ z := by + filter_upwards [hσ,(A.euclideanChart q).open_target.mem_nhds hy] with x hx hxt + have hH : (show Matrix (Fin d) (Fin d) ℂ from fun i j => + cutMetric (g.deform z.potential z.positive) q σ i j x) = + (g.deform z.potential z.positive).matrix q (coordinateEquiv d x) := by + ext i j + rw [cutMetric_apply,hx,one_mul] + rw [hH,cutPathDensity_apply,hx,one_mul] + exact path_determinant_equation line z q hxt +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/PathLocalizedMetricBounds.lean b/lean/OAI/Geometry/PrescribedRicci/PathLocalizedMetricBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..ced5d0a89708a19101cf151abf745870f7163138 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/PathLocalizedMetricBounds.lean @@ -0,0 +1,108 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CutoffHigher +import OAI.Geometry.PrescribedRicci.CalabiMetricC1 +import OAI.Geometry.PrescribedRicci.CompactPathBounds +import OAI.Geometry.PrescribedRicci.CutoffJetBound +import OAI.Geometry.PrescribedRicci.LocalizedPathData + +namespace OAI + +/-! Path Localized Metric Bounds. -/ + +section + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff SchwartzMap Classical ComplexOrder MatrixOrder Matrix.Norms.Elementwise ENNReal +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart TameInterpolation MetricLocalization +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] + {g : KaehlerMetric A} + +omit [ConnectedSpace X] in +lemma cutMetric_uniform_sobolev (line : SemipositiveAnticanonicalMetric A) (q : Fin A.count) + (σ τ : ChartCutoff (A.euclideanChart q).target) + (hτ : ∀ y ∈ tsupport (σ : EC d → ℂ), (τ : EC d → ℂ) =ᶠ[𝓝 y] fun _ => 1) + (k : ℕ) (hF : UniformSobolev ((k:ℝ)+2) (fun z : g.NormalizedPathSolution line => + localize A q (cutoffGlobal q τ) (cutoffGlobal_support q τ) (Smooth.ofReal z.potential))) (i j : Fin d) : + UniformSobolev (k:ℝ) (fun z : g.NormalizedPathSolution line => + cutMetric (g.deform z.potential z.positive) q σ i j) := by + simp_rw [cutMetric_deform g q σ τ hτ] + exact (UniformSobolev.const _ _).add + ((hF.of_coreBound (hessianEntrySchwartz_bound (k:ℝ) i j)).of_coreBound + (coreBound_product_integer σ.val k)) + +lemma cutMetric_uniform_C1 (line : SemipositiveAnticanonicalMetric A) (hd : 2 ≤ d) + (q : Fin A.count) (σ : ChartCutoff (A.euclideanChart q).target) : + ∃ B : ℝ, 0 ≤ B ∧ ∀ z : g.NormalizedPathSolution line, ∀ i j : Fin d, + (∀ y, ‖cutMetric (g.deform z.potential z.positive) q σ i j y‖ ≤ B) ∧ + (∀ a y, ‖fderiv ℝ (cutMetric (g.deform z.potential z.positive) q σ i j) y + (stdOrthonormalBasis ℝ (EC d) a)‖ ≤ B) := by + let : Nonempty (Fin d) := ⟨⟨0,by omega⟩⟩ + let : Nonempty (BasisIndex d) := ⟨⟨0,Module.finrank_pos⟩⟩ + let K := coordinateEquiv d '' tsupport (σ : EC d → ℂ) + have hK : IsCompact K := σ.compact.image (coordinateEquiv d).continuous + have hKt : K ⊆ (A.chart q).target := by + rintro _ ⟨y,hy,rfl⟩ + simpa only [ComplexAtlas.euclideanChart_target, mem_preimage] using σ.support_sub hy + obtain ⟨M,hM,hm⟩ := g.volumePath_metric_bounds_on_compact line hd q hK hKt + obtain ⟨P,hP,hp⟩ := g.volumePath_metric_C1_on_compact line hd q hK hKt + let Q := P*‖(coordinateEquiv d).toContinuousLinearMap‖ + have hQ : 0 ≤ Q := mul_nonneg hP.le (norm_nonneg _) + let f (z : g.NormalizedPathSolution line) (i j : Fin d) (y : EC d) := + (g.deform z.potential z.positive).matrix q (coordinateEquiv d y) i j + have hs (z : g.NormalizedPathSolution line) (i j : Fin d) : + ContDiffOn ℝ ∞ (f z i j) (A.euclideanChart q).target := + contDiffOn_pi.mp (contDiffOn_pi.mp (GluingData.metric_euclidean_smooth _ q) i) j + have h0 (i j : Fin d) (z : g.NormalizedPathSolution line) (y : EC d) + (hy : y ∈ tsupport (σ : EC d → ℂ)) : ‖f z i j y‖ ≤ M := + (norm_entry_le_entrywise_sup_norm ((g.deform z.potential z.positive).matrix q (coordinateEquiv d y))).trans + (hm z.potential z.positive z.mean_zero z.time z.constant z.time_mem z.equation _ + (mem_image_of_mem _ hy)).1 + have h1 (i j : Fin d) (z : g.NormalizedPathSolution line) (y : EC d) + (hy : y ∈ tsupport (σ : EC d → ℂ)) (a : BasisIndex d) : + ‖fderiv ℝ (f z i j) y (stdOrthonormalBasis ℝ (EC d) a)‖ ≤ Q := by + let H := fun x => (g.deform z.potential z.positive).matrix q x i j + have hdy : DifferentiableAt ℝ H (coordinateEquiv d y) := + ((contDiffOn_pi.mp (contDiffOn_pi.mp ((g.deform z.potential z.positive).smooth q) i) j).contDiffAt + ((A.chart q).open_target.mem_nhds (hKt (mem_image_of_mem _ hy)))).differentiableAt (by simp) + have he : fderiv ℝ (f z i j) y = (fderiv ℝ H (coordinateEquiv d y)).comp + (coordinateEquiv d).toContinuousLinearMap := + (hdy.hasFDerivAt.comp y (coordinateEquiv d).hasFDerivAt).fderiv + rw [he,ContinuousLinearMap.comp_apply] + apply (ContinuousLinearMap.le_opNorm _ _).trans + apply (mul_le_mul (hp z.potential z.positive z.mean_zero z.time z.constant z.time_mem z.equation _ + (mem_image_of_mem _ hy) i j) + ((coordinateEquiv d).toContinuousLinearMap.le_opNorm _) + (norm_nonneg _) hP.le).trans_eq + simp only [OrthonormalBasis.norm_eq_one,mul_one] + rfl + have hb (i j : Fin d) := σ.uniform_C1 (A.euclideanChart q).open_target + (stdOrthonormalBasis ℝ (EC d)) (fun z => f z i j) (fun z => hs z i j) + hM.le hQ (h0 i j) (h1 i j) + choose B hB hb using hb + refine ⟨∑ i, ∑ j, B i j, Finset.sum_nonneg fun i _ => Finset.sum_nonneg fun j _ => hB i j,?_⟩ + intro z i j + have hle : B i j ≤ ∑ i, ∑ j, B i j := + (Finset.single_le_sum (fun j _ => hB i j) (Finset.mem_univ j)).trans + (Finset.single_le_sum (fun i _ => Finset.sum_nonneg fun j _ => hB i j) (Finset.mem_univ i)) + exact ⟨fun y => ((hb i j z).1 y).trans hle,fun a y => ((hb i j z).2 a y).trans hle⟩ + +lemma cutMetric_uniform_initialJet [Nonempty (Fin d)] [Nonempty (BasisIndex d)] + (line : SemipositiveAnticanonicalMetric A) (hd : 2 ≤ d) + (q : Fin A.count) (σ : ChartCutoff (A.euclideanChart q).target) (π : Equiv.Perm (Fin d)) : + ∃ B : ℝ, 0 ≤ B ∧ ∀ z : g.NormalizedPathSolution line, + familyJetNorm (stdOrthonormalBasis ℝ (EC d)) (realComponents + (initialJet (stdOrthonormalBasis ℝ (EC d)) + (fun i y => cutMetric (g.deform z.potential z.positive) q σ (π i) i y))) 0 ∞ ≤ B := by + obtain ⟨B,hB,hb⟩ := cutMetric_uniform_C1 (g:=g) line hd q σ + exact ⟨B,hB,fun z => initialJet_zero_bound _ _ hB (fun i => (hb z (π i) i).1) + (fun i => (hb z (π i) i).2)⟩ +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/PathUniformAtlas.lean b/lean/OAI/Geometry/PrescribedRicci/PathUniformAtlas.lean new file mode 100644 index 0000000000000000000000000000000000000000..88f25c6eabf7b5582b0d5598383deee9569b45a9 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/PathUniformAtlas.lean @@ -0,0 +1,146 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.BoundedPoisson +import OAI.Geometry.PrescribedRicci.PathUniformSobolevBase +import OAI.Geometry.PrescribedRicci.UniformFrozenEstimate +import OAI.Geometry.PrescribedRicci.UniformPathPatches + +namespace OAI + +/-! Path Uniform Atlas. -/ + +section + + + +noncomputable section +open Set Filter Topology Manifold IsManifold Matrix +open scoped ContDiff SchwartzMap BoundedContinuousFunction ComplexOrder MatrixOrder Matrix.Norms.Elementwise Classical +namespace Anticanonical.SourceSmooth +open EllipticKernel SobolevChart FrozenPoisson MetricLocalization GlobalElliptic +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} + +structure UniformPathPatch (g : KaehlerMetric A) (line : SemipositiveAnticanonicalMetric A) where + index : Fin A.count + center : EC d + domain : Set (EC d) + isOpen_domain : IsOpen domain + center_mem : center ∈ domain + domain_sub : domain ⊆ (A.euclideanChart index).target + bound : ℝ + bound_pos : 0 < bound + matrix_bound : ∀ z : g.NormalizedPathSolution line, + ‖(g.deform z.potential z.positive).matrix index (coordinateEquiv d center)‖ ≤ bound + coefficient : g.NormalizedPathSolution line → SmoothCoefficients (BasisIndex d) (EC d) + small : ∀ z, perturbationBound (stdOrthonormalBasis ℝ (EC d)) (coefficientBCF (coefficient z)) * + uniformEllipticBound d bound ≤ 1/2 + equals : ∀ z, ∀ y ∈ domain, ∀ k l, + extendedCoefficient ((g.deform z.potential z.positive).matrix index (coordinateEquiv d center)) + (coefficientBCF (coefficient z)) k l y = + (traceBilin ((g.deform z.potential z.positive).matrix index (coordinateEquiv d y)) + (rankTwo (stdOrthonormalBasis ℝ (EC d) k) (stdOrthonormalBasis ℝ (EC d) l)) : ℂ) + +namespace UniformPathPatch +variable {g : KaehlerMetric A} {line : SemipositiveAnticanonicalMetric A} +def source (p : UniformPathPatch g line) : Set X := + (A.euclideanChart p.index).source ∩ (A.euclideanChart p.index) ⁻¹' p.domain +omit [ConnectedSpace X] in +lemma isOpen_source (p : UniformPathPatch g line) : IsOpen p.source := + (A.euclideanChart p.index).isOpen_inter_preimage p.isOpen_domain +omit [ConnectedSpace X] in +lemma source_sub (p : UniformPathPatch g line) : p.source ⊆ (A.euclideanChart p.index).source := + fun _ hx => hx.1 +omit [ConnectedSpace X] in +lemma center_target (p : UniformPathPatch g line) : p.center ∈ (A.euclideanChart p.index).target := + p.domain_sub p.center_mem + +theorem exists_at (g : KaehlerMetric A) (line : SemipositiveAnticanonicalMetric A) + (hd : 2 ≤ d) (x : X) : ∃ p : UniformPathPatch g line, x ∈ p.source := by + obtain ⟨i,hi⟩ := A.covers x + let e := A.euclideanChart i + have hxe : x ∈ e.source := by simpa [e] using hi + have hx : e x ∈ e.target := e.mapsTo hxe + obtain ⟨ε,hε,hball⟩ := Metric.mem_nhds_iff.mp (e.open_target.mem_nhds hx) + have hc : Metric.closedBall (e x) (ε/2) ⊆ e.target := + (Metric.closedBall_subset_ball (by linarith : ε/2 < ε)).trans hball + obtain ⟨M,r,hM,hr,hrR,hpatch⟩ := g.volumePath_uniform_patch line hd i (e x) + (by linarith : 0 < ε/2) hc (stdOrthonormalBasis ℝ (EC d)) + have hp (z : g.NormalizedPathSolution line) := + hpatch z.potential z.positive z.mean_zero z.time z.constant z.time_mem z.equation + choose hb a has hac hsmall heq using hp + let coeff (z : g.NormalizedPathSolution line) : SmoothCoefficients (BasisIndex d) (EC d) := + fun k l => (hac z k l).toSchwartzMap (has z k l) + have he (z : g.NormalizedPathSolution line) : coefficientBCF (coeff z) = a z := by + funext k l; ext y; rfl + let p : UniformPathPatch g line := { + index := i + center := e x + domain := Metric.ball (e x) (r/2) + isOpen_domain := Metric.isOpen_ball + center_mem := Metric.mem_ball_self (by linarith) + domain_sub := fun y hy => hc ((Metric.closedBall_subset_closedBall hrR) + ((Metric.ball_subset_closedBall).trans (Metric.closedBall_subset_closedBall (by linarith : r/2 ≤ r)) hy)) + bound := M + bound_pos := hM + matrix_bound := hb + coefficient := coeff + small := by intro z; rw [he]; exact hsmall z + equals := by + intro z y hy k l + rw [he] + change (traceBilin _ _ : ℂ)+a z k l y = _ + rw [heq z y (Metric.mem_closedBall.mpr (Metric.mem_ball.mp hy).le) k l] + ring } + exact ⟨p,hxe,Metric.mem_ball_self (by linarith)⟩ + +theorem finite_cover (g : KaehlerMetric A) (line : SemipositiveAnticanonicalMetric A) (hd : 2 ≤ d) : + ∃ S : Finset (UniformPathPatch g line), ∀ x : X, ∃ p ∈ S, x ∈ p.source := by + obtain ⟨S,hS⟩ := isCompact_univ.elim_finite_subcover (fun p : UniformPathPatch g line => p.source) + (fun p => p.isOpen_source) (by + intro x _ + obtain ⟨p,hp⟩ := exists_at g line hd x + exact mem_iUnion.mpr ⟨p,hp⟩) + refine ⟨S,fun x => ?_⟩ + obtain ⟨p,hp,hx⟩ := mem_iUnion₂.mp (hS (mem_univ x)) + exact ⟨p,hp,hx⟩ +end UniformPathPatch + +theorem exists_uniform_path_localizers (g : KaehlerMetric A) + (line : SemipositiveAnticanonicalMetric A) (hd : 2 ≤ d) : + ∃ (S : Finset (UniformPathPatch g line)) (D : Localizers A S), + (∀ p : S, D.index p = p.val.index) ∧ + (∀ p : S, tsupport (D.weight p : X → ℂ) ⊆ p.val.source) := by + obtain ⟨S,hS⟩ := UniformPathPatch.finite_cover g line hd + let := A.chartedSpace + let := A.isManifold + obtain ⟨ρ,hρ⟩ := SmoothPartitionOfUnity.exists_isSubordinate + 𝓘(ℝ,Coordinates d) (s:=(Set.univ : Set X)) isClosed_univ + (fun p : S => p.val.source) (fun p => p.val.isOpen_source) (by + intro x _ + obtain ⟨p,hp,hx⟩ := hS x + exact mem_iUnion.mpr ⟨⟨p,hp⟩,hx⟩) + let f (p : S) : SmoothRealFunction A := ⟨ρ p,(A.contMDiff_iff (ρ p)).mp (ρ p).contMDiff⟩ + let D : Localizers A S := { + index := fun p => p.val.index + weight := fun p => Smooth.ofReal (f p) + support_sub := by + intro p + rw [Smooth.ofReal_tsupport] + exact (hρ p).trans p.val.source_sub + sum_one := by + intro x + change (∑ p : S,((ρ p x : ℝ):ℂ)) = 1 + rw [← Complex.ofReal_sum] + exact_mod_cast (show ∑ p : S,ρ p x = 1 by + simpa only [finsum_eq_sum_of_fintype] using ρ.sum_eq_one (mem_univ x)) } + refine ⟨S,D,fun _ => rfl,?_⟩ + intro p + change tsupport (Smooth.ofReal (f p) : X → ℂ) ⊆ _ + rw [Smooth.ofReal_tsupport] + exact hρ p +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/PathUniformForcing.lean b/lean/OAI/Geometry/PrescribedRicci/PathUniformForcing.lean new file mode 100644 index 0000000000000000000000000000000000000000..61881471e8b8db3efefd8048d9ec0aad3f528b15 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/PathUniformForcing.lean @@ -0,0 +1,97 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalHessian +import OAI.Geometry.PrescribedPotential.RealSobolev +import OAI.Geometry.PrescribedPotential.SobolevExponential +import OAI.Geometry.PrescribedRicci.PathUniformSobolevBase +import OAI.Geometry.PrescribedRicci.SmoothPositivePath +import OAI.Geometry.PrescribedRicci.UniformSchwartz +import OAI.Geometry.PrescribedPotential.VolumeNormalization + +namespace OAI + +/-! Path Uniform Forcing. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical SchwartzMap +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) +local instance pathForcingNG (s : ℝ) : NormedAddCommGroup (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedAddCommGroup +local instance pathForcingNS (s : ℝ) : NormedSpace ℝ (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedSpace +local instance pathForcingTG (s : ℝ) : IsTopologicalAddGroup (D.localizers.RealSobolev s) := + Submodule.isTopologicalAddGroup _ +local instance pathForcingCS (s : ℝ) : ContinuousSMul ℝ (D.localizers.RealSobolev s) := + SMulMemClass.continuousSMul _ + +lemma expAffine_uniform_bound (F : RealSmooth A) (B : ℝ) (k : ℕ) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ t ∈ Icc (0:ℝ) 1, ∀ b : ℝ, b ≤ B → + ‖D.localizers.embed (k:ℝ) (F.expAffine t b).val‖ ≤ C := by + let m := max k (Module.finrank ℝ (EC d)+1) + have hm : Module.finrank ℝ (EC d) < m := lt_of_lt_of_le (Nat.lt_succ_self _) (le_max_right _ _) + obtain ⟨Q,hQ⟩ := isCompact_Icc.bddAbove_image + ((D.exponentialDensity_continuous m hm F).norm.continuousOn) + have hq (t : ℝ) (ht : t ∈ Icc (0:ℝ) 1) : ‖D.exponentialDensity m hm F t‖ ≤ max Q 0 := + (hQ (mem_image_of_mem _ ht)).trans (le_max_left _ _) + let L := D.localizers.lower (m:ℝ) (k:ℝ) + refine ⟨‖L‖*(Real.exp B*max Q 0),by positivity,fun t ht b hb => ?_⟩ + have hh : ‖D.localizers.embed (m:ℝ) (F.expAffine t b).val‖ ≤ Real.exp B*max Q 0 := by + change ‖D.localizers.realEmbed (m:ℝ) (F.expAffine t b)‖ ≤ _ + rw [← D.exponentialDensity_embedViaEnergy m hm F t b,norm_smul,Real.norm_eq_abs,abs_of_pos (Real.exp_pos b)] + exact mul_le_mul (Real.exp_le_exp.mpr hb) (hq t ht) (norm_nonneg _) (Real.exp_pos B).le + have he : L (D.localizers.embed (m:ℝ) (F.expAffine t b).val) = + D.localizers.embed (k:ℝ) (F.expAffine t b).val := + D.localizers.lower_embed (by exact_mod_cast (le_max_left k (Module.finrank ℝ (EC d)+1))) _ + rw [← he] + exact (L.le_opNorm _).trans (mul_le_mul_of_nonneg_left hh (norm_nonneg _)) + +lemma volumePath_forcing_uniform (line : SemipositiveAnticanonicalMetric A) (k : ℕ) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ z : g.NormalizedPathSolution line, + ‖D.localizers.embed (k:ℝ) + ((RealSmooth.ofReal (prescribedForcing g line)).expAffine z.time z.constant).val‖ ≤ C := by + let F := RealSmooth.ofReal (prescribedForcing g line) + let B := ‖(⟨(prescribedForcing g line).value,(prescribedForcing g line).continuous⟩ : C(X,ℝ))‖ + obtain ⟨C,hC,hb⟩ := D.expAffine_uniform_bound F B k + refine ⟨C,hC,fun z => hb z.time z.time_mem z.constant ?_⟩ + exact (le_abs_self _).trans (volumePath_scalar_bound g line z.time_mem ⟨z.positive,z.equation⟩) + +omit [ConnectedSpace X] in +lemma uniform_localize {Z : Type*} (k : ℕ) (F : Z → Smooth A) + (hb : ∃ C : ℝ, 0 ≤ C ∧ ∀ z, ‖D.localizers.embed (k:ℝ) (F z)‖ ≤ C) + (i : Fin A.count) (ρ : Smooth A) (hρ : tsupport (ρ : X → ℂ) ⊆ (A.euclideanChart i).source) : + UniformSobolev (k:ℝ) (fun z => localize A i ρ hρ (F z)) := by + obtain ⟨C,hC,hc⟩ := hb + obtain ⟨B,hB,hb⟩ := D.localization_integer_bound i ρ hρ k + exact ⟨B*C,mul_nonneg hB hC,fun z => (hb _).trans (mul_le_mul_of_nonneg_left (hc z) hB)⟩ +end GluingData + +omit [ConnectedSpace X] in +lemma localize_cutoff_product (i : Fin A.count) (κ : ChartCutoff (A.euclideanChart i).target) (F : Smooth A) : + localize A i (cutoffGlobal i κ) (cutoffGlobal_support i κ) F = + κ.product (A.euclideanChart i).open_target (F.smooth i) := by + ext y + by_cases hy : y ∈ (A.euclideanChart i).target + · rw [localize_apply,localizeFun_apply A _ _ hy] + have hx : (A.euclideanChart i).symm y ∈ (A.euclideanChart i).source := (A.euclideanChart i).symm.mapsTo hy + change (if (A.euclideanChart i).symm y ∈ (A.euclideanChart i).source then _ else 0)*_ = _ + rw [ite_eq_left hx,(A.euclideanChart i).right_inv hy] + rfl + · have hκ : κ y = 0 := image_eq_zero_of_notMem_tsupport (fun hs => hy (κ.support_sub hs)) + rw [localize_apply] + change (if y ∈ (A.euclideanChart i).target then _ else 0) = _ + rw [ite_eq_right hy,ChartCutoff.product_apply,hκ,zero_mul] +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/PathUniformHigher.lean b/lean/OAI/Geometry/PrescribedRicci/PathUniformHigher.lean new file mode 100644 index 0000000000000000000000000000000000000000..17923cd6f7e902f1347077d9b403c69093df9340 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/PathUniformHigher.lean @@ -0,0 +1,133 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.PathLocalGain +import OAI.Geometry.PrescribedRicci.PathUniformAtlas +import OAI.Geometry.PrescribedRicci.PathUniformForcing +import OAI.Geometry.PrescribedPotential.RegularityCutoffs + +namespace OAI + +/-! Path Uniform Higher. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff SchwartzMap Classical ComplexOrder MatrixOrder Matrix.Norms.Elementwise +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] + {g : KaehlerMetric A} + +omit [ConnectedSpace X] in +lemma weighted_cutoff_reconstruction (i : Fin A.count) (w F : Smooth A) + (hw : tsupport (w : X → ℂ) ⊆ (A.euclideanChart i).source) + (κ : ChartCutoff (A.euclideanChart i).target) + (hκ : ∀ x ∈ tsupport (w : X → ℂ), κ (A.euclideanChart i x) = 1) : + globalize i (κ.mulOn (A.euclideanChart i).open_target (w.smooth i)) + (localize A i (cutoffGlobal i κ) (cutoffGlobal_support i κ) F) = w.mul F := by + ext x + rw [globalize_apply,localize_cutoff_product] + by_cases hx : x ∈ (A.euclideanChart i).source + · rw [ite_eq_left hx] + change (κ (A.euclideanChart i x)*w ((A.euclideanChart i).symm (A.euclideanChart i x)))* + (κ (A.euclideanChart i x)*F ((A.euclideanChart i).symm (A.euclideanChart i x))) = w x*F x + rw [(A.euclideanChart i).left_inv hx] + by_cases hwx : w x = 0 + · rw [hwx]; ring + · rw [hκ x (subset_tsupport _ hwx),one_mul,one_mul] + · rw [ite_eq_right hx] + change 0 = w x*F x + rw [image_eq_zero_of_notMem_tsupport (fun hs => hx (hw hs)),zero_mul] + +namespace GluingData +variable (D : GluingData g ι) + +lemma path_patch_gain (line : SemipositiveAnticanonicalMetric A) (hd : 2 ≤ d) + (p : UniformPathPatch g line) (κ : ChartCutoff (A.euclideanChart p.index).target) + (hκp : tsupport (κ : EC d → ℂ) ⊆ p.domain) (hκr : ∀ y, (κ y).im = 0) + (k : ℕ) (hk : 1 ≤ k) + (hprev : ∃ C : ℝ, 0 ≤ C ∧ ∀ z : g.NormalizedPathSolution line, + ‖D.localizers.embed ((k:ℝ)+1) (Smooth.ofReal z.potential)‖ ≤ C) : + UniformSobolev ((k:ℝ)+2) (fun z : g.NormalizedPathSolution line => + localize A p.index (cutoffGlobal p.index κ) (cutoffGlobal_support p.index κ) (Smooth.ofReal z.potential)) := by + obtain ⟨σ,_,hσ⟩ := exists_chartCutoff_nhds κ.compact (A.euclideanChart p.index).open_target κ.support_sub + obtain ⟨τ,hτr,hτ⟩ := exists_chartCutoff_nhds σ.compact (A.euclideanChart p.index).open_target σ.support_sub + exact D.path_local_gain line hd p κ σ τ hκp hκr hτr hσ hτ k hk hprev + +lemma volumePath_uniform_gain (line : SemipositiveAnticanonicalMetric A) (hd : 2 ≤ d) + (k : ℕ) (hk : 1 ≤ k) + (hprev : ∃ C : ℝ, 0 ≤ C ∧ ∀ z : g.NormalizedPathSolution line, + ‖D.localizers.embed ((k:ℝ)+1) (Smooth.ofReal z.potential)‖ ≤ C) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ z : g.NormalizedPathSolution line, + ‖D.localizers.embed ((k:ℝ)+2) (Smooth.ofReal z.potential)‖ ≤ C := by + obtain ⟨S,L,hLI,hLS⟩ := exists_uniform_path_localizers g line hd + have hc (p : S) : ∃ κ : ChartCutoff (A.euclideanChart p.val.index).target, + tsupport (κ : EC d → ℂ) ⊆ p.val.domain ∧ (∀ y, (κ y).im = 0) ∧ + ∀ x ∈ tsupport (L.weight p : X → ℂ), κ (A.euclideanChart p.val.index x) = 1 := by + let e := A.euclideanChart p.val.index + have hK : IsCompact (e '' tsupport (L.weight p : X → ℂ)) := + (isClosed_tsupport _).isCompact.image_of_continuousOn + (e.continuousOn.mono (fun x hx => (hLS p hx).1)) + have hKU : e '' tsupport (L.weight p : X → ℂ) ⊆ p.val.domain := by + rintro y ⟨x,hx,rfl⟩ + exact (hLS p hx).2 + obtain ⟨κ,hκr,hκ⟩ := exists_chartCutoff_nhds hK p.val.isOpen_domain hKU + exact ⟨⟨κ.val,κ.compact,κ.support_sub.trans p.val.domain_sub⟩,κ.support_sub,hκr, + fun x hx => (hκ _ ⟨x,hx,rfl⟩).eq_of_nhds⟩ + choose κ hκp hκr hκ using hc + have hlocal (p : S) := D.path_patch_gain line hd p.val (κ p) (hκp p) (hκr p) k hk hprev + choose B hB hb using hlocal + let η (p : S) := (κ p).mulOn (A.euclideanChart p.val.index).open_target ((L.weight p).smooth p.val.index) + have hglob (p : S) := globalize_integer_bound D.localizers p.val.index (η p) (k+2) + choose Q hQ hq using hglob + have hsum (F : Smooth A) : F = ∑ p : S, globalize p.val.index (η p) + (localize A p.val.index (cutoffGlobal p.val.index (κ p)) (cutoffGlobal_support p.val.index (κ p)) F) := by + have he (p : S) := weighted_cutoff_reconstruction p.val.index (L.weight p) F + (by simpa only [hLI p] using L.support_sub p) (κ p) (hκ p) + simp_rw [show ∀ p : S, globalize p.val.index (η p) + (localize A p.val.index (cutoffGlobal p.val.index (κ p)) (cutoffGlobal_support p.val.index (κ p)) F) = + (L.weight p).mul F from he] + ext x + change F.val x = (∑ p : S, (L.weight p).mul F).val x + simp only [Submodule.coe_sum,Finset.sum_apply] + change F x = ∑ p : S, L.weight p x*F x + rw [← Finset.sum_mul,L.sum_one,one_mul] + refine ⟨∑ p, Q p*B p,Finset.sum_nonneg (fun p _ => mul_nonneg (hQ p) (hB p)),fun z => ?_⟩ + rw [hsum (Smooth.ofReal z.potential),map_sum] + apply (norm_sum_le _ _).trans + apply Finset.sum_le_sum + intro p _ + have hh := hq p (localize A p.val.index (cutoffGlobal p.val.index (κ p)) + (cutoffGlobal_support p.val.index (κ p)) (Smooth.ofReal z.potential)) + rw [Nat.cast_add,Nat.cast_ofNat] at hh + exact hh.trans (mul_le_mul_of_nonneg_left (hb p z) (hQ p)) + +theorem volumePath_uniform_all (line : SemipositiveAnticanonicalMetric A) (hd : 2 ≤ d) : + ∀ k : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∀ z : g.NormalizedPathSolution line, + ‖D.localizers.embed (k:ℝ) (Smooth.ofReal z.potential)‖ ≤ C := by + have hhigh : ∀ k : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∀ z : g.NormalizedPathSolution line, + ‖D.localizers.embed ((k:ℝ)+2) (Smooth.ofReal z.potential)‖ ≤ C := by + intro n + induction n with + | zero => + rw [Nat.cast_zero,zero_add] + exact D.volumePath_uniform_H2 line hd + | succ n ih => + have he : ((n+1:ℕ):ℝ)+1 = (n:ℝ)+2 := by push_cast; ring + have h := D.volumePath_uniform_gain line hd (n+1) (by omega) (by rw [he]; exact ih) + exact h + intro k + obtain ⟨C,hC,hc⟩ := hhigh k + obtain ⟨B,hB,hb⟩ := D.localizers.boundedCore_lower (by linarith : (k:ℝ) ≤ (k:ℝ)+2) + refine ⟨B*C,mul_nonneg hB hC,fun z => ?_⟩ + exact (hb (Smooth.ofReal z.potential)).trans (mul_le_mul_of_nonneg_left (hc z) hB) +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/PathUniformSobolevBase.lean b/lean/OAI/Geometry/PrescribedRicci/PathUniformSobolevBase.lean new file mode 100644 index 0000000000000000000000000000000000000000..311f2c5072569eb2be74d8ac9686d249e0eb0707 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/PathUniformSobolevBase.lean @@ -0,0 +1,114 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CompletedResolvent +import OAI.Geometry.PrescribedPotential.QuantitativeResolvent +import OAI.Geometry.PrescribedRicci.CurvatureCompactBounds +import OAI.Geometry.PrescribedRicci.KahlerL2Comparison +import OAI.Geometry.PrescribedRicci.MatrixComponentBounds +import OAI.Geometry.PrescribedRicci.MongeAmpereC0 +import OAI.Geometry.PrescribedRicci.UniformMetricBounds +import OAI.Geometry.PrescribedPotential.RealSmoothOperator +import OAI.Geometry.PrescribedPotential.VolumePath + +namespace OAI + +/-! Path Uniform Sobolev Base. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff Classical Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth.KaehlerMetric +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} + +structure NormalizedPathSolution (g : KaehlerMetric A) (line : SemipositiveAnticanonicalMetric A) where + potential : SmoothRealFunction A + positive : g.PositivePotential potential + mean_zero : g.integral potential.value = 0 + time : ℝ + time_mem : time ∈ Icc (0:ℝ) 1 + constant : ℝ + equation : ∀ x, (g.logRatio (g.deform potential positive)).value x = + time*(prescribedForcing g line).value x+constant + +lemma volumePath_background_laplacian_bound (g : KaehlerMetric A) + (line : SemipositiveAnticanonicalMetric A) (hd : 2 ≤ d) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ z : g.NormalizedPathSolution line, ∀ x, + |(g.laplacian z.potential).value x| ≤ C := by + obtain ⟨K,hK,hk⟩ := g.volumePath_metric_bounds line hd + obtain ⟨M,hM,hm⟩ := g.compact_background_bounds (prescribedForcing g line) + have hM0 : 0 ≤ M := by linarith + refine ⟨(d:ℝ)^2*M*(K+M),by positivity,fun z x => ?_⟩ + obtain ⟨q,hq⟩ := exists_partition_chart (A:=A) x + have hx := chartPartition_support q hq + have hb := hm q x hq + have hH := (hk z.potential z.positive z.mean_zero z.time z.constant z.time_mem z.equation q x hq).1 + have hp (i j : Fin d) : ‖z.potential.hessian q (A.chart q x) i j‖ ≤ K+M := by + have he : z.potential.hessian q (A.chart q x) i j = + (g.deform z.potential z.positive).matrix q (A.chart q x) i j-g.matrix q (A.chart q x) i j := by + change _ = (g.matrix q (A.chart q x) i j+_)-_ + ring + rw [he] + apply (norm_sub_le _ _).trans + exact add_le_add ((norm_le_pi_norm _ j).trans ((norm_le_pi_norm _ i).trans hH)) (hb.1 i j) + change |g.laplacianValue z.potential x| ≤ _ + rw [g.laplacianValue_local z.potential q hx] + exact (Complex.abs_re_le_norm _).trans (by + simpa only [Fintype.card_fin] using MongeAmpere.trace_mul_entry_bound hM0 hb.2.1 hp) +end Anticanonical.SourceSmooth.KaehlerMetric + +namespace GlobalElliptic +open Anticanonical SourceSmooth SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] + +omit [ConnectedSpace X] in +lemma Localizers.uniform_zero_of_bound (D : Localizers A ι) (g : KaehlerMetric A) + {Z : Type*} (F : Z → Smooth A) {M : ℝ} (hM : 0 ≤ M) + (hb : ∀ z x, ‖F z x‖ ≤ M) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ z, ‖D.embed 0 (F z)‖ ≤ C := by + obtain ⟨B,Q,hB,hQ,hbq⟩ := D.kahler_L2_comparison g + let C : ℝ := B*(M^2*g.integral (fun _ => (1:ℝ))) + have hC : 0 ≤ C := mul_nonneg hB.le (mul_nonneg (sq_nonneg _) (g.integral_nonneg (fun _ => zero_le_one))) + refine ⟨Real.sqrt C,Real.sqrt_nonneg _,fun z => (Real.le_sqrt (norm_nonneg _) hC).mpr ?_⟩ + apply (hbq (F z)).1.trans + apply mul_le_mul_of_nonneg_left _ hB.le + rw [← g.integral_const_mul (M^2) (fun _ => (1:ℝ))] + apply g.integral_mono ((F z).continuous.norm.pow 2) continuous_const + intro x + change ‖F z x‖^2 ≤ M^2*1 + rw [mul_one] + exact (sq_le_sq₀ (norm_nonneg _) hM).mpr (hb z x) + +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +theorem volumePath_uniform_H2 (line : SemipositiveAnticanonicalMetric A) (hd : 2 ≤ d) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ z : g.NormalizedPathSolution line, + ‖D.localizers.embed 2 (Smooth.ofReal z.potential)‖ ≤ C := by + obtain ⟨M,hM,hm⟩ := g.volumePath_C0_bound line hd + obtain ⟨B,hB,hb⟩ := D.localizers.uniform_zero_of_bound g + (fun z : g.NormalizedPathSolution line => Smooth.ofReal z.potential) hM (fun z x => by + simpa only [Smooth.ofReal_apply,Complex.norm_real,Real.norm_eq_abs] using + hm z.potential z.positive z.mean_zero z.time z.constant z.time_mem z.equation x) + obtain ⟨L,hL,hl⟩ := g.volumePath_background_laplacian_bound line hd + obtain ⟨J,hJ,hj⟩ := D.localizers.uniform_zero_of_bound g + (fun z : g.NormalizedPathSolution line => Smooth.ofReal (g.laplacian z.potential)) hL (fun z x => by + simpa only [Smooth.ofReal_apply,Complex.norm_real,Real.norm_eq_abs] using hl z x) + obtain ⟨m,hm,he⟩ := D.exists_completedError_small + refine ⟨‖D.completedResolvent m hm he‖*(m^2*B+J),by positivity,fun z => ?_⟩ + have h := D.elliptic_estimate m hm he (D.localizers.embed 2 (Smooth.ofReal z.potential)) + rw [D.localizers.lower_embed (by norm_num : (0:ℝ) ≤ 2), + completedL,D.localizers.extendCore_embed D.complexL_bound,complexL_ofReal] at h + exact h.trans (mul_le_mul_of_nonneg_left (add_le_add + (mul_le_mul_of_nonneg_left (hb z) (sq_nonneg m)) (hj z)) (norm_nonneg (D.completedResolvent m hm he))) +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/PositiveOpenness.lean b/lean/OAI/Geometry/PrescribedRicci/PositiveOpenness.lean new file mode 100644 index 0000000000000000000000000000000000000000..077d0109351a02ec6d8f2197e0d332570a92fd38 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/PositiveOpenness.lean @@ -0,0 +1,79 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.PatchCutoffs +import OAI.Geometry.PrescribedPotential.RealSobolev +import OAI.Geometry.PrescribedPotential.WeakPositive +import OAI.Geometry.PrescribedPotential.SobolevOpenness + +namespace OAI + +/-! Positive Openness. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff Classical ComplexOrder +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) +local instance positiveOpenNG (s : ℝ) : NormedAddCommGroup (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedAddCommGroup +local instance positiveOpenNS (s : ℝ) : NormedSpace ℝ (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedSpace +local instance positiveOpenTG (s : ℝ) : IsTopologicalAddGroup (D.localizers.RealSobolev s) := + Submodule.isTopologicalAddGroup _ +local instance positiveOpenCS (s : ℝ) : ContinuousSMul ℝ (D.localizers.RealSobolev s) := + SMulMemClass.continuousSMul _ + +omit [T2Space X] [CompactSpace X] in +lemma exists_weight_supportViaEnergy (x : X) : ∃ p, x ∈ tsupport (D.localizers.weight p : X → ℂ) := by + by_contra! hn + have hz : ∑ p, D.localizers.weight p x = 0 := Finset.sum_eq_zero (fun p _ => + image_eq_zero_of_notMem_tsupport (hn p)) + rw [D.localizers.sum_one] at hz + exact one_ne_zero hz + +lemma weakPositive_embed_iffViaEnergy (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (f : RealSmooth A) : + D.WeakPositive k (D.localizers.realEmbed ((k : ℝ)+2) f) ↔ g.PositivePotential f.source := by + constructor + · intro h i z hz + let x := (A.chart i).symm z + have hi : x ∈ (A.chart i).source := (A.chart i).mapsTo_symm hz + have hiz : A.chart i x = z := (A.chart i).right_inv hz + obtain ⟨p,hp⟩ := D.exists_weight_supportViaEnergy x + have hj : x ∈ (A.chart (D.patch p).index).source := by simpa using D.patch_source p hp + have hpos := h p x hp + rw [D.weakMatrix_embed k hk f p hp] at hpos + rw [← hiz, g.compatibility i (D.patch p).index x hi hj, + f.source.hessian_compatibility i (D.patch p).index hi hj, ← add_mul, ← mul_add] + exact hpos.conjTranspose_mul_mul_same (Matrix.mulVec_injective_of_det_ne_zero + (g.transition_det_isUnit i (D.patch p).index hi hj).ne_zero) + · intro h p x hx + rw [D.weakMatrix_embed k hk f p hx] + exact h _ _ ((A.chart (D.patch p).index).mapsTo (by simpa using D.patch_source p hx)) + + + +theorem positive_volume_eventually_solvableViaEnergy [ConnectedSpace X] + (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (x₀ : X) : + ∀ᶠ f in 𝓝 (D.realConstants (k : ℝ) 1), + ∃ (u : D.localizers.RealSobolev ((k : ℝ)+2)) (b : ℝ), + D.WeakPositive k u ∧ D.realVolume k hk u = Real.exp b • f ∧ + D.realEvaluation ((k : ℝ)+2) x₀ u = 0 := by + have hU : {z : D.localizers.RealSobolev ((k : ℝ)+2) × ℝ | D.WeakPositive k z.1} ∈ 𝓝 0 := + (show Tendsto (Prod.fst : D.localizers.RealSobolev ((k : ℝ)+2) × ℝ → _) + (𝓝 0) (𝓝 0) from continuous_fst.tendsto 0) (D.weakPositive_nhds k hk) + exact D.volume_eventually_solvable k hk x₀ hU + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/PositivePathClosedness.lean b/lean/OAI/Geometry/PrescribedRicci/PositivePathClosedness.lean new file mode 100644 index 0000000000000000000000000000000000000000..d1d0e2e77c45f1099c8beafad4d9700900e731bd --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/PositivePathClosedness.lean @@ -0,0 +1,73 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.PositivePathOpenness +import OAI.Geometry.PrescribedPotential.VolumeNormalization +import OAI.Geometry.PrescribedRicci.NormalizeVolumePath +import OAI.Geometry.PrescribedRicci.PositivePathLimit +import OAI.Geometry.PrescribedRicci.SmoothPathLimit + +namespace OAI + +/-! Positive Path Closedness. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical +namespace Anticanonical.SourceSmooth +open GlobalElliptic +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} + +theorem volumePath_soluble_limit (g : KaehlerMetric A) (line : SemipositiveAnticanonicalMetric A) + (hd : 2 ≤ d) (t : ℕ → ℝ) (u : ℝ) + (ht : ∀ n, t n ∈ Icc (0:ℝ) 1) + (hsol : ∀ n, ∃ (φ : SmoothRealFunction A) (b : ℝ), SolvesVolumePath g line (t n) φ b) + (hu : Tendsto t atTop (𝓝 u)) : + ∃ (φ : SmoothRealFunction A) (b : ℝ), SolvesVolumePath g line u φ b := by + choose φ b hφ using hsol + choose z hz _ using fun n => g.normalizeVolumePath line (ht n) (hφ n) + obtain ⟨S,⟨D⟩⟩ := exists_gluingData g + obtain ⟨ψ,ν,hν,hψ⟩ := D.path_smooth_subsequence line hd z + let M := ‖(⟨(prescribedForcing g line).value,(prescribedForcing g line).continuous⟩ : C(X,ℝ))‖ + have hb (n : ℕ) : (z (ν n)).constant ∈ Icc (-M) M := by + exact abs_le.mp (volumePath_scalar_bound g line (z (ν n)).time_mem + ⟨(z (ν n)).positive,(z (ν n)).equation⟩) + obtain ⟨c,_,μ,hμ,hc⟩ := isCompact_Icc.tendsto_subseq hb + refine ⟨ψ,c,D.path_limit_solves line (fun n => z (ν (μ n))) ψ u c + (fun k => (hψ k).comp hμ.tendsto_atTop) ?_ hc⟩ + have he : (fun n => (z (ν (μ n))).time) = t ∘ ν ∘ μ := by + funext n + exact hz _ + rw [he] + exact (hu.comp hν.tendsto_atTop).comp hμ.tendsto_atTop + +theorem volumePath_soluble_isClosed (g : KaehlerMetric A) (line : SemipositiveAnticanonicalMetric A) + (hd : 2 ≤ d) : + IsClosed {t : Icc (0:ℝ) 1 | ∃ (φ : SmoothRealFunction A) (b : ℝ), + SolvesVolumePath g line t.val φ b} := by + apply IsSeqClosed.isClosed + intro t u ht hu + exact volumePath_soluble_limit g line hd (fun n => (t n).val) u.val + (fun n => (t n).property) ht (continuous_subtype_val.continuousAt.tendsto.comp hu) + +theorem volumePath_one_exists (g : KaehlerMetric A) (line : SemipositiveAnticanonicalMetric A) + (hd : 2 ≤ d) : + ∃ (φ : SmoothRealFunction A) (b : ℝ), SolvesVolumePath g line 1 φ b := by + let S : Set (Icc (0:ℝ) 1) := {t | ∃ (φ : SmoothRealFunction A) (b : ℝ), + SolvesVolumePath g line t.val φ b} + have hS : IsClopen S := ⟨volumePath_soluble_isClosed g line hd, + (volumePath_soluble_isOpen g line).preimage continuous_subtype_val⟩ + let : PreconnectedSpace (Icc (0:ℝ) 1) := Subtype.preconnectedSpace isPreconnected_Icc + have he : S = univ := hS.eq_univ ⟨⟨0,by norm_num⟩,SmoothRealFunction.constant 0,0, + volumePath_zero g line⟩ + have h1 : (⟨1,by norm_num⟩ : Icc (0:ℝ) 1) ∈ S := by rw [he]; trivial + exact h1 +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/PositivePathLimit.lean b/lean/OAI/Geometry/PrescribedRicci/PositivePathLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..c890c58bf88ed72b4eab92553f9e701237138ce6 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/PositivePathLimit.lean @@ -0,0 +1,140 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.PathLocalizedDensity +import OAI.Geometry.PrescribedRicci.SmoothPathLimit + +namespace OAI + +/-! Positive Path Limit. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff Classical ComplexOrder +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] + {g : KaehlerMetric A} + +omit [ConnectedSpace X] in +lemma path_determinant_source (line : SemipositiveAnticanonicalMetric A) + (z : g.NormalizedPathSolution line) (q : Fin A.count) {x : X} + (hx : x ∈ (A.chart q).source) : + ((g.deform z.potential z.positive).matrix q (A.chart q x)).det = + (g.matrix q (A.chart q x)).det * + (Real.exp (z.time*(prescribedForcing g line).value x+z.constant):ℂ) := by + have hxe : x ∈ (A.euclideanChart q).source := by simpa using hx + have h := path_determinant_equation line z q ((A.euclideanChart q).mapsTo hxe) + have he : coordinateEquiv d (A.euclideanChart q x) = A.chart q x := + (coordinateEquiv d).apply_symm_apply _ + rw [he,(A.euclideanChart q).left_inv hxe] at h + exact h + +namespace GluingData +variable (D : GluingData g ι) + +omit [ConnectedSpace X] in +lemma path_limit_matrix (line : SemipositiveAnticanonicalMetric A) + (z : ℕ → g.NormalizedPathSolution line) (φ : SmoothRealFunction A) + (hlim : ∀ k : ℕ, Tendsto (fun n => D.localizers.embed (k:ℝ) (Smooth.ofReal (z n).potential)) + atTop (𝓝 (D.localizers.embed (k:ℝ) (Smooth.ofReal φ)))) + (p : ι) {x : X} (hx : x ∈ tsupport (D.localizers.weight p : X → ℂ)) : + Tendsto (fun n => (g.deform (z n).potential (z n).positive).matrix + (D.patch p).index (A.chart (D.patch p).index x)) atTop + (𝓝 (g.matrix (D.patch p).index (A.chart (D.patch p).index x)+ + φ.hessian (D.patch p).index (A.chart (D.patch p).index x))) := by + apply tendsto_pi_nhds.mpr + intro i + apply tendsto_pi_nhds.mpr + intro j + exact tendsto_const_nhds.add (D.hessian_of_sobolev _ φ hlim p hx i j) + +omit [ConnectedSpace X] in +lemma path_limit_determinant (line : SemipositiveAnticanonicalMetric A) + (z : ℕ → g.NormalizedPathSolution line) (φ : SmoothRealFunction A) (t b : ℝ) + (hlim : ∀ k : ℕ, Tendsto (fun n => D.localizers.embed (k:ℝ) (Smooth.ofReal (z n).potential)) + atTop (𝓝 (D.localizers.embed (k:ℝ) (Smooth.ofReal φ)))) + (ht : Tendsto (fun n => (z n).time) atTop (𝓝 t)) + (hb : Tendsto (fun n => (z n).constant) atTop (𝓝 b)) + (p : ι) {x : X} (hx : x ∈ tsupport (D.localizers.weight p : X → ℂ)) : + (g.matrix (D.patch p).index (A.chart (D.patch p).index x)+ + φ.hessian (D.patch p).index (A.chart (D.patch p).index x)).det = + (g.matrix (D.patch p).index (A.chart (D.patch p).index x)).det * + (Real.exp (t*(prescribedForcing g line).value x+b):ℂ) := by + have hs : x ∈ (A.chart (D.patch p).index).source := by simpa using D.patch_source p hx + have hdet := (show Continuous (fun M : Matrix (Fin d) (Fin d) ℂ => M.det) from + continuous_id.matrix_det).continuousAt.tendsto.comp (D.path_limit_matrix line z φ hlim p hx) + have hex := Real.continuous_exp.continuousAt.tendsto.comp + ((ht.mul_const ((prescribedForcing g line).value x)).add hb) + have hc := Complex.continuous_ofReal.continuousAt.tendsto.comp hex + have hr := hc.const_mul ((g.matrix (D.patch p).index (A.chart (D.patch p).index x)).det) + have he (n : ℕ) := path_determinant_source line (z n) (D.patch p).index hs + simp only [Function.comp_def] at hdet hr + simp_rw [he] at hdet + exact tendsto_nhds_unique hdet hr + +omit [ConnectedSpace X] in +lemma path_limit_positive (line : SemipositiveAnticanonicalMetric A) + (z : ℕ → g.NormalizedPathSolution line) (φ : SmoothRealFunction A) (t b : ℝ) + (hlim : ∀ k : ℕ, Tendsto (fun n => D.localizers.embed (k:ℝ) (Smooth.ofReal (z n).potential)) + atTop (𝓝 (D.localizers.embed (k:ℝ) (Smooth.ofReal φ)))) + (ht : Tendsto (fun n => (z n).time) atTop (𝓝 t)) + (hb : Tendsto (fun n => (z n).constant) atTop (𝓝 b)) : g.PositivePotential φ := by + have hpos (p : ι) (x : X) (hx : x ∈ tsupport (D.localizers.weight p : X → ℂ)) : + (g.matrix (D.patch p).index (A.chart (D.patch p).index x)+ + φ.hessian (D.patch p).index (A.chart (D.patch p).index x)).PosDef := by + have hs : x ∈ (A.chart (D.patch p).index).source := by simpa using D.patch_source p hx + have hz := (A.chart (D.patch p).index).mapsTo hs + apply (Matrix.PosSemidef.posDef_iff_det_ne_zero ?_).mpr + · rw [D.path_limit_determinant line z φ t b hlim ht hb p hx] + exact mul_ne_zero (g.positive _ _ hz).det_pos.ne' (Complex.ofReal_ne_zero.mpr (Real.exp_ne_zero _)) + · apply Matrix.PosSemidef.of_dotProduct_mulVec_nonneg + ((g.positive _ _ hz).isHermitian.add (φ.hessian_hermitian _ hz)) + intro v + have hc : Continuous (fun M : Matrix (Fin d) (Fin d) ℂ => star v ⬝ᵥ (M *ᵥ v)) := by fun_prop + have h := hc.continuousAt.tendsto.comp (D.path_limit_matrix line z φ hlim p hx) + exact isClosed_Ici.mem_of_tendsto h (Eventually.of_forall (fun n => + ((z n).positive _ _ hz).posSemidef.dotProduct_mulVec_nonneg v)) + intro i y hy + let x := (A.chart i).symm y + have hi : x ∈ (A.chart i).source := (A.chart i).mapsTo_symm hy + have hiy : A.chart i x = y := (A.chart i).right_inv hy + obtain ⟨p,hp⟩ := D.exists_weight_supportViaEnergy x + have hj : x ∈ (A.chart (D.patch p).index).source := by simpa using D.patch_source p hp + rw [← hiy,g.compatibility i (D.patch p).index x hi hj, + φ.hessian_compatibility i (D.patch p).index hi hj,← add_mul,← mul_add] + exact (hpos p x hp).conjTranspose_mul_mul_same (Matrix.mulVec_injective_of_det_ne_zero + (g.transition_det_isUnit i (D.patch p).index hi hj).ne_zero) + +omit [ConnectedSpace X] in +lemma path_limit_solves (line : SemipositiveAnticanonicalMetric A) + (z : ℕ → g.NormalizedPathSolution line) (φ : SmoothRealFunction A) (t b : ℝ) + (hlim : ∀ k : ℕ, Tendsto (fun n => D.localizers.embed (k:ℝ) (Smooth.ofReal (z n).potential)) + atTop (𝓝 (D.localizers.embed (k:ℝ) (Smooth.ofReal φ)))) + (ht : Tendsto (fun n => (z n).time) atTop (𝓝 t)) + (hb : Tendsto (fun n => (z n).constant) atTop (𝓝 b)) : SolvesVolumePath g line t φ b := by + let hp := D.path_limit_positive line z φ t b hlim ht hb + refine ⟨hp,fun x => ?_⟩ + obtain ⟨p,hpX⟩ := D.exists_weight_supportViaEnergy x + have hs : x ∈ (A.chart (D.patch p).index).source := by simpa using D.patch_source p hpX + let q := (D.patch p).index + have hz := (A.chart q).mapsTo hs + have he := congrArg Complex.re (D.path_limit_determinant line z φ t b hlim ht hb p hpX) + have hv : (g.deform φ hp).volumeCoefficient q (A.chart q x) = + g.volumeCoefficient q (A.chart q x)*Real.exp (t*(prescribedForcing g line).value x+b) := by + simpa only [KaehlerMetric.volumeCoefficient,KaehlerMetric.deform, + Complex.mul_re,Complex.ofReal_re,Complex.ofReal_im,mul_zero,sub_zero] using he + change g.logRatioValue (g.deform φ hp) x = _ + rw [g.logRatioValue_local _ q hs,hv, + Real.log_mul (g.volumeCoefficient_pos q hz).ne' (Real.exp_ne_zero _),Real.log_exp] + ring +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/PositivePathOpenness.lean b/lean/OAI/Geometry/PrescribedRicci/PositivePathOpenness.lean new file mode 100644 index 0000000000000000000000000000000000000000..b8c125f6e016a5707551620513ad816ba6f137f0 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/PositivePathOpenness.lean @@ -0,0 +1,81 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.PatchCutoffs +import OAI.Geometry.PrescribedPotential.PositivePotentialLinearization +import OAI.Geometry.PrescribedPotential.RealSobolev +import OAI.Geometry.PrescribedPotential.SmoothPotentialDifference +import OAI.Geometry.PrescribedPotential.VolumePath +import OAI.Geometry.PrescribedRicci.SmoothPositivePath + +namespace OAI + +/-! Positive Path Openness. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical ComplexOrder +namespace Anticanonical.SourceSmooth +open GlobalElliptic +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} +namespace KaehlerMetric + +omit [T2Space X] [CompactSpace X] [ConnectedSpace X] in +lemma logRatio_eq_log_density (g : KaehlerMetric A) (φ : SmoothRealFunction A) + (hp : g.PositivePotential φ) (x : X) : + (g.logRatio (g.deform φ hp)).value x = Real.log ((g.potentialDensity φ).value x) := by + obtain ⟨i,hi⟩ := A.covers x + rw [g.potentialDensity_quotient φ i hi] + change g.logRatioValue (g.deform φ hp) x = _ + rw [g.logRatioValue_local _ i hi,Real.log_div + (Complex.pos_iff.mp (hp i _ ((A.chart i).mapsTo hi)).det_pos).1.ne' + (g.volumeCoefficient_pos i ((A.chart i).mapsTo hi)).ne'] + rfl + +omit [T2Space X] [CompactSpace X] [ConnectedSpace X] in +lemma positive_add_of_deformed (g : KaehlerMetric A) (φ ψ : SmoothRealFunction A) + (hp : g.PositivePotential φ) (hq : (g.deform φ hp).PositivePotential ψ) : + g.PositivePotential (φ.addFunction ψ) := by + intro i z hz + rw [SmoothRealFunction.hessian_addFunction _ _ i hz,← add_assoc] + exact hq i z hz + +omit [T2Space X] [CompactSpace X] [ConnectedSpace X] in +lemma logRatio_add_deformed (g : KaehlerMetric A) (φ ψ : SmoothRealFunction A) + (hp : g.PositivePotential φ) (hq : (g.deform φ hp).PositivePotential ψ) (x : X) : + (g.logRatio (g.deform (φ.addFunction ψ) (g.positive_add_of_deformed φ ψ hp hq))).value x = + (g.logRatio (g.deform φ hp)).value x + + ((g.deform φ hp).logRatio ((g.deform φ hp).deform ψ hq)).value x := by + obtain ⟨i,hi⟩ := A.covers x + change g.logRatioValue _ x = g.logRatioValue _ x + (g.deform φ hp).logRatioValue _ x + rw [g.logRatioValue_local _ i hi,g.logRatioValue_local _ i hi, + (g.deform φ hp).logRatioValue_local _ i hi] + simp only [volumeCoefficient,deform,SmoothRealFunction.hessian_addFunction _ _ i ((A.chart i).mapsTo hi),add_assoc] + ring +end KaehlerMetric + +theorem volumePath_soluble_isOpen (g : KaehlerMetric A) (h : SemipositiveAnticanonicalMetric A) : + IsOpen {t : ℝ | ∃ (φ : SmoothRealFunction A) (b : ℝ), SolvesVolumePath g h t φ b} := by + apply isOpen_iff_mem_nhds.mpr + rintro t ⟨φ,b,hp,he⟩ + obtain ⟨x₀⟩ := (inferInstance : Nonempty X) + obtain ⟨S,⟨D⟩⟩ := exists_gluingData (g.deform φ hp) + have hn := D.smooth_positive_path_eventually (RealSmooth.ofReal (prescribedForcing g h)) x₀ + have hsub : Tendsto (fun u : ℝ => u-t) (𝓝 t) (𝓝 0) := by + simpa only [sub_self] using (show Continuous (fun u : ℝ => u-t) from continuous_id.sub continuous_const).tendsto t + filter_upwards [hsub.eventually hn] with u hu + obtain ⟨ψ,c,hq,_,hden⟩ := hu + refine ⟨φ.addFunction ψ,b+c,g.positive_add_of_deformed φ ψ hp hq,fun x => ?_⟩ + rw [g.logRatio_add_deformed φ ψ hp hq x,he x, + (g.deform φ hp).logRatio_eq_log_density ψ hq x,hden x,Real.log_exp] + change t*(prescribedForcing g h).value x+b+((u-t)*(prescribedForcing g h).value x+c) = _ + ring +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/PowerDual.lean b/lean/OAI/Geometry/PrescribedRicci/PowerDual.lean new file mode 100644 index 0000000000000000000000000000000000000000..304288b2b63b58fb581d8d0d4390d970227d5f72 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/PowerDual.lean @@ -0,0 +1,61 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalSobolev + +namespace OAI + +/-! Power Dual. -/ + +noncomputable section +open Filter Topology Asymptotics +namespace TameInterpolation + +def powerDual (p x : ℝ) : ℝ := x * |x| ^ (p-2) + +lemma powerDual_zero (p : ℝ) : powerDual p 0 = 0 := by simp [powerDual] + +lemma powerDual_hasDerivAt {p : ℝ} (hp : 2 < p) (x : ℝ) : + HasDerivAt (powerDual p) ((p-1)*|x|^(p-2)) x := by + by_cases hx : x = 0 + · subst x + have hq : 0 < p-2 := by linarith + have hF : HasFDerivAt (powerDual p) (0 : ℝ →L[ℝ] ℝ) 0 := by + refine .of_isLittleO ?_ + simp only [powerDual,abs_zero,zero_mul,zero_apply,sub_zero] + have hsmall : (fun y : ℝ => |y|^(p-2)) =o[𝓝 0] (fun _ => (1:ℝ)) := by + apply (isLittleO_const_iff one_ne_zero).mpr + have hc : ContinuousAt (fun y : ℝ => |y|^(p-2)) 0 := + continuousAt_id.abs.rpow_const (Or.inr hq.le) + simpa only [abs_zero,Real.zero_rpow hq.ne'] using hc.tendsto + simpa only [mul_one,sub_zero] using (isBigO_refl (fun y : ℝ => y) (𝓝 0)).mul_isLittleO hsmall + simpa [hq.ne'] using hF.hasDerivAt + · have hd := (hasDerivAt_id x).mul ((hasDerivAt_abs hx).rpow_const (p:=p-2) (Or.inl (abs_ne_zero.mpr hx))) + have ha : 0 < |x| := abs_pos.mpr hx + have he : |x|^(p-2) = |x|^(p-2-1)*|x| := by + rw [← Real.rpow_add_one ha.ne'] + congr 1 + ring + have hs : x*(SignType.sign x : ℝ) = |x| := by + simpa only [mul_comm] using sign_mul_self x + have hval : (p-1)*|x|^(p-2) = 1*|x|^(p-2)+x*((SignType.sign x:ℝ)*(p-2)*|x|^(p-2-1)) := by + rw [he] + calc + _ = |x|^(p-2-1)*|x|+ (x*(SignType.sign x:ℝ))*(p-2)*|x|^(p-2-1) := by rw [hs]; ring + _ = _ := by ring + rw [hval] + exact hd + +lemma powerDual_continuous {p : ℝ} (hp : 2 < p) : Continuous (powerDual p) := + (show Differentiable ℝ (powerDual p) from fun x => (powerDual_hasDerivAt hp x).differentiableAt).continuous + +lemma powerDual_mul_self {p : ℝ} (hp : 2 < p) (x : ℝ) : + powerDual p x*x = |x|^p := by + by_cases hx : x = 0 + · simp [hx,powerDual,Real.zero_rpow (by linarith : p ≠ 0)] + · change x * |x|^(p-2) * x = |x|^p + conv_rhs => rw [show p = (p-2)+2 by ring,Real.rpow_add (abs_pos.mpr hx),Real.rpow_two,sq_abs] + ring +end TameInterpolation + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/PowerIntegration.lean b/lean/OAI/Geometry/PrescribedRicci/PowerIntegration.lean new file mode 100644 index 0000000000000000000000000000000000000000..772f95f5209d4b0b408ca90f25e62881ff64c1ff --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/PowerIntegration.lean @@ -0,0 +1,76 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.GlobalKahlerIntegral +import OAI.Geometry.PrescribedRicci.PowerDual + +namespace OAI + +/-! Power Integration. -/ + +section + + +noncomputable section +open Set Filter Topology MeasureTheory +open scoped ContDiff +namespace TameInterpolation +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +def dir (v : E) (f : E → ℝ) (x : E) : ℝ := fderiv ℝ f x v + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma dir_smooth (v : E) {f : E → ℝ} (hf : ContDiff ℝ ∞ f) : ContDiff ℝ ∞ (dir v f) := + (hf.fderiv_right (by simp)).clm_apply contDiff_const + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma dir_compact (v : E) {f : E → ℝ} (hf : HasCompactSupport f) : + HasCompactSupport (dir v f) := + (hf.fderiv ℝ).comp_left (g:=fun L : E →L[ℝ] ℝ => L v) (by simp : (fun L : E →L[ℝ] ℝ => L v) 0 = 0) + +lemma power_dir_integration {p : ℝ} (hp : 2 < p) (v : E) + {f : E → ℝ} (hf : ContDiff ℝ ∞ f) (hc : HasCompactSupport f) : + (∫ x, |dir v f x|^p) = -(p-1) * + ∫ x, f x * |dir v f x|^(p-2) * dir v (dir v f) x := by + let a := dir v f + let b := dir v a + have ha : ContDiff ℝ ∞ a := dir_smooth v hf + have hb : ContDiff ℝ ∞ b := dir_smooth v ha + have hac : HasCompactSupport a := dir_compact v hc + have hbc : HasCompactSupport b := dir_compact v hac + have hpow : Continuous (fun x => |a x|^(p-2)) := ha.continuous.abs.rpow_const (fun _ => Or.inr (by linarith)) + have hdual : Continuous (fun x => powerDual p (a x)) := (powerDual_continuous hp).comp ha.continuous + have hdval (x : E) : fderiv ℝ (fun x => powerDual p (a x)) x v = (p-1)*|a x|^(p-2)*b x := by + have h := (powerDual_hasDerivAt hp (a x)).hasFDerivAt.comp x (ha.differentiable (by simp) x).hasFDerivAt + have he := congrArg (fun L : E →L[ℝ] ℝ => L v) h.fderiv + dsimp only [Function.comp_def] at he + rw [he] + simp only [ContinuousLinearMap.comp_apply] + change (fderiv ℝ a x v) * ((p-1)*|a x|^(p-2)) = _ + exact mul_comm _ _ + have h1 : Integrable (fun x => fderiv ℝ f x v * powerDual p (a x)) := + (ha.continuous.mul hdual).integrable_of_hasCompactSupport hac.mul_right + have h2 : Integrable (fun x => f x * fderiv ℝ (fun x => powerDual p (a x)) x v) := by + simp_rw [hdval] + exact (hf.continuous.mul ((continuous_const.mul hpow).mul hb.continuous)).integrable_of_hasCompactSupport hc.mul_right + have h3 : Integrable (fun x => f x * powerDual p (a x)) := + (hf.continuous.mul hdual).integrable_of_hasCompactSupport hc.mul_right + have he := integral_mul_fderiv_eq_neg_fderiv_mul_of_integrable h1 h2 h3 + (fun x _ => hf.differentiable (by simp) x) + (fun x _ => ((powerDual_hasDerivAt hp (a x)).differentiableAt.comp x (ha.differentiable (by simp) x))) + have hright : (fun x => fderiv ℝ f x v * powerDual p (a x)) = (fun x => |a x|^p) := by + funext x + exact (mul_comm _ _).trans (powerDual_mul_self hp (a x)) + have hleft : (fun x => f x * fderiv ℝ (fun x => powerDual p (a x)) x v) = + (fun x => (p-1)*(f x*|a x|^(p-2)*b x)) := by + funext x + rw [hdval] + ring + rw [hright,hleft,integral_const_mul] at he + dsimp only [a,b] at he + linarith +end TameInterpolation + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/PrescribedPotential.lean b/lean/OAI/Geometry/PrescribedRicci/PrescribedPotential.lean new file mode 100644 index 0000000000000000000000000000000000000000..723185aa4dab98cd9eefa1f47e74a7b60ada05d5 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/PrescribedPotential.lean @@ -0,0 +1,34 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.DimensionOnePotential +import OAI.Geometry.PrescribedRicci.DimensionZeroPotential +import OAI.Geometry.PrescribedRicci.PositivePathClosedness + +namespace OAI + +/-! Prescribed Potential. -/ + +section + + + +noncomputable section +namespace Anticanonical.SourceSmooth + +theorem prescribedPotentialViaEnergy (d : ℕ) (X : Type) [TopologicalSpace X] [T2Space X] + [CompactSpace X] [ConnectedSpace X] (A : ComplexAtlas d X) + (P : A.ProjectiveEmbedding) (h : SemipositiveAnticanonicalMetric A) : + HasPrescribedVolumePotential P h := by + rcases d with _ | d + · obtain ⟨φ,b,hφ⟩ := volumePath_zeroDim_one (projectiveBackground P) h + exact volumePath_one P h φ b hφ + rcases d with _ | d + · exact prescribedPotential_dimensionOne X A P h + · obtain ⟨φ,b,hφ⟩ := volumePath_one_exists (projectiveBackground P) h (by omega) + exact volumePath_one P h φ b hφ + +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/PrescribedRicci.lean b/lean/OAI/Geometry/PrescribedRicci/PrescribedRicci.lean new file mode 100644 index 0000000000000000000000000000000000000000..b8fe4956670c4c506c5374b649a3b73330416dd6 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/PrescribedRicci.lean @@ -0,0 +1,182 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.PrescribedPotential + +namespace OAI + +/-! Anticanonical sections and semipositive prescribed Ricci curvature. -/ + +noncomputable section +open Set +open scoped ContDiff + +namespace Anticanonical.ComplexAtlas + +variable {d : ℕ} {X : Type*} [TopologicalSpace X] (A : ComplexAtlas d X) + + + +def anticanonicalSections (m : ℤ) : + Submodule ℂ (Fin A.count → Coordinates d → ℂ) where + carrier := {f | + (∀ i, DifferentiableOn ℂ (f i) (A.chart i).target) ∧ + (∀ i z, z ∉ (A.chart i).target → f i z = 0) ∧ + (∀ i j x, x ∈ (A.chart i).source → x ∈ (A.chart j).source → + f j (A.chart j x) = A.jacobian i j x ^ m * f i (A.chart i x))} + zero_mem' := by + refine ⟨fun _ => differentiableOn_const _, fun _ _ _ => rfl, ?_⟩ + intro i j x hi hj + simp + add_mem' := by + intro f g hf hg + refine ⟨fun i => (hf.1 i).add (hg.1 i), ?_, ?_⟩ + · intro i z hz + change f i z + g i z = 0 + rw [hf.2.1 i z hz, hg.2.1 i z hz, add_zero] + · intro i j x hi hj + change f j (A.chart j x) + g j (A.chart j x) = + A.jacobian i j x ^ m * (f i (A.chart i x) + g i (A.chart i x)) + rw [hf.2.2 i j x hi hj, hg.2.2 i j x hi hj, mul_add] + smul_mem' := by + intro c f hf + refine ⟨fun i => (hf.1 i).const_smul c, ?_, ?_⟩ + · intro i z hz + change c • f i z = 0 + rw [hf.2.1 i z hz, smul_zero] + · intro i j x hi hj + change c * f j (A.chart j x) = A.jacobian i j x ^ m * (c * f i (A.chart i x)) + rw [hf.2.2 i j x hi hj] + ring + + + +abbrev H0Anticanonical (m : ℤ) := ↥(A.anticanonicalSections m) + +end Anticanonical.ComplexAtlas + +namespace Anticanonical.ComplexAtlas + +variable {d : ℕ} {X : Type*} [TopologicalSpace X] + {A : ComplexAtlas d X} {m : ℤ} + + + +theorem section_eq_zero_iff (s : A.H0Anticanonical m) : + s = 0 ↔ ∀ i z, z ∈ (A.chart i).target → s.val i z = 0 := by + constructor + · intro hs + subst hs + intro i z hz + rfl + · intro hs + apply Subtype.ext + funext i z + by_cases hz : z ∈ (A.chart i).target + · exact hs i z hz + · exact s.property.2.1 i z hz + + + +theorem section_ne_zero_iff (s : A.H0Anticanonical m) : + s ≠ 0 ↔ ∃ i z, z ∈ (A.chart i).target ∧ s.val i z ≠ 0 := by + rw [ne_eq, section_eq_zero_iff] + simp only [not_forall, exists_prop] + + + +theorem section_ne_zero_iff_on_source (s : A.H0Anticanonical m) : + s ≠ 0 ↔ ∃ (x : X) (i : Fin A.count), + x ∈ (A.chart i).source ∧ s.val i (A.chart i x) ≠ 0 := by + rw [section_ne_zero_iff] + constructor + · rintro ⟨i,z,hz,hs⟩ + refine ⟨(A.chart i).symm z,i,(A.chart i).mapsTo_symm hz,?_⟩ + simpa only [(A.chart i).right_inv hz] using hs + · rintro ⟨x,i,hx,hs⟩ + exact ⟨i,A.chart i x,(A.chart i).mapsTo hx,hs⟩ + + + +def unitSectionOfTrivialTransitions (A : ComplexAtlas d X) (m : ℤ) + (hJ : ∀ i j x, x ∈ (A.chart i).source → x ∈ (A.chart j).source → + A.jacobian i j x ^ m = 1) : A.H0Anticanonical m := by + classical + refine ⟨fun i z => if z ∈ (A.chart i).target then 1 else 0, ?_, ?_, ?_⟩ + · intro i + apply (differentiableOn_const (1 : ℂ)).congr + intro z hz + simp only [ite_eq_left hz] + · intro i z hz + simp only [ite_eq_right hz] + · intro i j x hi hj + simp only [ite_eq_left ((A.chart i).mapsTo hi), ite_eq_left ((A.chart j).mapsTo hj), + hJ i j x hi hj, mul_one] + +theorem unitSectionOfTrivialTransitions_ne_zero [Nonempty X] + (A : ComplexAtlas d X) (m : ℤ) + (hJ : ∀ i j x, x ∈ (A.chart i).source → x ∈ (A.chart j).source → + A.jacobian i j x ^ m = 1) : A.unitSectionOfTrivialTransitions m hJ ≠ 0 := by + classical + obtain ⟨x⟩ := ‹Nonempty X› + obtain ⟨i,hi⟩ := A.covers x + apply (section_ne_zero_iff_on_source _).mpr + refine ⟨x,i,hi,?_⟩ + simp only [unitSectionOfTrivialTransitions, ite_eq_left ((A.chart i).mapsTo hi), ne_eq, + one_ne_zero, not_false_eq_true] + + + +def degreeZeroSection (A : ComplexAtlas d X) : A.H0Anticanonical 0 := + A.unitSectionOfTrivialTransitions 0 (by intros; exact zpow_zero _) + + +@[simp] theorem jacobian_dim_zero (A : ComplexAtlas 0 X) (i j : Fin A.count) (x : X) : + A.jacobian i j x = 1 := by + simp [jacobian, Matrix.det_isEmpty] + + + +def dimensionZeroSection (A : ComplexAtlas 0 X) (m : ℤ) : A.H0Anticanonical m := + A.unitSectionOfTrivialTransitions m (by intros; simp) + +theorem dimensionZeroSection_ne_zero [Nonempty X] (A : ComplexAtlas 0 X) (m : ℤ) : + A.dimensionZeroSection m ≠ 0 := + A.unitSectionOfTrivialTransitions_ne_zero m _ + +end Anticanonical.ComplexAtlas + +namespace Anticanonical + + + +theorem headline_dimensionZero (X : Type) [TopologicalSpace X] [Nonempty X] + (A : ComplexAtlas 0 X) : + ∃ m : ℤ, 0 < m ∧ ∃ s : A.H0Anticanonical m, s ≠ 0 := by + exact ⟨1, by norm_num, A.dimensionZeroSection 1, A.dimensionZeroSection_ne_zero 1⟩ + +end Anticanonical + +namespace Anticanonical.SourceSmooth + + + +theorem prescribedRicciFromSemipositive (d : ℕ) (X : Type) + [TopologicalSpace X] [T2Space X] [CompactSpace X] [ConnectedSpace X] + (A : ComplexAtlas d X) (P : A.ProjectiveEmbedding) + (h : SemipositiveAnticanonicalMetric A) : + ∃ g : KaehlerMetric A, + (∀ i z, z ∈ (A.chart i).target → + ∀ v : Coordinates d, g.ricciQuadratic i z v = levi (h.weight i) z v) ∧ + (∀ i z, z ∈ (A.chart i).target → + ∀ v : Coordinates d, 0 ≤ g.ricciQuadratic i z v) := by + obtain ⟨φ,c,hc,hp,he⟩ := prescribedPotentialViaEnergy d X A P h + obtain ⟨g,_,hRic⟩ := prescribedRicci_of_potential P h φ hp hc he + refine ⟨g,hRic,?_⟩ + intro i z hz v + rw [hRic i z hz v] + exact h.semipositive i z hz v + +end Anticanonical.SourceSmooth + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/RoughCutoff.lean b/lean/OAI/Geometry/PrescribedRicci/RoughCutoff.lean new file mode 100644 index 0000000000000000000000000000000000000000..02dc1a566c4ffa3264fb096ad2eafcd5b16b27bf --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/RoughCutoff.lean @@ -0,0 +1,112 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.ChartSobolevAlgebra + +namespace OAI + +/-! Rough Cutoff. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory TemperedDistribution LineDeriv +open scoped SchwartzMap BoundedContinuousFunction ContDiff Classical ComplexOrder MatrixOrder +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +def cutoffTerm (k : ℕ) (hk : Module.finrank ℝ E < k) (κ : 𝓢(E,ℂ)) + (v w : E) (u : L2 E) : L2 E := + productCoord k hk (schwartzCoord (k:ℝ) (∂_{v} κ)) (derivativeCoord ((k:ℝ)+1) w u) + + productCoord k hk (schwartzCoord (k:ℝ) (∂_{w} κ)) (derivativeCoord ((k:ℝ)+1) v u) + + productCoord k hk (schwartzCoord (k:ℝ) (∂_{v} (∂_{w} κ))) + (lowerCoord ((k:ℝ)+1) (k:ℝ) (by linarith) u) + +lemma cutoffTerm_continuous (k : ℕ) (hk : Module.finrank ℝ E < k) (κ : 𝓢(E,ℂ)) + (v w : E) : Continuous (cutoffTerm k hk κ v w) := by + unfold cutoffTerm + fun_prop + +lemma cutoffTerm_schwartz (k : ℕ) (hk : Module.finrank ℝ E < k) (κ f : 𝓢(E,ℂ)) + (v w : E) : cutoffTerm k hk κ v w (schwartzCoord ((k:ℝ)+1) f) = + schwartzCoord (k:ℝ) + (SchwartzMap.smulLeftCLM ℂ (∂_{v} κ : 𝓢(E,ℂ)) (∂_{w} f) + + SchwartzMap.smulLeftCLM ℂ (∂_{w} κ : 𝓢(E,ℂ)) (∂_{v} f) + + SchwartzMap.smulLeftCLM ℂ (∂_{v} (∂_{w} κ) : 𝓢(E,ℂ)) f) := by + simp only [cutoffTerm,derivativeCoord_schwartz,add_sub_cancel_right, + lowerCoord_schwartz,productCoord_schwartz,schwartzCoord_add] + +end SobolevChart +namespace MetricLocalization +open EllipticKernel SobolevChart FrozenPoisson +variable {n : ℕ} + +def roughCutoff (H : Matrix (Fin n) (Fin n) ℂ) (k : ℕ) + (hk : Module.finrank ℝ (EC n) < k) (κ : 𝓢(EC n,ℂ)) + (a : BasisIndex n → BasisIndex n → L2 (EC n)) (u : L2 (EC n)) : L2 (EC n) := + ∑ i, ∑ j, ( + (traceBilin H (rankTwo (stdOrthonormalBasis ℝ (EC n) i) + (stdOrthonormalBasis ℝ (EC n) j)) : ℂ) • + cutoffTerm k hk κ (stdOrthonormalBasis ℝ (EC n) i) (stdOrthonormalBasis ℝ (EC n) j) u + + productCoord k hk (a i j) + (cutoffTerm k hk κ (stdOrthonormalBasis ℝ (EC n) i) (stdOrthonormalBasis ℝ (EC n) j) u)) + +lemma roughCutoff_continuous (H : Matrix (Fin n) (Fin n) ℂ) (k : ℕ) + (hk : Module.finrank ℝ (EC n) < k) (κ : 𝓢(EC n,ℂ)) : + Continuous (fun p : (BasisIndex n → BasisIndex n → L2 (EC n)) × L2 (EC n) => + roughCutoff H k hk κ p.1 p.2) := by + unfold roughCutoff + apply continuous_finsetSum + intro i _ + apply continuous_finsetSum + intro j _ + let T := (BasisIndex n → BasisIndex n → L2 (EC n)) × L2 (EC n) + have hc : Continuous (fun p : T => cutoffTerm k hk κ + (stdOrthonormalBasis ℝ (EC n) i) (stdOrthonormalBasis ℝ (EC n) j) p.2) := + (cutoffTerm_continuous k hk κ _ _).comp continuous_snd + have ha : Continuous (fun p : T => p.1 i j) := + (continuous_apply j).comp ((continuous_apply i).comp continuous_fst) + exact (hc.const_smul (traceBilin H (rankTwo (stdOrthonormalBasis ℝ (EC n) i) + (stdOrthonormalBasis ℝ (EC n) j)) : ℂ)).add (((productCoord k hk).continuous.comp ha).clm_apply hc) + +lemma roughCutoff_schwartz (H : Matrix (Fin n) (Fin n) ℂ) (k : ℕ) + (hk : Module.finrank ℝ (EC n) < k) (κ f : 𝓢(EC n,ℂ)) + (a : SmoothCoefficients (BasisIndex n) (EC n)) : + roughCutoff H k hk κ (fun i j => schwartzCoord (k:ℝ) (a i j)) + (schwartzCoord ((k:ℝ)+1) f) = + schwartzCoord (k:ℝ) (schwartzCutoffError (extendedCoefficient H (coefficientBCF a)) κ f) := by + rw [schwartzCutoffError_firstOrder _ + (extendedCoefficient_temperate H _ (fun i j => (a i j).hasTemperateGrowth))] + simp only [roughCutoff,cutoffTerm_schwartz,productCoord_schwartz, + schwartzCoord_sum] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + rw [← schwartzCoord_smul,← schwartzCoord_add] + congr 1 + ext x + simp only [add_apply,smul_apply, + SchwartzMap.smulLeftCLM_apply_apply + (SchwartzMap.smulLeftCLM ℂ _ _).hasTemperateGrowth] + simp only [add_apply,smul_eq_mul, + SchwartzMap.smulLeftCLM_apply_apply (extendedCoefficient_temperate H (coefficientBCF a) + (fun i j => (a i j).hasTemperateGrowth) i j), + SchwartzMap.smulLeftCLM_apply_apply (a i j).hasTemperateGrowth, + SchwartzMap.smulLeftCLM_apply_apply (∂_{stdOrthonormalBasis ℝ (EC n) i} κ).hasTemperateGrowth, + SchwartzMap.smulLeftCLM_apply_apply (∂_{stdOrthonormalBasis ℝ (EC n) j} κ).hasTemperateGrowth, + SchwartzMap.smulLeftCLM_apply_apply (∂_{stdOrthonormalBasis ℝ (EC n) i} + (∂_{stdOrthonormalBasis ℝ (EC n) j} κ)).hasTemperateGrowth] + simp only [extendedCoefficient,BoundedContinuousFunction.add_apply,BoundedContinuousFunction.const_apply] + change _ = ((traceBilin H (rankTwo _ _) : ℂ)+a i j x) * _ * _ + + ((traceBilin H (rankTwo _ _) : ℂ)+a i j x) * _ * _ + + ((traceBilin H (rankTwo _ _) : ℂ)+a i j x) * _ * _ + ring + +end MetricLocalization + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/RoughEllipticGain.lean b/lean/OAI/Geometry/PrescribedRicci/RoughEllipticGain.lean new file mode 100644 index 0000000000000000000000000000000000000000..6d8b9f0873285ee620ce13d94a722a9687bbb935 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/RoughEllipticGain.lean @@ -0,0 +1,77 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.TameRoughInverse + +namespace OAI + +/-! Rough Elliptic Gain. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory TemperedDistribution LineDeriv +open scoped SchwartzMap BoundedContinuousFunction ContDiff Classical ComplexOrder MatrixOrder +namespace FrozenPoisson +open SobolevChart EllipticKernel +variable {n : ℕ} {ι : Type*} [Fintype ι] + +lemma parameterResolvent_forward (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + {t : ℝ} (ht : 0 < t) (u : 𝓢'(EC n,ℂ)) : + parameterResolvent H t (parameterForward H t u) = u := by + rw [parameterResolvent,parameterForward, + fourierMultiplierCLM_fourierMultiplierCLM_apply (parameterForward_temperate H hH t) + (parameterSymbol_temperate H hH ht)] + have he : (fun ξ => ((t^2+symbol H ξ : ℝ):ℂ)) * parameterSymbol H t = fun _ => (1:ℂ) := by + funext ξ + simp only [Pi.mul_apply,parameterSymbol,← Complex.ofReal_mul] + have hp := symbol_nonneg H hH ξ + rw [mul_inv_cancel₀ (by positivity : t^2+symbol H ξ ≠ 0),Complex.ofReal_one] + rw [he,fourierMultiplierCLM_const] + simp + +lemma fixed_of_differential_equation (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (t : ℝ) (ht : 1 ≤ t) (v : ι → EC n) (a : ι → ι → EC n →ᵇ ℂ) + (u f : L2 (EC n)) + (he : (t^2:ℂ) • realize 2 u - frozenDifferential H (realize 2 u) - + ((perturbation v a u : L2 (EC n)) : 𝓢'(EC n,ℂ)) = (f : 𝓢'(EC n,ℂ))) : + u = parameterHilbert H hH t ht (f+perturbation v a u) := by + apply realize_injective 2 + have hr := parameterHilbert_realize H hH t ht 0 (f+perturbation v a u) + simp only [zero_add] at hr + rw [hr] + have hf : realize 0 (f+perturbation v a u) = + (f : 𝓢'(EC n,ℂ)) + ((perturbation v a u : L2 (EC n)) : 𝓢'(EC n,ℂ)) := by + simp [realize, ← Lp.toTemperedDistributionCLM_apply, map_add] + rw [hf,← sub_eq_iff_eq_add.mp he,← parameterForward_eq H hH] + exact (parameterResolvent_forward H hH (lt_of_lt_of_le zero_lt_one ht) _).symm + + + +theorem rough_equation_memSobolev (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (t : ℝ) (ht : 1 ≤ t) (v : ι → EC n) (k : ℕ) + (hk : Module.finrank ℝ (EC n)+1 < k) + (hs : (Module.finrank ℝ (EC n):ℝ) < 2*(k:ℝ)) + (a : ι → ι → L2 (EC n)) (f u : L2 (EC n)) + (hsmall : perturbationBound v (fun i j => strongEmbedding (k:ℝ) hs (a i j))*ellipticBound H hH < 1) + (he : (t^2:ℂ) • realize 2 u - frozenDifferential H (realize 2 u) - + ((perturbation v (fun i j => strongEmbedding (k:ℝ) hs (a i j)) u : L2 (EC n)) : 𝓢'(EC n,ℂ)) = + realize (k:ℝ) f) : + MemSobolev ((k:ℝ)+2) 2 (realize 2 u) := by + let f0 := lowerCoord (k:ℝ) 0 (Nat.cast_nonneg k) f + have hf0 : (f0 : 𝓢'(EC n,ℂ)) = realize (k:ℝ) f := by + have hh := realize_lowerCoord (k:ℝ) 0 (Nat.cast_nonneg k) f + simpa [realize,f0] using hh + have hu := fixed_of_differential_equation H hH t ht v _ u f0 (he.trans hf0.symm) + have heq := ParameterRegularity.fixed_unique H hH t ht v _ hsmall u + (parameterLocal H hH t ht v _ hsmall f0) f0 hu + (ParameterRegularity.parameterLocal_fixed H hH t ht v _ hsmall f0) + rw [heq] + exact ParameterRegularity.rough_local_memSobolev H hH t ht v k hk hs a f hsmall + +end FrozenPoisson + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/SchwartzHessianWords.lean b/lean/OAI/Geometry/PrescribedRicci/SchwartzHessianWords.lean new file mode 100644 index 0000000000000000000000000000000000000000..4d72f9c3a94c51021dbd7604214c72fb0e478f25 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/SchwartzHessianWords.lean @@ -0,0 +1,130 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.ComplexHessian +import OAI.Geometry.PrescribedPotential.CutoffHigher +import OAI.Geometry.PrescribedRicci.UniformSchwartz + +namespace OAI + +/-! Schwartz Hessian Words. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory LineDeriv +open scoped ContDiff SchwartzMap Classical +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +lemma schwartzWord_deriv (ws : List E) (v : E) (f : 𝓢(E,ℂ)) : + schwartzWord ws (∂_{v} f) = ∂_{v} (schwartzWord ws f) := by + induction ws with + | nil => rfl + | cons a ws ih => + change ∂_{a} (schwartzWord ws (∂_{v} f)) = ∂_{v} (∂_{a} (schwartzWord ws f)) + rw [ih,schwartz_deriv_comm] + +def wordSecondError (κ : 𝓢(E,ℂ)) (ws : List E) (a b : E) : + 𝓢(E,ℂ) → 𝓢(E,ℂ) := fun f => + SchwartzMap.smulLeftCLM ℂ (∂_{a} κ : 𝓢(E,ℂ)) (∂_{b} (schwartzWord ws f)) + + SchwartzMap.smulLeftCLM ℂ (∂_{b} κ : 𝓢(E,ℂ)) (∂_{a} (schwartzWord ws f)) + + SchwartzMap.smulLeftCLM ℂ (∂_{a} (∂_{b} κ) : 𝓢(E,ℂ)) (schwartzWord ws f) + +lemma wordSecondError_identity (κ f : 𝓢(E,ℂ)) (ws : List E) (a b : E) : + ∂_{a} (∂_{b} (SchwartzMap.smulLeftCLM ℂ κ (schwartzWord ws f))) = + SchwartzMap.smulLeftCLM ℂ κ (schwartzWord ws (∂_{a} (∂_{b} f))) + + wordSecondError κ ws a b f := by + rw [schwartz_second_product,schwartzWord_deriv,schwartzWord_deriv] + rfl + +lemma wordSecondError_bound (κ : 𝓢(E,ℂ)) (ws : List E) (a b : E) : + CoreBound ((ws.length:ℝ)+1) 0 (wordSecondError κ ws a b) := by + have hw : CoreBound ((ws.length:ℝ)+1) 1 (schwartzWord ws) := coreBound_word ws (by linarith) + have hd (v : E) : CoreBound ((ws.length:ℝ)+1) 0 (fun f => ∂_{v} (schwartzWord ws f)) := + (coreBound_deriv v (s:=1) (t:=0) (by norm_num)).comp hw + have h1 : CoreBound ((ws.length:ℝ)+1) 0 (fun f => + SchwartzMap.smulLeftCLM ℂ (∂_{a} κ : 𝓢(E,ℂ)) (∂_{b} (schwartzWord ws f))) := + (coreBound_product_zero (∂_{a} κ)).comp (hd b) + have h2 : CoreBound ((ws.length:ℝ)+1) 0 (fun f => + SchwartzMap.smulLeftCLM ℂ (∂_{b} κ : 𝓢(E,ℂ)) (∂_{a} (schwartzWord ws f))) := + (coreBound_product_zero (∂_{b} κ)).comp (hd a) + have h3 : CoreBound ((ws.length:ℝ)+1) 0 (fun f => + SchwartzMap.smulLeftCLM ℂ (∂_{a} (∂_{b} κ) : 𝓢(E,ℂ)) (schwartzWord ws f)) := + (coreBound_product_zero (∂_{a} (∂_{b} κ))).comp + (coreBound_word ws (by linarith : (0:ℝ) ≤ (ws.length:ℝ)+1-ws.length)) + exact (h1.add h2).add h3 + +lemma UniformSobolev.raise_one {Z : Type*} {s : ℝ} {F : Z → 𝓢(E,ℂ)} + (hF : UniformSobolev s F) + (hD : ∀ j, UniformSobolev s (fun z => ∂_{stdOrthonormalBasis ℝ E j} (F z))) : + UniformSobolev (s+1) F := by + obtain ⟨C,hC,hc⟩ := hF + choose B hB hb using hD + let c : ℝ := ‖(((2*Real.pi)^2:ℝ):ℂ)⁻¹‖ + refine ⟨‖raiseZero (E:=E) s‖*C+c*∑ j, ‖raiseDeriv s (stdOrthonormalBasis ℝ E j)‖*B j, + add_nonneg (mul_nonneg (norm_nonneg _) hC) + (mul_nonneg (norm_nonneg _) (Finset.sum_nonneg fun j _ => mul_nonneg (norm_nonneg _) (hB j))),fun z => ?_⟩ + rw [schwartzCoord_raise_one] + apply (norm_sub_le _ _).trans + rw [norm_smul] + apply add_le_add + · exact ((raiseZero s).le_opNorm _).trans (mul_le_mul_of_nonneg_left (hc z) (norm_nonneg _)) + · apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) + exact (norm_sum_le _ _).trans (Finset.sum_le_sum (fun j _ => + ((raiseDeriv s (stdOrthonormalBasis ℝ E j)).le_opNorm _).trans + (mul_le_mul_of_nonneg_left (hb j z) (norm_nonneg _)))) + +lemma UniformSobolev.of_words {Z : Type*} (k : ℕ) {s : ℝ} {F : Z → 𝓢(E,ℂ)} + (h : ∀ ws : List E, ws.length ≤ k → UniformSobolev s (fun z => schwartzWord ws (F z))) : + UniformSobolev (s+k) F := by + induction k generalizing F with + | zero => simpa [schwartzWord] using h [] (by simp) + | succ k ih => + have hv := ih (fun ws hw => h ws (by omega)) + have hd (j : Fin (Module.finrank ℝ E)) := ih + (F:=fun z => ∂_{stdOrthonormalBasis ℝ E j} (F z)) (fun ws hw => by + have hh := h (ws++[stdOrthonormalBasis ℝ E j]) (by simp only [List.length_append,List.length_cons,List.length_nil]; omega) + simpa only [schwartzWord_append,schwartzWord,ContinuousLinearMap.comp_apply, + ContinuousLinearMap.id_apply,lineDerivOpCLM_apply] using hh) + convert hv.raise_one hd using 1 + push_cast + ring +end SobolevChart + +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} + +lemma hessianEntrySchwartz_word (ws : List (EC d)) (i j : Fin d) (f : 𝓢(EC d,ℂ)) : + hessianEntrySchwartz i j (schwartzWord ws f) = schwartzWord ws (hessianEntrySchwartz i j f) := by + simp only [hessianEntrySchwartz,smul_apply,add_apply, + ContinuousLinearMap.comp_apply,lineDerivOpCLM_apply,map_add,map_smul,schwartzWord_deriv] + +def wordHessianError (κ : 𝓢(EC d,ℂ)) (ws : List (EC d)) (i j : Fin d) + (f : 𝓢(EC d,ℂ)) : 𝓢(EC d,ℂ) := + (1/4:ℂ) • (wordSecondError κ ws (hessianDirection i) (hessianDirection j) f + + wordSecondError κ ws (hessianIDirection i) (hessianIDirection j) f + + Complex.I • (wordSecondError κ ws (hessianIDirection i) (hessianDirection j) f + + (-1:ℂ) • wordSecondError κ ws (hessianDirection i) (hessianIDirection j) f)) + +lemma wordHessianError_identity (κ f : 𝓢(EC d,ℂ)) (ws : List (EC d)) (i j : Fin d) : + hessianEntrySchwartz i j (SchwartzMap.smulLeftCLM ℂ κ (schwartzWord ws f)) = + SchwartzMap.smulLeftCLM ℂ κ (schwartzWord ws (hessianEntrySchwartz i j f)) + + wordHessianError κ ws i j f := by + simp only [hessianEntrySchwartz,wordHessianError,smul_apply, + add_apply,ContinuousLinearMap.comp_apply,lineDerivOpCLM_apply, + wordSecondError_identity,map_add,map_smul] + module + +lemma wordHessianError_bound (κ : 𝓢(EC d,ℂ)) (ws : List (EC d)) (i j : Fin d) : + CoreBound ((ws.length:ℝ)+1) 0 (wordHessianError κ ws i j) := + ((wordSecondError_bound κ ws _ _).add (wordSecondError_bound κ ws _ _) |>.add + (((wordSecondError_bound κ ws _ _).add ((wordSecondError_bound κ ws _ _).smul (-1))).smul Complex.I)).smul (1/4) +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/SmoothLocalInverse.lean b/lean/OAI/Geometry/PrescribedRicci/SmoothLocalInverse.lean new file mode 100644 index 0000000000000000000000000000000000000000..b265dcfa3b2500b3429bd8059f380606f27f909c --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/SmoothLocalInverse.lean @@ -0,0 +1,106 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.SobolevExponential +import OAI.Geometry.PrescribedPotential.AugmentedVolume +import OAI.Geometry.PrescribedPotential.ClosedRangeSmooth + +namespace OAI + +/-! Smooth Local Inverse. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical +namespace ExponentialEvaluation +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] +lemma orbit_contDiff (L : E →L[ℝ] E) (v : E) : ContDiff ℝ ∞ (orbit L v) := by + have he : ContDiff ℝ ∞ (NormedSpace.exp : (E →L[ℝ] E) → (E →L[ℝ] E)) := + contDiff_iff_contDiffAt.mpr (fun w => (NormedSpace.exp_analytic (𝕂 := ℝ) w).contDiffAt) + exact (ContinuousLinearMap.apply ℝ E v).contDiff.comp + (he.comp (contDiff_id.smul contDiff_const)) +end ExponentialEvaluation +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) +local instance inverseRealNormedGroup (s : ℝ) : NormedAddCommGroup (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedAddCommGroup +local instance inverseRealNormedSpace (s : ℝ) : NormedSpace ℝ (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedSpace +local instance inverseRealTopologicalGroup (s : ℝ) : IsTopologicalAddGroup (D.localizers.RealSobolev s) := + Submodule.isTopologicalAddGroup _ +local instance inverseRealContinuousSMul (s : ℝ) : ContinuousSMul ℝ (D.localizers.RealSobolev s) := + SMulMemClass.continuousSMul _ + +omit [ConnectedSpace X] in +lemma exponentialDensity_contDiff (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (F : RealSmooth A) : ContDiff ℝ ∞ (D.exponentialDensity k hk F) := + ExponentialEvaluation.orbit_contDiff _ _ + + +theorem exists_volume_localInverse (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) (x₀ : X) : + ∃ R : (D.localizers.RealSobolev (k : ℝ) × ℝ) → + (D.localizers.RealSobolev ((k : ℝ)+2) × ℝ), + R (D.realConstants (k : ℝ) 1,0) = 0 ∧ + ContDiffAt ℝ ∞ R (D.realConstants (k : ℝ) 1,0) ∧ + (∀ᶠ y in 𝓝 (D.realConstants (k : ℝ) 1,0), D.augmentedVolume k hk x₀ (R y) = y) ∧ + (∀ᶠ u in 𝓝 0, R (D.augmentedVolume k hk x₀ u) = u) := by + obtain ⟨m,hm,he⟩ := D.exists_completedError_small + obtain ⟨P⟩ := D.localizers.constantProjection_exists + have hs : (Module.finrank ℝ (EC d) : ℝ) < 2*((k : ℝ)+2) := by + have hh : (Module.finrank ℝ (EC d) : ℝ) < (k : ℝ) := by exact_mod_cast hk + linarith [Nat.cast_nonneg (α := ℝ) k] + let L := D.realPoissonEquiv m hm he P k hs x₀ + have hL : HasFDerivAt (D.augmentedVolume k hk x₀) (L : _ →L[ℝ] _) 0 := + (D.augmentedVolume_hasStrictFDerivAt_zero k hk x₀).hasFDerivAt + have hf := (D.augmentedVolume_contDiff k hk x₀).contDiffAt (x := 0) + have hn : (∞ : ℕ∞ω) ≠ 0 := by simp + let R := hf.localInverse hL hn + refine ⟨R,?_,?_,?_,?_⟩ + · simpa only [D.augmentedVolume_zero] using hf.localInverse_apply_image hL hn + · simpa only [D.augmentedVolume_zero] using hf.to_localInverse hL hn + · have hh : ∀ᶠ y in 𝓝 (D.augmentedVolume k hk x₀ 0), + D.augmentedVolume k hk x₀ (R y) = y := + (hf.hasStrictFDerivAt' hL hn).eventually_right_inverse + rwa [D.augmentedVolume_zero] at hh + · exact (hf.hasStrictFDerivAt' hL hn).eventually_left_inverse + + + +theorem exists_smooth_sobolev_path (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (x₀ : X) (F : RealSmooth A) : + ∃ γ : ℝ → D.localizers.RealSobolev ((k : ℝ)+2) × ℝ, + γ 0 = 0 ∧ ContDiffAt ℝ ∞ γ 0 ∧ + ∀ᶠ t in 𝓝 0, + D.realVolume k hk (γ t).1 = Real.exp (γ t).2 • D.exponentialDensity k hk F t ∧ + D.realEvaluation ((k : ℝ)+2) x₀ (γ t).1 = 0 := by + obtain ⟨R,hR,hr,hh,_⟩ := D.exists_volume_localInverse k hk x₀ + let f : ℝ → D.localizers.RealSobolev (k : ℝ) × ℝ := fun t => + (D.exponentialDensity k hk F t,0) + have hf : ContDiff ℝ ∞ f := (D.exponentialDensity_contDiff k hk F).prodMk contDiff_const + have hz : f 0 = (D.realConstants (k : ℝ) 1,0) := by + simp only [f,D.exponentialDensity_zero] + refine ⟨R ∘ f,by rw [Function.comp_apply,hz,hR],?_,?_⟩ + · apply ContDiffAt.comp 0 _ hf.contDiffAt + rwa [hz] + · have ht : Tendsto f (𝓝 0) (𝓝 (D.realConstants (k : ℝ) 1,0)) := by + simpa only [hz] using hf.continuous.tendsto 0 + filter_upwards [ht.eventually hh] with t ht + refine ⟨?_,congrArg Prod.snd ht⟩ + have he := congrArg (fun z => Real.exp (R (f t)).2 • z.1) ht + change Real.exp (R (f t)).2 • + (Real.exp (-(R (f t)).2) • D.realVolume k hk (R (f t)).1) = _ at he + simpa only [Function.comp_apply, f, smul_smul, ← Real.exp_add, add_neg_cancel, + Real.exp_zero, one_smul] using he +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/SmoothPathLimit.lean b/lean/OAI/Geometry/PrescribedRicci/SmoothPathLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..8bde6477ca4acd67ace5323aaf56ac6967e507c0 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/SmoothPathLimit.lean @@ -0,0 +1,84 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.PatchCutoffs +import OAI.Geometry.PrescribedPotential.RealSobolev +import OAI.Geometry.PrescribedPotential.GlobalHessian +import OAI.Geometry.PrescribedRicci.GlobalSmoothCompact +import OAI.Geometry.PrescribedRicci.PathUniformHigher + +namespace OAI + +/-! Smooth Path Limit. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff Classical ComplexOrder +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) + +lemma pointwise_of_sobolev (f : ℕ → Smooth A) (F : Smooth A) + (hlim : ∀ k : ℕ, Tendsto (fun n => D.localizers.embed (k:ℝ) (f n)) atTop + (𝓝 (D.localizers.embed (k:ℝ) F))) (x : X) : + Tendsto (fun n => f n x) atTop (𝓝 (F x)) := by + let k := Module.finrank ℝ (EC d)+1 + have hs : (Module.finrank ℝ (EC d):ℝ) < 2*(k:ℝ) := by + exact_mod_cast (by dsimp [k]; omega : Module.finrank ℝ (EC d) < 2*k) + have hl := ((D.localizers.strong (k:ℝ)).continuous.tendsto _).comp (hlim k) + simp only [Function.comp_def,D.localizers.strong_embed _ hs] at hl + exact ((BoundedContinuousFunction.lipschitz_eval_const x).continuous.tendsto _).comp hl + +lemma real_of_sobolev (f : ℕ → SmoothRealFunction A) (F : Smooth A) + (hlim : ∀ k : ℕ, Tendsto (fun n => D.localizers.embed (k:ℝ) (Smooth.ofReal (f n))) atTop + (𝓝 (D.localizers.embed (k:ℝ) F))) : ∀ x, (F x).im = 0 := by + intro x + have h := Complex.continuous_im.continuousAt.tendsto.comp (D.pointwise_of_sobolev _ F hlim x) + have hz : Tendsto (fun n => (Smooth.ofReal (f n) x).im) atTop (𝓝 (0:ℝ)) := tendsto_const_nhds + exact tendsto_nhds_unique h hz + +lemma hessian_of_sobolev (f : ℕ → SmoothRealFunction A) (φ : SmoothRealFunction A) + (hlim : ∀ k : ℕ, Tendsto (fun n => D.localizers.embed (k:ℝ) (Smooth.ofReal (f n))) atTop + (𝓝 (D.localizers.embed (k:ℝ) (Smooth.ofReal φ)))) + (p : ι) {x : X} (hx : x ∈ tsupport (D.localizers.weight p : X → ℂ)) (i j : Fin d) : + Tendsto (fun n => (f n).hessian (D.patch p).index (A.chart (D.patch p).index x) i j) + atTop (𝓝 (φ.hessian (D.patch p).index (A.chart (D.patch p).index x) i j)) := by + have hl (k : ℕ) := ((D.completedHessian k p i j).continuous.tendsto _).comp (show + Tendsto (fun n => D.localizers.embed ((k:ℝ)+2) (Smooth.ofReal (f n))) atTop + (𝓝 (D.localizers.embed ((k:ℝ)+2) (Smooth.ofReal φ))) from by + have h := hlim (k+2) + rw [Nat.cast_add,Nat.cast_ofNat] at h + exact h) + have hh (k : ℕ) : Tendsto (fun n => D.localizers.embed (k:ℝ) + (D.localizedHessian p i j (Smooth.ofReal (f n)))) atTop + (𝓝 (D.localizers.embed (k:ℝ) (D.localizedHessian p i j (Smooth.ofReal φ)))) := by + simpa only [Function.comp_def,D.completedHessian_embed] using hl k + have h := D.pointwise_of_sobolev _ _ hh x + simpa only [D.localizedHessian_source p i j _ hx] using h + +variable [ConnectedSpace X] +theorem path_smooth_subsequence (line : SemipositiveAnticanonicalMetric A) (hd : 2 ≤ d) + (z : ℕ → g.NormalizedPathSolution line) : + ∃ φ : SmoothRealFunction A, ∃ ν : ℕ → ℕ, StrictMono ν ∧ ∀ k : ℕ, + Tendsto (fun n => D.localizers.embed (k:ℝ) (Smooth.ofReal (z (ν n)).potential)) atTop + (𝓝 (D.localizers.embed (k:ℝ) (Smooth.ofReal φ))) := by + obtain ⟨F,ν,hν,hF⟩ := D.smooth_subsequence (fun n => Smooth.ofReal (z n).potential) + (fun k => by + obtain ⟨C,hC,hc⟩ := D.volumePath_uniform_all line hd k + exact ⟨C,hC,fun n => hc (z n)⟩) + let R : RealSmooth A := ⟨F,D.real_of_sobolev (fun n => (z (ν n)).potential) F hF⟩ + refine ⟨R.source,ν,hν,?_⟩ + rw [R.ofReal_source] + exact hF +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/SmoothPositivePath.lean b/lean/OAI/Geometry/PrescribedRicci/SmoothPositivePath.lean new file mode 100644 index 0000000000000000000000000000000000000000..669a73de3f3ec2c0794da6ee1d1a805b6e1cdfd4 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/SmoothPositivePath.lean @@ -0,0 +1,104 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.NonlinearScale +import OAI.Geometry.PrescribedPotential.PatchCutoffs +import OAI.Geometry.PrescribedPotential.RealSobolev +import OAI.Geometry.PrescribedPotential.TwoScaleRegularity +import OAI.Geometry.PrescribedPotential.WeakPositive +import OAI.Geometry.PrescribedRicci.FiniteCofactorPatch +import OAI.Geometry.PrescribedRicci.FixedCofactorBootstrap +import OAI.Geometry.PrescribedRicci.PositiveOpenness +import OAI.Geometry.PrescribedRicci.SmoothLocalInverse + +namespace OAI + +/-! Smooth Positive Path. -/ + +section + + + +noncomputable section +open Set Filter Topology +open scoped ContDiff Classical +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace RealSmooth + +def expAffine (F : RealSmooth A) (t b : ℝ) : RealSmooth A := ofReal { + value := fun x => Real.exp (t*F.source.value x+b) + smooth i := ((contDiffOn_const.mul (F.source.smooth i)).add contDiffOn_const).exp } + +omit [T2Space X] [CompactSpace X] [ConnectedSpace X] in +lemma expAffine_apply (F : RealSmooth A) (t b : ℝ) (x : X) : + (F.expAffine t b).val x = (Real.exp (t*F.source.value x+b) : ℂ) := rfl +end RealSmooth +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) +local instance smoothPathNG (s : ℝ) : NormedAddCommGroup (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedAddCommGroup +local instance smoothPathNS (s : ℝ) : NormedSpace ℝ (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedSpace +local instance smoothPathTG (s : ℝ) : IsTopologicalAddGroup (D.localizers.RealSobolev s) := + Submodule.isTopologicalAddGroup _ +local instance smoothPathCS (s : ℝ) : ContinuousSMul ℝ (D.localizers.RealSobolev s) := + SMulMemClass.continuousSMul _ + +lemma exponentialDensity_embedViaEnergy (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (F : RealSmooth A) (t b : ℝ) : + Real.exp b • D.exponentialDensity k hk F t = D.localizers.realEmbed (k:ℝ) (F.expAffine t b) := by + have hs : (Module.finrank ℝ (EC d):ℝ) < 2*(k:ℝ) := by + have hh : (Module.finrank ℝ (EC d):ℝ) < (k:ℝ) := by exact_mod_cast hk + linarith only [hh,Nat.cast_nonneg (α:=ℝ) k] + apply Subtype.ext + apply D.localizers.strong_injective (k:ℝ) hs + ext x + change D.localizers.strong (k:ℝ) (Real.exp b • (D.exponentialDensity k hk F t).val) x = + D.localizers.strong (k:ℝ) (D.localizers.embed (k:ℝ) (F.expAffine t b).val) x + rw [ContinuousLinearMap.map_smul_of_tower,D.localizers.strong_embed _ hs] + simp only [BoundedContinuousFunction.smul_apply,D.exponentialDensity_strong, + Complex.real_smul] + change (Real.exp b:ℂ) * (Real.exp (t*F.source.value x):ℂ) = (F.expAffine t b).val x + rw [RealSmooth.expAffine_apply,Real.exp_add,Complex.ofReal_mul] + ring + +include D in + + +theorem smooth_positive_path_eventually (F : RealSmooth A) (x₀ : X) : + ∀ᶠ t : ℝ in 𝓝 0, ∃ (φ : SmoothRealFunction A) (b : ℝ), + g.PositivePotential φ ∧ φ.value x₀ = 0 ∧ + ∀ x, (g.potentialDensity φ).value x = Real.exp (t*F.source.value x+b) := by + let k := Module.finrank ℝ (EC d)+1 + have hk : Module.finrank ℝ (EC d) < k := by dsimp [k]; omega + have hk1 : Module.finrank ℝ (EC d) < k+1 := by omega + have hs : (Module.finrank ℝ (EC d):ℝ) < 2*((k+1:ℕ):ℝ) := by + dsimp [k]; push_cast; linarith only [Nat.cast_nonneg (α:=ℝ) (Module.finrank ℝ (EC d))] + obtain ⟨γ,hγ,hγc,hγeq⟩ := D.exists_smooth_sobolev_path (k+1) hk1 x₀ F + have hfst : Tendsto (fun t => (γ t).1) (𝓝 0) (𝓝 (0 : D.localizers.RealSobolev (((k+1:ℕ):ℝ)+2))) := by + simpa only [hγ,Prod.fst_zero] using hγc.continuousAt.fst.tendsto + have hval : Tendsto (fun t => (γ t).1.val) (𝓝 0) (𝓝 (0 : D.localizers.Sobolev (((k+1:ℕ):ℝ)+2))) := + continuous_subtype_val.tendsto 0 |>.comp hfst + filter_upwards [hγeq,hfst.eventually (D.weakPositive_nhds (k+1) hk1), + hval.eventually (D.cofactor_small_nhds (k+1) hk1 hs)] with t he hp hc + obtain ⟨hEq,hn⟩ := he + rw [D.exponentialDensity_embedViaEnergy] at hEq + obtain ⟨φ,hφ⟩ := D.cofactor_solution_smooth k hk hs (γ t).1 hc (F.expAffine t (γ t).2) hEq + refine ⟨φ.source,(γ t).2,?_,?_,?_⟩ + · rw [← hφ] at hp + exact (D.weakPositive_embed_iffViaEnergy (k+1) hk1 φ).mp hp + · rw [← hφ,D.realEvaluation_embed (by linarith only [hs] : (Module.finrank ℝ (EC d):ℝ) < 2*(((k+1:ℕ):ℝ)+2))] at hn + exact hn + · rw [← hφ,D.realVolume_embed] at hEq + have hcore := D.localizers.embed_injective ((k+1:ℕ):ℝ) (congrArg Subtype.val hEq) + intro x + have hv := congrArg (fun f : Smooth A => (f x).re) hcore + exact hv +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/SobolevCommutatorBound.lean b/lean/OAI/Geometry/PrescribedRicci/SobolevCommutatorBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..f7a9ce209045e971580bbad621f63e313af2f352 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/SobolevCommutatorBound.lean @@ -0,0 +1,165 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.SobolevProduct + +namespace OAI + +/-! Sobolev Commutator Bound. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory TemperedDistribution LineDeriv +open scoped SchwartzMap BoundedContinuousFunction ContDiff Classical +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +lemma product_words_asymmetric_bound (s t : ℝ) (p q : List E) + (hp : (p.length : ℝ) ≤ s) (hq : (q.length : ℝ) ≤ t) + (hd : (Module.finrank ℝ E : ℝ) < (s-p.length)+(t-q.length)) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ f g : 𝓢(E,ℂ), + ‖schwartzCoord 0 (SchwartzMap.smulLeftCLM ℂ (schwartzWord p f) (schwartzWord q g))‖ ≤ + C * (‖schwartzCoord s f‖ * ‖schwartzCoord t g‖) := by + have base (s t : ℝ) (p q : List E) (hq : (q.length : ℝ) ≤ t) + (hd : (Module.finrank ℝ E : ℝ) < 2*(s-p.length)) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ f g : 𝓢(E,ℂ), + ‖schwartzCoord 0 (SchwartzMap.smulLeftCLM ℂ (schwartzWord p f) (schwartzWord q g))‖ ≤ + C * (‖schwartzCoord s f‖ * ‖schwartzCoord t g‖) := by + obtain ⟨C,hC,hc⟩ := schwartz_word_sup_bound p s hd + obtain ⟨D,hD,hd⟩ := coreBound_word q (s:=t) (t:=0) (by linarith) + refine ⟨C*D,mul_nonneg hC hD,fun f g => ?_⟩ + rw [schwartzCoord_product_zero] + exact (multiply_norm_le _ _).trans (by + have h := mul_le_mul (hc f) (hd g) (norm_nonneg _) (mul_nonneg hC (norm_nonneg _)) + convert h using 1 + ring) + by_cases h : (Module.finrank ℝ E : ℝ) < 2*(s-p.length) + · exact base s t p q hq h + · obtain ⟨C,hC,hb⟩ := base t s q p hp (by linarith) + refine ⟨C,hC,fun f g => ?_⟩ + rw [schwartz_product_swap] + simpa only [mul_comm] using hb g f + + + +lemma second_order_commutator_product_bound (k : ℕ) + (hk : Module.finrank ℝ E + 1 < k) (p q : List E) + (hp : 0 < p.length) (hpq : p.length+q.length ≤ k) (v w : E) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ a f : 𝓢(E,ℂ), + ‖schwartzCoord 0 (SchwartzMap.smulLeftCLM ℂ (schwartzWord p a) + (∂_{v} (∂_{w} (schwartzWord q f))))‖ ≤ + C * (‖schwartzCoord (k:ℝ) a‖ * ‖schwartzCoord ((k:ℝ)+1) f‖) := by + have h := product_words_asymmetric_bound (E:=E) (k:ℝ) ((k:ℝ)+1) p (v::w::q) + (by exact_mod_cast (show p.length ≤ k by omega)) + (by simp only [List.length_cons]; exact_mod_cast (show q.length+1+1 ≤ k+1 by omega)) + (by + simp only [List.length_cons,Nat.cast_add,Nat.cast_one] + have h1 : (Module.finrank ℝ E:ℝ)+1 < k := by exact_mod_cast hk + have h2 : (p.length:ℝ)+q.length ≤ k := by exact_mod_cast hpq + linarith) + exact h + + + +def commutatorWords : List E → List (List E × List E) + | [] => [] + | v::ws => ( [v],ws ) :: + ((commutatorWords ws).map (fun t => (v::t.1,t.2)) ++ + (commutatorWords ws).map (fun t => (t.1,v::t.2))) + +omit [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] + [MeasurableSpace E] [BorelSpace E] in +lemma commutatorWords_orders (ws : List E) (t : List E × List E) + (ht : t ∈ commutatorWords ws) : + 0 < t.1.length ∧ t.1.length+t.2.length = ws.length := by + induction ws generalizing t with + | nil => simp [commutatorWords] at ht + | cons v ws ih => + simp only [commutatorWords,List.mem_cons,List.mem_append,List.mem_map] at ht + rcases ht with rfl | ⟨t,ht,rfl⟩ | ⟨t,ht,rfl⟩ + · simp [Nat.add_comm] + · obtain ⟨h1,h2⟩ := ih t ht + simp only [List.length_cons] + omega + · obtain ⟨h1,h2⟩ := ih t ht + simp only [List.length_cons] + omega + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma schwartz_word_product_commutator (ws : List E) (a f : 𝓢(E,ℂ)) : + schwartzWord ws (SchwartzMap.smulLeftCLM ℂ a f) = + SchwartzMap.smulLeftCLM ℂ a (schwartzWord ws f) + + ((commutatorWords ws).map (fun t => + SchwartzMap.smulLeftCLM ℂ (schwartzWord t.1 a) (schwartzWord t.2 f))).sum := by + induction ws with + | nil => simp [schwartzWord,commutatorWords] + | cons v ws ih => + change ∂_{v} (schwartzWord ws (SchwartzMap.smulLeftCLM ℂ a f)) = _ + rw [ih,lineDerivOp_add,schwartz_deriv_product] + have he : ∂_{v} (((commutatorWords ws).map (fun t => + SchwartzMap.smulLeftCLM ℂ (schwartzWord t.1 a) (schwartzWord t.2 f))).sum) = + ((commutatorWords ws).map (fun t => ∂_{v} + (SchwartzMap.smulLeftCLM ℂ (schwartzWord t.1 a) (schwartzWord t.2 f)))).sum := + (List.sum_map_hom _ _ (lineDerivOpCLM ℂ 𝓢(E,ℂ) v)).symm + rw [he] + simp only [schwartz_deriv_product,list_sum_add,commutatorWords,List.map_cons, + List.sum_cons,List.map_append,List.sum_append,List.map_map,Function.comp_def, + schwartzWord,ContinuousLinearMap.comp_apply,ContinuousLinearMap.id_apply, + lineDerivOpCLM_apply] + abel + +lemma second_order_commutator_bound (k : ℕ) (hk : Module.finrank ℝ E + 1 < k) + (ws : List E) (hws : ws.length ≤ k) (v w : E) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ a f : 𝓢(E,ℂ), + ‖schwartzCoord 0 (schwartzWord ws + (SchwartzMap.smulLeftCLM ℂ a (∂_{v} (∂_{w} f))) - + SchwartzMap.smulLeftCLM ℂ a (∂_{v} (∂_{w} (schwartzWord ws f))))‖ ≤ + C * (‖schwartzCoord (k:ℝ) a‖ * ‖schwartzCoord ((k:ℝ)+1) f‖) := by + have hcomm (q : List E) (f : 𝓢(E,ℂ)) : + schwartzWord q (∂_{v} (∂_{w} f)) = ∂_{v} (∂_{w} (schwartzWord q f)) := by + rw [GlobalElliptic.word_deriv_comm,GlobalElliptic.word_deriv_comm] + have hb (t : List E × List E) (ht : t ∈ commutatorWords ws) := + second_order_commutator_product_bound k hk t.1 t.2 + (commutatorWords_orders ws t ht).1 + (by rw [(commutatorWords_orders ws t ht).2]; exact hws) v w + classical + let C : List E × List E → ℝ := fun t => + if ht : t ∈ commutatorWords ws then (hb t ht).choose else 0 + have hC (t) (ht : t ∈ commutatorWords ws) : 0 ≤ C t := by + simp only [C,dite_eq_left ht] + exact (hb t ht).choose_spec.1 + have hB (t) (ht : t ∈ commutatorWords ws) (a f : 𝓢(E,ℂ)) : + ‖schwartzCoord 0 (SchwartzMap.smulLeftCLM ℂ (schwartzWord t.1 a) + (∂_{v} (∂_{w} (schwartzWord t.2 f))))‖ ≤ + C t * (‖schwartzCoord (k:ℝ) a‖ * ‖schwartzCoord ((k:ℝ)+1) f‖) := by + simp only [C,dite_eq_left ht] + exact (hb t ht).choose_spec.2 a f + refine ⟨((commutatorWords ws).map C).sum,List.sum_nonneg (by simpa only + [List.mem_map,forall_exists_index,and_imp,forall_apply_eq_imp_iff₂] using hC),fun a f => ?_⟩ + rw [schwartz_word_product_commutator,hcomm,add_sub_cancel_left,schwartzCoord_list_sum] + simp_rw [hcomm] + calc + _ ≤ ((commutatorWords ws).map (fun t => ‖schwartzCoord 0 + (SchwartzMap.smulLeftCLM ℂ (schwartzWord t.1 a) (∂_{v} (∂_{w} (schwartzWord t.2 f))))‖)).sum := + by + induction commutatorWords ws with + | nil => simp + | cons t ts ih => + simp only [List.map_cons,List.sum_cons] + exact (norm_add_le _ _).trans (add_le_add le_rfl ih) + _ ≤ ((commutatorWords ws).map (fun t => C t * + (‖schwartzCoord (k:ℝ) a‖ * ‖schwartzCoord ((k:ℝ)+1) f‖))).sum := + List.sum_le_sum (fun t ht => hB t ht a f) + _ = _ := by + induction commutatorWords ws with + | nil => simp + | cons t ts ih => simp only [List.map_cons,List.sum_cons,ih,add_mul] + +end SobolevChart + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/SobolevFamilyBounds.lean b/lean/OAI/Geometry/PrescribedRicci/SobolevFamilyBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..8a91b0e4b7653a07bb8a9bdaab0f1f5b7f7c2cc0 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/SobolevFamilyBounds.lean @@ -0,0 +1,74 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.IntegerBounds + +namespace OAI + +/-! Sobolev Family Bounds. -/ + +noncomputable section +open Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory TemperedDistribution LineDeriv +open scoped SchwartzMap ContDiff Classical Laplacian +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +def FamilyBound {α : Type*} (t : ℝ) (R : α → ℝ) (T : α → 𝓢(E,ℂ)) : Prop := + ∃ C : ℝ, 0 ≤ C ∧ ∀ x, ‖schwartzCoord t (T x)‖ ≤ C * R x + +lemma familyBound_raise_one {t : ℝ} {α : Type*} {R : α → ℝ} (T : α → 𝓢(E, ℂ)) + (hT : FamilyBound t R T) + (hD : ∀ j, FamilyBound t R (fun f => ∂_{stdOrthonormalBasis ℝ E j} (T f))) : + FamilyBound (t + 1) R T := by + obtain ⟨C, hC, hc⟩ := hT + choose D hD0 hdb using hD + let c : ℝ := ‖(((2 * Real.pi)^2 : ℝ) : ℂ)⁻¹‖ + refine ⟨‖raiseZero (E := E) t‖ * C + c * ∑ j, ‖raiseDeriv t (stdOrthonormalBasis ℝ E j)‖ * D j, + add_nonneg (mul_nonneg (norm_nonneg _) hC) + (mul_nonneg (norm_nonneg _) (Finset.sum_nonneg (fun j _ => mul_nonneg (norm_nonneg _) (hD0 j)))), fun f => ?_⟩ + rw [schwartzCoord_raise_one] + calc + _ ≤ ‖raiseZero t (schwartzCoord t (T f))‖ + + c * ‖∑ j, raiseDeriv t (stdOrthonormalBasis ℝ E j) + (schwartzCoord t (∂_{stdOrthonormalBasis ℝ E j} (T f)))‖ := by + simpa only [norm_smul] using norm_sub_le + (raiseZero t (schwartzCoord t (T f))) + ((((2 * Real.pi)^2 : ℝ) : ℂ)⁻¹ • ∑ j, raiseDeriv t (stdOrthonormalBasis ℝ E j) + (schwartzCoord t (∂_{stdOrthonormalBasis ℝ E j} (T f)))) + _ ≤ (‖raiseZero (E := E) t‖ * C) * R f + + c * ∑ j, (‖raiseDeriv t (stdOrthonormalBasis ℝ E j)‖ * D j) * R f := by + apply add_le_add + · exact ((raiseZero t).le_opNorm _).trans (by + simpa only [mul_assoc] using + (mul_le_mul_of_nonneg_left (hc f) (norm_nonneg (raiseZero (E := E) t)))) + · apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) + apply (norm_sum_le _ _).trans + apply Finset.sum_le_sum + intro j _ + exact ((raiseDeriv t (stdOrthonormalBasis ℝ E j)).le_opNorm _).trans (by + simpa only [mul_assoc] using mul_le_mul_of_nonneg_left (hdb j f) + (norm_nonneg (raiseDeriv t (stdOrthonormalBasis ℝ E j)))) + _ = _ := by rw [← Finset.sum_mul]; ring + +lemma familyBound_of_words_integer (k : ℕ) {t : ℝ} {α : Type*} {R : α → ℝ} (T : α → 𝓢(E, ℂ)) + (h : ∀ ws : List E, ws.length ≤ k → FamilyBound t R (fun f => schwartzWord ws (T f))) : + FamilyBound (t + k) R T := by + induction k generalizing T with + | zero => simpa [schwartzWord] using h [] (by simp) + | succ k ih => + have ht := ih T (fun ws hw => h ws (by omega)) + have hd (j : Fin (Module.finrank ℝ E)) := ih + (fun f => ∂_{stdOrthonormalBasis ℝ E j} (T f)) + (fun ws hw => by + have hh := h (ws ++ [stdOrthonormalBasis ℝ E j]) + (by simp only [List.length_append, List.length_cons, List.length_nil]; omega) + simpa only [schwartzWord_append, schwartzWord, ContinuousLinearMap.comp_apply, + ContinuousLinearMap.id_apply, lineDerivOpCLM_apply] using hh) + convert familyBound_raise_one T ht hd using 1 + push_cast + ring + +end SobolevChart + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/SobolevInterpolation.lean b/lean/OAI/Geometry/PrescribedRicci/SobolevInterpolation.lean new file mode 100644 index 0000000000000000000000000000000000000000..52a6ea0b0a26ee9e29d16362d94b08f05e7b9af5 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/SobolevInterpolation.lean @@ -0,0 +1,119 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.CoreBounds + +namespace OAI + +/-! Sobolev Interpolation. -/ + +noncomputable section +open Set Filter Topology MeasureTheory FourierTransform TemperedDistribution +open scoped SchwartzMap BoundedContinuousFunction ContDiff Classical +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +lemma rpow_epsilon_bound (r s t : ℝ) (hst : s < t) {ε : ℝ} (hε : 0 < ε) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ x : ℝ, 1 ≤ x → + x^(s/2) ≤ ε*x^(t/2)+C*x^(r/2) := by + have htend : Tendsto (fun x : ℝ => x^((s-t)/2)) atTop (nhds 0) := by + convert tendsto_rpow_neg_atTop (show 0 < (t-s)/2 by linarith) using 1 + funext x + congr 1 + ring + obtain ⟨R,hR⟩ := eventually_atTop.mp (htend.eventually (gt_mem_nhds hε)) + let B : ℝ := max 1 R + have hc : ContinuousOn (fun x : ℝ => x^((s-r)/2)) (Icc 1 B) := by + apply ContinuousOn.rpow_const continuousOn_id + intro x hx + left + change x ≠ 0 + linarith [hx.1] + obtain ⟨C,hC⟩ := isCompact_Icc.exists_bound_of_continuousOn hc + refine ⟨max 0 C,le_max_left _ _,fun x hx => ?_⟩ + have hx0 : 0 < x := by linarith + have he (a b : ℝ) : x^((a-b)/2)*x^(b/2)=x^(a/2) := by + rw [← Real.rpow_add hx0] + congr 1 + ring + by_cases hxb : x ≤ B + · have hb := hC x ⟨hx,hxb⟩ + rw [Real.norm_eq_abs,abs_of_nonneg (Real.rpow_nonneg hx0.le _)] at hb + have hmul := mul_le_mul_of_nonneg_right (hb.trans (le_max_right 0 C)) + (Real.rpow_nonneg hx0.le (r/2)) + rw [he s r] at hmul + exact hmul.trans (le_add_of_nonneg_left (mul_nonneg hε.le (Real.rpow_nonneg hx0.le _))) + · have ht := (hR x ((le_max_right 1 R).trans (le_of_not_ge hxb))) + have hmul := mul_le_mul_of_nonneg_right ht.le (Real.rpow_nonneg hx0.le (t/2)) + rw [he s t] at hmul + exact hmul.trans (le_add_of_nonneg_right (mul_nonneg (le_max_left _ _) (Real.rpow_nonneg hx0.le _))) + +def weightedFourier (s : ℝ) (f : 𝓢(E,ℂ)) : 𝓢(E,ℂ) := + SchwartzMap.smulLeftCLM ℂ (fun x : E => ((1+‖x‖^2)^(s/2):ℝ)) (𝓕 f) + +lemma weightedFourier_apply (s : ℝ) (f : 𝓢(E,ℂ)) (x : E) : + weightedFourier s f x = (((1+‖x‖^2)^(s/2):ℝ):ℂ) * 𝓕 f x := by + rw [weightedFourier,SchwartzMap.smulLeftCLM_apply_apply (by fun_prop)] + rfl + +lemma fourier_schwartzCoord (s : ℝ) (f : 𝓢(E,ℂ)) : + 𝓕 (schwartzCoord s f) = SchwartzMap.toLpCLM ℂ ℂ 2 volume (weightedFourier s f) := by + apply l2_injective + change ((𝓕 (schwartzCoord s f) : L2 E) : 𝓢'(E,ℂ)) = + (((weightedFourier s f).toLp 2 volume : L2 E) : 𝓢'(E,ℂ)) + rw [← Lp.fourier_toTemperedDistribution_eq,schwartzCoord_distribution, + fourier_besselPotential_eq_smulLeftCLM_fourier_apply] + rw [Lp.toTemperedDistribution_toLp_eq] + rw [fourier_toTemperedDistributionCLM_eq] + ext q + simp only [smulLeftCLM_apply_apply,SchwartzMap.toTemperedDistributionCLM_apply_apply] + apply integral_congr_ae + filter_upwards [] with x + simp only [SchwartzMap.smulLeftCLM_apply_apply (by fun_prop : + (fun x : E => (((1+‖x‖^2)^(s/2):ℝ):ℂ)).HasTemperateGrowth), + weightedFourier_apply,smul_eq_mul] + ring + +lemma schwartzCoord_norm_weightedFourier (s : ℝ) (f : 𝓢(E,ℂ)) : + ‖schwartzCoord s f‖ = ‖SchwartzMap.toLpCLM ℂ ℂ 2 volume (weightedFourier s f)‖ := by + rw [← fourier_schwartzCoord,Lp.norm_fourier_eq] + +theorem schwartz_sobolev_interpolation (r s t : ℝ) (hst : s < t) + {ε : ℝ} (hε : 0 < ε) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ f : 𝓢(E,ℂ), + ‖schwartzCoord s f‖ ≤ ε*‖schwartzCoord t f‖+C*‖schwartzCoord r f‖ := by + obtain ⟨C,hC,hb⟩ := rpow_epsilon_bound r s t hst hε + refine ⟨C,hC,fun f => ?_⟩ + let W := fun a : ℝ => SchwartzMap.toLpCLM ℂ ℂ 2 volume (weightedFourier a f) + have hn : ‖W s‖ ≤ ‖(ε:ℂ) • W t+(C:ℂ) • W r‖ := by + apply Lp.norm_le_norm_of_ae_le + filter_upwards [(weightedFourier s f).coeFn_toLp (p:=2) (μ:=volume), + (weightedFourier t f).coeFn_toLp (p:=2) (μ:=volume), + (weightedFourier r f).coeFn_toLp (p:=2) (μ:=volume), + Lp.coeFn_add ((ε:ℂ) • W t) ((C:ℂ) • W r), + Lp.coeFn_smul (ε:ℂ) (W t), Lp.coeFn_smul (C:ℂ) (W r)] with x hs ht hr hadd hsm hsm' + change ‖W s x‖ ≤ _ + rw [hadd] + simp only [Pi.add_apply] + rw [hsm,hsm'] + change ‖SchwartzMap.toLpCLM ℂ ℂ 2 volume (weightedFourier s f) x‖ ≤ + ‖(ε:ℂ) * SchwartzMap.toLpCLM ℂ ℂ 2 volume (weightedFourier t f) x+ + (C:ℂ)*SchwartzMap.toLpCLM ℂ ℂ 2 volume (weightedFourier r f) x‖ + simp only [SchwartzMap.toLpCLM_apply] + rw [hs,ht,hr] + simp only [weightedFourier_apply] + simp only [← mul_assoc] + rw [← add_mul,← Complex.ofReal_mul,← Complex.ofReal_mul,← Complex.ofReal_add] + simp only [norm_mul,Complex.norm_real,Real.norm_eq_abs] + have hx : 0 ≤ 1+‖x‖^2 := by positivity + rw [abs_of_nonneg (Real.rpow_nonneg hx _),abs_of_nonneg (add_nonneg + (mul_nonneg hε.le (Real.rpow_nonneg hx _)) (mul_nonneg hC (Real.rpow_nonneg hx _)))] + exact mul_le_mul_of_nonneg_right (hb _ (by nlinarith [sq_nonneg ‖x‖])) (norm_nonneg _) + have hn' := hn.trans (norm_add_le _ _) + simp only [norm_smul,Complex.norm_real,Real.norm_eq_abs,abs_of_pos hε,abs_of_nonneg hC] at hn' + simpa only [W,← schwartzCoord_norm_weightedFourier] using hn' + +end SobolevChart + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/TameApproximation.lean b/lean/OAI/Geometry/PrescribedRicci/TameApproximation.lean new file mode 100644 index 0000000000000000000000000000000000000000..3026a519f4f6429f684b17f26019c1a65e73c433 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/TameApproximation.lean @@ -0,0 +1,119 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.TameStability + +namespace OAI + +/-! Tame Approximation. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory TemperedDistribution LineDeriv +open scoped SchwartzMap BoundedContinuousFunction ContDiff Classical ComplexOrder MatrixOrder +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] +variable {ι : Type*} [Fintype ι] + +lemma schwartzCoord_sub (s : ℝ) (f g : 𝓢(E,ℂ)) : + schwartzCoord s (f-g) = schwartzCoord s f-schwartzCoord s g := by + apply realize_injective s + simp only [map_sub,realize_schwartzCoord] + +lemma continuous_multiply : Continuous (fun p : (E →ᵇ ℂ) × L2 E => multiply p.1 p.2) := by + change Continuous (fun p : (E →ᵇ ℂ) × L2 E => + (ContinuousLinearMap.mul ℂ ℂ).holderL volume ⊤ 2 2 (boundedToLinf p.1) p.2) + fun_prop + +omit [Fintype ι] in +lemma continuous_perturbation_entry (v : ι → E) (i j : ι) : + Continuous (fun p : (ι → ι → E →ᵇ ℂ) × L2 E => + multiply (p.1 i j) (secondH2 (v i) (v j) p.2)) := by + have ha : Continuous (fun p : (ι → ι → E →ᵇ ℂ) × L2 E => p.1 i j) := + (continuous_apply j).comp ((continuous_apply i).comp continuous_fst) + have hu : Continuous (fun p : (ι → ι → E →ᵇ ℂ) × L2 E => + secondH2 (v i) (v j) p.2) := + (secondH2 (v i) (v j)).continuous.comp continuous_snd + change Continuous (fun p : (ι → ι → E →ᵇ ℂ) × L2 E => + (ContinuousLinearMap.mul ℂ ℂ).holderL volume ⊤ 2 2 + (boundedToLinf (p.1 i j)) (secondH2 (v i) (v j) p.2)) + exact (((ContinuousLinearMap.mul ℂ ℂ).holderL volume ⊤ 2 2).continuous.comp + (boundedToLinf.continuous.comp ha)).clm_apply hu + +lemma perturbation_apply_identity (v : ι → E) (a : ι → ι → E →ᵇ ℂ) (u : L2 E) : + perturbation v a u = ∑ i, ∑ j, multiply (a i j) (secondH2 (v i) (v j) u) := by + simp only [perturbation,_root_.sum_apply,ContinuousLinearMap.comp_apply] + +lemma continuous_perturbation (v : ι → E) : + Continuous (fun p : (ι → ι → E →ᵇ ℂ) × L2 E => perturbation v p.1 p.2) := by + simp only [perturbation_apply_identity] + exact continuous_finsetSum Finset.univ (fun i _ => + continuous_finsetSum Finset.univ (fun j _ => continuous_perturbation_entry v i j)) + +omit [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] [MeasurableSpace E] + [BorelSpace E] in +lemma continuous_perturbationBound (v : ι → E) : + Continuous (perturbationBound v) := by + unfold perturbationBound + fun_prop + +end SobolevChart +namespace FrozenPoisson.ParameterRegularity +open SobolevChart EllipticKernel +variable {n : ℕ} {ι : Type*} [Fintype ι] + +lemma tame_high_cauchy (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (t : ℝ) (ht : 1 ≤ t) (v : ι → EC n) (k : ℕ) + (hk : Module.finrank ℝ (EC n)+1 < k) (M : ℝ) (hM : 0 ≤ M) + (θ : ℝ) (hθ : θ < 1) (x : ℕ → TameData H t v k M θ (ellipticBound H hH)) + (hf : CauchySeq (fun l => schwartzCoord (k:ℝ) (x l).f)) + (ha : ∀ i j, CauchySeq (fun l => schwartzCoord (k:ℝ) ((x l).a i j))) : + CauchySeq (fun l => schwartzCoord ((k:ℝ)+2) (x l).u) := by + obtain ⟨J,hJ,hj⟩ := tame_solution_bound H hH t ht v k hk M hM θ hθ + obtain ⟨R,hR,hfR⟩ := hf.isBounded_range.exists_pos_norm_le + have hu (l : ℕ) : ‖schwartzCoord ((k:ℝ)+2) (x l).u‖ ≤ J*R := + (hj (x l)).trans (mul_le_mul_of_nonneg_left (hfR _ (mem_range_self l)) hJ) + obtain ⟨C,B,hC,hB,hcb⟩ := tame_stability H hH t ht v k hk M hM θ hθ + obtain ⟨bf,hbf,hbf',htf⟩ := cauchySeq_iff_le_tendsto_0.mp hf + choose ba hba hba' hta using fun i j => cauchySeq_iff_le_tendsto_0.mp (ha i j) + apply cauchySeq_of_le_tendsto_0 (fun N => C*(bf N+B*(∑ i, ∑ j, ba i j N)*(J*R))) + · intro l m N hl hm + have h0 := hcb (x l) (x m) + simp only [schwartzCoord_sub] at h0 + rw [dist_eq_norm] + apply h0.trans + apply mul_le_mul_of_nonneg_left _ hC + apply add_le_add + · simpa only [dist_eq_norm] using hbf' l m N hl hm + · have ha' : (∑ i, ∑ j, ‖schwartzCoord (k:ℝ) ((x l).a i j)- + schwartzCoord (k:ℝ) ((x m).a i j)‖) ≤ ∑ i, ∑ j, ba i j N := by + apply Finset.sum_le_sum + intro i _ + apply Finset.sum_le_sum + intro j _ + simpa only [dist_eq_norm] using hba' i j l m N hl hm + exact mul_le_mul (mul_le_mul_of_nonneg_left ha' hB) (hu m) (norm_nonneg _) + (mul_nonneg hB (Finset.sum_nonneg (fun i _ => Finset.sum_nonneg (fun j _ => hba i j N)))) + · have ha0 : Tendsto (fun N => ∑ i, ∑ j, ba i j N) atTop (nhds (0:ℝ)) := by + simpa using tendsto_finsetSum _ (fun i _ => tendsto_finsetSum _ (fun j _ => hta i j)) + simpa using (htf.add ((ha0.const_mul B).mul_const (J*R))).const_mul C + +lemma tame_data_low_equation (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (t : ℝ) (ht : 1 ≤ t) (v : ι → EC n) (k : ℕ) (M θ : ℝ) + (x : TameData H t v k M θ (ellipticBound H hH)) : + schwartzCoord 2 x.u = parameterHilbert H hH t ht + (schwartzCoord 0 x.f + perturbation v (coefficientBCF x.a) (schwartzCoord 2 x.u)) := by + have hh := congrArg (schwartzCoord 2) x.equation + have hr := schwartzCoord_resolvent H hH t ht 0 (x.f+smoothPerturbation v x.a x.u) + norm_num only [zero_add] at hr + rw [hr,schwartzCoord_add,schwartzCoord_perturbation] at hh + exact hh + +end FrozenPoisson.ParameterRegularity + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/TameCofactorGain.lean b/lean/OAI/Geometry/PrescribedRicci/TameCofactorGain.lean new file mode 100644 index 0000000000000000000000000000000000000000..857bd28ec9940138d23b8c00561e5f9cef1fe23f --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/TameCofactorGain.lean @@ -0,0 +1,125 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.CofactorWeakEquation +import OAI.Geometry.PrescribedPotential.GlobalCompletion +import OAI.Geometry.PrescribedRicci.RoughEllipticGain + +namespace OAI + +/-! Tame Cofactor Gain. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix _root_.MeasureTheory _root_.OAI.MeasureTheory TemperedDistribution +open scoped ContDiff SchwartzMap Classical BoundedContinuousFunction Matrix.Norms.Elementwise +namespace GlobalElliptic +open Anticanonical SourceSmooth EllipticKernel SobolevChart FrozenPoisson MetricLocalization +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + {A : ComplexAtlas d X} {ι : Type*} [Fintype ι] +namespace GluingData +variable {g : KaehlerMetric A} (D : GluingData g ι) +local instance tameCofactorGainNG (s : ℝ) : NormedAddCommGroup (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedAddCommGroup +local instance tameCofactorGainNS (s : ℝ) : NormedSpace ℝ (D.localizers.RealSobolev s) := + (D.localizers.realCompletion s).normedSpace +local instance tameCofactorGainTG (s : ℝ) : IsTopologicalAddGroup (D.localizers.RealSobolev s) := + Submodule.isTopologicalAddGroup _ +local instance tameCofactorGainCS (s : ℝ) : ContinuousSMul ℝ (D.localizers.RealSobolev s) := + SMulMemClass.continuousSMul _ + +lemma cofactor_local_gain (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (hs : (Module.finrank ℝ (EC d):ℝ) < 2*((k+1:ℕ):ℝ)) + (u : D.localizers.RealSobolev (((k+1:ℕ):ℝ)+2)) + (hu : D.CofactorSmall (k+1) (by omega) hs u.val) + (w : D.localizers.RealSobolev ((k:ℝ)+2)) + (F : D.localizers.RealSobolev ((k+1:ℕ):ℝ)) + (hF : D.realVolumeDerivative k hk + (D.localizers.realLower (((k+1:ℕ):ℝ)+2) ((k:ℝ)+2) (by push_cast; linarith) u) w = + D.localizers.realLower ((k+1:ℕ):ℝ) (k:ℝ) (by push_cast; linarith) F) (p : ι) : + MemSobolev (((k+1:ℕ):ℝ)+2) 2 (D.localizers.distribution ((k:ℝ)+2) p w.val) := by + let a := fun i j => D.cofactorLocal (k+1) (by omega) p i j u.val + let E := roughCutoff (D.patch p).matrix (k+1) (by omega) (D.weightCore p) a + (lowerCoord ((k:ℝ)+2) (((k+1:ℕ):ℝ)+1) (by push_cast; linarith) + (D.outerCompleted ((k:ℝ)+2) p w.val)) + let f : L2 (EC d) := lowerCoord ((k:ℝ)+2) ((k+1:ℕ):ℝ) (by push_cast; linarith) + (w.val.val p)-F.val.val p-E + let w₂ := lowerCoord ((k:ℝ)+2) 2 (by linarith [Nat.cast_nonneg (α:=ℝ) k]) (w.val.val p) + have he := D.cofactor_weak_equation k hk hs p u w + dsimp only [cofactorWeakLeft,cofactorWeakRight,Prod.fst,Prod.snd] at he + rw [hF] at he + have hFl : D.localizers.distribution (k:ℝ) p + ((D.localizers.realLower ((k+1:ℕ):ℝ) (k:ℝ) (by push_cast; linarith) F).val) = + D.localizers.distribution ((k+1:ℕ):ℝ) p F.val := + D.localizers.distribution_lower (by push_cast; linarith) p F.val + rw [hFl] at he + change frozenDifferential (D.patch p).matrix (realize ((k:ℝ)+2) (w.val.val p)) + + ((perturbation (stdOrthonormalBasis ℝ (EC d)) + (D.cofactorBCF (k+1) (by omega) hs p u.val) w₂ : L2 (EC d)) : 𝓢'(EC d,ℂ)) = + realize ((k+1:ℕ):ℝ) (F.val.val p) + realize ((k+1:ℕ):ℝ) E at he + have hx : (1^2:ℂ) • realize 2 w₂ - frozenDifferential (D.patch p).matrix (realize 2 w₂) - + ((perturbation (stdOrthonormalBasis ℝ (EC d)) + (fun i j => strongEmbedding ((k+1:ℕ):ℝ) hs (a i j)) w₂ : L2 (EC d)) : 𝓢'(EC d,ℂ)) = + realize ((k+1:ℕ):ℝ) f := by + simp only [one_pow,one_smul,f,map_sub,realize_lowerCoord,w₂] + change realize ((k:ℝ)+2) (w.val.val p) - + frozenDifferential (D.patch p).matrix (realize ((k:ℝ)+2) (w.val.val p)) - + ((perturbation (stdOrthonormalBasis ℝ (EC d)) (D.cofactorBCF (k+1) (by omega) hs p u.val) + (lowerCoord ((k:ℝ)+2) 2 (by linarith [Nat.cast_nonneg (α:=ℝ) k]) (w.val.val p)) : L2 (EC d)) : 𝓢'(EC d,ℂ)) = _ + rw [sub_sub,he] + abel + have hg := rough_equation_memSobolev (D.patch p).matrix (D.patch p).positive 1 le_rfl + (stdOrthonormalBasis ℝ (EC d)) (k+1) (by omega) hs a f w₂ (hu p) hx + simpa only [w₂,realize_lowerCoord,Localizers.distribution_apply] using hg + +lemma real_sobolev_of_local_order (k l : ℕ) (hkl : l ≤ k) + (w : D.localizers.RealSobolev (l:ℝ)) + (hw : ∀ p, MemSobolev (k:ℝ) 2 (D.localizers.distribution (l:ℝ) p w.val)) : + ∃ z : D.localizers.RealSobolev (k:ℝ), + D.localizers.realLower (k:ℝ) (l:ℝ) (by exact_mod_cast hkl) z = w := by + let w₀ := D.localizers.lower (l:ℝ) 0 w.val + have hh (p : ι) : MemSobolev (k:ℝ) 2 (D.localizers.distribution 0 p w₀) := by + rw [D.localizers.distribution_lower (Nat.cast_nonneg l)] + exact hw p + obtain ⟨z,hz⟩ := D.sobolev_of_local_order k w₀ hh + have he : D.localizers.lower (k:ℝ) (l:ℝ) z = w.val := by + apply D.localizers.lower_injective (Nat.cast_nonneg l) + rw [D.localizers.lower_lower (by exact_mod_cast hkl) (Nat.cast_nonneg l)] + exact hz + have hm := D.mem_real_of_lower k l hkl z (he.symm ▸ w.property) + exact ⟨⟨z,hm⟩,Subtype.ext he⟩ + +lemma real_sobolev_of_local_order_eq (k l : ℕ) (hkl : l ≤ k) (s t : ℝ) + (hs : (k:ℝ) = s) (ht : (l:ℝ) = t) + (w : D.localizers.RealSobolev t) + (hw : ∀ p, MemSobolev s 2 (D.localizers.distribution t p w.val)) : + ∃ z : D.localizers.RealSobolev s, + D.localizers.realLower s t (by rw [← hs,← ht]; exact_mod_cast hkl) z = w := by + subst s; subst t + exact D.real_sobolev_of_local_order k l hkl w hw + + + +theorem cofactor_global_gain (k : ℕ) (hk : Module.finrank ℝ (EC d) < k) + (hs : (Module.finrank ℝ (EC d):ℝ) < 2*((k+1:ℕ):ℝ)) + (u : D.localizers.RealSobolev (((k+1:ℕ):ℝ)+2)) + (hu : D.CofactorSmall (k+1) (by omega) hs u.val) + (w : D.localizers.RealSobolev ((k:ℝ)+2)) + (F : D.localizers.RealSobolev ((k+1:ℕ):ℝ)) + (hF : D.realVolumeDerivative k hk + (D.localizers.realLower (((k+1:ℕ):ℝ)+2) ((k:ℝ)+2) (by push_cast; linarith) u) w = + D.localizers.realLower ((k+1:ℕ):ℝ) (k:ℝ) (by push_cast; linarith) F) : + ∃ z : D.localizers.RealSobolev (((k+1:ℕ):ℝ)+2), + D.localizers.realLower (((k+1:ℕ):ℝ)+2) ((k:ℝ)+2) (by push_cast; linarith) z = w := by + exact D.real_sobolev_of_local_order_eq (k+3) (k+2) (by omega) + (((k+1:ℕ):ℝ)+2) ((k:ℝ)+2) (by push_cast; ring) (by push_cast; rfl) + w (D.cofactor_local_gain k hk hs u hu w F hF) + +end GluingData +end GlobalElliptic + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/TameLimit.lean b/lean/OAI/Geometry/PrescribedRicci/TameLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..f56fbc9602e6700b8ef4f57b79ff4f173adfbd7f --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/TameLimit.lean @@ -0,0 +1,91 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.SobolevReconstruction +import OAI.Geometry.PrescribedRicci.TameApproximation + +namespace OAI + +/-! Tame Limit. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory TemperedDistribution LineDeriv +open scoped SchwartzMap BoundedContinuousFunction ContDiff Classical ComplexOrder MatrixOrder +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] +variable {ι : Type*} [Fintype ι] + +omit [Fintype ι] in +lemma coefficientBCF_tendsto (k : ℝ) (hk : (Module.finrank ℝ E : ℝ) < 2*k) + (a : ℕ → SmoothCoefficients ι E) (b : ι → ι → L2 E) + (ha : ∀ i j, Tendsto (fun l => schwartzCoord k (a l i j)) atTop (nhds (b i j))) : + Tendsto (fun l => coefficientBCF (a l)) atTop + (nhds (fun i j => strongEmbedding k hk (b i j))) := by + apply tendsto_pi_nhds.mpr + intro i + apply tendsto_pi_nhds.mpr + intro j + have hh := ((strongEmbedding k hk).continuous.tendsto (b i j)).comp (ha i j) + simpa only [Function.comp_def,strongEmbedding_schwartz,coefficientBCF] using hh + +end SobolevChart +namespace FrozenPoisson.ParameterRegularity +open SobolevChart EllipticKernel +variable {n : ℕ} {ι : Type*} [Fintype ι] + +lemma tame_limit_equation (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (t : ℝ) (ht : 1 ≤ t) (v : ι → EC n) (k : ℕ) + (hk : (Module.finrank ℝ (EC n):ℝ) < 2*(k:ℝ)) (M θ : ℝ) + (x : ℕ → TameData H t v k M θ (ellipticBound H hH)) + (a : ι → ι → L2 (EC n)) (f u : L2 (EC n)) + (ha : ∀ i j, Tendsto (fun l => schwartzCoord (k:ℝ) ((x l).a i j)) atTop (nhds (a i j))) + (hf : Tendsto (fun l => schwartzCoord (k:ℝ) (x l).f) atTop (nhds f)) + (hu : Tendsto (fun l => schwartzCoord ((k:ℝ)+2) (x l).u) atTop (nhds u)) : + lowerCoord ((k:ℝ)+2) 2 (by simp) u = parameterHilbert H hH t ht + (lowerCoord (k:ℝ) 0 (Nat.cast_nonneg k) f + + perturbation v (fun i j => strongEmbedding (k:ℝ) hk (a i j)) + (lowerCoord ((k:ℝ)+2) 2 (by simp) u)) := by + have hf0 := ((lowerCoord (k:ℝ) 0 (Nat.cast_nonneg k)).continuous.tendsto f).comp hf + have hu2 := ((lowerCoord ((k:ℝ)+2) 2 (by simp)).continuous.tendsto u).comp hu + simp only [Function.comp_def,lowerCoord_schwartz] at hf0 hu2 + have ha0 := coefficientBCF_tendsto (k:ℝ) hk (fun l => (x l).a) a ha + have hp := ((continuous_perturbation v).tendsto + ((fun i j => strongEmbedding (k:ℝ) hk (a i j)), + lowerCoord ((k:ℝ)+2) 2 (by simp) u)).comp (ha0.prodMk_nhds hu2) + have hr := ((parameterHilbert H hH t ht).continuous.tendsto _).comp (hf0.add hp) + have he l := tame_data_low_equation H hH t ht v k M θ (x l) + simp only [Function.comp_def,← he] at hr + exact tendsto_nhds_unique hu2 hr + + + +theorem tame_limit_representation (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (t : ℝ) (ht : 1 ≤ t) (v : ι → EC n) (k : ℕ) + (hk : Module.finrank ℝ (EC n)+1 < k) + (hs : (Module.finrank ℝ (EC n):ℝ) < 2*(k:ℝ)) + (M : ℝ) (hM : 0 ≤ M) (θ : ℝ) (hθ : θ < 1) + (x : ℕ → TameData H t v k M θ (ellipticBound H hH)) + (a : ι → ι → L2 (EC n)) (f : L2 (EC n)) + (ha : ∀ i j, Tendsto (fun l => schwartzCoord (k:ℝ) ((x l).a i j)) atTop (nhds (a i j))) + (hf : Tendsto (fun l => schwartzCoord (k:ℝ) (x l).f) atTop (nhds f)) + (hsmall : perturbationBound v (fun i j => strongEmbedding (k:ℝ) hs (a i j))*ellipticBound H hH < 1) : + MemSobolev ((k:ℝ)+2) 2 (realize 2 (parameterLocal H hH t ht v + (fun i j => strongEmbedding (k:ℝ) hs (a i j)) hsmall (lowerCoord (k:ℝ) 0 (Nat.cast_nonneg k) f))) := by + have hc := tame_high_cauchy H hH t ht v k hk M hM θ hθ x hf.cauchySeq + (fun i j => (ha i j).cauchySeq) + obtain ⟨u,hu⟩ := cauchySeq_tendsto_of_complete hc + have he := tame_limit_equation H hH t ht v k hs M θ x a f u ha hf hu + have he' := fixed_unique H hH t ht v _ hsmall _ _ _ he + (parameterLocal_fixed H hH t ht v _ hsmall _) + rw [← he',realize_lowerCoord] + exact realize_memSobolev _ _ + +end FrozenPoisson.ParameterRegularity + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/TameLocalInverse.lean b/lean/OAI/Geometry/PrescribedRicci/TameLocalInverse.lean new file mode 100644 index 0000000000000000000000000000000000000000..97c4206e209375b0af5d011c1322ec3b97a56593 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/TameLocalInverse.lean @@ -0,0 +1,209 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.SobolevCommutatorBound +import OAI.Geometry.PrescribedRicci.SobolevFamilyBounds +import OAI.Geometry.PrescribedRicci.SobolevInterpolation + +namespace OAI + +/-! Tame Local Inverse. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory TemperedDistribution LineDeriv +open scoped SchwartzMap BoundedContinuousFunction ContDiff Classical ComplexOrder MatrixOrder +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] +variable {ι : Type*} [Fintype ι] + +lemma perturbation_commutator_bound (k : ℕ) (hk : Module.finrank ℝ E + 1 < k) + (ws : List E) (hws : ws.length ≤ k) (v : ι → E) {M : ℝ} (hM : 0 ≤ M) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ (a : SmoothCoefficients ι E), + (∀ i j, ‖schwartzCoord (k:ℝ) (a i j)‖ ≤ M) → ∀ u : 𝓢(E,ℂ), + ‖schwartzCoord 0 (schwartzWord ws (smoothPerturbation v a u) - + smoothPerturbation v a (schwartzWord ws u))‖ ≤ C * ‖schwartzCoord ((k:ℝ)+1) u‖ := by + choose C hC hB using fun i j => second_order_commutator_bound k hk ws hws (v i) (v j) + refine ⟨(∑ i, ∑ j, C i j)*M, mul_nonneg (Finset.sum_nonneg (fun i _ => + Finset.sum_nonneg (fun j _ => hC i j))) hM, fun a ha u => ?_⟩ + have he : schwartzWord ws (smoothPerturbation v a u) - + smoothPerturbation v a (schwartzWord ws u) = + ∑ i, ∑ j, (schwartzWord ws (SchwartzMap.smulLeftCLM ℂ (a i j) (∂_{v i} (∂_{v j} u))) - + SchwartzMap.smulLeftCLM ℂ (a i j) (∂_{v i} (∂_{v j} (schwartzWord ws u)))) := by + simp only [smoothPerturbation_apply,map_sum,Finset.sum_sub_distrib] + rw [he,schwartzCoord_sum] + simp_rw [schwartzCoord_sum] + calc + _ ≤ ∑ i, ∑ j, C i j * (M*‖schwartzCoord ((k:ℝ)+1) u‖) := by + apply (norm_sum_le _ _).trans + apply Finset.sum_le_sum + intro i _ + apply (norm_sum_le _ _).trans + apply Finset.sum_le_sum + intro j _ + exact (hB i j (a i j) u).trans (mul_le_mul_of_nonneg_left + (mul_le_mul_of_nonneg_right (ha i j) (norm_nonneg _)) (hC i j)) + _ = _ := by simp_rw [← Finset.sum_mul]; ring + +end SobolevChart + +namespace FrozenPoisson.ParameterRegularity +open SobolevChart EllipticKernel +variable {n : ℕ} {ι : Type*} [Fintype ι] + + + +structure TameData (H : Matrix (Fin n) (Fin n) ℂ) (t : ℝ) + (v : ι → EC n) (k : ℕ) (M θ E : ℝ) where + a : SmoothCoefficients ι (EC n) + f : 𝓢(EC n,ℂ) + u : 𝓢(EC n,ℂ) + coefficient_bound : ∀ i j, ‖schwartzCoord (k:ℝ) (a i j)‖ ≤ M + small : perturbationBound v (coefficientBCF a)*E ≤ θ + equation : u = schwartzResolvent H t (f + smoothPerturbation v a u) + +lemma tame_word_bound (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (t : ℝ) (ht : 1 ≤ t) (v : ι → EC n) (k : ℕ) + (hk : Module.finrank ℝ (EC n)+1 < k) (M : ℝ) (hM : 0 ≤ M) + (θ : ℝ) (hθ : θ < 1) (ws : List (EC n)) (hws : ws.length ≤ k) : + FamilyBound 2 (fun x : TameData H t v k M θ (ellipticBound H hH) => + ‖schwartzCoord (k:ℝ) x.f‖ + ‖schwartzCoord ((k:ℝ)+1) x.u‖) + (fun x => schwartzWord ws x.u) := by + have hw : (ws.length : ℝ) ≤ k := by exact_mod_cast hws + obtain ⟨C,hC,hc⟩ := coreBound_word ws (s:=(k:ℝ)) (t:=0) (by linarith) + obtain ⟨D,hD,hd⟩ := perturbation_commutator_bound k hk ws hws v hM + let B := ellipticBound H hH + have hB : 0 ≤ B := (ellipticBound_pos H hH).le + refine ⟨B*(C+D)/(1-θ),div_nonneg (mul_nonneg hB (add_nonneg hC hD)) (by linarith),fun x => ?_⟩ + let z := schwartzWord ws x.u + let e := schwartzWord ws (smoothPerturbation v x.a x.u)-smoothPerturbation v x.a z + have he : z = schwartzResolvent H t (smoothPerturbation v x.a z + + (schwartzWord ws x.f + e)) := by + have he := congrArg (schwartzWord ws) x.equation + rw [schwartz_word_resolvent ws H hH t ht,map_add] at he + change z = _ at he + apply he.trans + congr 1 + dsimp only [e] + abel + have hr := schwartzResolvent_bound H hH t ht + (smoothPerturbation v x.a z+(schwartzWord ws x.f+e)) + rw [← he,schwartzCoord_add,schwartzCoord_add] at hr + have hg := (norm_add_le (schwartzCoord 0 (smoothPerturbation v x.a z)) + (schwartzCoord 0 (schwartzWord ws x.f)+schwartzCoord 0 e)).trans + (add_le_add le_rfl (norm_add_le _ _)) + have hh := hr.trans (mul_le_mul_of_nonneg_left hg hB) + have hp := smoothPerturbation_bound v x.a z + have hf := hc x.f + have hc' := hd x.a x.coefficient_bound x.u + have hs := mul_le_mul_of_nonneg_right x.small (norm_nonneg (schwartzCoord 2 z)) + have hy : (1-θ)*‖schwartzCoord 2 z‖ ≤ + B*(C+D)*(‖schwartzCoord (k:ℝ) x.f‖+‖schwartzCoord ((k:ℝ)+1) x.u‖) := by + have h0 := mul_le_mul_of_nonneg_left hp hB + have h1 := mul_le_mul_of_nonneg_left hf hB + have h2 := mul_le_mul_of_nonneg_left hc' hB + change ‖schwartzCoord 0 e‖ ≤ _ at hc' + dsimp only [B] at * + nlinarith [mul_nonneg (mul_nonneg hB hC) (norm_nonneg (schwartzCoord ((k:ℝ)+1) x.u)), + mul_nonneg (mul_nonneg hB hD) (norm_nonneg (schwartzCoord (k:ℝ) x.f))] + rw [div_mul_eq_mul_div,le_div_iff₀ (show 0 < 1-θ by linarith)] + simpa only [z,mul_comm] using hy + +lemma tame_preestimate (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (t : ℝ) (ht : 1 ≤ t) (v : ι → EC n) (k : ℕ) + (hk : Module.finrank ℝ (EC n)+1 < k) (M : ℝ) (hM : 0 ≤ M) + (θ : ℝ) (hθ : θ < 1) : + FamilyBound ((k:ℝ)+2) (fun x : TameData H t v k M θ (ellipticBound H hH) => + ‖schwartzCoord (k:ℝ) x.f‖ + ‖schwartzCoord ((k:ℝ)+1) x.u‖) (fun x => x.u) := by + rw [add_comm] + exact familyBound_of_words_integer k _ (fun ws hws => tame_word_bound H hH t ht v k hk M hM θ hθ ws hws) + + + +theorem tame_estimate (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (t : ℝ) (ht : 1 ≤ t) (v : ι → EC n) (k : ℕ) + (hk : Module.finrank ℝ (EC n)+1 < k) (M : ℝ) (hM : 0 ≤ M) + (θ : ℝ) (hθ : θ < 1) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ x : TameData H t v k M θ (ellipticBound H hH), + ‖schwartzCoord ((k:ℝ)+2) x.u‖ ≤ + C*(‖schwartzCoord (k:ℝ) x.f‖+‖schwartzCoord 2 x.u‖) := by + obtain ⟨C,hC,hc⟩ := tame_preestimate H hH t ht v k hk M hM θ hθ + let D := C+1 + have hD : 0 < D := by dsimp [D]; linarith + let ε := (2*D)⁻¹ + have hε : 0 < ε := inv_pos.mpr (mul_pos (by norm_num) hD) + have he : D*ε = 1/2 := by dsimp [ε]; field_simp + obtain ⟨J,hJ,hj⟩ := schwartz_sobolev_interpolation (E:=EC n) 2 ((k:ℝ)+1) ((k:ℝ)+2) + (by linarith) hε + refine ⟨2*D*(1+J),by positivity,fun x => ?_⟩ + have h1 := hj x.u + have h0 := (hc x).trans (mul_le_mul_of_nonneg_right + (show C ≤ D by dsimp [D]; linarith) + (add_nonneg (norm_nonneg _) (norm_nonneg _))) + have h2 := mul_le_mul_of_nonneg_left h1 hD.le + have h3 : D*(ε*‖schwartzCoord ((k:ℝ)+2) x.u‖) = + (1/2)*‖schwartzCoord ((k:ℝ)+2) x.u‖ := by rw [← mul_assoc,he] + nlinarith [mul_nonneg (mul_nonneg hD.le hJ) (norm_nonneg (schwartzCoord (k:ℝ) x.f)), + mul_nonneg hD.le (norm_nonneg (schwartzCoord 2 x.u))] + +private lemma combine_estimate {a f u C B : ℝ} (hC : 0 ≤ C) + (h : a ≤ C*(f+u)) (hu : u ≤ B*f) : a ≤ C*(1+B)*f := by + have hh := mul_le_mul_of_nonneg_left hu hC + nlinarith + +lemma tame_low_estimate (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (t : ℝ) (ht : 1 ≤ t) (v : ι → EC n) (k : ℕ) (M θ : ℝ) (hθ : θ < 1) : + ∃ B : ℝ, 0 ≤ B ∧ ∀ x : TameData H t v k M θ (ellipticBound H hH), + ‖schwartzCoord 2 x.u‖ ≤ B*‖schwartzCoord (k:ℝ) x.f‖ := by + obtain ⟨J,hJ,hj⟩ := coreBound_word ([] : List (EC n)) (s:=(k:ℝ)) (t:=0) (by simp) + let B := ellipticBound H hH*J/(1-θ) + have hB : 0 ≤ B := div_nonneg (mul_nonneg (ellipticBound_pos H hH).le hJ) (by linarith) + refine ⟨B,hB,fun x => ?_⟩ + have hh := schwartzResolvent_bound H hH t ht (x.f+smoothPerturbation v x.a x.u) + rw [← x.equation,schwartzCoord_add] at hh + have hh' := hh.trans (mul_le_mul_of_nonneg_left (norm_add_le _ _) (ellipticBound_pos H hH).le) + have hp := mul_le_mul_of_nonneg_left (smoothPerturbation_bound v x.a x.u) (ellipticBound_pos H hH).le + have hsmall := mul_le_mul_of_nonneg_right x.small (norm_nonneg (schwartzCoord 2 x.u)) + have hforce := mul_le_mul_of_nonneg_left (hj x.f) (ellipticBound_pos H hH).le + dsimp only [B] + rw [div_mul_eq_mul_div,le_div_iff₀ (show 0 < 1-θ by linarith)] + simp only [schwartzWord,ContinuousLinearMap.id_apply] at hforce + nlinarith + + + +theorem tame_solution_bound (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (t : ℝ) (ht : 1 ≤ t) (v : ι → EC n) (k : ℕ) + (hk : Module.finrank ℝ (EC n)+1 < k) (M : ℝ) (hM : 0 ≤ M) + (θ : ℝ) (hθ : θ < 1) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ x : TameData H t v k M θ (ellipticBound H hH), + ‖schwartzCoord ((k:ℝ)+2) x.u‖ ≤ C*‖schwartzCoord (k:ℝ) x.f‖ := by + obtain ⟨C,hC,hc⟩ := tame_estimate H hH t ht v k hk M hM θ hθ + obtain ⟨B,hB,hb⟩ := tame_low_estimate H hH t ht v k M θ hθ + refine ⟨C*(1+B),mul_nonneg hC (by linarith),fun x => ?_⟩ + exact combine_estimate hC (hc x) (hb x) + + + +theorem tame_inverse_bound (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (t : ℝ) (ht : 1 ≤ t) (v : ι → EC n) (k : ℕ) + (hk : Module.finrank ℝ (EC n)+1 < k) (M : ℝ) (hM : 0 ≤ M) + (θ : ℝ) (hθ : θ < 1) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ (a : SmoothCoefficients ι (EC n)) + (_ha : ∀ i j, ‖schwartzCoord (k:ℝ) (a i j)‖ ≤ M) + (hs : perturbationBound v (coefficientBCF a)*ellipticBound H hH ≤ θ), + ∀ f : 𝓢(EC n,ℂ), ‖schwartzCoord ((k:ℝ)+2) + (schwartzLocal H hH t ht v a (hs.trans_lt hθ) f)‖ ≤ C*‖schwartzCoord (k:ℝ) f‖ := by + obtain ⟨C,hC,hc⟩ := tame_solution_bound H hH t ht v k hk M hM θ hθ + refine ⟨C,hC,fun a ha hs f => ?_⟩ + exact hc ⟨a,f,schwartzLocal H hH t ht v a (hs.trans_lt hθ) f,ha,hs, + schwartzLocal_fixed H hH t ht v a (hs.trans_lt hθ) f⟩ + +end FrozenPoisson.ParameterRegularity + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/TameRoughInverse.lean b/lean/OAI/Geometry/PrescribedRicci/TameRoughInverse.lean new file mode 100644 index 0000000000000000000000000000000000000000..0a18ef95ba6c5d5c1c4ba66d262113b4d39bd902 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/TameRoughInverse.lean @@ -0,0 +1,82 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.TameLimit + +namespace OAI + +/-! Tame Rough Inverse. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory TemperedDistribution LineDeriv +open scoped SchwartzMap BoundedContinuousFunction ContDiff Classical ComplexOrder MatrixOrder +namespace FrozenPoisson.ParameterRegularity +open SobolevChart EllipticKernel +variable {n : ℕ} {ι : Type*} [Fintype ι] + +lemma exists_tame_approximants (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (t : ℝ) (ht : 1 ≤ t) (v : ι → EC n) (k : ℕ) + (hs : (Module.finrank ℝ (EC n):ℝ) < 2*(k:ℝ)) + (a : ι → ι → L2 (EC n)) (f : L2 (EC n)) + (hsmall : perturbationBound v (fun i j => strongEmbedding (k:ℝ) hs (a i j))*ellipticBound H hH < 1) : + ∃ (M θ : ℝ) (_ : 0 ≤ M) (_ : θ < 1) + (x : ℕ → TameData H t v k M θ (ellipticBound H hH)), + (∀ i j, Tendsto (fun l => schwartzCoord (k:ℝ) ((x l).a i j)) atTop (nhds (a i j))) ∧ + Tendsto (fun l => schwartzCoord (k:ℝ) (x l).f) atTop (nhds f) := by + choose aa haa using fun i j => exists_schwartz_approx (k:ℝ) (a i j) + obtain ⟨ff,hff⟩ := exists_schwartz_approx (k:ℝ) f + let asq : ℕ → SmoothCoefficients ι (EC n) := fun l i j => aa i j l + let p := perturbationBound v (fun i j => strongEmbedding (k:ℝ) hs (a i j))*ellipticBound H hH + let θ := (p+1)/2 + have hθp : p < θ := by dsimp [θ,p]; linarith + have hθ : θ < 1 := by dsimp [θ,p]; linarith + have ha0 := coefficientBCF_tendsto (k:ℝ) hs asq a haa + have hp : Tendsto (fun l => perturbationBound v (coefficientBCF (asq l))*ellipticBound H hH) + atTop (nhds p) := ((continuous_perturbationBound v).tendsto _ |>.comp ha0).mul_const _ + have hsm : ∀ᶠ l in atTop, perturbationBound v (coefficientBCF (asq l))*ellipticBound H hH ≤ θ := + (hp.eventually (gt_mem_nhds hθp)).mono (fun _ h => h.le) + let M := (∑ i, ∑ j, ‖a i j‖)+1 + have hM : 0 ≤ M := by dsimp [M]; positivity + have hMa (i j : ι) : ‖a i j‖+1 ≤ M := by + have hij : ‖a i j‖ ≤ ∑ i, ∑ j, ‖a i j‖ := + (Finset.single_le_sum (fun l _ => norm_nonneg (a i l)) (Finset.mem_univ j)).trans + (Finset.single_le_sum (fun l _ => Finset.sum_nonneg (fun m _ => norm_nonneg (a l m))) (Finset.mem_univ i)) + exact add_le_add hij le_rfl + have hbd : ∀ᶠ l in atTop, ∀ i j, ‖schwartzCoord (k:ℝ) (asq l i j)‖ ≤ M := by + apply eventually_all.mpr + intro i + apply eventually_all.mpr + intro j + have hh := (haa i j).norm.eventually (gt_mem_nhds (show ‖a i j‖ < ‖a i j‖+1 by linarith)) + exact hh.mono (fun _ hl => hl.le.trans (hMa i j)) + obtain ⟨N,hN⟩ := eventually_atTop.mp (hbd.and hsm) + have hn (l : ℕ) := hN (l+N) (Nat.le_add_left N l) + let x (l : ℕ) : TameData H t v k M θ (ellipticBound H hH) := + ⟨asq (l+N),ff (l+N),schwartzLocal H hH t ht v (asq (l+N)) ((hn l).2.trans_lt hθ) (ff (l+N)), + (hn l).1,(hn l).2, + schwartzLocal_fixed H hH t ht v (asq (l+N)) ((hn l).2.trans_lt hθ) (ff (l+N))⟩ + refine ⟨M,θ,hM,hθ,x,fun i j => ?_,?_⟩ + · exact (haa i j).comp (tendsto_add_atTop_nat N) + · exact hff.comp (tendsto_add_atTop_nat N) + + + +theorem rough_local_memSobolev (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (t : ℝ) (ht : 1 ≤ t) (v : ι → EC n) (k : ℕ) + (hk : Module.finrank ℝ (EC n)+1 < k) + (hs : (Module.finrank ℝ (EC n):ℝ) < 2*(k:ℝ)) + (a : ι → ι → L2 (EC n)) (f : L2 (EC n)) + (hsmall : perturbationBound v (fun i j => strongEmbedding (k:ℝ) hs (a i j))*ellipticBound H hH < 1) : + MemSobolev ((k:ℝ)+2) 2 (realize 2 (parameterLocal H hH t ht v + (fun i j => strongEmbedding (k:ℝ) hs (a i j)) hsmall (lowerCoord (k:ℝ) 0 (Nat.cast_nonneg k) f))) := by + obtain ⟨M,θ,hM,hθ,x,ha,hf⟩ := exists_tame_approximants H hH t ht v k hs a f hsmall + exact tame_limit_representation H hH t ht v k hk hs M hM θ hθ x a f ha hf hsmall + +end FrozenPoisson.ParameterRegularity + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/TameStability.lean b/lean/OAI/Geometry/PrescribedRicci/TameStability.lean new file mode 100644 index 0000000000000000000000000000000000000000..33d3e77a30a4cc0f91650c9a3ee0fb514619190f --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/TameStability.lean @@ -0,0 +1,123 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.TameLocalInverse + +namespace OAI + +/-! Tame Stability. -/ + +section + + + +noncomputable section +open Set Filter Topology _root_.MeasureTheory _root_.OAI.MeasureTheory TemperedDistribution LineDeriv +open scoped SchwartzMap BoundedContinuousFunction ContDiff Classical ComplexOrder MatrixOrder +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] +variable {ι : Type*} [Fintype ι] + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma smoothPerturbation_coeff_sub (v : ι → E) (a b : SmoothCoefficients ι E) + (u : 𝓢(E,ℂ)) : smoothPerturbation v (a-b) u = + smoothPerturbation v a u - smoothPerturbation v b u := by + ext x + simp only [smoothPerturbation_apply,_root_.sum_apply,_root_.sub_apply, + Pi.sub_apply] + simp only [SchwartzMap.smulLeftCLM_apply_apply (a _ _).hasTemperateGrowth, + SchwartzMap.smulLeftCLM_apply_apply (b _ _).hasTemperateGrowth, + SchwartzMap.smulLeftCLM_apply_apply (a _ _ - b _ _).hasTemperateGrowth, + _root_.sub_apply,smul_eq_mul,sub_mul,Finset.sum_sub_distrib] + +lemma perturbation_high_bound (k : ℕ) (hk : Module.finrank ℝ E < k) (v : ι → E) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ (a : SmoothCoefficients ι E) (u : 𝓢(E,ℂ)), + ‖schwartzCoord (k:ℝ) (smoothPerturbation v a u)‖ ≤ + C * (∑ i, ∑ j, ‖schwartzCoord (k:ℝ) (a i j)‖) * + ‖schwartzCoord ((k:ℝ)+2) u‖ := by + obtain ⟨C,hC,hc⟩ := schwartz_sobolev_product_bound (E:=E) k hk + choose D hD hd using fun i j => coreBound_word [v i,v j] (s:=(k:ℝ)+2) (t:=(k:ℝ)) (by simp) + let B := ∑ i, ∑ j, D i j + have hB : 0 ≤ B := Finset.sum_nonneg (fun i _ => Finset.sum_nonneg (fun j _ => hD i j)) + have hDB (i j : ι) : D i j ≤ B := + (Finset.single_le_sum (fun l _ => hD i l) (Finset.mem_univ j)).trans + (Finset.single_le_sum (fun l _ => Finset.sum_nonneg (fun m _ => hD l m)) (Finset.mem_univ i)) + refine ⟨C*B,mul_nonneg hC hB,fun a u => ?_⟩ + rw [smoothPerturbation_apply,schwartzCoord_sum] + simp_rw [schwartzCoord_sum] + calc + _ ≤ ∑ i, ∑ j, C*B*‖schwartzCoord (k:ℝ) (a i j)‖*‖schwartzCoord ((k:ℝ)+2) u‖ := by + apply (norm_sum_le _ _).trans + apply Finset.sum_le_sum + intro i _ + apply (norm_sum_le _ _).trans + apply Finset.sum_le_sum + intro j _ + apply (hc (a i j) (∂_{v i} (∂_{v j} u))).trans + have hb := (hd i j u).trans (mul_le_mul_of_nonneg_right (hDB i j) (norm_nonneg _)) + change ‖schwartzCoord (k:ℝ) (∂_{v i} (∂_{v j} u))‖ ≤ _ at hb + have hh := mul_le_mul_of_nonneg_left hb (mul_nonneg hC (norm_nonneg (schwartzCoord (k:ℝ) (a i j)))) + convert hh using 1 <;> ring + _ = _ := by simp_rw [← Finset.sum_mul,← Finset.mul_sum] + +end SobolevChart +namespace FrozenPoisson.ParameterRegularity +open SobolevChart EllipticKernel +variable {n : ℕ} {ι : Type*} [Fintype ι] + +lemma tame_difference_equation (H : Matrix (Fin n) (Fin n) ℂ) (t : ℝ) + (v : ι → EC n) (k : ℕ) (M θ E : ℝ) (x y : TameData H t v k M θ E) : + x.u-y.u = schwartzResolvent H t + ((x.f-y.f+smoothPerturbation v (x.a-y.a) y.u) + smoothPerturbation v x.a (x.u-y.u)) := by + rw [smoothPerturbation_coeff_sub,map_sub] + have he : x.f-y.f+(smoothPerturbation v x.a y.u-smoothPerturbation v y.a y.u)+ + (smoothPerturbation v x.a x.u-smoothPerturbation v x.a y.u) = + (x.f+smoothPerturbation v x.a x.u)-(y.f+smoothPerturbation v y.a y.u) := by abel + rw [he,map_sub,← x.equation,← y.equation] + +lemma tame_difference_bound (H : Matrix (Fin n) (Fin n) ℂ) (t : ℝ) + (v : ι → EC n) (k : ℕ) (M θ E C : ℝ) + (hc : ∀ x : TameData H t v k M θ E, + ‖schwartzCoord ((k:ℝ)+2) x.u‖ ≤ C*‖schwartzCoord (k:ℝ) x.f‖) + (x y : TameData H t v k M θ E) : + ‖schwartzCoord ((k:ℝ)+2) (x.u-y.u)‖ ≤ C*‖schwartzCoord (k:ℝ) + (x.f-y.f+smoothPerturbation v (x.a-y.a) y.u)‖ := + hc ⟨x.a,x.f-y.f+smoothPerturbation v (x.a-y.a) y.u,x.u-y.u, + x.coefficient_bound,x.small,tame_difference_equation H t v k M θ E x y⟩ + +lemma high_forcing_difference_bound (k : ℕ) (v : ι → EC n) (B : ℝ) + (hb : ∀ (a : SmoothCoefficients ι (EC n)) (u : 𝓢(EC n,ℂ)), + ‖schwartzCoord (k:ℝ) (smoothPerturbation v a u)‖ ≤ + B*(∑ i, ∑ j, ‖schwartzCoord (k:ℝ) (a i j)‖)*‖schwartzCoord ((k:ℝ)+2) u‖) + (a b : SmoothCoefficients ι (EC n)) (f g u : 𝓢(EC n,ℂ)) : + ‖schwartzCoord (k:ℝ) (f-g+smoothPerturbation v (a-b) u)‖ ≤ + ‖schwartzCoord (k:ℝ) (f-g)‖+ + B*(∑ i, ∑ j, ‖schwartzCoord (k:ℝ) (a i j-b i j)‖)*‖schwartzCoord ((k:ℝ)+2) u‖ := by + rw [schwartzCoord_add] + have h1 := norm_add_le (schwartzCoord (k:ℝ) (f-g)) + (schwartzCoord (k:ℝ) (smoothPerturbation v (a-b) u)) + have h2 := add_le_add (le_refl ‖schwartzCoord (k:ℝ) (f-g)‖) (hb (a-b) u) + exact h1.trans h2 + + + +theorem tame_stability (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + (t : ℝ) (ht : 1 ≤ t) (v : ι → EC n) (k : ℕ) + (hk : Module.finrank ℝ (EC n)+1 < k) (M : ℝ) (hM : 0 ≤ M) + (θ : ℝ) (hθ : θ < 1) : + ∃ C B : ℝ, 0 ≤ C ∧ 0 ≤ B ∧ ∀ x y : TameData H t v k M θ (ellipticBound H hH), + ‖schwartzCoord ((k:ℝ)+2) (x.u-y.u)‖ ≤ C * + (‖schwartzCoord (k:ℝ) (x.f-y.f)‖ + + B * (∑ i, ∑ j, ‖schwartzCoord (k:ℝ) (x.a i j-y.a i j)‖) * + ‖schwartzCoord ((k:ℝ)+2) y.u‖) := by + obtain ⟨C,hC,hc⟩ := tame_solution_bound H hH t ht v k hk M hM θ hθ + obtain ⟨B,hB,hb⟩ := perturbation_high_bound k (by omega) v + refine ⟨C,B,hC,hB,fun x y => ?_⟩ + exact (tame_difference_bound H t v k M θ _ C hc x y).trans + (mul_le_mul_of_nonneg_left (high_forcing_difference_bound k v B hb x.a y.a x.f y.f y.u) hC) + +end FrozenPoisson.ParameterRegularity + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/TensorEnergyBounds.lean b/lean/OAI/Geometry/PrescribedRicci/TensorEnergyBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..0f9f40e33a1dce220441e361b0d26977a28639ae --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/TensorEnergyBounds.lean @@ -0,0 +1,54 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.HermitianCoercivity +import OAI.Geometry.PrescribedRicci.HermitianTensorEnergy +import OAI.Geometry.PrescribedRicci.MatrixCompactBounds + +namespace OAI + +/-! Tensor Energy Bounds. -/ + +noncomputable section +open Matrix +open scoped ComplexOrder MatrixOrder Kronecker Matrix.Norms.Elementwise +namespace MongeAmpere +variable {n m : Type*} [Fintype n] [Fintype m] [DecidableEq n] [DecidableEq m] + +omit [DecidableEq n] [DecidableEq m] in +lemma kronecker_norm_le (B : Matrix m m ℂ) (K : Matrix n n ℂ) : ‖B ⊗ₖ K‖ ≤ ‖B‖*‖K‖ := by + apply matrix_norm_le_of_entries (by positivity) + intro i j + rw [Matrix.kronecker_apply,norm_mul] + exact mul_le_mul (norm_entry_le_entrywise_sup_norm B) (norm_entry_le_entrywise_sup_norm K) + (norm_nonneg _) (norm_nonneg _) + +lemma kronecker_inv {B : Matrix m m ℂ} {K : Matrix n n ℂ} (hB : B.PosDef) (hK : K.PosDef) : + (B ⊗ₖ K)⁻¹ = B⁻¹ ⊗ₖ K⁻¹ := by + apply Matrix.inv_eq_right_inv + rw [← Matrix.mul_kronecker_mul, + Matrix.mul_nonsing_inv _ (isUnit_iff_ne_zero.mpr hB.det_pos.ne'), + Matrix.mul_nonsing_inv _ (isUnit_iff_ne_zero.mpr hK.det_pos.ne'),Matrix.one_kronecker_one] + +lemma vectorNorm_sq_le_tensorEnergy {B : Matrix m m ℂ} {K : Matrix n n ℂ} + (hB : B.PosDef) (hK : K.PosDef) (V : m → n → ℂ) (a : m) : + ‖V a‖^2 ≤ ‖B⁻¹‖*‖K⁻¹‖*(tensorEnergy B K V).re := by + have hE := tensorEnergy_nonneg hB.posSemidef hK.posSemidef V + have hbound : ∀ i : n, ‖V a i‖^2 ≤ ‖B⁻¹‖*‖K⁻¹‖*(tensorEnergy B K V).re := by + intro i + have h := component_sq_le_hermPair (hB.kronecker hK) (fun p : m × n => V p.1 p.2) (a,i) + rw [← tensorEnergy_eq,kronecker_inv hB hK] at h + apply h.trans + apply mul_le_mul_of_nonneg_right _ hE + exact (Complex.re_le_norm _).trans ((norm_entry_le_entrywise_sup_norm _).trans + (kronecker_norm_le _ _)) + have hp : 0 ≤ ‖B⁻¹‖*‖K⁻¹‖*(tensorEnergy B K V).re := by positivity + have hv : ‖V a‖ ≤ Real.sqrt (‖B⁻¹‖*‖K⁻¹‖*(tensorEnergy B K V).re) := by + apply (pi_norm_le_iff_of_nonneg (Real.sqrt_nonneg _)).mpr + intro i + exact (Real.le_sqrt (norm_nonneg _) hp).mpr (hbound i) + exact ((sq_le_sq₀ (norm_nonneg _) (Real.sqrt_nonneg _)).mpr hv).trans_eq (Real.sq_sqrt hp) + +end MongeAmpere + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/TraceCauchySchwarz.lean b/lean/OAI/Geometry/PrescribedRicci/TraceCauchySchwarz.lean new file mode 100644 index 0000000000000000000000000000000000000000..31d08bc142c62b2541ce7f94436afaa8ae135d0f --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/TraceCauchySchwarz.lean @@ -0,0 +1,51 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.AnalyticSupport + +namespace OAI + +/-! Trace Cauchy Schwarz. -/ + +noncomputable section +open Matrix +open scoped ComplexOrder MatrixOrder +namespace MongeAmpere +variable {n : Type*} [Fintype n] [DecidableEq n] + +@[instance_reducible] def tracePairCore (B K : Matrix n n ℂ) (hB : B.PosSemidef) (hK : K.PosSemidef) : + PreInnerProductSpace.Core ℂ (Matrix n n ℂ) where + inner U V := (B*Uᴴ*K*V).trace + conj_inner_symm U V := by + change star (B*Vᴴ*K*U).trace = _ + rw [← trace_conjTranspose] + simp only [conjTranspose_mul,conjTranspose_conjTranspose,hB.isHermitian.eq,hK.isHermitian.eq] + simp only [← mul_assoc] + simpa only [mul_assoc] using (Matrix.trace_mul_comm (Uᴴ*K*V) B) + re_inner_nonneg U := by + change 0 ≤ (B*Uᴴ*K*U).trace.re + simpa only [mul_assoc] using + EllipticKernel.trace_mul_nonneg hB (hK.conjTranspose_mul_mul_same U) + add_left U V W := by simp only [conjTranspose_add,mul_add,add_mul,trace_add] + smul_left U V c := by simp only [conjTranspose_smul,Matrix.mul_smul,Matrix.smul_mul,trace_smul,smul_eq_mul]; rfl + +lemma trace_cauchySchwarz (B G W : Matrix n n ℂ) (hB : B.PosSemidef) + (hG : G.PosDef) : + ‖(B*W).trace‖^2 ≤ (B*G).trace.re * (B*Wᴴ*G⁻¹*W).trace.re := by + let := tracePairCore B G⁻¹ hB hG.inv.posSemidef + have hh := InnerProductSpace.Core.inner_mul_inner_self_le (𝕜 := ℂ) G W + have hunit : IsUnit G.det := isUnit_iff_ne_zero.mpr hG.det_pos.ne' + have h1 : (B*Gᴴ*G⁻¹*W).trace = (B*W).trace := by + rw [hG.isHermitian.eq,mul_assoc B G,Matrix.mul_nonsing_inv G hunit,mul_one] + have h2 : (B*Wᴴ*G⁻¹*G).trace = star (B*W).trace := by + rw [mul_assoc (B*Wᴴ),Matrix.nonsing_inv_mul G hunit,mul_one,← trace_conjTranspose] + rw [conjTranspose_mul,hB.isHermitian.eq,trace_mul_comm] + have h3 : (B*Gᴴ*G⁻¹*G).trace = (B*G).trace := by + rw [hG.isHermitian.eq,mul_assoc B G,Matrix.mul_nonsing_inv G hunit,mul_one] + change ‖(B*Gᴴ*G⁻¹*W).trace‖ * ‖(B*Wᴴ*G⁻¹*G).trace‖ ≤ + (B*Gᴴ*G⁻¹*G).trace.re * (B*Wᴴ*G⁻¹*W).trace.re at hh + simpa only [h1,h2,h3,norm_star,pow_two] using hh + +end MongeAmpere + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/TraceEntryBounds.lean b/lean/OAI/Geometry/PrescribedRicci/TraceEntryBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..9caea9f37644b94bbed1d6221a9a575068703052 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/TraceEntryBounds.lean @@ -0,0 +1,66 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.KaehlerTrace +import OAI.Geometry.PrescribedRicci.TraceCauchySchwarz + +namespace OAI + +/-! Trace Entry Bounds. -/ + +noncomputable section +open Matrix +open scoped ComplexOrder MatrixOrder +namespace MongeAmpere +variable {n : Type*} [Fintype n] [DecidableEq n] + +lemma trace_single_quadratic (B K : Matrix n n ℂ) (i j : n) : + (B*(Matrix.single i j 1)ᴴ*K*Matrix.single i j 1).trace = K i i*B j j := by + rw [Matrix.conjTranspose_single] + simp only [star_one] + rw [mul_assoc B (Matrix.single j i 1),mul_assoc B (Matrix.single j i 1*K), + Matrix.single_mul_mul_single,one_mul,mul_one,Matrix.trace_mul_single] + simp only [op_smul_eq_mul] + exact mul_comm _ _ + +lemma entry_sq_le_relative_trace (B G : Matrix n n ℂ) (hB : B.PosSemidef) + (hG : G.PosDef) (i j : n) : + ‖B j i‖^2 ≤ (B*G).trace.re * (G⁻¹ i i).re * (B j j).re := by + have hc := trace_cauchySchwarz B G (Matrix.single i j 1) hB hG + rw [Matrix.trace_mul_single,op_smul_eq_mul,mul_one,trace_single_quadratic] at hc + have him := (Complex.nonneg_iff.mp (hG.inv.posSemidef.diag_nonneg (i:=i))).2.symm + simpa only [Complex.mul_re,him,zero_mul,sub_zero,mul_assoc] using hc + +lemma diag_le_relative_trace (B G : Matrix n n ℂ) (hB : B.PosDef) + (hG : G.PosDef) (i : n) : + (B i i).re ≤ (B*G).trace.re * (G⁻¹ i i).re := by + have hb := (Complex.pos_iff.mp (hB.diag_pos (i:=i))).1 + have hc := entry_sq_le_relative_trace B G hB.posSemidef hG i i + have hi := (Complex.pos_iff.mp (hB.diag_pos (i:=i))).2.symm + rw [Complex.sq_norm,Complex.normSq_apply,hi,mul_zero,add_zero] at hc + nlinarith + +lemma entry_le_relative_trace [Nonempty n] (B G : Matrix n n ℂ) + (hB : B.PosDef) (hG : G.PosDef) {M : ℝ} (hM : 0 ≤ M) + (hdiag : ∀ i, (G⁻¹ i i).re ≤ M) (i j : n) : + ‖B i j‖ ≤ M*(B*G).trace.re := by + have hs := (trace_mul_pos hB hG).le + have hb := (Complex.pos_iff.mp (hB.diag_pos (i:=i))).1.le + have hd := diag_le_relative_trace B G hB hG i + have hd' : (B i i).re ≤ M*(B*G).trace.re := by + calc + _ ≤ (B*G).trace.re*(G⁻¹ i i).re := hd + _ ≤ (B*G).trace.re*M := mul_le_mul_of_nonneg_left (hdiag i) hs + _ = _ := mul_comm _ _ + have hc := entry_sq_le_relative_trace B G hB.posSemidef hG j i + have hx : (B*G).trace.re*(G⁻¹ j j).re*(B i i).re ≤ (M*(B*G).trace.re)^2 := by + calc + _ ≤ ((B*G).trace.re*M)*(B i i).re := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left (hdiag j) hs) hb + _ ≤ ((B*G).trace.re*M)*(M*(B*G).trace.re) := mul_le_mul_of_nonneg_left hd' (mul_nonneg hs hM) + _ = _ := by ring + have hpos := mul_nonneg hM hs + nlinarith [norm_nonneg (B i j)] + +end MongeAmpere + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/TraceMaximum.lean b/lean/OAI/Geometry/PrescribedRicci/TraceMaximum.lean new file mode 100644 index 0000000000000000000000000000000000000000..8c61b842b4a89aa4b1d6ca3ea4d50972b863681a --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/TraceMaximum.lean @@ -0,0 +1,96 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.KaehlerLogTrace +import OAI.Geometry.PrescribedRicci.KaehlerTrace +import OAI.Geometry.PrescribedRicci.MongeAmpereC0 +import OAI.Geometry.PrescribedRicci.UniformChernLu +import OAI.Geometry.PrescribedPotential.SmoothPotentialDifference +import OAI.Geometry.PrescribedPotential.VolumePath + +namespace OAI + +/-! Trace Maximum. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix +open scoped ContDiff ComplexOrder MatrixOrder +namespace Anticanonical.SourceSmooth.KaehlerMetric +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +lemma laplacian_addFunction (g : KaehlerMetric A) (φ ψ : SmoothRealFunction A) (x : X) : + (g.laplacian (φ.addFunction ψ)).value x = (g.laplacian φ).value x+(g.laplacian ψ).value x := by + obtain ⟨q,hq⟩ := A.covers x + change g.laplacianValue _ x = g.laplacianValue _ x+g.laplacianValue _ x + rw [g.laplacianValue_local _ q hq,g.laplacianValue_local φ q hq,g.laplacianValue_local ψ q hq] + simp only [linearizedMongeAmpere,φ.hessian_addFunction ψ q ((A.chart q).mapsTo hq), + mul_add,trace_add,Complex.add_re] + +lemma laplacian_realSMul (g : KaehlerMetric A) (φ : SmoothRealFunction A) (c : ℝ) (x : X) : + (g.laplacian (φ.realSMul c)).value x = c*(g.laplacian φ).value x := + g.linearizedMongeAmpere_realSMul φ c _ _ + +lemma laplacian_nonpos_at_globalMax (g : KaehlerMetric A) (φ : SmoothRealFunction A) + {x : X} (hx : ∀ y, φ.value y ≤ φ.value x) : (g.laplacian φ).value x ≤ 0 := + g.linearized_nonpos_at_globalMax φ hx _ (A.covers x).choose_spec + +variable [CompactSpace X] [Nonempty X] + +lemma trace_bound_of_C0_chernLu (g : KaehlerMetric A) (hd : 0 < d) + (φ : SmoothRealFunction A) (hp : g.PositivePotential φ) {C B : ℝ} + (hC : 0 ≤ C) (hB : ∀ x, |φ.value x| ≤ B) + (hLu : ∀ x, -C*((g.deform φ hp).traceMetric g).value x ≤ + ((g.deform φ hp).laplacian ((g.deform φ hp).logTrace g hd)).value x) : + ∀ x, ((g.deform φ hp).traceMetric g).value x ≤ + ((C+1)*(d:ℝ))*Real.exp (2*(C+1)*B) := by + let h := g.deform φ hp + let f := (h.logTrace g hd).addFunction (φ.realSMul (-(C+1))) + obtain ⟨x₀,_,hm⟩ := isCompact_univ.exists_isMaxOn univ_nonempty f.continuous.continuousOn + have hmax : ∀ y, f.value y ≤ f.value x₀ := fun y => hm (mem_univ y) + have hlap := h.laplacian_nonpos_at_globalMax f hmax + rw [laplacian_addFunction,laplacian_realSMul,g.laplacian_deform φ hp] at hlap + have hS₀ : (h.traceMetric g).value x₀ ≤ (C+1)*(d:ℝ) := by + have hh := hLu x₀ + change -C*(h.traceMetric g).value x₀ ≤ _ at hh + nlinarith + intro x + have hlog : Real.log ((h.traceMetric g).value x) ≤ + Real.log ((h.traceMetric g).value x₀)+2*(C+1)*B := by + have hh := hmax x + change Real.log ((h.traceMetric g).value x)+(-(C+1))*φ.value x ≤ + Real.log ((h.traceMetric g).value x₀)+(-(C+1))*φ.value x₀ at hh + have hx := abs_le.mp (hB x) + have hy := abs_le.mp (hB x₀) + nlinarith [mul_nonneg (by linarith : 0 ≤ C+1) (sub_nonneg.mpr hx.2), + mul_nonneg (by linarith : 0 ≤ C+1) (by linarith : 0 ≤ φ.value x₀+B)] + have he := Real.exp_le_exp.mpr hlog + rw [Real.exp_add,Real.exp_log (h.traceMetric_pos g hd x), + Real.exp_log (h.traceMetric_pos g hd x₀)] at he + exact he.trans (mul_le_mul_of_nonneg_right hS₀ (Real.exp_pos _).le) + +variable [T2Space X] [ConnectedSpace X] + + + +theorem volumePath_trace_bound (g : KaehlerMetric A) (line : SemipositiveAnticanonicalMetric A) + (hd : 2 ≤ d) : ∃ K : ℝ, 0 < K ∧ + ∀ (φ : SmoothRealFunction A) (hp : g.PositivePotential φ), g.integral φ.value = 0 → + ∀ (t b : ℝ), t ∈ Icc (0:ℝ) 1 → + (∀ x, (g.logRatio (g.deform φ hp)).value x = t*(prescribedForcing g line).value x+b) → + ∀ x, ((g.deform φ hp).traceMetric g).value x ≤ K := by + have hd' : 0 < d := by omega + obtain ⟨C,hC,hLu⟩ := g.uniform_chernLu line hd' + obtain ⟨B,hB,hC0⟩ := g.volumePath_C0_bound line hd + refine ⟨((C+1)*(d:ℝ))*Real.exp (2*(C+1)*B),by positivity,?_⟩ + intro φ hp hm t b ht heq + exact g.trace_bound_of_C0_chernLu hd' φ hp hC (hC0 φ hp hm t b ht heq) + (hLu t b φ hp heq ht) + +end Anticanonical.SourceSmooth.KaehlerMetric + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/UniformCalabi.lean b/lean/OAI/Geometry/PrescribedRicci/UniformCalabi.lean new file mode 100644 index 0000000000000000000000000000000000000000..b7516199317054c3ef287f7cd014d94c7634ab20 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/UniformCalabi.lean @@ -0,0 +1,67 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.CalabiLocalMaximum +import OAI.Geometry.PrescribedRicci.CalabiTensorMetric +import OAI.Geometry.PrescribedRicci.CompactPathBounds +import OAI.Geometry.PrescribedRicci.CompactPathRicci + +namespace OAI + +/-! Uniform Calabi. -/ + +section + + + +noncomputable section +open Matrix Set Filter Topology Manifold IsManifold +open scoped ContDiff ComplexOrder MatrixOrder Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth.KaehlerMetric +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +lemma exists_nested_coordinateCutoff {K U : Set (Coordinates d)} + (hK : IsCompact K) (hU : IsOpen U) (hKU : K ⊆ U) : + ∃ (χ : Coordinates d → ℝ) (L : Set (Coordinates d)), ContDiff ℝ ∞ χ ∧ + IsCompact L ∧ L ⊆ U ∧ tsupport χ ⊆ interior L ∧ K ⊆ L ∧ ∀ z ∈ K, χ z = 1 := by + obtain ⟨K₁,hK₁,hK₁c,hKK₁,hK₁U⟩ := exists_compact_closed_between hK hU hKU + obtain ⟨f,hf,hf0,_⟩ := exists_contMDiffMap_one_nhds_of_subset_interior + (𝓘(ℝ,Coordinates d)) hK.isClosed hKK₁ (n:=⊤) + have hsm : ContDiff ℝ ∞ (fun z => f z) := contMDiff_iff_contDiff.mp f.contMDiff + have hsup : tsupport (fun z => f z) ⊆ K₁ := by + apply closure_minimal _ hK₁c + intro z hz + by_contra hn + exact hz (hf0 z hn) + obtain ⟨L,hL,_,hK₁L,hLU⟩ := exists_compact_closed_between hK₁ hU hK₁U + refine ⟨f,L,hsm,hL,hLU,hsup.trans hK₁L,?_,?_⟩ + · exact (hKK₁.trans interior_subset).trans (hK₁L.trans interior_subset) + · intro z hz + exact hf.self_of_nhdsSet z hz + +variable [T2Space X] [CompactSpace X] [ConnectedSpace X] + + + +theorem volumePath_calabi_bound_on_compact (g : KaehlerMetric A) + (line : SemipositiveAnticanonicalMetric A) (hd : 2 ≤ d) (q : Fin A.count) + {K : Set (Coordinates d)} (hK : IsCompact K) (hKt : K ⊆ (A.chart q).target) : + ∃ P : ℝ, 0 < P ∧ ∀ (φ : SmoothRealFunction A) (hp : g.PositivePotential φ), + g.integral φ.value = 0 → ∀ (t b : ℝ), t ∈ Icc (0:ℝ) 1 → + (∀ x, (g.logRatio (g.deform φ hp)).value x = t*(prescribedForcing g line).value x+b) → + ∀ z ∈ K, (g.deform φ hp).calabiNorm q z ≤ P := by + obtain ⟨χ,L,hχ,hL,hLt,hχL,hKL,hχK⟩ := exists_nested_coordinateCutoff hK (A.chart q).open_target hKt + obtain ⟨M,hM,hmetric⟩ := g.volumePath_metric_bounds_on_compact line hd q hL hLt + obtain ⟨R,hR,hRicci⟩ := g.volumePath_ricci_bounds_on_compact line q hL hLt + obtain ⟨P,hP,hCalabi⟩ := calabi_bound_on_compact q hL hLt χ hχ hχL hM.le hR.le + refine ⟨P,hP,?_⟩ + intro φ hp hm t b ht heq z hz + apply hCalabi (g.deform φ hp) (fun y hy => ?_) z (hKL hz) (hχK z hz) + have h1 := hmetric φ hp hm t b ht heq y hy + have h2 := hRicci φ hp t b ht heq y hy + exact ⟨h1.1,h1.2,h2.1,h2.2⟩ + +end Anticanonical.SourceSmooth.KaehlerMetric + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/UniformChernLu.lean b/lean/OAI/Geometry/PrescribedRicci/UniformChernLu.lean new file mode 100644 index 0000000000000000000000000000000000000000..13f54a708ff9d6b44de58774c3def00845a1593f --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/UniformChernLu.lean @@ -0,0 +1,104 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.ChernLuAlgebra +import OAI.Geometry.PrescribedRicci.ChernLuDifferential +import OAI.Geometry.PrescribedRicci.CurvatureCompactBounds +import OAI.Geometry.PrescribedRicci.KaehlerLogTrace +import OAI.Geometry.PrescribedRicci.MatrixComponentBounds +import OAI.Geometry.PrescribedRicci.TraceEntryBounds +import OAI.Geometry.PrescribedPotential.VolumePath + +namespace OAI + +/-! Uniform Chern Lu. -/ + +section + + + +noncomputable section +open Matrix Filter Set Topology +open scoped ContDiff ComplexOrder MatrixOrder +namespace Anticanonical.SourceSmooth.KaehlerMetric +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} + +lemma volumePath_ricci_bound (g : KaehlerMetric A) (line : SemipositiveAnticanonicalMetric A) + {t b : ℝ} {φ : SmoothRealFunction A} (hp : g.PositivePotential φ) + (heq : ∀ x, (g.logRatio (g.deform φ hp)).value x = + t*(prescribedForcing g line).value x+b) + (ht : t ∈ Icc (0:ℝ) 1) (q : Fin A.count) {z : Coordinates d} + (hz : z ∈ (A.chart q).target) {M : ℝ} (hM : 0 ≤ M) + (hB : g.BackgroundComponentBound (prescribedForcing g line) q z M) (i j : Fin d) : + ‖(g.deform φ hp).curvatureRicci q z i j‖ ≤ 2*M := by + rw [g.volumePath_ricci line hp heq q hz] + change ‖g.curvatureRicci q z i j-(t:ℂ)*(prescribedForcing g line).hessian q z i j‖ ≤ _ + calc + _ ≤ ‖g.curvatureRicci q z i j‖+‖(t:ℂ)*(prescribedForcing g line).hessian q z i j‖ := norm_sub_le _ _ + _ ≤ M+M := add_le_add (hB.2.2.1 i j) (by + rw [norm_mul,Complex.norm_real,Real.norm_eq_abs,abs_of_nonneg ht.1] + exact (mul_le_mul_of_nonneg_left (hB.2.2.2.1 i j) ht.1).trans + (by nlinarith [ht.2])) + _ = _ := by ring + +lemma chernLu_of_background_bound (g : KaehlerMetric A) (line : SemipositiveAnticanonicalMetric A) + (hd : 0 < d) {t b : ℝ} {φ : SmoothRealFunction A} (hp : g.PositivePotential φ) + (heq : ∀ x, (g.logRatio (g.deform φ hp)).value x = + t*(prescribedForcing g line).value x+b) + (ht : t ∈ Icc (0:ℝ) 1) (q : Fin A.count) {z : Coordinates d} + (hz : z ∈ (A.chart q).target) {M : ℝ} (hM : 0 ≤ M) + (hB : g.BackgroundComponentBound (prescribedForcing g line) q z M) : + -((d:ℝ)^4*M^3+2*(d:ℝ)^4*M^4)*((g.deform φ hp).traceMetric g).localExpression q z ≤ + ((g.deform φ hp).laplacian ((g.deform φ hp).logTrace g hd)).localExpression q z := by + let : Nonempty (Fin d) := Fin.pos_iff_nonempty.mp hd + let h := g.deform φ hp + let S := (h.traceMetric g).localExpression q z + have hS : 0 < S := h.traceMetric_pos g hd ((A.chart q).symm z) + have hi (i j : Fin d) : ‖(h.matrix q z)⁻¹ i j‖ ≤ M*S := by + dsimp [S] + rw [h.traceMetric_local g q hz] + exact MongeAmpere.entry_le_relative_trace _ _ (h.positive q z hz).inv (g.positive q z hz) + hM (fun i => (Complex.re_le_norm _).trans (hB.2.1 i i)) i j + have hcurv : h.targetCurvatureTerm g q z ≤ ((d:ℝ)^4*M^3)*S^2 := by + change (∑ a, ∑ b, (h.matrix q z)⁻¹ a b*((h.matrix q z)⁻¹*g.curvatureMatrix q z b a).trace).re ≤ _ + apply (Complex.re_le_norm _).trans + have hh := MongeAmpere.contracted_curvature_bound (mul_nonneg hM hS.le) hi hB.2.2.2.2 + simp only [Fintype.card_fin] at hh + convert hh using 1 + first | rfl | ring + have hricci : -(2*(d:ℝ)^4*M^4)*S^2 ≤ h.sourceRicciTerm g q z := by + have hh := MongeAmpere.trace_four_entry_bound (mul_nonneg hM hS.le) + (mul_nonneg (by norm_num : (0:ℝ)≤2) hM) (mul_nonneg hM hS.le) + hi (g.volumePath_ricci_bound line hp heq ht q hz hM hB) hi hB.1 + simp only [Fintype.card_fin] at hh + have hh' : ‖((h.matrix q z)⁻¹*h.curvatureRicci q z*(h.matrix q z)⁻¹*g.matrix q z).trace‖ ≤ + (2*(d:ℝ)^4*M^4)*S^2 := by + convert hh using 1 + first | rfl | ring + have hl := (abs_le.mp (Complex.abs_re_le_norm ((h.matrix q z)⁻¹*h.curvatureRicci q z*(h.matrix q z)⁻¹*g.matrix q z).trace)).1 + dsimp [sourceRicciTerm] + linarith + exact h.chernLu_of_component_bounds g hd q hz hcurv hricci + +variable [T2Space X] [CompactSpace X] + +lemma uniform_chernLu (g : KaehlerMetric A) (line : SemipositiveAnticanonicalMetric A) + (hd : 0 < d) : ∃ C : ℝ, 0 ≤ C ∧ + ∀ (t b : ℝ) (φ : SmoothRealFunction A) (hp : g.PositivePotential φ), + (∀ x, (g.logRatio (g.deform φ hp)).value x = t*(prescribedForcing g line).value x+b) → + t ∈ Icc (0:ℝ) 1 → ∀ x, + -C*((g.deform φ hp).traceMetric g).value x ≤ + ((g.deform φ hp).laplacian ((g.deform φ hp).logTrace g hd)).value x := by + obtain ⟨M,hM,hB⟩ := g.compact_background_bounds (prescribedForcing g line) + refine ⟨(d:ℝ)^4*M^3+2*(d:ℝ)^4*M^4,by positivity,?_⟩ + intro t b φ hp heq ht x + obtain ⟨q,hq⟩ := exists_partition_chart (A:=A) x + have hx := chartPartition_support q hq + have hh := g.chernLu_of_background_bound line hd hp heq ht q ((A.chart q).mapsTo hx) + (by linarith) (hB q x hq) + simpa only [SmoothRealFunction.localExpression,Function.comp_apply,(A.chart q).left_inv hx] using hh + +end Anticanonical.SourceSmooth.KaehlerMetric + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/UniformCoefficientExtension.lean b/lean/OAI/Geometry/PrescribedRicci/UniformCoefficientExtension.lean new file mode 100644 index 0000000000000000000000000000000000000000..da8ab4465769ea12bcafb119fd90b18e65c6b228 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/UniformCoefficientExtension.lean @@ -0,0 +1,120 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.GlobalSobolev +import OAI.Geometry.PrescribedPotential.MetricLocalization +import OAI.Geometry.PrescribedRicci.UniformFrozenEstimate + +namespace OAI + +/-! Uniform Coefficient Extension. -/ + +noncomputable section +open Matrix Set Filter Topology +open scoped ContDiff ComplexOrder MatrixOrder Matrix.Norms.Elementwise BoundedContinuousFunction +namespace MetricLocalization +open EllipticKernel FrozenPoisson SobolevChart +variable {n : ℕ} {ι : Type*} [Fintype ι] + +omit [Fintype ι] in +theorem coefficient_extension_on_bump {U : Set (EC n)} (hU : IsOpen U) + (H : EC n → Matrix (Fin n) (Fin n) ℂ) (hH : ContDiffOn ℝ ∞ H U) + (hh : ∀ y ∈ U, (H y).PosDef) {x : EC n} (_hx : x ∈ U) + (v : ι → EC n) (ψ : ContDiffBump x) (hψ : tsupport ψ ⊆ U) + {ε : ℝ} (hε : 0 ≤ ε) + (hb : ∀ y ∈ tsupport ψ, ∀ i j, + |traceBilin (H y) (rankTwo (v i) (v j))-traceBilin (H x) (rankTwo (v i) (v j))| ≤ ε) : + ∃ a : ι → ι → EC n →ᵇ ℂ, + (∀ i j, ContDiff ℝ ∞ (a i j : EC n → ℂ)) ∧ + (∀ i j, HasCompactSupport (a i j : EC n → ℂ)) ∧ + (∀ i j, ‖a i j‖ ≤ ε) ∧ + ∀ y ∈ Metric.closedBall x ψ.rIn, ∀ i j, + a i j y = (traceBilin (H y) (rankTwo (v i) (v j)) : ℂ)- + (traceBilin (H x) (rankTwo (v i) (v j)) : ℂ) := by + let F : ι → ι → EC n → ℂ := fun i j y => + (traceBilin (H y) (rankTwo (v i) (v j)) : ℂ)- + (traceBilin (H x) (rankTwo (v i) (v j)) : ℂ) + let b : ι → ι → EC n → ℂ := fun i j y => ψ y • F i j y + have hF (i j : ι) : ContDiffOn ℝ ∞ (F i j) U := + (trace_coefficient_smooth hH hh _).sub contDiffOn_const + have hs (i j : ι) : ContDiff ℝ ∞ (b i j) := by + apply smooth_bump_smul + intro y hy + exact (hF i j y (hψ hy)).contDiffAt (hU.mem_nhds (hψ hy)) + have hc (i j : ι) : HasCompactSupport (b i j) := ψ.hasCompactSupport.smul_right + have hn (i j : ι) (y : EC n) : ‖b i j y‖ ≤ ε := by + by_cases hy : y ∈ tsupport ψ + · calc + _ = ψ y*‖F i j y‖ := by simp [b,abs_of_nonneg ψ.nonneg] + _ ≤ ‖F i j y‖ := by simpa using mul_le_mul_of_nonneg_right ψ.le_one (norm_nonneg (F i j y)) + _ ≤ ε := by simpa only [F,← Complex.ofReal_sub,Complex.norm_real,Real.norm_eq_abs] using hb y hy i j + · simp [b,image_eq_zero_of_notMem_tsupport hy,hε] + let a : ι → ι → EC n →ᵇ ℂ := fun i j => + BoundedContinuousFunction.ofNormedAddCommGroup (b i j) (hs i j).continuous ε (hn i j) + refine ⟨a,hs,hc,fun i j => (BoundedContinuousFunction.norm_le hε).mpr (hn i j),?_⟩ + intro y hy i j + change ψ y • F i j y = F i j y + rw [ψ.one_of_mem_closedBall hy,one_smul] + +lemma perturbationBound_le_of_norm (v : ι → EC n) (a : ι → ι → EC n →ᵇ ℂ) + {ε : ℝ} (ha : ∀ i j, ‖a i j‖ ≤ ε) : + perturbationBound v a ≤ ε*(∑ i, ∑ j, (2*Real.pi)^2*‖v i‖*‖v j‖) := by + simp only [perturbationBound,Finset.mul_sum] + apply Finset.sum_le_sum + intro i _ + apply Finset.sum_le_sum + intro j _ + exact mul_le_mul_of_nonneg_right (ha i j) (by positivity) + +theorem uniform_coefficient_radius (v : ι → EC n) {M P R : ℝ} + (hM : 0 ≤ M) (hP : 0 ≤ P) (hR : 0 < R) : + ∃ r : ℝ, 0 < r ∧ r ≤ R ∧ + ∀ (x : EC n) (U : Set (EC n)), IsOpen U → Metric.closedBall x R ⊆ U → + ∀ (H : EC n → Matrix (Fin n) (Fin n) ℂ), ContDiffOn ℝ ∞ H U → + (∀ y ∈ U, (H y).PosDef) → + (∀ y ∈ Metric.closedBall x R, ∀ i j, + |traceBilin (H y) (rankTwo (v i) (v j))-traceBilin (H x) (rankTwo (v i) (v j))| ≤ P*‖y-x‖) → + ∃ a : ι → ι → EC n →ᵇ ℂ, + (∀ i j, ContDiff ℝ ∞ (a i j : EC n → ℂ)) ∧ + (∀ i j, HasCompactSupport (a i j : EC n → ℂ)) ∧ + perturbationBound v a*uniformEllipticBound n M ≤ 1/2 ∧ + ∀ y ∈ Metric.closedBall x (r/2), ∀ i j, + a i j y = (traceBilin (H y) (rankTwo (v i) (v j)) : ℂ)- + (traceBilin (H x) (rankTwo (v i) (v j)) : ℂ) := by + let C := uniformEllipticBound n M + let Q : ℝ := ∑ i, ∑ j, (2*Real.pi)^2*‖v i‖*‖v j‖ + have hC : 0 < C := uniformEllipticBound_pos hM + have hQ : 0 ≤ Q := by dsimp only [Q]; positivity + let ε : ℝ := 1/(2*(1+Q*C)) + have hε : 0 < ε := by dsimp only [ε]; positivity + let r : ℝ := min R (ε/(P+1)) + have hr : 0 < r := lt_min hR (div_pos hε (by linarith only [hP])) + have hrR : r ≤ R := min_le_left .. + have hpr : P*r ≤ ε := by + have h1 := (le_div_iff₀ (by linarith only [hP] : 0 < P+1)).mp (min_le_right R (ε/(P+1))) + change r*(P+1) ≤ ε at h1 + nlinarith only [h1,hr] + refine ⟨r,hr,hrR,?_⟩ + intro x U hU hsub H hH hh hosc + let ψ : ContDiffBump x := + { rIn := r/2, rOut := r, rIn_pos := half_pos hr, rIn_lt_rOut := half_lt_self hr } + have hs : tsupport ψ ⊆ Metric.closedBall x R := by + rw [ContDiffBump.tsupport_eq] + exact Metric.closedBall_subset_closedBall hrR + obtain ⟨a,ha,hac,han,heq⟩ := coefficient_extension_on_bump hU H hH hh + (hsub (Metric.mem_closedBall_self hR.le)) v ψ (hs.trans hsub) hε.le (by + intro y hy i j + apply (hosc y (hs hy) i j).trans + apply (mul_le_mul_of_nonneg_left _ hP).trans hpr + simpa only [ContDiffBump.tsupport_eq,Metric.mem_closedBall,dist_eq_norm,ψ] using hy) + refine ⟨a,ha,hac,?_,heq⟩ + apply (mul_le_mul_of_nonneg_right (perturbationBound_le_of_norm v a han) hC.le).trans + change ε*Q*C ≤ 1/2 + have hd : 0 < 2*(1+Q*C) := by positivity + dsimp only [ε] + rw [div_mul_eq_mul_div,div_mul_eq_mul_div,one_mul] + apply (div_le_iff₀ hd).mpr + nlinarith only [mul_nonneg hQ hC.le] +end MetricLocalization + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/UniformCoefficientOscillation.lean b/lean/OAI/Geometry/PrescribedRicci/UniformCoefficientOscillation.lean new file mode 100644 index 0000000000000000000000000000000000000000..2576b706841ab269242b605e147418a662b0a58a --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/UniformCoefficientOscillation.lean @@ -0,0 +1,100 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.CalabiMetricC1 +import OAI.Geometry.PrescribedRicci.CalabiTensorBounds +import OAI.Geometry.PrescribedPotential.VolumePath + +namespace OAI + +/-! Uniform Coefficient Oscillation. -/ + +section + + + +noncomputable section +open Matrix Set Filter Topology +open scoped ContDiff ComplexOrder MatrixOrder Matrix.Norms.Elementwise +namespace MongeAmpere +variable {n : Type*} [Fintype n] [DecidableEq n] + +omit [DecidableEq n] in +lemma matrix_trace_norm_le (B : Matrix n n ℂ) : ‖B.trace‖ ≤ (Fintype.card n:ℝ)*‖B‖ := by + apply (norm_sum_le _ _).trans + apply (Finset.sum_le_sum (fun i _ => norm_entry_le_entrywise_sup_norm B (i:=i) (j:=i))).trans_eq + simp only [Finset.sum_const,Finset.card_univ,nsmul_eq_mul] + +lemma inverse_difference_bound (H K : Matrix n n ℂ) (hH : H.PosDef) (hK : K.PosDef) + {M : ℝ} (hM : 0 ≤ M) (hI : ‖H⁻¹‖ ≤ M) (hJ : ‖K⁻¹‖ ≤ M) : + ‖H⁻¹-K⁻¹‖ ≤ (Fintype.card n:ℝ)^2*M^2*‖H-K‖ := by + have hHU : IsUnit H := (Matrix.isUnit_iff_isUnit_det H).mpr (isUnit_iff_ne_zero.mpr hH.det_pos.ne') + have hKU : IsUnit K := (Matrix.isUnit_iff_isUnit_det K).mpr (isUnit_iff_ne_zero.mpr hK.det_pos.ne') + rw [Matrix.inv_sub_inv ⟨fun _ => hKU,fun _ => hHU⟩] + have h1 := matrix_norm_mul_le (H⁻¹*(K-H)) K⁻¹ + have h2 := matrix_norm_mul_le H⁻¹ (K-H) + calc + _ ≤ (Fintype.card n:ℝ)*((Fintype.card n:ℝ)*M*‖K-H‖)*M := + h1.trans (mul_le_mul + (mul_le_mul_of_nonneg_left (h2.trans (mul_le_mul_of_nonneg_right + (mul_le_mul_of_nonneg_left hI (Nat.cast_nonneg _)) (norm_nonneg _))) (Nat.cast_nonneg _)) + hJ (norm_nonneg _) (by positivity)) + _ = _ := by rw [norm_sub_rev]; ring +end MongeAmpere + +namespace EllipticKernel +open MongeAmpere +variable {n : ℕ} + +lemma traceBilin_difference_bound (H K : Matrix (Fin n) (Fin n) ℂ) (B : Bilin (EC n)) : + |traceBilin H B-traceBilin K B| ≤ (n:ℝ)^2*‖H⁻¹-K⁻¹‖* + ‖PotentialKaehler.hermitianPartMatrix (pullBilin B)‖ := by + rw [traceBilin_apply,traceBilin_apply,← Complex.sub_re,← Matrix.trace_sub,← Matrix.sub_mul] + apply (Complex.abs_re_le_norm _).trans + apply (matrix_trace_norm_le _).trans + apply (mul_le_mul_of_nonneg_left (matrix_norm_mul_le _ _) (Nat.cast_nonneg _)).trans_eq + simp only [Fintype.card_fin]; ring +end EllipticKernel + +namespace Anticanonical.SourceSmooth.KaehlerMetric +open MongeAmpere EllipticKernel +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} + +theorem volumePath_metric_lipschitz_on_compact (g : KaehlerMetric A) + (line : SemipositiveAnticanonicalMetric A) (hd : 2 ≤ d) (q : Fin A.count) + {K : Set (Coordinates d)} (hK : IsCompact K) (hKc : Convex ℝ K) (hKt : K ⊆ (A.chart q).target) : + ∃ P : ℝ, 0 < P ∧ ∀ (φ : SmoothRealFunction A) (hp : g.PositivePotential φ), + g.integral φ.value = 0 → ∀ (t b : ℝ), t ∈ Icc (0:ℝ) 1 → + (∀ x, (g.logRatio (g.deform φ hp)).value x = t*(prescribedForcing g line).value x+b) → + ∀ x ∈ K, ∀ y ∈ K, + ‖(g.deform φ hp).matrix q y-(g.deform φ hp).matrix q x‖ ≤ P*‖y-x‖ ∧ + ‖((g.deform φ hp).matrix q y)⁻¹-((g.deform φ hp).matrix q x)⁻¹‖ ≤ P*‖y-x‖ := by + obtain ⟨M,hM,hmetric⟩ := g.volumePath_metric_bounds_on_compact line hd q hK hKt + obtain ⟨P,hP,hder⟩ := g.volumePath_metric_C1_on_compact line hd q hK hKt + refine ⟨P+(d:ℝ)^2*M^2*P,by positivity,?_⟩ + intro φ hp hm t b ht heq x hx y hy + let H := (g.deform φ hp).matrix q + have hdiff : ‖H y-H x‖ ≤ P*‖y-x‖ := by + apply matrix_norm_le_of_entries (by positivity) + intro i j + apply Convex.norm_image_sub_le_of_norm_fderiv_le (𝕜:=ℝ) (s:=K) _ _ hKc hx hy + · intro z hz + exact differentiableAt_pi.mp (differentiableAt_pi.mp + ((((g.deform φ hp).smooth q).contDiffAt ((A.chart q).open_target.mem_nhds (hKt hz))).differentiableAt + (by simp)) i) j + · intro z hz + exact hder φ hp hm t b ht heq z hz i j + have hi := inverse_difference_bound (H y) (H x) + ((g.deform φ hp).positive q y (hKt hy)) ((g.deform φ hp).positive q x (hKt hx)) hM.le + (hmetric φ hp hm t b ht heq y hy).2 (hmetric φ hp hm t b ht heq x hx).2 + simp only [Fintype.card_fin] at hi + have hi' := hi.trans (mul_le_mul_of_nonneg_left hdiff (by positivity)) + constructor + · exact hdiff.trans (mul_le_mul_of_nonneg_right (le_add_of_nonneg_right (by positivity)) (norm_nonneg _)) + · change ‖(H y)⁻¹-(H x)⁻¹‖ ≤ _ + nlinarith only [hi',mul_nonneg hP.le (norm_nonneg (y-x))] +end Anticanonical.SourceSmooth.KaehlerMetric + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/UniformDeterminantRemainder.lean b/lean/OAI/Geometry/PrescribedRicci/UniformDeterminantRemainder.lean new file mode 100644 index 0000000000000000000000000000000000000000..d9298d31eb385dfd55ed00678fd680c41ce7e108 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/UniformDeterminantRemainder.lean @@ -0,0 +1,119 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.DeterminantJet +import OAI.Geometry.PrescribedRicci.JetRemainderBound +import OAI.Geometry.PrescribedRicci.UniformSchwartz + +namespace OAI + +/-! Uniform Determinant Remainder. -/ + +section + + + +noncomputable section +open Set Finset _root_.MeasureTheory _root_.OAI.MeasureTheory +open scoped ContDiff Classical BigOperators ENNReal SchwartzMap +namespace TameInterpolation +open SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] +variable {ι : Type*} [Fintype ι] [Nonempty ι] {n : ℕ} [Nonempty (Fin n)] {Z : Type*} + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] [Fintype ι] [Nonempty ι] in +lemma monoEval_compact (e : ι → E) (f : Fin n → E → ℂ) + (hc : ∀ i, HasCompactSupport (f i)) (s : Fin n → List ι) : + HasCompactSupport (monoEval e f s) := by + let i : Fin n := Classical.choice inferInstance + apply (cword_compact e (hc i) (s i)).mono + intro x hx + apply Finset.prod_ne_zero_iff.mp hx i (Finset.mem_univ i) + +lemma list_uniformLp {ν : Type*} (L : List ν) (F : ν → Z → E → ℂ) + (hf : ∀ a ∈ L, ∀ z, MemLp (F a z) 2 volume) + (hb : ∀ a ∈ L, ∃ C : ℝ, 0 ≤ C ∧ ∀ z, lpNorm (F a z) 2 volume ≤ C) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ z, lpNorm (fun x => (L.map (fun a => F a z x)).sum) 2 volume ≤ C := by + induction L with + | nil => exact ⟨0,le_rfl,fun z => by simp⟩ + | cons a L ih => + obtain ⟨C,hC,hc⟩ := hb a (by simp) + obtain ⟨B,hB,hb'⟩ := ih (fun b h => hf b (List.mem_cons_of_mem a h)) + (fun b h => hb b (List.mem_cons_of_mem a h)) + refine ⟨C+B,add_nonneg hC hB,fun z => ?_⟩ + simp only [List.map_cons,List.sum_cons] + exact (lpNorm_add_le (hf a (by simp) z) (by norm_num)).trans (add_le_add (hc z) (hb' z)) + +lemma detJetRemainder_uniform_bound (e : ι → E) + (F : Z → Fin n → Fin n → 𝓢(E,ℂ)) + (hc : ∀ z i j, HasCompactSupport (F z i j : E → ℂ)) (ws : List ι) + (h0 : ∀ σ : Equiv.Perm (Fin n), ∃ A : ℝ, 0 ≤ A ∧ ∀ z, + familyJetNorm e (realComponents (initialJet e (fun i x => F z (σ i) i x))) 0 ∞ ≤ A) + (hS : ∀ i j, UniformSobolev ((ws.length:ℝ)-1) (fun z => F z i j)) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ z, + lpNorm (detJetRemainder e (fun x i j => F z i j x) ws) 2 volume ≤ C := by + have hσ (σ : Equiv.Perm (Fin n)) : ∃ C : ℝ, 0 ≤ C ∧ ∀ z, + lpNorm (fun x => ((monoRemainder ws).map + (fun s => monoEval e (fun i x => F z (σ i) i x) s x)).sum) 2 volume ≤ C := by + obtain ⟨A,hA,ha⟩ := h0 σ + apply list_uniformLp + · intro s hs z + exact (monoEval_smooth e _ (fun i => (F z (σ i) i).smooth') s).continuous.memLp_of_hasCompactSupport + (monoEval_compact e _ (fun i => hc z (σ i) i) s) + · intro s hs + apply monoRemainder_uniform_bound e _ (fun z i => (F z (σ i) i).smooth') + (fun z i => hc z (σ i) i) ws s hs hA ha + intro j hj + have hlen : 2 ≤ ws.length := by + cases ws with + | nil => simp [monoRemainder] at hs + | cons a ws => + cases ws with + | nil => simp [monoRemainder] at hs + | cons b ws => simp + have hjs : (j:ℝ)+1 ≤ (ws.length:ℝ)-1 := by + have hh : j+2 ≤ ws.length := by omega + have hh' : (j:ℝ)+2 ≤ (ws.length:ℝ) := by exact_mod_cast hh + linarith only [hh'] + obtain ⟨B,hB,hb⟩ := initialJet_sobolev_bound (κ:=Fin n) e j ((ws.length:ℝ)-1) hjs + choose C hC hcb using fun i => hS (σ i) i + refine ⟨B*∑ i, C i,mul_nonneg hB (Finset.sum_nonneg fun i _ => hC i),fun z => ?_⟩ + exact (hb (fun i => F z (σ i) i)).trans (mul_le_mul_of_nonneg_left + (Finset.sum_le_sum fun i _ => hcb i z) hB) + choose C hC hcb using hσ + refine ⟨∑ σ : Equiv.Perm (Fin n), ‖(Equiv.Perm.sign σ : ℂ)‖*C σ, + Finset.sum_nonneg (fun σ _ => mul_nonneg (norm_nonneg _) (hC σ)),fun z => ?_⟩ + unfold detJetRemainder + have hm (σ : Equiv.Perm (Fin n)) : MemLp (fun x => (Equiv.Perm.sign σ : ℂ)* + ((monoRemainder ws).map (fun s => monoEval e (fun i x => F z (σ i) i x) s x)).sum) 2 volume := by + have hs : ∀ L : List (Fin n → List ι), MemLp (fun x => (L.map + (fun s => monoEval e (fun i x => F z (σ i) i x) s x)).sum) 2 volume := by + intro L + induction L with + | nil => simp + | cons a L ih => + exact ((monoEval_smooth e _ (fun i => (F z (σ i) i).smooth') a).continuous.memLp_of_hasCompactSupport + (monoEval_compact e _ (fun i => hc z (σ i) i) a)).add ih + exact (hs _).const_mul _ + have hh := lpNorm_sum_le (s:=Finset.univ) (fun σ _ => hm σ) (by norm_num : (1:ℝ≥0∞) ≤ 2) + have heval : (∑ σ : Equiv.Perm (Fin n), fun x => (Equiv.Perm.sign σ : ℂ)*((monoRemainder ws).map + (fun s => monoEval e (fun i x => F z (σ i) i x) s x)).sum) = + (fun x => ∑ σ : Equiv.Perm (Fin n), (Equiv.Perm.sign σ : ℂ)*((monoRemainder ws).map + (fun s => monoEval e (fun i x => F z (σ i) i x) s x)).sum) := by + funext x + exact Finset.sum_apply _ _ _ + rw [heval] at hh + apply hh.trans + apply Finset.sum_le_sum + intro σ _ + have he : (fun x => (Equiv.Perm.sign σ : ℂ)*((monoRemainder ws).map + (fun s => monoEval e (fun i x => F z (σ i) i x) s x)).sum) = + (Equiv.Perm.sign σ : ℂ) • (fun x => ((monoRemainder ws).map + (fun s => monoEval e (fun i x => F z (σ i) i x) s x)).sum) := rfl + rw [he,lpNorm_const_smul] + exact mul_le_mul_of_nonneg_left (hcb σ z) (norm_nonneg _) +end TameInterpolation + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/UniformFrozenEstimate.lean b/lean/OAI/Geometry/PrescribedRicci/UniformFrozenEstimate.lean new file mode 100644 index 0000000000000000000000000000000000000000..c8b09123d75f1dac4decca2edaa517244ac09ebf --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/UniformFrozenEstimate.lean @@ -0,0 +1,71 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.HermitianCoercivity +import OAI.Geometry.PrescribedPotential.SobolevParametrix + +namespace OAI + +/-! Uniform Frozen Estimate. -/ + +noncomputable section +open Matrix MeasureTheory TemperedDistribution +open scoped ComplexOrder MatrixOrder Matrix.Norms.Elementwise SchwartzMap Real +namespace FrozenPoisson +open EllipticKernel SobolevChart MongeAmpere +variable {n : ℕ} + +lemma trace_rankOne_hermPair (H : Matrix (Fin n) (Fin n) ℂ) (ξ : EC n) : + traceBilin H (rankOne ξ) = (1/4:ℝ)*(hermPair H⁻¹ (coordinateEquiv n ξ) (coordinateEquiv n ξ)).re := by + rw [traceBilin_apply,pull_rankOne,Matrix.mul_smul,Matrix.trace_smul] + simp only [Complex.smul_re,smul_eq_mul] + congr 1 + rw [Matrix.mul_vecMulVec,Matrix.trace_vecMulVec,dotProduct_comm] + rfl + +lemma coordinate_coercivity (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + {M : ℝ} (hM : ‖H‖ ≤ M) (ξ : EC n) : + ‖ξ‖^2 ≤ (n:ℝ)*M*(hermPair H⁻¹ (coordinateEquiv n ξ) (coordinateEquiv n ξ)).re := by + let : Invertible H := Matrix.invertibleOfIsUnitDet H (isUnit_iff_ne_zero.mpr hH.det_pos.ne') + have hp := hermPair_nonneg hH.inv.posSemidef (coordinateEquiv n ξ) + have hc (i : Fin n) : ‖ξ i‖^2 ≤ M*(hermPair H⁻¹ (coordinateEquiv n ξ) (coordinateEquiv n ξ)).re := by + apply (component_sq_le_hermPair hH.inv (coordinateEquiv n ξ) i).trans + rw [Matrix.inv_inv_of_invertible] + exact mul_le_mul_of_nonneg_right ((Complex.re_le_norm _).trans + ((norm_entry_le_entrywise_sup_norm H).trans hM)) hp + rw [PiLp.norm_sq_eq_of_L2] + apply (Finset.sum_le_sum (fun i _ => hc i)).trans_eq + simp only [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul,mul_assoc] + +def uniformEllipticBound (n : ℕ) (M : ℝ) : ℝ := 1+(n:ℝ)*M/Real.pi^2 + +lemma uniformEllipticBound_pos {M : ℝ} (hM : 0 ≤ M) : + 0 < uniformEllipticBound n M := by unfold uniformEllipticBound; positivity + +lemma gainSymbol_uniform_bound (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + {M : ℝ} (hM : 0 ≤ M) (hHM : ‖H‖ ≤ M) (ξ : EC n) : + ‖gainSymbol H ξ‖ ≤ uniformEllipticBound n M := by + have hc := coordinate_coercivity H hH hHM ξ + have hs : symbol H ξ = Real.pi^2*(hermPair H⁻¹ (coordinateEquiv n ξ) (coordinateEquiv n ξ)).re := by + rw [symbol,trace_rankOne_hermPair]; ring + have he : ‖ξ‖^2 ≤ ((n:ℝ)*M/Real.pi^2)*symbol H ξ := by + rw [hs] + convert hc using 1 + field_simp + have hp := symbol_nonneg H hH ξ + simp only [gainSymbol,inverseSymbol,← Complex.ofReal_mul,Complex.norm_real,Real.norm_eq_abs] + rw [abs_of_nonneg (by positivity),mul_inv_le_iff₀ (by positivity)] + have hq : 0 ≤ (n:ℝ)*M/Real.pi^2 := by positivity + dsimp [uniformEllipticBound] + nlinarith only [he,hp,hq] + +lemma hilbertResolvent_uniform_bound (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + {M : ℝ} (hM : 0 ≤ M) (hHM : ‖H‖ ≤ M) (u : L2 (EC n)) : + ‖hilbertResolvent H hH u‖ ≤ uniformEllipticBound n M*‖u‖ := by + apply (multiplier_norm_le (gainSymbolBCF H hH) u).trans + apply mul_le_mul_of_nonneg_right _ (norm_nonneg u) + exact (BoundedContinuousFunction.norm_le (uniformEllipticBound_pos hM).le).mpr + (gainSymbol_uniform_bound H hH hM hHM) +end FrozenPoisson + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/UniformL2.lean b/lean/OAI/Geometry/PrescribedRicci/UniformL2.lean new file mode 100644 index 0000000000000000000000000000000000000000..ffb089b653edfab0eb3f459fec71ce6440d17fe6 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/UniformL2.lean @@ -0,0 +1,73 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.UniformSchwartz + +namespace OAI + +/-! Uniform L2. -/ + +section + + +noncomputable section +open Set MeasureTheory +open scoped ContDiff SchwartzMap ENNReal Classical +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] {Z : Type*} +variable {V : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] + +def UniformL2 (F : Z → E → V) : Prop := + (∀ z, MemLp (F z) 2 volume) ∧ ∃ C : ℝ, 0 ≤ C ∧ ∀ z, lpNorm (F z) 2 volume ≤ C + +lemma UniformSobolev.uniformL2 {F : Z → 𝓢(E,ℂ)} (hF : UniformSobolev 0 F) : + UniformL2 (fun z => (F z : E → ℂ)) := + ⟨fun z => (F z).memLp _ _,(uniformSobolev_zero_iff F).mp hF⟩ + +omit [NormedSpace ℝ V] in +lemma UniformL2.norm {F : Z → E → V} (h : UniformL2 F) : UniformL2 (fun z x => ‖F z x‖) := by + refine ⟨fun z => (h.1 z).norm,?_⟩ + obtain ⟨C,hC,hc⟩ := h.2 + exact ⟨C,hC,fun z => by rw [lpNorm_norm (h.1 z).aestronglyMeasurable]; exact hc z⟩ + +omit [NormedSpace ℝ V] in +lemma UniformL2.add {F G : Z → E → V} (hF : UniformL2 F) (hG : UniformL2 G) : + UniformL2 (fun z x => F z x+G z x) := by + obtain ⟨C,hC,hc⟩ := hF.2 + obtain ⟨B,hB,hb⟩ := hG.2 + refine ⟨fun z => (hF.1 z).add (hG.1 z),C+B,add_nonneg hC hB,fun z => ?_⟩ + exact (lpNorm_add_le (hF.1 z) (by norm_num)).trans (add_le_add (hc z) (hb z)) + +lemma UniformL2.smul {F : Z → E → V} (hF : UniformL2 F) (c : ℝ) : + UniformL2 (fun z x => c • F z x) := by + obtain ⟨C,hC,hc⟩ := hF.2 + refine ⟨fun z => (hF.1 z).const_smul c,‖c‖*C,mul_nonneg (norm_nonneg _) hC,fun z => ?_⟩ + change lpNorm (c • F z) 2 volume ≤ _ + rw [lpNorm_const_smul] + exact mul_le_mul_of_nonneg_left (hc z) (norm_nonneg _) + +omit [NormedSpace ℝ V] in +lemma UniformL2.zero : UniformL2 (fun _ : Z => (0 : E → V)) := + ⟨fun _ => MemLp.zero,0,le_rfl,fun _ => by simp⟩ + +omit [NormedSpace ℝ V] in +lemma UniformL2.sum {ι : Type*} (S : Finset ι) (F : ι → Z → E → V) + (h : ∀ i ∈ S, UniformL2 (F i)) : UniformL2 (fun z x => ∑ i ∈ S, F i z x) := by + induction S using Finset.induction_on with + | empty => + simp only [Finset.sum_empty] + exact UniformL2.zero + | @insert a S ha ih => + simpa only [Finset.sum_insert ha] using + (h a (Finset.mem_insert_self a S)).add (ih (fun i hi => h i (Finset.mem_insert_of_mem hi))) + +lemma UniformSobolev.zero_of_majorant {F : Z → 𝓢(E,ℂ)} {G : Z → E → ℝ} + (hG : UniformL2 G) (h : ∀ z x, ‖F z x‖ ≤ G z x) : UniformSobolev 0 F := by + obtain ⟨C,hC,hc⟩ := hG.2 + apply (uniformSobolev_zero_iff F).mpr + exact ⟨C,hC,fun z => (lpNorm_mono_real (hG.1 z) (h z)).trans (hc z)⟩ +end SobolevChart + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/UniformLocalGain.lean b/lean/OAI/Geometry/PrescribedRicci/UniformLocalGain.lean new file mode 100644 index 0000000000000000000000000000000000000000..599fade983b064fe06a909095460b41b610a50d8 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/UniformLocalGain.lean @@ -0,0 +1,96 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.LocalDeterminantGain +import OAI.Geometry.PrescribedRicci.SchwartzHessianWords +import OAI.Geometry.PrescribedRicci.SobolevCommutatorBound +import OAI.Geometry.PrescribedRicci.UniformSchwartz + +namespace OAI + +/-! Uniform Local Gain. -/ + +section + + + +noncomputable section +open Set Filter Topology Matrix _root_.MeasureTheory _root_.OAI.MeasureTheory LineDeriv +open scoped ContDiff SchwartzMap Classical Matrix.Norms.Elementwise BoundedContinuousFunction +open scoped ComplexOrder MatrixOrder +namespace FrozenPoisson +open SobolevChart EllipticKernel MetricLocalization +variable {n : ℕ} {Z : Type*} +lemma uniform_schwartz_H2_of_differential {M : ℝ} (hM : 0 ≤ M) + (H : Z → Matrix (Fin n) (Fin n) ℂ) (hH : ∀ z, (H z).PosDef) + (hHM : ∀ z, ‖H z‖ ≤ M) + (a : Z → BasisIndex n → BasisIndex n → EC n →ᵇ ℂ) + (ha : ∀ z i j, (a z i j : EC n → ℂ).HasTemperateGrowth) + (hsmall : ∀ z, perturbationBound (stdOrthonormalBasis ℝ (EC n)) (a z)*uniformEllipticBound n M ≤ 1/2) + (F : Z → 𝓢(EC n,ℂ)) (hF : UniformSobolev 0 F) + (hD : UniformSobolev 0 (fun z => schwartzDifferential (extendedCoefficient (H z) (a z)) (F z))) : + UniformSobolev 2 F := by + apply uniform_schwartz_H2 hM H hH hHM a ha hsmall F + (fun z => F z-schwartzDifferential (extendedCoefficient (H z) (a z)) (F z)) (hF.sub hD) + intro z + rw [map_sub,schwartzDifferential_distribution _ (extendedCoefficient_temperate _ _ (ha z))] +end FrozenPoisson +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] {Z : Type*} +lemma UniformSobolev.of_basis_words (k : ℕ) {s : ℝ} {F : Z → 𝓢(E,ℂ)} + (h : ∀ ws : List (Fin (Module.finrank ℝ E)), ws.length ≤ k → + UniformSobolev s (fun z => schwartzWord (ws.map (stdOrthonormalBasis ℝ E)) (F z))) : + UniformSobolev (s+k) F := by + induction k generalizing F with + | zero => simpa [schwartzWord] using h [] (by simp) + | succ k ih => + have hv := ih (fun ws hw => h ws (by omega)) + have hd (j : Fin (Module.finrank ℝ E)) := ih + (F:=fun z => ∂_{stdOrthonormalBasis ℝ E j} (F z)) (fun ws hw => by + have hh := h (ws++[j]) (by simp only [List.length_append,List.length_cons,List.length_nil]; omega) + simpa only [List.map_append,List.map_cons,List.map_nil,schwartzWord_append,schwartzWord,ContinuousLinearMap.comp_apply, + ContinuousLinearMap.id_apply,lineDerivOpCLM_apply] using hh) + convert hv.raise_one hd using 1 + push_cast + ring + +lemma UniformSobolev.list_sum {ν : Type*} (L : List ν) {s : ℝ} (F : ν → Z → 𝓢(E,ℂ)) + (h : ∀ a ∈ L, UniformSobolev s (F a)) : + UniformSobolev s (fun z => (L.map (fun a => F a z)).sum) := by + induction L with + | nil => simpa using UniformSobolev.const (Z:=Z) s (0 : 𝓢(E,ℂ)) + | cons a L ih => + simpa only [List.map_cons,List.sum_cons] using + (h a (List.mem_cons_self)).add (ih (fun b hb => h b (List.mem_cons_of_mem a hb))) + +lemma uniform_cutoff_commutator (κ : 𝓢(E,ℂ)) (ws : List E) + {F : Z → 𝓢(E,ℂ)} (hF : UniformSobolev ((ws.length:ℝ)+1) F) : + UniformSobolev 2 (fun z => schwartzWord ws (SchwartzMap.smulLeftCLM ℂ κ (F z))- + SchwartzMap.smulLeftCLM ℂ κ (schwartzWord ws (F z))) := by + simp_rw [schwartz_word_product_commutator,add_sub_cancel_left] + apply UniformSobolev.list_sum + intro p hp + have hh := commutatorWords_orders ws p hp + apply UniformSobolev.of_coreBound (hF.word (t:=2) p.2 (by + have hlen : (p.2.length:ℝ)+1 ≤ ws.length := by exact_mod_cast (show p.2.length+1 ≤ ws.length by omega) + linarith)) + exact coreBound_product_integer (schwartzWord p.1 κ) 2 + +lemma uniform_cutoff_word_gain (κ : 𝓢(E,ℂ)) (k : ℕ) {F : Z → 𝓢(E,ℂ)} + (hF : UniformSobolev ((k:ℝ)+1) F) + (h : ∀ ws : List (Fin (Module.finrank ℝ E)), ws.length ≤ k → + UniformSobolev 2 (fun z => SchwartzMap.smulLeftCLM ℂ κ + (schwartzWord (ws.map (stdOrthonormalBasis ℝ E)) (F z)))) : + UniformSobolev ((k:ℝ)+2) (fun z => SchwartzMap.smulLeftCLM ℂ κ (F z)) := by + have hh := UniformSobolev.of_basis_words (F:=fun z => SchwartzMap.smulLeftCLM ℂ κ (F z)) k (s:=2) (fun ws hw => by + have hcom := uniform_cutoff_commutator κ (ws.map (stdOrthonormalBasis ℝ E)) + (hF.mono (by simp only [List.length_map]; exact_mod_cast (show ws.length+1 ≤ k+1 by omega))) + convert (h ws hw).add hcom using 1 + funext z + abel) + simpa only [add_comm] using hh +end SobolevChart + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/UniformLocalH2.lean b/lean/OAI/Geometry/PrescribedRicci/UniformLocalH2.lean new file mode 100644 index 0000000000000000000000000000000000000000..552d97d8e144b803c09ab1eb1cda46e982bb7a56 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/UniformLocalH2.lean @@ -0,0 +1,49 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.UniformFrozenEstimate +import OAI.Geometry.PrescribedPotential.VariablePoisson + +namespace OAI + +/-! Uniform Local H2. -/ + +noncomputable section +open Matrix MeasureTheory TemperedDistribution +open scoped ComplexOrder MatrixOrder Matrix.Norms.Elementwise SchwartzMap Real BoundedContinuousFunction +namespace FrozenPoisson +open EllipticKernel SobolevChart +variable {n : ℕ} {ι : Type*} [Fintype ι] + +theorem uniform_H2_absorb (H : Matrix (Fin n) (Fin n) ℂ) (hH : H.PosDef) + {M : ℝ} (hM : 0 ≤ M) (hHM : ‖H‖ ≤ M) + (v : ι → EC n) (a : ι → ι → EC n →ᵇ ℂ) + (hsmall : perturbationBound v a * uniformEllipticBound n M ≤ 1/2) + (u f : L2 (EC n)) + (he : realize 2 u - frozenDifferential H (realize 2 u) - + (perturbation v a u : 𝓢'(EC n,ℂ)) = (f : 𝓢'(EC n,ℂ))) : + ‖u‖ ≤ 2*uniformEllipticBound n M*‖f‖ := by + have he' : shifted H (realize 2 u) = + ((f+perturbation v a u : L2 (EC n)) : 𝓢'(EC n,ℂ)) := by + rw [shifted_eq_identity_sub H hH] + simpa only [← Lp.toTemperedDistributionCLM_apply,map_add] using (sub_eq_iff_eq_add.mp he) + have hu : u = hilbertResolvent H hH (f+perturbation v a u) := by + apply realize_injective 2 + have hr := hilbertResolvent_realize H hH 0 (f+perturbation v a u) + simp only [zero_add] at hr + have hzero : realize 0 (f+perturbation v a u) = ((f+perturbation v a u : L2 (EC n)) : 𝓢'(EC n,ℂ)) := by + simp only [realize,neg_zero,besselPotential_zero,ContinuousLinearMap.comp_apply, + ContinuousLinearMap.id_apply,Lp.toTemperedDistributionCLM_apply] + rw [hr,hzero,← he',resolvent_shifted H hH] + have hC := (uniformEllipticBound_pos (n:=n) hM).le + have h1 := hilbertResolvent_uniform_bound H hH hM hHM (f+perturbation v a u) + rw [← hu] at h1 + have h2 := norm_add_le f (perturbation v a u) + have h3 := perturbation_bound v a u + have h4 := mul_le_mul_of_nonneg_left (h2.trans (add_le_add_right h3 _)) hC + have h5 := mul_le_mul_of_nonneg_right hsmall (norm_nonneg u) + nlinarith only [h1,h4,h5] + +end FrozenPoisson + +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/UniformMetricBounds.lean b/lean/OAI/Geometry/PrescribedRicci/UniformMetricBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..29dfc4f533111f63ec68539476fd6c4b997572aa --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/UniformMetricBounds.lean @@ -0,0 +1,84 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.GlobalKahlerIntegral +import OAI.Geometry.PrescribedPotential.GlobalSobolev +import OAI.Geometry.PrescribedRicci.MatrixCompactBounds +import OAI.Geometry.PrescribedRicci.TraceEntryBounds +import OAI.Geometry.PrescribedRicci.TraceMaximum +import OAI.Geometry.PrescribedPotential.VolumePath + +namespace OAI + +/-! Uniform Metric Bounds. -/ + +section + + + +noncomputable section +open Matrix Set Filter Topology +open scoped ComplexOrder MatrixOrder Matrix.Norms.Elementwise +namespace Anticanonical.SourceSmooth.KaehlerMetric +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} + + + +theorem volumePath_metric_bounds (g : KaehlerMetric A) (line : SemipositiveAnticanonicalMetric A) + (hd : 2 ≤ d) : ∃ K : ℝ, 0 < K ∧ + ∀ (φ : SmoothRealFunction A) (hp : g.PositivePotential φ), g.integral φ.value = 0 → + ∀ (t b : ℝ), t ∈ Icc (0:ℝ) 1 → + (∀ x, (g.logRatio (g.deform φ hp)).value x = t*(prescribedForcing g line).value x+b) → + ∀ q : Fin A.count, ∀ x ∈ tsupport (chartPartition (A:=A) q).value, + ‖(g.deform φ hp).matrix q (A.chart q x)‖ ≤ K ∧ + ‖((g.deform φ hp).matrix q (A.chart q x))⁻¹‖ ≤ K := by + have hd' : 0 < d := by omega + let : Nonempty (Fin d) := Fin.pos_iff_nonempty.mp hd' + obtain ⟨T,hT,htrace⟩ := g.volumePath_trace_bound line hd + obtain ⟨M,hM,hbg⟩ := g.compact_background_bounds (prescribedForcing g line) + have hM0 : 0 ≤ M := by linarith + obtain ⟨D,hD,hdet⟩ := MongeAmpere.compact_matrix_bound + (show Continuous (fun H : Matrix (Fin d) (Fin d) ℂ => H.det.re) from + Complex.continuous_re.comp continuous_id.matrix_det) M + obtain ⟨Q,hQ,hmetric⟩ := MongeAmpere.metric_norm_bound_from_inverse (n:=Fin d) (M*T) + let E := Real.exp (2*‖(⟨(prescribedForcing g line).value, + (prescribedForcing g line).continuous⟩ : C(X,ℝ))‖) + have hE : 0 < E := Real.exp_pos _ + refine ⟨1+M*T+E*D*Q,by positivity,?_⟩ + intro φ hp hm t b ht heq q x hx + have hxs := chartPartition_support q hx + have hz := (A.chart q).mapsTo hxs + let H := (g.deform φ hp).matrix q (A.chart q x) + have hH := (g.deform φ hp).positive q (A.chart q x) hz + have hbi : ‖H⁻¹‖ ≤ M*T := by + apply MongeAmpere.matrix_norm_le_of_entries (mul_nonneg hM0 hT.le) + intro i j + have hi := MongeAmpere.entry_le_relative_trace H⁻¹ (g.matrix q (A.chart q x)) hH.inv + (g.positive q _ hz) hM0 + (fun i => (Complex.re_le_norm _).trans ((hbg q x hx).2.1 i i)) i j + have hs := htrace φ hp hm t b ht heq x + change (g.deform φ hp).traceMetricValue g x ≤ T at hs + rw [(g.deform φ hp).traceMetricValue_local g q hxs] at hs + exact hi.trans (mul_le_mul_of_nonneg_left hs hM0) + have hdh : H.det.re ≤ E*D := by + have hv := g.density_mul_volume φ q hz + rw [(A.chart q).left_inv hxs] at hv + change (g.potentialDensity φ).value x*(g.matrix q (A.chart q x)).det.re = H.det.re at hv + rw [← hv] + have hρ := (g.volumePath_density_bounds line ht hp heq x).2 + change (g.potentialDensity φ).value x ≤ E at hρ + exact mul_le_mul hρ + (hdet _ (MongeAmpere.matrix_norm_le_of_entries hM0 (hbg q x hx).1)) + (Complex.pos_iff.mp (g.positive q _ hz).det_pos).1.le hE.le + constructor + · have hb := (hmetric H hH hbi).trans (mul_le_mul_of_nonneg_right hdh hQ.le) + change ‖H‖ ≤ _ + nlinarith [mul_nonneg hM0 hT.le] + · change ‖H⁻¹‖ ≤ _ + nlinarith [mul_nonneg (mul_nonneg hE.le hD.le) hQ.le] + +end Anticanonical.SourceSmooth.KaehlerMetric + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/UniformPathPatches.lean b/lean/OAI/Geometry/PrescribedRicci/UniformPathPatches.lean new file mode 100644 index 0000000000000000000000000000000000000000..229c721ad2ea2b07be28387466325ddc13e429c7 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/UniformPathPatches.lean @@ -0,0 +1,86 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.UniformCoefficientExtension +import OAI.Geometry.PrescribedRicci.UniformCoefficientOscillation + +namespace OAI + +/-! Uniform Path Patches. -/ + +section + + + +noncomputable section +open Matrix Set Filter Topology +open scoped ContDiff ComplexOrder MatrixOrder Matrix.Norms.Elementwise BoundedContinuousFunction +namespace Anticanonical.SourceSmooth.KaehlerMetric +open MongeAmpere EllipticKernel FrozenPoisson MetricLocalization SobolevChart +variable {d : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [CompactSpace X] + [ConnectedSpace X] {A : ComplexAtlas d X} + +theorem volumePath_uniform_patch (g : KaehlerMetric A) (line : SemipositiveAnticanonicalMetric A) + (hd : 2 ≤ d) (q : Fin A.count) (x : EC d) {R : ℝ} (hR : 0 < R) + (hsub : Metric.closedBall x R ⊆ (A.euclideanChart q).target) + {ι : Type*} [Fintype ι] (v : ι → EC d) : + ∃ M r : ℝ, 0 < M ∧ 0 < r ∧ r ≤ R ∧ + ∀ (φ : SmoothRealFunction A) (hp : g.PositivePotential φ), g.integral φ.value = 0 → + ∀ t b : ℝ, t ∈ Icc (0:ℝ) 1 → + (∀ y, (g.logRatio (g.deform φ hp)).value y = t*(prescribedForcing g line).value y+b) → + ‖(g.deform φ hp).matrix q (coordinateEquiv d x)‖ ≤ M ∧ + ∃ a : ι → ι → EC d →ᵇ ℂ, + (∀ i j, ContDiff ℝ ∞ (a i j : EC d → ℂ)) ∧ + (∀ i j, HasCompactSupport (a i j : EC d → ℂ)) ∧ + perturbationBound v a*uniformEllipticBound d M ≤ 1/2 ∧ + ∀ y ∈ Metric.closedBall x (r/2), ∀ i j, + a i j y = (traceBilin ((g.deform φ hp).matrix q (coordinateEquiv d y)) (rankTwo (v i) (v j)) : ℂ)- + (traceBilin ((g.deform φ hp).matrix q (coordinateEquiv d x)) (rankTwo (v i) (v j)) : ℂ) := by + let K : Set (Coordinates d) := coordinateEquiv d '' Metric.closedBall x R + have hK : IsCompact K := (isCompact_closedBall x R).image (coordinateEquiv d).continuous + have hKc : Convex ℝ K := (convex_closedBall x R).linear_image (coordinateEquiv d).toLinearMap + have hKt : K ⊆ (A.chart q).target := by + rintro z ⟨y,hy,rfl⟩ + simpa using hsub hy + have hxK : coordinateEquiv d x ∈ K := ⟨x,Metric.mem_closedBall_self hR.le,rfl⟩ + obtain ⟨M,hM,hmetric⟩ := g.volumePath_metric_bounds_on_compact line hd q hK hKt + obtain ⟨P,hP,hlip⟩ := g.volumePath_metric_lipschitz_on_compact line hd q hK hKc hKt + let Q : ℝ := ∑ i, ∑ j, ‖PotentialKaehler.hermitianPartMatrix (pullBilin (rankTwo (v i) (v j)))‖ + have hQ : 0 ≤ Q := by dsimp only [Q]; positivity + have hBQ (i j : ι) : ‖PotentialKaehler.hermitianPartMatrix (pullBilin (rankTwo (v i) (v j)))‖ ≤ Q := by + apply (Finset.single_le_sum (fun _ _ => norm_nonneg _) (Finset.mem_univ j)).trans + exact Finset.single_le_sum (f:=fun i => ∑ j, ‖PotentialKaehler.hermitianPartMatrix (pullBilin (rankTwo (v i) (v j)))‖) + (fun _ _ => Finset.sum_nonneg fun _ _ => norm_nonneg _) (Finset.mem_univ i) + let B : ℝ := (d:ℝ)^2*P*‖(coordinateEquiv d).toContinuousLinearMap‖*Q + have hB : 0 ≤ B := by dsimp only [B]; positivity + obtain ⟨r,hr,hrR,hpatch⟩ := uniform_coefficient_radius v hM.le hB hR + refine ⟨M,r,hM,hr,hrR,?_⟩ + intro φ hp hm t b ht heq + refine ⟨(hmetric φ hp hm t b ht heq _ hxK).1,?_⟩ + let H : EC d → Matrix (Fin d) (Fin d) ℂ := fun y => (g.deform φ hp).matrix q (coordinateEquiv d y) + have hH : ContDiffOn ℝ ∞ H (A.euclideanChart q).target := by + apply ((g.deform φ hp).smooth q).comp (coordinateEquiv d).contDiff.contDiffOn + intro y hy + simpa using hy + have hh : ∀ y ∈ (A.euclideanChart q).target, (H y).PosDef := by + intro y hy + exact (g.deform φ hp).positive q _ (by simpa using hy) + apply hpatch x (A.euclideanChart q).target (A.euclideanChart q).open_target hsub H hH hh + intro y hy i j + have hyK : coordinateEquiv d y ∈ K := ⟨y,hy,rfl⟩ + have hI := (hlip φ hp hm t b ht heq _ hxK _ hyK).2 + have hc : ‖coordinateEquiv d y-coordinateEquiv d x‖ ≤ + ‖(coordinateEquiv d).toContinuousLinearMap‖*‖y-x‖ := by + rw [← map_sub] + exact (coordinateEquiv d).toContinuousLinearMap.le_opNorm (y-x) + have hI' : ‖(H y)⁻¹-(H x)⁻¹‖ ≤ P*‖(coordinateEquiv d).toContinuousLinearMap‖*‖y-x‖ := by + exact hI.trans (by simpa only [mul_assoc] using mul_le_mul_of_nonneg_left hc hP.le) + apply (traceBilin_difference_bound (H y) (H x) (rankTwo (v i) (v j))).trans + apply (mul_le_mul (mul_le_mul_of_nonneg_left hI' (by positivity)) (hBQ i j) + (norm_nonneg _) (by positivity)).trans_eq + dsimp only [B] + ring +end Anticanonical.SourceSmooth.KaehlerMetric + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/UniformSchwartz.lean b/lean/OAI/Geometry/PrescribedRicci/UniformSchwartz.lean new file mode 100644 index 0000000000000000000000000000000000000000..3c3ec4ee76ea052c593c98e23d03200b050cd95e --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/UniformSchwartz.lean @@ -0,0 +1,114 @@ +import Mathlib +import OAI.Geometry.PrescribedPotential.ChartParametrix +import OAI.Geometry.PrescribedRicci.JetSobolev +import OAI.Geometry.PrescribedRicci.UniformLocalH2 + +namespace OAI + +/-! Uniform Schwartz. -/ + +section + + + +noncomputable section +open Set Finset MeasureTheory LineDeriv TemperedDistribution +open scoped ContDiff Classical BigOperators ENNReal SchwartzMap BoundedContinuousFunction Real +open scoped ComplexOrder MatrixOrder Matrix.Norms.Elementwise +namespace SobolevChart +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] {Z : Type*} + +def UniformSobolev (s : ℝ) (F : Z → 𝓢(E,ℂ)) : Prop := + ∃ C : ℝ, 0 ≤ C ∧ ∀ z, ‖schwartzCoord s (F z)‖ ≤ C + +lemma UniformSobolev.of_coreBound {s t : ℝ} {F : Z → 𝓢(E,ℂ)} + (hF : UniformSobolev s F) {T : 𝓢(E,ℂ) → 𝓢(E,ℂ)} (hT : CoreBound s t T) : + UniformSobolev t (fun z => T (F z)) := by + obtain ⟨C,hC,hc⟩ := hF + obtain ⟨B,hB,hb⟩ := hT + exact ⟨B*C,mul_nonneg hB hC,fun z => (hb _).trans (mul_le_mul_of_nonneg_left (hc z) hB)⟩ + +lemma UniformSobolev.mono {s t : ℝ} {F : Z → 𝓢(E,ℂ)} + (hF : UniformSobolev s F) (hst : t ≤ s) : UniformSobolev t F := + hF.of_coreBound (T:=id) (CoreBound.id hst) + +lemma UniformSobolev.add {s : ℝ} {F G : Z → 𝓢(E,ℂ)} + (hF : UniformSobolev s F) (hG : UniformSobolev s G) : UniformSobolev s (fun z => F z+G z) := by + obtain ⟨C,hC,hc⟩ := hF + obtain ⟨B,hB,hb⟩ := hG + refine ⟨C+B,add_nonneg hC hB,fun z => ?_⟩ + rw [schwartzCoord_add] + exact (norm_add_le _ _).trans (add_le_add (hc z) (hb z)) + +lemma UniformSobolev.const (s : ℝ) (f : 𝓢(E,ℂ)) : UniformSobolev s (fun _ : Z => f) := + ⟨‖schwartzCoord s f‖,norm_nonneg _,fun _ => le_rfl⟩ + +lemma UniformSobolev.sum {s : ℝ} {κ : Type*} (I : Finset κ) + (F : κ → Z → 𝓢(E,ℂ)) (hF : ∀ i ∈ I, UniformSobolev s (F i)) : + UniformSobolev s (fun z => ∑ i ∈ I, F i z) := by + induction I using Finset.induction_on with + | empty => simpa using UniformSobolev.const (Z:=Z) s (0 : 𝓢(E,ℂ)) + | @insert i I hi ih => + simp only [Finset.sum_insert hi] + exact (hF i (Finset.mem_insert_self i I)).add (ih (fun j hj => hF j (Finset.mem_insert_of_mem hj))) + +lemma UniformSobolev.deriv {s t : ℝ} {F : Z → 𝓢(E,ℂ)} + (hF : UniformSobolev s F) (v : E) (hst : t ≤ s-1) : + UniformSobolev t (fun z => ∂_{v} (F z)) := hF.of_coreBound (coreBound_deriv v hst) + +lemma UniformSobolev.word {s t : ℝ} {F : Z → 𝓢(E,ℂ)} + (hF : UniformSobolev s F) (ws : List E) (hst : t ≤ s-ws.length) : + UniformSobolev t (fun z => schwartzWord ws (F z)) := hF.of_coreBound (coreBound_word ws hst) + +lemma uniformSobolev_zero_iff (F : Z → 𝓢(E,ℂ)) : UniformSobolev 0 F ↔ + ∃ C : ℝ, 0 ≤ C ∧ ∀ z, lpNorm (F z : E → ℂ) 2 volume ≤ C := by + simp only [UniformSobolev,TameInterpolation.lpNorm_schwartz_zero] + +lemma uniformSobolev_raise_two {s : ℝ} {F : Z → 𝓢(E,ℂ)} + (hF : UniformSobolev s F) + (hD : ∀ j, UniformSobolev s (fun z => + ∂_{stdOrthonormalBasis ℝ E j} (∂_{stdOrthonormalBasis ℝ E j} (F z)))) : + UniformSobolev (s+2) F := by + obtain ⟨C,hC,hc⟩ := hF + choose B hB hb using hD + refine ⟨C+‖(((2*Real.pi)^2:ℝ):ℂ)⁻¹‖*∑ j, B j,add_nonneg hC (mul_nonneg (norm_nonneg _) (Finset.sum_nonneg fun j _ => hB j)),fun z => ?_⟩ + apply (schwartzCoord_raise_two_norm s (F z)).trans + exact add_le_add (hc z) (mul_le_mul_of_nonneg_left + (Finset.sum_le_sum (fun j _ => hb j z)) (norm_nonneg _)) +end SobolevChart + +namespace FrozenPoisson +open SobolevChart EllipticKernel MetricLocalization +variable {n : ℕ} {Z : Type*} + +theorem uniform_schwartz_H2 {M : ℝ} (hM : 0 ≤ M) + (H : Z → Matrix (Fin n) (Fin n) ℂ) (hH : ∀ z, (H z).PosDef) + (hHM : ∀ z, ‖H z‖ ≤ M) + (a : Z → BasisIndex n → BasisIndex n → EC n →ᵇ ℂ) + (ha : ∀ z i j, (a z i j : EC n → ℂ).HasTemperateGrowth) + (hsmall : ∀ z, perturbationBound (stdOrthonormalBasis ℝ (EC n)) (a z) * + uniformEllipticBound n M ≤ 1/2) + (F G : Z → 𝓢(EC n,ℂ)) (hG : UniformSobolev 0 G) + (he : ∀ z, (SchwartzMap.toTemperedDistributionCLM (EC n) ℂ volume (F z)) - + chartDifferential (extendedCoefficient (H z) (a z)) (SchwartzMap.toTemperedDistributionCLM (EC n) ℂ volume (F z)) = + (SchwartzMap.toTemperedDistributionCLM (EC n) ℂ volume (G z))) : UniformSobolev 2 F := by + obtain ⟨C,hC,hc⟩ := hG + have hU := (uniformEllipticBound_pos (n:=n) hM).le + refine ⟨2*uniformEllipticBound n M*C,by positivity,fun z => ?_⟩ + have hEq : realize 2 (schwartzCoord 2 (F z)) - frozenDifferential (H z) (realize 2 (schwartzCoord 2 (F z))) - + (perturbation (stdOrthonormalBasis ℝ (EC n)) (a z) (schwartzCoord 2 (F z)) : 𝓢'(EC n,ℂ)) = + (schwartzCoord 0 (G z) : 𝓢'(EC n,ℂ)) := by + rw [sub_sub,← chartDifferential_extension (H z) (a z) (ha z),realize_schwartzCoord] + have h0 : (schwartzCoord 0 (G z) : 𝓢'(EC n,ℂ)) = (SchwartzMap.toTemperedDistributionCLM (EC n) ℂ volume (G z)) := by + rw [schwartzCoord_distribution,besselPotential_zero,ContinuousLinearMap.id_apply] + rw [h0] + exact he z + exact (uniform_H2_absorb (H z) (hH z) hM (hHM z) _ _ (hsmall z) _ _ hEq).trans + (mul_le_mul_of_nonneg_left (hc z) (by positivity)) +end FrozenPoisson + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/VolumePathRicci.lean b/lean/OAI/Geometry/PrescribedRicci/VolumePathRicci.lean new file mode 100644 index 0000000000000000000000000000000000000000..623871e7768bc610f32054eeac1aae17559a7412 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/VolumePathRicci.lean @@ -0,0 +1,85 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.CurvatureRicci +import OAI.Geometry.PrescribedPotential.VolumePath + +namespace OAI + +/-! Volume Path Ricci. -/ + +section + + +noncomputable section +open Matrix Filter Set Topology +open scoped ContDiff ComplexOrder MatrixOrder Matrix.Norms.Elementwise +namespace PotentialKaehler +variable {d : ℕ} + +lemma potentialMatrix_add_const (f : V d → ℝ) (z : V d) (c : ℝ) : + potentialMatrix (fun y => f y+c) z = potentialMatrix f z := by + unfold potentialMatrix + have he : fderiv ℝ (fun y => f y+c) = fderiv ℝ f := by + funext y + exact fderiv_add_const c + rw [he] + +lemma potentialMatrix_affine {f g : V d → ℝ} {z : V d} + (hf : ContDiffAt ℝ ∞ f z) (hg : ContDiffAt ℝ ∞ g z) (t c : ℝ) : + potentialMatrix (fun y => f y+t*g y+c) z = + potentialMatrix f z + (t:ℂ) • potentialMatrix g z := by + rw [potentialMatrix_add_const] + change hermitianPartMatrix (fderiv ℝ (fderiv ℝ (f+t • g)) z) = _ + have ht : ContDiffAt ℝ ∞ (t • g) z := hg.const_smul t + rw [EllipticKernel.hessian_add hf ht, + fderiv_const_smul_field (𝕜:=ℝ) (f:=g) t, + fderiv_const_smul_field (𝕜:=ℝ) (f:=fderiv ℝ g) t, + EllipticKernel.hermitianPartMatrix_add] + congr 1 + ext a b + simp only [hermitianPartMatrix_apply,Matrix.smul_apply] + apply Complex.ext <;> + simp [potentialMatrix,hermitianPartMatrix_apply,hermitianPart,Pi.smul_apply,smul_eq_mul,Complex.mul_re,Complex.mul_im] <;> ring + +end PotentialKaehler +namespace Anticanonical.SourceSmooth +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +namespace KaehlerMetric + +lemma ricciPotential_contDiffAt (g : KaehlerMetric A) (q : Fin A.count) + {z : Coordinates d} (hz : z ∈ (A.chart q).target) : + ContDiffAt ℝ ∞ (g.ricciPotential q) z := + (((g.volumeCoefficient_smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hz)).log + (g.volumeCoefficient_pos q hz).ne').neg + +lemma volumePath_ricci (g : KaehlerMetric A) (line : SemipositiveAnticanonicalMetric A) + {t b : ℝ} {φ : SmoothRealFunction A} (hp : g.PositivePotential φ) + (heq : ∀ x, (g.logRatio (g.deform φ hp)).value x = + t*(prescribedForcing g line).value x+b) + (q : Fin A.count) {z : Coordinates d} (hz : z ∈ (A.chart q).target) : + (g.deform φ hp).curvatureRicci q z = + g.curvatureRicci q z - (t:ℂ) • (prescribedForcing g line).hessian q z := by + have he : (g.deform φ hp).ricciPotential q =ᶠ[nhds z] + (fun y => g.ricciPotential q y+(-t)*(prescribedForcing g line).localExpression q y+(-b)) := by + filter_upwards [(A.chart q).open_target.mem_nhds hz] with y hy + have hh := heq ((A.chart q).symm y) + change (g.logRatio (g.deform φ hp)).localExpression q y = + t*(prescribedForcing g line).localExpression q y+b at hh + rw [g.logRatio_local _ q hy] at hh + unfold ricciPotential + linarith + rw [(g.deform φ hp).curvatureRicci_eq q hz, + PotentialKaehler.potentialMatrix_congr he, + PotentialKaehler.potentialMatrix_affine (g.ricciPotential_contDiffAt q hz) + (show ContDiffAt ℝ ∞ ((prescribedForcing g line).localExpression q) z from + ((prescribedForcing g line).smooth q).contDiffAt ((A.chart q).open_target.mem_nhds hz)), + g.curvatureRicci_eq q hz] + simp only [Complex.ofReal_neg,neg_smul,sub_eq_add_neg] + rfl + +end KaehlerMetric +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/WeightedMongeAmpereEnergy.lean b/lean/OAI/Geometry/PrescribedRicci/WeightedMongeAmpereEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..164fdd6ef551fa5bc1306e004c4d22b5581cfee4 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/WeightedMongeAmpereEnergy.lean @@ -0,0 +1,110 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.GlobalKahlerEnergy +import OAI.Geometry.PrescribedRicci.GlobalKahlerIntegral +import OAI.Geometry.PrescribedRicci.KahlerEnergyChain +import OAI.Geometry.PrescribedRicci.MongeAmpereEnergy + +namespace OAI + +/-! Weighted Monge Ampere Energy. -/ + +section + + +noncomputable section +open Set Filter Topology Matrix MeasureTheory +open scoped ContDiff ComplexOrder Classical +namespace Anticanonical.SourceSmooth +variable {d : ℕ} {X : Type*} [TopologicalSpace X] {A : ComplexAtlas d X} +namespace KaehlerMetric + +lemma integral_weighted_energy_segment [T2Space X] [CompactSpace X] + (g : KaehlerMetric A) (φ : SmoothRealFunction A) (hp : g.PositivePotential φ) + (hd : 0 < d) (W : X → ℝ) (hW : Continuous W) (hWpos : ∀ x, 0 ≤ W x) + (s : ℝ) (hs : s ∈ Ico 0 1) : + (1 - s) ^ (d - 1) * g.integral (fun x => W x * (g.energy φ φ).value x) ≤ + (g.deform (φ.realSMul s) (hp.segment ⟨hs.1, hs.2.le⟩)).integral + (fun x => W x * ((g.deform (φ.realSMul s) (hp.segment ⟨hs.1, hs.2.le⟩)).energy φ φ).value x) := by + let gs := g.deform (φ.realSMul s) (hp.segment ⟨hs.1, hs.2.le⟩) + rw [← g.integral_const_mul, ← g.integral_density (φ.realSMul s) (hp.segment ⟨hs.1, hs.2.le⟩)] + apply g.integral_mono (continuous_const.fun_mul (hW.fun_mul (g.energy φ φ).continuous)) + ((hW.fun_mul (gs.energy φ φ).continuous).fun_mul (g.potentialDensity _).continuous) + intro x + have he := mul_le_mul_of_nonneg_left (g.energy_segment_coercive φ hp hd s hs x) (hWpos x) + change (1-s)^(d-1) * (W x * (g.energy φ φ).value x) ≤ + (W x * (gs.energy φ φ).value x) * (g.potentialDensity (φ.realSMul s)).value x + nlinarith only [he] + +lemma integral_weighted_energy_half_segment [T2Space X] [CompactSpace X] + (g : KaehlerMetric A) (φ : SmoothRealFunction A) (hp : g.PositivePotential φ) + (hd : 0 < d) (W : X → ℝ) (hW : Continuous W) (hWpos : ∀ x, 0 ≤ W x) + (s : ℝ) (hs : s ∈ Icc 0 (1/2)) : + (1/2 : ℝ) ^ (d - 1) * g.integral (fun x => W x * (g.energy φ φ).value x) ≤ + (g.deform (φ.realSMul s) (hp.segment ⟨hs.1, by linarith [hs.2]⟩)).integral + (fun x => W x * ((g.deform (φ.realSMul s) (hp.segment ⟨hs.1, by linarith [hs.2]⟩)).energy φ φ).value x) := by + have hs' : s ∈ Ico 0 1 := ⟨hs.1, by linarith [hs.2]⟩ + refine le_trans ?_ (g.integral_weighted_energy_segment φ hp hd W hW hWpos s hs') + exact mul_le_mul_of_nonneg_right + (pow_le_pow_left₀ (by norm_num) (by linarith [hs.2]) (d - 1)) + (g.integral_nonneg (fun x => mul_nonneg (hWpos x) (g.energy_nonneg φ x))) + + + +theorem mongeAmpere_weighted_energy [T2Space X] [CompactSpace X] + (g : KaehlerMetric A) (φ : SmoothRealFunction A) (hp : g.PositivePotential φ) (hd : 0 < d) + (F : ℝ → ℝ) (hF : ContDiff ℝ ∞ F) (hFpos : ∀ x, 0 ≤ deriv F x) : + (1/2 : ℝ) ^ d * g.integral (fun x => deriv F (φ.value x) * (g.energy φ φ).value x) ≤ + g.integral (fun x => F (φ.value x)) - + g.integral (fun x => F (φ.value x) * (g.potentialDensity φ).value x) := by + let ψ := φ.compose F hF + let W (x : X) := deriv F (φ.value x) + have hW : Continuous W := (hF.continuous_deriv (by simp)).comp φ.continuous + let f (t : ℝ) := g.integral (fun x => ψ.value x * (g.potentialDensity (φ.realSMul t)).value x) + have hf (s : ℝ) (hs : s ∈ Icc 0 1) := g.volume_firstVariation φ ψ s (hp.segment hs) + have hfc : ContinuousOn f (Icc 0 1) := fun s hs => (hf s hs).continuousAt.continuousWithinAt + have hfd : DifferentiableOn ℝ f (interior (Icc 0 1)) := + fun s hs => (hf s (interior_subset hs)).differentiableAt.differentiableWithinAt + have hae (s : ℝ) (hs : s ∈ Icc 0 1) : + ((g.deform (φ.realSMul s) (hp.segment hs)).energy ψ φ).value = + fun x => W x * ((g.deform (φ.realSMul s) (hp.segment hs)).energy φ φ).value x := by + funext x + exact (g.deform (φ.realSMul s) (hp.segment hs)).energy_comp_left φ φ F hF x + have ha : AntitoneOn f (Icc 0 1) := antitoneOn_of_deriv_nonpos (convex_Icc 0 1) hfc hfd (by + intro s hs + rw [(hf s (interior_subset hs)).deriv, hae s (interior_subset hs)] + exact neg_nonpos.mpr ((g.deform (φ.realSMul s) (hp.segment (interior_subset hs))).integral_nonneg + (fun x => mul_nonneg (hFpos _) ((g.deform (φ.realSMul s) (hp.segment (interior_subset hs))).energy_nonneg φ x)))) + have hsub : Icc (0 : ℝ) (1/2) ⊆ Icc 0 1 := fun s hs => ⟨hs.1, by linarith [hs.2]⟩ + have hdh : DifferentiableOn ℝ f (interior (Icc 0 (1/2))) := + fun s hs => (hf s (hsub (interior_subset hs))).differentiableAt.differentiableWithinAt + have hh := (convex_Icc (0 : ℝ) (1/2)).image_sub_le_mul_sub_of_deriv_le + (hfc.mono hsub) hdh + (C := -((1/2 : ℝ) ^ (d - 1) * g.integral (fun x => W x * (g.energy φ φ).value x))) + (by + intro s hs + rw [(hf s (hsub (interior_subset hs))).deriv, hae s (hsub (interior_subset hs))] + exact neg_le_neg (g.integral_weighted_energy_half_segment φ hp hd W hW (fun x => hFpos _) s (interior_subset hs))) + 0 (by norm_num) (1/2) (by norm_num) (by norm_num) + have he := ha (show (1/2 : ℝ) ∈ Icc 0 1 by norm_num) (show (1 : ℝ) ∈ Icc 0 1 by norm_num) (by norm_num) + have h0 : f 0 = g.integral ψ.value := by + dsimp only [f] + simp_rw [g.potentialDensity_smul_zero, mul_one] + have h1 : f 1 = g.integral (fun x => ψ.value x * (g.potentialDensity φ).value x) := by + dsimp only [f] + simp_rw [g.potentialDensity_smul_one] + have hpow : (1/2 : ℝ) ^ d = (1/2 : ℝ) ^ (d - 1) * (1/2) := by + conv_lhs => rw [show d = (d - 1) + 1 by omega, pow_succ] + rw [h0] at hh + rw [h1] at he + rw [hpow] + change ((1/2 : ℝ) ^ (d - 1) * (1/2)) * g.integral (fun x => W x * (g.energy φ φ).value x) ≤ + g.integral ψ.value - g.integral (fun x => ψ.value x * (g.potentialDensity φ).value x) + nlinarith + +end KaehlerMetric +end Anticanonical.SourceSmooth + +end +end + +end OAI diff --git a/lean/OAI/Geometry/PrescribedRicci/WirtingerScalar.lean b/lean/OAI/Geometry/PrescribedRicci/WirtingerScalar.lean new file mode 100644 index 0000000000000000000000000000000000000000..ce24a6e8fa8eb386c317dca1f744a827838ab871 --- /dev/null +++ b/lean/OAI/Geometry/PrescribedRicci/WirtingerScalar.lean @@ -0,0 +1,106 @@ +import Mathlib +import OAI.Geometry.PrescribedRicci.ComplexIntegrationByParts + +namespace OAI + +/-! Wirtinger Scalar. -/ + +noncomputable section +open Matrix Filter Set Topology +open scoped ContDiff ComplexOrder +namespace Anticanonical.SourceSmooth.KaehlerMetric +variable {d : ℕ} + +lemma holDeriv_mul {f g : Coordinates d → ℂ} {z : Coordinates d} + (hf : DifferentiableAt ℝ f z) (hg : DifferentiableAt ℝ g z) (a : Fin d) : + holDeriv (fun y => f y*g y) z a = holDeriv f z a*g z+f z*holDeriv g z a := by + unfold holDeriv + rw [fderiv_fun_mul hf hg] + simp only [_root_.add_apply,_root_.smul_apply,smul_eq_mul] + ring + +lemma holDeriv_add {f g : Coordinates d → ℂ} {z : Coordinates d} + (hf : DifferentiableAt ℝ f z) (hg : DifferentiableAt ℝ g z) (a : Fin d) : + holDeriv (fun y => f y+g y) z a = holDeriv f z a+holDeriv g z a := by + unfold holDeriv + rw [fderiv_fun_add hf hg] + simp only [_root_.add_apply] + ring + +lemma holDeriv_sum {ι : Type*} [Fintype ι] {f : ι → Coordinates d → ℂ} + {z : Coordinates d} (hf : ∀ i, DifferentiableAt ℝ (f i) z) (a : Fin d) : + holDeriv (fun y => ∑ i, f i y) z a = ∑ i, holDeriv (f i) z a := by + unfold holDeriv + rw [fderiv_fun_sum (fun i _ => hf i)] + simp only [_root_.sum_apply,← Finset.sum_sub_distrib,Finset.mul_sum] + +lemma holDeriv_star (f : Coordinates d → ℂ) (z : Coordinates d) (a : Fin d) : + holDeriv (fun y => star (f y)) z a = star (barDeriv f z a) := by + unfold holDeriv barDeriv + rw [fderiv_star] + simp only [ContinuousLinearMap.comp_apply,ContinuousLinearEquiv.coe_coe,starL'_apply, + map_mul,map_add,map_inv₀,map_ofNat,Complex.star_def,Complex.conj_I] + ring + +lemma barDeriv_star (f : Coordinates d → ℂ) (z : Coordinates d) (a : Fin d) : + barDeriv (fun y => star (f y)) z a = star (holDeriv f z a) := by + have h := holDeriv_star (fun y => star (f y)) z a + simpa only [star_star] using congrArg star h.symm + +lemma contDiffAt_holDeriv {f : Coordinates d → ℂ} {z : Coordinates d} + (hf : ContDiffAt ℝ ∞ f z) (a : Fin d) : + ContDiffAt ℝ ∞ (fun y => holDeriv f y a) z := by + unfold holDeriv + exact contDiffAt_const.mul (((hf.fderiv_right (m:=∞) (by simp)).clm_apply contDiffAt_const).sub + (contDiffAt_const.mul ((hf.fderiv_right (m:=∞) (by simp)).clm_apply contDiffAt_const))) + +def scalarHolForm (a : Fin d) : (Coordinates d →L[ℝ] ℂ) →L[ℝ] ℂ := + (2:ℂ)⁻¹ • (ContinuousLinearMap.apply ℝ ℂ (coordinateVector a) - + Complex.I • ContinuousLinearMap.apply ℝ ℂ (Complex.I • coordinateVector a)) + +def scalarBarForm (a : Fin d) : (Coordinates d →L[ℝ] ℂ) →L[ℝ] ℂ := + (2:ℂ)⁻¹ • (ContinuousLinearMap.apply ℝ ℂ (coordinateVector a) + + Complex.I • ContinuousLinearMap.apply ℝ ℂ (Complex.I • coordinateVector a)) + +lemma fderiv_holDeriv {f : Coordinates d → ℂ} {z : Coordinates d} + (hf : ContDiffAt ℝ ∞ f z) (a : Fin d) (v : Coordinates d) : + fderiv ℝ (fun y => holDeriv f y a) z v = + (2:ℂ)⁻¹ * (fderiv ℝ (fderiv ℝ f) z v (coordinateVector a) - + Complex.I*fderiv ℝ (fderiv ℝ f) z v (Complex.I • coordinateVector a)) := by + exact congrArg (fun L : Coordinates d →L[ℝ] ℂ => L v) + (((scalarHolForm a).hasFDerivAt.comp z + ((hf.fderiv_right (m:=∞) (by simp)).differentiableAt (by simp)).hasFDerivAt).fderiv) + +lemma fderiv_barDeriv {f : Coordinates d → ℂ} {z : Coordinates d} + (hf : ContDiffAt ℝ ∞ f z) (a : Fin d) (v : Coordinates d) : + fderiv ℝ (fun y => barDeriv f y a) z v = + (2:ℂ)⁻¹ * (fderiv ℝ (fderiv ℝ f) z v (coordinateVector a) + + Complex.I*fderiv ℝ (fderiv ℝ f) z v (Complex.I • coordinateVector a)) := by + exact congrArg (fun L : Coordinates d →L[ℝ] ℂ => L v) + (((scalarBarForm a).hasFDerivAt.comp z + ((hf.fderiv_right (m:=∞) (by simp)).differentiableAt (by simp)).hasFDerivAt).fderiv) + +lemma scalar_bar_hol_comm {f : Coordinates d → ℂ} {z : Coordinates d} + (hf : ContDiffAt ℝ ∞ f z) (a b : Fin d) : + barDeriv (fun y => holDeriv f y a) z b = holDeriv (fun y => barDeriv f y b) z a := by + change (2:ℂ)⁻¹ * (fderiv ℝ (fun y => holDeriv f y a) z (coordinateVector b) + + Complex.I*fderiv ℝ (fun y => holDeriv f y a) z (Complex.I • coordinateVector b)) = + (2:ℂ)⁻¹ * (fderiv ℝ (fun y => barDeriv f y b) z (coordinateVector a) - + Complex.I*fderiv ℝ (fun y => barDeriv f y b) z (Complex.I • coordinateVector a)) + rw [fderiv_holDeriv hf,fderiv_holDeriv hf,fderiv_barDeriv hf,fderiv_barDeriv hf] + have hs (u v : Coordinates d) : fderiv ℝ (fderiv ℝ f) z u v = fderiv ℝ (fderiv ℝ f) z v u := by + exact hf.isSymmSndFDerivAt (by + simp only [minSmoothness_of_isRCLikeNormedField] + change ((2:ℕ∞):WithTop ℕ∞) ≤ ((⊤:ℕ∞):WithTop ℕ∞) + exact WithTop.coe_le_coe.mpr le_top) u v + rw [hs (coordinateVector a) (coordinateVector b), + hs (coordinateVector a) (Complex.I • coordinateVector b), + hs (Complex.I • coordinateVector a) (coordinateVector b), + hs (Complex.I • coordinateVector a) (Complex.I • coordinateVector b)] + ring + +end Anticanonical.SourceSmooth.KaehlerMetric + +end + +end OAI diff --git a/lean/OAI/Geometry/ProjectionBodies/AffineCovariance.lean b/lean/OAI/Geometry/ProjectionBodies/AffineCovariance.lean new file mode 100644 index 0000000000000000000000000000000000000000..f827b39a4216f68083ee5390678dc90d5190821d --- /dev/null +++ b/lean/OAI/Geometry/ProjectionBodies/AffineCovariance.lean @@ -0,0 +1,210 @@ +import OAI.Geometry.ProjectionBodies.Normalization + +namespace OAI + +noncomputable section +open Set MeasureTheory Metric Filter Topology +open scoped NNReal RealInnerProductSpace Pointwise +namespace PettyProjection +variable {n : ℕ} + +lemma unitSegment_smul (y : Space n) (a : ℝ) : unitSegment (a • y)=a • unitSegment y := by + rw [unitSegment,unitSegment,← image_smul,image_image] + congr 1 + funext t + exact smul_comm t a y + +lemma unitSegment_image (T : Space n →ₗ[ℝ] Space n) (y : Space n) : + T '' unitSegment y=unitSegment (T y) := by + rw [unitSegment,unitSegment,image_image] + congr 1 + funext a + exact map_smul T a y + +lemma unitSegment_zero : unitSegment (0:Space n)={0} := by + ext x + simp only [unitSegment,mem_image,mem_Icc,smul_zero,mem_singleton_iff] + constructor + · rintro ⟨a,ha,hax⟩;exact hax.symm + · rintro rfl;exact ⟨0,by norm_num, rfl⟩ + +lemma segment_volume_support [NeZero n] {K : Set (Space n)} + (hK : IsCompact K) (hc : Convex ℝ K) (h0 : K∈𝓝 (0:Space n)) (y : Space n) : + volume.real (K+unitSegment y)=volume.real K+2*support (projectionBody K) y := by + have hP := projectionBody_body hK hc h0 + have hne := hP.2.2.mono interior_subset + by_cases hy : y=0 + · rw [hy,unitSegment_zero,add_singleton] + simp only [add_zero,image_id'] + have hs0 : support (projectionBody K) 0=0 := by + simpa using support_smul hP.1 hne (r :=0) le_rfl (0:Space n) + simp only [hs0,mul_zero,add_zero] + · let u : Spherical.Sphere n := ⟨‖y‖⁻¹ • y,by simp [norm_smul,hy]⟩ + have he : y=‖y‖ • (u:Space n) := by simp [u,smul_smul,hy] + conv_lhs => rw [he,unitSegment_smul] + rw [segment_volume u hK hc (norm_nonneg y)] + conv_rhs => rhs;rhs;rw [he,support_smul hP.1 hne (norm_nonneg y),projectionBody_support_unit hK hc h0 u] + ring + +lemma linearEquiv_nhds (T : Space n ≃L[ℝ] Space n) {K : Set (Space n)} + (h0 : K∈𝓝 (0:Space n)) : T '' K∈𝓝 (0:Space n) := by + have hh := T.toHomeomorph.isOpenMap.image_mem_nhds h0 + change T '' K∈𝓝 (T 0) at hh + simpa only [map_zero] using hh + +lemma projection_support_linearEquiv [NeZero n] (T : Space n ≃L[ℝ] Space n) + {K : Set (Space n)} (hK : IsCompact K) (hc : Convex ℝ K) (h0 : K∈𝓝 (0:Space n)) + (y : Space n) : support (projectionBody (T '' K)) y= + |LinearMap.det T.toLinearMap| * support (projectionBody K) (T.symm y) := by + have him : T '' (K+unitSegment (T.symm y))=T '' K+unitSegment y := by + change T.toLinearMap '' (K+unitSegment (T.symm y))=T.toLinearMap '' K+unitSegment y + rw [image_add T.toLinearMap,unitSegment_image T.toLinearMap] + change T.toLinearMap '' K+unitSegment (T (T.symm y))=_ + rw [T.apply_symm_apply] + have hh := volumeReal_linearEquiv T (K+unitSegment (T.symm y)) + rw [him,segment_volume_support (hK.image T.continuous) (hc.linear_image T.toLinearMap) + (linearEquiv_nhds T h0),segment_volume_support hK hc h0,volumeReal_linearEquiv] at hh + linarith + +end PettyProjection +end + +noncomputable section +open Set MeasureTheory Metric Filter Topology +open scoped RealInnerProductSpace Pointwise +namespace PettyProjection +variable {n : ℕ} + +lemma adjoint_inverse_comp (T : Space n ≃L[ℝ] Space n) : + T.toContinuousLinearMap.adjoint.toLinearMap.comp T.symm.toContinuousLinearMap.adjoint.toLinearMap=LinearMap.id := by + apply LinearMap.ext + intro x + apply ext_inner_right ℝ + intro y + change ⟪T.toContinuousLinearMap.adjoint (T.symm.toContinuousLinearMap.adjoint x),y⟫=⟪x,y⟫ + rw [ContinuousLinearMap.adjoint_inner_left,ContinuousLinearMap.adjoint_inner_left] + simp + +/-- Invertibility of the transpose uses the transpose of the inverse. -/ +def adjointEquiv (T : Space n ≃L[ℝ] Space n) : Space n ≃L[ℝ] Space n := + (LinearEquiv.ofLinearMap T.toContinuousLinearMap.adjoint.toLinearMap + T.symm.toContinuousLinearMap.adjoint.toLinearMap + (adjoint_inverse_comp T) (adjoint_inverse_comp T.symm)).toContinuousLinearEquiv + +lemma adjointEquiv_clm (T : Space n ≃L[ℝ] Space n) : + (adjointEquiv T).toContinuousLinearMap=T.toContinuousLinearMap.adjoint := rfl + +lemma det_adjoint (A : Space n →L[ℝ] Space n) : + LinearMap.det A.adjoint.toLinearMap=LinearMap.det A.toLinearMap := by + let b := stdOrthonormalBasis ℝ (Space n) + rw [← LinearMap.det_toMatrix b.toBasis,← ContinuousLinearMap.adjoint_toLinearMap, + LinearMap.toMatrix_adjoint,Matrix.det_conjTranspose,LinearMap.det_toMatrix] + exact star_trivial _ + +lemma adjointEquiv_det (T : Space n ≃L[ℝ] Space n) : + LinearMap.det (adjointEquiv T).toLinearMap=LinearMap.det T.toLinearMap := det_adjoint _ + +end PettyProjection +end + +noncomputable section +open Set MeasureTheory Metric Filter Topology +open scoped NNReal RealInnerProductSpace Pointwise +namespace PettyProjection +variable {n : ℕ} [NeZero n] + +/-- The actual unpolarized projection body transforms by the determinant and +inverse transpose, proved from orthogonal shadow volumes via segment addition. -/ +theorem projectionBody_linearEquiv (T : Space n ≃L[ℝ] Space n) + {K : Set (Space n)} (hK : IsCompact K) (hc : Convex ℝ K) (h0 : K∈𝓝 (0:Space n)) : + projectionBody (T '' K)=|LinearMap.det T.toLinearMap| • (adjointEquiv T.symm '' projectionBody K) := by + let P := projectionBody K + let S := adjointEquiv T.symm + let d := |LinearMap.det T.toLinearMap| + have hd : 0 |LinearMap.det T.toLinearMap|^k) he + simp only [pow_succ] at hp + rw [hp] + field_simp + +lemma projectionRatio_linearEquiv (T : Space n ≃L[ℝ] Space n) + {K : Set (Space n)} (hK : IsCompact K) (hc : Convex ℝ K) (h0 : K∈𝓝 (0:Space n)) : + projectionRatio (T '' K)=projectionRatio K := by + rw [projectionRatio,projection_volume_linearEquiv T hK hc h0,volumeReal_linearEquiv, + projectionRatio,mul_pow] + have hd := abs_pos.mpr (linearEquiv_det_ne_zero T) + field_simp + +end PettyProjection +end + +noncomputable section +open Set MeasureTheory Metric Filter Topology +open scoped NNReal RealInnerProductSpace Pointwise +namespace PettyProjection +variable {n : ℕ} + +lemma projectionBody_unitBall : projectionBody (unitBall n)=kappa (n-1) • unitBall n := by + have he : projectionBody (unitBall n)=wulff (fun _ : Spherical.Sphere n => kappa (n-1)) := by + ext x + constructor + · intro hx u + have hh := hx (u:Space n) (Spherical.norm_coe u) + rwa [shadowVolume_unitBall u] at hh + · intro hx u hu + let v : Spherical.Sphere n := ⟨u,by simpa only [mem_sphere,dist_zero_right] using hu⟩ + have hh : ⟪u,x⟫≤kappa (n-1) := hx v + have hv : shadowVolume (unitBall n) u=kappa (n-1) := shadowVolume_unitBall v + rwa [hv] + rw [he] + have hb : wulff (fun _ : Spherical.Sphere n => kappa (n-1))=closedBall (0:Space n) (kappa (n-1)) := + Subset.antisymm (wulff_subset_closedBall (kappa_pos (n-1)).le (fun _ => le_rfl)) + (closedBall_subset_wulff (fun _ => le_rfl)) + rw [hb,unitBall,smul_closedBall' (kappa_pos (n-1)).ne'] + simp only [smul_zero,Real.norm_of_nonneg (kappa_pos (n-1)).le,mul_one] + +lemma projectionRatio_unitBall {n : ℕ} (hn : 2≤n) : projectionRatio (unitBall n)=pettyConstant n := by + let : NeZero n := ⟨by omega⟩ + rw [projectionRatio_normalized hn rfl,projectionBody_unitBall, + normalizedVolume_smul (kappa_pos (n-1)).le,normalizedVolume_of_volume (K :=unitBall n) rfl,mul_one] + rfl + +/-- All affine ellipsoids, including arbitrary translates, attain equality. -/ +theorem ellipsoid_projectionRatio {n : ℕ} (hn : 2≤n) {K : Set (Space n)} + (hK : IsEllipsoid K) : projectionRatio K=pettyConstant n := by + let : NeZero n := ⟨by omega⟩ + obtain ⟨a,T,rfl⟩ := hK + have he : (fun x : Space n => a+T x) '' unitBall n=(fun y => a+y) '' (T '' unitBall n) := by + rw [image_image] + rw [he,projectionRatio_translate] + change projectionRatio (T.toContinuousLinearEquiv '' unitBall n)=_ + rw [projectionRatio_linearEquiv T.toContinuousLinearEquiv unitBall_body.1 unitBall_body.2.1 unitBall_nhds, + projectionRatio_unitBall hn] + +end PettyProjection +end + +end OAI diff --git a/lean/OAI/Geometry/ProjectionBodies/AffinePosition.lean b/lean/OAI/Geometry/ProjectionBodies/AffinePosition.lean new file mode 100644 index 0000000000000000000000000000000000000000..f8ca56ff9ee2cdcd042ac6d020d2825c9b422704 --- /dev/null +++ b/lean/OAI/Geometry/ProjectionBodies/AffinePosition.lean @@ -0,0 +1,492 @@ +import OAI.Geometry.ProjectionBodies.PositionMatrices + +namespace OAI + +universe uX + +noncomputable section +open Set MeasureTheory Metric Filter Topology +open scoped RealInnerProductSpace +namespace PettyProjection +open Spherical (Sphere mean sigma gaugeField gaugeMoment absolutePair) + +/-- The genuine unpolarized cosine pairing of two (not necessarily even) measures. -/ +def measurePair {n : ℕ} (μ ν : Measure (Space n)) : ℝ := + ∫ x,∫ y,|⟪x,y⟫| ∂ν ∂μ + +def Represents {n : ℕ} (μ : Measure (Space n)) (g : Seminorm ℝ (Space n)) (k : ℕ) (s : ℝ) : Prop := + ∀ (φ : Space n → ℝ),Continuous φ → (∀ x,φ (-x)=φ x) → + (∀ r : ℝ,0 < r → ∀ x,φ (r • x)=r*φ x) → + (∫ x,φ x ∂μ)=s*mean (fun u : Sphere n => φ (gaugeField g k u)) + +lemma represents_pair {n : ℕ} [NeZero n] {μ ν : Measure (Space n)} + (hν : Integrable (fun x : Space n => ‖x‖) ν) + (f g : Seminorm ℝ (Space n)) {k : ℕ} (hk : 0 < k) {s t : ℝ} + (hf : Represents μ f k s) (hg : Represents ν g k t) : + measurePair μ ν=s*t*absolutePair (gaugeField f k) (gaugeField g k) := by + have hcos : measurePair μ ν=∫ x,cosineSeminorm ν hν x ∂μ := by + unfold measurePair + apply integral_congr_ae + filter_upwards [] with x + change (∫ y,|⟪x,y⟫| ∂ν)=∫ y,|⟪y,x⟫| ∂ν + simp only [real_inner_comm x] + rw [hcos,hf _ (Spherical.seminorm_continuous n _) (fun x => map_neg_eq_map _ x) + (fun r hr x => by rw [map_smul_eq_mul,Real.norm_of_nonneg hr.le])] + have he (u : Sphere n) : cosineSeminorm ν hν (gaugeField f k u)= + t*mean (fun v : Sphere n => |⟪gaugeField f k u,gaugeField g k v⟫|) := by + have hh := hg (fun x => |⟪gaugeField f k u,x⟫|) (by fun_prop) + (fun x => by simp) (fun r hr x => by simp only [inner_smul_right,abs_mul,abs_of_pos hr]) + change (∫ x,|⟪x,gaugeField f k u⟫| ∂ν)=_ + simpa only [real_inner_comm (gaugeField f k u)] using hh + simp_rw [he] + rw [mean,integral_const_mul,mul_assoc] + congr 1 + congr 1 + exact (integral_prod _ (Spherical.gaugeField_absolute_integrable f g hk)).symm + +namespace RelativeGauge +variable {n : ℕ} [NeZero n] {μ : Measure (Space n)} + +lemma scaled_represents + (hμ : Integrable (fun x : Space n => ‖x‖) μ) + (hq : ∀ x : Space n,x≠0 → 0 < cosineSeminorm μ hμ x) + (g : RelativeGauge (⊤ : Submodule ℝ (Space n))) (hgn : supportFunctional μ g.body=1) + (hmin : ∀ q : RelativeGauge (⊤ : Submodule ℝ (Space n)),supportFunctional μ q.body=1 → + Spherical.objective (regime n) g.toSeminorm≤Spherical.objective (regime n) q.toSeminorm) + {a : ℝ} (ha : 0 < a) : + Represents μ (g.scale a ha).toSeminorm (Scalar.exponent n) + (supportFunctional μ (g.scale a ha).body/gaugeMoment (g.scale a ha).toSeminorm (Scalar.exponent n-1)) := by + intro φ hφ he hh + have ht : 0 < gaugeMoment (g.scale a ha).toSeminorm (Scalar.exponent n-1) := + Position.mean_power_pos _ ((g.scale a ha).ne_zero top_ne_bot) _ + have h := scaled_field_representation hμ hq g hgn hmin ha φ hφ he hh + rw [div_mul_eq_mul_div] + exact (eq_div_iff ht.ne').mpr h + +end RelativeGauge +end PettyProjection +end + +noncomputable section +open Set MeasureTheory Metric Filter Topology +open scoped RealInnerProductSpace +namespace PettyProjection.Position +open Spherical (Sphere norm_coe) + +lemma compact_inward {X : Type uX} [TopologicalSpace X] [CompactSpace X] + {a b : X → ℝ} (ha : Continuous a) (hb : Continuous b) + (ha0 : ∀ x,0≤a x) (hab : ∀ x,a x=0 → b x<0) : + ∃ ε : ℝ,0<ε ∧ ∀ x,0 (hab x h.symm).not_ge hx) + obtain ⟨M,hM,hbound⟩ := (isCompact_univ.image hb).isBounded.exists_pos_norm_le + let ε := a x/(2*M) + have hε : 0<ε := div_pos hax (by positivity) + refine ⟨ε,hε,fun y => ?_⟩ + by_cases hy : y∈K + · have hmy : a x≤a y := hmin hy + have hbM : b y≤M := (le_abs_self _).trans (by simpa only [Real.norm_eq_abs] using hbound (b y) ⟨y,mem_univ _,rfl⟩) + have hh : ε*M=a x/2 := by dsimp [ε]; field_simp + have hle := mul_le_mul_of_nonneg_left hbM hε.le + rw [hh] at hle + linarith + · have hby : b y<0 := lt_of_not_ge hy + have hneg := mul_neg_of_pos_of_neg hε hby + linarith [ha0 y] + · refine ⟨1,zero_lt_one,fun y => ?_⟩ + have hby : b y<0 := by + by_contra h + exact hne ⟨y,le_of_not_gt h⟩ + linarith [ha0 y] + +lemma inward_perturbation {n : ℕ} [NeZero n] {A F : Mat n} (hA : A∈domain n) + (hF : Symmetric F) (htr : tr F=0) + (hker : ∀ e : Sphere n,op A e=0 → quad F e<0) : + ∃ ε : ℝ,0<ε ∧ A-ε • F∈domain n ∧ ∀ x : Space n,x≠0 → 0 quad A u) := + by simp_rw [quad_eq]; fun_prop + have hcf : Continuous (fun u : Sphere n => quad F u) := + by simp_rw [quad_eq]; fun_prop + obtain ⟨ε,hε,hp⟩ := compact_inward hca hcf (fun u => hA.1.2 u) + (fun u hu => hker u (op_kernel_of_quad_zero hA.1 hu)) + have hq : ∀ x : Space n,x≠0 → 0 (sq_nonneg ‖x‖⁻¹).not_gt h.1) |>.2 + refine ⟨ε,hε,⟨⟨?_,?_⟩,?_⟩,hq⟩ + · intro i j + change A (i,j)-ε*F (i,j)=A (j,i)-ε*F (j,i) + rw [hA.1.1 i j,hF i j] + · intro x + by_cases hx : x=0 + · simp [hx,quad] + · exact (hq x hx).le + · change (∑ i,(A (i,i)-ε*F (i,i)))=1 + rw [Finset.sum_sub_distrib,← Finset.mul_sum] + change tr A-ε*tr F=1 + rw [hA.2,htr,mul_zero,sub_zero] + +/-- The topological mechanism. The field is genuine and continuous; +its negativity on every null direction forces an interior zero. -/ +theorem traceOne_field_zero {n : ℕ} [NeZero n] (F : {A : Mat n // A∈domain n} → Mat n) + (hFc : Continuous F) (hFs : ∀ A,Symmetric (F A)) (hFt : ∀ A,tr (F A)=0) + (hFk : ∀ A (e : Sphere n),op A.val e=0 → quad (F A) e<0) : + ∃ A : {A : Mat n // A∈domain n},F A=0 ∧ Function.Injective (op A.val) := by + let p := FixedPoint.nearest (domain n) domain_nonempty domain_compact.isComplete domain_convex + have hp (x : Mat n) : p x∈domain n := FixedPoint.nearest_mem _ _ _ _ x + have hpc : Continuous p := (FixedPoint.nearest_lipschitz _ _ _ _).continuous + let f : Mat n → Mat n := fun x => p (x-F ⟨p x,hp x⟩) + have hfc : Continuous f := hpc.comp (continuous_id.sub (hFc.comp (hpc.subtype_mk hp))) + obtain ⟨A,hA,hfix⟩ := FixedPoint.fixedPoint_compact_convex domain_nonempty domain_compact domain_convex + hfc.continuousOn (fun x _ => hp _) + let a : {A : Mat n // A∈domain n} := ⟨A,hA⟩ + have hpa : p A=A := FixedPoint.nearest_eq_of_mem _ _ _ _ hA + have hfix' : p (A-F a)=A := by simpa only [f,hpa] using hfix + have hi := FixedPoint.nearest_inner (domain n) domain_nonempty domain_compact.isComplete domain_convex (A-F a) + change ∀ z∈domain n,⟪A-F a-p (A-F a),z-p (A-F a)⟫≤0 at hi + rw [hfix'] at hi + obtain ⟨ε,hε,hB,_⟩ := inward_perturbation hA (hFs a) (hFt a) (hFk a) + have hh := hi (A-ε • F a) hB + have hf0 : F a=0 := by + simp only [sub_sub_cancel_left,inner_neg_left,inner_neg_right,inner_smul_right,real_inner_self_eq_norm_sq] at hh + have hs : ‖F a‖^2≤0 := nonpos_of_mul_nonpos_left (by nlinarith only [hh]) hε + have hn : ‖F a‖=0 := by nlinarith [norm_nonneg (F a)] + exact norm_eq_zero.mp hn + refine ⟨a,hf0,?_⟩ + apply (op A).ker_eq_bot.mp + apply LinearMap.ker_eq_bot'.mpr + intro x hx + change op A x=0 at hx + by_contra hx0 + let e : Sphere n := ⟨‖x‖⁻¹ • x,by rw [mem_sphere_zero_iff_norm,norm_smul,Real.norm_of_nonneg (inv_nonneg.mpr (norm_nonneg _)),inv_mul_cancel₀ (norm_ne_zero_iff.mpr hx0)]⟩ + have he : op A e=0 := by change op A (‖x‖⁻¹ • x)=0; rw [map_smul,hx,smul_zero] + have hh := hFk a e he + rw [hf0] at hh + simp only [quad_eq] at hh + simp at hh +end PettyProjection.Position +end + +noncomputable section +open Set MeasureTheory Metric Filter Topology +open scoped RealInnerProductSpace +namespace PettyProjection.Position +open Spherical (Sphere mean seminorm_continuous) +open RelativeGauge +variable {n : ℕ} [NeZero n] {μ : Measure (Space n)} + +abbrev Domain (n : ℕ) := {A : Mat n // A∈domain n} +instance domain_compactSpace : CompactSpace (Domain n) := isCompact_iff_compactSpace.mp domain_compact + +def domainMap (A : Domain n) : NonzeroMap n := ⟨op A.val,domain_range_ne_bot A.property⟩ +omit [NeZero n] in +lemma domainMap_continuous : Continuous (domainMap : Domain n → NonzeroMap n) := + (op_continuous.comp continuous_subtype_val).subtype_mk _ + +lemma optimizer_kernel (hμ : Integrable (fun x : Space n => ‖x‖) μ) + (hq : ∀ x : Space n,x≠0 → 0 ‖x‖) μ) + (hq : ∀ x : Space n,x≠0 → 0 optimizer hμ hq b (domainMap p.1) p.2) := by + exact ((optimizerSphere_continuous hμ hq b).comp domainMap_continuous).fst'.eval continuous_snd + +def positionField (hμ : Integrable (fun x : Space n => ‖x‖) μ) + (hq : ∀ x : Space n,x≠0 → 0 ‖x‖) μ) + (hq : ∀ x : Space n,x≠0 → 0 mean (fun u : Sphere n => optimizer hμ hq b (domainMap A) u^k)) := by + simpa only [Measure.restrict_univ,mean] using + (continuous_parametric_integral_of_continuous (μ := Spherical.sigma n) (hg.pow k) isCompact_univ) + have hij (i j : Fin n) : Continuous (fun A : Domain n => mean (fun u : Sphere n => + optimizer hμ hq b (domainMap A) u^k*(u:Space n) i*(u:Space n) j)) := by + have hc : Continuous (fun p : Domain n × Sphere n => + optimizer hμ hq b (domainMap p.1) p.2^k*(p.2:Space n) i*(p.2:Space n) j) := + (hg.pow k).mul (by fun_prop) |>.mul (by fun_prop) + simpa only [Measure.restrict_univ,mean] using + (continuous_parametric_integral_of_continuous (μ := Spherical.sigma n) hc isCompact_univ) + apply (PiLp.continuous_toLp 2 _).comp + apply continuous_pi + intro ij + exact ((hij ij.1 ij.2).div hm (fun A => + (mean_power_pos _ ((optimizer hμ hq b (domainMap A)).ne_zero (domainMap A).property) k).ne')).sub continuous_const + +/-- A genuine nonsingular affine position for the variational optimizer. The +trace-one representative is used here; determinant normalization is a scalar +change and is performed in the global assembly. -/ +theorem exists_optimizer_position (hμ : Integrable (fun x : Space n => ‖x‖) μ) + (hq : ∀ x : Space n,x≠0 → 0 field_symmetric _ k) + (fun A => field_trace _ ((optimizer hμ hq b (domainMap A)).ne_zero (domainMap A).property) k) + (fun A e he => field_kernel ((optimizer hμ hq b (domainMap A)).ne_zero (domainMap A).property) + hk e (optimizer_kernel hμ hq b A e he)) + exact ⟨A,hinj,hA⟩ +end PettyProjection.Position +end + +noncomputable section +open Set MeasureTheory Metric Filter Topology +open scoped RealInnerProductSpace Pointwise +namespace PettyProjection +variable {n : ℕ} + +lemma volumeReal_linearEquiv (T : Space n ≃L[ℝ] Space n) (K : Set (Space n)) : + volume.real (T '' K)=|LinearMap.det T.toLinearMap| * volume.real K := by + unfold Measure.real + rw [Measure.addHaar_image_continuousLinearEquiv,ENNReal.toReal_mul,ENNReal.toReal_ofReal (abs_nonneg _)] + +lemma linearEquiv_body (T : Space n ≃L[ℝ] Space n) {K : Set (Space n)} (hK : IsConvexBody K) : + IsConvexBody (T '' K) := by + refine ⟨hK.1.image T.continuous,hK.2.1.linear_image T.toLinearMap,?_⟩ + change (interior (T.toHomeomorph '' K)).Nonempty + rw [← T.toHomeomorph.image_interior] + exact hK.2.2.image T + +lemma linearEquiv_det_ne_zero (T : Space n ≃L[ℝ] Space n) : LinearMap.det T.toLinearMap≠0 := + T.toLinearEquiv.isUnit_det'.ne_zero + +def volumeFactor (T : Space n ≃L[ℝ] Space n) : ℝ := |LinearMap.det T.toLinearMap|^((n:ℝ)⁻¹) +lemma volumeFactor_pos (T : Space n ≃L[ℝ] Space n) : 0 < volumeFactor T := + Real.rpow_pos_of_pos (abs_pos.mpr (linearEquiv_det_ne_zero T)) _ + +lemma normalizedVolume_linearEquiv (T : Space n ≃L[ℝ] Space n) (K : Set (Space n)) : + normalizedVolume (T '' K)=volumeFactor T*normalizedVolume K := by + rw [normalizedVolume,volumeRoot,volumeReal_linearEquiv, + Real.mul_rpow (abs_nonneg _) measureReal_nonneg] + unfold volumeFactor normalizedVolume volumeRoot + ring + +lemma volumeFactor_symm (T : Space n ≃L[ℝ] Space n) : volumeFactor T.symm=(volumeFactor T)⁻¹ := by + unfold volumeFactor + rw [show T.symm.toLinearMap=(T.toLinearEquiv.symm : Space n →ₗ[ℝ] Space n) from rfl, + LinearEquiv.det_coe_symm,abs_inv,Real.inv_rpow (abs_nonneg _)] + +lemma symmetric_equiv_symm (T : Space n ≃L[ℝ] Space n) (hT : T.toLinearMap.IsSymmetric) : + T.symm.toLinearMap.IsSymmetric := by + intro x y + change ⟪T.symm x,y⟫=⟪x,T.symm y⟫ + have hh := hT (T.symm x) (T.symm y) + change ⟪T (T.symm x),T.symm y⟫=⟪T.symm x,T (T.symm y)⟫ at hh + simpa only [T.apply_symm_apply] using hh.symm + +lemma functional_map_symmetric {μ : Measure (Space n)} (T : Space n ≃L[ℝ] Space n) + (hT : T.toLinearMap.IsSymmetric) {K : Set (Space n)} (hK : IsCompact K) (hne : K.Nonempty) : + supportFunctional (μ.map T) K=supportFunctional μ (T '' K) := by + change supportFunctional (μ.map T.toContinuousLinearMap) K=_ + rw [functional_map T.toContinuousLinearMap hK] + unfold supportFunctional + apply integral_congr_ae + filter_upwards [] with x + change support K (T.toContinuousLinearMap x)=support (T.toContinuousLinearMap '' K) x + rw [support_linear_image hK hne T.toContinuousLinearMap,hT.clm_adjoint_eq] + +lemma measurePair_cosine {μ ν : Measure (Space n)} + (hν : Integrable (fun x : Space n => ‖x‖) ν) : + measurePair μ ν=∫ x,cosineSeminorm ν hν x ∂μ := by + unfold measurePair + apply integral_congr_ae + filter_upwards [] with x + change (∫ y,|⟪x,y⟫| ∂ν)=∫ y,|⟪y,x⟫| ∂ν + simp only [real_inner_comm x] + +lemma measurePair_map_symmetric {μ ν : Measure (Space n)} + (hν : Integrable (fun x : Space n => ‖x‖) ν) + (T : Space n ≃L[ℝ] Space n) (hT : T.toLinearMap.IsSymmetric) : + measurePair (μ.map T) (ν.map T.symm)=measurePair μ ν := by + change measurePair (μ.map T.toContinuousLinearMap) (ν.map T.symm.toContinuousLinearMap)=_ + rw [measurePair_cosine (norm_integrable_map hν T.symm.toContinuousLinearMap), + integral_map T.toContinuousLinearMap.continuous.measurable.aemeasurable (Spherical.seminorm_continuous n _).aestronglyMeasurable, + measurePair_cosine hν] + apply integral_congr_ae + filter_upwards [] with x + rw [cosine_map ν hν T.symm.toContinuousLinearMap,(symmetric_equiv_symm T hT).clm_adjoint_eq] + simp + +end PettyProjection +end + +noncomputable section +open Set MeasureTheory Metric Filter Topology +open scoped RealInnerProductSpace +namespace PettyProjection.Position +open Spherical +variable {n : ℕ} [NeZero n] + +lemma mean_inner_sq (x : Space n) : (n:ℝ)*mean (fun u : Sphere n => ⟪x,(u:Space n)⟫^2)=‖x‖^2 := by + by_cases hx : x=0 + · simp [hx,mean] + let e : Sphere n := ⟨‖x‖⁻¹ • x,by rw [mem_sphere_zero_iff_norm,norm_smul,Real.norm_of_nonneg (inv_nonneg.mpr (norm_nonneg _)),inv_mul_cancel₀ (norm_ne_zero_iff.mpr hx)]⟩ + have he := sphere_kernel_moment (0 : Seminorm ℝ (Space n)) 0 e (by simp) + simp only [Nat.cast_zero,add_zero,pow_zero,one_mul,mean_const] at he + have hh : mean (fun u : Sphere n => ⟪(e:Space n),(u:Space n)⟫^2)= + ‖x‖⁻¹^2*mean (fun u : Sphere n => ⟪x,(u:Space n)⟫^2) := by + simp only [e,inner_smul_left,conj_trivial,mul_pow,mean,integral_const_mul] + rw [hh] at he + have hn := norm_ne_zero_iff.mpr hx + field_simp at he + nlinarith [sq_pos_of_ne_zero hn] + +omit [NeZero n] in +lemma symmetric_eq_zero_of_quad {A : Mat n} (hA : Symmetric A) (hq : ∀ x,quad A x=0) : A=0 := by + have hd (i : Fin n) : A (i,i)=0 := by rw [← quad_basis,hq] + apply WithLp.ofLp_injective + funext ij + have hh := hq (EuclideanSpace.single ij.1 1+EuclideanSpace.single ij.2 1) + have he := quad_basis_add A ij.1 ij.2 1 1 + simp only [one_smul,one_pow,one_mul,hd,hA ij.2 ij.1] at he + change A ij=0 + linarith + +lemma constantMomentField_zero : momentField (0 : Seminorm ℝ (Space n)) 0=0 := by + apply symmetric_eq_zero_of_quad (field_symmetric _ _) (fun x => ?_) + rw [field_quad] + simp only [pow_zero,one_mul,mean_const,div_one] + have hm := mean_inner_sq x + have hn : (n:ℝ)≠0 := Nat.cast_ne_zero.mpr (NeZero.ne n) + rw [sub_eq_zero,eq_div_iff hn] + linarith + +lemma coordinateProduct_mean (i j : Fin n) : mean (coordinateProduct n i j)=(if i=j then 1 else 0)/(n:ℝ) := by + have hh := congrArg (fun A : Mat n => A (i,j)) (constantMomentField_zero (n := n)) + change mean (fun u : Sphere n => (0 : Seminorm ℝ (Space n)) u^0*(u:Space n) i*(u:Space n) j)/ + mean (fun u : Sphere n => (0 : Seminorm ℝ (Space n)) u^0)-(if i=j then 1 else 0)/(n:ℝ)=0 at hh + simp only [pow_zero,one_mul,mean_const,div_one] at hh + exact sub_eq_zero.mp hh + +/-- The matrix isotropy condition gives precisely the actual H₂ projection, +not a replacement cancellation condition. -/ +lemma field_zero_harmonic {n : ℕ} (hn : 2≤n) [NeZero n] (g : Seminorm ℝ (Space n)) + (hg : g≠0) (k : ℕ) (hF : momentField g k=0) : + (harmonicSpace n 2).starProjection (toH n + (restrictContinuous (fun x => g x^k) ((seminorm_continuous n g).pow k)))=0 := by + let f : C(Sphere n,ℝ) := restrictContinuous (fun x => g x^k) ((seminorm_continuous n g).pow k) + let c := mean (fun u : Sphere n => g u^k) + let v := toH n f-toH n (ContinuousMap.const (Sphere n) c) + have ho : v∈(lowSpace n)ᗮ := by + apply (Submodule.mem_orthogonal _ _).mpr + intro w hw + induction hw using Submodule.span_induction with + | mem w hw => + obtain ⟨⟨i,j⟩,rfl⟩ := hw + rw [real_inner_comm,show v=toH n (f-ContinuousMap.const (Sphere n) c) by simp [v],inner_toH] + change mean (fun u : Sphere n => (g u^k-c)*((u:Space n) i*(u:Space n) j))=0 + have hij := congrArg (fun A : Mat n => A (i,j)) hF + change mean (fun u : Sphere n => g u^k*(u:Space n) i*(u:Space n) j)/c-(if i=j then 1 else 0)/(n:ℝ)=0 at hij + have hc : c≠0 := (mean_power_pos g hg k).ne' + have hv := (div_eq_iff hc).mp (sub_eq_zero.mp hij) + change _=0 + simp_rw [sub_mul] + have hi : Integrable (fun u : Sphere n => g u^k*((u:Space n) i*(u:Space n) j)) (sigma n) := + continuous_integrable (((seminorm_continuous n g).comp continuous_subtype_val).pow k |>.mul + (by fun_prop : Continuous (fun u : Sphere n => (u:Space n) i*(u:Space n) j))) + have hi' : Integrable (fun u : Sphere n => c*((u:Space n) i*(u:Space n) j)) (sigma n) := + continuous_integrable (by fun_prop) + rw [mean,integral_sub hi hi',integral_const_mul] + change mean (fun u : Sphere n => g u^k*((u:Space n) i*(u:Space n) j))-c*mean (coordinateProduct n i j)=0 + rw [coordinateProduct_mean] + have he : mean (fun u : Sphere n => g u^k*((u:Space n) i*(u:Space n) j))= + mean (fun u : Sphere n => g u^k*(u:Space n) i*(u:Space n) j) := by congr 1;funext u;ring + rw [he,hv]; ring + | zero => simp + | add x y _ _ hx hy => simp only [inner_add_left,hx,hy,add_zero] + | smul a x _ hx => simp only [inner_smul_left,conj_trivial,hx,mul_zero] + apply Submodule.eq_starProjection_of_mem_of_inner_eq_zero (Submodule.zero_mem _) + intro w hw + simp only [sub_zero] + have hvol := (Submodule.mem_orthogonal _ _).mp ho w (harmonicSpace_two_le_lowSpace n hw) + have hconst : ⟪toH n (ContinuousMap.const (Sphere n) c),w⟫=0 := + harmonic_inner_ne hn (d := 0) (by decide) (constant_mem_harmonicSpace_zero n c) hw + change ⟪toH n f,w⟫=0 + dsimp only [v] at hvol + have hconst' : ⟪w,toH n (ContinuousMap.const (Sphere n) c)⟫=0 := + (real_inner_comm _ _).trans hconst + rw [inner_sub_right,hconst',sub_zero] at hvol + exact (real_inner_comm _ _).trans hvol +end PettyProjection.Position +end + +noncomputable section +open Set MeasureTheory Metric Filter Topology +open scoped RealInnerProductSpace +namespace PettyProjection +namespace RelativeGauge +variable {n : ℕ} [NeZero n] + +def IsMinimizer (μ : Measure (Space n)) (b : Bool) (g : RelativeGauge (⊤ : Submodule ℝ (Space n))) : Prop := + supportFunctional μ g.body=1 ∧ + ∀ q : RelativeGauge (⊤ : Submodule ℝ (Space n)),supportFunctional μ q.body=1 → + Spherical.objective b g.toSeminorm≤Spherical.objective b q.toSeminorm + +omit [NeZero n] in +lemma copy_minimizer {V : Submodule ℝ (Space n)} (hV : V=⊤) + {μ : Measure (Space n)} {b : Bool} (g : RelativeGauge V) + (hgn : supportFunctional μ g.body=1) + (hmin : ∀ q : RelativeGauge V,supportFunctional μ q.body=1 → + Spherical.objective b g.toSeminorm≤Spherical.objective b q.toSeminorm) : + ∃ f : RelativeGauge (⊤ : Submodule ℝ (Space n)),f.toSeminorm=g.toSeminorm ∧ IsMinimizer μ b f := by + subst V + exact ⟨g,rfl,hgn,hmin⟩ + +/-- Actual full-dimensional position of the logarithmic/linear optimizer, +with no determinant normalization needed in the later weighted assembly. -/ +theorem exists_symmetric_position {μ : Measure (Space n)} + (hμ : Integrable (fun x : Space n => ‖x‖) μ) + (hq : ∀ x : Space n,x≠0 → 0 < cosineSeminorm μ hμ x) : + ∃ T : Space n ≃L[ℝ] Space n,T.toLinearMap.IsSymmetric ∧ + ∃ g : RelativeGauge (⊤ : Submodule ℝ (Space n)),IsMinimizer (μ.map T) (regime n) g ∧ + Position.momentField g.toSeminorm (Scalar.exponent n)=0 := by + obtain ⟨A,hinj,hF⟩ := Position.exists_optimizer_position hμ hq (regime n) (exponent_pos n) + have hsurj : Function.Surjective (Position.op A.val) := + LinearMap.surjective_of_injective (f := (Position.op A.val).toLinearMap) hinj + have hfull : LinearMap.range (Position.op A.val).toLinearMap=⊤ := LinearMap.range_eq_top.mpr hsurj + let T : Space n ≃L[ℝ] Space n := + (LinearEquiv.ofBijective (Position.op A.val).toLinearMap ⟨hinj,hsurj⟩).toContinuousLinearEquiv + obtain ⟨g,hg,hmin⟩ := copy_minimizer hfull (optimizer hμ hq (regime n) (Position.domainMap A)) + (optimizer_normalized hμ hq (regime n) (Position.domainMap A)) + (optimizer_minimal hμ hq (regime n) (Position.domainMap A)) + refine ⟨T,Position.symmetric_op A.property.1.1,g,hmin,?_⟩ + rw [hg] + exact hF + +lemma exists_full_minimizer {μ : Measure (Space n)} + (hμ : Integrable (fun x : Space n => ‖x‖) μ) + (hq : ∀ x : Space n,x≠0 → 0 < cosineSeminorm μ hμ x) (b : Bool) : + ∃ g : RelativeGauge (⊤ : Submodule ℝ (Space n)),IsMinimizer μ b g := + exists_minimizer hμ top_ne_bot (fun x _ hx => hq x hx) b + +end RelativeGauge +end PettyProjection +end + +end OAI diff --git a/lean/OAI/Geometry/ProjectionBodies/BilinearEquality.lean b/lean/OAI/Geometry/ProjectionBodies/BilinearEquality.lean new file mode 100644 index 0000000000000000000000000000000000000000..c1e879ee372eb60d96b724237c2c3e4294c01a9d --- /dev/null +++ b/lean/OAI/Geometry/ProjectionBodies/BilinearEquality.lean @@ -0,0 +1,312 @@ +import OAI.Geometry.ProjectionBodies.AffinePosition + +namespace OAI + +noncomputable section +open Set MeasureTheory Metric Filter Topology +open scoped RealInnerProductSpace +namespace PettyProjection +open Spherical (Sphere mean sigma gaugeMoment) +namespace RelativeGauge +variable {n : ℕ} [NeZero n] {μ : Measure (Space n)} + +omit [NeZero n] in +lemma scale_momentField (g : RelativeGauge (⊤ : Submodule ℝ (Space n))) + {a : ℝ} (ha : 0 (a*g u)^k*(u:Space n) ij.1*(u:Space n) ij.2)/ + mean (fun u : Sphere n => (a*g u)^k)-_=mean (fun u : Sphere n => g u^k*(u:Space n) ij.1*(u:Space n) ij.2)/ + mean (fun u : Sphere n => g u^k)-_ + have he : mean (fun u : Sphere n => (a*g u)^k*(u:Space n) ij.1*(u:Space n) ij.2)= + a^k*mean (fun u : Sphere n => g u^k*(u:Space n) ij.1*(u:Space n) ij.2) := by + simp_rw [mul_pow,mul_assoc] + exact integral_const_mul _ _ + have he' : mean (fun u : Sphere n => (a*g u)^k)=a^k*mean (fun u : Sphere n => g u^k) := by + simp only [mul_pow,mean,integral_const_mul] + rw [he,he',mul_div_mul_left _ _ (pow_ne_zero _ ha.ne')] + +lemma volumeNormalize_harmonic (hn : 2≤n) (g : RelativeGauge (⊤ : Submodule ℝ (Space n))) + (hF : Position.momentField g.toSeminorm (Scalar.exponent n)=0) : + (Spherical.harmonicSpace n 2).starProjection (Spherical.toH n + (Spherical.restrictContinuous (fun x => g.volumeNormalize x^Scalar.exponent n) + ((Spherical.seminorm_continuous n g.volumeNormalize.toSeminorm).pow _)))=0 := by + apply Position.field_zero_harmonic hn _ (g.volumeNormalize.ne_zero top_ne_bot) + rw [volumeNormalize,g.scale_momentField,hF] + +lemma volumeNormalize_representation + (hμ : Integrable (fun x : Space n => ‖x‖) μ) + (hq : ∀ x : Space n,x≠0 → 0 ‖x‖) μ) + (hq : ∀ x : Space n,x≠0 → 0< cosineSeminorm μ hμ x) + (T : Space n ≃L[ℝ] Space n) : + ∀ x : Space n,x≠0 → 0< cosineSeminorm (μ.map T) (norm_integrable_map hμ T.toContinuousLinearMap) x := by + intro x hx + exact cosine_map_pos hμ hq T.toContinuousLinearMap x ⟨T.symm x,T.apply_symm_apply x⟩ hx + +/-- The genuine bilinear inequality, with its global rigidity +consequence. The hypotheses are the support-functional bounds supplied by +Brunn--Minkowski, not the desired projection-volume conclusion. -/ +theorem measure_bilinear {n : ℕ} (hn : 4≤ n) [NeZero n] {μ ν : Measure (Space n)} + (hμ : Integrable (fun x : Space n => ‖x‖) μ) + (hν : Integrable (fun x : Space n => ‖x‖) ν) + (hqμ : ∀ x : Space n,x≠0 → 0< cosineSeminorm μ hμ x) + (hqν : ∀ x : Space n,x≠0 → 0< cosineSeminorm ν hν x) + (hbμ : ∀ M : Set (Space n),IsConvexBody M → normalizedVolume M≤ supportFunctional μ M) + (hbν : ∀ M : Set (Space n),IsConvexBody M → normalizedVolume M≤ supportFunctional ν M) : + cosineConstant n≤ measurePair μ ν ∧ + (measurePair μ ν=cosineConstant n → + ∃ T : Space n ≃L[ℝ] Space n,supportFunctional μ (T '' unitBall n)=normalizedVolume (T '' unitBall n)) := by + obtain ⟨T,hT,g,hg,hF⟩ := exists_symmetric_position hμ hqμ + let μ' := μ.map T + let ν' := ν.map T.symm + have hiμ : Integrable (fun x : Space n => ‖x‖) μ' := norm_integrable_map hμ T.toContinuousLinearMap + have hiν : Integrable (fun x : Space n => ‖x‖) ν' := norm_integrable_map hν T.symm.toContinuousLinearMap + have hpμ : ∀ x : Space n,x≠0 → 0< cosineSeminorm μ' hiμ x := cosine_equiv_pos hμ hqμ T + have hpν : ∀ x : Space n,x≠0 → 0< cosineSeminorm ν' hiν x := cosine_equiv_pos hν hqν T.symm + obtain ⟨f,hf⟩ := exists_full_minimizer hiν hpν (regime n) + obtain ⟨s,hs,hsrep,hse⟩ := volumeNormalize_representation hiμ hpμ g hg + obtain ⟨t,ht,htrep,hte⟩ := volumeNormalize_representation hiν hpν f hf + let α := volumeFactor T + have hα : 0<α := volumeFactor_pos T + have hgbody : IsConvexBody g.volumeNormalize.body := + ⟨g.volumeNormalize.compact,g.volumeNormalize.convex,g.volumeNormalize.top_interior⟩ + have hfbody : IsConvexBody f.volumeNormalize.body := + ⟨f.volumeNormalize.compact,f.volumeNormalize.convex,f.volumeNormalize.top_interior⟩ + have hgs : α≤ supportFunctional μ' g.volumeNormalize.body := by + have h := hbμ _ (linearEquiv_body T hgbody) + rw [normalizedVolume_linearEquiv,normalizedVolume_of_volume g.volumeNormalize_body_volume,mul_one, + ← functional_map_symmetric T hT hgbody.1 (hgbody.2.2.mono interior_subset)] at h + exact h + have hft : α⁻¹≤ supportFunctional ν' f.volumeNormalize.body := by + have h := hbν _ (linearEquiv_body T.symm hfbody) + rw [normalizedVolume_linearEquiv,normalizedVolume_of_volume f.volumeNormalize_body_volume,mul_one, + volumeFactor_symm,← functional_map_symmetric T.symm (symmetric_equiv_symm T hT) + hfbody.1 (hfbody.2.2.mono interior_subset)] at h + exact h + rw [hse] at hgs + rw [hte] at hft + have hsbound : 1≤(s/α)*gaugeMoment g.volumeNormalize.toSeminorm (Scalar.exponent n-1) := by + rw [div_mul_eq_mul_div,le_div_iff₀ hα,one_mul] + exact hgs + have htbound : 1≤(t*α)*gaugeMoment f.volumeNormalize.toSeminorm (Scalar.exponent n-1) := by + have hh := mul_le_mul_of_nonneg_left hft hα.le + rw [mul_inv_cancel₀ hα.ne'] at hh + nlinarith [hh] + obtain ⟨hlow,heq⟩ := Spherical.normalized_norm_pair hn g.volumeNormalize.toSeminorm + f.volumeNormalize.toSeminorm g.volumeNormalize.top_pos f.volumeNormalize.top_pos + g.volumeNormalize_moment f.volumeNormalize_moment (g.volumeNormalize_harmonic (by omega) hF) + (div_pos hs hα) (mul_pos ht hα) hsbound htbound + have hsprod : (s/α)*(t*α)=s*t := by field_simp + rw [hsprod] at hlow heq + have hpair := represents_pair hiν g.volumeNormalize.toSeminorm f.volumeNormalize.toSeminorm + (exponent_pos n) hsrep htrep + have hPinv : measurePair μ' ν'=measurePair μ ν := measurePair_map_symmetric hν T hT + rw [hPinv] at hpair + refine ⟨hpair.symm ▸ hlow,?_⟩ + intro h + obtain ⟨hg1,_,hs1,_⟩ := heq (hpair.symm.trans h) + have hbody : g.volumeNormalize.body=unitBall n := full_body_of_sphere_one _ hg1 + have hmoment : gaugeMoment g.volumeNormalize.toSeminorm (Scalar.exponent n-1)=1 := by + simp only [gaugeMoment] + simp_rw [hg1,one_pow] + exact Spherical.mean_const n 1 + have hsα : s=α := (div_eq_one_iff_eq hα.ne').mp hs1 + rw [hbody,hmoment,mul_one,hsα] at hse + refine ⟨T,?_⟩ + have hball : IsConvexBody (unitBall n) := hbody ▸ hgbody + rw [← functional_map_symmetric T hT hball.1 (hball.2.2.mono interior_subset), + hse,normalizedVolume_linearEquiv,normalizedVolume_of_volume (K := unitBall n) rfl,mul_one] + +end PettyProjection +end + +noncomputable section +open Set MeasureTheory Metric Filter Topology +open scoped NNReal RealInnerProductSpace Pointwise +namespace PettyProjection +open Spherical (Sphere norm_coe seminorm_continuous) +variable {n : ℕ} [NeZero n] {K : Set (Space n)} + +lemma gaugeMeasure_norm_integrable (hK : IsCompact K) (hc : Convex ℝ K) + (h0 : K∈𝓝 (0:Space n)) : Integrable (fun x : Space n => ‖x‖) (gaugeProjectionMeasure K) := by + let := gaugeMeasure_finite hK hc h0 + exact boundedMeasure_integrable_continuous (gaugeMeasure_bounded hc h0) continuous_norm + +lemma gaugeMeasure_cosine_pos (hK : IsCompact K) (hc : Convex ℝ K) + (h0 : K∈𝓝 (0:Space n)) : + ∀ x : Space n,x≠0 → 0< cosineSeminorm (gaugeProjectionMeasure K) (gaugeMeasure_norm_integrable hK hc h0) x := by + intro x hx + let u : Sphere n := ⟨‖x‖⁻¹ • x,by simp [norm_smul,hx]⟩ + have hu := gaugeMeasure_shadow hK hc h0 u + have hh := shadowVolume_pos hK h0 (u:Space n) + have hn : 0 < (n:ℝ)*kappa n := mul_pos (Nat.cast_pos.mpr (NeZero.pos n)) (kappa_pos n) + have hp : 0< cosineSeminorm (gaugeProjectionMeasure K) (gaugeMeasure_norm_integrable hK hc h0) u := by + change 0 < ∫ y,|⟪y,(u:Space n)⟫| ∂gaugeProjectionMeasure K + nlinarith + change 0< cosineSeminorm _ _ (‖x‖⁻¹ • x) at hp + rw [map_smul_eq_mul,Real.norm_of_nonneg (inv_nonneg.mpr (norm_nonneg _))] at hp + exact (mul_pos_iff.mp hp).elim (fun h => h.2) (fun h => False.elim (not_lt_of_ge (inv_nonneg.mpr (norm_nonneg x)) h.1)) + +def projectionSeminorm (hK : IsCompact K) (hc : Convex ℝ K) (h0 : K∈𝓝 (0:Space n)) : Seminorm ℝ (Space n) := by + let q := cosineSeminorm (gaugeProjectionMeasure K) (gaugeMeasure_norm_integrable hK hc h0) + let c : ℝ := (n : ℝ)*kappa n/2 + have hc : 0 ≤ c := div_nonneg (mul_nonneg (Nat.cast_nonneg _) (kappa_pos n).le) (by norm_num) + exact Seminorm.of (fun x => c*q x) + (fun x y => by + simpa only [mul_add] using mul_le_mul_of_nonneg_left (map_add_le_add q x y) hc) + (fun r x => by rw [map_smul_eq_mul];ring) + +lemma projectionSeminorm_unit (hK : IsCompact K) (hc : Convex ℝ K) (h0 : K∈𝓝 (0:Space n)) + (u : Sphere n) : projectionSeminorm hK hc h0 u=shadowVolume K u := by + have hh := gaugeMeasure_shadow hK hc h0 u + change (n*kappa n/2)*(∫ x,|⟪x,(u:Space n)⟫| ∂gaugeProjectionMeasure K)=_ + linarith + +lemma projectionSeminorm_pos (hK : IsCompact K) (hc : Convex ℝ K) (h0 : K∈𝓝 (0:Space n)) + (u : Sphere n) : 0< projectionSeminorm hK hc h0 u := by + rw [projectionSeminorm_unit] + exact shadowVolume_pos hK h0 u + +lemma projectionBody_eq_wulff (hK : IsCompact K) (hc : Convex ℝ K) (h0 : K∈𝓝 (0:Space n)) : + projectionBody K=wulff (fun u : Sphere n => projectionSeminorm hK hc h0 u) := by + ext x + constructor + · intro hx u + change ⟪(u:Space n),x⟫ ≤ projectionSeminorm hK hc h0 u + rw [projectionSeminorm_unit] + exact hx u (norm_coe u) + · intro hx u hu + let v : Sphere n := ⟨u,by simpa only [mem_sphere,dist_zero_right] using hu⟩ + have h : ⟪u,x⟫ ≤ projectionSeminorm hK hc h0 v := hx v + rw [projectionSeminorm_unit] at h + exact h + +lemma projectionBody_body (hK : IsCompact K) (hc : Convex ℝ K) (h0 : K∈𝓝 (0:Space n)) : + IsConvexBody (projectionBody K) := by + rw [projectionBody_eq_wulff hK hc h0] + exact wulff_body ⟨fun u : Sphere n => projectionSeminorm hK hc h0 (u:Space n),(seminorm_continuous n (projectionSeminorm hK hc h0)).comp continuous_subtype_val⟩ + (projectionSeminorm_pos hK hc h0) + +lemma projectionBody_nhds (hK : IsCompact K) (hc : Convex ℝ K) (h0 : K∈𝓝 (0:Space n)) : + projectionBody K∈𝓝 (0:Space n) := by + rw [projectionBody_eq_wulff hK hc h0] + exact wulff_nhds ⟨fun u : Sphere n => projectionSeminorm hK hc h0 (u:Space n),(seminorm_continuous n (projectionSeminorm hK hc h0)).comp continuous_subtype_val⟩ + (projectionSeminorm_pos hK hc h0) + +lemma projectionBody_support (hK : IsCompact K) (hc : Convex ℝ K) (h0 : K∈𝓝 (0:Space n)) + (x : Space n) : support (projectionBody K) x= + (n*kappa n/2)*∫ y,|⟪y,x⟫| ∂gaugeProjectionMeasure K := by + rw [projectionBody_eq_wulff hK hc h0,support_wulff_seminorm _ (projectionSeminorm_pos hK hc h0)] + rfl + +lemma projectionBody_support_unit (hK : IsCompact K) (hc : Convex ℝ K) (h0 : K∈𝓝 (0:Space n)) + (u : Sphere n) : support (projectionBody K) u=shadowVolume K u := by + rw [projectionBody_eq_wulff hK hc h0,support_wulff_seminorm _ (projectionSeminorm_pos hK hc h0), + projectionSeminorm_unit] + +end PettyProjection +end + +noncomputable section +open Set MeasureTheory Metric Filter Topology +open scoped NNReal RealInnerProductSpace Pointwise Gradient +namespace PettyProjection +open Spherical (Sphere norm_coe mean) +variable {n : ℕ} [NeZero n] + +omit [NeZero n] in +lemma unitBall_body : IsConvexBody (unitBall n) := by + exact ⟨isCompact_closedBall _ _,convex_closedBall _ _,⟨0,mem_interior_iff_mem_nhds.mpr (closedBall_mem_nhds _ (by norm_num))⟩⟩ + +omit [NeZero n] in +lemma unitBall_nhds : unitBall n∈𝓝 (0:Space n) := closedBall_mem_nhds _ (by norm_num) + +omit [NeZero n] in +lemma shadowVolume_unitBall (u : Sphere n) : shadowVolume (unitBall n) u=kappa (n-1) := by + have him : (perpendicular (u:Space n)).orthogonalProjectionOnto '' unitBall n= + closedBall (0:perpendicular (u:Space n)) 1 := by + ext z + constructor + · rintro ⟨x,hx,rfl⟩ + simp only [unitBall,mem_closedBall,dist_zero_right] at hx ⊢ + exact ((perpendicular (u:Space n)).norm_orthogonalProjectionOnto_apply_le x).trans hx + · intro hz + refine ⟨z,?_,Submodule.orthogonalProjectionOnto_mem_subspace_eq_self z⟩ + simpa [unitBall] using hz + let e : perpendicular (u:Space n) ≃ₗᵢ[ℝ] Space (n-1) := + ((stdOrthonormalBasis ℝ (perpendicular (u:Space n))).reindex (finCongr (perpendicular_finrank u))).repr + unfold shadowVolume + rw [him] + have he : e ⁻¹' unitBall (n-1)=closedBall (0:perpendicular (u:Space n)) 1 := by + ext z + simp [unitBall,dist_zero_right] + have hh := e.measurePreserving.measure_preimage (isClosed_closedBall.measurableSet.nullMeasurableSet : NullMeasurableSet (unitBall (n-1)) volume) + change volume (e ⁻¹' unitBall (n-1)) = volume (unitBall (n-1)) at hh + rw [he] at hh + exact congrArg ENNReal.toReal hh + +omit [NeZero n] in +lemma gradient_norm_unit (u : Sphere n) : ∇ (fun x : Space n => ‖x‖) (u:Space n)=(u:Space n) := by + have hd := (hasStrictFDerivAt_norm_sq (u:Space n)).hasFDerivAt.sqrt (by rw [norm_coe];norm_num) + simp only [norm_coe,one_pow,Real.sqrt_one,mul_one] at hd + have hs : (1/(2:ℝ)) • (2 • innerSL ℝ (u:Space n))=innerSL ℝ (u:Space n) := by + ext v + simp only [smul_apply,two_smul,smul_eq_mul,add_apply] + ring + rw [hs] at hd + have hd' : HasFDerivAt (fun x : Space n => ‖x‖) (innerSL ℝ (u:Space n)) (u:Space n) := by + simpa only [Real.sqrt_sq (norm_nonneg _)] using hd + apply (InnerProductSpace.toDual ℝ (Space n)).injective + rw [toDual_gradient,hd'.fderiv] + rfl + +lemma ball_cosine_constant : 2*kappa (n-1)=(n:ℝ)*kappa n*Spherical.cosineConstant n := by + let u : Sphere n := Spherical.pole n + have hh := shadow_gauge_formula (K :=unitBall n) unitBall_body.1 unitBall_body.2.1 unitBall_nhds u + have hg : gauge (unitBall n)=(fun x : Space n => ‖x‖) := by + funext x + simp [unitBall,gauge_closedBall (E :=Space n) (by norm_num : (0:ℝ)≤1) x] + have he : (fun v : Sphere n => (gauge (unitBall n) (v:Space n))⁻¹^n* + |⟪∇ (gauge (unitBall n)) (v:Space n),(u:Space n)⟫|)= + (fun v : Sphere n => |⟪(u:Space n),(v:Space n)⟫|) := by + funext v + rw [hg,gradient_norm_unit] + change (‖(v:Space n)‖)⁻¹^n*|⟪(v:Space n),(u:Space n)⟫|=_ + rw [norm_coe] + simp only [inv_one,one_pow,one_mul,real_inner_comm (v:Space n)] + rw [shadowVolume_unitBall,he,Spherical.mean_abs_inner] at hh + exact hh + +end PettyProjection +end + +end OAI diff --git a/lean/OAI/Geometry/ProjectionBodies/Brouwer.lean b/lean/OAI/Geometry/ProjectionBodies/Brouwer.lean new file mode 100644 index 0000000000000000000000000000000000000000..80b0a5d5d054f5a7c3641d8a342344292ddc404b --- /dev/null +++ b/lean/OAI/Geometry/ProjectionBodies/Brouwer.lean @@ -0,0 +1,184 @@ +import OAI.Geometry.ProjectionBodies.FixedPointCalculus + +namespace OAI + +universe uE + +noncomputable section +open Set Metric Filter Topology MeasureTheory +open scoped RealInnerProductSpace +namespace PettyProjection.FixedPoint +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +lemma contDiffAt_rayRetraction {f : E → E} {x : E} (hf : ContDiffAt ℝ 1 f x) + (hc : ‖f x‖<1) (hne : x≠f x) : + ContDiffAt ℝ 1 (fun y => rayRetraction (f y) y) x := by + have hv : ContDiffAt ℝ 1 (fun y => y-f y) x := contDiffAt_id.sub hf + have ha : ContDiffAt ℝ 1 (fun y => ‖y-f y‖^2) x := hv.norm_sq (𝕜 := ℝ) + have hb : ContDiffAt ℝ 1 (fun y => ⟪f y,y-f y⟫) x := hf.inner ℝ hv + have hc2 : ContDiffAt ℝ 1 (fun y => ‖f y‖^2) x := hf.norm_sq (𝕜 := ℝ) + have ha0 : 0<‖x-f x‖^2 := sq_pos_of_pos (norm_pos_iff.mpr (sub_ne_zero.mpr hne)) + have hcc : ‖f x‖^2<1 := by nlinarith [norm_nonneg (f x)] + have hd0 : 0<⟪f x,x-f x⟫^2+‖x-f x‖^2*(1-‖f x‖^2) := by + nlinarith [sq_nonneg ⟪f x,x-f x⟫] + have hroot := (((hb.pow 2).add (ha.mul (contDiffAt_const.sub hc2))).sqrt + (ne_of_gt hd0)).sub hb + have ht := hroot.div ha (ne_of_gt ha0) + exact hf.add (ht.smul hv) + +lemma smooth_fixedPoint_ball [FiniteDimensional ℝ E] {f : E → E} + (hf : ContDiff ℝ 1 f) (hb : ∀ x∈closedBall (0:E) 1, ‖f x‖<1) : + ∃ x∈closedBall (0:E) 1, f x=x := by + by_contra h + have hne (x : E) (hx : x∈closedBall (0:E) 1) : x≠f x := by + intro he + exact h ⟨x,hx,he.symm⟩ + let r : E → E := fun x => rayRetraction (f x) x + have hr (x : E) (hx : x∈closedBall (0:E) 1) : ContDiffAt ℝ 1 r x := + contDiffAt_rayRetraction hf.contDiffAt (hb x hx) (hne x hx) + borelize E + apply no_smooth_retraction (.addHaar : Measure E) + (r' := fderiv ℝ r) + (fun x hx => ((hr x hx).differentiableAt (by norm_num)).hasFDerivAt.hasFDerivWithinAt) + (fun x hx => ((hr x hx).continuousAt_fderiv (by norm_num)).continuousWithinAt) + · intro x hx + exact rayRetraction_norm (hb x hx) (hne x hx) + · intro x hx + exact rayRetraction_boundary (hb x (by simpa only [mem_closedBall,dist_zero_right,hx] using le_rfl (a := (1:ℝ)))) hx + +end PettyProjection.FixedPoint +end + +noncomputable section +open Set Metric Topology +namespace PettyProjection.FixedPoint +variable {E : Type uE} [NormedAddCommGroup E] +section Approximation +variable [NormedSpace ℝ E] + +lemma scaled_approximation {u v : E} {ε : ℝ} (hε : 0<ε) (hv : ‖v‖≤1) + (huv : dist u v<ε) : + ‖(1+ε)⁻¹ • u‖<1 ∧ dist ((1+ε)⁻¹ • u) v<2*ε := by + let a : ℝ := (1+ε)⁻¹ + have hden : 0<1+ε := by linarith + have ha : 0 f (ballNearest x)) := by + let : CompactSpace (closedBall (0:E) 1) := isCompact_iff_compactSpace.mp (isCompact_closedBall _ _) + have hfc : Continuous (fun x : closedBall (0:E) 1 => f x) := + continuousOn_iff_continuous_domRestrict.mp hf + have hp : UniformContinuous (fun x : E => (⟨ballNearest x,ballNearest_mem x⟩ : closedBall (0:E) 1)) := + ballNearest_lipschitz.uniformContinuous.subtype_mk _ + exact (CompactSpace.uniformContinuous_of_continuous hfc).comp hp + +end PettyProjection.FixedPoint +end + +noncomputable section +open Set Metric Topology +namespace PettyProjection.FixedPoint +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] + +/-- The full continuous finite-dimensional unit-ball fixed-point theorem, +obtained from polynomial Jacobian integration, not from a topological axiom. -/ +lemma fixedPoint_unitBall {f : E → E} (hf : ContinuousOn f (closedBall (0:E) 1)) + (hball : MapsTo f (closedBall (0:E) 1) (closedBall (0:E) 1)) : + ∃ x∈closedBall (0:E) 1, f x=x := by + by_contra hfix + have hgap : ContinuousOn (fun x => ‖f x-x‖) (closedBall (0:E) 1) := + (hf.sub continuousOn_id).norm + obtain ⟨x₀,hx₀,hmin⟩ := (isCompact_closedBall (0:E) 1).exists_isMinOn + (nonempty_closedBall.mpr (by norm_num)) hgap + let δ : ℝ := ‖f x₀-x₀‖ + have hδ : 0<δ := by + apply norm_pos_iff.mpr + intro he + exact hfix ⟨x₀,hx₀,sub_eq_zero.mp he⟩ + let ε : ℝ := δ/4 + have hε : 0<ε := div_pos hδ (by norm_num) + obtain ⟨g,hg,hga⟩ := (uniformlyContinuous_ball_extension hf).exists_contDiff_dist_le hε + have happ (x : E) (hx : x∈closedBall (0:E) 1) : dist (g x) (f x)<ε := by + have he : ballNearest x=x := ballNearest_eq + (by simpa only [mem_closedBall,dist_zero_right] using hx) + simpa only [he] using hga x + have hn (x : E) (hx : x∈closedBall (0:E) 1) : ‖f x‖≤1 := by + simpa only [mem_closedBall,dist_zero_right] using hball hx + let q : E → E := fun x => (1+ε)⁻¹ • g x + have hq : ContDiff ℝ 1 q := (hg.of_le (by norm_num)).const_smul _ + have hqb (x : E) (hx : x∈closedBall (0:E) 1) : ‖q x‖<1 := + (scaled_approximation hε (hn x hx) (happ x hx)).1 + obtain ⟨x,hx,hqx⟩ := smooth_fixedPoint_ball hq hqb + have hdist := (scaled_approximation hε (hn x hx) (happ x hx)).2 + change dist (q x) (f x)<2*ε at hdist + rw [hqx,dist_eq_norm,norm_sub_rev] at hdist + have hh : δ≤‖f x-x‖ := hmin hx + dsimp [ε] at hdist + linarith + +end PettyProjection.FixedPoint +end + +noncomputable section +open Set Metric Topology +namespace PettyProjection.FixedPoint +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] + +/-- Brouwer on any nonempty compact convex set, derived from the genuine +unit-ball theorem by the nearest-point extension. -/ +theorem fixedPoint_compact_convex {K : Set E} (hne : K.Nonempty) + (hk : IsCompact K) (hc : Convex ℝ K) {f : E → E} + (hf : ContinuousOn f K) (hmap : MapsTo f K K) : ∃ x∈K, f x=x := by + obtain ⟨R,hR,hbound⟩ := hk.isBounded.exists_pos_norm_le + let p : E → E := nearest K hne hk.isComplete hc + have hp (x : E) : p x∈K := nearest_mem K hne hk.isComplete hc x + have hpc : Continuous p := (nearest_lipschitz K hne hk.isComplete hc).continuous + let F : E → E := fun x => R⁻¹ • f (p (R • x)) + have hFc : Continuous F := by + apply Continuous.const_smul + exact hf.comp_continuous (hpc.comp (continuous_const.smul continuous_id)) (fun x => hp _) + have hFB : MapsTo F (closedBall (0:E) 1) (closedBall (0:E) 1) := by + intro x hx + rw [mem_closedBall,dist_zero_right] + change ‖R⁻¹ • f (p (R • x))‖≤1 + rw [norm_smul,Real.norm_eq_abs,abs_of_pos (inv_pos.mpr hR)] + exact (inv_mul_le_iff₀ hR).mpr (by simpa using hbound _ (hmap (hp _))) + obtain ⟨x,_,hfix⟩ := fixedPoint_unitBall hFc.continuousOn hFB + have he : f (p (R • x))=R • x := by + have hh := congrArg (fun y : E => R • y) hfix + simpa only [F,smul_smul,mul_inv_cancel₀ hR.ne',one_smul] using hh + have hxK : R • x∈K := he ▸ hmap (hp _) + refine ⟨R • x,hxK,?_⟩ + have hpfix : p (R • x)=R • x := nearest_eq_of_mem K hne hk.isComplete hc hxK + rwa [hpfix] at he + +end PettyProjection.FixedPoint +end + +end OAI diff --git a/lean/OAI/Geometry/ProjectionBodies/BrunnMinkowski.lean b/lean/OAI/Geometry/ProjectionBodies/BrunnMinkowski.lean new file mode 100644 index 0000000000000000000000000000000000000000..8358d76a37fb7dad5618a8d5672e447054b10188 --- /dev/null +++ b/lean/OAI/Geometry/ProjectionBodies/BrunnMinkowski.lean @@ -0,0 +1,315 @@ +import OAI.Geometry.ProjectionBodies.SliceTransport + +namespace OAI + +universe uE uF + +noncomputable section +open Set MeasureTheory Filter Topology +open scoped Pointwise +namespace PettyProjection +section +variable {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] + [FiniteDimensional ℝ E] [MeasureSpace E] [BorelSpace E] + [Measure.IsAddHaarMeasure (volume : Measure E)] + +/-- The dimension-induction predicate, used only with a proved lower-dimensional +case. It is not an extra hypothesis on the projection-volume main theorem. -/ +def BrunnMinkowskiRoot (E : Type uE) [NormedAddCommGroup E] [NormedSpace ℝ E] + [MeasureSpace E] (m : ℕ) : Prop := + ∀ K M : Set E, IsCompact K → Convex ℝ K → (interior K).Nonempty → + IsCompact M → Convex ℝ M → (interior M).Nonempty → + ∀ a b : ℝ, 0 ≤ a → 0 ≤ b → a+b=1 → + a*(volume.real K)^((m:ℝ)⁻¹)+b*(volume.real M)^((m:ℝ)⁻¹) ≤ + (volume.real (a • K+b • M))^((m:ℝ)⁻¹) + +omit [FiniteDimensional ℝ E] [BorelSpace E] in +lemma sliceDensity_root_concave {m : ℕ} (hm : BrunnMinkowskiRoot E m) + {K : Set (E × ℝ)} (hK : IsCompact K) (hc : Convex ℝ K) + (hi : (interior K).Nonempty) {l r : ℝ} + (hl : l ∈ Prod.snd '' K) (hr : r ∈ Prod.snd '' K) : + ConcaveOn ℝ (Ioo l r) (fun s => (sliceDensity K s)^((m:ℝ)⁻¹)) := by + refine ⟨convex_Ioo l r,?_⟩ + intro s hs t ht a b ha hb hab + have hlower := hm (horizontalSlice K s) (horizontalSlice K t) + (horizontalSlice_compact hK s) (horizontalSlice_convex hc s) + (horizontalSlice_interior_nonempty hc hi hl hr hs) + (horizontalSlice_compact hK t) (horizontalSlice_convex hc t) + (horizontalSlice_interior_nonempty hc hi hl hr ht) a b ha hb hab + exact hlower.trans (Real.rpow_le_rpow measureReal_nonneg + (measureReal_mono (horizontalSlice_combo_subset hc ha hb hab s t) + (horizontalSlice_compact hK (a*s+b*t)).measure_ne_top) (by positivity)) + +omit [FiniteDimensional ℝ E] [BorelSpace E] in +lemma sliceDensity_continuous {m : ℕ} (hm0 : 0 < m) (hm : BrunnMinkowskiRoot E m) + {K : Set (E × ℝ)} (hK : IsCompact K) (hc : Convex ℝ K) + (hi : (interior K).Nonempty) {l r : ℝ} + (hl : l ∈ Prod.snd '' K) (hr : r ∈ Prod.snd '' K) : + ContinuousOn (sliceDensity K) (Ioo l r) := by + have h := (ConcaveOn.continuousOn isOpen_Ioo + (sliceDensity_root_concave hm hK hc hi hl hr)).pow m + convert h using 1 + funext s + exact (Real.rpow_inv_natCast_pow (sliceDensity_nonneg K s) hm0.ne').symm + +/-- The actual convex-body product step, not a replacement by abstract densities. -/ +theorem brunnMinkowski_product_unit {m : ℕ} (hm0 : 0 < m) (hm : BrunnMinkowskiRoot E m) + {K M : Set (E × ℝ)} (hK : IsCompact K) (hcK : Convex ℝ K) + (hiK : (interior K).Nonempty) (hM : IsCompact M) (hcM : Convex ℝ M) + (hiM : (interior M).Nonempty) (hvK : volume.real K=1) (hvM : volume.real M=1) + {a b : ℝ} (ha : 0 < a) (hb : 0 < b) (hab : a+b=1) : + 1 ≤ volume.real (a • K+b • M) := by + obtain ⟨l,r,hlr,hpr⟩ := vertical_projection_interval hK hcK hiK + obtain ⟨L,R,hLR,hPR⟩ := vertical_projection_interval hM hcM hiM + have hl : l ∈ Prod.snd '' K := by rw [hpr]; exact left_mem_Icc.mpr hlr.le + have hr : r ∈ Prod.snd '' K := by rw [hpr]; exact right_mem_Icc.mpr hlr.le + have hL : L ∈ Prod.snd '' M := by rw [hPR]; exact left_mem_Icc.mpr hLR.le + have hR : R ∈ Prod.snd '' M := by rw [hPR]; exact right_mem_Icc.mpr hLR.le + have hC : IsCompact (a • K+b • M) := (hK.smul a).add (hM.smul b) + have hbounds : Prod.snd '' (a • K+b • M) ⊆ Icc (a*l+b*L) (a*r+b*R) := by + rintro s ⟨_,⟨_,⟨x,hx,rfl⟩,_,⟨y,hy,rfl⟩,rfl⟩,rfl⟩ + have hx' : x.2 ∈ Icc l r := by rw [← hpr]; exact mem_image_of_mem _ hx + have hy' : y.2 ∈ Icc L R := by rw [← hPR]; exact mem_image_of_mem _ hy + change a*l+b*L ≤ a*x.2+b*y.2 ∧ a*x.2+b*y.2 ≤ a*r+b*R + exact ⟨add_le_add (mul_le_mul_of_nonneg_left hx'.1 ha.le) (mul_le_mul_of_nonneg_left hy'.1 hb.le), + add_le_add (mul_le_mul_of_nonneg_left hx'.2 ha.le) (mul_le_mul_of_nonneg_left hy'.2 hb.le)⟩ + rw [← sliceDensity_interval_integral hC (by nlinarith) hbounds] + apply slice_transport hm0 ha hb hab hlr hLR + (sliceDensity_continuous hm0 hm hK hcK hiK hl hr) + (sliceDensity_continuous hm0 hm hM hcM hiM hL hR) + (sliceDensity_integrable hK).intervalIntegrable + (sliceDensity_integrable hM).intervalIntegrable + (fun s hs => sliceDensity_pos hK hcK hiK hl hr hs) + (fun s hs => sliceDensity_pos hM hcM hiM hL hR hs) + · rw [sliceDensity_interval_integral hK hlr.le (by rw [hpr]),hvK] + · rw [sliceDensity_interval_integral hM hLR.le (by rw [hPR]),hvM] + · exact (sliceDensity_integrable hC).intervalIntegrable + · intro s hs t ht + have hroot := hm (horizontalSlice K s) (horizontalSlice M t) + (horizontalSlice_compact hK s) (horizontalSlice_convex hcK s) + (horizontalSlice_interior_nonempty hcK hiK hl hr hs) + (horizontalSlice_compact hM t) (horizontalSlice_convex hcM t) + (horizontalSlice_interior_nonempty hcM hiM hL hR ht) a b ha.le hb.le hab + have hf0 := sliceDensity_nonneg K s + have hg0 := sliceDensity_nonneg M t + have hroot' := pow_le_pow_left₀ (by positivity : 0 ≤ a*(sliceDensity K s)^((m:ℝ)⁻¹)+b*(sliceDensity M t)^((m:ℝ)⁻¹)) hroot m + rw [Real.rpow_inv_natCast_pow measureReal_nonneg hm0.ne'] at hroot' + exact hroot'.trans (measureReal_mono (horizontalSlice_minkowski_subset K M a b s t) + (horizontalSlice_compact hC _).measure_ne_top) + +end +end PettyProjection +end + +noncomputable section +open Set MeasureTheory Filter Topology +open scoped Pointwise +namespace PettyProjection +section +variable {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] + [FiniteDimensional ℝ E] [MeasureSpace E] [BorelSpace E] + [Measure.IsAddHaarMeasure (volume : Measure E)] + +lemma volumeReal_smul_nonneg {r : ℝ} (hr : 0 ≤ r) (K : Set E) : + volume.real (r • K)=r^(Module.finrank ℝ E)*volume.real K := by + rw [Measure.real,Measure.addHaar_smul_of_nonneg volume hr,ENNReal.toReal_mul, + ENNReal.toReal_ofReal (pow_nonneg hr _)] + rfl + +omit [NormedSpace ℝ E] [FiniteDimensional ℝ E] [BorelSpace E] in +lemma volumeReal_pos_of_body {K : Set E} (hK : IsCompact K) (hi : (interior K).Nonempty) : + 0 < volume.real K := + ENNReal.toReal_pos (ne_of_gt (lt_of_lt_of_le (isOpen_interior.measure_pos volume hi) + (measure_mono interior_subset))) hK.measure_ne_top + +/-- Usual normalization from the unit-volume form. The exponent is the actual +finite dimension of the Haar space, and the bodies remain arbitrary. -/ +theorem brunnMinkowski_of_unit {d : ℕ} (hd : 0 < d) (hDim : Module.finrank ℝ E=d) + (hunit : ∀ K M : Set E, IsCompact K → Convex ℝ K → (interior K).Nonempty → + IsCompact M → Convex ℝ M → (interior M).Nonempty → + volume.real K=1 → volume.real M=1 → ∀ a b : ℝ, 0 < a → 0 < b → a+b=1 → + 1 ≤ volume.real (a • K+b • M)) : BrunnMinkowskiRoot E d := by + intro K M hK hcK hiK hM hcM hiM a b ha hb hab + obtain rfl | ha := ha.eq_or_lt + · have hb1 : b=1 := by linarith + simp [hb1,zero_smul_set (hiK.mono interior_subset)] + obtain rfl | hb := hb.eq_or_lt + · have ha1 : a=1 := by linarith + simp [ha1,zero_smul_set (hiM.mono interior_subset)] + let p := (volume.real K)^((d:ℝ)⁻¹) + let q := (volume.real M)^((d:ℝ)⁻¹) + let D := a*p+b*q + have hp : 0 < p := Real.rpow_pos_of_pos (volumeReal_pos_of_body hK hiK) _ + have hq : 0 < q := Real.rpow_pos_of_pos (volumeReal_pos_of_body hM hiM) _ + have hD : 0 < D := by dsimp [D]; positivity + have hpm : p^d=volume.real K := Real.rpow_inv_natCast_pow measureReal_nonneg hd.ne' + have hqm : q^d=volume.real M := Real.rpow_inv_natCast_pow measureReal_nonneg hd.ne' + have hUK : volume.real (p⁻¹ • K)=1 := by + rw [volumeReal_smul_nonneg (inv_nonneg.mpr hp.le),hDim,inv_pow,hpm] + exact inv_mul_cancel₀ (volumeReal_pos_of_body hK hiK).ne' + have hUM : volume.real (q⁻¹ • M)=1 := by + rw [volumeReal_smul_nonneg (inv_nonneg.mpr hq.le),hDim,inv_pow,hqm] + exact inv_mul_cancel₀ (volumeReal_pos_of_body hM hiM).ne' + have hiUK : (interior (p⁻¹ • K)).Nonempty := by + rw [interior_smul₀ (inv_ne_zero hp.ne')] + exact hiK.image _ + have hiUM : (interior (q⁻¹ • M)).Nonempty := by + rw [interior_smul₀ (inv_ne_zero hq.ne')] + exact hiM.image _ + have he := hunit (p⁻¹ • K) (q⁻¹ • M) (hK.smul _) (hcK.smul _) hiUK + (hM.smul _) (hcM.smul _) hiUM hUK hUM (a*p/D) (b*q/D) + (by positivity) (by positivity) (by rw [← add_div]; exact div_self hD.ne') + have hsets : (a*p/D) • (p⁻¹ • K)+(b*q/D) • (q⁻¹ • M)=D⁻¹ • (a • K+b • M) := by + rw [smul_add,smul_smul,smul_smul,smul_smul,smul_smul] + congr 2 <;> field_simp + rw [hsets,volumeReal_smul_nonneg (inv_nonneg.mpr hD.le),hDim,inv_pow] at he + have hpow : D^d ≤ volume.real (a • K+b • M) := by + have hx := mul_le_mul_of_nonneg_left he (pow_nonneg hD.le d) + simpa only [mul_one,← mul_assoc,mul_inv_cancel₀ (pow_ne_zero _ hD.ne'),one_mul] using hx + have hr := Real.rpow_le_rpow (pow_nonneg hD.le d) hpow (by positivity : 0 ≤ (d:ℝ)⁻¹) + rw [← Real.rpow_natCast,← Real.rpow_mul hD.le,mul_inv_cancel₀ (by exact_mod_cast hd.ne'),Real.rpow_one] at hr + exact hr + +end +end PettyProjection +end + +noncomputable section +open Set MeasureTheory Filter Topology +open scoped Pointwise +namespace PettyProjection +section +variable {E : Type uE} {F : Type uF} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] + [MeasureSpace E] [BorelSpace E] [MeasureSpace F] [BorelSpace F] + +omit [MeasureSpace E] [BorelSpace E] [MeasureSpace F] [BorelSpace F] in +lemma linearEquiv_preimage_combo (e : E ≃L[ℝ] F) (K M : Set F) (a b : ℝ) : + e ⁻¹' (a • K+b • M)=a • (e ⁻¹' K)+b • (e ⁻¹' M) := by + ext z + constructor + · rintro ⟨_,⟨x,hx,rfl⟩,_,⟨y,hy,rfl⟩,he⟩ + refine ⟨a • e.symm x,⟨e.symm x,by simpa using hx,rfl⟩, + b • e.symm y,⟨e.symm y,by simpa using hy,rfl⟩,?_⟩ + apply e.injective + simpa using he + · rintro ⟨_,⟨x,hx,rfl⟩,_,⟨y,hy,rfl⟩,rfl⟩ + exact ⟨a • e x,⟨e x,hx,rfl⟩,b • e y,⟨e y,hy,rfl⟩,by simp⟩ + +omit [BorelSpace E] in +lemma BrunnMinkowskiRoot.equiv {m : ℕ} (hm : BrunnMinkowskiRoot E m) + (e : E ≃L[ℝ] F) (he : MeasurePreserving e) : BrunnMinkowskiRoot F m := by + intro K M hK hcK hiK hM hcM hiM a b ha hb hab + have hPK : IsCompact (e ⁻¹' K) := e.toHomeomorph.isCompact_preimage.mpr hK + have hPM : IsCompact (e ⁻¹' M) := e.toHomeomorph.isCompact_preimage.mpr hM + have hiPK : (interior (e ⁻¹' K)).Nonempty := by + change (interior (e.toHomeomorph ⁻¹' K)).Nonempty + rw [← e.toHomeomorph.preimage_interior] + obtain ⟨x,hx⟩ := hiK + exact ⟨e.symm x,by simpa using hx⟩ + have hiPM : (interior (e ⁻¹' M)).Nonempty := by + change (interior (e.toHomeomorph ⁻¹' M)).Nonempty + rw [← e.toHomeomorph.preimage_interior] + obtain ⟨x,hx⟩ := hiM + exact ⟨e.symm x,by simpa using hx⟩ + have h := hm (e ⁻¹' K) (e ⁻¹' M) hPK (hcK.linear_preimage e.toLinearMap) hiPK + hPM (hcM.linear_preimage e.toLinearMap) hiPM a b ha hb hab + have hm' (S : Set F) (hS : IsCompact S) : volume.real (e ⁻¹' S)=volume.real S := + congrArg ENNReal.toReal (he.measure_preimage hS.measurableSet.nullMeasurableSet) + rw [hm' K hK,hm' M hM,← linearEquiv_preimage_combo,hm' _ ((hK.smul _).add (hM.smul _))] at h + exact h +end + +/-- The one-dimensional base case, with no symmetry or origin condition. -/ +lemma brunnMinkowski_real : BrunnMinkowskiRoot ℝ 1 := by + intro K M hK hcK hiK hM hcM hiM a b ha hb hab + obtain rfl | ha := ha.eq_or_lt + · have hb1 : b=1 := by linarith + simp [hb1,zero_smul_set (hiK.mono interior_subset)] + obtain rfl | hb := hb.eq_or_lt + · have ha1 : a=1 := by linarith + simp [ha1,zero_smul_set (hiM.mono interior_subset)] + rw [compact_convex_real_interval hK hcK (hiK.mono interior_subset), + compact_convex_real_interval hM hcM (hiM.mono interior_subset)] + have hKlr : sInf K ≤ sSup K := (hK.isGLB_sInf (hiK.mono interior_subset)).1 + (hK.sSup_mem (hiK.mono interior_subset)) + have hMlr : sInf M ≤ sSup M := (hM.isGLB_sInf (hiM.mono interior_subset)).1 + (hM.sSup_mem (hiM.mono interior_subset)) + have hKa : a*sInf K ≤ a*sSup K := mul_le_mul_of_nonneg_left hKlr ha.le + have hMb : b*sInf M ≤ b*sSup M := mul_le_mul_of_nonneg_left hMlr hb.le + rw [LinearOrderedField.smul_Icc ha,LinearOrderedField.smul_Icc hb,Icc_add_Icc hKa hMb] + simp only [Nat.cast_one,inv_one,Real.rpow_one,Real.volume_real_Icc] + rw [max_eq_left (sub_nonneg.mpr hKlr),max_eq_left (sub_nonneg.mpr hMlr), + max_eq_left (sub_nonneg.mpr (add_le_add hKa hMb))] + nlinarith + +/-- Standard coordinate splitting, with explicit measure evidence. -/ +def finSplitLinear (n : ℕ) : (Fin (n+1) → ℝ) ≃ₗ[ℝ] ((Fin n → ℝ) × ℝ) where + toEquiv := (MeasurableEquiv.piFinSuccAbove (fun _ : Fin (n+1) => ℝ) 0).toEquiv.trans + (Equiv.prodComm _ _) + map_add' _ _ := rfl + map_smul' _ _ := rfl + +def finSplit (n : ℕ) : (Fin (n+1) → ℝ) ≃L[ℝ] ((Fin n → ℝ) × ℝ) := + (finSplitLinear n).toContinuousLinearEquiv + +lemma finSplit_measurePreserving (n : ℕ) : MeasurePreserving (finSplit n) := by + have hs : MeasurePreserving (Prod.swap : ℝ × (Fin n → ℝ) → (Fin n → ℝ) × ℝ) := by + simpa only [Measure.volume_eq_prod] using + (Measure.measurePreserving_swap (μ := (volume : Measure ℝ)) (ν := (volume : Measure (Fin n → ℝ)))) + exact hs.comp (volume_preserving_piFinSuccAbove (fun _ : Fin (n+1) => ℝ) 0) + +def finOneLinear : (Fin 1 → ℝ) ≃ₗ[ℝ] ℝ := LinearEquiv.funUnique (Fin 1) ℝ ℝ + +def finOne : (Fin 1 → ℝ) ≃L[ℝ] ℝ := finOneLinear.toContinuousLinearEquiv + +lemma finOne_measurePreserving : MeasurePreserving finOne := + volume_preserving_piUnique (fun _ : Fin 1 => ℝ) + +/-- Brunn--Minkowski in all positive Cartesian dimensions, obtained by the +actual convex-body slice induction. -/ +theorem brunnMinkowski_fin (n : ℕ) : BrunnMinkowskiRoot (Fin (n+1) → ℝ) (n+1) := by + induction n with + | zero => + exact brunnMinkowski_real.equiv finOne.symm + (MeasurePreserving.symm finOne.toHomeomorph.toMeasurableEquiv finOne_measurePreserving) + | succ n ih => + let : Measure.IsAddHaarMeasure (volume : Measure ((Fin (n+1) → ℝ) × ℝ)) := by + rw [Measure.volume_eq_prod] + infer_instance + have hprod : BrunnMinkowskiRoot ((Fin (n+1) → ℝ) × ℝ) (n+1+1) := by + apply brunnMinkowski_of_unit (by omega) + · simp + · intro K M hK hcK hiK hM hcM hiM hvK hvM a b ha hb hab + exact brunnMinkowski_product_unit (by omega) ih hK hcK hiK hM hcM hiM hvK hvM ha hb hab + exact hprod.equiv (finSplit (n+1)).symm + (MeasurePreserving.symm (finSplit (n+1)).toHomeomorph.toMeasurableEquiv + (finSplit_measurePreserving (n+1))) + +/-- Standard Euclidean volume version used for the projection-body theorem. -/ +theorem brunnMinkowski_space {n : ℕ} (hn : 0 < n) : BrunnMinkowskiRoot (Space n) n := by + obtain ⟨m,rfl⟩ := Nat.exists_eq_succ_of_ne_zero hn.ne' + exact (brunnMinkowski_fin m).equiv + (PiLp.continuousLinearEquiv 2 ℝ (fun _ : Fin (m+1) => ℝ)).symm + (PiLp.volume_preserving_toLp (Fin (m+1))) + +end PettyProjection +end + +noncomputable section +open Set MeasureTheory Filter Topology +namespace PettyProjection + +/-- Brunn--Minkowski for the canonical Euclidean volume on any finite-dimensional +real inner-product space. -/ +theorem brunnMinkowski_innerProduct {E : Type uE} [NormedAddCommGroup E] + [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + (hE : 0 < Module.finrank ℝ E) : BrunnMinkowskiRoot E (Module.finrank ℝ E) := by + exact (brunnMinkowski_space hE).equiv + (stdOrthonormalBasis ℝ E).repr.symm.toContinuousLinearEquiv + (stdOrthonormalBasis ℝ E).measurePreserving_repr_symm + +end PettyProjection +end + +end OAI diff --git a/lean/OAI/Geometry/ProjectionBodies/CosineCalculus.lean b/lean/OAI/Geometry/ProjectionBodies/CosineCalculus.lean new file mode 100644 index 0000000000000000000000000000000000000000..d58e0d35d8fd09570ff3fdb1ef9a3c1bde440c88 --- /dev/null +++ b/lean/OAI/Geometry/ProjectionBodies/CosineCalculus.lean @@ -0,0 +1,285 @@ +import OAI.Geometry.ProjectionBodies.NormEstimates + +namespace OAI + +noncomputable section +open Set Filter Topology Function +namespace PettyProjection.Spherical + +/-- Positive part to a natural power; the endpoint is fixed to zero. -/ +def posPower (r : ℕ) (x : ℝ) : ℝ := if 0 < x then x^r else 0 + +lemma posPower_hasDerivAt {r : ℕ} (hr : 2 ≤ r) (x : ℝ) : + HasDerivAt (posPower r) ((r : ℝ)*posPower (r-1) x) x := by + have hd (z : ℝ) : HasDerivAt (fun a : ℝ => (a-1)^r) ((r : ℝ)*(z-1)^(r-1)) z := by + convert! ((hasDerivAt_id z).sub_const 1).pow r using 1 + simp + have hp := Scalar.paste_hasDerivAt (fun z _ => hd z) + (by simp [show r ≠ 0 by omega]) (by simp [show r-1 ≠ 0 by omega]) (x+1) + have h := hp.comp x ((hasDerivAt_id x).add_const 1) + convert! h using 1 + · funext z; simp [posPower] + · simp [posPower, mul_ite] + +lemma posPower_contDiff_one {r : ℕ} (hr : 2 ≤ r) : ContDiff ℝ 1 (posPower r) := by + have hd (z : ℝ) : HasDerivAt (fun a : ℝ => (a-1)^r) ((r : ℝ)*(z-1)^(r-1)) z := by + convert! ((hasDerivAt_id z).sub_const 1).pow r using 1 + simp + have h := Scalar.paste_contDiff_one (fun z _ => hd z) + (by simp [show r ≠ 0 by omega]) (by simp [show r-1 ≠ 0 by omega]) + (by fun_prop) + have hc := h.comp (contDiff_id.add contDiff_const : ContDiff ℝ 1 (fun x : ℝ => x+1)) + convert! hc using 1 + ext x + simp [posPower] + +lemma posPower_contDiff_two {r : ℕ} (hr : 3 ≤ r) : ContDiff ℝ 2 (posPower r) := by + have he : deriv (posPower r) = fun x => (r : ℝ)*posPower (r-1) x := + funext fun x => (posPower_hasDerivAt (by omega) x).deriv + change ContDiff ℝ (1+1) (posPower r) + rw [contDiff_succ_iff_deriv] + refine ⟨fun x => (posPower_hasDerivAt (by omega) x).differentiableAt, ?_, ?_⟩ + · simp + · rw [he] + exact contDiff_const.mul (posPower_contDiff_one (by omega)) + +lemma abs_pow_posPower {r : ℕ} (hr : 0 < r) (x : ℝ) : + |x|^r = posPower r x + posPower r (-x) := by + rcases lt_trichotomy x 0 with hx | rfl | hx + · simp [posPower, abs_of_neg hx, not_lt.mpr hx.le, neg_pos.mpr hx] + · simp [posPower, hr.ne'] + · simp [posPower, abs_of_pos hx, hx, not_lt.mpr (neg_nonpos.mpr hx.le)] + +lemma abs_pow_contDiff_two {r : ℕ} (hr : 3 ≤ r) : ContDiff ℝ 2 (fun x : ℝ => |x|^r) := by + have he : (fun x : ℝ => |x|^r) = fun x => posPower r x+posPower r (-x) := + funext (abs_pow_posPower (by omega)) + rw [he] + exact (posPower_contDiff_two hr).add ((posPower_contDiff_two hr).comp contDiff_neg) + +lemma abs_pow_hasDerivAt {r : ℕ} (hr : 2 ≤ r) (x : ℝ) : + HasDerivAt (fun x : ℝ => |x|^r) ((r : ℝ)*x*|x|^(r-2)) x := by + have h := (posPower_hasDerivAt hr x).add ((posPower_hasDerivAt hr (-x)).comp x (hasDerivAt_neg x)) + have he : (fun x : ℝ => |x|^r) = fun x => posPower r x+posPower r (-x) := + funext (abs_pow_posPower (by omega)) + rw [he] + convert! h using 1 + have hp : r-1 = (r-2)+1 := by omega + rcases lt_trichotomy x 0 with hx | rfl | hx + · simp only [posPower, ite_eq_right (not_lt.mpr hx.le), ite_eq_left (neg_pos.mpr hx), + abs_of_neg hx, hp, pow_succ] + ring + · simp [posPower] + · simp only [posPower, ite_eq_left hx, ite_eq_right (not_lt.mpr (neg_nonpos.mpr hx.le)), + abs_of_pos hx, hp, pow_succ] + ring + +lemma abs_pow_second_deriv {r : ℕ} (hr : 3 ≤ r) (x : ℝ) : + HasDerivAt (fun x : ℝ => (r : ℝ)*x*|x|^(r-2)) + ((r : ℝ)*((r : ℝ)-1)*|x|^(r-2)) x := by + have he : (fun x : ℝ => (r : ℝ)*x*|x|^(r-2)) = + fun x => (r : ℝ)*(posPower (r-1) x - posPower (r-1) (-x)) := by + funext z + have hp : r-1 = (r-2)+1 := by omega + rcases lt_trichotomy z 0 with hz | rfl | hz + · simp only [posPower, ite_eq_right (not_lt.mpr hz.le), ite_eq_left (neg_pos.mpr hz), + abs_of_neg hz, hp, pow_succ]; ring + · simp [posPower] + · simp only [posPower, ite_eq_left hz, ite_eq_right (not_lt.mpr (neg_nonpos.mpr hz.le)), + abs_of_pos hz, hp, pow_succ]; ring + rw [he] + have h := ((posPower_hasDerivAt (show 2 ≤ r-1 by omega) x).sub + ((posPower_hasDerivAt (show 2 ≤ r-1 by omega) (-x)).comp x (hasDerivAt_neg x))).const_mul (r : ℝ) + convert! h using 1 + rw [show r-1-1 = r-2 by omega, Nat.cast_sub (by omega), Nat.cast_one, + abs_pow_posPower (show 0 < r-2 by omega)] + ring + +end PettyProjection.Spherical +end + +noncomputable section +open Set MeasureTheory Metric Filter Topology Function +open scoped ENNReal RealInnerProductSpace +namespace PettyProjection.Spherical + +lemma inner_generator {n : ℕ} (u x : Space n) (i j : Fin n) : + ⟪u, generator n i j x⟫ = x i*u j-x j*u i := by + simp [generator_apply, inner_sub_right, inner_smul_right, + EuclideanSpace.inner_single_right] + +lemma sum_inner_generator_sq {n : ℕ} (u x : Space n) : + ∑ i : Fin n, ∑ j : Fin n, ⟪u, generator n i j x⟫^2 = + 2*(‖u‖^2*‖x‖^2-⟪u,x⟫^2) := by + simp_rw [inner_generator] + have he (i j : Fin n) : (x i*u j-x j*u i)^2 = + x i^2*u j^2+x j^2*u i^2-2*(x i*u i)*(x j*u j) := by ring + simp_rw [he, Finset.sum_sub_distrib, Finset.sum_add_distrib, + ← Finset.mul_sum, ← Finset.sum_mul] + rw [← EuclideanSpace.real_norm_sq_eq, ← EuclideanSpace.real_norm_sq_eq] + simp only [← Finset.mul_sum] + rw [← EuclideanSpace.real_norm_sq_eq] + have hi : ⟪u,x⟫ = ∑ i, x i*u i := by + simp [EuclideanSpace.inner_eq_star_dotProduct, dotProduct] + rw [hi] + ring + +lemma rotDeriv_scalar_linear {n : ℕ} (T : Space n →L[ℝ] Space n) + (L : Space n →L[ℝ] ℝ) {f f' : ℝ → ℝ} + (hf : ∀ t, HasDerivAt f (f' t) t) (x : Space n) : + rotDeriv T (f ∘ L) x = f' (L x)*L (T x) := by + have h := (hf (L x)).comp_hasFDerivAt x L.hasFDerivAt + simp only [rotDeriv, h.fderiv, smul_apply, smul_eq_mul] + +lemma rotDeriv_scalar_linear_twice {n : ℕ} (T : Space n →L[ℝ] Space n) + (L : Space n →L[ℝ] ℝ) {f f' f'' : ℝ → ℝ} + (hf : ∀ t, HasDerivAt f (f' t) t) + (hf' : ∀ t, HasDerivAt f' (f'' t) t) (x : Space n) : + rotDeriv T (rotDeriv T (f ∘ L)) x = + f'' (L x)*(L (T x))^2+f' (L x)*L (T (T x)) := by + have he : rotDeriv T (f ∘ L) = fun y => f' (L y)*L (T y) := + funext (rotDeriv_scalar_linear T L hf) + rw [he] + have hd := ((hf' (L x)).comp_hasFDerivAt x L.hasFDerivAt).mul + (L.comp T).hasFDerivAt + change fderiv ℝ ((f' ∘ L) * (fun y => (L.comp T) y)) x (T x) = _ + rw [hd.fderiv] + simp only [add_apply, smul_apply, smul_eq_mul, ContinuousLinearMap.comp_apply, comp_apply] + ring + +lemma casimir_scalar_inner {n : ℕ} (u x : Space n) {f f' f'' : ℝ → ℝ} + (hf : ∀ t, HasDerivAt f (f' t) t) + (hf' : ∀ t, HasDerivAt f' (f'' t) t) : + casimir (fun y => f ⟪u,y⟫) x = + f'' ⟪u,x⟫*(‖u‖^2*‖x‖^2-⟪u,x⟫^2)- + ((n : ℝ)-1)*f' ⟪u,x⟫*⟪u,x⟫ := by + change casimir (f ∘ (innerSL ℝ u)) x = _ + unfold casimir + simp_rw [rotDeriv_scalar_linear_twice _ (innerSL ℝ u) hf hf', + innerSL_apply_apply, Finset.sum_add_distrib, ← Finset.mul_sum] + rw [sum_inner_generator_sq] + simp_rw [← inner_sum, sum_generator_square, inner_smul_right] + ring + +lemma posPower_mul {r : ℕ} (x : ℝ) : + posPower r x*x = posPower (r+1) x := by + by_cases hx : 0 < x <;> simp [posPower, hx, pow_succ] + +lemma posPower_mul_sq {r : ℕ} (x : ℝ) : + posPower r x*x^2 = posPower (r+2) x := by + rw [pow_two, ← mul_assoc, posPower_mul, posPower_mul] + +lemma casimir_posPower_inner {n r : ℕ} (hr : 3 ≤ r) (u x : Sphere n) : + casimir (fun y => posPower r ⟪(u : Space n),y⟫) x = + (r : ℝ)*((r : ℝ)-1)*posPower (r-2) ⟪(u : Space n),(x : Space n)⟫ - + eigenvalue n r*posPower r ⟪(u : Space n),(x : Space n)⟫ := by + have hd (t : ℝ) : HasDerivAt (fun z => (r : ℝ)*posPower (r-1) z) + ((r : ℝ)*((r : ℝ)-1)*posPower (r-2) t) t := by + convert! (posPower_hasDerivAt (show 2 ≤ r-1 by omega) t).const_mul (r : ℝ) using 1 + rw [show r-1-1 = r-2 by omega, Nat.cast_sub (by omega), Nat.cast_one] + ring + rw [casimir_scalar_inner _ _ (posPower_hasDerivAt (by omega)) hd, + norm_coe, norm_coe] + simp only [one_pow, mul_one] + have h₁ := posPower_mul (r := r-1) ⟪(u : Space n),(x : Space n)⟫ + have h₂ := posPower_mul_sq (r := r-2) ⟪(u : Space n),(x : Space n)⟫ + rw [show r-1+1 = r by omega] at h₁ + rw [show r-2+2 = r by omega] at h₂ + unfold eigenvalue + calc + _ = (r : ℝ)*((r : ℝ)-1)*posPower (r-2) ⟪(u : Space n),(x : Space n)⟫ - + (r : ℝ)*((r : ℝ)-1)*(posPower (r-2) ⟪(u : Space n),(x : Space n)⟫ * ⟪(u : Space n),(x : Space n)⟫^2) - + ((n : ℝ)-1)*(r : ℝ)*(posPower (r-1) ⟪(u : Space n),(x : Space n)⟫ * ⟪(u : Space n),(x : Space n)⟫) := by ring + _ = _ := by rw [h₁, h₂]; ring + +lemma mean_casimir_comm {n : ℕ} [NeZero n] {f g : Space n → ℝ} + (hf : ContDiff ℝ 2 f) (hg : ContDiff ℝ 2 g) : + mean (fun u : Sphere n => f u*casimir g u) = + mean (fun u : Sphere n => g u*casimir f u) := by + rw [mean_casimir (hf.of_le (by norm_num)) hg, + mean_casimir (hg.of_le (by norm_num)) hf, energy_symm] + +end PettyProjection.Spherical +end + +noncomputable section +open Set MeasureTheory Metric Filter Topology Function +open scoped ENNReal RealInnerProductSpace Gradient +namespace PettyProjection.Spherical + +lemma sum_inner_generator_mul {n : ℕ} (u w x : Space n) : + ∑ i : Fin n, ∑ j : Fin n, ⟪u,generator n i j x⟫*⟪w,generator n i j x⟫ = + 2*(‖x‖^2*⟪u,w⟫-⟪u,x⟫*⟪w,x⟫) := by + simp_rw [inner_generator] + have he (i j : Fin n) : (x i*u j-x j*u i)*(x i*w j-x j*w i) = + x i^2*(u j*w j)+x j^2*(u i*w i)-(x i*w i)*(x j*u j)-(x i*u i)*(x j*w j) := by ring + simp_rw [he, Finset.sum_sub_distrib, Finset.sum_add_distrib, + ← Finset.mul_sum, ← Finset.sum_mul] + have hi (a b : Space n) : ⟪a,b⟫ = ∑ i, a i*b i := by + simp [EuclideanSpace.inner_eq_star_dotProduct, dotProduct, mul_comm] + rw [hi u w, hi u x, hi w x, EuclideanSpace.real_norm_sq_eq] + simp_rw [mul_comm (u _) (x _), mul_comm (w _) (x _)] + simp only [← Finset.mul_sum] + ring + +/-- Genuine tangential gradient on the unit sphere, expressed ambiently. -/ +def sphereGradient {n : ℕ} (f : Space n → ℝ) (x : Space n) : Space n := + ∇ f x - (fderiv ℝ f x x) • x + +lemma continuous_gradient_of_contDiff {n : ℕ} {f : Space n → ℝ} (hf : ContDiff ℝ 1 f) : + Continuous (gradient f) := + (InnerProductSpace.toDual ℝ (Space n)).symm.continuous.comp (hf.continuous_fderiv (by norm_num)) + +lemma sphereGradient_continuous {n : ℕ} {f : Space n → ℝ} (hf : ContDiff ℝ 1 f) : + Continuous (sphereGradient f) := by + exact (continuous_gradient_of_contDiff hf).sub + (((hf.continuous_fderiv (by norm_num)).clm_apply continuous_id).smul continuous_id) + +lemma sphereGradient_inner {n : ℕ} (f : Space n → ℝ) (x w : Space n) : + ⟪sphereGradient f x,w⟫ = fderiv ℝ f x w - fderiv ℝ f x x*⟪x,w⟫ := by + simp only [sphereGradient, inner_sub_left, inner_smul_left, inner_gradient_left, starRingEnd_apply, star_trivial] + +lemma sphereGradient_tangent {n : ℕ} (f : Space n → ℝ) (x : Sphere n) : + ⟪sphereGradient f x,(x : Space n)⟫ = 0 := by + rw [sphereGradient_inner, real_inner_self_eq_norm_sq, norm_coe] + simp + +lemma sum_rotDeriv_inner {n : ℕ} (f : Space n → ℝ) (x : Sphere n) (w : Space n) : + (1/2 : ℝ)*(∑ i : Fin n, ∑ j : Fin n, + rotDeriv (generator n i j) f x*⟪w,generator n i j x⟫) = ⟪sphereGradient f x,w⟫ := by + simp only [rotDeriv, ← inner_gradient_left] + rw [sum_inner_generator_mul, norm_coe, sphereGradient_inner, + inner_gradient_left, inner_gradient_left, real_inner_comm w (x : Space n)] + ring + +lemma mean_gradient_casimir {n : ℕ} [NeZero n] {f g : Space n → ℝ} + (hf : ContDiff ℝ 1 f) (hg : ContDiff ℝ 2 g) : + mean (fun x : Sphere n => ⟪sphereGradient f x,sphereGradient g x⟫) = + -mean (fun x : Sphere n => f x*casimir g x) := by + rw [mean_casimir hf hg, neg_neg] + have hs (x : Sphere n) : ⟪sphereGradient f x,sphereGradient g x⟫ = + (1/2 : ℝ)*∑ i : Fin n, ∑ j : Fin n, + rotDeriv (generator n i j) f x*rotDeriv (generator n i j) g x := by + have h := sum_rotDeriv_inner f x (∇ g x) + simp only [inner_gradient_left] at h + change ⟪sphereGradient f x, ∇ g x - (fderiv ℝ g x x) • (x : Space n)⟫ = _ + rw [inner_sub_right, inner_smul_right, sphereGradient_tangent, mul_zero, sub_zero] + exact h.symm + simp_rw [hs] + rw [mean, integral_const_mul] + congr 1 + rw [integral_finsetSum] + · apply Finset.sum_congr rfl + intro i _ + exact integral_finsetSum _ (fun j _ => continuous_integrable + (((continuous_rotDeriv _ hf).comp continuous_subtype_val).mul + ((continuous_rotDeriv _ (hg.of_le (by norm_num))).comp continuous_subtype_val))) + · intro i _ + apply continuous_integrable + exact continuous_finsetSum _ fun j _ => + ((continuous_rotDeriv _ hf).comp continuous_subtype_val).mul + ((continuous_rotDeriv _ (hg.of_le (by norm_num))).comp continuous_subtype_val) + +end PettyProjection.Spherical +end + +end OAI diff --git a/lean/OAI/Geometry/ProjectionBodies/CosineSpectrum.lean b/lean/OAI/Geometry/ProjectionBodies/CosineSpectrum.lean new file mode 100644 index 0000000000000000000000000000000000000000..f0926a3d6570093710987aa051bb0bfcb805287e --- /dev/null +++ b/lean/OAI/Geometry/ProjectionBodies/CosineSpectrum.lean @@ -0,0 +1,441 @@ +import OAI.Geometry.ProjectionBodies.SignCalculus + +namespace OAI + +noncomputable section +open Set MeasureTheory Metric Filter Topology Function +open scoped ENNReal RealInnerProductSpace +namespace PettyProjection.Spherical + +lemma posPower_eq_max_pow {r : ℕ} (hr : 0 < r) (x : ℝ) : + posPower r x = max x 0 ^ r := by + by_cases hx : 0 < x + · simp [posPower, hx, max_eq_left hx.le] + · simp [posPower, hx, max_eq_right (not_lt.mp hx), hr.ne'] + +/-- Positive-hemisphere power kernel, including the constant zeroth power. -/ +def higherKernel {n : ℕ} (r : ℕ) (u : Sphere n) (f : Sphere n → ℝ) : ℝ := + mean (fun x => (max ⟪(u : Space n),(x : Space n)⟫ 0)^r*f x) + +lemma higherKernel_const_pos {n : ℕ} [NeZero n] (r : ℕ) (u : Sphere n) : + 0 < higherKernel r u (fun _ => 1) := by + have hc : Continuous (fun x : Sphere n => max ⟪(u : Space n),(x : Space n)⟫ 0 ^ r) := by + fun_prop + simp only [higherKernel, mul_one, mean] + exact integral_pos_of_integrable_nonneg_nonzero hc (continuous_integrable hc) + (fun x => pow_nonneg (le_max_right _ _) _) (x := u) + (by rw [real_inner_self_eq_norm_sq, norm_coe]; norm_num) + +lemma higherKernel_recurrence {n r d : ℕ} [NeZero n] (hr : 3 ≤ r) + (u : Sphere n) {f : Space n → ℝ} (hf : ContDiff ℝ 2 f) + (heig : ∀ x : Sphere n, casimir f x = -eigenvalue n d*f x) : + (eigenvalue n r-eigenvalue n d)*higherKernel r u (fun x => f x) = + (r : ℝ)*((r : ℝ)-1)*higherKernel (r-2) u (fun x => f x) := by + let g : Space n → ℝ := fun y => posPower r ⟪(u : Space n),y⟫ + have hg : ContDiff ℝ 2 g := (posPower_contDiff_two hr).comp (innerSL ℝ (u : Space n)).contDiff + have h := mean_casimir_comm hf hg + have he (x : Sphere n) : f x*casimir g x = + (r : ℝ)*((r : ℝ)-1)*((max ⟪(u : Space n),(x : Space n)⟫ 0)^(r-2)*f x) - + eigenvalue n r*((max ⟪(u : Space n),(x : Space n)⟫ 0)^r*f x) := by + rw [show casimir g x = _ from casimir_posPower_inner hr u x, + posPower_eq_max_pow (show 0 < r-2 by omega), posPower_eq_max_pow (show 0 < r by omega)] + ring + simp_rw [he, heig, g, posPower_eq_max_pow (show 0 < r by omega)] at h + have hct (r : ℕ) : Continuous (fun x : Sphere n => max ⟪(u : Space n),(x : Space n)⟫ 0 ^ r * f x) := by + exact ((continuous_const.inner continuous_subtype_val).max continuous_const |>.pow r).mul + (hf.continuous.comp continuous_subtype_val) + have hh : (fun x : Sphere n => max ⟪(u : Space n),(x : Space n)⟫ 0 ^ r * + (-eigenvalue n d*f x)) = fun x : Sphere n => -eigenvalue n d* + (max ⟪(u : Space n),(x : Space n)⟫ 0 ^ r*f x) := by funext x; ring + rw [hh, mean, integral_sub + ((continuous_integrable (hct (r-2))).const_mul _) ((continuous_integrable (hct r)).const_mul _), + integral_const_mul, integral_const_mul, mean, integral_const_mul] at h + change (r : ℝ)*((r : ℝ)-1)*higherKernel (r-2) u (fun x => f x) - + eigenvalue n r*higherKernel r u (fun x => f x) = + -eigenvalue n d*higherKernel r u (fun x => f x) at h + linarith + +lemma higherKernel_const_recurrence {n r : ℕ} [NeZero n] (hr : 3 ≤ r) (u : Sphere n) : + eigenvalue n r*higherKernel r u (fun _ => 1) = + (r : ℝ)*((r : ℝ)-1)*higherKernel (r-2) u (fun _ => 1) := by + have he (x : Sphere n) : casimir (fun _ : Space n => (1 : ℝ)) x = -eigenvalue n 0*1 := by + have hc (T : Space n →L[ℝ] Space n) : rotDeriv T (fun _ : Space n => (1 : ℝ)) = fun _ => 0 := + funext (rotDeriv_const T 1) + simp [casimir, hc, rotDeriv_const, eigenvalue] + simpa [eigenvalue] using higherKernel_recurrence hr u contDiff_const he + +lemma higherKernel_peak {n : ℕ} [NeZero n] (u : Sphere n) {f : Sphere n → ℝ} + (hf : Continuous f) : + Tendsto (fun r : ℕ => higherKernel r u f / higherKernel r u (fun _ => 1)) + atTop (𝓝 (f u)) := by + have hc : Continuous (fun x : Sphere n => max ⟪(u : Space n),(x : Space n)⟫ 0) := by fun_prop + have hmax (x : Sphere n) (_ : x ∈ (univ : Set (Sphere n))) (hne : x ≠ u) : + max ⟪(u : Space n),(x : Space n)⟫ 0 < max ⟪(u : Space n),(u : Space n)⟫ 0 := by + rw [real_inner_self_eq_norm_sq, norm_coe] + norm_num only [one_pow, max_eq_left zero_le_one] + apply max_lt + · exact (inner_lt_one_iff_real_of_norm_eq_one (norm_coe u) (norm_coe x)).mpr + (by intro h; exact hne (Subtype.ext h.symm)) + · norm_num + have h := tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn + (μ := sigma n) isCompact_univ hc.continuousOn hmax + (fun x _ => le_max_right _ _) (by rw [real_inner_self_eq_norm_sq, norm_coe]; norm_num) + (by simp) hf.continuousOn + simpa [smul_eq_mul, div_eq_mul_inv, higherKernel, mean, mul_comm] using h + +end PettyProjection.Spherical +end + +noncomputable section +open Filter Topology +namespace PettyProjection.Spherical + +/-- Normalized multiplier of the positive-power kernel on degree `2*j`. -/ +def higherFactor (n j : ℕ) (s : ℝ) : ℝ := + ∏ a ∈ Finset.range j, (s-2*a)/(s+n+2*a) + +lemma higherFactor_zero (n : ℕ) (s : ℝ) : higherFactor n 0 s = 1 := by + simp [higherFactor] + +lemma higherFactor_succ (n j : ℕ) (s : ℝ) : + higherFactor n (j+1) s = higherFactor n j s*((s-2*j)/(s+n+2*j)) := by + simp only [higherFactor, Finset.prod_range_succ] + +lemma higherFactor_odd_ne_zero {n : ℕ} (hn : 2 ≤ n) (j m : ℕ) : + higherFactor n j (2*m+1) ≠ 0 := by + apply Finset.prod_ne_zero_iff.mpr + intro a _ + apply div_ne_zero + · apply sub_ne_zero.mpr + have h : (2*m+1 : ℕ) ≠ 2*a := by omega + exact_mod_cast h + · have hn' : (2 : ℝ) ≤ n := by exact_mod_cast hn + have hm : (0 : ℝ) ≤ m := Nat.cast_nonneg _ + have ha : (0 : ℝ) ≤ a := Nat.cast_nonneg _ + linarith + +lemma higherFactor_step {n : ℕ} (hn : 2 ≤ n) (j : ℕ) {s : ℝ} (hs : 3 ≤ s) : + (s-2*j)*(s+2*j+n-2)*higherFactor n j s = + s*(s+n-2)*higherFactor n j (s-2) := by + have hn' : (2 : ℝ) ≤ n := by exact_mod_cast hn + induction j with + | zero => simp [higherFactor] + | succ j ih => + rw [higherFactor_succ, higherFactor_succ] + have hj : (0 : ℝ) ≤ j := Nat.cast_nonneg _ + have h₁ : s+n+2*j ≠ 0 := by linarith + have h₂ : s-2+n+2*j ≠ 0 := by linarith + push_cast + field_simp + linear_combination (s-2*j-2)*(s+n+2*j)*ih + +lemma higherFactor_tendsto (n j : ℕ) : + Tendsto (fun m : ℕ => higherFactor n j (2*m+1)) atTop (𝓝 1) := by + induction j with + | zero => simpa only [higherFactor_zero] using tendsto_const_nhds + | succ j ih => + have h : Tendsto (fun m : ℕ => ((2*(m : ℝ)+1)-2*j)/((2*(m : ℝ)+1)+n+2*j)) atTop (𝓝 1) := by + have h := tendsto_add_mul_div_add_mul_atTop_nhds (1-2*(j : ℝ)) + (1+n+2*(j : ℝ)) (2 : ℝ) (show (2 : ℝ) ≠ 0 by norm_num) + convert! h using 1 + · funext m; congr 1 <;> ring + · norm_num + simpa only [higherFactor_succ, mul_one] using ih.mul h + +end PettyProjection.Spherical +end + +noncomputable section +open Set MeasureTheory Metric Filter Topology Function +open scoped ENNReal RealInnerProductSpace +namespace PettyProjection.Spherical + +lemma eigenvalue_sub_even {n j : ℕ} (s : ℕ) : + eigenvalue n s-eigenvalue n (2*j) = + ((s : ℝ)-2*j)*((s : ℝ)+2*j+n-2) := by + simp only [eigenvalue, Nat.cast_mul, Nat.cast_ofNat] + ring + +lemma eigenvalue_odd_sub_even_ne_zero {n : ℕ} (hn : 2 ≤ n) (m j : ℕ) : + eigenvalue n (2*m+1)-eigenvalue n (2*j) ≠ 0 := by + rw [eigenvalue_sub_even] + apply mul_ne_zero + · apply sub_ne_zero.mpr + have h : (2*m+1 : ℕ) ≠ 2*j := by omega + exact_mod_cast h + · have hn' : (2 : ℝ) ≤ n := by exact_mod_cast hn + have hm : (0 : ℝ) ≤ m := Nat.cast_nonneg _ + have hj : (0 : ℝ) ≤ j := Nat.cast_nonneg _ + push_cast + linarith + +lemma higherKernel_normalized_recurrence {n r d : ℕ} [NeZero n] (hr : 3 ≤ r) + (u : Sphere n) {f : Space n → ℝ} (hf : ContDiff ℝ 2 f) + (heig : ∀ x : Sphere n, casimir f x = -eigenvalue n d*f x) : + (eigenvalue n r-eigenvalue n d)*(higherKernel r u (fun x => f x)/higherKernel r u (fun _ => 1)) = + eigenvalue n r*(higherKernel (r-2) u (fun x => f x)/higherKernel (r-2) u (fun _ => 1)) := by + have h := higherKernel_recurrence hr u hf heig + have hz := higherKernel_const_recurrence hr u + have h₁ := (higherKernel_const_pos r u).ne' + have h₂ := (higherKernel_const_pos (r-2) u).ne' + field_simp + linear_combination higherKernel (r-2) u (fun _ => 1)*h - + higherKernel (r-2) u (fun x => f x)*hz + +lemma higherKernel_eigenfunction {n j : ℕ} (hn : 2 ≤ n) [NeZero n] + (u : Sphere n) {f : Space n → ℝ} (hf : ContDiff ℝ 2 f) + (heig : ∀ x : Sphere n, casimir f x = -eigenvalue n (2*j)*f x) : + higherKernel 1 u (fun x => f x)/higherKernel 1 u (fun _ => 1) = + higherFactor n j 1*f u := by + let A (m : ℕ) := higherKernel (2*m+1) u (fun x => f x)/higherKernel (2*m+1) u (fun _ => 1) + let F (m : ℕ) := higherFactor n j (2*m+1) + have hinv (m : ℕ) : A m*F 0 = A 0*F m := by + induction m with + | zero => rfl + | succ m ih => + have hc := eigenvalue_odd_sub_even_ne_zero hn (m+1) j + have hA := higherKernel_normalized_recurrence (show 3 ≤ 2*(m+1)+1 by omega) u hf heig + rw [show 2*(m+1)+1-2 = 2*m+1 by omega] at hA + change (eigenvalue n (2*(m+1)+1)-eigenvalue n (2*j))*A (m+1) = + eigenvalue n (2*(m+1)+1)*A m at hA + have hF : (eigenvalue n (2*(m+1)+1)-eigenvalue n (2*j))*F (m+1) = + eigenvalue n (2*(m+1)+1)*F m := by + have hm : (0 : ℝ) ≤ m := Nat.cast_nonneg _ + have h := higherFactor_step hn j (s := 2*(m+1)+1) (by linarith) + have he : (2*((m : ℝ)+1)+1)-2 = 2*m+1 := by ring + rw [he] at h + rw [eigenvalue_sub_even] + simpa only [F, eigenvalue, Nat.cast_add, + Nat.cast_mul, Nat.cast_one, Nat.cast_ofNat] using h + apply mul_left_cancel₀ hc + calc + _ = ((eigenvalue n (2*(m+1)+1)-eigenvalue n (2*j))*A (m+1))*F 0 := by ring + _ = eigenvalue n (2*(m+1)+1)*(A m*F 0) := by rw [hA]; ring + _ = eigenvalue n (2*(m+1)+1)*(A 0*F m) := by rw [ih] + _ = A 0*((eigenvalue n (2*(m+1)+1)-eigenvalue n (2*j))*F (m+1)) := by rw [hF]; ring + _ = _ := by ring + have ht : Tendsto (fun m : ℕ => 2*m+1) atTop atTop := by + apply Filter.tendsto_atTop.mpr + intro b + filter_upwards [eventually_ge_atTop b] with m hm + omega + have hA : Tendsto A atTop (𝓝 (f u)) := + (higherKernel_peak u (hf.continuous.comp continuous_subtype_val)).comp ht + have hF : Tendsto F atTop (𝓝 1) := higherFactor_tendsto n j + have hlim₁ := hA.mul (tendsto_const_nhds (x := F 0)) + have hlim₂ := (tendsto_const_nhds (x := A 0)).mul hF + have heq : (fun m => A m*F 0) = (fun m => A 0*F m) := funext hinv + rw [heq] at hlim₁ + have h := tendsto_nhds_unique hlim₁ hlim₂ + simpa [A, F, mul_comm] using h.symm + +lemma higherKernel_harmonic {n j : ℕ} (hn : 2 ≤ n) [NeZero n] + (u : Sphere n) {p : MvPolynomial (Fin n) ℝ} (hp : p.IsHomogeneous (2*j)) + (hΔ : laplacePolynomial p = 0) : + higherKernel 1 u (fun x => polynomialFunction p x)/higherKernel 1 u (fun _ => 1) = + higherFactor n j 1*polynomialFunction p u := by + exact higherKernel_eigenfunction hn u ((polynomialFunction_contDiff p).of_le (by norm_num)) + (fun x => casimir_harmonic hp hΔ x) + +end PettyProjection.Spherical +end + +noncomputable section +open Set MeasureTheory Metric Filter Topology Function +open scoped ENNReal RealInnerProductSpace +namespace PettyProjection.Spherical + +def pole (n : ℕ) [NeZero n] : Sphere n := + ⟨EuclideanSpace.single (0 : Fin n) 1, by simp⟩ + +lemma higherKernel_const_rotation {n : ℕ} (r : ℕ) (u : Sphere n) + (U : Space n ≃ₗᵢ[ℝ] Space n) : + higherKernel r (sphereMap U u) (fun _ => 1) = higherKernel r u (fun _ => 1) := by + have h := mean_rotation U (fun x : Sphere n => max ⟪U (u : Space n),(x : Space n)⟫ 0 ^ r) + change mean (fun x : Sphere n => max ⟪U (u : Space n),U (x : Space n)⟫ 0 ^ r) = _ at h + simp only [U.inner_map_map] at h + simp only [higherKernel, mul_one] + change mean (fun x : Sphere n => max ⟪U (u : Space n),(x : Space n)⟫ 0 ^ r) = _ + exact h.symm + +lemma higherKernel_const_independent {n : ℕ} (r : ℕ) (u v : Sphere n) : + higherKernel r u (fun _ => 1) = higherKernel r v (fun _ => 1) := by + let U := (ℝ ∙ ((u : Space n)-(v : Space n)))ᗮ.reflection + have h : sphereMap U u = v := by + apply Subtype.ext + exact Submodule.reflection_sub ((norm_coe u).trans (norm_coe v).symm) + rw [← h, higherKernel_const_rotation] + +/-- The true normalized cosine kernel's constant, not an assumed multiplier. -/ +def cosineConstant (n : ℕ) [NeZero n] : ℝ := + 2*higherKernel 1 (pole n) (fun _ => 1) + +lemma cosineConstant_pos (n : ℕ) [NeZero n] : 0 < cosineConstant n := + mul_pos (by norm_num) (higherKernel_const_pos 1 (pole n)) + +lemma mean_pos_inner_even {n : ℕ} [NeZero n] (u : Sphere n) {f : Space n → ℝ} + (heven : Function.Even f) (hf : Continuous f) : + mean (fun x : Sphere n => |⟪(u : Space n),(x : Space n)⟫| *f x) = + 2*higherKernel 1 u (fun x => f x) := by + have h := mean_rotation (LinearIsometryEquiv.neg ℝ : Space n ≃ₗᵢ[ℝ] Space n) + (fun x : Sphere n => max ⟪(u : Space n),(x : Space n)⟫ 0*f x) + have he : (fun x : Sphere n => max ⟪(u : Space n),((sphereMap (LinearIsometryEquiv.neg ℝ)) x : Space n)⟫ 0 * + f (sphereMap (LinearIsometryEquiv.neg ℝ) x)) = + (fun x : Sphere n => max (-⟪(u : Space n),(x : Space n)⟫) 0*f x) := by + funext x + change max ⟪(u : Space n),-(x : Space n)⟫ 0*f (-(x : Space n)) = _ + rw [inner_neg_right, heven] + rw [he] at h + have hk (t : ℝ) : |t| = max t 0+max (-t) 0 := by + rcases le_total 0 t with ht | ht <;> simp [abs_of_nonneg, abs_of_nonpos, ht] + simp only [higherKernel, pow_one] + simp_rw [hk, add_mul] + rw [mean, integral_add] + · change mean (fun x : Sphere n => max ⟪(u : Space n),(x : Space n)⟫ 0*f x) + + mean (fun x : Sphere n => max (-⟪(u : Space n),(x : Space n)⟫) 0*f x) = _ + rw [h] + ring + · exact continuous_integrable (by fun_prop) + · exact continuous_integrable (by fun_prop) + +lemma mean_abs_inner {n : ℕ} [NeZero n] (u : Sphere n) : + mean (fun x : Sphere n => |⟪(u : Space n),(x : Space n)⟫|) = cosineConstant n := by + have h := mean_pos_inner_even u (f := fun _ => 1) (fun _ => rfl) continuous_const + simpa only [mul_one, higherKernel_const_independent 1 u (pole n), cosineConstant] using h + +/-- The actual cosine integral, with its constant fixed geometrically. -/ +def cosine {n : ℕ} [NeZero n] (f : Sphere n → ℝ) (u : Sphere n) : ℝ := + mean (fun x : Sphere n => |⟪(u : Space n),(x : Space n)⟫| *f x)/cosineConstant n + +lemma cosine_continuous {n : ℕ} [NeZero n] {f : Sphere n → ℝ} (hf : Continuous f) : + Continuous (cosine f) := by + apply Continuous.div_const + have h := continuous_parametric_integral_of_continuous (μ := sigma n) + (f := fun u x : Sphere n => |⟪(u : Space n),(x : Space n)⟫| *f x) + (by fun_prop) isCompact_univ + simpa only [Measure.restrict_univ, mean] using h + +lemma cosine_const {n : ℕ} [NeZero n] (c : ℝ) : cosine (fun _ : Sphere n => c) = fun _ => c := by + funext u + rw [cosine, mean, integral_mul_const] + change mean (fun x : Sphere n => |⟪(u : Space n),(x : Space n)⟫|)*c/cosineConstant n = c + rw [mean_abs_inner] + field_simp [(cosineConstant_pos n).ne'] + +lemma polynomialFunction_even {n d : ℕ} {p : MvPolynomial (Fin n) ℝ} + (hp : p.IsHomogeneous d) (hd : Even d) : Function.Even (polynomialFunction p) := by + intro x + simpa only [neg_one_smul, hd.neg_one_pow, one_mul] using + polynomialFunction_smul_argument hp (-1) x + +lemma cosine_harmonic {n j : ℕ} (hn : 2 ≤ n) [NeZero n] + {p : MvPolynomial (Fin n) ℝ} (hp : p.IsHomogeneous (2*j)) + (hΔ : laplacePolynomial p = 0) (u : Sphere n) : + cosine (fun x => polynomialFunction p x) u = higherFactor n j 1*polynomialFunction p u := by + rw [cosine, mean_pos_inner_even u (polynomialFunction_even hp (even_two_mul j)) + (polynomialFunction_contDiff p).continuous, cosineConstant, + ← higherKernel_const_independent 1 u (pole n), mul_div_mul_left _ _ (by norm_num : (2 : ℝ) ≠ 0)] + exact higherKernel_harmonic hn u hp hΔ + +end PettyProjection.Spherical +end + +noncomputable section +open Set MeasureTheory Metric Filter Topology Function +open scoped ENNReal RealInnerProductSpace +namespace PettyProjection.Spherical + +def cosineMap {n : ℕ} [NeZero n] (f : C(Sphere n, ℝ)) : C(Sphere n, ℝ) := + ⟨cosine f, cosine_continuous f.continuous⟩ + +lemma cosine_selfadj {n : ℕ} [NeZero n] {f g : Sphere n → ℝ} + (hf : Continuous f) (hg : Continuous g) : + mean (fun u => f u*cosine g u) = mean (fun u => cosine f u*g u) := by + have hi : Integrable (fun z : Sphere n × Sphere n => + f z.1 * (|⟪(z.1 : Space n),(z.2 : Space n)⟫| * g z.2)) ((sigma n).prod (sigma n)) := + (by fun_prop : Continuous _).integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) + have h := integral_integral_swap (f := fun u v : Sphere n => f u*(|⟪(u : Space n),(v : Space n)⟫| * g v)) hi + simp only [cosine, mean, ← mul_div_assoc, div_mul_eq_mul_div, integral_div, ← integral_const_mul] + rw [h] + congr 1 + apply integral_congr_ae + filter_upwards with u + rw [← integral_mul_const] + apply integral_congr_ae + filter_upwards with v + rw [real_inner_comm (u : Space n) (v : Space n)] + ring + +lemma mean_cosine {n : ℕ} [NeZero n] {f : Sphere n → ℝ} (hf : Continuous f) : + mean (cosine f) = mean f := by + have h := cosine_selfadj (f := fun _ => 1) continuous_const hf + simpa only [one_mul, cosine_const] using h + +lemma cosine_neg {n : ℕ} [NeZero n] (f : Sphere n → ℝ) (u : Sphere n) : + cosine f (sphereMap (LinearIsometryEquiv.neg ℝ) u) = cosine f u := by + unfold cosine + congr 1 + congr 1 + funext x + change |⟪-(u : Space n),(x : Space n)⟫| * f x = _ + rw [inner_neg_left, abs_neg] + +lemma mean_sphere_even_mul_odd {n d : ℕ} {f : Sphere n → ℝ} + (heven : ∀ u, f (sphereMap (LinearIsometryEquiv.neg ℝ) u) = f u) + {p : MvPolynomial (Fin n) ℝ} (hp : p.IsHomogeneous d) (hd : Odd d) : + mean (fun u : Sphere n => f u*polynomialFunction p u) = 0 := by + have h := mean_rotation (LinearIsometryEquiv.neg ℝ : Space n ≃ₗᵢ[ℝ] Space n) + (fun u : Sphere n => f u*polynomialFunction p u) + have he : (fun u : Sphere n => f (sphereMap (LinearIsometryEquiv.neg ℝ) u)* + polynomialFunction p (sphereMap (LinearIsometryEquiv.neg ℝ) u)) = + (fun u : Sphere n => -(f u*polynomialFunction p u)) := by + funext u + rw [heven] + change f u*polynomialFunction p (-(u : Space n)) = _ + rw [polynomialFunction_odd hp hd, mul_neg] + rw [he, mean, integral_neg] at h + change -mean (fun u : Sphere n => f u*polynomialFunction p u) = _ at h + linarith + +lemma cosine_harmonic_odd {n d : ℕ} [NeZero n] {p : MvPolynomial (Fin n) ℝ} + (hp : p.IsHomogeneous d) (hd : Odd d) (u : Sphere n) : + cosine (fun x => polynomialFunction p x) u = 0 := by + rw [cosine, mean_even_mul_odd (f := fun x => |⟪(u : Space n),x⟫|) _ hp hd, zero_div] + intro x + simp only [inner_neg_right, abs_neg] + +lemma cosine_projection_even {n j : ℕ} (hn : 2 ≤ n) [NeZero n] (f : C(Sphere n, ℝ)) : + (harmonicSpace n (2*j)).starProjection (toH n (cosineMap f)) = + higherFactor n j 1 • (harmonicSpace n (2*j)).starProjection (toH n f) := by + apply Submodule.eq_starProjection_of_mem_of_inner_eq_zero + ((harmonicSpace n (2*j)).smul_mem _ ((harmonicSpace n (2*j)).starProjection_apply_mem _)) + rintro v ⟨p, hp, rfl⟩ + rw [inner_sub_left, real_inner_smul_left, Submodule.inner_starProjection_left_eq_right] + rw [Submodule.starProjection_eq_self_iff.mpr (show polynomialL2 n p ∈ harmonicSpace n (2*j) from ⟨p,hp,rfl⟩)] + change ⟪toH n (cosineMap f),toH n (polynomialRestriction n p)⟫ - + higherFactor n j 1 * ⟪toH n f,toH n (polynomialRestriction n p)⟫ = 0 + rw [inner_toH, inner_toH] + change mean (fun u : Sphere n => cosine f u*(polynomialRestriction n p) u) - _ = 0 + rw [← cosine_selfadj f.continuous (polynomialRestriction n p).continuous] + have he : (fun u : Sphere n => f u*cosine (polynomialRestriction n p) u) = + (fun u : Sphere n => higherFactor n j 1*(f u*polynomialFunction p u)) := by + funext u + rw [show cosine (polynomialRestriction n p) u = _ from cosine_harmonic hn hp.1 hp.2 u] + ring + rw [he, mean, integral_const_mul] + change _ - higherFactor n j 1 * (∫ u : Sphere n, f u * polynomialFunction p u ∂sigma n) = 0 + exact sub_self _ + +lemma cosine_projection_odd {n d : ℕ} [NeZero n] (f : C(Sphere n, ℝ)) (hd : Odd d) : + (harmonicSpace n d).starProjection (toH n (cosineMap f)) = 0 := by + apply Submodule.eq_starProjection_of_mem_of_inner_eq_zero (Submodule.zero_mem _) + rintro v ⟨p, hp, rfl⟩ + rw [sub_zero] + change ⟪toH n (cosineMap f),toH n (polynomialRestriction n p)⟫ = 0 + rw [inner_toH] + exact mean_sphere_even_mul_odd (cosine_neg f) hp.1 hd + +end PettyProjection.Spherical +end + +end OAI diff --git a/lean/OAI/Geometry/ProjectionBodies/FixedPointCalculus.lean b/lean/OAI/Geometry/ProjectionBodies/FixedPointCalculus.lean new file mode 100644 index 0000000000000000000000000000000000000000..25890938f81bf468d3fa8971fc7712da4697002e --- /dev/null +++ b/lean/OAI/Geometry/ProjectionBodies/FixedPointCalculus.lean @@ -0,0 +1,591 @@ +import OAI.Geometry.ProjectionBodies.VariationalRepresentation + +namespace OAI + +universe uE uX uι uα + +noncomputable section +namespace PettyProjection.FixedPoint +open scoped RealInnerProductSpace + +def rayRoot (a b c : ℝ) : ℝ := (Real.sqrt (b^2+a*(1-c))-b)/a +lemma rayRoot_positive {a b c : ℝ} (ha : 0 (p x).coeff k) + +lemma continuousCoeffs_const (p : Polynomial ℝ) : ContinuousCoeffs (fun _ : X => p) := + fun _ => continuous_const + +lemma continuousCoeffs_C {f : X → ℝ} (hf : Continuous f) : + ContinuousCoeffs (fun x => Polynomial.C (f x)) := by + intro k + by_cases hk : k = 0 + · subst k; simpa only [coeff_C_zero] using hf + · simpa only [coeff_C, ite_eq_right hk] using (continuous_const : Continuous (fun _ : X => (0 : ℝ))) + +lemma ContinuousCoeffs.add {p q : X → Polynomial ℝ} + (hp : ContinuousCoeffs p) (hq : ContinuousCoeffs q) : + ContinuousCoeffs (fun x => p x + q x) := by + intro k + simp only [coeff_add] + exact continuous_add.comp ((hp k).prodMk (hq k)) + +lemma ContinuousCoeffs.mul {p q : X → Polynomial ℝ} + (hp : ContinuousCoeffs p) (hq : ContinuousCoeffs q) : + ContinuousCoeffs (fun x => p x * q x) := by + intro k + simp only [coeff_mul] + exact continuous_finsetSum _ (fun ij _ => (hp ij.1).mul (hq ij.2)) + +lemma ContinuousCoeffs.sum {ι : Type uι} (s : Finset ι) {p : ι → X → Polynomial ℝ} + (hp : ∀ i ∈ s, ContinuousCoeffs (p i)) : + ContinuousCoeffs (fun x => ∑ i ∈ s, p i x) := by + intro k + simp only [finsetSum_coeff] + exact continuous_finsetSum _ (fun i hi => hp i hi k) + +lemma ContinuousCoeffs.prod {ι : Type uι} (s : Finset ι) {p : ι → X → Polynomial ℝ} + (hp : ∀ i ∈ s, ContinuousCoeffs (p i)) : + ContinuousCoeffs (fun x => ∏ i ∈ s, p i x) := by + classical + induction s using Finset.induction_on with + | empty => simpa using continuousCoeffs_const (X := X) (1 : Polynomial ℝ) + | @insert i s hi ih => + simp only [Finset.prod_insert hi] + exact (hp i (Finset.mem_insert_self _ _)).mul + (ih (fun j hj => hp j (Finset.mem_insert_of_mem hj))) + +lemma ContinuousCoeffs.det {ι : Type uι} [Fintype ι] [DecidableEq ι] + {p : X → Matrix ι ι (Polynomial ℝ)} + (hp : ∀ i j, ContinuousCoeffs (fun x => p x i j)) : + ContinuousCoeffs (fun x => (p x).det) := by + classical + simp only [Matrix.det_apply] + apply ContinuousCoeffs.sum + intro e _ + have hprod := ContinuousCoeffs.prod Finset.univ (fun i _ => hp (e i) i) + intro k + simp only [coeff_smul] + exact continuous_smul.comp (continuous_const.prodMk (hprod k)) + +/-- Integrating a uniformly bounded-degree polynomial coefficient by coefficient. -/ +def integralPolynomial {α : Type uα} [MeasurableSpace α] (μ : Measure α) + (p : α → Polynomial ℝ) (d : ℕ) : Polynomial ℝ := + ∑ k ∈ Finset.range (d+1), Polynomial.C (∫ x, (p x).coeff k ∂μ) * Polynomial.X^k + +lemma eval_integralPolynomial {α : Type uα} [MeasurableSpace α] (μ : Measure α) + (p : α → Polynomial ℝ) (d : ℕ) (hp : ∀ x, (p x).natDegree ≤ d) + (hi : ∀ k ≤ d, Integrable (fun x => (p x).coeff k) μ) (t : ℝ) : + (integralPolynomial μ p d).eval t = ∫ x, (p x).eval t ∂μ := by + have he (x : α) : (p x).eval t = ∑ k ∈ Finset.range (d+1), (p x).coeff k*t^k := by + exact Polynomial.eval_eq_sum_range' (Nat.lt_succ_of_le (hp x)) t + simp only [integralPolynomial, eval_finsetSum, eval_mul, eval_C, eval_pow, eval_X] + simp_rw [he] + rw [integral_finsetSum] + · apply Finset.sum_congr rfl + intro k hk + exact (integral_mul_const _ _).symm + · intro k hk + exact (hi k (Nat.le_of_lt_succ (Finset.mem_range.mp hk))).mul_const _ + +lemma exists_integral_det_polynomial {ι : Type uι} [Fintype ι] [DecidableEq ι] + {α : Type uα} [TopologicalSpace α] [MeasurableSpace α] [BorelSpace α] + (μ : Measure α) [IsFiniteMeasure μ] [CompactSpace α] + (A B : α → Matrix ι ι ℝ) (hA : Continuous A) (hB : Continuous B) : + ∃ p : Polynomial ℝ, ∀ t : ℝ, + p.eval t = ∫ x, (t • A x + B x).det ∂μ := by + let q : α → Polynomial ℝ := fun x => + Matrix.det ((Polynomial.X : Polynomial ℝ) • (A x).map Polynomial.C + (B x).map Polynomial.C) + have hq : ContinuousCoeffs q := by + apply ContinuousCoeffs.det + intro i j + apply ContinuousCoeffs.add + · exact (continuousCoeffs_const Polynomial.X).mul + (continuousCoeffs_C ((continuous_apply j).comp ((continuous_apply i).comp hA))) + · exact continuousCoeffs_C ((continuous_apply j).comp ((continuous_apply i).comp hB)) + have hdeg (x : α) : (q x).natDegree ≤ Fintype.card ι := + Polynomial.natDegree_det_X_add_C_le (A x) (B x) + refine ⟨integralPolynomial μ q (Fintype.card ι), fun t => ?_⟩ + rw [eval_integralPolynomial μ q _ hdeg (fun k _ => (by simpa only [integrableOn_univ] using (hq k).continuousOn.integrableOn_compact' (μ := μ) isCompact_univ MeasurableSet.univ))] + apply integral_congr_ae + filter_upwards with x + change Polynomial.eval t (Matrix.det _) = _ + change (Polynomial.evalRingHom t) _ = _ + rw [RingHom.map_det] + congr 1 + ext i j + simp only [RingHom.mapMatrix_apply, Matrix.map_apply, Matrix.add_apply, Matrix.smul_apply, smul_eq_mul, map_add, Polynomial.coe_evalRingHom, eval_mul, eval_X, eval_C] + +lemma exists_integralOn_det_polynomial {ι : Type uι} [Fintype ι] [DecidableEq ι] + {α : Type uα} [TopologicalSpace α] [MeasurableSpace α] [BorelSpace α] [T2Space α] + (μ : Measure α) [IsFiniteMeasureOnCompacts μ] {s : Set α} (hs : IsCompact s) + (A B : α → Matrix ι ι ℝ) (hA : ContinuousOn A s) (hB : ContinuousOn B s) : + ∃ p : Polynomial ℝ, ∀ t : ℝ, + p.eval t = ∫ x in s, (t • A x + B x).det ∂μ := by + let q : α → Polynomial ℝ := fun x => + Matrix.det ((Polynomial.X : Polynomial ℝ) • (A x).map Polynomial.C + (B x).map Polynomial.C) + have hq : ContinuousCoeffs (fun x : s => q x) := by + apply ContinuousCoeffs.det + intro i j + apply ContinuousCoeffs.add + · exact (continuousCoeffs_const Polynomial.X).mul + (continuousCoeffs_C ((continuous_apply j).comp ((continuous_apply i).comp + (continuousOn_iff_continuous_domRestrict.mp hA)))) + · exact continuousCoeffs_C ((continuous_apply j).comp ((continuous_apply i).comp + (continuousOn_iff_continuous_domRestrict.mp hB))) + have hdeg (x : α) : (q x).natDegree ≤ Fintype.card ι := + Polynomial.natDegree_det_X_add_C_le (A x) (B x) + refine ⟨integralPolynomial (μ.restrict s) q (Fintype.card ι), fun t => ?_⟩ + rw [eval_integralPolynomial (μ.restrict s) q _ hdeg + (fun k _ => ContinuousOn.integrableOn_compact hs + (continuousOn_iff_continuous_domRestrict.mpr (hq k)))] + apply integral_congr_ae + filter_upwards with x + change (Polynomial.evalRingHom t) (Matrix.det _) = _ + rw [RingHom.map_det] + congr 1 + ext i j + simp only [RingHom.mapMatrix_apply, Matrix.map_apply, Matrix.add_apply, Matrix.smul_apply, + smul_eq_mul, map_add, Polynomial.coe_evalRingHom, eval_mul, eval_X, eval_C] + +lemma exists_integralOn_clm_det_polynomial + {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] + {α : Type uα} [TopologicalSpace α] [MeasurableSpace α] [BorelSpace α] [T2Space α] + (μ : Measure α) [IsFiniteMeasureOnCompacts μ] {s : Set α} (hs : IsCompact s) + (A B : α → (E →L[ℝ] E)) (hA : ContinuousOn A s) (hB : ContinuousOn B s) : + ∃ p : Polynomial ℝ, ∀ t : ℝ, + p.eval t = ∫ x in s, (t • A x + B x).det ∂μ := by + classical + let b := Module.finBasis ℝ E + let M := (LinearMap.toMatrix b b).toLinearMap.comp (ContinuousLinearMap.coeLM ℝ) + have hM := M.continuous_of_finiteDimensional + obtain ⟨p,hp⟩ := exists_integralOn_det_polynomial μ hs + (fun x => M (A x)) (fun x => M (B x)) (hM.comp_continuousOn hA) (hM.comp_continuousOn hB) + refine ⟨p,fun t => (hp t).trans ?_⟩ + apply integral_congr_ae + filter_upwards with x + rw [← map_smul M,← map_add M] + exact LinearMap.det_toMatrix b _ + +end PettyProjection.FixedPoint +end + +noncomputable section +open Set Metric Function +open scoped NNReal +namespace PettyProjection.FixedPoint +variable {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + +lemma bijective_add_small {z : E → E} {C : ℝ≥0} (hz : LipschitzWith C z) + {t : ℝ} (ht : ‖t‖₊*C<1) : Bijective (fun x => x+t • z x) := by + have hc (y : E) : ContractingWith (‖t‖₊*C) (fun x => y-t • z x) := by + refine ⟨ht, ?_⟩ + apply LipschitzWith.of_dist_le_mul + intro x w + simp only [dist_sub_left, dist_smul₀, NNReal.coe_mul, coe_nnnorm] + calc + ‖t‖ * dist (z x) (z w) ≤ ‖t‖ * (C * dist x w) := + mul_le_mul_of_nonneg_left (hz.dist_le_mul x w) (norm_nonneg t) + _ = _ := by ring + constructor + · intro x y hxy + apply (hc (x+t • z x)).fixedPoint_unique' + · change x+t • z x-t • z x=x + abel + · change x+t • z x-t • z y=y + change x+t • z x=y+t • z y at hxy + rw [hxy] + abel + · intro y + obtain ⟨x,hx,-⟩ := (hc y).exists_fixedPoint (0:E) (edist_ne_top _ _) + refine ⟨x,?_⟩ + change y-t • z x=x at hx + exact eq_sub_iff_add_eq.mp hx.symm + +lemma image_ball_add_small {z : E → E} {C : ℝ≥0} (hz : LipschitzWith C z) + (hzero : ∀ x, 1≤‖x‖ → z x=0) {t : ℝ} (ht : ‖t‖₊*C<1) : + (fun x => x+t • z x) '' ball (0:E) 1 = ball (0:E) 1 := by + have hbi := bijective_add_small hz ht + have hout (x : E) (hx : x∉ball (0:E) 1) : x+t • z x=x := by + have hxn : 1≤‖x‖ := by simpa only [mem_ball,dist_zero_right,not_lt] using hx + rw [hzero x hxn,smul_zero,add_zero] + apply Subset.antisymm + · rintro y ⟨x,hx,rfl⟩ + by_contra hy + have he : x+t • z x=x := hbi.1 (hout (x+t • z x) hy) + exact hy (by change x+t • z x∈_; rw [he]; exact hx) + · intro y hy + obtain ⟨x,hxy⟩ := hbi.2 y + refine ⟨x,?_,hxy⟩ + by_contra hx + change x+t • z x=y at hxy + rw [hout x hx] at hxy + exact hx (hxy.symm ▸ hy) + +lemma image_closedBall_add_small {z : E → E} {C : ℝ≥0} (hz : LipschitzWith C z) + (hzero : ∀ x, 1≤‖x‖ → z x=0) {t : ℝ} (ht : ‖t‖₊*C<1) : + (fun x => x+t • z x) '' closedBall (0:E) 1 = closedBall (0:E) 1 := by + have hbi := bijective_add_small hz ht + have hout (x : E) (hx : x∉closedBall (0:E) 1) : x+t • z x=x := by + have hxn : 1<‖x‖ := by simpa only [mem_closedBall,dist_zero_right,not_le] using hx + rw [hzero x hxn.le,smul_zero,add_zero] + apply Subset.antisymm + · rintro y ⟨x,hx,rfl⟩ + by_contra hy + have he : x+t • z x=x := hbi.1 (hout (x+t • z x) hy) + exact hy (by change x+t • z x∈_; rw [he]; exact hx) + · intro y hy + obtain ⟨x,hxy⟩ := hbi.2 y + refine ⟨x,?_,hxy⟩ + by_contra hx + change x+t • z x=y at hxy + rw [hout x hx] at hxy + exact hx (hxy.symm ▸ hy) + +end PettyProjection.FixedPoint +end + +noncomputable section +open Set Metric Filter Topology +open scoped RealInnerProductSpace +namespace PettyProjection.FixedPoint + +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +lemma nearest_unique {K : Set E} {x p q : E} + (hp : ∀ z ∈ K, ⟪x-p,z-p⟫ ≤ 0) (hq : ∀ z ∈ K, ⟪x-q,z-q⟫ ≤ 0) + (hpK : p∈K) (hqK : q∈K) : p=q := by + have h1 := hp q hqK + have h2 := hq p hpK + have he : ⟪x-p,q-p⟫+⟪x-q,p-q⟫ = ‖p-q‖^2 := by + rw [← real_inner_self_eq_norm_sq] + simp only [inner_sub_left, inner_sub_right] + ring + have hn : ‖p-q‖^2 ≤ 0 := by linarith + have hz : ‖p-q‖=0 := by nlinarith [norm_nonneg (p-q)] + exact sub_eq_zero.mp (norm_eq_zero.mp hz) + +/-- The genuine nearest point; no fixed-point principle is used here. -/ +def nearest (K : Set E) (hne : K.Nonempty) (hcomplete : IsComplete K) + (hc : Convex ℝ K) (x : E) : E := + Classical.choose (exists_norm_eq_iInf_of_complete_convex hne hcomplete hc x) + +lemma nearest_mem (K : Set E) (hne : K.Nonempty) (hcomplete : IsComplete K) + (hc : Convex ℝ K) (x : E) : nearest K hne hcomplete hc x∈K := + (Classical.choose_spec (exists_norm_eq_iInf_of_complete_convex hne hcomplete hc x)).1 + +lemma nearest_inner (K : Set E) (hne : K.Nonempty) (hcomplete : IsComplete K) + (hc : Convex ℝ K) (x : E) : + ∀ z∈K, ⟪x-nearest K hne hcomplete hc x,z-nearest K hne hcomplete hc x⟫ ≤ 0 := + (norm_eq_iInf_iff_real_inner_le_zero hc (nearest_mem K hne hcomplete hc x)).mp + (Classical.choose_spec (exists_norm_eq_iInf_of_complete_convex hne hcomplete hc x)).2 + +lemma nearest_eq_of_mem (K : Set E) (hne : K.Nonempty) (hcomplete : IsComplete K) + (hc : Convex ℝ K) {x : E} (hx : x∈K) : nearest K hne hcomplete hc x=x := by + apply nearest_unique (nearest_inner K hne hcomplete hc x) _ + (nearest_mem K hne hcomplete hc x) hx + intro z hz + simp only [sub_self,inner_zero_left,le_refl] + +lemma nearest_eq_of_inner (K : Set E) (hne : K.Nonempty) (hcomplete : IsComplete K) + (hc : Convex ℝ K) {x p : E} (hp : p∈K) + (hi : ∀ z∈K,⟪x-p,z-p⟫≤0) : nearest K hne hcomplete hc x=p := + nearest_unique (nearest_inner K hne hcomplete hc x) hi + (nearest_mem K hne hcomplete hc x) hp + +lemma nearest_lipschitz (K : Set E) (hne : K.Nonempty) (hcomplete : IsComplete K) + (hc : Convex ℝ K) : LipschitzWith 1 (nearest K hne hcomplete hc) := by + apply LipschitzWith.of_dist_le_mul + intro x y + let p := nearest K hne hcomplete hc x + let q := nearest K hne hcomplete hc y + have h1 := nearest_inner K hne hcomplete hc x q (nearest_mem K hne hcomplete hc y) + have h2 := nearest_inner K hne hcomplete hc y p (nearest_mem K hne hcomplete hc x) + change ⟪x-p,q-p⟫≤0 at h1 + change ⟪y-q,p-q⟫≤0 at h2 + have he : ⟪x-p,q-p⟫+⟪y-q,p-q⟫ = ‖p-q‖^2-⟪x-y,p-q⟫ := by + rw [← real_inner_self_eq_norm_sq] + simp only [inner_sub_left,inner_sub_right] + ring + have hle : ‖p-q‖^2 ≤ ‖x-y‖*‖p-q‖ := by + have hcs := real_inner_le_norm (x-y) (p-q) + linarith + change dist p q ≤ (1:ℝ)*dist x y + simp only [one_mul,dist_eq_norm] + by_cases hz : ‖p-q‖=0 + · rw [hz]; exact norm_nonneg _ + · nlinarith [lt_of_le_of_ne (norm_nonneg (p-q)) (Ne.symm hz)] + +variable [CompleteSpace E] + +def ballNearest (x : E) : E := nearest (closedBall (0:E) 1) + (nonempty_closedBall.mpr (by norm_num)) isClosed_closedBall.isComplete (convex_closedBall _ _) x + +lemma ballNearest_mem (x : E) : ballNearest x∈closedBall (0:E) 1 := + nearest_mem _ _ _ _ x + +lemma ballNearest_eq {x : E} (hx : ‖x‖≤1) : ballNearest x=x := + nearest_eq_of_mem _ _ _ _ (by simpa only [mem_closedBall,dist_zero_right] using hx) + +lemma ballNearest_lipschitz : LipschitzWith 1 (ballNearest : E → E) := + nearest_lipschitz (closedBall (0:E) 1) + (nonempty_closedBall.mpr (by norm_num)) isClosed_closedBall.isComplete (convex_closedBall _ _) + +lemma ballNearest_norm {x : E} (hx : 1≤‖x‖) : ‖ballNearest x‖=1 := by + have hx0 : ‖x‖≠0 := by linarith + let p : E := ‖x‖⁻¹ • x + have hp : ‖p‖=1 := by simp [p,norm_smul,hx0] + have hxp : x=‖x‖ • p := by simp [p,hx0] + have he : ballNearest x=p := by + apply nearest_eq_of_inner (closedBall (0:E) 1) _ _ _ + · simpa only [mem_closedBall,dist_zero_right,hp] using le_rfl (a := (1:ℝ)) + · intro z hz + have hsub : x-p=(‖x‖-1) • p := by rw [sub_smul,one_smul,← hxp] + rw [hsub,inner_smul_left,inner_sub_right,real_inner_self_eq_norm_sq,hp] + have hcs := real_inner_le_norm p z + have hzn : ‖z‖≤1 := by simpa only [mem_closedBall,dist_zero_right] using hz + have hi : ⟪p,z⟫-1≤0 := by rw [hp,one_mul] at hcs; linarith + simpa using mul_nonpos_of_nonneg_of_nonpos (sub_nonneg.mpr hx) hi + rw [he,hp] + +end PettyProjection.FixedPoint +end + +noncomputable section +open Set Metric Filter Topology MeasureTheory +open scoped RealInnerProductSpace NNReal +namespace PettyProjection.FixedPoint +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] + +omit [FiniteDimensional ℝ E] in +lemma ball_uniqueDiff : UniqueDiffOn ℝ (closedBall (0:E) 1) := by + apply uniqueDiffOn_convex (convex_closedBall _ _) + rw [interior_closedBall (0:E) (by norm_num : (1:ℝ)≠0)] + exact nonempty_ball.mpr (by norm_num) + +lemma sphere_derivative_det_zero {r : E → E} {r' : E → E →L[ℝ] E} + (hd : ∀ x∈closedBall (0:E) 1, HasFDerivWithinAt r (r' x) (closedBall (0:E) 1) x) + (hnorm : ∀ x∈closedBall (0:E) 1, ‖r x‖=1) {x : E} (hx : x∈closedBall (0:E) 1) : + (r' x).det=0 := by + have hi := (hd x hx).inner ℝ (hd x hx) + have hc : HasFDerivWithinAt (fun y => ⟪r y,r y⟫) (0 : E →L[ℝ] ℝ) + (closedBall (0:E) 1) x := by + apply (hasFDerivWithinAt_const (1:ℝ) x (closedBall (0:E) 1)).congr + · intro y hy + change ⟪r y,r y⟫=1 + rw [real_inner_self_eq_norm_sq,hnorm y hy,one_pow] + · rw [real_inner_self_eq_norm_sq,hnorm x hx,one_pow] + have he := (ball_uniqueDiff x hx).eq hi hc + have hort (v : E) : ⟪r x,r' x v⟫=0 := by + have h := congrArg (fun L : E →L[ℝ] ℝ => L v) he + simp only [ContinuousLinearMap.comp_apply,ContinuousLinearMap.prod_apply, + fderivInnerCLM_apply,zero_apply] at h + have hsymm := real_inner_comm (r x) (r' x v) + linarith + change ((r' x) : E →ₗ[ℝ] E).det=0 + apply LinearMap.det_eq_zero_iff_ker_ne_bot.mpr + intro hker + have hsurj := (LinearMap.injective_iff_surjective).mp (LinearMap.ker_eq_bot.mp hker) + obtain ⟨v,hv⟩ := hsurj (r x) + change r' x v=r x at hv + have hz := hort v + rw [hv,real_inner_self_eq_norm_sq,hnorm x hx] at hz + norm_num at hz + +lemma retraction_extension {r : E → E} {r' : E → E →L[ℝ] E} + (hd : ∀ x∈closedBall (0:E) 1, HasFDerivWithinAt r (r' x) (closedBall (0:E) 1) x) + (hc : ContinuousOn r' (closedBall (0:E) 1)) + (hb : ∀ x : E, ‖x‖=1 → r x=x) : + ∃ (z : E → E) (C : ℝ≥0), LipschitzWith C z ∧ + (∀ x∈closedBall (0:E) 1, z x=r x-x) ∧ (∀ x,1≤‖x‖ → z x=0) := by + have hcN := hc.nnnorm + obtain ⟨C,hC⟩ := (isCompact_closedBall (0:E) 1).bddAbove_image hcN + have hr : LipschitzOnWith C r (closedBall (0:E) 1) := + (convex_closedBall _ _).lipschitzOnWith_of_nnnorm_hasFDerivWithin_le hd + (fun x hx => hC (mem_image_of_mem _ hx)) + let z : E → E := fun x => r (ballNearest x)-ballNearest x + refine ⟨z,C+1,?_,?_,?_⟩ + · apply LipschitzWith.of_dist_le_mul + intro x y + calc + dist (z x) (z y) ≤ dist (r (ballNearest x)) (r (ballNearest y)) + + dist (ballNearest x) (ballNearest y) := dist_sub_sub_le _ _ _ _ + _ ≤ C * dist (ballNearest x) (ballNearest y) + dist (ballNearest x) (ballNearest y) := + add_le_add (hr.dist_le_mul _ (ballNearest_mem x) _ (ballNearest_mem y)) le_rfl + _ = (C+1:ℝ) * dist (ballNearest x) (ballNearest y) := by ring + _ ≤ (C+1:ℝ) * dist x y := by + gcongr + simpa only [NNReal.coe_one,one_mul] using ballNearest_lipschitz.dist_le_mul x y + _ = _ := by simp only [NNReal.coe_add,NNReal.coe_one] + · intro x hx + have he : ballNearest x=x := ballNearest_eq (by simpa only [mem_closedBall,dist_zero_right] using hx) + simp only [z,he] + · intro x hx + simp only [z,hb _ (ballNearest_norm hx),sub_self] + +end PettyProjection.FixedPoint +end + +noncomputable section +open Set Metric Filter Topology MeasureTheory +open scoped RealInnerProductSpace NNReal +namespace PettyProjection.FixedPoint +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +omit [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma eventually_pos_det_homotopy {A : E → E →L[ℝ] E} {K : Set E} + (hK : IsCompact K) (hA : ContinuousOn A K) : + ∀ᶠ t : ℝ in 𝓝 0, ∀ x∈K, 0<(t • A x+ContinuousLinearMap.id ℝ E).det := by + let : CompactSpace K := isCompact_iff_compactSpace.mp hK + have hAc : Continuous (fun x : K => A x) := continuousOn_iff_continuous_domRestrict.mp hA + have hL : Continuous (fun z : ℝ × K => z.1 • A z.2+ContinuousLinearMap.id ℝ E) := by + exact continuous_add.comp ((continuous_smul.comp + (continuous_fst.prodMk (hAc.comp continuous_snd))).prodMk continuous_const) + have hD := ContinuousLinearMap.continuous_det.comp hL + have he : ∀ᶠ t : ℝ in 𝓝 0, ∀ x:K, 0<(t • A x+ContinuousLinearMap.id ℝ E).det := by + have hh := (isCompact_univ : IsCompact (univ : Set K)).eventually_forall_of_forall_eventually + (x₀ := (0:ℝ)) (P := fun t x => 0<(t • A x+ContinuousLinearMap.id ℝ E).det) + apply Filter.Eventually.mono (hh ?_) + · intro t ht x + exact ht x (mem_univ x) + · intro x hx + apply (hD.continuousAt (x := (0,x))).eventually + apply Ioi_mem_nhds + simp [ContinuousLinearMap.det] + filter_upwards [he] with t ht x hx + exact ht ⟨x,hx⟩ + +/-- Milnor's elementary determinant-polynomial obstruction to a differentiable +retraction of a ball onto its sphere. Only Jacobian change of variables and the +Banach contraction principle are needed. -/ +lemma no_smooth_retraction (μ : Measure E) [μ.IsAddHaarMeasure] + {r : E → E} {r' : E → E →L[ℝ] E} + (hd : ∀ x∈closedBall (0:E) 1, HasFDerivWithinAt r (r' x) (closedBall (0:E) 1) x) + (hc : ContinuousOn r' (closedBall (0:E) 1)) + (hnorm : ∀ x∈closedBall (0:E) 1, ‖r x‖=1) + (hb : ∀ x : E, ‖x‖=1 → r x=x) : False := by + let K := closedBall (0:E) 1 + let I : E →L[ℝ] E := ContinuousLinearMap.id ℝ E + obtain ⟨z,C,hz,hzK,hzout⟩ := retraction_extension hd hc hb + have hzD (x : E) (hx : x∈K) : HasFDerivWithinAt z (r' x-I) K x := by + apply ((hd x hx).sub (hasFDerivWithinAt_id x K)).congr + · intro y hy + exact hzK y hy + · exact hzK x hx + have hA : ContinuousOn (fun x => r' x-I) K := hc.sub continuousOn_const + obtain ⟨p,hp⟩ := exists_integralOn_clm_det_polynomial μ (isCompact_closedBall (0:E) 1) + (fun x => r' x-I) (fun _ => I) hA continuousOn_const + have hsmall : ∀ᶠ t : ℝ in 𝓝 0, ‖t‖₊*C<1 := by + have hh : Continuous (fun t : ℝ => ‖t‖₊*C) := by fun_prop + exact (hh.continuousAt (x := 0)).eventually (Iio_mem_nhds (by simp)) + have hpos := eventually_pos_det_homotopy (isCompact_closedBall (0:E) 1) hA + have he : ∀ᶠ t : ℝ in 𝓝 0, p.eval t=μ.real K := by + filter_upwards [hsmall,hpos] with t ht hpt + rw [hp] + have hFD (x : E) (hx : x∈K) : + HasFDerivWithinAt (fun x => x+t • z x) (t • (r' x-I)+I) K x := by + convert ((hzD x hx).const_smul t).add (hasFDerivWithinAt_id x K) using 1 + ext y + simp only [Pi.add_apply,Pi.smul_apply,id_eq,add_comm] + have hJac := integral_image_eq_integral_abs_det_fderiv_smul μ isClosed_closedBall.measurableSet + hFD (bijective_add_small hz ht).1.injOn (fun _ : E => (1:ℝ)) + rw [image_closedBall_add_small hz hzout ht] at hJac + have heq : (∫ x in K, |(t • (r' x-I)+I).det| • (1:ℝ) ∂μ) = + ∫ x in K, (t • (r' x-I)+I).det ∂μ := by + apply setIntegral_congr_fun isClosed_closedBall.measurableSet + intro x hx + change |(t • (r' x-I)+I).det| • (1:ℝ)=(t • (r' x-I)+I).det + rw [abs_of_pos (hpt x hx)] + simp only [smul_eq_mul,mul_one,I] + rw [heq] at hJac + simpa only [integral_const,smul_eq_mul,mul_one,Measure.real,Measure.restrict_apply_univ,K] using hJac.symm + have hpoly : p=Polynomial.C (μ.real K) := by + apply Polynomial.eq_of_infinite_eval_eq + apply infinite_of_mem_nhds (0:ℝ) + change {t | p.eval t=μ.real K}∈𝓝 (0:ℝ) at he + simpa only [Polynomial.eval_C] using he + have hzero : p.eval 1=0 := by + rw [hp] + calc + (∫ x in closedBall (0:E) 1, ((1:ℝ) • (r' x-I)+I).det ∂μ) = + ∫ _ in closedBall (0:E) 1, (0:ℝ) ∂μ := by + apply setIntegral_congr_fun isClosed_closedBall.measurableSet + intro x hx + change ((1:ℝ) • (r' x-I)+I).det=0 + simp only [one_smul,sub_add_cancel] + exact sphere_derivative_det_zero hd hnorm hx + _ = 0 := integral_zero _ _ + rw [hpoly,Polynomial.eval_C] at hzero + have hpositive : 0<μ.real K := by + exact ENNReal.toReal_pos (ne_of_gt (measure_closedBall_pos μ (0:E) zero_lt_one)) + (measure_closedBall_lt_top.ne) + linarith + +end PettyProjection.FixedPoint +end + +end OAI diff --git a/lean/OAI/Geometry/ProjectionBodies/GaussianMeasures.lean b/lean/OAI/Geometry/ProjectionBodies/GaussianMeasures.lean new file mode 100644 index 0000000000000000000000000000000000000000..30d5c001b6745f15db79707f3b2fcf9cd9e42340 --- /dev/null +++ b/lean/OAI/Geometry/ProjectionBodies/GaussianMeasures.lean @@ -0,0 +1,260 @@ +import OAI.Geometry.ProjectionBodies.Brouwer + +namespace OAI + +noncomputable section +open Set MeasureTheory Metric Filter Topology Function +open scoped ENNReal NNReal RealInnerProductSpace +namespace PettyProjection +open Spherical (Sphere norm_coe surface sigma mean) + +/-- The actual one-dimensional radial Gaussian moment. -/ +def gaussianRadial (d : ℕ) : ℝ := ∫ r in Ioi (0:ℝ),r^d*Real.exp (-(r^2)) + +lemma gaussianRadial_eq (d : ℕ) : gaussianRadial d=(1/2:ℝ)*Real.Gamma (((d:ℝ)+1)/2) := by + simpa only [gaussianRadial,Real.rpow_natCast,Real.rpow_two] using + integral_rpow_mul_exp_neg_rpow (p := (2:ℝ)) (q := (d:ℝ)) (by norm_num) (by linarith [Nat.cast_nonneg (α := ℝ) d]) + +lemma gaussianRadial_pos (d : ℕ) : 0 (r^m).toNNReal • (r^k*Real.exp (-(r^2))))] + unfold gaussianRadial + apply setIntegral_congr_fun measurableSet_Ioi + intro x hx + dsimp only + rw [NNReal.smul_def,Real.coe_toNNReal _ (pow_nonneg hx.le _),pow_add] + ring + · exact (measurable_subtype_coe.pow_const _).real_toNNReal + +lemma surface_integral_eq_mean {n : ℕ} [NeZero n] (f : Sphere n → ℝ) : + (∫ u,f u ∂surface n)=(n:ℝ)*kappa n*mean f := by + rw [mean,sigma,integral_smul_measure,ENNReal.toReal_inv,smul_eq_mul] + change _=(n:ℝ)*kappa n*(((surface n).real univ)⁻¹* _) + rw [surface_real_univ] + field_simp [(kappa_pos n).ne',(Nat.cast_pos.mpr (NeZero.pos n) : (0:ℝ) f u)*gaussianRadial (n-1+k) := by + let F : Space n → ℝ := fun x => f x*Real.exp (-(‖x‖^2)) + let ν := Measure.volumeIoiPow (Module.finrank ℝ (Space n)-1) + have he : (∫ x,F x)=∫ x : ({0}ᶜ : Set (Space n)),F x ∂volume.comap Subtype.val := by + rw [integral_subtype_comap (measurableSet_singleton _).compl,restrict_compl_singleton] + rw [show (∫ x,f x*Real.exp (-(‖x‖^2)))=∫ x,F x from rfl,he] + have hm := (volume : Measure (Space n)).measurePreserving_homeomorphUnitSphereProd + rw [← (hm.symm (homeomorphUnitSphereProd (Space n)).toMeasurableEquiv).integral_comp + (homeomorphUnitSphereProd (Space n)).symm.measurableEmbedding (fun x => F x)] + have hfun : (fun z : Sphere n × Ioi (0:ℝ) => F ↑((homeomorphUnitSphereProd (Space n)).symm z))= + (fun z => f z.1*(z.2.val^k*Real.exp (-(z.2.val^2)))) := by + funext z + rw [homeomorphUnitSphereProd_symm_apply_coe] + dsimp only [F] + rw [hh _ z.2.property,norm_smul,Real.norm_of_nonneg z.2.property.le,norm_coe,mul_one] + ring + change (∫ z : Sphere n × Ioi (0:ℝ),F ↑((homeomorphUnitSphereProd (Space n)).symm z) ∂(surface n).prod ν)=_ + rw [hfun] + rw [integral_prod_mul (fun u : Sphere n => f u) (fun r : Ioi (0:ℝ) => r.val^k*Real.exp (-(r.val^2))), + surface_integral_eq_mean] + dsimp only [ν] + rw [integral_radial_gaussian] + simp only [finrank_euclideanSpace_fin] + +end PettyProjection +end + +noncomputable section +open Set MeasureTheory Metric Filter Topology +open scoped NNReal RealInnerProductSpace +namespace PettyProjection +variable {n : ℕ} + +lemma norm_integrable_map {μ : Measure (Space n)} + (hμ : Integrable (fun x : Space n => ‖x‖) μ) (A : Space n →L[ℝ] Space n) : + Integrable (fun x : Space n => ‖x‖) (μ.map A) := by + apply (integrable_map_measure continuous_norm.aestronglyMeasurable A.continuous.measurable.aemeasurable).mpr + exact (hμ.const_mul ‖A‖).mono' (continuous_norm.comp A.continuous).aestronglyMeasurable + (Eventually.of_forall (fun x => by simpa only [Function.comp_apply,Real.norm_eq_abs,abs_norm] using A.le_opNorm x)) + +lemma cosine_map (μ : Measure (Space n)) (hμ : Integrable (fun x : Space n => ‖x‖) μ) + (A : Space n →L[ℝ] Space n) (x : Space n) : + cosineSeminorm (μ.map A) (norm_integrable_map hμ A) x=cosineSeminorm μ hμ (A.adjoint x) := by + change (∫ y,|⟪y,x⟫| ∂μ.map A)=∫ y,|⟪y,A.adjoint x⟫| ∂μ + rw [integral_map A.continuous.measurable.aemeasurable (by fun_prop)] + congr 1 + funext y + rw [ContinuousLinearMap.adjoint_inner_right] + +lemma adjoint_ne_zero_on_range (A : Space n →L[ℝ] Space n) {x : Space n} + (hx : x∈LinearMap.range A.toLinearMap) (hx0 : x≠0) : A.adjoint x≠0 := by + intro h + obtain ⟨y,rfl⟩ := hx + change A.adjoint (A y)=0 at h + change A y≠0 at hx0 + have hh := ContinuousLinearMap.adjoint_inner_right A y (A y) + rw [h,inner_zero_right,real_inner_self_eq_norm_sq] at hh + exact hx0 (norm_eq_zero.mp (by nlinarith [norm_nonneg (A y)])) + +lemma cosine_map_pos {μ : Measure (Space n)} + (hμ : Integrable (fun x : Space n => ‖x‖) μ) + (hq : ∀ x : Space n,x≠0 → 0 ‖x‖) μ) (A : Space n →L[ℝ] Space n) (x : Space n) : + cosineSeminorm (μ.map A) (norm_integrable_map hμ A) + ((LinearMap.range A.toLinearMap).starProjection x)= + cosineSeminorm (μ.map A) (norm_integrable_map hμ A) x := by + change (∫ y,|⟪y,(LinearMap.range A.toLinearMap).starProjection x⟫| ∂μ.map A)=∫ y,|⟪y,x⟫| ∂μ.map A + rw [integral_map A.continuous.measurable.aemeasurable (by fun_prop), + integral_map A.continuous.measurable.aemeasurable (by fun_prop)] + congr 1 + funext y + rw [← Submodule.inner_starProjection_left_eq_right, + (LinearMap.range A.toLinearMap).starProjection_eq_self_iff.mpr + (show A y∈LinearMap.range A.toLinearMap from ⟨y,rfl⟩)] + +lemma functional_map_continuous {μ : Measure (Space n)} + (hμ : Integrable (fun x : Space n => ‖x‖) μ) {K : Set (Space n)} + (hK : IsCompact K) (hne : K.Nonempty) : + Continuous (fun A : Space n →L[ℝ] Space n => supportFunctional (μ.map A) K) := by + simp_rw [functional_map _ hK] + obtain ⟨R,hR,hbound⟩ := hK.isBounded.exists_pos_norm_le + have hlip := support_lipschitz hK hne (R := ⟨R,hR.le⟩) hbound + apply continuous_iff_continuousAt.mpr + intro A + apply continuousAt_of_dominated (bound := fun x => R*(‖A‖+1)*‖x‖) <;> try infer_instance + · filter_upwards [] with B + exact (support_continuous hK).aestronglyMeasurable.comp_measurable B.continuous.measurable + · filter_upwards [continuous_norm.continuousAt.eventually (gt_mem_nhds (show ‖A‖<‖A‖+1 by linarith))] with B hB + filter_upwards [] with x + have hz : support K 0=0 := by + obtain ⟨z,hz,he⟩ := support_attained hK hne 0 + simpa only [inner_zero_left] using he + have hh := hlip.norm_sub_le (B x) 0 + rw [hz,sub_zero,sub_zero] at hh + exact hh.trans ((mul_le_mul_of_nonneg_left (B.le_opNorm x) hR.le).trans + (by + calc + R*(‖B‖*‖x‖) ≤ R*((‖A‖+1)*‖x‖) := mul_le_mul_of_nonneg_left + (mul_le_mul_of_nonneg_right hB.le (norm_nonneg _)) hR.le + _ = R*(‖A‖+1)*‖x‖ := by ring)) + · exact hμ.const_mul (R*(‖A‖+1)) + · filter_upwards [] with x + exact ((support_continuous hK).comp (by fun_prop : Continuous (fun B : Space n →L[ℝ] Space n => B x))).continuousAt + +end PettyProjection +end + +noncomputable section +open Set MeasureTheory Metric Filter Topology +open scoped NNReal RealInnerProductSpace Pointwise +namespace PettyProjection +open Spherical (seminorm_continuous) +variable {n : ℕ} + +def projectedUnit (V : Submodule ℝ (Space n)) (g : Seminorm ℝ (Space n)) : Set (Space n) := + closure (V.starProjection '' seminormUnit g) + +lemma projectedUnit_sub (V : Submodule ℝ (Space n)) (g : Seminorm ℝ (Space n)) : + projectedUnit V g⊆V := by + apply closure_minimal _ V.closed_of_finiteDimensional + rintro _ ⟨x,_,rfl⟩ + exact V.starProjection_apply_mem x + +lemma projectedUnit_convex (V : Submodule ℝ (Space n)) (g : Seminorm ℝ (Space n)) : + Convex ℝ (projectedUnit V g) := (seminormUnit_convex g).linear_image V.starProjection.toLinearMap |>.closure + +lemma projectedUnit_balanced (V : Submodule ℝ (Space n)) (g : Seminorm ℝ (Space n)) : + Balanced ℝ (projectedUnit V g) := by + apply Balanced.closure + intro a ha y hy + obtain ⟨z,⟨w,hw,rfl⟩,rfl⟩ := hy + refine ⟨a • w,(seminormUnit_balanced g) a ha ⟨w,hw,rfl⟩,?_⟩ + exact map_smul V.starProjection a w + +lemma projectedUnit_inner (V : Submodule ℝ (Space n)) (g : Seminorm ℝ (Space n)) : + ∃ r : ℝ,0 subset_closure ⟨x,hin ?_,?_⟩⟩ + · rw [mem_ball,dist_zero_right]; linarith + · exact V.starProjection_eq_self_iff.mpr hx + +lemma projectedUnit_compact (V : Submodule ℝ (Space n)) (g : Seminorm ℝ (Space n)) + {c : ℝ} (hc : 0 (inv_pos.mpr (hfp s hs)).le + have he := intervalIntegral.integral_comp_mul_deriv_of_deriv_nonneg + (g := fun x => x*f x) hQc.continuousOn hdu hpu + rw [hQ0,hQ1] at he + refine (intervalIntegral.integral_congr_ae_restrict ?_).trans he + rw [uIoc_of_le (by norm_num : (0:ℝ) ≤ 1),← Measure.restrict_congr_set Ioo_ae_eq_Ioc] + filter_upwards [ae_restrict_mem measurableSet_Ioo] with s hs + simp [(hfp s hs).ne'] + +/-- Equality in slice transport forces the two full marginal distributions to +be translates. In particular both projection endpoints differ by the difference +of their first moments. -/ +theorem slice_transport_equality {m : ℕ} (hm : 0 < m) {a b l r L R : ℝ} + (ha : 0 < a) (hb : 0 < b) (hab : a+b=1) (hlr : l a*Q s+b*P s + let z' : ℝ → ℝ := fun s => a/(f (Q s))+b/(g (P s)) + have hzc : Continuous z := by dsimp [z]; fun_prop + have hzd : ∀ s ∈ Ioo (0:ℝ) 1, HasDerivAt z (z' s) s := by + intro s hs + convert ((hQd s hs).2.const_mul a).add ((hPd s hs).2.const_mul b) using 1 + all_goals rfl + have hzp : ∀ s ∈ Ioo (0:ℝ) 1, 0 (hzp s hs).le + have hint : IntervalIntegrable (fun s => h (z s)*z' s) volume 0 1 := + (intervalIntegral.integrable_comp_mul_deriv_iff_of_deriv_nonneg hzc.continuousOn hzdu hzpu).mpr hhi + have hsub := intervalIntegral.integral_comp_mul_deriv_of_deriv_nonneg + (g := h) hzc.continuousOn hzdu hzpu + change (∫ s in (0:ℝ)..1, h (z s)*z' s) = _ at hsub + have hpt : ∀ s ∈ Ioo (0:ℝ) 1, 1 ≤ h (z s)*z' s := by + intro s hs + let p := (f (Q s))^((m:ℝ)⁻¹) + let q := (g (P s))^((m:ℝ)⁻¹) + have hp : 0